From a79b59ed68214420bdd25d7e2ec0bbf5759ab6e0 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Sun, 19 Jun 2022 15:17:42 +0100 Subject: [PATCH] `progress` and `progress-draw` PAL patches --- decompiler/config/jak1_pal.jsonc | 10 +- decompiler/config/jak1_pal/hacks.jsonc | 5 +- decompiler/config/jak1_pal/label_types.jsonc | 148 +++++++++--------- goal_src/engine/game/task/process-taskable.gc | 1 - goal_src/engine/ui/progress/progress-draw.gc | 25 ++- goal_src/engine/ui/progress/progress.gc | 16 +- goal_src/engine/ui/text.gc | 1 + goal_src/levels/beach/mayor.gc | 1 + goal_src/levels/snow/snow-flutflut-obs.gc | 1 + 9 files changed, 115 insertions(+), 93 deletions(-) diff --git a/decompiler/config/jak1_pal.jsonc b/decompiler/config/jak1_pal.jsonc index a3bcbfe18e..413d9dc953 100644 --- a/decompiler/config/jak1_pal.jsonc +++ b/decompiler/config/jak1_pal.jsonc @@ -6,7 +6,7 @@ // if you want to filter to only some object names. // it will make the decompiler much faster. - "allowed_objects": ["gsound-h", "gsound", "rollingcam-ag", "pusher-ag", "happy-plant-ag", "dark-plant-ag", "rolling-start-ag"], + "allowed_objects": [], "banned_objects": [], //////////////////////////// @@ -33,11 +33,11 @@ "disassemble_data": false, // unpack textures to assets folder - "process_tpages": false, + "process_tpages": true, // unpack game text to assets folder - "process_game_text": false, + "process_game_text": true, // unpack game count to assets folder - "process_game_count": false, + "process_game_count": true, // write goal imports for art groups "process_art_groups": true, @@ -61,7 +61,7 @@ "hexdump_code": false, "hexdump_data": false, // dump raw obj files - "dump_objs": false, + "dump_objs": true, // print control flow graph "print_cfgs": false, diff --git a/decompiler/config/jak1_pal/hacks.jsonc b/decompiler/config/jak1_pal/hacks.jsonc index adfdbd4b01..4c8465a0ac 100644 --- a/decompiler/config/jak1_pal/hacks.jsonc +++ b/decompiler/config/jak1_pal/hacks.jsonc @@ -497,7 +497,10 @@ "(method 49 progress)": [[35, 1]], "(method 37 progress)": [[41, 1]], "(method 38 progress)": [[106, 1]], - "(method 39 progress)": [[41, 1]], + "(method 39 progress)": [ + [56, 1], + [83, 1] + ], "(method 41 progress)": [[73, 1]], "(method 42 progress)": [[41, 1]], "(method 43 progress)": [ diff --git a/decompiler/config/jak1_pal/label_types.jsonc b/decompiler/config/jak1_pal/label_types.jsonc index e84976ffd2..bf5b071280 100644 --- a/decompiler/config/jak1_pal/label_types.jsonc +++ b/decompiler/config/jak1_pal/label_types.jsonc @@ -428,80 +428,6 @@ "assistant": [["L71", "vector"]], - "progress": [ - ["L667", "uint64", true], - ["L586", "float", true], - ["L587", "float", true], - ["L588", "float", true], - ["L589", "float", true], - ["L590", "float", true], - ["L591", "float", true], - ["L592", "float", true], - ["L593", "float", true], - ["L594", "float", true], - ["L595", "float", true], - ["L596", "float", true], - ["L597", "float", true], - ["L598", "float", true], - ["L599", "float", true], - ["L600", "float", true], - ["L601", "float", true], - ["L602", "float", true], - ["L603", "float", true], - ["L604", "float", true], - ["L605", "float", true], - ["L606", "float", true], - ["L607", "float", true], - ["L608", "float", true], - ["L609", "float", true], - ["L610", "float", true], - ["L611", "float", true], - ["L612", "float", true], - ["L613", "float", true], - ["L614", "float", true], - ["L615", "float", true], - ["L617", "float", true], - ["L616", "float", true], - ["L618", "float", true], - ["L619", "float", true], - ["L620", "float", true], - ["L621", "float", true], - ["L622", "float", true], - ["L623", "float", true], - ["L624", "float", true], - ["L625", "float", true], - ["L626", "float", true], - ["L627", "float", true], - ["L628", "float", true], - ["L629", "float", true], - ["L630", "float", true], - ["L631", "float", true], - ["L632", "float", true], - ["L633", "float", true], - ["L634", "float", true], - ["L635", "float", true], - ["L583", "vector"], - ["L581", "vector"], - ["L579", "vector"], - ["L577", "vector"], - ["L573", "vector"], - ["L575", "vector"], - ["L636", "uint64", true], - ["L637", "uint64", true], - ["L638", "uint64", true], - ["L639", "uint64", true], - ["L640", "uint64", true], - ["L641", "uint64", true], - ["L642", "uint64", true], - ["L643", "uint64", true], - ["L644", "uint64", true], - ["L645", "uint64", true], - ["L646", "uint64", true], - ["L647", "uint64", true], - ["L648", "uint64", true], - ["L649", "uint64", true] - ], - "target-part": [ ["L336", "float", true], ["L337", "float", true], @@ -2147,6 +2073,80 @@ ["L361", "float", true] ], + "progress": [ + ["L576", "vector"], + ["L578", "vector"], + ["L580", "vector"], + ["L582", "vector"], + ["L584", "vector"], + ["L586", "vector"], + ["L589", "float", true], + ["L590", "float", true], + ["L591", "float", true], + ["L592", "float", true], + ["L593", "float", true], + ["L594", "float", true], + ["L595", "float", true], + ["L596", "float", true], + ["L597", "float", true], + ["L598", "float", true], + ["L599", "float", true], + ["L600", "float", true], + ["L601", "float", true], + ["L602", "float", true], + ["L603", "float", true], + ["L604", "float", true], + ["L605", "float", true], + ["L606", "float", true], + ["L607", "float", true], + ["L608", "float", true], + ["L609", "float", true], + ["L610", "float", true], + ["L611", "float", true], + ["L612", "float", true], + ["L613", "float", true], + ["L614", "float", true], + ["L615", "float", true], + ["L617", "float", true], + ["L616", "float", true], + ["L618", "float", true], + ["L619", "float", true], + ["L620", "float", true], + ["L621", "float", true], + ["L622", "float", true], + ["L623", "float", true], + ["L624", "float", true], + ["L625", "float", true], + ["L626", "float", true], + ["L627", "float", true], + ["L628", "float", true], + ["L629", "float", true], + ["L630", "float", true], + ["L631", "float", true], + ["L632", "float", true], + ["L633", "float", true], + ["L634", "float", true], + ["L635", "float", true], + ["L636", "float", true], + ["L637", "float", true], + ["L638", "float", true], + ["L639", "uint64", true], + ["L640", "uint64", true], + ["L641", "uint64", true], + ["L642", "uint64", true], + ["L643", "uint64", true], + ["L644", "uint64", true], + ["L645", "uint64", true], + ["L646", "uint64", true], + ["L647", "uint64", true], + ["L648", "uint64", true], + ["L649", "uint64", true], + ["L650", "uint64", true], + ["L651", "uint64", true], + ["L652", "uint64", true], + ["L670", "uint64", true] + ], + // please do not add things after this entry! git is dumb. "object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": [] } diff --git a/goal_src/engine/game/task/process-taskable.gc b/goal_src/engine/game/task/process-taskable.gc index 4d12da0e80..2d7f8bff9d 100644 --- a/goal_src/engine/game/task/process-taskable.gc +++ b/goal_src/engine/game/task/process-taskable.gc @@ -44,7 +44,6 @@ (none) ) - (defmethod get-response gui-query ((obj gui-query)) (kill-current-level-hint '() '(sidekick voicebox stinger) 'exit) (level-hint-surpress!) diff --git a/goal_src/engine/ui/progress/progress-draw.gc b/goal_src/engine/ui/progress/progress-draw.gc index 04d4e02de7..43867915f3 100644 --- a/goal_src/engine/ui/progress/progress-draw.gc +++ b/goal_src/engine/ui/progress/progress-draw.gc @@ -598,16 +598,27 @@ (let ((v1-5 arg0)) (set! (-> v1-5 height) (the float 110)) ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id insert-memcard) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + ;; PAL patch here + (let ((v1-6 (-> obj card-info))) + (when (and (= (-> *setting-control* default language) (language-enum japanese)) v1-6 (zero? (-> v1-6 handle))) + (set! (-> arg0 origin y) -15.0) + (let ((s4-0 print-game-text-scaled)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id memcard-not-inserted) #f) 1) + (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + ) + (set! (-> arg0 origin y) 53.0) + ) ) - (let ((v1-7 arg0)) - (set! (-> v1-7 scale) 0.65) + (let ((s4-1 print-game-text-scaled)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id insert-memcard) #f) 1) + (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + ) + (let ((v1-12 arg0)) + (set! (-> v1-12 scale) 0.65) ) (set! (-> arg0 origin y) 130.0) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 60)) + (let ((v1-13 arg0)) + (set! (-> v1-13 height) (the float 60)) ) (print-game-text-scaled (lookup-text! *common-text* (game-text-id back?) #f) diff --git a/goal_src/engine/ui/progress/progress.gc b/goal_src/engine/ui/progress/progress.gc index 68a50db5c8..2d11204840 100644 --- a/goal_src/engine/ui/progress/progress.gc +++ b/goal_src/engine/ui/progress/progress.gc @@ -49,6 +49,7 @@ (not (send-event (handle->process (-> *game-info* auto-save-proc)) 'progress-allowed?)) ) (not *target*) + (= *cheat-mode* 'camera) ) ) ) @@ -1067,12 +1068,17 @@ (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-creating)) ) + ;; PAL patch here + ((and (= (-> obj display-state-stack 0) (progress-screen title)) (zero? (scf-get-territory))) + (sound-play "cursor-options") + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set-master-mode 'game) + ) (else (sound-play "cursor-options") - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) + (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) @@ -1163,7 +1169,7 @@ (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-formatting)) ) - ((= (-> obj display-state-stack 0) (progress-screen title)) + ((and (= (-> obj display-state-stack 0) (progress-screen title)) (zero? (scf-get-territory))) (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) diff --git a/goal_src/engine/ui/text.gc b/goal_src/engine/ui/text.gc index 40d8da302e..4bfe2cd031 100644 --- a/goal_src/engine/ui/text.gc +++ b/goal_src/engine/ui/text.gc @@ -507,6 +507,7 @@ ) ) (else + ;; PAL patch here (if (= sv-176 3) (set! sv-176 32) ) diff --git a/goal_src/levels/beach/mayor.gc b/goal_src/levels/beach/mayor.gc index 4c944ad532..84c109de5a 100644 --- a/goal_src/levels/beach/mayor.gc +++ b/goal_src/levels/beach/mayor.gc @@ -69,6 +69,7 @@ (close-specific-task! (game-task jungle-lurkerm) (task-status need-reward-speech)) (first-any (-> arg0 tasks) #t) ) + ;; PAL patch here (new 'static 'spool-anim :name "mayor-resolution-beams" :index 7 diff --git a/goal_src/levels/snow/snow-flutflut-obs.gc b/goal_src/levels/snow/snow-flutflut-obs.gc index 723a91a7ff..09403e80ee 100644 --- a/goal_src/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/levels/snow/snow-flutflut-obs.gc @@ -414,6 +414,7 @@ (set! (-> obj prev-button) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> obj prev-button) #f) ) + ;; PAL patch here (set! (-> obj trying-for-fuel-cell?) (not (task-complete? *game-info* (game-task snow-ball)))) (ja-channel-set! 1) (let ((s5-1 (-> obj skel root-channel 0)))