[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
+6 -20
View File
@@ -100,11 +100,7 @@
(s5-0 (/ (the-as int (car (cdr a0-1))) 8))
(s4-0 (car (cdr (cdr a0-1))))
(s3-0 (car (cdr (cdr (cdr a0-1)))))
(s2-0 (-> (the-as symbol v1-0) value))
(v1-1 (if (type? s2-0 level-load-info)
(the-as level-load-info s2-0)
)
)
(v1-1 (as-type (-> (the-as symbol v1-0) value) level-load-info))
)
(when v1-1
(set! (-> v1-1 borrow-level s5-0) (the-as symbol s4-0))
@@ -1456,15 +1452,9 @@
)
)
(set! (-> gp-0 origin x) 120.0)
(let ((v1-7 gp-0))
(set! (-> v1-7 scale) 0.7)
)
(let ((v1-8 gp-0))
(set! (-> v1-8 width) (the float 300))
)
(let ((v1-9 gp-0))
(set! (-> v1-9 height) (the float 35))
)
(set-scale! gp-0 0.7)
(set-width! gp-0 300)
(set-height! gp-0 35)
(set! (-> gp-0 flags) (font-flags shadow kerning middle middle-vert large))
(let ((s4-0 (if (logtest? (-> this flags) (fail-mission-flags famflags-2))
(the-as int (-> this fail-message))
@@ -1480,16 +1470,12 @@
)
)
(when (= (-> this message) (fail-mission-message fammsg-1))
(let ((v1-17 gp-0))
(set! (-> v1-17 height) (the float 95))
)
(set-height! gp-0 95)
(let ((s5-1 print-game-text))
(format (clear *temp-string*) (lookup-text! *common-text* (text-id try-again?) #f) 1)
(s5-1 *temp-string* gp-0 #f 44 (bucket-id progress))
)
(let ((v1-19 gp-0))
(set! (-> v1-19 height) (the float 155))
)
(set-height! gp-0 155)
(let ((s5-2 print-game-text))
(format (clear *temp-string*) (lookup-text! *common-text* (text-id yes-no-prompt) #f) 1)
(s5-2 *temp-string* gp-0 #f 44 (bucket-id progress))