summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-01-31 16:07:12 -0800
committerGitHub <noreply@github.com>2024-01-31 19:07:12 -0500
commit06379c310941c031451c87c09d32cc7a8860e7fe (patch)
tree99abb62045709a4e095606299425ae241593b0e2 /src/code
parenta0d31dba680fdddb354dc8aae6ae0efe1663ef3f (diff)
Gamealloc, Graph, and Graphalloc retail OK (#1675)
* Gamealloc OK * Graph + Graphalloc OK * PR review * gfxalloc * new lines * Remove imposter
Diffstat (limited to 'src/code')
-rw-r--r--src/code/flg_set.c4
-rw-r--r--src/code/game.c8
-rw-r--r--src/code/gamealloc.c2
-rw-r--r--src/code/gfxalloc.c25
-rw-r--r--src/code/graph.c239
-rw-r--r--src/code/z_debug.c4
-rw-r--r--src/code/z_demo.c4
-rw-r--r--src/code/z_kankyo.c4
-rw-r--r--src/code/z_message_PAL.c8
-rw-r--r--src/code/z_play.c4
-rw-r--r--src/code/z_rcp.c2
-rw-r--r--src/code/z_vismono.c4
12 files changed, 176 insertions, 132 deletions
diff --git a/src/code/flg_set.c b/src/code/flg_set.c
index 04167c2ec..190439486 100644
--- a/src/code/flg_set.c
+++ b/src/code/flg_set.c
@@ -78,7 +78,7 @@ void FlagSet_Update(PlayState* play) {
s32 pad;
polyOpa = POLY_OPA_DISP;
- gfx = Graph_GfxPlusOne(polyOpa);
+ gfx = Gfx_Open(polyOpa);
gSPDisplayList(OVERLAY_DISP++, gfx);
GfxPrint_Init(&printer);
@@ -171,7 +171,7 @@ void FlagSet_Update(PlayState* play) {
GfxPrint_Destroy(&printer);
gSPEndDisplayList(gfx++);
- Graph_BranchDlist(polyOpa, gfx);
+ Gfx_Close(polyOpa, gfx);
POLY_OPA_DISP = gfx;
}
diff --git a/src/code/game.c b/src/code/game.c
index 2bc179d68..ea6e399f5 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -156,7 +156,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx, "../game.c", 746);
- newDList = Graph_GfxPlusOne(polyOpaP = POLY_OPA_DISP);
+ newDList = Gfx_Open(polyOpaP = POLY_OPA_DISP);
gSPDisplayList(OVERLAY_DISP++, newDList);
if (R_ENABLE_FB_FILTER == 1) {
@@ -193,7 +193,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
}
gSPEndDisplayList(newDList++);
- Graph_BranchDlist(polyOpaP, newDList);
+ Gfx_Close(polyOpaP, newDList);
POLY_OPA_DISP = newDList;
if (1) {}
@@ -230,11 +230,11 @@ void func_800C49F4(GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx, "../game.c", 846);
- newDlist = Graph_GfxPlusOne(polyOpaP = POLY_OPA_DISP);
+ newDlist = Gfx_Open(polyOpaP = POLY_OPA_DISP);
gSPDisplayList(OVERLAY_DISP++, newDlist);
gSPEndDisplayList(newDlist++);
- Graph_BranchDlist(polyOpaP, newDlist);
+ Gfx_Close(polyOpaP, newDlist);
POLY_OPA_DISP = newDlist;
if (1) {}
diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c
index ee981d2be..c5e8e5243 100644
--- a/src/code/gamealloc.c
+++ b/src/code/gamealloc.c
@@ -12,6 +12,7 @@ void GameAlloc_Log(GameAlloc* this) {
}
}
+#if OOT_DEBUG
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) {
GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
@@ -27,6 +28,7 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin
return NULL;
}
}
+#endif
void* GameAlloc_Malloc(GameAlloc* this, u32 size) {
GameAllocEntry* ptr = SYSTEM_ARENA_MALLOC(size + sizeof(GameAllocEntry), "../gamealloc.c", 93);
diff --git a/src/code/gfxalloc.c b/src/code/gfxalloc.c
new file mode 100644
index 000000000..79d8bb04e
--- /dev/null
+++ b/src/code/gfxalloc.c
@@ -0,0 +1,25 @@
+#include "global.h"
+
+Gfx* Gfx_Open(Gfx* gfx) {
+ return gfx + 1;
+}
+
+Gfx* Gfx_Close(Gfx* gfx, Gfx* dst) {
+ gSPBranchList(gfx, dst);
+ return dst;
+}
+
+void* Gfx_Alloc(Gfx** gfxP, u32 size) {
+ u8* ptr;
+ Gfx* dst;
+
+ size = ALIGN8(size);
+
+ ptr = (u8*)(*gfxP + 1);
+
+ dst = (Gfx*)(ptr + size);
+ gSPBranchList(*gfxP, dst);
+
+ *gfxP = dst;
+ return ptr;
+}
diff --git a/src/code/graph.c b/src/code/graph.c
index c6f165b74..f2e2775e0 100644
--- a/src/code/graph.c
+++ b/src/code/graph.c
@@ -30,6 +30,7 @@ UCodeInfo D_8012D248[3] = {
{ UCODE_S2DEX, gspS2DEX2d_fifoTextStart },
};
+#if OOT_DEBUG
void Graph_FaultClient(void) {
void* nextFb = osViGetNextFramebuffer();
void* newFb = (SysCfb_GetFbPtr(0) != nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1);
@@ -93,6 +94,7 @@ void Graph_UCodeFaultClient(Gfx* workBuf) {
UCodeDisas_Disassemble(&disassembler, workBuf);
UCodeDisas_Destroy(&disassembler);
}
+#endif
void Graph_InitTHGA(GraphicsContext* gfxCtx) {
GfxPool* pool = &gGfxPools[gfxCtx->gfxPoolIdx & 1];
@@ -139,13 +141,17 @@ void Graph_Init(GraphicsContext* gfxCtx) {
gfxCtx->xScale = gViConfigXScale;
gfxCtx->yScale = gViConfigYScale;
osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff));
+#if OOT_DEBUG
func_800D31F0();
Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL);
+#endif
}
void Graph_Destroy(GraphicsContext* gfxCtx) {
+#if OOT_DEBUG
func_800D3210();
Fault_RemoveClient(&sGraphFaultClient);
+#endif
}
void Graph_TaskSet00(GraphicsContext* gfxCtx) {
@@ -157,109 +163,122 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
OSMesg msg;
OSTask_t* task = &gfxCtx->task.list.t;
OSScTask* scTask = &gfxCtx->task;
- CfbInfo* cfb;
gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime =
osGetTime() - sGraphPrevTaskTimeStart - gAudioThreadUpdateTimeAcc;
- osSetTimer(&timer, OS_USEC_TO_CYCLES(3000000), 0, &gfxCtx->queue, (OSMesg)666);
+ {
+ CfbInfo* cfb;
- osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_BLOCK);
- osStopTimer(&timer);
+ osSetTimer(&timer, OS_USEC_TO_CYCLES(3000000), 0, &gfxCtx->queue, (OSMesg)666);
- if (msg == (OSMesg)666) {
- PRINTF(VT_FGCOL(RED));
- PRINTF("RCPが帰ってきませんでした。"); // "RCP did not return."
- PRINTF(VT_RST);
+ osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_BLOCK);
+ osStopTimer(&timer);
- LogUtils_LogHexDump((void*)PHYS_TO_K1(SP_BASE_REG), 0x20);
- LogUtils_LogHexDump((void*)PHYS_TO_K1(DPC_BASE_REG), 0x20);
- LogUtils_LogHexDump(gGfxSPTaskYieldBuffer, sizeof(gGfxSPTaskYieldBuffer));
+ if (msg == (OSMesg)666) {
+#if OOT_DEBUG
+ PRINTF(VT_FGCOL(RED));
+ PRINTF("RCPが帰ってきませんでした。"); // "RCP did not return."
+ PRINTF(VT_RST);
- SREG(6) = -1;
- if (sPrevTaskWorkBuffer != NULL) {
- R_HREG_MODE = HREG_MODE_UCODE_DISAS;
- R_UCODE_DISAS_TOGGLE = 1;
- R_UCODE_DISAS_LOG_LEVEL = 2;
- Graph_DisassembleUCode(sPrevTaskWorkBuffer);
+ LogUtils_LogHexDump((void*)PHYS_TO_K1(SP_BASE_REG), 0x20);
+ LogUtils_LogHexDump((void*)PHYS_TO_K1(DPC_BASE_REG), 0x20);
+ LogUtils_LogHexDump(gGfxSPTaskYieldBuffer, sizeof(gGfxSPTaskYieldBuffer));
+
+ SREG(6) = -1;
+ if (sPrevTaskWorkBuffer != NULL) {
+ R_HREG_MODE = HREG_MODE_UCODE_DISAS;
+ R_UCODE_DISAS_TOGGLE = 1;
+ R_UCODE_DISAS_LOG_LEVEL = 2;
+ Graph_DisassembleUCode(sPrevTaskWorkBuffer);
+ }
+#endif
+
+ Fault_AddHungupAndCrashImpl("RCP is HUNG UP!!", "Oh! MY GOD!!");
}
- Fault_AddHungupAndCrashImpl("RCP is HUNG UP!!", "Oh! MY GOD!!");
- }
+ osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_NOBLOCK);
- osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_NOBLOCK);
+#if OOT_DEBUG
+ sPrevTaskWorkBuffer = gfxCtx->workBuffer;
+#endif
- sPrevTaskWorkBuffer = gfxCtx->workBuffer;
- if (gfxCtx->callback != NULL) {
- gfxCtx->callback(gfxCtx, gfxCtx->callbackParam);
- }
+ if (gfxCtx->callback != NULL) {
+ gfxCtx->callback(gfxCtx, gfxCtx->callbackParam);
+ }
- timeNow = osGetTime();
- if (gAudioThreadUpdateTimeStart != 0) {
- // The audio thread update is running
- // Add the time already spent to the accumulator and leave the rest for the next cycle
+ timeNow = osGetTime();
+ if (gAudioThreadUpdateTimeStart != 0) {
+ // The audio thread update is running
+ // Add the time already spent to the accumulator and leave the rest for the next cycle
- gAudioThreadUpdateTimeAcc += timeNow - gAudioThreadUpdateTimeStart;
- gAudioThreadUpdateTimeStart = timeNow;
- }
- gAudioThreadUpdateTimeTotalPerGfxTask = gAudioThreadUpdateTimeAcc;
- gAudioThreadUpdateTimeAcc = 0;
-
- sGraphPrevTaskTimeStart = osGetTime();
-
- task->type = M_GFXTASK;
- task->flags = OS_SC_DRAM_DLIST;
- task->ucode_boot = SysUcode_GetUCodeBoot();
- task->ucode_boot_size = SysUcode_GetUCodeBootSize();
- task->ucode = SysUcode_GetUCode();
- task->ucode_data = SysUcode_GetUCodeData();
- task->ucode_size = SP_UCODE_SIZE;
- task->ucode_data_size = SP_UCODE_DATA_SIZE;
- task->dram_stack = gGfxSPTaskStack;
- task->dram_stack_size = sizeof(gGfxSPTaskStack);
- task->output_buff = gGfxSPTaskOutputBuffer;
- task->output_buff_size = gGfxSPTaskOutputBuffer + ARRAY_COUNT(gGfxSPTaskOutputBuffer);
- task->data_ptr = (u64*)gfxCtx->workBuffer;
-
- OPEN_DISPS(gfxCtx, "../graph.c", 828);
- task->data_size = (uintptr_t)WORK_DISP - (uintptr_t)gfxCtx->workBuffer;
- CLOSE_DISPS(gfxCtx, "../graph.c", 830);
-
- { s32 pad2; } // Necessary to match stack usage
-
- task->yield_data_ptr = gGfxSPTaskYieldBuffer;
- task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer);
-
- scTask->next = NULL;
- scTask->flags = OS_SC_NEEDS_RSP | OS_SC_NEEDS_RDP | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK;
- if (R_GRAPH_TASKSET00_FLAGS & 1) {
- R_GRAPH_TASKSET00_FLAGS &= ~1;
- scTask->flags &= ~OS_SC_SWAPBUFFER;
- gfxCtx->fbIdx--;
- }
+ gAudioThreadUpdateTimeAcc += timeNow - gAudioThreadUpdateTimeStart;
+ gAudioThreadUpdateTimeStart = timeNow;
+ }
+ gAudioThreadUpdateTimeTotalPerGfxTask = gAudioThreadUpdateTimeAcc;
+ gAudioThreadUpdateTimeAcc = 0;
+
+ sGraphPrevTaskTimeStart = osGetTime();
+
+ task->type = M_GFXTASK;
+ task->flags = OS_SC_DRAM_DLIST;
+ task->ucode_boot = SysUcode_GetUCodeBoot();
+ task->ucode_boot_size = SysUcode_GetUCodeBootSize();
+ task->ucode = SysUcode_GetUCode();
+ task->ucode_data = SysUcode_GetUCodeData();
+ task->ucode_size = SP_UCODE_SIZE;
+ task->ucode_data_size = SP_UCODE_DATA_SIZE;
+ task->dram_stack = gGfxSPTaskStack;
+ task->dram_stack_size = sizeof(gGfxSPTaskStack);
+ task->output_buff = gGfxSPTaskOutputBuffer;
+ task->output_buff_size = gGfxSPTaskOutputBuffer + ARRAY_COUNT(gGfxSPTaskOutputBuffer);
+ task->data_ptr = (u64*)gfxCtx->workBuffer;
+
+ OPEN_DISPS(gfxCtx, "../graph.c", 828);
+ task->data_size = (uintptr_t)WORK_DISP - (uintptr_t)gfxCtx->workBuffer;
+ CLOSE_DISPS(gfxCtx, "../graph.c", 830);
+
+ task->yield_data_ptr = gGfxSPTaskYieldBuffer;
+
+ if (1) {}
+
+ task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer);
+
+ scTask->next = NULL;
+ scTask->flags = OS_SC_NEEDS_RSP | OS_SC_NEEDS_RDP | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK;
+ if (R_GRAPH_TASKSET00_FLAGS & 1) {
+ R_GRAPH_TASKSET00_FLAGS &= ~1;
+ scTask->flags &= ~OS_SC_SWAPBUFFER;
+ gfxCtx->fbIdx--;
+ }
+
+ scTask->msgQueue = &gfxCtx->queue;
+ scTask->msg = NULL;
- scTask->msgQueue = &gfxCtx->queue;
- scTask->msg = NULL;
+ { s16 pad; }
- cfb = &sGraphCfbInfos[sGraphCfbInfoIdx++];
- cfb->framebuffer = gfxCtx->curFrameBuffer;
- cfb->swapBuffer = gfxCtx->curFrameBuffer;
- cfb->viMode = gfxCtx->viMode;
- cfb->viFeatures = gfxCtx->viFeatures;
- cfb->xScale = gfxCtx->xScale;
- cfb->yScale = gfxCtx->yScale;
- cfb->unk_10 = 0;
- cfb->updateRate = R_UPDATE_RATE;
+ cfb = &sGraphCfbInfos[sGraphCfbInfoIdx];
- scTask->framebuffer = cfb;
- sGraphCfbInfoIdx %= ARRAY_COUNT(sGraphCfbInfos);
+ sGraphCfbInfoIdx = (sGraphCfbInfoIdx + 1) % ARRAY_COUNT(sGraphCfbInfos);
+ cfb->framebuffer = gfxCtx->curFrameBuffer;
+ cfb->swapBuffer = gfxCtx->curFrameBuffer;
- if (1) {}
+ cfb->viMode = gfxCtx->viMode;
+ cfb->viFeatures = gfxCtx->viFeatures;
+ cfb->xScale = gfxCtx->xScale;
+ cfb->yScale = gfxCtx->yScale;
+ cfb->unk_10 = 0;
+ cfb->updateRate = R_UPDATE_RATE;
- gfxCtx->schedMsgQueue = &gScheduler.cmdQueue;
+ scTask->framebuffer = cfb;
- osSendMesg(&gScheduler.cmdQueue, (OSMesg)scTask, OS_MESG_BLOCK);
- Sched_Notify(&gScheduler);
+ { s16 pad2; }
+
+ gfxCtx->schedMsgQueue = &gScheduler.cmdQueue;
+
+ osSendMesg(&gScheduler.cmdQueue, (OSMesg)scTask, OS_MESG_BLOCK);
+ Sched_Notify(&gScheduler);
+ }
}
void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
@@ -268,6 +287,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gameState->inPreNMIState = false;
Graph_InitTHGA(gfxCtx);
+#if OOT_DEBUG
OPEN_DISPS(gfxCtx, "../graph.c", 966);
gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0);
@@ -276,10 +296,12 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 開始", 0);
CLOSE_DISPS(gfxCtx, "../graph.c", 975);
+#endif
GameState_ReqPadData(gameState);
GameState_Update(gameState);
+#if OOT_DEBUG
OPEN_DISPS(gfxCtx, "../graph.c", 987);
gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0);
@@ -288,6 +310,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 終了", 0);
CLOSE_DISPS(gfxCtx, "../graph.c", 996);
+#endif
OPEN_DISPS(gfxCtx, "../graph.c", 999);
@@ -300,6 +323,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
CLOSE_DISPS(gfxCtx, "../graph.c", 1028);
+#if OOT_DEBUG
if (R_HREG_MODE == HREG_MODE_PLAY && R_PLAY_ENABLE_UCODE_DISAS == 2) {
R_HREG_MODE = HREG_MODE_UCODE_DISAS;
R_UCODE_DISAS_TOGGLE = -1;
@@ -326,6 +350,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
R_UCODE_DISAS_TOGGLE = 0;
}
}
+#endif
problem = false;
@@ -377,7 +402,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
{
OSTime timeNow = osGetTime();
- s32 pad[4];
+ s32 pad;
gRSPGfxTimeTotal = gRSPGfxTimeAcc;
gRSPAudioTimeTotal = gRSPAudioTimeAcc;
@@ -392,19 +417,29 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
sGraphPrevUpdateEndTime = timeNow;
}
+#if OOT_DEBUG
if (gIsCtrlr2Valid && CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) &&
CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) {
gSaveContext.gameMode = GAMEMODE_NORMAL;
- SET_NEXT_GAMESTATE(gameState, MapSelect_Init, MapSelectState);
+ {
+ GameState* state = gameState;
+
+ SET_NEXT_GAMESTATE(state, MapSelect_Init, MapSelectState);
+ }
gameState->running = false;
}
if (gIsCtrlr2Valid && PreNmiBuff_IsResetting(gAppNmiBufferPtr) && !gameState->inPreNMIState) {
// "To reset mode"
PRINTF(VT_COL(YELLOW, BLACK) "PRE-NMIによりリセットモードに移行します\n" VT_RST);
- SET_NEXT_GAMESTATE(gameState, PreNMI_Init, PreNMIState);
+ {
+ GameState* state = gameState;
+
+ SET_NEXT_GAMESTATE(state, PreNMI_Init, PreNMIState);
+ }
gameState->running = false;
}
+#endif
}
void Graph_ThreadEntry(void* arg0) {
@@ -413,7 +448,6 @@ void Graph_ThreadEntry(void* arg0) {
u32 size;
GameStateOverlay* nextOvl = &gGameStateOverlayTable[GAMESTATE_SETUP];
GameStateOverlay* ovl;
- char faultMsg[0x50];
PRINTF("グラフィックスレッド実行開始\n"); // "Start graphic thread execution"
Graph_Init(&gfxCtx);
@@ -428,10 +462,15 @@ void Graph_ThreadEntry(void* arg0) {
gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196);
if (gameState == NULL) {
+#if OOT_DEBUG
+ char faultMsg[0x50];
PRINTF("確保失敗\n"); // "Failure to secure"
sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
+#else
+ Fault_AddHungupAndCrash("../graph.c", 1200);
+#endif
}
GameState_Init(gameState, ovl->init, &gfxCtx);
@@ -469,6 +508,7 @@ void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size) {
return THGA_AllocTail(&gfxCtx->polyOpa, ALIGN16(size));
}
+#if OOT_DEBUG
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line) {
if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_LOG_MODE != 4) {
dispRefs[0] = gfxCtx->polyOpa.p;
@@ -502,27 +542,4 @@ void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file,
}
}
}
-
-Gfx* Graph_GfxPlusOne(Gfx* gfx) {
- return gfx + 1;
-}
-
-Gfx* Graph_BranchDlist(Gfx* gfx, Gfx* dst) {
- gSPBranchList(gfx, dst);
- return dst;
-}
-
-void* Graph_DlistAlloc(Gfx** gfxP, u32 size) {
- u8* ptr;
- Gfx* dst;
-
- size = ALIGN8(size);
-
- ptr = (u8*)(*gfxP + 1);
-
- dst = (Gfx*)(ptr + size);
- gSPBranchList(*gfxP, dst);
-
- *gfxP = dst;
- return ptr;
-}
+#endif
diff --git a/src/code/z_debug.c b/src/code/z_debug.c
index 9581ec854..011a87d39 100644
--- a/src/code/z_debug.c
+++ b/src/code/z_debug.c
@@ -283,7 +283,7 @@ void Debug_DrawText(GraphicsContext* gfxCtx) {
GfxPrint_Init(&printer);
opaStart = POLY_OPA_DISP;
- gfx = Graph_GfxPlusOne(POLY_OPA_DISP);
+ gfx = Gfx_Open(POLY_OPA_DISP);
gSPDisplayList(OVERLAY_DISP++, gfx);
GfxPrint_Open(&printer, gfx);
@@ -299,7 +299,7 @@ void Debug_DrawText(GraphicsContext* gfxCtx) {
gfx = GfxPrint_Close(&printer);
gSPEndDisplayList(gfx++);
- Graph_BranchDlist(opaStart, gfx);
+ Gfx_Close(opaStart, gfx);
POLY_OPA_DISP = gfx;
if (1) {}
diff --git a/src/code/z_demo.c b/src/code/z_demo.c
index 97833dd22..68b67de0f 100644
--- a/src/code/z_demo.c
+++ b/src/code/z_demo.c
@@ -2211,11 +2211,11 @@ void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) {
OPEN_DISPS(play->state.gfxCtx, "../z_demo.c", 4101);
prevDisplayList = POLY_OPA_DISP;
- displayList = Graph_GfxPlusOne(POLY_OPA_DISP);
+ displayList = Gfx_Open(POLY_OPA_DISP);
gSPDisplayList(OVERLAY_DISP++, displayList);
Cutscene_DrawDebugInfo(play, &displayList, csCtx);
gSPEndDisplayList(displayList++);
- Graph_BranchDlist(prevDisplayList, displayList);
+ Gfx_Close(prevDisplayList, displayList);
POLY_OPA_DISP = displayList;
CLOSE_DISPS(play->state.gfxCtx, "../z_demo.c", 4108);
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index 37556fd91..771cc1d37 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -958,11 +958,11 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
OPEN_DISPS(play->state.gfxCtx, "../z_kankyo.c", 1682);
prevDisplayList = POLY_OPA_DISP;
- displayList = Graph_GfxPlusOne(POLY_OPA_DISP);
+ displayList = Gfx_Open(POLY_OPA_DISP);
gSPDisplayList(OVERLAY_DISP++, displayList);
Environment_PrintDebugInfo(play, &displayList);
gSPEndDisplayList(displayList++);
- Graph_BranchDlist(prevDisplayList, displayList);
+ Gfx_Close(prevDisplayList, displayList);
POLY_OPA_DISP = displayList;
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_kankyo.c", 1690);
diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c
index eaeebf003..be7d20473 100644
--- a/src/code/z_message_PAL.c
+++ b/src/code/z_message_PAL.c
@@ -3013,19 +3013,19 @@ void Message_Draw(PlayState* play) {
watchVar = gSaveContext.save.info.scarecrowLongSongSet;
Message_DrawDebugVariableChanged(&watchVar, play->state.gfxCtx);
if (BREG(0) != 0 && play->msgCtx.textId != 0) {
- plusOne = Graph_GfxPlusOne(polyOpaP = POLY_OPA_DISP);
+ plusOne = Gfx_Open(polyOpaP = POLY_OPA_DISP);
gSPDisplayList(OVERLAY_DISP++, plusOne);
Message_DrawDebugText(play, &plusOne);
gSPEndDisplayList(plusOne++);
- Graph_BranchDlist(polyOpaP, plusOne);
+ Gfx_Close(polyOpaP, plusOne);
POLY_OPA_DISP = plusOne;
}
if (1) {}
- plusOne = Graph_GfxPlusOne(polyOpaP = POLY_OPA_DISP);
+ plusOne = Gfx_Open(polyOpaP = POLY_OPA_DISP);
gSPDisplayList(OVERLAY_DISP++, plusOne);
Message_DrawMain(play, &plusOne);
gSPEndDisplayList(plusOne++);
- Graph_BranchDlist(polyOpaP, plusOne);
+ Gfx_Close(polyOpaP, plusOne);
POLY_OPA_DISP = plusOne;
CLOSE_DISPS(play->state.gfxCtx, "../z_message_PAL.c", 3582);
}
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 5ad02db22..cefc1d2d2 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -1085,7 +1085,7 @@ void Play_Draw(PlayState* this) {
Gfx* gfxP;
Gfx* sp1CC = POLY_OPA_DISP;
- gfxP = Graph_GfxPlusOne(sp1CC);
+ gfxP = Gfx_Open(sp1CC);
gSPDisplayList(OVERLAY_DISP++, gfxP);
if ((this->transitionMode == TRANS_MODE_INSTANCE_RUNNING) ||
@@ -1109,7 +1109,7 @@ void Play_Draw(PlayState* this) {
}
gSPEndDisplayList(gfxP++);
- Graph_BranchDlist(sp1CC, gfxP);
+ Gfx_Close(sp1CC, gfxP);
POLY_OPA_DISP = gfxP;
}
diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c
index b9948003c..946a786b8 100644
--- a/src/code/z_rcp.c
+++ b/src/code/z_rcp.c
@@ -1362,7 +1362,7 @@ void Gfx_SetupDL_59Opa(GraphicsContext* gfxCtx) {
}
Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height) {
- Gfx* displayList = Graph_DlistAlloc(gfxP, 3 * sizeof(Gfx));
+ Gfx* displayList = Gfx_Alloc(gfxP, 3 * sizeof(Gfx));
gDPTileSync(displayList);
gDPSetTileSize(displayList + 1, G_TX_RENDERTILE, x, y, x + ((width - 1) << 2), y + ((height - 1) << 2));
diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c
index 99b20f0f5..a35cdcd10 100644
--- a/src/code/z_vismono.c
+++ b/src/code/z_vismono.c
@@ -146,14 +146,14 @@ void VisMono_Draw(VisMono* this, Gfx** gfxP) {
if (this->tlut) {
tlut = this->tlut;
} else {
- tlut = Graph_DlistAlloc(&gfx, 256 * G_IM_SIZ_16b_BYTES);
+ tlut = Gfx_Alloc(&gfx, 256 * G_IM_SIZ_16b_BYTES);
VisMono_DesaturateTLUT(this, tlut);
}
if (this->dList) {
dList = this->dList;
} else {
- dList = Graph_DlistAlloc(&gfx, VISMONO_DLSIZE * sizeof(Gfx));
+ dList = Gfx_Alloc(&gfx, VISMONO_DLSIZE * sizeof(Gfx));
dListEnd = VisMono_DesaturateDList(this, dList);
if (!(dListEnd <= dList + VISMONO_DLSIZE)) {