From 7d7625f4f82c8db4d121239ac550ecb7902cc20d Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Mon, 16 Jan 2023 13:37:29 -0500 Subject: [PATCH] [jak2] workaround for cutscene playing (#2131) --- common/repl/util.h | 1 + common/util/string_util.cpp | 2 +- decompiler/config/jak2/all-types.gc | 80 +- .../jak2/anonymous_function_types.jsonc | 6 + decompiler/config/jak2/hacks.jsonc | 3 +- decompiler/config/jak2/inputs.jsonc | 14 +- decompiler/config/jak2/stack_structures.jsonc | 9 +- decompiler/config/jak2/type_casts.jsonc | 25 +- game/common/str_rpc_types.h | 35 +- .../opengl_renderer/OpenGLRenderer.cpp | 30 +- game/graphics/opengl_renderer/buckets.h | 14 + game/overlord/stream.cpp | 67 +- goal_src/jak2/characters/ashelin/ash.gc | 2 +- goal_src/jak2/characters/sig/sig.gc | 2 +- goal_src/jak2/engine/camera/pov-camera.gc | 443 +++++ .../jak2/engine/collide/collide-shape-h.gc | 4 +- .../jak2/engine/common_objs/generic-obs.gc | 17 +- goal_src/jak2/engine/game/idle-control.gc | 37 +- goal_src/jak2/engine/gfx/blit-displays.gc | 8 + goal_src/jak2/engine/level/level.gc | 2 +- goal_src/jak2/engine/load/loader.gc | 47 +- goal_src/jak2/engine/physics/rigid-body.gc | 282 ++- goal_src/jak2/engine/scene/scene.gc | 9 +- goal_src/jak2/engine/util/script.gc | 3 +- goal_src/jak2/game.gp | 101 +- .../common/enemy/amphibian/amphibian.gc | 2 +- .../enemy/baby_spider/tomb-baby-spider.gc | 4 +- .../jak2/levels/common/enemy/fodder/fodder.gc | 2 +- .../enemy/guards/crimson-guard-level.gc | 16 +- goal_src/jak2/levels/common/enemy/hopper.gc | 8 +- .../enemy/metalhead_bearer/centurion.gc | 2 +- .../common/enemy/metalhead_brown/metalmonk.gc | 2 +- .../enemy/metalhead_slinger/grenadier.gc | 32 +- .../levels/common/entities/sew-gunturret.gc | 22 +- goal_src/jak2/levels/common/flitter.gc | 34 +- goal_src/jak2/levels/common/grunt.gc | 70 +- goal_src/jak2/levels/drill_platform/ginsu.gc | 2 +- goal_src/jak2/levels/forest/pegasus.gc | 2 +- goal_src/jak2/levels/forest/predator.gc | 2 +- goal_src/jak2/levels/fortress/fort-turret.gc | 2 +- .../levels/fortress/prison/intro-texture.gc | 3 + .../jak2/levels/mars_tomb/monster-frog.gc | 8 +- goal_src/jak2/levels/ruins/rapid-gunner.gc | 2 +- goal_src/jak2/levels/sewer/gator.gc | 8 +- goal_src/jak2/levels/sewer/sewer-obs2.gc | 4 +- goal_src/jak2/levels/temple/rhino.gc | 8 +- goal_src/jak2/levels/title/title-obs.gc | 1491 ++++++++++++++++ goalc/CMakeLists.txt | 5 +- goalc/simple_main.cpp | 52 + .../jak2/characters/ashelin/ash_REF.gc | 6 +- .../reference/jak2/characters/sig/sig_REF.gc | 2 +- .../engine/collide/collide-shape-h_REF.gc | 4 +- .../jak2/engine/game/idle-control_REF.gc | 26 +- .../jak2/engine/physics/rigid-body_REF.gc | 1174 +++---------- .../common/enemy/amphibian/amphibian_REF.gc | 2 +- .../enemy/baby_spider/tomb-baby-spider_REF.gc | 4 +- .../levels/common/enemy/fodder/fodder_REF.gc | 2 +- .../enemy/guards/crimson-guard-level_REF.gc | 10 +- .../jak2/levels/common/enemy/hopper_REF.gc | 8 +- .../enemy/metalhead_bearer/centurion_REF.gc | 2 +- .../enemy/metalhead_brown/metalmonk_REF.gc | 2 +- .../enemy/metalhead_slinger/grenadier_REF.gc | 32 +- .../common/entities/sew-gunturret_REF.gc | 4 +- .../jak2/levels/common/flitter_REF.gc | 30 +- .../reference/jak2/levels/common/grunt_REF.gc | 70 +- .../jak2/levels/drill_platform/ginsu_REF.gc | 2 +- .../jak2/levels/forest/pegasus_REF.gc | 2 +- .../jak2/levels/forest/predator_REF.gc | 2 +- .../jak2/levels/fortress/fort-turret_REF.gc | 2 +- .../jak2/levels/mars_tomb/monster-frog_REF.gc | 8 +- .../jak2/levels/ruins/rapid-gunner_REF.gc | 2 +- .../reference/jak2/levels/sewer/gator_REF.gc | 4 +- .../jak2/levels/sewer/sewer-obs2_REF.gc | 4 +- .../reference/jak2/levels/temple/rhino_REF.gc | 8 +- .../jak2/levels/title/title-obs_REF.gc | 1564 +++++++++++++++++ test/offline/config/jak2/config.jsonc | 1 + 76 files changed, 4704 insertions(+), 1299 deletions(-) create mode 100644 goalc/simple_main.cpp create mode 100644 test/decompiler/reference/jak2/levels/title/title-obs_REF.gc diff --git a/common/repl/util.h b/common/repl/util.h index d12b0c573f..df2528ba3c 100644 --- a/common/repl/util.h +++ b/common/repl/util.h @@ -26,6 +26,7 @@ class Wrapper { std::vector examples{}; std::vector> regex_colors{}; + Wrapper(GameVersion version) : repl_config(version) {} Wrapper(const std::string& _username, const Config& config, const StartupFile& startup) : username(_username), repl_config(config), startup_file(startup) {} replxx::Replxx& get_repl() { return repl; } diff --git a/common/util/string_util.cpp b/common/util/string_util.cpp index a7c83d8100..f80f67d19b 100644 --- a/common/util/string_util.cpp +++ b/common/util/string_util.cpp @@ -48,7 +48,7 @@ std::string trim_newline_indents(const std::string& s) { std::string join(const std::vector& strs, const std::string& join_with) { std::string out; - for (int i = 0; i < strs.size(); i++) { + for (size_t i = 0; i < strs.size(); i++) { out += strs.at(i); if (i < strs.size() - 1) { out += join_with; diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 7c2a540e5c..4399758766 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -16172,7 +16172,7 @@ (deftype collide-prim-core (structure) ((world-sphere vector :inline :offset-assert 0) - (collide-as collide-spec :offset-assert 16) ;; guessed by decompiler + (collide-as collide-spec :offset 16) ;; guessed by decompiler (collide-with collide-spec :offset-assert 20) (action collide-action :offset-assert 24) ;; guessed by decompiler (prim-type prim-type :offset-assert 28) @@ -16513,7 +16513,7 @@ (try-snap-to-surface (_type_ vector float float float) symbol 64) (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol 65) (step-collison! (_type_ vector vector float int) float 66) - (collide-shape-moving-method-67 () none 67) + (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none 67) ) ) @@ -24479,7 +24479,7 @@ ;; (define-extern hflip-disp function) (define-extern blit-displays (function none)) (define-extern draw-color-bars (function none)) -;; (define-extern draw-raw-image function) +(define-extern draw-raw-image (function bucket-id art-group int int level int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; font-data ;; @@ -32312,8 +32312,15 @@ ;; idle-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum ic-cmd + :type uint8 + (restart 0) + (play 1) + (push 2) + ) + (deftype idle-control-frame (uint32) - ((command uint8 :offset 0) + ((command ic-cmd :offset 0) (anim uint8 :offset 8) (param0 uint8 :offset 16) (param1 uint8 :offset 24) @@ -33725,6 +33732,32 @@ :flag-assert #x900000008 ) + +(deftype rb-work (structure) + ((cquery collide-query :inline) + (mat-1 matrix :inline :offset 544) + (vec-2 vector :inline :offset 608) + (vec-5 vector :inline :offset 624) + (vec-3 vector :inline :offset 640) + (float-4 float :offset 656) + (pat-id pat-surface :offset 660) + (rbody rigid-body :offset 664) + (prim-id int32 :offset 668) + (vec-1 vector :inline :offset 672) + (quat-1 quaternion :inline) + (vec-8 vector :inline :offset 704) + (vec-4 vector :inline :offset 720) + (vec-6 vector :inline) + (vec-7 vector :inline) + (vec-9 vector :inline) + (float-2 float :offset 784) + (float-3 float) + (dt float :offset 792) + (float-1 float) + (cnt int8 :offset 800) + ) + ) + (define-extern *rigid-body-work* rigid-body-work) (define-extern matrix-3x3-triple-transpose-product (function matrix matrix matrix matrix)) (define-extern damping-time-adjust (function float float float)) @@ -44268,35 +44301,42 @@ ;; title-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype title-control (process) - () + ((selected int32 :offset-assert 128) + (sprites hud-sprite 2 :inline :offset-assert 144) + (sprite-pos vector :inline :offset-assert 272) + (sprite-draw uint32 :offset-assert 288) + (buffer external-art-buffer 2 :offset-assert 292) + (want int32 2 :offset-assert 300) + (want-name basic 2 :offset-assert 308) + (have int32 2 :offset-assert 316) + (draw int32 :offset-assert 324) + (draw-name basic :offset-assert 328) + (active symbol :offset-assert 332) + (spark-time time-frame :offset-assert 336) + (gui-id uint32 :offset-assert 344) + ) :method-count-assert 18 :size-assert #x15c :flag-assert #x1200e0015c ;; Failed to read fields. (:methods - (title-control-method-9 () none 9) - (title-control-method-10 () none 10) - (title-control-method-11 () none 11) - (title-control-method-12 () none 12) - (title-control-method-13 () none 13) (startup () _type_ :state 14) (wait () _type_ :state 15) (idle () _type_ :state 16) - (scrap-book () _type_ :state 17) + (scrap-book (int) _type_ :state 17) ) ) -|# -;; (define-extern title-plug-lightning function) -;; (define-extern title-screen-change function) -;; (define-extern wait-for-press function) -;; (define-extern title-menu function) -;; (define-extern title-fade-out function) -;; (define-extern title-progress function) -;; (define-extern title-control-init function) +(define-extern title-plug-lightning (function process-drawable vector cspace none)) +(define-extern title-screen-change (function symbol int symbol int symbol symbol none :behavior title-control)) +(define-extern wait-for-press (function time-frame time-frame symbol symbol)) +(define-extern title-menu (function object :behavior title-control)) +(define-extern title-fade-out (function float none)) +(define-extern title-progress (function symbol none)) +(define-extern title-control-init (function none :behavior title-control)) (define-extern target-title (state symbol target)) +(define-extern *title-control* (pointer title-control)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mech-part ;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index af2cb25fb9..e1e16df405 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -852,5 +852,11 @@ "whack": [ [0, "(function (pointer process) :behavior whack-a-metal)"], [6, "(function int none :behavior whack-a-metal)"] + ], + "title-obs": [ + [3, "(function external-art-buffer none)"], + [16, "(function none)"], + [17, "(function process-drawable vector cspace object)"], + [18, "(function object)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 81900f7b0f..c081b9fd1f 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -516,7 +516,8 @@ 1, 2, 4, 6, 7, 14, 17, 19, 22, 24, 26, 27, 29, 31, 33, 35 ], "(anon-function 2 ruins-obs)": [7, 28, 37, 50, 51, 61, 62, 71], - "(anon-function 62 sig0-course)": [0, 1, 5, 6] + "(anon-function 62 sig0-course)": [0, 1, 5, 6], + "(method 67 collide-shape-moving)": [0, 1, 2, 3, 11, 12, 13] }, // Sometimes the game might use format strings that are fetched dynamically, diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index 31ecb31208..ece441fe79 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -89,12 +89,12 @@ // "DGO/LTESS.DGO", "DGO/CFA.DGO", // "DGO/TOMBEXT.DGO", - // "DGO/LCGUARD.DGO", + "DGO/LCGUARD.DGO", "DGO/TOE.DGO", // "DGO/PALBOSS.DGO", "DGO/FRB.DGO", "DGO/PAE.DGO", - // "DGO/TITLE.DGO", + "DGO/TITLE.DGO", "DGO/FORDUMPD.DGO", "DGO/D3A.DGO", "DGO/DRILLMTN.DGO", @@ -123,7 +123,7 @@ "DGO/PAS.DGO", // "DGO/LBBUSH.DGO", "DGO/LPACKAGE.DGO", - // "DGO/LINTCSTB.DGO", + "DGO/LINTCSTB.DGO", // "DGO/LPORTRUN.DGO", // "DGO/LASHGRD.DGO", "DGO/CGB.DGO", @@ -143,7 +143,7 @@ "DGO/CMB.DGO", "DGO/LGUARD.DGO", "DGO/CPA.DGO", - // "DGO/LCITYLOW.DGO", + "DGO/LCITYLOW.DGO", // "DGO/LTENTOUT.DGO", "DGO/UNB.DGO", "DGO/CPO.DGO", @@ -208,13 +208,18 @@ "FEB.DGO", "FOB.DGO", "FOR.DGO", + "TITLE.DGO", "FORDUMPD.DGO", "GGA.DGO", "HIDEOUT.DGO", "HIPHOG.DGO", + "INTROCST.DGO", "KIOSK.DGO", + "LCGUARD.DGO", + "LCITYLOW.DGO", "LDJAKBRN.DGO", "LGUARD.DGO", + "LINTCSTB.DGO", "LPROTECT.DGO", "LSACK.DGO", "LTRNYSAM.DGO", @@ -225,6 +230,7 @@ "MTX.DGO", "ONINTENT.DGO", "ORACLE.DGO", + "MTN.DGO", "PRI.DGO", "RUI.DGO", "SAG.DGO", diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index f4ed898a8b..0629cf7093 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1414,7 +1414,7 @@ "(code die fort-missile)": [[16, "matrix"]], "birth-func-dig-digger-collide": [[16, ["inline-array", "vector", 5]]], "(method 29 dig-bomb-crate)": [[16, "dig-bomb-crate-cylinder-spawn-params"]], - "(method 63 collide-shape-moving)": [[16, ["inline-array", "vector", 51]]], + "(method 63 collide-shape-moving)": [[16, "rb-work"]], "(code active dig-spikey-sphere-door)": [ [32, "projectile-init-by-other-params"] ], @@ -1644,5 +1644,12 @@ "(code active whack-a-metal)": [ [16, "vector"], [32, "vector"] + ], + "(code startup title-control)": [ + [16, ["array", "symbol", 6]], + [48, "mc-slot-info"] + ], + "title-plug-lightning": [ + [16, "vector"] ] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 96bb2a3cf6..27b43f1bec 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -2359,7 +2359,7 @@ "(anon-function 31 script)": [ [25, "s3", "process-drawable"], [59, "v0", "joint"], - [14, "s5", "(function process vector cspace)"] + [14, "s5", "(function process vector cspace none)"] ], "(method 9 script-context)": [[81, "s5", "symbol"]], "(anon-function 33 script)": [ @@ -7414,5 +7414,26 @@ ], "(anon-function 97 sig0-course)": [[62, "v1", "sigt-wait-spot"]], "(anon-function 11 ash1-course)": [[51, "v1", "asht-wait-spot"]], - "(anon-function 4 ash1-course)": [[99, "v1", "asht-wait-spot"]] + "(anon-function 4 ash1-course)": [[99, "v1", "asht-wait-spot"]], + "(method 67 collide-shape-moving)": [ + [8, "v1", "collide-shape-prim-group"], + [[30, 56], "s1", "collide-cache-prim"] + ], + "(method 63 collide-shape-moving)": [ + [118, "v1", "collide-shape-prim"], + [379, "a0", "collide-shape-prim-mesh"], + [410, "v1", "collide-shape-prim-mesh"], + [459, "v1", "collide-shape-prim-mesh"] + ], + "(post startup title-control)": [ + [[8, 32], "gp", "process-drawable"], + [[211, 216], "v1", "external-art-buffer"] + ], + "(code startup title-control)": [ + [[261, 265], "v1", "handle"], + [257, "gp", "handle"] + ], + "title-plug-lightning": [ + [99, "v1", "title-control"] + ] } diff --git a/game/common/str_rpc_types.h b/game/common/str_rpc_types.h index ad6fd92a00..5e849901a8 100644 --- a/game/common/str_rpc_types.h +++ b/game/common/str_rpc_types.h @@ -58,7 +58,7 @@ struct RPC_Str_Cmd_Jak2 { char basename[48]; // 32 }; -struct RPC_Play_Cmd { +struct RPC_Play_Cmd_Jak1 { u16 rsvd; u16 result; u32 address; @@ -67,6 +67,39 @@ struct RPC_Play_Cmd { char name[48]; }; +struct SoundStreamName { + char chars[48]; +}; + +struct RPC_Play_Cmd_Jak2 { + u16 rsvd; + u16 result; + u32 address; + u32 section; + u32 maxlen; + u32 id[4]; + SoundStreamName names[4]; + u32 pad[8]; +}; +static_assert(sizeof(RPC_Play_Cmd_Jak2) == 256); + +/* + * +(deftype play-chunk-msg (structure) + ((rsvd uint16 :offset-assert 0) + (result uint16 :offset-assert 2) + (address pointer :offset-assert 4) + (section uint32 :offset-assert 8) + (maxlen uint32 :offset-assert 12) + (id uint32 4 :offset-assert 16) + (basename sound-stream-name 4 :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #xe0 + :flag-assert #x9000000e0 + ) + */ + constexpr int STR_RPC_RESULT_ERROR = 1; constexpr int STR_RPC_RESULT_DONE = 0; diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 27ff0c2c15..5f9c00722b 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -127,9 +127,14 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { init_bucket_renderer("tex-l4-tfrag", BucketCategory::TEX, BucketId::TEX_L4_TFRAG); init_bucket_renderer("tfrag-l4-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L4_TFRAG, - std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 3); - init_bucket_renderer("tie-l4-tfrag", BucketCategory::TIE, BucketId::TIE_L4_TFRAG, 3); + std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 4); + init_bucket_renderer("tie-l4-tfrag", BucketCategory::TIE, BucketId::TIE_L4_TFRAG, 4); // 60 + init_bucket_renderer("tex-l5-tfrag", BucketCategory::TEX, + BucketId::TEX_L5_TFRAG); + init_bucket_renderer("tfrag-l5-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L5_TFRAG, + std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 5); + init_bucket_renderer("tie-l5-tfrag", BucketCategory::TIE, BucketId::TIE_L5_TFRAG, 5); // 70 init_bucket_renderer("tex-l0-shrub", BucketCategory::TEX, BucketId::TEX_L0_SHRUB); @@ -151,6 +156,9 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { BucketId::TEX_L4_SHRUB); // 110 init_bucket_renderer("shrub-l4-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L4_SHRUB); + init_bucket_renderer("tex-l5-shrub", BucketCategory::TEX, + BucketId::TEX_L5_SHRUB); + init_bucket_renderer("shrub-l5-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L5_SHRUB); // 120 init_bucket_renderer("tex-l0-alpha", BucketCategory::TEX, BucketId::TEX_L0_ALPHA); @@ -167,10 +175,15 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { init_bucket_renderer("merc-l1-alpha", BucketCategory::MERC, BucketId::MERC_L1_ALPHA); init_bucket_renderer("tex-l2-alpha", BucketCategory::TEX, BucketId::TEX_L2_ALPHA); + init_bucket_renderer("tfrag-t-l2-alpha", BucketCategory::TFRAG, + BucketId::TFRAG_T_L2_ALPHA, + std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, 2); // 150 init_bucket_renderer("merc-l2-alpha", BucketCategory::MERC, BucketId::MERC_L2_ALPHA); // 160 // 170 + init_bucket_renderer("tex-l5-alpha", BucketCategory::TEX, + BucketId::TEX_L5_ALPHA); // 180 init_bucket_renderer("tex-lcom-tfrag", BucketCategory::TEX, BucketId::TEX_LCOM_TFRAG); @@ -198,14 +211,17 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { init_bucket_renderer("merc-l4-pris", BucketCategory::MERC, BucketId::MERC_L4_PRIS); init_bucket_renderer("tex-l5-pris", BucketCategory::TEX, BucketId::TEX_L5_PRIS); + init_bucket_renderer("merc-l5-pris", BucketCategory::MERC, BucketId::MERC_L5_PRIS); // 220 init_bucket_renderer("tex-lcom-pris", BucketCategory::TEX, BucketId::TEX_LCOM_PRIS); init_bucket_renderer("merc-lcom-pris", BucketCategory::MERC, BucketId::MERC_LCOM_PRIS); init_bucket_renderer("tex-l0-pris2", BucketCategory::TEX, BucketId::TEX_L0_PRIS2); + init_bucket_renderer("merc-l0-pris2", BucketCategory::MERC, BucketId::MERC_L0_PRIS2); init_bucket_renderer("tex-l1-pris2", BucketCategory::TEX, BucketId::TEX_L1_PRIS2); + init_bucket_renderer("merc-l1-pris2", BucketCategory::MERC, BucketId::MERC_L1_PRIS2); // 230 init_bucket_renderer("tex-l2-pris2", BucketCategory::TEX, BucketId::TEX_L2_PRIS2); @@ -228,15 +244,19 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { init_bucket_renderer("merc-l1-water", BucketCategory::MERC, BucketId::MERC_L1_WATER); init_bucket_renderer("tfrag-w-l1-alpha", BucketCategory::TFRAG, BucketId::TFRAG_W_L1_WATER, - std::vector{tfrag3::TFragmentTreeKind::WATER}, false, 0); + std::vector{tfrag3::TFragmentTreeKind::WATER}, false, 1); // 270 init_bucket_renderer("tex-l2-water", BucketCategory::TEX, BucketId::TEX_L2_WATER); init_bucket_renderer("merc-l2-water", BucketCategory::MERC, BucketId::MERC_L2_WATER); + init_bucket_renderer("tfrag-w-l2-alpha", BucketCategory::TFRAG, + BucketId::TFRAG_W_L2_WATER, + std::vector{tfrag3::TFragmentTreeKind::WATER}, false, 2); init_bucket_renderer("tex-l3-water", BucketCategory::TEX, BucketId::TEX_L3_WATER); // 280 + init_bucket_renderer("merc-l3-water", BucketCategory::MERC, BucketId::MERC_L3_WATER); init_bucket_renderer("tex-l4-water", BucketCategory::TEX, BucketId::TEX_L4_WATER); init_bucket_renderer("merc-l4-water", BucketCategory::MERC, BucketId::MERC_L4_WATER); @@ -261,6 +281,10 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { // 320 init_bucket_renderer("progress", BucketCategory::OTHER, BucketId::PROGRESS, 0x8000); + init_bucket_renderer("screen-filter", BucketCategory::OTHER, + BucketId::SCREEN_FILTER, 0x8000); + init_bucket_renderer("bucket-322", BucketCategory::OTHER, BucketId::BUCKET_322, + 0x8000); init_bucket_renderer("debug2", BucketCategory::OTHER, BucketId::DEBUG2, 0x8000); init_bucket_renderer("debug-no-zbuf2", BucketCategory::OTHER, BucketId::DEBUG_NO_ZBUF2, 0x8000); diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index 2c282d03b4..de7fd5ae33 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -104,6 +104,9 @@ enum class BucketId { TEX_L4_TFRAG = 51, TFRAG_L4_TFRAG = 52, TIE_L4_TFRAG = 53, + TEX_L5_TFRAG = 62, + TFRAG_L5_TFRAG = 63, + TIE_L5_TFRAG = 64, TEX_L0_SHRUB = 73, SHRUB_L0_SHRUB = 74, MERC_L0_SHRUB = 79, @@ -115,13 +118,17 @@ enum class BucketId { SHRUB_L3_SHRUB = 101, TEX_L4_SHRUB = 109, SHRUB_L4_SHRUB = 110, + TEX_L5_SHRUB = 118, + SHRUB_L5_SHRUB = 119, TEX_L0_ALPHA = 127, TFRAG_T_L0_ALPHA = 128, TEX_L1_ALPHA = 137, MERC_L1_ALPHA = 141, TFRAG_T_L1_ALPHA = 138, TEX_L2_ALPHA = 147, + TFRAG_T_L2_ALPHA = 148, MERC_L2_ALPHA = 151, + TEX_L5_ALPHA = 177, TEX_LCOM_TFRAG = 187, MERC_LCOM_TFRAG = 188, TEX_LCOM_SHRUB = 191, @@ -137,10 +144,13 @@ enum class BucketId { TEX_L4_PRIS = 212, MERC_L4_PRIS = 213, TEX_L5_PRIS = 216, + MERC_L5_PRIS = 217, TEX_LCOM_PRIS = 220, MERC_LCOM_PRIS = 221, TEX_L0_PRIS2 = 224, + MERC_L0_PRIS2 = 225, TEX_L1_PRIS2 = 228, + MERC_L1_PRIS2 = 229, TEX_L2_PRIS2 = 232, TEX_L3_PRIS2 = 236, TEX_L4_PRIS2 = 240, @@ -152,7 +162,9 @@ enum class BucketId { TFRAG_W_L1_WATER = 264, TEX_L2_WATER = 270, MERC_L2_WATER = 271, + TFRAG_W_L2_WATER = 273, TEX_L3_WATER = 279, + MERC_L3_WATER = 280, TEX_L4_WATER = 288, MERC_L4_WATER = 289, TEX_LCOM_WATER = 306, @@ -165,6 +177,8 @@ enum class BucketId { DEBUG_NO_ZBUF1 = 318, TEX_ALL_MAP = 319, PROGRESS = 320, + SCREEN_FILTER = 321, + BUCKET_322 = 322, DEBUG2 = 324, DEBUG_NO_ZBUF2 = 325, DEBUG3 = 326, diff --git a/game/overlord/stream.cpp b/game/overlord/stream.cpp index c26dd7e719..e2922629c6 100644 --- a/game/overlord/stream.cpp +++ b/game/overlord/stream.cpp @@ -23,10 +23,13 @@ using namespace iop; static RPC_Str_Cmd_Jak1 sSTRBufJak1; static RPC_Str_Cmd_Jak2 sSTRBufJak2; -static RPC_Play_Cmd sPLAYBuf[2]; // todo type +static RPC_Play_Cmd_Jak1 sPLAYBufJak1[2]; +static RPC_Play_Cmd_Jak2 sPLAYBufJak2[2]; + void* RPC_STR_jak1(unsigned int fno, void* _cmd, int y); void* RPC_STR_jak2(unsigned int fno, void* _cmd, int y); -void* RPC_PLAY(unsigned int fno, void* _cmd, int y); +void* RPC_PLAY_jak1(unsigned int fno, void* _cmd, int y); +void* RPC_PLAY_jak2(unsigned int fno, void* _cmd, int y); static constexpr int PLAY_MSG_SIZE = 0x40; @@ -59,7 +62,8 @@ CacheEntryJ2 sCacheJ2[STR_INDEX_CACHE_SIZE]; void stream_init_globals() { memset(&sSTRBufJak1, 0, sizeof(RPC_Str_Cmd_Jak1)); memset(&sSTRBufJak2, 0, sizeof(RPC_Str_Cmd_Jak2)); - memset(&sPLAYBuf, 0, sizeof(RPC_Play_Cmd)); + memset(&sPLAYBufJak1, 0, sizeof(RPC_Play_Cmd_Jak1) * 2); + memset(&sPLAYBufJak2, 0, sizeof(RPC_Play_Cmd_Jak2) * 2); } /*! @@ -94,7 +98,17 @@ u32 PLAYThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, nullptr, nullptr, &dq); + if (g_game_version == GameVersion::Jak1) { + sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY_jak1, sPLAYBufJak1, nullptr, + nullptr, &dq); + + } else if (g_game_version == GameVersion::Jak2) { + sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY_jak2, sPLAYBufJak2, nullptr, + nullptr, &dq); + + } else { + ASSERT_MSG(false, "unsupported game version in PLAYThread initialization!"); + } CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -216,7 +230,8 @@ void* RPC_STR_jak2(unsigned int fno, void* _cmd, int y) { if (!file_record) { // didn't find the file - printf("[OVERLORD STR] Failed to find animation %s\n", cmd->basename); + printf("[OVERLORD STR] Failed to find animation %s (%s)\n", cmd->basename, + animation_iso_name); cmd->result = STR_RPC_RESULT_ERROR; } else { // found it! See if we've cached this animation's header. @@ -263,11 +278,11 @@ void* RPC_STR_jak2(unsigned int fno, void* _cmd, int y) { return cmd; } -void* RPC_PLAY([[maybe_unused]] unsigned int fno, void* _cmd, int size) { +void* RPC_PLAY_jak1([[maybe_unused]] unsigned int fno, void* _cmd, int size) { s32 n_messages = size / PLAY_MSG_SIZE; char namebuf[16]; - auto* cmd = (RPC_Play_Cmd*)(_cmd); + auto* cmd = (RPC_Play_Cmd_Jak1*)(_cmd); while (n_messages > 0) { if (cmd->name[0] == '$') { char* name_part = &cmd->name[1]; @@ -319,3 +334,41 @@ void* RPC_PLAY([[maybe_unused]] unsigned int fno, void* _cmd, int size) { return _cmd; } + +/*! + * This is just copied from Jak 1, and is totally wrong for jak 2. + * It does nothing. + */ +void* RPC_PLAY_jak2([[maybe_unused]] unsigned int fno, void* _cmd, int size) { + s32 n_messages = size / PLAY_MSG_SIZE; + char namebuf[16]; + + auto* cmd = (RPC_Play_Cmd_Jak2*)(_cmd); + while (n_messages > 0) { + if (cmd->names[0].chars[0] == '$') { + char* name_part = &cmd->names[0].chars[1]; + size_t name_len = strlen(name_part); + + if (name_len < 9) { + memset(namebuf, ' ', 8); + memcpy(namebuf, name_part, name_len); + } else { + memcpy(namebuf, name_part, 8); + } + + // ASCII toupper + for (int i = 0; i < 8; i++) { + if (namebuf[i] >= 0x61 && namebuf[i] < 0x7b) { + namebuf[i] -= 0x20; + } + } + } else { + ISONameFromAnimationName(namebuf, cmd->names[0].chars); + } + + n_messages--; + cmd++; + } + + return _cmd; +} diff --git a/goal_src/jak2/characters/ashelin/ash.gc b/goal_src/jak2/characters/ashelin/ash.gc index 011a23407f..b2350ccfd1 100644 --- a/goal_src/jak2/characters/ashelin/ash.gc +++ b/goal_src/jak2/characters/ashelin/ash.gc @@ -44,7 +44,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/characters/sig/sig.gc b/goal_src/jak2/characters/sig/sig.gc index 88748b104d..117c0daceb 100644 --- a/goal_src/jak2/characters/sig/sig.gc +++ b/goal_src/jak2/characters/sig/sig.gc @@ -46,7 +46,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/engine/camera/pov-camera.gc b/goal_src/jak2/engine/camera/pov-camera.gc index df24f71b12..1362e9d618 100644 --- a/goal_src/jak2/engine/camera/pov-camera.gc +++ b/goal_src/jak2/engine/camera/pov-camera.gc @@ -7,3 +7,446 @@ ;; DECOMP BEGINS +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 25 of type pov-camera +(defmethod abort? pov-camera ((obj pov-camera)) + (when (or (and (>= (- (-> self clock frame-counter) (-> obj debounce-start-time)) (seconds 0.2)) + (cpad-pressed? 0 triangle) + ) + (logtest? (-> obj flags) (pov-camera-flag allow-abort)) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (when (logtest? (-> obj flags) (pov-camera-flag notify-of-abort)) + (send-event (handle->process (-> obj notify-handle)) 'notify 'abort-request) + #t + ) + ) + ) + +;; definition for method 26 of type pov-camera +(defmethod target-grabbed? pov-camera ((obj pov-camera)) + (or (not *target*) (process-grab? *target* #f)) + ) + +;; definition for method 29 of type pov-camera +(defmethod target-released? pov-camera ((obj pov-camera)) + (or (not *target*) (process-release? *target*)) + ) + +;; failed to figure out what this is: +(defstate pov-camera-startup (pov-camera) + :virtual #t + :code (behavior () + (go-virtual pov-camera-start-playing) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate pov-camera-start-playing (pov-camera) + :virtual #t + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (while (not (target-grabbed? self)) + (suspend) + ) + (let ((gp-0 0)) + (let ((v1-7 (the-as joint (get-art-by-name-method (-> self draw jgeo) "camera" (the-as type #f))))) + (if v1-7 + (set! gp-0 (+ (-> v1-7 number) 1)) + ) + ) + (let ((v1-10 (process-spawn othercam self gp-0 #t #t :to self))) + (send-event (ppointer->process v1-10) 'mask (-> self mask-to-clear)) + ) + ) + (go-virtual pov-camera-playing) + (none) + ) + ) + +;; definition for function pov-camera-play-and-reposition +;; WARN: Return type mismatch int vs none. +(defbehavior pov-camera-play-and-reposition pov-camera ((arg0 art-joint-anim) (arg1 vector) (arg2 float)) + (let ((s4-0 #f)) + (ja-no-eval :group! arg0 :num! (seek! (the float (+ (-> arg0 frames num-frames) -1)) arg2) :frame-num 0.0) + (until (ja-done? 0) + (let ((v1-4 (and (not s4-0) (< (the float (+ (-> (ja-group) frames num-frames) -4)) (ja-frame-num 0))))) + (when v1-4 + (set! s4-0 #t) + (send-event *camera* 'teleport-to-vector-start-string arg1) + ) + ) + (suspend) + (ja :num! (seek! max arg2)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate pov-camera-playing (pov-camera) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('abort) + (when (logtest? (-> self flags) (pov-camera-flag notify-of-abort)) + (logior! (-> self flags) (pov-camera-flag allow-abort)) + (if (= (-> self anim-name type) string) + (go-virtual pov-camera-abort) + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self debounce-start-time) (-> self clock frame-counter)) + (if (= (-> self anim-name type) string) + (backup-load-state-and-set-cmds *load-state* (-> self command-list)) + ) + (none) + ) + :exit (behavior () + (if (= (-> self anim-name type) string) + (restore-load-state-and-cleanup *load-state*) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (none) + ) + :code (behavior () + (add-setting! 'music-volume 'rel (-> self music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> self sfx-volume-movie) 0) + (cond + ((= (-> self anim-name type) string) + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (abort? self) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= (-> self anim-name type) spool-anim) + (ja-play-spooled-anim + (the-as spool-anim (-> self anim-name)) + (the-as art-joint-anim #f) + (the-as art-joint-anim #f) + (method-of-object self abort?) + ) + ) + ) + (go-virtual pov-camera-done-playing) + (none) + ) + :post (behavior () + (if (= (-> self anim-name type) string) + (execute-commands-up-to *load-state* (ja-aframe-num 0)) + ) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate pov-camera-abort (pov-camera) + :virtual #t + :enter (behavior () + (logior! (-> self flags) (pov-camera-flag allow-abort)) + (none) + ) + :code (behavior () + (set-blackout-frames (seconds 0.035)) + (suspend) + (suspend) + (go-virtual pov-camera-done-playing) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate pov-camera-done-playing (pov-camera) + :virtual #t + :code (behavior () + (while (not (target-released? self)) + (suspend) + ) + (send-event (handle->process (-> self notify-handle)) 'notify 'die) + (suspend) + (suspend) + (cleanup-for-death self) + (deactivate self) + (none) + ) + ) + +;; definition for method 28 of type pov-camera +;; WARN: Return type mismatch int vs none. +(defmethod pov-camera-method-28 pov-camera () + 0 + (none) + ) + +;; definition for method 27 of type pov-camera +;; WARN: Return type mismatch int vs none. +(defmethod pov-camera-method-27 pov-camera () + 0 + (none) + ) + +;; definition for function pov-camera-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior pov-camera-init-by-other pov-camera ((arg0 vector) (arg1 skeleton-group) (arg2 string) (arg3 pov-camera-flag) (arg4 process-drawable) (arg5 pair)) + ((method-of-object self pov-camera-method-27)) + (set! (-> *game-info* pov-camera-handle) (process->handle self)) + (set! (-> self flags) arg3) + (set! (-> self command-list) arg5) + (set! (-> self music-volume-movie) 100.0) + (set! (-> self sfx-volume-movie) 100.0) + (if arg4 + (set! (-> self notify-handle) (process->handle arg4)) + (set! (-> self notify-handle) (the-as handle #f)) + ) + (set! (-> self debounce-start-time) (-> self clock frame-counter)) + (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (when (logtest? (-> self flags) (pov-camera-flag inherit-orientation)) + (let ((v1-21 (if (type? arg4 process-drawable) + arg4 + ) + ) + ) + (quaternion-copy! (-> self root quat) (-> v1-21 root quat)) + ) + ) + (initialize-skeleton self arg1 (the-as pair 0)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (logior! (-> self skel status) (joint-control-status sync-math)) + (set! (-> self anim-name) arg2) + (cond + ((= (-> arg2 type) string) + (logior! (-> self skel status) (joint-control-status valid-spooled-frame)) + (let ((s5-1 (get-art-by-name (-> self draw art-group) arg2 art-joint-anim))) + (if (not s5-1) + (go process-drawable-art-error arg2) + ) + (ja-channel-set! 1) + (set! (-> self skel root-channel 0 frame-group) s5-1) + ) + ) + ((= (-> arg2 type) spool-anim) + ) + ) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) + (set! (-> self event-hook) + (lambda :behavior pov-camera + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('mask) + (let ((v0-0 (the-as number (-> arg3 param 0)))) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) + v0-0 + ) + ) + (('music-movie-volume) + (set! (-> self music-volume-movie) (the-as float (-> arg3 param 0))) + ) + (('sfx-movie-volume) + (set! (-> self sfx-volume-movie) (the-as float (-> arg3 param 0))) + ) + ) + ) + ) + ) + ((method-of-object self pov-camera-method-28)) + (go-virtual pov-camera-startup) + (none) + ) + +;; definition for function othercam-calc +(defun othercam-calc ((arg0 float)) + (set! (-> *camera-other-fov* data) (* 2.0 (atan (/ 14.941477 (* 20.3 arg0)) 1.0))) + ) + +;; failed to figure out what this is: +(defstate othercam-running (othercam) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-0 object)) + (case event-type + (('die) + (set! v0-0 #t) + (set! (-> self die?) (the-as symbol v0-0)) + v0-0 + ) + (('joint) + (cond + ((type? (-> event param 0) string) + (let ((v1-7 (the-as joint (get-art-by-name-method + (-> (the-as process-drawable (-> self hand process 0)) draw jgeo) + (the-as string (-> event param 0)) + (the-as type #f) + ) + ) + ) + ) + (when v1-7 + (set! v0-0 (+ (-> v1-7 number) 1)) + (set! (-> self cam-joint-index) (the-as int v0-0)) + v0-0 + ) + ) + ) + ((not (logtest? (-> event param 0) 7)) + (set! v0-0 (/ (the-as int (-> event param 0)) 8)) + (set! (-> self cam-joint-index) (the-as int v0-0)) + v0-0 + ) + ) + ) + (('target) + (set! v0-0 (process->handle (the-as process (-> event param 0)))) + (set! (-> self hand) (the-as handle v0-0)) + v0-0 + ) + (('mask) + (set! v0-0 (-> event param 0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) + v0-0 + ) + ) + ) + :enter (behavior () + (hide-hud-quick #f) + (case (-> self spooling?) + (('logo 'scene-player) + ) + (else + (add-setting! 'process-mask 'set 0 (-> self mask-to-clear)) + (add-setting! 'movie (process->ppointer self) 0 0) + (if (not (-> self border-value)) + (add-setting! 'border-mode (-> self border-value) 0 0) + ) + ) + ) + (set! (-> self had-valid-frame) #f) + (let ((gp-0 (the-as process-drawable (-> self hand process 0)))) + (vector<-cspace! (-> self old-pos) (-> gp-0 node-list data (-> self cam-joint-index))) + (let ((v1-20 (-> gp-0 node-list data (-> self cam-joint-index) bone transform))) + (vector-normalize-copy! (-> self old-mat-z) (-> v1-20 vector 2) -1.0) + ) + ) + (apply-settings *setting-control*) + (none) + ) + :exit (behavior () + (remove-setting! 'process-mask) + (apply-settings *setting-control*) + (none) + ) + :code (behavior () + (until #f + (let ((s2-0 (the-as process-drawable (-> self hand process 0)))) + (when (not s2-0) + (format #t "ERROR: othercam parent invalid~%") + (deactivate self) + ) + (set! (-> *camera-other-root* quad) (-> s2-0 root trans quad)) + (let ((s4-0 (-> s2-0 node-list data (-> self cam-joint-index) bone transform)) + (s3-0 (-> s2-0 node-list data (-> self cam-joint-index) bone scale)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s1-0 + (or (!= (-> self spooling?) #t) (logtest? (-> s2-0 skel status) (joint-control-status valid-spooled-frame))) + ) + ) + (vector<-cspace! s5-0 (-> s2-0 node-list data (-> self cam-joint-index))) + (vector-normalize-copy! gp-0 (-> s4-0 vector 2) -1.0) + (cond + ((< (vector-length (-> s4-0 vector 2)) 0.1) + (set-blackout-frames (seconds 0.017)) + (if (not (logtest? (-> s2-0 draw status) (draw-control-status no-draw no-draw-temp))) + (format 0 "ERROR: other camera zero matrix!~%") + ) + ) + (s1-0 + (when (not (-> self had-valid-frame)) + (set! (-> self had-valid-frame) (the-as basic #t)) + (set! (-> self old-pos quad) (-> s5-0 quad)) + (set! (-> self old-mat-z quad) (-> gp-0 quad)) + ) + (set! (-> *camera-other-trans* quad) (-> s5-0 quad)) + (vector-normalize-copy! + (the-as vector (-> *camera-other-matrix* vector)) + (the-as vector (-> s4-0 vector)) + -1.0 + ) + (set! (-> *camera-other-matrix* vector 0 w) 0.0) + (vector-normalize-copy! (-> *camera-other-matrix* vector 1) (-> s4-0 vector 1) 1.0) + (set! (-> *camera-other-matrix* vector 1 w) 0.0) + (vector-normalize-copy! (-> *camera-other-matrix* vector 2) (-> s4-0 vector 2) -1.0) + (set! (-> *camera-other-matrix* vector 2 w) 0.0) + (vector-reset! (-> *camera-other-matrix* trans)) + (set! (-> self fov) (othercam-calc (-> s3-0 x))) + (set! *camera-look-through-other* 2) + (set! (-> self old-pos quad) (-> s5-0 quad)) + (set! (-> self old-mat-z quad) (-> gp-0 quad)) + ) + ) + ) + ) + (suspend) + (let ((a0-27 (-> self hand process 0))) + (when (or (-> self die?) (and (not (-> self survive-anim-end?)) (ja-anim-done? a0-27))) + (let ((gp-1 (-> self clock frame-counter))) + (while (and (< (- (-> self clock frame-counter) gp-1) (seconds 60)) + (or (and (-> self entity) (not (is-object-visible? (-> self level) (-> self entity extra vis-id)))) + (< 81920.0 (vector-vector-distance (camera-pos) (-> *math-camera* trans))) + ) + ) + (suspend) + ) + ) + (deactivate self) + ) + ) + ) + #f + (none) + ) + ) + +;; definition for function othercam-init-by-other +;; WARN: Return type mismatch int vs none. +(defbehavior othercam-init-by-other othercam ((arg0 pov-camera) (arg1 int) (arg2 symbol) (arg3 symbol)) + (set! (-> self spooling?) arg3) + (case (-> self spooling?) + (('logo) + ) + (else + (set! (-> *game-info* other-camera-handle) (process->handle self)) + ) + ) + (set! (-> self hand) (process->handle arg0)) + (set! (-> self cam-joint-index) arg1) + (logclear! (-> self mask) (process-mask freeze pause menu actor-pause)) + (set! (-> self border-value) #f) + (set! (-> self die?) #f) + (set! (-> self survive-anim-end?) arg2) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) + (set! (-> self event-hook) (-> othercam-running event)) + (go othercam-running) + 0 + (none) + ) + + + + diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index 2a43f42792..e98cec4f25 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -374,7 +374,7 @@ (deftype collide-prim-core (structure) ((world-sphere vector :inline :offset-assert 0) - (collide-as collide-spec :offset-assert 16) + (collide-as collide-spec :offset 16) (collide-with collide-spec :offset-assert 20) (action collide-action :offset-assert 24) (prim-type prim-type :offset-assert 28) @@ -566,7 +566,7 @@ (try-snap-to-surface (_type_ vector float float float) symbol 64) (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol 65) (step-collison! (_type_ vector vector float int) float 66) - (collide-shape-moving-method-67 () none 67) + (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none 67) ) ) diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index d8ab890069..0d7c430474 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -1548,6 +1548,13 @@ This commonly includes things such as: ) ) ) + ;; Note: there's some changes here to skip setting things if arg4 is #f. + ;; the address of #f is misaligned, but on ps2 the lq instruction will silently mask. + ;; Loading from #f doesn't really make sense, so this was likely just a mistake in the + ;; original game. + ;; the OpenGOAL compiler uses vmovaps, which will crash on a misaligned load because + ;; this has been useful for finding errors. So to prevent this crash, we skip the load + ;; if the argument is #f. (some callers of this directly pass #f, so it's not a bug higher up). (cond ((>= 256 (the-as int arg4)) (set! (-> self target-joint0) (the-as int arg4)) @@ -1555,7 +1562,10 @@ This commonly includes things such as: ) (else (set! (-> self target-joint0) -1) - (set! (-> self offset0 quad) (-> arg4 quad)) + ;; hack, fixed bug in original game + (when arg4 + (set! (-> self offset0 quad) (-> arg4 quad)) + ) ) ) (cond @@ -1565,7 +1575,10 @@ This commonly includes things such as: ) (else (set! (-> self target-joint1) -1) - (set! (-> self offset1 quad) (-> arg5 quad)) + ;; hack, fixed bug in original game + (when arg5 + (set! (-> self offset1 quad) (-> arg5 quad)) + ) ) ) (set! (-> self root) (new 'process 'trsqv)) diff --git a/goal_src/jak2/engine/game/idle-control.gc b/goal_src/jak2/engine/game/idle-control.gc index dc4b67d675..234b29c230 100644 --- a/goal_src/jak2/engine/game/idle-control.gc +++ b/goal_src/jak2/engine/game/idle-control.gc @@ -5,13 +5,20 @@ ;; name in dgo: idle-control ;; dgos: GAME, COMMON +(defenum ic-cmd + :type uint8 + (restart 0) + (play 1) + (push 2) + ) + ;; DECOMP BEGINS (deftype idle-control-frame (uint32) - ((command uint8 :offset 0 :size 8) - (anim uint8 :offset 8 :size 8) - (param0 uint8 :offset 16 :size 8) - (param1 uint8 :offset 24 :size 8) + ((command ic-cmd :offset 0 :size 8) + (anim uint8 :offset 8 :size 8) + (param0 uint8 :offset 16 :size 8) + (param1 uint8 :offset 24 :size 8) ) :method-count-assert 9 :size-assert #x4 @@ -47,15 +54,15 @@ ;; TODO - method manually patched (maybe incorrectly) around `self` changing ;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement. (defmethod idle-control-method-10 idle-control ((obj idle-control) (arg0 process-drawable)) - (local-vars (a1-1 int)) + (local-vars (a1-1 int) (backup-pp process)) (when (nonzero? (-> obj anim)) - (let ((s5-0 self)) + (with-pp + (set! backup-pp pp) + (set! pp arg0) (loop - (let* ((s4-0 (-> obj current 0)) - (v1-4 (-> s4-0 command)) - ) - (cond - ((= v1-4 1) + (let ((s4-0 (-> obj current 0))) + (case (-> s4-0 command) + (((ic-cmd play)) (if (< (-> s4-0 anim) 0) (return #f) ) @@ -102,14 +109,14 @@ ) ) ) - ((= v1-4 2) + (((ic-cmd push)) (ja-channel-push! 1 (the-as time-frame (-> s4-0 param0))) (set! (-> obj current) (&-> (-> obj current) 1)) (set! (-> obj counter) 0) (set! (-> obj target) 0) 0 ) - ((zero? v1-4) + (((ic-cmd restart)) (set! (-> obj current) (-> obj anim)) (set! (-> obj counter) 0) (set! (-> obj target) 0) @@ -118,8 +125,12 @@ ) ) ) + (set! pp backup-pp) ) ) 0 (none) ) + + + diff --git a/goal_src/jak2/engine/gfx/blit-displays.gc b/goal_src/jak2/engine/gfx/blit-displays.gc index 5b98c8e2a7..ebc937a151 100644 --- a/goal_src/jak2/engine/gfx/blit-displays.gc +++ b/goal_src/jak2/engine/gfx/blit-displays.gc @@ -66,5 +66,13 @@ ) ) +;; hack + +(defun draw-raw-image ((arg0 bucket-id) (arg1 art-group) (arg2 int) (arg3 int) (arg4 level) (arg5 int)) + (format 0 "unimplemented draw-raw-image~%") + (none) + ) + + ;; DECOMP BEGINS diff --git a/goal_src/jak2/engine/level/level.gc b/goal_src/jak2/engine/level/level.gc index bb5243625f..17bd748a12 100644 --- a/goal_src/jak2/engine/level/level.gc +++ b/goal_src/jak2/engine/level/level.gc @@ -2684,7 +2684,7 @@ (camera-pos) (new 'static 'boxed-array :type symbol :length 0 :allocated-length 6) (update *setting-control*) - ;; (update *gui-control* #t) + (update *gui-control* #t) (update *art-control* #t) (clear-rec *art-control*) (dotimes (s5-0 6) diff --git a/goal_src/jak2/engine/load/loader.gc b/goal_src/jak2/engine/load/loader.gc index bcb486fb8f..23fea32055 100644 --- a/goal_src/jak2/engine/load/loader.gc +++ b/goal_src/jak2/engine/load/loader.gc @@ -783,9 +783,48 @@ ) ) +;; to allow streaming animations to play without overload VAG streaming, set STREAM_PLAY_HACK. +;; in the ja-play-spooled-anim function below, we use the get-current-str-pos/get-str-id-is-playing? +;; instead of the usual current-str-pos/str-id-is-playing? functions. The #cond below remaps those +;; to point to hacked versions if STREAM_PLAY_HACK is true, otherwise it just maps to the original +;; version. + +(defglobalconstant STREAM_PLAY_HACK #t) +(#cond + (STREAM_PLAY_HACK + (define *hack-pos-buffer-id* (new 'static 'array int 4)) ;; 4 channels? + (define *hack-pos-buffer-pos* (new 'static 'array int 4)) ;; 4 channels? + (define *hack-pos-next-idx* 0) ;; new channel, if none is found. + (define *hack-pos-speed* 5) + (defun get-current-str-pos ((obj sound-id)) + (dotimes (i 4) + (when (= (-> *hack-pos-buffer-id* i) obj) + (+! (-> *hack-pos-buffer-pos* i) *hack-pos-speed*) + (return (-> *hack-pos-buffer-pos* i)) + ) + ) + (set! (-> *hack-pos-buffer-id* *hack-pos-next-idx*) (the-as int obj)) + (set! (-> *hack-pos-buffer-pos* *hack-pos-next-idx*) 0) + (+! *hack-pos-next-idx* 1) + (if (= *hack-pos-next-idx* 4) + (set! *hack-pos-next-idx* 0) + ) + *hack-pos-speed* + ) + (defun get-str-id-is-playing? ((obj int)) + #t + ) + ) + (#t + (define get-current-str-pos current-str-pos) + (define get-str-id-is-playing? str-id-is-playing?) + ) + ) + (defbehavior ja-play-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 art-joint-anim) (arg3 (function process-drawable symbol))) (local-vars (v0-59 int) (sv-176 int)) + (define *hack-pos* 12) (let ((s2-0 arg2) (s1-0 arg3) (gp-0 (new 'stack 'spooler-block arg2 arg3)) @@ -1011,7 +1050,7 @@ (let* ((f30-0 (* 0.05859375 (-> s5-8 speed))) (f28-0 (+ (-> gp-0 part-audio-start) (/ (the float (+ (-> s5-8 frames num-frames) -1)) f30-0))) ) - (set! sv-176 (current-str-pos (-> gp-0 sid))) + (set! sv-176 (get-current-str-pos (-> gp-0 sid))) ;; modified (set! (-> gp-0 good-time) (-> self clock frame-counter)) (until (>= (the float v0-59) f28-0) (if (= (-> self skel root-channel 0) (-> self skel channel)) @@ -1059,8 +1098,8 @@ (set! (-> gp-0 old-pos) sv-176) (set! (-> gp-0 old-time) (-> self clock frame-counter)) (suspend) - (let* ((f26-0 (* (- (the float (current-str-pos (-> gp-0 sid))) (-> gp-0 part-audio-start)) f30-0)) - (f0-16 (if (str-id-is-playing? (the-as int (-> gp-0 sid))) + (let* ((f26-0 (* (- (the float (get-current-str-pos (-> gp-0 sid))) (-> gp-0 part-audio-start)) f30-0)) + (f0-16 (if (get-str-id-is-playing? (the-as int (-> gp-0 sid))) (fmax 0.0 (fmin f26-0 (the float (+ (-> (ja-group) frames num-frames) -1)))) (fmax 0.0 (fmin (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1)))) ) @@ -1068,7 +1107,7 @@ ) (ja-no-eval :num! (seek!) :frame-num f0-16) ) - (set! v0-59 (current-str-pos (-> gp-0 sid))) + (set! v0-59 (get-current-str-pos (-> gp-0 sid))) (set! sv-176 v0-59) ) (set! (-> gp-0 part-audio-start) f28-0) diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index fb9be913de..be637825e8 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -5,8 +5,30 @@ ;; name in dgo: rigid-body ;; dgos: GAME, COMMON -;; og:ignore-form:collide-shape-moving-method-63 -;; og:ignore-form:collide-shape-moving-method-67 +(deftype rb-work (structure) + ((cquery collide-query :inline) + (mat-1 matrix :inline :offset 544) + (vec-2 vector :inline :offset 608) + (vec-5 vector :inline :offset 624) + (vec-3 vector :inline :offset 640) + (float-4 float :offset 656) + (pat-id pat-surface :offset 660) + (rbody rigid-body :offset 664) + (prim-id int32 :offset 668) + (vec-1 vector :inline :offset 672) + (quat-1 quaternion :inline) + (vec-8 vector :inline :offset 704) + (vec-4 vector :inline :offset 720) + (vec-6 vector :inline) + (vec-7 vector :inline) + (vec-9 vector :inline) + (float-2 float :offset 784) + (float-3 float) + (dt float :offset 792) + (float-1 float) + (cnt int8 :offset 800) + ) + ) ;; DECOMP BEGINS @@ -311,15 +333,74 @@ ) (rigid-body-method-13 obj) (if (logtest? (-> obj flags) (rigid-body-flag enable-collision)) - ;; TODO - disabled for now, method isnt decomp'd yet, it sucks - ;; (collide-shape-moving-method-63 arg0 obj arg1) + (collide-shape-moving-method-63 arg0 obj arg1) (rigid-body-method-14 obj arg1) ) 0 (none) ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((obj collide-shape-moving) (arg0 matrix) (arg1 collide-query)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 *collide-cache*) + (s3-0 (-> obj root-prim)) + (s2-0 1) + ) + (b! (nonzero? (-> s3-0 prim-core prim-type)) cfg-2 :delay (empty-form)) + (let ((v1-2 s3-0)) + (set! s3-0 (-> (the-as collide-shape-prim-group v1-2) child 0)) + (set! s2-0 (the-as int (-> v1-2 specific 0))) + ) + (label cfg-2) + (b! #t cfg-13 :delay (nop!)) + (label cfg-3) + (+! s2-0 -1) + (let ((v1-4 -1)) + (b! (!= (-> s3-0 prim-core prim-type) v1-4) cfg-12 :delay (nop!)) + ) + (.lvf vf5 (&-> s3-0 local-sphere quad)) + (.lvf vf1 (&-> arg0 quad 0)) + (.lvf vf2 (&-> arg0 quad 1)) + (.lvf vf3 (&-> arg0 quad 2)) + (.lvf vf4 (&-> arg0 trans quad)) + (.lvf vf6 (&-> s3-0 prim-core world-sphere quad)) + (.mul.x.vf acc vf1 vf5) + (.add.mul.y.vf acc vf2 vf5 acc) + (.add.mul.z.vf acc vf3 vf5 acc) + (.add.mul.w.vf vf7 vf4 vf0 acc :mask #b111) + (.sub.vf vf8 vf7 vf6 :mask #b111) + (.svf (&-> arg1 move-dist quad) vf8) + (let ((s1-0 (the-as collide-cache-prim (-> s4-0 prims)))) + (countdown (s0-0 (-> s4-0 num-prims)) + (when (logtest? (-> s3-0 prim-core collide-with) (-> s1-0 prim-core collide-as)) + (if (>= (the-as int (-> s1-0 prim-core prim-type)) 0) + (collide-with-collide-cache-prim-mesh s3-0 arg1 s1-0) + (collide-with-collide-cache-prim-sphere s3-0 arg1 s1-0) + ) + ) + (&+! s1-0 48) + ) + ) + (label cfg-12) + (&+! s3-0 80) + (label cfg-13) + (b! (nonzero? s2-0) cfg-3 :delay (nop!)) + ) + 0 + (none) + ) + ) (defun transform-rigid-body-prims ((arg0 collide-shape-prim) (arg1 matrix)) (rlet ((acc :class vf) @@ -359,7 +440,196 @@ ) ) -;; ERROR: failed type prop at 118: Could not figure out load: (set! v1 (l.wu v1)) +(defmethod collide-shape-moving-method-63 collide-shape-moving ((obj collide-shape-moving) (arg0 rigid-body) (arg1 float)) + (local-vars (s3-0 rigid-body)) + (with-pp + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'rb-work))) + (set! (-> s5-0 dt) arg1) + (set! (-> s5-0 float-1) 1.0) + (set! (-> s5-0 cnt) 0) + (until (not (and (< 0.05 (-> s5-0 float-1)) (< (-> s5-0 cnt) (the-as int (-> obj max-iteration-count))))) + (set! (-> s5-0 cquery best-dist) -100000000.0) + (set! (-> s5-0 cquery best-my-prim) #f) + (set! (-> s5-0 cquery num-spheres) (the-as uint #f)) + (set! (-> s5-0 vec-1 quad) (-> arg0 position quad)) + (quaternion-copy! (-> s5-0 quat-1) (-> arg0 rotation)) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) + (mem-copy! (the-as pointer (-> s5-0 mat-1)) (the-as pointer (-> arg0 matrix)) 64) + (set! (-> arg0 position quad) (-> s5-0 vec-1 quad)) + (quaternion-copy! (-> arg0 rotation) (-> s5-0 quat-1)) + (rigid-body-method-24 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (collide-with-all-collide-cache-prims obj (-> s5-0 mat-1) (-> s5-0 cquery)) + (let ((f30-0 (-> s5-0 cquery best-dist))) + (b! (>= f30-0 0.0) cfg-3 :delay #f) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) + (rigid-body-method-13 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (set! (-> s5-0 float-1) 0.0) + (b! #t cfg-44 :delay (nop!)) + (label cfg-3) + (update-from-step-size *touching-list* f30-0) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt) f30-0)) + ) + (rigid-body-method-13 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (mem-copy! (the-as pointer (-> s5-0 mat-1)) (the-as pointer (-> arg0 matrix)) 64) + (set! s3-0 (the-as rigid-body #f)) + (b! (not (-> s5-0 cquery num-spheres)) cfg-12 :delay (empty-form)) + (let ((a0-20 (-> (the-as collide-shape-prim (-> s5-0 cquery num-spheres)) cshape process))) + (b! (zero? (-> a0-20 rbody)) cfg-12 :delay (empty-form)) + (set! s3-0 (-> a0-20 rbody state)) + (b! (not (logtest? (-> s3-0 flags) (rigid-body-flag active))) cfg-11 :delay (nop!)) + (b! (logtest? (-> s3-0 flags) (rigid-body-flag enable-physics)) cfg-10 :delay (empty-form)) + (send-event a0-20 'enable-physics) + ) + (label cfg-10) + (b! #t cfg-12 :delay (nop!)) + (label cfg-11) + (set! s3-0 (the-as rigid-body #f)) + (label cfg-12) + (let ((v1-37 (-> s5-0 cquery best-my-prim))) + (.lvf vf7 (&-> (-> s5-0 cquery) best-other-tri intersect quad)) + (.lvf vf6 (&-> v1-37 prim-core world-sphere quad)) + (.sub.vf vf8 vf6 vf7) + (.mul.vf vf9 vf8 vf8 :mask #b111) + (.mul.x.vf acc vf0 vf9 :mask #b1000) + (.add.mul.y.vf acc vf0 vf9 acc :mask #b1000) + (.add.mul.z.vf vf9 vf0 vf9 acc :mask #b1000) + (.isqrt.vf Q vf0 vf9 :fsf #b11 :ftf #b11) + (.mov.vf vf8 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf8 vf8 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> s5-0 vec-5 quad) vf8) + (.svf (&-> s5-0 vec-2 quad) vf7) + (set! (-> s5-0 prim-id) (the-as int (-> v1-37 prim-id))) + ) + (rigid-body-method-22 arg0 (-> s5-0 vec-2) (-> s5-0 vec-3)) + (b! (not s3-0) cfg-14 :delay (empty-form)) + (rigid-body-method-13 s3-0) + (rigid-body-method-22 s3-0 (-> s5-0 vec-2) (-> s5-0 vec-4)) + (vector-! (-> s5-0 vec-3) (-> s5-0 vec-3) (-> s5-0 vec-4)) + (label cfg-14) + (set! (-> s5-0 float-4) 0.0) + (set! (-> s5-0 float-2) (+ -409.6 (vector-dot (-> s5-0 vec-3) (-> s5-0 vec-5)))) + (set! (-> s5-0 float-3) 0.0) + (b! (>= (-> s5-0 float-2) 0.0) cfg-39) + (vector-! (-> s5-0 vec-6) (-> s5-0 vec-2) (-> arg0 position)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-6) (-> s5-0 vec-5)) + (vector-rotate*! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> arg0 inv-i-world)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s5-0 vec-6)) + (set! (-> s5-0 float-3) (+ (-> arg0 info inv-mass) (vector-dot (-> s5-0 vec-5) (-> s5-0 vec-7)))) + (let ((f30-1 (-> arg0 info bounce-factor))) + (cond + (s3-0 + (vector-! (-> s5-0 vec-6) (-> s5-0 vec-2) (-> s3-0 position)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-6) (-> s5-0 vec-5)) + (vector-rotate*! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s3-0 inv-i-world)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s5-0 vec-6)) + (+! (-> s5-0 float-3) (+ (-> s3-0 info inv-mass) (vector-dot (-> s5-0 vec-5) (-> s5-0 vec-7)))) + (set! f30-1 (fmax + (fmax f30-1 (-> s3-0 info bounce-factor)) + (* (-> arg0 info bounce-mult-factor) (-> s3-0 info bounce-mult-factor)) + ) + ) + ) + (else + ) + ) + (set! (-> s5-0 float-4) (* (+ 1.0 f30-1) (/ (- (-> s5-0 float-2)) (-> s5-0 float-3)))) + ) + (vector-float*! (-> s5-0 vec-8) (-> s5-0 vec-5) (-> s5-0 float-4)) + (let ((f30-2 (-> arg0 info mass))) + (if s3-0 + (set! f30-2 (fmin f30-2 (-> s3-0 info mass))) + ) + (vector+float*! (-> s5-0 vec-9) (-> s5-0 vec-3) (-> s5-0 vec-5) (- (-> s5-0 float-2))) + (vector-normalize! (-> s5-0 vec-9) 1.0) + (let ((f0-31 (* -1.0 (fmin + (* (vector-dot (-> s5-0 vec-9) (-> s5-0 vec-3)) f30-2) + (* (-> arg0 info friction-factor) (-> s5-0 float-4)) + ) + ) + ) + ) + (vector+float*! (-> s5-0 vec-8) (-> s5-0 vec-8) (-> s5-0 vec-9) f0-31) + ) + ) + (rigid-body-method-18 arg0 (-> s5-0 vec-2) (-> s5-0 vec-8)) + (when s3-0 + (vector-float*! (-> s5-0 vec-8) (-> s5-0 vec-8) -1.0) + (rigid-body-method-18 s3-0 (-> s5-0 vec-2) (-> s5-0 vec-8)) + ) + (rigid-body-method-12 arg0 1.0) + (rigid-body-method-13 arg0) + (let ((f30-3 (-> s5-0 cquery best-dist))) + (when (< f30-3 0.0001) + (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 vec-5) 40.96) + (rigid-body-method-24 arg0) + ) + (set! (-> s5-0 float-1) (- (-> s5-0 float-1) (* f30-3 (-> s5-0 float-1)))) + ) + (set! (-> s5-0 pat-id) (-> s5-0 cquery best-other-tri pat)) + (let ((v1-103 pp)) + (let ((a0-49 (the-as object (-> s5-0 cquery num-spheres)))) + (if (the-as uint a0-49) + (set! v1-103 (-> (the-as collide-shape-prim-mesh a0-49) cshape process)) + ) + ) + (set! (-> s5-0 rbody) s3-0) + (send-event (-> obj process) 'impact-impulse :from v1-103 (-> s5-0 vec-2)) + ) + (b! (not s3-0) cfg-32 :delay (empty-form)) + (rigid-body-method-12 s3-0 1.0) + (rigid-body-method-13 s3-0) + (let ((s2-0 (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape))) + (transform-rigid-body-prims (-> s2-0 root-prim) (-> s3-0 matrix)) + (vector-float*! (-> s5-0 vec-5) (-> s5-0 vec-5) -1.0) + (vector-float*! (-> s5-0 vec-3) (-> s5-0 vec-3) -1.0) + (set! (-> s5-0 rbody) arg0) + (send-event (-> s2-0 process) 'impact-impulse :from (-> obj process) (-> s5-0 vec-2)) + ) + (label cfg-32) + (+! (-> s5-0 cnt) 1) + ) + (b! #t cfg-42 :delay (nop!)) + (label cfg-39) + (b! (not s3-0) cfg-41 :delay (empty-form)) + (set! (-> arg0 blocked-by) (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape process)) + 0 + (label cfg-41) + (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 vec-5) 40.96) + (rigid-body-method-24 arg0) + 0 + (label cfg-42) + (when (< 0.0 (-> s5-0 float-1)) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) + (rigid-body-method-13 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (set! (-> s5-0 float-1) 0.0) + ) + (label cfg-44) + (let ((f0-47 (* (- 1.0 (-> s5-0 float-1)) (-> s5-0 dt)))) + (set! (-> arg0 time-remaining) (- (-> arg0 time-remaining) f0-47)) + ) + ) + 0 + (none) + ) + ) + ) (defmethod rigid-body-method-15 rigid-body ((obj rigid-body) (arg0 collide-shape-moving) (arg1 float)) (local-vars diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index e728540ed3..12848f37de 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -870,10 +870,6 @@ (defstate wait (scene-player) :virtual #t :enter (behavior ((arg0 symbol)) - ;; HACK TO NOT GET STUCK WAITING FOR SCENE TO LOAD - ;; progress from cutscenes however is handled by the command-list on the load-state cleanup - (go-virtual release) - ;; END HACK - REMOVE ME EVENTUALLY (set! (-> self state-time) (-> self clock frame-counter)) (when (or (-> self scene) (-> self preload-continue)) (let ((gp-0 (scene-decode-continue (the-as basic (if (-> self scene) @@ -996,7 +992,8 @@ (!= (-> *setting-control* user-current movie) (process->ppointer self)) ) *progress-process* - (!= (get-status *gui-control* (the-as sound-id (-> self gui-id))) 3) + ;; modified + (#if STREAM_PLAY_HACK #f (!= (get-status *gui-control* (the-as sound-id (-> self gui-id))) 3)) ) ) (suspend) @@ -1073,7 +1070,7 @@ ) (v1-167 (get-status *gui-control* (the-as sound-id a1-26))) ) - (not (or (= v1-167 (gui-status ready)) (= v1-167 (gui-status active)))) + (#if STREAM_PLAY_HACK #f (not (or (= v1-167 (gui-status ready)) (= v1-167 (gui-status active))))) ) ) ) diff --git a/goal_src/jak2/engine/util/script.gc b/goal_src/jak2/engine/util/script.gc index fbc5f8efbd..ba1c073fa1 100644 --- a/goal_src/jak2/engine/util/script.gc +++ b/goal_src/jak2/engine/util/script.gc @@ -2392,7 +2392,7 @@ ) (let* ((s5-0 (-> arg0 param 1)) (gp-0 (if (type? s5-0 function) - (the-as (function process vector cspace) s5-0) + (the-as (function process vector cspace none) s5-0) ) ) (s3-0 (command-get-process (-> arg0 param 2) (the-as process #f))) @@ -2442,6 +2442,7 @@ (-> arg0 trans) ) ) + (the-as cspace s3-1) ) (format 0 "ERROR: SCRIPT: joint-eval: unknown entity ~A in:~%~T~A~%" (-> arg0 param 2) (-> arg0 expr)) ) diff --git a/goal_src/jak2/game.gp b/goal_src/jak2/game.gp index 0f74654b41..1394266d90 100644 --- a/goal_src/jak2/game.gp +++ b/goal_src/jak2/game.gp @@ -859,6 +859,14 @@ "TOMB" "TWEAKVAL") +;; intro cutscenes +(copy-strs "INSHUT" "INVORTEX" "INCSQUAR" "INPRISON") + +;; jak ambient +(copy-strs "JAA1" "JAA2" "JAA3" "JAA4" "JAA5" "JAA6") + +(copy-vag-files "ENG") + ;;;;;;;;;;;;;;;;;;;;; ;; Text ;;;;;;;;;;;;;;;;;;;;; @@ -2521,33 +2529,29 @@ ;; "lbrnermk" ;; ) -;; ;;;;;;;;;;;;;;;;;;;;; -;; ;; LCGUARD -;; ;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;; +;; LCGUARD +;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LCGUARD.DGO" "lcguard.gd") +(cgo "LCGUARD.DGO" "lcguard.gd") -;; (copy-textures 2691) +(copy-textures 2691) -;; (copy-gos -;; "crimson-guard-highres-ag" -;; "lcguard" -;; ) +(copy-gos + "lcguard" + ) -;; ;;;;;;;;;;;;;;;;;;;;; -;; ;; LCITYLOW -;; ;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;; +;; LCITYLOW +;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LCITYLOW.DGO" "lcitylow.gd") +(cgo "LCITYLOW.DGO" "lcitylow.gd") -;; (copy-textures 2755 2756 3388) +(copy-textures 2755 2756 3388) -;; (copy-gos -;; "barons-ship-lores-ag" -;; "searchlight-ag" -;; "pal-windmill-ag" -;; "lcitylow" -;; ) +(copy-gos + "lcitylow" + ) ;;;;;;;;;;;;;;;;;;;;; ;; LDJAKBRN @@ -2715,21 +2719,19 @@ ;; "lhipout" ;; ) -;; ;;;;;;;;;;;;;;;;;;;;; -;; ;; LINTCSTB -;; ;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;; +;; LINTCSTB +;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LINTCSTB.DGO" "lintcstb.gd") +(cgo "LINTCSTB.DGO" "lintcstb.gd") -;; (copy-textures 2752 2754 3243) +(copy-textures 2752 2754 3243) -;; (copy-gos -;; "keira-highres-ag" -;; "samos-highres-ag" -;; "rift-rider-break-ag" -;; "rift-rider-ag" -;; "lintcstb" -;; ) +(copy-gos + "rift-rider-break-ag" + "rift-rider-ag" + "lintcstb" + ) ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; LJAKDAX @@ -3861,7 +3863,7 @@ "ruins-vis" ) -(copy-strs "RUB1" "RUBW1" "RUBW2" "RUBW3" "RUBW4" "RUBW5" "RUBW6" "RUDPA1" "RUPC1" "RUPC2") +(copy-strs "RUB1" "RUBW1" "RUBW2" "RUBW3" "RUBW4" "RUBW5" "RUBW6" "RUDPA1" "RUPC1" "RUPC2" "RUTVICTO") ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; SAG @@ -4257,26 +4259,27 @@ "throne-vis" ) -;; ;;;;;;;;;;;;;;;;;;;;; -;; ;; TITLE -;; ;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;; +;; TITLE +;;;;;;;;;;;;;;;;;;;;; -;; (cgo "TITLE.DGO" "title.gd") +(cgo "TITLE.DGO" "title.gd") -;; (goal-src-sequence -;; "" -;; :deps ("$OUT/obj/los-control.o") -;; "levels/title/title-obs.gc" -;; ) +(goal-src-sequence + "" + :deps ("$OUT/obj/los-control.o") + "levels/title/title-obs.gc" + ) -;; (copy-textures 3091 3090) +(copy-textures 3091 3090) -;; (copy-gos -;; "daxter-highres-ag" -;; "jak-logo-ag" -;; "jak-stand-ag" -;; "title" -;; ) +(copy-gos + "jak-logo-ag" + "jak-stand-ag" + "title" + ) + +(copy-strs "DESCREEN" "TIDINTRO") ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; TOA diff --git a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc index 017f687ea1..eec608e7ed 100644 --- a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc +++ b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc @@ -127,7 +127,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc b/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc index df7de1ef67..7f30a8df1b 100644 --- a/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc +++ b/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc @@ -36,8 +36,8 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x64 :param1 #x64) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) ) diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 731ea6fe46..5c34e99d9d 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -79,7 +79,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc index 218661d383..77a1a22f08 100644 --- a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc @@ -9,10 +9,10 @@ (define *crimson-guard-fact* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 200))) -(defskelgroup skel-crimson-guard-level crimson-guard 0 4 - ((1 (meters 20)) (2 (meters 999999))) +(defskelgroup skel-crimson-guard-level crimson-guard crimson-guard-lod0-jg crimson-guard-idle-ja + ((crimson-guard-lod0-mg (meters 20)) (crimson-guard-lod2-mg (meters 999999))) :bounds (static-spherem 0 0 0 5) - :shadow 3 + :shadow crimson-guard-shadow-mg :origin-joint-index 3 ) @@ -89,7 +89,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -201,7 +201,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -313,7 +313,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -425,7 +425,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -537,7 +537,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index 7703284c23..33a8b4d27f 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -170,10 +170,10 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 8 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc b/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc index 93a9b946ce..f199206950 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc @@ -249,7 +249,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc b/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc index 41cac14300..2ec22dbf4f 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc @@ -86,7 +86,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc b/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc index 4a24f80ed2..f2969d2482 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc @@ -95,22 +95,22 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 20 - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x8) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x4 :param1 #x8) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/entities/sew-gunturret.gc b/goal_src/jak2/levels/common/entities/sew-gunturret.gc index 9caee93ad2..0687212995 100644 --- a/goal_src/jak2/levels/common/entities/sew-gunturret.gc +++ b/goal_src/jak2/levels/common/entities/sew-gunturret.gc @@ -392,10 +392,13 @@ ) ) -(defskelgroup skel-sew-gunturret sew-gunturret 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 5)) +(defskelgroup skel-sew-gunturret sew-gunturret sew-gunturret-lod0-jg sew-gunturret-idle-ja + ((sew-gunturret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) -(defskelgroup skel-sew-gunturret-explode sew-gunturret 4 6 - ((5 (meters 999999))) +(defskelgroup skel-sew-gunturret-explode sew-gunturret sew-gunturret-explode-lod0-jg sew-gunturret-explode-idle-ja + ((sew-gunturret-explode-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 15) ) @@ -482,7 +485,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x2 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -1088,10 +1091,13 @@ (none) ) -(defskelgroup skel-pal-gun-turret pal-gun-turret 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 4)) +(defskelgroup skel-pal-gun-turret pal-gun-turret pal-gun-turret-lod0-jg pal-gun-turret-idle-ja + ((pal-gun-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) -(defskelgroup skel-pal-gun-turret-explode pal-gun-turret 4 6 - ((5 (meters 999999))) +(defskelgroup skel-pal-gun-turret-explode pal-gun-turret pal-gun-turret-explode-lod0-jg pal-gun-turret-explode-idle-ja + ((pal-gun-turret-explode-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 15) ) @@ -1105,7 +1111,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x2 :param1 #x2) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x2 :param0 #x2 :param1 #x2) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/common/flitter.gc b/goal_src/jak2/levels/common/flitter.gc index 8d6077a8e9..407b848e17 100644 --- a/goal_src/jak2/levels/common/flitter.gc +++ b/goal_src/jak2/levels/common/flitter.gc @@ -416,21 +416,21 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 16 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x3 :param1 #x6) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #xf :param1 #x1e) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x2 :param1 #x4) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xa :param1 #x14) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x3 :param1 #x6) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x2 :param1 #x4) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #xa :param1 #x14) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #xf :param1 #x1e) (new 'static 'idle-control-frame) ) :idle-anim 5 @@ -1445,8 +1445,6 @@ (the-as float s5-2) ) ) - (set! (-> obj minimap) - (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0) - ) + (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) (none) ) diff --git a/goal_src/jak2/levels/common/grunt.gc b/goal_src/jak2/levels/common/grunt.gc index 49238f268f..ba6e23badc 100644 --- a/goal_src/jak2/levels/common/grunt.gc +++ b/goal_src/jak2/levels/common/grunt.gc @@ -136,41 +136,41 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 36 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x2 :param0 #x3c) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x1e :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x3c) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x3c) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x1e :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x3c) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) ) :idle-anim 5 diff --git a/goal_src/jak2/levels/drill_platform/ginsu.gc b/goal_src/jak2/levels/drill_platform/ginsu.gc index fb48288231..7ce462287c 100644 --- a/goal_src/jak2/levels/drill_platform/ginsu.gc +++ b/goal_src/jak2/levels/drill_platform/ginsu.gc @@ -178,7 +178,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index 2ec021d506..ea5a143dc9 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -75,7 +75,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index aa020d43ae..7aca7688f2 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -241,7 +241,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/fortress/fort-turret.gc b/goal_src/jak2/levels/fortress/fort-turret.gc index d489b19b83..c7bdc50411 100644 --- a/goal_src/jak2/levels/fortress/fort-turret.gc +++ b/goal_src/jak2/levels/fortress/fort-turret.gc @@ -468,7 +468,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/fortress/prison/intro-texture.gc b/goal_src/jak2/levels/fortress/prison/intro-texture.gc index dd09b0c0e3..b0b6a555bc 100644 --- a/goal_src/jak2/levels/fortress/prison/intro-texture.gc +++ b/goal_src/jak2/levels/fortress/prison/intro-texture.gc @@ -7,3 +7,6 @@ ;; DECOMP BEGINS +(defun set-jakb-prison-texture-morph! ((a int)) + (none) + ) \ No newline at end of file diff --git a/goal_src/jak2/levels/mars_tomb/monster-frog.gc b/goal_src/jak2/levels/mars_tomb/monster-frog.gc index d1e181d7ec..9d2f71b5f4 100644 --- a/goal_src/jak2/levels/mars_tomb/monster-frog.gc +++ b/goal_src/jak2/levels/mars_tomb/monster-frog.gc @@ -38,10 +38,10 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 8 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x2 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x2 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x2) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index dd57da73b2..949c882b3c 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -62,7 +62,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/sewer/gator.gc b/goal_src/jak2/levels/sewer/gator.gc index 85f28fb69e..a03cc584c0 100644 --- a/goal_src/jak2/levels/sewer/gator.gc +++ b/goal_src/jak2/levels/sewer/gator.gc @@ -7,8 +7,8 @@ ;; DECOMP BEGINS -(defskelgroup skel-gator amphibian 0 -1 - ((1 (meters 20)) (2 (meters 999999))) +(defskelgroup skel-gator amphibian amphibian-lod0-jg -1 + ((amphibian-lod0-mg (meters 20)) (amphibian-lod1-mg (meters 999999))) :bounds (static-spherem 0 1 0 5.5) ) @@ -42,8 +42,8 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #xd :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xd :param0 #x64 :param1 #x64) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) ) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 22d35fe6c6..b4f86a7955 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -1457,8 +1457,8 @@ This commonly includes things such as: :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) ) diff --git a/goal_src/jak2/levels/temple/rhino.gc b/goal_src/jak2/levels/temple/rhino.gc index 673e162f11..1d451a1564 100644 --- a/goal_src/jak2/levels/temple/rhino.gc +++ b/goal_src/jak2/levels/temple/rhino.gc @@ -152,10 +152,10 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 8 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x4) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x4) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/goal_src/jak2/levels/title/title-obs.gc b/goal_src/jak2/levels/title/title-obs.gc index 6f7f550370..e38b1dec18 100644 --- a/goal_src/jak2/levels/title/title-obs.gc +++ b/goal_src/jak2/levels/title/title-obs.gc @@ -5,5 +5,1496 @@ ;; 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 :offset-assert 128) + (sprites hud-sprite 2 :inline :offset-assert 144) + (sprite-pos vector :inline :offset-assert 272) + (sprite-draw uint32 :offset-assert 288) + (buffer external-art-buffer 2 :offset-assert 292) + (want int32 2 :offset-assert 300) + (want-name basic 2 :offset-assert 308) + (have int32 2 :offset-assert 316) + (draw int32 :offset-assert 324) + (draw-name basic :offset-assert 328) + (active symbol :offset-assert 332) + (spark-time time-frame :offset-assert 336) + (gui-id uint32 :offset-assert 344) + ) + :heap-base #xe0 + :method-count-assert 18 + :size-assert #x15c + :flag-assert #x1200e0015c + (:methods + (startup () _type_ :state 14) + (wait () _type_ :state 15) + (idle () _type_ :state 16) + (scrap-book (int) _type_ :state 17) + ) + ) + + +;; WARN: Return type mismatch process vs title-control. +(defmethod relocate title-control ((obj title-control) (arg0 int)) + (dotimes (v1-0 2) + (if (nonzero? (-> obj buffer v1-0)) + (&+! (-> obj buffer v1-0) arg0) + ) + ) + (the-as title-control ((method-of-type process relocate) obj arg0)) + ) + +(defmethod deactivate title-control ((obj title-control)) + (dotimes (s5-0 2) + (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + ) + (dotimes (s5-1 2) + (update (-> obj buffer s5-1)) + ) + ((method-of-type process deactivate) obj) + (none) + ) + +(defskelgroup skel-jak-logo jak-logo jak-logo-lod0-jg -1 + ((jak-logo-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +(defskelgroup skel-jak-stand jak-stand jak-stand-lod0-jg -1 + ((jak-stand-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +;; WARN: Return type mismatch time-frame vs none. +(defun title-plug-lightning ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (local-vars (sv-32 cspace) (sv-48 int) (sv-64 symbol) (sv-80 int) (sv-96 vector)) + (set! sv-32 arg2) + (when (< (-> *setting-control* user-current movie-skip-frame) 0.0) + (let ((s5-0 (get-process *default-dead-pool* lightning-tracker #x4000))) + (when s5-0 + (let ((t9-1 (method-of-type lightning-tracker activate))) + (t9-1 + (the-as lightning-tracker s5-0) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s3-0 run-function-in-process) + (s2-0 s5-0) + (s1-0 lightning-tracker-init) + (s0-0 (-> *lightning-spec-id-table* 1)) + ) + (set! sv-48 30) + (set! sv-64 (the-as symbol #f)) + (set! sv-80 (+ (-> sv-32 joint number) 1)) + (set! sv-96 (new 'stack-no-clear 'vector)) + (set! (-> sv-96 x) (+ (-> arg1 x) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 y) (+ (-> arg1 y) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 z) (+ (-> arg1 z) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 w) 1.0) + ((the-as (function object object object object object object object object none) s3-0) + s2-0 + s1-0 + s0-0 + sv-48 + sv-64 + arg0 + sv-80 + sv-96 + ) + ) + (-> s5-0 ppointer) + ) + ) + (let ((v1-21 (handle->process (-> *game-info* controller 0)))) + (if v1-21 + (set! (-> (the-as title-control v1-21) spark-time) (-> *display* base-clock frame-counter)) + ) + ) + ) + (none) + ) + +(scene-method-16 + (new 'static 'scene + :name "title-disk-intro" + :extra #f + :info #f + :mask-to-clear #x1000000 + :entity "scene-stage-47" + :art-group "scenecamera" + :anim "title-disk-intro" + :parts 10 + :command-list '((0 + (want-force-vis 'ctysluma #t) + (want-force-vis 'ctywide #t) + (kill "ctysluma-part-181") + (kill "ctysluma-part-182") + (kill "ctysluma-part-187") + (kill "ctysluma-part-188") + (send-event "jak-logo" 'color-mult 0 0 0 1) + (setting-unset sound-bank-load) + (apply + ,(lambda () + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 23) + (send-event (ppointer->process *time-of-day*) 'change 'minute 0) + (send-event (ppointer->process *time-of-day*) 'change 'second 0) + ) + ) + (joint-eval + ,(lambda ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (logior! (-> arg0 draw global-effect) (draw-control-global-effect title-light)) + (case (scf-get-territory) + ((1) + (case (-> *setting-control* user-current language) + (((language-enum spanish)) + (send-event arg0 'segment 32 0) + ) + (((language-enum french)) + (send-event arg0 'segment 64 0) + ) + (else + (send-event arg0 'segment 512 0) + ) + ) + ) + ((2) + (send-event arg0 'segment 256 128) + ) + ) + ) + entity + "jak-logo" + joint + "plugsparks" + ) + (fadein (seconds (new 'static 'bfloat :data 1.0))) + ) + (10 (want-force-vis 'ctysluma #f) (want-force-vis 'ctywide #f) (send-event *target* 'change-mode 'title)) + (991 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + (part-tracker + "group-title-plug" + entity + "jak-logo" + joint + "plugsparks" + track + #t + duration + (frame-range (new 'static 'bfloat :data 991.0) (new 'static 'bfloat :data 1011.0)) + ) + ) + (992 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (998 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (999 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1004 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1005 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1008 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1009 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1010 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1011 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1012 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1013 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + ) + (1033 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1063 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + ) + (1073 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1105 + (apply + ,(lambda () + (with-pp + (kill-by-type lightning-tracker *active-pool*) + (kill-by-type part-tracker *active-pool*) + (if (lookup-gui-connection *gui-control* pp (gui-channel art-load) (the-as string #f) (new 'static 'sound-id)) + (sound-group-pause (sound-group dialog)) + ) + (send-event (handle->process (-> *game-info* controller 0)) 'pause) + (time-of-day-setup #t) + (remove-setting! 'half-speed) + (none) + ) + ) + ) + ) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :draw-target #f + :abort #f + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'title + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-logo" + :level 'title + :art-group "skel-jak-logo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x6e + ) + (new 'static 'scene-actor + :name "jak-stand" + :level 'title + :art-group "skel-jak-stand" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "title-movie" + :end-point-obj "title-movie-end" + :borrow '() + :sfx-volume 1.0 + :ambient-volume 1.0 + :blackout-end #f + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +(defbehavior title-screen-change title-control ((arg0 symbol) (arg1 int) (arg2 symbol) (arg3 int) (arg4 symbol) (arg5 symbol)) + (when arg5 + (let ((s1-0 (the-as int (-> *setting-control* user-current language)))) + (if (and (= (the-as language-enum s1-0) (language-enum english)) (= (scf-get-territory) 1)) + (set! s1-0 7) + ) + (if (>= arg1 0) + (+! arg1 (* 3 s1-0)) + ) + (if (>= arg3 0) + (+! arg3 (* 3 s1-0)) + ) + ) + ) + (set! (-> self want-name 0) (the-as basic 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 #x3f800000 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 #x3f800000 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + ) + (set! (-> self draw) arg1) + (set! (-> self draw-name) (the-as basic arg0)) + (set! (-> self active) #f) + (while (and (>= (-> self draw) 0) (not (-> self active))) + (suspend) + ) + (remove-setting! 'bg-a) + (set! (-> self want-name 1) (the-as basic arg2)) + (set! (-> self want 1) arg3) + 0 + (none) + ) + +(defun wait-for-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (with-pp + (let ((s3-0 (-> pp clock frame-counter)) + (s4-0 #f) + ) + (while (not (or (>= (- (-> pp clock frame-counter) s3-0) arg1) (and (>= (- (-> pp clock frame-counter) s3-0) arg0) s4-0)) + ) + (if (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s4-0 #t) + ) + (when (cpad-pressed? 0 triangle) + (set! s4-0 'abort) + (goto cfg-14) + ) + (suspend) + ) + (label cfg-14) + s4-0 + ) + ) + ) + +;; 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 uint32 #x132))) + (until #f + (when (not (paused?)) + (cond + ((and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (> (-> self selected) 0) + ) + (seekl! (-> self selected) 0 1) + (sound-play "dmenu-move") + ) + ((and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (< (-> self selected) (+ (-> gp-1 length) -1)) + ) + (seekl! (-> self selected) (+ (-> gp-1 length) -1) 1) + (sound-play "dmenu-move") + ) + ((or (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (cpad-pressed? 0 start) + (or (not *debug-segment*) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) + ) + ) + (sound-play "dmenu-pick") + (return (the-as object (-> self selected))) + ) + ) + (when (< (mod (-> self clock frame-counter) 300) 210) + (set! sv-112 (new + 'stack + 'font-context + *font-default-matrix* + 64 + 312 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (let ((v1-35 sv-112)) + (set! (-> v1-35 width) (the float 384)) + ) + (let ((v1-36 sv-112)) + (set! (-> v1-36 height) (the float 50)) + ) + (set! (-> sv-112 flags) (font-flags shadow kerning middle left large)) + (set! (-> sv-112 scale) 0.7) + (dotimes (s5-4 (-> gp-1 length)) + (if (= (-> self selected) s5-4) + (set! (-> sv-112 color) (font-color #f1f104)) + (set! (-> sv-112 color) (font-color #dadada)) + ) + (print-game-text + (lookup-text! *common-text* (the-as game-text-id (-> gp-1 s5-4)) #f) + sv-112 + #f + 44 + (bucket-id progress) + ) + (set! (-> sv-112 origin y) (+ 22.0 (-> sv-112 origin y))) + ) + ) + ) + (suspend) + ) + ) + #f + -1 + ) + +(defun title-fade-out ((arg0 float)) + (with-pp + (setup *screen-filter* (new 'static 'vector) (new 'static 'vector :w 128.0) arg0 (bucket-id screen-filter)) + (let ((gp-0 (-> pp clock frame-counter))) + (until (>= (- (-> pp clock frame-counter) 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 + (none) + ) + ) + +(defun title-progress ((arg0 symbol)) + (with-pp + (setup + *screen-filter* + (new 'static 'vector :w 128.0) + (new 'static 'vector :w 128.0) + (-> pp clock seconds-per-frame) + (bucket-id screen-filter) + ) + (set-setting! 'allow-progress #t 0 0) + (apply-settings *setting-control*) + (activate-progress *dproc* arg0) + (set-setting! 'allow-progress #f 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) + (apply-settings *setting-control*) + (set-blackout-frames (seconds 0.2)) + 0 + (none) + ) + ) + +(defstate startup (title-control) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('pause) + (set! (-> *game-info* demo-state) (the-as uint 2)) + (the-as object (remove-setting! 'bg-a)) + ) + (('scrap-book) + (go-virtual scrap-book (the-as int (-> event 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)) + ) + ) + ) + (disable *screen-filter*) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + ) + (none) + ) + :code (behavior () + (let ((v1-1 (-> *game-info* demo-state))) + (when (or (zero? v1-1) (= v1-1 1)) + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 6))) + (set! (-> a1-0 5) #f) + (set! (-> a1-0 4) #f) + (set! (-> a1-0 3) #f) + (set! (-> a1-0 2) 'ctywide) + (set! (-> a1-0 1) 'ctysluma) + (set! (-> a1-0 0) 'title) + (want-levels *load-state* a1-0) + ) + (want-display-level *load-state* 'ctysluma 'display) + (want-display-level *load-state* 'ctywide 'display) + (when (zero? (-> *game-info* demo-state)) + (title-screen-change (the-as symbol "demo-screens") 27 #f -1 #t #f) + (wait-for-press (seconds 1) (seconds 5) #f) + (while (not (and (= (level-status *level* 'ctysluma) 'active) (= (level-status *level* 'ctywide) 'active))) + (suspend) + ) + (title-screen-change #f -1 #f -1 #f #f) + (set-blackout-frames (seconds 0.2)) + ) + (label cfg-12) + (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-12) + ) + (set! (-> *setting-control* user-default bg-a) 0.0) + (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-0 'insufficient-space)) + (if (zero? (-> gp-0 handle)) + (set! s5-0 'no-memory-card) + ) + (title-fade-out 1000.0) + (title-progress s5-0) + ) + (goto cfg-26) + ) + ) + ) + ) + (label cfg-26) + (let ((v1-39 (-> *game-info* demo-state))) + (when (or (zero? v1-39) (= v1-39 1)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (let ((gp-2 + (ppointer->handle (process-spawn scene-player :init scene-player-init "title-disk-intro" #t "title-movie")) + ) + ) + (while (and (handle->process (the-as handle gp-2)) (= (-> *game-info* demo-state) 1)) + (when (and (cpad-pressed? 0 start triangle) (< (-> *setting-control* user-current movie-skip-frame) 0.0)) + (set-setting! 'movie-skip-frame 'abs #x448a2000 0) + (set-setting! 'dialog-volume 'abs 0 0) + (set! (-> *setting-control* user-current dialog-volume) 0.000000001) + (set-setting! 'bg-a 'abs #x3f800000 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (apply-settings *setting-control*) + ) + (if *target* + (set! (-> *target* control trans quad) (-> (math-camera-pos) quad)) + ) + (set! (-> *game-info* kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 1)) + ) + ) + (go-virtual wait) + (none) + ) + :post (behavior () + (local-vars (v1-73 external-art-buffer)) + (let ((gp-0 (command-get-process "jak-logo" (the-as process #f)))) + (when (and gp-0 (nonzero? (-> (the-as process-drawable gp-0) draw))) + (let ((s5-0 (lookup-light-sphere-by-name "big-title1" (-> self level bsp light-hash))) + (v1-6 (lookup-light-sphere-by-name "big-title2" (-> self level bsp light-hash))) + ) + (if s5-0 + (set! (-> s5-0 brightness) (-> (the-as process-drawable gp-0) draw color-mult x)) + ) + (if v1-6 + (set! (-> v1-6 brightness) (-> (the-as process-drawable gp-0) draw color-mult x)) + ) + ) + ) + ) + (let ((gp-1 (lookup-light-sphere-by-name "small-title" (-> self level bsp light-hash)))) + (when gp-1 + (if (>= (- (-> *display* base-clock frame-counter) (-> self spark-time)) (seconds 0.125)) + (set! (-> gp-1 brightness) 0.0) + (set! (-> gp-1 brightness) (rand-vu-float-range 0.5 2.0)) + ) + ) + ) + (dotimes (v1-16 2) + (set! (-> self buffer v1-16 frame-lock) #f) + (set! (-> self have v1-16) -1) + ) + (dotimes (gp-2 2) + (let ((s5-1 (-> self want gp-2)) + (s4-0 (-> self want-name gp-2)) + ) + (when (>= s5-1 0) + (dotimes (s3-0 2) + (case (file-status (-> self buffer s3-0) (the-as string s4-0) s5-1) + (('locked 'active) + (set! (-> self buffer s3-0 frame-lock) #t) + (set! (-> self have gp-2) s3-0) + ) + ) + ) + ) + ) + ) + (dotimes (gp-3 2) + (let ((a2-1 (-> self want gp-3)) + (a1-9 (-> self want-name gp-3)) + ) + (when (and (>= a2-1 0) (< (-> self have gp-3) 0)) + (dotimes (v1-46 2) + (when (not (-> self buffer v1-46 frame-lock)) + (set-pending-file (-> self buffer v1-46) (the-as string a1-9) a2-1 (process->handle self) -1.0) + (goto cfg-45) + ) + ) + ) + ) + (label cfg-45) + ) + (dotimes (gp-4 2) + (update (-> self buffer gp-4)) + ) + (set! (-> self active) #f) + (when (>= (-> self draw) 0) + (dotimes (gp-5 2) + (when (file-status (-> self buffer gp-5) (the-as string (-> self draw-name)) (-> self draw)) + (set! v1-73 (-> self buffer gp-5)) + (goto cfg-58) + ) + ) + (set! v1-73 (the-as external-art-buffer #f)) + (label cfg-58) + (when (and v1-73 (-> v1-73 art-group)) + (draw-raw-image (bucket-id debug-no-zbuf1) (-> v1-73 art-group) 512 416 (-> self level) 8) + (set! (-> self active) #t) + ) + ) + (none) + ) + ) + +(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) + :code (behavior () + (remove-setting! 'allow-timeout) + (remove-setting! 'dialog-volume) + (if (zero? (title-menu)) + (go-virtual idle) + ) + (sleep-code) + (none) + ) + :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 (-> self clock seconds-per-frame))) + (title-progress 'title) + (sleep-code) + (none) + ) + :post (-> (method-of-type title-control startup) post) + ) + +(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* ((v1-3 arg0) + (gp-0 (cond + ((= v1-3 1) + 0 + ) + ((= v1-3 2) + 43 + ) + (else + 0 + ) + ) + ) + (s5-1 (cond + ((= arg0 1) + 43 + ) + ((= arg0 2) + 196 + ) + (else + 0 + ) + ) + ) + (s4-0 gp-0) + (a3-0 (+ gp-0 1)) + (v1-6 #f) + ) + (while (not (or (>= s4-0 s5-1) (= v1-6 'abort))) + (let ((t9-1 title-screen-change) + (a0-4 "scrap-book") + (a1-0 s4-0) + (a2-0 "scrap-book") + ) + (set! a3-0 (cond + ((>= a3-0 s5-1) + -1 + ) + (else + (empty) + a3-0 + ) + ) + ) + (t9-1 (the-as symbol a0-4) a1-0 (the-as symbol a2-0) a3-0 (= s4-0 gp-0) #f) + ) + (set! v1-6 (wait-for-press (seconds 1) (seconds 5) #t)) + (+! s4-0 1) + (set! a3-0 (+ s4-0 1)) + ) + ) + (title-screen-change #f -1 #f -1 #f #f) + (set-blackout-frames (seconds 0.2)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (go-virtual idle) + (none) + ) + :post (-> (method-of-type title-control startup) post) + ) + +;; WARN: Return type mismatch object vs none. +(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 (the-as entity-actor a1-2)) + ) + (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-progress #f 0 0) + (set-setting! 'airlock #f 0 0) + (set-setting! 'music #f 0 0) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-error #f 0 0) + (set-setting! 'music-volume 'abs 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 + (none) + ) + #f + ) + ) + ) + (set! (-> self selected) 0) + (dotimes (v1-36 2) + (set! (-> self want v1-36) -1) + (set! (-> self have v1-36) -1) + ) + (set! (-> self draw) -1) + (set! (-> self active) #f) + (dotimes (v1-40 2) + (let ((a0-16 (&+ (-> self sprites 0 color2) (* v1-40 64)))) + (set! (-> a0-16 0) 128) + (set! (-> a0-16 1) 128) + (set! (-> a0-16 2) 128) + (set! (-> a0-16 3) 128) + ) + (set! (-> self sprites v1-40 pos z) #xffffff) + (set! (-> self sprites v1-40 pos w) 0) + (set! (-> self sprites v1-40 scale-x) 1.0) + (set! (-> self sprites v1-40 scale-y) 1.0) + (set! (-> self sprites v1-40 angle) 0.0) + (set! (-> self sprites v1-40 flags) (the-as uint 0)) + (set! (-> self sprites v1-40 tex) #f) + ) + (set! (-> self sprite-draw) (the-as uint 0)) + (case (-> *game-info* demo-state) + ((100) + (set! (-> *game-info* demo-state) (the-as uint 1)) + ) + ((201) + (go-virtual scrap-book 1) + ) + ((202) + (go-virtual scrap-book 2) + ) + ((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) + (none) + ) + +(defstate target-title (target) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('change-mode) + (case (-> event param 0) + (('grab) + (if (not (-> event param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc arg1 event-type event) + ) + ) + ) + :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)) + (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 :to *entity-pool*)) + ) + ) + (none) + ) + :code (the-as (function symbol none :behavior target) sleep-code) + :post target-no-move-post + ) + +(defpartgroup group-title-sign-naughtydog + :id 1285 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5460 :flags (is-3d launch-asap bit7)) + (sp-item 5461 :flags (is-3d launch-asap bit7)) + (sp-item 5462 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 5462 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 48) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5460 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866432 -2139062144 0 1 -1054866432 #x60606060 #x202020 1) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5461 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866432 -2139062144 0 1 -1054866432 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-title-sign-big-praxis + :id 1286 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5463 :flags (is-3d launch-asap bit7)) + (sp-item 5464 :flags (is-3d launch-asap bit7)) + (sp-item 5465 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 5465 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 48) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 5463 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 16)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866688 -2139062144 0 1 -1054866688 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5464 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 16)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866688 -2139062144 0 1 -1054866688 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-title-sign-wanted + :id 1287 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5466 :flags (is-3d launch-asap bit7)) + (sp-item 5467 :flags (is-3d launch-asap bit7)) + (sp-item 5468 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 5468 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 5466 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866176 -2139062144 0 1 -1054866176 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5467 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866176 -2139062144 0 1 -1054866176 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-title-sign-scea + :id 1288 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5469 :flags (is-3d launch-asap bit7)) (sp-item 5470 :flags (is-3d launch-asap bit7))) + ) + +(defpart 5469 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054867456 -2139062144 0 1 -1054867456 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5470 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054867456 -2139062144 0 1 -1054867456 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(when (= (scf-get-territory) 1) + (let ((v1-82 (get-field-spec-by-id (-> *part-id-table* 5469) (sp-field-id spt-userdata)))) + (if v1-82 + (set! (-> v1-82 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054867200 -2139062144 0 1 -1054867200 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-85 (get-field-spec-by-id (-> *part-id-table* 5470) (sp-field-id spt-userdata)))) + (if v1-85 + (set! (-> v1-85 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054867200 -2139062144 0 1 -1054867200 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +(when (= (scf-get-territory) 2) + (let ((v1-89 (get-field-spec-by-id (-> *part-id-table* 5469) (sp-field-id spt-userdata)))) + (if v1-89 + (set! (-> v1-89 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054866944 -2139062144 0 1 -1054866944 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-92 (get-field-spec-by-id (-> *part-id-table* 5470) (sp-field-id spt-userdata)))) + (if v1-92 + (set! (-> v1-92 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054866944 -2139062144 0 1 -1054866944 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +(when (= (scf-get-territory) 3) + (let ((v1-96 (get-field-spec-by-id (-> *part-id-table* 5469) (sp-field-id spt-userdata)))) + (if v1-96 + (set! (-> v1-96 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054865920 -2139062144 0 1 -1054865920 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-99 (get-field-spec-by-id (-> *part-id-table* 5470) (sp-field-id spt-userdata)))) + (if v1-99 + (set! (-> v1-99 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054865920 -2139062144 0 1 -1054865920 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +(defpartgroup group-title-plug + :id 1289 + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5471 :flags (bit6) :period 1500 :length 150) + (sp-item 5472 :flags (bit6) :period 1500 :length 150) + (sp-item 5473 :period 1500 :length 200) + (sp-item 5473 :period 1500 :length 100) + (sp-item 5473 :period 1500 :length 70) + (sp-item 5473 :period 1500 :length 45) + (sp-item 5473 :period 1500 :length 30) + (sp-item 5473 :period 1500 :length 25) + (sp-item 5473 :period 1500 :length 20) + (sp-item 5473 :period 1500 :length 15) + ) + ) + +(defpart 5471 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -5.0) (degrees 10.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 20.0 4.0 1.0) + (sp-flt spt-omega 411648.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +(defpart 5472 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -2.0) (degrees 4.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 255.0 255.0 1.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 8.0 4.0 1.0) + (sp-flt spt-omega 1231667.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +(defpart 5473 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-flt spt-omega 8.192) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-r -0.85 -0.85 1.0) + (sp-rnd-flt spt-fade-g -1.7 -1.7 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 300 1199 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) diff --git a/goalc/CMakeLists.txt b/goalc/CMakeLists.txt index 942bb28600..c113fbc87d 100644 --- a/goalc/CMakeLists.txt +++ b/goalc/CMakeLists.txt @@ -62,5 +62,8 @@ if (WIN32) endif () add_executable(goalc main.cpp) -target_link_libraries(goalc common Zydis compiler sqlite3 SQLiteCpp) +add_executable(goalc-simple simple_main.cpp) + +target_link_libraries(goalc common Zydis compiler sqlite3 SQLiteCpp) +target_link_libraries(goalc-simple common Zydis compiler sqlite3 SQLiteCpp) diff --git a/goalc/simple_main.cpp b/goalc/simple_main.cpp new file mode 100644 index 0000000000..b582fba8ff --- /dev/null +++ b/goalc/simple_main.cpp @@ -0,0 +1,52 @@ +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/versions.h" + +#include "goalc/compiler/Compiler.h" + +int main(int argc, char** argv) { + // logging + lg::set_stdout_level(lg::level::info); + lg::set_flush_level(lg::level::info); + lg::initialize(); + + // game version + std::string game = "jak1"; + if (argc > 1) { + game = argv[1]; + } + GameVersion game_version = game_name_to_version(game); + + // path + if (!file_util::setup_project_path(std::nullopt)) { + return 1; + } + + lg::info("OpenGOAL Compiler {}.{}", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR); + + std::unique_ptr compiler; + ReplStatus status = ReplStatus::OK; + try { + compiler = + std::make_unique(game_version, "", std::make_unique(game_version)); + while (status != ReplStatus::WANT_EXIT) { + if (status == ReplStatus::WANT_RELOAD) { + lg::info("Reloading compiler..."); + if (compiler) { + compiler->save_repl_history(); + } + compiler = std::make_unique(game_version, "", + std::make_unique(game_version)); + status = ReplStatus::OK; + } + std::string input_from_stdin = compiler->get_repl_input(); + if (!input_from_stdin.empty()) { + status = compiler->handle_repl_string(input_from_stdin); + } + } + } catch (std::exception& e) { + lg::error("Compiler Fatal Error: {}", e.what()); + } + + return 0; +} diff --git a/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc b/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc index 5a826b4af3..897fb4c8e6 100644 --- a/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc +++ b/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc @@ -66,7 +66,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -1437,7 +1437,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/characters/sig/sig_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig_REF.gc index 379e733aec..59c99dbf4c 100644 --- a/test/decompiler/reference/jak2/characters/sig/sig_REF.gc +++ b/test/decompiler/reference/jak2/characters/sig/sig_REF.gc @@ -67,7 +67,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc index 8da9d1737d..3aa59623ae 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -181,7 +181,7 @@ ;; definition of type collide-prim-core (deftype collide-prim-core (structure) ((world-sphere vector :inline :offset-assert 0) - (collide-as collide-spec :offset-assert 16) + (collide-as collide-spec :offset 16) (collide-with collide-spec :offset-assert 20) (action collide-action :offset-assert 24) (prim-type prim-type :offset-assert 28) @@ -1628,7 +1628,7 @@ (try-snap-to-surface (_type_ vector float float float) symbol 64) (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol 65) (step-collison! (_type_ vector vector float int) float 66) - (collide-shape-moving-method-67 () none 67) + (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none 67) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc index e1fa49b7d9..0eda210864 100644 --- a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc @@ -3,10 +3,10 @@ ;; definition of type idle-control-frame (deftype idle-control-frame (uint32) - ((command uint8 :offset 0 :size 8) - (anim uint8 :offset 8 :size 8) - (param0 uint8 :offset 16 :size 8) - (param1 uint8 :offset 24 :size 8) + ((command ic-cmd :offset 0 :size 8) + (anim uint8 :offset 8 :size 8) + (param0 uint8 :offset 16 :size 8) + (param1 uint8 :offset 24 :size 8) ) :method-count-assert 9 :size-assert #x4 @@ -28,13 +28,13 @@ (v1-4 (-> obj command)) ) (t9-1 a0-2 a1-1 a2-1 (cond - ((= v1-4 1) + ((= v1-4 (ic-cmd play)) "play" ) - ((= v1-4 2) + ((= v1-4 (ic-cmd push)) "push" ) - ((zero? v1-4) + ((= v1-4 (ic-cmd restart)) "restart" ) (else @@ -106,11 +106,9 @@ (let ((s5-0 self)) (set! self arg0) (loop - (let* ((s4-0 (-> obj current 0)) - (v1-4 (-> s4-0 command)) - ) - (cond - ((= v1-4 1) + (let ((s4-0 (-> obj current 0))) + (case (-> s4-0 command) + (((ic-cmd play)) (if (< (-> s4-0 anim) 0) (return #f) ) @@ -157,14 +155,14 @@ ) ) ) - ((= v1-4 2) + (((ic-cmd push)) (ja-channel-push! 1 (the-as time-frame (-> s4-0 param0))) (set! (-> obj current) (&-> (-> obj current) 1)) (set! (-> obj counter) 0) (set! (-> obj target) 0) 0 ) - ((zero? v1-4) + (((ic-cmd restart)) (set! (-> obj current) (-> obj anim)) (set! (-> obj counter) 0) (set! (-> obj target) 0) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc index acc0db301f..14d4ca5d51 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -355,7 +355,68 @@ ) ;; definition for method 67 of type collide-shape-moving -;; ERROR: function was not converted to expressions. Cannot decompile. +;; WARN: Return type mismatch int vs none. +(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((obj collide-shape-moving) (arg0 matrix) (arg1 collide-query)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 *collide-cache*) + (s3-0 (-> obj root-prim)) + (s2-0 1) + ) + (b! (nonzero? (-> s3-0 prim-core prim-type)) cfg-2 :delay (empty-form)) + (let ((v1-2 s3-0)) + (set! s3-0 (-> (the-as collide-shape-prim-group v1-2) child 0)) + (set! s2-0 (the-as int (-> v1-2 specific 0))) + ) + (label cfg-2) + (b! #t cfg-13 :delay (nop!)) + (label cfg-3) + (+! s2-0 -1) + (let ((v1-4 -1)) + (b! (!= (-> s3-0 prim-core prim-type) v1-4) cfg-12 :delay (nop!)) + ) + (.lvf vf5 (&-> s3-0 local-sphere quad)) + (.lvf vf1 (&-> arg0 quad 0)) + (.lvf vf2 (&-> arg0 quad 1)) + (.lvf vf3 (&-> arg0 quad 2)) + (.lvf vf4 (&-> arg0 trans quad)) + (.lvf vf6 (&-> s3-0 prim-core world-sphere quad)) + (.mul.x.vf acc vf1 vf5) + (.add.mul.y.vf acc vf2 vf5 acc) + (.add.mul.z.vf acc vf3 vf5 acc) + (.add.mul.w.vf vf7 vf4 vf0 acc :mask #b111) + (.sub.vf vf8 vf7 vf6 :mask #b111) + (.svf (&-> arg1 move-dist quad) vf8) + (let ((s1-0 (the-as collide-cache-prim (-> s4-0 prims)))) + (countdown (s0-0 (-> s4-0 num-prims)) + (when (logtest? (-> s3-0 prim-core collide-with) (-> s1-0 prim-core collide-as)) + (if (>= (the-as int (-> s1-0 prim-core prim-type)) 0) + (collide-with-collide-cache-prim-mesh s3-0 arg1 s1-0) + (collide-with-collide-cache-prim-sphere s3-0 arg1 s1-0) + ) + ) + (&+! s1-0 48) + ) + ) + (label cfg-12) + (&+! s3-0 80) + (label cfg-13) + (b! (nonzero? s2-0) cfg-3 :delay (nop!)) + ) + 0 + (none) + ) + ) ;; definition for function transform-rigid-body-prims (defun transform-rigid-body-prims ((arg0 collide-shape-prim) (arg1 matrix)) @@ -398,397 +459,9 @@ ;; definition for method 63 of type collide-shape-moving ;; INFO: Used lq/sq -;; ERROR: failed type prop at 118: Could not figure out load: (set! v1 (l.wu v1)) ;; WARN: Return type mismatch int vs none. -(defmethod collide-shape-moving-method-63 collide-shape-moving ((a0-0 collide-shape-moving) (a1-0 rigid-body) (a2-0 float)) - (local-vars - (v0-0 quaternion) - (v0-1 none) - (v0-2 pointer) - (v0-3 quaternion) - (v0-4 none) - (v0-5 symbol) - (v0-6 none) - (v0-7 none) - (v0-8 none) - (v0-9 symbol) - (v0-10 none) - (v0-11 none) - (v0-12 none) - (v0-13 symbol) - (v0-14 pointer) - (v0-15 none) - (v0-16 none) - (v0-17 none) - (v0-18 none) - (v0-19 none) - (v0-20 none) - (v0-21 none) - (v0-22 none) - (v0-23 none) - (v0-24 none) - (v0-25 none) - (v0-26 none) - (v0-27 none) - (v0-28 none) - (v0-29 none) - (v0-30 none) - (v0-31 none) - (v0-32 none) - (v0-33 none) - (v0-34 none) - (v0-35 none) - (v0-36 int) - (v1-0 int) - (v1-1 int) - (v1-2 vector) - (v1-3 type) - (v1-5 vector) - (v1-6 type) - (v1-8 type) - (v1-10 symbol) - (v1-11 type) - (v1-13 type) - (v1-15 type) - (v1-17 type) - (v1-19 type) - (v1-21 float) - (v1-22 uint) - (v1-23 float) - (v1-24 none) - (v1-25 none) - (v1-26 none) - (v1-27 none) - (v1-28 none) - (v1-29 none) - (v1-30 none) - (v1-31 none) - (v1-32 none) - (v1-33 none) - (v1-34 none) - (v1-37 none) - (v1-38 none) - (v1-39 none) - (v1-41 none) - (v1-42 none) - (v1-44 none) - (v1-46 none) - (v1-47 none) - (v1-48 none) - (v1-49 none) - (v1-50 none) - (v1-51 none) - (v1-52 none) - (v1-53 none) - (v1-54 none) - (v1-55 none) - (v1-56 none) - (v1-57 none) - (v1-58 none) - (v1-59 none) - (v1-60 none) - (v1-61 none) - (v1-62 none) - (v1-63 none) - (v1-64 none) - (v1-65 none) - (v1-68 none) - (v1-70 none) - (v1-71 none) - (v1-72 none) - (v1-74 none) - (v1-76 none) - (v1-77 none) - (v1-78 none) - (v1-79 none) - (v1-80 none) - (v1-81 none) - (v1-82 none) - (v1-83 none) - (v1-84 none) - (v1-87 none) - (v1-88 none) - (v1-89 none) - (v1-91 none) - (v1-93 none) - (v1-95 none) - (v1-97 none) - (v1-98 none) - (v1-99 none) - (v1-102 none) - (v1-103 none) - (v1-104 none) - (v1-105 none) - (v1-106 none) - (v1-107 none) - (v1-109 none) - (v1-110 none) - (v1-112 none) - (v1-114 none) - (v1-115 none) - (v1-116 none) - (v1-117 none) - (v1-118 none) - (v1-119 none) - (v1-120 none) - (v1-121 none) - (v1-122 none) - (v1-124 none) - (v1-125 none) - (v1-126 none) - (v1-127 none) - (v1-128 none) - (v1-129 none) - (v1-131 none) - (v1-132 none) - (v1-133 none) - (v1-134 none) - (v1-135 none) - (v1-136 none) - (v1-137 none) - (v1-138 none) - (v1-140 none) - (v1-142 none) - (v1-144 none) - (v1-147 int) - (a0-1 vector) - (a0-2 uint128) - (a0-3 vector) - (a0-4 rigid-body) - (a0-5 vector) - (a0-6 vector) - (a0-7 uint128) - (a0-8 quaternion) - (a0-9 rigid-body) - (a0-10 collide-shape-prim) - (a0-11 collide-shape-moving) - (a0-12 rigid-body) - (a0-13 rigid-body) - (a0-14 collide-shape-prim) - (a0-15 touching-list) - (a0-16 rigid-body) - (a0-17 rigid-body) - (a0-18 collide-shape-prim) - (a0-19 vector) - (a0-20 none) - (a0-21 none) - (a0-25 none) - (a0-26 none) - (a0-27 none) - (a0-28 none) - (a0-29 none) - (a0-30 none) - (a0-31 none) - (a0-32 none) - (a0-33 none) - (a0-34 none) - (a0-35 none) - (a0-36 none) - (a0-37 none) - (a0-38 none) - (a0-39 none) - (a0-40 none) - (a0-41 none) - (a0-43 none) - (a0-47 none) - (a0-49 none) - (a0-50 none) - (a0-51 none) - (a0-54 none) - (a0-55 none) - (a0-56 none) - (a0-57 none) - (a0-58 none) - (a0-59 none) - (a0-60 none) - (a0-64 none) - (a1-1 quaternion) - (a1-2 float) - (a1-3 matrix) - (a1-4 vector) - (a1-5 matrix) - (a1-6 vector) - (a1-7 float) - (a1-8 matrix) - (a1-9 float) - (a1-10 float) - (a1-11 matrix) - (a1-12 matrix) - (a1-13 none) - (a1-14 none) - (a1-15 none) - (a1-16 none) - (a1-17 none) - (a1-18 none) - (a1-19 none) - (a1-20 none) - (a1-21 none) - (a1-22 none) - (a1-23 none) - (a1-24 none) - (a1-25 none) - (a1-26 none) - (a1-27 none) - (a1-28 none) - (a1-29 none) - (a1-30 none) - (a1-31 none) - (a1-32 none) - (a1-33 none) - (a1-34 none) - (a1-35 none) - (a1-36 none) - (a1-37 none) - (a1-38 none) - (a1-39 none) - (a1-42 none) - (a1-43 none) - (a1-44 none) - (a1-45 none) - (a1-46 none) - (a1-47 none) - (a1-48 none) - (a1-50 none) - (a2-1 int) - (a2-2 vector) - (a2-3 int) - (a2-4 none) - (a2-5 none) - (a2-6 none) - (a2-7 none) - (a2-8 none) - (a2-9 none) - (a2-10 none) - (a2-11 none) - (a2-12 none) - (s2-0 none) - (s3-0 symbol) - (s5-0 (inline-array vector)) - (t9-0 (function quaternion quaternion quaternion)) - (t9-1 (function rigid-body float none)) - (t9-2 (function pointer pointer int pointer)) - (t9-3 (function quaternion quaternion quaternion)) - (t9-4 (function rigid-body none)) - (t9-5 (function collide-shape-prim matrix symbol)) - (t9-6 (function none)) - (t9-7 (function rigid-body float none)) - (t9-8 (function rigid-body none)) - (t9-9 (function collide-shape-prim matrix symbol)) - (t9-10 (function touching-list float none)) - (t9-11 (function rigid-body float none)) - (t9-12 (function rigid-body none)) - (t9-13 (function collide-shape-prim matrix symbol)) - (t9-14 (function pointer pointer int pointer)) - (t9-15 none) - (t9-16 none) - (t9-17 none) - (t9-18 none) - (t9-19 none) - (t9-20 none) - (t9-21 none) - (t9-22 none) - (t9-23 none) - (t9-24 none) - (t9-25 none) - (t9-26 none) - (t9-27 none) - (t9-28 none) - (t9-29 none) - (t9-30 none) - (t9-31 none) - (t9-32 none) - (t9-33 none) - (t9-34 none) - (t9-35 none) - (sp-0 none) - (f0-0 float) - (f0-1 float) - (f0-2 float) - (f0-3 float) - (f0-4 float) - (f0-5 float) - (f0-6 float) - (f0-7 float) - (f0-8 float) - (f0-9 float) - (f0-10 float) - (f0-11 float) - (f0-12 none) - (f0-13 none) - (f0-14 none) - (f0-15 none) - (f0-16 none) - (f0-17 none) - (f0-18 none) - (f0-19 none) - (f0-20 none) - (f0-21 none) - (f0-22 none) - (f0-23 none) - (f0-24 none) - (f0-25 none) - (f0-26 none) - (f0-27 none) - (f0-28 none) - (f0-29 none) - (f0-30 none) - (f0-31 none) - (f0-32 none) - (f0-33 none) - (f0-34 none) - (f0-35 none) - (f0-36 none) - (f0-37 none) - (f0-38 none) - (f0-39 none) - (f0-40 none) - (f0-41 none) - (f0-42 none) - (f0-43 none) - (f0-44 none) - (f0-45 float) - (f0-46 float) - (f0-47 float) - (f0-48 float) - (f1-0 float) - (f1-1 float) - (f1-2 float) - (f1-3 none) - (f1-4 none) - (f1-5 none) - (f1-6 none) - (f1-7 none) - (f1-8 none) - (f1-9 none) - (f1-10 none) - (f1-11 none) - (f1-12 none) - (f1-13 none) - (f1-14 none) - (f1-15 none) - (f1-16 none) - (f1-17 none) - (f1-18 none) - (f1-19 none) - (f1-20 none) - (f1-21 none) - (f1-22 none) - (f1-23 none) - (f1-24 float) - (f1-25 float) - (f1-26 float) - (f2-0 none) - (f2-1 none) - (f2-2 none) - (f2-3 none) - (f2-4 none) - (f2-5 none) - (f3-0 none) - (f30-0 float) - (f30-1 none) - (f30-2 none) - (f30-3 none) - ) +(defmethod collide-shape-moving-method-63 collide-shape-moving ((obj collide-shape-moving) (arg0 rigid-body) (arg1 float)) + (local-vars (s3-0 rigid-body)) (with-pp (rlet ((acc :class vf) (Q :class vf) @@ -799,553 +472,181 @@ (vf9 :class vf) ) (init-vf0-vector) - (set! s5-0 (new 'stack-no-clear 'inline-array 'vector 51)) - (set! f0-0 (gpr->fpr a2-0)) - (set! (-> s5-0 49 z) f0-0) - (set! v1-0 #x3f800000) - (set! f0-1 (the-as float (gpr->fpr v1-0))) - (set! (-> s5-0 49 w) f0-1) - (s.b! (+ s5-0 800) 0) - (until (begin - (set! v1-1 -859915232) - (set! f0-2 (the-as float (gpr->fpr v1-1))) - (set! (-> s5-0 7 x) f0-2) - (set! (-> s5-0 7 z) (the-as float #f)) - (set! (-> s5-0 7 y) (the-as float #f)) - (set! v1-2 (-> s5-0 42)) - (set! a0-1 (-> a1-0 position)) - (set! a0-2 (-> a0-1 quad)) - (set! (-> v1-2 quad) a0-2) - (set! t9-0 quaternion-copy!) - (set! a0-3 (-> s5-0 43)) - (set! a1-1 (-> a1-0 rotation)) - (call! a0-3 a1-1) - (set! a0-4 a1-0) - (set! v1-3 rigid-body) - (set! t9-1 (method-of-type v1-3 rigid-body-method-14)) - (set! f0-3 (-> s5-0 49 w)) - (set! f1-0 (-> s5-0 49 z)) - (set! f0-4 (*.s f0-3 f1-0)) - (set! a1-2 (fpr->gpr f0-4)) - (call! a0-4 a1-2) - (set! v1-4 v0-1) - (set! t9-2 mem-copy!) - (set! a0-5 (-> s5-0 34)) - (set! a1-3 (-> a1-0 matrix)) - (set! a2-1 64) - (call! a0-5 a1-3 a2-1) - (set! v1-5 (-> a1-0 position)) - (set! a0-6 (-> s5-0 42)) - (set! a0-7 (-> a0-6 quad)) - (set! (-> v1-5 quad) a0-7) - (set! t9-3 quaternion-copy!) - (set! a0-8 (-> a1-0 rotation)) - (set! a1-4 (-> s5-0 43)) - (call! a0-8 a1-4) - (set! a0-9 a1-0) - (set! v1-6 rigid-body) - (set! t9-4 (method-of-type v1-6 rigid-body-method-24)) - (call! a0-9) - (set! v1-7 v0-4) - (set! t9-5 transform-rigid-body-prims) - (set! a0-10 (-> a0-0 root-prim)) - (set! a1-5 (-> a1-0 matrix)) - (call! a0-10 a1-5) - (set! a0-11 a0-0) - (set! v1-8 (-> a0-11 type)) - (set! t9-6 (method-of-type v1-8 collide-shape-moving-method-67)) - (set! a1-6 (-> s5-0 34)) - (set! a2-2 (-> s5-0 0)) - (call!) - (set! v1-9 v0-6) - (set! f30-0 (-> s5-0 7 x)) - (set! f0-5 (the-as float 0)) - (b! (>=.s f30-0 f0-5) L106 (set! v1-10 #f)) - (set! a0-12 a1-0) - (set! v1-11 rigid-body) - (set! t9-7 (method-of-type v1-11 rigid-body-method-14)) - (set! f0-6 (-> s5-0 49 w)) - (set! f1-1 (-> s5-0 49 z)) - (set! f0-7 (*.s f0-6 f1-1)) - (set! a1-7 (fpr->gpr f0-7)) - (call! a0-12 a1-7) - (set! v1-12 v0-7) - (set! a0-13 a1-0) - (set! v1-13 rigid-body) - (set! t9-8 (method-of-type v1-13 rigid-body-method-13)) - (call! a0-13) - (set! v1-14 v0-8) - (set! t9-9 transform-rigid-body-prims) - (set! a0-14 (-> a0-0 root-prim)) - (set! a1-8 (-> a1-0 matrix)) - (call! a0-14 a1-8) - (set! f0-8 (the-as float 0)) - (set! (-> s5-0 49 w) f0-8) - ((b! #t L126 (nop!)) (nop!)) - (label cfg-3) - (set! a0-15 *touching-list*) - (set! v1-15 touching-list) - (set! t9-10 (method-of-type v1-15 update-from-step-size)) - (set! a1-9 (fpr->gpr f30-0)) - (call! a0-15 a1-9) - (set! v1-16 v0-10) - (set! a0-16 a1-0) - (set! v1-17 rigid-body) - (set! t9-11 (method-of-type v1-17 rigid-body-method-14)) - (set! f0-9 (-> s5-0 49 w)) - (set! f1-2 (-> s5-0 49 z)) - (set! f0-10 (*.s f0-9 f1-2)) - (set! f0-11 (*.s f0-10 f30-0)) - (set! a1-10 (fpr->gpr f0-11)) - (call! a0-16 a1-10) - (set! v1-18 v0-11) - (set! a0-17 a1-0) - (set! v1-19 rigid-body) - (set! t9-12 (method-of-type v1-19 rigid-body-method-13)) - (call! a0-17) - (set! v1-20 v0-12) - (set! t9-13 transform-rigid-body-prims) - (set! a0-18 (-> a0-0 root-prim)) - (set! a1-11 (-> a1-0 matrix)) - (call! a0-18 a1-11) - (set! t9-14 mem-copy!) - (set! a0-19 (-> s5-0 34)) - (set! a1-12 (-> a1-0 matrix)) - (set! a2-3 64) - (call! a0-19 a1-12 a2-3) - (set! s3-0 #f) - (set! v1-21 (-> s5-0 7 y)) - ((b! (not v1-21) L110 (set! v1-22 #f)) (empty-form)) - (set! v1-23 (-> s5-0 7 y)) - (set! v1-24 (the-as none (l.wu v1-23))) - (set! a0-20 (the-as none (l.wu (+ v1-24 136)))) - (set! v1-25 (the-as none (l.wu (+ a0-20 180)))) - ((b! (zero? v1-25) L110 (set! v1-26 #f)) (empty-form)) - (set! v1-27 (the-as none (l.wu (+ a0-20 180)))) - (set! s3-0 (the-as symbol (+ v1-27 12))) - (set! v1-28 (the-as none (l.wu (+ s3-0 8)))) - (set! v1-29 (the-as none (logand v1-28 8))) - ((b! (zero? v1-29) L109 (nop!)) (nop!)) - (set! v1-30 (the-as none (l.wu (+ s3-0 8)))) - (set! v1-31 (the-as none (logand v1-30 2))) - ((b! (nonzero? v1-31) L108 (set! v1-32 #f)) (empty-form)) - (if (begin (set! a1-13 (the-as none (+ sp-0 832))) (set! v1-33 (the-as none s6-0)) v1-33) - (set! a2-4 (the-as none (l.wu (+ v1-33 24)))) - ) - (s.w! (+ a1-13 8) a2-4) - (s.w! (+ a1-13 68) 0) - (set! v1-34 (the-as none 'enable-physics)) - (s.w! (+ a1-13 64) v1-34) - (set! t9-15 (the-as none send-event-function)) - (call!) - (set! v1-35 (the-as none v0-15)) - (label cfg-10) - ((b! #t L110 (nop!)) (nop!)) - (label cfg-11) - (set! s3-0 (the-as symbol #f)) - (set! v1-36 (the-as none s3-0)) - (label cfg-12) - (set! v1-37 (the-as none (-> s5-0 7 z))) - (set! a0-21 (the-as none (-> s5-0 0))) - (.lvf vf7 (+ a0-21 48)) - (.lvf vf6 (+ v1-37 12)) - (.sub.vf vf8 vf6 vf7) - (.mul.vf vf9 vf8 vf8 :mask #b111) - (.mul.x.vf acc vf0 vf9 :mask #b1000) - (.add.mul.y.vf acc vf0 vf9 acc :mask #b1000) - (.add.mul.z.vf vf9 vf0 vf9 acc :mask #b1000) - (.isqrt.vf Q vf0 vf9 :fsf #b11 :ftf #b11) - (.mov.vf vf8 vf0 :mask #b1000) - (.wait.vf) - (.mul.vf vf8 vf8 Q :mask #b111) - (.nop.vf) - (.nop.vf) - (.nop.vf) - (.svf (&-> s5-0 39 quad) vf8) - (.svf (&-> s5-0 38 quad) vf7) - (set! v1-38 (the-as none (l.wu (+ v1-37 4)))) - (set! (-> s5-0 41 w) (the-as float v1-38)) - (set! a0-22 (the-as none a1-0)) - (set! v1-39 (the-as none rigid-body)) - (set! t9-16 (the-as none (l.wu (+ v1-39 104)))) - (set! a1-14 (the-as none (-> s5-0 38))) - (set! a2-5 (the-as none (-> s5-0 40))) - (call!) - (set! v1-40 (the-as none v0-16)) - ((b! (not s3-0) L111 (set! v1-41 #f)) (empty-form)) - (set! a0-23 (the-as none s3-0)) - (set! v1-42 (the-as none rigid-body)) - (set! t9-17 (the-as none (l.wu (+ v1-42 68)))) - (call!) - (set! v1-43 (the-as none v0-17)) - (set! a0-24 (the-as none s3-0)) - (set! v1-44 (the-as none rigid-body)) - (set! t9-18 (the-as none (l.wu (+ v1-44 104)))) - (set! a1-15 (the-as none (+ s5-0 608))) - (set! a2-6 (the-as none (+ s5-0 720))) - (call!) - (set! v1-45 (the-as none v0-18)) - (set! a1-16 (the-as none (+ s5-0 640))) - (set! v1-46 (the-as none (+ s5-0 640))) - (set! a0-25 (the-as none (+ s5-0 720))) - (set! a1-17 (the-as none (vector-!2 a1-16 v1-46 a0-25))) - (label cfg-14) - (set! f0-12 (the-as none 0)) - (s.f! (+ s5-0 656) f0-12) - (set! v1-47 (the-as none -1009988403)) - (set! f0-13 (the-as none (gpr->fpr v1-47))) - (set! a0-26 (the-as none (+ s5-0 640))) - (set! v1-48 (the-as none (+ s5-0 624))) - (set! f1-3 (the-as none (vec3dot a0-26 v1-48))) - (set! v1-49 (the-as none (fpr->gpr f1-3))) - (set! f1-4 (the-as none (gpr->fpr v1-49))) - (set! f0-14 (the-as none (+.s f0-13 f1-4))) - (s.f! (+ s5-0 784) f0-14) - (set! f0-15 (the-as none 0)) - (s.f! (+ s5-0 788) f0-15) - (set! f0-16 (the-as none (l.f (+ s5-0 784)))) - (set! f1-5 (the-as none 0)) - (b! (>=.s f0-16 f1-5) L123 (nop!)) - (if (begin - (when (begin - (when (begin - (cond - ((begin - (set! a1-18 (the-as none (+ s5-0 736))) - (set! v1-50 (the-as none (+ s5-0 608))) - (set! a0-27 (the-as none (+ a1-0 32))) - (set! a1-19 (the-as none (vector-!2 a1-18 v1-50 a0-27))) - (set! a1-20 (the-as none (+ s5-0 752))) - (set! v1-51 (the-as none (+ s5-0 736))) - (set! a0-28 (the-as none (+ s5-0 624))) - (set! a1-21 (the-as none (veccross a1-20 v1-51 a0-28))) - (set! t9-19 (the-as none vector-rotate*!)) - (set! a0-29 (the-as none (+ s5-0 752))) - (set! a1-22 (the-as none (+ s5-0 752))) - (set! a2-7 (the-as none (+ a1-0 224))) - (call!) - (set! a1-23 (the-as none (+ s5-0 752))) - (set! v1-52 (the-as none (+ s5-0 752))) - (set! a0-30 (the-as none (+ s5-0 736))) - (set! a1-24 (the-as none (veccross a1-23 v1-52 a0-30))) - (set! v1-53 (the-as none (l.wu (+ a1-0 4)))) - (set! f0-17 (the-as none (l.f (+ v1-53 4)))) - (set! a0-31 (the-as none (+ s5-0 624))) - (set! v1-54 (the-as none (+ s5-0 752))) - (set! f1-6 (the-as none (vec3dot a0-31 v1-54))) - (set! v1-55 (the-as none (fpr->gpr f1-6))) - (set! f1-7 (the-as none (gpr->fpr v1-55))) - (set! f0-18 (the-as none (+.s f0-17 f1-7))) - (s.f! (+ s5-0 788) f0-18) - (set! v1-56 (the-as none (l.wu (+ a1-0 4)))) - (set! f30-1 (the-as none (l.f (+ v1-56 16)))) - s3-0 - ) - (set! a1-25 (the-as none (+ s5-0 736))) - (set! v1-57 (the-as none (+ s5-0 608))) - (set! a0-32 (the-as none (+ s3-0 32))) - (set! a1-26 (the-as none (vector-!2 a1-25 v1-57 a0-32))) - (set! a1-27 (the-as none (+ s5-0 752))) - (set! v1-58 (the-as none (+ s5-0 736))) - (set! a0-33 (the-as none (+ s5-0 624))) - (set! a1-28 (the-as none (veccross a1-27 v1-58 a0-33))) - (set! t9-20 (the-as none vector-rotate*!)) - (set! a0-34 (the-as none (+ s5-0 752))) - (set! a1-29 (the-as none (+ s5-0 752))) - (set! a2-8 (the-as none (+ s3-0 224))) - (call!) - (set! a1-30 (the-as none (+ s5-0 752))) - (set! v1-59 (the-as none (+ s5-0 752))) - (set! a0-35 (the-as none (+ s5-0 736))) - (set! a1-31 (the-as none (veccross a1-30 v1-59 a0-35))) - (set! f0-19 (the-as none (l.f (+ s5-0 788)))) - (set! v1-60 (the-as none (l.wu (+ s3-0 4)))) - (set! f1-8 (the-as none (l.f (+ v1-60 4)))) - (set! a0-36 (the-as none (+ s5-0 624))) - (set! v1-61 (the-as none (+ s5-0 752))) - (set! f2-0 (the-as none (vec3dot a0-36 v1-61))) - (set! v1-62 (the-as none (fpr->gpr f2-0))) - (set! f2-1 (the-as none (gpr->fpr v1-62))) - (set! f1-9 (the-as none (+.s f1-8 f2-1))) - (set! f0-20 (the-as none (+.s f0-19 f1-9))) - (s.f! (+ s5-0 788) f0-20) - (set! v1-63 (the-as none (l.wu (+ s3-0 4)))) - (set! f0-21 (the-as none (l.f (+ v1-63 16)))) - (set! f0-22 (the-as none (max.s f30-1 f0-21))) - (set! v1-64 (the-as none (l.wu (+ a1-0 4)))) - (set! f1-10 (the-as none (l.f (+ v1-64 24)))) - (set! v1-65 (the-as none (l.wu (+ s3-0 4)))) - (set! f2-2 (the-as none (l.f (+ v1-65 24)))) - (set! f1-11 (the-as none (*.s f1-10 f2-2))) - (set! f30-1 (the-as none (max.s f0-22 f1-11))) - (set! v1-66 (the-as none (fpr->gpr f30-1))) - ) - (else - ) - ) - (set! v1-68 (the-as none #x3f800000)) - (set! f0-23 (the-as none (gpr->fpr v1-68))) - (set! f0-24 (the-as none (+.s f0-23 f30-1))) - (set! f1-12 (the-as none (l.f (+ s5-0 784)))) - (set! f1-13 (the-as none (neg.s f1-12))) - (set! f2-3 (the-as none (l.f (+ s5-0 788)))) - (set! f1-14 (the-as none (/.s f1-13 f2-3))) - (set! f0-25 (the-as none (*.s f0-24 f1-14))) - (s.f! (+ s5-0 656) f0-25) - (set! v1-69 (the-as none (fpr->gpr f0-25))) - (set! v1-70 (the-as none (+ s5-0 704))) - (set! a0-37 (the-as none (+ s5-0 624))) - (set! f0-26 (the-as none (l.f (+ s5-0 656)))) - (set! v1-71 (the-as none (vector-float*!2 v1-70 a0-37 f0-26))) - (set! v1-72 (the-as none (l.wu (+ a1-0 4)))) - (set! f30-2 (the-as none (l.f v1-72))) - s3-0 - ) - (set! v1-74 (the-as none (l.wu (+ s3-0 4)))) - (set! f0-27 (the-as none (l.f v1-74))) - (set! f30-2 (the-as none (min.s f30-2 f0-27))) - (set! v1-75 (the-as none (fpr->gpr f30-2))) - ) - (when (begin - (set! v1-76 (the-as none (+ s5-0 768))) - (set! a0-38 (the-as none (+ s5-0 640))) - (set! a1-32 (the-as none (+ s5-0 624))) - (set! f0-28 (the-as none (l.f (+ s5-0 784)))) - (set! f0-29 (the-as none (neg.s f0-28))) - (set! v1-77 (the-as none (vecplusfloattimes v1-76 a0-38 a1-32 f0-29))) - (set! t9-21 (the-as none vector-normalize!)) - (set! a0-39 (the-as none (+ s5-0 768))) - (set! a1-33 (the-as none #x3f800000)) - (call!) - (set! v1-78 (the-as none -1082130432)) - (set! f0-30 (the-as none (gpr->fpr v1-78))) - (set! a0-40 (the-as none (+ s5-0 768))) - (set! v1-79 (the-as none (+ s5-0 640))) - (set! f1-15 (the-as none (vec3dot a0-40 v1-79))) - (set! v1-80 (the-as none (fpr->gpr f1-15))) - (set! f1-16 (the-as none (gpr->fpr v1-80))) - (set! f1-17 (the-as none (*.s f1-16 f30-2))) - (set! v1-81 (the-as none (l.wu (+ a1-0 4)))) - (set! f2-4 (the-as none (l.f (+ v1-81 20)))) - (set! f3-0 (the-as none (l.f (+ s5-0 656)))) - (set! f2-5 (the-as none (*.s f2-4 f3-0))) - (set! f1-18 (the-as none (min.s f1-17 f2-5))) - (set! f0-31 (the-as none (*.s f0-30 f1-18))) - (set! v1-82 (the-as none (+ s5-0 704))) - (set! a0-41 (the-as none (+ s5-0 704))) - (set! a1-34 (the-as none (+ s5-0 768))) - (set! v1-83 (the-as none (vecplusfloattimes v1-82 a0-41 a1-34 f0-31))) - (set! a0-42 (the-as none a1-0)) - (set! v1-84 (the-as none rigid-body)) - (set! t9-22 (the-as none (l.wu (+ v1-84 88)))) - (set! a1-35 (the-as none (+ s5-0 608))) - (set! a2-9 (the-as none (+ s5-0 704))) - (call!) - (set! v1-85 (the-as none v0-22)) - s3-0 - ) - (set! v1-87 (the-as none (+ s5-0 704))) - (set! a0-43 (the-as none (+ s5-0 704))) - (set! a1-36 (the-as none -1082130432)) - (set! f0-32 (the-as none (gpr->fpr a1-36))) - (set! v1-88 (the-as none (vector-float*!2 v1-87 a0-43 f0-32))) - (set! a0-44 (the-as none s3-0)) - (set! v1-89 (the-as none rigid-body)) - (set! t9-23 (the-as none (l.wu (+ v1-89 88)))) - (set! a1-37 (the-as none (+ s5-0 608))) - (set! a2-10 (the-as none (+ s5-0 704))) - (call!) - (set! v1-90 (the-as none v0-23)) - ) - (set! a0-45 (the-as none a1-0)) - (set! v1-91 (the-as none rigid-body)) - (set! t9-24 (the-as none (l.wu (+ v1-91 64)))) - (set! a1-38 (the-as none #x3f800000)) - (call!) - (set! v1-92 (the-as none v0-24)) - (set! a0-46 (the-as none a1-0)) - (set! v1-93 (the-as none rigid-body)) - (set! t9-25 (the-as none (l.wu (+ v1-93 68)))) - (call!) - (set! v1-94 (the-as none v0-25)) - (set! f30-3 (the-as none (l.f (+ s5-0 112)))) - (set! v1-95 (the-as none #x38d1b717)) - (set! f0-33 (the-as none (gpr->fpr v1-95))) - (<.s f30-3 f0-33) - ) - (set! v1-97 (the-as none (+ a1-0 32))) - (set! a0-47 (the-as none (+ a1-0 32))) - (set! a1-39 (the-as none (+ s5-0 624))) - (set! a2-11 (the-as none #x4223d70a)) - (set! f0-34 (the-as none (gpr->fpr a2-11))) - (set! v1-98 (the-as none (vecplusfloattimes v1-97 a0-47 a1-39 f0-34))) - (set! a0-48 (the-as none a1-0)) - (set! v1-99 (the-as none rigid-body)) - (set! t9-26 (the-as none (l.wu (+ v1-99 112)))) - (call!) - (set! v1-100 (the-as none v0-26)) - ) - (when (begin - (set! f0-35 (the-as none (l.f (+ s5-0 796)))) - (set! f1-19 (the-as none (l.f (+ s5-0 796)))) - (set! f1-20 (the-as none (*.s f30-3 f1-19))) - (set! f0-36 (the-as none (-.s f0-35 f1-20))) - (s.f! (+ s5-0 796) f0-36) - (set! v1-101 (the-as none (fpr->gpr f0-36))) - (set! v1-102 (the-as none (l.wu (+ s5-0 80)))) - (s.w! (+ s5-0 660) v1-102) - (set! v1-103 (the-as none s6-0)) - (set! a0-49 (the-as none (l.wu (+ s5-0 116)))) - a0-49 - ) - (set! v1-104 (the-as none (l.wu a0-49))) - (set! v1-103 (the-as none (l.wu (+ v1-104 136)))) - (set! a1-41 (the-as none v1-103)) - ) - (s.w! (+ s5-0 664) s3-0) - (set! a1-42 (the-as none (+ sp-0 832))) - v1-103 - ) - (set! a0-50 (the-as none (l.wu (+ v1-103 24)))) - ) - (s.w! (+ a1-42 8) a0-50) - (set! v1-105 (the-as none 1)) - (s.w! (+ a1-42 68) v1-105) - (set! v1-106 (the-as none 'impact-impulse)) - (s.w! (+ a1-42 64) v1-106) - (set! v1-107 (the-as none (+ s5-0 608))) - (s.d! (+ a1-42 16) v1-107) - (set! t9-27 (the-as none send-event-function)) - (set! a0-51 (the-as none (l.wu (+ a0-0 136)))) - (call!) - (set! v1-108 (the-as none v0-27)) - ((b! (not s3-0) L120 (set! v1-109 #f)) (empty-form)) - (if (begin - (set! a0-52 (the-as none s3-0)) - (set! v1-110 (the-as none rigid-body)) - (set! t9-28 (the-as none (l.wu (+ v1-110 64)))) - (set! a1-43 (the-as none #x3f800000)) - (call!) - (set! v1-111 (the-as none v0-28)) - (set! a0-53 (the-as none s3-0)) - (set! v1-112 (the-as none rigid-body)) - (set! t9-29 (the-as none (l.wu (+ v1-112 68)))) - (call!) - (set! v1-113 (the-as none v0-29)) - (set! v1-114 (the-as none (l.wu (+ s5-0 116)))) - (set! s2-0 (the-as none (l.wu v1-114))) - (set! t9-30 (the-as none transform-rigid-body-prims)) - (set! a0-54 (the-as none (l.wu (+ s2-0 156)))) - (set! a1-44 (the-as none (+ s3-0 160))) - (call!) - (set! v1-115 (the-as none (+ s5-0 624))) - (set! a0-55 (the-as none (+ s5-0 624))) - (set! a1-45 (the-as none -1082130432)) - (set! f0-37 (the-as none (gpr->fpr a1-45))) - (set! v1-116 (the-as none (vector-float*!2 v1-115 a0-55 f0-37))) - (set! v1-117 (the-as none (+ s5-0 640))) - (set! a0-56 (the-as none (+ s5-0 640))) - (set! a1-46 (the-as none -1082130432)) - (set! f0-38 (the-as none (gpr->fpr a1-46))) - (set! v1-118 (the-as none (vector-float*!2 v1-117 a0-56 f0-38))) - (s.w! (+ s5-0 664) a1-0) - (set! a1-47 (the-as none (+ sp-0 832))) - (set! v1-119 (the-as none (l.wu (+ a0-0 136)))) - v1-119 - ) - (set! a0-57 (the-as none (l.wu (+ v1-119 24)))) - ) - (s.w! (+ a1-47 8) a0-57) - (set! v1-120 (the-as none 1)) - (s.w! (+ a1-47 68) v1-120) - (set! v1-121 (the-as none 'impact-impulse)) - (s.w! (+ a1-47 64) v1-121) - (set! v1-122 (the-as none (+ s5-0 608))) - (s.d! (+ a1-47 16) v1-122) - (set! t9-31 (the-as none send-event-function)) - (set! a0-58 (the-as none (l.wu (+ s2-0 136)))) - (call!) - (set! v1-123 (the-as none v0-31)) - (label cfg-32) - (set! v1-124 (the-as none (l.b (+ s5-0 800)))) - (set! v1-125 (the-as none (+ v1-124 1))) - (s.b! (+ s5-0 800) v1-125) - (set! v1-126 (the-as none #x3d4ccccd)) - (set! f0-39 (the-as none (gpr->fpr v1-126))) - (set! f1-21 (the-as none (l.f (+ s5-0 796)))) - (set! v1-127 (the-as none (<.s f0-39 f1-21))) - (and v1-127 (begin - (set! v1-129 (the-as none (l.b (+ s5-0 800)))) - (set! a0-59 (the-as none (l.bu (+ a0-0 140)))) - (set! v1-128 (the-as none (<.si v1-129 a0-59))) - ) - ) - (not v1-128) - ) - (empty) - ) - ((b! #t L125 (nop!)) (nop!)) - (label cfg-39) - ((b! (not s3-0) L124 (set! v1-131 #f)) (empty-form)) - (set! v1-132 (the-as none (l.wu (+ s5-0 116)))) - (set! v1-133 (the-as none (l.wu v1-132))) - (set! v1-134 (the-as none (l.wu (+ v1-133 136)))) - (s.w! (+ a1-0 16) v1-134) - (set! v1-135 (the-as none 0)) - (label cfg-41) - (set! v1-136 (the-as none (+ a1-0 32))) - (set! a0-60 (the-as none (+ a1-0 32))) - (set! a1-48 (the-as none (+ s5-0 624))) - (set! a2-12 (the-as none #x4223d70a)) - (set! f0-40 (the-as none (gpr->fpr a2-12))) - (set! v1-137 (the-as none (vecplusfloattimes v1-136 a0-60 a1-48 f0-40))) - (set! a0-61 (the-as none a1-0)) - (set! v1-138 (the-as none rigid-body)) - (set! t9-32 (the-as none (l.wu (+ v1-138 112)))) - (call!) - (set! v1-139 (the-as none v0-32)) - (set! v1-140 (the-as none 0)) - (when (begin - (label cfg-42) - (set! f0-41 (the-as none 0)) - (set! f1-22 (the-as none (l.f (+ s5-0 796)))) - (<.s f0-41 f1-22) + (let ((s5-0 (new 'stack-no-clear 'rb-work))) + (set! (-> s5-0 dt) arg1) + (set! (-> s5-0 float-1) 1.0) + (set! (-> s5-0 cnt) 0) + (until (not (and (< 0.05 (-> s5-0 float-1)) (< (-> s5-0 cnt) (the-as int (-> obj max-iteration-count))))) + (set! (-> s5-0 cquery best-dist) -100000000.0) + (set! (-> s5-0 cquery best-my-prim) #f) + (set! (-> s5-0 cquery num-spheres) (the-as uint #f)) + (set! (-> s5-0 vec-1 quad) (-> arg0 position quad)) + (quaternion-copy! (-> s5-0 quat-1) (-> arg0 rotation)) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) + (mem-copy! (the-as pointer (-> s5-0 mat-1)) (the-as pointer (-> arg0 matrix)) 64) + (set! (-> arg0 position quad) (-> s5-0 vec-1 quad)) + (quaternion-copy! (-> arg0 rotation) (-> s5-0 quat-1)) + (rigid-body-method-24 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (collide-with-all-collide-cache-prims obj (-> s5-0 mat-1) (-> s5-0 cquery)) + (let ((f30-0 (-> s5-0 cquery best-dist))) + (b! (>= f30-0 0.0) cfg-3 :delay #f) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) + (rigid-body-method-13 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (set! (-> s5-0 float-1) 0.0) + (b! #t cfg-44 :delay (nop!)) + (label cfg-3) + (update-from-step-size *touching-list* f30-0) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt) f30-0)) + ) + (rigid-body-method-13 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (mem-copy! (the-as pointer (-> s5-0 mat-1)) (the-as pointer (-> arg0 matrix)) 64) + (set! s3-0 (the-as rigid-body #f)) + (b! (not (-> s5-0 cquery num-spheres)) cfg-12 :delay (empty-form)) + (let ((a0-20 (-> (the-as collide-shape-prim (-> s5-0 cquery num-spheres)) cshape process))) + (b! (zero? (-> a0-20 rbody)) cfg-12 :delay (empty-form)) + (set! s3-0 (-> a0-20 rbody state)) + (b! (not (logtest? (-> s3-0 flags) (rigid-body-flag active))) cfg-11 :delay (nop!)) + (b! (logtest? (-> s3-0 flags) (rigid-body-flag enable-physics)) cfg-10 :delay (empty-form)) + (send-event a0-20 'enable-physics) + ) + (label cfg-10) + (b! #t cfg-12 :delay (nop!)) + (label cfg-11) + (set! s3-0 (the-as rigid-body #f)) + (label cfg-12) + (let ((v1-37 (-> s5-0 cquery best-my-prim))) + (.lvf vf7 (&-> (-> s5-0 cquery) best-other-tri intersect quad)) + (.lvf vf6 (&-> v1-37 prim-core world-sphere quad)) + (.sub.vf vf8 vf6 vf7) + (.mul.vf vf9 vf8 vf8 :mask #b111) + (.mul.x.vf acc vf0 vf9 :mask #b1000) + (.add.mul.y.vf acc vf0 vf9 acc :mask #b1000) + (.add.mul.z.vf vf9 vf0 vf9 acc :mask #b1000) + (.isqrt.vf Q vf0 vf9 :fsf #b11 :ftf #b11) + (.mov.vf vf8 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf8 vf8 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> s5-0 vec-5 quad) vf8) + (.svf (&-> s5-0 vec-2 quad) vf7) + (set! (-> s5-0 prim-id) (the-as int (-> v1-37 prim-id))) + ) + (rigid-body-method-22 arg0 (-> s5-0 vec-2) (-> s5-0 vec-3)) + (b! (not s3-0) cfg-14 :delay (empty-form)) + (rigid-body-method-13 s3-0) + (rigid-body-method-22 s3-0 (-> s5-0 vec-2) (-> s5-0 vec-4)) + (vector-! (-> s5-0 vec-3) (-> s5-0 vec-3) (-> s5-0 vec-4)) + (label cfg-14) + (set! (-> s5-0 float-4) 0.0) + (set! (-> s5-0 float-2) (+ -409.6 (vector-dot (-> s5-0 vec-3) (-> s5-0 vec-5)))) + (set! (-> s5-0 float-3) 0.0) + (b! (>= (-> s5-0 float-2) 0.0) cfg-39) + (vector-! (-> s5-0 vec-6) (-> s5-0 vec-2) (-> arg0 position)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-6) (-> s5-0 vec-5)) + (vector-rotate*! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> arg0 inv-i-world)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s5-0 vec-6)) + (set! (-> s5-0 float-3) (+ (-> arg0 info inv-mass) (vector-dot (-> s5-0 vec-5) (-> s5-0 vec-7)))) + (let ((f30-1 (-> arg0 info bounce-factor))) + (cond + (s3-0 + (vector-! (-> s5-0 vec-6) (-> s5-0 vec-2) (-> s3-0 position)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-6) (-> s5-0 vec-5)) + (vector-rotate*! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s3-0 inv-i-world)) + (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s5-0 vec-6)) + (+! (-> s5-0 float-3) (+ (-> s3-0 info inv-mass) (vector-dot (-> s5-0 vec-5) (-> s5-0 vec-7)))) + (set! f30-1 (fmax + (fmax f30-1 (-> s3-0 info bounce-factor)) + (* (-> arg0 info bounce-mult-factor) (-> s3-0 info bounce-mult-factor)) + ) + ) + ) + (else + ) ) - (set! a0-62 (the-as none a1-0)) - (set! v1-142 (the-as none rigid-body)) - (set! t9-33 (the-as none (l.wu (+ v1-142 72)))) - (set! f0-42 (the-as none (l.f (+ s5-0 796)))) - (set! f1-23 (the-as none (l.f (+ s5-0 792)))) - (set! f0-43 (the-as none (*.s f0-42 f1-23))) - (set! a1-49 (the-as none (fpr->gpr f0-43))) - (call!) - (set! v1-143 (the-as none v0-33)) - (set! a0-63 (the-as none a1-0)) - (set! v1-144 (the-as none rigid-body)) - (set! t9-34 (the-as none (l.wu (+ v1-144 68)))) - (call!) - (set! v1-145 (the-as none v0-34)) - (set! t9-35 (the-as none transform-rigid-body-prims)) - (set! a0-64 (the-as none (l.wu (+ a0-0 156)))) - (set! a1-50 (the-as none (+ a1-0 160))) - (call!) - (set! f0-44 (the-as none 0)) - (s.f! (+ s5-0 796) f0-44) - (set! v1-146 (the-as none (fpr->gpr f0-44))) + (set! (-> s5-0 float-4) (* (+ 1.0 f30-1) (/ (- (-> s5-0 float-2)) (-> s5-0 float-3)))) + ) + (vector-float*! (-> s5-0 vec-8) (-> s5-0 vec-5) (-> s5-0 float-4)) + (let ((f30-2 (-> arg0 info mass))) + (if s3-0 + (set! f30-2 (fmin f30-2 (-> s3-0 info mass))) + ) + (vector+float*! (-> s5-0 vec-9) (-> s5-0 vec-3) (-> s5-0 vec-5) (- (-> s5-0 float-2))) + (vector-normalize! (-> s5-0 vec-9) 1.0) + (let ((f0-31 (* -1.0 (fmin + (* (vector-dot (-> s5-0 vec-9) (-> s5-0 vec-3)) f30-2) + (* (-> arg0 info friction-factor) (-> s5-0 float-4)) + ) + ) + ) + ) + (vector+float*! (-> s5-0 vec-8) (-> s5-0 vec-8) (-> s5-0 vec-9) f0-31) + ) + ) + (rigid-body-method-18 arg0 (-> s5-0 vec-2) (-> s5-0 vec-8)) + (when s3-0 + (vector-float*! (-> s5-0 vec-8) (-> s5-0 vec-8) -1.0) + (rigid-body-method-18 s3-0 (-> s5-0 vec-2) (-> s5-0 vec-8)) + ) + (rigid-body-method-12 arg0 1.0) + (rigid-body-method-13 arg0) + (let ((f30-3 (-> s5-0 cquery best-dist))) + (when (< f30-3 0.0001) + (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 vec-5) 40.96) + (rigid-body-method-24 arg0) + ) + (set! (-> s5-0 float-1) (- (-> s5-0 float-1) (* f30-3 (-> s5-0 float-1)))) + ) + (set! (-> s5-0 pat-id) (-> s5-0 cquery best-other-tri pat)) + (let ((v1-103 pp)) + (let ((a0-49 (the-as object (-> s5-0 cquery num-spheres)))) + (if (the-as uint a0-49) + (set! v1-103 (-> (the-as collide-shape-prim-mesh a0-49) cshape process)) + ) + ) + (set! (-> s5-0 rbody) s3-0) + (send-event (-> obj process) 'impact-impulse :from v1-103 (-> s5-0 vec-2)) + ) + (b! (not s3-0) cfg-32 :delay (empty-form)) + (rigid-body-method-12 s3-0 1.0) + (rigid-body-method-13 s3-0) + (let ((s2-0 (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape))) + (transform-rigid-body-prims (-> s2-0 root-prim) (-> s3-0 matrix)) + (vector-float*! (-> s5-0 vec-5) (-> s5-0 vec-5) -1.0) + (vector-float*! (-> s5-0 vec-3) (-> s5-0 vec-3) -1.0) + (set! (-> s5-0 rbody) arg0) + (send-event (-> s2-0 process) 'impact-impulse :from (-> obj process) (-> s5-0 vec-2)) + ) + (label cfg-32) + (+! (-> s5-0 cnt) 1) + ) + (b! #t cfg-42 :delay (nop!)) + (label cfg-39) + (b! (not s3-0) cfg-41 :delay (empty-form)) + (set! (-> arg0 blocked-by) (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape process)) + 0 + (label cfg-41) + (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 vec-5) 40.96) + (rigid-body-method-24 arg0) + 0 + (label cfg-42) + (when (< 0.0 (-> s5-0 float-1)) + (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) + (rigid-body-method-13 arg0) + (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (set! (-> s5-0 float-1) 0.0) + ) + (label cfg-44) + (let ((f0-47 (* (- 1.0 (-> s5-0 float-1)) (-> s5-0 dt)))) + (set! (-> arg0 time-remaining) (- (-> arg0 time-remaining) f0-47)) + ) ) - (label cfg-44) - (set! v1-147 #x3f800000) - (set! f0-45 (the-as float (gpr->fpr v1-147))) - (set! f1-24 (-> s5-0 49 w)) - (set! f0-46 (-.s f0-45 f1-24)) - (set! f1-25 (-> s5-0 49 z)) - (set! f0-47 (*.s f0-46 f1-25)) - (set! f1-26 (-> a1-0 time-remaining)) - (set! f0-48 (-.s f1-26 f0-47)) - (set! (-> a1-0 time-remaining) f0-48) - (set! v1-148 (fpr->gpr f0-48)) - (set! v0-36 0) - (ret-none) + 0 + (none) ) ) ) @@ -1576,6 +877,7 @@ ) ;; definition for method 10 of type rigid-body-control +;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs object. (defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1)))) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc index 204b88ff2c..cf7394738c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc @@ -216,7 +216,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc index 06a2cf9b2f..4c68493b24 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc @@ -45,8 +45,8 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x64 :param1 #x64) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc index 97bcb726a5..6f8b01c225 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc @@ -124,7 +124,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc index 9b387aa59e..4924923b67 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc @@ -137,7 +137,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -251,7 +251,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -365,7 +365,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -479,7 +479,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -593,7 +593,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc index 6aeb3c8f4b..cd8a51ea76 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -229,10 +229,10 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 8 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc index 749bf046e2..bf99519036 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc @@ -331,7 +331,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc index 5845b1b48f..befb47483a 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc @@ -135,7 +135,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc index 4545ab41b5..cfbccb7df6 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc @@ -130,22 +130,22 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 20 - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x8) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x27) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x4 :param1 #x8) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x27) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc index 8048acde59..d3a931bc29 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc @@ -554,7 +554,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x2 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) @@ -1209,7 +1209,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x2 :param1 #x2) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x2 :param0 #x2 :param1 #x2) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc index 6c06753226..7eb30e144e 100644 --- a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc @@ -450,21 +450,21 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 16 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x3 :param1 #x6) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #xf :param1 #x1e) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x2 :param1 #x4) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xa :param1 #x14) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x3 :param1 #x6) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x2 :param1 #x4) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #xa :param1 #x14) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #xf :param1 #x1e) (new 'static 'idle-control-frame) ) :idle-anim 5 diff --git a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc index 0db34ab267..1fd2407854 100644 --- a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc @@ -197,41 +197,41 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 36 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x2 :param0 #x3c) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) - (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x1e :param0 #x1 :param1 #x1) - (new 'static 'idle-control-frame :command #x2 :param0 #x3c) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x3c) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x1e :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x3c) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) ) :idle-anim 5 diff --git a/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc index 4e46bd6296..25df91a080 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc @@ -233,7 +233,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 8444ed6c99..4b027a3e2e 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -122,7 +122,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index 8681d7ecdc..093f0a1e69 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -295,7 +295,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc index 6650c00a2d..7e5ff1918d 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc @@ -521,7 +521,7 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc index 83043cf76c..3571be1fa4 100644 --- a/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc +++ b/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc @@ -47,10 +47,10 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 8 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x2 :param1 #x3) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x2 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x2) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc index ef30b2f3c4..8f2dcc7edf 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -90,7 +90,7 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc index 75168c32a5..4ad49d2e6a 100644 --- a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc @@ -56,8 +56,8 @@ :move-to-ground #f :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #xd :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #xd :param0 #x64 :param1 #x64) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc index 1ca91b49d3..1e594d9b39 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -1694,8 +1694,8 @@ This commonly includes things such as: :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 4 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x3) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) ) diff --git a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc index b9f20e4db4..9965780b6f 100644 --- a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc @@ -408,10 +408,10 @@ :move-to-ground #t :hover-if-no-ground #f :idle-anim-script (new 'static 'array idle-control-frame 8 - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x4) - (new 'static 'idle-control-frame :command #x2 :param0 #x1e) - (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x4) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) (new 'static 'idle-control-frame) diff --git a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc new file mode 100644 index 0000000000..1452583c9f --- /dev/null +++ b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc @@ -0,0 +1,1564 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type title-control +(deftype title-control (process) + ((selected int32 :offset-assert 128) + (sprites hud-sprite 2 :inline :offset-assert 144) + (sprite-pos vector :inline :offset-assert 272) + (sprite-draw uint32 :offset-assert 288) + (buffer external-art-buffer 2 :offset-assert 292) + (want int32 2 :offset-assert 300) + (want-name basic 2 :offset-assert 308) + (have int32 2 :offset-assert 316) + (draw int32 :offset-assert 324) + (draw-name basic :offset-assert 328) + (active symbol :offset-assert 332) + (spark-time time-frame :offset-assert 336) + (gui-id uint32 :offset-assert 344) + ) + :heap-base #xe0 + :method-count-assert 18 + :size-assert #x15c + :flag-assert #x1200e0015c + (:methods + (startup () _type_ :state 14) + (wait () _type_ :state 15) + (idle () _type_ :state 16) + (scrap-book (int) _type_ :state 17) + ) + ) + +;; definition for method 3 of type title-control +(defmethod inspect title-control ((obj title-control)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tselected: ~D~%" (-> obj selected)) + (format #t "~2Tsprites[2] @ #x~X~%" (-> obj sprites)) + (format #t "~2Tsprite-pos: ~`vector`P~%" (-> obj sprite-pos)) + (format #t "~2Tsprite-draw: ~D~%" (-> obj sprite-draw)) + (format #t "~2Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (dotimes (s5-0 2) + (format #t "~T [~D]~2Tbuffer: ~A~%" s5-0 (-> obj buffer s5-0)) + ) + (format #t "~2Twant[2] @ #x~X~%" (-> obj want)) + (format #t "~2Twant-name[2] @ #x~X~%" (-> obj want-name)) + (format #t "~2Thave[2] @ #x~X~%" (-> obj have)) + (format #t "~2Tdraw: ~D~%" (-> obj draw)) + (format #t "~2Tdraw-name: ~A~%" (-> obj draw-name)) + (format #t "~2Tactive: ~A~%" (-> obj active)) + (format #t "~2Tspark-time: ~D~%" (-> obj spark-time)) + (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (label cfg-7) + obj + ) + +;; definition for method 7 of type title-control +;; WARN: Return type mismatch process vs title-control. +(defmethod relocate title-control ((obj title-control) (arg0 int)) + (dotimes (v1-0 2) + (if (nonzero? (-> obj buffer v1-0)) + (&+! (-> obj buffer v1-0) arg0) + ) + ) + (the-as title-control ((method-of-type process relocate) obj arg0)) + ) + +;; definition for method 10 of type title-control +(defmethod deactivate title-control ((obj title-control)) + (dotimes (s5-0 2) + (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + ) + (dotimes (s5-1 2) + (update (-> obj buffer s5-1)) + ) + ((method-of-type process deactivate) obj) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-jak-logo jak-logo jak-logo-lod0-jg -1 + ((jak-logo-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-jak-stand jak-stand jak-stand-lod0-jg -1 + ((jak-stand-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +;; definition for function title-plug-lightning +;; INFO: Used lq/sq +;; WARN: Return type mismatch time-frame vs none. +(defun title-plug-lightning ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (local-vars (sv-32 cspace) (sv-48 int) (sv-64 symbol) (sv-80 int) (sv-96 vector)) + (set! sv-32 arg2) + (when (< (-> *setting-control* user-current movie-skip-frame) 0.0) + (let ((s5-0 (get-process *default-dead-pool* lightning-tracker #x4000))) + (when s5-0 + (let ((t9-1 (method-of-type lightning-tracker activate))) + (t9-1 + (the-as lightning-tracker s5-0) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s3-0 run-function-in-process) + (s2-0 s5-0) + (s1-0 lightning-tracker-init) + (s0-0 (-> *lightning-spec-id-table* 1)) + ) + (set! sv-48 30) + (set! sv-64 (the-as symbol #f)) + (set! sv-80 (+ (-> sv-32 joint number) 1)) + (set! sv-96 (new 'stack-no-clear 'vector)) + (set! (-> sv-96 x) (+ (-> arg1 x) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 y) (+ (-> arg1 y) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 z) (+ (-> arg1 z) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 w) 1.0) + ((the-as (function object object object object object object object object none) s3-0) + s2-0 + s1-0 + s0-0 + sv-48 + sv-64 + arg0 + sv-80 + sv-96 + ) + ) + (-> s5-0 ppointer) + ) + ) + (let ((v1-21 (handle->process (-> *game-info* controller 0)))) + (if v1-21 + (set! (-> (the-as title-control v1-21) spark-time) (-> *display* base-clock frame-counter)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "title-disk-intro" + :extra #f + :info #f + :mask-to-clear #x1000000 + :entity "scene-stage-47" + :art-group "scenecamera" + :anim "title-disk-intro" + :parts 10 + :command-list '((0 + (want-force-vis 'ctysluma #t) + (want-force-vis 'ctywide #t) + (kill "ctysluma-part-181") + (kill "ctysluma-part-182") + (kill "ctysluma-part-187") + (kill "ctysluma-part-188") + (send-event "jak-logo" 'color-mult 0 0 0 1) + (setting-unset sound-bank-load) + (apply + ,(lambda () + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 23) + (send-event (ppointer->process *time-of-day*) 'change 'minute 0) + (send-event (ppointer->process *time-of-day*) 'change 'second 0) + ) + ) + (joint-eval + ,(lambda ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (logior! (-> arg0 draw global-effect) (draw-control-global-effect title-light)) + (case (scf-get-territory) + ((1) + (case (-> *setting-control* user-current language) + (((language-enum spanish)) + (send-event arg0 'segment 32 0) + ) + (((language-enum french)) + (send-event arg0 'segment 64 0) + ) + (else + (send-event arg0 'segment 512 0) + ) + ) + ) + ((2) + (send-event arg0 'segment 256 128) + ) + ) + ) + entity + "jak-logo" + joint + "plugsparks" + ) + (fadein (seconds (new 'static 'bfloat :data 1.0))) + ) + (10 (want-force-vis 'ctysluma #f) (want-force-vis 'ctywide #f) (send-event *target* 'change-mode 'title)) + (991 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + (part-tracker + "group-title-plug" + entity + "jak-logo" + joint + "plugsparks" + track + #t + duration + (frame-range (new 'static 'bfloat :data 991.0) (new 'static 'bfloat :data 1011.0)) + ) + ) + (992 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (998 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (999 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1004 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1005 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1008 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1009 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1010 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1011 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval title-plug-lightning entity "jak-logo" joint "plugsparks") + ) + (1012 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1013 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + ) + (1033 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1063 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + ) + (1073 + (send-event + "jak-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1105 + (apply + ,(lambda () + (with-pp + (kill-by-type lightning-tracker *active-pool*) + (kill-by-type part-tracker *active-pool*) + (if (lookup-gui-connection *gui-control* pp (gui-channel art-load) (the-as string #f) (new 'static 'sound-id)) + (sound-group-pause (sound-group dialog)) + ) + (send-event (handle->process (-> *game-info* controller 0)) 'pause) + (time-of-day-setup #t) + (remove-setting! 'half-speed) + (none) + ) + ) + ) + ) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :draw-target #f + :abort #f + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'title + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-logo" + :level 'title + :art-group "skel-jak-logo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x6e + ) + (new 'static 'scene-actor + :name "jak-stand" + :level 'title + :art-group "skel-jak-stand" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "title-movie" + :end-point-obj "title-movie-end" + :borrow '() + :sfx-volume 1.0 + :ambient-volume 1.0 + :blackout-end #f + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +;; definition for function title-screen-change +;; WARN: Return type mismatch int vs none. +(defbehavior title-screen-change title-control ((arg0 symbol) (arg1 int) (arg2 symbol) (arg3 int) (arg4 symbol) (arg5 symbol)) + (when arg5 + (let ((s1-0 (the-as int (-> *setting-control* user-current language)))) + (if (and (= (the-as language-enum s1-0) (language-enum english)) (= (scf-get-territory) 1)) + (set! s1-0 7) + ) + (if (>= arg1 0) + (+! arg1 (* 3 s1-0)) + ) + (if (>= arg3 0) + (+! arg3 (* 3 s1-0)) + ) + ) + ) + (set! (-> self want-name 0) (the-as basic 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 #x3f800000 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 #x3f800000 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + ) + (set! (-> self draw) arg1) + (set! (-> self draw-name) (the-as basic arg0)) + (set! (-> self active) #f) + (while (and (>= (-> self draw) 0) (not (-> self active))) + (suspend) + ) + (remove-setting! 'bg-a) + (set! (-> self want-name 1) (the-as basic arg2)) + (set! (-> self want 1) arg3) + 0 + (none) + ) + +;; definition for function wait-for-press +(defun wait-for-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (with-pp + (let ((s3-0 (-> pp clock frame-counter)) + (s4-0 #f) + ) + (while (not (or (>= (- (-> pp clock frame-counter) s3-0) arg1) (and (>= (- (-> pp clock frame-counter) s3-0) arg0) s4-0)) + ) + (if (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s4-0 #t) + ) + (when (cpad-pressed? 0 triangle) + (set! s4-0 'abort) + (goto cfg-14) + ) + (suspend) + ) + (label cfg-14) + s4-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 uint32 #x132))) + (until #f + (when (not (paused?)) + (cond + ((and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (> (-> self selected) 0) + ) + (seekl! (-> self selected) 0 1) + (sound-play "dmenu-move") + ) + ((and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (< (-> self selected) (+ (-> gp-1 length) -1)) + ) + (seekl! (-> self selected) (+ (-> gp-1 length) -1) 1) + (sound-play "dmenu-move") + ) + ((or (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (cpad-pressed? 0 start) + (or (not *debug-segment*) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) + ) + ) + (sound-play "dmenu-pick") + (return (the-as object (-> self selected))) + ) + ) + (when (< (mod (-> self clock frame-counter) 300) 210) + (set! sv-112 (new + 'stack + 'font-context + *font-default-matrix* + 64 + 312 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (let ((v1-35 sv-112)) + (set! (-> v1-35 width) (the float 384)) + ) + (let ((v1-36 sv-112)) + (set! (-> v1-36 height) (the float 50)) + ) + (set! (-> sv-112 flags) (font-flags shadow kerning middle left large)) + (set! (-> sv-112 scale) 0.7) + (dotimes (s5-4 (-> gp-1 length)) + (if (= (-> self selected) s5-4) + (set! (-> sv-112 color) (font-color #f1f104)) + (set! (-> sv-112 color) (font-color #dadada)) + ) + (print-game-text + (lookup-text! *common-text* (the-as game-text-id (-> gp-1 s5-4)) #f) + sv-112 + #f + 44 + (bucket-id progress) + ) + (set! (-> sv-112 origin y) (+ 22.0 (-> sv-112 origin y))) + ) + ) + ) + (suspend) + ) + ) + #f + -1 + ) + +;; definition for function title-fade-out +;; WARN: Return type mismatch int vs none. +(defun title-fade-out ((arg0 float)) + (with-pp + (setup *screen-filter* (new 'static 'vector) (new 'static 'vector :w 128.0) arg0 (bucket-id screen-filter)) + (let ((gp-0 (-> pp clock frame-counter))) + (until (>= (- (-> pp clock frame-counter) 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 + (none) + ) + ) + +;; definition for function title-progress +;; WARN: Return type mismatch int vs none. +(defun title-progress ((arg0 symbol)) + (with-pp + (setup + *screen-filter* + (new 'static 'vector :w 128.0) + (new 'static 'vector :w 128.0) + (-> pp clock seconds-per-frame) + (bucket-id screen-filter) + ) + (set-setting! 'allow-progress #t 0 0) + (apply-settings *setting-control*) + (activate-progress *dproc* arg0) + (set-setting! 'allow-progress #f 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) + (apply-settings *setting-control*) + (set-blackout-frames (seconds 0.2)) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate startup (title-control) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('pause) + (set! (-> *game-info* demo-state) (the-as uint 2)) + (the-as object (remove-setting! 'bg-a)) + ) + (('scrap-book) + (go-virtual scrap-book (the-as int (-> event 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)) + ) + ) + ) + (disable *screen-filter*) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + ) + (none) + ) + :code (behavior () + (let ((v1-1 (-> *game-info* demo-state))) + (when (or (zero? v1-1) (= v1-1 1)) + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 6))) + (set! (-> a1-0 5) #f) + (set! (-> a1-0 4) #f) + (set! (-> a1-0 3) #f) + (set! (-> a1-0 2) 'ctywide) + (set! (-> a1-0 1) 'ctysluma) + (set! (-> a1-0 0) 'title) + (want-levels *load-state* a1-0) + ) + (want-display-level *load-state* 'ctysluma 'display) + (want-display-level *load-state* 'ctywide 'display) + (when (zero? (-> *game-info* demo-state)) + (title-screen-change (the-as symbol "demo-screens") 27 #f -1 #t #f) + (wait-for-press (seconds 1) (seconds 5) #f) + (while (not (and (= (level-status *level* 'ctysluma) 'active) (= (level-status *level* 'ctywide) 'active))) + (suspend) + ) + (title-screen-change #f -1 #f -1 #f #f) + (set-blackout-frames (seconds 0.2)) + ) + (label cfg-12) + (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-12) + ) + (set! (-> *setting-control* user-default bg-a) 0.0) + (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-0 'insufficient-space)) + (if (zero? (-> gp-0 handle)) + (set! s5-0 'no-memory-card) + ) + (title-fade-out 1000.0) + (title-progress s5-0) + ) + (goto cfg-26) + ) + ) + ) + ) + (label cfg-26) + (let ((v1-39 (-> *game-info* demo-state))) + (when (or (zero? v1-39) (= v1-39 1)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (let ((gp-2 + (ppointer->handle (process-spawn scene-player :init scene-player-init "title-disk-intro" #t "title-movie")) + ) + ) + (while (and (handle->process (the-as handle gp-2)) (= (-> *game-info* demo-state) 1)) + (when (and (cpad-pressed? 0 start triangle) (< (-> *setting-control* user-current movie-skip-frame) 0.0)) + (set-setting! 'movie-skip-frame 'abs #x448a2000 0) + (set-setting! 'dialog-volume 'abs 0 0) + (set! (-> *setting-control* user-current dialog-volume) 0.000000001) + (set-setting! 'bg-a 'abs #x3f800000 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (apply-settings *setting-control*) + ) + (if *target* + (set! (-> *target* control trans quad) (-> (math-camera-pos) quad)) + ) + (set! (-> *game-info* kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 1)) + ) + ) + (go-virtual wait) + (none) + ) + :post (behavior () + (local-vars (v1-73 external-art-buffer)) + (let ((gp-0 (command-get-process "jak-logo" (the-as process #f)))) + (when (and gp-0 (nonzero? (-> (the-as process-drawable gp-0) draw))) + (let ((s5-0 (lookup-light-sphere-by-name "big-title1" (-> self level bsp light-hash))) + (v1-6 (lookup-light-sphere-by-name "big-title2" (-> self level bsp light-hash))) + ) + (if s5-0 + (set! (-> s5-0 brightness) (-> (the-as process-drawable gp-0) draw color-mult x)) + ) + (if v1-6 + (set! (-> v1-6 brightness) (-> (the-as process-drawable gp-0) draw color-mult x)) + ) + ) + ) + ) + (let ((gp-1 (lookup-light-sphere-by-name "small-title" (-> self level bsp light-hash)))) + (when gp-1 + (if (>= (- (-> *display* base-clock frame-counter) (-> self spark-time)) (seconds 0.125)) + (set! (-> gp-1 brightness) 0.0) + (set! (-> gp-1 brightness) (rand-vu-float-range 0.5 2.0)) + ) + ) + ) + (dotimes (v1-16 2) + (set! (-> self buffer v1-16 frame-lock) #f) + (set! (-> self have v1-16) -1) + ) + (dotimes (gp-2 2) + (let ((s5-1 (-> self want gp-2)) + (s4-0 (-> self want-name gp-2)) + ) + (when (>= s5-1 0) + (dotimes (s3-0 2) + (case (file-status (-> self buffer s3-0) (the-as string s4-0) s5-1) + (('locked 'active) + (set! (-> self buffer s3-0 frame-lock) #t) + (set! (-> self have gp-2) s3-0) + ) + ) + ) + ) + ) + ) + (dotimes (gp-3 2) + (let ((a2-1 (-> self want gp-3)) + (a1-9 (-> self want-name gp-3)) + ) + (when (and (>= a2-1 0) (< (-> self have gp-3) 0)) + (dotimes (v1-46 2) + (when (not (-> self buffer v1-46 frame-lock)) + (set-pending-file (-> self buffer v1-46) (the-as string a1-9) a2-1 (process->handle self) -1.0) + (goto cfg-45) + ) + ) + ) + ) + (label cfg-45) + ) + (dotimes (gp-4 2) + (update (-> self buffer gp-4)) + ) + (set! (-> self active) #f) + (when (>= (-> self draw) 0) + (dotimes (gp-5 2) + (when (file-status (-> self buffer gp-5) (the-as string (-> self draw-name)) (-> self draw)) + (set! v1-73 (-> self buffer gp-5)) + (goto cfg-58) + ) + ) + (set! v1-73 (the-as external-art-buffer #f)) + (label cfg-58) + (when (and v1-73 (-> v1-73 art-group)) + (draw-raw-image (bucket-id debug-no-zbuf1) (-> v1-73 art-group) 512 416 (-> self level) 8) + (set! (-> self active) #t) + ) + ) + (none) + ) + ) + +;; 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) + :code (behavior () + (remove-setting! 'allow-timeout) + (remove-setting! 'dialog-volume) + (if (zero? (title-menu)) + (go-virtual idle) + ) + (sleep-code) + (none) + ) + :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 (-> self clock seconds-per-frame))) + (title-progress 'title) + (sleep-code) + (none) + ) + :post (-> (method-of-type title-control startup) post) + ) + +;; 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* ((v1-3 arg0) + (gp-0 (cond + ((= v1-3 1) + 0 + ) + ((= v1-3 2) + 43 + ) + (else + 0 + ) + ) + ) + (s5-1 (cond + ((= arg0 1) + 43 + ) + ((= arg0 2) + 196 + ) + (else + 0 + ) + ) + ) + (s4-0 gp-0) + (a3-0 (+ gp-0 1)) + (v1-6 #f) + ) + (while (not (or (>= s4-0 s5-1) (= v1-6 'abort))) + (let ((t9-1 title-screen-change) + (a0-4 "scrap-book") + (a1-0 s4-0) + (a2-0 "scrap-book") + ) + (set! a3-0 (cond + ((>= a3-0 s5-1) + -1 + ) + (else + (empty) + a3-0 + ) + ) + ) + (t9-1 (the-as symbol a0-4) a1-0 (the-as symbol a2-0) a3-0 (= s4-0 gp-0) #f) + ) + (set! v1-6 (wait-for-press (seconds 1) (seconds 5) #t)) + (+! s4-0 1) + (set! a3-0 (+ s4-0 1)) + ) + ) + (title-screen-change #f -1 #f -1 #f #f) + (set-blackout-frames (seconds 0.2)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (go-virtual idle) + (none) + ) + :post (-> (method-of-type title-control startup) post) + ) + +;; definition for function title-control-init +;; WARN: Return type mismatch object vs none. +(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 (the-as entity-actor a1-2)) + ) + (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-progress #f 0 0) + (set-setting! 'airlock #f 0 0) + (set-setting! 'music #f 0 0) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-error #f 0 0) + (set-setting! 'music-volume 'abs 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 + (none) + ) + #f + ) + ) + ) + (set! (-> self selected) 0) + (dotimes (v1-36 2) + (set! (-> self want v1-36) -1) + (set! (-> self have v1-36) -1) + ) + (set! (-> self draw) -1) + (set! (-> self active) #f) + (dotimes (v1-40 2) + (let ((a0-16 (&+ (-> self sprites 0 color2) (* v1-40 64)))) + (set! (-> a0-16 0) 128) + (set! (-> a0-16 1) 128) + (set! (-> a0-16 2) 128) + (set! (-> a0-16 3) 128) + ) + (set! (-> self sprites v1-40 pos z) #xffffff) + (set! (-> self sprites v1-40 pos w) 0) + (set! (-> self sprites v1-40 scale-x) 1.0) + (set! (-> self sprites v1-40 scale-y) 1.0) + (set! (-> self sprites v1-40 angle) 0.0) + (set! (-> self sprites v1-40 flags) (the-as uint 0)) + (set! (-> self sprites v1-40 tex) #f) + ) + (set! (-> self sprite-draw) (the-as uint 0)) + (case (-> *game-info* demo-state) + ((100) + (set! (-> *game-info* demo-state) (the-as uint 1)) + ) + ((201) + (go-virtual scrap-book 1) + ) + ((202) + (go-virtual scrap-book 2) + ) + ((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) + (none) + ) + +;; failed to figure out what this is: +(defstate target-title (target) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('change-mode) + (case (-> event param 0) + (('grab) + (if (not (-> event param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc arg1 event-type event) + ) + ) + ) + :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)) + (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 :to *entity-pool*)) + ) + ) + (none) + ) + :code (the-as (function symbol none :behavior target) sleep-code) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defpartgroup group-title-sign-naughtydog + :id 1285 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5460 :flags (is-3d launch-asap bit7)) + (sp-item 5461 :flags (is-3d launch-asap bit7)) + (sp-item 5462 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 5462 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 48) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5460 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866432 -2139062144 0 1 -1054866432 #x60606060 #x202020 1) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5461 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866432 -2139062144 0 1 -1054866432 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-title-sign-big-praxis + :id 1286 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5463 :flags (is-3d launch-asap bit7)) + (sp-item 5464 :flags (is-3d launch-asap bit7)) + (sp-item 5465 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 5465 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 48) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5463 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 16)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866688 -2139062144 0 1 -1054866688 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5464 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 16)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866688 -2139062144 0 1 -1054866688 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-title-sign-wanted + :id 1287 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5466 :flags (is-3d launch-asap bit7)) + (sp-item 5467 :flags (is-3d launch-asap bit7)) + (sp-item 5468 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 5468 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5466 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866176 -2139062144 0 1 -1054866176 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5467 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054866176 -2139062144 0 1 -1054866176 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-title-sign-scea + :id 1288 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5469 :flags (is-3d launch-asap bit7)) (sp-item 5470 :flags (is-3d launch-asap bit7))) + ) + +;; failed to figure out what this is: +(defpart 5469 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054867456 -2139062144 0 1 -1054867456 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5470 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc12)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 -1054867456 -2139062144 0 1 -1054867456 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(when (= (scf-get-territory) 1) + (let ((v1-82 (get-field-spec-by-id (-> *part-id-table* 5469) (sp-field-id spt-userdata)))) + (if v1-82 + (set! (-> v1-82 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054867200 -2139062144 0 1 -1054867200 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-85 (get-field-spec-by-id (-> *part-id-table* 5470) (sp-field-id spt-userdata)))) + (if v1-85 + (set! (-> v1-85 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054867200 -2139062144 0 1 -1054867200 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(when (= (scf-get-territory) 2) + (let ((v1-89 (get-field-spec-by-id (-> *part-id-table* 5469) (sp-field-id spt-userdata)))) + (if v1-89 + (set! (-> v1-89 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054866944 -2139062144 0 1 -1054866944 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-92 (get-field-spec-by-id (-> *part-id-table* 5470) (sp-field-id spt-userdata)))) + (if v1-92 + (set! (-> v1-92 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054866944 -2139062144 0 1 -1054866944 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(when (= (scf-get-territory) 3) + (let ((v1-96 (get-field-spec-by-id (-> *part-id-table* 5469) (sp-field-id spt-userdata)))) + (if v1-96 + (set! (-> v1-96 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054865920 -2139062144 0 1 -1054865920 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-99 (get-field-spec-by-id (-> *part-id-table* 5470) (sp-field-id spt-userdata)))) + (if v1-99 + (set! (-> v1-99 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 -1054865920 -2139062144 0 1 -1054865920 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-title-plug + :id 1289 + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5471 :flags (bit6) :period 1500 :length 150) + (sp-item 5472 :flags (bit6) :period 1500 :length 150) + (sp-item 5473 :period 1500 :length 200) + (sp-item 5473 :period 1500 :length 100) + (sp-item 5473 :period 1500 :length 70) + (sp-item 5473 :period 1500 :length 45) + (sp-item 5473 :period 1500 :length 30) + (sp-item 5473 :period 1500 :length 25) + (sp-item 5473 :period 1500 :length 20) + (sp-item 5473 :period 1500 :length 15) + ) + ) + +;; failed to figure out what this is: +(defpart 5471 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -5.0) (degrees 10.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 20.0 4.0 1.0) + (sp-flt spt-omega 411648.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5472 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -2.0) (degrees 4.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 255.0 255.0 1.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 8.0 4.0 1.0) + (sp-flt spt-omega 1231667.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5473 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-flt spt-omega 8.192) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-r -0.85 -0.85 1.0) + (sp-rnd-flt spt-fade-g -1.7 -1.7 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 300 1199 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index cf0adc57dc..78ba41b7b9 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -61,6 +61,7 @@ "DGO/STD.DGO", "DGO/STR.DGO", "DGO/THR.DGO", + "DGO/TITLE.DGO", "DGO/TOA.DGO", "DGO/TOB.DGO", "DGO/TOC.DGO",