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!
This commit is contained in:
Tyler Wilding
2022-09-14 19:37:12 -04:00
committed by GitHub
parent 8117ed3bc7
commit 82e0517275
34 changed files with 635 additions and 2973 deletions
+1 -1
View File
@@ -2005,7 +2005,7 @@
(when s4-0
(let ((gp-1 (-> arg3 param 0)))
(set! (-> *syntax-context* got-error?) #f)
(eval! *syntax-context* (the-as structure gp-1))
(eval! *syntax-context* gp-1)
(when (not (-> *syntax-context* got-error?))
(set! (-> s4-0 changed) #t)
(cond
+18 -1
View File
@@ -684,7 +684,24 @@
)
;; definition for function debug-menu-func-decode
;; ERROR: function was not converted to expressions. Cannot decompile.
;; WARN: Return type mismatch object vs function.
;; WARN: Using new Jak 2 rtype-of
(defun debug-menu-func-decode ((arg0 object))
(let ((v1-2 (rtype-of arg0)))
(the-as function (cond
((or (= v1-2 symbol) (= v1-2 type))
(-> (the-as symbol arg0) value)
)
((= v1-2 function)
arg0
)
(else
nothing
)
)
)
)
)
;; definition for function debug-menu-make-from-template
;; INFO: Used lq/sq