summaryrefslogtreecommitdiff
path: root/src/code_800C9CC.c
diff options
context:
space:
mode:
authorMateusz Naściszewski <matin1111@wp.pl>2020-12-26 06:57:02 +0100
committerSeth Barberee <seth.barberee@gmail.com>2020-12-28 20:13:22 -0600
commit6362345b04a04fefec25fdb29fd1b1bb9f8da163 (patch)
tree84059fefe70ebab180e8f5efcc5d2208abd28275 /src/code_800C9CC.c
parentb64320b043fe0a774327d7d880e9f16605db54ee (diff)
Decompile UpdateInput
and some other minor stuff.
Diffstat (limited to 'src/code_800C9CC.c')
-rw-r--r--src/code_800C9CC.c49
1 files changed, 15 insertions, 34 deletions
diff --git a/src/code_800C9CC.c b/src/code_800C9CC.c
index 27445f0..593728e 100644
--- a/src/code_800C9CC.c
+++ b/src/code_800C9CC.c
@@ -9,7 +9,7 @@ struct unkStruct_809CC88
u16 unk6;
};
-extern u16 gUnknown_203B0BC;
+extern u16 gRawKeyInput;
extern u8 gUnknown_202D6B8;
extern u8 gUnknown_202D6B9;
extern u16 gUnknown_202D7FA;
@@ -22,58 +22,39 @@ extern struct unkStruct_809CC88 gUnknown_202D6B0;
void ReadKeyInput(struct UnkInputStruct1 *r0)
{
u16 keyInput = REG_KEYINPUT ^ KEYS_MASK;
- r0->unk0 = 0;
+ r0->held = 0;
if((keyInput & DPAD_UP) != 0)
- {
- r0->unk0 = DPAD_UP;
- }
+ r0->held = DPAD_UP;
if((keyInput & DPAD_DOWN) != 0)
- {
- r0->unk0 |= DPAD_DOWN;
- }
+ r0->held |= DPAD_DOWN;
if((keyInput & DPAD_LEFT) != 0)
- {
- r0->unk0 |= DPAD_LEFT;
- }
+ r0->held |= DPAD_LEFT;
if((keyInput & DPAD_RIGHT) != 0)
- {
- r0->unk0 |= DPAD_RIGHT;
- }
+ r0->held |= DPAD_RIGHT;
if((keyInput & A_BUTTON) != 0)
- {
- r0->unk0 |= A_BUTTON;
- }
+ r0->held |= A_BUTTON;
if((keyInput & B_BUTTON) != 0)
- {
- r0->unk0 |= B_BUTTON;
- }
+ r0->held |= B_BUTTON;
if((keyInput & START_BUTTON) != 0)
- {
- r0->unk0 |= START_BUTTON;
- }
+ r0->held |= START_BUTTON;
if((keyInput & SELECT_BUTTON) != 0)
- {
- r0->unk0 |= SELECT_BUTTON;
- }
+ r0->held |= SELECT_BUTTON;
if((keyInput & R_BUTTON) != 0)
- {
- r0->unk0 |= R_BUTTON;
- }
-
+ r0->held |= R_BUTTON;
+
if((keyInput & L_BUTTON) != 0)
- {
- r0->unk0 |= L_BUTTON;
- }
- gUnknown_203B0BC = keyInput;
+ r0->held |= L_BUTTON;
+
+ gRawKeyInput = keyInput;
}
void sub_800CC44(s32 r0, s32 r1)