From 0d51f09f8822e122737f7dc85bc3a5d8d15c3d68 Mon Sep 17 00:00:00 2001 From: Texline666 <93364055+Tanline666@users.noreply.github.com> Date: Mon, 28 Sep 2026 10:40:27 -0600 Subject: [PATCH 1/3] new branch for graphics work --- .github/workflows/build.yml | 2 +- config/RSPE01_00/splits.txt | 32 + config/RSPE01_00/symbols.txt | 547 ++++---- config/RSPE01_01/symbols.txt | 67 +- configure.py | 4 +- include/Pack/RPGraphics.h | 2 + include/Pack/RPGraphics/RPGrpCamera.h | 13 + include/Pack/RPGraphics/RPGrpCpuTexture.h | 156 +++ include/Pack/RPGraphics/RPGrpModel.h | 82 +- include/Pack/RPGraphics/RPGrpModelAnm.h | 8 +- include/Pack/RPGraphics/RPGrpModelG3D.h | 2 + include/Pack/RPGraphics/RPGrpModelRfl.h | 4 + include/Pack/RPGraphics/RPGrpModelScene.h | 27 +- include/Pack/RPGraphics/RPGrpRenderer.h | 32 +- include/Pack/RPGraphics/RPGrpResTIMG.h | 39 + include/egg/gfxe/eggFogManager.h | 4 + include/egg/gfxe/eggLightManager.h | 16 +- include/egg/gfxe/eggLightObject.h | 24 +- include/egg/gfxe/eggLightTexture.h | 8 +- include/egg/gfxe/eggPostEffectBlur.h | 7 +- include/egg/gfxe/eggPostEffectBlurGather.h | 9 +- include/egg/gfxe/eggPostEffectBlurSimple.h | 5 +- include/egg/gfxe/eggScnRootEx.h | 3 + include/egg/gfxe/eggScreen.h | 5 +- include/egg/gfxe/eggShadowTexture.h | 7 +- include/egg/gfxe/eggShadowTextureManager.h | 2 +- include/egg/gfxe/eggStateGX.h | 11 + include/egg/math/eggMatrix.h | 5 +- src/Pack/RPGraphics/RPGrpCpuTexture.cpp | 228 ++++ src/Pack/RPGraphics/RPGrpModel.cpp | 44 +- .../RPGraphics/RPGrpModelAnmImplement.cpp | 1127 +++-------------- src/Pack/RPGraphics/RPGrpModelImplement.cpp | 15 +- src/Pack/RPGraphics/RPGrpModelResManager.cpp | 6 +- src/Pack/RPGraphics/RPGrpModelRfl.cpp | 16 +- src/Pack/RPGraphics/RPGrpModelScene.cpp | 21 + src/Pack/RPGraphics/RPGrpRenderer.cpp | 53 + src/Pack/RPKernel/RPSysKokeshiIcon.cpp | 2 + src/egg/gfxe/eggLightObject.cpp | 63 + 38 files changed, 1396 insertions(+), 1302 deletions(-) create mode 100644 include/Pack/RPGraphics/RPGrpCpuTexture.h create mode 100644 include/Pack/RPGraphics/RPGrpResTIMG.h create mode 100644 src/Pack/RPGraphics/RPGrpCpuTexture.cpp create mode 100644 src/Pack/RPGraphics/RPGrpModelScene.cpp create mode 100644 src/Pack/RPGraphics/RPGrpRenderer.cpp create mode 100644 src/egg/gfxe/eggLightObject.cpp diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbcfc00ea..37675770a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: # Add game versions here - version: [RSPE01_01] + version: [RSPE01_00, RSPE01_01] steps: # Checkout the repository diff --git a/config/RSPE01_00/splits.txt b/config/RSPE01_00/splits.txt index e391653b4..e1aeb4b4d 100644 --- a/config/RSPE01_00/splits.txt +++ b/config/RSPE01_00/splits.txt @@ -908,13 +908,45 @@ Pack/RPKernel/RPSysKokeshiIcon.cpp: .text start:0x8016D500 end:0x8016EBF4 .data start:0x80381DA0 end:0x80381DB4 +Pack/RPGraphics/RPGrpModel.cpp: + .text start:0x801809E8 end:0x80181190 + Pack/RPGraphics/RPGrpModelAnm.cpp: .text start:0x80181190 end:0x80181984 .data start:0x803823B0 end:0x80382438 + .sdata2 start:0x804E1A88 end:0x804E1A90 Pack/RPGraphics/RPGrpModelResManager.cpp: .text start:0x80185AE4 end:0x80186924 + .data start:0x803826F0 end:0x803827A4 + +Pack/RPGraphics/RPGrpCpuTexture.cpp: + .text start:0x8018F1A0 end:0x801900F0 + +Pack/RPGraphics/RPGrpFog.cpp: + .text start:0x801900F0 end:0x80190344 Pack/RPAudio/RPSndAudioMgr.cpp: .text start:0x8019C7E0 end:0x8019E630 .sbss start:0x804DFC5C end:0x804DFC68 + +Pack/RPUtility/RPUtlDohMath.cpp: + .text start:0x8019F8D4 end:0x8019FE84 + .ctors start:0x80330160 end:0x80330164 + .bss start:0x804D6F08 end:0x804D6FC8 + .sbss start:0x804DFC78 end:0x804DFC80 + .sdata2 start:0x804E1EE0 end:0x804E1EF0 + +Pack/RPUtility/RPUtlMapData.cpp: + .text start:0x801A5000 end:0x801A546C + +Pack/RPUtility/RPUtlShadowDrawer.cpp: + .text start:0x801A546C end:0x801A5580 + .ctors start:0x8033016C end:0x80330170 + .bss start:0x804D7078 end:0x804D70A8 + +Pack/RPSports/RPSportsCommon/RPSysPlayerSelectScene.cpp: + .text start:0x801B8778 end:0x801BB064 + +Pack/RPSports/RPSportsCommon/RPSportsMenuBgModel.cpp: + .text start:0x801BB064 end:0x801BB644 diff --git a/config/RSPE01_00/symbols.txt b/config/RSPE01_00/symbols.txt index de9bfc87d..27fb6cee5 100644 --- a/config/RSPE01_00/symbols.txt +++ b/config/RSPE01_00/symbols.txt @@ -914,7 +914,7 @@ fn_8002D7BC = .text:0x8002D7BC; // type:function size:0x8 fn_8002D7C4 = .text:0x8002D7C4; // type:function size:0x6C fn_8002D830 = .text:0x8002D830; // type:function size:0x58 SetOutputMode__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd10OutputMode = .text:0x8002D888; // type:function size:0xC8 -fn_8002D950 = .text:0x8002D950; // type:function size:0x8 +GetOutputMode__Q44nw4r3snd6detail9AxManagerFv = .text:0x8002D950; // type:function size:0x8 fn_8002D958 = .text:0x8002D958; // type:function size:0x200 fn_8002DB58 = .text:0x8002DB58; // type:function size:0x8C fn_8002DBE4 = .text:0x8002DBE4; // type:function size:0x15C @@ -923,8 +923,8 @@ fn_8002DD78 = .text:0x8002DD78; // type:function size:0xC4 fn_8002DE3C = .text:0x8002DE3C; // type:function size:0x68 fn_8002DEA4 = .text:0x8002DEA4; // type:function size:0xF8 fn_8002DF9C = .text:0x8002DF9C; // type:function size:0x158 -fn_8002E0F4 = .text:0x8002E0F4; // type:function size:0x204 -fn_8002E2F8 = .text:0x8002E2F8; // type:function size:0xC8 +AppendEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusPQ34nw4r3snd6FxBase = .text:0x8002E0F4; // type:function size:0x204 +ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi = .text:0x8002E2F8; // type:function size:0xC8 fn_8002E3C0 = .text:0x8002E3C0; // type:function size:0xE8 fn_8002E4A8 = .text:0x8002E4A8; // type:function size:0x2D8 PrepareReset__Q44nw4r3snd6detail9AxManagerFv = .text:0x8002E780; // type:function size:0xC8 @@ -1010,19 +1010,19 @@ fn_800335A0 = .text:0x800335A0; // type:function size:0x8 fn_800335A8 = .text:0x800335A8; // type:function size:0x8 fn_800335B0 = .text:0x800335B0; // type:function size:0x8 fn_800335B8 = .text:0x800335B8; // type:function size:0x4C -fn_80033604 = .text:0x80033604; // type:function size:0x10 -fn_80033614 = .text:0x80033614; // type:function size:0x8 -fn_8003361C = .text:0x8003361C; // type:function size:0x10 +SetOutputLine__Q44nw4r3snd6detail10BasicSoundFi = .text:0x80033604; // type:function size:0x10 +SetMainOutVolume__Q44nw4r3snd6detail10BasicSoundFf = .text:0x80033614; // type:function size:0x8 +SetRemoteOutVolume__Q44nw4r3snd6detail10BasicSoundFif = .text:0x8003361C; // type:function size:0x10 fn_8003362C = .text:0x8003362C; // type:function size:0x5C fn_80033688 = .text:0x80033688; // type:function size:0x14 fn_8003369C = .text:0x8003369C; // type:function size:0x14 -fn_800336B0 = .text:0x800336B0; // type:function size:0x14 -fn_800336C4 = .text:0x800336C4; // type:function size:0x8 -fn_800336CC = .text:0x800336CC; // type:function size:0x8 -fn_800336D4 = .text:0x800336D4; // type:function size:0x40 -fn_80033714 = .text:0x80033714; // type:function size:0x40 -fn_80033754 = .text:0x80033754; // type:function size:0x8 -fn_8003375C = .text:0x8003375C; // type:function size:0xC +IsAttachedTempGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x800336B0; // type:function size:0x14 +DetachGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x800336C4; // type:function size:0x8 +DetachTempGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x800336CC; // type:function size:0x8 +SetId__Q44nw4r3snd6detail10BasicSoundFUl = .text:0x800336D4; // type:function size:0x40 +__dt__Q44nw4r3snd6detail10BasicSoundFv = .text:0x80033714; // type:function size:0x40 +GetRuntimeTypeInfo__Q44nw4r3snd6detail10BasicSoundCFv = .text:0x80033754; // type:function size:0x8 +__sinit_\snd_BasicSound_cpp = .text:0x8003375C; // type:function size:0xC fn_80033768 = .text:0x80033768; // type:function size:0xF8 fn_80033860 = .text:0x80033860; // type:function size:0x78 fn_800338D8 = .text:0x800338D8; // type:function size:0xC4 @@ -1104,13 +1104,13 @@ fn_800365A0 = .text:0x800365A0; // type:function size:0x60 fn_80036600 = .text:0x80036600; // type:function size:0x138 fn_80036738 = .text:0x80036738; // type:function size:0x44 fn_8003677C = .text:0x8003677C; // type:function size:0x7C -fn_800367F8 = .text:0x800367F8; // type:function size:0x8C -fn_80036884 = .text:0x80036884; // type:function size:0x2C +__ct__Q34nw4r3snd10FxReverbHiFv = .text:0x800367F8; // type:function size:0x8C +GetRequiredMemSize__Q34nw4r3snd10FxReverbHiFv = .text:0x80036884; // type:function size:0x2C fn_800368B0 = .text:0x800368B0; // type:function size:0x8 fn_800368B8 = .text:0x800368B8; // type:function size:0x8 fn_800368C0 = .text:0x800368C0; // type:function size:0xB4 fn_80036974 = .text:0x80036974; // type:function size:0x60 -fn_800369D4 = .text:0x800369D4; // type:function size:0x1C0 +SetParam__Q34nw4r3snd10FxReverbHiFRCQ44nw4r3snd10FxReverbHi13ReverbHiParam = .text:0x800369D4; // type:function size:0x1C0 fn_80036B94 = .text:0x80036B94; // type:function size:0x44 fn_80036BD8 = .text:0x80036BD8; // type:function size:0x7C fn_80036C54 = .text:0x80036C54; // type:function size:0x8C @@ -1199,15 +1199,15 @@ fn_8003929C = .text:0x8003929C; // type:function size:0x78 fn_80039314 = .text:0x80039314; // type:function size:0x80 fn_80039394 = .text:0x80039394; // type:function size:0x114 fn_800394A8 = .text:0x800394A8; // type:function size:0xE8 -fn_80039590 = .text:0x80039590; // type:function size:0xC -fn_8003959C = .text:0x8003959C; // type:function size:0x1C +EnableOutput__Q34nw4r3snd13RemoteSpeakerFb = .text:0x80039590; // type:function size:0xC +IsEnabledOutput__Q34nw4r3snd13RemoteSpeakerCFv = .text:0x8003959C; // type:function size:0x1C fn_800395B8 = .text:0x800395B8; // type:function size:0x2E0 fn_80039898 = .text:0x80039898; // type:function size:0xB8 fn_80039950 = .text:0x80039950; // type:function size:0xA0 fn_800399F0 = .text:0x800399F0; // type:function size:0x58 fn_80039A48 = .text:0x80039A48; // type:function size:0x74 -fn_80039ABC = .text:0x80039ABC; // type:function size:0x98 -fn_80039B54 = .text:0x80039B54; // type:function size:0x10 +GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv = .text:0x80039ABC; // type:function size:0x98 +GetRemoteSpeaker__Q44nw4r3snd6detail20RemoteSpeakerManagerFi = .text:0x80039B54; // type:function size:0x10 fn_80039B64 = .text:0x80039B64; // type:function size:0xCC fn_80039C30 = .text:0x80039C30; // type:function size:0x44 fn_80039C74 = .text:0x80039C74; // type:function size:0xF0 @@ -1271,16 +1271,16 @@ fn_8003B438 = .text:0x8003B438; // type:function size:0x8 fn_8003B440 = .text:0x8003B440; // type:function size:0x8 fn_8003B448 = .text:0x8003B448; // type:function size:0xCC fn_8003B514 = .text:0x8003B514; // type:function size:0x8 -fn_8003B51C = .text:0x8003B51C; // type:function size:0x2C +WriteVariable__Q44nw4r3snd6detail8SeqSoundFis = .text:0x8003B51C; // type:function size:0x2C WriteGlobalVariable__Q44nw4r3snd6detail8SeqSoundFis = .text:0x8003B548; // type:function size:0x28 -fn_8003B570 = .text:0x8003B570; // type:function size:0x14 -fn_8003B584 = .text:0x8003B584; // type:function size:0x8 +IsAttachedTempSpecialHandle__Q44nw4r3snd6detail8SeqSoundFv = .text:0x8003B570; // type:function size:0x14 +DetachTempSpecialHandle__Q44nw4r3snd6detail8SeqSoundFv = .text:0x8003B584; // type:function size:0x8 fn_8003B58C = .text:0x8003B58C; // type:function size:0x8 fn_8003B594 = .text:0x8003B594; // type:function size:0x8 fn_8003B59C = .text:0x8003B59C; // type:function size:0x8 fn_8003B5A4 = .text:0x8003B5A4; // type:function size:0xC -fn_8003B5B0 = .text:0x8003B5B0; // type:function size:0x108 -fn_8003B6B8 = .text:0x8003B6B8; // type:function size:0x38 +__ct__Q34nw4r3snd14SeqSoundHandleFPQ34nw4r3snd11SoundHandle = .text:0x8003B5B0; // type:function size:0x108 +DetachSound__Q34nw4r3snd14SeqSoundHandleFv = .text:0x8003B6B8; // type:function size:0x38 fn_8003B6F0 = .text:0x8003B6F0; // type:function size:0x8 fn_8003B6F8 = .text:0x8003B6F8; // type:function size:0x164 fn_8003B85C = .text:0x8003B85C; // type:function size:0x10 @@ -1316,57 +1316,57 @@ fn_8003D428 = .text:0x8003D428; // type:function size:0x24 fn_8003D44C = .text:0x8003D44C; // type:function size:0x8 fn_8003D454 = .text:0x8003D454; // type:function size:0x8 fn_8003D45C = .text:0x8003D45C; // type:function size:0x20 -fn_8003D47C = .text:0x8003D47C; // type:function size:0x24 -fn_8003D4A0 = .text:0x8003D4A0; // type:function size:0x40 -fn_8003D4E0 = .text:0x8003D4E0; // type:function size:0x14 -fn_8003D4F4 = .text:0x8003D4F4; // type:function size:0x8 -fn_8003D4FC = .text:0x8003D4FC; // type:function size:0x18 -fn_8003D514 = .text:0x8003D514; // type:function size:0x8 -fn_8003D51C = .text:0x8003D51C; // type:function size:0x8 -fn_8003D524 = .text:0x8003D524; // type:function size:0x8 +__ct__Q34nw4r3snd12SoundArchiveFv = .text:0x8003D47C; // type:function size:0x24 +__dt__Q34nw4r3snd12SoundArchiveFv = .text:0x8003D4A0; // type:function size:0x40 +IsAvailable__Q34nw4r3snd12SoundArchiveCFv = .text:0x8003D4E0; // type:function size:0x14 +Setup__Q34nw4r3snd12SoundArchiveFPQ44nw4r3snd6detail22SoundArchiveFileReader = .text:0x8003D4F4; // type:function size:0x8 +Shutdown__Q34nw4r3snd12SoundArchiveFv = .text:0x8003D4FC; // type:function size:0x18 +GetPlayerCount__Q34nw4r3snd12SoundArchiveCFv = .text:0x8003D514; // type:function size:0x8 +GetGroupCount__Q34nw4r3snd12SoundArchiveCFv = .text:0x8003D51C; // type:function size:0x8 +GetSoundLabelString__Q34nw4r3snd12SoundArchiveCFUl = .text:0x8003D524; // type:function size:0x8 ConvertLabelStringToSoundId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x8003D52C; // type:function size:0x10 -fn_8003D53C = .text:0x8003D53C; // type:function size:0x10 -fn_8003D54C = .text:0x8003D54C; // type:function size:0x10 +ConvertLabelStringToPlayerId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x8003D53C; // type:function size:0x10 +ConvertLabelStringToGroupId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x8003D54C; // type:function size:0x10 GetSoundUserParam__Q34nw4r3snd12SoundArchiveCFUl = .text:0x8003D55C; // type:function size:0x8 -fn_8003D564 = .text:0x8003D564; // type:function size:0x8 -fn_8003D56C = .text:0x8003D56C; // type:function size:0x8 -fn_8003D574 = .text:0x8003D574; // type:function size:0x8 -fn_8003D57C = .text:0x8003D57C; // type:function size:0x8 -fn_8003D584 = .text:0x8003D584; // type:function size:0x8 -fn_8003D58C = .text:0x8003D58C; // type:function size:0x8 -fn_8003D594 = .text:0x8003D594; // type:function size:0x8 -fn_8003D59C = .text:0x8003D59C; // type:function size:0x8 -fn_8003D5A4 = .text:0x8003D5A4; // type:function size:0x8 -fn_8003D5AC = .text:0x8003D5AC; // type:function size:0x8 -fn_8003D5B4 = .text:0x8003D5B4; // type:function size:0x8 -fn_8003D5BC = .text:0x8003D5BC; // type:function size:0x8 -fn_8003D5C4 = .text:0x8003D5C4; // type:function size:0x8 -fn_8003D5CC = .text:0x8003D5CC; // type:function size:0x224 -fn_8003D7F0 = .text:0x8003D7F0; // type:function size:0x118 -fn_8003D908 = .text:0x8003D908; // type:function size:0x118 -fn_8003DA20 = .text:0x8003DA20; // type:function size:0x7C -fn_8003DA9C = .text:0x8003DA9C; // type:function size:0x24 -fn_8003DAC0 = .text:0x8003DAC0; // type:function size:0xB0 -fn_8003DB70 = .text:0x8003DB70; // type:function size:0xA8 -fn_8003DC18 = .text:0x8003DC18; // type:function size:0xC -fn_8003DC24 = .text:0x8003DC24; // type:function size:0xF0 -fn_8003DD14 = .text:0x8003DD14; // type:function size:0xEC -fn_8003DE00 = .text:0x8003DE00; // type:function size:0x104 -fn_8003DF04 = .text:0x8003DF04; // type:function size:0x80 -fn_8003DF84 = .text:0x8003DF84; // type:function size:0x4C -fn_8003DFD0 = .text:0x8003DFD0; // type:function size:0x70 -fn_8003E040 = .text:0x8003E040; // type:function size:0xAC -fn_8003E0EC = .text:0x8003E0EC; // type:function size:0xB8 -fn_8003E1A4 = .text:0x8003E1A4; // type:function size:0x110 -fn_8003E2B4 = .text:0x8003E2B4; // type:function size:0x138 -fn_8003E3EC = .text:0x8003E3EC; // type:function size:0x84 -fn_8003E470 = .text:0x8003E470; // type:function size:0x40 -fn_8003E4B0 = .text:0x8003E4B0; // type:function size:0x44 -fn_8003E4F4 = .text:0x8003E4F4; // type:function size:0x104 -fn_8003E5F8 = .text:0x8003E5F8; // type:function size:0xB8 -fn_8003E6B0 = .text:0x8003E6B0; // type:function size:0x100 -fn_8003E7B0 = .text:0x8003E7B0; // type:function size:0x120 -fn_8003E8D0 = .text:0x8003E8D0; // type:function size:0x148 +GetSoundType__Q34nw4r3snd12SoundArchiveCFUl = .text:0x8003D564; // type:function size:0x8 +ReadSoundInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive9SoundInfo = .text:0x8003D56C; // type:function size:0x8 +detail_ReadSeqSoundInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive12SeqSoundInfo = .text:0x8003D574; // type:function size:0x8 +detail_ReadStrmSoundInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive13StrmSoundInfo = .text:0x8003D57C; // type:function size:0x8 +detail_ReadWaveSoundInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive13WaveSoundInfo = .text:0x8003D584; // type:function size:0x8 +ReadPlayerInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive10PlayerInfo = .text:0x8003D58C; // type:function size:0x8 +ReadSoundArchivePlayerInfo__Q34nw4r3snd12SoundArchiveCFPQ44nw4r3snd12SoundArchive22SoundArchivePlayerInfo = .text:0x8003D594; // type:function size:0x8 +detail_ReadSound3DParam__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive12Sound3DParam = .text:0x8003D59C; // type:function size:0x8 +detail_ReadBankInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive8BankInfo = .text:0x8003D5A4; // type:function size:0x8 +detail_ReadGroupInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive9GroupInfo = .text:0x8003D5AC; // type:function size:0x8 +detail_ReadGroupItemInfo__Q34nw4r3snd12SoundArchiveCFUlUlPQ44nw4r3snd12SoundArchive13GroupItemInfo = .text:0x8003D5B4; // type:function size:0x8 +detail_ReadFileInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive8FileInfo = .text:0x8003D5BC; // type:function size:0x8 +detail_ReadFilePos__Q34nw4r3snd12SoundArchiveCFUlUlPQ44nw4r3snd12SoundArchive7FilePos = .text:0x8003D5C4; // type:function size:0x8 +detail_OpenFileStream__Q34nw4r3snd12SoundArchiveCFUlPvi = .text:0x8003D5CC; // type:function size:0x224 +detail_OpenGroupStream__Q34nw4r3snd12SoundArchiveCFUlPvi = .text:0x8003D7F0; // type:function size:0x118 +detail_OpenGroupWaveDataStream__Q34nw4r3snd12SoundArchiveCFUlPvi = .text:0x8003D908; // type:function size:0x118 +SetExternalFileRoot__Q34nw4r3snd12SoundArchiveFPCc = .text:0x8003DA20; // type:function size:0x7C +__ct__Q44nw4r3snd6detail22SoundArchiveFileReaderFv = .text:0x8003DA9C; // type:function size:0x24 +Init__Q44nw4r3snd6detail22SoundArchiveFileReaderFPCv = .text:0x8003DAC0; // type:function size:0xB0 +SetStringChunk__Q44nw4r3snd6detail22SoundArchiveFileReaderFPCvUl = .text:0x8003DB70; // type:function size:0xA8 +SetInfoChunk__Q44nw4r3snd6detail22SoundArchiveFileReaderFPCvUl = .text:0x8003DC18; // type:function size:0xC +GetSoundType__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUl = .text:0x8003DC24; // type:function size:0xF0 +ReadSoundInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive9SoundInfo = .text:0x8003DD14; // type:function size:0xEC +ReadSound3DParam__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive12Sound3DParam = .text:0x8003DE00; // type:function size:0x104 +ReadSeqSoundInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive12SeqSoundInfo = .text:0x8003DF04; // type:function size:0x80 +ReadStrmSoundInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive13StrmSoundInfo = .text:0x8003DF84; // type:function size:0x4C +ReadWaveSoundInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive13WaveSoundInfo = .text:0x8003DFD0; // type:function size:0x70 +ReadBankInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive8BankInfo = .text:0x8003E040; // type:function size:0xAC +ReadPlayerInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive10PlayerInfo = .text:0x8003E0EC; // type:function size:0xB8 +ReadGroupInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive9GroupInfo = .text:0x8003E1A4; // type:function size:0x110 +ReadGroupItemInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlUlPQ44nw4r3snd12SoundArchive13GroupItemInfo = .text:0x8003E2B4; // type:function size:0x138 +ReadSoundArchivePlayerInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFPQ44nw4r3snd12SoundArchive22SoundArchivePlayerInfo = .text:0x8003E3EC; // type:function size:0x84 +GetPlayerCount__Q44nw4r3snd6detail22SoundArchiveFileReaderCFv = .text:0x8003E470; // type:function size:0x40 +GetGroupCount__Q44nw4r3snd6detail22SoundArchiveFileReaderCFv = .text:0x8003E4B0; // type:function size:0x44 +GetSoundLabelString__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUl = .text:0x8003E4F4; // type:function size:0x104 +GetSoundUserParam__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUl = .text:0x8003E5F8; // type:function size:0xB8 +ReadFileInfo__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlPQ44nw4r3snd12SoundArchive8FileInfo = .text:0x8003E6B0; // type:function size:0x100 +ReadFilePos__Q44nw4r3snd6detail22SoundArchiveFileReaderCFUlUlPQ44nw4r3snd12SoundArchive7FilePos = .text:0x8003E7B0; // type:function size:0x120 +ConvertLabelStringToId__Q44nw4r3snd6detail22SoundArchiveFileReaderCFPCQ54nw4r3snd6detail16SoundArchiveFile10StringTreePCc = .text:0x8003E8D0; // type:function size:0x148 fn_8003EA18 = .text:0x8003EA18; // type:function size:0xF4 fn_8003EB0C = .text:0x8003EB0C; // type:function size:0x3C fn_8003EB48 = .text:0x8003EB48; // type:function size:0x40 @@ -2469,7 +2469,7 @@ fn_80070B08 = .text:0x80070B08; // type:function size:0x80 fn_80070B88 = .text:0x80070B88; // type:function size:0x30 fn_80070BB8 = .text:0x80070BB8; // type:function size:0xC fn_80070BC4 = .text:0x80070BC4; // type:function size:0x410 -fn_80070FD4 = .text:0x80070FD4; // type:function size:0xF8 +G3dInit__Q24nw4r3g3dFb = .text:0x80070FD4; // type:function size:0xF8 G3dReset__Q24nw4r3g3dFv = .text:0x800710CC; // type:function size:0x8 fn_800710D4 = .text:0x800710D4; // type:function size:0x104 fn_800711D8 = .text:0x800711D8; // type:function size:0x108 @@ -2698,7 +2698,7 @@ setAxisRotation__Q23EGG5QuatfFRCQ23EGG8Vector3ff = .text:0x8007DF04; // type:fun normalise__Q23EGG8Vector3fFv = .text:0x8007DF9C; // type:function size:0x7C __sinit_\eggVector_cpp = .text:0x8007E018; // type:function size:0x130 fn_8007E148 = .text:0x8007E148; // type:function size:0x74 -fn_8007E1BC = .text:0x8007E1BC; // type:function size:0xA8 +create__Q23EGG7ExpHeapFPvUlUs = .text:0x8007E1BC; // type:function size:0xA8 create__Q23EGG7ExpHeapFUlPQ23EGG4HeapUs = .text:0x8007E264; // type:function size:0x12C fn_8007E390 = .text:0x8007E390; // type:function size:0x70 fn_8007E400 = .text:0x8007E400; // type:function size:0x8 @@ -2956,24 +2956,24 @@ fn_80088908 = .text:0x80088908; // type:function size:0x38 fn_80088940 = .text:0x80088940; // type:function size:0x8 fn_80088948 = .text:0x80088948; // type:function size:0x8 fn_80088950 = .text:0x80088950; // type:function size:0x8 -fn_80088958 = .text:0x80088958; // type:function size:0x18 -fn_80088970 = .text:0x80088970; // type:function size:0xD0 -fn_80088A40 = .text:0x80088A40; // type:function size:0x244 -fn_80088C84 = .text:0x80088C84; // type:function size:0x244 -fn_80088EC8 = .text:0x80088EC8; // type:function size:0x244 -fn_8008910C = .text:0x8008910C; // type:function size:0x244 -fn_80089350 = .text:0x80089350; // type:function size:0x48 -fn_80089398 = .text:0x80089398; // type:function size:0x64 -fn_800893FC = .text:0x800893FC; // type:function size:0xC0 -fn_800894BC = .text:0x800894BC; // type:function size:0x70 -fn_8008952C = .text:0x8008952C; // type:function size:0x70 -fn_8008959C = .text:0x8008959C; // type:function size:0x70 -fn_8008960C = .text:0x8008960C; // type:function size:0x70 -fn_8008967C = .text:0x8008967C; // type:function size:0xD0 -fn_8008974C = .text:0x8008974C; // type:function size:0xC -fn_80089758 = .text:0x80089758; // type:function size:0xC -fn_80089764 = .text:0x80089764; // type:function size:0xC -fn_80089770 = .text:0x80089770; // type:function size:0xC +__ct__Q23EGG7AudioFxFv = .text:0x80088958; // type:function size:0x18 +__dt__Q23EGG7AudioFxFv = .text:0x80088970; // type:function size:0xD0 +createFxReverbHi__Q23EGG7AudioFxFPCQ44nw4r3snd10FxReverbHi13ReverbHiParam = .text:0x80088A40; // type:function size:0x244 +createFxReverbHiDpl2__Q23EGG7AudioFxFPCQ44nw4r3snd14FxReverbHiDpl217ReverbHiDpl2Param = .text:0x80088C84; // type:function size:0x244 +createFxChorus__Q23EGG7AudioFxFPCQ44nw4r3snd8FxChorus11ChorusParam = .text:0x80088EC8; // type:function size:0x244 +createFxDelay__Q23EGG7AudioFxFPCQ44nw4r3snd7FxDelay10DelayParam = .text:0x8008910C; // type:function size:0x244 +__ct__Q23EGG10AudioFxMgrFv = .text:0x80089350; // type:function size:0x48 +__dt__Q23EGG10AudioFxMgrFv = .text:0x80089398; // type:function size:0x64 +initializeFx__Q23EGG10AudioFxMgrFPQ34nw4r3snd9SoundHeapPQ33EGG10AudioFxMgr13AudioFxMgrArg = .text:0x800893FC; // type:function size:0xC0 +setFxReverbHi__Q23EGG10AudioFxMgrFQ34nw4r3snd6AuxBusPCQ44nw4r3snd10FxReverbHi13ReverbHiParam = .text:0x800894BC; // type:function size:0x70 +setFxReverbHiDpl2__Q23EGG10AudioFxMgrFQ34nw4r3snd6AuxBusPCQ44nw4r3snd14FxReverbHiDpl217ReverbHiDpl2Param = .text:0x8008952C; // type:function size:0x70 +setFxChorus__Q23EGG10AudioFxMgrFQ34nw4r3snd6AuxBusPCQ44nw4r3snd8FxChorus11ChorusParam = .text:0x8008959C; // type:function size:0x70 +setFxDelay__Q23EGG10AudioFxMgrFQ34nw4r3snd6AuxBusPCQ44nw4r3snd7FxDelay10DelayParam = .text:0x8008960C; // type:function size:0x70 +clearFx__Q23EGG10AudioFxMgrFQ34nw4r3snd6AuxBus = .text:0x8008967C; // type:function size:0xD0 +getDefaultFxReverbHi__Q23EGG10AudioFxMgrFv = .text:0x8008974C; // type:function size:0xC +getDefaultFxReverbHiDpl2__Q23EGG10AudioFxMgrFv = .text:0x80089758; // type:function size:0xC +getDefaultFxChorus__Q23EGG10AudioFxMgrFv = .text:0x80089764; // type:function size:0xC +getDefaultFxDelay__Q23EGG10AudioFxMgrFv = .text:0x80089770; // type:function size:0xC decode__Q23EGG6DecompFPUcPUc = .text:0x8008977C; // type:function size:0x260 decodeASH__Q23EGG6DecompFPUcPUc = .text:0x800899DC; // type:function size:0x300 decodeASR__Q23EGG6DecompFPUcPUc = .text:0x80089CDC; // type:function size:0x940 @@ -3728,7 +3728,7 @@ GXSetDither = .text:0x800BB3B8; // type:function size:0x2C GXSetDstAlpha = .text:0x800BB3E4; // type:function size:0x30 fn_800BB414 = .text:0x800BB414; // type:function size:0x34 fn_800BB448 = .text:0x800BB448; // type:function size:0x70 -fn_800BB4B8 = .text:0x800BB4B8; // type:function size:0x840 +GXDrawCylinder = .text:0x800BB4B8; // type:function size:0x840 fn_800BBCF8 = .text:0x800BBCF8; // type:function size:0x3E4 fn_800BC0DC = .text:0x800BC0DC; // type:function size:0x3D0 fn_800BC4AC = .text:0x800BC4AC; // type:function size:0x200 @@ -4512,45 +4512,45 @@ PPCDisableSpeculation = .text:0x800E40C8; // type:function size:0x28 scope:globa PPCSetFpNonIEEEMode = .text:0x800E40F0; // type:function size:0x8 scope:global fn_800E40F8 = .text:0x800E40F8; // type:function size:0x8 PPCMthid4 = .text:0x800E4100; // type:function size:0x50 scope:global -fn_800E4150 = .text:0x800E4150; // type:function size:0x220 -fn_800E4370 = .text:0x800E4370; // type:function size:0x2AC -fn_800E461C = .text:0x800E461C; // type:function size:0x14 -fn_800E4630 = .text:0x800E4630; // type:function size:0x1A0 -fn_800E47D0 = .text:0x800E47D0; // type:function size:0xE8 -fn_800E48B8 = .text:0x800E48B8; // type:function size:0x170 -fn_800E4A28 = .text:0x800E4A28; // type:function size:0x44 -fn_800E4A6C = .text:0x800E4A6C; // type:function size:0x1BC -fn_800E4C28 = .text:0x800E4C28; // type:function size:0xB0 -fn_800E4CD8 = .text:0x800E4CD8; // type:function size:0x13C -fn_800E4E14 = .text:0x800E4E14; // type:function size:0x140 -fn_800E4F54 = .text:0x800E4F54; // type:function size:0xA0 -fn_800E4FF4 = .text:0x800E4FF4; // type:function size:0xC4 -fn_800E50B8 = .text:0x800E50B8; // type:function size:0x8 -fn_800E50C0 = .text:0x800E50C0; // type:function size:0x1C -fn_800E50DC = .text:0x800E50DC; // type:function size:0x10 -fn_800E50EC = .text:0x800E50EC; // type:function size:0x348 -fn_800E5434 = .text:0x800E5434; // type:function size:0x160 -fn_800E5594 = .text:0x800E5594; // type:function size:0xBC -fn_800E5650 = .text:0x800E5650; // type:function size:0x14 -fn_800E5664 = .text:0x800E5664; // type:function size:0x150 -fn_800E57B4 = .text:0x800E57B4; // type:function size:0x88 -fn_800E583C = .text:0x800E583C; // type:function size:0x14 -fn_800E5850 = .text:0x800E5850; // type:function size:0x8C -fn_800E58DC = .text:0x800E58DC; // type:function size:0xEC -fn_800E59C8 = .text:0x800E59C8; // type:function size:0x124 -fn_800E5AEC = .text:0x800E5AEC; // type:function size:0x90 -fn_800E5B7C = .text:0x800E5B7C; // type:function size:0xA8 -fn_800E5C24 = .text:0x800E5C24; // type:function size:0x4 -fn_800E5C28 = .text:0x800E5C28; // type:function size:0x4 -fn_800E5C2C = .text:0x800E5C2C; // type:function size:0x4 -fn_800E5C30 = .text:0x800E5C30; // type:function size:0x4 -fn_800E5C34 = .text:0x800E5C34; // type:function size:0xA4 -fn_800E5CD8 = .text:0x800E5CD8; // type:function size:0x8 -fn_800E5CE0 = .text:0x800E5CE0; // type:function size:0x24 -fn_800E5D04 = .text:0x800E5D04; // type:function size:0x44 -fn_800E5D48 = .text:0x800E5D48; // type:function size:0x4 -fn_800E5D4C = .text:0x800E5D4C; // type:function size:0x2C -fn_800E5D78 = .text:0x800E5D78; // type:function size:0x4 +gki_init_free_queue = .text:0x800E4150; // type:function size:0x220 +gki_buffer_init = .text:0x800E4370; // type:function size:0x2AC +GKI_init_q = .text:0x800E461C; // type:function size:0x14 +GKI_getbuf = .text:0x800E4630; // type:function size:0x1A0 +GKI_getpoolbuf = .text:0x800E47D0; // type:function size:0xE8 +GKI_freebuf = .text:0x800E48B8; // type:function size:0x170 +GKI_get_buf_size = .text:0x800E4A28; // type:function size:0x44 +GKI_send_msg = .text:0x800E4A6C; // type:function size:0x1BC +GKI_read_mbox = .text:0x800E4C28; // type:function size:0xB0 +GKI_enqueue = .text:0x800E4CD8; // type:function size:0x13C +GKI_enqueue_head = .text:0x800E4E14; // type:function size:0x140 +GKI_dequeue = .text:0x800E4F54; // type:function size:0xA0 +GKI_remove_from_queue = .text:0x800E4FF4; // type:function size:0xC4 +GKI_getfirst = .text:0x800E50B8; // type:function size:0x8 +GKI_getnext = .text:0x800E50C0; // type:function size:0x1C +GKI_queue_is_empty = .text:0x800E50DC; // type:function size:0x10 +GKI_create_pool = .text:0x800E50EC; // type:function size:0x348 +GKI_delete_pool = .text:0x800E5434; // type:function size:0x160 +gki_timers_init = .text:0x800E5594; // type:function size:0xBC +GKI_get_tick_count = .text:0x800E5650; // type:function size:0x14 +GKI_start_timer = .text:0x800E5664; // type:function size:0x150 +GKI_stop_timer = .text:0x800E57B4; // type:function size:0x88 +GKI_init_timer_list = .text:0x800E583C; // type:function size:0x14 +GKI_update_timer_list = .text:0x800E5850; // type:function size:0x8C +GKI_add_to_timer_list = .text:0x800E58DC; // type:function size:0xEC +GKI_remove_from_timer_list = .text:0x800E59C8; // type:function size:0x124 +GKI_init = .text:0x800E5AEC; // type:function size:0x90 +GKI_shutdown = .text:0x800E5B7C; // type:function size:0xA8 +GKI_run = .text:0x800E5C24; // type:function size:0x4 +GKI_sched_lock = .text:0x800E5C28; // type:function size:0x4 +GKI_sched_unlock = .text:0x800E5C2C; // type:function size:0x4 +GKI_delay = .text:0x800E5C30; // type:function size:0x4 +GKI_send_event = .text:0x800E5C34; // type:function size:0xA4 +GKI_get_taskid = .text:0x800E5CD8; // type:function size:0x8 +GKI_enable = .text:0x800E5CE0; // type:function size:0x24 +GKI_disable = .text:0x800E5D04; // type:function size:0x44 +GKI_exception = .text:0x800E5D48; // type:function size:0x4 +GKI_os_malloc = .text:0x800E5D4C; // type:function size:0x2C +GKI_os_free = .text:0x800E5D78; // type:function size:0x4 fn_800E5D7C = .text:0x800E5D7C; // type:function size:0x24 fn_800E5DA0 = .text:0x800E5DA0; // type:function size:0x398 fn_800E6138 = .text:0x800E6138; // type:function size:0x1AC @@ -6647,8 +6647,8 @@ fn_801651AC = .text:0x801651AC; // type:function size:0x68 fn_80165214 = .text:0x80165214; // type:function size:0x58 fn_8016526C = .text:0x8016526C; // type:function size:0x128 fn_80165394 = .text:0x80165394; // type:function size:0x34 -fn_801653C8 = .text:0x801653C8; // type:function size:0x40 -fn_80165408 = .text:0x80165408; // type:function size:0x10 +__dt__15RP_DEBUG_STUB_1Fv = .text:0x801653C8; // type:function size:0x40 +__ct__15RP_DEBUG_STUB_1Fv = .text:0x80165408; // type:function size:0x10 fn_80165418 = .text:0x80165418; // type:function size:0x40 fn_80165458 = .text:0x80165458; // type:function size:0x194 fn_801655EC = .text:0x801655EC; // type:function size:0x114 @@ -7035,13 +7035,13 @@ fn_8017866C = .text:0x8017866C; // type:function size:0x540 fn_80178BAC = .text:0x80178BAC; // type:function size:0x40 fn_80178BEC = .text:0x80178BEC; // type:function size:0x68 fn_80178C54 = .text:0x80178C54; // type:function size:0x15C -fn_80178DB0 = .text:0x80178DB0; // type:function size:0x244 -fn_80178FF4 = .text:0x80178FF4; // type:function size:0x4C -fn_80179040 = .text:0x80179040; // type:function size:0x4C -fn_8017908C = .text:0x8017908C; // type:function size:0x50 -fn_801790DC = .text:0x801790DC; // type:function size:0x24C +SyncFromMatrix__11RPGrpCameraFUs = .text:0x80178DB0; // type:function size:0x244 +GetScreenToWorld__11RPGrpCameraCFPQ34nw4r4math4VEC3RCQ34nw4r4math4VEC2PC11RPGrpScreen = .text:0x80178FF4; // type:function size:0x4C +GetScreenToWorld__11RPGrpCameraCFPQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3PC11RPGrpScreen = .text:0x80179040; // type:function size:0x4C +GetWorldToScreen__11RPGrpCameraCFPQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3PC11RPGrpScreen = .text:0x8017908C; // type:function size:0x50 +CalcMatrix__11RPGrpCameraFv = .text:0x801790DC; // type:function size:0x24C fn_80179328 = .text:0x80179328; // type:function size:0x44 -fn_8017936C = .text:0x8017936C; // type:function size:0x8C +__ct__11RPGrpCameraFv = .text:0x8017936C; // type:function size:0x8C fn_801793F8 = .text:0x801793F8; // type:function size:0x40 fn_80179438 = .text:0x80179438; // type:function size:0x324 fn_8017975C = .text:0x8017975C; // type:function size:0xA8 @@ -7183,24 +7183,24 @@ fn_801808A8 = .text:0x801808A8; // type:function size:0xBC fn_80180964 = .text:0x80180964; // type:function size:0x40 fn_801809A4 = .text:0x801809A4; // type:function size:0x3C fn_801809E0 = .text:0x801809E0; // type:function size:0x8 -fn_801809E8 = .text:0x801809E8; // type:function size:0x44 -fn_80180A2C = .text:0x80180A2C; // type:function size:0xF8 +RemoveGenList__10RPGrpModelFv = .text:0x801809E8; // type:function size:0x44 +SetReverseCulling__10RPGrpModelFb = .text:0x80180A2C; // type:function size:0xF8 CalcMaterial__10RPGrpModelFv = .text:0x80180B24; // type:function size:0x78 Entry__10RPGrpModelFv = .text:0x80180B9C; // type:function size:0x2C Calc__10RPGrpModelFv = .text:0x80180BC8; // type:function size:0x74 -fn_80180C3C = .text:0x80180C3C; // type:function size:0x5C -fn_80180C98 = .text:0x80180C98; // type:function size:0x64 -fn_80180CFC = .text:0x80180CFC; // type:function size:0x84 -fn_80180D80 = .text:0x80180D80; // type:function size:0x110 +UpdateFrame__10RPGrpModelFv = .text:0x80180C3C; // type:function size:0x5C +CreateRecord__10RPGrpModelFUs = .text:0x80180C98; // type:function size:0x64 +CreateBoundingInfo__10RPGrpModelFUl = .text:0x80180CFC; // type:function size:0x84 +Configure__10RPGrpModelFv = .text:0x80180D80; // type:function size:0x110 SetCallback__10RPGrpModelFP19IRPGrpModelCallback = .text:0x80180E90; // type:function size:0x10 __dt__10RPGrpModelFv = .text:0x80180EA0; // type:function size:0x40 __ct__10RPGrpModelFUc = .text:0x80180EE0; // type:function size:0xBC Construct__10RPGrpModelFUsPCcUcUlUl = .text:0x80180F9C; // type:function size:0x94 Construct__10RPGrpModelFUsiUcUlUl = .text:0x80181030; // type:function size:0x94 Construct__10RPGrpModelFUsUcUlUl = .text:0x801810C4; // type:function size:0xB4 -fn_80181178 = .text:0x80181178; // type:function size:0x8 -fn_80181180 = .text:0x80181180; // type:function size:0x8 -fn_80181188 = .text:0x80181188; // type:function size:0x8 +GetJointNum__10RPGrpModelCFv = .text:0x80181178; // type:function size:0x8 +GetShapeNum__10RPGrpModelCFv = .text:0x80181180; // type:function size:0x8 +GetViewMtxNum__10RPGrpModelCFv = .text:0x80181188; // type:function size:0x8 InternalRegist__13RPGrpModelAnmFQ213RPGrpModelAnm3AnmUs = .text:0x80181190; // type:function size:0x1C GetBlendIndex__13RPGrpModelAnmFQ213RPGrpModelAnm3AnmUsUc = .text:0x801811AC; // type:function size:0x7C SetBlendAnm__13RPGrpModelAnmFQ213RPGrpModelAnm3AnmUcUs = .text:0x80181228; // type:function size:0x110 @@ -7217,19 +7217,19 @@ __dt__13RPGrpModelAnmFv = .text:0x80181944; // type:function size:0x40 GetUpdateRate__25RPGrpModelAnmImplement<1>CFQ213RPGrpModelAnm3AnmUs = .text:0x80181984; // type:function size:0x3C GetAnmObj__25RPGrpModelAnmImplement<1>CFQ213RPGrpModelAnm3AnmUs = .text:0x801819C0; // type:function size:0x4 SetUpdateRate__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmUsf = .text:0x801819C4; // type:function size:0x4C -fn_80181A10 = .text:0x80181A10; // type:function size:0x3C -fn_80181A4C = .text:0x80181A4C; // type:function size:0x4C -fn_80181A98 = .text:0x80181A98; // type:function size:0xF0 -fn_80181B88 = .text:0x80181B88; // type:function size:0xE8 -fn_80181C70 = .text:0x80181C70; // type:function size:0x8 -fn_80181C78 = .text:0x80181C78; // type:function size:0x8 -fn_80181C80 = .text:0x80181C80; // type:function size:0x4 -fn_80181C84 = .text:0x80181C84; // type:function size:0x24 -fn_80181CA8 = .text:0x80181CA8; // type:function size:0x190 -fn_80181E38 = .text:0x80181E38; // type:function size:0x54 -fn_80181E8C = .text:0x80181E8C; // type:function size:0x60 -fn_80181EEC = .text:0x80181EEC; // type:function size:0x58 -fn_80181F44 = .text:0x80181F44; // type:function size:0x100 +GetFrame__25RPGrpModelAnmImplement<1>CFQ213RPGrpModelAnm3AnmUs = .text:0x80181A10; // type:function size:0x3C +SetFrame__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmUsf = .text:0x80181A4C; // type:function size:0x4C +GetAnmPlayPolicy__25RPGrpModelAnmImplement<1>CFQ213RPGrpModelAnm3AnmUs = .text:0x80181A98; // type:function size:0xF0 +GetNumFrame__25RPGrpModelAnmImplement<1>CFQ213RPGrpModelAnm3AnmUs = .text:0x80181B88; // type:function size:0xE8 +VF_0x48__25RPGrpModelAnmImplement<1>Fv = .text:0x80181C70; // type:function size:0x8 +VF_0x44__25RPGrpModelAnmImplement<1>Fv = .text:0x80181C78; // type:function size:0x8 +VF_0x70__25RPGrpModelAnmImplement<1>Fv = .text:0x80181C80; // type:function size:0x4 +SetEnableQuaternionBlend__25RPGrpModelAnmImplement<1>Fb = .text:0x80181C84; // type:function size:0x24 +UpdateFrame__25RPGrpModelAnmImplement<1>Fv = .text:0x80181CA8; // type:function size:0x190 +ReleaseChrAnmNode__25RPGrpModelAnmImplement<1>FUsUsQ213RPGrpModelAnm8BindType = .text:0x80181E38; // type:function size:0x54 +GetBlendWeight__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmUcUc = .text:0x80181E8C; // type:function size:0x60 +GetBlendAnm__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmUcUc = .text:0x80181EEC; // type:function size:0x58 +RemoveBlendAnm__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmUcUc = .text:0x80181F44; // type:function size:0x100 fn_80182044 = .text:0x80182044; // type:function size:0x58 fn_8018209C = .text:0x8018209C; // type:function size:0xD8 fn_80182174 = .text:0x80182174; // type:function size:0x1C0 @@ -7239,11 +7239,11 @@ fn_80182A18 = .text:0x80182A18; // type:function size:0x430 fn_80182E48 = .text:0x80182E48; // type:function size:0x84 fn_80182ECC = .text:0x80182ECC; // type:function size:0x74 fn_80182F40 = .text:0x80182F40; // type:function size:0x4 -fn_80182F44 = .text:0x80182F44; // type:function size:0xA8 -fn_80182FEC = .text:0x80182FEC; // type:function size:0x60 -fn_8018304C = .text:0x8018304C; // type:function size:0x40 -fn_8018308C = .text:0x8018308C; // type:function size:0x44C -fn_801834D8 = .text:0x801834D8; // type:function size:0x44C +InternalGetAnmObj__25RPGrpModelAnmImplement<1>CFQ213RPGrpModelAnm3AnmUs = .text:0x80182F44; // type:function size:0xA8 +SetAnmObj__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmPPQ34nw4r3g3d6AnmObj = .text:0x80182FEC; // type:function size:0x60 +__dt__25RPGrpModelAnmImplement<1>Fv = .text:0x8018304C; // type:function size:0x40 +RegistFromResFile__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmUsUsUl = .text:0x8018308C; // type:function size:0x44C +RegistFromResFile__25RPGrpModelAnmImplement<1>FQ213RPGrpModelAnm3AnmUsUsPCc = .text:0x801834D8; // type:function size:0x44C fn_80183924 = .text:0x80183924; // type:function size:0x34 fn_80183958 = .text:0x80183958; // type:function size:0x34 fn_8018398C = .text:0x8018398C; // type:function size:0x30 @@ -7311,7 +7311,7 @@ fn_801852E8 = .text:0x801852E8; // type:function size:0x34 fn_8018531C = .text:0x8018531C; // type:function size:0xC fn_80185328 = .text:0x80185328; // type:function size:0x8 fn_80185330 = .text:0x80185330; // type:function size:0x4 -fn_80185334 = .text:0x80185334; // type:function size:0x58 +__dt__13RPGrpModelG3DFv = .text:0x80185334; // type:function size:0x58 fn_8018538C = .text:0x8018538C; // type:function size:0x8 fn_80185394 = .text:0x80185394; // type:function size:0x8 fn_8018539C = .text:0x8018539C; // type:function size:0x8 @@ -7325,10 +7325,10 @@ fn_801853D4 = .text:0x801853D4; // type:function size:0x8 fn_801853DC = .text:0x801853DC; // type:function size:0x174 fn_80185550 = .text:0x80185550; // type:function size:0x104 fn_80185654 = .text:0x80185654; // type:function size:0xC -fn_80185660 = .text:0x80185660; // type:function size:0x10 +GetBinaryType__14RPGrpModelMiscCFv = .text:0x80185660; // type:function size:0x10 fn_80185670 = .text:0x80185670; // type:function size:0x10 fn_80185680 = .text:0x80185680; // type:function size:0x10 -fn_80185690 = .text:0x80185690; // type:function size:0x10 +GetDrawPathManager__17RPGrpModelManagerCFUc = .text:0x80185690; // type:function size:0x10 fn_801856A0 = .text:0x801856A0; // type:function size:0x50 fn_801856F0 = .text:0x801856F0; // type:function size:0x60 fn_80185750 = .text:0x80185750; // type:function size:0x58 @@ -7345,13 +7345,13 @@ fn_80185AA4 = .text:0x80185AA4; // type:function size:0x40 InternalGetResultTransform__20RPGrpModelResManagerFQ34nw4r3g3d9ResAnmChrUsfPQ23EGG9Matrix34fPQ23EGG8Vector3fPQ23EGG8Vector3fPQ23EGG8Vector3f = .text:0x80185AE4; // type:function size:0xA8 GetResultTransform__20RPGrpModelResManagerFUsUsfPQ23EGG9Matrix34fPQ23EGG8Vector3fPQ23EGG8Vector3fPQ23EGG8Vector3f = .text:0x80185B8C; // type:function size:0xD0 HasFile__20RPGrpModelResManagerCFQ220RPGrpModelResManager4TypeUsPCc = .text:0x80185C5C; // type:function size:0x24C -fn_80185EA8 = .text:0x80185EA8; // type:function size:0x270 -fn_80186118 = .text:0x80186118; // type:function size:0x1D4 -fn_801862EC = .text:0x801862EC; // type:function size:0x1D4 -fn_801864C0 = .text:0x801864C0; // type:function size:0xA0 -fn_80186560 = .text:0x80186560; // type:function size:0x48 -fn_801865A8 = .text:0x801865A8; // type:function size:0xB0 -fn_80186658 = .text:0x80186658; // type:function size:0x84 +InternalCreateData__20RPGrpModelResManagerFUsQ220RPGrpModelResManager4TypePvUl = .text:0x80185EA8; // type:function size:0x270 +GetPtr__20RPGrpModelResManagerCFQ220RPGrpModelResManager4TypeUsi = .text:0x80186118; // type:function size:0x1D4 +GetPtr__20RPGrpModelResManagerCFQ220RPGrpModelResManager4TypeUsPCc = .text:0x801862EC; // type:function size:0x1D4 +CreateData__20RPGrpModelResManagerFQ220RPGrpModelResManager4TypePvUl = .text:0x801864C0; // type:function size:0xA0 +SearchData__20RPGrpModelResManagerCFPv = .text:0x80186560; // type:function size:0x48 +TerminateAll__20RPGrpModelResManagerFv = .text:0x801865A8; // type:function size:0xB0 +Terminate__20RPGrpModelResManagerFUs = .text:0x80186658; // type:function size:0x84 CreateResourceList__20RPGrpModelResManagerFUs = .text:0x801866DC; // type:function size:0x1E8 Configure__20RPGrpModelResManagerFv = .text:0x801868C4; // type:function size:0x10 __ct__20RPGrpModelResManagerFv = .text:0x801868D4; // type:function size:0x10 @@ -7381,7 +7381,7 @@ fn_801877BC = .text:0x801877BC; // type:function size:0x94 fn_80187850 = .text:0x80187850; // type:function size:0x40 fn_80187890 = .text:0x80187890; // type:function size:0x40 fn_801878D0 = .text:0x801878D0; // type:function size:0x30 -SetTVMode__Q23EGG6ScreenFQ33EGG6Screen6TVMode = .text:0x80187900; // type:function size:0xBC +fn_80187900 = .text:0x80187900; // type:function size:0xBC fn_801879BC = .text:0x801879BC; // type:function size:0x608 fn_80187FC4 = .text:0x80187FC4; // type:function size:0x74 fn_80188038 = .text:0x80188038; // type:function size:0x54 @@ -7551,20 +7551,20 @@ fn_8018EF28 = .text:0x8018EF28; // type:function size:0x10C fn_8018F034 = .text:0x8018F034; // type:function size:0xE0 fn_8018F114 = .text:0x8018F114; // type:function size:0x50 fn_8018F164 = .text:0x8018F164; // type:function size:0x3C -fn_8018F1A0 = .text:0x8018F1A0; // type:function size:0x6C -fn_8018F20C = .text:0x8018F20C; // type:function size:0x58 -fn_8018F264 = .text:0x8018F264; // type:function size:0x440 +allocWithHeaderDebug__15RPGrpCpuTextureFv = .text:0x8018F1A0; // type:function size:0x6C +alloc__15RPGrpCpuTextureFv = .text:0x8018F20C; // type:function size:0x58 +fillGradationTable__15RPGrpCpuTextureFQ215RPGrpCpuTexture14EGradationKindiUsUsRC8_GXColorRC8_GXColorbb = .text:0x8018F264; // type:function size:0x440 fn_8018F6A4 = .text:0x8018F6A4; // type:function size:0x294 -fn_8018F938 = .text:0x8018F938; // type:function size:0x84 -fn_8018F9BC = .text:0x8018F9BC; // type:function size:0x1C -fn_8018F9D8 = .text:0x8018F9D8; // type:function size:0x4C -fn_8018FA24 = .text:0x8018FA24; // type:function size:0x4C -fn_8018FA70 = .text:0x8018FA70; // type:function size:0x48 -fn_8018FAB8 = .text:0x8018FAB8; // type:function size:0x80 +initResTIMG__15RPGrpCpuTextureCFv = .text:0x8018F938; // type:function size:0x84 +getTexBufferSize__15RPGrpCpuTextureCFv = .text:0x8018F9BC; // type:function size:0x1C +flush__15RPGrpCpuTextureCFv = .text:0x8018F9D8; // type:function size:0x4C +invalidate__15RPGrpCpuTextureCFv = .text:0x8018FA24; // type:function size:0x4C +load__15RPGrpCpuTextureF11_GXTexMapID = .text:0x8018FA70; // type:function size:0x48 +getTexObj__15RPGrpCpuTextureCFP9_GXTexObj = .text:0x8018FAB8; // type:function size:0x80 fn_8018FB38 = .text:0x8018FB38; // type:function size:0x20 fn_8018FB58 = .text:0x8018FB58; // type:function size:0x24 fn_8018FB7C = .text:0x8018FB7C; // type:function size:0x28 -fn_8018FBA4 = .text:0x8018FBA4; // type:function size:0x54C +makeGradationTable__FQ215RPGrpCpuTexture14EGradationKindP8_GXColorUsUsUsRC8_GXColorRC8_GXColor = .text:0x8018FBA4; // type:function size:0x54C fn_801900F0 = .text:0x801900F0; // type:function size:0xA4 fn_80190194 = .text:0x80190194; // type:function size:0x78 fn_8019020C = .text:0x8019020C; // type:function size:0xA8 @@ -7712,8 +7712,8 @@ fn_80198744 = .text:0x80198744; // type:function size:0xAC fn_801987F0 = .text:0x801987F0; // type:function size:0x1A0 fn_80198990 = .text:0x80198990; // type:function size:0x170 fn_80198B00 = .text:0x80198B00; // type:function size:0x1B4 -fn_80198CB4 = .text:0x80198CB4; // type:function size:0x660 -fn_80199314 = .text:0x80199314; // type:function size:0x66C +Calc__18RPGrpModelMaterialFv = .text:0x80198CB4; // type:function size:0x660 +__ct__18RPGrpModelMaterialFP10RPGrpModelUs = .text:0x80199314; // type:function size:0x66C fn_80199980 = .text:0x80199980; // type:function size:0x124 fn_80199AA4 = .text:0x80199AA4; // type:function size:0x84 fn_80199B28 = .text:0x80199B28; // type:function size:0x40 @@ -7723,8 +7723,8 @@ fn_8019A310 = .text:0x8019A310; // type:function size:0x70 fn_8019A380 = .text:0x8019A380; // type:function size:0x40 fn_8019A3C0 = .text:0x8019A3C0; // type:function size:0x4 fn_8019A3C4 = .text:0x8019A3C4; // type:function size:0x1B0 -fn_8019A574 = .text:0x8019A574; // type:function size:0xCC -fn_8019A640 = .text:0x8019A640; // type:function size:0x164 +Clear__16RPGrpModelRecordFv = .text:0x8019A574; // type:function size:0xCC +__ct__16RPGrpModelRecordFUsP10RPGrpModel = .text:0x8019A640; // type:function size:0x164 fn_8019A7A4 = .text:0x8019A7A4; // type:function size:0x78 fn_8019A81C = .text:0x8019A81C; // type:function size:0x4 fn_8019A820 = .text:0x8019A820; // type:function size:0x40 @@ -7846,25 +7846,25 @@ fn_8019E618 = .text:0x8019E618; // type:function size:0x8 fn_8019E620 = .text:0x8019E620; // type:function size:0x8 fn_8019E628 = .text:0x8019E628; // type:function size:0x8 isDisconnectAllFinished__15RPSndSpeakerMgrFv = .text:0x8019E630; // type:function size:0x2C -fn_8019E65C = .text:0x8019E65C; // type:function size:0x84 -fn_8019E6E0 = .text:0x8019E6E0; // type:function size:0x84 -fn_8019E764 = .text:0x8019E764; // type:function size:0x34 -fn_8019E798 = .text:0x8019E798; // type:function size:0x30 -fn_8019E7C8 = .text:0x8019E7C8; // type:function size:0xD0 -fn_8019E898 = .text:0x8019E898; // type:function size:0xD4 -fn_8019E96C = .text:0x8019E96C; // type:function size:0x58 -fn_8019E9C4 = .text:0x8019E9C4; // type:function size:0xE4 +disconnectAll__15RPSndSpeakerMgrFv = .text:0x8019E65C; // type:function size:0x84 +connectAll__15RPSndSpeakerMgrFv = .text:0x8019E6E0; // type:function size:0x84 +setSpeakerShutdownCallback__15RPSndSpeakerMgrFll = .text:0x8019E764; // type:function size:0x34 +setSpeakerSetupCallback__15RPSndSpeakerMgrFll = .text:0x8019E798; // type:function size:0x30 +setSpeakerOffCallback__15RPSndSpeakerMgrFll = .text:0x8019E7C8; // type:function size:0xD0 +setSpeakerOnCallback__15RPSndSpeakerMgrFll = .text:0x8019E898; // type:function size:0xD4 +__dt__15RPSndSpeakerMgrFv = .text:0x8019E96C; // type:function size:0x58 +__ct__15RPSndSpeakerMgrFPQ23EGG4Heap = .text:0x8019E9C4; // type:function size:0xE4 setRemoteSend__15RPSndSpeakerMgrFPQ34nw4r3snd11SoundHandleUlfff = .text:0x8019EAA8; // type:function size:0x190 -fn_8019EC38 = .text:0x8019EC38; // type:function size:0xEC -fn_8019ED24 = .text:0x8019ED24; // type:function size:0x30 -fn_8019ED54 = .text:0x8019ED54; // type:function size:0x84 -fn_8019EDD8 = .text:0x8019EDD8; // type:function size:0x1AC +setEnableSw__15RPSndSpeakerMgrFlb = .text:0x8019EC38; // type:function size:0xEC +updateMasterVolume__15RPSndSpeakerMgrFv = .text:0x8019ED24; // type:function size:0x30 +exit__15RPSndSpeakerMgrFv = .text:0x8019ED54; // type:function size:0x84 +calc__15RPSndSpeakerMgrFv = .text:0x8019EDD8; // type:function size:0x1AC reset__15RPSndSpeakerMgrFv = .text:0x8019EF84; // type:function size:0x84 -fn_8019F008 = .text:0x8019F008; // type:function size:0x60 -fn_8019F068 = .text:0x8019F068; // type:function size:0x80 -fn_8019F0E8 = .text:0x8019F0E8; // type:function size:0xF8 +CreateInstance__15RPSndSpeakerMgrFPQ23EGG4Heap = .text:0x8019F008; // type:function size:0x60 +stopAllActorSound__11RPSndObjMgrFi = .text:0x8019F068; // type:function size:0x80 +setHandleDpdPan__12RPSndUtilityFRQ34nw4r3snd11SoundHandleRCQ34nw4r4math4VEC2f = .text:0x8019F0E8; // type:function size:0xF8 fn_8019F1E0 = .text:0x8019F1E0; // type:function size:0xD8 -fn_8019F2B8 = .text:0x8019F2B8; // type:function size:0x78 +update__17RPSndMoveValueF32Fv = .text:0x8019F2B8; // type:function size:0x78 moveValue__17RPSndMoveValueF32FfUl = .text:0x8019F330; // type:function size:0x4C fn_8019F37C = .text:0x8019F37C; // type:function size:0x20 fn_8019F39C = .text:0x8019F39C; // type:function size:0x18 @@ -7877,10 +7877,10 @@ fn_8019F514 = .text:0x8019F514; // type:function size:0x144 fn_8019F658 = .text:0x8019F658; // type:function size:0x168 fn_8019F7C0 = .text:0x8019F7C0; // type:function size:0x54 __dt__14RPSndStaticMgrFv = .text:0x8019F814; // type:function size:0x68 -fn_8019F87C = .text:0x8019F87C; // type:function size:0x58 -fn_8019F8D4 = .text:0x8019F8D4; // type:function size:0x1FC -fn_8019FAD0 = .text:0x8019FAD0; // type:function size:0x298 -fn_8019FD68 = .text:0x8019FD68; // type:function size:0x11C +__ct__14RPSndStaticMgrFv = .text:0x8019F87C; // type:function size:0x58 +GetMidPoint__12RPUtlDohMathFPQ34nw4r4math4VEC3PfRCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3ff = .text:0x8019F8D4; // type:function size:0x1FC +MTX34Normalize__12RPUtlDohMathFPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34Q212RPUtlDohMath9AxisOrder = .text:0x8019FAD0; // type:function size:0x298 +__sinit_\RPUtlDohMath_cpp = .text:0x8019FD68; // type:function size:0x11C fn_8019FE84 = .text:0x8019FE84; // type:function size:0x3C4 fn_801A0248 = .text:0x801A0248; // type:function size:0x7C fn_801A02C4 = .text:0x801A02C4; // type:function size:0x198 @@ -7980,9 +7980,9 @@ fn_801A5000 = .text:0x801A5000; // type:function size:0x80 fn_801A5080 = .text:0x801A5080; // type:function size:0x74 fn_801A50F4 = .text:0x801A50F4; // type:function size:0x6C fn_801A5160 = .text:0x801A5160; // type:function size:0x30C -fn_801A546C = .text:0x801A546C; // type:function size:0x88 -fn_801A54F4 = .text:0x801A54F4; // type:function size:0x88 -fn_801A557C = .text:0x801A557C; // type:function size:0x4 +drawShadow__17RPUtlShadowDrawerFv = .text:0x801A546C; // type:function size:0x88 +initMtx__17RPUtlShadowDrawerCFv = .text:0x801A54F4; // type:function size:0x88 +__sinit_\RPUtlShadowDrawer_cpp = .text:0x801A557C; // type:function size:0x4 fn_801A5580 = .text:0x801A5580; // type:function size:0xC fn_801A558C = .text:0x801A558C; // type:function size:0x5C fn_801A55E8 = .text:0x801A55E8; // type:function size:0x5C @@ -8459,11 +8459,11 @@ fn_801BAFC4 = .text:0x801BAFC4; // type:function size:0x5C fn_801BB020 = .text:0x801BB020; // type:function size:0x34 fn_801BB054 = .text:0x801BB054; // type:function size:0x8 fn_801BB05C = .text:0x801BB05C; // type:function size:0x8 -fn_801BB064 = .text:0x801BB064; // type:function size:0x94 -fn_801BB0F8 = .text:0x801BB0F8; // type:function size:0x130 -fn_801BB228 = .text:0x801BB228; // type:function size:0x1F8 -fn_801BB420 = .text:0x801BB420; // type:function size:0x1CC -fn_801BB5EC = .text:0x801BB5EC; // type:function size:0x58 +calcView__19RPSportsMenuBgModelFv = .text:0x801BB064; // type:function size:0x94 +initCamera__19RPSportsMenuBgModelFv = .text:0x801BB0F8; // type:function size:0x130 +createData__19RPSportsMenuBgModelFPQ23EGG7Archive = .text:0x801BB228; // type:function size:0x1F8 +__ct__19RPSportsMenuBgModelFUcUcUs = .text:0x801BB420; // type:function size:0x1CC +__dt__19RPSportsMenuBgModelFv = .text:0x801BB5EC; // type:function size:0x58 fn_801BB644 = .text:0x801BB644; // type:function size:0x20 fn_801BB664 = .text:0x801BB664; // type:function size:0xA8 fn_801BB70C = .text:0x801BB70C; // type:function size:0xA8 @@ -14373,10 +14373,10 @@ lbl_80343978 = .rodata:0x80343978; // type:object size:0x1B lbl_80343998 = .rodata:0x80343998; // type:object size:0x60 lbl_803439F8 = .rodata:0x803439F8; // type:object size:0x18 lbl_80343A10 = .rodata:0x80343A10; // type:object size:0x18 -lbl_80343A28 = .rodata:0x80343A28; // type:object size:0x18 -lbl_80343A40 = .rodata:0x80343A40; // type:object size:0x18 -lbl_80343A58 = .rodata:0x80343A58; // type:object size:0xC -lbl_80343A64 = .rodata:0x80343A64; // type:object size:0xC +sDefaultFxReverbHi__Q23EGG10AudioFxMgr = .rodata:0x80343A28; // type:object size:0x18 +sDefaultFxReverbHiDpl2__Q23EGG10AudioFxMgr = .rodata:0x80343A40; // type:object size:0x18 +sDefaultFxChorus__Q23EGG10AudioFxMgr = .rodata:0x80343A58; // type:object size:0xC +sDefaultFxDelay__Q23EGG10AudioFxMgr = .rodata:0x80343A64; // type:object size:0xC lbl_80343A70 = .rodata:0x80343A70; // type:object size:0x1F0 lbl_80343C60 = .rodata:0x80343C60; // type:object size:0x38 lbl_80343C98 = .rodata:0x80343C98; // type:object size:0xD8 @@ -16654,8 +16654,8 @@ lbl_8035FE50 = .data:0x8035FE50; // type:object size:0x68 lbl_8035FEB8 = .data:0x8035FEB8; // type:object size:0x28 lbl_8035FEE0 = .data:0x8035FEE0; // type:object size:0x28 lbl_8035FF08 = .data:0x8035FF08; // type:object size:0x18 -lbl_8035FF20 = .data:0x8035FF20; // type:object size:0x20 -lbl_8035FF40 = .data:0x8035FF40; // type:object size:0x30 +__vt__Q34nw4r3snd12SoundArchive = .data:0x8035FF20; // type:object size:0x20 +__vt__Q34nw4r3snd18SoundArchivePlayer = .data:0x8035FF40; // type:object size:0x30 lbl_8035FF70 = .data:0x8035FF70; // type:object size:0x14 lbl_8035FF84 = .data:0x8035FF84; // type:object size:0x14 lbl_8035FF98 = .data:0x8035FF98; // type:object size:0x18 @@ -17106,12 +17106,19 @@ lbl_803771E0 = .data:0x803771E0; // type:object size:0x100 lbl_803772E0 = .data:0x803772E0; // type:object size:0x200 lbl_803774E0 = .data:0x803774E0; // type:object size:0x800 lbl_80377CE0 = .data:0x80377CE0; // type:object size:0x37 data:string -lbl_80377D18 = .data:0x80377D18; // type:object size:0x15 data:string -lbl_80377D30 = .data:0x80377D30; // type:object size:0x98 -lbl_80377DC8 = .data:0x80377DC8; // type:object size:0x1B data:string -lbl_80377DE4 = .data:0x80377DE4; // type:object size:0x1D data:string -lbl_80377E04 = .data:0x80377E04; // type:object size:0x44 -lbl_80377E48 = .data:0x80377E48; // type:object size:0x12 data:string +@844 = .data:0x80377D18; // type:object size:0x15 data:string +@845 = .data:0x80377D30; // type:object size:0x18 data:string +@873 = .data:0x80377D48; // type:object size:0x15 data:string +@874 = .data:0x80377D60; // type:object size:0x13 data:string +@875 = .data:0x80377D74; // type:object size:0xC data:string +@917 = .data:0x80377D80; // type:object size:0x18 data:string +@918 = .data:0x80377D98; // type:object size:0x18 data:string +@919 = .data:0x80377DB0; // type:object size:0x15 data:string +@966 = .data:0x80377DC8; // type:object size:0x1B data:string +@967 = .data:0x80377DE4; // type:object size:0x1D data:string +@987 = .data:0x80377E04; // type:object size:0x22 data:string +@1043 = .data:0x80377E28; // type:object size:0x1D data:string +@1157 = .data:0x80377E48; // type:object size:0x12 data:string lbl_80377E60 = .data:0x80377E60; // type:object size:0x3A data:string lbl_80377E9C = .data:0x80377E9C; // type:object size:0x2F data:string lbl_80377ED0 = .data:0x80377ED0; // type:object size:0x5D0 @@ -17727,7 +17734,7 @@ lbl_80382240 = .data:0x80382240; // type:object size:0x28 lbl_80382268 = .data:0x80382268; // type:object size:0x28 lbl_80382290 = .data:0x80382290; // type:object size:0x58 lbl_803822E8 = .data:0x803822E8; // type:object size:0x30 -lbl_80382318 = .data:0x80382318; // type:object size:0x98 +__vt__10RPGrpModel = .data:0x80382318; // type:object size:0x98 __vt__13RPGrpModelAnm = .data:0x803823B0; // type:object size:0x88 jumptable_80382438 = .data:0x80382438; // type:object size:0x20 scope:local jumptable_80382458 = .data:0x80382458; // type:object size:0x20 scope:local @@ -17741,11 +17748,11 @@ lbl_803825A0 = .data:0x803825A0; // type:object size:0x30 lbl_803825D0 = .data:0x803825D0; // type:object size:0xF0 lbl_803826C0 = .data:0x803826C0; // type:object size:0xC lbl_803826CC = .data:0x803826CC; // type:object size:0x24 -jumptable_803826F0 = .data:0x803826F0; // type:object size:0x28 scope:local -jumptable_80382718 = .data:0x80382718; // type:object size:0x30 scope:local -jumptable_80382748 = .data:0x80382748; // type:object size:0x28 scope:local -jumptable_80382770 = .data:0x80382770; // type:object size:0x28 scope:local -__vt__20RPGrpModelResManager = .data:0x80382798; // type:object size:0x10 +@18027 = .data:0x803826F0; // type:object size:0x28 scope:local +@18143 = .data:0x80382718; // type:object size:0x30 scope:local +@18357 = .data:0x80382748; // type:object size:0x28 scope:local +@18572 = .data:0x80382770; // type:object size:0x28 scope:local +__vt__20RPGrpModelResManager = .data:0x80382798; // type:object size:0xC jumptable_803827A8 = .data:0x803827A8; // type:object size:0x24 scope:local lbl_803827CC = .data:0x803827CC; // type:object size:0x14 lbl_803827E0 = .data:0x803827E0; // type:object size:0x10 @@ -17804,7 +17811,7 @@ lbl_80383004 = .data:0x80383004; // type:object size:0x16 data:string @STRING@setCameraCount__Q23EGG19TAudioSound3DMgr<4>Fl@1 = .data:0x80383030; // type:object size:0x10 data:string @STRING@setCameraCount__Q23EGG19TAudioSound3DMgr<4>Fl@0 = .data:0x80383040; // type:object size:0xC data:string @STRING@setCameraCount__Q23EGG19TAudioSound3DMgr<4>Fl = .data:0x80383050; // type:object size:0x10 data:string -lbl_80383060 = .data:0x80383060; // type:object size:0x10 +__vt__15RPSndSpeakerMgr = .data:0x80383060; // type:object size:0xC lbl_80383070 = .data:0x80383070; // type:object size:0x70 lbl_803830E0 = .data:0x803830E0; // type:object size:0x6BA0 lbl_80389C80 = .data:0x80389C80; // type:object size:0x58 @@ -17860,7 +17867,7 @@ lbl_8038A2D0 = .data:0x8038A2D0; // type:object size:0x20 lbl_8038A2F0 = .data:0x8038A2F0; // type:object size:0x10 __vt__14RPSysBootScene = .data:0x8038A300; // type:object size:0x60 __vt__22RPSysPlayerSelectScene = .data:0x8038A360; // type:object size:0x60 -lbl_8038A3C0 = .data:0x8038A3C0; // type:object size:0x10 +__vt__19RPSportsMenuBgModel = .data:0x8038A3C0; // type:object size:0x10 lbl_8038A3D0 = .data:0x8038A3D0; // type:object size:0x20 lbl_8038A3F0 = .data:0x8038A3F0; // type:object size:0x28 jumptable_8038A418 = .data:0x8038A418; // type:object size:0x1C scope:local @@ -18774,10 +18781,7 @@ lbl_80400900 = .bss:0x80400900; // type:object size:0x4E7 lbl_80400DE7 = .bss:0x80400DE7; // type:object size:0x3310 lbl_804040F7 = .bss:0x804040F7; // type:object size:0x5227 lbl_8040931E = .bss:0x8040931E; // type:object size:0xBE2 -lbl_80409F00 = .bss:0x80409F00; // type:object size:0x1FF data:byte -lbl_8040A0FF = .bss:0x8040A0FF; // type:object size:0x5E9C -lbl_8040FF9B = .bss:0x8040FF9B; // type:object size:0x1076E -lbl_80420709 = .bss:0x80420709; // type:object size:0x122D7 +gki_cb = .bss:0x80409F00; // type:object size:0x28AE0 data:byte lbl_804329E0 = .bss:0x804329E0; // type:object size:0x40 lbl_80432A20 = .bss:0x80432A20; // type:object size:0x60 data:4byte lbl_80432A80 = .bss:0x80432A80; // type:object size:0x1000 @@ -18874,15 +18878,16 @@ lbl_804D6EB0 = .bss:0x804D6EB0; // type:object size:0x28 data:byte lbl_804D6ED8 = .bss:0x804D6ED8; // type:object size:0x10 data:4byte lbl_804D6EE8 = .bss:0x804D6EE8; // type:object size:0x10 lbl_804D6EF8 = .bss:0x804D6EF8; // type:object size:0x10 -lbl_804D6F08 = .bss:0x804D6F08; // type:object size:0xC align:4 data:float -lbl_804D6F14 = .bss:0x804D6F14; // type:object size:0xC align:4 data:float -lbl_804D6F20 = .bss:0x804D6F20; // type:object size:0xC align:4 data:float -lbl_804D6F2C = .bss:0x804D6F2C; // type:object size:0xC align:4 data:float -lbl_804D6F38 = .bss:0x804D6F38; // type:object size:0xC align:4 data:float -lbl_804D6F44 = .bss:0x804D6F44; // type:object size:0xC align:4 data:float -lbl_804D6F50 = .bss:0x804D6F50; // type:object size:0x10 align:4 data:float -lbl_804D6F60 = .bss:0x804D6F60; // type:object size:0x58 align:4 data:float -lbl_804D6FB8 = .bss:0x804D6FB8; // type:object size:0x10 align:4 data:float +VEC3_ZERO__12RPUtlDohMath = .bss:0x804D6F08; // type:object size:0xC align:4 data:float +AXIS_XP__12RPUtlDohMath = .bss:0x804D6F14; // type:object size:0xC align:4 data:float +AXIS_XN__12RPUtlDohMath = .bss:0x804D6F20; // type:object size:0xC align:4 data:float +AXIS_YP__12RPUtlDohMath = .bss:0x804D6F2C; // type:object size:0xC align:4 data:float +AXIS_YN__12RPUtlDohMath = .bss:0x804D6F38; // type:object size:0xC align:4 data:float +AXIS_ZP__12RPUtlDohMath = .bss:0x804D6F44; // type:object size:0xC align:4 data:float +AXIS_ZN__12RPUtlDohMath = .bss:0x804D6F50; // type:object size:0xC align:4 data:float +MTX34_IDENT__12RPUtlDohMath = .bss:0x804D6F60; // type:object size:0x30 align:4 data:float +MTX33_IDENT__12RPUtlDohMath = .bss:0x804D6F90; // type:object size:0x24 align:4 data:float +QUAT_IDENT__12RPUtlDohMath = .bss:0x804D6FB8; // type:object size:0x10 align:4 data:float lbl_804D6FC8 = .bss:0x804D6FC8; // type:object size:0x10 data:4byte lbl_804D6FD8 = .bss:0x804D6FD8; // type:object size:0x10 data:byte lbl_804D6FE8 = .bss:0x804D6FE8; // type:object size:0xC align:4 data:float @@ -18891,7 +18896,7 @@ lbl_804D7000 = .bss:0x804D7000; // type:object size:0xC align:4 data:float lbl_804D700C = .bss:0x804D700C; // type:object size:0xC align:4 data:float lbl_804D7018 = .bss:0x804D7018; // type:object size:0xC align:4 data:float lbl_804D7024 = .bss:0x804D7024; // type:object size:0x54 data:4byte -lbl_804D7078 = .bss:0x804D7078; // type:object size:0x30 data:4byte +sCameraMtx__17RPUtlShadowDrawer = .bss:0x804D7078; // type:object size:0x30 data:4byte lbl_804D70A8 = .bss:0x804D70A8; // type:object size:0x18 data:4byte lbl_804D70C0 = .bss:0x804D70C0; // type:object size:0x20 data:4byte lbl_804D70E0 = .bss:0x804D70E0; // type:object size:0x18 align:4 data:float @@ -20227,7 +20232,7 @@ lbl_804DF148 = .sbss:0x804DF148; // type:object size:0x4 data:4byte lbl_804DF14C = .sbss:0x804DF14C; // type:object size:0x1 data:byte lbl_804DF150 = .sbss:0x804DF150; // type:object size:0x8 data:byte lbl_804DF158 = .sbss:0x804DF158; // type:object size:0x8 data:byte -lbl_804DF160 = .sbss:0x804DF160; // type:object size:0x8 data:4byte +typeInfo__Q44nw4r3snd6detail8SeqSound = .sbss:0x804DF160; // type:object size:0x8 data:4byte lbl_804DF168 = .sbss:0x804DF168; // type:object size:0x4 align:4 data:float lbl_804DF16C = .sbss:0x804DF16C; // type:object size:0x1 data:byte lbl_804DF170 = .sbss:0x804DF170; // type:object size:0x4 align:4 data:float @@ -20751,10 +20756,10 @@ lbl_804DFB54 = .sbss:0x804DFB54; // type:object size:0x4 data:4byte lbl_804DFB58 = .sbss:0x804DFB58; // type:object size:0x4 data:4byte lbl_804DFB5C = .sbss:0x804DFB5C; // type:object size:0x4 data:4byte spAllocator__10RPGrpModel = .sbss:0x804DFB60; // type:object size:0x4 data:4byte -lbl_804DFB64 = .sbss:0x804DFB64; // type:object size:0x4 data:4byte -lbl_804DFB68 = .sbss:0x804DFB68; // type:object size:0x4 data:4byte -lbl_804DFB6C = .sbss:0x804DFB6C; // type:object size:0x4 data:4byte -lbl_804DFB70 = .sbss:0x804DFB70; // type:object size:0x8 data:4byte +spCalcModel__10RPGrpModel = .sbss:0x804DFB64; // type:object size:0x4 data:4byte +spEntryHead__10RPGrpModel = .sbss:0x804DFB68; // type:object size:0x4 data:4byte +spEntryTail__10RPGrpModel = .sbss:0x804DFB6C; // type:object size:0x4 data:4byte +spGenList__10RPGrpModel = .sbss:0x804DFB70; // type:object size:0x8 data:4byte lbl_804DFB78 = .sbss:0x804DFB78; // type:object size:0x8 data:4byte lbl_804DFB80 = .sbss:0x804DFB80; // type:object size:0x4 data:4byte lbl_804DFB84 = .sbss:0x804DFB84; // type:object size:0x4 data:4byte @@ -20814,9 +20819,9 @@ lbl_804DFC58 = .sbss:0x804DFC58; // type:object size:0x4 data:4byte MemDeallocCallbackArg = .sbss:0x804DFC5C; // type:object size:0x4 data:4byte spInstance__13RPSndAudioMgr = .sbss:0x804DFC60; // type:object size:0x4 data:4byte lbl_804DFC64 = .sbss:0x804DFC64; // type:object size:0x4 data:4byte -spInstance__15RPSndSpeakerMgr = .sbss:0x804DFC68; // type:object size:0x8 data:4byte +spInstance__15RPSndSpeakerMgr = .sbss:0x804DFC68; // type:object size:0x4 data:4byte lbl_804DFC70 = .sbss:0x804DFC70; // type:object size:0x8 data:4byte -lbl_804DFC78 = .sbss:0x804DFC78; // type:object size:0x8 align:4 data:float +VEC2_ZERO__12RPUtlDohMath = .sbss:0x804DFC78; // type:object size:0x8 align:4 data:float lbl_804DFC80 = .sbss:0x804DFC80; // type:object size:0x8 data:4byte lbl_804DFC88 = .sbss:0x804DFC88; // type:object size:0x4 data:4byte lbl_804DFC8C = .sbss:0x804DFC8C; // type:object size:0x4 data:4byte @@ -22287,9 +22292,9 @@ lbl_804E1A78 = .sdata2:0x804E1A78; // type:object size:0x1 data:byte lbl_804E1A79 = .sdata2:0x804E1A79; // type:object size:0x1 data:byte lbl_804E1A7A = .sdata2:0x804E1A7A; // type:object size:0x1 data:byte lbl_804E1A7B = .sdata2:0x804E1A7B; // type:object size:0x5 data:byte -lbl_804E1A80 = .sdata2:0x804E1A80; // type:object size:0x8 align:4 data:float -lbl_804E1A88 = .sdata2:0x804E1A88; // type:object size:0x4 align:4 data:float -lbl_804E1A8C = .sdata2:0x804E1A8C; // type:object size:0x4 align:4 data:float +@17544 = .sdata2:0x804E1A80; // type:object size:0x8 align:4 data:float +@17460 = .sdata2:0x804E1A88; // type:object size:0x4 align:4 data:float +@17461 = .sdata2:0x804E1A8C; // type:object size:0x4 align:4 data:float lbl_804E1A90 = .sdata2:0x804E1A90; // type:object size:0x8 lbl_804E1A98 = .sdata2:0x804E1A98; // type:object size:0x4 align:4 data:float lbl_804E1A9C = .sdata2:0x804E1A9C; // type:object size:0x4 align:4 data:float @@ -22557,7 +22562,7 @@ lbl_804E1E90 = .sdata2:0x804E1E90; // type:object size:0x4 align:4 data:float lbl_804E1E94 = .sdata2:0x804E1E94; // type:object size:0x4 align:4 data:float lbl_804E1E98 = .sdata2:0x804E1E98; // type:object size:0x4 align:4 data:float lbl_804E1EA0 = .sdata2:0x804E1EA0; // type:object size:0x8 align:8 data:double -lbl_804E1EA8 = .sdata2:0x804E1EA8; // type:object size:0x8 align:4 data:float +@11557 = .sdata2:0x804E1EA8; // type:object size:0x4 align:4 data:float lbl_804E1EB0 = .sdata2:0x804E1EB0; // type:object size:0x4 align:4 data:float lbl_804E1EB4 = .sdata2:0x804E1EB4; // type:object size:0x4 align:4 data:float lbl_804E1EB8 = .sdata2:0x804E1EB8; // type:object size:0x4 align:4 data:float @@ -22566,10 +22571,10 @@ lbl_804E1EC0 = .sdata2:0x804E1EC0; // type:object size:0x8 align:8 data:double lbl_804E1EC8 = .sdata2:0x804E1EC8; // type:object size:0x8 align:4 data:float lbl_804E1ED0 = .sdata2:0x804E1ED0; // type:object size:0x4 align:4 data:float lbl_804E1ED8 = .sdata2:0x804E1ED8; // type:object size:0x8 align:8 data:double -lbl_804E1EE0 = .sdata2:0x804E1EE0; // type:object size:0x4 align:4 data:float -lbl_804E1EE4 = .sdata2:0x804E1EE4; // type:object size:0x4 align:4 data:float -lbl_804E1EE8 = .sdata2:0x804E1EE8; // type:object size:0x4 align:4 data:float -lbl_804E1EEC = .sdata2:0x804E1EEC; // type:object size:0x4 align:4 data:float +FLOAT_EPSILON__12RPUtlDohMath = .sdata2:0x804E1EE0; // type:object size:0x4 align:4 data:float +@27055 = .sdata2:0x804E1EE4; // type:object size:0x4 align:4 data:float +@27056 = .sdata2:0x804E1EE8; // type:object size:0x4 align:4 data:float +@27244 = .sdata2:0x804E1EEC; // type:object size:0x4 align:4 data:float lbl_804E1EF0 = .sdata2:0x804E1EF0; // type:object size:0x4 align:4 data:float lbl_804E1EF4 = .sdata2:0x804E1EF4; // type:object size:0x4 align:4 data:float lbl_804E1EF8 = .sdata2:0x804E1EF8; // type:object size:0x4 align:4 data:float diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index 4ea2385f4..f3de7b62c 100644 --- a/config/RSPE01_01/symbols.txt +++ b/config/RSPE01_01/symbols.txt @@ -2894,7 +2894,7 @@ __ct__Q23EGG12LightManagerFUlUlUc = .text:0x8008FF24; // type:function size:0x23 Reset__Q23EGG12LightManagerFv = .text:0x80090160; // type:function size:0x12C scope:global Calc__Q23EGG12LightManagerFPQ34nw4r3g3d7ScnRoot = .text:0x8009028C; // type:function size:0xB0 scope:global CalcView__Q23EGG12LightManagerFRCQ34nw4r4math5MTX34UcPQ34nw4r3g3d7ScnRoot = .text:0x8009033C; // type:function size:0x140 scope:global -fn_8009047C = .text:0x8009047C; // type:function size:0x78 +SetChanAmbColor__Q23EGG12LightManagerCFv = .text:0x8009047C; // type:function size:0x78 LoadObjIndxGX__Q23EGG12LightManagerCFv = .text:0x800904F4; // type:function size:0x74 scope:global LoadLightSetGD__Q23EGG12LightManagerCFiPUlPUlPUlPUlP8_GXColor = .text:0x80090568; // type:function size:0x6C scope:global DoneDraw__Q23EGG12LightManagerFv = .text:0x800905D4; // type:function size:0x2C scope:global @@ -6864,7 +6864,7 @@ fn_80183534 = .text:0x80183534; // type:function size:0x50 fn_80183584 = .text:0x80183584; // type:function size:0x24 getFBHeight__11RPSysSystemCFv = .text:0x801835A8; // type:function size:0xC getFBWidth__11RPSysSystemCFv = .text:0x801835B4; // type:function size:0xC -fn_801835C0 = .text:0x801835C0; // type:function size:0x14 +getModifyRatio__11RPSysSystemCFv = .text:0x801835C0; // type:function size:0x14 fn_801835D4 = .text:0x801835D4; // type:function size:0x8 setupRenderMode__11RPSysSystemFv = .text:0x801835DC; // type:function size:0x130 setupTVMode__11RPSysSystemFv = .text:0x8018370C; // type:function size:0x6C @@ -7774,8 +7774,8 @@ fn_801A96B8 = .text:0x801A96B8; // type:function size:0x40 fn_801A96F8 = .text:0x801A96F8; // type:function size:0x40 fn_801A9738 = .text:0x801A9738; // type:function size:0x40 fn_801A9778 = .text:0x801A9778; // type:function size:0x40 -fn_801A97B8 = .text:0x801A97B8; // type:function size:0x14 -fn_801A97CC = .text:0x801A97CC; // type:function size:0x14 +On__13RPGrpDrawPathFv = .text:0x801A97B8; // type:function size:0x14 +Off__13RPGrpDrawPathFv = .text:0x801A97CC; // type:function size:0x14 LoadScnLight__17RPGrpLightManagerFUsPCcfUl = .text:0x801A97E0; // type:function size:0x80 RemoveGenList__10RPGrpModelFv = .text:0x801A9860; // type:function size:0x44 ReplaceTexture__10RPGrpModelFPCcRC12RPGrpTextureb = .text:0x801A98A4; // type:function size:0x94 @@ -7947,7 +7947,7 @@ fn_801AF40C = .text:0x801AF40C; // type:function size:0x24 AppendDrawObject__13RPGrpRendererFP16IRPGrpDrawObject = .text:0x801AF430; // type:function size:0x24 fn_801AF454 = .text:0x801AF454; // type:function size:0x138 fn_801AF58C = .text:0x801AF58C; // type:function size:0x9C -fn_801AF628 = .text:0x801AF628; // type:function size:0x98 +CreateView3D__13RPGrpRendererFUcP11RPGrpCameraP11RPGrpScreen = .text:0x801AF628; // type:function size:0x98 fn_801AF6C0 = .text:0x801AF6C0; // type:function size:0x54 CalculateInPause__13RPGrpRendererFv = .text:0x801AF714; // type:function size:0x58 PostCalculate__13RPGrpRendererFv = .text:0x801AF76C; // type:function size:0x84 @@ -8007,19 +8007,19 @@ GetCamera__17RPGrpViewRender3DCFv = .text:0x801B18BC; // type:function size:0x8 __ct__17RPGrpViewRender3DFUc = .text:0x801B18C4; // type:function size:0x4C __dt__17RPGrpViewRender3DFv = .text:0x801B1910; // type:function size:0x40 scope:weak GetType__17RPGrpViewRender3DCFv = .text:0x801B1950; // type:function size:0x8 scope:weak -fn_801B1958 = .text:0x801B1958; // type:function size:0x98 +setupEnvironment__15RPGrpModelSceneCFv = .text:0x801B1958; // type:function size:0x98 fn_801B19F0 = .text:0x801B19F0; // type:function size:0x24 -fn_801B1A14 = .text:0x801B1A14; // type:function size:0x80 +setDrawPriority__15RPGrpModelSceneCFP10RPGrpModel = .text:0x801B1A14; // type:function size:0x80 fn_801B1A94 = .text:0x801B1A94; // type:function size:0x18 fn_801B1AAC = .text:0x801B1AAC; // type:function size:0x14 fn_801B1AC0 = .text:0x801B1AC0; // type:function size:0x14 fn_801B1AD4 = .text:0x801B1AD4; // type:function size:0x120 DrawPrepare__15RPGrpModelSceneFPC11RPGrpCameraPC11RPGrpScreen = .text:0x801B1BF4; // type:function size:0x50 -fn_801B1C44 = .text:0x801B1C44; // type:function size:0x40 +g_calc_background__15RPGrpModelSceneFv = .text:0x801B1C44; // type:function size:0x40 fn_801B1C84 = .text:0x801B1C84; // type:function size:0x100 -fn_801B1D84 = .text:0x801B1D84; // type:function size:0x38 +CalcView__15RPGrpModelSceneFv = .text:0x801B1D84; // type:function size:0x38 fn_801B1DBC = .text:0x801B1DBC; // type:function size:0xC4 -fn_801B1E80 = .text:0x801B1E80; // type:function size:0x80 +__dt__15RPGrpModelSceneFv = .text:0x801B1E80; // type:function size:0x80 fn_801B1F00 = .text:0x801B1F00; // type:function size:0x4E0 fn_801B23E0 = .text:0x801B23E0; // type:function size:0x4 fn_801B23E4 = .text:0x801B23E4; // type:function size:0x40 @@ -8800,11 +8800,11 @@ fn_801D5744 = .text:0x801D5744; // type:function size:0x5C fn_801D57A0 = .text:0x801D57A0; // type:function size:0x34 fn_801D57D4 = .text:0x801D57D4; // type:function size:0x8 fn_801D57DC = .text:0x801D57DC; // type:function size:0x8 -fn_801D57E4 = .text:0x801D57E4; // type:function size:0xA4 -fn_801D5888 = .text:0x801D5888; // type:function size:0x130 -fn_801D59B8 = .text:0x801D59B8; // type:function size:0x1F8 -fn_801D5BB0 = .text:0x801D5BB0; // type:function size:0x1CC -fn_801D5D7C = .text:0x801D5D7C; // type:function size:0x58 +calcView__19RPSportsMenuBgModelFv = .text:0x801D57E4; // type:function size:0xA4 +initCamera__19RPSportsMenuBgModelFv = .text:0x801D5888; // type:function size:0x130 +createData__19RPSportsMenuBgModelFPQ23EGG7Archive = .text:0x801D59B8; // type:function size:0x1F8 +__ct__19RPSportsMenuBgModelFUcUcUs = .text:0x801D5BB0; // type:function size:0x1CC +__dt__19RPSportsMenuBgModelFv = .text:0x801D5D7C; // type:function size:0x58 fn_801D5DD4 = .text:0x801D5DD4; // type:function size:0x20 fn_801D5DF4 = .text:0x801D5DF4; // type:function size:0xA8 fn_801D5E9C = .text:0x801D5E9C; // type:function size:0xA8 @@ -17895,12 +17895,19 @@ __FilterSizeTable = .data:0x803AEAA0; // type:object size:0x100 scope:local __SinTableFixedPoint = .data:0x803AEBA0; // type:object size:0x200 scope:local align:8 __SrcTab12khz = .data:0x803AEDA0; // type:object size:0x800 scope:local align:8 @472 = .data:0x803AF5A0; // type:object size:0x37 scope:local align:4 data:string -lbl_803AF5D8 = .data:0x803AF5D8; // type:object size:0x15 data:string -lbl_803AF5F0 = .data:0x803AF5F0; // type:object size:0x98 -lbl_803AF688 = .data:0x803AF688; // type:object size:0x1B data:string -lbl_803AF6A4 = .data:0x803AF6A4; // type:object size:0x1D data:string -lbl_803AF6C4 = .data:0x803AF6C4; // type:object size:0x44 -lbl_803AF708 = .data:0x803AF708; // type:object size:0x12 data:string +@844 = .data:0x803AF5D8; // type:object size:0x15 data:string +@845 = .data:0x803AF5F0; // type:object size:0x18 data:string +@873 = .data:0x803AF608; // type:object size:0x15 data:string +@874 = .data:0x803AF620; // type:object size:0x13 data:string +@875 = .data:0x803AF634; // type:object size:0xC data:string +@917 = .data:0x803AF640; // type:object size:0x18 data:string +@918 = .data:0x803AF658; // type:object size:0x18 align:8 data:string +@919 = .data:0x803AF670; // type:object size:0x15 data:string +@966 = .data:0x803AF688; // type:object size:0x1B data:string +@967 = .data:0x803AF6A4; // type:object size:0x1D data:string +@987 = .data:0x803AF6C4; // type:object size:0x22 align:4 data:string +@1043 = .data:0x803AF6E8; // type:object size:0x1D data:string +@1157 = .data:0x803AF708; // type:object size:0x12 data:string lbl_803AF720 = .data:0x803AF720; // type:object size:0x3A data:string lbl_803AF75C = .data:0x803AF75C; // type:object size:0x2F data:string lbl_803AF790 = .data:0x803AF790; // type:object size:0x5D0 @@ -18674,8 +18681,8 @@ lbl_803BA550 = .data:0x803BA550; // type:object size:0xE data:string lbl_803BA560 = .data:0x803BA560; // type:object size:0xD data:string lbl_803BA570 = .data:0x803BA570; // type:object size:0xE data:string lbl_803BA580 = .data:0x803BA580; // type:object size:0xD data:string -lbl_803BA590 = .data:0x803BA590; // type:object size:0x1F data:string -lbl_803BA5B0 = .data:0x803BA5B0; // type:object size:0xD data:string +@STRING@setModifyRatio__Q23EGG7StateGXFf@0 = .data:0x803BA590; // type:object size:0x1F data:string +@STRING@setModifyRatio__Q23EGG7StateGXFf = .data:0x803BA5B0; // type:object size:0xD data:string lbl_803BA5C0 = .data:0x803BA5C0; // type:object size:0x2C lbl_803BA5EC = .data:0x803BA5EC; // type:object size:0xC lbl_803BA5F8 = .data:0x803BA5F8; // type:object size:0x10 @@ -18777,7 +18784,7 @@ lbl_803C1F78 = .data:0x803C1F78; // type:object size:0x28 lbl_803C1FA0 = .data:0x803C1FA0; // type:object size:0x38 lbl_803C1FD8 = .data:0x803C1FD8; // type:object size:0x28 lbl_803C2000 = .data:0x803C2000; // type:object size:0x38 -lbl_803C2038 = .data:0x803C2038; // type:object size:0xC +__vt__19RPSportsMenuBgModel = .data:0x803C2038; // type:object size:0xC lbl_803C2044 = .data:0x803C2044; // type:object size:0x22 data:string lbl_803C2068 = .data:0x803C2068; // type:object size:0x12 data:string lbl_803C2080 = .data:0x803C2080; // type:object size:0x20 @@ -19902,7 +19909,7 @@ lbl_804A4788 = .bss:0x804A4788; // type:object size:0xC align:4 data:float lbl_804A4794 = .bss:0x804A4794; // type:object size:0xC align:4 data:float lbl_804A47A0 = .bss:0x804A47A0; // type:object size:0xC align:4 data:float lbl_804A47AC = .bss:0x804A47AC; // type:object size:0x54 data:4byte -sGlobalMtx__17RPUtlShadowDrawer = .bss:0x804A4800; // type:object size:0x30 data:4byte +sCameraMtx__17RPUtlShadowDrawer = .bss:0x804A4800; // type:object size:0x30 data:4byte lbl_804A4830 = .bss:0x804A4830; // type:object size:0x18 data:4byte lbl_804A4848 = .bss:0x804A4848; // type:object size:0x20 data:4byte lbl_804A4868 = .bss:0x804A4868; // type:object size:0x18 align:4 data:float @@ -20464,7 +20471,7 @@ lbl_804BDBF0 = .sdata:0x804BDBF0; // type:object size:0x8 sSoundHeapSize__16RPSysHomeMenuMgr = .sdata:0x804BDBF8; // type:object size:0x4 data:4byte sSuccess__17RPSysNWC24Manager = .sdata:0x804BDC00; // type:object size:0x4 data:4byte lbl_804BDC08 = .sdata:0x804BDC08; // type:object size:0x4 data:4byte -lbl_804BDC0C = .sdata:0x804BDC0C; // type:object size:0x4 data:4byte +sRenderPass__13RPGrpRenderer = .sdata:0x804BDC0C; // type:object size:0x4 data:4byte lbl_804BDC10 = .sdata:0x804BDC10; // type:object size:0x8 align:4 data:float lbl_804BDC18 = .sdata:0x804BDC18; // type:object size:0x8 lbl_804BDC20 = .sdata:0x804BDC20; // type:object size:0x8 align:4 data:float @@ -21891,7 +21898,7 @@ sAddrWork__16RPSysCoreAddress = .sbss:0x804BF580; // type:object size:0x6 data:b lbl_804BF588__18RPSysLytDynamicAnm = .sbss:0x804BF588; // type:object size:0x4 align:4 data:4byte OUT_OF_SCREEN_POS__18RPSysCursorDrawMgr = .sbss:0x804BF590; // type:object size:0x8 align:4 data:float spInstance__18RPSysCursorDrawMgr = .sbss:0x804BF598; // type:object size:0x4 data:4byte -lbl_804BF5A0 = .sbss:0x804BF5A0; // type:object size:0x8 data:4byte +spInstance__17RPSysSystemWinMgr = .sbss:0x804BF5A0; // type:object size:0x8 data:4byte spInstance__16RPSysHomeMenuMgr = .sbss:0x804BF5A8; // type:object size:0x4 data:4byte spHomeMenuArcMgr__16RPSysHomeMenuMgr = .sbss:0x804BF5AC; // type:object size:0x4 data:4byte sIsBusy__15RPSysPairingMgr = .sbss:0x804BF5B0; // type:object size:0x1 data:byte @@ -21913,7 +21920,7 @@ spCurrent__17RPGrpModelManager = .sbss:0x804BF5F8; // type:object size:0x8 data: spCurrent__20RPGrpModelResManager = .sbss:0x804BF600; // type:object size:0x8 data:4byte lbl_804BF608 = .sbss:0x804BF608; // type:object size:0x8 data:4byte spCurrent__13RPGrpRenderer = .sbss:0x804BF610; // type:object size:0x4 data:4byte -lbl_804BF614 = .sbss:0x804BF614; // type:object size:0x1 data:byte +sRendering__13RPGrpRenderer = .sbss:0x804BF614; // type:object size:0x1 data:byte lbl_804BF615 = .sbss:0x804BF615; // type:object size:0x1 data:byte gap_11_804BF616_sbss = .sbss:0x804BF616; // type:object size:0x2 scope:global spCurrentView__13RPGrpRenderer = .sbss:0x804BF618; // type:object size:0x4 data:4byte @@ -23640,8 +23647,8 @@ lbl_804C1888 = .sdata2:0x804C1888; // type:object size:0x1 data:byte lbl_804C1889 = .sdata2:0x804C1889; // type:object size:0x1 data:byte lbl_804C188A = .sdata2:0x804C188A; // type:object size:0x1 data:byte lbl_804C188B = .sdata2:0x804C188B; // type:object size:0x1 data:byte -lbl_804C188C = .sdata2:0x804C188C; // type:object size:0x4 align:4 data:float -lbl_804C1890 = .sdata2:0x804C1890; // type:object size:0x8 align:4 data:float +@26961 = .sdata2:0x804C188C; // type:object size:0x4 align:4 data:float +@26962 = .sdata2:0x804C1890; // type:object size:0x4 align:4 data:float @16652 = .sdata2:0x804C1898; // type:object size:0x4 scope:local align:4 data:float lbl_804C18A0 = .sdata2:0x804C18A0; // type:object size:0x1 data:byte lbl_804C18A1 = .sdata2:0x804C18A1; // type:object size:0x1 data:byte diff --git a/configure.py b/configure.py index 4660adf5f..4f18e1adf 100755 --- a/configure.py +++ b/configure.py @@ -1276,13 +1276,15 @@ def MatchingFor(*versions): Object(Matching, "Pack/RPGraphics/RPGrpCamera.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpDrawPathManager.cpp"), Object(Matching, "Pack/RPGraphics/RPGrpLightManager.cpp"), - Object(Matching, "Pack/RPGraphics/RPGrpModel.cpp"), + Object(not MatchingFor("RSPE01_00"), "Pack/RPGraphics/RPGrpModel.cpp"), Object(not MatchingFor("RSPE01_00"), "Pack/RPGraphics/RPGrpModelAnm.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpModelAnmImplement.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpModelImplement.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpModelMisc.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpModelManager.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpModelResManager.cpp"), + Object(NonMatching, "Pack/RPGraphics/RPGrpCpuTexture.cpp"), + Object(NonMatching, "Pack/RPGraphics/RPGrpFog.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpRenderer.cpp"), Object(Matching, "Pack/RPGraphics/RPGrpScreen.cpp"), Object(NonMatching, "Pack/RPGraphics/RPGrpView.cpp"), diff --git a/include/Pack/RPGraphics.h b/include/Pack/RPGraphics.h index 87c6b3d33..ffc9041df 100644 --- a/include/Pack/RPGraphics.h +++ b/include/Pack/RPGraphics.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/include/Pack/RPGraphics/RPGrpCamera.h b/include/Pack/RPGraphics/RPGrpCamera.h index 27f6d845b..192a00b23 100644 --- a/include/Pack/RPGraphics/RPGrpCamera.h +++ b/include/Pack/RPGraphics/RPGrpCamera.h @@ -154,6 +154,19 @@ class RPGrpCamera { void LoadScnCameraMatrix(const nw4r::g3d::ResAnmScn scn, u8 refNumber, f32 frame = 0.0f); + /** + * @brief Getter for position + * + * @return nw4r::math::VEC3 Camera position + */ + nw4r::math::VEC3 GetPosition() { + return mPosition; + } + + void SetPosition(nw4r::math::VEC3 newPos) { + mPosition = newPos; + } + /** * @brief Sets the type of this camera * diff --git a/include/Pack/RPGraphics/RPGrpCpuTexture.h b/include/Pack/RPGraphics/RPGrpCpuTexture.h new file mode 100644 index 000000000..bc48b1e16 --- /dev/null +++ b/include/Pack/RPGraphics/RPGrpCpuTexture.h @@ -0,0 +1,156 @@ +#ifndef RP_GRAPHICS_CPU_TEXTURE_H +#define RP_GRAPHICS_CPU_TEXTURE_H + +#include + +#include + +#include + +//! TODO(texline) Confirm this + +/** + * @note Superseded by EGG::CpuTexture in rev 1. + */ +class RPGrpCpuTexture { +private: + u16 mFlags; // at 0x0 + u16 mWidth; // at 0x2 + u16 mHeight; // at 0x4 + u8 mFormat; // at 0x6 + u8 mWrapS; // at 0x7 + u8 mWrapT; // at 0x8 + u8 mMinFilter; // at 0x9 + u8 mMagFilter; // at 0xA + char UNK_0xB[0x10 - 0xB]; + void* mpBuffer; // at 0x10 + +public: + enum EGradationKind { + GRADATION_LINEAR, // y=x + GRADATION_QUADRATIC, // y=x^2 + GRADATION_CUBIC, // y=x^3 + GRADATION_QUARTIC, // y=x^4 + GRADATION_QUINTIC, // y=x^5 + GRADATION_QUADRATIC_EASEOUT, // y=1-(1-x)^2 + GRADATION_QUARTIC_EASEOUT, // y=1-(1-x)^4 + }; + +public: + //! @bug Texture buffer is leaked + virtual ~RPGrpCpuTexture() {} // at 0x8 + virtual void configure(); // at 0xC + virtual void getTexObj(GXTexObj* pObj) const; // at 0x10 + virtual void load(GXTexMapID map); // at 0x14 + + RPGrpCpuTexture(); + RPGrpCpuTexture(u16 width, u16 height, GXTexFmt format); + + void alloc(); + void allocWithHeaderDebug(); + + RPGrpResTIMG* getResTIMG() const; + u32 getTexBufferSize() const; + + void fillNormalMapSphere(); + void fillGradationTable(EGradationKind kind, int dir, u16 tableStart, + u16 tableGoal, const GXColor& c1, const GXColor& c2, + bool wrap, bool setAll); + + void setColor(u16 x, u16 y, GXColor color); + + void invalidate() const; + void flush() const; + + bool checkIsConfigure() const { + return testFlag(cFlag_Configured); + } + bool checkHasHeader() const { + return testFlag(cFlag_HasHeader); + } + + void setFlag(u8 flag) { + mFlags |= flag; + } + void clearFlag(u8 flag) { + mFlags &= ~flag; + } + bool testFlag(u8 flag) const { + return (mFlags & flag) ? true : false; + } + + u16 getWidth() const { + return mWidth; + } + void setWidth(u16 w) { + mWidth = w; + } + + u16 getHeight() const { + return mHeight; + } + void setHeight(u16 h) { + mHeight = h; + } + + GXTexFmt getFormat() const { + return static_cast(mFormat); + } + void setFormat(GXTexFmt format) { + mFormat = format; + } + + GXTexWrapMode getWrapS() const { + return static_cast(mWrapS); + } + void setWrapS(u8 wrap) { + mWrapS = wrap; + } + + GXTexWrapMode getWrapT() const { + return static_cast(mWrapT); + } + void setWrapT(u8 wrap) { + mWrapT = wrap; + } + + GXTexFilter getMinFilter() const { + return static_cast(mMinFilter); + } + void setMinFilter(u8 filter) { + mMinFilter = filter; + } + + GXTexFilter getMagFilter() const { + return static_cast(mMagFilter); + } + void setMagFilter(u8 filter) { + mMagFilter = filter; + } + + void* getBuffer() const { + return mpBuffer; + } + void setBuffer(void* pBuffer) { + mpBuffer = pBuffer; + clearFlag(cFlag_HasHeader); + } + +private: + enum { + cFlag_Configured = 1 << 0, + cFlag_HasHeader = 1 << 1, + }; + +private: + void initResTIMG() const; + + RPGrpResTIMG* getHeader() const { + // clang-format off + return reinterpret_cast( + reinterpret_cast(mpBuffer) - sizeof(RPGrpResTIMG)); + // clang-format on + } +}; + +#endif diff --git a/include/Pack/RPGraphics/RPGrpModel.h b/include/Pack/RPGraphics/RPGrpModel.h index 87bb930b5..2480bee72 100644 --- a/include/Pack/RPGraphics/RPGrpModel.h +++ b/include/Pack/RPGraphics/RPGrpModel.h @@ -53,15 +53,38 @@ class RPGrpModel { }; protected: +#if defined(VERSION_RSPE01_00) + u8 unk0; + u8 unk1; + u16 mFlags; + u16 unk4; + u32 unkFlag; + RPGrpModel* mpEntryNext; // at 0xC + RPGrpModel* mpGenNext; // at 0x10 + nw4r::math::MTX34 mtx14; + nw4r::math::VEC3 mBaseScale; // at 0x44 + RPGrpModelAnm* mpModelAnm; // at 0x50 + RPGrpModelMaterial** mppMaterials; // at 0x54 + RPGrpModelBoundingInfo* mpBoundingInfo; // at 0x58 + RPGrpModelRecord* mpRecord; // at 0x5C + BOOL mReverseCulling; // at 0x60 + IRPGrpModelCallback* mpCallback; // at 0x64 + u8 mDrawScene; // at 0x68 + u8 mDrawGroup; // at 0x69 + u8 mViewNo; // at 0x6A + u8 padding; + u32 unk6C; + +#elif defined(VERSION_RSPE01_01) u8 mViewNo; // at 0x0 u8 mDrawScene; // at 0x1 u8 mDrawGroup; // at 0x2 - char unk3; + u8 unk3; char unk4; char unk5[0x8 - 0x5]; u16 mFlags; // at 0x8 u16 unkA; - u32 unkC; + u32 unkFlag; u32 unk10; RPGrpModel* mpEntryNext; // at 0x14 RPGrpModel* mpGenNext; // at 0x18 @@ -73,6 +96,7 @@ class RPGrpModel { RPGrpModelRecord* mpRecord; // at 0x38 BOOL mReverseCulling; // at 0x3C EGG::ModelEx* mpModelEx; // at 0x40 +#endif public: static RPGrpModel* Construct(RPGrpHandle handle, u8 viewNo, u32 typeOption, @@ -135,9 +159,15 @@ class RPGrpModel { nw4r::math::MTX34* pMtx) const = 0; // at 0x48 virtual void GetViewMtx(nw4r::math::MTX34* pMtx) const = 0; // at 0x4C +#if defined(VERSION_RSPE01_00) virtual u16 GetJointNum() const { // at 0x50 + return 0; // stubbed in rev 0 + } +#elif defined(VERSION_RSPE01_01) + virtual u16 GetJointNum() const { return mpModelEx->getNumNode(); } +#endif virtual const char* GetJointName(u16 idx) const = 0; // at 0x54 virtual u16 GetJointIndex(const char* pName) const = 0; // at 0x58 @@ -146,24 +176,39 @@ class RPGrpModel { virtual const char* GetMaterialName(u16 idx) const = 0; // at 0x60 virtual u16 GetMaterialIndex(const char* pName) const = 0; // at 0x64 +#if defined(VERSION_RSPE01_00) + virtual u16 GetShapeNum() const { // at 0x68 + return 0; + } +#elif defined(VERSION_RSPE01_01) virtual u16 GetShapeNum() const { // at 0x68 return mpModelEx->getNumShape(); } +#endif virtual const char* GetShapeName(u16 idx) const = 0; // at 0x6C virtual u16 GetShapeIndex(const char* pName) const = 0; // at 0x70 +#if defined(VERSION_RSPE01_00) + virtual u16 GetViewMtxNum() const { // at 0x74 + return 0; + } +#elif defined(VERSION_RSPE01_01) virtual u16 GetViewMtxNum() const { // at 0x74 return mpModelEx->getNumViewMtx(); } +#endif +#if defined(VERSION_RSPE01_01) virtual void DrawDirect(u32 drawFlag, nw4r::math::MTX34* pViewMtx) { // at 0x78 mpModelEx->drawShapeDirectly(drawFlag, true, true, pViewMtx); } +#endif virtual void CalcMaterial(); // at 0x7C +#if defined(VERSION_RSPE01_01) virtual void CalcBeforeDraw() { // at 0x80 mpModelEx->setVisible(mFlags & EFlag_Visible); } @@ -181,6 +226,7 @@ class RPGrpModel { const_cast(&rViewMtx)); } } +#endif void RemoveGenList(); void CreateMaterial(u16 idx); @@ -190,6 +236,15 @@ class RPGrpModel { void Calc(); void Entry(); +//! This is a bit hacky, but it's meant for nw4r functions +//! that require a pointer, not the matrix itself (texline) +#if defined(VERSION_RSPE01_00) + nw4r::math::MTX34* GetMtxPtr() { + return &mtx14; + } +#endif + +#if defined(VERSION_RSPE01_01) EGG::ModelEx* GetModelEx() const { return mpModelEx; } @@ -213,6 +268,11 @@ class RPGrpModel { nw4r::g3d::ScnRfl* GetScnRfl() const { return mpModelEx->getScnRfl(); } +#endif + + RPGrpModelAnm* GetModelAnm() const { + return mpModelAnm; + } const nw4r::math::VEC3& GetBaseScale() const { return mBaseScale; @@ -243,6 +303,22 @@ class RPGrpModel { return (mFlags & EFlag_Visible) ? true : false; } + u8 GetDrawScene() const { + return mDrawScene; + } + + void SetDrawScene(u8 drawScene) { + mDrawScene = drawScene; + } + + u8 GetUnk4() const { + return unk4; + } + + u8 GetDrawGroup() const { + return mDrawGroup; + } + /** * @brief Gets the allocator used for model-related allocations */ @@ -266,10 +342,12 @@ class RPGrpModel { virtual void CreateAnm() = 0; // at 0x90 virtual void InternalCalc() = 0; // at 0x94 +#if defined(VERSION_RSPE01_01) virtual void GetShapeMinMax(u16 shapeIdx, nw4r::math::VEC3* pMin, nw4r::math::VEC3* pMax) const { // at 0x98 mpModelEx->getShapeMinMax(shapeIdx, pMin, pMax, false); } +#endif protected: enum { diff --git a/include/Pack/RPGraphics/RPGrpModelAnm.h b/include/Pack/RPGraphics/RPGrpModelAnm.h index 314c6169f..6ebb60de4 100644 --- a/include/Pack/RPGraphics/RPGrpModelAnm.h +++ b/include/Pack/RPGraphics/RPGrpModelAnm.h @@ -133,6 +133,12 @@ class RPGrpModelAnm { } } +#if defined(VERSION_RSPE01_00) + virtual void Calc(); +#elif defined(VERSION_RSPE01_01) + void Calc(); +#endif + virtual void SetEnableChrAnm(bool enable) { // at 0x68 if (!enable) { mFlags |= Flag_DisableChrAnm; @@ -151,8 +157,6 @@ class RPGrpModelAnm { void CreateBuffer(Anm anm, u16 num); - void Calc(); - s8 GetBlendIndex(Anm anm, AnmIdx idx, u8); void InternalRegist(Anm anm, u16 idx); diff --git a/include/Pack/RPGraphics/RPGrpModelG3D.h b/include/Pack/RPGraphics/RPGrpModelG3D.h index aa2febc9d..fcabd43c2 100644 --- a/include/Pack/RPGraphics/RPGrpModelG3D.h +++ b/include/Pack/RPGraphics/RPGrpModelG3D.h @@ -39,6 +39,7 @@ class RPGrpModelG3D : public RPGrpModel, virtual IRPGrpModelCallback* SetCallback(IRPGrpModelCallback* pCallback) override; // at 0x18 +#if defined(VERSION_RSPE01_01) virtual void SetCallbackJointIndex(u16 idx) override { // at 0x24 GetScnMdlSimple()->SetScnMdlCallbackNodeID(idx); } @@ -114,6 +115,7 @@ class RPGrpModelG3D : public RPGrpModel, virtual void Configure() override; // at 0x8C virtual void CreateAnm() override; // at 0x90 virtual void InternalCalc() override; // at 0x94 +#endif virtual void ExecCallback_CALC_WORLD(nw4r::g3d::ScnObj::Timing timing, nw4r::g3d::ScnObj* pObj, u32 param, diff --git a/include/Pack/RPGraphics/RPGrpModelRfl.h b/include/Pack/RPGraphics/RPGrpModelRfl.h index cc15f6746..04b4e4b74 100644 --- a/include/Pack/RPGraphics/RPGrpModelRfl.h +++ b/include/Pack/RPGraphics/RPGrpModelRfl.h @@ -49,6 +49,7 @@ class RPGrpModelRfl : public RPGrpModel, public nw4r::g3d::IScnObjCallback { return 0; } +#if defined(VERSION_RSPE01_01) virtual void GetWorldMtx(u16 /* idx */, nw4r::math::MTX34* pMtx) const override { // at 0x3C @@ -61,12 +62,14 @@ class RPGrpModelRfl : public RPGrpModel, public nw4r::g3d::IScnObjCallback { GetWorldMtx(u16 /* nodeIdx */) const override { // at 0x40 return GetScnObj()->GetMtxPtr(nw4r::g3d::ScnObj::MTX_LOCAL); } +#endif virtual nw4r::math::MTX34* ReferWorldMtx(u16 /* nodeIdx */) const override { // at 0x44 return &spCalcWorldMtxArray[0]; } +#if defined(VERSION_RSPE01_01) virtual void GetViewMtx(nw4r::math::MTX34* pMtx) const override { // at 0x4C GetScnObj()->GetMtx(nw4r::g3d::ScnObj::MTX_VIEW, pMtx); } @@ -75,6 +78,7 @@ class RPGrpModelRfl : public RPGrpModel, public nw4r::g3d::IScnObjCallback { nw4r::math::MTX34* pMtx) const override { // at 0x48 GetViewMtx(pMtx); } +#endif virtual const char* GetJointName(u16 idx) const override; // at 0x54 diff --git a/include/Pack/RPGraphics/RPGrpModelScene.h b/include/Pack/RPGraphics/RPGrpModelScene.h index 2f4fed433..d86ff2b4a 100644 --- a/include/Pack/RPGraphics/RPGrpModelScene.h +++ b/include/Pack/RPGraphics/RPGrpModelScene.h @@ -2,6 +2,10 @@ #define RP_GRAPHICS_MODEL_SCENE_H #include +#include + +#include + //! @addtogroup rp_graphics //! @{ @@ -14,7 +18,18 @@ class RPGrpScreen; */ class RPGrpModelScene { private: - char unk00[0xA4]; + char unk00[0x2]; + char mIdx; // at 0x2 + char unk03; + u8 unk04; + char unk05[0x3]; + u8 unk08; + char unk09[0x3]; + EGG::LightManager* mpLightManager; // at 0xC + EGG::FogManager* mpFogManager; // at 0x10 + char unk14[0x88]; + EGG::ScnRootEx* mpScnRootEx; // at 0x9C + char unkA0[0x4]; public: virtual ~RPGrpModelScene(); // at 0x8 @@ -24,7 +39,17 @@ class RPGrpModelScene { virtual void DrawFinish(); // at 0x18 virtual void PreConditionForRenderingGX() const; // at 0x1C + void g_calc_background(); + void DrawPrepare(const RPGrpCamera* pCamera, const RPGrpScreen* pScreen); + + void setDrawPriority(RPGrpModel* pModel) const; + + /** + * @brief Initializes a scene's projection matrix, + * ambient lights, and fog GX + */ + void setupGX() const; }; //! @} diff --git a/include/Pack/RPGraphics/RPGrpRenderer.h b/include/Pack/RPGraphics/RPGrpRenderer.h index 24fd2ed83..bbc8c9c46 100644 --- a/include/Pack/RPGraphics/RPGrpRenderer.h +++ b/include/Pack/RPGraphics/RPGrpRenderer.h @@ -2,6 +2,9 @@ #define RP_GRAPHICS_RENDERER_H #include +#include +#include + #include //! @addtogroup rp_graphics @@ -17,8 +20,27 @@ class RPGrpView; */ class RPGrpRenderer { public: + enum RenderPassState { + RENDERPASS_SYSCALC, + RENDERPASS_SYSDRAW, + RENDERPASS_DRAWBEFORE, + RENDERPASS_DRAW, + RENDERPASS_DRAWDONE, + RENDERPASS_DRAW2D, + RENDERPASS_3DOPA, + RENDERPASS_3DXLU, + RENDERPASS_SVBEFORE, + RENDERPASS_SV, + RENDERPASS_EFFECT_2, + RENDERPASS_BEGIN, + RENDERPASS_END, + RENDERPASS_NULL, + }; + //! Maximum number of renderer views static const int MAX_VIEW = 32; + static bool sRendering; + static RenderPassState sRenderPass; public: /** @@ -46,6 +68,9 @@ class RPGrpRenderer { return spCurrentScreen; } + /** + * @brief Sets up a GX context for rendering + */ static void Begin(); static void End(); @@ -62,6 +87,9 @@ class RPGrpRenderer { AppendDrawObject(&rObject); } + RPGrpViewRender3D* CreateView3D(u8 viewNo, RPGrpCamera* camera, + RPGrpScreen* screen); + void PreCalculate(); void PostCalculate(); void CalculateInPause(); @@ -76,8 +104,8 @@ class RPGrpRenderer { static RPGrpScreen* spCurrentScreen; char unk0[0xC]; - IRPGrpDrawObject* mpDrawList; // at 0xC - char unk10[0x14 - 0x10]; + IRPGrpDrawObject* mpDrawList; // at 0xC + IRPGrpDrawObject* mpDrawObj; // at 0x10 RPGrpView* mpDrawViews[MAX_VIEW]; // at 0x14 }; diff --git a/include/Pack/RPGraphics/RPGrpResTIMG.h b/include/Pack/RPGraphics/RPGrpResTIMG.h new file mode 100644 index 000000000..1cf745878 --- /dev/null +++ b/include/Pack/RPGraphics/RPGrpResTIMG.h @@ -0,0 +1,39 @@ +#ifndef RP_GRAPHICS_RES_TIMG_H +#define RP_GRAPHICS_RES_TIMG_H +#include + +/** + * @note Superseded by EGG::ResTIMG in rev 1. + */ +struct RPGrpResTIMG { + + enum JUTTransparency { + JUT_TRANSPARENCY_DISABLE, + JUT_TRANSPARENCY_ENABLE, + }; + + u8 format; // at 0x0 + u8 transparency; // at 0x1 + u16 width; // at 0x2 + u16 height; // at 0x4 + u8 wrapS; // at 0x6 + u8 wrapT; // at 0x7 + u8 tlutName; // at 0x8 + u8 tlutFormat; // at 0x9 + u16 paletteEntryNum; // at 0xA + s32 paletteOffset; // at 0xC + u8 mipMap; // at 0x10 + u8 edgeLODEnable; // at 0x11 + u8 biasClampEnable; // at 0x12 + u8 anisotropy; // at 0x13 + u8 minFilter; // at 0x14 + u8 magFilter; // at 0x15 + s8 minLOD; // at 0x16 + s8 maxLOD; // at 0x17 + u8 mipMapLevel; // at 0x18 + u8 BYTE_0x19; + s16 LODBias; // at 0x1A + s32 imageOffset; // at 0x1C +}; + +#endif diff --git a/include/egg/gfxe/eggFogManager.h b/include/egg/gfxe/eggFogManager.h index 887ea665d..202d4c7e7 100644 --- a/include/egg/gfxe/eggFogManager.h +++ b/include/egg/gfxe/eggFogManager.h @@ -29,6 +29,10 @@ class FogManager { void LoadScnFog(const nw4r::g3d::ResAnmScn scn, f32 frame); void DoneDraw(); + Fog* GetFog(int id) { + return mFog[id]; + } + private: enum { cFlag_CalcDone = 1 << 2, diff --git a/include/egg/gfxe/eggLightManager.h b/include/egg/gfxe/eggLightManager.h index 07d3c08aa..2c1748708 100644 --- a/include/egg/gfxe/eggLightManager.h +++ b/include/egg/gfxe/eggLightManager.h @@ -26,6 +26,19 @@ class LightManager : IBinary { void Calc(nw4r::g3d::ScnRoot*); void CalcView(const nw4r::math::MTX34&, u8, nw4r::g3d::ScnRoot*); + /** + * @brief Sets ambient color registers + * + * @details Channel 0 is set to current value of m_pAmbColor0, + * while channel 1 is set to black + */ + void SetChanAmbColor() const; + + /** + * @brief Loads light registers with contents of array index + */ + void LoadObjIndxGX() const; + void DoneDraw(); void LoadScnLightInner(nw4r::g3d::ResAnmScn, f32, u32); @@ -50,7 +63,8 @@ class LightManager : IBinary { u16 m_numLight; // at 0x4 char UNK_0x8[0xC - 0x8]; LightObj** m_ppLightSet; // at 0xC - char UNK_0X10[0x18 - 0x10]; + GXColor* m_pAmbColor0; // at 0x10 + char UNK_0X14[0x18 - 0x14]; u8 m_viewNum; // at 0x18 u8 m_currentView; // at 0x19 char UNK_0x1A[0x20 - 0x1A]; diff --git a/include/egg/gfxe/eggLightObject.h b/include/egg/gfxe/eggLightObject.h index 263b83e3e..6f8e26ad7 100644 --- a/include/egg/gfxe/eggLightObject.h +++ b/include/egg/gfxe/eggLightObject.h @@ -5,6 +5,8 @@ #include #include +#include + #include namespace EGG { @@ -44,13 +46,29 @@ class LightObject : IBinary { void Reset(); void Calc(); + /** + * @brief Calculates direction vectors using camera viewpoint + * + * @param rCameraMtx Matrix used for creating position vector + */ void CalcView(const nw4r::math::MTX34& rCameraMtx); void CalcFinalDirColor(const EGG::LightTexture& rTexture, nw4r::math::VEC3* pDir, GXColor* pColor); + void InitGX(GXLightObj* pObj) const; + + void CopyToG3D_World(nw4r::g3d::ScnRoot& pScnRoot) const; + + void CopyFromG3D(nw4r::g3d::LightAnmResult* pResult, f32 frame); + void CalcDirDist(); + /** + * @brief Calculates attenuation for light object + */ + void CalcAt(); + void SetPosAt(const nw4r::math::VEC3& rPos, const nw4r::math::VEC3& rAt); private: @@ -74,9 +92,9 @@ class LightObject : IBinary { private: u16 mAmbIndex; // at 0x4 - Vector3f mAt; // at 0x8 - Vector3f mPos; // at 0x14 - Vector3f mDir; // at 0x20 + nw4r::math::VEC3 mAt; // at 0x8 + nw4r::math::VEC3 mPos; // at 0x14 + nw4r::math::VEC3 mDir; // at 0x20 GXColor mBrightnessColor; // at 0x2C f32 mIntensity; // at 0x30 LightType mLightType; // at 0x34 diff --git a/include/egg/gfxe/eggLightTexture.h b/include/egg/gfxe/eggLightTexture.h index 6d5f930a6..fac80854c 100644 --- a/include/egg/gfxe/eggLightTexture.h +++ b/include/egg/gfxe/eggLightTexture.h @@ -1,9 +1,9 @@ #ifndef EGG_GFXE_LIGHT_TEXTURE_H #define EGG_GFXE_LIGHT_TEXTURE_H -#include "eggCapTexture.h" -#include "eggIBinary.h" -#include "eggScreen.h" -#include "types_egg.h" +#include + +#include +#include namespace EGG { class LightTexture : public CapTexture, public IBinary { diff --git a/include/egg/gfxe/eggPostEffectBlur.h b/include/egg/gfxe/eggPostEffectBlur.h index 5949ddfcd..0869184d7 100644 --- a/include/egg/gfxe/eggPostEffectBlur.h +++ b/include/egg/gfxe/eggPostEffectBlur.h @@ -1,8 +1,9 @@ #ifndef EGG_GFXE_POST_EFFECT_BLUR_H #define EGG_GFXE_POST_EFFECT_BLUR_H -#include "eggAssert.h" -#include "eggPostEffectBase.h" -#include "types_egg.h" +#include + +#include +#include namespace EGG { class PostEffectBlur : public PostEffectBase { diff --git a/include/egg/gfxe/eggPostEffectBlurGather.h b/include/egg/gfxe/eggPostEffectBlurGather.h index 3408905b3..6805d54c4 100644 --- a/include/egg/gfxe/eggPostEffectBlurGather.h +++ b/include/egg/gfxe/eggPostEffectBlurGather.h @@ -1,9 +1,10 @@ #ifndef EGG_GFXE_POST_EFFECT_BLUR_GATHER_H #define EGG_GFXE_POST_EFFECT_BLUR_GATHER_H -#include "eggAssert.h" -#include "eggDrawGX.h" -#include "eggPostEffectBase.h" -#include "types_egg.h" +#include + +#include +#include +#include namespace EGG { class PostEffectBlurGather : public PostEffectBase { diff --git a/include/egg/gfxe/eggPostEffectBlurSimple.h b/include/egg/gfxe/eggPostEffectBlurSimple.h index 011661b7b..c682b920d 100644 --- a/include/egg/gfxe/eggPostEffectBlurSimple.h +++ b/include/egg/gfxe/eggPostEffectBlurSimple.h @@ -1,7 +1,8 @@ #ifndef EGG_GFXE_POST_EFFECT_BLUR_SIMPLE_H #define EGG_GFXE_POST_EFFECT_BLUR_SIMPLE_H -#include "eggPostEffectBase.h" -#include "types_egg.h" +#include + +#include namespace EGG { diff --git a/include/egg/gfxe/eggScnRootEx.h b/include/egg/gfxe/eggScnRootEx.h index 3d5286937..a6890a941 100644 --- a/include/egg/gfxe/eggScnRootEx.h +++ b/include/egg/gfxe/eggScnRootEx.h @@ -58,6 +58,9 @@ class ScnRootEx : public IDrawGX { void SetCurrentCamera(int idx, const nw4r::math::MTX34& rCameraMtx, const Screen& rScreen); + /** + * @brief Calculates view matrices for each 3D object in scene + */ void CalcView(); void GatherDrawScnObj(); diff --git a/include/egg/gfxe/eggScreen.h b/include/egg/gfxe/eggScreen.h index d3587f86d..bab637f51 100644 --- a/include/egg/gfxe/eggScreen.h +++ b/include/egg/gfxe/eggScreen.h @@ -46,7 +46,10 @@ class Screen : public Frustum { CanvasMode canvasMode); Screen(const Screen& rOther); - virtual ~Screen() {} // at 0x8 + virtual ~Screen() {} // at 0x8 + /** + * @brief Sets projection matrix + */ virtual void SetProjectionGX() const; // at 0xC virtual void CopyToG3D(nw4r::g3d::Camera camera) const; // at 0x10 diff --git a/include/egg/gfxe/eggShadowTexture.h b/include/egg/gfxe/eggShadowTexture.h index 88614419b..076943325 100644 --- a/include/egg/gfxe/eggShadowTexture.h +++ b/include/egg/gfxe/eggShadowTexture.h @@ -1,8 +1,9 @@ #ifndef EGG_GFXE_SHADOW_TEXTURE_H #define EGG_GFXE_SHADOW_TEXTURE_H -#include "eggModelSnapshot.h" -#include "eggPostEffectBase.h" -#include "types_egg.h" +#include + +#include +#include namespace EGG { class ShadowTexture : public ModelSnapshot { diff --git a/include/egg/gfxe/eggShadowTextureManager.h b/include/egg/gfxe/eggShadowTextureManager.h index bce076e38..b39e23eb3 100644 --- a/include/egg/gfxe/eggShadowTextureManager.h +++ b/include/egg/gfxe/eggShadowTextureManager.h @@ -1,6 +1,6 @@ #ifndef EGG_GFXE_SHADOW_TEXTURE_MANAGER_H #define EGG_GFXE_SHADOW_TEXTURE_MANAGER_H -#include "types_egg.h" +#include namespace EGG { diff --git a/include/egg/gfxe/eggStateGX.h b/include/egg/gfxe/eggStateGX.h index 51f2d36c8..9338615ee 100644 --- a/include/egg/gfxe/eggStateGX.h +++ b/include/egg/gfxe/eggStateGX.h @@ -1,5 +1,7 @@ #ifndef EGG_GFXE_STATE_GX_H #define EGG_GFXE_STATE_GX_H +#include + #include #include @@ -107,6 +109,15 @@ class StateGX { s_heightEfb = height; } + static f32 getModifyRatio() { + return s_modifyRatio; + } + static void setModifyRatio(f32 modify) { +#line 261 + EGG_ASSERT(0.f <= modify && modify <= 1.f); + s_modifyRatio = modify; + } + private: struct GXCache { u32 flags; // at 0x0 diff --git a/include/egg/math/eggMatrix.h b/include/egg/math/eggMatrix.h index d3e4fbc16..84a4879fe 100644 --- a/include/egg/math/eggMatrix.h +++ b/include/egg/math/eggMatrix.h @@ -76,7 +76,10 @@ class Matrix34f : public nw4r::math::MTX34 { f32 z = _20 * rVec.x + _21 * rVec.y + _22 * rVec.z; return Vector3f(x, y, z); } - + /** + * @brief Creates a 3x4 identity matrix. As identity matrices are + * square, the fourth column is zeroed out. + */ void makeIdentity(); void makeQ(const Quatf& rQuat); diff --git a/src/Pack/RPGraphics/RPGrpCpuTexture.cpp b/src/Pack/RPGraphics/RPGrpCpuTexture.cpp new file mode 100644 index 000000000..721063bf3 --- /dev/null +++ b/src/Pack/RPGraphics/RPGrpCpuTexture.cpp @@ -0,0 +1,228 @@ +#include + +RPGrpCpuTexture::RPGrpCpuTexture() + : mFlags(NULL), + mWrapT(GX_CLAMP), + mWrapS(GX_CLAMP), + mMagFilter(GX_LINEAR), + mMinFilter(GX_LINEAR) {} + +void blendColor(GXColor* pColor, const GXColor& c1, const GXColor& c2, + f32 scale) { + + if (scale <= 0.0f) { + *pColor = c1; + } else if (scale >= 1.0f) { + *pColor = c2; + } else { + pColor->r = c1.r + scale * (c2.r - c1.r); + pColor->g = c1.g + scale * (c2.g - c1.g); + pColor->b = c1.b + scale * (c2.b - c1.b); + pColor->a = c1.a + scale * (c2.a - c1.a); + } +} + +void makeGradationTable(RPGrpCpuTexture::EGradationKind kind, GXColor* pTable, + u16 tableSize, u16 tableStart, u16 tableGoal, + const GXColor& c1, const GXColor& c2) { + + for (int i = 0; i < tableStart + 1; i++) { + pTable[i] = c1; + } + + for (int i = tableGoal - 1; i < tableSize; i++) { + pTable[i] = c2; + } + + for (int i = tableStart + 1; i < tableGoal - 1; i++) { + f32 scale = static_cast(i - tableStart) / + static_cast(tableGoal - tableStart); + + switch (kind) { + case RPGrpCpuTexture::GRADATION_LINEAR: { + break; + } + + case RPGrpCpuTexture::GRADATION_QUADRATIC: { + scale *= scale; + break; + } + + case RPGrpCpuTexture::GRADATION_CUBIC: { + scale *= scale; + scale *= scale; + break; + } + + case RPGrpCpuTexture::GRADATION_QUARTIC: { + scale *= scale; + scale *= scale; + scale *= scale; + break; + } + + case RPGrpCpuTexture::GRADATION_QUINTIC: { + scale *= scale; + scale *= scale; + scale *= scale; + scale *= scale; + break; + } + + case RPGrpCpuTexture::GRADATION_QUADRATIC_EASEOUT: { + f32 minusOne = scale - 1.0f; + scale = -minusOne * minusOne + 1.0f; + break; + } + + case RPGrpCpuTexture::GRADATION_QUARTIC_EASEOUT: { + f32 minusOne = scale - 1.0f; + scale = -minusOne * minusOne * minusOne * minusOne + 1.0f; + break; + } + } + + blendColor(&pTable[i], c1, c2, scale); + } +} + +void RPGrpCpuTexture::configure() { + mFlags = cFlag_Configured; +} + +void RPGrpCpuTexture::getTexObj(GXTexObj* pObj) const { + GXInitTexObj(pObj, getBuffer(), getWidth(), getHeight(), getFormat(), + getWrapS(), getWrapT(), GX_FALSE); + + GXInitTexObjLOD(pObj, getMinFilter(), getMagFilter(), 0.0f, 0.0f, 0.0f, + GX_FALSE, GX_FALSE, GX_ANISO_1); +} + +void RPGrpCpuTexture::load(GXTexMapID map) { + GXTexObj obj; + getTexObj(&obj); + + GXLoadTexObj(&obj, map); +} + +void RPGrpCpuTexture::invalidate() const { + DCInvalidateRange(mpBuffer, getTexBufferSize()); +} + +void RPGrpCpuTexture::flush() const { + DCFlushRange(mpBuffer, getTexBufferSize()); +} + +u32 RPGrpCpuTexture::getTexBufferSize() const { + return GXGetTexBufferSize(getWidth(), getHeight(), getFormat(), GX_FALSE, + 1); +} + +void RPGrpCpuTexture::initResTIMG() const { + RPGrpResTIMG* pHeader = getHeader(); + + pHeader->format = getFormat(); + pHeader->transparency = RPGrpResTIMG::JUT_TRANSPARENCY_DISABLE; + pHeader->width = getWidth(); + pHeader->height = getHeight(); + pHeader->wrapS = getWrapS(); + pHeader->wrapT = getWrapT(); + pHeader->tlutName = GX_TLUT0; + pHeader->tlutFormat = GX_TL_IA8; + pHeader->paletteEntryNum = 0; + pHeader->paletteOffset = 0; + pHeader->mipMap = GX_FALSE; + pHeader->edgeLODEnable = GX_FALSE; + pHeader->biasClampEnable = GX_FALSE; + pHeader->anisotropy = GX_ANISO_1; + pHeader->minFilter = getMinFilter(); + pHeader->magFilter = getMagFilter(); + pHeader->minLOD = 0; + pHeader->maxLOD = 0; + pHeader->mipMapLevel = 1; + pHeader->LODBias = 0; + pHeader->imageOffset = sizeof(RPGrpResTIMG); +} + +void RPGrpCpuTexture::fillGradationTable(EGradationKind kind, int dir, + u16 tableStart, u16 tableGoal, + const GXColor& c1, const GXColor& c2, + bool wrap, bool setAll) { + + bool isSLine = dir == 's' || dir == 'S'; + + u16 tableSize = isSLine ? getWidth() : getHeight(); + + u16 tableHeight = isSLine ? getHeight() : getWidth(); + u16 tableMid = tableSize / 2; + + GXColor table[1024]; + makeGradationTable(kind, table, tableSize, tableStart, tableGoal, c1, c2); + + if (wrap) { + GXColor colors[256]; + + for (int i = 0; i < tableSize; i++) { + colors[i] = table[i < tableMid ? i + tableMid : i - tableMid]; + } + + for (int i = 0; i < tableSize; i++) { + table[i] = colors[i]; + } + } + + u16 setStart = setAll ? 0 : tableStart; + u16 setGoal = setAll ? tableSize : tableGoal; + + for (u16 x = setStart; x < setGoal; x++) { + for (u16 y = 0; y < tableHeight; y++) { + setColor(y, x, table[x]); + } + } + flush(); +} + +void RPGrpCpuTexture::alloc() { + u8* pBuffer = new (32) u8[getTexBufferSize()]; + setBuffer(pBuffer); +} + +void RPGrpCpuTexture::allocWithHeaderDebug() { + + u8* pBuffer = new (32) u8[getTexBufferSize() + sizeof(RPGrpResTIMG)]; + + setBuffer(pBuffer + sizeof(RPGrpResTIMG)); + setFlag(cFlag_HasHeader); + initResTIMG(); +} + +void RPGrpCpuTexture::setColor(u16 x, u16 y, GXColor color) { + switch (getFormat()) { + case GX_TF_RGBA8: { + int offset = ((x >> 2) + (y >> 2) * (getWidth() / 4)) * 0x40 + // block + (y & 3) * 8 + (x & 3) * 2; // pixel + + u8* pData = static_cast(getBuffer()) + offset; + + pData[0] = color.a; + pData[1] = color.r; + pData[32] = color.g; + pData[33] = color.b; + break; + } + + case GX_TF_I8: { + int offset = (x & 0x7) + (y & 0x3) * 8; // pixel + offset += ((x >> 3) + ((y >> 2) * (getWidth() / 8))) * 32; // block + + u8* pData = static_cast(getBuffer()) + offset; + + pData[0] = color.r; + break; + } + + default: { + break; + } + } +} diff --git a/src/Pack/RPGraphics/RPGrpModel.cpp b/src/Pack/RPGraphics/RPGrpModel.cpp index e05b51c4c..c773d02a4 100644 --- a/src/Pack/RPGraphics/RPGrpModel.cpp +++ b/src/Pack/RPGraphics/RPGrpModel.cpp @@ -19,11 +19,13 @@ const nw4r::math::_VEC3 RPGrpModel::GEOMETRY_MAGNIFY[/* ??? */] = { {0.0f, 0.0f, 0.0f}, }; +#ifdef VERSION_RSPE01_01 RPGrpModel* RPGrpModel::Construct(RPGrpHandle handle, u8 viewNo, u32 typeOption, u32 bufferOption) { RPGrpModel* p = NULL; switch (RPGrpModelResManager::GetCurrent()->GetType(handle)) { + case RPGrpModelResManager::Type_ResMdl: { p = new RPGrpModelG3D(handle, viewNo, typeOption, bufferOption); break; @@ -59,8 +61,39 @@ RPGrpModel* RPGrpModel::Construct(RPGrpHandle handle, const char* pName, p->CreateAnm(); return p; } +#endif RPGrpModel::RPGrpModel(u8 viewNo) +#if defined(VERSION_RSPE01_00) + : unk0(0), + unk1(0), + mFlags(1), + unk4(0), + unkFlag(0), + mpEntryNext(NULL), + mpGenNext(NULL), + mBaseScale(1.0f, 1.0f, 1.0f), + mpModelAnm(NULL), + mppMaterials(NULL), + mpBoundingInfo(NULL), + mpRecord(NULL), + mReverseCulling(FALSE), + mpCallback(NULL), + mDrawGroup(8), + mDrawScene(8), + mViewNo(viewNo), + unk6C(NULL) { + + mpGenNext = spGenList; + spGenList = this; + nw4r::math::MTX34Identity(&mtx14); + //! @bug only in rev 0: mBaseScale was already initialized + mBaseScale.z = 1.0f; + mBaseScale.y = 1.0f; + mBaseScale.x = 1.0f; +} + +#elif defined(VERSION_RSPE01_01) : mViewNo(viewNo), mDrawScene(0), mDrawGroup(0), @@ -68,7 +101,7 @@ RPGrpModel::RPGrpModel(u8 viewNo) unk4(8), mFlags(EFlag_Visible), unkA(0), - unkC(0), + unkFlag(0), unk10(0), mpEntryNext(NULL), mpGenNext(NULL), @@ -84,6 +117,7 @@ RPGrpModel::RPGrpModel(u8 viewNo) mpGenNext = spGenList; spGenList = this; } +#endif RPGrpModel::~RPGrpModel() {} @@ -147,10 +181,12 @@ void RPGrpModel::UpdateFrame() { mpModelAnm->UpdateFrame(); } +#if defined(VERSION_RSPE01_01) nw4r::g3d::ScnObj* pScnObj = GetScnObj(); if (pScnObj != NULL) { pScnObj->G3dProc(nw4r::g3d::G3dObj::G3DPROC_UPDATEFRAME, 0, NULL); } +#endif } void RPGrpModel::Calc() { @@ -180,15 +216,19 @@ void RPGrpModel::Entry() { mFlags |= EFlag_Entered; } +//! TODO(texline) vtable is different in rev 0 +//! (offset should be 0x4c there, but is 0x5c) void RPGrpModel::CalcMaterial() { for (int i = 0; i < GetMaterialNum(); i++) { mppMaterials[i]->Calc(); } } +#if defined(VERSION_RSPE01_01) u16 RPGrpModel::GetMaterialNum() const { return mpModelEx->getNumMaterial(); } +#endif void RPGrpModel::SetReverseCulling(bool reverse) { if (reverse == mReverseCulling) { @@ -211,6 +251,7 @@ void RPGrpModel::SetReverseCulling(bool reverse) { mReverseCulling = reverse; } +#if defined(VERSION_RSPE01_01) u16 RPGrpModel::ReplaceTexture(const char* pName, const RPGrpTexture& rTexture, bool keepFilterWrap) { @@ -218,6 +259,7 @@ u16 RPGrpModel::ReplaceTexture(const char* pName, const RPGrpTexture& rTexture, return mpModelEx->replaceTexture(pName, texObj, keepFilterWrap, NULL, 0, true); } +#endif void RPGrpModel::RemoveGenList() { RPGrpModel* pIt = spGenList; diff --git a/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp b/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp index c6c869bc8..3d7cbfa46 100644 --- a/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp +++ b/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp @@ -2,1057 +2,260 @@ #include -/****************************************************************************** - * - * RPGrpModelAnmG3D - * - ******************************************************************************/ +RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, u8 viewNo, u32 typeOption, + u32 bufferOption) + : RPGrpModel(viewNo) { -//! Animation object type conversion table -// clang-format off -const nw4r::g3d::ScnMdlSimple::AnmObjType RPGrpModelAnmG3D::TO_G3D_TYPE[Anm_Max] = { - nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_CHR, // Anm_Chr - nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_MATCLR, // Anm_Clr - nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_TEXPAT, // Anm_TexPat - nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_TEXSRT, // Anm_TexSrt - nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_VIS, // Anm_Vis - nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_SHP, // Anm_Shp -}; -// clang-format on + const nw4r::g3d::ResMdl mdl = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); -//! Animation play policy conversion table -const RPGrpModelAnm::AnmPlayPolicy RPGrpModelAnmG3D::FROM_G3D_POLICY[] = { - AnmPlayPolicy_OneTime, // nw4r::g3d::ANM_POLICY_ONETIME - AnmPlayPolicy_Loop, // nw4r::g3d::ANM_POLICY_LOOP - AnmPlayPolicy_2, // ??? - AnmPlayPolicy_3, // ??? - AnmPlayPolicy_4, // ??? -}; - -void RPGrpModelAnmG3D::RegistFromResFile(Anm anm, AnmIdx idx, - RPGrpHandle handle, - const char* pName) { - InternalRegist(anm, idx); - - switch (anm) { - case Anm_Chr: { - const nw4r::g3d::ResAnmChr chr = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, pName); - - RegistAnmChr(idx, chr); - break; - } - - case Anm_Clr: { - const nw4r::g3d::ResAnmClr clr = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, pName); - - RegistAnmClr(idx, clr); - break; - } - - case Anm_TexPat: { - const nw4r::g3d::ResAnmTexPat pat = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, - pName); - - RegistAnmTexPat(idx, pat); - break; - } - - case Anm_TexSrt: { - const nw4r::g3d::ResAnmTexSrt srt = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, - pName); - - RegistAnmTexSrt(idx, srt); - break; - } - - case Anm_Vis: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, pName); - - RegistAnmVis(idx, vis); - break; - } - - case Anm_Shp: { - const nw4r::g3d::ResAnmShp shp = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, pName); - - RegistAnmShp(idx, shp); - break; - } - - case Anm_6: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, pName); - - RegistAnmVis(idx, vis); - break; - } - - case Anm_7: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, pName); - - RegistAnmVis(idx, vis); - break; - } - - default: { - break; - } - } -} - -void RPGrpModelAnmG3D::RegistFromResFile(Anm anm, AnmIdx idx, - RPGrpHandle handle, u32 id) { - InternalRegist(anm, idx); - - switch (anm) { - case Anm_Chr: { - const nw4r::g3d::ResAnmChr chr = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmChr(idx, chr); - break; - } - - case Anm_Clr: { - const nw4r::g3d::ResAnmClr clr = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmClr(idx, clr); - break; - } - - case Anm_TexPat: { - const nw4r::g3d::ResAnmTexPat pat = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmTexPat(idx, pat); - break; - } - - case Anm_TexSrt: { - const nw4r::g3d::ResAnmTexSrt srt = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmTexSrt(idx, srt); - break; - } - - case Anm_Vis: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmVis(idx, vis); - break; - } - - case Anm_Shp: { - const nw4r::g3d::ResAnmShp shp = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmShp(idx, shp); - break; - } - - case Anm_6: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmVis(idx, vis); - break; - } - - case Anm_7: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle, id); - - RegistAnmVis(idx, vis); - break; - } - - default: { - break; - } - } -} - -void RPGrpModelAnmG3D::Init() { - mppAnmObjChrRes = NULL; - mppAnmObjMatClrRes = NULL; - mppAnmObjTexPatRes = NULL; - mppAnmObjTexSrtRes = NULL; - mppAnmObjVisRes = NULL; - mppAnmObjShpRes = NULL; - unk88 = NULL; - unk8C = NULL; - - for (int i = 0; i < Anm_Max; i++) { - unk90[i] = 0; - } - - mpChrBlendInfo = NULL; - mpShpBlendInfo = NULL; -} - -void RPGrpModelAnmG3D::SetAnmObj(Anm anm, nw4r::g3d::AnmObj** ppAnmObjs) { - switch (anm) { - case Anm_Chr: { - mppAnmObjChrRes = - reinterpret_cast(ppAnmObjs); - break; - } - - case Anm_Clr: { - mppAnmObjMatClrRes = - reinterpret_cast(ppAnmObjs); - break; - } - - case Anm_TexPat: { - mppAnmObjTexPatRes = - reinterpret_cast(ppAnmObjs); - break; - } - - case Anm_TexSrt: { - mppAnmObjTexSrtRes = - reinterpret_cast(ppAnmObjs); - break; - } - - case Anm_Vis: { - mppAnmObjVisRes = - reinterpret_cast(ppAnmObjs); - break; - } - - case Anm_Shp: { - mppAnmObjShpRes = - reinterpret_cast(ppAnmObjs); - break; - } - - case Anm_6: { - unk88 = reinterpret_cast(ppAnmObjs); - break; - } - - case Anm_7: { - unk8C = reinterpret_cast(ppAnmObjs); - break; - } + nw4r::g3d::ScnObj* pScnObj; + u32 size; - default: { - break; - } + if (bufferOption == 0 && !(typeOption & TypeOption_NoSimple)) { + pScnObj = + nw4r::g3d::ScnMdlSimple::Construct(spAllocator, &size, mdl, viewNo); + } else { + pScnObj = nw4r::g3d::ScnMdl::Construct(spAllocator, &size, mdl, + bufferOption, viewNo); } - InternalSetAnmObj(anm); +#if defined(VERSION_RSPE01_01) + mpModelEx = new EGG::ModelEx(pScnObj); +#endif } -nw4r::g3d::AnmObj* RPGrpModelAnmG3D::InternalGetAnmObj(Anm anm, - AnmIdx idx) const { - switch (anm) { - case Anm_Chr: { - return mppAnmObjChrRes[idx]; - } - - case Anm_Clr: { - return mppAnmObjMatClrRes[idx]; - } - - case Anm_TexPat: { - return mppAnmObjTexPatRes[idx]; - break; - } - - case Anm_TexSrt: { - return mppAnmObjTexSrtRes[idx]; - break; - } - - case Anm_Vis: { - return mppAnmObjVisRes[idx]; - break; - } - - case Anm_Shp: { - return mppAnmObjShpRes[idx]; - break; - } - - case Anm_6: { - return unk88[idx]; - break; - } - - case Anm_7: { - return unk8C[idx]; - break; - } +RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, int idx, u8 viewNo, + u32 typeOption, u32 bufferOption) + : RPGrpModel(viewNo) { - default: { - return NULL; - } - } -} + const nw4r::g3d::ResFile file = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); -void RPGrpModelAnmG3D::VF_0x74(UNKTYPE) {} + const nw4r::g3d::ResMdl mdl = file.GetResMdl(idx); -void RPGrpModelAnmG3D::Configure() { - RPGrpModelAnm::Configure(); + nw4r::g3d::ScnObj* pScnObj; + u32 size; - for (int i = 0; i < Anm_Max; i++) { - unk90[i] = 0; + if (bufferOption == 0 && !(typeOption & TypeOption_NoSimple)) { + pScnObj = + nw4r::g3d::ScnMdlSimple::Construct(spAllocator, &size, mdl, viewNo); + } else { + pScnObj = nw4r::g3d::ScnMdl::Construct(spAllocator, &size, mdl, + bufferOption, viewNo); } - mppAnmObjChrRes = NULL; - mppAnmObjMatClrRes = NULL; - mppAnmObjTexPatRes = NULL; - mppAnmObjTexSrtRes = NULL; - mppAnmObjVisRes = NULL; - mppAnmObjShpRes = NULL; - unk88 = NULL; - unk8C = NULL; - - mpChrBlendInfo = NULL; -#if defined(BUG_FIX) - mpShpBlendInfo = NULL; +#if defined(VERSION_RSPE01_01) + mpModelEx = new EGG::ModelEx(pScnObj); #endif } -RPGrpModelAnmG3D::RPGrpModelAnmImplement(RPGrpModel* pModel) { - mpScnMdlSimple = pModel->GetScnMdlSimple(); - Init(); - - for (int i = 0; i < Anm_Max; i++) { - mpToIndexG3D[i] = NULL; - } -} - -void RPGrpModelAnmG3D::InternalSetAnmObj(Anm anm) { - mpToIndexG3D[anm] = new s8[GetAnmNum(anm)]; - - for (int i = 0; i < GetAnmNum(anm); i++) { - mpToIndexG3D[anm][i] = -1; - } - - switch (anm) { - case Anm_Chr: { - // TODO(kiwi) Why only one? SetBlendWeight could write way out of bounds - mpChrBlendInfo = new ChrBlendInfo[1]; - - mpChrBlendInfo[0].pAnmObj = nw4r::g3d::AnmObjChrBlend::Construct( - RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), 8); - - for (int i = 0; i < 8; i++) { - mpChrBlendInfo[0].toAnmIdx[i] = -1; - } - break; - } - - case Anm_Clr: { - if (GetAnmNum(Anm_Clr) >= 2) { - - mpAnmObjMatClrOverride = nw4r::g3d::AnmObjMatClrOverride::Construct( - RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), - GetAnmNum(Anm_Clr)); - - mpAnmObjMatClrOverride->Bind(mpScnMdlSimple->GetResMdl()); - mpScnMdlSimple->SetAnmObj(mpAnmObjMatClrOverride); - } else { - mpAnmObjMatClrOverride = NULL; - } - break; - } - - case Anm_TexPat: { - if (GetAnmNum(Anm_TexPat) >= 2) { - - mpAnmObjTexPatOverride = nw4r::g3d::AnmObjTexPatOverride::Construct( - RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), - GetAnmNum(Anm_TexPat)); - - mpAnmObjTexPatOverride->Bind(mpScnMdlSimple->GetResMdl()); - mpScnMdlSimple->SetAnmObj(mpAnmObjTexPatOverride); - } else { - mpAnmObjTexPatOverride = NULL; - } - break; - } - - case Anm_TexSrt: { - if (GetAnmNum(Anm_TexSrt) >= 2) { - - mpAnmObjTexSrtOverride = nw4r::g3d::AnmObjTexSrtOverride::Construct( - RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), - GetAnmNum(Anm_TexSrt)); - - mpAnmObjTexSrtOverride->Bind(mpScnMdlSimple->GetResMdl()); - mpScnMdlSimple->SetAnmObj(mpAnmObjTexSrtOverride); - } else { - mpAnmObjTexSrtOverride = NULL; - } - break; - } - - case Anm_Vis: { - if (GetAnmNum(Anm_Vis) >= 2) { - - mpAnmObjVisOR = nw4r::g3d::AnmObjVisOR::Construct( - RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl()); - - mpAnmObjVisOR->Bind(mpScnMdlSimple->GetResMdl()); - mpScnMdlSimple->SetAnmObj(mpAnmObjVisOR); - } else { - mpAnmObjVisOR = NULL; - } - break; - } +RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, const char* pName, u8 viewNo, + u32 typeOption, u32 bufferOption) + : RPGrpModel(viewNo) { - case Anm_Shp: { - // TODO(kiwi) Why only one? SetBlendWeight could write way out of bounds - mpShpBlendInfo = new ShpBlendInfo[1]; + const nw4r::g3d::ResFile file = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); - mpShpBlendInfo[0].pAnmObj = nw4r::g3d::AnmObjShpBlend::Construct( - RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), 8); + const nw4r::g3d::ResMdl mdl = file.GetResMdl(pName); - mpShpBlendInfo[0].pAnmObj->Bind(mpScnMdlSimple->GetResMdl()); - mpScnMdlSimple->SetAnmObj(mpShpBlendInfo[0].pAnmObj); + nw4r::g3d::ScnObj* pScnObj; + u32 size; - for (int i = 0; i < 8; i++) { - mpShpBlendInfo[0].toAnmIdx[i] = -1; - } - break; + if (bufferOption == 0 && !(typeOption & TypeOption_NoSimple)) { + pScnObj = + nw4r::g3d::ScnMdlSimple::Construct(spAllocator, &size, mdl, viewNo); + } else { + pScnObj = nw4r::g3d::ScnMdl::Construct(spAllocator, &size, mdl, + bufferOption, viewNo); } - default: { - break; - } - } +#if defined(VERSION_RSPE01_01) + mpModelEx = new EGG::ModelEx(pScnObj); +#endif } -void RPGrpModelAnmG3D::Regist(Anm anm, AnmIdx idx, RPGrpHandle handle) { - InternalRegist(anm, idx); - - switch (anm) { - case Anm_Chr: { - const nw4r::g3d::ResAnmChr chr = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); - - RegistAnmChr(idx, chr); - break; - } - - case Anm_Clr: { - const nw4r::g3d::ResAnmClr clr = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); - - RegistAnmClr(idx, clr); - break; - } - - case Anm_TexPat: { - const nw4r::g3d::ResAnmTexPat pat = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); - - RegistAnmTexPat(idx, pat); - break; - } - - case Anm_TexSrt: { - const nw4r::g3d::ResAnmTexSrt srt = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); - - RegistAnmTexSrt(idx, srt); - break; - } - - case Anm_Vis: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); - - RegistAnmVis(idx, vis); - break; - } - - case Anm_Shp: { - const nw4r::g3d::ResAnmShp shp = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); - - RegistAnmShp(idx, shp); - break; - } +#ifdef VERSION_RSPE01_01 +void RPGrpModelG3D::Configure() { + RPGrpModel::Configure(); - case Anm_6: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); + GetScnMdlSimple()->SetScnObjCallback(this); + GetScnMdlSimple()->SetScnMdlCallback(this); - RegistAnmVis(idx, vis); - break; - } + GetScnMdlSimple()->EnableScnObjCallbackTiming( + nw4r::g3d::ScnObj::CALLBACK_TIMING_A); - case Anm_7: { - const nw4r::g3d::ResAnmVis vis = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); + GetScnMdlSimple()->EnableScnObjCallbackExecOp( + nw4r::g3d::ScnObj::EXECOP_CALC_MAT); - RegistAnmVis(idx, vis); - break; - } - - default: { - break; - } - } + InternalCalc(); } -bool RPGrpModelAnmG3D::Start(Anm anm, AnmIdx idx, f32 frame) { - if (anm != Anm_Chr && anm != Anm_Shp) { - mpAnmFlags[anm][idx] |= AnmFlag_PlayingG3D; - - if (GetAnmNum(anm) >= 2) { - switch (anm) { - case Anm_Clr: { - u8 g3dIdx = 0; - mpAnmObjMatClrOverride->DetachAll(); - - for (int i = 0; i < GetAnmNum(Anm_Clr); i++) { - if (!IsPlayingG3D(Anm_Clr, i)) { - continue; - } - - mpAnmObjMatClrOverride->Attach(g3dIdx, - mppAnmObjMatClrRes[i]); - mpToIndexG3D[Anm_Clr][idx] = g3dIdx++; - } - break; - } - - case Anm_TexPat: { - u8 g3dIdx = 0; - mpAnmObjTexPatOverride->DetachAll(); - - for (int i = 0; i < GetAnmNum(Anm_TexPat); i++) { - if (!IsPlayingG3D(Anm_TexPat, i)) { - continue; - } - - mpAnmObjTexPatOverride->Attach(g3dIdx, - mppAnmObjTexPatRes[i]); - mpToIndexG3D[Anm_TexPat][idx] = g3dIdx++; - } - break; - } - - case Anm_TexSrt: { - u8 g3dIdx = 0; - mpAnmObjTexSrtOverride->DetachAll(); - - for (int i = 0; i < GetAnmNum(Anm_TexSrt); i++) { - if (!IsPlayingG3D(Anm_TexSrt, i)) { - continue; - } - - mpAnmObjTexSrtOverride->Attach(g3dIdx, - mppAnmObjTexSrtRes[i]); - mpToIndexG3D[Anm_TexSrt][idx] = g3dIdx++; - } - break; - } - - case Anm_Vis: { - u8 g3dIdx = 0; - mpAnmObjVisOR->DetachAll(); - - for (int i = 0; i < GetAnmNum(Anm_Vis); i++) { - if (!IsPlayingG3D(Anm_Vis, i)) { - continue; - } - - mpAnmObjVisOR->Attach(g3dIdx, mppAnmObjVisRes[i]); - mpToIndexG3D[Anm_Vis][idx] = g3dIdx++; - } - break; - } - - default: { - break; - } - } - - } else if (anm != Anm_Chr && anm != Anm_Shp) { - nw4r::g3d::AnmObj* pAnmObj = InternalGetAnmObj(anm, idx); - - if (pAnmObj != mpScnMdlSimple->GetAnmObj(TO_G3D_TYPE[anm])) { - mpScnMdlSimple->RemoveAnmObj(TO_G3D_TYPE[anm]); - mpScnMdlSimple->SetAnmObj(pAnmObj); - } - } - } - - return RPGrpModelAnm::Start(anm, idx, frame); +void RPGrpModelG3D::CreateAnm() { + mpModelAnm = RPGrpModelAnmG3D::Construct(this); } - -bool RPGrpModelAnmG3D::Cancel(Anm anm, AnmIdx idx) { - bool success = RPGrpModelAnm::Cancel(anm, idx); - - if (!success) { - return false; - } - - if (anm == Anm_Chr || anm == Anm_Shp) { - s8 blendIdx = GetBlendIndex(anm, idx, 0); - - if (blendIdx != -1) { - RemoveBlendAnm(anm, blendIdx, 0); - } - - } else if (IsPlayingG3D(anm, idx)) { - mpAnmFlags[anm][idx] &= ~AnmFlag_PlayingG3D; - - if (GetAnmNum(anm) >= 2) { - switch (anm) { - case Anm_Clr: { - mpAnmObjMatClrOverride->Detach(mpToIndexG3D[Anm_Clr][idx]); - break; - } - - case Anm_TexPat: { - mpAnmObjTexPatOverride->Detach(mpToIndexG3D[Anm_TexPat][idx]); - break; - } - - case Anm_TexSrt: { - mpAnmObjTexSrtOverride->Detach(mpToIndexG3D[Anm_TexSrt][idx]); - break; - } - - case Anm_Vis: { - mpAnmObjVisOR->Detach(mpToIndexG3D[Anm_Vis][idx]); - break; - } - - default: { - break; - } - } - - mpToIndexG3D[anm][idx] = -1; - - } else { - // @bug Messed up the expression somehow? -#if defined(BUG_FIX) - success = mpScnMdlSimple->RemoveAnmObj(TO_G3D_TYPE[anm]) != NULL; -#else - mpScnMdlSimple->RemoveAnmObj(TO_G3D_TYPE[anm]); - success = success != 0; #endif - } +IRPGrpModelCallback* +RPGrpModelG3D::SetCallback(IRPGrpModelCallback* pCallback) { + IRPGrpModelCallback* pOldCallback = mpCallback; + mpCallback = pCallback; +#if defined(VERSION_RSPE01_01) + if (pCallback == NULL) { + GetScnMdlSimple()->DisableScnMdlCallbackTiming( + nw4r::g3d::ScnObj::CALLBACK_TIMING_ALL); } else { - success = false; + GetScnMdlSimple()->EnableScnMdlCallbackTiming( + nw4r::g3d::ScnObj::CALLBACK_TIMING_ALL); } +#endif - return success; + return pOldCallback; } -s16 RPGrpModelAnmG3D::SetBlendAnm(Anm anm, u8 arg1, AnmIdx idx) { - s16 uVar1 = RPGrpModelAnm::SetBlendAnm(anm, arg1, idx); - - if (uVar1 != idx) { - switch (anm) { - case Anm_Chr: { - mpChrBlendInfo[0].pAnmObj->Attach(arg1, mppAnmObjChrRes[idx]); - mpChrBlendInfo[0].toAnmIdx[arg1] = idx; - - if (IsEnableChrAnm() && - mpChrBlendInfo[0].pAnmObj->GetParent() == NULL) { - - mpScnMdlSimple->SetAnmObj(mpChrBlendInfo[0].pAnmObj); - } - break; +#if defined(VERSION_RSPE01_01) +void RPGrpModelG3D::InternalCalc() { + if (!mReverseCulling) { + if (GetScnLeaf() != NULL) { + GetScnLeaf()->SetScale(mBaseScale); } + } else { + const nw4r::math::_VEC3& rMag = GEOMETRY_MAGNIFY[mReverseCulling - 1]; - case Anm_Shp: { - mpShpBlendInfo[0].pAnmObj->Attach(arg1, mppAnmObjShpRes[idx]); - mpShpBlendInfo[0].toAnmIdx[arg1] = idx; - break; - } + nw4r::math::VEC3 scale(mBaseScale.x * rMag.x, mBaseScale.y * rMag.y, + mBaseScale.z * rMag.z); - default: { - break; - } + if (GetScnLeaf() != NULL) { + GetScnLeaf()->SetScale(scale); } } - return uVar1; -} - -void RPGrpModelAnmG3D::SetBlendWeight(Anm anm, u8 g3dIndex, f32 weight, - u8 blendIdx) { - switch (anm) { - case Anm_Chr: { - mpChrBlendInfo[blendIdx].pAnmObj->SetWeight(g3dIndex, weight); - break; + if (mpRecord != NULL) { + GetScnMdlSimple()->EnableScnMdlCallbackTiming( + nw4r::g3d::ScnMdl::CALLBACK_TIMING_C); } - case Anm_Shp: { - mpShpBlendInfo[blendIdx].pAnmObj->SetWeight(g3dIndex, weight); - break; - } - - default: { - break; - } + if (GetScnObj() != NULL) { + GetScnObj()->G3dProc(nw4r::g3d::G3dObj::G3DPROC_CALC_WORLD, 0, NULL); } } -s16 RPGrpModelAnmG3D::RemoveBlendAnm(Anm anm, u8 arg1, u8 arg2) { - s16 idx = GetBlendAnm(anm, arg1, arg2); - - if (idx != -1) { - mpAnmFlags[anm][static_cast(idx)] &= ~AnmFlag_PlayingG3D; - - switch (anm) { - case Anm_Chr: { - mpChrBlendInfo[arg2].pAnmObj->Detach(arg1); - mpChrBlendInfo[arg2].toAnmIdx[arg1] = -1; - break; - } - - case Anm_Shp: { - mpShpBlendInfo[arg2].pAnmObj->Detach(arg1); - mpShpBlendInfo[arg2].toAnmIdx[arg1] = -1; - break; - } - - default: { - break; - } - } - } +void RPGrpModelG3D::CalcBeforeDraw() { + RPGrpModel::CalcBeforeDraw(); - return idx; -} + if (mpCallback != NULL) { + spCalcViewMtxArray = GetScnMdlSimple()->GetViewPosMtxArray(); + spCalcModel = this; -s16 RPGrpModelAnmG3D::GetBlendAnm(Anm anm, u8 arg1, u8 arg2) { - switch (anm) { - case Anm_Chr: { - return mpChrBlendInfo[arg2].toAnmIdx[arg1]; - } + mpCallback->ReferViewMtx(this); - case Anm_Shp: { - return mpShpBlendInfo[arg2].toAnmIdx[arg1]; - } - - default: { - return -1; - } + spCalcViewMtxArray = NULL; + spCalcModel = NULL; } } -f32 RPGrpModelAnmG3D::GetBlendWeight(Anm anm, u8 arg1, u8 arg2) { - switch (anm) { - case Anm_Chr: { - return mpChrBlendInfo[arg2].pAnmObj->GetWeight(arg1); - } - - case Anm_Shp: { - return mpShpBlendInfo[arg2].pAnmObj->GetWeight(arg1); - } - - default: { - return 0.0f; - } +void RPGrpModelG3D::SetJointVisible(u32 idx, bool enable) { + if (GetScnMdl() != NULL) { + nw4r::g3d::ScnMdl::CopiedVisAccess access(GetScnMdl(), idx); + access.SetVisibilityEx(enable); + } else { + GetScnMdlSimple()->GetResMdl().GetResNode(idx).SetVisibility(enable); } } -// clang-format off -static nw4r::g3d::AnmObjChr::BindOption TO_BIND_OPTION[RPGrpModelAnm::BindType_Max] = { - nw4r::g3d::AnmObjChr::BIND_ONE, // BindType_One - nw4r::g3d::AnmObjChr::BIND_PARTIAL, // BindType_Partial -}; -// clang-format on - -void RPGrpModelAnmG3D::ReBindChrAnmNode(u16 arg0, u16 arg1, BindType type) { - mppAnmObjChrRes[arg0]->Release(); - mppAnmObjChrRes[arg0]->Bind(mpScnMdlSimple->GetResMdl(), arg1, - TO_BIND_OPTION[type]); -} - -void RPGrpModelAnmG3D::ReleaseChrAnmNode(u16 arg0, u16 arg1, BindType type) { - mppAnmObjChrRes[arg0]->Release(mpScnMdlSimple->GetResMdl(), arg1, - TO_BIND_OPTION[type]); -} - -void RPGrpModelAnmG3D::UpdateFrame() { - for (int i = 0; i < Anm_Max; i++) { - if (i == Anm_Chr && IsBlending(Anm_Chr) && IsEnableChrAnm()) { - s16 idx = GetBlendAnm(Anm_Chr, 0, 0); - f32 rate = GetUpdateRate(Anm_Chr, idx); - - rate = unk60 - nw4r::math::FAbs(rate); - unk60 = rate; - - if (rate <= 0.0f) { - unk64 = 0.0f; - unk60 = 0.0f; - - SetBlendWeight(Anm_Chr, 0, 1.0f, 0); - RemoveBlendAnm(Anm_Chr, 1, 0); - } else { - f32 weight = rate / unk64; - SetBlendWeight(Anm_Chr, 0, 1.0f - weight, 0); - SetBlendWeight(Anm_Chr, 1, weight, 0); - } - } +bool RPGrpModelG3D::IsJointVisible(u32 idx) const { + if (GetScnMdl() != NULL) { + nw4r::g3d::ScnMdl::CopiedVisAccess access(GetScnMdl(), idx); + return access.IsVisible(); + } else { + return GetScnMdlSimple()->GetResMdl().GetResNode(idx).IsVisible(); } } +#endif -void RPGrpModelAnmG3D::InternalCalc() {} - -void RPGrpModelAnmG3D::SetEnableQuaternionBlend(bool enable) { - RPGrpModelAnm::SetEnableQuaternionBlend(enable); - - mpChrBlendInfo[0].pAnmObj->SetAnmFlag( - nw4r::g3d::AnmObj::FLAG_USE_QUATERNION_ROTATION_BLEND, - IsEnableQuaternionBlend()); -} - -void RPGrpModelAnmG3D::SetEnableChrAnm(bool enable) { - RPGrpModelAnm::SetEnableChrAnm(enable); +void RPGrpModelG3D::ExecCallback_CALC_WORLD( + nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj* /* pObj */, + u32 /* param */, void* /* pInfo */) {} - if (IsEnableChrAnm()) { - if (mpChrBlendInfo[0].pAnmObj->GetParent() == NULL && - mpChrBlendInfo[0].pAnmObj->TestAnmFlag( - nw4r::g3d::AnmObj::FLAG_ANM_BOUND)) { +void RPGrpModelG3D::ExecCallback_CALC_MAT(nw4r::g3d::ScnObj::Timing timing, + nw4r::g3d::ScnObj* /* pObj */, + u32 /* param */, void* /* pInfo */) { - mpScnMdlSimple->SetAnmObj(mpChrBlendInfo[0].pAnmObj); + if (!(unkFlag & 0x40)) { + if (timing & nw4r::g3d::ScnObj::CALLBACK_TIMING_A) { + CalcMaterial(); } - } else if (mpChrBlendInfo[0].pAnmObj->GetParent() != NULL) { - mpScnMdlSimple->RemoveAnmObj(mpChrBlendInfo[0].pAnmObj); + } else if (timing & nw4r::g3d::ScnObj::CALLBACK_TIMING_C) { + CalcMaterial(); } } -void RPGrpModelAnmG3D::VF_0x70(UNKTYPE) {} - -void RPGrpModelAnmG3D::RegistAnmChr(AnmIdx idx, - const nw4r::g3d::ResAnmChr chr) { - const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); - - u32 size; - mppAnmObjChrRes[idx] = nw4r::g3d::AnmObjChrRes::Construct( - RPGrpModel::GetAllocator(), &size, chr, mdl, false); - - mppAnmObjChrRes[idx]->Bind(mdl); -} - -void RPGrpModelAnmG3D::RegistAnmClr(AnmIdx idx, - const nw4r::g3d::ResAnmClr clr) { - const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); - - u32 size; - mppAnmObjMatClrRes[idx] = nw4r::g3d::AnmObjMatClrRes::Construct( - RPGrpModel::GetAllocator(), &size, clr, mdl, false); +void RPGrpModelG3D::ExecCallback_DRAW_OPA( + nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj* /* pObj */, + u32 /* param */, void* /* pInfo */) { - mppAnmObjMatClrRes[idx]->Bind(mdl); + nw4r::g3d::G3DState::Invalidate(nw4r::g3d::G3DState::INVALIDATE_TEV); } -void RPGrpModelAnmG3D::RegistAnmTexPat(AnmIdx idx, - const nw4r::g3d::ResAnmTexPat pat) { - const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); - - u32 size; - mppAnmObjTexPatRes[idx] = nw4r::g3d::AnmObjTexPatRes::Construct( - RPGrpModel::GetAllocator(), &size, pat, mdl, false); +void RPGrpModelG3D::ExecCallback_DRAW_XLU( + nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj* /* pObj */, + u32 /* param */, void* /* pInfo */) { - mppAnmObjTexPatRes[idx]->Bind(mdl); + nw4r::g3d::G3DState::Invalidate(nw4r::g3d::G3DState::INVALIDATE_TEV); } -void RPGrpModelAnmG3D::RegistAnmTexSrt(AnmIdx idx, - const nw4r::g3d::ResAnmTexSrt srt) { - const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); +void RPGrpModelG3D::ExecCallbackA(nw4r::g3d::ChrAnmResult* pResult, + nw4r::g3d::ResMdl /* mdl */, + nw4r::g3d::FuncObjCalcWorld* pFuncObj) { + nw4r::math::MTX34 trans; + nw4r::math::VEC3 scale; - u32 size; - mppAnmObjTexSrtRes[idx] = nw4r::g3d::AnmObjTexSrtRes::Construct( - RPGrpModel::GetAllocator(), &size, srt, mdl, false); + pResult->GetRotTrans(&trans); + pResult->GetScale(&scale); - mppAnmObjTexSrtRes[idx]->Bind(mdl); -} + mpCallback->EditJointLocalMtx( + this, GetScnMdlSimple()->GetScnMdlCallbackNodeID(), &trans, &scale); -void RPGrpModelAnmG3D::RegistAnmVis(AnmIdx idx, - const nw4r::g3d::ResAnmVis vis) { - const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); + pResult->SetRotTrans(&trans); + pResult->SetScale(&scale); - u32 size; - mppAnmObjVisRes[idx] = nw4r::g3d::AnmObjVisRes::Construct( - RPGrpModel::GetAllocator(), &size, vis, mdl); - - mppAnmObjVisRes[idx]->Bind(mdl); + pFuncObj->SetCallbackNodeID(GetScnMdlSimple()->GetScnMdlCallbackNodeID()); } -void RPGrpModelAnmG3D::RegistAnmShp(AnmIdx idx, - const nw4r::g3d::ResAnmShp chr) { - const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); - - u32 size; - mppAnmObjShpRes[idx] = nw4r::g3d::AnmObjShpRes::Construct( - RPGrpModel::GetAllocator(), &size, chr, mdl, false); - - mppAnmObjShpRes[idx]->Bind(mdl); -} - -f32 RPGrpModelAnmG3D::VF_0x44(UNKTYPE) { - return 0.0f; -} - -f32 RPGrpModelAnmG3D::VF_0x48(UNKTYPE) { - return 0.0f; -} - -int RPGrpModelAnmG3D::GetNumFrame(Anm anm, AnmIdx idx) const { - switch (anm) { - case Anm_Chr: { - return mppAnmObjChrRes[idx]->GetResAnm().GetNumFrame(); - } - - case Anm_Clr: { - return mppAnmObjMatClrRes[idx]->GetResAnm().GetNumFrame(); - } - - case Anm_TexPat: { - return mppAnmObjTexPatRes[idx]->GetResAnm().GetNumFrame(); - } - - case Anm_TexSrt: { - return mppAnmObjTexSrtRes[idx]->GetResAnm().GetNumFrame(); +void RPGrpModelG3D::ExecCallbackB(nw4r::g3d::WorldMtxManip* pManip, + nw4r::g3d::ResMdl /* mdl */, + nw4r::g3d::FuncObjCalcWorld* pFuncObj) { + if (!sJointWorldMtxInitialized) { + sJointWorldMtxInitialized = true; } - case Anm_Vis: { - return mppAnmObjVisRes[idx]->GetResAnm().GetNumFrame(); - } + pManip->GetMtx(&sJointWorldMtx); - case Anm_Shp: { - return mppAnmObjShpRes[idx]->GetResAnm().GetNumFrame(); - } + mpCallback->EditJointWorldMtx( + this, GetScnMdlSimple()->GetScnMdlCallbackNodeID(), &sJointWorldMtx); - case Anm_6: { - return unk88[idx]->GetResAnm().GetNumFrame(); - } - - case Anm_7: { - return unk8C[idx]->GetResAnm().GetNumFrame(); - } + pManip->SetMtx(&sJointWorldMtx); - default: { - return 0; - } - } + pFuncObj->SetCallbackNodeID(GetScnMdlSimple()->GetScnMdlCallbackNodeID()); } -RPGrpModelAnmG3D::AnmPlayPolicy -RPGrpModelAnmG3D::GetAnmPlayPolicy(Anm anm, AnmIdx idx) const { - nw4r::g3d::AnmPolicy policy; - - switch (anm) { - case Anm_Chr: { - policy = mppAnmObjChrRes[idx]->GetResAnm().GetAnmPolicy(); - break; - } - - case Anm_Clr: { - policy = mppAnmObjMatClrRes[idx]->GetResAnm().GetAnmPolicy(); - break; - } - - case Anm_TexPat: { - policy = mppAnmObjTexPatRes[idx]->GetResAnm().GetAnmPolicy(); - break; - } - - case Anm_TexSrt: { - policy = mppAnmObjTexSrtRes[idx]->GetResAnm().GetAnmPolicy(); - break; - } - - case Anm_Vis: { - policy = mppAnmObjVisRes[idx]->GetResAnm().GetAnmPolicy(); - break; - } - - case Anm_Shp: { - policy = mppAnmObjShpRes[idx]->GetResAnm().GetAnmPolicy(); - break; - } +void RPGrpModelG3D::ExecCallbackC(nw4r::math::MTX34* pMtxArray, + nw4r::g3d::ResMdl /* mdl */, + nw4r::g3d::FuncObjCalcWorld* /* pFuncObj */) { + spCalcWorldMtxArray = pMtxArray; + spCalcModel = this; - case Anm_6: { - policy = unk88[idx]->GetResAnm().GetAnmPolicy(); - break; + if (mpCallback != NULL) { + mpCallback->EditWorldMtx(this); } - case Anm_7: { - policy = unk8C[idx]->GetResAnm().GetAnmPolicy(); - break; + if (mpRecord != NULL) { + mpRecord->Calc(this); } - default: { - // @bug Policy variable is possibly uninitialized -#if defined(BUG_FIX) - policy = nw4r::g3d::ANM_POLICY_ONETIME; -#endif - break; - } - } - - return FROM_G3D_POLICY[policy]; -} - -void RPGrpModelAnmG3D::SetFrame(Anm anm, AnmIdx idx, f32 frame) { - GetAnmObj(anm, idx)->SetFrame(frame); -} - -f32 RPGrpModelAnmG3D::GetFrame(Anm anm, AnmIdx idx) const { - return GetAnmObj(anm, idx)->GetFrame(); -} - -void RPGrpModelAnmG3D::SetUpdateRate(Anm anm, AnmIdx idx, f32 rate) { - GetAnmObj(anm, idx)->SetUpdateRate(rate); -} - -nw4r::g3d::AnmObj* RPGrpModelAnmG3D::GetAnmObj(Anm anm, AnmIdx idx) const { - return InternalGetAnmObj(anm, idx); -} - -f32 RPGrpModelAnmG3D::GetUpdateRate(Anm anm, AnmIdx idx) const { - return GetAnmObj(anm, idx)->GetUpdateRate(); + spCalcWorldMtxArray = NULL; + spCalcModel = NULL; } diff --git a/src/Pack/RPGraphics/RPGrpModelImplement.cpp b/src/Pack/RPGraphics/RPGrpModelImplement.cpp index dbe2b5af3..3d7cbfa46 100644 --- a/src/Pack/RPGraphics/RPGrpModelImplement.cpp +++ b/src/Pack/RPGraphics/RPGrpModelImplement.cpp @@ -21,7 +21,9 @@ RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, u8 viewNo, u32 typeOption, bufferOption, viewNo); } +#if defined(VERSION_RSPE01_01) mpModelEx = new EGG::ModelEx(pScnObj); +#endif } RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, int idx, u8 viewNo, @@ -45,7 +47,9 @@ RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, int idx, u8 viewNo, bufferOption, viewNo); } +#if defined(VERSION_RSPE01_01) mpModelEx = new EGG::ModelEx(pScnObj); +#endif } RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, const char* pName, u8 viewNo, @@ -69,9 +73,12 @@ RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, const char* pName, u8 viewNo, bufferOption, viewNo); } +#if defined(VERSION_RSPE01_01) mpModelEx = new EGG::ModelEx(pScnObj); +#endif } +#ifdef VERSION_RSPE01_01 void RPGrpModelG3D::Configure() { RPGrpModel::Configure(); @@ -90,12 +97,13 @@ void RPGrpModelG3D::Configure() { void RPGrpModelG3D::CreateAnm() { mpModelAnm = RPGrpModelAnmG3D::Construct(this); } +#endif IRPGrpModelCallback* RPGrpModelG3D::SetCallback(IRPGrpModelCallback* pCallback) { IRPGrpModelCallback* pOldCallback = mpCallback; mpCallback = pCallback; - +#if defined(VERSION_RSPE01_01) if (pCallback == NULL) { GetScnMdlSimple()->DisableScnMdlCallbackTiming( nw4r::g3d::ScnObj::CALLBACK_TIMING_ALL); @@ -103,10 +111,12 @@ RPGrpModelG3D::SetCallback(IRPGrpModelCallback* pCallback) { GetScnMdlSimple()->EnableScnMdlCallbackTiming( nw4r::g3d::ScnObj::CALLBACK_TIMING_ALL); } +#endif return pOldCallback; } +#if defined(VERSION_RSPE01_01) void RPGrpModelG3D::InternalCalc() { if (!mReverseCulling) { if (GetScnLeaf() != NULL) { @@ -164,6 +174,7 @@ bool RPGrpModelG3D::IsJointVisible(u32 idx) const { return GetScnMdlSimple()->GetResMdl().GetResNode(idx).IsVisible(); } } +#endif void RPGrpModelG3D::ExecCallback_CALC_WORLD( nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj* /* pObj */, @@ -173,7 +184,7 @@ void RPGrpModelG3D::ExecCallback_CALC_MAT(nw4r::g3d::ScnObj::Timing timing, nw4r::g3d::ScnObj* /* pObj */, u32 /* param */, void* /* pInfo */) { - if (!(unkC & 0x40)) { + if (!(unkFlag & 0x40)) { if (timing & nw4r::g3d::ScnObj::CALLBACK_TIMING_A) { CalcMaterial(); } diff --git a/src/Pack/RPGraphics/RPGrpModelResManager.cpp b/src/Pack/RPGraphics/RPGrpModelResManager.cpp index e20fe86bf..316d17984 100644 --- a/src/Pack/RPGraphics/RPGrpModelResManager.cpp +++ b/src/Pack/RPGraphics/RPGrpModelResManager.cpp @@ -167,7 +167,7 @@ void* RPGrpModelResManager::GetPtr(Type type, RPGrpHandle handle, } case Type_ResAnmScn: { - return mpResList[handle].pResFile->Get().GetResAnmShp(pName).ptr(); + return mpResList[handle].pResFile->Get().GetResAnmScn(pName).ptr(); } default: { @@ -223,7 +223,7 @@ void* RPGrpModelResManager::GetPtr(Type type, RPGrpHandle handle, } case Type_ResAnmScn: { - return mpResList[handle].pResFile->Get().GetResAnmShp(index).ptr(); + return mpResList[handle].pResFile->Get().GetResAnmScn(index).ptr(); } default: { @@ -404,7 +404,7 @@ bool RPGrpModelResManager::HasFile(Type type, RPGrpHandle handle, } case Type_ResAnmScn: { - return mpResList[handle].pResFile->Get().GetResAnmShp(pName).IsValid(); + return mpResList[handle].pResFile->Get().GetResAnmScn(pName).IsValid(); } default: { diff --git a/src/Pack/RPGraphics/RPGrpModelRfl.cpp b/src/Pack/RPGraphics/RPGrpModelRfl.cpp index 7111faac3..235ff9920 100644 --- a/src/Pack/RPGraphics/RPGrpModelRfl.cpp +++ b/src/Pack/RPGraphics/RPGrpModelRfl.cpp @@ -21,6 +21,7 @@ nw4r::math::MTX34 RPGrpModelRfl::lbl_804A4608( ); // clang-format on +#if defined(VERSION_RSPE01_01) RPGrpModelRfl* RPGrpModelRfl::Construct(RFLDataSource src, u16 index, RFLMiddleDB* pMiddleDB, RFLResolution resolution, u32 exprFlags, @@ -50,6 +51,7 @@ RPGrpModelRfl* RPGrpModelRfl::Construct(RFLDataSource src, u16 index, return p; } +#endif RPGrpModelRfl::RPGrpModelRfl(RFLResolution resolution, u32 exprFlags, u8 viewNo) : RPGrpModel(viewNo), @@ -66,7 +68,9 @@ RPGrpModelRfl::RPGrpModelRfl(RFLResolution resolution, u32 exprFlags, u8 viewNo) *static_cast(pScnRfl->GetUserData()) = this; +#if defined(VERSION_RSPE01_01) mpModelEx = new EGG::ModelEx(pScnRfl); +#endif } void RPGrpModelRfl::Configure() { @@ -82,9 +86,11 @@ void RPGrpModelRfl::Configure() { sDrawCoreSetting.posNrmMtxID = GX_PNMTX0; sDrawCoreSetting.reverseCulling = false; +#if defined(VERSION_RSPE01_01) GetScnRfl()->SetLightSetIdx(LIGHT_SET_IDX); GetScnRfl()->SetFogIdx(FOG_IDX); GetScnRfl()->SetAmbientColor((GXColor){255, 255, 255, 255}); +#endif mBrightnessColor = (GXColor){255, 255, 255, 255}; InternalCalc(); @@ -108,6 +114,7 @@ u16 RPGrpModelRfl::ReplaceTexture(const char* pName, return 1; } +#if defined(VERSION_RSPE01_01) void RPGrpModelRfl::InternalCalc() { if (!mReverseCulling) { nw4r::math::VEC3 scale(mBaseScale.x * sBaseScale, @@ -148,7 +155,9 @@ void RPGrpModelRfl::InternalCalc() { spCalcWorldMtxArray = NULL; } } +#endif +#if defined(VERSION_RSPE01_01) void RPGrpModelRfl::CalcBeforeDraw() { RPGrpModel::CalcBeforeDraw(); @@ -159,6 +168,7 @@ void RPGrpModelRfl::CalcBeforeDraw() { mFlagsRfl &= ~0x200; } } +#endif void RPGrpModelRfl::DrawProc(nw4r::g3d::ScnRfl* pScnRfl, const RFLCharModel* pModel, u32 diffMask, @@ -188,7 +198,7 @@ void RPGrpModelRfl::DrawGX(const RFLCharModel* pModel, u32 diffMask, bool useMat = !(EGG::ModelEx::getDrawFlag() & EGG::ModelEx::cDrawFlag_IgnoreMaterial); - bool bVar3 = ((unkC & 0x20) || (mFlagsRfl & 0x8)) && mDrawGroup == 1; + bool bVar3 = ((unkFlag & 0x20) || (mFlagsRfl & 0x8)) && mDrawGroup == 1; bool bVar2 = !(mFlagsRfl & 0x400) || mDrawGroup == 1; bool bVar3_2 = opa && (mFlagsRfl & 0x40); @@ -252,7 +262,9 @@ void RPGrpModelRfl::DrawGX(const RFLCharModel* pModel, u32 diffMask, } nw4r::math::MTX34 viewMtx; +#if defined(VERSION_RSPE01_01) GetScnRfl()->GetMtx(nw4r::g3d::ScnObj::MTX_VIEW, &viewMtx); +#endif viewMtx._03 = viewMtx._13 = viewMtx._23 = 0.0f; GXLoadTexMtxImm(viewMtx, GX_TEXMTX0, GX_MTX_3x4); @@ -407,6 +419,7 @@ void RPGrpModelRfl::DrawGX(const RFLCharModel* pModel, u32 diffMask, } } +#if defined(VERSION_RSPE01_01) const char* RPGrpModelRfl::GetJointName(u16 /* idx */) const { static const char JOINT_NAME[] = "dummy"; return JOINT_NAME; @@ -421,3 +434,4 @@ const char* RPGrpModelRfl::GetShapeName(u16 /* idx */) const { static const char SHAPE_NAME[] = "dummy"; return SHAPE_NAME; } +#endif diff --git a/src/Pack/RPGraphics/RPGrpModelScene.cpp b/src/Pack/RPGraphics/RPGrpModelScene.cpp new file mode 100644 index 000000000..34a54f820 --- /dev/null +++ b/src/Pack/RPGraphics/RPGrpModelScene.cpp @@ -0,0 +1,21 @@ +#include + +RPGrpModelScene::~RPGrpModelScene() {} + +void RPGrpModelScene::CalcView() { + mpScnRootEx->UpdateFrame(); + mpScnRootEx->CalcWorld(); +} + +void RPGrpModelScene::g_calc_background() { + mIdx = 0; + mpScnRootEx->CalcVtx(); + mpScnRootEx->CalcMaterial(); +} + +void RPGrpModelScene::setupGX() const { + mpScnRootEx->getScreen().SetProjectionGX(); + mpLightManager->SetChanAmbColor(); + mpLightManager->LoadObjIndxGX(); + mpFogManager->GetFog(0)->SetGX(); +} diff --git a/src/Pack/RPGraphics/RPGrpRenderer.cpp b/src/Pack/RPGraphics/RPGrpRenderer.cpp new file mode 100644 index 000000000..9a1aaa500 --- /dev/null +++ b/src/Pack/RPGraphics/RPGrpRenderer.cpp @@ -0,0 +1,53 @@ +#include +#include + +static bool renderState; + +void RPGrpRenderer::Begin() { + f32 modify; + + sRendering = FALSE; + sRenderPass = RENDERPASS_BEGIN; + spCurrentScreen = &RPGrpScreen::GetRootScreen(); + EGG::GfxEngine::beginDraw(); + modify = RP_GET_INSTANCE(RPSysSystem)->getModifyRatio(); + EGG::StateGX::setModifyRatio(modify); +} + +void RPGrpRenderer::StartDebugDraw() { + EGG::Matrix34f mtx; + + RPGrpScreen clone(RPGrpScreen::GetRootScreen()); + clone.SetNearZ(0.0f); + clone.SetFarZ(1.0f); + clone.SetProjectionType(EGG::Frustum::PROJ_ORTHO); + clone.SetProjectionGX(); + + nw4r::math::MTX34Identity(&mtx); + GXLoadPosMtxImm(mtx, GX_PNMTX0); + GXLoadNrmMtxImm(mtx, GX_PNMTX0); +} + +void RPGrpRenderer::End() { + sRenderPass = RENDERPASS_END; +} + +RPGrpViewRender3D* RPGrpRenderer::CreateView3D(u8 viewNo, RPGrpCamera* camera, + RPGrpScreen* screen) { + RPGrpViewRender3D* render = new RPGrpViewRender3D(viewNo); + + render->Configure(); + render->AttachCamera(camera); + render->AttachScreen(screen); + + return render; +} + +void RPGrpRenderer::AppendDrawObject(IRPGrpDrawObject* pObject) { + if (pObject) { + mpDrawObj = pObject; + } else { + mpDrawObj = pObject; + mpDrawList = pObject; + } +} diff --git a/src/Pack/RPKernel/RPSysKokeshiIcon.cpp b/src/Pack/RPKernel/RPSysKokeshiIcon.cpp index ab703d688..443e7eedb 100644 --- a/src/Pack/RPKernel/RPSysKokeshiIcon.cpp +++ b/src/Pack/RPKernel/RPSysKokeshiIcon.cpp @@ -234,6 +234,7 @@ void RPSysKokeshiIcon::MakeTexture(RPGrpModel* pModel, BeginMakeTexture(); { pScnRoot->Clear(); +#if defined(VERSION_RSPE01_01) nw4r::g3d::ScnObj* pScnObj = NULL; if (pModel->GetKind() == RPGrpModel::Kind_RFL) { @@ -243,6 +244,7 @@ void RPSysKokeshiIcon::MakeTexture(RPGrpModel* pModel, } pScnRoot->PushBack(pScnObj); +#endif pScnRoot->CalcWorld(); pScnRoot->CalcMaterial(); diff --git a/src/egg/gfxe/eggLightObject.cpp b/src/egg/gfxe/eggLightObject.cpp new file mode 100644 index 000000000..dce799f9b --- /dev/null +++ b/src/egg/gfxe/eggLightObject.cpp @@ -0,0 +1,63 @@ +#include + +namespace EGG { + +void LightObject::Calc() { + mLightVector = mDir; + + mLightColor.a = mBrightnessColor.a; +} + +void LightObject::CalcView(const nw4r::math::MTX34& cameraMTX) { + nw4r::math::VEC3 camVec; + nw4r::math::VEC3 sumVec; + + if (mLightType == cLightType_Dir) { + camVec.z = -cameraMTX._22; + camVec.x = -cameraMTX._20; + camVec.y = -cameraMTX._21; + + if (nw4r::math::VEC3Len(&camVec) > 0.0f) { + C_VECHalfAngle(mDir, camVec, sumVec); + PSVECScale(sumVec, mLightVector, -1.0f); + } else { + mLightVector.y = 0.0f; + mLightVector.x = 0.0f; + mLightVector.z = 1.0f; + } + } +} + +void LightObject::InitGX(GXLightObj* pObj) const { +#line 281 + EGG_ASSERT(pObj); + if ((mFlags & 1) && (mFlags & 64)) { + GXInitLightColor(pObj, mLightColor); + //! TODO(texline) Variables are incomplete + } +} + +void LightObject::CalcDirDist() { + mDir.x = mAt.x - mPos.x; + mDir.y = mAt.y - mPos.y; + mDir.z = mAt.z - mPos.z; + + mDistance = nw4r::math::VEC3Len(&mDir); + if (mDistance > 0.0f) { + mDir /= mDistance; + } else { + mDir.z = 0.0f; + mDir.y = 0.0f; + mDir.x = 0.0f; + } +} + +void LightObject::CalcAt() { + //! Calculating all variables at once leads to (non-matching) paired singles + //! operations + mAt.x = (mDir.x * mDistance) + mPos.x; + mAt.y = (mDir.y * mDistance) + mPos.y; + mAt.z = (mDir.z * mDistance) + mPos.z; +} + +} // namespace EGG From b8dc71867970e0436acf7a31476f6fc76ad15c5b Mon Sep 17 00:00:00 2001 From: Texline666 <93364055+Tanline666@users.noreply.github.com> Date: Mon, 28 Sep 2026 10:50:04 -0600 Subject: [PATCH 2/3] Hotfix: forgot to move RPGrpModelAnmImplement changes --- .../RPGraphics/RPGrpModelAnmImplement.cpp | 1127 ++++++++++++++--- 1 file changed, 962 insertions(+), 165 deletions(-) diff --git a/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp b/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp index 3d7cbfa46..c6c869bc8 100644 --- a/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp +++ b/src/Pack/RPGraphics/RPGrpModelAnmImplement.cpp @@ -2,260 +2,1057 @@ #include -RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, u8 viewNo, u32 typeOption, - u32 bufferOption) - : RPGrpModel(viewNo) { +/****************************************************************************** + * + * RPGrpModelAnmG3D + * + ******************************************************************************/ - const nw4r::g3d::ResMdl mdl = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); +//! Animation object type conversion table +// clang-format off +const nw4r::g3d::ScnMdlSimple::AnmObjType RPGrpModelAnmG3D::TO_G3D_TYPE[Anm_Max] = { + nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_CHR, // Anm_Chr + nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_MATCLR, // Anm_Clr + nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_TEXPAT, // Anm_TexPat + nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_TEXSRT, // Anm_TexSrt + nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_VIS, // Anm_Vis + nw4r::g3d::ScnMdlSimple::ANMOBJTYPE_SHP, // Anm_Shp +}; +// clang-format on - nw4r::g3d::ScnObj* pScnObj; - u32 size; +//! Animation play policy conversion table +const RPGrpModelAnm::AnmPlayPolicy RPGrpModelAnmG3D::FROM_G3D_POLICY[] = { + AnmPlayPolicy_OneTime, // nw4r::g3d::ANM_POLICY_ONETIME + AnmPlayPolicy_Loop, // nw4r::g3d::ANM_POLICY_LOOP + AnmPlayPolicy_2, // ??? + AnmPlayPolicy_3, // ??? + AnmPlayPolicy_4, // ??? +}; - if (bufferOption == 0 && !(typeOption & TypeOption_NoSimple)) { - pScnObj = - nw4r::g3d::ScnMdlSimple::Construct(spAllocator, &size, mdl, viewNo); - } else { - pScnObj = nw4r::g3d::ScnMdl::Construct(spAllocator, &size, mdl, - bufferOption, viewNo); +void RPGrpModelAnmG3D::RegistFromResFile(Anm anm, AnmIdx idx, + RPGrpHandle handle, + const char* pName) { + InternalRegist(anm, idx); + + switch (anm) { + case Anm_Chr: { + const nw4r::g3d::ResAnmChr chr = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, pName); + + RegistAnmChr(idx, chr); + break; } -#if defined(VERSION_RSPE01_01) - mpModelEx = new EGG::ModelEx(pScnObj); -#endif + case Anm_Clr: { + const nw4r::g3d::ResAnmClr clr = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, pName); + + RegistAnmClr(idx, clr); + break; + } + + case Anm_TexPat: { + const nw4r::g3d::ResAnmTexPat pat = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, + pName); + + RegistAnmTexPat(idx, pat); + break; + } + + case Anm_TexSrt: { + const nw4r::g3d::ResAnmTexSrt srt = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, + pName); + + RegistAnmTexSrt(idx, srt); + break; + } + + case Anm_Vis: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, pName); + + RegistAnmVis(idx, vis); + break; + } + + case Anm_Shp: { + const nw4r::g3d::ResAnmShp shp = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, pName); + + RegistAnmShp(idx, shp); + break; + } + + case Anm_6: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, pName); + + RegistAnmVis(idx, vis); + break; + } + + case Anm_7: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, pName); + + RegistAnmVis(idx, vis); + break; + } + + default: { + break; + } + } } -RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, int idx, u8 viewNo, - u32 typeOption, u32 bufferOption) - : RPGrpModel(viewNo) { +void RPGrpModelAnmG3D::RegistFromResFile(Anm anm, AnmIdx idx, + RPGrpHandle handle, u32 id) { + InternalRegist(anm, idx); - const nw4r::g3d::ResFile file = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); + switch (anm) { + case Anm_Chr: { + const nw4r::g3d::ResAnmChr chr = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); - const nw4r::g3d::ResMdl mdl = file.GetResMdl(idx); + RegistAnmChr(idx, chr); + break; + } - nw4r::g3d::ScnObj* pScnObj; - u32 size; + case Anm_Clr: { + const nw4r::g3d::ResAnmClr clr = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); - if (bufferOption == 0 && !(typeOption & TypeOption_NoSimple)) { - pScnObj = - nw4r::g3d::ScnMdlSimple::Construct(spAllocator, &size, mdl, viewNo); - } else { - pScnObj = nw4r::g3d::ScnMdl::Construct(spAllocator, &size, mdl, - bufferOption, viewNo); + RegistAnmClr(idx, clr); + break; } -#if defined(VERSION_RSPE01_01) - mpModelEx = new EGG::ModelEx(pScnObj); -#endif + case Anm_TexPat: { + const nw4r::g3d::ResAnmTexPat pat = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); + + RegistAnmTexPat(idx, pat); + break; + } + + case Anm_TexSrt: { + const nw4r::g3d::ResAnmTexSrt srt = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); + + RegistAnmTexSrt(idx, srt); + break; + } + + case Anm_Vis: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); + + RegistAnmVis(idx, vis); + break; + } + + case Anm_Shp: { + const nw4r::g3d::ResAnmShp shp = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); + + RegistAnmShp(idx, shp); + break; + } + + case Anm_6: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); + + RegistAnmVis(idx, vis); + break; + } + + case Anm_7: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle, id); + + RegistAnmVis(idx, vis); + break; + } + + default: { + break; + } + } } -RPGrpModelG3D::RPGrpModelG3D(RPGrpHandle handle, const char* pName, u8 viewNo, - u32 typeOption, u32 bufferOption) - : RPGrpModel(viewNo) { +void RPGrpModelAnmG3D::Init() { + mppAnmObjChrRes = NULL; + mppAnmObjMatClrRes = NULL; + mppAnmObjTexPatRes = NULL; + mppAnmObjTexSrtRes = NULL; + mppAnmObjVisRes = NULL; + mppAnmObjShpRes = NULL; + unk88 = NULL; + unk8C = NULL; - const nw4r::g3d::ResFile file = - RPGrpModelResManager::GetCurrent() - ->GetData(handle); + for (int i = 0; i < Anm_Max; i++) { + unk90[i] = 0; + } - const nw4r::g3d::ResMdl mdl = file.GetResMdl(pName); + mpChrBlendInfo = NULL; + mpShpBlendInfo = NULL; +} - nw4r::g3d::ScnObj* pScnObj; - u32 size; +void RPGrpModelAnmG3D::SetAnmObj(Anm anm, nw4r::g3d::AnmObj** ppAnmObjs) { + switch (anm) { + case Anm_Chr: { + mppAnmObjChrRes = + reinterpret_cast(ppAnmObjs); + break; + } - if (bufferOption == 0 && !(typeOption & TypeOption_NoSimple)) { - pScnObj = - nw4r::g3d::ScnMdlSimple::Construct(spAllocator, &size, mdl, viewNo); - } else { - pScnObj = nw4r::g3d::ScnMdl::Construct(spAllocator, &size, mdl, - bufferOption, viewNo); + case Anm_Clr: { + mppAnmObjMatClrRes = + reinterpret_cast(ppAnmObjs); + break; + } + + case Anm_TexPat: { + mppAnmObjTexPatRes = + reinterpret_cast(ppAnmObjs); + break; + } + + case Anm_TexSrt: { + mppAnmObjTexSrtRes = + reinterpret_cast(ppAnmObjs); + break; + } + + case Anm_Vis: { + mppAnmObjVisRes = + reinterpret_cast(ppAnmObjs); + break; } -#if defined(VERSION_RSPE01_01) - mpModelEx = new EGG::ModelEx(pScnObj); + case Anm_Shp: { + mppAnmObjShpRes = + reinterpret_cast(ppAnmObjs); + break; + } + + case Anm_6: { + unk88 = reinterpret_cast(ppAnmObjs); + break; + } + + case Anm_7: { + unk8C = reinterpret_cast(ppAnmObjs); + break; + } + + default: { + break; + } + } + + InternalSetAnmObj(anm); +} + +nw4r::g3d::AnmObj* RPGrpModelAnmG3D::InternalGetAnmObj(Anm anm, + AnmIdx idx) const { + switch (anm) { + case Anm_Chr: { + return mppAnmObjChrRes[idx]; + } + + case Anm_Clr: { + return mppAnmObjMatClrRes[idx]; + } + + case Anm_TexPat: { + return mppAnmObjTexPatRes[idx]; + break; + } + + case Anm_TexSrt: { + return mppAnmObjTexSrtRes[idx]; + break; + } + + case Anm_Vis: { + return mppAnmObjVisRes[idx]; + break; + } + + case Anm_Shp: { + return mppAnmObjShpRes[idx]; + break; + } + + case Anm_6: { + return unk88[idx]; + break; + } + + case Anm_7: { + return unk8C[idx]; + break; + } + + default: { + return NULL; + } + } +} + +void RPGrpModelAnmG3D::VF_0x74(UNKTYPE) {} + +void RPGrpModelAnmG3D::Configure() { + RPGrpModelAnm::Configure(); + + for (int i = 0; i < Anm_Max; i++) { + unk90[i] = 0; + } + + mppAnmObjChrRes = NULL; + mppAnmObjMatClrRes = NULL; + mppAnmObjTexPatRes = NULL; + mppAnmObjTexSrtRes = NULL; + mppAnmObjVisRes = NULL; + mppAnmObjShpRes = NULL; + unk88 = NULL; + unk8C = NULL; + + mpChrBlendInfo = NULL; +#if defined(BUG_FIX) + mpShpBlendInfo = NULL; #endif } -#ifdef VERSION_RSPE01_01 -void RPGrpModelG3D::Configure() { - RPGrpModel::Configure(); +RPGrpModelAnmG3D::RPGrpModelAnmImplement(RPGrpModel* pModel) { + mpScnMdlSimple = pModel->GetScnMdlSimple(); + Init(); + + for (int i = 0; i < Anm_Max; i++) { + mpToIndexG3D[i] = NULL; + } +} + +void RPGrpModelAnmG3D::InternalSetAnmObj(Anm anm) { + mpToIndexG3D[anm] = new s8[GetAnmNum(anm)]; + + for (int i = 0; i < GetAnmNum(anm); i++) { + mpToIndexG3D[anm][i] = -1; + } + + switch (anm) { + case Anm_Chr: { + // TODO(kiwi) Why only one? SetBlendWeight could write way out of bounds + mpChrBlendInfo = new ChrBlendInfo[1]; + + mpChrBlendInfo[0].pAnmObj = nw4r::g3d::AnmObjChrBlend::Construct( + RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), 8); + + for (int i = 0; i < 8; i++) { + mpChrBlendInfo[0].toAnmIdx[i] = -1; + } + break; + } + + case Anm_Clr: { + if (GetAnmNum(Anm_Clr) >= 2) { + + mpAnmObjMatClrOverride = nw4r::g3d::AnmObjMatClrOverride::Construct( + RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), + GetAnmNum(Anm_Clr)); + + mpAnmObjMatClrOverride->Bind(mpScnMdlSimple->GetResMdl()); + mpScnMdlSimple->SetAnmObj(mpAnmObjMatClrOverride); + } else { + mpAnmObjMatClrOverride = NULL; + } + break; + } + + case Anm_TexPat: { + if (GetAnmNum(Anm_TexPat) >= 2) { + + mpAnmObjTexPatOverride = nw4r::g3d::AnmObjTexPatOverride::Construct( + RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), + GetAnmNum(Anm_TexPat)); + + mpAnmObjTexPatOverride->Bind(mpScnMdlSimple->GetResMdl()); + mpScnMdlSimple->SetAnmObj(mpAnmObjTexPatOverride); + } else { + mpAnmObjTexPatOverride = NULL; + } + break; + } + + case Anm_TexSrt: { + if (GetAnmNum(Anm_TexSrt) >= 2) { + + mpAnmObjTexSrtOverride = nw4r::g3d::AnmObjTexSrtOverride::Construct( + RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), + GetAnmNum(Anm_TexSrt)); + + mpAnmObjTexSrtOverride->Bind(mpScnMdlSimple->GetResMdl()); + mpScnMdlSimple->SetAnmObj(mpAnmObjTexSrtOverride); + } else { + mpAnmObjTexSrtOverride = NULL; + } + break; + } + + case Anm_Vis: { + if (GetAnmNum(Anm_Vis) >= 2) { + + mpAnmObjVisOR = nw4r::g3d::AnmObjVisOR::Construct( + RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl()); + + mpAnmObjVisOR->Bind(mpScnMdlSimple->GetResMdl()); + mpScnMdlSimple->SetAnmObj(mpAnmObjVisOR); + } else { + mpAnmObjVisOR = NULL; + } + break; + } + + case Anm_Shp: { + // TODO(kiwi) Why only one? SetBlendWeight could write way out of bounds + mpShpBlendInfo = new ShpBlendInfo[1]; + + mpShpBlendInfo[0].pAnmObj = nw4r::g3d::AnmObjShpBlend::Construct( + RPGrpModel::GetAllocator(), NULL, mpScnMdlSimple->GetResMdl(), 8); + + mpShpBlendInfo[0].pAnmObj->Bind(mpScnMdlSimple->GetResMdl()); + mpScnMdlSimple->SetAnmObj(mpShpBlendInfo[0].pAnmObj); + + for (int i = 0; i < 8; i++) { + mpShpBlendInfo[0].toAnmIdx[i] = -1; + } + break; + } + + default: { + break; + } + } +} + +void RPGrpModelAnmG3D::Regist(Anm anm, AnmIdx idx, RPGrpHandle handle) { + InternalRegist(anm, idx); + + switch (anm) { + case Anm_Chr: { + const nw4r::g3d::ResAnmChr chr = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); + + RegistAnmChr(idx, chr); + break; + } + + case Anm_Clr: { + const nw4r::g3d::ResAnmClr clr = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); + + RegistAnmClr(idx, clr); + break; + } + + case Anm_TexPat: { + const nw4r::g3d::ResAnmTexPat pat = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); + + RegistAnmTexPat(idx, pat); + break; + } + + case Anm_TexSrt: { + const nw4r::g3d::ResAnmTexSrt srt = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); + + RegistAnmTexSrt(idx, srt); + break; + } + + case Anm_Vis: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); + + RegistAnmVis(idx, vis); + break; + } + + case Anm_Shp: { + const nw4r::g3d::ResAnmShp shp = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); + + RegistAnmShp(idx, shp); + break; + } - GetScnMdlSimple()->SetScnObjCallback(this); - GetScnMdlSimple()->SetScnMdlCallback(this); + case Anm_6: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); - GetScnMdlSimple()->EnableScnObjCallbackTiming( - nw4r::g3d::ScnObj::CALLBACK_TIMING_A); + RegistAnmVis(idx, vis); + break; + } - GetScnMdlSimple()->EnableScnObjCallbackExecOp( - nw4r::g3d::ScnObj::EXECOP_CALC_MAT); + case Anm_7: { + const nw4r::g3d::ResAnmVis vis = + RPGrpModelResManager::GetCurrent() + ->GetData(handle); - InternalCalc(); + RegistAnmVis(idx, vis); + break; + } + + default: { + break; + } + } } -void RPGrpModelG3D::CreateAnm() { - mpModelAnm = RPGrpModelAnmG3D::Construct(this); +bool RPGrpModelAnmG3D::Start(Anm anm, AnmIdx idx, f32 frame) { + if (anm != Anm_Chr && anm != Anm_Shp) { + mpAnmFlags[anm][idx] |= AnmFlag_PlayingG3D; + + if (GetAnmNum(anm) >= 2) { + switch (anm) { + case Anm_Clr: { + u8 g3dIdx = 0; + mpAnmObjMatClrOverride->DetachAll(); + + for (int i = 0; i < GetAnmNum(Anm_Clr); i++) { + if (!IsPlayingG3D(Anm_Clr, i)) { + continue; + } + + mpAnmObjMatClrOverride->Attach(g3dIdx, + mppAnmObjMatClrRes[i]); + mpToIndexG3D[Anm_Clr][idx] = g3dIdx++; + } + break; + } + + case Anm_TexPat: { + u8 g3dIdx = 0; + mpAnmObjTexPatOverride->DetachAll(); + + for (int i = 0; i < GetAnmNum(Anm_TexPat); i++) { + if (!IsPlayingG3D(Anm_TexPat, i)) { + continue; + } + + mpAnmObjTexPatOverride->Attach(g3dIdx, + mppAnmObjTexPatRes[i]); + mpToIndexG3D[Anm_TexPat][idx] = g3dIdx++; + } + break; + } + + case Anm_TexSrt: { + u8 g3dIdx = 0; + mpAnmObjTexSrtOverride->DetachAll(); + + for (int i = 0; i < GetAnmNum(Anm_TexSrt); i++) { + if (!IsPlayingG3D(Anm_TexSrt, i)) { + continue; + } + + mpAnmObjTexSrtOverride->Attach(g3dIdx, + mppAnmObjTexSrtRes[i]); + mpToIndexG3D[Anm_TexSrt][idx] = g3dIdx++; + } + break; + } + + case Anm_Vis: { + u8 g3dIdx = 0; + mpAnmObjVisOR->DetachAll(); + + for (int i = 0; i < GetAnmNum(Anm_Vis); i++) { + if (!IsPlayingG3D(Anm_Vis, i)) { + continue; + } + + mpAnmObjVisOR->Attach(g3dIdx, mppAnmObjVisRes[i]); + mpToIndexG3D[Anm_Vis][idx] = g3dIdx++; + } + break; + } + + default: { + break; + } + } + + } else if (anm != Anm_Chr && anm != Anm_Shp) { + nw4r::g3d::AnmObj* pAnmObj = InternalGetAnmObj(anm, idx); + + if (pAnmObj != mpScnMdlSimple->GetAnmObj(TO_G3D_TYPE[anm])) { + mpScnMdlSimple->RemoveAnmObj(TO_G3D_TYPE[anm]); + mpScnMdlSimple->SetAnmObj(pAnmObj); + } + } + } + + return RPGrpModelAnm::Start(anm, idx, frame); } + +bool RPGrpModelAnmG3D::Cancel(Anm anm, AnmIdx idx) { + bool success = RPGrpModelAnm::Cancel(anm, idx); + + if (!success) { + return false; + } + + if (anm == Anm_Chr || anm == Anm_Shp) { + s8 blendIdx = GetBlendIndex(anm, idx, 0); + + if (blendIdx != -1) { + RemoveBlendAnm(anm, blendIdx, 0); + } + + } else if (IsPlayingG3D(anm, idx)) { + mpAnmFlags[anm][idx] &= ~AnmFlag_PlayingG3D; + + if (GetAnmNum(anm) >= 2) { + switch (anm) { + case Anm_Clr: { + mpAnmObjMatClrOverride->Detach(mpToIndexG3D[Anm_Clr][idx]); + break; + } + + case Anm_TexPat: { + mpAnmObjTexPatOverride->Detach(mpToIndexG3D[Anm_TexPat][idx]); + break; + } + + case Anm_TexSrt: { + mpAnmObjTexSrtOverride->Detach(mpToIndexG3D[Anm_TexSrt][idx]); + break; + } + + case Anm_Vis: { + mpAnmObjVisOR->Detach(mpToIndexG3D[Anm_Vis][idx]); + break; + } + + default: { + break; + } + } + + mpToIndexG3D[anm][idx] = -1; + + } else { + // @bug Messed up the expression somehow? +#if defined(BUG_FIX) + success = mpScnMdlSimple->RemoveAnmObj(TO_G3D_TYPE[anm]) != NULL; +#else + mpScnMdlSimple->RemoveAnmObj(TO_G3D_TYPE[anm]); + success = success != 0; #endif + } -IRPGrpModelCallback* -RPGrpModelG3D::SetCallback(IRPGrpModelCallback* pCallback) { - IRPGrpModelCallback* pOldCallback = mpCallback; - mpCallback = pCallback; -#if defined(VERSION_RSPE01_01) - if (pCallback == NULL) { - GetScnMdlSimple()->DisableScnMdlCallbackTiming( - nw4r::g3d::ScnObj::CALLBACK_TIMING_ALL); } else { - GetScnMdlSimple()->EnableScnMdlCallbackTiming( - nw4r::g3d::ScnObj::CALLBACK_TIMING_ALL); + success = false; } -#endif - return pOldCallback; + return success; } -#if defined(VERSION_RSPE01_01) -void RPGrpModelG3D::InternalCalc() { - if (!mReverseCulling) { - if (GetScnLeaf() != NULL) { - GetScnLeaf()->SetScale(mBaseScale); +s16 RPGrpModelAnmG3D::SetBlendAnm(Anm anm, u8 arg1, AnmIdx idx) { + s16 uVar1 = RPGrpModelAnm::SetBlendAnm(anm, arg1, idx); + + if (uVar1 != idx) { + switch (anm) { + case Anm_Chr: { + mpChrBlendInfo[0].pAnmObj->Attach(arg1, mppAnmObjChrRes[idx]); + mpChrBlendInfo[0].toAnmIdx[arg1] = idx; + + if (IsEnableChrAnm() && + mpChrBlendInfo[0].pAnmObj->GetParent() == NULL) { + + mpScnMdlSimple->SetAnmObj(mpChrBlendInfo[0].pAnmObj); + } + break; } - } else { - const nw4r::math::_VEC3& rMag = GEOMETRY_MAGNIFY[mReverseCulling - 1]; - nw4r::math::VEC3 scale(mBaseScale.x * rMag.x, mBaseScale.y * rMag.y, - mBaseScale.z * rMag.z); + case Anm_Shp: { + mpShpBlendInfo[0].pAnmObj->Attach(arg1, mppAnmObjShpRes[idx]); + mpShpBlendInfo[0].toAnmIdx[arg1] = idx; + break; + } - if (GetScnLeaf() != NULL) { - GetScnLeaf()->SetScale(scale); + default: { + break; + } } } - if (mpRecord != NULL) { - GetScnMdlSimple()->EnableScnMdlCallbackTiming( - nw4r::g3d::ScnMdl::CALLBACK_TIMING_C); + return uVar1; +} + +void RPGrpModelAnmG3D::SetBlendWeight(Anm anm, u8 g3dIndex, f32 weight, + u8 blendIdx) { + switch (anm) { + case Anm_Chr: { + mpChrBlendInfo[blendIdx].pAnmObj->SetWeight(g3dIndex, weight); + break; } - if (GetScnObj() != NULL) { - GetScnObj()->G3dProc(nw4r::g3d::G3dObj::G3DPROC_CALC_WORLD, 0, NULL); + case Anm_Shp: { + mpShpBlendInfo[blendIdx].pAnmObj->SetWeight(g3dIndex, weight); + break; + } + + default: { + break; + } } } -void RPGrpModelG3D::CalcBeforeDraw() { - RPGrpModel::CalcBeforeDraw(); +s16 RPGrpModelAnmG3D::RemoveBlendAnm(Anm anm, u8 arg1, u8 arg2) { + s16 idx = GetBlendAnm(anm, arg1, arg2); - if (mpCallback != NULL) { - spCalcViewMtxArray = GetScnMdlSimple()->GetViewPosMtxArray(); - spCalcModel = this; + if (idx != -1) { + mpAnmFlags[anm][static_cast(idx)] &= ~AnmFlag_PlayingG3D; + + switch (anm) { + case Anm_Chr: { + mpChrBlendInfo[arg2].pAnmObj->Detach(arg1); + mpChrBlendInfo[arg2].toAnmIdx[arg1] = -1; + break; + } - mpCallback->ReferViewMtx(this); + case Anm_Shp: { + mpShpBlendInfo[arg2].pAnmObj->Detach(arg1); + mpShpBlendInfo[arg2].toAnmIdx[arg1] = -1; + break; + } - spCalcViewMtxArray = NULL; - spCalcModel = NULL; + default: { + break; + } + } } + + return idx; } -void RPGrpModelG3D::SetJointVisible(u32 idx, bool enable) { - if (GetScnMdl() != NULL) { - nw4r::g3d::ScnMdl::CopiedVisAccess access(GetScnMdl(), idx); - access.SetVisibilityEx(enable); - } else { - GetScnMdlSimple()->GetResMdl().GetResNode(idx).SetVisibility(enable); +s16 RPGrpModelAnmG3D::GetBlendAnm(Anm anm, u8 arg1, u8 arg2) { + switch (anm) { + case Anm_Chr: { + return mpChrBlendInfo[arg2].toAnmIdx[arg1]; + } + + case Anm_Shp: { + return mpShpBlendInfo[arg2].toAnmIdx[arg1]; + } + + default: { + return -1; + } } } -bool RPGrpModelG3D::IsJointVisible(u32 idx) const { - if (GetScnMdl() != NULL) { - nw4r::g3d::ScnMdl::CopiedVisAccess access(GetScnMdl(), idx); - return access.IsVisible(); - } else { - return GetScnMdlSimple()->GetResMdl().GetResNode(idx).IsVisible(); +f32 RPGrpModelAnmG3D::GetBlendWeight(Anm anm, u8 arg1, u8 arg2) { + switch (anm) { + case Anm_Chr: { + return mpChrBlendInfo[arg2].pAnmObj->GetWeight(arg1); + } + + case Anm_Shp: { + return mpShpBlendInfo[arg2].pAnmObj->GetWeight(arg1); + } + + default: { + return 0.0f; + } } } -#endif -void RPGrpModelG3D::ExecCallback_CALC_WORLD( - nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj* /* pObj */, - u32 /* param */, void* /* pInfo */) {} +// clang-format off +static nw4r::g3d::AnmObjChr::BindOption TO_BIND_OPTION[RPGrpModelAnm::BindType_Max] = { + nw4r::g3d::AnmObjChr::BIND_ONE, // BindType_One + nw4r::g3d::AnmObjChr::BIND_PARTIAL, // BindType_Partial +}; +// clang-format on -void RPGrpModelG3D::ExecCallback_CALC_MAT(nw4r::g3d::ScnObj::Timing timing, - nw4r::g3d::ScnObj* /* pObj */, - u32 /* param */, void* /* pInfo */) { +void RPGrpModelAnmG3D::ReBindChrAnmNode(u16 arg0, u16 arg1, BindType type) { + mppAnmObjChrRes[arg0]->Release(); + mppAnmObjChrRes[arg0]->Bind(mpScnMdlSimple->GetResMdl(), arg1, + TO_BIND_OPTION[type]); +} - if (!(unkFlag & 0x40)) { - if (timing & nw4r::g3d::ScnObj::CALLBACK_TIMING_A) { - CalcMaterial(); +void RPGrpModelAnmG3D::ReleaseChrAnmNode(u16 arg0, u16 arg1, BindType type) { + mppAnmObjChrRes[arg0]->Release(mpScnMdlSimple->GetResMdl(), arg1, + TO_BIND_OPTION[type]); +} + +void RPGrpModelAnmG3D::UpdateFrame() { + for (int i = 0; i < Anm_Max; i++) { + if (i == Anm_Chr && IsBlending(Anm_Chr) && IsEnableChrAnm()) { + s16 idx = GetBlendAnm(Anm_Chr, 0, 0); + f32 rate = GetUpdateRate(Anm_Chr, idx); + + rate = unk60 - nw4r::math::FAbs(rate); + unk60 = rate; + + if (rate <= 0.0f) { + unk64 = 0.0f; + unk60 = 0.0f; + + SetBlendWeight(Anm_Chr, 0, 1.0f, 0); + RemoveBlendAnm(Anm_Chr, 1, 0); + } else { + f32 weight = rate / unk64; + SetBlendWeight(Anm_Chr, 0, 1.0f - weight, 0); + SetBlendWeight(Anm_Chr, 1, weight, 0); + } } - } else if (timing & nw4r::g3d::ScnObj::CALLBACK_TIMING_C) { - CalcMaterial(); } } -void RPGrpModelG3D::ExecCallback_DRAW_OPA( - nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj* /* pObj */, - u32 /* param */, void* /* pInfo */) { +void RPGrpModelAnmG3D::InternalCalc() {} + +void RPGrpModelAnmG3D::SetEnableQuaternionBlend(bool enable) { + RPGrpModelAnm::SetEnableQuaternionBlend(enable); + + mpChrBlendInfo[0].pAnmObj->SetAnmFlag( + nw4r::g3d::AnmObj::FLAG_USE_QUATERNION_ROTATION_BLEND, + IsEnableQuaternionBlend()); +} + +void RPGrpModelAnmG3D::SetEnableChrAnm(bool enable) { + RPGrpModelAnm::SetEnableChrAnm(enable); + + if (IsEnableChrAnm()) { + if (mpChrBlendInfo[0].pAnmObj->GetParent() == NULL && + mpChrBlendInfo[0].pAnmObj->TestAnmFlag( + nw4r::g3d::AnmObj::FLAG_ANM_BOUND)) { + + mpScnMdlSimple->SetAnmObj(mpChrBlendInfo[0].pAnmObj); + } + } else if (mpChrBlendInfo[0].pAnmObj->GetParent() != NULL) { + mpScnMdlSimple->RemoveAnmObj(mpChrBlendInfo[0].pAnmObj); + } +} + +void RPGrpModelAnmG3D::VF_0x70(UNKTYPE) {} + +void RPGrpModelAnmG3D::RegistAnmChr(AnmIdx idx, + const nw4r::g3d::ResAnmChr chr) { + const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); + + u32 size; + mppAnmObjChrRes[idx] = nw4r::g3d::AnmObjChrRes::Construct( + RPGrpModel::GetAllocator(), &size, chr, mdl, false); + + mppAnmObjChrRes[idx]->Bind(mdl); +} + +void RPGrpModelAnmG3D::RegistAnmClr(AnmIdx idx, + const nw4r::g3d::ResAnmClr clr) { + const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); + + u32 size; + mppAnmObjMatClrRes[idx] = nw4r::g3d::AnmObjMatClrRes::Construct( + RPGrpModel::GetAllocator(), &size, clr, mdl, false); - nw4r::g3d::G3DState::Invalidate(nw4r::g3d::G3DState::INVALIDATE_TEV); + mppAnmObjMatClrRes[idx]->Bind(mdl); } -void RPGrpModelG3D::ExecCallback_DRAW_XLU( - nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj* /* pObj */, - u32 /* param */, void* /* pInfo */) { +void RPGrpModelAnmG3D::RegistAnmTexPat(AnmIdx idx, + const nw4r::g3d::ResAnmTexPat pat) { + const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); + + u32 size; + mppAnmObjTexPatRes[idx] = nw4r::g3d::AnmObjTexPatRes::Construct( + RPGrpModel::GetAllocator(), &size, pat, mdl, false); - nw4r::g3d::G3DState::Invalidate(nw4r::g3d::G3DState::INVALIDATE_TEV); + mppAnmObjTexPatRes[idx]->Bind(mdl); } -void RPGrpModelG3D::ExecCallbackA(nw4r::g3d::ChrAnmResult* pResult, - nw4r::g3d::ResMdl /* mdl */, - nw4r::g3d::FuncObjCalcWorld* pFuncObj) { - nw4r::math::MTX34 trans; - nw4r::math::VEC3 scale; +void RPGrpModelAnmG3D::RegistAnmTexSrt(AnmIdx idx, + const nw4r::g3d::ResAnmTexSrt srt) { + const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); - pResult->GetRotTrans(&trans); - pResult->GetScale(&scale); + u32 size; + mppAnmObjTexSrtRes[idx] = nw4r::g3d::AnmObjTexSrtRes::Construct( + RPGrpModel::GetAllocator(), &size, srt, mdl, false); - mpCallback->EditJointLocalMtx( - this, GetScnMdlSimple()->GetScnMdlCallbackNodeID(), &trans, &scale); + mppAnmObjTexSrtRes[idx]->Bind(mdl); +} - pResult->SetRotTrans(&trans); - pResult->SetScale(&scale); +void RPGrpModelAnmG3D::RegistAnmVis(AnmIdx idx, + const nw4r::g3d::ResAnmVis vis) { + const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); - pFuncObj->SetCallbackNodeID(GetScnMdlSimple()->GetScnMdlCallbackNodeID()); + u32 size; + mppAnmObjVisRes[idx] = nw4r::g3d::AnmObjVisRes::Construct( + RPGrpModel::GetAllocator(), &size, vis, mdl); + + mppAnmObjVisRes[idx]->Bind(mdl); } -void RPGrpModelG3D::ExecCallbackB(nw4r::g3d::WorldMtxManip* pManip, - nw4r::g3d::ResMdl /* mdl */, - nw4r::g3d::FuncObjCalcWorld* pFuncObj) { - if (!sJointWorldMtxInitialized) { - sJointWorldMtxInitialized = true; +void RPGrpModelAnmG3D::RegistAnmShp(AnmIdx idx, + const nw4r::g3d::ResAnmShp chr) { + const nw4r::g3d::ResMdl mdl = mpScnMdlSimple->GetResMdl(); + + u32 size; + mppAnmObjShpRes[idx] = nw4r::g3d::AnmObjShpRes::Construct( + RPGrpModel::GetAllocator(), &size, chr, mdl, false); + + mppAnmObjShpRes[idx]->Bind(mdl); +} + +f32 RPGrpModelAnmG3D::VF_0x44(UNKTYPE) { + return 0.0f; +} + +f32 RPGrpModelAnmG3D::VF_0x48(UNKTYPE) { + return 0.0f; +} + +int RPGrpModelAnmG3D::GetNumFrame(Anm anm, AnmIdx idx) const { + switch (anm) { + case Anm_Chr: { + return mppAnmObjChrRes[idx]->GetResAnm().GetNumFrame(); + } + + case Anm_Clr: { + return mppAnmObjMatClrRes[idx]->GetResAnm().GetNumFrame(); + } + + case Anm_TexPat: { + return mppAnmObjTexPatRes[idx]->GetResAnm().GetNumFrame(); + } + + case Anm_TexSrt: { + return mppAnmObjTexSrtRes[idx]->GetResAnm().GetNumFrame(); } - pManip->GetMtx(&sJointWorldMtx); + case Anm_Vis: { + return mppAnmObjVisRes[idx]->GetResAnm().GetNumFrame(); + } - mpCallback->EditJointWorldMtx( - this, GetScnMdlSimple()->GetScnMdlCallbackNodeID(), &sJointWorldMtx); + case Anm_Shp: { + return mppAnmObjShpRes[idx]->GetResAnm().GetNumFrame(); + } - pManip->SetMtx(&sJointWorldMtx); + case Anm_6: { + return unk88[idx]->GetResAnm().GetNumFrame(); + } + + case Anm_7: { + return unk8C[idx]->GetResAnm().GetNumFrame(); + } - pFuncObj->SetCallbackNodeID(GetScnMdlSimple()->GetScnMdlCallbackNodeID()); + default: { + return 0; + } + } } -void RPGrpModelG3D::ExecCallbackC(nw4r::math::MTX34* pMtxArray, - nw4r::g3d::ResMdl /* mdl */, - nw4r::g3d::FuncObjCalcWorld* /* pFuncObj */) { - spCalcWorldMtxArray = pMtxArray; - spCalcModel = this; +RPGrpModelAnmG3D::AnmPlayPolicy +RPGrpModelAnmG3D::GetAnmPlayPolicy(Anm anm, AnmIdx idx) const { + nw4r::g3d::AnmPolicy policy; + + switch (anm) { + case Anm_Chr: { + policy = mppAnmObjChrRes[idx]->GetResAnm().GetAnmPolicy(); + break; + } + + case Anm_Clr: { + policy = mppAnmObjMatClrRes[idx]->GetResAnm().GetAnmPolicy(); + break; + } + + case Anm_TexPat: { + policy = mppAnmObjTexPatRes[idx]->GetResAnm().GetAnmPolicy(); + break; + } + + case Anm_TexSrt: { + policy = mppAnmObjTexSrtRes[idx]->GetResAnm().GetAnmPolicy(); + break; + } + + case Anm_Vis: { + policy = mppAnmObjVisRes[idx]->GetResAnm().GetAnmPolicy(); + break; + } + + case Anm_Shp: { + policy = mppAnmObjShpRes[idx]->GetResAnm().GetAnmPolicy(); + break; + } - if (mpCallback != NULL) { - mpCallback->EditWorldMtx(this); + case Anm_6: { + policy = unk88[idx]->GetResAnm().GetAnmPolicy(); + break; } - if (mpRecord != NULL) { - mpRecord->Calc(this); + case Anm_7: { + policy = unk8C[idx]->GetResAnm().GetAnmPolicy(); + break; } - spCalcWorldMtxArray = NULL; - spCalcModel = NULL; + default: { + // @bug Policy variable is possibly uninitialized +#if defined(BUG_FIX) + policy = nw4r::g3d::ANM_POLICY_ONETIME; +#endif + break; + } + } + + return FROM_G3D_POLICY[policy]; +} + +void RPGrpModelAnmG3D::SetFrame(Anm anm, AnmIdx idx, f32 frame) { + GetAnmObj(anm, idx)->SetFrame(frame); +} + +f32 RPGrpModelAnmG3D::GetFrame(Anm anm, AnmIdx idx) const { + return GetAnmObj(anm, idx)->GetFrame(); +} + +void RPGrpModelAnmG3D::SetUpdateRate(Anm anm, AnmIdx idx, f32 rate) { + GetAnmObj(anm, idx)->SetUpdateRate(rate); +} + +nw4r::g3d::AnmObj* RPGrpModelAnmG3D::GetAnmObj(Anm anm, AnmIdx idx) const { + return InternalGetAnmObj(anm, idx); +} + +f32 RPGrpModelAnmG3D::GetUpdateRate(Anm anm, AnmIdx idx) const { + return GetAnmObj(anm, idx)->GetUpdateRate(); } From 6f123a14cc5fc2359aa0157efaa60daa19370fd1 Mon Sep 17 00:00:00 2001 From: Texline666 <93364055+Tanline666@users.noreply.github.com> Date: Thu, 15 Oct 2026 10:06:44 -0600 Subject: [PATCH 3/3] Implementing feedback --- include/egg/gfxe/eggFogManager.h | 2 +- include/egg/gfxe/eggLightManager.h | 9 --------- include/egg/gfxe/eggLightObject.h | 2 +- include/egg/gfxe/eggScnRootEx.h | 3 --- include/egg/gfxe/eggScreen.h | 5 +---- include/egg/gfxe/eggStateGX.h | 3 +++ include/egg/math/eggMatrix.h | 5 +---- src/Pack/RPGraphics/RPGrpModel.cpp | 4 +--- src/egg/gfxe/eggLightObject.cpp | 2 -- 9 files changed, 8 insertions(+), 27 deletions(-) diff --git a/include/egg/gfxe/eggFogManager.h b/include/egg/gfxe/eggFogManager.h index 202d4c7e7..b4a42e16d 100644 --- a/include/egg/gfxe/eggFogManager.h +++ b/include/egg/gfxe/eggFogManager.h @@ -29,7 +29,7 @@ class FogManager { void LoadScnFog(const nw4r::g3d::ResAnmScn scn, f32 frame); void DoneDraw(); - Fog* GetFog(int id) { + Fog* GetFog(int id) const { return mFog[id]; } diff --git a/include/egg/gfxe/eggLightManager.h b/include/egg/gfxe/eggLightManager.h index 2c1748708..37a7ad6b0 100644 --- a/include/egg/gfxe/eggLightManager.h +++ b/include/egg/gfxe/eggLightManager.h @@ -26,17 +26,8 @@ class LightManager : IBinary { void Calc(nw4r::g3d::ScnRoot*); void CalcView(const nw4r::math::MTX34&, u8, nw4r::g3d::ScnRoot*); - /** - * @brief Sets ambient color registers - * - * @details Channel 0 is set to current value of m_pAmbColor0, - * while channel 1 is set to black - */ void SetChanAmbColor() const; - /** - * @brief Loads light registers with contents of array index - */ void LoadObjIndxGX() const; void DoneDraw(); diff --git a/include/egg/gfxe/eggLightObject.h b/include/egg/gfxe/eggLightObject.h index 6f8e26ad7..235f61cef 100644 --- a/include/egg/gfxe/eggLightObject.h +++ b/include/egg/gfxe/eggLightObject.h @@ -58,7 +58,7 @@ class LightObject : IBinary { void InitGX(GXLightObj* pObj) const; - void CopyToG3D_World(nw4r::g3d::ScnRoot& pScnRoot) const; + void CopyToG3D_World(nw4r::g3d::ScnRoot* pScnRoot) const; void CopyFromG3D(nw4r::g3d::LightAnmResult* pResult, f32 frame); diff --git a/include/egg/gfxe/eggScnRootEx.h b/include/egg/gfxe/eggScnRootEx.h index a6890a941..3d5286937 100644 --- a/include/egg/gfxe/eggScnRootEx.h +++ b/include/egg/gfxe/eggScnRootEx.h @@ -58,9 +58,6 @@ class ScnRootEx : public IDrawGX { void SetCurrentCamera(int idx, const nw4r::math::MTX34& rCameraMtx, const Screen& rScreen); - /** - * @brief Calculates view matrices for each 3D object in scene - */ void CalcView(); void GatherDrawScnObj(); diff --git a/include/egg/gfxe/eggScreen.h b/include/egg/gfxe/eggScreen.h index bab637f51..d3587f86d 100644 --- a/include/egg/gfxe/eggScreen.h +++ b/include/egg/gfxe/eggScreen.h @@ -46,10 +46,7 @@ class Screen : public Frustum { CanvasMode canvasMode); Screen(const Screen& rOther); - virtual ~Screen() {} // at 0x8 - /** - * @brief Sets projection matrix - */ + virtual ~Screen() {} // at 0x8 virtual void SetProjectionGX() const; // at 0xC virtual void CopyToG3D(nw4r::g3d::Camera camera) const; // at 0x10 diff --git a/include/egg/gfxe/eggStateGX.h b/include/egg/gfxe/eggStateGX.h index 9338615ee..8231a3b6e 100644 --- a/include/egg/gfxe/eggStateGX.h +++ b/include/egg/gfxe/eggStateGX.h @@ -1,5 +1,7 @@ #ifndef EGG_GFXE_STATE_GX_H #define EGG_GFXE_STATE_GX_H +#include + #include #include @@ -7,6 +9,7 @@ #include #include + namespace EGG { class StateGX { diff --git a/include/egg/math/eggMatrix.h b/include/egg/math/eggMatrix.h index 84a4879fe..d3e4fbc16 100644 --- a/include/egg/math/eggMatrix.h +++ b/include/egg/math/eggMatrix.h @@ -76,10 +76,7 @@ class Matrix34f : public nw4r::math::MTX34 { f32 z = _20 * rVec.x + _21 * rVec.y + _22 * rVec.z; return Vector3f(x, y, z); } - /** - * @brief Creates a 3x4 identity matrix. As identity matrices are - * square, the fourth column is zeroed out. - */ + void makeIdentity(); void makeQ(const Quatf& rQuat); diff --git a/src/Pack/RPGraphics/RPGrpModel.cpp b/src/Pack/RPGraphics/RPGrpModel.cpp index c773d02a4..cfc0c5016 100644 --- a/src/Pack/RPGraphics/RPGrpModel.cpp +++ b/src/Pack/RPGraphics/RPGrpModel.cpp @@ -88,9 +88,7 @@ RPGrpModel::RPGrpModel(u8 viewNo) spGenList = this; nw4r::math::MTX34Identity(&mtx14); //! @bug only in rev 0: mBaseScale was already initialized - mBaseScale.z = 1.0f; - mBaseScale.y = 1.0f; - mBaseScale.x = 1.0f; + mBaseScale.x = mBaseScale.y = mBaseScale.z = 1.0f; } #elif defined(VERSION_RSPE01_01) diff --git a/src/egg/gfxe/eggLightObject.cpp b/src/egg/gfxe/eggLightObject.cpp index dce799f9b..a780ccc21 100644 --- a/src/egg/gfxe/eggLightObject.cpp +++ b/src/egg/gfxe/eggLightObject.cpp @@ -53,8 +53,6 @@ void LightObject::CalcDirDist() { } void LightObject::CalcAt() { - //! Calculating all variables at once leads to (non-matching) paired singles - //! operations mAt.x = (mDir.x * mDistance) + mPos.x; mAt.y = (mDir.y * mDistance) + mPos.y; mAt.z = (mDir.z * mDistance) + mPos.z;