mirror of
https://github.com/open-goal/jak-project
synced 2026-06-15 06:31:22 -04:00
82e0517275
Has boxed array accessing that prevents me from adding anything to ref tests (the entire file is lambdas so the access pattern that i would like to ignore happens at the top-level, can't ignore it. This code actually already has quite a bit of original docstrings so it's not too bad in that regard considering a `script-context` can have 16 arbitrary objects. It seems they rarely put more than a single object in the context and the types are usually obvious / are actually type checked!
47 lines
735 B
Common Lisp
47 lines
735 B
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: script.gc
|
|
;; name in dgo: script
|
|
;; dgos: ENGINE, GAME
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(defun command-get-int ((arg0 object) (arg1 int))
|
|
(cond
|
|
((null? arg0)
|
|
(empty)
|
|
arg1
|
|
)
|
|
((type? arg0 binteger)
|
|
(the-as int (/ (the-as int arg0) 8))
|
|
)
|
|
((type? arg0 bfloat)
|
|
(the int (-> (the-as bfloat arg0) data))
|
|
)
|
|
(else
|
|
(empty)
|
|
arg1
|
|
)
|
|
)
|
|
)
|
|
|
|
(defun command-get-float ((arg0 object) (arg1 float))
|
|
(cond
|
|
((null? arg0)
|
|
(empty)
|
|
arg1
|
|
)
|
|
((type? arg0 binteger)
|
|
(the float (/ (the-as int arg0) 8))
|
|
)
|
|
((type? arg0 bfloat)
|
|
(-> (the-as bfloat arg0) data)
|
|
)
|
|
(else
|
|
(empty)
|
|
arg1
|
|
)
|
|
)
|
|
)
|