[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
+1 -6
View File
@@ -789,12 +789,7 @@
(set! (-> this surf) *gravel-surface*)
)
(((pat-event rail))
(let* ((s4-0 (-> this process))
(a0-14 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(let ((a0-14 (the-as process-drawable (as-type (-> this process) process-focusable))))
(if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status))))
(set! (-> this surf) *rail-surface*)
)
+6 -24
View File
@@ -207,20 +207,11 @@
(when (and (logtest? (process-mask crate enemy collectable guard) (-> arg0 mask))
(not (logtest? (process-mask no-track) (-> arg0 mask)))
)
(let* ((gp-0 *search-info*)
(s4-0 arg0)
(s5-0 (if (type? s4-0 process-drawable)
s4-0
)
)
)
(let ((gp-0 *search-info*)
(s5-0 (as-type arg0 process-drawable))
)
(when s5-0
(let* ((s4-1 (-> s5-0 root))
(s3-0 (if (type? s4-1 collide-shape)
s4-1
)
)
)
(let ((s3-0 (the-as trsqv (as-type (-> s5-0 root) collide-shape))))
(when s3-0
(let* ((s4-2 (the-as structure (-> (the-as collide-shape s3-0) root-prim prim-core)))
(f30-0 (- (vector-vector-distance (-> gp-0 point) (-> (the-as collide-prim-core s4-2) world-sphere))
@@ -228,12 +219,7 @@
)
)
)
(let* ((s1-0 s5-0)
(s2-0 (if (type? s1-0 process-focusable)
s1-0
)
)
)
(let ((s2-0 (the-as process-drawable (as-type s5-0 process-focusable))))
(if (and (type? s2-0 process-focusable)
s2-0
s2-0
@@ -407,11 +393,7 @@
(while (begin (label cfg-89) (nonzero? s4-0))
(+! s4-0 -1)
(let* ((s1-0 (-> arg0 s4-0))
(s2-0 (-> s1-0 process))
(s3-0 (if (type? s2-0 process-focusable)
s2-0
)
)
(s3-0 (the-as process-drawable (as-type (-> s1-0 process) process-focusable)))
)
(when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead))))
(and (logtest? (process-mask crate enemy collectable guard) (-> s3-0 mask))
+3 -13
View File
@@ -12,21 +12,11 @@
(-> this src-proc)
(or process (-> this dst-proc))
)
(let* ((process-source (handle->process (-> this src-proc)))
(process-focus (if (type? process-source process-focusable)
(the-as process-focusable process-source)
)
)
)
(let ((process-focus (as-type (handle->process (-> this src-proc)) process-focusable)))
(when process-focus
(when (not process)
(let ((process-dest (handle->process (-> this dst-proc))))
(set! process (if (type? process-dest process-focusable)
(the-as process-focusable process-dest)
)
)
(if (not process)
(set! process (as-type (handle->process (-> this dst-proc)) process-focusable))
)
)
(when process
(let ((start-pos (new 'stack-no-clear 'vector)))
(set! (-> start-pos quad) (-> (get-trans process-focus 3) quad))