diff options
| author | cadmic <cadmic24@gmail.com> | 2024-09-12 11:10:43 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-12 14:10:43 -0400 |
| commit | f089adf20c0f285925e67800723254a80c67db6e (patch) | |
| tree | fb82055b46202c80ed0dace5bccc4d850575f457 /src/code/graph.c | |
| parent | 09c1816e2d6c4da8468c59d69454aa3e6a9ef27f (diff) | |
[ntsc-1.2] Match ntsc-1.2 BSS and add to CI (#2187)
* Match ntsc-1.2
* Add ntsc-1.2 to CI
* Apply fixes from Jenkins
* Promote ntsc-1.2 to "supported" in Makefile
* Declare D_80858AD8 as a u64 array
* Tweak wording
* Hopefully make ntsc-1.2 bss more stable
* Restore segmented_address.h include
Diffstat (limited to 'src/code/graph.c')
| -rw-r--r-- | src/code/graph.c | 108 |
1 files changed, 53 insertions, 55 deletions
diff --git a/src/code/graph.c b/src/code/graph.c index 2b4777ea6..7c562f160 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -5,7 +5,8 @@ #define GFXPOOL_HEAD_MAGIC 0x1234 #define GFXPOOL_TAIL_MAGIC 0x5678 -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:223" /** * The time at which the previous `Graph_Update` ended. @@ -19,12 +20,6 @@ OSTime sGraphPrevTaskTimeStart; #if OOT_DEBUG FaultClient sGraphFaultClient; -#endif - -CfbInfo sGraphCfbInfos[3]; - -#if OOT_DEBUG -FaultClient sGraphUcodeFaultClient; UCodeInfo D_8012D230[3] = { { UCODE_F3DZEX, gspF3DZEX2_NoN_PosLight_fifoTextStart }, @@ -165,11 +160,6 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { #if OOT_DEBUG static Gfx* sPrevTaskWorkBuffer = NULL; #endif - static s32 sGraphCfbInfoIdx = 0; - - OSTime timeNow; - OSTimer timer; - OSMesg msg; OSTask_t* task = &gfxCtx->task.list.t; OSScTask* scTask = &gfxCtx->task; @@ -177,7 +167,8 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { osGetTime() - sGraphPrevTaskTimeStart - gAudioThreadUpdateTimeAcc; { - CfbInfo* cfb; + OSTimer timer; + OSMesg msg; // Schedule a message to be handled in 3 seconds, for RCP timeout osSetTimer(&timer, OS_USEC_TO_CYCLES(3000000), 0, &gfxCtx->queue, (OSMesg)666); @@ -212,12 +203,15 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { #if OOT_DEBUG sPrevTaskWorkBuffer = gfxCtx->workBuffer; #endif + } - if (gfxCtx->callback != NULL) { - gfxCtx->callback(gfxCtx, gfxCtx->callbackParam); - } + if (gfxCtx->callback != NULL) { + gfxCtx->callback(gfxCtx, gfxCtx->callbackParam); + } + + { + OSTime timeNow = osGetTime(); - 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 @@ -229,41 +223,45 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { 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; - - 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--; - } + 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; + + 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; } + { + static CfbInfo sGraphCfbInfos[3]; + static s32 sGraphCfbInfoIdx = 0; + CfbInfo* cfb; cfb = &sGraphCfbInfos[sGraphCfbInfoIdx]; @@ -279,14 +277,12 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { cfb->updateRate = R_UPDATE_RATE; scTask->framebuffer = cfb; + } - { s16 pad2; } - - gfxCtx->schedMsgQueue = &gScheduler.cmdQueue; + gfxCtx->schedMsgQueue = &gScheduler.cmdQueue; - osSendMesg(&gScheduler.cmdQueue, (OSMesg)scTask, OS_MESG_BLOCK); - Sched_Notify(&gScheduler); - } + osSendMesg(&gScheduler.cmdQueue, (OSMesg)scTask, OS_MESG_BLOCK); + Sched_Notify(&gScheduler); } void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { @@ -339,6 +335,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { } if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_TOGGLE != 0) { + static FaultClient sGraphUcodeFaultClient; + if (R_UCODE_DISAS_LOG_MODE == 3) { Fault_AddClient(&sGraphUcodeFaultClient, Graph_UCodeFaultClient, gfxCtx->workBuffer, "do_count_fault"); } |
