Skip to content

Commit

Permalink
decomp: finalized credits
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser committed Jun 2, 2021
1 parent 4a7ee7d commit 3802bb7
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 35 deletions.
4 changes: 2 additions & 2 deletions decompiler/config/jak1_ntsc_black_label/stack_vars.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@
],

"draw-end-credits": [
[16, "symbol"]
[16, "font-context"]
],

"draw-title-credits": [
[16, "symbol"]
[16, "font-context"]
]
}
2 changes: 2 additions & 0 deletions goal_src/engine/game/game-save.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions goal_src/engine/game/main.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
19 changes: 6 additions & 13 deletions goal_src/engine/ui/credits.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -135,6 +136,7 @@
)
)
)
(none)
)

;; definition for function draw-end-credits
Expand All @@ -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))
Expand Down
15 changes: 8 additions & 7 deletions goal_src/engine/ui/text-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,23 @@

;; 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)
)
)

;; todo, need support for array
(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))
5 changes: 5 additions & 0 deletions test/decompiler/reference/all_forward_declarations.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 4 additions & 13 deletions test/decompiler/reference/engine/ui/credits_REF.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 3802bb7

Please sign in to comment.