summaryrefslogtreecommitdiff
path: root/src/input.c
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2020-08-04 17:18:59 -0700
committertheo3 <arisstephenson2@gmail.com>2020-08-04 17:18:59 -0700
commit2575c0a63df8770448f92a177a3f45634d7ce45e (patch)
treeb69c2fe1bc3a4cd0178fb8b47c9e6595ab9f41ca /src/input.c
parent7f7b74cfd5874da1e7bc75756319a38d6fd94660 (diff)
parent765047808cf2306fe6130c316213aaf0aab1d0cf (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/input.c')
-rw-r--r--src/input.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/input.c b/src/input.c
index df5b2290..438a6e6b 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1,18 +1,9 @@
#include "global.h"
#include "entity.h"
-
-typedef struct {
- u16 field_0x0;
- u16 field_0x2;
- u16 field_0x4;
- u8 field_0x6;
- u8 field_0x7;
-} Input;
+#include "readKeyInput.h"
void StoreKeyInput(Input *pkeyInput, u32 ioKeyInput);
-extern Input gUnk_03000FF0;
-
void ReadKeyInput(void)
{
u32 reg = ~*(u16*)0x04000130 & 0x3FF;
@@ -23,22 +14,22 @@ void ReadKeyInput(void)
void StoreKeyInput(Input *input, u32 ioKeyInput)
{
u32 difference;
- u32 temp = input->field_0x0;
+ u32 temp = input->heldKeys;
difference = ioKeyInput & ~temp;
- input->field_0x2 = difference;
+ input->newKeys = difference;
if (ioKeyInput == temp) {
- if (--input->field_0x7 == 0) {
- input->field_0x7 = 4;
- input->field_0x4 = ioKeyInput;
+ if (--input->unk7 == 0) {
+ input->unk7 = 4;
+ input->unk4 = ioKeyInput;
}
else {
- input->field_0x4 = 0;
+ input->unk4 = 0;
}
}
else {
- input->field_0x7 = 0x14;
- input->field_0x4 = difference;
+ input->unk7 = 0x14;
+ input->unk4 = difference;
}
- input->field_0x0 = ioKeyInput;
+ input->heldKeys = ioKeyInput;
} \ No newline at end of file