Rename `D_800C4B30` to `nuContDataLockKey`

This commit is contained in:
gijs 2023-10-21 17:38:58 +02:00
parent a689d76967
commit 37df9533bc
4 changed files with 11 additions and 13 deletions

View File

@ -130,14 +130,11 @@ extern void* D_800B1828;
extern s32 D_800E8B14;
extern s32 D_A9EF0;
extern s32 D_800C4B30;
extern OSPiHandle* CART_HANDLE;
extern OSMesgQueue MQ_800E7988;
extern s32 D_800C4B30;
extern void (*D_800A9FE0)(s16);
extern OSContPad __GLOBAL_CONTROLLER_DATA[MAXCONTROLLERS];

View File

@ -38,6 +38,7 @@ nuContDataMutexBuf = 0x800BE194;
nuContCallBack = 0x800A9FF8;
nuContStatus = 0x800C4B38; // size:0x10 type:u32
nuContNum = 0x800C6D60;
nuContDataLockKey = 0x800C4B30;
nuBoot = 0x8007F880;
nuScCreateScheduler = 0x80088C50; // rom:0x19050

View File

@ -3,18 +3,18 @@
#include "nu/nusys.h"
void nuContDataLock(void) {
s32 temp_v0;
s32 mask;
temp_v0 = osSetIntMask(OS_IM_NONE);
D_800C4B30 = 1;
osSetIntMask(temp_v0);
mask = osSetIntMask(OS_IM_NONE);
nuContDataLockKey = 1;
osSetIntMask(mask);
}
void nuContDataUnLock(void) {
s32 temp_v0;
s32 mask;
temp_v0 = osSetIntMask(OS_IM_NONE);
D_800C4B30 = 0;
osSetIntMask(temp_v0);
mask = osSetIntMask(OS_IM_NONE);
nuContDataLockKey = 0;
osSetIntMask(mask);
}

View File

@ -53,7 +53,7 @@ s32 __read_controller(OSContPad* data, u32 flags) {
return res;
osRecvMesg(&nuSiMesgQ, NULL, OS_MESG_BLOCK);
if (!(flags & D_800C4B30)) {
if (!(flags & nuContDataLockKey)) {
func_8008A354();
osContGetReadData(data);
func_8008A37C();
@ -78,7 +78,7 @@ s32 __real_read_controller(void) {
s32 __calls_read_controller_0(s16* arg0) {
if (D_800C4B30 == 0) {
if (nuContDataLockKey == 0) {
osRecvMesg(&nuContWaitMesgQ, NULL, 0);
__read_controller(__GLOBAL_CONTROLLER_DATA, 1);
if (D_800A9FE0 != NULL) {