Files
jak-project/goal_src/jak2/engine/util/script.gc
T
Tyler Wilding 82e0517275 d/jak2: get script decompiling, no ref tests yet (#1877)
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!
2022-09-14 19:37:12 -04:00

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
)
)
)