From f16e493d79dcb16f76e0804221845f9591dc0589 Mon Sep 17 00:00:00 2001 From: gijs Date: Fri, 20 Oct 2023 17:53:56 +0200 Subject: [PATCH] Rename `MQ_CONTROLLER` to `nuSiMesgQ` --- include/common.h | 3 --- linker_scripts/symbols/addr.txt | 2 +- src/_ob_icy_coast.c | 10 ++++++---- src/_ob_prized_reading.c | 10 ++++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/common.h b/include/common.h index 78cdb1f..361a0fc 100644 --- a/include/common.h +++ b/include/common.h @@ -139,19 +139,16 @@ extern OSThread THREAD_CONTROLLER; extern OSMesg D_800BBE60[8]; -extern OSMesgQueue MQ_CONTROLLER; extern OSMesgQueue MQ_800E7988; extern OSThread THREAD_CONTROLLER; extern OSPiHandle* PTR_CART_ROM_HANDLE; extern s32 D_800C4B30; -extern OSMesgQueue MQ_CONTROLLER; extern OSMesgQueue MQ_800E9BF0; extern u8 D_800A9FF8; extern OSContStatus __GLOBAL_CONT_STATUS[MAXCONTROLLERS]; -extern OSMesgQueue MQ_CONTROLLER; extern void (*D_800A9FE0)(s16); extern OSMesgQueue MQ_800C4A00; diff --git a/linker_scripts/symbols/addr.txt b/linker_scripts/symbols/addr.txt index 7d30b28..edf99eb 100644 --- a/linker_scripts/symbols/addr.txt +++ b/linker_scripts/symbols/addr.txt @@ -23,6 +23,7 @@ gFrameBuf1 = 0x803B5000; gFrameBuf2 = 0x803DA800; rdpstateinit_dl = 0x800A9EF0; // rom:0x3A2F0 nuGfxDisplay = 0x800C4BD8; +nuSiMesgQ = 0x800E9B88; nuBoot = 0x8007F880; nuScCreateScheduler = 0x80088C50; // rom:0x19050 @@ -896,7 +897,6 @@ __MUS_MEM_800B186C = 0x800B186C; __MUS_MEM_800B1870 = 0x800B1870; __MUS_MEM_800B1868 = 0x800B1868; -MQ_CONTROLLER = 0x800E9B88; MQ_SWAP_BUFFER = 0x800E9BA8; MQ_800E7988 = 0x800E7988; MQ_800C4A00 = 0x800C4A00; diff --git a/src/_ob_icy_coast.c b/src/_ob_icy_coast.c index 7edf5c8..e6e7193 100644 --- a/src/_ob_icy_coast.c +++ b/src/_ob_icy_coast.c @@ -1,14 +1,16 @@ #include "common.h" +#include "nu/nusys.h" + /* 1A060 80089C60 */ u8 nuSiMgrInit(void) { u8 pattern; - OSContStatus data[3]; + OSContStatus status[NU_CONT_MAXCONTROLLERS]; - osCreateMesgQueue(&MQ_CONTROLLER, D_800BBE60, 8); - osSetEventMesg(OS_EVENT_SI, &MQ_CONTROLLER, NULL); + osCreateMesgQueue(&nuSiMesgQ, D_800BBE60, 8); + osSetEventMesg(OS_EVENT_SI, &nuSiMesgQ, NULL); - osContInit(&MQ_CONTROLLER, &pattern, data); + osContInit(&nuSiMesgQ, &pattern, status); osCreateThread(&THREAD_CONTROLLER, 5, __controller_thread_80089D9C, NULL, &MQ_800BE030, 0x73); osStartThread(&THREAD_CONTROLLER); diff --git a/src/_ob_prized_reading.c b/src/_ob_prized_reading.c index a809579..cb1333a 100644 --- a/src/_ob_prized_reading.c +++ b/src/_ob_prized_reading.c @@ -1,5 +1,7 @@ #include "common.h" +#include "nu/nusys.h" + void func_8008A5D0(); void func_8008A640(); @@ -54,11 +56,11 @@ void __end_copy_global_controller_data(void) { s32 __read_controller(OSContPad* data, u32 flags) { s32 res; - res = osContStartReadData(&MQ_CONTROLLER); + res = osContStartReadData(&nuSiMesgQ); if(res != 0) return res; - osRecvMesg(&MQ_CONTROLLER, NULL, OS_MESG_BLOCK); + osRecvMesg(&nuSiMesgQ, NULL, OS_MESG_BLOCK); if (!(flags & D_800C4B30)) { func_8008A354(); osContGetReadData(data); @@ -72,9 +74,9 @@ s32 __read_controller(OSContPad* data, u32 flags) { s32 __real_read_controller(void) { s32 var_v0; - var_v0 = osContStartQuery(&MQ_CONTROLLER); + var_v0 = osContStartQuery(&nuSiMesgQ); if (var_v0 == 0) { - osRecvMesg(&MQ_CONTROLLER, NULL, OS_MESG_BLOCK); + osRecvMesg(&nuSiMesgQ, NULL, OS_MESG_BLOCK); osContGetQuery(__GLOBAL_CONT_STATUS); return 0; } else {