From cd917b0cb8c20e457d43805ee27d2597daed63e3 Mon Sep 17 00:00:00 2001 From: cadmic Date: Tue, 9 Jan 2024 04:59:03 -0800 Subject: 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 --- src/code/gamealloc.c | 6 +- src/code/graph.c | 4 +- src/code/listalloc.c | 4 +- src/code/loadfragment2.c | 3 +- src/code/main.c | 2 +- src/code/sys_matrix.c | 22 +++- src/code/z_DLF.c | 2 +- src/code/z_actor.c | 67 +++++----- src/code/z_bgcheck.c | 2 +- src/code/z_camera.c | 4 +- src/code/z_cheap_proc.inc.c | 6 +- src/code/z_collision_check.c | 16 +-- src/code/z_construct.c | 52 ++++---- src/code/z_debug.c | 2 +- src/code/z_debug_display.c | 6 +- src/code/z_draw.c | 82 ++++++------ src/code/z_eff_blure.c | 8 +- src/code/z_eff_spark.c | 2 +- src/code/z_effect_soft_sprite.c | 7 +- src/code/z_en_a_keep.c | 3 +- src/code/z_en_item00.c | 15 +-- src/code/z_fbdemo.c | 25 ++-- src/code/z_fcurve_data_skelanime.c | 12 +- src/code/z_kaleido_manager.c | 2 +- src/code/z_kanfont.c | 20 +-- src/code/z_kankyo.c | 48 +++---- src/code/z_lifemeter.c | 2 +- src/code/z_lights.c | 6 +- src/code/z_map_exp.c | 22 ++-- src/code/z_map_mark.c | 2 +- src/code/z_message_PAL.c | 48 +++---- src/code/z_parameter.c | 35 +++--- src/code/z_play.c | 10 +- src/code/z_player_lib.c | 16 +-- src/code/z_rcp.c | 8 +- src/code/z_room.c | 6 +- src/code/z_sample.c | 6 +- src/code/z_scene.c | 13 +- src/code/z_scene_table.c | 14 +-- src/code/z_skelanime.c | 69 +++++------ src/code/z_skin_awb.c | 12 +- src/code/z_skin_matrix.c | 2 +- src/code/z_sram.c | 2 +- src/code/z_view.c | 34 ++--- src/code/z_vismono.c | 6 +- src/code/z_vr_box.c | 248 ++++++++++++++++++------------------- src/code/z_vr_box_draw.c | 6 +- 47 files changed, 495 insertions(+), 494 deletions(-) (limited to 'src/code') diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c index 9a4303ad2..2b1cd04d4 100644 --- a/src/code/gamealloc.c +++ b/src/code/gamealloc.c @@ -29,7 +29,7 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin } void* GameAlloc_Malloc(GameAlloc* this, u32 size) { - GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93); + GameAllocEntry* ptr = SYSTEM_ARENA_MALLOC(size + sizeof(GameAllocEntry), "../gamealloc.c", 93); if (ptr != NULL) { ptr->size = size; @@ -54,7 +54,7 @@ void GameAlloc_Free(GameAlloc* this, void* data) { ptr->prev->next = ptr->next; ptr->next->prev = ptr->prev; this->head = this->base.prev; - SystemArena_FreeDebug(ptr, "../gamealloc.c", 125); + SYSTEM_ARENA_FREE(ptr, "../gamealloc.c", 125); } } @@ -65,7 +65,7 @@ void GameAlloc_Cleanup(GameAlloc* this) { while (&this->base != next) { cur = next; next = next->next; - SystemArena_FreeDebug(cur, "../gamealloc.c", 145); + SYSTEM_ARENA_FREE(cur, "../gamealloc.c", 145); } this->head = &this->base; diff --git a/src/code/graph.c b/src/code/graph.c index 8a0057c7b..5704c68f5 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -425,7 +425,7 @@ void Graph_ThreadEntry(void* arg0) { size = ovl->instanceSize; osSyncPrintf("クラスサイズ=%dバイト\n", size); // "Class size = %d bytes" - gameState = SystemArena_MallocDebug(size, "../graph.c", 1196); + gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196); if (gameState == NULL) { osSyncPrintf("確保失敗\n"); // "Failure to secure" @@ -442,7 +442,7 @@ void Graph_ThreadEntry(void* arg0) { nextOvl = Graph_GetNextGameState(gameState); GameState_Destroy(gameState); - SystemArena_FreeDebug(gameState, "../graph.c", 1227); + SYSTEM_ARENA_FREE(gameState, "../graph.c", 1227); Overlay_FreeGameState(ovl); } Graph_Destroy(&gfxCtx); diff --git a/src/code/listalloc.c b/src/code/listalloc.c index d4d24138c..7560c20c6 100644 --- a/src/code/listalloc.c +++ b/src/code/listalloc.c @@ -7,7 +7,7 @@ ListAlloc* ListAlloc_Init(ListAlloc* this) { } void* ListAlloc_Alloc(ListAlloc* this, u32 size) { - ListAlloc* ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), "../listalloc.c", 40); + ListAlloc* ptr = SYSTEM_ARENA_MALLOC(size + sizeof(ListAlloc), "../listalloc.c", 40); 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); + SYSTEM_ARENA_FREE(ptr, "../listalloc.c", 72); } void ListAlloc_FreeAll(ListAlloc* this) { diff --git a/src/code/loadfragment2.c b/src/code/loadfragment2.c index 97002f9e9..693ef5425 100644 --- a/src/code/loadfragment2.c +++ b/src/code/loadfragment2.c @@ -1,8 +1,7 @@ #include "global.h" void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) { - void* allocatedRamAddr = - SystemArena_MallocRDebug((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31); + void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31); if (gOverlayLogSeverity >= 3) { osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vramStart, vramEnd, allocatedRamAddr, diff --git a/src/code/main.c b/src/code/main.c index 4e633fd34..c1fd17c48 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -61,7 +61,7 @@ void Main(void* arg) { debugHeapSize = PHYS_TO_K0(0x600000) - (uintptr_t)debugHeapStart; } else { debugHeapSize = 0x400; - debugHeapStart = SystemArena_MallocDebug(debugHeapSize, "../main.c", 565); + debugHeapStart = SYSTEM_ARENA_MALLOC(debugHeapSize, "../main.c", 565); } osSyncPrintf("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize); DebugArena_Init(debugHeapStart, debugHeapSize); diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index f58872d07..fa038a76c 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -20,7 +20,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 = GAME_STATE_ALLOC(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153); sMatrixStack = sCurrentMatrix; } @@ -603,16 +603,30 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) { return dest; } +#ifdef OOT_DEBUG + Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) { - return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest); + return Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(sCurrentMatrix, file, line), dest); } Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) { - return Matrix_ToMtx(Graph_Alloc(gfxCtx, sizeof(Mtx)), file, line); + return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)), file, line); +} + +#else + +Mtx* Matrix_ToMtx(Mtx* dest) { + return Matrix_MtxFToMtx(sCurrentMatrix, dest); } +Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx) { + return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx))); +} + +#endif /* OOT_DEBUG */ + Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) { - return Matrix_MtxFToMtx(src, Graph_Alloc(gfxCtx, sizeof(Mtx))); + return Matrix_MtxFToMtx(src, GRAPH_ALLOC(gfxCtx, sizeof(Mtx))); } void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) { diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c index 7034f829c..5da87b7af 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -104,7 +104,7 @@ void Overlay_FreeGameState(GameStateOverlay* overlayEntry) { overlayEntry->unk_24 = NULL; } - SystemArena_FreeDebug(overlayEntry->loadedRamAddr, "../z_DLF.c", 149); + SYSTEM_ARENA_FREE(overlayEntry->loadedRamAddr, "../z_DLF.c", 149); overlayEntry->loadedRamAddr = NULL; } } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index ccd3e20cd..f2cd50edc 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -54,7 +54,7 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, PlayState* play, Gfx* dlist, temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.shadowScale; Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 1588), + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 1588), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dlist); @@ -94,7 +94,7 @@ void ActorShadow_DrawFoot(PlayState* play, Light* light, MtxF* arg2, s32 arg3, f Matrix_RotateY(sp58, MTXMODE_APPLY); Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 1687), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 1687), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, gFootShadowDL); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 1693); @@ -377,7 +377,7 @@ void func_8002C124(TargetContext* targetCtx, PlayState* play) { Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY); Matrix_Push(); Matrix_Translate(entry->unk_0C, entry->unk_0C, 0.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 2116), + gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 2116), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(OVERLAY_DISP++, gZTargetLockOnTriangleDL); Matrix_Pop(); @@ -404,8 +404,7 @@ void func_8002C124(TargetContext* targetCtx, PlayState* play) { Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, naviColor->inner.r, naviColor->inner.g, naviColor->inner.b, 255); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 2153), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 2153), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, gZTargetArrowDL); } @@ -679,7 +678,7 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart; if ((size != 0) && (size <= 0x3000)) { - DmaMgr_RequestSyncDebug(texture, loadedScene->titleFile.vromStart, size, "../z_actor.c", 2765); + DMA_REQUEST_SYNC(texture, loadedScene->titleFile.vromStart, size, "../z_actor.c", 2765); } titleCtx->texture = texture; @@ -1363,11 +1362,11 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* LookAt* lookAt; f32 correctedEyeX; - lookAt = Graph_Alloc(gfxCtx, sizeof(LookAt)); + lookAt = GRAPH_ALLOC(gfxCtx, sizeof(LookAt)); correctedEyeX = (eye->x == object->x) && (eye->z == object->z) ? eye->x + 0.001f : eye->x; - *hilite = Graph_Alloc(gfxCtx, sizeof(Hilite)); + *hilite = GRAPH_ALLOC(gfxCtx, sizeof(Hilite)); if (R_HREG_MODE == HREG_MODE_PRINT_HILITE_INFO) { osSyncPrintf("z_actor.c 3529 eye=[%f(%f) %f %f] object=[%f %f %f] light_direction=[%f %f %f]\n", correctedEyeX, @@ -1426,7 +1425,7 @@ void func_8002EBCC(Actor* actor, PlayState* play, s32 flag) { hilite = func_8002EABC(&actor->world.pos, &play->view.eye, &lightDir, play->state.gfxCtx); if (flag != 0) { - displayList = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Gfx)); + displayList = GRAPH_ALLOC(play->state.gfxCtx, 2 * sizeof(Gfx)); displayListHead = displayList; OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 4384); @@ -1452,7 +1451,7 @@ void func_8002ED80(Actor* actor, PlayState* play, s32 flag) { hilite = func_8002EB44(&actor->world.pos, &play->view.eye, &lightDir, play->state.gfxCtx); if (flag != 0) { - displayList = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Gfx)); + displayList = GRAPH_ALLOC(play->state.gfxCtx, 2 * sizeof(Gfx)); displayListHead = displayList; OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 4429); @@ -2034,14 +2033,14 @@ void Actor_DrawFaroresWindPointer(PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 255); Matrix_RotateZ(BINANG_TO_RAD_ALT2((play->gameplayFrames * 1500) & 0xFFFF), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 5458), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 5458), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); Matrix_Pop(); Matrix_RotateZ(BINANG_TO_RAD_ALT2(~((play->gameplayFrames * 1200) & 0xFFFF)), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 5463), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 5463), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); } @@ -2689,7 +2688,7 @@ void func_80031C3C(ActorContext* actorCtx, PlayState* play) { } if (actorCtx->absoluteSpace != NULL) { - ZeldaArena_FreeDebug(actorCtx->absoluteSpace, "../z_actor.c", 6731); + ZELDA_ARENA_FREE(actorCtx->absoluteSpace, "../z_actor.c", 6731); actorCtx->absoluteSpace = NULL; } @@ -2775,7 +2774,7 @@ void Actor_FreeOverlay(ActorOverlay* actorOverlay) { if (HREG(20) != 0) { osSyncPrintf("オーバーレイ解放します\n"); // "Overlay deallocated" } - ZeldaArena_FreeDebug(actorOverlay->loadedRamAddr, "../z_actor.c", 6834); + ZELDA_ARENA_FREE(actorOverlay->loadedRamAddr, "../z_actor.c", 6834); actorOverlay->loadedRamAddr = NULL; } } @@ -2833,8 +2832,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos if (actorCtx->absoluteSpace == NULL) { // "AMF: absolute magic field" - actorCtx->absoluteSpace = - ZeldaArena_MallocRDebug(ACTOROVL_ABSOLUTE_SPACE_SIZE, "AMF:絶対魔法領域", 0); + actorCtx->absoluteSpace = ZELDA_ARENA_MALLOC_R(ACTOROVL_ABSOLUTE_SPACE_SIZE, "AMF:絶対魔法領域", 0); if (HREG(20) != 0) { // "Absolute magic field reservation - %d bytes reserved" osSyncPrintf("絶対魔法領域確保 %d バイト確保\n", ACTOROVL_ABSOLUTE_SPACE_SIZE); @@ -2843,9 +2841,9 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos overlayEntry->loadedRamAddr = actorCtx->absoluteSpace; } else if (overlayEntry->allocType & ACTOROVL_ALLOC_PERSISTENT) { - overlayEntry->loadedRamAddr = ZeldaArena_MallocRDebug(overlaySize, name, 0); + overlayEntry->loadedRamAddr = ZELDA_ARENA_MALLOC_R(overlaySize, name, 0); } else { - overlayEntry->loadedRamAddr = ZeldaArena_MallocDebug(overlaySize, name, 0); + overlayEntry->loadedRamAddr = ZELDA_ARENA_MALLOC(overlaySize, name, 0); } if (overlayEntry->loadedRamAddr == NULL) { @@ -2886,7 +2884,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos return NULL; } - actor = ZeldaArena_MallocDebug(actorInit->instanceSize, name, 1); + actor = ZELDA_ARENA_MALLOC(actorInit->instanceSize, name, 1); if (actor == NULL) { // "Actor class cannot be reserved! %s " @@ -3027,7 +3025,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { newHead = Actor_RemoveFromCategory(play, actorCtx, actor); - ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242); + ZELDA_ARENA_FREE(actor, "../z_actor.c", 7242); if (overlayEntry->vramStart == NULL) { if (HREG(20) != 0) { @@ -3205,15 +3203,15 @@ void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) { u32 objectSlotsSize; matricesSize = (count + 1) * sizeof(*bodyBreak->matrices); - bodyBreak->matrices = ZeldaArena_MallocDebug(matricesSize, "../z_actor.c", 7540); + bodyBreak->matrices = ZELDA_ARENA_MALLOC(matricesSize, "../z_actor.c", 7540); if (bodyBreak->matrices != NULL) { dListsSize = (count + 1) * sizeof(*bodyBreak->dLists); - bodyBreak->dLists = ZeldaArena_MallocDebug(dListsSize, "../z_actor.c", 7543); + bodyBreak->dLists = ZELDA_ARENA_MALLOC(dListsSize, "../z_actor.c", 7543); if (bodyBreak->dLists != NULL) { objectSlotsSize = (count + 1) * sizeof(*bodyBreak->objectSlots); - bodyBreak->objectSlots = ZeldaArena_MallocDebug(objectSlotsSize, "../z_actor.c", 7546); + bodyBreak->objectSlots = ZELDA_ARENA_MALLOC(objectSlotsSize, "../z_actor.c", 7546); if (bodyBreak->objectSlots != NULL) { Lib_MemSet((u8*)bodyBreak->matrices, matricesSize, 0); @@ -3226,15 +3224,15 @@ void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) { } if (bodyBreak->matrices != NULL) { - ZeldaArena_FreeDebug(bodyBreak->matrices, "../z_actor.c", 7558); + ZELDA_ARENA_FREE(bodyBreak->matrices, "../z_actor.c", 7558); } if (bodyBreak->dLists != NULL) { - ZeldaArena_FreeDebug(bodyBreak->dLists, "../z_actor.c", 7561); + ZELDA_ARENA_FREE(bodyBreak->dLists, "../z_actor.c", 7561); } if (bodyBreak->objectSlots != NULL) { - ZeldaArena_FreeDebug(bodyBreak->objectSlots, "../z_actor.c", 7564); + ZELDA_ARENA_FREE(bodyBreak->objectSlots, "../z_actor.c", 7564); } } @@ -3301,9 +3299,9 @@ s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s1 bodyBreak->val = BODYBREAK_STATUS_FINISHED; - ZeldaArena_FreeDebug(bodyBreak->matrices, "../z_actor.c", 7678); - ZeldaArena_FreeDebug(bodyBreak->dLists, "../z_actor.c", 7679); - ZeldaArena_FreeDebug(bodyBreak->objectSlots, "../z_actor.c", 7680); + ZELDA_ARENA_FREE(bodyBreak->matrices, "../z_actor.c", 7678); + ZELDA_ARENA_FREE(bodyBreak->dLists, "../z_actor.c", 7679); + ZELDA_ARENA_FREE(bodyBreak->objectSlots, "../z_actor.c", 7680); return true; } @@ -3640,7 +3638,7 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) { Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 8149), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8149), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, gCircleShadowDL); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8155); @@ -3728,8 +3726,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) { Matrix_Scale(entry->chainsScale, entry->chainsScale, entry->chainsScale, MTXMODE_APPLY); } - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 8299), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8299), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, entry->chainDL); if (i % 2) { @@ -3744,7 +3741,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) { Matrix_Put(&baseMtxF); Matrix_Scale(frame * 0.1f, frame * 0.1f, frame * 0.1f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 8314), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8314), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, entry->lockDL); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8319); @@ -4065,7 +4062,7 @@ void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex Gfx* func_80034B28(GraphicsContext* gfxCtx) { Gfx* displayList; - displayList = Graph_Alloc(gfxCtx, sizeof(Gfx)); + displayList = GRAPH_ALLOC(gfxCtx, sizeof(Gfx)); gSPEndDisplayList(displayList); return displayList; @@ -4075,7 +4072,7 @@ Gfx* func_80034B54(GraphicsContext* gfxCtx) { Gfx* displayListHead; Gfx* displayList; - displayList = displayListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx)); + displayList = displayListHead = GRAPH_ALLOC(gfxCtx, 2 * sizeof(Gfx)); gDPSetRenderMode(displayListHead++, G_RM_FOG_SHADE_A, AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 0525c8987..1fbca9e09 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -2503,7 +2503,7 @@ void SSNodeList_Alloc(PlayState* play, SSNodeList* this, s32 tblMax, s32 numPoly ASSERT(this->tbl != NULL, "this->short_slist_node_tbl != NULL", "../z_bgcheck.c", 5975); - this->polyCheckTbl = GameState_Alloc(&play->state, numPolys, "../z_bgcheck.c", 5979); + this->polyCheckTbl = GAME_STATE_ALLOC(&play->state, numPolys, "../z_bgcheck.c", 5979); ASSERT(this->polyCheckTbl != NULL, "this->polygon_check != NULL", "../z_bgcheck.c", 5981); } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 9d7bf8a73..8dd3e3e62 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -7017,7 +7017,7 @@ s32 Camera_Special9(Camera* camera) { } Camera* Camera_Create(View* view, CollisionContext* colCtx, PlayState* play) { - Camera* newCamera = ZeldaArena_MallocDebug(sizeof(*newCamera), "../z_camera.c", 9370); + Camera* newCamera = ZELDA_ARENA_MALLOC(sizeof(*newCamera), "../z_camera.c", 9370); if (newCamera != NULL) { osSyncPrintf(VT_FGCOL(BLUE) "camera: create --- allocate %d byte" VT_RST "\n", sizeof(*newCamera) * 4); @@ -7031,7 +7031,7 @@ Camera* Camera_Create(View* view, CollisionContext* colCtx, PlayState* play) { void Camera_Destroy(Camera* camera) { if (camera != NULL) { osSyncPrintf(VT_FGCOL(BLUE) "camera: destroy ---" VT_RST "\n"); - ZeldaArena_FreeDebug(camera, "../z_camera.c", 9391); + ZELDA_ARENA_FREE(camera, "../z_camera.c", 9391); } else { osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: destroy: already cleared\n" VT_RST); } diff --git a/src/code/z_cheap_proc.inc.c b/src/code/z_cheap_proc.inc.c index 70140f013..db646129f 100644 --- a/src/code/z_cheap_proc.inc.c +++ b/src/code/z_cheap_proc.inc.c @@ -4,8 +4,7 @@ void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) { OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 214); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_cheap_proc.c", 216), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_cheap_proc.c", 216), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dlist); CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 219); @@ -15,8 +14,7 @@ void Gfx_DrawDListXlu(PlayState* play, Gfx* dlist) { OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 228); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_cheap_proc.c", 230), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_cheap_proc.c", 230), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, dlist); CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 233); diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index bdf007889..26d91b347 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -69,7 +69,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, gSPSetGeometryMode(POLY_OPA_DISP++, G_LIGHTING); gDPPipeSync(POLY_OPA_DISP++); - vtxTbl = Graph_Alloc(gfxCtx, 3 * sizeof(Vtx)); + vtxTbl = GRAPH_ALLOC(gfxCtx, 3 * sizeof(Vtx)); ASSERT(vtxTbl != NULL, "vtx_tbl != NULL", "../z_collision_check.c", 726); vtxTbl[0].n.ob[0] = vA->x; @@ -335,7 +335,7 @@ s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* collider) { collider->count = 0; if (collider->elements != NULL) { - ZeldaArena_FreeDebug(collider->elements, "../z_collision_check.c", 1393); + ZELDA_ARENA_FREE(collider->elements, "../z_collision_check.c", 1393); } collider->elements = NULL; return true; @@ -366,7 +366,7 @@ s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJnt Collider_SetBaseToActor(play, &dest->base, &src->base); dest->count = src->count; - dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1443); + dest->elements = ZELDA_ARENA_MALLOC(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1443); if (dest->elements == NULL) { dest->count = 0; @@ -394,7 +394,7 @@ s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* dest, Actor* a Collider_SetBaseType1(play, &dest->base, actor, &src->base); dest->count = src->count; - dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1490); + dest->elements = ZELDA_ARENA_MALLOC(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1490); if (dest->elements == NULL) { dest->count = 0; @@ -422,7 +422,7 @@ s32 Collider_SetJntSphAlloc(PlayState* play, ColliderJntSph* dest, Actor* actor, Collider_SetBase(play, &dest->base, actor, &src->base); dest->count = src->count; - dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1551); + dest->elements = ZELDA_ARENA_MALLOC(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1551); if (dest->elements == NULL) { dest->count = 0; @@ -698,7 +698,7 @@ s32 Collider_FreeTris(PlayState* play, ColliderTris* tris) { tris->count = 0; if (tris->elements != NULL) { - ZeldaArena_FreeDebug(tris->elements, "../z_collision_check.c", 2099); + ZELDA_ARENA_FREE(tris->elements, "../z_collision_check.c", 2099); } tris->elements = NULL; return true; @@ -730,7 +730,7 @@ s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* dest, Actor* actor Collider_SetBaseType1(play, &dest->base, actor, &src->base); dest->count = src->count; - dest->elements = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2156); + dest->elements = ZELDA_ARENA_MALLOC(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2156); if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); @@ -756,7 +756,7 @@ s32 Collider_SetTrisAlloc(PlayState* play, ColliderTris* dest, Actor* actor, Col Collider_SetBase(play, &dest->base, actor, &src->base); dest->count = src->count; - dest->elements = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2207); + dest->elements = ZELDA_ARENA_MALLOC(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2207); if (dest->elements == NULL) { osSyncPrintf(VT_FGCOL(RED)); diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 94e690151..a0ae14504 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -34,15 +34,15 @@ void Interface_Init(PlayState* play) { // "Permanent PARAMETER Segment = %x" osSyncPrintf("常駐PARAMETERセグメント=%x\n", parameterSize); - interfaceCtx->parameterSegment = GameState_Alloc(&play->state, parameterSize, "../z_construct.c", 159); + interfaceCtx->parameterSegment = GAME_STATE_ALLOC(&play->state, parameterSize, "../z_construct.c", 159); osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment); ASSERT(interfaceCtx->parameterSegment != NULL, "parameter->parameterSegment != NULL", "../z_construct.c", 161); - DmaMgr_RequestSyncDebug(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize, - "../z_construct.c", 162); + DMA_REQUEST_SYNC(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize, + "../z_construct.c", 162); - interfaceCtx->doActionSegment = GameState_Alloc(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166); + interfaceCtx->doActionSegment = GAME_STATE_ALLOC(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166); osSyncPrintf("DOアクション テクスチャ初期=%x\n", 3 * DO_ACTION_TEX_SIZE); // "DO Action Texture Initialization" osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment); @@ -57,8 +57,8 @@ void Interface_Init(PlayState* play) { doActionOffset = LANGUAGE_FRA * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; } - DmaMgr_RequestSyncDebug(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, - 2 * DO_ACTION_TEX_SIZE, "../z_construct.c", 174); + DMA_REQUEST_SYNC(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, + 2 * DO_ACTION_TEX_SIZE, "../z_construct.c", 174); if (gSaveContext.language == LANGUAGE_ENG) { doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_ENG * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; @@ -68,11 +68,11 @@ void Interface_Init(PlayState* play) { doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_FRA * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; } - DmaMgr_RequestSyncDebug(interfaceCtx->doActionSegment + 2 * DO_ACTION_TEX_SIZE, - (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DO_ACTION_TEX_SIZE, - "../z_construct.c", 178); + DMA_REQUEST_SYNC(interfaceCtx->doActionSegment + 2 * DO_ACTION_TEX_SIZE, + (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DO_ACTION_TEX_SIZE, + "../z_construct.c", 178); - interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, ICON_ITEM_SEGMENT_SIZE, "../z_construct.c", 190); + interfaceCtx->iconItemSegment = GAME_STATE_ALLOC(&play->state, ICON_ITEM_SEGMENT_SIZE, "../z_construct.c", 190); // "Icon Item Texture Initialization = %x" osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", ICON_ITEM_SEGMENT_SIZE); @@ -85,33 +85,33 @@ void Interface_Init(PlayState* play) { gSaveContext.save.info.equips.buttonItems[3]); if (gSaveContext.save.info.equips.buttonItems[0] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, - "../z_construct.c", 198); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, + "../z_construct.c", 198); } else if (gSaveContext.save.info.equips.buttonItems[0] != 0xFF) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, - "../z_construct.c", 203); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, + "../z_construct.c", 203); } if (gSaveContext.save.info.equips.buttonItems[1] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (1 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[1]), ITEM_ICON_SIZE, - "../z_construct.c", 209); + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (1 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[1]), ITEM_ICON_SIZE, + "../z_construct.c", 209); } if (gSaveContext.save.info.equips.buttonItems[2] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (2 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[2]), ITEM_ICON_SIZE, - "../z_construct.c", 214); + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (2 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[2]), ITEM_ICON_SIZE, + "../z_construct.c", 214); } if (gSaveContext.save.info.equips.buttonItems[3] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (3 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[3]), ITEM_ICON_SIZE, - "../z_construct.c", 219); + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (3 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[3]), ITEM_ICON_SIZE, + "../z_construct.c", 219); } osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timerState)); @@ -190,7 +190,7 @@ void Message_Init(PlayState* play) { View_Init(&msgCtx->view, play->state.gfxCtx); - msgCtx->textboxSegment = GameState_Alloc(&play->state, TEXTBOX_SEGMENT_SIZE, "../z_construct.c", 349); + msgCtx->textboxSegment = GAME_STATE_ALLOC(&play->state, TEXTBOX_SEGMENT_SIZE, "../z_construct.c", 349); osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment); diff --git a/src/code/z_debug.c b/src/code/z_debug.c index bc46c5a72..9581ec854 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -97,7 +97,7 @@ char sRegGroupChars[REG_GROUPS] = { void Regs_Init(void) { s32 i; - gRegEditor = SystemArena_MallocDebug(sizeof(RegEditor), "../z_debug.c", 260); + gRegEditor = SYSTEM_ARENA_MALLOC(sizeof(RegEditor), "../z_debug.c", 260); gRegEditor->regPage = 0; gRegEditor->regGroup = 0; gRegEditor->regCur = 0; diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index 62c52acbd..d1d5dd34c 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -34,7 +34,7 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, GraphicsContext* gfxCtx) { DebugDispObject* prevHead = sDebugObjectListHead; - sDebugObjectListHead = Graph_Alloc(gfxCtx, sizeof(DebugDispObject)); + sDebugObjectListHead = GRAPH_ALLOC(gfxCtx, sizeof(DebugDispObject)); sDebugObjectListHead->pos.x = posX; sDebugObjectListHead->pos.y = posY; @@ -81,7 +81,7 @@ void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayStat gDPLoadTextureBlock(POLY_XLU_DISP++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_debug_display.c", 189), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_debug_display.c", 189), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, gDebugSpriteDL); @@ -100,7 +100,7 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, PlayState* Matrix_SetTranslateRotateYXZ(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot); Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_debug_display.c", 228), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_debug_display.c", 228), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, dlist); diff --git a/src/code/z_draw.c b/src/code/z_draw.c index 68b878444..671b8d0e2 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -385,7 +385,7 @@ void GetItem_DrawMaskOrBombchu(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 556); Gfx_SetupDL_26Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 565); @@ -397,7 +397,7 @@ void GetItem_DrawSoldOut(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 572); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 581); @@ -409,7 +409,7 @@ void GetItem_DrawBlueFire(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 588); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -420,7 +420,7 @@ void GetItem_DrawBlueFire(PlayState* play, s16 drawId) { Matrix_Push(); Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); Matrix_Pop(); @@ -433,11 +433,11 @@ void GetItem_DrawPoes(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 628); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), @@ -445,7 +445,7 @@ void GetItem_DrawPoes(PlayState* play, s16 drawId) { 1 * -(play->state.frames * 6), 16, 32)); Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); Matrix_Pop(); @@ -459,11 +459,11 @@ void GetItem_DrawFairy(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 670); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), @@ -471,7 +471,7 @@ void GetItem_DrawFairy(PlayState* play, s16 drawId) { 1 * -(play->state.frames * 6), 32, 32)); Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); Matrix_Pop(); @@ -488,11 +488,11 @@ void GetItem_DrawMirrorShield(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0) % 256, 1 * (play->state.frames * 2) % 256, 64, 64, 1, 0 * (play->state.frames * 0) % 128, 1 * (play->state.frames * 1) % 128, 32, 32)); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 735); @@ -504,7 +504,7 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 742); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -512,7 +512,7 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), 1 * -(play->state.frames * 5), 32, 32, 1, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 32, 64)); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 765); @@ -524,7 +524,7 @@ void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772); Gfx_SetupDL_26Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); @@ -537,11 +537,11 @@ void GetItem_DrawCompass(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 811); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 827); @@ -557,14 +557,14 @@ void GetItem_DrawPotion(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -1 * (play->state.frames * 1), 1 * (play->state.frames * 1), 32, 32, 1, -1 * (play->state.frames * 1), 1 * (play->state.frames * 1), 32, 32)); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[5]); @@ -581,7 +581,7 @@ void GetItem_DrawGoronSword(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 1), 0 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 1), 0 * (play->state.frames * 1), 32, 32)); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 883); @@ -597,7 +597,7 @@ void GetItem_DrawDekuNuts(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 6), 1 * (play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 6), 1 * (play->state.frames * 6), 32, 32)); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 906); @@ -613,7 +613,7 @@ void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 1), 1 * -(play->state.frames * 3), 32, 32, 1, 0 * (play->state.frames * 1), 1 * -(play->state.frames * 2), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 929); @@ -629,7 +629,7 @@ void GetItem_DrawFish(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), 1 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 0), 1 * (play->state.frames * 1), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 952); @@ -641,7 +641,7 @@ void GetItem_DrawOpa0(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 959); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 968); @@ -653,11 +653,11 @@ void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 975); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 991); @@ -669,7 +669,7 @@ void GetItem_DrawXlu01(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); @@ -682,12 +682,12 @@ void GetItem_DrawOpa10Xlu2(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1015); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1032); @@ -699,11 +699,11 @@ void GetItem_DrawMagicArrow(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1039); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -720,7 +720,7 @@ void GetItem_DrawMagicSpell(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 2), 1 * -(play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 1), -1 * (play->state.frames * 2), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -734,7 +734,7 @@ void GetItem_DrawOpa1023(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1088); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -749,12 +749,12 @@ void GetItem_DrawOpa10Xlu32(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1108); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -769,12 +769,12 @@ void GetItem_DrawSmallRupee(PlayState* play, s16 drawId) { Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -791,7 +791,7 @@ void GetItem_DrawScale(PlayState* play, s16 drawId) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 2), -1 * (play->state.frames * 2), 64, 64, 1, 1 * (play->state.frames * 4), 1 * -(play->state.frames * 4), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); @@ -806,12 +806,12 @@ void GetItem_DrawBulletBag(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); @@ -825,7 +825,7 @@ void GetItem_DrawWallet(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1214); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index d7d17af12..31edaa042 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -393,7 +393,7 @@ void EffectBlure_DrawElemNoInterpolation(EffectBlure* this, EffectBlureElement* Math_Vec3s_ToVec3f(&sp6C, &this->elements[0].p2); - vtx = Graph_Alloc(gfxCtx, sizeof(Vtx[4])); + vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[4])); if (vtx == NULL) { // "Vertices cannot be secured." osSyncPrintf("z_eff_blure.c::SQ_NoInterpolate_disp() 頂点確保できず。\n"); @@ -554,7 +554,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem Math_Vec3f_Scale(&sp174, 0.5f); Math_Vec3f_Scale(&sp168, 0.5f); - vtx = Graph_Alloc(gfxCtx, sizeof(Vtx[16])); + vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[16])); if (vtx == NULL) { // "Vertices cannot be secured." osSyncPrintf("z_eff_blure.c::SQ_HermiteInterpolate_disp() 頂点確保できず。\n"); @@ -849,7 +849,7 @@ void EffectBlure_DrawSimple(EffectBlure* this2, GraphicsContext* gfxCtx) { if (this->numElements >= 2) { vtxCount = this->numElements * 4; - vtx = Graph_Alloc(gfxCtx, vtxCount * sizeof(Vtx)); + vtx = GRAPH_ALLOC(gfxCtx, vtxCount * sizeof(Vtx)); if (vtx == NULL) { // "Vertices cannot be secured. Forced termination" osSyncPrintf("ブラ─表示:頂点確保できず。強制終了\n"); @@ -943,7 +943,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { Gfx_SetupDL_38Xlu(gfxCtx); gDPPipeSync(POLY_XLU_DISP++); - vtx = Graph_Alloc(gfxCtx, sizeof(Vtx[32])); + vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[32])); if (vtx == NULL) { // "Blure display: Vertex table could not be secured" osSyncPrintf("ブラ─表示:頂点テーブル確保できず\n"); diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index ad147c428..e20954bfa 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -171,7 +171,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { gSPSetGeometryMode(POLY_XLU_DISP++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH); gDPPipeSync(POLY_XLU_DISP++); - vertices = Graph_Alloc(gfxCtx, this->numElements * sizeof(Vtx[4])); + vertices = GRAPH_ALLOC(gfxCtx, this->numElements * sizeof(Vtx[4])); if (vertices == NULL) { // "Memory Allocation Failure graph_malloc" osSyncPrintf("EffectSparkInfo_disp():メモリー確保失敗 graph_malloc\n"); diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 6fb6e05d3..3147e3c0b 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -15,7 +15,8 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) { overlay->vromEnd - overlay->vromStart); } - sEffectSsInfo.table = GameState_Alloc(&play->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289); + sEffectSsInfo.table = + GAME_STATE_ALLOC(&play->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289); ASSERT(sEffectSsInfo.table != NULL, "EffectSS2Info.data_table != NULL", "../z_effect_soft_sprite.c", 290); sEffectSsInfo.searchStartIndex = 0; @@ -52,7 +53,7 @@ void EffectSs_ClearAll(PlayState* play) { addr = overlay->loadedRamAddr; if (addr != NULL) { - ZeldaArena_FreeDebug(addr, "../z_effect_soft_sprite.c", 337); + ZELDA_ARENA_FREE(addr, "../z_effect_soft_sprite.c", 337); } overlay->loadedRamAddr = NULL; @@ -189,7 +190,7 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) { initInfo = overlayEntry->initInfo; } else { if (overlayEntry->loadedRamAddr == NULL) { - overlayEntry->loadedRamAddr = ZeldaArena_MallocRDebug(overlaySize, "../z_effect_soft_sprite.c", 585); + overlayEntry->loadedRamAddr = ZELDA_ARENA_MALLOC_R(overlaySize, "../z_effect_soft_sprite.c", 585); if (overlayEntry->loadedRamAddr == NULL) { osSyncPrintf(VT_FGCOL(RED)); diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 118f0f3d9..33adc258c 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -353,8 +353,7 @@ void EnAObj_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50); } - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_a_keep.c", 712), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_a_keep.c", 712), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDLists[type]); CLOSE_DISPS(play->state.gfxCtx, "../z_en_a_keep.c", 715); diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 685464909..23bc99f82 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -831,8 +831,7 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) { texIndex = this->actor.params - 0x10; } - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1562), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTex[texIndex])); @@ -861,8 +860,7 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex])); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1607), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, gItemDropDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1611); @@ -878,14 +876,12 @@ void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(&this->actor, play, 0); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1634), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1634), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, gHeartPieceExteriorDL); Gfx_SetupDL_25Xlu(play->state.gfxCtx); func_8002ED80(&this->actor, play, 0); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1644), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1644), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, gHeartContainerInteriorDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1647); @@ -901,8 +897,7 @@ void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); func_8002ED80(&this->actor, play, 0); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1670), - G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1670), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, gHeartPieceInteriorDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1673); diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index f1e36a396..0e3eb674b 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -133,19 +133,19 @@ void TransitionTile_Destroy(TransitionTile* this) { Sleep_Msec(100); if (this->vtxData != NULL) { - SystemArena_FreeDebug(this->vtxData, "../z_fbdemo.c", 180); + SYSTEM_ARENA_FREE(this->vtxData, "../z_fbdemo.c", 180); this->vtxData = NULL; } if (this->vtxFrame1 != NULL) { - SystemArena_FreeDebug(this->vtxFrame1, "../z_fbdemo.c", 181); + SYSTEM_ARENA_FREE(this->vtxFrame1, "../z_fbdemo.c", 181); this->vtxFrame1 = NULL; } if (this->vtxFrame2 != NULL) { - SystemArena_FreeDebug(this->vtxFrame2, "../z_fbdemo.c", 182); + SYSTEM_ARENA_FREE(this->vtxFrame2, "../z_fbdemo.c", 182); this->vtxFrame2 = NULL; } if (this->gfx != NULL) { - SystemArena_FreeDebug(this->gfx, "../z_fbdemo.c", 183); + SYSTEM_ARENA_FREE(this->gfx, "../z_fbdemo.c", 183); this->gfx = NULL; } } @@ -156,28 +156,27 @@ TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows) { this->frame = 0; this->cols = cols; this->rows = rows; - this->vtxData = - SystemArena_MallocDebug((cols + 1) * sizeof(TransitionTileVtxData) * (rows + 1), "../z_fbdemo.c", 195); - this->vtxFrame1 = SystemArena_MallocDebug((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 196); - this->vtxFrame2 = SystemArena_MallocDebug((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 197); - this->gfx = SystemArena_MallocDebug((this->rows * (1 + this->cols * 9) + 2) * sizeof(Gfx), "../z_fbdemo.c", 198); + this->vtxData = SYSTEM_ARENA_MALLOC((cols + 1) * sizeof(TransitionTileVtxData) * (rows + 1), "../z_fbdemo.c", 195); + this->vtxFrame1 = SYSTEM_ARENA_MALLOC((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 196); + this->vtxFrame2 = SYSTEM_ARENA_MALLOC((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 197); + this->gfx = SYSTEM_ARENA_MALLOC((this->rows * (1 + this->cols * 9) + 2) * sizeof(Gfx), "../z_fbdemo.c", 198); if ((this->vtxData == NULL) || (this->vtxFrame1 == NULL) || (this->vtxFrame2 == NULL) || (this->gfx == NULL)) { osSyncPrintf("fbdemo_init allocation error\n"); if (this->vtxData != NULL) { - SystemArena_FreeDebug(this->vtxData, "../z_fbdemo.c", 202); + SYSTEM_ARENA_FREE(this->vtxData, "../z_fbdemo.c", 202); this->vtxData = NULL; } if (this->vtxFrame1 != NULL) { - SystemArena_FreeDebug(this->vtxFrame1, "../z_fbdemo.c", 203); + SYSTEM_ARENA_FREE(this->vtxFrame1, "../z_fbdemo.c", 203); this->vtxFrame1 = NULL; } if (this->vtxFrame2 != NULL) { - SystemArena_FreeDebug(this->vtxFrame2, "../z_fbdemo.c", 204); + SYSTEM_ARENA_FREE(this->vtxFrame2, "../z_fbdemo.c", 204); this->vtxFrame2 = NULL; } if (this->gfx != NULL) { - SystemArena_FreeDebug(this->gfx, "../z_fbdemo.c", 205); + SYSTEM_ARENA_FREE(this->gfx, "../z_fbdemo.c", 205); this->gfx = NULL; } return NULL; diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index 20e8aa259..27c947c07 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -52,8 +52,8 @@ s32 SkelCurve_Init(PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* s skelCurve->limbCount = skeletonHeader->limbCount; skelCurve->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->limbs); - skelCurve->jointTable = ZeldaArena_MallocDebug(sizeof(*skelCurve->jointTable) * skelCurve->limbCount, - "../z_fcurve_data_skelanime.c", 125); + skelCurve->jointTable = + ZELDA_ARENA_MALLOC(sizeof(*skelCurve->jointTable) * skelCurve->limbCount, "../z_fcurve_data_skelanime.c", 125); ASSERT(skelCurve->jointTable != NULL, "this->now_joint != NULL", "../z_fcurve_data_skelanime.c", 127); skelCurve->curFrame = 0.0f; return true; @@ -64,7 +64,7 @@ s32 SkelCurve_Init(PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* s */ void SkelCurve_Destroy(PlayState* play, SkelCurve* skelCurve) { if (skelCurve->jointTable != NULL) { - ZeldaArena_FreeDebug(skelCurve->jointTable, "../z_fcurve_data_skelanime.c", 146); + ZELDA_ARENA_FREE(skelCurve->jointTable, "../z_fcurve_data_skelanime.c", 146); } } @@ -192,7 +192,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov dList = limb->dList[0]; if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321), + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321), G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, dList); } @@ -201,13 +201,13 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov dList = limb->dList[0]; if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332), + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332), G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, dList); } dList = limb->dList[1]; if (dList != NULL) { - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338), G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, dList); } diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index dfae97704..04efe06ff 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -57,7 +57,7 @@ void KaleidoManager_Init(PlayState* play) { osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestSize); osSyncPrintf(VT_RST); - sKaleidoAreaPtr = GameState_Alloc(&play->state, largestSize, "../z_kaleido_manager.c", 150); + sKaleidoAreaPtr = GAME_STATE_ALLOC(&play->state, largestSize, "../z_kaleido_manager.c", 150); LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 151); osSyncPrintf(VT_FGCOL(GREEN)); diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index 5f83f5779..4caad7713 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -9,9 +9,9 @@ void func_8006EE50(Font* font, u16 arg1, u16 arg2) { * at `codePointIndex`. The value of `character` is the ASCII codepoint subtract ' '/0x20. */ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) { - DmaMgr_RequestSyncDebug(&font->charTexBuf[codePointIndex], - (uintptr_t)_nes_font_staticSegmentRomStart + character * FONT_CHAR_TEX_SIZE, - FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 93); + DMA_REQUEST_SYNC(&font->charTexBuf[codePointIndex], + (uintptr_t)_nes_font_staticSegmentRomStart + character * FONT_CHAR_TEX_SIZE, FONT_CHAR_TEX_SIZE, + "../z_kanfont.c", 93); } /** @@ -20,10 +20,10 @@ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) { * The different icons are given in the MessageBoxIcon enum. */ void Font_LoadMessageBoxIcon(Font* font, u16 icon) { - DmaMgr_RequestSyncDebug(font->iconBuf, - (uintptr_t)_message_staticSegmentRomStart + 4 * MESSAGE_STATIC_TEX_SIZE + - icon * FONT_CHAR_TEX_SIZE, - FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 100); + DMA_REQUEST_SYNC(font->iconBuf, + (uintptr_t)_message_staticSegmentRomStart + 4 * MESSAGE_STATIC_TEX_SIZE + + icon * FONT_CHAR_TEX_SIZE, + FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 100); } /** @@ -42,8 +42,8 @@ void Font_LoadOrderedFont(Font* font) { font->msgOffset = _message_0xFFFC_nes - (const char*)_nes_message_data_staticSegmentStart; len = font->msgLength = _message_0xFFFD_nes - _message_0xFFFC_nes; - DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len, - "../z_kanfont.c", 122); + DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len, + "../z_kanfont.c", 122); osSyncPrintf("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, jj = len); len = jj; @@ -60,7 +60,7 @@ void Font_LoadOrderedFont(Font* font) { osSyncPrintf("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]); offset = (font->msgBuf[codePointIndex] - ' ') * FONT_CHAR_TEX_SIZE; - DmaMgr_RequestSyncDebug(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134); + DMA_REQUEST_SYNC(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134); fontBufIndex += FONT_CHAR_TEX_SIZE / 8; } } diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index a160ba863..7c12ea7c9 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -710,9 +710,9 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon size = gNormalSkyFiles[newSkybox1Index].file.vromEnd - gNormalSkyFiles[newSkybox1Index].file.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); - DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->staticSegments[0], - gNormalSkyFiles[newSkybox1Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL, - "../z_kankyo.c", 1264); + DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->staticSegments[0], + gNormalSkyFiles[newSkybox1Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL, + "../z_kankyo.c", 1264); envCtx->skybox1Index = newSkybox1Index; } @@ -721,9 +721,9 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon size = gNormalSkyFiles[newSkybox2Index].file.vromEnd - gNormalSkyFiles[newSkybox2Index].file.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); - DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->staticSegments[1], - gNormalSkyFiles[newSkybox2Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL, - "../z_kankyo.c", 1281); + DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->staticSegments[1], + gNormalSkyFiles[newSkybox2Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL, + "../z_kankyo.c", 1281); envCtx->skybox2Index = newSkybox2Index; } @@ -735,16 +735,16 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon gNormalSkyFiles[newSkybox1Index].palette.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); - DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->palettes, - gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, - NULL, "../z_kankyo.c", 1307); + DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->palettes, + gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL, + "../z_kankyo.c", 1307); } else { size = gNormalSkyFiles[newSkybox1Index].palette.vromEnd - gNormalSkyFiles[newSkybox1Index].palette.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); - DmaMgr_RequestAsync(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size, - gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, - NULL, "../z_kankyo.c", 1320); + DMA_REQUEST_ASYNC(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size, + gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL, + "../z_kankyo.c", 1320); } } @@ -756,16 +756,16 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon gNormalSkyFiles[newSkybox2Index].palette.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); - DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->palettes, - gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, - NULL, "../z_kankyo.c", 1342); + DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->palettes, + gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL, + "../z_kankyo.c", 1342); } else { size = gNormalSkyFiles[newSkybox2Index].palette.vromEnd - gNormalSkyFiles[newSkybox2Index].palette.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); - DmaMgr_RequestAsync(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size, - gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, - NULL, "../z_kankyo.c", 1355); + DMA_REQUEST_ASYNC(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size, + gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL, + "../z_kankyo.c", 1355); } } @@ -1427,7 +1427,7 @@ void Environment_DrawSunAndMoon(PlayState* play) { scale = (color * 2.0f) + 10.0f; Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_kankyo.c", 2364), G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 2364), G_MTX_LOAD); Gfx_SetupDL_54Opa(play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, gSunDL); @@ -1446,7 +1446,7 @@ void Environment_DrawSunAndMoon(PlayState* play) { alpha = temp * 255.0f; if (alpha > 0.0f) { - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_kankyo.c", 2406), G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 2406), G_MTX_LOAD); Gfx_SetupDL_51Opa(play->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 240, 255, 180, alpha); @@ -1620,7 +1620,7 @@ void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View POLY_XLU_DISP = func_800947AC(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, lensFlareColors[i].r, lensFlareColors[i].g, lensFlareColors[i].b, alpha * envCtx->lensFlareAlphaScale); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_kankyo.c", 2662), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2662), 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); @@ -1754,7 +1754,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx) Matrix_RotateY(-rotY, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2 - rotX, MTXMODE_APPLY); Matrix_Scale(0.4f, 1.2f, 0.4f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_kankyo.c", 2887), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2887), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gRaindropDL); } @@ -1781,7 +1781,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx) Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_kankyo.c", 2940), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2940), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); } @@ -2025,7 +2025,7 @@ void Environment_DrawLightning(PlayState* play, s32 unused) { Matrix_Scale(22.0f, 100.0f, 22.0f, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, 128); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_kankyo.c", 3333), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 3333), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(lightningTextures[sLightningBolts[i].textureIndex])); Gfx_SetupDL_61Xlu(play->state.gfxCtx); diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index 42edcb102..6f3617d24 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -475,7 +475,7 @@ void Health_DrawMeter(PlayState* play) { } { - Mtx* matrix = Graph_Alloc(gfxCtx, sizeof(Mtx)); + Mtx* matrix = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); Matrix_SetTranslateScaleMtx2( matrix, 1.0f - (0.32f * beatingHeartPulsingSize), 1.0f - (0.32f * beatingHeartPulsingSize), 1.0f - (0.32f * beatingHeartPulsingSize), -130.0f + offsetX, 94.5f - offsetY, 0.0f); diff --git a/src/code/z_lights.c b/src/code/z_lights.c index 53b22cb39..1b9373474 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -279,7 +279,7 @@ Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 Lights* lights; s32 i; - lights = Graph_Alloc(gfxCtx, sizeof(Lights)); + lights = GRAPH_ALLOC(gfxCtx, sizeof(Lights)); lights->l.a.l.col[0] = lights->l.a.l.colc[0] = ambientR; lights->l.a.l.col[1] = lights->l.a.l.colc[1] = ambientG; @@ -303,7 +303,7 @@ Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB) { Lights* lights; - lights = Graph_Alloc(gfxCtx, sizeof(Lights)); + lights = GRAPH_ALLOC(gfxCtx, sizeof(Lights)); lights->l.a.l.col[0] = lights->l.a.l.colc[0] = ambientR; lights->l.a.l.col[1] = lights->l.a.l.colc[1] = ambientG; @@ -388,7 +388,7 @@ void Lights_DrawGlow(PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50); Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_lights.c", 918), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_lights.c", 918), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL); } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index c5d5f177b..b12ffe419 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -130,10 +130,10 @@ void Map_InitData(PlayState* play, s16 room) { osSyncPrintf("KKK=%d\n", extendedMapIndex); osSyncPrintf(VT_RST); sEntranceIconMapIndex = extendedMapIndex; - DmaMgr_RequestSyncDebug(interfaceCtx->mapSegment, - (uintptr_t)_map_grand_staticSegmentRomStart + - gMapData->owMinimapTexOffset[extendedMapIndex], - gMapData->owMinimapTexSize[mapIndex], "../z_map_exp.c", 309); + DMA_REQUEST_SYNC(interfaceCtx->mapSegment, + (uintptr_t)_map_grand_staticSegmentRomStart + + gMapData->owMinimapTexOffset[extendedMapIndex], + gMapData->owMinimapTexSize[mapIndex], "../z_map_exp.c", 309); interfaceCtx->unk_258 = mapIndex; break; case SCENE_DEKU_TREE: @@ -159,10 +159,10 @@ void Map_InitData(PlayState* play, s16 room) { osSyncPrintf("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room, mapIndex, VREG(30)); osSyncPrintf(VT_RST); - DmaMgr_RequestSyncDebug(play->interfaceCtx.mapSegment, - (uintptr_t)_map_i_staticSegmentRomStart + - ((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE), - MAP_I_TEX_SIZE, "../z_map_exp.c", 346); + DMA_REQUEST_SYNC(play->interfaceCtx.mapSegment, + (uintptr_t)_map_i_staticSegmentRomStart + + ((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE), + MAP_I_TEX_SIZE, "../z_map_exp.c", 346); R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room]; R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room]; Map_SetFloorPalettesData(play, VREG(30)); @@ -232,7 +232,7 @@ void Map_Init(PlayState* play) { interfaceCtx->unk_258 = -1; interfaceCtx->unk_25A = -1; - interfaceCtx->mapSegment = GameState_Alloc(&play->state, 0x1000, "../z_map_exp.c", 457); + interfaceCtx->mapSegment = GAME_STATE_ALLOC(&play->state, 0x1000, "../z_map_exp.c", 457); // "MAP texture initialization scene_data_ID=%d mapSegment=%x" osSyncPrintf("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneId, interfaceCtx->mapSegment, play); @@ -334,7 +334,7 @@ void Minimap_DrawCompassIcons(PlayState* play) { Matrix_RotateX(-1.6f, MTXMODE_APPLY); tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400; Matrix_RotateY(tempX / 10.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_map_exp.c", 585), + gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_map_exp.c", 585), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255); @@ -348,7 +348,7 @@ void Minimap_DrawCompassIcons(PlayState* play) { Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY); Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY); Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_map_exp.c", 603), + gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_map_exp.c", 603), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255); diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index e84cbaaec..60e092daf 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -57,7 +57,7 @@ void MapMark_Init(PlayState* play) { MapMarkDataOverlay* overlay = &sMapMarkDataOvl; u32 overlaySize = (uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart; - overlay->loadedRamAddr = GameState_Alloc(&play->state, overlaySize, "../z_map_mark.c", 235); + overlay->loadedRamAddr = GAME_STATE_ALLOC(&play->state, overlaySize, "../z_map_mark.c", 235); LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236); Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr); diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 8313c667a..d43148efd 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -1161,16 +1161,16 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) { R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem32XOffsets[gSaveContext.language]; R_TEXTBOX_ICON_YPOS = y + ((44 - ITEM_ICON_HEIGHT) / 2); R_TEXTBOX_ICON_DIMENSION = ITEM_ICON_WIDTH; // assumes the image is square - DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_ITEM_ICON_VROM(itemId), - ITEM_ICON_SIZE, "../z_message_PAL.c", 1473); + DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_ITEM_ICON_VROM(itemId), ITEM_ICON_SIZE, + "../z_message_PAL.c", 1473); // "Item 32-0" osSyncPrintf("アイテム32-0\n"); } else { R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[gSaveContext.language]; R_TEXTBOX_ICON_YPOS = y + ((44 - QUEST_ICON_HEIGHT) / 2); R_TEXTBOX_ICON_DIMENSION = QUEST_ICON_WIDTH; // assumes the image is square - DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_QUEST_ICON_VROM(itemId), - QUEST_ICON_SIZE, "../z_message_PAL.c", 1482); + DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_QUEST_ICON_VROM(itemId), QUEST_ICON_SIZE, + "../z_message_PAL.c", 1482); // "Item 24" osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84); } @@ -1527,14 +1527,14 @@ void Message_Decode(PlayState* play) { msgCtx->textboxBackgroundBackColorIdx = font->msgBuf[msgCtx->msgBufPos + 2] & 0xF; msgCtx->textboxBackgroundYOffsetIdx = (font->msgBuf[msgCtx->msgBufPos + 3] & 0xF0) >> 4; msgCtx->textboxBackgroundUnkArg = font->msgBuf[msgCtx->msgBufPos + 3] & 0xF; - DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, - (uintptr_t)_message_texture_staticSegmentRomStart + - msgCtx->textboxBackgroundIdx * MESSAGE_TEXTURE_STATIC_TEX_SIZE, - MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1830); - DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + MESSAGE_TEXTURE_STATIC_TEX_SIZE, - (uintptr_t)_message_texture_staticSegmentRomStart + - (msgCtx->textboxBackgroundIdx + 1) * MESSAGE_TEXTURE_STATIC_TEX_SIZE, - MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1834); + DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, + (uintptr_t)_message_texture_staticSegmentRomStart + + msgCtx->textboxBackgroundIdx * MESSAGE_TEXTURE_STATIC_TEX_SIZE, + MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1830); + DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + MESSAGE_TEXTURE_STATIC_TEX_SIZE, + (uintptr_t)_message_texture_staticSegmentRomStart + + (msgCtx->textboxBackgroundIdx + 1) * MESSAGE_TEXTURE_STATIC_TEX_SIZE, + MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1834); msgCtx->msgBufPos += 3; R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8; numLines = 2; @@ -1629,24 +1629,24 @@ void Message_OpenText(PlayState* play, u16 textId) { if (sTextIsCredits) { Message_FindCreditsMessage(play, textId); msgCtx->msgLength = font->msgLength; - DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset, - font->msgLength, "../z_message_PAL.c", 1954); + DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength, "../z_message_PAL.c", 1954); } else { if (gSaveContext.language == LANGUAGE_ENG) { Message_FindMessage(play, textId); msgCtx->msgLength = font->msgLength; - DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, - font->msgLength, "../z_message_PAL.c", 1966); + DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength, "../z_message_PAL.c", 1966); } else if (gSaveContext.language == LANGUAGE_GER) { Message_FindMessage(play, textId); msgCtx->msgLength = font->msgLength; - DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset, - font->msgLength, "../z_message_PAL.c", 1978); + DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength, "../z_message_PAL.c", 1978); } else { Message_FindMessage(play, textId); msgCtx->msgLength = font->msgLength; - DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset, - font->msgLength, "../z_message_PAL.c", 1990); + DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength, "../z_message_PAL.c", 1990); } } msgCtx->textBoxProperties = font->charTexBuf[0]; @@ -1656,10 +1656,10 @@ void Message_OpenText(PlayState* play, u16 textId) { // "Text Box Type" osSyncPrintf("吹き出し種類=%d\n", msgCtx->textBoxType); if (textBoxType < TEXTBOX_TYPE_NONE_BOTTOM) { - DmaMgr_RequestSyncDebug(msgCtx->textboxSegment, - (uintptr_t)_message_staticSegmentRomStart + - (messageStaticIndices[textBoxType] * MESSAGE_STATIC_TEX_SIZE), - MESSAGE_STATIC_TEX_SIZE, "../z_message_PAL.c", 2006); + DMA_REQUEST_SYNC(msgCtx->textboxSegment, + (uintptr_t)_message_staticSegmentRomStart + + (messageStaticIndices[textBoxType] * MESSAGE_STATIC_TEX_SIZE), + MESSAGE_STATIC_TEX_SIZE, "../z_message_PAL.c", 2006); if (textBoxType == TEXTBOX_TYPE_BLACK) { msgCtx->textboxColorRed = 0; msgCtx->textboxColorGreen = 0; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 8f541f8b4..9db54bc97 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -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); diff --git a/src/code/z_play.c b/src/code/z_play.c index a90f0ab6e..753ce80f1 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -397,7 +397,7 @@ void Play_Init(GameState* thisx) { osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetRemaining(&this->state.tha)); zAllocSize = THA_GetRemaining(&this->state.tha); - zAlloc = (uintptr_t)GameState_Alloc(&this->state, zAllocSize, "../z_play.c", 2918); + zAlloc = (uintptr_t)GAME_STATE_ALLOC(&this->state, zAllocSize, "../z_play.c", 2918); zAllocAligned = (zAlloc + 8) & ~0xF; ZeldaArena_Init((void*)zAllocAligned, zAllocSize - (zAllocAligned - zAlloc)); // "Zelda Heap" @@ -1077,8 +1077,8 @@ void Play_Draw(PlayState* this) { this->billboardMtxF.mf[3][0] = this->billboardMtxF.mf[3][1] = this->billboardMtxF.mf[3][2] = 0.0f; // This transpose is where the viewing matrix is properly converted into a billboard matrix Matrix_Transpose(&this->billboardMtxF); - this->billboardMtx = Matrix_MtxFToMtx(Matrix_CheckFloats(&this->billboardMtxF, "../z_play.c", 4005), - Graph_Alloc(gfxCtx, sizeof(Mtx))); + this->billboardMtx = Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(&this->billboardMtxF, "../z_play.c", 4005), + GRAPH_ALLOC(gfxCtx, sizeof(Mtx))); gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx); @@ -1413,8 +1413,8 @@ void* Play_LoadFile(PlayState* this, RomFile* file) { void* allocp; size = file->vromEnd - file->vromStart; - allocp = GameState_Alloc(&this->state, size, "../z_play.c", 4692); - DmaMgr_RequestSyncDebug(allocp, file->vromStart, size, "../z_play.c", 4694); + allocp = GAME_STATE_ALLOC(&this->state, size, "../z_play.c", 4692); + DMA_REQUEST_SYNC(allocp, file->vromStart, size, "../z_play.c", 4694); return allocp; } diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index feee098ca..7a7d9c366 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1368,7 +1368,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) { Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW); Matrix_Scale(sp60, sp60, sp60, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2587), + gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2587), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment); gSPDisplayList(OVERLAY_DISP++, gLinkAdultHookshotReticleDL); @@ -1475,7 +1475,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY); Matrix_Scale(1.0f, this->unk_85C, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2653), + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2653), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL); @@ -1496,7 +1496,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2710); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2712), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2712), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetEnvColor(POLY_XLU_DISP++, bottleColor->r, bottleColor->g, bottleColor->b, 0); gSPDisplayList(POLY_XLU_DISP++, sBottleDLists[((void)0, gSaveContext.save.linkAge)]); @@ -1569,7 +1569,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_RotateZ(this->unk_858 * -0.2f, MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2804), + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2804), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, stringData->dList); @@ -1648,11 +1648,11 @@ u32 Player_InitPauseDrawData(PlayState* play, u8* segment, SkelAnime* skelAnime) size = gObjectTable[OBJECT_GAMEPLAY_KEEP].vromEnd - gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart; ptr = segment + PAUSE_EQUIP_BUFFER_SIZE; - DmaMgr_RequestSyncDebug(ptr, gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart, size, "../z_player_lib.c", 2982); + DMA_REQUEST_SYNC(ptr, gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart, size, "../z_player_lib.c", 2982); size = gObjectTable[linkObjectId].vromEnd - gObjectTable[linkObjectId].vromStart; ptr = segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE; - DmaMgr_RequestSyncDebug(ptr, gObjectTable[linkObjectId].vromStart, size, "../z_player_lib.c", 2988); + DMA_REQUEST_SYNC(ptr, gObjectTable[linkObjectId].vromStart, size, "../z_player_lib.c", 2988); ptr = (void*)ALIGN16((uintptr_t)ptr + size); @@ -1728,8 +1728,8 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, Gfx* opaRef; Gfx* xluRef; u16 perspNorm; - Mtx* perspMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx)); - Mtx* lookAtMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx)); + Mtx* perspMtx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx)); + Mtx* lookAtMtx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx)); OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 3129); diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 3b9a85098..b9948003c 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -1380,7 +1380,7 @@ Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y) { } Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) { - Gfx* displayList = Graph_Alloc(gfxCtx, 3 * sizeof(Gfx)); + Gfx* displayList = GRAPH_ALLOC(gfxCtx, 3 * sizeof(Gfx)); x %= 512 << 2; y %= 512 << 2; @@ -1394,7 +1394,7 @@ Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2) { - Gfx* displayList = Graph_Alloc(gfxCtx, 5 * sizeof(Gfx)); + Gfx* displayList = GRAPH_ALLOC(gfxCtx, 5 * sizeof(Gfx)); x1 %= 512 << 2; y1 %= 512 << 2; @@ -1412,7 +1412,7 @@ Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 wi Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a) { - Gfx* displayList = Graph_Alloc(gfxCtx, 6 * sizeof(Gfx)); + Gfx* displayList = GRAPH_ALLOC(gfxCtx, 6 * sizeof(Gfx)); x1 %= 512 << 2; y1 %= 512 << 2; @@ -1430,7 +1430,7 @@ Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1 } Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a) { - Gfx* displayList = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx)); + Gfx* displayList = GRAPH_ALLOC(gfxCtx, 2 * sizeof(Gfx)); gDPSetEnvColor(displayList, r, g, b, a); gSPEndDisplayList(displayList + 1); diff --git a/src/code/z_room.c b/src/code/z_room.c index e0a79f1e9..1e9e29e8f 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -571,7 +571,7 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { osSyncPrintf(VT_FGCOL(YELLOW)); // "Room buffer size=%08x(%5.1fK)" osSyncPrintf("部屋バッファサイズ=%08x(%5.1fK)\n", maxRoomSize, maxRoomSize / 1024.0f); - roomCtx->bufPtrs[0] = GameState_Alloc(&play->state, maxRoomSize, "../z_room.c", 946); + roomCtx->bufPtrs[0] = GAME_STATE_ALLOC(&play->state, maxRoomSize, "../z_room.c", 946); // "Room buffer initial pointer=%08x" osSyncPrintf("部屋バッファ開始ポインタ=%08x\n", roomCtx->bufPtrs[0]); roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + maxRoomSize); @@ -604,8 +604,8 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) { (void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7)); osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1); - DmaMgr_RequestAsync(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0, - &roomCtx->loadQueue, NULL, "../z_room.c", 1036); + DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0, + &roomCtx->loadQueue, NULL, "../z_room.c", 1036); roomCtx->unk_30 ^= 1; return true; diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 3b5e1c208..d2469cf40 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -22,7 +22,7 @@ void Sample_Draw(SampleState* this) { View_Apply(view, VIEW_ALL); { - Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); + Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); guPosition(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42)); gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); @@ -79,8 +79,8 @@ void Sample_SetupView(SampleState* this) { void Sample_LoadTitleStatic(SampleState* this) { u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart; - this->staticSegment = GameState_Alloc(&this->state, size, "../z_sample.c", 163); - DmaMgr_RequestSyncDebug(this->staticSegment, (uintptr_t)_title_staticSegmentRomStart, size, "../z_sample.c", 164); + this->staticSegment = GAME_STATE_ALLOC(&this->state, size, "../z_sample.c", 163); + DMA_REQUEST_SYNC(this->staticSegment, (uintptr_t)_title_staticSegmentRomStart, size, "../z_sample.c", 164); } void Sample_Init(GameState* thisx) { diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 72d77af17..e8f6ef795 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -32,8 +32,8 @@ s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 objectId) { "this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment", "../z_scene.c", 142); - DmaMgr_RequestSyncDebug(objectCtx->slots[objectCtx->numEntries].segment, gObjectTable[objectId].vromStart, size, - "../z_scene.c", 145); + DMA_REQUEST_SYNC(objectCtx->slots[objectCtx->numEntries].segment, gObjectTable[objectId].vromStart, size, + "../z_scene.c", 145); if (objectCtx->numEntries < (ARRAY_COUNT(objectCtx->slots) - 1)) { objectCtx->slots[objectCtx->numEntries + 1].segment = @@ -81,7 +81,8 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { osSyncPrintf("オブジェクト入れ替えバンク情報 %8.3fKB\n", spaceSize / 1024.0f); osSyncPrintf(VT_RST); - objectCtx->spaceStart = objectCtx->slots[0].segment = GameState_Alloc(&play->state, spaceSize, "../z_scene.c", 219); + objectCtx->spaceStart = objectCtx->slots[0].segment = + GAME_STATE_ALLOC(&play->state, spaceSize, "../z_scene.c", 219); objectCtx->spaceEnd = (void*)((uintptr_t)objectCtx->spaceStart + spaceSize); objectCtx->mainKeepSlot = Object_SpawnPersistent(objectCtx, OBJECT_GAMEPLAY_KEEP); @@ -103,8 +104,8 @@ void Object_UpdateEntries(ObjectContext* objectCtx) { osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, size / 1024.0f, entry->segment); - DmaMgr_RequestAsync(&entry->dmaRequest, entry->segment, objectFile->vromStart, size, 0, - &entry->loadQueue, NULL, "../z_scene.c", 266); + DMA_REQUEST_ASYNC(&entry->dmaRequest, entry->segment, objectFile->vromStart, size, 0, &entry->loadQueue, + NULL, "../z_scene.c", 266); } else if (osRecvMesg(&entry->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) { entry->id = -entry->id; } @@ -145,7 +146,7 @@ void func_800981B8(ObjectContext* objectCtx) { objectCtx->slots[i].segment); osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->numEntries, (uintptr_t)objectCtx->slots[i].segment + size, objectCtx->spaceEnd); - DmaMgr_RequestSyncDebug(objectCtx->slots[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342); + DMA_REQUEST_SYNC(objectCtx->slots[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342); } } diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 835ad264f..334880e06 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -157,7 +157,7 @@ void* sDCLavaFloorTextures[] = { void Scene_DrawConfigDodongosCavern(PlayState* play) { u32 gameplayFrames; s32 pad; - Gfx* displayListHead = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Gfx[3])); + Gfx* displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 2 * sizeof(Gfx[3])); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 4905); @@ -193,7 +193,7 @@ void Scene_DrawConfigDodongosCavern(PlayState* play) { void Scene_DrawConfigTempleOfTime(PlayState* play) { f32 temp; - Gfx* displayListHead = Graph_Alloc(play->state.gfxCtx, 18 * sizeof(Gfx)); + Gfx* displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 18 * sizeof(Gfx)); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5069); @@ -784,7 +784,7 @@ void Scene_DrawConfigGerudoTrainingGround(PlayState* play) { Gfx* Gfx_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a) { - Gfx* displayList = Graph_Alloc(gfxCtx, 10 * sizeof(Gfx)); + Gfx* displayList = GRAPH_ALLOC(gfxCtx, 10 * sizeof(Gfx)); x1 %= 512 << 2; y1 %= 512 << 2; @@ -966,7 +966,7 @@ void Scene_DrawConfigHyruleField(PlayState* play) { u32 gameplayFrames; Gfx* displayListHead; - displayListHead = Graph_Alloc(play->state.gfxCtx, 3 * sizeof(Gfx)); + displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 3 * sizeof(Gfx)); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6814); @@ -1065,7 +1065,7 @@ void Scene_DrawConfigKokiriForest(PlayState* play) { spA3 = 128; spA0 = 500; - displayListHead = Graph_Alloc(play->state.gfxCtx, 6 * sizeof(Gfx)); + displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 6 * sizeof(Gfx)); if (1) {} if (1) {} @@ -1335,7 +1335,7 @@ void Scene_DrawConfigHyruleCastle(PlayState* play) { } void Scene_DrawConfigDeathMountainTrail(PlayState* play) { - Gfx* displayListHead = Graph_Alloc(play->state.gfxCtx, 3 * sizeof(Gfx)); + Gfx* displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 3 * sizeof(Gfx)); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7461); @@ -1537,7 +1537,7 @@ void Scene_DrawConfigJabuJabu(PlayState* play) { Matrix_Scale(1.005f, sinf(D_8012A398) * 0.8f, 1.005f, MTXMODE_NEW); } - gSPSegment(POLY_OPA_DISP++, 0x0D, Matrix_NewMtx(play->state.gfxCtx, "../z_scene_table.c", 7809)); + gSPSegment(POLY_OPA_DISP++, 0x0D, MATRIX_NEW(play->state.gfxCtx, "../z_scene_table.c", 7809)); CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7811); } diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 0efb58769..f6324b361 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -39,7 +39,7 @@ void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3 if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 805), G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 805), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } } @@ -97,7 +97,7 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } } @@ -143,7 +143,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { - Matrix_ToMtx(*mtx, "../z_skelanime.c", 945); + MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 945); { OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 946); gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD); @@ -152,7 +152,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, } (*mtx)++; } else if (limbDList != NULL) { - Matrix_ToMtx(*mtx, "../z_skelanime.c", 954); + MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 954); (*mtx)++; } } @@ -185,7 +185,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, Gfx* limbDList; Vec3f pos; Vec3s rot; - Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(Mtx)); + Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, dListCount * sizeof(Mtx)); if (skeleton == NULL) { osSyncPrintf(VT_FGCOL(RED)); @@ -211,12 +211,12 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { - Matrix_ToMtx(mtx, "../z_skelanime.c", 1033); + MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1033); gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, newDList); mtx++; } else if (limbDList != NULL) { - Matrix_ToMtx(mtx, "../z_skelanime.c", 1040); + MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1040); mtx++; } } @@ -258,7 +258,7 @@ void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3 if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1103), G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1103), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } } @@ -314,7 +314,7 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1176), G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1176), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } } @@ -361,12 +361,12 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { - Matrix_ToMtx(*limbMatrices, "../z_skelanime.c", 1242); + MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1242); gSPMatrix(POLY_OPA_DISP++, *limbMatrices, G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, newDList); (*limbMatrices)++; } else if (limbDList != NULL) { - Matrix_ToMtx(*limbMatrices, "../z_skelanime.c", 1249); + MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1249); (*limbMatrices)++; } } @@ -402,7 +402,7 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Gfx* limbDList; Vec3f pos; Vec3s rot; - Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(Mtx)); + Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, dListCount * sizeof(Mtx)); if (skeleton == NULL) { osSyncPrintf(VT_FGCOL(RED)); @@ -430,12 +430,12 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { - Matrix_ToMtx(mtx, "../z_skelanime.c", 1327); + MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1327); gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, newDList); mtx++; } else if (limbDList != NULL) { - Matrix_ToMtx(mtx, "../z_skelanime.c", 1334); + MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1334); mtx++; } } @@ -522,7 +522,7 @@ Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD); + gSPMatrix(gfx++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD); gSPDisplayList(gfx++, dList); } } @@ -578,7 +578,7 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD); + gSPMatrix(gfx++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD); gSPDisplayList(gfx++, dList); } } @@ -622,12 +622,12 @@ Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { - Matrix_ToMtx(*mtx, "../z_skelanime.c", 1623); + MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 1623); gSPMatrix(gfx++, *mtx, G_MTX_LOAD); gSPDisplayList(gfx++, newDList); (*mtx)++; } else if (limbDList != NULL) { - Matrix_ToMtx(*mtx, "../z_skelanime.c", 1630); + MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 1630); (*mtx)++; } } @@ -662,7 +662,7 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 Gfx* limbDList; Vec3f pos; Vec3s rot; - Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(*mtx)); + Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, dListCount * sizeof(*mtx)); if (skeleton == NULL) { osSyncPrintf(VT_FGCOL(RED)); @@ -687,12 +687,12 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { - Matrix_ToMtx(mtx, "../z_skelanime.c", 1710); + MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1710); gSPMatrix(gfx++, mtx, G_MTX_LOAD); gSPDisplayList(gfx++, newDList); mtx++; } else if (limbDList != NULL) { - Matrix_ToMtx(mtx, "../z_skelanime.c", 1717); + MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1717); mtx++; } } @@ -845,10 +845,9 @@ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animati s32 pad; osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1); - DmaMgr_RequestAsync(&entry->data.load.req, frameTable, - LINK_ANIMATION_OFFSET(linkAnimHeader->segment, ((sizeof(Vec3s) * limbCount + 2) * frame)), - sizeof(Vec3s) * limbCount + 2, 0, &entry->data.load.msgQueue, NULL, "../z_skelanime.c", - 2004); + DMA_REQUEST_ASYNC(&entry->data.load.req, frameTable, + LINK_ANIMATION_OFFSET(linkAnimHeader->segment, ((sizeof(Vec3s) * limbCount + 2) * frame)), + sizeof(Vec3s) * limbCount + 2, 0, &entry->data.load.msgQueue, NULL, "../z_skelanime.c", 2004); } } @@ -1068,8 +1067,8 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade } if (jointTable == NULL) { - skelAnime->jointTable = ZeldaArena_MallocDebug(allocSize, "../z_skelanime.c", 2364); - skelAnime->morphTable = ZeldaArena_MallocDebug(allocSize, "../z_skelanime.c", 2365); + skelAnime->jointTable = ZELDA_ARENA_MALLOC(allocSize, "../z_skelanime.c", 2364); + skelAnime->morphTable = ZELDA_ARENA_MALLOC(allocSize, "../z_skelanime.c", 2365); } else { ASSERT(limbBufCount == limbCount, "joint_buff_num == joint_num", "../z_skelanime.c", 2369); @@ -1384,9 +1383,9 @@ SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHe skelAnime->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->segment); if (jointTable == NULL) { skelAnime->jointTable = - ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 2968); + ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 2968); skelAnime->morphTable = - ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 2969); + ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 2969); } else { ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 2973); skelAnime->jointTable = jointTable; @@ -1417,10 +1416,10 @@ SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* sk if (jointTable == NULL) { skelAnime->jointTable = - ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3047); + ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3047); skelAnime->morphTable = - ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3048); + ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3048); } else { ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 3052); skelAnime->jointTable = jointTable; @@ -1449,9 +1448,9 @@ SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skelet skelAnime->limbCount = skeletonHeader->limbCount + 1; skelAnime->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->segment); skelAnime->jointTable = - ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3120); + ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3120); skelAnime->morphTable = - ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3121); + ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3121); if ((skelAnime->jointTable == NULL) || (skelAnime->morphTable == NULL)) { osSyncPrintf(VT_FGCOL(RED)); // "Memory allocation error" @@ -1839,13 +1838,13 @@ s32 Animation_OnFrame(SkelAnime* skelAnime, f32 frame) { */ void SkelAnime_Free(SkelAnime* skelAnime, PlayState* play) { if (skelAnime->jointTable != NULL) { - ZeldaArena_FreeDebug(skelAnime->jointTable, "../z_skelanime.c", 3729); + ZELDA_ARENA_FREE(skelAnime->jointTable, "../z_skelanime.c", 3729); } else { osSyncPrintf("now_joint あきまへん!!\n"); // "now_joint is freed! !" } if (skelAnime->morphTable != NULL) { - ZeldaArena_FreeDebug(skelAnime->morphTable, "../z_skelanime.c", 3731); + ZELDA_ARENA_FREE(skelAnime->morphTable, "../z_skelanime.c", 3731); } else { osSyncPrintf("morf_joint あきまへん!!\n"); // "morf_joint is freed !!" } diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c index e16556ca6..ed5d9e587 100644 --- a/src/code/z_skin_awb.c +++ b/src/code/z_skin_awb.c @@ -48,7 +48,7 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim skeleton = SEGMENTED_TO_VIRTUAL(skin->skeletonHeader->segment); limbCount = skin->skeletonHeader->limbCount; - skin->vtxTable = ZeldaArena_MallocDebug(limbCount * sizeof(SkinLimbVtx), "../z_skin_awb.c", 212); + skin->vtxTable = ZELDA_ARENA_MALLOC(limbCount * sizeof(SkinLimbVtx), "../z_skin_awb.c", 212); ASSERT(skin->vtxTable != NULL, "pskin_awb->avb_tbl != NULL", "../z_skin_awb.c", 214); @@ -67,11 +67,11 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim vtxEntry->index = 0; vtxEntry->buf[0] = - ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 235); + ZELDA_ARENA_MALLOC(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 235); ASSERT(vtxEntry->buf[0] != NULL, "psavb->buf[0] != NULL", "../z_skin_awb.c", 237); vtxEntry->buf[1] = - ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 240); + ZELDA_ARENA_MALLOC(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 240); ASSERT(vtxEntry->buf[1] != NULL, "psavb->buf[1] != NULL", "../z_skin_awb.c", 242); Skin_InitAnimatedLimb(play, skin, i); @@ -90,17 +90,17 @@ void Skin_Free(PlayState* play, Skin* skin) { for (i = 0; i < skin->limbCount; i++) { if (skin->vtxTable[i].buf[0] != NULL) { - ZeldaArena_FreeDebug(skin->vtxTable[i].buf[0], "../z_skin_awb.c", 276); + ZELDA_ARENA_FREE(skin->vtxTable[i].buf[0], "../z_skin_awb.c", 276); skin->vtxTable[i].buf[0] = NULL; } if (skin->vtxTable[i].buf[1] != NULL) { - ZeldaArena_FreeDebug(skin->vtxTable[i].buf[1], "../z_skin_awb.c", 280); + ZELDA_ARENA_FREE(skin->vtxTable[i].buf[1], "../z_skin_awb.c", 280); skin->vtxTable[i].buf[1] = NULL; } } if (skin->vtxTable != NULL) { - ZeldaArena_FreeDebug(skin->vtxTable, "../z_skin_awb.c", 286); + ZELDA_ARENA_FREE(skin->vtxTable, "../z_skin_awb.c", 286); } SkelAnime_Free(&skin->skelAnime, play); diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c index 35b8411a4..3879af52f 100644 --- a/src/code/z_skin_matrix.c +++ b/src/code/z_skin_matrix.c @@ -593,7 +593,7 @@ void SkinMatrix_MtxFToMtx(MtxF* src, Mtx* dest) { } Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src) { - Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); + Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); if (mtx == NULL) { osSyncPrintf("Skin_Matrix_to_Mtx_new() 確保失敗:NULLを返して終了\n", mtx); diff --git a/src/code/z_sram.c b/src/code/z_sram.c index be42f16fd..ff5452723 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -915,7 +915,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { } void Sram_Alloc(GameState* gameState, SramContext* sramCtx) { - sramCtx->readBuff = GameState_Alloc(gameState, SRAM_SIZE, "../z_sram.c", 1294); + sramCtx->readBuff = GAME_STATE_ALLOC(gameState, SRAM_SIZE, "../z_sram.c", 1294); ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295); } diff --git a/src/code/z_view.c b/src/code/z_view.c index 117957d1b..d1df496ba 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -21,7 +21,7 @@ void View_ViewportToVp(Vp* dest, Viewport* src) { } View* View_New(GraphicsContext* gfxCtx) { - View* view = SystemArena_MallocDebug(sizeof(View), "../z_view.c", 285); + View* view = SYSTEM_ARENA_MALLOC(sizeof(View), "../z_view.c", 285); if (view != NULL) { __osMemset(view, 0, sizeof(View)); @@ -32,7 +32,7 @@ View* View_New(GraphicsContext* gfxCtx) { } void View_Free(View* view) { - SystemArena_FreeDebug(view, "../z_view.c", 297); + SYSTEM_ARENA_FREE(view, "../z_view.c", 297); } void View_Init(View* view, GraphicsContext* gfxCtx) { @@ -261,7 +261,7 @@ s32 View_StepDistortion(View* view, Mtx* projectionMtx) { Matrix_RotateZ(-view->curDistortionOrientation.z, MTXMODE_APPLY); Matrix_RotateY(-view->curDistortionOrientation.y, MTXMODE_APPLY); Matrix_RotateX(-view->curDistortionOrientation.x, MTXMODE_APPLY); - Matrix_ToMtx(projectionMtx, "../z_view.c", 566); + MATRIX_TO_MTX(projectionMtx, "../z_view.c", 566); return true; } @@ -291,7 +291,7 @@ s32 View_ApplyPerspective(View* view) { OPEN_DISPS(gfxCtx, "../z_view.c", 596); // Viewport - vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp)); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 601); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -302,7 +302,7 @@ s32 View_ApplyPerspective(View* view) { gSPViewport(POLY_XLU_DISP++, vp); // Perspective projection - projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 616); view->projectionPtr = projection; @@ -350,7 +350,7 @@ s32 View_ApplyPerspective(View* view) { gSPMatrix(POLY_XLU_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); // View matrix (look-at) - viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); + viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 667); view->viewingPtr = viewing; @@ -394,7 +394,7 @@ s32 View_ApplyOrtho(View* view) { OPEN_DISPS(gfxCtx, "../z_view.c", 726); - vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp)); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 730); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -405,7 +405,7 @@ s32 View_ApplyOrtho(View* view) { gSPViewport(POLY_XLU_DISP++, vp); gSPViewport(OVERLAY_DISP++, vp); - projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 744); view->projectionPtr = projection; @@ -434,7 +434,7 @@ s32 View_ApplyOrthoToOverlay(View* view) { OPEN_DISPS(gfxCtx, "../z_view.c", 777); - vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp)); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 781); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -444,7 +444,7 @@ s32 View_ApplyOrthoToOverlay(View* view) { view->viewport.bottomY); gSPViewport(OVERLAY_DISP++, vp); - projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 791); view->projectionPtr = projection; @@ -475,7 +475,7 @@ s32 View_ApplyPerspectiveToOverlay(View* view) { OPEN_DISPS(gfxCtx, "../z_view.c", 816); - vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp)); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 821); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -485,7 +485,7 @@ s32 View_ApplyPerspectiveToOverlay(View* view) { view->viewport.bottomY); gSPViewport(OVERLAY_DISP++, vp); - projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 833); view->projectionPtr = projection; @@ -500,7 +500,7 @@ s32 View_ApplyPerspectiveToOverlay(View* view) { gSPPerspNormalize(OVERLAY_DISP++, view->normal); gSPMatrix(OVERLAY_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); + viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 848); view->viewingPtr = viewing; @@ -551,7 +551,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) { mask = (view->flags & mask) | (mask >> 4); if (mask & VIEW_VIEWPORT) { - vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp)); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 910); View_ViewportToVp(vp, &view->viewport); @@ -564,7 +564,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) { } if (mask & VIEW_PROJECTION_ORTHO) { - projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 921); view->projectionPtr = projection; @@ -575,7 +575,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) { gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); } else if (mask & (VIEW_PROJECTION_PERSPECTIVE | VIEW_VIEWPORT)) { - projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 932); view->projectionPtr = projection; @@ -592,7 +592,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) { } if (mask & VIEW_VIEWING) { - viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); + viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 948); view->viewingPtr = viewing; diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c index 8f0a5653f..99b20f0f5 100644 --- a/src/code/z_vismono.c +++ b/src/code/z_vismono.c @@ -45,7 +45,7 @@ void VisMono_Init(VisMono* this) { } void VisMono_Destroy(VisMono* this) { - SystemArena_FreeDebug(this->dList, "../z_vismono.c", 137); + SYSTEM_ARENA_FREE(this->dList, "../z_vismono.c", 137); } void VisMono_DesaturateTLUT(VisMono* this, u16* tlut) { @@ -187,12 +187,12 @@ void VisMono_DrawOld(VisMono* this) { Gfx* dListEnd; if (this->tlut == NULL) { - this->tlut = SystemArena_MallocDebug(256 * G_IM_SIZ_16b_BYTES, "../z_vismono.c", 283); + this->tlut = SYSTEM_ARENA_MALLOC(256 * G_IM_SIZ_16b_BYTES, "../z_vismono.c", 283); VisMono_DesaturateTLUT(this, this->tlut); } if (this->dList == NULL) { - this->dList = SystemArena_MallocDebug(VISMONO_DLSIZE * sizeof(Gfx), "../z_vismono.c", 289); + this->dList = SYSTEM_ARENA_MALLOC(VISMONO_DLSIZE * sizeof(Gfx), "../z_vismono.c", 289); dListEnd = VisMono_DesaturateDList(this, this->dList); ASSERT(dListEnd <= this->dList + VISMONO_DLSIZE, "glistp_end <= this->mono_dl + DLSIZE", "../z_vismono.c", 292); } diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index 221038ea0..ed3547d4f 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -487,43 +487,43 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { } size = gNormalSkyFiles[skybox1Index].file.vromEnd - gNormalSkyFiles[skybox1Index].file.vromStart; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1054); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1054); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1055); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], gNormalSkyFiles[skybox1Index].file.vromStart, size, - "../z_vr_box.c", 1058); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], gNormalSkyFiles[skybox1Index].file.vromStart, size, + "../z_vr_box.c", 1058); size = gNormalSkyFiles[skybox2Index].file.vromEnd - gNormalSkyFiles[skybox2Index].file.vromStart; - skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1060); + skyboxCtx->staticSegments[1] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1060); ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c", 1061); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], gNormalSkyFiles[skybox2Index].file.vromStart, size, - "../z_vr_box.c", 1064); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[1], gNormalSkyFiles[skybox2Index].file.vromStart, size, + "../z_vr_box.c", 1064); if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) { size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart; - skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1072); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1072); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, gNormalSkyFiles[skybox1Index].palette.vromStart, size, - "../z_vr_box.c", 1075); - DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, - gNormalSkyFiles[skybox2Index].palette.vromStart, size, "../z_vr_box.c", 1077); + DMA_REQUEST_SYNC(skyboxCtx->palettes, gNormalSkyFiles[skybox1Index].palette.vromStart, size, + "../z_vr_box.c", 1075); + DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, gNormalSkyFiles[skybox2Index].palette.vromStart, size, + "../z_vr_box.c", 1077); } else { size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart; - skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1085); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1085); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, gNormalSkyFiles[skybox2Index].palette.vromStart, size, - "../z_vr_box.c", 1088); - DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, - gNormalSkyFiles[skybox1Index].palette.vromStart, size, "../z_vr_box.c", 1090); + DMA_REQUEST_SYNC(skyboxCtx->palettes, gNormalSkyFiles[skybox2Index].palette.vromStart, size, + "../z_vr_box.c", 1088); + DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, gNormalSkyFiles[skybox1Index].palette.vromStart, size, + "../z_vr_box.c", 1090); } break; @@ -532,162 +532,162 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_SP1a_staticSegmentRomStart; size = (uintptr_t)_vr_SP1a_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1127); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1127); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1128); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1129); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1129); start = (uintptr_t)_vr_SP1a_pal_staticSegmentRomStart; size = (uintptr_t)_vr_SP1a_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1132); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1132); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1133); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1134); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1134); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_OVERCAST_SUNSET: start = (uintptr_t)_vr_cloud2_staticSegmentRomStart; size = (uintptr_t)_vr_cloud2_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1155); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1155); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1156); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1159); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1159); - skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1162); + skyboxCtx->staticSegments[1] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1162); ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c", 1163); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1166); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1166); start = (uintptr_t)_vr_cloud2_pal_staticSegmentRomStart; size = (uintptr_t)_vr_cloud2_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1170); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1170); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1171); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1173); - DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, start, size, "../z_vr_box.c", 1175); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1173); + DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, start, size, "../z_vr_box.c", 1175); break; case SKYBOX_MARKET_ADULT: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_RUVR_staticSegmentRomStart; size = (uintptr_t)_vr_RUVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1182); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1182); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1183); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1184); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1184); start = (uintptr_t)_vr_RUVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_RUVR_pal_staticSegmentRomEnd - start; osSyncPrintf("SIZE = %d\n", size); - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1188); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1188); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1189); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1190); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1190); break; case SKYBOX_CUTSCENE_MAP: start = (uintptr_t)_vr_holy0_staticSegmentRomStart; size = (uintptr_t)_vr_holy0_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1196); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1196); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1197); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1200); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1200); start = (uintptr_t)_vr_holy1_staticSegmentRomStart; size = (uintptr_t)_vr_holy1_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1203); + skyboxCtx->staticSegments[1] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1203); ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c", 1204); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1207); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1207); start = (uintptr_t)_vr_holy0_pal_staticSegmentRomStart; size = (uintptr_t)_vr_holy0_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1211); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1211); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1212); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1214); - DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, (uintptr_t)_vr_holy1_pal_staticSegmentRomStart, - size, "../z_vr_box.c", 1216); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1214); + DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, (uintptr_t)_vr_holy1_pal_staticSegmentRomStart, size, + "../z_vr_box.c", 1216); break; case SKYBOX_HOUSE_LINK: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_LHVR_staticSegmentRomStart; size = (uintptr_t)_vr_LHVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1226); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1226); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1227); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1228); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1228); start = (uintptr_t)_vr_LHVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_LHVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1231); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1231); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1232); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1233); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1233); break; case SKYBOX_MARKET_CHILD_DAY: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_MDVR_staticSegmentRomStart; size = (uintptr_t)_vr_MDVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1257); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1257); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1258); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1259); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1259); start = (uintptr_t)_vr_MDVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_MDVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1262); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1262); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1263); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1264); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1264); break; case SKYBOX_MARKET_CHILD_NIGHT: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_MNVR_staticSegmentRomStart; size = (uintptr_t)_vr_MNVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1271); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1271); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1272); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1273); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1273); start = (uintptr_t)_vr_MNVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_MNVR_pal_staticSegmentRomEnd - start; osSyncPrintf("SIZE = %d\n", size); - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1277); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1277); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1278); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1279); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1279); break; case SKYBOX_HAPPY_MASK_SHOP: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_FCVR_staticSegmentRomStart; size = (uintptr_t)_vr_FCVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1286); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1286); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1287); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1288); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1288); start = (uintptr_t)_vr_FCVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_FCVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1291); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1291); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1292); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1293); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1293); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_HOUSE_KNOW_IT_ALL_BROTHERS: @@ -695,90 +695,90 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_KHVR_staticSegmentRomStart; size = (uintptr_t)_vr_KHVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1301); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1301); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1302); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1303); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1303); start = (uintptr_t)_vr_KHVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_KHVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1306); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1306); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1307); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1308); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1308); break; case SKYBOX_HOUSE_OF_TWINS: skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; start = (uintptr_t)_vr_K3VR_staticSegmentRomStart; size = (uintptr_t)_vr_K3VR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1331); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1331); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1332); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1333); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1333); start = (uintptr_t)_vr_K3VR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_K3VR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1336); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1336); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1337); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1338); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1338); break; case SKYBOX_STABLES: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_MLVR_staticSegmentRomStart; size = (uintptr_t)_vr_MLVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1345); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1345); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1346); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1347); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1347); start = (uintptr_t)_vr_MLVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_MLVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1350); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1350); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1351); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1352); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1352); break; case SKYBOX_HOUSE_KAKARIKO: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_KKRVR_staticSegmentRomStart; size = (uintptr_t)_vr_KKRVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1359); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1359); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1360); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1361); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1361); start = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1364); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1364); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1365); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1366); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1366); break; case SKYBOX_KOKIRI_SHOP: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_KSVR_staticSegmentRomStart; size = (uintptr_t)_vr_KSVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1373); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1373); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1374); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1375); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1375); start = (uintptr_t)_vr_KSVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_KSVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1378); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1378); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1379); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1380); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1380); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_GORON_SHOP: @@ -786,18 +786,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_GLVR_staticSegmentRomStart; size = (uintptr_t)_vr_GLVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1405); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1405); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1406); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1407); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1407); start = (uintptr_t)_vr_GLVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_GLVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1410); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1410); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1411); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1412); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1412); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_ZORA_SHOP: @@ -805,18 +805,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_ZRVR_staticSegmentRomStart; size = (uintptr_t)_vr_ZRVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1420); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1420); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1421); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1422); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1422); start = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1425); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1425); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1426); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1427); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1427); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_POTION_SHOP_KAKARIKO: @@ -824,18 +824,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_DGVR_staticSegmentRomStart; size = (uintptr_t)_vr_DGVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1451); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1451); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1452); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1453); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1453); start = (uintptr_t)_vr_DGVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_DGVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1456); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1456); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1457); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1458); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1458); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_POTION_SHOP_MARKET: @@ -843,18 +843,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_ALVR_staticSegmentRomStart; size = (uintptr_t)_vr_ALVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1466); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1466); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1467); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1468); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1468); start = (uintptr_t)_vr_ALVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_ALVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1471); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1471); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1472); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1473); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1473); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_BOMBCHU_SHOP: @@ -862,18 +862,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_NSVR_staticSegmentRomStart; size = (uintptr_t)_vr_NSVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1481); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1481); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1482); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1483); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1483); start = (uintptr_t)_vr_NSVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_NSVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1486); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1486); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1487); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1488); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1488); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_HOUSE_RICHARD: @@ -881,108 +881,108 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { start = (uintptr_t)_vr_IPVR_staticSegmentRomStart; size = (uintptr_t)_vr_IPVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1512); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1512); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1513); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1514); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1514); start = (uintptr_t)_vr_IPVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_IPVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1517); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1517); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1518); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1519); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1519); break; case SKYBOX_HOUSE_IMPA: skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; start = (uintptr_t)_vr_LBVR_staticSegmentRomStart; size = (uintptr_t)_vr_LBVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1526); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1526); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1527); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1528); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1528); start = (uintptr_t)_vr_LBVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_LBVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1531); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1531); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1532); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1533); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1533); break; case SKYBOX_TENT: skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; start = (uintptr_t)_vr_TTVR_staticSegmentRomStart; size = (uintptr_t)_vr_TTVR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1540); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1540); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1541); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1542); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1542); start = (uintptr_t)_vr_TTVR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_TTVR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1545); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1545); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1546); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1547); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1547); break; case SKYBOX_HOUSE_MIDO: skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; start = (uintptr_t)_vr_K4VR_staticSegmentRomStart; size = (uintptr_t)_vr_K4VR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1560); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1560); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1561); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1562); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1562); start = (uintptr_t)_vr_K4VR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_K4VR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1565); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1565); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1566); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1567); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1567); break; case SKYBOX_HOUSE_SARIA: skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; start = (uintptr_t)_vr_K5VR_staticSegmentRomStart; size = (uintptr_t)_vr_K5VR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1574); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1574); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1575); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1576); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1576); start = (uintptr_t)_vr_K5VR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_K5VR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1579); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1579); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1580); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1581); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1581); break; case SKYBOX_HOUSE_ALLEY: skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; start = (uintptr_t)_vr_KR3VR_staticSegmentRomStart; size = (uintptr_t)_vr_KR3VR_staticSegmentRomEnd - start; - skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1588); + skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1588); ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", 1589); - DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1590); + DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1590); start = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomStart; size = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomEnd - start; - skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1593); + skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1593); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1594); - DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1595); + DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1595); break; case SKYBOX_UNSET_27: break; @@ -1007,24 +1007,24 @@ void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) { osSyncPrintf(VT_FGCOL(GREEN)); if (skyboxCtx->drawType != SKYBOX_DRAW_128) { - skyboxCtx->dListBuf = GameState_Alloc(state, 8 * 150 * sizeof(Gfx), "../z_vr_box.c", 1636); + skyboxCtx->dListBuf = GAME_STATE_ALLOC(state, 8 * 150 * sizeof(Gfx), "../z_vr_box.c", 1636); ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1637); - skyboxCtx->roomVtx = GameState_Alloc(state, 8 * 32 * sizeof(Vtx), "../z_vr_box.c", 1639); + skyboxCtx->roomVtx = GAME_STATE_ALLOC(state, 8 * 32 * sizeof(Vtx), "../z_vr_box.c", 1639); ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1640); Skybox_Calculate256(skyboxCtx, skyboxId); } else { - skyboxCtx->dListBuf = GameState_Alloc(state, 12 * 150 * sizeof(Gfx), "../z_vr_box.c", 1643); + skyboxCtx->dListBuf = GAME_STATE_ALLOC(state, 12 * 150 * sizeof(Gfx), "../z_vr_box.c", 1643); ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1644); if (skyboxId == SKYBOX_CUTSCENE_MAP) { - skyboxCtx->roomVtx = GameState_Alloc(state, 6 * 32 * sizeof(Vtx), "../z_vr_box.c", 1648); + skyboxCtx->roomVtx = GAME_STATE_ALLOC(state, 6 * 32 * sizeof(Vtx), "../z_vr_box.c", 1648); ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1649); Skybox_Calculate128(skyboxCtx, 6); // compute all 6 faces } else { - skyboxCtx->roomVtx = GameState_Alloc(state, 5 * 32 * sizeof(Vtx), "../z_vr_box.c", 1653); + skyboxCtx->roomVtx = GAME_STATE_ALLOC(state, 5 * 32 * sizeof(Vtx), "../z_vr_box.c", 1653); ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1654); Skybox_Calculate128(skyboxCtx, 5); // compute 5 faces, excludes the bottom face diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c index 96a785118..45e3237de 100644 --- a/src/code/z_vr_box_draw.c +++ b/src/code/z_vr_box_draw.c @@ -8,7 +8,7 @@ Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY); Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY); Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY); - return Matrix_ToMtx(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 42); + return MATRIX_TO_MTX(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 42); } void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) { @@ -24,13 +24,13 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId gSPTexture(POLY_OPA_DISP++, 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON); // Prepare matrix - sSkyboxDrawMatrix = Graph_Alloc(gfxCtx, sizeof(Mtx)); + sSkyboxDrawMatrix = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY); Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY); Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY); - Matrix_ToMtx(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 76); + MATRIX_TO_MTX(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 76); gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); // Enable magic square RGB dithering and bilinear filtering -- cgit v1.2.3