mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-08 08:55:17 +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:
parent
e146d7bc26
commit
cd917b0cb8
314 changed files with 1352 additions and 1294 deletions
|
@ -1307,9 +1307,9 @@ void Interface_LoadItemIcon1(PlayState* play, u16 button) {
|
|||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE),
|
||||
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0,
|
||||
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
|
||||
DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE),
|
||||
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0,
|
||||
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
|
@ -1317,9 +1317,9 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) {
|
|||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE),
|
||||
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0,
|
||||
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
|
||||
DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE),
|
||||
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0,
|
||||
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
|
@ -2119,10 +2119,10 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l
|
|||
if ((action != DO_ACTION_NONE) && (action != DO_ACTION_MAX + DO_ACTION_NONE) &&
|
||||
(action != 2 * DO_ACTION_MAX + DO_ACTION_NONE)) {
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160,
|
||||
interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
|
||||
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE),
|
||||
DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
|
||||
DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_160,
|
||||
interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
|
||||
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE),
|
||||
DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
} else {
|
||||
gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment);
|
||||
|
@ -2183,9 +2183,9 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) {
|
|||
interfaceCtx->unk_1FC = action;
|
||||
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
|
||||
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
|
||||
0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
|
||||
DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
|
||||
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
|
||||
0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
interfaceCtx->unk_1FA = true;
|
||||
|
@ -2989,8 +2989,7 @@ void Interface_DrawActionButton(PlayState* play) {
|
|||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_parameter.c", 3177),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_parameter.c", 3177), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0);
|
||||
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, gButtonBackgroundTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
|
||||
|
@ -3006,7 +3005,7 @@ void Interface_InitVertices(PlayState* play) {
|
|||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 i;
|
||||
|
||||
interfaceCtx->actionVtx = Graph_Alloc(play->state.gfxCtx, 8 * sizeof(Vtx));
|
||||
interfaceCtx->actionVtx = GRAPH_ALLOC(play->state.gfxCtx, 8 * sizeof(Vtx));
|
||||
|
||||
interfaceCtx->actionVtx[0].v.ob[0] = interfaceCtx->actionVtx[2].v.ob[0] = -14;
|
||||
interfaceCtx->actionVtx[1].v.ob[0] = interfaceCtx->actionVtx[3].v.ob[0] = interfaceCtx->actionVtx[0].v.ob[0] + 28;
|
||||
|
@ -3048,7 +3047,7 @@ void Interface_InitVertices(PlayState* play) {
|
|||
interfaceCtx->actionVtx[5].v.tc[0] = interfaceCtx->actionVtx[7].v.tc[0] = 1536;
|
||||
interfaceCtx->actionVtx[6].v.tc[1] = interfaceCtx->actionVtx[7].v.tc[1] = 512;
|
||||
|
||||
interfaceCtx->beatingHeartVtx = Graph_Alloc(play->state.gfxCtx, 4 * sizeof(Vtx));
|
||||
interfaceCtx->beatingHeartVtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Vtx));
|
||||
|
||||
interfaceCtx->beatingHeartVtx[0].v.ob[0] = interfaceCtx->beatingHeartVtx[2].v.ob[0] = -8;
|
||||
interfaceCtx->beatingHeartVtx[1].v.ob[0] = interfaceCtx->beatingHeartVtx[3].v.ob[0] = 8;
|
||||
|
@ -3357,7 +3356,7 @@ void Interface_Draw(PlayState* play) {
|
|||
Matrix_Translate(0.0f, 0.0f, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_parameter.c", 3701),
|
||||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_parameter.c", 3701),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue