1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-11 17:30:25 +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

@ -72,7 +72,7 @@ void EffectSsBlast_Draw(PlayState* play, u32 index, EffectSs* this) {
this->rInnerColorA);
Matrix_Put(&mf);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_blast.c", 199),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_blast.c", 199),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, this->gfx);

View file

@ -150,7 +150,7 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) {
Matrix_Translate(0.0f, 0.0f, depth, MTXMODE_APPLY);
Matrix_RotateZ((this->life * 0.02f) + 180.0f, MTXMODE_APPLY);
Matrix_Scale(layer2Scale, layer2Scale, layer2Scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_eff_ss_bomb2.c", 448),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_bomb2.c", 448),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gEffBombExplosion3DL);
layer2Scale -= 0.15f;

View file

@ -45,7 +45,7 @@ void EffectSsBubble_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_bubble.c", 167),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_bubble.c", 167),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Opa(gfxCtx);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);

View file

@ -99,7 +99,7 @@ void EffectSsDeadDs_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_RotateZYX(this->rRoll, this->rPitch, this->rYaw, MTXMODE_APPLY);
Matrix_RotateX(1.57f, MTXMODE_APPLY);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_eff_ss_dead_ds.c", 246),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_dead_ds.c", 246),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
PRIMITIVE, 0);

View file

@ -81,7 +81,7 @@ void EffectSsDtBubble_Draw(PlayState* play, u32 index, EffectSs* this) {
scale = this->rScale * 0.004f;
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_dt_bubble.c", 213),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_dt_bubble.c", 213),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Xlu2(gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,

View file

@ -78,7 +78,7 @@ void EffectSsEnFire_Draw(PlayState* play, u32 index, EffectSs* this) {
scale = Math_SinS(this->life * 0x333) * (this->rScale * 0.00005f);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_eff_en_fire.c", 180),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_en_fire.c", 180),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
redGreen = this->life - 5;

View file

@ -113,7 +113,7 @@ void EffectSsEnIce_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
Matrix_RotateY(BINANG_TO_RAD(this->rYaw), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD(this->rPitch), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_en_ice.c", 261),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_en_ice.c", 261),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
hiliteLightDir.x = 89.8f;

View file

@ -71,7 +71,7 @@ void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_eff_ss_extra.c", 186),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_extra.c", 186),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rScoreIdx]));
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_yabusame_point_DL_000DC0));

View file

@ -58,7 +58,7 @@ void EffectSsFcircle_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(xzScale, yScale, xzScale, MTXMODE_APPLY);
Matrix_RotateY(BINANG_TO_RAD(this->rYaw), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_fcircle.c", 163),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_fcircle.c", 163),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08,

View file

@ -107,7 +107,7 @@ void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this)
gDPPipeSync(POLY_XLU_DISP++);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_RotateZ((this->rXZRot / (f32)0x8000) * 3.1416f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_fhg_flash.c", 326),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_fhg_flash.c", 326),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
@ -140,7 +140,7 @@ void EffectSsFhgFlash_DrawShock(PlayState* play, u32 index, EffectSs* this) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, this->rAlpha);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 155, 0);
Matrix_RotateZ((this->rXZRot / (f32)0x8000) * 3.1416f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_fhg_flash.c", 395),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_fhg_flash.c", 395),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, this->gfx);

View file

@ -119,7 +119,7 @@ void EffectSsFireTail_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Scale(1.0f, temp1, 1.0f / temp1, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_eff_fire_tail.c", 238),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_fire_tail.c", 238),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, 255);

View file

@ -86,7 +86,7 @@ void EffectSsGMagma2_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_g_magma2.c", 282),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_g_magma2.c", 282),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (this->rDrawMode == 0) {

View file

@ -81,7 +81,7 @@ void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_RotateY(this->rYaw * 0.01f, MTXMODE_APPLY);
Matrix_RotateX(this->rPitch * 0.01f, MTXMODE_APPLY);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_hahen.c", 228),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_hahen.c", 228),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, this->gfx);
@ -105,7 +105,7 @@ void EffectSsHahen_DrawGray(PlayState* play, u32 index, EffectSs* this) {
Matrix_RotateY(this->rYaw * 0.01f, MTXMODE_APPLY);
Matrix_RotateX(this->rPitch * 0.01f, MTXMODE_APPLY);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_hahen.c", 271),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_hahen.c", 271),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gDPSetCombineLERP(POLY_OPA_DISP++, SHADE, 0, PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0,

View file

@ -65,7 +65,7 @@ void EffectSsIcePiece_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
Matrix_RotateY(BINANG_TO_RAD(this->rYaw), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD(this->rPitch), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ice_piece.c", 185),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ice_piece.c", 185),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, (s32)alpha & 0xFF);

View file

@ -79,7 +79,7 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) {
scale = this->rScale * 0.0001f;
Matrix_Scale(scale, scale, 1.0f, MTXMODE_APPLY);
mtx = Matrix_NewMtx(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 196);
mtx = MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 196);
if (mtx != NULL) {
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View file

@ -75,7 +75,7 @@ void EffectSsKFire_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_RotateY(M_PI, MTXMODE_APPLY);
}
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_eff_k_fire.c", 215),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_k_fire.c", 215),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);

View file

@ -112,7 +112,7 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
if ((((this->rReg4 >> 7) & 1) << 7) == 0x80) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_kakera.c", 268),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_kakera.c", 268),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
@ -122,7 +122,7 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) {
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
} else {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_kakera.c", 286),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_kakera.c", 286),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Opa(play->state.gfxCtx);

View file

@ -67,7 +67,7 @@ void EffectSsSibuki_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_sibuki.c", 176),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_sibuki.c", 176),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Opa(gfxCtx);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA);

View file

@ -63,7 +63,7 @@ void EffectSsSibuki2_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_sibuki2.c", 171),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_sibuki2.c", 171),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Opa(gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA);

View file

@ -64,7 +64,7 @@ void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_RotateZYX(0, this->rYaw, play->state.frames * 10000, MTXMODE_APPLY);
}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_stick.c", 176),
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_stick.c", 176),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_25Opa(gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjectSlot].segment);

View file

@ -62,7 +62,7 @@ void EffectSsStone1_Draw(PlayState* play, u32 index, EffectSs* this) {
scale = (mfW < 1500.0f) ? 3.0f : (mfW / 1500.0f) * 3.0f;
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_stone1.c", 168),
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_stone1.c", 168),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Gfx_SetupDL_61Xlu(gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(drawParams->texture));