From aac010eb71f7e3010b3e3b3d4df4128a55c482b4 Mon Sep 17 00:00:00 2001 From: KeybadeBlox Date: Thu, 19 Feb 2026 21:16:11 -0500 Subject: [PATCH] Add PlayerCharId type --- decompile/objdiff.json | 2 +- decompile/src/JSRF/GameData.cpp | 6 ++--- decompile/src/JSRF/GameData.hpp | 42 +++++++++++++++++++++++++++------ ghidra/symboltable.tsv | 14 +++++------ 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/decompile/objdiff.json b/decompile/objdiff.json index d7ccccf..4b711b0 100644 --- a/decompile/objdiff.json +++ b/decompile/objdiff.json @@ -40,7 +40,7 @@ }, "symbol_mappings": { "?finalizeGameData@@YAXXZ": "_$E2", - "?initGameData@@YGXXZ": "_$E1" + "?initGameData@@YAXXZ": "_$E1" } } ] diff --git a/decompile/src/JSRF/GameData.cpp b/decompile/src/JSRF/GameData.cpp index 1b6f69f..5a5e7d4 100644 --- a/decompile/src/JSRF/GameData.cpp +++ b/decompile/src/JSRF/GameData.cpp @@ -45,18 +45,18 @@ unsigned GameData::getSpawnPosIndex() { } // Address: 0x00039CB0 -void GameData::unlockCharacter(unsigned charId) { // Status: unimplemented +void GameData::unlockCharacter(PlayerCharId charId) { } // Address: 0x00039CF0 -void GameData::lockCharacter(unsigned charId) { // Status: unimplemented +void GameData::lockCharacter(PlayerCharId charId) { } // Address: 0x00039D10 -BOOL GameData::characterUnlocked(unsigned charId) { // Status: unimplemented +BOOL GameData::characterUnlocked(PlayerCharId charId) { return 0; } diff --git a/decompile/src/JSRF/GameData.hpp b/decompile/src/JSRF/GameData.hpp index 0169de2..d19a335 100644 --- a/decompile/src/JSRF/GameData.hpp +++ b/decompile/src/JSRF/GameData.hpp @@ -8,6 +8,34 @@ Save data and closely-related runtime data. #include "../XDK/Win32.h" +// Enum that should probably go somewhere else +enum PlayerCharId { + PCHARID_BEAT, + PCHARID_CORN, + PCHARID_GUM, + PCHARID_COMBO, + PCHARID_RHYTH, + PCHARID_SODA, + PCHARID_YOYO, + PCHARID_NT3000, + PCHARID_GARAM, + PCHARID_BOOGIE, + PCHARID_CUBE, + PCHARID_LOVESHOCKERS, + PCHARID_POISONJAM, + PCHARID_NOISETANK, + PCHARID_IMMORTALS, + PCHARID_DOOMRIDERS, + PCHARID_RAPID99, + PCHARID_POTTS, + PCHARID_GOUJI, + PCHARID_ROBOY, + PCHARID_CLUTCH, + PCHARID_JAZZ, + PCHARID_AKUMU, + PCHARID_ZEROBEAT +}; + // Data structure actually saved to disk struct SaveData { unsigned chapter; @@ -93,10 +121,10 @@ enum TestRunType { // Unpacked version of TestRunScoreSaved struct TestRunScore { - unsigned score; - unsigned character; - unsigned rank1; // Used by Jet Tech - unsigned rank2; // Used by other test runs + unsigned score; + PlayerCharId character; + unsigned rank1; // Used by Jet Tech + unsigned rank2; // Used by other test runs }; // Numeric IDs for different timers @@ -140,9 +168,9 @@ struct GameData { void setMissionDigits34 (unsigned val); void setSpawnPosIndex (unsigned val); unsigned getSpawnPosIndex (); - void unlockCharacter (unsigned charId); - void lockCharacter (unsigned charId); - BOOL characterUnlocked (unsigned charId); + void unlockCharacter (PlayerCharId charId); + void lockCharacter (PlayerCharId charId); + BOOL characterUnlocked (PlayerCharId charId); BOOL checkFlagConditions (unsigned * conds , unsigned count); void writeStateFlags (unsigned * writes, unsigned count); BOOL checkFlagConditionUnpacked(FlagList flagList, unsigned index); diff --git a/ghidra/symboltable.tsv b/ghidra/symboltable.tsv index cbf9cf2..14b47d1 100755 --- a/ghidra/symboltable.tsv +++ b/ghidra/symboltable.tsv @@ -238,9 +238,9 @@ 0x00039c80 func void __thiscall notinline nofixup GameData::setMissionDigits34 uint missionDigits34 0x00039c90 func void __thiscall notinline nofixup GameData::setSpawnPosIndex uint index 0x00039ca0 func uint __thiscall notinline nofixup GameData::getSpawnPosIndex -0x00039cb0 func void __thiscall notinline nofixup GameData::unlockCharacter PlayerCharId32 charId -0x00039cf0 func void __thiscall notinline nofixup GameData::lockCharacter PlayerCharId32 charId -0x00039d10 func BOOL __thiscall notinline nofixup GameData::characterUnlocked PlayerCharId32 charId +0x00039cb0 func void __thiscall notinline nofixup GameData::unlockCharacter PlayerCharId charId +0x00039cf0 func void __thiscall notinline nofixup GameData::lockCharacter PlayerCharId charId +0x00039d10 func BOOL __thiscall notinline nofixup GameData::characterUnlocked PlayerCharId charId 0x00039d40 func BOOL __thiscall notinline nofixup GameData::checkFlagConditions uint * conds uint count 0x00039d80 func void __thiscall notinline nofixup GameData::writeStateFlags uint * writes uint count 0x00039db0 func BOOL __thiscall notinline nofixup GameData::checkFlagConditionUnpacked FlagList flagList uint index @@ -343,7 +343,7 @@ 0x0004c070 func void __thiscall notinline nofixup Mission::waitForSomething 0x0004c400 func void __thiscall notinline nofixup Mission::showTextForFrame 0x0004ca20 func void __thiscall notinline nofixup Mission::setPauseOptions Call_SetPauseOptions * args -0x0004d5f0 func undefined __stdcall notinline nofixup populateSomeCharIdArray PlayerCharId32 * buf +0x0004d5f0 func undefined __stdcall notinline nofixup populateSomeCharIdArray PlayerCharId * buf 0x0004d880 func void __thiscall notinline nofixup Mission::setManyPlayerStateFieldsToOne 0x0004db30 func void default notinline nofixup resolveMissionBinPtrs MissionBin * mssn 0x0004e930 func void __stdcall notinline nofixup newMission uint chapter uint idDigits34 BOOL param_3 @@ -446,7 +446,7 @@ 0x0006f600 func undefined __cdecl notinline nofixup showReconnectNAndStartMessage1 uint controllerId 0x0006f650 func undefined __cdecl notinline nofixup showReconnectNAndStartMessage2 uint controllerId 0x0006f6a0 func void __cdecl notinline nofixup showReconnectControllerMessage -0x0006f6d0 func void default notinline nofixup showCharacterJoinMessage PlayerCharId32 character undefined4 controller +0x0006f6d0 func void default notinline nofixup showCharacterJoinMessage PlayerCharId character undefined4 controller 0x0006f730 func undefined unknown notinline nofixup showProblemWithDisc 0x0006f760 func undefined unknown notinline nofixup showSaveLoadErr 0x0006f9c0 func undefined4 * __thiscall notinline nofixup UnknownStatic27::~UnknownStatic27 byte param_1 @@ -1126,7 +1126,7 @@ 0x001f9358 data UnknownStatic13Part g_unknownStatic13PartDefault 0x001f93c8 data UnknownStatic13 g_unknownStatic13 0x001f9640 data UnknownStatic13Part * g_unchangingUnknownStatic3Ptr -0x001f9808 data PlayerCharId32[32] charIds +0x001f9808 data PlayerCharId[32] charIds 0x001f9888 data SwitcherMethod *[119] Mission::exec_1Funcs 0x001f9a68 data SwitcherMethod *[119] Mission::exec_5Funcs 0x001f9c48 data SwitcherMethod *[119] Mission::exec_3Funcs @@ -1176,7 +1176,7 @@ 0x0021c234 data uint[5] tagIdsPoisonJam 0x0021c248 data uint[5] tagIdsImmortals 0x0021c25c data uint[5] tagIdsZeroBeat -0x0021c450 data PlayerCharId32[24] someCharIdArray +0x0021c450 data PlayerCharId[24] someCharIdArray 0x0021c510 data EvCharId[24] someCharIdMapping 0x0021c570 data char *[5] hasJoinedYou 0x0021c584 data undefined * testRunRankNamesJa