diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2025-01-27 07:48:59 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-27 12:48:59 -0300 |
| commit | 982ca889e2180165f7d2dd33c5fda2b6e8f998a0 (patch) | |
| tree | 0850d4416d7971fe738300c200a394f1693791df /src/code/graph.c | |
| parent | b9267f0550e4f408c93ac9d091332f51e9ea7838 (diff) | |
Misc Cleanup (#1782)
* Remove some unnecessary casts in Graph_TaskSet00
* gGfxSPTaskYieldBuffer as u64
* gGfxSPTaskStack size macro
* R_THREE_DAY_CLOCK_Y_POS set to negative number
* scope cfb in Graph_TaskSet00
* Graph_ThreadEntry types
* func_80124618
* SysCfb_SetHiResMode
Diffstat (limited to 'src/code/graph.c')
| -rw-r--r-- | src/code/graph.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/code/graph.c b/src/code/graph.c index 7fa6e505f..f823f995a 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -147,7 +147,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) { OSScTask* scTask = &gfxCtx->task; OSTimer timer; OSMesg msg; - CfbInfo* cfb; + s32 pad; retry: osSetTimer(&timer, OS_USEC_TO_CYCLES(3 * 1000 * 1000), 0, &gfxCtx->queue, (OSMesg)666); @@ -180,13 +180,13 @@ retry: task->ucode_data = SysUcode_GetUCodeData(); task->ucode_size = SP_UCODE_SIZE; task->ucode_data_size = SP_UCODE_DATA_SIZE; - task->dram_stack = (u64*)gGfxSPTaskStack; + task->dram_stack = gGfxSPTaskStack; task->dram_stack_size = sizeof(gGfxSPTaskStack); task->output_buff = gGfxSPTaskOutputBufferPtr; - task->output_buff_size = (void*)gGfxSPTaskOutputBufferEnd; + task->output_buff_size = gGfxSPTaskOutputBufferEnd; task->data_ptr = (u64*)gGfxMasterDL; task->data_size = 0; - task->yield_data_ptr = (u64*)gGfxSPTaskYieldBuffer; + task->yield_data_ptr = gGfxSPTaskYieldBuffer; task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer); scTask->next = NULL; @@ -201,27 +201,28 @@ retry: scTask->msgQ = &gfxCtx->queue; scTask->msg = NULL; - { s32 pad; } + { + CfbInfo* cfb = &sGraphCfbInfos[sCfbIndex]; - cfb = &sGraphCfbInfos[sCfbIndex]; - sCfbIndex = (sCfbIndex + 1) % ARRAY_COUNT(sGraphCfbInfos); + sCfbIndex = (sCfbIndex + 1) % ARRAY_COUNT(sGraphCfbInfos); - cfb->framebuffer = gfxCtx->curFrameBuffer; - cfb->swapBuffer = gfxCtx->curFrameBuffer; + cfb->framebuffer = gfxCtx->curFrameBuffer; + cfb->swapBuffer = gfxCtx->curFrameBuffer; - if (gfxCtx->updateViMode) { - gfxCtx->updateViMode = false; - cfb->viMode = gfxCtx->viMode; - cfb->viFeatures = gfxCtx->viConfigFeatures; - cfb->xScale = gfxCtx->xScale; - cfb->yScale = gfxCtx->yScale; - } else { - cfb->viMode = NULL; - } - cfb->unk_10 = 0; - cfb->updateRate = gameState->framerateDivisor; + if (gfxCtx->updateViMode) { + gfxCtx->updateViMode = false; + cfb->viMode = gfxCtx->viMode; + cfb->viFeatures = gfxCtx->viConfigFeatures; + cfb->xScale = gfxCtx->xScale; + cfb->yScale = gfxCtx->yScale; + } else { + cfb->viMode = NULL; + } + cfb->unk_10 = 0; + cfb->updateRate = gameState->framerateDivisor; - scTask->framebuffer = cfb; + scTask->framebuffer = cfb; + } while (gfxCtx->queue.validCount != 0) { osRecvMesg(&gfxCtx->queue, NULL, OS_MESG_NOBLOCK); @@ -341,11 +342,11 @@ void Graph_ThreadEntry(void* arg) { GameStateOverlay* nextOvl = &gGameStateOverlayTable[0]; GameStateOverlay* ovl; GameState* gameState; - u32 size; + size_t size; s32 pad[2]; gZBufferLoRes = malloc(sizeof(*gZBufferLoRes) + sizeof(*gWorkBufferLoRes) + 64 - 1); - gZBufferLoRes = (void*)ALIGN64((u32)gZBufferLoRes); + gZBufferLoRes = (void*)ALIGN64((uintptr_t)gZBufferLoRes); gWorkBufferLoRes = (void*)((u8*)gZBufferLoRes + sizeof(*gZBufferLoRes)); |
