From 8afad0eccf4682878d8369c00a90af1749af99e3 Mon Sep 17 00:00:00 2001 From: gijs Date: Wed, 18 Oct 2023 15:37:45 +0200 Subject: [PATCH] Fixed typing of `__GLOBAL_CONTROLLER_DATA_COPY` --- include/common.h | 5 +++-- src/main.c | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/common.h b/include/common.h index d576181..3f82fae 100644 --- a/include/common.h +++ b/include/common.h @@ -161,7 +161,9 @@ extern OSContStatus __GLOBAL_CONT_STATUS[MAXCONTROLLERS]; extern OSMesgQueue MQ_CONTROLLER; extern void (*D_800A9FE0)(s16); extern OSMesgQueue MQ_800C4A00; -extern OSContPad __GLOBAL_CONTROLLER_DATA; + +extern OSContPad __GLOBAL_CONTROLLER_DATA[MAXCONTROLLERS]; +extern OSContPad __GLOBAL_CONTROLLER_DATA_COPY[MAXCONTROLLERS]; extern u8 D_800AA040; extern void (*SWAP_BUFFER_FUNC_800A9E8C)(void** buffers); @@ -610,6 +612,5 @@ extern s8 D_800A8213; extern s16 D_800AEE90; extern s16 D_800AEF10; -extern s32 __GLOBAL_CONTROLLER_DATA_COPY[]; #endif \ No newline at end of file diff --git a/src/main.c b/src/main.c index 58a4abf..763fa04 100644 --- a/src/main.c +++ b/src/main.c @@ -81,12 +81,11 @@ loop_2: var_t0 += 1; var_a2 += 0x10; } while (var_t0 < 4); - bzero(&__GLOBAL_CONTROLLER_DATA_COPY, 0x18); + bzero(__GLOBAL_CONTROLLER_DATA_COPY, sizeof(__GLOBAL_CONTROLLER_DATA_COPY)); } extern u8 D_800AEF9A; -extern OSContPad __GLOBAL_CONTROLLER_DATA; void func_8007284C(u16 __unused) { const u16 pattern_a = CONT_A | CONT_B | CONT_L | CONT_START; @@ -94,11 +93,11 @@ void func_8007284C(u16 __unused) { if ((D_800AEF9A & 1) && !(D_800AEF9A & 4)) { if (D_800AEF9A & 2) { - if (__GLOBAL_CONTROLLER_DATA.button == 0) { + if (__GLOBAL_CONTROLLER_DATA[0].button == 0) { D_800AEF9A = D_800AEF9A & 0xFD; } - } else if (__GLOBAL_CONTROLLER_DATA.button == pattern_a || - __GLOBAL_CONTROLLER_DATA.button == pattern_b) { + } else if (__GLOBAL_CONTROLLER_DATA[0].button == pattern_a || + __GLOBAL_CONTROLLER_DATA[0].button == pattern_b) { D_800AEF9A = D_800AEF9A | 6; } }