From 4dae5206c008c622ea706359d1c68f49aea9fecf Mon Sep 17 00:00:00 2001 From: KeybadeBlox Date: Fri, 2 Jan 2026 23:14:59 -0500 Subject: [PATCH] Minor decompiling in JSRF/Core --- decompile/src/JSRF/Core.cpp | 36 ++++++++++++++++++++++++------------ decompile/src/XDK/Win32.hpp | 17 +++++++++++++++-- readme.md | 2 +- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/decompile/src/JSRF/Core.cpp b/decompile/src/JSRF/Core.cpp index 6776322..62ae1cd 100644 --- a/decompile/src/JSRF/Core.cpp +++ b/decompile/src/JSRF/Core.cpp @@ -6,6 +6,10 @@ Game and GameObj classes that form the foundation of the JSRF game code. #include "Core.hpp" +// Declarations for symbols not yet defined in their own source files +// Remove these once they've been delinked! +void readInput(); + // Address: 0x00011000 // Matching: no GameObj::~GameObj() { @@ -171,11 +175,17 @@ GameObj * GameObj::getParent() { // Address: 0x00011BE0 // Matching: no void GameObj::removeFromObjList(GameObj * obj) { + if (obj->flags > -1) { + } } // Address: 0x00011C20 // Matching: no void GameObj::removeChildrenFromObjList(GameObj * firstChild) { + if (firstChild != NULL) do { + if (firstChild->flags > -1) { + } + } while (firstChild != NULL); } // Address: 0x00011C80 @@ -281,7 +291,7 @@ GameObj::GameObj(GameObj * parent, GameObjIndex index, GameObjFlags flags) { } // Address: 0x00012170 -// Matching: no +// Matching: yes DrawTree::DrawTree(GameObj * parent, GameObjIndex index, GameObjFlags flags) : GameObj(parent, index, flags) { this->otherBitfield = 7; @@ -495,6 +505,11 @@ void Game::appendToDrawPriorityList(GameObj * obj) { // Address: 0x00012A20 // Matching: no void Game::sortDrawPriorityListSingleLevel(char sortKeyBitOffset) { + for ( + unsigned i = 0; + i < sizeof this->drawPriorityListsByKeyHeads/sizeof *this->drawPriorityListsByKeyHeads; + i++ + ) this->drawPriorityListsByKeyHeads[i] = NULL; } // Address: 0x00012AC0 @@ -547,22 +562,19 @@ void Game::draw() { // Address: 0x00013A80 // Matching: no void Game::frame() { + readInput(); } // Address: 0x00013F80 -// Matching: no +// Matching: yes int Game::mainLoop() { - if (this->initState < 0) return -1; - - while (true) { - while (this->fatalErr) { - // (need to declare these somewhere) - //readInput(); - //Sleep(0x10); + if (this->initState >= 0) while (true) { + if (this->fatalErr == FALSE) this->frame(); + else { + readInput(); + Sleep(0x10); } - - this->frame(); - } + } else return -1; } // Address: 0x00013FC0 diff --git a/decompile/src/XDK/Win32.hpp b/decompile/src/XDK/Win32.hpp index 32cc801..1a9c0e3 100644 --- a/decompile/src/XDK/Win32.hpp +++ b/decompile/src/XDK/Win32.hpp @@ -21,8 +21,11 @@ typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; -typedef int BOOL; -typedef float FLOAT; +typedef void VOID; +typedef void * LPVOID; +typedef unsigned long SIZE_T; +typedef float FLOAT; +typedef int BOOL; #define TRUE 1 #define FALSE 0 @@ -46,4 +49,14 @@ typedef long HRESULT; #define ERROR_SUCCESS 0L #define E_OUTOFMEMORY 0x8007000EL +// Standard Win32 functions +VOID __stdcall Sleep(DWORD dwMilliseconds); + +LPVOID __stdcall VirtualAlloc( + LPVOID lpAddress, + SIZE_T dwSize, + DWORD flAllocationType, + DWORD flProtect +); + #endif diff --git a/readme.md b/readme.md index 16d660e..273b5fd 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,7 @@ A matching decompilation of the Xbox game Jet Set Radio Future. ## Progress - Delinking progress: 0.52% (13263 out of 2574172 bytes in XBE address space) -- Decompilation progress: 29.6% (29 out of the 98 functions delinked so far) +- Decompilation progress: 30.6% (30 out of the 98 functions delinked so far) ## Roadmap The approach of this decompilation is to: