[decompiler] as-type and font method support (#3855)

Add support for `as-type` macro, and detecting inline font methods. This
works in all three games but I've only updated jak 3's goal_src for now.
Eventually I will go back and work through the others, but I want to get
more decompiler features in first.


![image](https://github.com/user-attachments/assets/5c31bf85-97b4-437c-bc4b-dc054e60551e)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
water111
2025-02-01 21:23:11 -05:00
committed by GitHub
parent d5590ab638
commit 48cb9bb787
645 changed files with 5391 additions and 16694 deletions
@@ -538,12 +538,7 @@
(remove! a0-3)
)
)
(let* ((s5-0 (-> this root))
(a0-5 (if (type? s5-0 collide-shape)
s5-0
)
)
)
(let ((a0-5 (the-as trsqv (as-type (-> this root) collide-shape))))
(when a0-5
(let ((a2-0 (-> (the-as collide-shape a0-5) actor-hash-index))
(v1-12 *actor-hash*)
@@ -578,12 +573,7 @@
(if (-> self entity)
(logior! (-> self entity extra perm status) (entity-perm-status error))
)
(let* ((s5-0 (-> self root))
(v1-6 (if (type? s5-0 collide-shape)
s5-0
)
)
)
(let ((v1-6 (the-as trsqv (as-type (-> self root) collide-shape))))
(when v1-6
(let ((a0-5 (-> (the-as collide-shape v1-6) root-prim)))
(set! (-> a0-5 prim-core collide-as) (collide-spec))
@@ -715,12 +705,7 @@
(-> arg1 light-index)
)
)
(let* ((gp-1 (ppointer->process (-> arg0 parent)))
(v1-54 (if (type? gp-1 process-drawable)
gp-1
)
)
)
(let ((v1-54 (the-as process-tree (as-type (ppointer->process (-> arg0 parent)) process-drawable))))
(when (and v1-54 (nonzero? (-> (the-as process-drawable v1-54) draw)))
(set! (-> s2-0 light-index) (-> (the-as process-drawable v1-54) draw light-index))
(set! (-> s2-0 shadow-mask) (-> (the-as process-drawable v1-54) draw shadow-mask))
@@ -1884,14 +1869,9 @@
;; WARN: Return type mismatch object vs process-focusable.
(defbehavior find-offending-process-focusable process-drawable ((arg0 process-tree) (arg1 attack-info))
(let ((s5-0 (the-as object #f)))
(when (and arg1 (logtest? (-> arg1 mask) (attack-mask attacker)))
(let ((s4-0 (handle->process (-> arg1 attacker))))
(set! s5-0 (if (type? s4-0 process-focusable)
s4-0
)
)
(if (and arg1 (logtest? (-> arg1 mask) (attack-mask attacker)))
(set! s5-0 (the-as object (as-type (handle->process (-> arg1 attacker)) process-focusable)))
)
)
(when (not (the-as process s5-0))
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))