From 0d4e3928ebc031c25a863dee9dd7ade58ead7b52 Mon Sep 17 00:00:00 2001 From: Matt Dallmeyer Date: Mon, 29 Apr 2024 11:23:31 -0700 Subject: [PATCH] decomp3 `title-obs`, `credits-h` (#3476) --- decompiler/config/jak3/all-types.gc | 566 +++- .../ntsc_v1/anonymous_function_types.jsonc | 6 + decompiler/config/jak3/ntsc_v1/hacks.jsonc | 9 +- decompiler/config/jak3/ntsc_v1/inputs.jsonc | 16 +- .../config/jak3/ntsc_v1/label_types.jsonc | 3 + .../jak3/ntsc_v1/stack_structures.jsonc | 10 +- .../config/jak3/ntsc_v1/type_casts.jsonc | 12 +- decompiler/level_extractor/extract_merc.cpp | 7 +- .../jak3/engine/game/task/task-control-h.gc | 2 +- goal_src/jak3/engine/gfx/blit-displays.gc | 4 + goal_src/jak3/engine/target/target-death.gc | 4 +- goal_src/jak3/engine/target/target-h.gc | 2 +- goal_src/jak3/engine/target/target2.gc | 2 +- goal_src/jak3/engine/ui/text-h.gc | 433 +++ goal_src/jak3/game.gp | 14 +- goal_src/jak3/levels/title/credits-h.gc | 441 +++ goal_src/jak3/levels/title/credits.gc | 1 - goal_src/jak3/levels/title/title-obs.gc | 2599 ++++++++++++++++ .../engine/game/task/task-control-h_REF.gc | 2 +- .../jak3/engine/target/target-death_REF.gc | 7 +- .../jak3/engine/target/target-h_REF.gc | 2 +- .../jak3/engine/target/target2_REF.gc | 3 +- .../jak3/levels/title/credits-h_REF.gc | 440 +++ .../jak3/levels/title/credits_REF.gc | 9 + .../jak3/levels/title/title-obs_REF.gc | 2762 +++++++++++++++++ test/offline/config/jak3/config.jsonc | 3 +- 26 files changed, 7252 insertions(+), 107 deletions(-) create mode 100644 test/decompiler/reference/jak3/levels/title/credits-h_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/title/credits_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/title/title-obs_REF.gc diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 9ee070274d..9789786c27 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -8879,6 +8879,202 @@ (text-020c #x020c) (text-020d #x020d) (progress-continue #x020e) + (credits-020f #x020f) + (credits-0211 #x0211) + (credits-0212 #x0212) + (credits-0213 #x0213) + (credits-0214 #x0214) + (credits-0215 #x0215) + (credits-0216 #x0216) + (credits-0217 #x0217) + (credits-0218 #x0218) + (credits-0219 #x0219) + (credits-021a #x021a) + (credits-021b #x021b) + (credits-021d #x021d) + (credits-021e #x021e) + (credits-0221 #x0221) + (credits-0222 #x0222) + (credits-0223 #x0223) + (credits-0224 #x0224) + (credits-0226 #x0226) + (credits-0227 #x0227) + (credits-0228 #x0228) + (credits-022a #x022a) + (credits-022b #x022b) + (credits-022c #x022c) + (credits-022d #x022d) + (credits-0230 #x0230) + (credits-0231 #x0231) + (credits-0232 #x0232) + (credits-0234 #x0234) + (credits-0235 #x0235) + (credits-0239 #x0239) + (credits-023a #x023a) + (credits-023b #x023b) + (credits-023c #x023c) + (credits-023e #x023e) + (credits-023f #x023f) + (credits-0243 #x0243) + (credits-0245 #x0245) + (credits-024a #x024a) + (credits-024c #x024c) + (credits-024e #x024e) + (credits-024f #x024f) + (credits-0250 #x0250) + (credits-0252 #x0252) + (credits-0253 #x0253) + (credits-0254 #x0254) + (credits-0255 #x0255) + (credits-0256 #x0256) + (credits-0257 #x0257) + (credits-0259 #x0259) + (credits-025e #x025e) + (credits-0261 #x0261) + (credits-0262 #x0262) + (credits-0263 #x0263) + (credits-0264 #x0264) + (credits-0265 #x0265) + (credits-0266 #x0266) + (credits-0267 #x0267) + (credits-0268 #x0268) + (credits-026d #x026d) + (credits-026e #x026e) + (credits-026f #x026f) + (credits-0270 #x0270) + (credits-0273 #x0273) + (credits-0274 #x0274) + (credits-0275 #x0275) + (credits-0276 #x0276) + (credits-0279 #x0279) + (credits-027a #x027a) + (credits-027b #x027b) + (credits-027c #x027c) + (credits-0281 #x0281) + (credits-0282 #x0282) + (credits-0283 #x0283) + (credits-0284 #x0284) + (credits-028e #x028e) + (credits-0290 #x0290) + (credits-0293 #x0293) + (credits-0294 #x0294) + (credits-0295 #x0295) + (credits-0296 #x0296) + (credits-029b #x029b) + (credits-02a5 #x02a5) + (credits-02a8 #x02a8) + (credits-02a9 #x02a9) + (credits-02aa #x02aa) + (credits-02ab #x02ab) + (credits-02ac #x02ac) + (credits-02ae #x02ae) + (credits-02b0 #x02b0) + (credits-02b2 #x02b2) + (credits-02b4 #x02b4) + (credits-02b7 #x02b7) + (credits-02b8 #x02b8) + (credits-02ba #x02ba) + (credits-02bb #x02bb) + (credits-02bc #x02bc) + (credits-02be #x02be) + (credits-02c0 #x02c0) + (credits-02c2 #x02c2) + (credits-02c3 #x02c3) + (credits-02c4 #x02c4) + (credits-02c6 #x02c6) + (credits-02c8 #x02c8) + (credits-02c9 #x02c9) + (credits-02cc #x02cc) + (credits-02cd #x02cd) + (credits-02ce #x02ce) + (credits-02cf #x02cf) + (credits-02d4 #x02d4) + (credits-02d6 #x02d6) + (credits-02db #x02db) + (credits-02e0 #x02e0) + (credits-02e1 #x02e1) + (credits-02ea #x02ea) + (credits-02ed #x02ed) + (credits-02f4 #x02f4) + (credits-02f5 #x02f5) + (credits-02f6 #x02f6) + (credits-02f7 #x02f7) + (credits-02f8 #x02f8) + (credits-02f9 #x02f9) + (credits-02fa #x02fa) + (credits-02fb #x02fb) + (credits-02fc #x02fc) + (credits-02fd #x02fd) + (credits-02fe #x02fe) + (credits-02ff #x02ff) + (credits-0300 #x0300) + (credits-0301 #x0301) + (credits-0302 #x0302) + (credits-0303 #x0303) + (credits-0304 #x0304) + (credits-0305 #x0305) + (credits-0306 #x0306) + (credits-0307 #x0307) + (credits-0324 #x0324) + (credits-0347 #x0347) + (credits-0348 #x0348) + (credits-0349 #x0349) + (credits-034a #x034a) + (credits-034b #x034b) + (credits-034c #x034c) + (credits-034d #x034d) + (credits-034f #x034f) + (credits-0351 #x0351) + (credits-0352 #x0352) + (credits-0356 #x0356) + (credits-0358 #x0358) + (credits-0359 #x0359) + (credits-035d #x035d) + (credits-035e #x035e) + (credits-035f #x035f) + (credits-0360 #x0360) + (credits-0361 #x0361) + (credits-0363 #x0363) + (credits-0364 #x0364) + (credits-0365 #x0365) + (credits-0366 #x0366) + (credits-0367 #x0367) + (credits-0368 #x0368) + (credits-036a #x036a) + (credits-036c #x036c) + (credits-036d #x036d) + (credits-036e #x036e) + (credits-036f #x036f) + (credits-0370 #x0370) + (credits-0379 #x0379) + (credits-037d #x037d) + (credits-037e #x037e) + (credits-037f #x037f) + (credits-0380 #x0380) + (credits-0382 #x0382) + (credits-0383 #x0383) + (credits-0384 #x0384) + (credits-0385 #x0385) + (credits-0386 #x0386) + (credits-0387 #x0387) + (credits-0388 #x0388) + (credits-038a #x038a) + (credits-038b #x038b) + (credits-038d #x038d) + (credits-0391 #x0391) + (credits-0393 #x0393) + (credits-0394 #x0394) + (credits-0395 #x0395) + (credits-0396 #x0396) + (credits-0397 #x0397) + (credits-0398 #x0398) + (credits-0399 #x0399) + (credits-039a #x039a) + (credits-039c #x039c) + (credits-039f #x039f) + (credits-03a1 #x03a1) + (credits-03b5 #x03b5) + (credits-03be #x03be) (text-03bf #x03bf) (text-03c0 #x03c0) (text-03c1 #x03c1) @@ -8891,6 +9087,23 @@ (progress-missions-todo-icon #x03c8) (progress-missions-complete-icon #x03c9) (text-03d1 #x03d1) + (credits-03e4 #x03e4) + (credits-03e5 #x03e5) + (credits-03e7 #x03e7) + (credits-03ef #x03ef) + (credits-03f1 #x03f1) + (credits-03f3 #x03f3) + (credits-03f4 #x03f4) + (credits-03f5 #x03f5) + (credits-03f6 #x03f6) + (credits-03fc #x03fc) + (credits-03fd #x03fd) + (credits-03fe #x03fe) + (credits-03ff #x03ff) + (credits-0400 #x0400) + (credits-0401 #x0401) + (credits-0403 #x0403) + (credits-0404 #x0404) (text-0408 #x0408) (text-0409 #x0409) (text-040a #x040a) @@ -8898,6 +9111,7 @@ (text-040c #x040c) (text-040d #x040d) (text-040e #x040e) + (credits-040f #x040f) (progress-missions-mine-explore #x0443) (progress-missions-mine-blow #x0444) (progress-missions-forest-turn-on-machine #x0445) @@ -9320,6 +9534,25 @@ (progress-inventory-v-rhino #x06c8) (progress-inventory-v-mirage #x06c9) (progress-inventory-v-x-ride #x06ca) + (credits-06cb #x06cb) + (credits-06cc #x06cc) + (credits-06cd #x06cd) + (credits-06ce #x06ce) + (credits-06cf #x06cf) + (credits-06d0 #x06d0) + (credits-06d1 #x06d1) + (credits-06d2 #x06d2) + (credits-06d3 #x06d3) + (credits-06d4 #x06d4) + (credits-06d5 #x06d5) + (credits-06d6 #x06d6) + (credits-06d7 #x06d7) + (credits-06d8 #x06d8) + (credits-06d9 #x06d9) + (credits-06da #x06da) + (credits-06db #x06db) + (credits-06dc #x06dc) + (credits-06dd #x06dd) (text-06de #x06de) (text-06df #x06df) (progress-inventory-gun-red-1 #x06e0) @@ -9370,6 +9603,103 @@ (text-070d #x070d) (text-070e #x070e) (text-070f #x070f) + (credits-0710 #x0710) + (credits-0711 #x0711) + (credits-0712 #x0712) + (credits-0713 #x0713) + (credits-0714 #x0714) + (credits-0715 #x0715) + (credits-0716 #x0716) + (credits-0717 #x0717) + (credits-0718 #x0718) + (credits-0719 #x0719) + (credits-071a #x071a) + (credits-071b #x071b) + (credits-071c #x071c) + (credits-071d #x071d) + (credits-071e #x071e) + (credits-071f #x071f) + (credits-0720 #x0720) + (credits-0721 #x0721) + (credits-0722 #x0722) + (credits-0723 #x0723) + (credits-0724 #x0724) + (credits-0725 #x0725) + (credits-0726 #x0726) + (credits-0727 #x0727) + (credits-0728 #x0728) + (credits-0729 #x0729) + (credits-072a #x072a) + (credits-072b #x072b) + (credits-072c #x072c) + (credits-072d #x072d) + (credits-072e #x072e) + (credits-072f #x072f) + (credits-0730 #x0730) + (credits-0731 #x0731) + (credits-0732 #x0732) + (credits-0733 #x0733) + (credits-0734 #x0734) + (credits-0735 #x0735) + (credits-0736 #x0736) + (credits-0737 #x0737) + (credits-0738 #x0738) + (credits-0739 #x0739) + (credits-073a #x073a) + (credits-073b #x073b) + (credits-073c #x073c) + (credits-073d #x073d) + (credits-073e #x073e) + (credits-0740 #x0740) + (credits-0742 #x0742) + (credits-0743 #x0743) + (credits-0744 #x0744) + (credits-0746 #x0746) + (credits-0747 #x0747) + (credits-0748 #x0748) + (credits-0749 #x0749) + (credits-074a #x074a) + (credits-074b #x074b) + (credits-074c #x074c) + (credits-074d #x074d) + (credits-074e #x074e) + (credits-074f #x074f) + (credits-0750 #x0750) + (credits-0751 #x0751) + (credits-0752 #x0752) + (credits-0753 #x0753) + (credits-0754 #x0754) + (credits-0755 #x0755) + (credits-0756 #x0756) + (credits-0757 #x0757) + (credits-0758 #x0758) + (credits-0759 #x0759) + (credits-075a #x075a) + (credits-075b #x075b) + (credits-075c #x075c) + (credits-075d #x075d) + (credits-075e #x075e) + (credits-075f #x075f) + (credits-0760 #x0760) + (credits-0761 #x0761) + (credits-0762 #x0762) + (credits-0763 #x0763) + (credits-0764 #x0764) + (credits-0766 #x0766) + (credits-0767 #x0767) + (credits-0768 #x0768) + (credits-0769 #x0769) + (credits-076a #x076a) + (credits-076b #x076b) + (credits-076c #x076c) + (credits-076d #x076d) + (credits-076e #x076e) + (credits-076f #x076f) + (credits-0770 #x0770) + (credits-0771 #x0771) + (credits-0772 #x0772) + (credits-0773 #x0773) + (credits-0774 #x0774) (text-0775 #x0775) (text-0776 #x0776) (scene-catacomb-get-shield #x0778) @@ -9377,10 +9707,54 @@ (mission-fail-marauders-escaped #x077a) (text-077b #x077b) (text-077c #x077c) + (credits-077d #x077d) + (credits-077e #x077e) + (credits-077f #x077f) + (credits-0780 #x0780) + (credits-0781 #x0781) + (credits-0782 #x0782) + (credits-0783 #x0783) (talk-to-kleiver #x078d) + (credits-078f #x078f) + (credits-0790 #x0790) + (credits-0791 #x0791) + (credits-0792 #x0792) + (credits-0793 #x0793) + (credits-0794 #x0794) + (credits-0795 #x0795) + (credits-0796 #x0796) + (credits-0797 #x0797) + (credits-0798 #x0798) + (credits-0799 #x0799) + (credits-079a #x079a) + (credits-079b #x079b) + (credits-079c #x079c) + (credits-079d #x079d) + (credits-079e #x079e) + (credits-079f #x079f) + (credits-07a0 #x07a0) + (credits-07a1 #x07a1) + (credits-07a2 #x07a2) + (credits-07a3 #x07a3) + (credits-07a4 #x07a4) + (credits-07a5 #x07a5) + (credits-07a6 #x07a6) + (credits-07a7 #x07a7) + (credits-07a8 #x07a8) + (credits-07a9 #x07a9) + (credits-07aa #x07aa) + (credits-07ab #x07ab) + (credits-07ac #x07ac) + (credits-07ad #x07ad) + (credits-07ae #x07ae) + (credits-07af #x07af) + (credits-07b0 #x07b0) + (credits-07b1 #x07b1) + (credits-07b2 #x07b2) (progress-secrets-unlimited-turbos #x07b3) (text-07b4 #x07b4) (text-07b5 #x07b5) + (credits-07b6 #x07b6) (progress-language-portuguese #x07b8) (text-07b9 #x07b9) (text-07ba #x07ba) @@ -9394,8 +9768,12 @@ (text-07c2 #x07c2) (text-07c3 #x07c3) (text-07c4 #x07c4) + (credits-07c5 #x07c5) + (credits-07c6 #x07c6) (progress-language-commentary #x07c7) (progress-language-dutch #x07c8) + (credits-07c9 #x07c9) + (credits-07ca #x07ca) (progress-inventory #x07cb) (text-07cc #x07cc) (text-07cd #x07cd) @@ -9428,6 +9806,17 @@ (text-07e8 #x07e8) (text-07e9 #x07e9) (progress-secrets-kleever-diaper #x07ea) + (credits-07eb #x07eb) + (credits-07ec #x07ec) + (credits-07ed #x07ed) + (credits-07ee #x07ee) + (credits-07ef #x07ef) + (credits-07f0 #x07f0) + (credits-07f1 #x07f1) + (credits-07f2 #x07f2) + (credits-07f3 #x07f3) + (credits-07f4 #x07f4) + (credits-07f5 #x07f5) (text-07f6 #x07f6) (text-07f7 #x07f7) (text-07f8 #x07f8) @@ -9452,6 +9841,14 @@ (progress-controls-crouch-uppercut #x080b) (progress-controls-pad-triangle-4 #x080c) (progress-controls-dark-invis #x080d) + (credits-080e #x080e) + (credits-080f #x080f) + (credits-0810 #x0810) + (credits-0811 #x0811) + (credits-0812 #x0812) + (credits-0813 #x0813) + (credits-0814 #x0814) + (credits-0815 #x0815) (text-0816 #x0816) (text-0817 #x0817) (text-0818 #x0818) @@ -9514,10 +9911,16 @@ (progress-secrets-button-invis #x0851) (progress-secrets-cancel #x0852) (progress-secrets-buy #x0853) + (credits-0854 #x0854) + (credits-0855 #x0855) (progress-secrets-price #x0856) (text-0857 #x0857) (text-0858 #x0858) (text-085a #x085a) + (credits-085b #x085b) + (credits-085c #x085c) + (credits-085d #x085d) + (credits-085e #x085e) (text-085f #x085f) (text-0860 #x0860) (text-0861 #x0861) @@ -9550,12 +9953,15 @@ (progress-highscores-clank-gun-course #x087e) (progress-highscores-eco-grid-game #x087f) (progress-highscores-marauder-challenge #x0880) + (credits-0881 #x0881) + (credits-0882 #x0882) (progress-controls-pad-l2-lanalog #x0883) (progress-controls-board-grab #x0884) (text-0885 #x0885) (text-0886 #x0886) (text-0887 #x0887) (text-0888 #x0888) + (credits-0889 #x0889) (progress-controls-pad-360-spin #x088a) (progress-controls-pad-triangle-2 #x088b) (progress-controls-board-boost #x088c) @@ -9571,6 +9977,33 @@ (text-0897 #x0897) (talk-to-ashelin #x0898) (text-0899 #x0899) + (credits-089c #x089c) + (credits-089d #x089d) + (credits-089e #x089e) + (credits-089f #x089f) + (credits-08a0 #x08a0) + (credits-08a1 #x08a1) + (credits-08a2 #x08a2) + (credits-08a3 #x08a3) + (credits-08a4 #x08a4) + (credits-08a5 #x08a5) + (credits-08a6 #x08a6) + (credits-08a7 #x08a7) + (credits-08a8 #x08a8) + (credits-08a9 #x08a9) + (credits-08aa #x08aa) + (credits-08ab #x08ab) + (credits-08ac #x08ac) + (credits-08ad #x08ad) + (credits-08ae #x08ae) + (credits-08af #x08af) + (credits-08b0 #x08b0) + (credits-08b1 #x08b1) + (credits-08b2 #x08b2) + (credits-08b3 #x08b3) + (credits-08b4 #x08b4) + (credits-08b5 #x08b5) + (credits-08b6 #x08b6) ) ;; ---text-h:text-id @@ -14116,7 +14549,7 @@ (text-name text-id :offset-assert 8) ;; guessed by decompiler (pre-play-node game-task-node :offset-assert 12) ;; game-task-node (kiosk-play-node game-task-node :offset-assert 14) ;; game-task-node - (pre-play-continue object :offset-assert 16) ;; guessed by decompiler + (pre-play-continue string :offset-assert 16) ;; guessed by decompiler (play-node game-task-node :offset-assert 20) ;; game-task-node (play-continue string :offset-assert 24) ;; guessed by decompiler (kiosk-play-continue object :offset-assert 28) ;; guessed by decompiler @@ -22981,7 +23414,7 @@ target-demo ;; not defined ;; special states target-startup - target-title ;; associated process guessed by decompiler, old: (state symbol target) + (target-title symbol) (target-credits int) target-load-wait target-hide @@ -30524,7 +30957,7 @@ (define-extern *blit-displays-work* blit-displays-work) (define-extern draw-color-bars (function blit-displays-work none)) -;; (define-extern draw-raw-image function) ;; (function bucket-id art-group int int level int none) +(define-extern draw-raw-image (function bucket-id art-group int vector vector level int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; font-data ;; @@ -62998,7 +63431,7 @@ ;; credits-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *credits-ids* array) +(define-extern *credits-ids* (array text-id)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; credits ;; @@ -63009,58 +63442,53 @@ ;; title-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype title-control (process) - ((selected int32 :offset-assert 124) - (sprites hud-sprite 2 :offset-assert 140) ;; guessed by decompiler - (sprite-pos vector :inline :offset-assert 268) - (sprite-draw uint32 :offset-assert 284) - (buffer external-art-buffer 2 :offset-assert 288) ;; guessed by decompiler - (want int32 2 :offset-assert 296) ;; guessed by decompiler - (want-name string 2 :offset-assert 304) ;; guessed by decompiler - (have int32 2 :offset-assert 312) ;; guessed by decompiler - (draw int32 :offset-assert 320) - (draw-name string :offset-assert 324) ;; guessed by decompiler - (active symbol :offset-assert 328) ;; guessed by decompiler - (spark-time uint64 :offset-assert 332) ;; time-frame - (gui-id sound-id :offset-assert 340) ;; guessed by decompiler - (logo uint32 :offset-assert 344) + ((selected int32 :offset-assert 128) ;; shifted all offsets by +4 + (sprites hud-sprite 2 :inline :offset-assert 144) ;; made inline + (sprite-pos vector :inline :offset-assert 272) + (sprite-draw uint32 :offset-assert 288) + (buffer external-art-buffer 2 :offset-assert 292) ;; guessed by decompiler + (want int32 2 :offset-assert 300) ;; guessed by decompiler + (want-name string 2 :offset-assert 308) ;; guessed by decompiler + (have int32 2 :offset-assert 316) ;; guessed by decompiler + (draw int32 :offset-assert 324) + (draw-name string :offset-assert 328) ;; guessed by decompiler + (active symbol :offset-assert 332) ;; guessed by decompiler + (spark-time time-frame :offset-assert 336) ;; changed to time-frame + (gui-id sound-id :offset-assert 344) ;; guessed by decompiler + (logo (pointer manipy) :offset-assert 348) ) :method-count-assert 19 :size-assert #x160 :flag-assert #x1300e00160 (:state-methods - control-spec ;; 18 - scrap-book ;; 17, old: (scrap-book (int) _type_ :state) - idle ;; 16, old: (idle () _type_ :state) - wait ;; 15, old: (wait () _type_ :state) startup ;; 14, old: (startup () _type_ :state) + wait ;; 15, old: (wait () _type_ :state) + idle ;; 16, old: (idle () _type_ :state) + (scrap-book int) ;; 17, old: (scrap-book (int) _type_ :state) + (control-spec int) ;; 18 ) ) -|# -#| (deftype museum-char (structure) - ((skel basic :offset-assert 0) - (anim uint32 :offset-assert 4) - (height-min float :offset-assert 8) - (height-max float :offset-assert 12) - (zoom-min float :offset-assert 16) - (zoom-max float :offset-assert 20) - (scale float :offset-assert 24) - (text-id uint32 :offset-assert 28) - (cloth-reset-time uint64 :offset-assert 32) - (use-orient-cloth-reset? basic :offset-assert 40) - (outtake-num uint32 :offset-assert 44) - (outtake basic :offset-assert 48) + ((skel string :offset-assert 0) + (anim uint32 :offset-assert 4) + (height-min float :offset-assert 8) + (height-max float :offset-assert 12) + (zoom-min float :offset-assert 16) + (zoom-max float :offset-assert 20) + (scale float :offset-assert 24) + (text-id text-id :offset-assert 28) + (cloth-reset-time time-frame :offset-assert 32) + (use-orient-cloth-reset? symbol :offset-assert 40) + (outtake-num uint32 :offset-assert 44) + (outtake (array string) :offset-assert 48) ) :method-count-assert 9 :size-assert #x34 :flag-assert #x900000034 ) -|# -#| (deftype hirez-viewer (process-drawable) ((angley float :offset-assert 200) (anglex float :offset-assert 204) @@ -63070,10 +63498,10 @@ (pos-x float :offset-assert 220) (dest-pos-x float :offset-assert 224) (alpha float :offset-assert 228) - (cloth-reset-time uint64 :offset-assert 232) - (use-orient-cloth-reset? basic :offset-assert 240) - (id uint32 :offset-assert 244) - (credits basic :offset-assert 248) + (cloth-reset-time time-frame :offset-assert 232) + (use-orient-cloth-reset? symbol :offset-assert 240) + (id sound-id :offset-assert 244) + (credits symbol :offset-assert 248) ) :method-count-assert 21 :size-assert #xfc @@ -63082,44 +63510,42 @@ idle ;; 20 ) ) -|# -#| (deftype highres-viewer-manager (process) - ((current int32 :offset-assert 128) - (next int32 :offset-assert 132) - (handle uint64 :offset-assert 136) - (left-right basic :offset-assert 144) - (museum basic :offset-assert 148) - (next-time uint64 :offset-assert 152) + ((current int32 :offset-assert 128) + (next int32 :offset-assert 132) + (handle handle :offset-assert 136) + (left-right symbol :offset-assert 144) + (museum (array museum-char) :offset-assert 148) + (next-time time-frame :offset-assert 152) ) :method-count-assert 16 :size-assert #xa0 :flag-assert #x10002000a0 (:state-methods - credits ;; 15 idle ;; 14 + credits ;; 15 ) ) -|# -;; (define-extern title-screen-change function) ;; (function string int string int symbol symbol none :behavior title-control) -;; (define-extern wait-for-press function) ;; (function time-frame time-frame symbol symbol) -;; (define-extern direction-press function) -;; (define-extern title-menu function) ;; (function object :behavior title-control) -;; (define-extern title-fade-out function) ;; (function float none) -;; (define-extern title-progress function) ;; (function symbol none) -;; (define-extern *scrap-book-1* array) -;; (define-extern *scrap-book-2* array) -;; (define-extern title-control-init function) ;; (function none :behavior title-control) -;; (define-extern hirez-viewer-init-by-other function) -;; (define-extern spawn-hirez-viewer function) -;; (define-extern *museum-1* array) -;; (define-extern *museum-2* array) -;; (define-extern *museum-3* array) -;; (define-extern hvm-init-by-other function) -;; (define-extern spawn-hirez-viewer-manager function) -;; (define-extern draw-end-credits function) ;; (function level float symbol) +(define-extern title-screen-change (function string int string int symbol symbol int :behavior title-control)) +(define-extern wait-for-press (function time-frame time-frame symbol symbol)) +(define-extern direction-press (function time-frame time-frame symbol symbol)) +(define-extern title-menu (function object :behavior title-control)) +(define-extern title-fade-out (function float int)) +(define-extern title-progress (function symbol int)) +(define-extern *scrap-book-1* (array int16)) +(define-extern *scrap-book-2* (array int16)) +(define-extern *title-control* (pointer title-control)) +(define-extern title-control-init (function object :behavior title-control)) +(define-extern hirez-viewer-init-by-other (function museum-char symbol symbol object :behavior hirez-viewer)) +(define-extern spawn-hirez-viewer (function museum-char symbol symbol handle)) +(define-extern *museum-1* (array museum-char)) +(define-extern *museum-2* (array museum-char)) +(define-extern *museum-3* (array museum-char)) +(define-extern hvm-init-by-other (function (array museum-char) symbol object :behavior highres-viewer-manager)) +(define-extern spawn-hirez-viewer-manager (function (array museum-char) symbol handle)) +(define-extern draw-end-credits (function level float symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; lfaccar-init ;; diff --git a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc index 3a1e09120b..38da1dcc21 100644 --- a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc @@ -858,5 +858,11 @@ [9, "(function none :behavior scene-player)"], [10, "(function none :behavior scene-player)"], [11, "(function none :behavior scene-player)"] + ], + "title-obs": [ + [20, "(function external-art-buffer int)"], + [22, "(function game-task object)"], + [26, "(function vector :behavior manipy)"], + [30, "(function object :behavior manipy)"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/hacks.jsonc b/decompiler/config/jak3/ntsc_v1/hacks.jsonc index 7f776aebff..1f0f219ed9 100644 --- a/decompiler/config/jak3/ntsc_v1/hacks.jsonc +++ b/decompiler/config/jak3/ntsc_v1/hacks.jsonc @@ -223,7 +223,9 @@ "(method 16 cty-borrow-manager)", "mark-permanent-holds", "update-sound-info", - "insert-into-sound-list" + "insert-into-sound-list", + // title-obs + "(anon-function 22 title-obs)" ], // If format is used with the wrong number of arguments, @@ -540,7 +542,9 @@ "(method 15 hud-wasbbv-score)": [[61, 0]], "(method 15 hud-wasbbv-goal)": [[64, 0]], "(method 32 task-manager-dark-punch-training)": [[53, 0]], - "(method 32 task-manager-lightjak-training-shield)": [[53, 0]] + "(method 32 task-manager-lightjak-training-shield)": [[53, 0]], + "(trans credits highres-viewer-manager)": [[185, 0]], + "(trans idle hirez-viewer)": [[356, 0]] }, "mips2c_functions_by_name": [ @@ -686,6 +690,7 @@ ["lcit", 0, 0], ["pow", 0, 0], ["wasintro", 0, 0], + ["wasintro-vis", 0, 0], ["lfacctyb", 0, 0], ["intpfall", 0, 0], ["lfaccity", 0, 0], diff --git a/decompiler/config/jak3/ntsc_v1/inputs.jsonc b/decompiler/config/jak3/ntsc_v1/inputs.jsonc index 7f872f5267..9c7745f4be 100644 --- a/decompiler/config/jak3/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak3/ntsc_v1/inputs.jsonc @@ -116,7 +116,7 @@ // "DGO/GUNGAME1.DGO", // "DGO/GUNGAME2.DGO", // "DGO/POWERGD.DGO", - // "DGO/FREEHQ.DGO", + "DGO/FREEHQ.DGO", // "DGO/FREECAST.DGO", // "DGO/CITYCAST.DGO", // "DGO/GRIDCST.DGO", // city-destroy-grid-res @@ -187,13 +187,13 @@ // "DGO/PRECB.DGO", // "DGO/PRECC.DGO", // "DGO/PRECD.DGO", - // // title/intro - // "DGO/WIN.DGO", // wasintro - // "DGO/TITLE.DGO", - // "DGO/INTTITLE.DGO", + // title/intro + "DGO/WIN.DGO", // wasintro + "DGO/TITLE.DGO", + "DGO/INTTITLE.DGO", // "DGO/INTPALRF.DGO", // intro-palace-roof // "DGO/IPF.DGO", // intro-palace-fall - // "DGO/INTROCST.DGO", + "DGO/INTROCST.DGO", // // outro // "DGO/OUTCAST3.DGO", // "DGO/OUTROCST.DGO", @@ -256,7 +256,7 @@ "DGO/LFORM.DGO", "DGO/LFORP.DGO", // "DGO/LFORRING.DGO", - // "DGO/LFREEOUT.DGO", + "DGO/LFREEOUT.DGO", // "DGO/LGUNNORM.DGO", // "DGO/LGUNRNC.DGO", // "DGO/LJAK.DGO", @@ -297,7 +297,7 @@ // "DGO/LSNKWHLS.DGO", // "DGO/LTNFXHIP.DGO", // "DGO/LTNJXHIP.DGO", - // "DGO/LTORN.DGO", + "DGO/LTORN.DGO", // "DGO/LTORNJNX.DGO", // "DGO/LTORNSAM.DGO", "DGO/LTOWA.DGO", diff --git a/decompiler/config/jak3/ntsc_v1/label_types.jsonc b/decompiler/config/jak3/ntsc_v1/label_types.jsonc index e5f34070f0..8709b9fb09 100644 --- a/decompiler/config/jak3/ntsc_v1/label_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/label_types.jsonc @@ -1550,5 +1550,8 @@ ["L302", "vector"], ["L345", "vector"], ["L346", "vector"] + ], + "title-obs": [ + ["L651", "vector"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc index b122996163..6d37afdc17 100644 --- a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc +++ b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc @@ -1938,5 +1938,13 @@ [128, "vector"] ], "factory-fighter-init-by-other": [[16, "light-trail-tracker-spawn-params"]], - "(code explode factory-fighter)": [[112, "vector"]] + "(code explode factory-fighter)": [[112, "vector"]], + "(trans credits highres-viewer-manager)": [[16, "event-message-block"]], + "(trans idle hirez-viewer)": [[48, "vector"]], + "(code wait title-control)": [[16, "event-message-block"]], + "(code startup title-control)": [ + [16, ["array", "symbol", 10]], + [64, "event-message-block"], // this memory is reused as both mc-slot-info and event-message-block + [368, ["array", "symbol", 10]] + ] } diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index d1d03c52d6..cf031600b8 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -9265,5 +9265,15 @@ [[30, 36], "v1", "railx-states"], [[13, 19], "v1", "railx-states"] ], - "(code idle rail-warp-gate)": [[10, "v1", "art-joint-anim"]] + "(code idle rail-warp-gate)": [[10, "v1", "art-joint-anim"]], + "(code idle hirez-viewer)": [[20, "v1", "art-joint-anim"]], + "(post startup title-control)": [ + [155, "gp", "external-art-buffer"], + [226, "gp", "external-art-buffer"] + ], + "(code startup title-control)": [ + [[59, 149], "gp", "mc-slot-info"], // (+ sp-0 64) is reused as both mc-slot-info and event-message-block + [354, "v1", "process-drawable"], + [356, "s4", "quaternion"] + ] } diff --git a/decompiler/level_extractor/extract_merc.cpp b/decompiler/level_extractor/extract_merc.cpp index 37115056ca..5f86fb4f2e 100644 --- a/decompiler/level_extractor/extract_merc.cpp +++ b/decompiler/level_extractor/extract_merc.cpp @@ -782,8 +782,11 @@ s32 find_or_add_texture_to_level(tfrag3::Level& out, if (idx == left_id || idx == right_id) { if (!hdr.eye_ctrl) { - fmt::print("no eye ctrl, but expected one"); - if (debug_name != "kor-break-lod0") { + fmt::print("no eye ctrl, but expected one for {}\n", debug_name); + // it looks like these models have half-implemented eyes - the texture IDs are there, but + // there's no eye control. + if (debug_name != "kor-break-lod0" && debug_name != "errol-lowres-lod1" && + debug_name != "kleever-rider-lod0") { ASSERT(false); } } diff --git a/goal_src/jak3/engine/game/task/task-control-h.gc b/goal_src/jak3/engine/game/task/task-control-h.gc index 9be2e1871e..d7f5f936eb 100644 --- a/goal_src/jak3/engine/game/task/task-control-h.gc +++ b/goal_src/jak3/engine/game/task/task-control-h.gc @@ -1460,7 +1460,7 @@ (text-name text-id) (pre-play-node game-task-node) (kiosk-play-node game-task-node) - (pre-play-continue object) + (pre-play-continue string) (play-node game-task-node) (play-continue string) (kiosk-play-continue object) diff --git a/goal_src/jak3/engine/gfx/blit-displays.gc b/goal_src/jak3/engine/gfx/blit-displays.gc index 6919cc8ce0..68a8b02174 100644 --- a/goal_src/jak3/engine/gfx/blit-displays.gc +++ b/goal_src/jak3/engine/gfx/blit-displays.gc @@ -94,5 +94,9 @@ (none) ) +(defun draw-raw-image ((arg0 bucket-id) (arg1 art-group) (arg2 int) (arg3 vector) (arg4 vector) (arg5 level) (arg6 int)) + (none) + ) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/target/target-death.gc b/goal_src/jak3/engine/target/target-death.gc index c1af68d886..658e23b659 100644 --- a/goal_src/jak3/engine/target/target-death.gc +++ b/goal_src/jak3/engine/target/target-death.gc @@ -43,11 +43,11 @@ ((logtest? (-> arg0 flags) (continue-flags title)) enter-state #t - (go target-title) + (go target-title #t) ) ((logtest? (-> arg0 flags) (continue-flags title-movie)) enter-state - (go target-title) + (go target-title #f) ) ((logtest? (-> arg0 flags) (continue-flags intro)) (pre-intro-play) diff --git a/goal_src/jak3/engine/target/target-h.gc b/goal_src/jak3/engine/target/target-h.gc index 579f5fc78c..34477307cb 100644 --- a/goal_src/jak3/engine/target/target-h.gc +++ b/goal_src/jak3/engine/target/target-h.gc @@ -550,7 +550,7 @@ target-swim-stance target-swim-up target-swim-walk - target-title + (target-title symbol) target-tube (target-tube-death symbol) (target-tube-hit symbol attack-info) diff --git a/goal_src/jak3/engine/target/target2.gc b/goal_src/jak3/engine/target/target2.gc index 6377bfea26..6e0e60c54e 100644 --- a/goal_src/jak3/engine/target/target2.gc +++ b/goal_src/jak3/engine/target/target2.gc @@ -380,7 +380,7 @@ ) (('title) enter-state - (go target-title) + (go target-title #f) ) (('grab) (if (and (and (-> self next-state) (= (-> self next-state name) 'target-grab-ride)) (-> block param 1)) diff --git a/goal_src/jak3/engine/ui/text-h.gc b/goal_src/jak3/engine/ui/text-h.gc index d65b644a5d..78a0b7ed05 100644 --- a/goal_src/jak3/engine/ui/text-h.gc +++ b/goal_src/jak3/engine/ui/text-h.gc @@ -219,6 +219,202 @@ (text-020c #x020c) (text-020d #x020d) (progress-continue #x020e) + (credits-020f #x020f) + (credits-0211 #x0211) + (credits-0212 #x0212) + (credits-0213 #x0213) + (credits-0214 #x0214) + (credits-0215 #x0215) + (credits-0216 #x0216) + (credits-0217 #x0217) + (credits-0218 #x0218) + (credits-0219 #x0219) + (credits-021a #x021a) + (credits-021b #x021b) + (credits-021d #x021d) + (credits-021e #x021e) + (credits-0221 #x0221) + (credits-0222 #x0222) + (credits-0223 #x0223) + (credits-0224 #x0224) + (credits-0226 #x0226) + (credits-0227 #x0227) + (credits-0228 #x0228) + (credits-022a #x022a) + (credits-022b #x022b) + (credits-022c #x022c) + (credits-022d #x022d) + (credits-0230 #x0230) + (credits-0231 #x0231) + (credits-0232 #x0232) + (credits-0234 #x0234) + (credits-0235 #x0235) + (credits-0239 #x0239) + (credits-023a #x023a) + (credits-023b #x023b) + (credits-023c #x023c) + (credits-023e #x023e) + (credits-023f #x023f) + (credits-0243 #x0243) + (credits-0245 #x0245) + (credits-024a #x024a) + (credits-024c #x024c) + (credits-024e #x024e) + (credits-024f #x024f) + (credits-0250 #x0250) + (credits-0252 #x0252) + (credits-0253 #x0253) + (credits-0254 #x0254) + (credits-0255 #x0255) + (credits-0256 #x0256) + (credits-0257 #x0257) + (credits-0259 #x0259) + (credits-025e #x025e) + (credits-0261 #x0261) + (credits-0262 #x0262) + (credits-0263 #x0263) + (credits-0264 #x0264) + (credits-0265 #x0265) + (credits-0266 #x0266) + (credits-0267 #x0267) + (credits-0268 #x0268) + (credits-026d #x026d) + (credits-026e #x026e) + (credits-026f #x026f) + (credits-0270 #x0270) + (credits-0273 #x0273) + (credits-0274 #x0274) + (credits-0275 #x0275) + (credits-0276 #x0276) + (credits-0279 #x0279) + (credits-027a #x027a) + (credits-027b #x027b) + (credits-027c #x027c) + (credits-0281 #x0281) + (credits-0282 #x0282) + (credits-0283 #x0283) + (credits-0284 #x0284) + (credits-028e #x028e) + (credits-0290 #x0290) + (credits-0293 #x0293) + (credits-0294 #x0294) + (credits-0295 #x0295) + (credits-0296 #x0296) + (credits-029b #x029b) + (credits-02a5 #x02a5) + (credits-02a8 #x02a8) + (credits-02a9 #x02a9) + (credits-02aa #x02aa) + (credits-02ab #x02ab) + (credits-02ac #x02ac) + (credits-02ae #x02ae) + (credits-02b0 #x02b0) + (credits-02b2 #x02b2) + (credits-02b4 #x02b4) + (credits-02b7 #x02b7) + (credits-02b8 #x02b8) + (credits-02ba #x02ba) + (credits-02bb #x02bb) + (credits-02bc #x02bc) + (credits-02be #x02be) + (credits-02c0 #x02c0) + (credits-02c2 #x02c2) + (credits-02c3 #x02c3) + (credits-02c4 #x02c4) + (credits-02c6 #x02c6) + (credits-02c8 #x02c8) + (credits-02c9 #x02c9) + (credits-02cc #x02cc) + (credits-02cd #x02cd) + (credits-02ce #x02ce) + (credits-02cf #x02cf) + (credits-02d4 #x02d4) + (credits-02d6 #x02d6) + (credits-02db #x02db) + (credits-02e0 #x02e0) + (credits-02e1 #x02e1) + (credits-02ea #x02ea) + (credits-02ed #x02ed) + (credits-02f4 #x02f4) + (credits-02f5 #x02f5) + (credits-02f6 #x02f6) + (credits-02f7 #x02f7) + (credits-02f8 #x02f8) + (credits-02f9 #x02f9) + (credits-02fa #x02fa) + (credits-02fb #x02fb) + (credits-02fc #x02fc) + (credits-02fd #x02fd) + (credits-02fe #x02fe) + (credits-02ff #x02ff) + (credits-0300 #x0300) + (credits-0301 #x0301) + (credits-0302 #x0302) + (credits-0303 #x0303) + (credits-0304 #x0304) + (credits-0305 #x0305) + (credits-0306 #x0306) + (credits-0307 #x0307) + (credits-0324 #x0324) + (credits-0347 #x0347) + (credits-0348 #x0348) + (credits-0349 #x0349) + (credits-034a #x034a) + (credits-034b #x034b) + (credits-034c #x034c) + (credits-034d #x034d) + (credits-034f #x034f) + (credits-0351 #x0351) + (credits-0352 #x0352) + (credits-0356 #x0356) + (credits-0358 #x0358) + (credits-0359 #x0359) + (credits-035d #x035d) + (credits-035e #x035e) + (credits-035f #x035f) + (credits-0360 #x0360) + (credits-0361 #x0361) + (credits-0363 #x0363) + (credits-0364 #x0364) + (credits-0365 #x0365) + (credits-0366 #x0366) + (credits-0367 #x0367) + (credits-0368 #x0368) + (credits-036a #x036a) + (credits-036c #x036c) + (credits-036d #x036d) + (credits-036e #x036e) + (credits-036f #x036f) + (credits-0370 #x0370) + (credits-0379 #x0379) + (credits-037d #x037d) + (credits-037e #x037e) + (credits-037f #x037f) + (credits-0380 #x0380) + (credits-0382 #x0382) + (credits-0383 #x0383) + (credits-0384 #x0384) + (credits-0385 #x0385) + (credits-0386 #x0386) + (credits-0387 #x0387) + (credits-0388 #x0388) + (credits-038a #x038a) + (credits-038b #x038b) + (credits-038d #x038d) + (credits-0391 #x0391) + (credits-0393 #x0393) + (credits-0394 #x0394) + (credits-0395 #x0395) + (credits-0396 #x0396) + (credits-0397 #x0397) + (credits-0398 #x0398) + (credits-0399 #x0399) + (credits-039a #x039a) + (credits-039c #x039c) + (credits-039f #x039f) + (credits-03a1 #x03a1) + (credits-03b5 #x03b5) + (credits-03be #x03be) (text-03bf #x03bf) (text-03c0 #x03c0) (text-03c1 #x03c1) @@ -231,6 +427,23 @@ (progress-missions-todo-icon #x03c8) (progress-missions-complete-icon #x03c9) (text-03d1 #x03d1) + (credits-03e4 #x03e4) + (credits-03e5 #x03e5) + (credits-03e7 #x03e7) + (credits-03ef #x03ef) + (credits-03f1 #x03f1) + (credits-03f3 #x03f3) + (credits-03f4 #x03f4) + (credits-03f5 #x03f5) + (credits-03f6 #x03f6) + (credits-03fc #x03fc) + (credits-03fd #x03fd) + (credits-03fe #x03fe) + (credits-03ff #x03ff) + (credits-0400 #x0400) + (credits-0401 #x0401) + (credits-0403 #x0403) + (credits-0404 #x0404) (text-0408 #x0408) (text-0409 #x0409) (text-040a #x040a) @@ -238,6 +451,7 @@ (text-040c #x040c) (text-040d #x040d) (text-040e #x040e) + (credits-040f #x040f) (progress-missions-mine-explore #x0443) (progress-missions-mine-blow #x0444) (progress-missions-forest-turn-on-machine #x0445) @@ -660,6 +874,25 @@ (progress-inventory-v-rhino #x06c8) (progress-inventory-v-mirage #x06c9) (progress-inventory-v-x-ride #x06ca) + (credits-06cb #x06cb) + (credits-06cc #x06cc) + (credits-06cd #x06cd) + (credits-06ce #x06ce) + (credits-06cf #x06cf) + (credits-06d0 #x06d0) + (credits-06d1 #x06d1) + (credits-06d2 #x06d2) + (credits-06d3 #x06d3) + (credits-06d4 #x06d4) + (credits-06d5 #x06d5) + (credits-06d6 #x06d6) + (credits-06d7 #x06d7) + (credits-06d8 #x06d8) + (credits-06d9 #x06d9) + (credits-06da #x06da) + (credits-06db #x06db) + (credits-06dc #x06dc) + (credits-06dd #x06dd) (text-06de #x06de) (text-06df #x06df) (progress-inventory-gun-red-1 #x06e0) @@ -710,6 +943,103 @@ (text-070d #x070d) (text-070e #x070e) (text-070f #x070f) + (credits-0710 #x0710) + (credits-0711 #x0711) + (credits-0712 #x0712) + (credits-0713 #x0713) + (credits-0714 #x0714) + (credits-0715 #x0715) + (credits-0716 #x0716) + (credits-0717 #x0717) + (credits-0718 #x0718) + (credits-0719 #x0719) + (credits-071a #x071a) + (credits-071b #x071b) + (credits-071c #x071c) + (credits-071d #x071d) + (credits-071e #x071e) + (credits-071f #x071f) + (credits-0720 #x0720) + (credits-0721 #x0721) + (credits-0722 #x0722) + (credits-0723 #x0723) + (credits-0724 #x0724) + (credits-0725 #x0725) + (credits-0726 #x0726) + (credits-0727 #x0727) + (credits-0728 #x0728) + (credits-0729 #x0729) + (credits-072a #x072a) + (credits-072b #x072b) + (credits-072c #x072c) + (credits-072d #x072d) + (credits-072e #x072e) + (credits-072f #x072f) + (credits-0730 #x0730) + (credits-0731 #x0731) + (credits-0732 #x0732) + (credits-0733 #x0733) + (credits-0734 #x0734) + (credits-0735 #x0735) + (credits-0736 #x0736) + (credits-0737 #x0737) + (credits-0738 #x0738) + (credits-0739 #x0739) + (credits-073a #x073a) + (credits-073b #x073b) + (credits-073c #x073c) + (credits-073d #x073d) + (credits-073e #x073e) + (credits-0740 #x0740) + (credits-0742 #x0742) + (credits-0743 #x0743) + (credits-0744 #x0744) + (credits-0746 #x0746) + (credits-0747 #x0747) + (credits-0748 #x0748) + (credits-0749 #x0749) + (credits-074a #x074a) + (credits-074b #x074b) + (credits-074c #x074c) + (credits-074d #x074d) + (credits-074e #x074e) + (credits-074f #x074f) + (credits-0750 #x0750) + (credits-0751 #x0751) + (credits-0752 #x0752) + (credits-0753 #x0753) + (credits-0754 #x0754) + (credits-0755 #x0755) + (credits-0756 #x0756) + (credits-0757 #x0757) + (credits-0758 #x0758) + (credits-0759 #x0759) + (credits-075a #x075a) + (credits-075b #x075b) + (credits-075c #x075c) + (credits-075d #x075d) + (credits-075e #x075e) + (credits-075f #x075f) + (credits-0760 #x0760) + (credits-0761 #x0761) + (credits-0762 #x0762) + (credits-0763 #x0763) + (credits-0764 #x0764) + (credits-0766 #x0766) + (credits-0767 #x0767) + (credits-0768 #x0768) + (credits-0769 #x0769) + (credits-076a #x076a) + (credits-076b #x076b) + (credits-076c #x076c) + (credits-076d #x076d) + (credits-076e #x076e) + (credits-076f #x076f) + (credits-0770 #x0770) + (credits-0771 #x0771) + (credits-0772 #x0772) + (credits-0773 #x0773) + (credits-0774 #x0774) (text-0775 #x0775) (text-0776 #x0776) (scene-catacomb-get-shield #x0778) @@ -717,10 +1047,54 @@ (mission-fail-marauders-escaped #x077a) (text-077b #x077b) (text-077c #x077c) + (credits-077d #x077d) + (credits-077e #x077e) + (credits-077f #x077f) + (credits-0780 #x0780) + (credits-0781 #x0781) + (credits-0782 #x0782) + (credits-0783 #x0783) (talk-to-kleiver #x078d) + (credits-078f #x078f) + (credits-0790 #x0790) + (credits-0791 #x0791) + (credits-0792 #x0792) + (credits-0793 #x0793) + (credits-0794 #x0794) + (credits-0795 #x0795) + (credits-0796 #x0796) + (credits-0797 #x0797) + (credits-0798 #x0798) + (credits-0799 #x0799) + (credits-079a #x079a) + (credits-079b #x079b) + (credits-079c #x079c) + (credits-079d #x079d) + (credits-079e #x079e) + (credits-079f #x079f) + (credits-07a0 #x07a0) + (credits-07a1 #x07a1) + (credits-07a2 #x07a2) + (credits-07a3 #x07a3) + (credits-07a4 #x07a4) + (credits-07a5 #x07a5) + (credits-07a6 #x07a6) + (credits-07a7 #x07a7) + (credits-07a8 #x07a8) + (credits-07a9 #x07a9) + (credits-07aa #x07aa) + (credits-07ab #x07ab) + (credits-07ac #x07ac) + (credits-07ad #x07ad) + (credits-07ae #x07ae) + (credits-07af #x07af) + (credits-07b0 #x07b0) + (credits-07b1 #x07b1) + (credits-07b2 #x07b2) (progress-secrets-unlimited-turbos #x07b3) (text-07b4 #x07b4) (text-07b5 #x07b5) + (credits-07b6 #x07b6) (progress-language-portuguese #x07b8) (text-07b9 #x07b9) (text-07ba #x07ba) @@ -734,8 +1108,12 @@ (text-07c2 #x07c2) (text-07c3 #x07c3) (text-07c4 #x07c4) + (credits-07c5 #x07c5) + (credits-07c6 #x07c6) (progress-language-commentary #x07c7) (progress-language-dutch #x07c8) + (credits-07c9 #x07c9) + (credits-07ca #x07ca) (progress-inventory #x07cb) (text-07cc #x07cc) (text-07cd #x07cd) @@ -768,6 +1146,17 @@ (text-07e8 #x07e8) (text-07e9 #x07e9) (progress-secrets-kleever-diaper #x07ea) + (credits-07eb #x07eb) + (credits-07ec #x07ec) + (credits-07ed #x07ed) + (credits-07ee #x07ee) + (credits-07ef #x07ef) + (credits-07f0 #x07f0) + (credits-07f1 #x07f1) + (credits-07f2 #x07f2) + (credits-07f3 #x07f3) + (credits-07f4 #x07f4) + (credits-07f5 #x07f5) (text-07f6 #x07f6) (text-07f7 #x07f7) (text-07f8 #x07f8) @@ -792,6 +1181,14 @@ (progress-controls-crouch-uppercut #x080b) (progress-controls-pad-triangle-4 #x080c) (progress-controls-dark-invis #x080d) + (credits-080e #x080e) + (credits-080f #x080f) + (credits-0810 #x0810) + (credits-0811 #x0811) + (credits-0812 #x0812) + (credits-0813 #x0813) + (credits-0814 #x0814) + (credits-0815 #x0815) (text-0816 #x0816) (text-0817 #x0817) (text-0818 #x0818) @@ -854,10 +1251,16 @@ (progress-secrets-button-invis #x0851) (progress-secrets-cancel #x0852) (progress-secrets-buy #x0853) + (credits-0854 #x0854) + (credits-0855 #x0855) (progress-secrets-price #x0856) (text-0857 #x0857) (text-0858 #x0858) (text-085a #x085a) + (credits-085b #x085b) + (credits-085c #x085c) + (credits-085d #x085d) + (credits-085e #x085e) (text-085f #x085f) (text-0860 #x0860) (text-0861 #x0861) @@ -890,12 +1293,15 @@ (progress-highscores-clank-gun-course #x087e) (progress-highscores-eco-grid-game #x087f) (progress-highscores-marauder-challenge #x0880) + (credits-0881 #x0881) + (credits-0882 #x0882) (progress-controls-pad-l2-lanalog #x0883) (progress-controls-board-grab #x0884) (text-0885 #x0885) (text-0886 #x0886) (text-0887 #x0887) (text-0888 #x0888) + (credits-0889 #x0889) (progress-controls-pad-360-spin #x088a) (progress-controls-pad-triangle-2 #x088b) (progress-controls-board-boost #x088c) @@ -911,6 +1317,33 @@ (text-0897 #x0897) (talk-to-ashelin #x0898) (text-0899 #x0899) + (credits-089c #x089c) + (credits-089d #x089d) + (credits-089e #x089e) + (credits-089f #x089f) + (credits-08a0 #x08a0) + (credits-08a1 #x08a1) + (credits-08a2 #x08a2) + (credits-08a3 #x08a3) + (credits-08a4 #x08a4) + (credits-08a5 #x08a5) + (credits-08a6 #x08a6) + (credits-08a7 #x08a7) + (credits-08a8 #x08a8) + (credits-08a9 #x08a9) + (credits-08aa #x08aa) + (credits-08ab #x08ab) + (credits-08ac #x08ac) + (credits-08ad #x08ad) + (credits-08ae #x08ae) + (credits-08af #x08af) + (credits-08b0 #x08b0) + (credits-08b1 #x08b1) + (credits-08b2 #x08b2) + (credits-08b3 #x08b3) + (credits-08b4 #x08b4) + (credits-08b5 #x08b5) + (credits-08b6 #x08b6) ) ;; ---text-id diff --git a/goal_src/jak3/game.gp b/goal_src/jak3/game.gp index 0beec704de..2c45eb55b7 100644 --- a/goal_src/jak3/game.gp +++ b/goal_src/jak3/game.gp @@ -199,7 +199,7 @@ ; (cgo-file "gungame1.gd" common-dep) ; (cgo-file "gungame2.gd" common-dep) ; (cgo-file "powergd.gd" common-dep) -; (cgo-file "freehq.gd" common-dep) +(cgo-file "freehq.gd" common-dep) ; (cgo-file "vin.gd" common-dep) ; (cgo-file "freecast.gd" common-dep) ; (cgo-file "citycast.gd" common-dep) @@ -273,12 +273,12 @@ ; (cgo-file "precc.gd" common-dep) ; (cgo-file "precd.gd" common-dep) ; ;; title/intro -; (cgo-file "win.gd" common-dep) ;; wasintro -; (cgo-file "title.gd" common-dep) -; (cgo-file "inttitle.gd" common-dep) +(cgo-file "win.gd" common-dep) ;; wasintro +(cgo-file "title.gd" common-dep) +(cgo-file "inttitle.gd" common-dep) ; (cgo-file "intpalrf.gd" common-dep) ;; intro-palace-roof ; (cgo-file "ipf.gd" common-dep) ;; intro-palace-fall -; (cgo-file "introcst.gd" common-dep) +(cgo-file "introcst.gd" common-dep) ; ;; outro ; (cgo-file "outcast3.gd" common-dep) ; (cgo-file "outrocst.gd" common-dep) @@ -340,7 +340,7 @@ (cgo-file "lform.gd" common-dep) (cgo-file "lforp.gd" common-dep) ; (cgo-file "lforring.gd" common-dep) -; (cgo-file "lfreeout.gd" common-dep) +(cgo-file "lfreeout.gd" common-dep) ; (cgo-file "lgunnorm.gd" common-dep) ; (cgo-file "lgunrnc.gd" common-dep) ; (cgo-file "ljak.gd" common-dep) @@ -381,7 +381,7 @@ ; (cgo-file "lsnkwhls.gd" common-dep) ; (cgo-file "ltnfxhip.gd" common-dep) ; (cgo-file "ltnjxhip.gd" common-dep) -; (cgo-file "ltorn.gd" common-dep) +(cgo-file "ltorn.gd" common-dep) ; (cgo-file "ltornjnx.gd" common-dep) ; (cgo-file "ltornsam.gd" common-dep) (cgo-file "ltowa.gd" common-dep) diff --git a/goal_src/jak3/levels/title/credits-h.gc b/goal_src/jak3/levels/title/credits-h.gc index c571697165..80eefd72ea 100644 --- a/goal_src/jak3/levels/title/credits-h.gc +++ b/goal_src/jak3/levels/title/credits-h.gc @@ -7,3 +7,444 @@ ;; DECOMP BEGINS +(define *credits-ids* (the-as (array text-id) (new 'static 'boxed-array :type text-id + (text-id credits-020f) + (text-id credits-0211) + (text-id credits-0212) + (text-id credits-0213) + (text-id credits-0214) + (text-id credits-0215) + (text-id credits-0216) + (text-id credits-0217) + (text-id credits-0218) + (text-id credits-0219) + (text-id credits-021a) + (text-id credits-021b) + (text-id credits-0710) + (text-id credits-021d) + (text-id credits-021e) + (text-id credits-0711) + (text-id credits-0221) + (text-id credits-0222) + (text-id credits-0223) + (text-id credits-0224) + (text-id credits-0227) + (text-id credits-0228) + (text-id credits-0712) + (text-id credits-022a) + (text-id credits-022b) + (text-id credits-022c) + (text-id credits-022d) + (text-id credits-0713) + (text-id credits-0230) + (text-id credits-0231) + (text-id credits-0232) + (text-id credits-0714) + (text-id credits-0234) + (text-id credits-0235) + (text-id credits-0715) + (text-id credits-0239) + (text-id credits-023a) + (text-id credits-023b) + (text-id credits-023c) + (text-id credits-0716) + (text-id credits-023e) + (text-id credits-023f) + (text-id credits-0717) + (text-id credits-0718) + (text-id credits-0243) + (text-id credits-0719) + (text-id credits-071a) + (text-id credits-071b) + (text-id credits-071c) + (text-id credits-071d) + (text-id credits-071e) + (text-id credits-071f) + (text-id credits-0720) + (text-id credits-0721) + (text-id credits-0722) + (text-id credits-0723) + (text-id credits-0724) + (text-id credits-0725) + (text-id credits-0726) + (text-id credits-0727) + (text-id credits-0728) + (text-id credits-0245) + (text-id credits-077d) + (text-id credits-077e) + (text-id credits-0747) + (text-id credits-077f) + (text-id credits-0748) + (text-id credits-03e4) + (text-id credits-03e5) + (text-id credits-0729) + (text-id credits-024a) + (text-id credits-072a) + (text-id credits-024c) + (text-id credits-024f) + (text-id credits-072b) + (text-id credits-024e) + (text-id credits-0250) + (text-id credits-072c) + (text-id credits-03e7) + (text-id credits-072d) + (text-id credits-072e) + (text-id credits-072f) + (text-id credits-0252) + (text-id credits-0253) + (text-id credits-0254) + (text-id credits-0255) + (text-id credits-0256) + (text-id credits-0257) + (text-id credits-0780) + (text-id credits-0259) + (text-id credits-07b6) + (text-id credits-025e) + (text-id credits-07c9) + (text-id credits-0781) + (text-id credits-07ca) + (text-id credits-0261) + (text-id credits-0262) + (text-id credits-0263) + (text-id credits-0264) + (text-id credits-0265) + (text-id credits-0266) + (text-id credits-0267) + (text-id credits-0268) + (text-id credits-0854) + (text-id credits-0855) + (text-id credits-026d) + (text-id credits-026e) + (text-id credits-0881) + (text-id credits-0882) + (text-id credits-026f) + (text-id credits-0270) + (text-id credits-07c5) + (text-id credits-07c6) + (text-id credits-0273) + (text-id credits-0274) + (text-id credits-0275) + (text-id credits-0276) + (text-id credits-0279) + (text-id credits-027a) + (text-id credits-027b) + (text-id credits-027c) + (text-id credits-0281) + (text-id credits-0282) + (text-id credits-0283) + (text-id credits-0284) + (text-id credits-0730) + (text-id credits-0731) + (text-id credits-0732) + (text-id credits-0733) + (text-id credits-0734) + (text-id credits-0735) + (text-id credits-089e) + (text-id credits-089f) + (text-id credits-08a0) + (text-id credits-08a1) + (text-id credits-08a2) + (text-id credits-08a3) + (text-id credits-08a4) + (text-id credits-08a5) + (text-id credits-0736) + (text-id credits-0737) + (text-id credits-0738) + (text-id credits-028e) + (text-id credits-0739) + (text-id credits-0290) + (text-id credits-0293) + (text-id credits-0294) + (text-id credits-0295) + (text-id credits-0296) + (text-id credits-029b) + (text-id credits-03ef) + (text-id credits-073a) + (text-id credits-073b) + (text-id credits-073c) + (text-id credits-073d) + (text-id credits-073e) + (text-id credits-08a6) + (text-id credits-0740) + (text-id credits-0889) + (text-id credits-0742) + (text-id credits-0743) + (text-id credits-0744) + (text-id credits-07eb) + (text-id credits-0746) + (text-id credits-02a5) + (text-id credits-0226) + (text-id credits-0749) + (text-id credits-074a) + (text-id credits-074b) + (text-id credits-074c) + (text-id credits-074d) + (text-id credits-074e) + (text-id credits-074f) + (text-id credits-0750) + (text-id credits-0751) + (text-id credits-0752) + (text-id credits-0782) + (text-id credits-0783) + (text-id credits-02a8) + (text-id credits-02a9) + (text-id credits-02aa) + (text-id credits-02ab) + (text-id credits-02ac) + (text-id credits-02ae) + (text-id credits-0753) + (text-id credits-02b0) + (text-id credits-0754) + (text-id credits-02b2) + (text-id credits-085b) + (text-id credits-085c) + (text-id credits-085d) + (text-id credits-085e) + (text-id credits-02c3) + (text-id credits-02c4) + (text-id credits-0755) + (text-id credits-02c6) + (text-id credits-0756) + (text-id credits-02c8) + (text-id credits-02c9) + (text-id credits-0757) + (text-id credits-0758) + (text-id credits-02d6) + (text-id credits-0759) + (text-id credits-08a7) + (text-id credits-075a) + (text-id credits-075b) + (text-id credits-075c) + (text-id credits-075d) + (text-id credits-075e) + (text-id credits-0760) + (text-id credits-02ed) + (text-id credits-02e1) + (text-id credits-02db) + (text-id credits-0761) + (text-id credits-0762) + (text-id credits-02ea) + (text-id credits-0763) + (text-id credits-0764) + (text-id credits-0766) + (text-id credits-08a8) + (text-id credits-089c) + (text-id credits-0767) + (text-id credits-08a9) + (text-id credits-0770) + (text-id credits-0768) + (text-id credits-0769) + (text-id credits-076a) + (text-id credits-076b) + (text-id credits-08aa) + (text-id credits-02e0) + (text-id credits-076c) + (text-id credits-076d) + (text-id credits-08ab) + (text-id credits-076e) + (text-id credits-076f) + (text-id credits-089d) + (text-id credits-02d4) + (text-id credits-0771) + (text-id credits-08ac) + (text-id credits-08ad) + (text-id credits-0772) + (text-id credits-08ae) + (text-id credits-08af) + (text-id credits-0773) + (text-id credits-08b0) + (text-id credits-075f) + (text-id credits-08b1) + (text-id credits-08b2) + (text-id credits-08b3) + (text-id credits-08b4) + (text-id credits-08b5) + (text-id credits-0774) + (text-id credits-08b6) + (text-id credits-02cc) + (text-id credits-02cd) + (text-id credits-02ce) + (text-id credits-02cf) + (text-id credits-03f1) + (text-id credits-02b4) + (text-id credits-078f) + (text-id credits-0790) + (text-id credits-0791) + (text-id credits-0792) + (text-id credits-0793) + (text-id credits-02b7) + (text-id credits-02b8) + (text-id credits-0794) + (text-id credits-0795) + (text-id credits-0796) + (text-id credits-0797) + (text-id credits-0798) + (text-id credits-0799) + (text-id credits-079a) + (text-id credits-079b) + (text-id credits-079c) + (text-id credits-079d) + (text-id credits-03f3) + (text-id credits-02ba) + (text-id credits-02bb) + (text-id credits-02bc) + (text-id credits-03f4) + (text-id credits-02be) + (text-id credits-03f5) + (text-id credits-02c0) + (text-id credits-079e) + (text-id credits-079f) + (text-id credits-07a0) + (text-id credits-07a1) + (text-id credits-07a2) + (text-id credits-07a3) + (text-id credits-07a4) + (text-id credits-03f6) + (text-id credits-02c2) + (text-id credits-07a5) + (text-id credits-07a6) + (text-id credits-07a7) + (text-id credits-07a8) + (text-id credits-07a9) + (text-id credits-07aa) + (text-id credits-07ab) + (text-id credits-07ac) + (text-id credits-07ad) + (text-id credits-07ae) + (text-id credits-07af) + (text-id credits-07b0) + (text-id credits-07b1) + (text-id credits-07b2) + (text-id credits-02f4) + (text-id credits-02f5) + (text-id credits-02f6) + (text-id credits-02f7) + (text-id credits-02f8) + (text-id credits-02f9) + (text-id credits-02fa) + (text-id credits-02fb) + (text-id credits-02fc) + (text-id credits-02fd) + (text-id credits-02fe) + (text-id credits-02ff) + (text-id credits-0300) + (text-id credits-0301) + (text-id credits-0302) + (text-id credits-0303) + (text-id credits-0304) + (text-id credits-0305) + (text-id credits-0306) + (text-id credits-0307) + (text-id credits-0347) + (text-id credits-0348) + (text-id credits-0349) + (text-id credits-06cb) + (text-id credits-06cc) + (text-id credits-034a) + (text-id credits-034b) + (text-id credits-06cd) + (text-id credits-06ce) + (text-id credits-034c) + (text-id credits-034d) + (text-id credits-06cf) + (text-id credits-06d0) + (text-id credits-06d1) + (text-id credits-034f) + (text-id credits-06d2) + (text-id credits-040f) + (text-id credits-0351) + (text-id credits-0352) + (text-id credits-03fc) + (text-id credits-0356) + (text-id credits-06d3) + (text-id credits-0358) + (text-id credits-06d4) + (text-id credits-0359) + (text-id credits-06d5) + (text-id credits-06d6) + (text-id credits-06d7) + (text-id credits-06d8) + (text-id credits-06d9) + (text-id credits-035d) + (text-id credits-035e) + (text-id credits-035f) + (text-id credits-0360) + (text-id credits-0361) + (text-id credits-06da) + (text-id credits-0363) + (text-id credits-0364) + (text-id credits-0365) + (text-id credits-0366) + (text-id credits-06db) + (text-id credits-06dc) + (text-id credits-06dd) + (text-id credits-0367) + (text-id credits-0368) + (text-id credits-03fd) + (text-id credits-036a) + (text-id credits-03fe) + (text-id credits-036c) + (text-id credits-036d) + (text-id credits-036e) + (text-id credits-036f) + (text-id credits-0370) + (text-id credits-03ff) + (text-id credits-080e) + (text-id credits-080f) + (text-id credits-0810) + (text-id credits-0811) + (text-id credits-0400) + (text-id credits-0812) + (text-id credits-0401) + (text-id credits-0379) + (text-id credits-0813) + (text-id credits-0403) + (text-id credits-037d) + (text-id credits-037e) + (text-id credits-037f) + (text-id credits-0380) + (text-id credits-0814) + (text-id credits-0815) + (text-id credits-0382) + (text-id credits-0383) + (text-id credits-0384) + (text-id credits-0385) + (text-id credits-0386) + (text-id credits-0387) + (text-id credits-0388) + (text-id credits-038a) + (text-id credits-038b) + (text-id credits-07ec) + (text-id credits-038d) + (text-id credits-07ed) + (text-id credits-0391) + (text-id credits-07ee) + (text-id credits-0397) + (text-id credits-0398) + (text-id credits-0393) + (text-id credits-0394) + (text-id credits-0395) + (text-id credits-0396) + (text-id credits-0399) + (text-id credits-039a) + (text-id credits-07ef) + (text-id credits-07f0) + (text-id credits-0324) + (text-id credits-039c) + (text-id credits-0404) + (text-id credits-07f1) + (text-id credits-039f) + (text-id credits-07f2) + (text-id credits-07f3) + (text-id credits-07f4) + (text-id credits-03a1) + (text-id credits-03b5) + (text-id credits-07f5) + (text-id credits-03be) + ) + ) + ) + + + + diff --git a/goal_src/jak3/levels/title/credits.gc b/goal_src/jak3/levels/title/credits.gc index d32eb6a6a1..2b05e60fe7 100644 --- a/goal_src/jak3/levels/title/credits.gc +++ b/goal_src/jak3/levels/title/credits.gc @@ -6,4 +6,3 @@ ;; dgos: TITLE ;; DECOMP BEGINS - diff --git a/goal_src/jak3/levels/title/title-obs.gc b/goal_src/jak3/levels/title/title-obs.gc index 6f7f550370..404cae1a69 100644 --- a/goal_src/jak3/levels/title/title-obs.gc +++ b/goal_src/jak3/levels/title/title-obs.gc @@ -5,5 +5,2604 @@ ;; name in dgo: title-obs ;; dgos: TITLE +(declare-type title-control process) +(define-extern *title-control* (pointer title-control)) + ;; DECOMP BEGINS +(deftype title-control (process) + ((selected int32) + (sprites hud-sprite 2 :inline) + (sprite-pos vector :inline) + (sprite-draw uint32) + (buffer external-art-buffer 2) + (want int32 2) + (want-name string 2) + (have int32 2) + (draw int32) + (draw-name string) + (active symbol) + (spark-time time-frame) + (gui-id sound-id) + (logo (pointer manipy)) + ) + (:state-methods + startup + wait + idle + (scrap-book int) + (control-spec int) + ) + ) + + +;; WARN: Return type mismatch process vs title-control. +(defmethod relocate ((this title-control) (offset int)) + (dotimes (v1-0 2) + (if (nonzero? (-> this buffer v1-0)) + (&+! (-> this buffer v1-0) offset) + ) + ) + (the-as title-control ((method-of-type process relocate) this offset)) + ) + +(defmethod deactivate ((this title-control)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intro #f) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (dotimes (s5-0 2) + (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + ) + (dotimes (s5-1 2) + (update (-> this buffer s5-1)) + ) + ((method-of-type process deactivate) this) + (none) + ) + +(defskelgroup skel-jakthreelogo jakthreelogo jakthreelogo-lod0-jg jakthreelogo-idle-ja + ((jakthreelogo-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +(defbehavior title-screen-change title-control ((arg0 string) (arg1 int) (arg2 string) (arg3 int) (arg4 symbol) (arg5 symbol)) + (when arg5 + (let ((s1-0 (the-as int (-> *setting-control* user-current language)))) + 0 + (if (and (= (the-as language-enum s1-0) (language-enum english)) (= (scf-get-territory) 1)) + (set! s1-0 11) + ) + (let ((v1-6 (cond + ((zero? s1-0) + 0 + ) + ((= s1-0 11) + 1 + ) + ((= s1-0 1) + 2 + ) + ((= s1-0 2) + 3 + ) + ((= s1-0 4) + 4 + ) + ((= s1-0 3) + 5 + ) + (else + 0 + ) + ) + ) + ) + (if (>= arg1 0) + (+! arg1 (* 3 v1-6)) + ) + (if (>= arg3 0) + (+! arg3 (* 3 v1-6)) + ) + ) + ) + ) + (set! (-> self want-name 0) arg0) + (set! (-> self want 0) arg1) + (set! (-> self want-name 1) (-> self draw-name)) + (set! (-> self want 1) (-> self draw)) + (when arg4 + (set-setting! 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (set-blackout-frames 0) + (apply-settings *setting-control*) + ) + (when (>= (-> self draw) 0) + (set-setting! 'bg-a 'abs 1.0 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + ) + (set! (-> self draw) arg1) + (set! (-> self draw-name) arg0) + (set! (-> self active) #f) + (while (and (>= (-> self draw) 0) (not (-> self active))) + (suspend) + ) + (remove-setting! 'bg-a) + (set! (-> self want-name 1) arg2) + (set! (-> self want 1) arg3) + 0 + ) + +(defun wait-for-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (let ((s2-0 (current-time)) + (s3-0 #f) + ) + (while (not (or (time-elapsed? s2-0 arg1) (and (time-elapsed? s2-0 arg0) s3-0))) + (if (cpad-pressed? 0 confirm) + (set! s3-0 #t) + ) + (when (and arg2 (cpad-pressed? 0 triangle)) + (set! s3-0 'abort) + (goto cfg-17) + ) + (suspend) + ) + (label cfg-17) + s3-0 + ) + ) + +(defun direction-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (let ((s2-0 (current-time)) + (s3-0 #f) + ) + (while (not (or (time-elapsed? s2-0 arg1) (and (time-elapsed? s2-0 arg0) s3-0))) + (if (cpad-pressed? 0 r1 confirm) + (set! s3-0 'forward) + ) + (if (cpad-pressed? 0 l1) + (set! s3-0 'back) + ) + (when (and arg2 (cpad-pressed? 0 triangle)) + (set! s3-0 'abort) + (goto cfg-19) + ) + (suspend) + ) + (label cfg-19) + s3-0 + ) + ) + +;; WARN: Return type mismatch int vs object. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior title-menu title-control () + (local-vars (sv-112 font-context)) + (sound-play "dmenu-hit") + (let ((gp-1 (new 'static 'boxed-array :type text-id (text-id progress-start-button))) + (s5-1 (current-time)) + ) + (while (not *common-text*) + (suspend) + ) + (until #f + (when (not (paused?)) + (cond + ((and (kiosk?) (or (cpad-pressed? 0 square) (time-elapsed? s5-1 (seconds 60)))) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 5)) + (suspend) + ) + ) + (set! s5-1 (current-time)) + ) + ((and (cpad-pressed? 0 up l-analog-up) (> (-> self selected) 0)) + (seekl! (-> self selected) 0 1) + (sound-play "dmenu-move") + ) + ((and (cpad-pressed? 0 down l-analog-down) (< (-> self selected) (+ (-> gp-1 length) -1))) + (seekl! (-> self selected) (+ (-> gp-1 length) -1) 1) + (sound-play "dmenu-move") + ) + ((or (cpad-pressed? 0 confirm) + (and (cpad-pressed? 0 start) + (or (not *debug-segment*) (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) + ) + ) + (sound-play "dmenu-pick") + (return (the-as object (-> self selected))) + ) + ) + (when (< (mod (current-time) 300) 210) + (set! sv-112 + (new 'stack 'font-context *font-default-matrix* 64 312 0.0 (font-color default) (font-flags shadow kerning)) + ) + (let ((v1-56 sv-112)) + (set! (-> v1-56 width) (the float 384)) + ) + (let ((v1-57 sv-112)) + (set! (-> v1-57 height) (the float 50)) + ) + (set! (-> sv-112 flags) (font-flags shadow kerning middle middle-vert large)) + (set! (-> sv-112 scale) 0.7) + (dotimes (s4-2 (-> gp-1 length)) + (if (= (-> self selected) s4-2) + (set! (-> sv-112 color) (font-color progress-old-selected)) + (set! (-> sv-112 color) (font-color white)) + ) + (print-game-text (lookup-text! *common-text* (-> gp-1 s4-2) #f) sv-112 #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> sv-112 origin y) 22.0) + ) + ) + ) + (suspend) + ) + ) + #f + -1 + ) + +(defun title-fade-out ((arg0 float)) + (setup + *screen-filter* + (new 'static 'vector) + (new 'static 'vector :w 128.0) + arg0 + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.4)) + (suspend) + ) + ) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (set! (-> *setting-control* user-current bg-a) 0.0) + (while (or (-> *setting-control* user-current movie) + (not *target*) + (not (and (-> *target* next-state) (= (-> *target* next-state name) 'target-title))) + (!= (-> *setting-control* user-current bg-a) 0.0) + ) + (suspend) + ) + (set! (-> *game-info* blackout-time) 0) + (set! (-> *setting-control* user-current bg-a-force) 0.0) + (disable *screen-filter*) + 0 + ) + +(defun title-progress ((arg0 symbol)) + (setup + *screen-filter* + (new 'static 'vector :w 128.0) + (new 'static 'vector :w 128.0) + (seconds-per-frame) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-progress #t 0.0 0) + (apply-settings *setting-control*) + (activate-progress *dproc* arg0) + (set-setting! 'allow-progress #f 0.0 0) + (dotimes (gp-1 5) + (suspend) + ) + (disable *screen-filter*) + (remove-setting! 'allow-error) + (while (-> *blit-displays-work* menu-mode) + (suspend) + ) + (set-setting! 'allow-error #f 0.0 0) + (apply-settings *setting-control*) + (set-blackout-frames (seconds 0.2)) + 0 + ) + +(defstate startup (title-control) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('scrap-book) + (go-virtual scrap-book (the-as int (-> block param 0))) + ) + (('control-spec) + (go-virtual control-spec (the-as int (-> block param 0))) + ) + ) + ) + :exit (behavior () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'startup) (= v1-3 'wait) (= v1-3 'idle) (= v1-3 'scrap-book) (= v1-3 'control-spec)) + ) + ) + ) + (disable *screen-filter*) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + ) + ) + :code (behavior () + (when (zero? (-> *game-info* demo-state)) + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-0 9) #f) + (set! (-> a1-0 8) #f) + (set! (-> a1-0 7) #f) + (set! (-> a1-0 6) #f) + (set! (-> a1-0 5) #f) + (set! (-> a1-0 4) #f) + (set! (-> a1-0 3) #f) + (set! (-> a1-0 2) 'introcst) + (set! (-> a1-0 1) 'wasintro) + (set! (-> a1-0 0) 'title) + (want-levels *load-state* a1-0) + ) + (when (zero? (-> *game-info* demo-state)) + (title-screen-change "demo-screen" 27 (the-as string #f) -1 #t #f) + (wait-for-press (seconds 1) (seconds 5) #t) + (title-screen-change (the-as string #f) -1 (the-as string #f) -1 #f #f) + (set-blackout-frames (seconds 0.2)) + ) + (when (and (not (kiosk?)) (not (demo?))) + (label cfg-8) + ;; og:preserve-this manual patch - stack memory here is reused as both mc-slot-info and event-message-block + (let ((gp-0 (new 'stack-no-clear 'mc-slot-info))) + (mc-get-slot-info 0 gp-0) + (when (zero? (-> gp-0 known)) + (set-blackout-frames (seconds 0.05)) + (suspend) + (goto cfg-8) + ) + (set! (-> *setting-control* user-default bg-a) 0.0) + (when (and (= (scf-get-territory) 1) (zero? (scf-get-language))) + (cond + ((or (zero? (-> gp-0 handle)) (zero? (-> gp-0 formatted)) (zero? (-> gp-0 inited)) (< (-> gp-0 last-file) 0)) + (set-blackout-frames 0) + (title-fade-out 1000.0) + (title-progress 'language-select) + ) + (else + (let ((v1-27 (-> gp-0 file (-> gp-0 last-file) language))) + (when (and (>= v1-27 0) (< v1-27 (the-as uint 11))) + (set! (-> *setting-control* user-default language) (the-as language-enum v1-27)) + (set! (-> *setting-control* user-default subtitle-language) (the-as language-enum v1-27)) + (if (< v1-27 (the-as uint 5)) + (set! (-> *setting-control* user-default audio-language) (the-as language-enum v1-27)) + ) + ) + ) + ) + ) + ) + (when (or (zero? (-> gp-0 handle)) + (and (nonzero? (-> gp-0 formatted)) (zero? (-> gp-0 inited)) (< (-> gp-0 mem-actual) (-> gp-0 mem-required))) + ) + (mem-copy! (the-as pointer *auto-save-info*) (the-as pointer gp-0) 300) + (set-blackout-frames 0) + (let ((s5-2 'insufficient-space)) + (if (zero? (-> gp-0 handle)) + (set! s5-2 'no-memory-card) + ) + (title-fade-out 1000.0) + (title-progress s5-2) + ) + ) + ) + ) + ) + (let ((v1-39 (-> *game-info* demo-state))) + (cond + ((zero? v1-39) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (initialize! *game-info* 'game (the-as game-save #f) "pre-intro-start" (the-as resetter-spec #f)) + ) + ((or (= v1-39 1) (= v1-39 2) (= v1-39 3)) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (-> *game-info* demo-state) + (send-event (ppointer->process *time-of-day*) 'change 'hour 18) + (let ((a1-12 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-12 9) #f) + (set! (-> a1-12 8) #f) + (set! (-> a1-12 7) #f) + (set! (-> a1-12 6) #f) + (set! (-> a1-12 5) #f) + (set! (-> a1-12 4) #f) + (set! (-> a1-12 3) #f) + (set! (-> a1-12 2) #f) + (set! (-> a1-12 1) 'wasintro) + (set! (-> a1-12 0) 'title) + (want-levels *load-state* a1-12) + ) + (want-display-level *load-state* 'wasintro 'display) + (while (!= (status-of-level-and-borrows *level* 'wasintro #f) 'active) + (suspend) + ) + (set-setting! 'fog-special-interp-targ #f 0.15 0) + (set-setting! 'fog-special-interp-rate #f 0.4 0) + (persist-with-delay *setting-control* 'fog-special-interp-targ 0 'fog-special-interp-targ #f 0.15 0) + (case (-> *game-info* demo-state) + ((3) + (set-setting! 'dust-storm-fog-scalar #f 2.0 0) + ) + ) + (suspend) + (let* ((s5-3 (position-in-front-of-camera! (new 'stack-no-clear 'vector) 184320.0 0.0)) + (s4-0 (get-process *default-dead-pool* manipy #x20000 1)) + (gp-2 (when s4-0 + (let ((t9-30 (method-of-type manipy activate))) + (t9-30 (the-as manipy s4-0) self "manipy" (the-as pointer #x70004000)) + ) + (run-now-in-process + s4-0 + manipy-init + s5-3 + (-> self entity) + (art-group-get-by-name *level* "skel-jakthreelogo" (the-as (pointer level) #f)) + #f + 0 + ) + (-> s4-0 ppointer) + ) + ) + ) + (set! (-> self logo) (the-as (pointer manipy) gp-2)) + (when gp-2 + (quaternion-axis-angle! + (-> (the-as process-drawable (-> gp-2 0)) root quat) + 0.0 + 1.0 + 0.0 + (+ 32768.0 (vector-y-angle (-> *math-camera* inv-camera-rot fvec))) + ) + (send-event (ppointer->process gp-2) 'eval (lambda :behavior manipy + () + (set! (-> self speed) 0.0) + (logior! (-> self draw status) (draw-control-status force-fade)) + (send-event self 'draw #f) + ) + ) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (set! (-> *game-info* demo-state) (the-as uint 2)) + ) + ) + ) + (go-virtual wait) + ) + :post (behavior () + (local-vars (gp-4 external-art-buffer)) + (set! (-> *setting-control* cam-current fov) (-> *setting-control* cam-target fov)) + (dotimes (v1-2 2) + (set! (-> self buffer v1-2 frame-lock) #f) + (set! (-> self have v1-2) -1) + ) + (dotimes (gp-0 2) + (let ((s5-0 (-> self want gp-0)) + (s4-0 (-> self want-name gp-0)) + ) + (when (>= s5-0 0) + (dotimes (s3-0 2) + (case (file-status (-> self buffer s3-0) s4-0 s5-0) + (('locked 'active) + (set! (-> self buffer s3-0 frame-lock) #t) + (set! (-> self have gp-0) s3-0) + ) + ) + ) + ) + ) + ) + (dotimes (gp-1 2) + (let ((a2-1 (-> self want gp-1)) + (a1-4 (-> self want-name gp-1)) + ) + (when (and (>= a2-1 0) (< (-> self have gp-1) 0)) + (dotimes (v1-32 2) + (when (not (-> self buffer v1-32 frame-lock)) + (set-pending-file (-> self buffer v1-32) a1-4 a2-1 (process->handle self) -1.0) + (goto cfg-33) + ) + ) + ) + ) + (label cfg-33) + ) + (dotimes (gp-2 2) + (update (-> self buffer gp-2)) + ) + (set! (-> self active) #f) + (when (>= (-> self draw) 0) + (dotimes (gp-3 2) + (when (file-status (-> self buffer gp-3) (-> self draw-name) (-> self draw)) + (set! gp-4 (-> self buffer gp-3)) + (goto cfg-46) + ) + ) + (set! gp-4 (the-as external-art-buffer #f)) + (label cfg-46) + (when (and gp-4 (-> gp-4 art-group)) + (with-dma-buffer-add-bucket ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id debug-no-zbuf1) + ) + (dma-buffer-add-gs-set s4-1 + (test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))) + ) + (let ((t1-0 (shl #x8000 16))) + (draw-sprite2d-xy s4-1 -256 -208 512 416 (the-as rgba t1-0) #x3fffff) + ) + ) + (let ((t9-6 draw-raw-image) + (a0-31 *blit-displays-work*) + (a1-15 577) + (a2-5 (-> gp-4 art-group)) + (a3-7 (new 'static 'vector :x 512.0 :y 416.0 :w 1.0)) + (t0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> t0-2 x) (-> *video-params* relative-x-scale)) + (set! (-> t0-2 y) 1.0) + (set! (-> t0-2 z) 0.0) + (set! (-> t0-2 w) 1.0) + (t9-6 (the-as bucket-id a0-31) (the-as art-group a1-15) (the-as int a2-5) a3-7 t0-2 (-> self level) 8) + ) + (set! (-> self active) #t) + ) + ) + ) + ) + +(defstate wait (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :trans (behavior () + 0 + ) + :code (behavior () + (remove-setting! 'allow-timeout) + (remove-setting! 'dialog-volume) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event + (ppointer->process (-> self logo)) + 'trans-hook + (lambda :behavior manipy + () + (seek! (-> self speed) 1.0 (* 0.5 (seconds-per-frame))) + (when (< 0.0 (-> self speed)) + (if (zero? (-> self draw force-fade)) + (send-event self 'draw #t) + ) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (-> self speed))))) + ) + (let ((v1-14 (position-in-front-of-camera! + (new 'stack-no-clear 'vector) + (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 184320.0 + 225280.0 + ) + 0.0 + ) + ) + (v0-3 (-> self root trans)) + ) + (set! (-> v0-3 quad) (-> v1-14 quad)) + v0-3 + ) + ) + ) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (remove-setting! 'dust-storm-fog-scalar) + (if (zero? (title-menu)) + (go-virtual idle) + ) + (sleep-code) + ) + :post (-> (method-of-type title-control startup) post) + ) + +(defstate idle (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :code (behavior () + (title-fade-out (* 3.0 (seconds-per-frame))) + (title-progress (if (or (demo?) (kiosk?)) + 'select-kiosk-start + 'title + ) + ) + (until (= (-> *game-info* current-continue level) 'title) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + ) + (go-virtual wait) + ) + :post (-> (method-of-type title-control startup) post) + ) + +(define *scrap-book-1* (new 'static 'boxed-array :type int16 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 97 + 98 + 99 + 100 + #x65 + #x67 + #x68 + #x69 + #x6a + #x6b + #x6c + #x6d + #x6e + #x70 + #x71 + #x72 + #x73 + #x74 + #x75 + #x76 + #x77 + #x78 + #x7b + #x7c + #x7d + #x7e + #x7f + #x80 + #x81 + #x82 + #x83 + #x84 + #x85 + #x86 + #x87 + #x88 + #x89 + #x8a + #x8b + #x8c + #x8d + #x8e + #x8f + #x90 + #x91 + #x92 + #x93 + #x94 + #x95 + #x96 + #x97 + #x98 + #x99 + #x9a + #x9b + #x9c + #x9d + #x9e + #x9f + #xa0 + #xa1 + #xa2 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + #x66 + #x79 + #x7a + #xca + #xcb + #xcc + #xcd + #xce + #xcf + #xd0 + #xd1 + #xd2 + #xd3 + #xd4 + #xd5 + #xd6 + #xd7 + #xd8 + #xd9 + #xda + ) + ) + +(define *scrap-book-2* (new 'static 'boxed-array :type int16 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + #x6f + #xac + #xad + #xae + #xaf + #xb0 + #xb1 + #xb2 + #xb3 + #xb4 + #xb5 + #xb6 + #xb7 + #xb8 + #xb9 + #xba + #xbb + #xbc + #xbd + #xbe + #xbf + #xc0 + #xdb + #xdc + #xdd + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + #xc1 + #xc2 + #xc3 + #xc4 + #xc5 + #xc6 + #xc7 + #xc8 + #xc9 + #xa3 + #xa4 + #xa5 + #xa6 + #xa7 + #xa8 + #xa9 + #xaa + #xab + ) + ) + +(defstate scrap-book (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :code (behavior ((arg0 int)) + (while (-> *blit-displays-work* menu-mode) + (suspend) + ) + (set-blackout-frames (seconds 1000)) + (let ((gp-1 (if (= arg0 2) + *scrap-book-2* + *scrap-book-1* + ) + ) + (s5-0 0) + ) + 0 + (let ((s4-0 (length gp-1)) + (s3-0 s5-0) + (s2-0 (+ s5-0 1)) + (v1-6 #f) + ) + (while (not (or (>= s3-0 s4-0) (= v1-6 'abort))) + (title-screen-change + "scrap-book" + (-> gp-1 s3-0) + "scrap-book" + (if (>= s2-0 s4-0) + -1 + (-> gp-1 s2-0) + ) + (= s3-0 s5-0) + #f + ) + (format #t "display index ~d page ~D (next is ~D)~%" s3-0 (-> gp-1 s3-0) (if (>= s2-0 s4-0) + -1 + (-> gp-1 s2-0) + ) + ) + (set! v1-6 (direction-press (seconds 1) (seconds 5) #t)) + (case v1-6 + (('back) + (set! s3-0 (max 0 (+ s3-0 -1))) + ) + (else + (+! s3-0 1) + ) + ) + (set! s2-0 (+ s3-0 1)) + ) + ) + ) + (title-screen-change (the-as string #f) -1 (the-as string #f) -1 #f #f) + (set-blackout-frames (seconds 0.2)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (go-virtual idle) + ) + :post (-> (method-of-type title-control startup) post) + ) + +(defstate control-spec (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :code (behavior ((arg0 int)) + (let* ((v1-0 arg0) + (a1-0 (cond + ((= v1-0 18) + 0 + ) + ((= v1-0 24) + 0 + ) + ((= v1-0 32) + 1 + ) + ((= v1-0 33) + 1 + ) + ((= v1-0 38) + 2 + ) + ((= v1-0 50) + 1 + ) + (else + -1 + ) + ) + ) + ) + (cond + ((!= a1-0 -1) + (title-screen-change "demo-screen" a1-0 (the-as string #f) -1 #t #t) + ) + (else + (set-setting! 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (set-blackout-frames (seconds 100)) + (apply-settings *setting-control*) + ) + ) + ) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.6)) + (suspend) + ) + ) + (process-spawn-function + process + (lambda ((arg0 game-task)) + (let ((v1-2 (-> *game-info* play-list arg0))) + (let ((s5-0 (-> v1-2 kiosk-play-continue)) + (gp-0 (play-task arg0 'debug 'kiosk)) + ) + (cond + ((pair? s5-0) + (persist-with-delay *setting-control* 'title-control-scene (seconds 1000000) 'render #f 0.0 0) + (start 'play (get-continue-by-name *game-info* gp-0)) + (process-spawn scene-player :init scene-player-init (car (cdr s5-0)) #t gp-0 :name "scene-player") + ) + (else + (persist-with-delay *setting-control* 'title-control (seconds 1000000) 'render #f 0.0 0) + (start 'play (get-continue-by-name *game-info* gp-0)) + ) + ) + ) + ) + ) + arg0 + :from *4k-dead-pool* + ) + (until #f + (suspend) + ) + #f + (title-screen-change (the-as string #f) -1 (the-as string #f) -1 #f #f) + (set-blackout-frames (seconds 0.2)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (go-virtual idle) + ) + :post (-> (method-of-type title-control startup) post) + ) + +(defbehavior title-control-init title-control () + (stack-size-set! (-> self main-thread) 2048) + (logclear! (-> self mask) (process-mask freeze pause menu progress actor-pause)) + (set! (-> self level) (level-get *level* 'title)) + (let ((a1-2 (if (and (nonzero? (-> self level entity)) (> (-> self level entity length) 0)) + (-> self level entity data 0 entity) + ) + ) + ) + (process-entity-set! self a1-2) + ) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-error #f 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'entity-name "camera-311" 0.0 0) + (apply-settings *setting-control*) + (dotimes (gp-0 2) + (set! (-> self buffer gp-0) + (new + 'process + 'external-art-buffer + gp-0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (level-get *level* 'title))) + (cond + ((not (-> gp-0 user-object (-> arg0 index))) + (let ((s4-0 (-> arg0 heap))) + (set! (-> s4-0 base) (kmalloc (-> gp-0 heap) #xd0000 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) #xd0000)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (set! (-> gp-0 user-object (-> arg0 index)) (the-as basic (-> arg0 heap base))) + ) + (else + (let ((v1-10 (-> arg0 heap))) + (set! (-> v1-10 base) (the-as pointer (-> gp-0 user-object (-> arg0 index)))) + (set! (-> v1-10 current) (-> v1-10 base)) + (set! (-> v1-10 top-base) (&+ (-> v1-10 base) #xd0000)) + (set! (-> v1-10 top) (-> v1-10 top-base)) + ) + ) + ) + ) + 0 + ) + #f + ) + ) + ) + (set! (-> self selected) 0) + (dotimes (v1-38 2) + (set! (-> self want v1-38) -1) + (set! (-> self have v1-38) -1) + ) + (set! (-> self draw) -1) + (set! (-> self active) #f) + (dotimes (v1-42 2) + (let ((a0-17 (&+ (-> self sprites 0 color-ptr) (* v1-42 64)))) + (set! (-> a0-17 0) 128) + (set! (-> a0-17 1) 128) + (set! (-> a0-17 2) 128) + (set! (-> a0-17 3) 128) + ) + (set! (-> self sprites v1-42 pos z) #xffffff) + (set! (-> self sprites v1-42 pos w) 0) + (set! (-> self sprites v1-42 scale-x) 1.0) + (set! (-> self sprites v1-42 scale-y) 1.0) + (set! (-> self sprites v1-42 angle) 0.0) + (set! (-> self sprites v1-42 flags) (hud-sprite-flags)) + (set! (-> self sprites v1-42 tid) (the-as texture-id #f)) + ) + (set! (-> self sprite-draw) (the-as uint 0)) + (set! (-> self logo) (the-as (pointer manipy) #f)) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intro #t) + (let ((v1-55 (-> *game-info* demo-state))) + (cond + ((zero? v1-55) + (set! (-> *setting-control* user-current fog-special-interp-targ) 0.0) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity 0) + ) + ((or (= v1-55 1) (= v1-55 2)) + ) + ((= v1-55 3) + (set! (-> *setting-control* user-current fog-special-interp-targ) 2.0) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x40000000) + (set-setting! 'fog-special-interp-targ #f 2.0 0) + (set-setting! 'fog-special-interp-rate #f 0.2 0) + ) + ((= v1-55 100) + (set! (-> *game-info* demo-state) (the-as uint 1)) + ) + ((= v1-55 201) + (go-virtual scrap-book 1) + ) + ((= v1-55 202) + (go-virtual scrap-book 2) + ) + ((= v1-55 203) + (go-virtual scrap-book 3) + ) + ) + ) + (set! *title-control* (the-as (pointer title-control) (process->ppointer self))) + (set! (-> *game-info* controller 0) (process->handle self)) + (go-virtual startup) + ) + +(defstate target-title (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change-mode) + (case (-> block param 0) + (('grab) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((a0-1 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> a0-1 next0))) + (while (!= a0-1 (-> *hud-engine* alive-list-end)) + (deactivate ((method-of-type connection get-process) (the-as connection a0-1))) + (set! a0-1 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + (ja-channel-set! 0) + (when arg0 + (let ((gp-1 (-> self mask)) + (s5-1 (-> *game-info* mode)) + ) + (set! (-> *game-info* mode) 'movie) + (logior! (-> self mask) (process-mask no-kill)) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + (set! (-> self mask) gp-1) + (set! (-> *game-info* mode) s5-1) + ) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (kill-by-type title-control *active-pool*) + (set! (-> self game controller 0) + (ppointer->handle + (process-spawn title-control :init title-control-init :name "title-control" :to *entity-pool*) + ) + ) + ) + ) + :exit (behavior () + (activate-hud self) + ) + :code (the-as (function symbol object) sleep-code) + :post target-no-move-post + ) + +(deftype museum-char (structure) + ((skel string) + (anim uint32) + (height-min float) + (height-max float) + (zoom-min float) + (zoom-max float) + (scale float) + (text-id text-id) + (cloth-reset-time time-frame) + (use-orient-cloth-reset? symbol) + (outtake-num uint32) + (outtake (array string)) + ) + ) + + +(deftype hirez-viewer (process-drawable) + ((angley float) + (anglex float) + (updown float) + (zoom float) + (char museum-char) + (pos-x float) + (dest-pos-x float) + (alpha float) + (cloth-reset-time time-frame) + (use-orient-cloth-reset? symbol) + (id sound-id) + (credits symbol) + ) + (:state-methods + idle + ) + ) + + +(defstate idle (hirez-viewer) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-right) + (set! (-> self dest-pos-x) 550.0) + ) + (('go-left) + (set! (-> self dest-pos-x) -550.0) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self id) (new 'static 'sound-id)) + (when (and (not (-> self credits)) + (nonzero? (-> self char outtake)) + (or (= (-> *setting-control* user-default subtitle-language) (language-enum english)) + (= (-> *setting-control* user-default subtitle-language) (language-enum french)) + (= (-> *setting-control* user-default subtitle-language) (language-enum german)) + (= (-> *setting-control* user-default subtitle-language) (language-enum spanish)) + (= (-> *setting-control* user-default subtitle-language) (language-enum italian)) + ) + ) + (add-setting! 'music-volume 'rel 0.25 0) + (set! (-> self id) (add-process + *gui-control* + self + (gui-channel hal) + (gui-action play) + (-> self char outtake (-> self char outtake-num)) + -99.0 + 0 + ) + ) + (sound-params-set! *gui-control* (-> self id) #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (+! (-> self char outtake-num) 1) + (when (= (-> self char outtake length) (-> self char outtake-num)) + (set! (-> self char outtake-num) (the-as uint 0)) + 0 + ) + ) + ) + :exit (behavior () + (set-action! + *gui-control* + (gui-action stop) + (-> self id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (and (nonzero? (-> self id)) (zero? (get-status *gui-control* (-> self id)))) + (set! (-> self id) (new 'static 'sound-id)) + (remove-setting! 'music-volume) + ) + (let ((v1-7 (-> *cpad-list* cpads 0))) + (let ((f1-0 (the float (+ (-> v1-7 rightx) -128))) + (f0-2 (the float (+ (-> v1-7 righty) -128))) + ) + (if (< 64.0 (fabs f1-0)) + (set! (-> self angley) (- (-> self angley) (* 364.0889 (seconds-per-frame) f1-0))) + ) + (when (< 64.0 (fabs f0-2)) + (set! (-> self anglex) (- (-> self anglex) (* 364.0889 (seconds-per-frame) f0-2))) + (set! (-> self anglex) (fmax -5461.3335 (fmin 5461.3335 (-> self anglex)))) + ) + ) + (the float (+ (-> v1-7 leftx) -128)) + (let ((f0-10 (the float (+ (-> v1-7 lefty) -128)))) + (when (< 64.0 (fabs f0-10)) + (+! (-> self zoom) (* 204.8 (seconds-per-frame) f0-10)) + (set! (-> self zoom) (fmax (fmin (-> self zoom) (-> self char zoom-max)) (-> self char zoom-min))) + ) + ) + (let ((f1-11 (the float (-> v1-7 abutton 9))) + (f0-18 (the float (-> v1-7 abutton 8))) + ) + (+! (-> self updown) (* 50.0 (seconds-per-frame) f1-11)) + (set! (-> self updown) (- (-> self updown) (* 50.0 (seconds-per-frame) f0-18))) + ) + ) + (set! (-> self updown) (fmax (fmin (-> self updown) (-> self char height-max)) (-> self char height-min))) + (+! (-> self pos-x) (* 5.0 (seconds-per-frame) (- (-> self dest-pos-x) (-> self pos-x)))) + (if (< 520.0 (fabs (-> self pos-x))) + (deactivate self) + ) + (if (nonzero? (-> self skel)) + (set-vector! (-> self draw color-mult) (-> self alpha) (-> self alpha) (-> self alpha) 1.0) + ) + (if (< (fabs (-> self dest-pos-x)) 200.0) + (seek! (-> self alpha) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> self alpha) 0.0 (* 2.0 (seconds-per-frame))) + ) + (cond + ((not (time-elapsed? (-> self state-time) (-> self cloth-reset-time))) + (process-drawable-cloth-command self '(reset)) + ) + ((-> self use-orient-cloth-reset?) + (process-drawable-cloth-command self '(set-flags local-space)) + ) + (else + (process-drawable-cloth-command self '(set-flags local-space-xyz)) + ) + ) + (let ((a2-3 (new 'stack-no-clear 'vector)) + (a1-7 (new 'stack-no-clear 'vector)) + (v1-40 (new 'stack-no-clear 'vector)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-40 quad) (-> *math-camera* trans quad)) + (set-vector! a3-0 (-> self pos-x) 0.0 0.0 1.0) + (set! (-> a2-3 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (let ((a0-42 a1-7)) + (let ((t0-8 (-> *math-camera* inv-camera-rot fvec))) + (let ((t1-0 (-> self zoom))) + (.mov vf7 t1-0) + ) + (.lvf vf5 (&-> t0-8 quad)) + ) + (.lvf vf4 (&-> v1-40 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-42 quad) vf6) + ) + (reverse-transform-point! gp-2 a1-7 a2-3 a3-0) + ) + (set! (-> self root trans quad) (-> gp-2 quad)) + ) + (matrix->quaternion (-> self root quat) (-> *math-camera* inv-camera-rot)) + (quaternion*! + (-> self root quat) + (-> self root quat) + (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* (-> self angley)) + ) + (let ((gp-4 (-> self root trans))) + (let ((s5-1 (-> self root trans))) + (let ((v1-50 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((a0-49 (- (-> self updown)))) + (.mov vf7 a0-49) + ) + (.lvf vf5 (&-> v1-50 quad)) + ) + (.lvf vf4 (&-> s5-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> gp-4 quad) vf6) + ) + (let ((gp-5 (new + 'stack + 'font-context + *font-default-matrix* + 20 + 350 + 0.0 + (font-color font-color-43) + (font-flags shadow kerning) + ) + ) + ) + (let ((v1-52 gp-5)) + (set! (-> v1-52 width) (the float 300)) + ) + (let ((v1-53 gp-5)) + (set! (-> v1-53 height) (the float 30)) + ) + (let ((v1-54 gp-5)) + (set! (-> v1-54 scale) 0.7) + ) + (let ((v1-55 gp-5)) + (set! (-> v1-55 alpha) (-> self alpha)) + ) + (set! (-> gp-5 flags) (font-flags shadow kerning large)) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> self char text-id) #f)) + (s5-2 *temp-string* gp-5 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + :code (behavior () + (cond + ((nonzero? (-> self skel)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self char anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja-post) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + (else + (until #f + (format *stdcon* "no skel~%") + (suspend) + ) + #f + ) + ) + ) + ) + +(defbehavior hirez-viewer-init-by-other hirez-viewer ((arg0 museum-char) (arg1 symbol) (arg2 symbol)) + (set! (-> self credits) arg2) + (set! (-> self char) arg0) + (set! (-> self root) (new 'process 'trsqv)) + (set-vector! (-> self root scale) (-> arg0 scale) (-> arg0 scale) (-> arg0 scale) 1.0) + (set! (-> self cloth-reset-time) (-> arg0 cloth-reset-time)) + (set! (-> self use-orient-cloth-reset?) (-> arg0 use-orient-cloth-reset?)) + (let ((s4-1 (art-group-get-by-name *level* (-> arg0 skel) (the-as (pointer level) #f)))) + (when s4-1 + (when (art-group-get-by-name *level* (the-as string (-> s4-1 data 0)) (&-> self level)) + (initialize-skeleton self (the-as skeleton-group s4-1) (the-as pair 0)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (logior! (-> self draw global-effect) (draw-control-global-effect title-light)) + ) + ) + ) + (set! (-> self pos-x) (if arg1 + 500.0 + -500.0 + ) + ) + (if arg2 + (set! (-> self dest-pos-x) -100.0) + (set! (-> self dest-pos-x) 0.0) + ) + (set! (-> self angley) 32768.0) + (set! (-> self zoom) (-> self char zoom-max)) + (set! (-> self updown) (* 0.5 (+ (-> self char height-max) (-> self char height-min)))) + (if (nonzero? (-> self skel)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + ) + (set! (-> self alpha) 0.0) + (go-virtual idle) + ) + +;; WARN: Return type mismatch int vs handle. +(defun spawn-hirez-viewer ((arg0 museum-char) (arg1 symbol) (arg2 symbol)) + (the-as + handle + (ppointer->handle + (process-spawn hirez-viewer arg0 arg1 arg2 :name "hirez-viewer" :to *entity-pool* :stack-size #x20000) + ) + ) + ) + +(define *museum-1* + (new 'static 'boxed-array :type museum-char + (new 'static 'museum-char + :skel "skel-jakc-highres" + :anim #x7 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.4 + :text-id (text-id text-07bd) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #f + :outtake (new 'static 'boxed-array :type string "jakout01" "jakout02" "jakout03" "jakout04") + ) + (new 'static 'museum-char + :skel "skel-ashelin-highres" + :anim #x5 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 1.0 + :text-id (text-id text-07c1) + :outtake (new 'static 'boxed-array :type string + "ashout01" + "ashout02" + "ashout03" + "ashout04" + "ashout05" + "ashout06" + "ashout07" + ) + ) + (new 'static 'museum-char + :skel "skel-keira-highres" + :anim #x4 + :height-min 2048.0 + :height-max 9011.2 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07fa) + ) + (new 'static 'museum-char + :skel "skel-kleever-highres" + :anim #xe + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 10240.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-07f7) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-onin-highres" + :anim #x6 + :height-min 2048.0 + :height-max 6144.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0801) + ) + (new 'static 'museum-char + :skel "skel-ottsel-daxpants" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07be) + :outtake (new 'static 'boxed-array :type string + "daxout01" + "daxout02" + "daxout03" + "daxout04" + "daxout05" + "daxout06" + "daxout07" + "daxout08" + ) + ) + (new 'static 'museum-char + :skel "skel-pecker-highres" + :anim #x5 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 1.0 + :text-id (text-id text-07bf) + :outtake (new 'static 'boxed-array :type string "pekout01") + ) + (new 'static 'museum-char + :skel "skel-samos-highres" + :anim #x5 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07f8) + ) + (new 'static 'museum-char + :skel "skel-seem-highres" + :anim #x6 + :height-min 2048.0 + :height-max 9011.2 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07f9) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #t + ) + (new 'static 'museum-char + :skel "skel-tess-highres" + :anim #x4 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07c2) + :outtake (new 'static 'boxed-array :type string "tesout01" "tesout02" "tesout03" "tesout04" "tesout05") + ) + (new 'static 'museum-char + :skel "skel-torn-highres" + :anim #x7 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 1.0 + :text-id (text-id text-07c0) + :outtake (new 'static 'boxed-array :type string "torout01" "torout02") + ) + (new 'static 'museum-char + :skel "skel-errol" + :anim #x3 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0804) + ) + (new 'static 'museum-char + :skel "skel-jinx-highres" + :anim #x4 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-0803) + ) + (new 'static 'museum-char + :skel "skel-damus-highres" + :anim #xa + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0802) + :cloth-reset-time (seconds 0.4) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-sig-highres" + :anim #x5 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-07fd) + ) + (new 'static 'museum-char + :skel "skel-veger-highres" + :anim #x6 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-0805) + :cloth-reset-time (seconds 0.4) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-ottsel-dummy" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07fb) + ) + (new 'static 'museum-char + :skel "skel-ottsel-leader" + :anim #x5 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07fe) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-ottsel-surfer" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07ff) + ) + (new 'static 'museum-char + :skel "skel-ottsel-tess" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07fc) + ) + (new 'static 'museum-char + :skel "skel-ottsel-veger" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-0800) + ) + ) + ) + +(defskelgroup skel-jak-one jak-one jak-one-lod0-jg jak-one-idle-ja + ((jak-one-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :sort 1 + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +(defskelgroup skel-brutter-highres brutter-highres brutter-highres-lod0-jg brutter-highres-brutter-idle-ja + ((brutter-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-baron-highres baron-highres baron-highres-lod0-jg baron-highres-idle-ja + ((baron-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-crocadog-highres crocadog-highres crocadog-highres-lod0-jg crocadog-highres-idle-ja + ((crocadog-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-red-crimson-guard-highres red-crimson-guard-highres red-crimson-guard-highres-lod0-jg red-crimson-guard-highres-red-crimson-guard-walk-ja + ((red-crimson-guard-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-kid-highres kid-highres kid-highres-lod0-jg kid-highres-kid-walk-ja + ((kid-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-kor-highres kor-highres kor-highres-lod0-jg kor-highres-idle-ja + ((kor-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-errol-highres errol-highres errol-highres-lod0-jg errol-highres-errol-walk-ja + ((errol-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-youngsamos-highres youngsamos-highres youngsamos-highres-lod0-jg youngsamos-highres-youngsamos-idle-ja + ((youngsamos-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-krew krew krew-lod0-jg krew-idle-ja + ((krew-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-vin vin vin-lod0-jg vin-idle-ja + ((vin-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-daxter-highres daxter-highres daxter-highres-lod0-jg daxter-highres-daxter-walk-ja + ((daxter-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(define *museum-2* + (new 'static 'boxed-array :type museum-char + (new 'static 'museum-char + :skel "skel-jak-highres" + :anim #x4 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.4 + :text-id (text-id text-07bc) + :outtake (new 'static 'boxed-array :type string "jakout01" "jakout02" "jakout03" "jakout04") + ) + (new 'static 'museum-char + :skel "skel-daxter-highres" + :anim #x3 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07be) + :outtake (new 'static 'boxed-array :type string + "daxout01" + "daxout02" + "daxout03" + "daxout04" + "daxout05" + "daxout06" + "daxout07" + "daxout08" + ) + ) + (new 'static 'museum-char + :skel "skel-vin" + :anim #x2 + :height-min 4096.0 + :height-max 10240.0 + :zoom-min 12288.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0894) + :outtake (new 'static 'boxed-array :type string "vinout01" "vinout02" "vinout03") + ) + (new 'static 'museum-char + :skel "skel-krew" + :anim #x2 + :height-min 4096.0 + :height-max 12288.0 + :zoom-min 12288.0 + :zoom-max 28672.0 + :scale 1.0 + :text-id (text-id text-0893) + :outtake (new 'static 'boxed-array :type string "krwout01" "krwout02" "krwout03" "krwout04" "krwout05") + ) + (new 'static 'museum-char + :skel "skel-errol-highres" + :anim #x3 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 1.0 + :text-id (text-id text-0830) + ) + (new 'static 'museum-char + :skel "skel-youngsamos-highres" + :anim #x2 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-0817) + ) + (new 'static 'museum-char + :skel "skel-kor-highres" + :anim #x3 + :height-min 2048.0 + :height-max 9011.2 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 1.0 + :text-id (text-id text-082f) + ) + (new 'static 'museum-char + :skel "skel-kid-highres" + :anim #x2 + :height-min 2048.0 + :height-max 6144.0 + :zoom-min 4096.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-082e) + ) + (new 'static 'museum-char + :skel "skel-baron-highres" + :anim #x3 + :height-min 2048.0 + :height-max 14336.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0816) + :outtake (new 'static 'boxed-array :type string "barout01" "barout02" "barout03" "barout04" "barout05") + ) + (new 'static 'museum-char + :skel "skel-red-crimson-guard-highres" + :anim #x2 + :height-min 2048.0 + :height-max 14336.0 + :zoom-min 12288.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0819) + ) + (new 'static 'museum-char + :skel "skel-brutter-highres" + :anim #x2 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0818) + ) + (new 'static 'museum-char + :skel "skel-crocadog-highres" + :anim #x2 + :height-min 2048.0 + :height-max 3276.8 + :zoom-min 12288.0 + :zoom-max 16384.0 + :scale 1.0 + :text-id (text-id text-082d) + ) + ) + ) + +(defskelgroup skel-flutflut flutflut flutflut-lod0-jg flutflut-flutflut-walk-ja + ((flutflut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-sidekick-human sidekick-human sidekick-human-lod0-jg sidekick-human-sidekick-human-idle-ja + ((sidekick-human-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-yellowsage yellowsage yellowsage-lod0-jg yellowsage-yellowsage-idle-ja + ((yellowsage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-redsage redsage redsage-lod0-jg redsage-redsage-idle-ja + ((redsage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-sculptor sculptor sculptor-lod0-jg sculptor-sculptor-idle-ja + ((sculptor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-ogreboss ogreboss ogreboss-lod0-jg ogreboss-ogreboss-idle-ja + ((ogreboss-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-minershort minershort minershort-lod0-jg minershort-minershort-idle-ja + ((minershort-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-minertall minertall minertall-lod0-jg minertall-minertall-idle-ja + ((minertall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-mayor mayor mayor-lod0-jg mayor-mayor-pace-ja + ((mayor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-geologist geologist geologist-lod0-jg geologist-geologist-idle-ja + ((geologist-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-gambler gambler gambler-lod0-jg gambler-gambler-idle-ja + ((gambler-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-fisher fisher fisher-lod0-jg fisher-fisher-idle-ja + ((fisher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-farmer farmer farmer-lod0-jg farmer-farmer-idle-ja + ((farmer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-billy billy billy-lod0-jg billy-billy-idle-ja + ((billy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-bluesage bluesage bluesage-lod0-jg bluesage-bluesage-idle-ja + ((bluesage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-babak babak babak-lod0-jg babak-babak-idle-ja + ((babak-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-bird-lady bird-lady bird-lady-lod0-jg bird-lady-bird-lady-idle-ja + ((bird-lady-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-evilbro evilbro evilbro-lod0-jg evilbro-evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-evilsis evilsis evilsis-lod0-jg evilsis-evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-explorer explorer explorer-lod0-jg explorer-explorer-idle-ja + ((explorer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-warrior warrior warrior-lod0-jg warrior-warrior-idle-ja + ((warrior-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(define *museum-3* (new 'static 'boxed-array :type museum-char + (new 'static 'museum-char + :skel "skel-jak-one" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 18432.0 + :scale 1.4 + :text-id (text-id text-07bb) + ) + (new 'static 'museum-char + :skel "skel-warrior" + :anim #x2 + :height-min 2048.0 + :height-max 16384.0 + :zoom-min 12288.0 + :zoom-max 32768.0 + :scale 1.0 + :text-id (text-id text-0820) + ) + (new 'static 'museum-char + :skel "skel-evilsis" + :anim #x3 + :height-min 2048.0 + :height-max 11059.2 + :zoom-min 6144.0 + :zoom-max 18432.0 + :scale 0.8 + :text-id (text-id text-0829) + ) + (new 'static 'museum-char + :skel "skel-evilbro" + :anim #x3 + :height-max 9830.4 + :zoom-min 6144.0 + :zoom-max 18432.0 + :scale 0.8 + :text-id (text-id text-0828) + ) + (new 'static 'museum-char + :skel "skel-bird-lady" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-0826) + ) + (new 'static 'museum-char + :skel "skel-explorer" + :anim #x3 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-082a) + ) + (new 'static 'museum-char + :skel "skel-billy" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-0832) + ) + (new 'static 'museum-char + :skel "skel-farmer" + :anim #x2 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 12288.0 + :zoom-max 28672.0 + :scale 0.8 + :text-id (text-id text-082b) + ) + (new 'static 'museum-char + :skel "skel-fisher" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-082c) + ) + (new 'static 'museum-char + :skel "skel-mayor" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-081b) + ) + (new 'static 'museum-char + :skel "skel-minershort" + :anim #x2 + :height-min 2048.0 + :height-max 6144.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-0823) + ) + (new 'static 'museum-char + :skel "skel-minertall" + :anim #x2 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-0824) + ) + (new 'static 'museum-char + :skel "skel-gambler" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-0822) + ) + (new 'static 'museum-char + :skel "skel-ogreboss" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.1 + :text-id (text-id text-0825) + ) + (new 'static 'museum-char + :skel "skel-sculptor" + :anim #x2 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-081d) + ) + (new 'static 'museum-char + :skel "skel-redsage" + :anim #x2 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 10240.0 + :zoom-max 22528.0 + :scale 0.8 + :text-id (text-id text-081c) + ) + (new 'static 'museum-char + :skel "skel-yellowsage" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 10240.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-081f) + ) + (new 'static 'museum-char + :skel "skel-sidekick-human" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-081e) + ) + (new 'static 'museum-char + :skel "skel-geologist" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-0821) + ) + (new 'static 'museum-char + :skel "skel-bluesage" + :anim #x2 + :height-min 2048.0 + :height-max 14336.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 0.8 + :text-id (text-id text-0827) + ) + (new 'static 'museum-char + :skel "skel-babak" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 12288.0 + :zoom-max 22528.0 + :scale 0.8 + :text-id (text-id text-0831) + ) + (new 'static 'museum-char + :skel "skel-flutflut" + :anim #x2 + :height-min 4096.0 + :height-max 8192.0 + :zoom-min 10240.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-081a) + ) + ) + ) + +(deftype highres-viewer-manager (process) + ((current int32) + (next int32) + (handle handle) + (left-right symbol) + (museum (array museum-char)) + (next-time time-frame) + ) + (:state-methods + idle + credits + ) + ) + + +(defstate idle (highres-viewer-manager) + :virtual #t + :trans (behavior () + (when (!= (-> self current) (-> self next)) + (set! (-> self current) (-> self next)) + (set! (-> self handle) (spawn-hirez-viewer (-> self museum (-> self current)) (-> self left-right) #f)) + ) + (let ((a0-3 (-> *cpad-list* cpads 0))) + (cond + ((logtest? (logclear (pad-buttons right) (-> a0-3 button0-abs 0)) (-> a0-3 button0-abs 1)) + (set! (-> self left-right) #f) + (send-event (handle->process (-> self handle)) 'go-right) + (set! (-> self next) (mod (+ (-> self next) 1) (-> self museum length))) + ) + ((let ((a0-13 (-> *cpad-list* cpads 0))) + (logtest? (logclear (pad-buttons left) (-> a0-13 button0-abs 0)) (-> a0-13 button0-abs 1)) + ) + (set! (-> self left-right) #t) + (send-event (handle->process (-> self handle)) 'go-left) + (set! (-> self next) (mod (+ (-> self museum length) -1 (-> self next)) (-> self museum length))) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate credits (highres-viewer-manager) + :virtual #t + :trans (behavior () + (when (!= (-> self current) (-> self next)) + (set-time! (-> self next-time)) + (set! (-> self current) (-> self next)) + (set! (-> self handle) (spawn-hirez-viewer (-> self museum (-> self current)) (-> self left-right) #t)) + ) + (when (time-elapsed? (-> self next-time) (seconds 20)) + (set! (-> self left-right) #f) + (send-event (handle->process (-> self handle)) 'go-right) + (set! (-> self next) (mod (+ (-> self next) 1) (-> self museum length))) + ) + (let ((a0-11 (-> *cpad-list* cpads 0))) + (cond + ((logtest? (logclear (pad-buttons left) (-> a0-11 button0-abs 0)) (-> a0-11 button0-abs 1)) + (set-time! (-> self next-time)) + (set! (-> self left-right) #f) + (send-event (handle->process (-> self handle)) 'go-right) + (set! (-> self next) (mod (+ (-> self next) 1) (-> self museum length))) + ) + ((let ((a0-21 (-> *cpad-list* cpads 0))) + (logtest? (logclear (pad-buttons right) (-> a0-21 button0-abs 0)) (-> a0-21 button0-abs 1)) + ) + (set-time! (-> self next-time)) + (set! (-> self left-right) #t) + (send-event (handle->process (-> self handle)) 'go-left) + (set! (-> self next) (mod (+ (-> self museum length) -1 (-> self next)) (-> self museum length))) + ) + ) + ) + (let ((gp-0 (new + 'stack + 'font-context + *font-default-matrix* + 20 + 20 + 0.0 + (font-color font-color-43) + (font-flags shadow kerning) + ) + ) + ) + (let ((v1-56 gp-0)) + (set! (-> v1-56 width) (the float 300)) + ) + (let ((v1-57 gp-0)) + (set! (-> v1-57 height) (the float 30)) + ) + (let ((v1-58 gp-0)) + (set! (-> v1-58 scale) 0.7) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0806) #f)) + (s5-0 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + :code sleep-code + ) + +(defbehavior hvm-init-by-other highres-viewer-manager ((arg0 (array museum-char)) (arg1 symbol)) + (set-setting! 'entity-name "camera-311" 0.0 0) + (set! (-> self museum) arg0) + (set! (-> self next) 0) + (set! (-> self current) -1) + (set! (-> self handle) (the-as handle #f)) + (set-time! (-> self next-time)) + (if arg1 + (go-virtual credits) + (go-virtual idle) + ) + ) + +;; WARN: Return type mismatch int vs handle. +(defun spawn-hirez-viewer-manager ((arg0 (array museum-char)) (arg1 symbol)) + (kill-by-type highres-viewer-manager *active-pool*) + (the-as handle (ppointer->handle (process-spawn + highres-viewer-manager + :init hvm-init-by-other + arg0 + arg1 + :name "highres-viewer-manager" + :to *entity-pool* + :stack-size 4096 + ) + ) + ) + ) + +(defun draw-end-credits ((arg0 level) (arg1 float)) + (let* ((f26-0 (lerp-scale 0.75 0.75 arg1 800.0 900.0)) + (f30-0 (- 416.0 (* 0.75 arg1))) + (s5-1 0) + (f28-0 0.0) + (s3-0 #t) + (s4-0 (new + 'stack + 'font-context + *font-default-matrix* + (- 496 (the int (* 375.0 f26-0))) + 0 + 0.0 + (font-color font-color-43) + (font-flags shadow kerning) + ) + ) + ) + (let ((v1-4 s4-0)) + (set! (-> v1-4 width) (* 375.0 f26-0)) + ) + (let ((v1-5 s4-0)) + (set! (-> v1-5 height) (the float 150)) + ) + (let ((v1-6 s4-0)) + (set! (-> v1-6 scale) (* 0.8 f26-0)) + ) + (set! (-> s4-0 flags) (font-flags shadow kerning middle large)) + (while (or s3-0 (and (< f30-0 (- f28-0)) (< s5-1 (-> *credits-ids* length)))) + (+! f30-0 f28-0) + (+! s5-1 1) + (let ((a0-7 (lookup-text arg0 (-> *credits-ids* s5-1) #t))) + (while (and a0-7 (zero? (-> a0-7 data 0)) (< s5-1 (-> *credits-ids* length))) + (+! s5-1 1) + (set! a0-7 (lookup-text arg0 (-> *credits-ids* s5-1) #t)) + ) + (set! f28-0 (if a0-7 + (+ 5.0 (print-game-text a0-7 s4-0 #t 35 (bucket-id hud-draw-hud-alpha))) + 40.0 + ) + ) + ) + (set! s3-0 #f) + ) + (cond + ((and (< 70 s5-1) (cpad-pressed? 0 triangle circle x)) + #t + ) + ((and (= s5-1 (-> *credits-ids* length)) (< f30-0 (- f28-0))) + #t + ) + (else + (set! (-> s4-0 origin y) f30-0) + (while (< (-> s4-0 origin y) 416.0) + (let ((a0-16 (lookup-text arg0 (-> *credits-ids* s5-1) #t))) + (while (and a0-16 (zero? (-> a0-16 data 0)) (< s5-1 (-> *credits-ids* length))) + (+! s5-1 1) + (set! a0-16 (lookup-text arg0 (-> *credits-ids* s5-1) #t)) + ) + (let ((f0-14 (if a0-16 + (+ 5.0 (print-game-text a0-16 s4-0 #f 35 (bucket-id hud-draw-hud-alpha))) + 40.0 + ) + ) + ) + (+! (-> s4-0 origin y) f0-14) + ) + ) + (+! s5-1 1) + ) + #f + ) + ) + ) + ) + +(defstate target-credits (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change-mode) + (case (-> block param 0) + (('grab) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 int)) + (set! (-> self control mod-surface) *empty-mods*) + (let ((a0-2 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> a0-2 next0))) + (while (!= a0-2 (-> *hud-engine* alive-list-end)) + (deactivate ((method-of-type connection get-process) (the-as connection a0-2))) + (set! a0-2 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + (ja-channel-set! 0) + (kill-by-type hirez-viewer *active-pool*) + (kill-by-type highres-viewer-manager *active-pool*) + (cond + ((= arg0 1) + (spawn-hirez-viewer-manager *museum-3* #f) + ) + ((= arg0 2) + (spawn-hirez-viewer-manager *museum-2* #f) + ) + ((= arg0 3) + (spawn-hirez-viewer-manager *museum-1* #f) + ) + (else + (spawn-hirez-viewer-manager *museum-1* #t) + ) + ) + (remove-setting! 'music-volume) + (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.001 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'music 'mcredits 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) + (apply-settings *setting-control*) + ) + :exit (behavior () + (activate-hud self) + (target-exit) + ) + :code (behavior ((arg0 int)) + (cond + ((zero? arg0) + (let ((s5-0 (current-time))) + (while (let ((a0-2 (level-get *level* 'title))) + (and a0-2 (not (draw-end-credits a0-2 (* 0.15 (the float (- (current-time) s5-0)))))) + ) + (suspend) + ) + ) + ) + (else + (until (cpad-pressed? 0 triangle) + (suspend) + ) + ) + ) + (suspend) + (kill-by-type hirez-viewer *active-pool*) + (kill-by-type highres-viewer-manager *active-pool*) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'music) + (remove-setting! 'sound-mode) + (apply-settings *setting-control*) + (let ((v1-25 (get-continue-by-name *game-info* (if (zero? arg0) + "wascity-start" + "title-restart" + ) + ) + ) + ) + (send-event self 'continue v1-25) + ) + (until #f + (suspend) + ) + #f + ) + :post target-no-move-post + ) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc index 8d475ba9f1..323f5f7dff 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc @@ -1646,7 +1646,7 @@ (text-name text-id) (pre-play-node game-task-node) (kiosk-play-node game-task-node) - (pre-play-continue object) + (pre-play-continue string) (play-node game-task-node) (play-continue string) (kiosk-play-continue object) diff --git a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc index 2da1155c7e..97cc55a382 100644 --- a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc @@ -40,13 +40,10 @@ (defbehavior arrive-at-continue target ((arg0 continue-point)) (cond ((logtest? (-> arg0 flags) (continue-flags title)) - enter-state - #t - (go target-title) + (go target-title #t) ) ((logtest? (-> arg0 flags) (continue-flags title-movie)) - enter-state - (go target-title) + (go target-title #f) ) ((logtest? (-> arg0 flags) (continue-flags intro)) (pre-intro-play) diff --git a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc index 7bce6a67f4..5935e500f4 100644 --- a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc @@ -292,7 +292,7 @@ target-swim-stance target-swim-up target-swim-walk - target-title + (target-title symbol) target-tube (target-tube-death symbol) (target-tube-hit symbol attack-info) diff --git a/test/decompiler/reference/jak3/engine/target/target2_REF.gc b/test/decompiler/reference/jak3/engine/target/target2_REF.gc index 7e7f3bca08..373eddded2 100644 --- a/test/decompiler/reference/jak3/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target2_REF.gc @@ -380,8 +380,7 @@ (go target-demo) ) (('title) - enter-state - (go target-title) + (go target-title #f) ) (('grab) (if (and (and (-> self next-state) (= (-> self next-state name) 'target-grab-ride)) (-> block param 1)) diff --git a/test/decompiler/reference/jak3/levels/title/credits-h_REF.gc b/test/decompiler/reference/jak3/levels/title/credits-h_REF.gc new file mode 100644 index 0000000000..f4578f76b1 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/title/credits-h_REF.gc @@ -0,0 +1,440 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *credits-ids*, type (array text-id) +(define *credits-ids* (new 'static 'boxed-array :type text-id + (text-id credits-020f) + (text-id credits-0211) + (text-id credits-0212) + (text-id credits-0213) + (text-id credits-0214) + (text-id credits-0215) + (text-id credits-0216) + (text-id credits-0217) + (text-id credits-0218) + (text-id credits-0219) + (text-id credits-021a) + (text-id credits-021b) + (text-id credits-0710) + (text-id credits-021d) + (text-id credits-021e) + (text-id credits-0711) + (text-id credits-0221) + (text-id credits-0222) + (text-id credits-0223) + (text-id credits-0224) + (text-id credits-0227) + (text-id credits-0228) + (text-id credits-0712) + (text-id credits-022a) + (text-id credits-022b) + (text-id credits-022c) + (text-id credits-022d) + (text-id credits-0713) + (text-id credits-0230) + (text-id credits-0231) + (text-id credits-0232) + (text-id credits-0714) + (text-id credits-0234) + (text-id credits-0235) + (text-id credits-0715) + (text-id credits-0239) + (text-id credits-023a) + (text-id credits-023b) + (text-id credits-023c) + (text-id credits-0716) + (text-id credits-023e) + (text-id credits-023f) + (text-id credits-0717) + (text-id credits-0718) + (text-id credits-0243) + (text-id credits-0719) + (text-id credits-071a) + (text-id credits-071b) + (text-id credits-071c) + (text-id credits-071d) + (text-id credits-071e) + (text-id credits-071f) + (text-id credits-0720) + (text-id credits-0721) + (text-id credits-0722) + (text-id credits-0723) + (text-id credits-0724) + (text-id credits-0725) + (text-id credits-0726) + (text-id credits-0727) + (text-id credits-0728) + (text-id credits-0245) + (text-id credits-077d) + (text-id credits-077e) + (text-id credits-0747) + (text-id credits-077f) + (text-id credits-0748) + (text-id credits-03e4) + (text-id credits-03e5) + (text-id credits-0729) + (text-id credits-024a) + (text-id credits-072a) + (text-id credits-024c) + (text-id credits-024f) + (text-id credits-072b) + (text-id credits-024e) + (text-id credits-0250) + (text-id credits-072c) + (text-id credits-03e7) + (text-id credits-072d) + (text-id credits-072e) + (text-id credits-072f) + (text-id credits-0252) + (text-id credits-0253) + (text-id credits-0254) + (text-id credits-0255) + (text-id credits-0256) + (text-id credits-0257) + (text-id credits-0780) + (text-id credits-0259) + (text-id credits-07b6) + (text-id credits-025e) + (text-id credits-07c9) + (text-id credits-0781) + (text-id credits-07ca) + (text-id credits-0261) + (text-id credits-0262) + (text-id credits-0263) + (text-id credits-0264) + (text-id credits-0265) + (text-id credits-0266) + (text-id credits-0267) + (text-id credits-0268) + (text-id credits-0854) + (text-id credits-0855) + (text-id credits-026d) + (text-id credits-026e) + (text-id credits-0881) + (text-id credits-0882) + (text-id credits-026f) + (text-id credits-0270) + (text-id credits-07c5) + (text-id credits-07c6) + (text-id credits-0273) + (text-id credits-0274) + (text-id credits-0275) + (text-id credits-0276) + (text-id credits-0279) + (text-id credits-027a) + (text-id credits-027b) + (text-id credits-027c) + (text-id credits-0281) + (text-id credits-0282) + (text-id credits-0283) + (text-id credits-0284) + (text-id credits-0730) + (text-id credits-0731) + (text-id credits-0732) + (text-id credits-0733) + (text-id credits-0734) + (text-id credits-0735) + (text-id credits-089e) + (text-id credits-089f) + (text-id credits-08a0) + (text-id credits-08a1) + (text-id credits-08a2) + (text-id credits-08a3) + (text-id credits-08a4) + (text-id credits-08a5) + (text-id credits-0736) + (text-id credits-0737) + (text-id credits-0738) + (text-id credits-028e) + (text-id credits-0739) + (text-id credits-0290) + (text-id credits-0293) + (text-id credits-0294) + (text-id credits-0295) + (text-id credits-0296) + (text-id credits-029b) + (text-id credits-03ef) + (text-id credits-073a) + (text-id credits-073b) + (text-id credits-073c) + (text-id credits-073d) + (text-id credits-073e) + (text-id credits-08a6) + (text-id credits-0740) + (text-id credits-0889) + (text-id credits-0742) + (text-id credits-0743) + (text-id credits-0744) + (text-id credits-07eb) + (text-id credits-0746) + (text-id credits-02a5) + (text-id credits-0226) + (text-id credits-0749) + (text-id credits-074a) + (text-id credits-074b) + (text-id credits-074c) + (text-id credits-074d) + (text-id credits-074e) + (text-id credits-074f) + (text-id credits-0750) + (text-id credits-0751) + (text-id credits-0752) + (text-id credits-0782) + (text-id credits-0783) + (text-id credits-02a8) + (text-id credits-02a9) + (text-id credits-02aa) + (text-id credits-02ab) + (text-id credits-02ac) + (text-id credits-02ae) + (text-id credits-0753) + (text-id credits-02b0) + (text-id credits-0754) + (text-id credits-02b2) + (text-id credits-085b) + (text-id credits-085c) + (text-id credits-085d) + (text-id credits-085e) + (text-id credits-02c3) + (text-id credits-02c4) + (text-id credits-0755) + (text-id credits-02c6) + (text-id credits-0756) + (text-id credits-02c8) + (text-id credits-02c9) + (text-id credits-0757) + (text-id credits-0758) + (text-id credits-02d6) + (text-id credits-0759) + (text-id credits-08a7) + (text-id credits-075a) + (text-id credits-075b) + (text-id credits-075c) + (text-id credits-075d) + (text-id credits-075e) + (text-id credits-0760) + (text-id credits-02ed) + (text-id credits-02e1) + (text-id credits-02db) + (text-id credits-0761) + (text-id credits-0762) + (text-id credits-02ea) + (text-id credits-0763) + (text-id credits-0764) + (text-id credits-0766) + (text-id credits-08a8) + (text-id credits-089c) + (text-id credits-0767) + (text-id credits-08a9) + (text-id credits-0770) + (text-id credits-0768) + (text-id credits-0769) + (text-id credits-076a) + (text-id credits-076b) + (text-id credits-08aa) + (text-id credits-02e0) + (text-id credits-076c) + (text-id credits-076d) + (text-id credits-08ab) + (text-id credits-076e) + (text-id credits-076f) + (text-id credits-089d) + (text-id credits-02d4) + (text-id credits-0771) + (text-id credits-08ac) + (text-id credits-08ad) + (text-id credits-0772) + (text-id credits-08ae) + (text-id credits-08af) + (text-id credits-0773) + (text-id credits-08b0) + (text-id credits-075f) + (text-id credits-08b1) + (text-id credits-08b2) + (text-id credits-08b3) + (text-id credits-08b4) + (text-id credits-08b5) + (text-id credits-0774) + (text-id credits-08b6) + (text-id credits-02cc) + (text-id credits-02cd) + (text-id credits-02ce) + (text-id credits-02cf) + (text-id credits-03f1) + (text-id credits-02b4) + (text-id credits-078f) + (text-id credits-0790) + (text-id credits-0791) + (text-id credits-0792) + (text-id credits-0793) + (text-id credits-02b7) + (text-id credits-02b8) + (text-id credits-0794) + (text-id credits-0795) + (text-id credits-0796) + (text-id credits-0797) + (text-id credits-0798) + (text-id credits-0799) + (text-id credits-079a) + (text-id credits-079b) + (text-id credits-079c) + (text-id credits-079d) + (text-id credits-03f3) + (text-id credits-02ba) + (text-id credits-02bb) + (text-id credits-02bc) + (text-id credits-03f4) + (text-id credits-02be) + (text-id credits-03f5) + (text-id credits-02c0) + (text-id credits-079e) + (text-id credits-079f) + (text-id credits-07a0) + (text-id credits-07a1) + (text-id credits-07a2) + (text-id credits-07a3) + (text-id credits-07a4) + (text-id credits-03f6) + (text-id credits-02c2) + (text-id credits-07a5) + (text-id credits-07a6) + (text-id credits-07a7) + (text-id credits-07a8) + (text-id credits-07a9) + (text-id credits-07aa) + (text-id credits-07ab) + (text-id credits-07ac) + (text-id credits-07ad) + (text-id credits-07ae) + (text-id credits-07af) + (text-id credits-07b0) + (text-id credits-07b1) + (text-id credits-07b2) + (text-id credits-02f4) + (text-id credits-02f5) + (text-id credits-02f6) + (text-id credits-02f7) + (text-id credits-02f8) + (text-id credits-02f9) + (text-id credits-02fa) + (text-id credits-02fb) + (text-id credits-02fc) + (text-id credits-02fd) + (text-id credits-02fe) + (text-id credits-02ff) + (text-id credits-0300) + (text-id credits-0301) + (text-id credits-0302) + (text-id credits-0303) + (text-id credits-0304) + (text-id credits-0305) + (text-id credits-0306) + (text-id credits-0307) + (text-id credits-0347) + (text-id credits-0348) + (text-id credits-0349) + (text-id credits-06cb) + (text-id credits-06cc) + (text-id credits-034a) + (text-id credits-034b) + (text-id credits-06cd) + (text-id credits-06ce) + (text-id credits-034c) + (text-id credits-034d) + (text-id credits-06cf) + (text-id credits-06d0) + (text-id credits-06d1) + (text-id credits-034f) + (text-id credits-06d2) + (text-id credits-040f) + (text-id credits-0351) + (text-id credits-0352) + (text-id credits-03fc) + (text-id credits-0356) + (text-id credits-06d3) + (text-id credits-0358) + (text-id credits-06d4) + (text-id credits-0359) + (text-id credits-06d5) + (text-id credits-06d6) + (text-id credits-06d7) + (text-id credits-06d8) + (text-id credits-06d9) + (text-id credits-035d) + (text-id credits-035e) + (text-id credits-035f) + (text-id credits-0360) + (text-id credits-0361) + (text-id credits-06da) + (text-id credits-0363) + (text-id credits-0364) + (text-id credits-0365) + (text-id credits-0366) + (text-id credits-06db) + (text-id credits-06dc) + (text-id credits-06dd) + (text-id credits-0367) + (text-id credits-0368) + (text-id credits-03fd) + (text-id credits-036a) + (text-id credits-03fe) + (text-id credits-036c) + (text-id credits-036d) + (text-id credits-036e) + (text-id credits-036f) + (text-id credits-0370) + (text-id credits-03ff) + (text-id credits-080e) + (text-id credits-080f) + (text-id credits-0810) + (text-id credits-0811) + (text-id credits-0400) + (text-id credits-0812) + (text-id credits-0401) + (text-id credits-0379) + (text-id credits-0813) + (text-id credits-0403) + (text-id credits-037d) + (text-id credits-037e) + (text-id credits-037f) + (text-id credits-0380) + (text-id credits-0814) + (text-id credits-0815) + (text-id credits-0382) + (text-id credits-0383) + (text-id credits-0384) + (text-id credits-0385) + (text-id credits-0386) + (text-id credits-0387) + (text-id credits-0388) + (text-id credits-038a) + (text-id credits-038b) + (text-id credits-07ec) + (text-id credits-038d) + (text-id credits-07ed) + (text-id credits-0391) + (text-id credits-07ee) + (text-id credits-0397) + (text-id credits-0398) + (text-id credits-0393) + (text-id credits-0394) + (text-id credits-0395) + (text-id credits-0396) + (text-id credits-0399) + (text-id credits-039a) + (text-id credits-07ef) + (text-id credits-07f0) + (text-id credits-0324) + (text-id credits-039c) + (text-id credits-0404) + (text-id credits-07f1) + (text-id credits-039f) + (text-id credits-07f2) + (text-id credits-07f3) + (text-id credits-07f4) + (text-id credits-03a1) + (text-id credits-03b5) + (text-id credits-07f5) + (text-id credits-03be) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/title/credits_REF.gc b/test/decompiler/reference/jak3/levels/title/credits_REF.gc new file mode 100644 index 0000000000..8e4b1f21d4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/title/credits_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc new file mode 100644 index 0000000000..90450da4cd --- /dev/null +++ b/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc @@ -0,0 +1,2762 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type title-control +(deftype title-control (process) + ((selected int32) + (sprites hud-sprite 2 :inline) + (sprite-pos vector :inline) + (sprite-draw uint32) + (buffer external-art-buffer 2) + (want int32 2) + (want-name string 2) + (have int32 2) + (draw int32) + (draw-name string) + (active symbol) + (spark-time time-frame) + (gui-id sound-id) + (logo (pointer manipy)) + ) + (:state-methods + startup + wait + idle + (scrap-book int) + (control-spec int) + ) + ) + +;; definition for method 3 of type title-control +(defmethod inspect ((this title-control)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tselected: ~D~%" (-> this selected)) + (format #t "~2Tsprites[2] @ #x~X~%" (-> this sprites)) + (format #t "~2Tsprite-pos: ~`vector`P~%" (-> this sprite-pos)) + (format #t "~2Tsprite-draw: ~D~%" (-> this sprite-draw)) + (format #t "~2Tbuffer[2] @ #x~X~%" (-> this buffer)) + (dotimes (s5-0 2) + (format #t "~T [~D]~2Tbuffer: ~A~%" s5-0 (-> this buffer s5-0)) + ) + (format #t "~2Twant[2] @ #x~X~%" (-> this want)) + (format #t "~2Twant-name[2] @ #x~X~%" (-> this want-name)) + (format #t "~2Thave[2] @ #x~X~%" (-> this have)) + (format #t "~2Tdraw: ~D~%" (-> this draw)) + (format #t "~2Tdraw-name: ~A~%" (-> this draw-name)) + (format #t "~2Tactive: ~A~%" (-> this active)) + (format #t "~2Tspark-time: ~D~%" (-> this spark-time)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) + (format #t "~2Tlogo: #x~X~%" (-> this logo)) + (label cfg-7) + this + ) + +;; definition for method 7 of type title-control +;; WARN: Return type mismatch process vs title-control. +(defmethod relocate ((this title-control) (offset int)) + (dotimes (v1-0 2) + (if (nonzero? (-> this buffer v1-0)) + (&+! (-> this buffer v1-0) offset) + ) + ) + (the-as title-control ((method-of-type process relocate) this offset)) + ) + +;; definition for method 10 of type title-control +(defmethod deactivate ((this title-control)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intro #f) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (dotimes (s5-0 2) + (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + ) + (dotimes (s5-1 2) + (update (-> this buffer s5-1)) + ) + ((method-of-type process deactivate) this) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-jakthreelogo jakthreelogo jakthreelogo-lod0-jg jakthreelogo-idle-ja + ((jakthreelogo-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +;; definition for function title-screen-change +(defbehavior title-screen-change title-control ((arg0 string) (arg1 int) (arg2 string) (arg3 int) (arg4 symbol) (arg5 symbol)) + (when arg5 + (let ((s1-0 (the-as int (-> *setting-control* user-current language)))) + 0 + (if (and (= (the-as language-enum s1-0) (language-enum english)) (= (scf-get-territory) 1)) + (set! s1-0 11) + ) + (let ((v1-6 (cond + ((zero? s1-0) + 0 + ) + ((= s1-0 11) + 1 + ) + ((= s1-0 1) + 2 + ) + ((= s1-0 2) + 3 + ) + ((= s1-0 4) + 4 + ) + ((= s1-0 3) + 5 + ) + (else + 0 + ) + ) + ) + ) + (if (>= arg1 0) + (+! arg1 (* 3 v1-6)) + ) + (if (>= arg3 0) + (+! arg3 (* 3 v1-6)) + ) + ) + ) + ) + (set! (-> self want-name 0) arg0) + (set! (-> self want 0) arg1) + (set! (-> self want-name 1) (-> self draw-name)) + (set! (-> self want 1) (-> self draw)) + (when arg4 + (set-setting! 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (set-blackout-frames 0) + (apply-settings *setting-control*) + ) + (when (>= (-> self draw) 0) + (set-setting! 'bg-a 'abs 1.0 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + ) + (set! (-> self draw) arg1) + (set! (-> self draw-name) arg0) + (set! (-> self active) #f) + (while (and (>= (-> self draw) 0) (not (-> self active))) + (suspend) + ) + (remove-setting! 'bg-a) + (set! (-> self want-name 1) arg2) + (set! (-> self want 1) arg3) + 0 + ) + +;; definition for function wait-for-press +(defun wait-for-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (let ((s2-0 (current-time)) + (s3-0 #f) + ) + (while (not (or (time-elapsed? s2-0 arg1) (and (time-elapsed? s2-0 arg0) s3-0))) + (if (cpad-pressed? 0 confirm) + (set! s3-0 #t) + ) + (when (and arg2 (cpad-pressed? 0 triangle)) + (set! s3-0 'abort) + (goto cfg-17) + ) + (suspend) + ) + (label cfg-17) + s3-0 + ) + ) + +;; definition for function direction-press +(defun direction-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (let ((s2-0 (current-time)) + (s3-0 #f) + ) + (while (not (or (time-elapsed? s2-0 arg1) (and (time-elapsed? s2-0 arg0) s3-0))) + (if (cpad-pressed? 0 r1 confirm) + (set! s3-0 'forward) + ) + (if (cpad-pressed? 0 l1) + (set! s3-0 'back) + ) + (when (and arg2 (cpad-pressed? 0 triangle)) + (set! s3-0 'abort) + (goto cfg-19) + ) + (suspend) + ) + (label cfg-19) + s3-0 + ) + ) + +;; definition for function title-menu +;; WARN: Return type mismatch int vs object. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior title-menu title-control () + (local-vars (sv-112 font-context)) + (sound-play "dmenu-hit") + (let ((gp-1 (new 'static 'boxed-array :type text-id (text-id progress-start-button))) + (s5-1 (current-time)) + ) + (while (not *common-text*) + (suspend) + ) + (until #f + (when (not (paused?)) + (cond + ((and (kiosk?) (or (cpad-pressed? 0 square) (time-elapsed? s5-1 (seconds 60)))) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 5)) + (suspend) + ) + ) + (set! s5-1 (current-time)) + ) + ((and (cpad-pressed? 0 up l-analog-up) (> (-> self selected) 0)) + (seekl! (-> self selected) 0 1) + (sound-play "dmenu-move") + ) + ((and (cpad-pressed? 0 down l-analog-down) (< (-> self selected) (+ (-> gp-1 length) -1))) + (seekl! (-> self selected) (+ (-> gp-1 length) -1) 1) + (sound-play "dmenu-move") + ) + ((or (cpad-pressed? 0 confirm) + (and (cpad-pressed? 0 start) + (or (not *debug-segment*) (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) + ) + ) + (sound-play "dmenu-pick") + (return (the-as object (-> self selected))) + ) + ) + (when (< (mod (current-time) 300) 210) + (set! sv-112 + (new 'stack 'font-context *font-default-matrix* 64 312 0.0 (font-color default) (font-flags shadow kerning)) + ) + (let ((v1-56 sv-112)) + (set! (-> v1-56 width) (the float 384)) + ) + (let ((v1-57 sv-112)) + (set! (-> v1-57 height) (the float 50)) + ) + (set! (-> sv-112 flags) (font-flags shadow kerning middle middle-vert large)) + (set! (-> sv-112 scale) 0.7) + (dotimes (s4-2 (-> gp-1 length)) + (if (= (-> self selected) s4-2) + (set! (-> sv-112 color) (font-color progress-old-selected)) + (set! (-> sv-112 color) (font-color white)) + ) + (print-game-text (lookup-text! *common-text* (-> gp-1 s4-2) #f) sv-112 #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> sv-112 origin y) 22.0) + ) + ) + ) + (suspend) + ) + ) + #f + -1 + ) + +;; definition for function title-fade-out +(defun title-fade-out ((arg0 float)) + (setup + *screen-filter* + (new 'static 'vector) + (new 'static 'vector :w 128.0) + arg0 + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.4)) + (suspend) + ) + ) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (set! (-> *setting-control* user-current bg-a) 0.0) + (while (or (-> *setting-control* user-current movie) + (not *target*) + (not (and (-> *target* next-state) (= (-> *target* next-state name) 'target-title))) + (!= (-> *setting-control* user-current bg-a) 0.0) + ) + (suspend) + ) + (set! (-> *game-info* blackout-time) 0) + (set! (-> *setting-control* user-current bg-a-force) 0.0) + (disable *screen-filter*) + 0 + ) + +;; definition for function title-progress +(defun title-progress ((arg0 symbol)) + (setup + *screen-filter* + (new 'static 'vector :w 128.0) + (new 'static 'vector :w 128.0) + (seconds-per-frame) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-progress #t 0.0 0) + (apply-settings *setting-control*) + (activate-progress *dproc* arg0) + (set-setting! 'allow-progress #f 0.0 0) + (dotimes (gp-1 5) + (suspend) + ) + (disable *screen-filter*) + (remove-setting! 'allow-error) + (while (-> *blit-displays-work* menu-mode) + (suspend) + ) + (set-setting! 'allow-error #f 0.0 0) + (apply-settings *setting-control*) + (set-blackout-frames (seconds 0.2)) + 0 + ) + +;; failed to figure out what this is: +(defstate startup (title-control) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('scrap-book) + (go-virtual scrap-book (the-as int (-> block param 0))) + ) + (('control-spec) + (go-virtual control-spec (the-as int (-> block param 0))) + ) + ) + ) + :exit (behavior () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'startup) (= v1-3 'wait) (= v1-3 'idle) (= v1-3 'scrap-book) (= v1-3 'control-spec)) + ) + ) + ) + (disable *screen-filter*) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + ) + ) + :code (behavior () + (when (zero? (-> *game-info* demo-state)) + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-0 9) #f) + (set! (-> a1-0 8) #f) + (set! (-> a1-0 7) #f) + (set! (-> a1-0 6) #f) + (set! (-> a1-0 5) #f) + (set! (-> a1-0 4) #f) + (set! (-> a1-0 3) #f) + (set! (-> a1-0 2) 'introcst) + (set! (-> a1-0 1) 'wasintro) + (set! (-> a1-0 0) 'title) + (want-levels *load-state* a1-0) + ) + (when (zero? (-> *game-info* demo-state)) + (title-screen-change "demo-screen" 27 (the-as string #f) -1 #t #f) + (wait-for-press (seconds 1) (seconds 5) #t) + (title-screen-change (the-as string #f) -1 (the-as string #f) -1 #f #f) + (set-blackout-frames (seconds 0.2)) + ) + (when (and (not (kiosk?)) (not (demo?))) + (label cfg-8) + (let ((gp-0 (the-as mc-slot-info (new 'stack-no-clear 'event-message-block)))) + (mc-get-slot-info 0 gp-0) + (when (zero? (-> gp-0 known)) + (set-blackout-frames (seconds 0.05)) + (suspend) + (goto cfg-8) + ) + (set! (-> *setting-control* user-default bg-a) 0.0) + (when (and (= (scf-get-territory) 1) (zero? (scf-get-language))) + (cond + ((or (zero? (-> gp-0 handle)) (zero? (-> gp-0 formatted)) (zero? (-> gp-0 inited)) (< (-> gp-0 last-file) 0)) + (set-blackout-frames 0) + (title-fade-out 1000.0) + (title-progress 'language-select) + ) + (else + (let ((v1-27 (-> gp-0 file (-> gp-0 last-file) language))) + (when (and (>= v1-27 0) (< v1-27 (the-as uint 11))) + (set! (-> *setting-control* user-default language) (the-as language-enum v1-27)) + (set! (-> *setting-control* user-default subtitle-language) (the-as language-enum v1-27)) + (if (< v1-27 (the-as uint 5)) + (set! (-> *setting-control* user-default audio-language) (the-as language-enum v1-27)) + ) + ) + ) + ) + ) + ) + (when (or (zero? (-> gp-0 handle)) + (and (nonzero? (-> gp-0 formatted)) (zero? (-> gp-0 inited)) (< (-> gp-0 mem-actual) (-> gp-0 mem-required))) + ) + (mem-copy! (the-as pointer *auto-save-info*) (the-as pointer gp-0) 300) + (set-blackout-frames 0) + (let ((s5-2 'insufficient-space)) + (if (zero? (-> gp-0 handle)) + (set! s5-2 'no-memory-card) + ) + (title-fade-out 1000.0) + (title-progress s5-2) + ) + ) + ) + ) + ) + (let ((v1-39 (-> *game-info* demo-state))) + (cond + ((zero? v1-39) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (initialize! *game-info* 'game (the-as game-save #f) "pre-intro-start" (the-as resetter-spec #f)) + ) + ((or (= v1-39 1) (= v1-39 2) (= v1-39 3)) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (-> *game-info* demo-state) + (send-event (ppointer->process *time-of-day*) 'change 'hour 18) + (let ((a1-12 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-12 9) #f) + (set! (-> a1-12 8) #f) + (set! (-> a1-12 7) #f) + (set! (-> a1-12 6) #f) + (set! (-> a1-12 5) #f) + (set! (-> a1-12 4) #f) + (set! (-> a1-12 3) #f) + (set! (-> a1-12 2) #f) + (set! (-> a1-12 1) 'wasintro) + (set! (-> a1-12 0) 'title) + (want-levels *load-state* a1-12) + ) + (want-display-level *load-state* 'wasintro 'display) + (while (!= (status-of-level-and-borrows *level* 'wasintro #f) 'active) + (suspend) + ) + (set-setting! 'fog-special-interp-targ #f 0.15 0) + (set-setting! 'fog-special-interp-rate #f 0.4 0) + (persist-with-delay *setting-control* 'fog-special-interp-targ 0 'fog-special-interp-targ #f 0.15 0) + (case (-> *game-info* demo-state) + ((3) + (set-setting! 'dust-storm-fog-scalar #f 2.0 0) + ) + ) + (suspend) + (let* ((s5-3 (position-in-front-of-camera! (new 'stack-no-clear 'vector) 184320.0 0.0)) + (s4-0 (get-process *default-dead-pool* manipy #x20000 1)) + (gp-2 (when s4-0 + (let ((t9-30 (method-of-type manipy activate))) + (t9-30 (the-as manipy s4-0) self "manipy" (the-as pointer #x70004000)) + ) + (run-now-in-process + s4-0 + manipy-init + s5-3 + (-> self entity) + (art-group-get-by-name *level* "skel-jakthreelogo" (the-as (pointer level) #f)) + #f + 0 + ) + (-> s4-0 ppointer) + ) + ) + ) + (set! (-> self logo) (the-as (pointer manipy) gp-2)) + (when gp-2 + (quaternion-axis-angle! + (-> (the-as process-drawable (-> gp-2 0)) root quat) + 0.0 + 1.0 + 0.0 + (+ 32768.0 (vector-y-angle (-> *math-camera* inv-camera-rot fvec))) + ) + (send-event (ppointer->process gp-2) 'eval (lambda :behavior manipy + () + (set! (-> self speed) 0.0) + (logior! (-> self draw status) (draw-control-status force-fade)) + (send-event self 'draw #f) + ) + ) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (set! (-> *game-info* demo-state) (the-as uint 2)) + ) + ) + ) + (go-virtual wait) + ) + :post (behavior () + (local-vars (gp-4 external-art-buffer)) + (set! (-> *setting-control* cam-current fov) (-> *setting-control* cam-target fov)) + (dotimes (v1-2 2) + (set! (-> self buffer v1-2 frame-lock) #f) + (set! (-> self have v1-2) -1) + ) + (dotimes (gp-0 2) + (let ((s5-0 (-> self want gp-0)) + (s4-0 (-> self want-name gp-0)) + ) + (when (>= s5-0 0) + (dotimes (s3-0 2) + (case (file-status (-> self buffer s3-0) s4-0 s5-0) + (('locked 'active) + (set! (-> self buffer s3-0 frame-lock) #t) + (set! (-> self have gp-0) s3-0) + ) + ) + ) + ) + ) + ) + (dotimes (gp-1 2) + (let ((a2-1 (-> self want gp-1)) + (a1-4 (-> self want-name gp-1)) + ) + (when (and (>= a2-1 0) (< (-> self have gp-1) 0)) + (dotimes (v1-32 2) + (when (not (-> self buffer v1-32 frame-lock)) + (set-pending-file (-> self buffer v1-32) a1-4 a2-1 (process->handle self) -1.0) + (goto cfg-33) + ) + ) + ) + ) + (label cfg-33) + ) + (dotimes (gp-2 2) + (update (-> self buffer gp-2)) + ) + (set! (-> self active) #f) + (when (>= (-> self draw) 0) + (dotimes (gp-3 2) + (when (file-status (-> self buffer gp-3) (-> self draw-name) (-> self draw)) + (set! gp-4 (-> self buffer gp-3)) + (goto cfg-46) + ) + ) + (set! gp-4 (the-as external-art-buffer #f)) + (label cfg-46) + (when (and gp-4 (-> gp-4 art-group)) + (with-dma-buffer-add-bucket ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id debug-no-zbuf1) + ) + (dma-buffer-add-gs-set s4-1 + (test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))) + ) + (let ((t1-0 (shl #x8000 16))) + (draw-sprite2d-xy s4-1 -256 -208 512 416 (the-as rgba t1-0) #x3fffff) + ) + ) + (let ((t9-6 draw-raw-image) + (a0-31 *blit-displays-work*) + (a1-15 577) + (a2-5 (-> gp-4 art-group)) + (a3-7 (new 'static 'vector :x 512.0 :y 416.0 :w 1.0)) + (t0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> t0-2 x) (-> *video-params* relative-x-scale)) + (set! (-> t0-2 y) 1.0) + (set! (-> t0-2 z) 0.0) + (set! (-> t0-2 w) 1.0) + (t9-6 (the-as bucket-id a0-31) (the-as art-group a1-15) (the-as int a2-5) a3-7 t0-2 (-> self level) 8) + ) + (set! (-> self active) #t) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :trans (behavior () + 0 + ) + :code (behavior () + (remove-setting! 'allow-timeout) + (remove-setting! 'dialog-volume) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event + (ppointer->process (-> self logo)) + 'trans-hook + (lambda :behavior manipy + () + (seek! (-> self speed) 1.0 (* 0.5 (seconds-per-frame))) + (when (< 0.0 (-> self speed)) + (if (zero? (-> self draw force-fade)) + (send-event self 'draw #t) + ) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (-> self speed))))) + ) + (let ((v1-14 (position-in-front-of-camera! + (new 'stack-no-clear 'vector) + (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 184320.0 + 225280.0 + ) + 0.0 + ) + ) + (v0-3 (-> self root trans)) + ) + (set! (-> v0-3 quad) (-> v1-14 quad)) + v0-3 + ) + ) + ) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (remove-setting! 'dust-storm-fog-scalar) + (if (zero? (title-menu)) + (go-virtual idle) + ) + (sleep-code) + ) + :post (-> (method-of-type title-control startup) post) + ) + +;; failed to figure out what this is: +(defstate idle (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :code (behavior () + (title-fade-out (* 3.0 (seconds-per-frame))) + (title-progress (if (or (demo?) (kiosk?)) + 'select-kiosk-start + 'title + ) + ) + (until (= (-> *game-info* current-continue level) 'title) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + ) + (go-virtual wait) + ) + :post (-> (method-of-type title-control startup) post) + ) + +;; definition for symbol *scrap-book-1*, type (array int16) +(define *scrap-book-1* (new 'static 'boxed-array :type int16 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 97 + 98 + 99 + 100 + #x65 + #x67 + #x68 + #x69 + #x6a + #x6b + #x6c + #x6d + #x6e + #x70 + #x71 + #x72 + #x73 + #x74 + #x75 + #x76 + #x77 + #x78 + #x7b + #x7c + #x7d + #x7e + #x7f + #x80 + #x81 + #x82 + #x83 + #x84 + #x85 + #x86 + #x87 + #x88 + #x89 + #x8a + #x8b + #x8c + #x8d + #x8e + #x8f + #x90 + #x91 + #x92 + #x93 + #x94 + #x95 + #x96 + #x97 + #x98 + #x99 + #x9a + #x9b + #x9c + #x9d + #x9e + #x9f + #xa0 + #xa1 + #xa2 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + #x66 + #x79 + #x7a + #xca + #xcb + #xcc + #xcd + #xce + #xcf + #xd0 + #xd1 + #xd2 + #xd3 + #xd4 + #xd5 + #xd6 + #xd7 + #xd8 + #xd9 + #xda + ) + ) + +;; definition for symbol *scrap-book-2*, type (array int16) +(define *scrap-book-2* (new 'static 'boxed-array :type int16 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + #x6f + #xac + #xad + #xae + #xaf + #xb0 + #xb1 + #xb2 + #xb3 + #xb4 + #xb5 + #xb6 + #xb7 + #xb8 + #xb9 + #xba + #xbb + #xbc + #xbd + #xbe + #xbf + #xc0 + #xdb + #xdc + #xdd + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + #xc1 + #xc2 + #xc3 + #xc4 + #xc5 + #xc6 + #xc7 + #xc8 + #xc9 + #xa3 + #xa4 + #xa5 + #xa6 + #xa7 + #xa8 + #xa9 + #xaa + #xab + ) + ) + +;; failed to figure out what this is: +(defstate scrap-book (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :code (behavior ((arg0 int)) + (while (-> *blit-displays-work* menu-mode) + (suspend) + ) + (set-blackout-frames (seconds 1000)) + (let ((gp-1 (if (= arg0 2) + *scrap-book-2* + *scrap-book-1* + ) + ) + (s5-0 0) + ) + 0 + (let ((s4-0 (length gp-1)) + (s3-0 s5-0) + (s2-0 (+ s5-0 1)) + (v1-6 #f) + ) + (while (not (or (>= s3-0 s4-0) (= v1-6 'abort))) + (title-screen-change + "scrap-book" + (-> gp-1 s3-0) + "scrap-book" + (if (>= s2-0 s4-0) + -1 + (-> gp-1 s2-0) + ) + (= s3-0 s5-0) + #f + ) + (format #t "display index ~d page ~D (next is ~D)~%" s3-0 (-> gp-1 s3-0) (if (>= s2-0 s4-0) + -1 + (-> gp-1 s2-0) + ) + ) + (set! v1-6 (direction-press (seconds 1) (seconds 5) #t)) + (case v1-6 + (('back) + (set! s3-0 (max 0 (+ s3-0 -1))) + ) + (else + (+! s3-0 1) + ) + ) + (set! s2-0 (+ s3-0 1)) + ) + ) + ) + (title-screen-change (the-as string #f) -1 (the-as string #f) -1 #f #f) + (set-blackout-frames (seconds 0.2)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (go-virtual idle) + ) + :post (-> (method-of-type title-control startup) post) + ) + +;; failed to figure out what this is: +(defstate control-spec (title-control) + :virtual #t + :event (-> (method-of-type title-control startup) event) + :enter (-> (method-of-type title-control startup) enter) + :exit (-> (method-of-type title-control startup) exit) + :code (behavior ((arg0 int)) + (let* ((v1-0 arg0) + (a1-0 (cond + ((= v1-0 18) + 0 + ) + ((= v1-0 24) + 0 + ) + ((= v1-0 32) + 1 + ) + ((= v1-0 33) + 1 + ) + ((= v1-0 38) + 2 + ) + ((= v1-0 50) + 1 + ) + (else + -1 + ) + ) + ) + ) + (cond + ((!= a1-0 -1) + (title-screen-change "demo-screen" a1-0 (the-as string #f) -1 #t #t) + ) + (else + (set-setting! 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (set-blackout-frames (seconds 100)) + (apply-settings *setting-control*) + ) + ) + ) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.6)) + (suspend) + ) + ) + (process-spawn-function + process + (lambda ((arg0 game-task)) + (let ((v1-2 (-> *game-info* play-list arg0))) + (let ((s5-0 (-> v1-2 kiosk-play-continue)) + (gp-0 (play-task arg0 'debug 'kiosk)) + ) + (cond + ((pair? s5-0) + (persist-with-delay *setting-control* 'title-control-scene (seconds 1000000) 'render #f 0.0 0) + (start 'play (get-continue-by-name *game-info* gp-0)) + (process-spawn scene-player :init scene-player-init (car (cdr s5-0)) #t gp-0 :name "scene-player") + ) + (else + (persist-with-delay *setting-control* 'title-control (seconds 1000000) 'render #f 0.0 0) + (start 'play (get-continue-by-name *game-info* gp-0)) + ) + ) + ) + ) + ) + arg0 + :from *4k-dead-pool* + ) + (until #f + (suspend) + ) + #f + (title-screen-change (the-as string #f) -1 (the-as string #f) -1 #f #f) + (set-blackout-frames (seconds 0.2)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (go-virtual idle) + ) + :post (-> (method-of-type title-control startup) post) + ) + +;; definition for function title-control-init +(defbehavior title-control-init title-control () + (stack-size-set! (-> self main-thread) 2048) + (logclear! (-> self mask) (process-mask freeze pause menu progress actor-pause)) + (set! (-> self level) (level-get *level* 'title)) + (let ((a1-2 (if (and (nonzero? (-> self level entity)) (> (-> self level entity length) 0)) + (-> self level entity data 0 entity) + ) + ) + ) + (process-entity-set! self a1-2) + ) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-error #f 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'entity-name "camera-311" 0.0 0) + (apply-settings *setting-control*) + (dotimes (gp-0 2) + (set! (-> self buffer gp-0) + (new + 'process + 'external-art-buffer + gp-0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (level-get *level* 'title))) + (cond + ((not (-> gp-0 user-object (-> arg0 index))) + (let ((s4-0 (-> arg0 heap))) + (set! (-> s4-0 base) (kmalloc (-> gp-0 heap) #xd0000 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) #xd0000)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (set! (-> gp-0 user-object (-> arg0 index)) (the-as basic (-> arg0 heap base))) + ) + (else + (let ((v1-10 (-> arg0 heap))) + (set! (-> v1-10 base) (the-as pointer (-> gp-0 user-object (-> arg0 index)))) + (set! (-> v1-10 current) (-> v1-10 base)) + (set! (-> v1-10 top-base) (&+ (-> v1-10 base) #xd0000)) + (set! (-> v1-10 top) (-> v1-10 top-base)) + ) + ) + ) + ) + 0 + ) + #f + ) + ) + ) + (set! (-> self selected) 0) + (dotimes (v1-38 2) + (set! (-> self want v1-38) -1) + (set! (-> self have v1-38) -1) + ) + (set! (-> self draw) -1) + (set! (-> self active) #f) + (dotimes (v1-42 2) + (let ((a0-17 (&+ (-> self sprites 0 color-ptr) (* v1-42 64)))) + (set! (-> a0-17 0) 128) + (set! (-> a0-17 1) 128) + (set! (-> a0-17 2) 128) + (set! (-> a0-17 3) 128) + ) + (set! (-> self sprites v1-42 pos z) #xffffff) + (set! (-> self sprites v1-42 pos w) 0) + (set! (-> self sprites v1-42 scale-x) 1.0) + (set! (-> self sprites v1-42 scale-y) 1.0) + (set! (-> self sprites v1-42 angle) 0.0) + (set! (-> self sprites v1-42 flags) (hud-sprite-flags)) + (set! (-> self sprites v1-42 tid) (the-as texture-id #f)) + ) + (set! (-> self sprite-draw) (the-as uint 0)) + (set! (-> self logo) (the-as (pointer manipy) #f)) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intro #t) + (let ((v1-55 (-> *game-info* demo-state))) + (cond + ((zero? v1-55) + (set! (-> *setting-control* user-current fog-special-interp-targ) 0.0) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity 0) + ) + ((or (= v1-55 1) (= v1-55 2)) + ) + ((= v1-55 3) + (set! (-> *setting-control* user-current fog-special-interp-targ) 2.0) + (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x40000000) + (set-setting! 'fog-special-interp-targ #f 2.0 0) + (set-setting! 'fog-special-interp-rate #f 0.2 0) + ) + ((= v1-55 100) + (set! (-> *game-info* demo-state) (the-as uint 1)) + ) + ((= v1-55 201) + (go-virtual scrap-book 1) + ) + ((= v1-55 202) + (go-virtual scrap-book 2) + ) + ((= v1-55 203) + (go-virtual scrap-book 3) + ) + ) + ) + (set! *title-control* (the-as (pointer title-control) (process->ppointer self))) + (set! (-> *game-info* controller 0) (process->handle self)) + (go-virtual startup) + ) + +;; failed to figure out what this is: +(defstate target-title (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change-mode) + (case (-> block param 0) + (('grab) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((a0-1 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> a0-1 next0))) + (while (!= a0-1 (-> *hud-engine* alive-list-end)) + (deactivate ((method-of-type connection get-process) (the-as connection a0-1))) + (set! a0-1 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + (ja-channel-set! 0) + (when arg0 + (let ((gp-1 (-> self mask)) + (s5-1 (-> *game-info* mode)) + ) + (set! (-> *game-info* mode) 'movie) + (logior! (-> self mask) (process-mask no-kill)) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + (set! (-> self mask) gp-1) + (set! (-> *game-info* mode) s5-1) + ) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (kill-by-type title-control *active-pool*) + (set! (-> self game controller 0) + (ppointer->handle + (process-spawn title-control :init title-control-init :name "title-control" :to *entity-pool*) + ) + ) + ) + ) + :exit (behavior () + (activate-hud self) + ) + :code (the-as (function symbol object) sleep-code) + :post target-no-move-post + ) + +;; definition of type museum-char +(deftype museum-char (structure) + ((skel string) + (anim uint32) + (height-min float) + (height-max float) + (zoom-min float) + (zoom-max float) + (scale float) + (text-id text-id) + (cloth-reset-time time-frame) + (use-orient-cloth-reset? symbol) + (outtake-num uint32) + (outtake (array string)) + ) + ) + +;; definition for method 3 of type museum-char +(defmethod inspect ((this museum-char)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'museum-char) + (format #t "~1Tskel: ~A~%" (-> this skel)) + (format #t "~1Tanim: ~D~%" (-> this anim)) + (format #t "~1Theight-min: ~f~%" (-> this height-min)) + (format #t "~1Theight-max: ~f~%" (-> this height-max)) + (format #t "~1Tzoom-min: ~f~%" (-> this zoom-min)) + (format #t "~1Tzoom-max: ~f~%" (-> this zoom-max)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Ttext-id: ~D~%" (-> this text-id)) + (format #t "~1Tcloth-reset-time: ~D~%" (-> this cloth-reset-time)) + (format #t "~1Tuse-orient-cloth-reset?: ~A~%" (-> this use-orient-cloth-reset?)) + (format #t "~1Touttake-num: ~D~%" (-> this outtake-num)) + (format #t "~1Touttake: ~A~%" (-> this outtake)) + (label cfg-4) + this + ) + +;; definition of type hirez-viewer +(deftype hirez-viewer (process-drawable) + ((angley float) + (anglex float) + (updown float) + (zoom float) + (char museum-char) + (pos-x float) + (dest-pos-x float) + (alpha float) + (cloth-reset-time time-frame) + (use-orient-cloth-reset? symbol) + (id sound-id) + (credits symbol) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type hirez-viewer +(defmethod inspect ((this hirez-viewer)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tangley: ~f~%" (-> this angley)) + (format #t "~2Tanglex: ~f~%" (-> this anglex)) + (format #t "~2Tupdown: ~f~%" (-> this updown)) + (format #t "~2Tzoom: ~f~%" (-> this zoom)) + (format #t "~2Tchar: #~%" (-> this char)) + (format #t "~2Tpos-x: ~f~%" (-> this pos-x)) + (format #t "~2Tdest-pos-x: ~f~%" (-> this dest-pos-x)) + (format #t "~2Talpha: ~f~%" (-> this alpha)) + (format #t "~2Tcloth-reset-time: ~D~%" (-> this cloth-reset-time)) + (format #t "~2Tuse-orient-cloth-reset?: ~A~%" (-> this use-orient-cloth-reset?)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tcredits: ~A~%" (-> this credits)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (hirez-viewer) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-right) + (set! (-> self dest-pos-x) 550.0) + ) + (('go-left) + (set! (-> self dest-pos-x) -550.0) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self id) (new 'static 'sound-id)) + (when (and (not (-> self credits)) + (nonzero? (-> self char outtake)) + (or (= (-> *setting-control* user-default subtitle-language) (language-enum english)) + (= (-> *setting-control* user-default subtitle-language) (language-enum french)) + (= (-> *setting-control* user-default subtitle-language) (language-enum german)) + (= (-> *setting-control* user-default subtitle-language) (language-enum spanish)) + (= (-> *setting-control* user-default subtitle-language) (language-enum italian)) + ) + ) + (add-setting! 'music-volume 'rel 0.25 0) + (set! (-> self id) (add-process + *gui-control* + self + (gui-channel hal) + (gui-action play) + (-> self char outtake (-> self char outtake-num)) + -99.0 + 0 + ) + ) + (sound-params-set! *gui-control* (-> self id) #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (+! (-> self char outtake-num) 1) + (when (= (-> self char outtake length) (-> self char outtake-num)) + (set! (-> self char outtake-num) (the-as uint 0)) + 0 + ) + ) + ) + :exit (behavior () + (set-action! + *gui-control* + (gui-action stop) + (-> self id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (and (nonzero? (-> self id)) (zero? (get-status *gui-control* (-> self id)))) + (set! (-> self id) (new 'static 'sound-id)) + (remove-setting! 'music-volume) + ) + (let ((v1-7 (-> *cpad-list* cpads 0))) + (let ((f1-0 (the float (+ (-> v1-7 rightx) -128))) + (f0-2 (the float (+ (-> v1-7 righty) -128))) + ) + (if (< 64.0 (fabs f1-0)) + (set! (-> self angley) (- (-> self angley) (* 364.0889 (seconds-per-frame) f1-0))) + ) + (when (< 64.0 (fabs f0-2)) + (set! (-> self anglex) (- (-> self anglex) (* 364.0889 (seconds-per-frame) f0-2))) + (set! (-> self anglex) (fmax -5461.3335 (fmin 5461.3335 (-> self anglex)))) + ) + ) + (the float (+ (-> v1-7 leftx) -128)) + (let ((f0-10 (the float (+ (-> v1-7 lefty) -128)))) + (when (< 64.0 (fabs f0-10)) + (+! (-> self zoom) (* 204.8 (seconds-per-frame) f0-10)) + (set! (-> self zoom) (fmax (fmin (-> self zoom) (-> self char zoom-max)) (-> self char zoom-min))) + ) + ) + (let ((f1-11 (the float (-> v1-7 abutton 9))) + (f0-18 (the float (-> v1-7 abutton 8))) + ) + (+! (-> self updown) (* 50.0 (seconds-per-frame) f1-11)) + (set! (-> self updown) (- (-> self updown) (* 50.0 (seconds-per-frame) f0-18))) + ) + ) + (set! (-> self updown) (fmax (fmin (-> self updown) (-> self char height-max)) (-> self char height-min))) + (+! (-> self pos-x) (* 5.0 (seconds-per-frame) (- (-> self dest-pos-x) (-> self pos-x)))) + (if (< 520.0 (fabs (-> self pos-x))) + (deactivate self) + ) + (if (nonzero? (-> self skel)) + (set-vector! (-> self draw color-mult) (-> self alpha) (-> self alpha) (-> self alpha) 1.0) + ) + (if (< (fabs (-> self dest-pos-x)) 200.0) + (seek! (-> self alpha) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> self alpha) 0.0 (* 2.0 (seconds-per-frame))) + ) + (cond + ((not (time-elapsed? (-> self state-time) (-> self cloth-reset-time))) + (process-drawable-cloth-command self '(reset)) + ) + ((-> self use-orient-cloth-reset?) + (process-drawable-cloth-command self '(set-flags local-space)) + ) + (else + (process-drawable-cloth-command self '(set-flags local-space-xyz)) + ) + ) + (let ((a2-3 (new 'stack-no-clear 'vector)) + (a1-7 (new 'stack-no-clear 'vector)) + (v1-40 (new 'stack-no-clear 'vector)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-40 quad) (-> *math-camera* trans quad)) + (set-vector! a3-0 (-> self pos-x) 0.0 0.0 1.0) + (set! (-> a2-3 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (let ((a0-42 a1-7)) + (let ((t0-8 (-> *math-camera* inv-camera-rot fvec))) + (let ((t1-0 (-> self zoom))) + (.mov vf7 t1-0) + ) + (.lvf vf5 (&-> t0-8 quad)) + ) + (.lvf vf4 (&-> v1-40 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-42 quad) vf6) + ) + (reverse-transform-point! gp-2 a1-7 a2-3 a3-0) + ) + (set! (-> self root trans quad) (-> gp-2 quad)) + ) + (matrix->quaternion (-> self root quat) (-> *math-camera* inv-camera-rot)) + (quaternion*! + (-> self root quat) + (-> self root quat) + (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* (-> self angley)) + ) + (let ((gp-4 (-> self root trans))) + (let ((s5-1 (-> self root trans))) + (let ((v1-50 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((a0-49 (- (-> self updown)))) + (.mov vf7 a0-49) + ) + (.lvf vf5 (&-> v1-50 quad)) + ) + (.lvf vf4 (&-> s5-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> gp-4 quad) vf6) + ) + (let ((gp-5 (new + 'stack + 'font-context + *font-default-matrix* + 20 + 350 + 0.0 + (font-color font-color-43) + (font-flags shadow kerning) + ) + ) + ) + (let ((v1-52 gp-5)) + (set! (-> v1-52 width) (the float 300)) + ) + (let ((v1-53 gp-5)) + (set! (-> v1-53 height) (the float 30)) + ) + (let ((v1-54 gp-5)) + (set! (-> v1-54 scale) 0.7) + ) + (let ((v1-55 gp-5)) + (set! (-> v1-55 alpha) (-> self alpha)) + ) + (set! (-> gp-5 flags) (font-flags shadow kerning large)) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> self char text-id) #f)) + (s5-2 *temp-string* gp-5 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + :code (behavior () + (cond + ((nonzero? (-> self skel)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self char anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja-post) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + (else + (until #f + (format *stdcon* "no skel~%") + (suspend) + ) + #f + ) + ) + ) + ) + +;; definition for function hirez-viewer-init-by-other +(defbehavior hirez-viewer-init-by-other hirez-viewer ((arg0 museum-char) (arg1 symbol) (arg2 symbol)) + (set! (-> self credits) arg2) + (set! (-> self char) arg0) + (set! (-> self root) (new 'process 'trsqv)) + (set-vector! (-> self root scale) (-> arg0 scale) (-> arg0 scale) (-> arg0 scale) 1.0) + (set! (-> self cloth-reset-time) (-> arg0 cloth-reset-time)) + (set! (-> self use-orient-cloth-reset?) (-> arg0 use-orient-cloth-reset?)) + (let ((s4-1 (art-group-get-by-name *level* (-> arg0 skel) (the-as (pointer level) #f)))) + (when s4-1 + (when (art-group-get-by-name *level* (the-as string (-> s4-1 data 0)) (&-> self level)) + (initialize-skeleton self (the-as skeleton-group s4-1) (the-as pair 0)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (logior! (-> self draw global-effect) (draw-control-global-effect title-light)) + ) + ) + ) + (set! (-> self pos-x) (if arg1 + 500.0 + -500.0 + ) + ) + (if arg2 + (set! (-> self dest-pos-x) -100.0) + (set! (-> self dest-pos-x) 0.0) + ) + (set! (-> self angley) 32768.0) + (set! (-> self zoom) (-> self char zoom-max)) + (set! (-> self updown) (* 0.5 (+ (-> self char height-max) (-> self char height-min)))) + (if (nonzero? (-> self skel)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + ) + (set! (-> self alpha) 0.0) + (go-virtual idle) + ) + +;; definition for function spawn-hirez-viewer +;; WARN: Return type mismatch int vs handle. +(defun spawn-hirez-viewer ((arg0 museum-char) (arg1 symbol) (arg2 symbol)) + (the-as + handle + (ppointer->handle + (process-spawn hirez-viewer arg0 arg1 arg2 :name "hirez-viewer" :to *entity-pool* :stack-size #x20000) + ) + ) + ) + +;; definition for symbol *museum-1*, type (array museum-char) +(define *museum-1* + (new 'static 'boxed-array :type museum-char + (new 'static 'museum-char + :skel "skel-jakc-highres" + :anim #x7 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.4 + :text-id (text-id text-07bd) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #f + :outtake (new 'static 'boxed-array :type string "jakout01" "jakout02" "jakout03" "jakout04") + ) + (new 'static 'museum-char + :skel "skel-ashelin-highres" + :anim #x5 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 1.0 + :text-id (text-id text-07c1) + :outtake (new 'static 'boxed-array :type string + "ashout01" + "ashout02" + "ashout03" + "ashout04" + "ashout05" + "ashout06" + "ashout07" + ) + ) + (new 'static 'museum-char + :skel "skel-keira-highres" + :anim #x4 + :height-min 2048.0 + :height-max 9011.2 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07fa) + ) + (new 'static 'museum-char + :skel "skel-kleever-highres" + :anim #xe + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 10240.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-07f7) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-onin-highres" + :anim #x6 + :height-min 2048.0 + :height-max 6144.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0801) + ) + (new 'static 'museum-char + :skel "skel-ottsel-daxpants" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07be) + :outtake (new 'static 'boxed-array :type string + "daxout01" + "daxout02" + "daxout03" + "daxout04" + "daxout05" + "daxout06" + "daxout07" + "daxout08" + ) + ) + (new 'static 'museum-char + :skel "skel-pecker-highres" + :anim #x5 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 1.0 + :text-id (text-id text-07bf) + :outtake (new 'static 'boxed-array :type string "pekout01") + ) + (new 'static 'museum-char + :skel "skel-samos-highres" + :anim #x5 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07f8) + ) + (new 'static 'museum-char + :skel "skel-seem-highres" + :anim #x6 + :height-min 2048.0 + :height-max 9011.2 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07f9) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #t + ) + (new 'static 'museum-char + :skel "skel-tess-highres" + :anim #x4 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-07c2) + :outtake (new 'static 'boxed-array :type string "tesout01" "tesout02" "tesout03" "tesout04" "tesout05") + ) + (new 'static 'museum-char + :skel "skel-torn-highres" + :anim #x7 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 1.0 + :text-id (text-id text-07c0) + :outtake (new 'static 'boxed-array :type string "torout01" "torout02") + ) + (new 'static 'museum-char + :skel "skel-errol" + :anim #x3 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0804) + ) + (new 'static 'museum-char + :skel "skel-jinx-highres" + :anim #x4 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-0803) + ) + (new 'static 'museum-char + :skel "skel-damus-highres" + :anim #xa + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0802) + :cloth-reset-time (seconds 0.4) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-sig-highres" + :anim #x5 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-07fd) + ) + (new 'static 'museum-char + :skel "skel-veger-highres" + :anim #x6 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.0 + :text-id (text-id text-0805) + :cloth-reset-time (seconds 0.4) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-ottsel-dummy" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07fb) + ) + (new 'static 'museum-char + :skel "skel-ottsel-leader" + :anim #x5 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07fe) + :cloth-reset-time (seconds 0.1) + :use-orient-cloth-reset? #f + ) + (new 'static 'museum-char + :skel "skel-ottsel-surfer" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07ff) + ) + (new 'static 'museum-char + :skel "skel-ottsel-tess" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07fc) + ) + (new 'static 'museum-char + :skel "skel-ottsel-veger" + :anim #x4 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-0800) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-jak-one jak-one jak-one-lod0-jg jak-one-idle-ja + ((jak-one-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :sort 1 + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-brutter-highres brutter-highres brutter-highres-lod0-jg brutter-highres-brutter-idle-ja + ((brutter-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-baron-highres baron-highres baron-highres-lod0-jg baron-highres-idle-ja + ((baron-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-crocadog-highres crocadog-highres crocadog-highres-lod0-jg crocadog-highres-idle-ja + ((crocadog-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-red-crimson-guard-highres red-crimson-guard-highres red-crimson-guard-highres-lod0-jg red-crimson-guard-highres-red-crimson-guard-walk-ja + ((red-crimson-guard-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-kid-highres kid-highres kid-highres-lod0-jg kid-highres-kid-walk-ja + ((kid-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-kor-highres kor-highres kor-highres-lod0-jg kor-highres-idle-ja + ((kor-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-errol-highres errol-highres errol-highres-lod0-jg errol-highres-errol-walk-ja + ((errol-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-youngsamos-highres youngsamos-highres youngsamos-highres-lod0-jg youngsamos-highres-youngsamos-idle-ja + ((youngsamos-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-krew krew krew-lod0-jg krew-idle-ja + ((krew-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-vin vin vin-lod0-jg vin-idle-ja + ((vin-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-daxter-highres daxter-highres daxter-highres-lod0-jg daxter-highres-daxter-walk-ja + ((daxter-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; definition for symbol *museum-2*, type (array museum-char) +(define *museum-2* + (new 'static 'boxed-array :type museum-char + (new 'static 'museum-char + :skel "skel-jak-highres" + :anim #x4 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 18432.0 + :scale 1.4 + :text-id (text-id text-07bc) + :outtake (new 'static 'boxed-array :type string "jakout01" "jakout02" "jakout03" "jakout04") + ) + (new 'static 'museum-char + :skel "skel-daxter-highres" + :anim #x3 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-07be) + :outtake (new 'static 'boxed-array :type string + "daxout01" + "daxout02" + "daxout03" + "daxout04" + "daxout05" + "daxout06" + "daxout07" + "daxout08" + ) + ) + (new 'static 'museum-char + :skel "skel-vin" + :anim #x2 + :height-min 4096.0 + :height-max 10240.0 + :zoom-min 12288.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0894) + :outtake (new 'static 'boxed-array :type string "vinout01" "vinout02" "vinout03") + ) + (new 'static 'museum-char + :skel "skel-krew" + :anim #x2 + :height-min 4096.0 + :height-max 12288.0 + :zoom-min 12288.0 + :zoom-max 28672.0 + :scale 1.0 + :text-id (text-id text-0893) + :outtake (new 'static 'boxed-array :type string "krwout01" "krwout02" "krwout03" "krwout04" "krwout05") + ) + (new 'static 'museum-char + :skel "skel-errol-highres" + :anim #x3 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 1.0 + :text-id (text-id text-0830) + ) + (new 'static 'museum-char + :skel "skel-youngsamos-highres" + :anim #x2 + :height-min 2048.0 + :height-max 4096.0 + :zoom-min 8192.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-0817) + ) + (new 'static 'museum-char + :skel "skel-kor-highres" + :anim #x3 + :height-min 2048.0 + :height-max 9011.2 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 1.0 + :text-id (text-id text-082f) + ) + (new 'static 'museum-char + :skel "skel-kid-highres" + :anim #x2 + :height-min 2048.0 + :height-max 6144.0 + :zoom-min 4096.0 + :zoom-max 12288.0 + :scale 1.0 + :text-id (text-id text-082e) + ) + (new 'static 'museum-char + :skel "skel-baron-highres" + :anim #x3 + :height-min 2048.0 + :height-max 14336.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0816) + :outtake (new 'static 'boxed-array :type string "barout01" "barout02" "barout03" "barout04" "barout05") + ) + (new 'static 'museum-char + :skel "skel-red-crimson-guard-highres" + :anim #x2 + :height-min 2048.0 + :height-max 14336.0 + :zoom-min 12288.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0819) + ) + (new 'static 'museum-char + :skel "skel-brutter-highres" + :anim #x2 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-0818) + ) + (new 'static 'museum-char + :skel "skel-crocadog-highres" + :anim #x2 + :height-min 2048.0 + :height-max 3276.8 + :zoom-min 12288.0 + :zoom-max 16384.0 + :scale 1.0 + :text-id (text-id text-082d) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-flutflut flutflut flutflut-lod0-jg flutflut-flutflut-walk-ja + ((flutflut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-sidekick-human sidekick-human sidekick-human-lod0-jg sidekick-human-sidekick-human-idle-ja + ((sidekick-human-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-yellowsage yellowsage yellowsage-lod0-jg yellowsage-yellowsage-idle-ja + ((yellowsage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-redsage redsage redsage-lod0-jg redsage-redsage-idle-ja + ((redsage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-sculptor sculptor sculptor-lod0-jg sculptor-sculptor-idle-ja + ((sculptor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ogreboss ogreboss ogreboss-lod0-jg ogreboss-ogreboss-idle-ja + ((ogreboss-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-minershort minershort minershort-lod0-jg minershort-minershort-idle-ja + ((minershort-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-minertall minertall minertall-lod0-jg minertall-minertall-idle-ja + ((minertall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-mayor mayor mayor-lod0-jg mayor-mayor-pace-ja + ((mayor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-geologist geologist geologist-lod0-jg geologist-geologist-idle-ja + ((geologist-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gambler gambler gambler-lod0-jg gambler-gambler-idle-ja + ((gambler-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-fisher fisher fisher-lod0-jg fisher-fisher-idle-ja + ((fisher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-farmer farmer farmer-lod0-jg farmer-farmer-idle-ja + ((farmer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-billy billy billy-lod0-jg billy-billy-idle-ja + ((billy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-bluesage bluesage bluesage-lod0-jg bluesage-bluesage-idle-ja + ((bluesage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-babak babak babak-lod0-jg babak-babak-idle-ja + ((babak-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-bird-lady bird-lady bird-lady-lod0-jg bird-lady-bird-lady-idle-ja + ((bird-lady-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-evilbro evilbro evilbro-lod0-jg evilbro-evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-evilsis evilsis evilsis-lod0-jg evilsis-evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-explorer explorer explorer-lod0-jg explorer-explorer-idle-ja + ((explorer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-warrior warrior warrior-lod0-jg warrior-warrior-idle-ja + ((warrior-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; definition for symbol *museum-3*, type (array museum-char) +(define *museum-3* (new 'static 'boxed-array :type museum-char + (new 'static 'museum-char + :skel "skel-jak-one" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 18432.0 + :scale 1.4 + :text-id (text-id text-07bb) + ) + (new 'static 'museum-char + :skel "skel-warrior" + :anim #x2 + :height-min 2048.0 + :height-max 16384.0 + :zoom-min 12288.0 + :zoom-max 32768.0 + :scale 1.0 + :text-id (text-id text-0820) + ) + (new 'static 'museum-char + :skel "skel-evilsis" + :anim #x3 + :height-min 2048.0 + :height-max 11059.2 + :zoom-min 6144.0 + :zoom-max 18432.0 + :scale 0.8 + :text-id (text-id text-0829) + ) + (new 'static 'museum-char + :skel "skel-evilbro" + :anim #x3 + :height-max 9830.4 + :zoom-min 6144.0 + :zoom-max 18432.0 + :scale 0.8 + :text-id (text-id text-0828) + ) + (new 'static 'museum-char + :skel "skel-bird-lady" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-0826) + ) + (new 'static 'museum-char + :skel "skel-explorer" + :anim #x3 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-082a) + ) + (new 'static 'museum-char + :skel "skel-billy" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-0832) + ) + (new 'static 'museum-char + :skel "skel-farmer" + :anim #x2 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 12288.0 + :zoom-max 28672.0 + :scale 0.8 + :text-id (text-id text-082b) + ) + (new 'static 'museum-char + :skel "skel-fisher" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-082c) + ) + (new 'static 'museum-char + :skel "skel-mayor" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-081b) + ) + (new 'static 'museum-char + :skel "skel-minershort" + :anim #x2 + :height-min 2048.0 + :height-max 6144.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-0823) + ) + (new 'static 'museum-char + :skel "skel-minertall" + :anim #x2 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-0824) + ) + (new 'static 'museum-char + :skel "skel-gambler" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-0822) + ) + (new 'static 'museum-char + :skel "skel-ogreboss" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 8192.0 + :zoom-max 16384.0 + :scale 0.1 + :text-id (text-id text-0825) + ) + (new 'static 'museum-char + :skel "skel-sculptor" + :anim #x2 + :height-min 2048.0 + :height-max 12288.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 1.0 + :text-id (text-id text-081d) + ) + (new 'static 'museum-char + :skel "skel-redsage" + :anim #x2 + :height-min 2048.0 + :height-max 10240.0 + :zoom-min 10240.0 + :zoom-max 22528.0 + :scale 0.8 + :text-id (text-id text-081c) + ) + (new 'static 'museum-char + :skel "skel-yellowsage" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 10240.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-081f) + ) + (new 'static 'museum-char + :skel "skel-sidekick-human" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 16384.0 + :scale 0.8 + :text-id (text-id text-081e) + ) + (new 'static 'museum-char + :skel "skel-geologist" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 4096.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-0821) + ) + (new 'static 'museum-char + :skel "skel-bluesage" + :anim #x2 + :height-min 2048.0 + :height-max 14336.0 + :zoom-min 8192.0 + :zoom-max 24576.0 + :scale 0.8 + :text-id (text-id text-0827) + ) + (new 'static 'museum-char + :skel "skel-babak" + :anim #x2 + :height-min 2048.0 + :height-max 8192.0 + :zoom-min 12288.0 + :zoom-max 22528.0 + :scale 0.8 + :text-id (text-id text-0831) + ) + (new 'static 'museum-char + :skel "skel-flutflut" + :anim #x2 + :height-min 4096.0 + :height-max 8192.0 + :zoom-min 10240.0 + :zoom-max 20480.0 + :scale 0.8 + :text-id (text-id text-081a) + ) + ) + ) + +;; definition of type highres-viewer-manager +(deftype highres-viewer-manager (process) + ((current int32) + (next int32) + (handle handle) + (left-right symbol) + (museum (array museum-char)) + (next-time time-frame) + ) + (:state-methods + idle + credits + ) + ) + +;; definition for method 3 of type highres-viewer-manager +(defmethod inspect ((this highres-viewer-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tcurrent: ~D~%" (-> this current)) + (format #t "~2Tnext: ~D~%" (-> this next)) + (format #t "~2Thandle: ~D~%" (-> this handle)) + (format #t "~2Tleft-right: ~A~%" (-> this left-right)) + (format #t "~2Tmuseum: ~A~%" (-> this museum)) + (format #t "~2Tnext-time: ~D~%" (-> this next-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (highres-viewer-manager) + :virtual #t + :trans (behavior () + (when (!= (-> self current) (-> self next)) + (set! (-> self current) (-> self next)) + (set! (-> self handle) (spawn-hirez-viewer (-> self museum (-> self current)) (-> self left-right) #f)) + ) + (let ((a0-3 (-> *cpad-list* cpads 0))) + (cond + ((logtest? (logclear (pad-buttons right) (-> a0-3 button0-abs 0)) (-> a0-3 button0-abs 1)) + (set! (-> self left-right) #f) + (send-event (handle->process (-> self handle)) 'go-right) + (set! (-> self next) (mod (+ (-> self next) 1) (-> self museum length))) + ) + ((let ((a0-13 (-> *cpad-list* cpads 0))) + (logtest? (logclear (pad-buttons left) (-> a0-13 button0-abs 0)) (-> a0-13 button0-abs 1)) + ) + (set! (-> self left-right) #t) + (send-event (handle->process (-> self handle)) 'go-left) + (set! (-> self next) (mod (+ (-> self museum length) -1 (-> self next)) (-> self museum length))) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate credits (highres-viewer-manager) + :virtual #t + :trans (behavior () + (when (!= (-> self current) (-> self next)) + (set-time! (-> self next-time)) + (set! (-> self current) (-> self next)) + (set! (-> self handle) (spawn-hirez-viewer (-> self museum (-> self current)) (-> self left-right) #t)) + ) + (when (time-elapsed? (-> self next-time) (seconds 20)) + (set! (-> self left-right) #f) + (send-event (handle->process (-> self handle)) 'go-right) + (set! (-> self next) (mod (+ (-> self next) 1) (-> self museum length))) + ) + (let ((a0-11 (-> *cpad-list* cpads 0))) + (cond + ((logtest? (logclear (pad-buttons left) (-> a0-11 button0-abs 0)) (-> a0-11 button0-abs 1)) + (set-time! (-> self next-time)) + (set! (-> self left-right) #f) + (send-event (handle->process (-> self handle)) 'go-right) + (set! (-> self next) (mod (+ (-> self next) 1) (-> self museum length))) + ) + ((let ((a0-21 (-> *cpad-list* cpads 0))) + (logtest? (logclear (pad-buttons right) (-> a0-21 button0-abs 0)) (-> a0-21 button0-abs 1)) + ) + (set-time! (-> self next-time)) + (set! (-> self left-right) #t) + (send-event (handle->process (-> self handle)) 'go-left) + (set! (-> self next) (mod (+ (-> self museum length) -1 (-> self next)) (-> self museum length))) + ) + ) + ) + (let ((gp-0 (new + 'stack + 'font-context + *font-default-matrix* + 20 + 20 + 0.0 + (font-color font-color-43) + (font-flags shadow kerning) + ) + ) + ) + (let ((v1-56 gp-0)) + (set! (-> v1-56 width) (the float 300)) + ) + (let ((v1-57 gp-0)) + (set! (-> v1-57 height) (the float 30)) + ) + (let ((v1-58 gp-0)) + (set! (-> v1-58 scale) 0.7) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0806) #f)) + (s5-0 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + :code sleep-code + ) + +;; definition for function hvm-init-by-other +(defbehavior hvm-init-by-other highres-viewer-manager ((arg0 (array museum-char)) (arg1 symbol)) + (set-setting! 'entity-name "camera-311" 0.0 0) + (set! (-> self museum) arg0) + (set! (-> self next) 0) + (set! (-> self current) -1) + (set! (-> self handle) (the-as handle #f)) + (set-time! (-> self next-time)) + (if arg1 + (go-virtual credits) + (go-virtual idle) + ) + ) + +;; definition for function spawn-hirez-viewer-manager +;; WARN: Return type mismatch int vs handle. +(defun spawn-hirez-viewer-manager ((arg0 (array museum-char)) (arg1 symbol)) + (kill-by-type highres-viewer-manager *active-pool*) + (the-as handle (ppointer->handle (process-spawn + highres-viewer-manager + :init hvm-init-by-other + arg0 + arg1 + :name "highres-viewer-manager" + :to *entity-pool* + :stack-size 4096 + ) + ) + ) + ) + +;; definition for function draw-end-credits +(defun draw-end-credits ((arg0 level) (arg1 float)) + (let* ((f26-0 (lerp-scale 0.75 0.75 arg1 800.0 900.0)) + (f30-0 (- 416.0 (* 0.75 arg1))) + (s5-1 0) + (f28-0 0.0) + (s3-0 #t) + (s4-0 (new + 'stack + 'font-context + *font-default-matrix* + (- 496 (the int (* 375.0 f26-0))) + 0 + 0.0 + (font-color font-color-43) + (font-flags shadow kerning) + ) + ) + ) + (let ((v1-4 s4-0)) + (set! (-> v1-4 width) (* 375.0 f26-0)) + ) + (let ((v1-5 s4-0)) + (set! (-> v1-5 height) (the float 150)) + ) + (let ((v1-6 s4-0)) + (set! (-> v1-6 scale) (* 0.8 f26-0)) + ) + (set! (-> s4-0 flags) (font-flags shadow kerning middle large)) + (while (or s3-0 (and (< f30-0 (- f28-0)) (< s5-1 (-> *credits-ids* length)))) + (+! f30-0 f28-0) + (+! s5-1 1) + (let ((a0-7 (lookup-text arg0 (-> *credits-ids* s5-1) #t))) + (while (and a0-7 (zero? (-> a0-7 data 0)) (< s5-1 (-> *credits-ids* length))) + (+! s5-1 1) + (set! a0-7 (lookup-text arg0 (-> *credits-ids* s5-1) #t)) + ) + (set! f28-0 (if a0-7 + (+ 5.0 (print-game-text a0-7 s4-0 #t 35 (bucket-id hud-draw-hud-alpha))) + 40.0 + ) + ) + ) + (set! s3-0 #f) + ) + (cond + ((and (< 70 s5-1) (cpad-pressed? 0 triangle circle x)) + #t + ) + ((and (= s5-1 (-> *credits-ids* length)) (< f30-0 (- f28-0))) + #t + ) + (else + (set! (-> s4-0 origin y) f30-0) + (while (< (-> s4-0 origin y) 416.0) + (let ((a0-16 (lookup-text arg0 (-> *credits-ids* s5-1) #t))) + (while (and a0-16 (zero? (-> a0-16 data 0)) (< s5-1 (-> *credits-ids* length))) + (+! s5-1 1) + (set! a0-16 (lookup-text arg0 (-> *credits-ids* s5-1) #t)) + ) + (let ((f0-14 (if a0-16 + (+ 5.0 (print-game-text a0-16 s4-0 #f 35 (bucket-id hud-draw-hud-alpha))) + 40.0 + ) + ) + ) + (+! (-> s4-0 origin y) f0-14) + ) + ) + (+! s5-1 1) + ) + #f + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-credits (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change-mode) + (case (-> block param 0) + (('grab) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 int)) + (set! (-> self control mod-surface) *empty-mods*) + (let ((a0-2 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> a0-2 next0))) + (while (!= a0-2 (-> *hud-engine* alive-list-end)) + (deactivate ((method-of-type connection get-process) (the-as connection a0-2))) + (set! a0-2 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + (ja-channel-set! 0) + (kill-by-type hirez-viewer *active-pool*) + (kill-by-type highres-viewer-manager *active-pool*) + (cond + ((= arg0 1) + (spawn-hirez-viewer-manager *museum-3* #f) + ) + ((= arg0 2) + (spawn-hirez-viewer-manager *museum-2* #f) + ) + ((= arg0 3) + (spawn-hirez-viewer-manager *museum-1* #f) + ) + (else + (spawn-hirez-viewer-manager *museum-1* #t) + ) + ) + (remove-setting! 'music-volume) + (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.001 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'music 'mcredits 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) + (apply-settings *setting-control*) + ) + :exit (behavior () + (activate-hud self) + (target-exit) + ) + :code (behavior ((arg0 int)) + (cond + ((zero? arg0) + (let ((s5-0 (current-time))) + (while (let ((a0-2 (level-get *level* 'title))) + (and a0-2 (not (draw-end-credits a0-2 (* 0.15 (the float (- (current-time) s5-0)))))) + ) + (suspend) + ) + ) + ) + (else + (until (cpad-pressed? 0 triangle) + (suspend) + ) + ) + ) + (suspend) + (kill-by-type hirez-viewer *active-pool*) + (kill-by-type highres-viewer-manager *active-pool*) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'music) + (remove-setting! 'sound-mode) + (apply-settings *setting-control*) + (let ((v1-25 (get-continue-by-name *game-info* (if (zero? arg0) + "wascity-start" + "title-restart" + ) + ) + ) + ) + (send-event self 'continue v1-25) + ) + (until #f + (suspend) + ) + #f + ) + :post target-no-move-post + ) + + + + diff --git a/test/offline/config/jak3/config.jsonc b/test/offline/config/jak3/config.jsonc index 5f3b2e4da4..6bf9133c72 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -87,7 +87,8 @@ "DGO/COMBA.DGO", "DGO/LFACTORY.DGO", "DGO/RAILX.DGO", - "DGO/FACB.DGO" + "DGO/FACB.DGO", + "DGO/TITLE.DGO" ], "skip_compile_files": [