From 5299bc441fc336ebd64f7b3902de3fa3951d387f Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sun, 7 Apr 2024 13:07:30 -0400 Subject: [PATCH] [jak3] Fix defskelgroup (#3460) Fixes https://github.com/open-goal/jak-project/issues/3459 --- decompiler/analysis/find_skelgroups.cpp | 54 ++++++++++--------- .../config/jak3/ntsc_v1/type_casts.jsonc | 4 +- game/graphics/opengl_renderer/EyeRenderer.cpp | 6 ++- game/graphics/opengl_renderer/EyeRenderer.h | 1 + game/graphics/texture/TexturePool.cpp | 11 +++- game/graphics/texture/TexturePool.h | 1 + .../jak3/engine/common-obs/collectables.gc | 6 +-- .../jak3/engine/common-obs/generic-obs.gc | 2 +- goal_src/jak3/engine/common-obs/voicebox.gc | 2 +- goal_src/jak3/engine/common-obs/warp-gate.gc | 4 +- goal_src/jak3/engine/gfx/texture/texture.gc | 2 +- goal_src/jak3/engine/target/board/board-h.gc | 4 +- goal_src/jak3/engine/target/flut/flut-h.gc | 2 +- .../jak3/engine/target/gun/gun-dark-shot.gc | 2 +- goal_src/jak3/engine/target/gun/gun-h.gc | 12 ++--- .../jak3/engine/target/gun/gun-red-shot.gc | 2 +- .../jak3/engine/target/gun/gun-yellow-shot.gc | 2 +- goal_src/jak3/engine/target/mech/mech-h.gc | 2 +- goal_src/jak3/engine/target/sidekick.gc | 4 +- .../jak3/engine/target/target-invisible.gc | 2 +- goal_src/jak3/engine/target/target-util.gc | 23 ++++---- .../engine/common-obs/collectables_REF.gc | 6 +-- .../jak3/engine/common-obs/generic-obs_REF.gc | 2 +- .../jak3/engine/common-obs/voicebox_REF.gc | 2 +- .../jak3/engine/common-obs/warp-gate_REF.gc | 4 +- .../engine/gfx/foreground/foreground_REF.gc | 26 +++++---- .../jak3/engine/target/board/board-h_REF.gc | 4 +- .../jak3/engine/target/flut/flut-h_REF.gc | 6 +-- .../engine/target/gun/gun-dark-shot_REF.gc | 2 +- .../jak3/engine/target/gun/gun-h_REF.gc | 12 ++--- .../engine/target/gun/gun-red-shot_REF.gc | 2 +- .../engine/target/gun/gun-yellow-shot_REF.gc | 6 +-- .../jak3/engine/target/mech/mech-h_REF.gc | 2 +- .../jak3/engine/target/sidekick_REF.gc | 4 +- .../engine/target/target-invisible_REF.gc | 2 +- .../jak3/engine/target/target-util_REF.gc | 23 ++++---- 36 files changed, 136 insertions(+), 115 deletions(-) diff --git a/decompiler/analysis/find_skelgroups.cpp b/decompiler/analysis/find_skelgroups.cpp index 9316c53b5d..ab3a8bb705 100644 --- a/decompiler/analysis/find_skelgroups.cpp +++ b/decompiler/analysis/find_skelgroups.cpp @@ -233,25 +233,30 @@ L460: .word 0x0 // jgeo // 36 .word 0x0 // janim // 40 .word 0x0 // ? (word 10) // 44 - .word 0x0 // bounds x // 48 - .word 0x0 // bounds y // 52 - .word 0x0 // bounds z // 56 - .word 0x464ccccd // bounds w/radius // 60 - .word 0x0 // mgeo 0/1 // 64 - .word 0x0 // mgeo 2/3 // 68 - .word 0x0 // mgeo 4/5 // 72 - .word 0x0 // max-lod // 76 - .word 0x0 // lod-dist 0 // 80 - .word 0x0 // lod-dist 1 // 84 - .word 0x0 // lod-dist 2 // 88 - .word 0x0 // lod-dist 3 // 92 - .word 0x0 // lod-dist 4 // 96 - .word 0x0 // lod-dist 5 // 100 - .word 0x45800000 // longest-edge // 104 - .word 0x80a // texture-level/version/shadow/sort // 108 - .word 0x10303 // origin-joint-index/shadow-joint-index/light-index/pad // 112 - .symbol #f // clothing // 116 - .word 0x0 // global-effects // 120 + .word 0x0 // bounds x // 48 11 + .word 0x0 // bounds y // 52 12 + .word 0x0 // bounds z // 56 13 + .word 0x464ccccd // bounds w/radius // 60 14 + .word 0x0 // mgeo 0/1 // 64 15 + .word 0x0 // mgeo 2/3 // 68 16 + .word 0x0 // mgeo 4/5 // 72 17 + .word 0x0 // max-lod // 76 18 + .word 0x0 // lod-dist 0 // 80 19 + .word 0x0 // lod-dist 1 // 84 20 + .word 0x0 // lod-dist 2 // 88 21 + .word 0x0 // lod-dist 3 // 92 22 + .word 0x0 // lod-dist 4 // 96 23 + .word 0x0 // lod-dist 5 // 100 24 + .word 0x45800000 // longest-edge // 104 25 + (texture-level int8 :offset-assert 108) ;; word 26 + (version int8 :offset-assert 109) + (shadow int16 :offset-assert 110) + (shadow-joint-index int8 :offset-assert 112) ;; word 27 + (origin-joint-index int8 :offset-assert 113) + (sort int8 :offset-assert 114) + (light-index uint8 :offset-assert 115) + (clothing (array cloth-params) :offset-assert 116) ;; word 28 + (global-effects uint8 :offset-assert 120) ;; word 29 .word 0x0 // pad */ @@ -297,15 +302,16 @@ L460: } result.tex_level = other_word.get_byte(0); result.version = other_word.get_byte(1); - result.shadow = other_word.get_byte(2); - result.sort = other_word.get_byte(3); + result.shadow = ((u32)other_word.get_byte(2)) | (((u32)other_word.get_byte(3)) << 8); + auto& index_word = words.at(start_word_idx + 27); if (index_word.kind() != LinkedWord::PLAIN_DATA) { env.func->warnings.error_and_throw("Reference to skelgroup bad: invalid index data"); } - result.origin_joint_index = index_word.get_byte(0); - result.shadow_joint_index = index_word.get_byte(1); - result.light_index = index_word.get_byte(2); + result.shadow_joint_index = index_word.get_byte(0); + result.origin_joint_index = index_word.get_byte(1); + result.sort = index_word.get_byte(2); + result.light_index = index_word.get_byte(3); auto& clothing = words.at(start_word_idx + 28); if (clothing.kind() != LinkedWord::SYM_PTR && clothing.symbol_name() != "#f") { diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index 42cf9f52e7..e531e7d407 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -4687,7 +4687,9 @@ [164, "a0", "(pointer uint128)"], [90, "t1", "vu-lights"], [[93, 99], "t1", "(pointer uint128)"], - [101, "t1", "(pointer uint128)"] + [101, "t1", "(pointer uint128)"], + [[42, 49], "t6", "bone-calculation"], + [[0, 200], "at", "foreground-work"] ], "free-eye-index": [[30, "a2", "eye-control"]], "update-eyes": [ diff --git a/game/graphics/opengl_renderer/EyeRenderer.cpp b/game/graphics/opengl_renderer/EyeRenderer.cpp index bc70ce9341..10d74cd9ab 100644 --- a/game/graphics/opengl_renderer/EyeRenderer.cpp +++ b/game/graphics/opengl_renderer/EyeRenderer.cpp @@ -23,10 +23,14 @@ void EyeRenderer::init_textures(TexturePool& texture_pool, GameVersion version) tbp += EYE_BASE_BLOCK_JAK1; break; case GameVersion::Jak2: - case GameVersion::Jak3: // NOTE: using jak 1's address because jak 2's breaks some ocean stuff. + // this is a little suspicious, I think we're possibly just getting lucky here. tbp += EYE_BASE_BLOCK_JAK1; break; + case GameVersion::Jak3: + // for jak 3, go back to using the right TBP. + tbp += EYE_BASE_BLOCK_JAK3; + break; default: ASSERT_NOT_REACHED(); } diff --git a/game/graphics/opengl_renderer/EyeRenderer.h b/game/graphics/opengl_renderer/EyeRenderer.h index 67d070df81..b9c24c504d 100644 --- a/game/graphics/opengl_renderer/EyeRenderer.h +++ b/game/graphics/opengl_renderer/EyeRenderer.h @@ -8,6 +8,7 @@ constexpr int EYE_BASE_BLOCK_JAK1 = 8160; constexpr int EYE_BASE_BLOCK_JAK2 = 3968; +constexpr int EYE_BASE_BLOCK_JAK3 = 504; constexpr int NUM_EYE_PAIRS = 20; constexpr int SINGLE_EYE_SIZE = 32; diff --git a/game/graphics/texture/TexturePool.cpp b/game/graphics/texture/TexturePool.cpp index c5a8518f23..d848bf0d57 100644 --- a/game/graphics/texture/TexturePool.cpp +++ b/game/graphics/texture/TexturePool.cpp @@ -412,6 +412,15 @@ std::string TexturePool::get_debug_texture_name(PcTextureId id) { if (it) { return *it; } else { - return "???"; + return "??? (missing PC id to name mapping)"; + } +} + +std::string TexturePool::get_debug_texture_name_from_tbp(u32 tbp) { + auto info = lookup_gpu_texture(tbp); + if (!info) { + return "??? (bad tbp)"; + } else { + return get_debug_texture_name(info->tex_id); } } diff --git a/game/graphics/texture/TexturePool.h b/game/graphics/texture/TexturePool.h index f8abd357c5..3b656fa8a0 100644 --- a/game/graphics/texture/TexturePool.h +++ b/game/graphics/texture/TexturePool.h @@ -348,6 +348,7 @@ class TexturePool { PcTextureId allocate_pc_port_texture(GameVersion version); std::string get_debug_texture_name(PcTextureId id); + std::string get_debug_texture_name_from_tbp(u32 tbp); private: void refresh_links(GpuTexture& texture); diff --git a/goal_src/jak3/engine/common-obs/collectables.gc b/goal_src/jak3/engine/common-obs/collectables.gc index 265febbd53..222b53f812 100644 --- a/goal_src/jak3/engine/common-obs/collectables.gc +++ b/goal_src/jak3/engine/common-obs/collectables.gc @@ -44,13 +44,13 @@ (defskelgroup skel-gun-yellow-up yellow-barrel yellow-barrel-lod0-jg yellow-barrel-idle-ja ((yellow-barrel-lod0-mg (meters 999999))) :bounds (static-spherem 0 1 0 1.6) - :shadow-joint-index 3 + :origin-joint-index 3 ) (defskelgroup skel-gun-dark-up dark-barrel 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 1 0 1.6) - :shadow-joint-index 3 + :origin-joint-index 3 ) (defskelgroup skel-skill collectables collectables-skill-lod0-jg collectables-skill-idle-ja @@ -61,7 +61,7 @@ :bounds (static-spherem 0 0 0 0.6) :shadow collectables-skill-shadow-mg :texture-level 10 - :origin-joint-index 3 + :shadow-joint-index 3 ) (deftype collectable (process-drawable) diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index 0457989a82..bda70a166b 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -79,7 +79,7 @@ (defskelgroup skel-spotlight spotlight spotlight-lod0-jg -1 ((spotlight-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 10) - :shadow-joint-index 5 + :origin-joint-index 5 ) ;; WARN: Return type mismatch object vs (pointer sparticle-launch-group). diff --git a/goal_src/jak3/engine/common-obs/voicebox.gc b/goal_src/jak3/engine/common-obs/voicebox.gc index 6183d58960..c91b342eff 100644 --- a/goal_src/jak3/engine/common-obs/voicebox.gc +++ b/goal_src/jak3/engine/common-obs/voicebox.gc @@ -82,7 +82,7 @@ ((talk-box-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4) :texture-level 10 - :light-index 1 + :sort 1 ) (defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) diff --git a/goal_src/jak3/engine/common-obs/warp-gate.gc b/goal_src/jak3/engine/common-obs/warp-gate.gc index a78fa3d8e2..c869557a31 100644 --- a/goal_src/jak3/engine/common-obs/warp-gate.gc +++ b/goal_src/jak3/engine/common-obs/warp-gate.gc @@ -451,7 +451,7 @@ (defskelgroup skel-warp-gate warp-gate warp-gate-lod0-jg warp-gate-idle-ja ((warp-gate-lod0-mg (meters 999999))) :bounds (static-spherem 0 3 0 4) - :shadow-joint-index 3 + :origin-joint-index 3 ) (deftype warp-gate (process-drawable) @@ -1063,7 +1063,7 @@ (defskelgroup skel-air-train air-train air-train-lod0-jg air-train-idle-ja ((air-train-lod0-mg (meters 999999))) :bounds (static-spherem 0 2 -2 12.5) - :shadow-joint-index 3 + :origin-joint-index 3 ) (deftype air-train (warp-gate) diff --git a/goal_src/jak3/engine/gfx/texture/texture.gc b/goal_src/jak3/engine/gfx/texture/texture.gc index ef94914aa1..7662dc4c32 100644 --- a/goal_src/jak3/engine/gfx/texture/texture.gc +++ b/goal_src/jak3/engine/gfx/texture/texture.gc @@ -1343,7 +1343,7 @@ ) ) (((tpage-category pris)) - (set! (-> lev upload-size 1) (upload-vram-pages-pris + (set! (-> lev upload-size 1) (upload-vram-pages-pris-pc pool (-> pool segment-common) a2-1 diff --git a/goal_src/jak3/engine/target/board/board-h.gc b/goal_src/jak3/engine/target/board/board-h.gc index ff6da723dc..4dfb62683d 100644 --- a/goal_src/jak3/engine/target/board/board-h.gc +++ b/goal_src/jak3/engine/target/board/board-h.gc @@ -352,8 +352,8 @@ ((board-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 3.5) :shadow board-shadow-mg - :shadow-joint-index 3 - :light-index 1 + :sort 1 + :origin-joint-index 3 ) (define *board-shadow-control* diff --git a/goal_src/jak3/engine/target/flut/flut-h.gc b/goal_src/jak3/engine/target/flut/flut-h.gc index d269e3e32b..b318e08495 100644 --- a/goal_src/jak3/engine/target/flut/flut-h.gc +++ b/goal_src/jak3/engine/target/flut/flut-h.gc @@ -72,5 +72,5 @@ ((flut-saddle-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 3.5) :shadow flut-saddle-shadow-mg - :light-index 1 + :sort 1 ) diff --git a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc index 327651b5c1..24fb1db2dd 100644 --- a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc @@ -172,7 +172,7 @@ ((gun-nuke-sphere-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 30) :texture-level 10 - :light-index 4 + :sort 4 ) (deftype gun-dark-3-sphere (process-drawable) diff --git a/goal_src/jak3/engine/target/gun/gun-h.gc b/goal_src/jak3/engine/target/gun/gun-h.gc index 6f87ed9b72..430a8493b8 100644 --- a/goal_src/jak3/engine/target/gun/gun-h.gc +++ b/goal_src/jak3/engine/target/gun/gun-h.gc @@ -246,8 +246,8 @@ ((gun-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1.5) :shadow gun-shadow-mg - :shadow-joint-index 3 - :light-index 1 + :sort 1 + :origin-joint-index 3 ) (define *gun-shadow-control* @@ -264,28 +264,28 @@ ((gun-ammo-yellow-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) (defskelgroup skel-ammo-red gun gun-ammo-red-lod0-jg gun-ammo-idle-ja ((gun-ammo-red-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) (defskelgroup skel-ammo-blue gun gun-ammo-blue-lod0-jg gun-ammo-idle-ja ((gun-ammo-blue-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) (defskelgroup skel-ammo-dark gun gun-ammo-dark-lod0-jg gun-ammo-idle-ja ((gun-ammo-dark-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) (defskelgroup skel-gun-red-cone gun gun-red-cone-lod0-jg gun-red-cone-idle-ja diff --git a/goal_src/jak3/engine/target/gun/gun-red-shot.gc b/goal_src/jak3/engine/target/gun/gun-red-shot.gc index 87569238b8..f681b1562b 100644 --- a/goal_src/jak3/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-red-shot.gc @@ -1192,7 +1192,7 @@ ((gun-red-sphere-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 30) :texture-level 10 - :light-index 4 + :sort 4 ) (deftype red-2-ring (process-drawable) diff --git a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc index 6f3858845c..e01d22a319 100644 --- a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc @@ -370,7 +370,7 @@ ((gun-saucer-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4096) :texture-level 10 - :light-index 1 + :sort 1 ) (defmethod setup-collision! ((this gun-yellow-3-saucer)) diff --git a/goal_src/jak3/engine/target/mech/mech-h.gc b/goal_src/jak3/engine/target/mech/mech-h.gc index 607dcbbe66..6b6b24c6f0 100644 --- a/goal_src/jak3/engine/target/mech/mech-h.gc +++ b/goal_src/jak3/engine/target/mech/mech-h.gc @@ -81,5 +81,5 @@ (defskelgroup skel-mech-explode mech mech-explode-lod0-jg mech-explode-idle-ja ((mech-explode-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4.5) - :shadow-joint-index 3 + :origin-joint-index 3 ) diff --git a/goal_src/jak3/engine/target/sidekick.gc b/goal_src/jak3/engine/target/sidekick.gc index 80cc823a32..8347525aeb 100644 --- a/goal_src/jak3/engine/target/sidekick.gc +++ b/goal_src/jak3/engine/target/sidekick.gc @@ -16,9 +16,9 @@ :longest-edge (meters 1) :shadow daxter-shadow-mg :texture-level 10 + :sort 1 :origin-joint-index 6 :shadow-joint-index 6 - :light-index 1 ) (defskelgroup skel-sidekick-highres daxter-highres daxter-highres-lod0-jg -1 @@ -26,9 +26,9 @@ :bounds (static-spherem 0 0 0 3) :longest-edge (meters 1) :shadow daxter-highres-shadow-mg + :sort 1 :origin-joint-index 6 :shadow-joint-index 6 - :light-index 1 ) (define *sidekick-remap* diff --git a/goal_src/jak3/engine/target/target-invisible.gc b/goal_src/jak3/engine/target/target-invisible.gc index 3f0d1018fa..718ac0d9d5 100644 --- a/goal_src/jak3/engine/target/target-invisible.gc +++ b/goal_src/jak3/engine/target/target-invisible.gc @@ -325,7 +325,7 @@ (defskelgroup skel-dark-maker-idol dark-maker-idol dark-maker-idol-lod0-jg dark-maker-idol-idle-ja ((dark-maker-idol-lod0-mg (meters 999999))) :bounds (static-spherem 0 1 0 2) - :shadow-joint-index 3 + :origin-joint-index 3 ) (defstate idle (dark-maker-idol) diff --git a/goal_src/jak3/engine/target/target-util.gc b/goal_src/jak3/engine/target/target-util.gc index d49873931d..546457ca76 100644 --- a/goal_src/jak3/engine/target/target-util.gc +++ b/goal_src/jak3/engine/target/target-util.gc @@ -12,9 +12,9 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) (defskelgroup skel-jchar-normal jakb jakb-lod0-jg -1 @@ -23,9 +23,9 @@ :longest-edge (meters 1) :shadow jak-ext-geo-c+0-jakclod0-sash-cg :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) (defskelgroup skel-jchar-old jakb jakb-lod0-jg -1 @@ -33,9 +33,9 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) (defskelgroup skel-jchar-c jakb jakb-lod0-jg -1 @@ -44,9 +44,9 @@ :longest-edge (meters 1) :shadow jakb-c-shadow-mg :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 :clothing (((mesh 10) (gravity-constant (meters 16)) (wind-constant 0.5) @@ -107,10 +107,9 @@ :longest-edge (meters 1) :shadow jakb-walk-down-ja :texture-level 10 - :sort 2 + :sort 4 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 4 ) (defskelgroup skel-jchar-shield jakb jakb-shield-shield-lod0-jg -1 @@ -118,8 +117,8 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :texture-level 10 - :shadow-joint-index 3 - :light-index 5 + :sort 5 + :origin-joint-index 3 ) (define *target-shadow-control* @@ -137,9 +136,9 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :shadow jak-highres-shadow-mg + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) (defskelgroup skel-jakc-highres jakc-highres jakc-highres-lod0-jg jakc-highres-idle-ja @@ -201,21 +200,21 @@ ((collectables-generic-blast-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 50) :texture-level 10 - :light-index 4 + :sort 4 ) (defskelgroup skel-generic-ripples collectables collectables-generic-ripples-lod0-jg collectables-generic-ripples-idle-ja ((collectables-generic-ripples-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 6) :texture-level 10 - :light-index 4 + :sort 4 ) (defskelgroup skel-bomb-blast collectables collectables-bomb-blast-lod0-jg collectables-bomb-blast-idle-ja ((collectables-bomb-blast-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 50) :texture-level 10 - :light-index 4 + :sort 4 ) (deftype target-bank (basic) diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc index 605abf25d9..57a885b8f9 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc @@ -19,14 +19,14 @@ (defskelgroup skel-gun-yellow-up yellow-barrel yellow-barrel-lod0-jg yellow-barrel-idle-ja ((yellow-barrel-lod0-mg (meters 999999))) :bounds (static-spherem 0 1 0 1.6) - :shadow-joint-index 3 + :origin-joint-index 3 ) ;; failed to figure out what this is: (defskelgroup skel-gun-dark-up dark-barrel 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 1 0 1.6) - :shadow-joint-index 3 + :origin-joint-index 3 ) ;; failed to figure out what this is: @@ -38,7 +38,7 @@ :bounds (static-spherem 0 0 0 0.6) :shadow collectables-skill-shadow-mg :texture-level 10 - :origin-joint-index 3 + :shadow-joint-index 3 ) ;; definition of type collectable diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc index 79dc051da1..d2b4997bc9 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc @@ -11,7 +11,7 @@ (defskelgroup skel-spotlight spotlight spotlight-lod0-jg -1 ((spotlight-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 10) - :shadow-joint-index 5 + :origin-joint-index 5 ) ;; definition for function entity-lookup-part-group diff --git a/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc index 5d76a2af41..9e0ac865dd 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc @@ -111,7 +111,7 @@ ((talk-box-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4) :texture-level 10 - :light-index 1 + :sort 1 ) ;; definition for method 24 of type remote diff --git a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc index a21efa37f5..94e74caec2 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc @@ -462,7 +462,7 @@ (defskelgroup skel-warp-gate warp-gate warp-gate-lod0-jg warp-gate-idle-ja ((warp-gate-lod0-mg (meters 999999))) :bounds (static-spherem 0 3 0 4) - :shadow-joint-index 3 + :origin-joint-index 3 ) ;; definition of type warp-gate @@ -1111,7 +1111,7 @@ (defskelgroup skel-air-train air-train air-train-lod0-jg air-train-idle-ja ((air-train-lod0-mg (meters 999999))) :bounds (static-spherem 0 2 -2 12.5) - :shadow-joint-index 3 + :origin-joint-index 3 ) ;; definition of type air-train diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc index 23be954864..194d997658 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc @@ -1517,7 +1517,15 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lui at, 28672] (defun foreground-draw-hud ((arg0 draw-control) (arg1 dma-buffer) (arg2 float)) - (local-vars (at-0 int) (a0-2 (pointer uint128)) (t2-8 object) (t3-3 uint) (t3-4 uint) (t3-5 uint) (t3-6 uint)) + (local-vars + (at-0 foreground-work) + (a0-2 (pointer uint128)) + (t2-8 object) + (t3-3 uint) + (t3-4 uint) + (t3-5 uint) + (t3-6 uint) + ) (.lui at-0 28672) (let* ((a2-1 (-> arg1 base)) (v1-0 (the-as object (&+ a2-1 64))) @@ -1553,14 +1561,14 @@ (let ((t3-0 (-> t5-0 joint-ptr)) (t4-0 (-> t5-0 bone-ptr)) (t5-1 (-> t5-0 num-bones)) - (t6-0 t0-2) + (t6-0 (the-as bone-calculation t0-2)) ) - (set! (-> (the-as (pointer int16) t6-0)) t2-5) - (s.h! (+ t6-0 2) t5-1) - (s.w! (+ t6-0 4) t1-5) - (s.w! (+ t6-0 8) t3-0) - (s.w! (+ t6-0 12) t4-0) - (s.w! (+ t6-0 32) 0) + (set! (-> t6-0 flags) (the-as bone-calc-flags t2-5)) + (set! (-> t6-0 num-bones) t5-1) + (set! (-> t6-0 matrix-area) (the-as (inline-array pris-mtx) t1-5)) + (set! (-> t6-0 joints) t3-0) + (set! (-> t6-0 bones) t4-0) + (set! (-> t6-0 next) (the-as bone-calculation 0)) ) (if (nonzero? (-> a1-6 next)) (set! (-> a1-6 next next) (the-as bone-calculation t0-2)) @@ -1572,7 +1580,7 @@ ) (&+ a2-1 48) (let ((a1-8 (the-as object (+ (the-as uint v1-0) a3-3)))) - (s.w! (+ at-0 36) v1-0) + (set! (-> at-0 regs mtxs) (the-as (inline-array pris-mtx) v1-0)) (let ((v1-3 (-> *foreground* merc-bucket-info))) (when (= (-> arg0 data-format) (draw-control-data-format merc)) (let ((a2-4 (-> arg0 lod-set lod 0 geo)) diff --git a/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc index 3a09cc9047..b696111e87 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc @@ -512,8 +512,8 @@ ((board-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 3.5) :shadow board-shadow-mg - :shadow-joint-index 3 - :light-index 1 + :sort 1 + :origin-joint-index 3 ) ;; definition for symbol *board-shadow-control*, type shadow-control diff --git a/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc index 6ae3bbd56b..b0a2a2cc21 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc @@ -106,12 +106,8 @@ ((flut-saddle-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 3.5) :shadow flut-saddle-shadow-mg - :light-index 1 + :sort 1 ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc index 905e536d86..4ff5fcb8d0 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc @@ -196,7 +196,7 @@ ((gun-nuke-sphere-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 30) :texture-level 10 - :light-index 4 + :sort 4 ) ;; definition of type gun-dark-3-sphere diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc index 0b9e67e601..2e12697518 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc @@ -375,8 +375,8 @@ ((gun-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1.5) :shadow gun-shadow-mg - :shadow-joint-index 3 - :light-index 1 + :sort 1 + :origin-joint-index 3 ) ;; definition for symbol *gun-shadow-control*, type shadow-control @@ -395,7 +395,7 @@ ((gun-ammo-yellow-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) ;; failed to figure out what this is: @@ -403,7 +403,7 @@ ((gun-ammo-red-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) ;; failed to figure out what this is: @@ -411,7 +411,7 @@ ((gun-ammo-blue-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) ;; failed to figure out what this is: @@ -419,7 +419,7 @@ ((gun-ammo-dark-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 1) :texture-level 10 - :light-index 1 + :sort 1 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc index 6e0b884dd1..512bd7b968 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc @@ -1355,7 +1355,7 @@ ((gun-red-sphere-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 30) :texture-level 10 - :light-index 4 + :sort 4 ) ;; definition of type red-2-ring diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc index 139bb5c66a..5638c123f4 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc @@ -490,7 +490,7 @@ ((gun-saucer-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4096) :texture-level 10 - :light-index 1 + :sort 1 ) ;; definition for method 30 of type gun-yellow-3-saucer @@ -2388,7 +2388,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc index c6be8a3cb6..ee94412385 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc @@ -135,7 +135,7 @@ (defskelgroup skel-mech-explode mech mech-explode-lod0-jg mech-explode-idle-ja ((mech-explode-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4.5) - :shadow-joint-index 3 + :origin-joint-index 3 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak3/engine/target/sidekick_REF.gc b/test/decompiler/reference/jak3/engine/target/sidekick_REF.gc index bac1204183..9b8dc349a4 100644 --- a/test/decompiler/reference/jak3/engine/target/sidekick_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/sidekick_REF.gc @@ -8,9 +8,9 @@ :longest-edge (meters 1) :shadow daxter-shadow-mg :texture-level 10 + :sort 1 :origin-joint-index 6 :shadow-joint-index 6 - :light-index 1 ) ;; failed to figure out what this is: @@ -19,9 +19,9 @@ :bounds (static-spherem 0 0 0 3) :longest-edge (meters 1) :shadow daxter-highres-shadow-mg + :sort 1 :origin-joint-index 6 :shadow-joint-index 6 - :light-index 1 ) ;; definition for symbol *sidekick-remap*, type pair diff --git a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc index afbff93968..737ba34a34 100644 --- a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc @@ -365,7 +365,7 @@ (defskelgroup skel-dark-maker-idol dark-maker-idol dark-maker-idol-lod0-jg dark-maker-idol-idle-ja ((dark-maker-idol-lod0-mg (meters 999999))) :bounds (static-spherem 0 1 0 2) - :shadow-joint-index 3 + :origin-joint-index 3 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc index cbe7be17c4..278c9a64c1 100644 --- a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc @@ -7,9 +7,9 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) ;; failed to figure out what this is: @@ -19,9 +19,9 @@ :longest-edge (meters 1) :shadow jak-ext-geo-c+0-jakclod0-sash-cg :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) ;; failed to figure out what this is: @@ -30,9 +30,9 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) ;; failed to figure out what this is: @@ -42,9 +42,9 @@ :longest-edge (meters 1) :shadow jakb-c-shadow-mg :texture-level 10 + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 :clothing (((mesh 10) (gravity-constant (meters 16)) (wind-constant 0.5) @@ -106,10 +106,9 @@ :longest-edge (meters 1) :shadow jakb-walk-down-ja :texture-level 10 - :sort 2 + :sort 4 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 4 ) ;; failed to figure out what this is: @@ -118,8 +117,8 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :texture-level 10 - :shadow-joint-index 3 - :light-index 5 + :sort 5 + :origin-joint-index 3 ) ;; definition for symbol *target-shadow-control*, type shadow-control @@ -139,9 +138,9 @@ :bounds (static-spherem 0 0 0 3.2) :longest-edge (meters 1) :shadow jak-highres-shadow-mg + :sort 1 :origin-joint-index 3 :shadow-joint-index 3 - :light-index 1 ) ;; failed to figure out what this is: @@ -205,7 +204,7 @@ ((collectables-generic-blast-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 50) :texture-level 10 - :light-index 4 + :sort 4 ) ;; failed to figure out what this is: @@ -213,7 +212,7 @@ ((collectables-generic-ripples-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 6) :texture-level 10 - :light-index 4 + :sort 4 ) ;; failed to figure out what this is: @@ -221,7 +220,7 @@ ((collectables-bomb-blast-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 50) :texture-level 10 - :light-index 4 + :sort 4 ) ;; definition of type target-bank