diff --git a/decompile/Makefile b/decompile/Makefile index 3303154..92d8f5f 100644 --- a/decompile/Makefile +++ b/decompile/Makefile @@ -6,10 +6,5 @@ all: src/JSRF/Jet2.obj CL.EXE /nologo /Wall /TP /W3 /Ogityb0 /MT /GX /Fo$@ /c $< # Header files used for each object -src/JSRF/Jet2.obj: src/JSRF/Core.hpp src/Std.hpp src/XDK/D3D.hpp\ - src/XDK/Win32.hpp - -src/JSRF/Core.obj: src/JSRF/Core.hpp src/Smilebit/MMatrix.hpp src/Std.hpp\ - src/XDK/D3D.hpp src/XDK/Win32.hpp - -src/JSRF/GameData.obj: src/JSRF/GameData.hpp +src/JSRF/Jet2.obj: src/JSRF/Core.hpp src/XDK/D3D.hpp src/XDK/Win32.hpp\ + src/Std.hpp diff --git a/decompile/objdiff.json b/decompile/objdiff.json index 3cb19c1..5bd8d18 100644 --- a/decompile/objdiff.json +++ b/decompile/objdiff.json @@ -117,18 +117,6 @@ "RootExecObj::~RootExecObj": "??1RootExecObj@@UAE@XZ", "removeFromObjListByIndex": "?removeFromObjListByIndex@@YAXW4GameObjIndex@@@Z" } - }, - { - "name": "JSRF/GameData", - "target_path": "target/JSRF/GameData.obj", - "base_path": "src/JSRF/GameData.obj", - "metadata": { - "complete": false, - "source_path": "src/JSRF/GameData.cpp" - }, - "symbol_mappings": { - "GameData::`scalar_deleting_destructor'": "??_GGameData@@UAEPAXI@Z" - } } ] } diff --git a/decompile/src/JSRF/GameData.cpp b/decompile/src/JSRF/GameData.cpp deleted file mode 100644 index 0fda95f..0000000 --- a/decompile/src/JSRF/GameData.cpp +++ /dev/null @@ -1,10 +0,0 @@ -/* JSRF Decompilation: JSRF/GameData.hpp -Save data and closely-related runtime data. -*/ - -#pragma bss_seg(".data") - -#include "GameData.hpp" - - -GameData g_gameData = GameData(); diff --git a/decompile/src/JSRF/GameData.hpp b/decompile/src/JSRF/GameData.hpp deleted file mode 100644 index 278f2d9..0000000 --- a/decompile/src/JSRF/GameData.hpp +++ /dev/null @@ -1,164 +0,0 @@ -/* JSRF Decompilation: JSRF/GameData.hpp -Save data and closely-related runtime data. -*/ - -#ifndef GAMEDATA_HPP -#define GAMEDATA_HPP - -#include "../XDK/Win32.hpp" - - -// Data structure actually saved to disk -struct SaveData { - unsigned chapter; - unsigned missionDigits34; - unsigned spawnPosIndex; - unsigned playtimeFrames; - unsigned unlockedChars; - - // Boolean flags read and written by missions - unsigned chapterFlags[16]; // Reset every chapter - unsigned globalFlags [16]; // Never reset - unsigned specialFlags[16]; // Never reset; special effects like - // unlocking/completing tutorials, finishing - // street challenges - - unsigned spawnedSouls [8]; // Souls that have appeared on streets - unsigned collectedSouls[8]; // Souls that have been acquired - unsigned heldSouls [8]; // Souls currently usable (i.e. not stolen) - - unsigned unusedPerStageBitmask[16]; - - // Which tags have been sprayed and by who - // Indexed by stage, tag ID, and player/rival tag; rival tags don't - // count towards completion and can be painted over. Each entry is a - // packed bit array of 3 bits per "G" mark, valued 7 if nothing is - // painted or 0-3 to indicate player 1-4 painted it (in story mode, - // rival graffiti is considered painted by players 2-4). - unsigned tagState[16][80][2]; - - struct SaveSettings { - float volumeMusic; - float volumeSfx; - BOOL rumbleEnabled; - unsigned unused[29]; - } saveSettings; - - unsigned garageMusic; - unsigned unusedBitfield[8]; - - // Sewer switches at offset 0 then noise tanks at offset 3 - unsigned miscObjectives[32]; - - struct TestRunScoreSaved { - unsigned score; - unsigned char character; - unsigned char rank1; // Used by Jet Tech - unsigned char rank2; // Used by other test runs - } highScores[16][4][5]; - - unsigned clutchTimer; - unsigned unusedTimer; - - unsigned selectedTags [5]; // Like GameData but for P1 in 1-player - unsigned customTagSelected[5]; // Like GameData but for P1 in 1-player - - unsigned eventsSeen[16]; -}; - -// Numeric IDs for selecting different listss of state flags -enum FlagList { - FLAGLIST_MISSION, - FLAGLIST_CHAPTER, - FLAGLIST_GLOBAL, - FLAGLIST_SPECIAL -}; - -// Numeric IDs for tag sizes (should maybe put somewhere else?) -enum TagSize { TAGSIZE_SS, TAGSIZE_S, TAGSIZE_M, TAGSIZE_L, TAGSIZE_XL }; - -// Numeric IDs for different test run categories -enum TestRunType { - TESTRUN_GRAFFITI, - TESTRUN_TECH, - TESTRUN_DASH, - TESTRUN_FLAG -}; - -// Unpacked version of TestRunScoreSaved -struct TestRunScore { - unsigned score; - unsigned character; - unsigned rank1; // Used by Jet Tech - unsigned rank2; // Used by other test runs -}; - -// Numeric IDs for different timers -enum Timer { TIMER_DEATHBALLPRACTICE, TIMER_CLUTCH, TIMER_UNUSED }; - -// Save data-ish data structure used at runtime -extern struct GameData { - SaveData saveActive; - SaveData saveStashed; // Holds save data during test runs/tutorials - - unsigned missionFlags[16]; // Reset every mission transition - unsigned deathBallPracticeTimer; // For Jazz sequence in Future Site - - // Indexed like SaveData.highScores; true if score is most recent and - // also made leaderboard - BOOL mostRecentHighScore[16][4][5]; - - // Tags indexed by single or multiplayer, then gang (GGs, Golden - // Rhinos/Zero Beat, Poison Jam, Immortals) or player, then size - unsigned selectedTags [2][4][5]; // IDs of tags in use - BOOL customTagSelected[2][4][5]; // True means tag ID is for custom - // graffiti list, not ingame list - - BOOL checkFlagCondition (unsigned cond); - void writeStateFlag (unsigned flagVal); - void incrementChapter (); - void setMissionDigits34 (unsigned val); - void setSpawnPosIndex (unsigned val); - unsigned getSpawnPosIndex (); - void unlockCharacter (unsigned charId); - void lockCharacter (unsigned charId); - BOOL characterUnlocked (unsigned charId); - BOOL checkFlagConditions (unsigned * conds , unsigned count); - void writeStateFlags (unsigned * writes, unsigned count); - BOOL checkFlagConditionUnpacked(FlagList flagList, unsigned index); - void writeStateFlagUnpacked (FlagList flagList, unsigned index, unsigned val); - void setSoulSpawned (unsigned soulId); - BOOL getSoulSpawned (unsigned soulId); - void setSoulCollected (unsigned soulId); - BOOL getSoulHeld (unsigned soulId); - BOOL soulSpawnedUncollected(unsigned soulId); - void clearHeldSouls (); - void restoreHeldSouls (); - unsigned getSoulCount (); - unsigned getTotalSoulsInStage(unsigned stageId); - unsigned getHeldSoulsInStage (unsigned stageId); - unsigned setSoulCollectedBySize(TagSize size, unsigned index); - void setUnusedPerStageBitmask(unsigned stageId, unsigned index); - int getTagState (unsigned stageId, unsigned index, BOOL rivalTag); - void setTagState (unsigned stageId, unsigned index, BOOL rivalTag, unsigned val); - void setTagCovered (unsigned stageId, unsigned index, BOOL rivalTag, unsigned gangOrPlayer); - void setVolumeSettings (float volMusic, float volSfx); - void getVolumeSettings (float * outMusic, float * outSfx); - void setRumbleEnabled (BOOL val); - BOOL getRumbleEnabled (); - void setGarageMusic (unsigned songId); - unsigned getGarageMusic (); - void setUnusedBitfield (unsigned index); - void setMiscObjective (unsigned index); - BOOL getMiscObjective (unsigned index); - unsigned countMiscObjectives (); - BOOL getHighScore (unsigned stageId, TestRunType type, unsigned rank, TestRunScore * out); - void incrementTimer (Timer timer); - unsigned getTimer (Timer timer); - void setTimer (Timer timer, unsigned frames); - - GameData(); - virtual ~GameData(); -} g_gameData; - -#endif diff --git a/delink/objects.csv b/delink/objects.csv index 5cc7ec1..58357f8 100644 --- a/delink/objects.csv +++ b/delink/objects.csv @@ -1,6 +1,5 @@ Object,Delink?,.text,.text$x,D3D,DSOUND,MMATRIX,XGRPH,XPP,.rdata,.rdata$x,.data,DOLBY JSRF/Core.obj,true,0x00011000-0x00013FEB,0x00186BA0-0x00186C14,,,,,,0x001C4390-0x001C44F9,0x001E4D20-0x001E4DAB,0x001EB880-0x001EB933, -JSRF/GameData.obj,true,0x00039B50-0x0003B937,,,,,,,0x001CA16C-0x001CA3DB,,0x001EFC88-0x001F7047, JSRF/Jet2.obj,true,0x0006F9E0-0x0006FA6F,0x00187710-0x00187724,,,,,,,0x001E620C-0x001E622F,0x0022FCE0-0x0022FCE3, ADX (need to decompose),false,0x0013A570-0x0014555F,?,,,,,,?,?,?, XDK Core (need to decompose),false,0x00145560-0x0014B79F,?,,,,,,?,?,?, @@ -12,4 +11,4 @@ Direct3D8 (need to decompose),false,,,0x0018CB40-0x0019E334,,,,,?,?,?, DirectSound8 (need to decompose),false,,,,0x0019E340-0x001BA89B,,,,?,?,?,0x0027E080-0x00284E17 MMatrix.obj,false,,,,,0x001BA8A0-0x001BBAAF,,,,,0x00264BD8-0x00264C13, Xgraphics (need to decompose),false,,,,,,0x001BBAC0-0x001BC7BB,,,,, -XDK Peripherals (need to decompose),false,,,,,,,0x001BC7C0-0x001C3F57,,,, +XDK Peripherals,false,,,,,,,0x001BC7C0-0x001C3F57,,,, diff --git a/delink/symboltable.tsv b/delink/symboltable.tsv index 2061e04..39a6247 100644 --- a/delink/symboltable.tsv +++ b/delink/symboltable.tsv @@ -24,8 +24,8 @@ destructChildren 00011b90 f getParent 00011bd0 f removeFromObjList 00011be0 f removeChildrenFromObjList 00011c20 f -nopMethod1Arg 00011c80 f -nopMethod0Arg 00011c90 f +nopDraw 00011c80 f +nopExec 00011c90 f copySomeVectors 00011ca0 f `scalar_deleting_destructor' 00011ce0 f recursivePostExecDefault 00011d00 f @@ -49,7 +49,7 @@ setEventNextFrame 000126f0 f setFreezeCamNextFrame 00012710 f setUncoveredPauseNextFrame 00012730 f enableDrawChildren 00012750 f -enableSkipDraw 00012760 f +setSkipDraw 00012760 f fatal 00012770 f setDrawMode 000127b0 f setGlobal 000127c0 f @@ -200,7 +200,7 @@ readMissionDat 00030850 f readPeople 00031160 f readCurrentPlayer 000320a0 f readPlayer 00032c70 f -methodReturnTrue 00033800 f +return1 00033800 f initProgress 00033870 f getProgress 000338a0 f readProgress 00033a80 f @@ -239,59 +239,31 @@ checkFlagConditions 00039d40 f writeStateFlags 00039d80 f checkFlagConditionUnpacked 00039db0 f writeStateFlagUnpacked 00039de0 f -setSoulSpawned 00039e10 f -getSoulSpawned 00039e40 f -setSoulCollected 00039e80 f -getSoulHeld 00039eb0 f -soulSpawnedUncollected 00039ef0 f -clearHeldSouls 00039f40 f -restoreHeldSouls 00039f60 f +setGraffitiSoulSpawned 00039e10 f +getGraffitiSoulSpawned 00039e40 f +giveSoul 00039e80 f +clearCollectedSouls 00039f40 f +restoreCollectedSouls 00039f60 f getSoulCount 00039fd0 f -getTotalSoulsInStage 0003a0a0 f -getHeldSoulsInStage 0003a130 f -setSoulCollectedBySize 0003a2b0 f -setUnusedPerStageBitmask 0003a2f0 f -getTagState 0003a340 f -setTagState 0003a3a0 f -setTagCovered 0003a400 f -setVolumeSettings 0003a4a0 f +setSomeSoulCollected 0003a2f0 f +getSomeCollectedSouls 0003a340 f +setSomeCollectedSouls 0003a3a0 f +setSomeCollectedSoulsRepeating 0003a400 f getVolumeSettings 0003a4c0 f -setRumbleEnabled 0003a4e0 f -getRumbleEnabled 0003a4f0 f setGarageMusic 0003a500 f getGarageMusic 0003a510 f -setUnusedBitfield 0003a520 f -setMiscObjective 0003a550 f -getMiscObjective 0003a580 f -countMiscObjectives 0003a5c0 f -getHighScore 0003a690 f -incrementTimer 0003a750 f -getTimer 0003a780 f -setTimer 0003a7b0 f -setSelectedTag 0003a7f0 f -getSelectedTag 0003a820 f -setCustomTagSelected 0003a840 f -getCustomTagSelected 0003a870 f +incrementSomeFrameCount 0003a750 f +getSomeFrameCount_MAYBE 0003a780 f +setSomeFrameCountToSeconds 0003a7b0 f setEventSeen 0003a890 f eventSeen 0003a8c0 f incrementPlaytime 0003a900 f -getSaveDataSize 0003a910 f -decrypt 0003a920 f -encrypt 0003ab60 f -getSaveDescription 0003ae00 f +getSomeConstant 0003a910 f clearStateFlags 0003ae20 f -resetTimer 0003aea0 f -GameData 0003aed0 f -resetSelectedTags 0003b3c0 f -resetExceptSettingsAndSouls 0003b420 f -resetExceptSettingsAndHighScores 0003b5a0 f -resetExceptSettings 0003b640 f -stash 0003b680 f -stashRestoreExceptSpecialFlags 0003b6a0 f -stashRestoreExceptHighScores 0003b6f0 f -stashRestore 0003b790 f -`scalar_deleting_destructor' 0003b7c0 f -addHighScore 0003b7e0 f +setFrameCountToZero 0003aea0 f +SaveData 0003aed0 f +setSomeArrayValues 0003b3c0 f +~SaveData 0003b7c0 f UnknownAllocated_0x1166 0003c150 f ~TextRenderer_MAYBE 0003c2b0 f draw 0003c310 f @@ -443,7 +415,6 @@ showProblemWithDisc 0006f730 f showSaveLoadErr 0006f760 f ~UnknownStatic27 0006f9c0 f _main 0006f9e0 f -resetHighScores 00077400 f ~UnknownAllocated_0x1167_2 000780f0 f UnknownAllocated_0x1167_2 00078520 f _~UnknownAllocated_0x1167_2 000789d0 f @@ -484,7 +455,7 @@ SomePlayerStateChild 00084200 f ~UnknownObj_0x50 00085410 f _~UnknownObj_0x50 00086180 f dealDamage_MAYBE 00092ff0 f -methodReturn0 00093ce0 f +return0 00093ce0 f setTired_MAYBE 0009bd90 f ~PlayerCamera 000a2820 f draw 000a2960 f @@ -864,7 +835,7 @@ initUnknownStatic04 0018ad20 f initUnknownStatic05 0018ad30 f initUnknownStatic06 0018ad40 f initUnknownStatic07 0018ad50 f -initGameData 0018ad60 f +initSaveData 0018ad60 f initUnknownStatic09 0018ad80 f initUnknownStatic10 0018ada0 f initUnknownStatic11 0018adb0 f @@ -904,7 +875,7 @@ initUnknownStatic44 0018c5b0 f initUnknownStatic45 0018c6f0 f initUnknownStatic46 0018c810 f ~UnknownStatic06 0018c980 f -~GameData 0018c9a0 f +~SaveData 0018c9a0 f ~UnknownStatic13 0018c9f0 f ~GraphicsSettings 0018caa0 f ~UnknownStatic25 0018caf0 f @@ -970,7 +941,7 @@ vtable 001c4d50 l vtable 001c4d58 l vtable 001c4f68 l vtable 001ca168 l -`vftable' 001ca3d8 l +vtable 001ca3d8 l vtable 001ca440 l vtable 001ca4c8 l vtable 001ca508 l @@ -1054,7 +1025,6 @@ drawFuncArgs 001eb880 l g_unknownStatic02 001eb994 l g_unknownStatic04 001ebaa8 l g_unknownStatic05 001ebabc l -g_soundBanks 001ebe00 l g_unknownStatic06 001ec050 l fileInitializers 001ec068 l fileReaders 001ec0f0 l @@ -1064,7 +1034,6 @@ fileFreers 001ec288 l enemyFilenames 001ec310 l enemyInitializers 001ec370 l enemySoundEffectMapping 001ec3d0 l -g_MarkPressTextFilenames 001ee218 l playerFilenames 001ee5f8 l animationsMap 001ee658 l playerSoundFilenameIdMap 001ee6b8 l @@ -1072,15 +1041,10 @@ animationsNames 001ee718 l talkEventMapping 001eeb6c l logoFilenames 001efc5c l g_unknownStatic07 001efc74 l -g_stageIdToStageIndex 001efc88 l -g_defaultHeldSouls 001efd78 l -g_defaultSpawnedSouls 001efdc8 l -g_defaultSelectedTags 001efe68 l -g_unusedDebugStrings 001efeb8 l -g_gameData 001effb0 l +someStageSoulMapping 001efc88 l +g_saveData 001effb0 l someJaTextParameter 001f8b30 l someSpaceTextParameter 001f8b58 l -g_soullIdToStageIndex 001f8c38 l fullscreenViewport 001f90b0 l g_unknownStatic13PartDefault 001f9358 l g_unknownStatic13 001f93c8 l @@ -1126,11 +1090,6 @@ stageNames 0021ba68 l charNamesJa 0021ba80 l charNamesEn 0021bae0 l charNames 0021bc60 l -g_stageIds 0021c098 l -g_jetGraffitiStageIds 0021c0f8 l -g_jetTechStageIds 0021c12c l -g_jetDashStageIds 0021c160 l -g_jetFlagStageIds 0021c194 l stageToCharIdArrayIndex_MAYBE 0021c1fc l tagIdsPoisonJam 0021c234 l tagIdsImmortals 0021c248 l @@ -1172,7 +1131,6 @@ g_criticalSections 0022eeb8 l g_game 0022fce0 l g_collisionManager 0022fce8 l g_unknownStatic09 002314b0 l -g_genericScratch 00231d40 l g_objectCount 00251d40 l g_textureOps 00251d44 l g_texIndexPerStage 00251d54 l diff --git a/readme.md b/readme.md index dcefa7a..148da8b 100644 --- a/readme.md +++ b/readme.md @@ -2,9 +2,9 @@ A matching decompilation of the Xbox game Jet Set Radio Future. ## Progress -- Delinking progress: 1.02% (26325 out of 2574172 bytes in XBE address space) -- Decompilation progress: 18.3% (30 out of the 164 functions delinked so far) -- **Estimated total progress: 0.19%** (previous two multiplied together) +- Delinking progress: 0.52% (13263 out of 2574172 bytes in XBE address space) +- Decompilation progress: 30.6% (30 out of the 98 functions delinked so far) +- **Estimated total progress: 0.16%** (previous two multiplied together) ## Roadmap The approach of this decompilation is to: @@ -24,7 +24,7 @@ linker from the same Visual C++ 7.0 already used to compile object files. Step ## Contributing Anybody interested in joining the effort is welcome to read the -[contribution guide](documentation/gettingstarted.md). Those looking to get in -contact with other contributors can post to +[contribution guide](contributing.md). Those looking to get in contact with +other contributors can post to [the repository's issue tracker](https://codeberg.org/KeybadeBlox/JSRF-Decompilation/issues) or join the [JSRF Reverse Engineering Discord](https://discord.gg/kYEm5jz).