1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 14:34:32 +00:00

Create debug macros for common functions (#1597)

* Create debug macros for common functions

* Revert NDEBUG change

* MALLOCR -> MALLOC_R

* DEBUG -> OOT_DEBUG

* Use the same name for debug and non-debug matrix functions

* Fix file/line argument order

* Revert g[s]DPNoOp[Tag]

* Use SystemArena_MallocDebug directly in GameAlloc_MallocDebug

* MTXF_TO_MTX -> MATRIX_TO_MTX
This commit is contained in:
cadmic 2024-01-09 04:59:03 -08:00 committed by GitHub
parent e146d7bc26
commit cd917b0cb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
314 changed files with 1352 additions and 1294 deletions

View file

@ -454,7 +454,7 @@ void FileSelect_SetWindowVtx(GameState* thisx) {
s16 tmp2;
s16 tmp3;
this->windowVtx = Graph_Alloc(this->state.gfxCtx, sizeof(Vtx) * 80);
this->windowVtx = GRAPH_ALLOC(this->state.gfxCtx, sizeof(Vtx) * 80);
tmp = this->windowPosX - 90;
for (x = 0, i = 0; i < 4; i++) {
@ -512,7 +512,7 @@ void FileSelect_SetWindowContentVtx(GameState* thisx) {
s16 temp_t1;
SramContext* sramCtx = &this->sramCtx;
this->windowContentVtx = Graph_Alloc(this->state.gfxCtx, 0x288 * sizeof(Vtx));
this->windowContentVtx = GRAPH_ALLOC(this->state.gfxCtx, 0x288 * sizeof(Vtx));
for (phi_t2 = 0; phi_t2 < 0x288; phi_t2 += 4) {
this->windowContentVtx[phi_t2].v.ob[0] = this->windowContentVtx[phi_t2 + 2].v.ob[0] = 0x12C;
@ -1150,7 +1150,7 @@ void FileSelect_ConfigModeDraw(GameState* thisx) {
Matrix_RotateX(this->windowRot / 100.0f, MTXMODE_APPLY);
}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_file_choose.c", 2282),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2282),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0);
@ -1178,7 +1178,7 @@ void FileSelect_ConfigModeDraw(GameState* thisx) {
Matrix_Translate(0.0f, 0.0f, -93.6f, MTXMODE_NEW);
Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY);
Matrix_RotateX((this->windowRot - 314.0f) / 100.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_file_choose.c", 2316),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2316),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0);
@ -1207,7 +1207,7 @@ void FileSelect_ConfigModeDraw(GameState* thisx) {
Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY);
Matrix_RotateX((this->windowRot - 314.0f) / 100.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_file_choose.c", 2337),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2337),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0);
@ -1559,7 +1559,7 @@ void FileSelect_SelectModeDraw(GameState* thisx) {
Matrix_Translate(0.0f, 0.0f, -93.6f, MTXMODE_NEW);
Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY);
Matrix_RotateX(this->windowRot / 100.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_file_choose.c", 2810),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2810),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0);
@ -1879,16 +1879,15 @@ void FileSelect_Init(GameState* thisx) {
SREG(30) = 1;
osSyncPrintf("SIZE=%x\n", size);
this->staticSegment = GameState_Alloc(&this->state, size, "../z_file_choose.c", 3392);
this->staticSegment = GAME_STATE_ALLOC(&this->state, size, "../z_file_choose.c", 3392);
ASSERT(this->staticSegment != NULL, "this->staticSegment != NULL", "../z_file_choose.c", 3393);
DmaMgr_RequestSyncDebug(this->staticSegment, (uintptr_t)_title_staticSegmentRomStart, size, "../z_file_choose.c",
3394);
DMA_REQUEST_SYNC(this->staticSegment, (uintptr_t)_title_staticSegmentRomStart, size, "../z_file_choose.c", 3394);
size = (uintptr_t)_parameter_staticSegmentRomEnd - (uintptr_t)_parameter_staticSegmentRomStart;
this->parameterSegment = GameState_Alloc(&this->state, size, "../z_file_choose.c", 3398);
this->parameterSegment = GAME_STATE_ALLOC(&this->state, size, "../z_file_choose.c", 3398);
ASSERT(this->parameterSegment != NULL, "this->parameterSegment != NULL", "../z_file_choose.c", 3399);
DmaMgr_RequestSyncDebug(this->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, size,
"../z_file_choose.c", 3400);
DMA_REQUEST_SYNC(this->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, size, "../z_file_choose.c",
3400);
Matrix_Init(&this->state);
View_Init(&this->view, this->state.gfxCtx);

View file

@ -39,7 +39,7 @@ void FileSelect_SetKeyboardVtx(GameState* thisx) {
s16 phi_t1;
s16 phi_s2;
this->keyboardVtx = Graph_Alloc(this->state.gfxCtx, sizeof(Vtx) * 4 * 5 * 13);
this->keyboardVtx = GRAPH_ALLOC(this->state.gfxCtx, sizeof(Vtx) * 4 * 5 * 13);
phi_s1 = 0x26;
@ -141,7 +141,7 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) {
gSP1Quadrangle(POLY_OPA_DISP++, phi_s0, phi_s0 + 2, phi_s0 + 3, phi_s0 + 1, 0);
}
this->nameEntryVtx = Graph_Alloc(this->state.gfxCtx, 44 * sizeof(Vtx));
this->nameEntryVtx = GRAPH_ALLOC(this->state.gfxCtx, 44 * sizeof(Vtx));
for (phi_s0 = 0, phi_t1 = 0; phi_t1 < 44; phi_t1 += 4, phi_s0++) {
if ((phi_s0 > 0) && (phi_s0 < 9)) {
@ -983,7 +983,7 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) {
Matrix_Push();
Matrix_Translate(0.0f, 0.1f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1009),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1009),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_OPA_DISP++, gOptionsDividerTopVtx, 4, 0);
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
@ -991,7 +991,7 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) {
Matrix_Push();
Matrix_Translate(0.0f, 0.2f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1021),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1021),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_OPA_DISP++, gOptionsDividerMiddleVtx, 4, 0);
@ -1000,7 +1000,7 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) {
Matrix_Push();
Matrix_Translate(0.0f, 0.4f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1033),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1033),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_OPA_DISP++, gOptionsDividerBottomVtx, 4, 0);
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);