mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-21 17:47:44 -04:00
21fbdce7aa
* add the ability to define and read bitfield types * new set * add bitfield setting * add static bitfields
13 lines
409 B
Common Lisp
13 lines
409 B
Common Lisp
(deftype test-bf-type7 (int64)
|
|
((f1 uint16 :offset 0)
|
|
(f2 uint8 :size 7 :offset 16)
|
|
(f3 float :offset 23)
|
|
(f4 uint8 :size 1 :offset 55)
|
|
(f5 uint8 :offset 56)
|
|
)
|
|
)
|
|
|
|
(let ((temp (new 'static 'test-bf-type7 :f1 #x12 :f2 #x13 :f3 12.3433 :f4 #x1)))
|
|
(format #t "~A" (eq? 0 (-> temp f5))) ; check it gets truncated
|
|
(format #t "~f~%" (+ (-> temp f3) (-> temp f2) (-> temp f1) (-> temp f4)))
|
|
) |