Use Macro for __FILE__ & __LINE__ when possible (#559)

* First batch some overlay

* Almost all overlay

* effect & gamestate

* kaleido stuffs

* more overlay

* more left over from code folder

* remaining hardcoded line and file

* Open & Close _DISP __FILE__ & __LINE__ clean up

* Some if (1) {} remove

* LOG_xxxx __FILE__ , __LINE__ cleaned

* ASSERT macro __FILE__ __LINE__

* mtx without line/file in functions

* " if (1) {} " & "if (0) {}" and tab/white place

* LogUtils as macro

* GameState_, GameAlloc_, SystemArena_ & ZeldaArena_

* Revert "GameState_, GameAlloc_, SystemArena_ & ZeldaArena_"

This reverts commit 0d85caaf7e.

* Like last commit but as macro

* Fix matrix not using macros

* use function not macro

* DebugArena_* functions
GameAlloc_MallocDebug
BgCheck_PosErrorCheck as macros
removed issues with ; in macro file
This commit is contained in:
Baoulettes 2022-07-06 01:29:34 +02:00 committed by GitHub
parent a9c3c7541e
commit a5df9dddf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
467 changed files with 3081 additions and 3459 deletions

View file

@ -134,7 +134,7 @@ GameStateOverlay* Graph_GetNextGameState(GameState* gameState) {
return &gGameStateOverlayTable[5];
}
LOG_ADDRESS("game_init_func", gameStateInitFunc, "../graph.c", 696);
LOG_ADDRESS("game_init_func", gameStateInitFunc);
return NULL;
}
@ -225,11 +225,9 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
task->output_buff_size = (u64*)((u8*)gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer));
task->data_ptr = (u64*)gfxCtx->workBuffer;
OPEN_DISPS(gfxCtx, "../graph.c", 828);
OPEN_DISPS(gfxCtx);
task->data_size = (uintptr_t)WORK_DISP - (uintptr_t)gfxCtx->workBuffer;
CLOSE_DISPS(gfxCtx, "../graph.c", 830);
{ s32 pad2; } // Necessary to match stack usage
CLOSE_DISPS(gfxCtx);
task->yield_data_ptr = (u64*)gGfxSPTaskYieldBuffer;
task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer);
@ -258,8 +256,6 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
scTask->framebuffer = cfb;
sGraphCfbInfoIdx = sGraphCfbInfoIdx % ARRAY_COUNT(sGraphCfbInfos);
if (1) {}
gfxCtx->schedMsgQ = &gSchedContext.cmdQ;
osSendMesgPtr(&gSchedContext.cmdQ, scTask, OS_MESG_BLOCK);
@ -272,29 +268,29 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gameState->unk_A0 = 0;
Graph_InitTHGA(gfxCtx);
OPEN_DISPS(gfxCtx, "../graph.c", 966);
OPEN_DISPS(gfxCtx);
gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0);
gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 開始", 0);
gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 開始", 0);
gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 開始", 0);
CLOSE_DISPS(gfxCtx, "../graph.c", 975);
CLOSE_DISPS(gfxCtx);
GameState_ReqPadData(gameState);
GameState_Update(gameState);
Debug_Draw();
OPEN_DISPS(gfxCtx, "../graph.c", 987);
OPEN_DISPS(gfxCtx);
gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0);
gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 終了", 0);
gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 終了", 0);
gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 終了", 0);
CLOSE_DISPS(gfxCtx, "../graph.c", 996);
CLOSE_DISPS(gfxCtx);
OPEN_DISPS(gfxCtx, "../graph.c", 999);
OPEN_DISPS(gfxCtx);
gSPBranchList(WORK_DISP++, gfxCtx->polyOpaBuffer);
gSPBranchList(POLY_OPA_DISP++, gfxCtx->polyXluBuffer);
@ -305,7 +301,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gDPFullSync(OVERLAY_DISP++);
gSPEndDisplayList(OVERLAY_DISP++);
CLOSE_DISPS(gfxCtx, "../graph.c", 1028);
CLOSE_DISPS(gfxCtx);
if (HREG(80) == 10 && HREG(93) == 2) {
HREG(80) = 7;
@ -344,14 +340,14 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
osSyncPrintf("%c", 7);
// "Dynamic area head is destroyed"
osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域先頭が破壊されています\n" VT_RST);
Fault_AddHungupAndCrash("../graph.c", 1070);
Fault_AddHungupAndCrash(__FILE__, __LINE__);
}
if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) {
problem = true;
osSyncPrintf("%c", 7);
// "Dynamic region tail is destroyed"
osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域末尾が破壊されています\n" VT_RST);
Fault_AddHungupAndCrash("../graph.c", 1076);
Fault_AddHungupAndCrash(__FILE__, __LINE__);
}
}
@ -458,7 +454,7 @@ static void RunFrame()
size = runFrameContext.ovl->instanceSize;
osSyncPrintf("クラスサイズ=%dバイト\n", size); // "Class size = %d bytes"
runFrameContext.gameState = SystemArena_MallocDebug(size, "../graph.c", 1196);
runFrameContext.gameState = SYSTEM_ARENA_MALLOC_DEBUG(size);
if (!runFrameContext.gameState)
{
@ -499,7 +495,7 @@ static void RunFrame()
runFrameContext.nextOvl = Graph_GetNextGameState(runFrameContext.gameState);
GameState_Destroy(runFrameContext.gameState);
SystemArena_FreeDebug(runFrameContext.gameState, "../graph.c", 1227);
SYSTEM_ARENA_FREE_DEBUG(runFrameContext.gameState);
Overlay_FreeGameState(runFrameContext.ovl);
}
Graph_Destroy(&runFrameContext.gfxCtx);