[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
+8 -22
View File
@@ -218,13 +218,9 @@
)
(-> (the-as pair (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) car)
(-> (the-as pair (-> (the-as pair (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) cdr)) car)
(let* ((s3-0 (-> (the-as symbol v1-0) value))
(v1-1 (if (type? s3-0 level-load-info)
s3-0
)
)
(a0-11 (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr))
)
(let ((v1-1 (as-type (-> (the-as symbol v1-0) value) level-load-info))
(a0-11 (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr))
)
(when (and v1-1 (-> (the-as level-load-info v1-1) borrow))
(case s5-0
(('alias)
@@ -2350,15 +2346,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 params flags) (resetter-flag text-message))
(the-as int (-> this params text-message))
@@ -2374,16 +2364,12 @@
)
)
(when (= (-> this params message) (resetter-message mission-fail-or-retry))
(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 text-008b) #f) 1)
(s5-1 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha))
)
(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 text-0081) #f) 1)
(s5-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha))