1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-06 16:04:35 +00:00

Decomp game.c (#129)

* decomp most of game.c

* improve GameState_DrawInputDisplay matching

* fix merge conflicts

* pr suggestions

* remove builtin math functions
This commit is contained in:
krimtonz 2020-05-14 18:11:33 -05:00 committed by GitHub
parent efa9742984
commit 44ffb7ec62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 1494 additions and 1977 deletions

View file

@ -105,10 +105,10 @@ void* Graph_InitTHGA(GraphicsContext* gfxCtx) {
gfxCtx->unk_014 = 0;
}
GameStateOverlay* Graph_GetNextGameState() {
GameStateOverlay* Graph_GetNextGameState(GameState* gameState) {
void* gameStateInitFunc;
gameStateInitFunc = func_800C546C();
gameStateInitFunc = GameState_GetInit(gameState);
if (gameStateInitFunc == TitleSetup_Init) {
return &gGameStateOverlayTable[0];
}
@ -285,8 +285,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gDPNoOpString(gfxCtx->overlay.p++, "OVERLAY_DISP 開始", 0);
Graph_CloseDisps(dispRefs, gfxCtx, "../graph.c", 975);
func_800C4A98(gameState); // Game_ReqPadData
func_800C4AC8(gameState); // Game_SetGameFrame
GameState_ReqPadData(gameState);
GameState_Update(gameState);
Graph_OpenDisps(dispRefs2, gfxCtx, "../graph.c", 987);
gDPNoOpString(gfxCtx->work.p++, "WORK_DISP 終了", 0);
@ -435,14 +435,14 @@ void Graph_ThreadEntry(void* arg0) {
sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
}
func_800C5080(gameState, ovl->init, &gfxCtx); // Game_Ct
GameState_Init(gameState, ovl->init, &gfxCtx);
while (func_800C547C(gameState)) { // Game_IsGameStateRunning
while (GameState_IsRunning(gameState)) {
Graph_Update(&gfxCtx, gameState);
}
nextOvl = Graph_GetNextGameState(gameState);
func_800C5360(gameState); // Game_Dt
GameState_Destroy(gameState);
SystemArena_FreeDebug(gameState, "../graph.c", 1227);
Overlay_FreeGameState(ovl);
}