jak-project/test/goalc/source_templates/with_game/test-fancy-static-fields.gc

31 lines
982 B
Common Lisp
Raw Normal View History

(deftype basic-field-test-bitfield (int32)
((f1 uint8 :offset 0 :size 1)
(f2 uint8 :offset 1 :size 1)
(f3 uint8 :offset 2 :size 1)
)
)
(deftype basic-field-test-type (basic)
((name string)
(kc kernel-context)
(kci kernel-context :inline)
(pos float)
(bf int32)
(list pair))
)
(let ((obj (new 'static 'basic-field-test-type
:pos 12.34
:list '(a b c )
:name "name"
:bf (new 'static 'basic-field-test-bitfield :f1 1 :f3 1)
:kc (new 'static 'kernel-context :next-pid 12)
:kci (new 'static 'kernel-context :low-memory-message 'asdf :relocating-min 33))))
(format #t "~A ~D ~f ~A ~D" (-> obj name) (-> obj kc next-pid) (-> obj pos) (-> obj list) (-> obj bf))
(format #t " ~D ~D ~A ~A~%"
(-> obj kci relocating-min)
(logand 15 (the int (-> obj kci)))
(-> obj kci type)
(-> obj kci low-memory-message))
)