diff --git a/decompile/Makefile b/decompile/Makefile index eb51c84..1337f62 100644 --- a/decompile/Makefile +++ b/decompile/Makefile @@ -3,7 +3,7 @@ # All object files to link together OBJ = src/JSRF/Jet2.obj src/JSRF/Core.obj src/JSRF/GameData.obj\ - src/XDK/CRT/CRT0.obj + src/XDK/Xapi/xapi0.obj # Import library for the only thing we don't compile ourselves, the Xbox kernel LIB = lib/xboxkrnl.lib @@ -14,7 +14,7 @@ all: $(OBJ) # For now, just compile all the object files ## Build commands -.SUFFIXES: .cpp .obj .def .lib .exe.xbe +.SUFFIXES: .c .cpp .obj .def .lib .exe.xbe # Convert compiled executable into a working Xbox executable # (TODO: we may want to fork cxbe to add section checksums and the game ID) @@ -32,7 +32,7 @@ src/JSRF/Jet2.exe: $(OBJ) $(LIB) # Compile object files from source .c.obj: - CL.EXE /nologo /Wall /W4 /Ogityb0 /GfX /Fo$@ /c $< + CL.EXE /nologo /Wall /W4 /O1giy /Fo$@ /c $< .cpp.obj: CL.EXE /nologo /Wall /W4 /Ogityb0 /GfX /Fo$@ /c $< @@ -46,4 +46,4 @@ src/JSRF/Core.obj: src/JSRF/Core.hpp src/MUSASHI/MMatrix.hpp\ src/JSRF/GameData.obj: src/JSRF/GameData.hpp -src/XDK/CRT/CRT0.obj: src/XDK/Win32.h +src/XDK/Xapi/xapi0.obj: src/XDK/Win32.h diff --git a/decompile/objdiff.json b/decompile/objdiff.json index 4c6af55..573b0d4 100644 --- a/decompile/objdiff.json +++ b/decompile/objdiff.json @@ -1,6 +1,8 @@ { "custom_make": "NMAKE.EXE", "watch_patterns": [ + "*.c", + "*.h", "*.cpp", "*.hpp" ], @@ -53,4 +55,4 @@ } } ] -} \ No newline at end of file +} diff --git a/decompile/src/XDK/Xapi/xapi0.c b/decompile/src/XDK/Xapi/xapi0.c index ee9c93b..78bfefc 100644 --- a/decompile/src/XDK/Xapi/xapi0.c +++ b/decompile/src/XDK/Xapi/xapi0.c @@ -58,7 +58,7 @@ DWORD __stdcall mainXapiStartup(LPVOID lpThreadParameter) { } // Address: 0x00148023 -// Status: nonmatching +// Status: matching void mainCRTStartup(void) { /* The true entrypoint of the game, spawning a thread for the rest to run in The linker automatically sets this function to the entrypoint. @@ -66,11 +66,11 @@ The linker automatically sets this function to the entrypoint. HANDLE thread; // Figure out available thread-local storage - XapiTlsSize = ( + XapiTlsSize = 4 + (( (_tls_used.EndAddressOfRawData - _tls_used.StartAddressOfRawData) + _tls_used.SizeOfZeroFill - ) + 15 & 0xFFFFFFF0; // Round up to nearest 0x10 - *_tls_used.AddressOfIndex = XapiTlsSize / (-4); + ) + 15 & 0xFFFFFFF0); // Round up to nearest 0x10 + *_tls_used.AddressOfIndex = -1 * XapiTlsSize/4; // Launch program as a thread thread = CreateThread(NULL, 0, mainXapiStartup, NULL, 0, NULL); diff --git a/readme.md b/readme.md index 49cfa1e..70ccc22 100644 --- a/readme.md +++ b/readme.md @@ -3,8 +3,8 @@ A matching decompilation of the Xbox game Jet Set Radio Future. ## Progress - Delinking progress: 1.03% (26559 out of 2574172 bytes in XBE address space) -- Decompilation progress: 18.5% (31 out of the 168 functions delinked so far) -- **Estimated total progress: 0.19%** (previous two multiplied together) +- Decompilation progress: 19.0% (32 out of the 168 functions delinked so far) +- **Estimated total progress: 0.20%** (previous two multiplied together) ## Roadmap The approach of this decompilation is to: