mirror of
https://codeberg.org/KeybadeBlox/JSRF-Decompilation.git
synced 2026-04-07 04:50:23 +03:00
Decompile mainCRTStartup()
Incidental changes include fixes for Xapi in the Makefille and objdiff.json, as well as new compiler flags for Xapi.
This commit is contained in:
parent
cbd63865e2
commit
4e20347b7c
4 changed files with 13 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"custom_make": "NMAKE.EXE",
|
||||
"watch_patterns": [
|
||||
"*.c",
|
||||
"*.h",
|
||||
"*.cpp",
|
||||
"*.hpp"
|
||||
],
|
||||
|
|
@ -53,4 +55,4 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue