From 05b93a6faa80597b39c3b1842e1b6b3b4ee08d01 Mon Sep 17 00:00:00 2001 From: gijs Date: Fri, 20 Oct 2023 12:25:45 +0200 Subject: [PATCH] Decompile `nuScWaitTaskReady` --- src/_ob_past_brick.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/_ob_past_brick.c b/src/_ob_past_brick.c index 822b059..692faaa 100644 --- a/src/_ob_past_brick.c +++ b/src/_ob_past_brick.c @@ -107,30 +107,20 @@ INCLUDE_ASM(const s32, "_ob_past_brick", nuScExecuteGraphics); // } // } -// extern struct { -// OSMesgQueue mq; -// u8 padding[0x549]; -// u8 b; -// } D_800E8C2C; +void nuScWaitTaskReady(NUScTask* task) { + NUScClient client; + void* fb = task->framebuffer; -INCLUDE_ASM(const s32, "_ob_past_brick", nuScWaitTaskReady); + if(nusched.frameBufferNum == 1) { + return; + } -/* 1989C 8008949C */ -// void nuScWaitTaskReady(void** buffers) -// { -// Stack__dma_load_loop sp10; -// void* temp_s0 = buffers[3]; - -// if (D_800E8C2C.b != 1) -// { -// while(osViGetNextFramebuffer() == temp_s0 || osViGetCurrentFramebuffer() == temp_s0) -// { -// nuScAddClient(&sp10, &D_800E8C2C.mq, 1); -// osRecvMesg(&D_800E8C2C.mq, NULL, 1); -// nuScRemoveClient(&sp10); -// } -// } -// } + while (osViGetNextFramebuffer() == fb || osViGetCurrentFramebuffer() == fb) { + nuScAddClient(&client, &nusched.waitMQ, NU_SC_RETRACE_MSG); + osRecvMesg(&nusched.waitMQ, NULL, OS_MESG_BLOCK); + nuScRemoveClient(&client); + } +} INCLUDE_ASM(const s32, "_ob_past_brick", nuScSetFrameBufferNum);