From 1fe00fcce1150e1e9b8950015fd2f891a8b51639 Mon Sep 17 00:00:00 2001 From: Random <28494085+Random0666@users.noreply.github.com> Date: Fri, 20 Mar 2020 17:15:39 +0100 Subject: [PATCH] Changes in PR #15 (2) - Documented z_msgevent.c --- asm/non_matchings/code/z_jpeg/func_8006E418.s | 2 +- asm/non_matchings/code/z_play/func_800BEDD8.s | 2 +- include/functions.h | 2 +- include/sched.h | 10 ++++++++++ include/ultra64/mbi.h | 8 +++++--- spec | 2 +- src/code/{code_8007BF10.c => z_msgevent.c} | 6 +++--- 7 files changed, 22 insertions(+), 10 deletions(-) rename src/code/{code_8007BF10.c => z_msgevent.c} (82%) diff --git a/asm/non_matchings/code/z_jpeg/func_8006E418.s b/asm/non_matchings/code/z_jpeg/func_8006E418.s index ca42877a75..09a98ffa82 100644 --- a/asm/non_matchings/code/z_jpeg/func_8006E418.s +++ b/asm/non_matchings/code/z_jpeg/func_8006E418.s @@ -96,7 +96,7 @@ glabel func_8006E418 /* AE5620 8006E480 27A502B8 */ addiu $a1, $sp, 0x2b8 /* AE5624 8006E484 0C001874 */ jal osCreateMesgQueue /* AE5628 8006E488 24060001 */ li $a2, 1 -/* AE562C 8006E48C 0C01EFC4 */ jal func_8007BF10 +/* AE562C 8006E48C 0C01EFC4 */ jal MsgEvent_SendNullTask /* AE5630 8006E490 00000000 */ nop /* AE5634 8006E494 0C001A78 */ jal osGetTime /* AE5638 8006E498 00000000 */ nop diff --git a/asm/non_matchings/code/z_play/func_800BEDD8.s b/asm/non_matchings/code/z_play/func_800BEDD8.s index 040866161b..1be2fffa21 100644 --- a/asm/non_matchings/code/z_play/func_800BEDD8.s +++ b/asm/non_matchings/code/z_play/func_800BEDD8.s @@ -370,7 +370,7 @@ glabel func_800BEDD8 /* B364E4 800BF344 84430190 */ lh $v1, 0x190($v0) /* B364E8 800BF348 5461000E */ bnel $v1, $at, .L800BF384 /* B364EC 800BF34C 28610004 */ slti $at, $v1, 4 -/* B364F0 800BF350 0C01EFC4 */ jal func_8007BF10 +/* B364F0 800BF350 0C01EFC4 */ jal MsgEvent_SendNullTask /* B364F4 800BF354 00000000 */ nop /* B364F8 800BF358 0C030DDC */ jal func_800C3770 /* B364FC 800BF35C 8FA4003C */ lw $a0, 0x3c($sp) diff --git a/include/functions.h b/include/functions.h index 08b0a5b1a2..8c84fe9b62 100644 --- a/include/functions.h +++ b/include/functions.h @@ -924,7 +924,7 @@ void MapMark_DrawConditionally(GlobalContext* globalCtx); void PreNmiBuff_Init(PreNmiBuff* this); void PreNmiBuff_SetReset(PreNmiBuff* this); u32 PreNmiBuff_IsResetting(PreNmiBuff* this); -// ? func_8007BF10(?); +void MsgEvent_SendNullTask(); f32 func_8007BF90(Vec3f*, Vec3f*); // ? func_8007C028(?); // ? func_8007C058(?); diff --git a/include/sched.h b/include/sched.h index ece6bfddeb..ff396be94b 100644 --- a/include/sched.h +++ b/include/sched.h @@ -3,6 +3,16 @@ #include +#define OS_SC_NEEDS_RDP 0x0001 +#define OS_SC_NEEDS_RSP 0x0002 +#define OS_SC_DRAM_DLIST 0x0004 +#define OS_SC_PARALLEL_TASK 0x0010 +#define OS_SC_LAST_TASK 0x0020 +#define OS_SC_SWAPBUFFER 0x0040 + +#define OS_SC_RCP_MASK 0x0003 +#define OS_SC_TYPE_MASK 0x0007 + typedef struct OSScTask { /* 0x00 */ struct OSScTask* next; diff --git a/include/ultra64/mbi.h b/include/ultra64/mbi.h index 17213ea2bd..00b113595f 100644 --- a/include/ultra64/mbi.h +++ b/include/ultra64/mbi.h @@ -76,9 +76,11 @@ * **************************************************************************/ -#define M_GFXTASK 1 -#define M_AUDTASK 2 -#define M_VIDTASK 3 +#define M_NULTASK 0 +#define M_GFXTASK 1 +#define M_AUDTASK 2 +#define M_VIDTASK 3 +#define M_NJPEGTASK 4 #define M_HVQTASK 6 #define M_HVQMTASK 7 diff --git a/spec b/spec index 5b8caf7eb6..164e1f744b 100644 --- a/spec +++ b/spec @@ -340,7 +340,7 @@ beginseg include "build/src/code/z_map_mark.o" include "build/src/code/z_moji.o" include "build/src/code/prenmi_buff.o" - include "build/src/code/code_8007BF10.o" + include "build/src/code/z_msgevent.o" include "build/src/code/code_8007BF90.o" include "build/src/code/z_onepointdemo.o" include "build/data/z_onepointdemo.data.o" diff --git a/src/code/code_8007BF10.c b/src/code/z_msgevent.c similarity index 82% rename from src/code/code_8007BF10.c rename to src/code/z_msgevent.c index f318d23bfa..3282d0342f 100644 --- a/src/code/code_8007BF10.c +++ b/src/code/z_msgevent.c @@ -2,7 +2,7 @@ #include #include -void func_8007BF10() +void MsgEvent_SendNullTask() { u32 pad[4]; OSScTask task; @@ -11,11 +11,11 @@ void func_8007BF10() u32 pad2[1]; task.next = NULL; - task.flags = 3; + task.flags = OS_SC_RCP_MASK; task.msgQ = &queue; task.msg = NULL; task.framebuffer = NULL; - task.list.t.type = 0; + task.list.t.type = M_NULTASK; osCreateMesgQueue(task.msgQ, &msg, 1); osSendMesg(&gSchedContext.cmdQ, &task, OS_MESG_BLOCK); func_800C95F8(&gSchedContext); // osScKickEntryMsg