From 4a3905b62b867b992ed6c55ecdd9bffdc67f4a45 Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Mon, 27 Jun 2022 16:05:59 +0200 Subject: [PATCH] remaining hardcoded line and file --- soh/src/code/db_camera.c | 22 +++++++++++----------- soh/src/code/gamealloc.c | 10 +++++----- soh/src/code/listalloc.c | 4 ++-- soh/src/code/loadfragment2.c | 2 +- soh/src/code/main.c | 2 +- soh/src/code/mtxuty-cvt.c | 8 ++++---- soh/src/code/sched.c | 28 ++++++++++++++-------------- soh/src/code/sys_matrix.c | 4 ++-- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/soh/src/code/db_camera.c b/soh/src/code/db_camera.c index 53d5c41bf..09b998fe2 100644 --- a/soh/src/code/db_camera.c +++ b/soh/src/code/db_camera.c @@ -1517,18 +1517,18 @@ char DbCamera_InitCut(s32 idx, DbCameraSub* sub) { D_80161250[0x3F + sDbCameraCuts[idx].letter] = 'O'; i = sub->nPoints * sizeof(CutsceneCameraPoint); - sDbCameraCuts[idx].lookAt = DebugArena_MallocDebug(i, "../db_camera.c", 2748); + sDbCameraCuts[idx].lookAt = DebugArena_MallocDebug(i, __FILE__, __LINE__); if (sDbCameraCuts[idx].lookAt == NULL) { // "Debug camera memory allocation failure" - osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2751); + osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", __FILE__, __LINE__); return '?'; } - sDbCameraCuts[idx].position = DebugArena_MallocDebug(i, "../db_camera.c", 2754); + sDbCameraCuts[idx].position = DebugArena_MallocDebug(i, __FILE__, __LINE__); if (sDbCameraCuts[idx].position == NULL) { // "Debug camera memory allocation failure" - osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2757); - DebugArena_FreeDebug(sDbCameraCuts[idx].lookAt, "../db_camera.c", 2758); + osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", __FILE__, __LINE__); + DebugArena_FreeDebug(sDbCameraCuts[idx].lookAt, __FILE__, __LINE__); sDbCameraCuts[idx].lookAt = NULL; return '?'; } @@ -1551,8 +1551,8 @@ void DbCamera_ResetCut(s32 idx, s32 shouldFree) { } if (shouldFree) { - DebugArena_FreeDebug(sDbCameraCuts[idx].lookAt, "../db_camera.c", 2784); - DebugArena_FreeDebug(sDbCameraCuts[idx].position, "../db_camera.c", 2785); + DebugArena_FreeDebug(sDbCameraCuts[idx].lookAt, __FILE__, __LINE__); + DebugArena_FreeDebug(sDbCameraCuts[idx].position, __FILE__, __LINE__); } sDbCameraCuts[idx].letter = '?'; @@ -1602,10 +1602,10 @@ s32 DbCamera_LoadCallback(char* c) { if (sDbCameraCuts[i].letter != '?') { size = sDbCameraCuts[i].nPoints * sizeof(CutsceneCameraPoint); - sDbCameraCuts[i].lookAt = DebugArena_MallocDebug(ALIGN32(size), "../db_camera.c", 2844); + sDbCameraCuts[i].lookAt = DebugArena_MallocDebug(ALIGN32(size), __FILE__, __LINE__); if (sDbCameraCuts[i].lookAt == NULL) { // "Debug camera memory allocation failure" - osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2847); + osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", __FILE__, __LINE__); return false; } if (!Mempak_Read(2, *c, sDbCameraCuts[i].lookAt, off, ALIGN32(size))) { @@ -1613,10 +1613,10 @@ s32 DbCamera_LoadCallback(char* c) { } off += ALIGN32(size); - sDbCameraCuts[i].position = DebugArena_MallocDebug(ALIGN32(size), "../db_camera.c", 2855); + sDbCameraCuts[i].position = DebugArena_MallocDebug(ALIGN32(size), __FILE__, __LINE__); if (sDbCameraCuts[i].position == NULL) { // "Debug camera memory allocation failure" - osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2858); + osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", __FILE__, __LINE__); return false; } if (!Mempak_Read(2, *c, sDbCameraCuts[i].position, off, ALIGN32(size))) { diff --git a/soh/src/code/gamealloc.c b/soh/src/code/gamealloc.c index 451c56de2..11de5cd65 100644 --- a/soh/src/code/gamealloc.c +++ b/soh/src/code/gamealloc.c @@ -29,7 +29,7 @@ void* GameAlloc_MallocDebug(GameAlloc* this, size_t size, const char* file, s32 } void* GameAlloc_Malloc(GameAlloc* this, size_t size) { - GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93); + GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), __FILE__, __LINE__); if (ptr != NULL) { ptr->size = size; @@ -49,12 +49,12 @@ void GameAlloc_Free(GameAlloc* this, void* data) { if (data != NULL) { ptr = &((GameAllocEntry*)data)[-1]; - LogUtils_CheckNullPointer("ptr->prev", ptr->prev, "../gamealloc.c", 120); - LogUtils_CheckNullPointer("ptr->next", ptr->next, "../gamealloc.c", 121); + LogUtils_CheckNullPointer("ptr->prev", ptr->prev, __FILE__, __LINE__); + LogUtils_CheckNullPointer("ptr->next", ptr->next, __FILE__, __LINE__); ptr->prev->next = ptr->next; ptr->next->prev = ptr->prev; this->head = this->base.prev; - SystemArena_FreeDebug(ptr, "../gamealloc.c", 125); + SystemArena_FreeDebug(ptr, __FILE__, __LINE__); } } @@ -65,7 +65,7 @@ void GameAlloc_Cleanup(GameAlloc* this) { while (&this->base != next) { cur = next; next = next->next; - SystemArena_FreeDebug(cur, "../gamealloc.c", 145); + SystemArena_FreeDebug(cur, __FILE__, __LINE__); } this->head = &this->base; diff --git a/soh/src/code/listalloc.c b/soh/src/code/listalloc.c index 18d43328d..2e10e0e83 100644 --- a/soh/src/code/listalloc.c +++ b/soh/src/code/listalloc.c @@ -7,7 +7,7 @@ ListAlloc* ListAlloc_Init(ListAlloc* this) { } void* ListAlloc_Alloc(ListAlloc* this, size_t size) { - ListAlloc* ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), "../listalloc.c", 40); + ListAlloc* ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), __FILE__, __LINE__); ListAlloc* next; if (ptr == NULL) { @@ -49,7 +49,7 @@ void ListAlloc_Free(ListAlloc* this, void* data) { this->next = ptr->prev; } - SystemArena_FreeDebug(ptr, "../listalloc.c", 72); + SystemArena_FreeDebug(ptr, __FILE__, __LINE__); } void ListAlloc_FreeAll(ListAlloc* this) { diff --git a/soh/src/code/loadfragment2.c b/soh/src/code/loadfragment2.c index dd413ca49..28d56ddca 100644 --- a/soh/src/code/loadfragment2.c +++ b/soh/src/code/loadfragment2.c @@ -1,7 +1,7 @@ #include "global.h" void* Overlay_AllocateAndLoad(uintptr_t vRomStart, uintptr_t vRomEnd, void* vRamStart, void* vRamEnd) { - void* allocatedVRamAddr = SystemArena_MallocRDebug((intptr_t)vRamEnd - (intptr_t)vRamStart, "../loadfragment2.c", 31); + void* allocatedVRamAddr = SystemArena_MallocRDebug((intptr_t)vRamEnd - (intptr_t)vRamStart, __FILE__, __LINE__); if (gOverlayLogSeverity >= 3) { osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr, diff --git a/soh/src/code/main.c b/soh/src/code/main.c index 35435815c..b9967db13 100644 --- a/soh/src/code/main.c +++ b/soh/src/code/main.c @@ -75,7 +75,7 @@ void Main(void* arg) { debugHeapSize = (0x80600000 - (uintptr_t)debugHeap); } else { debugHeapSize = 0x400; - debugHeap = SystemArena_MallocDebug(debugHeapSize, "../main.c", 565); + debugHeap = SystemArena_MallocDebug(debugHeapSize, __FILE__, __LINE__); } debugHeapSize = 1024 * 64; diff --git a/soh/src/code/mtxuty-cvt.c b/soh/src/code/mtxuty-cvt.c index 18c7a36f3..639882b1d 100644 --- a/soh/src/code/mtxuty-cvt.c +++ b/soh/src/code/mtxuty-cvt.c @@ -4,8 +4,8 @@ void MtxConv_F2L(Mtx* m1, MtxF* m2) { s32 i; s32 j; - LogUtils_CheckNullPointer("m1", m1, "../mtxuty-cvt.c", 31); - LogUtils_CheckNullPointer("m2", m2, "../mtxuty-cvt.c", 32); + LogUtils_CheckNullPointer("m1", m1, __FILE__, __LINE__); + LogUtils_CheckNullPointer("m2", m2, __FILE__, __LINE__); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { @@ -18,7 +18,7 @@ void MtxConv_F2L(Mtx* m1, MtxF* m2) { } void MtxConv_L2F(MtxF* m1, Mtx* m2) { - LogUtils_CheckNullPointer("m1", m1, "../mtxuty-cvt.c", 55); - LogUtils_CheckNullPointer("m2", m2, "../mtxuty-cvt.c", 56); + LogUtils_CheckNullPointer("m1", m1, __FILE__, __LINE__); + LogUtils_CheckNullPointer("m2", m2, __FILE__, __LINE__); guMtxL2F(m1, m2); } diff --git a/soh/src/code/sched.c b/soh/src/code/sched.c index 4bc314491..1ec891e58 100644 --- a/soh/src/code/sched.c +++ b/soh/src/code/sched.c @@ -18,7 +18,7 @@ OSTime sRDPStartTime; void Sched_SwapFrameBuffer(CfbInfo* cfbInfo) { u16 width; - LogUtils_CheckValidPointer("cfbinfo->swapbuffer", cfbInfo->swapBuffer, "../sched.c", 340); + LogUtils_CheckValidPointer("cfbinfo->swapbuffer", cfbInfo->swapBuffer, __FILE__, __LINE__); if (cfbInfo->swapBuffer != NULL) { osViSwapBuffer(cfbInfo->swapBuffer); cfbInfo->updateRate2 = cfbInfo->updateRate; @@ -77,18 +77,18 @@ void Sched_HandleReset(SchedContext* sc) { if (sc->curRSPTask->framebuffer == NULL) { LOG_TIME("(((u64)(now - audio_rsp_start_time)*(1000000LL/15625LL))/((62500000LL*3/4)/15625LL))", - OS_CYCLES_TO_USEC(now - sRSPAudioStartTime), "../sched.c", 421); + OS_CYCLES_TO_USEC(now - sRSPAudioStartTime), __FILE__, __LINE__); } else if (OS_CYCLES_TO_USEC(now - sRSPGFXStartTime) > 1000000 || OS_CYCLES_TO_USEC(now - sRDPStartTime) > 1000000) { func_800FBFD8(); if (sc->curRSPTask != NULL) { LOG_TIME("(((u64)(now - graph_rsp_start_time)*(1000000LL/15625LL))/((62500000LL*3/4)/15625LL))", - OS_CYCLES_TO_USEC(now - sRSPGFXStartTime), "../sched.c", 427); + OS_CYCLES_TO_USEC(now - sRSPGFXStartTime), __FILE__, __LINE__); osSendMesg32(&sc->interruptQ, RSP_DONE_MSG, OS_MESG_NOBLOCK); } if (sc->curRDPTask != NULL) { LOG_TIME("(((u64)(now - rdp_start_time)*(1000000LL/15625LL))/((62500000LL*3/4)/15625LL))", - OS_CYCLES_TO_USEC(now - sRDPStartTime), "../sched.c", 431); + OS_CYCLES_TO_USEC(now - sRDPStartTime), __FILE__, __LINE__); osSendMesg32(&sc->interruptQ, RDP_DONE_MSG, OS_MESG_NOBLOCK); } } @@ -103,8 +103,8 @@ void Sched_QueueTask(SchedContext* sc, OSScTask* task) { s32 type = task->list.t.type; ASSERT((type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK), - "(type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK)", "../sched.c", - 463); + "(type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK)", __FILE__, + __LINE__); if (type == M_AUDTASK) { if (sLogScheduler) { @@ -136,7 +136,7 @@ void Sched_QueueTask(SchedContext* sc, OSScTask* task) { void Sched_Yield(SchedContext* sc) { if (!(sc->curRSPTask->state & OS_SC_YIELD)) { - ASSERT(sc->curRSPTask->list.t.type != M_AUDTASK, "sc->curRSPTask->list.t.type != M_AUDTASK", "../sched.c", 496); + ASSERT(sc->curRSPTask->list.t.type != M_AUDTASK, "sc->curRSPTask->list.t.type != M_AUDTASK", __FILE__, __LINE__); sc->curRSPTask->state |= OS_SC_YIELD; @@ -155,14 +155,14 @@ OSScTask* func_800C89D4(SchedContext* sc, OSScTask* task) { if (sc->pendingSwapBuf1 != NULL) { if (0) { - ASSERT(sc->pendingSwapBuf1 != NULL, "sc->pending_swapbuffer1", "../sched.c", UNK_LINE); + ASSERT(sc->pendingSwapBuf1 != NULL, "sc->pending_swapbuffer1", __FILE__, UNK_LINE); } return NULL; } if (sc->pendingSwapBuf2 != NULL) { if (0) { - ASSERT(sc->pendingSwapBuf2 != NULL, "sc->pending_swapbuffer2", "../sched.c", UNK_LINE); + ASSERT(sc->pendingSwapBuf2 != NULL, "sc->pending_swapbuffer2", __FILE__, UNK_LINE); } return NULL; } @@ -223,7 +223,7 @@ void func_800C8BC4(SchedContext* sc, OSScTask* task) { if (sc->pendingSwapBuf1 == NULL) { sc->pendingSwapBuf1 = task->framebuffer; - LogUtils_CheckValidPointer("sc->pending_swapbuffer1", sc->pendingSwapBuf1, "../sched.c", 618); + LogUtils_CheckValidPointer("sc->pending_swapbuffer1", sc->pendingSwapBuf1, __FILE__, __LINE__); if ((sc->curBuf == NULL) || (sc->curBuf->updateRate2 < 1)) { func_800C84E4(sc, task->framebuffer); @@ -248,7 +248,7 @@ u32 Sched_IsComplete(SchedContext* sc, OSScTask* task) { } void Sched_RunTask(SchedContext* sc, OSScTask* spTask, OSScTask* dpTask) { - ASSERT(sc->curRSPTask == NULL, "sc->curRSPTask == NULL", "../sched.c", 663); + ASSERT(sc->curRSPTask == NULL, "sc->curRSPTask == NULL", __FILE__, __LINE__); if (spTask != NULL) { if (spTask->list.t.type == M_NULTASK) { if (spTask->flags & OS_SC_NEEDS_RSP) { @@ -358,7 +358,7 @@ void Sched_HandleRSPDone(SchedContext* sc) { OSScTask* nextRDP = NULL; s32 state; - ASSERT(sc->curRSPTask != NULL, "sc->curRSPTask", "../sched.c", 819); + ASSERT(sc->curRSPTask != NULL, "sc->curRSPTask", __FILE__, __LINE__); if (sc->curRSPTask->list.t.type == M_AUDTASK) { gRSPAudioTotalTime += osGetTime() - sRSPAudioStartTime; @@ -407,8 +407,8 @@ void Sched_HandleRDPDone(SchedContext* sc) { s32 state; gRDPTotalTime = osGetTime() - sRDPStartTime; - ASSERT(sc->curRDPTask != NULL, "sc->curRDPTask", "../sched.c", 878); - ASSERT(sc->curRDPTask->list.t.type == M_GFXTASK, "sc->curRDPTask->list.t.type == M_GFXTASK", "../sched.c", 879); + ASSERT(sc->curRDPTask != NULL, "sc->curRDPTask", __FILE__, __LINE__); + ASSERT(sc->curRDPTask->list.t.type == M_GFXTASK, "sc->curRDPTask->list.t.type == M_GFXTASK", __FILE__, __LINE__); curTask = sc->curRDPTask; sc->curRDPTask = NULL; curTask->state &= ~OS_SC_DP; diff --git a/soh/src/code/sys_matrix.c b/soh/src/code/sys_matrix.c index bc90bf669..1c3fdb948 100644 --- a/soh/src/code/sys_matrix.c +++ b/soh/src/code/sys_matrix.c @@ -22,7 +22,7 @@ MtxF* sMatrixStack; // "Matrix_stack" MtxF* sCurrentMatrix; // "Matrix_now" void Matrix_Init(GameState* gameState) { - sCurrentMatrix = GameState_Alloc(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153); + sCurrentMatrix = GameState_Alloc(gameState, 20 * sizeof(MtxF), __FILE__, __LINE__); sMatrixStack = sCurrentMatrix; } @@ -35,7 +35,7 @@ void Matrix_Push(void) { void Matrix_Pop(void) { FrameInterpolation_RecordMatrixPop(); sCurrentMatrix--; - ASSERT(sCurrentMatrix >= sMatrixStack, "Matrix_now >= Matrix_stack", "../sys_matrix.c", 176); + ASSERT(sCurrentMatrix >= sMatrixStack, "Matrix_now >= Matrix_stack", __FILE__, __LINE__); } void Matrix_Get(MtxF* dest) {