From 3802bb731af9cc9fbe724408ef9ca93bfaa2f583 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Wed, 2 Jun 2021 00:50:37 -0400 Subject: [PATCH] decomp: finalized `credits` --- .../jak1_ntsc_black_label/stack_vars.jsonc | 4 ++-- goal_src/engine/game/game-save.gc | 2 ++ goal_src/engine/game/main.gc | 3 +++ goal_src/engine/ui/credits.gc | 19 ++++++------------- goal_src/engine/ui/text-h.gc | 15 ++++++++------- .../reference/all_forward_declarations.gc | 5 +++++ .../reference/engine/ui/credits_REF.gc | 17 ++++------------- 7 files changed, 30 insertions(+), 35 deletions(-) diff --git a/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc index 1c5a6c6dd1..00e6934066 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc @@ -256,10 +256,10 @@ ], "draw-end-credits": [ - [16, "symbol"] + [16, "font-context"] ], "draw-title-credits": [ - [16, "symbol"] + [16, "font-context"] ] } diff --git a/goal_src/engine/game/game-save.gc b/goal_src/engine/game/game-save.gc index ed1c1e761e..00d590e4a2 100644 --- a/goal_src/engine/game/game-save.gc +++ b/goal_src/engine/game/game-save.gc @@ -5,3 +5,5 @@ ;; name in dgo: game-save ;; dgos: GAME, ENGINE +;; TODO - for credits +(define-extern print-game-text (function string font-context symbol int int float)) ; TODO decomp error, this seems correct though diff --git a/goal_src/engine/game/main.gc b/goal_src/engine/game/main.gc index a84f5de33b..067d1c59b3 100644 --- a/goal_src/engine/game/main.gc +++ b/goal_src/engine/game/main.gc @@ -9,3 +9,6 @@ "Are we in a movie?" (nonzero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) ) + +;; TODO - for credits +(define-extern scf-get-territory (function int)) diff --git a/goal_src/engine/ui/credits.gc b/goal_src/engine/ui/credits.gc index e6f2ba3760..3471dafb7f 100644 --- a/goal_src/engine/ui/credits.gc +++ b/goal_src/engine/ui/credits.gc @@ -30,6 +30,7 @@ (set! (-> *font-work* color-table 32 color v1-0 b) (the int f0-8)) ) ) + (none) ) ;; definition for symbol *title-credits-scale*, type (array float) @@ -56,9 +57,9 @@ (f30-0 (* arg0 (the float (+ s4-0 -2)))) (s5-0 (the int f30-0)) (gp-0 - ((method-of-type font-context new) - (new 'stack-no-clear 'symbol) - font-context + (new + 'stack + 'font-context *font-default-matrix* 0 0 @@ -135,6 +136,7 @@ ) ) ) + (none) ) ;; definition for function draw-end-credits @@ -148,16 +150,7 @@ (s3-0 0) (s2-0 #t) (s5-0 - ((method-of-type font-context new) - (new 'stack-no-clear 'symbol) - font-context - *font-default-matrix* - 31 - 0 - 0.0 - 0 - (the-as uint 3) - ) + (new 'stack 'font-context *font-default-matrix* 31 0 0.0 0 (the-as uint 3)) ) ) (let ((v1-2 s5-0)) diff --git a/goal_src/engine/ui/text-h.gc b/goal_src/engine/ui/text-h.gc index 701e401809..a60b49ef7f 100644 --- a/goal_src/engine/ui/text-h.gc +++ b/goal_src/engine/ui/text-h.gc @@ -22,16 +22,16 @@ ;; A table of all strings. (deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name string :offset-assert 12) - (data game-text :dynamic :inline :offset-assert 16) + ((length int32 :offset-assert 4) + (language-id int32 :offset-assert 8) + (group-name string :offset-assert 12) + (data game-text :inline :dynamic :offset-assert 16) ) :method-count-assert 10 :size-assert #x10 :flag-assert #xa00000010 (:methods - (dummy-9 () none 9) + (dummy-9 (_type_ uint symbol) string 9) ) ) @@ -39,5 +39,6 @@ (define *text-group-names* (new 'static 'boxed-array string 1 "common")) (define *common-text-heap* (new 'global 'kheap)) -;; probably some other type. -(define *common-text* #f) + +;; definition for symbol *common-text*, type game-text-info +(define *common-text* (the-as game-text-info #f)) diff --git a/test/decompiler/reference/all_forward_declarations.gc b/test/decompiler/reference/all_forward_declarations.gc index 63b8b56722..e62882847e 100644 --- a/test/decompiler/reference/all_forward_declarations.gc +++ b/test/decompiler/reference/all_forward_declarations.gc @@ -718,3 +718,8 @@ vec ) ) + +;; TODO - for credits +(define-extern scf-get-territory (function int)) +(declare-type font-context basic) +(define-extern print-game-text (function string font-context symbol int int float)) ; TODO decomp error, this seems correct though diff --git a/test/decompiler/reference/engine/ui/credits_REF.gc b/test/decompiler/reference/engine/ui/credits_REF.gc index ded33d1899..8e4060ee20 100644 --- a/test/decompiler/reference/engine/ui/credits_REF.gc +++ b/test/decompiler/reference/engine/ui/credits_REF.gc @@ -55,9 +55,9 @@ (f30-0 (* arg0 (the float (+ s4-0 -2)))) (s5-0 (the int f30-0)) (gp-0 - ((method-of-type font-context new) - (new 'stack-no-clear 'symbol) - font-context + (new + 'stack + 'font-context *font-default-matrix* 0 0 @@ -150,16 +150,7 @@ (s3-0 0) (s2-0 #t) (s5-0 - ((method-of-type font-context new) - (new 'stack-no-clear 'symbol) - font-context - *font-default-matrix* - 31 - 0 - 0.0 - 0 - (the-as uint 3) - ) + (new 'stack 'font-context *font-default-matrix* 31 0 0.0 0 (the-as uint 3)) ) ) (let ((v1-2 s5-0))