diff options
author | Mateusz Naściszewski <matin1111@wp.pl> | 2020-12-26 07:25:05 +0100 |
---|---|---|
committer | Seth Barberee <seth.barberee@gmail.com> | 2020-12-28 20:13:22 -0600 |
commit | 372d737a125cd05e6844e777d8d389dc7c8f2f98 (patch) | |
tree | fc146841fa822f071a85e6ac655fc2aec4f3ccfb | |
parent | 6362345b04a04fefec25fdb29fd1b1bb9f8da163 (diff) |
Label funcs and globals
-rw-r--r-- | asm/code_2.s | 8 | ||||
-rw-r--r-- | asm/code_800D090.s | 16 | ||||
-rw-r--r-- | asm/code_8012A18.s | 8 | ||||
-rw-r--r-- | asm/code_803D110.s | 6 | ||||
-rw-r--r-- | asm/code_80521D0.s | 142 | ||||
-rw-r--r-- | asm/code_8098468.s | 4 | ||||
-rw-r--r-- | asm/code_8098BDC.s | 12 | ||||
-rw-r--r-- | asm/code_809D148.s | 4 | ||||
-rw-r--r-- | asm/wonder_mail.s | 4 | ||||
-rw-r--r-- | include/input.h | 15 | ||||
-rw-r--r-- | src/code_8040094.c | 4 | ||||
-rw-r--r-- | src/code_8098BDC.c | 4 | ||||
-rw-r--r-- | src/input.c | 86 | ||||
-rw-r--r-- | src/save1.c | 2 | ||||
-rw-r--r-- | sym_ewram.txt | 4 |
15 files changed, 160 insertions, 159 deletions
diff --git a/asm/code_2.s b/asm/code_2.s index 8d2cf42..406eb39 100644 --- a/asm/code_2.s +++ b/asm/code_2.s @@ -179,7 +179,7 @@ _080004D8: bl SetBGOBJEnableFlags b _08000516 .align 2, 0 -_080004FC: .4byte gUnknown_20255F0 +_080004FC: .4byte gRealInputs _08000500: cmp r4, 0 bne _08000522 @@ -305,7 +305,7 @@ xxx_update_stuff: bl sub_80060EC bl sub_8011860 bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl CopySpritesToOam bl sub_8005304 bl TransferBGPaletteBuffer @@ -592,7 +592,7 @@ _0800086C: beq _08000892 b _08000860 .align 2, 0 -_08000880: .4byte gUnknown_20255F0 +_08000880: .4byte gRealInputs _08000884: add r0, sp, 0x8 bl sub_80144A4 @@ -720,7 +720,7 @@ _0800097C: beq _080009A2 b _0800095C .align 2, 0 -_08000990: .4byte gUnknown_20255F0 +_08000990: .4byte gRealInputs _08000994: mov r0, sp bl sub_80144A4 diff --git a/asm/code_800D090.s b/asm/code_800D090.s index 004cb28..77a7b90 100644 --- a/asm/code_800D090.s +++ b/asm/code_800D090.s @@ -5739,7 +5739,7 @@ _0800FB58: .4byte 0x0000401a _0800FB5C: .4byte 0x00004018 _0800FB60: .4byte 0x00004a28 _0800FB64: .4byte 0x00004a1c -_0800FB68: .4byte gUnknown_20255F0 +_0800FB68: .4byte gRealInputs thumb_func_end sub_800FAA8 thumb_func_start sub_800FB6C @@ -5804,7 +5804,7 @@ _0800FBCA: b _0800FC16 .align 2, 0 _0800FBE8: .4byte gUnknown_203B0E4 -_0800FBEC: .4byte gUnknown_20255F0 +_0800FBEC: .4byte gRealInputs _0800FBF0: .4byte 0x00004dfc _0800FBF4: .4byte 0x00004e25 _0800FBF8: .4byte 0x00004dec @@ -6424,7 +6424,7 @@ _08010072: .align 2, 0 _08010094: .4byte gUnknown_80D3EDC _08010098: .4byte gUnknown_80D3EEC -_0801009C: .4byte gUnknown_20255F0 +_0801009C: .4byte gRealInputs _080100A0: .4byte gUnknown_202DE18 _080100A4: .4byte gUnknown_202DE19 _080100A8: @@ -6921,7 +6921,7 @@ _08010480: .4byte 0x00005114 _08010484: .4byte 0x0000110c _08010488: .4byte 0x000052dc _0801048C: .4byte 0x000052de -_08010490: .4byte gUnknown_20255F0 +_08010490: .4byte gRealInputs thumb_func_end sub_8010344 thumb_func_start sub_8010494 @@ -7547,7 +7547,7 @@ sub_8010960: ldr r0, [r0] bl IncrementPlayTime bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl CopySpritesToOam bl sub_8005304 bl TransferBGPaletteBuffer @@ -8003,7 +8003,7 @@ _08010D5E: _08010D70: .4byte gUnknown_203B0EC _08010D74: .4byte gUnknown_80D407C _08010D78: .4byte gUnknown_80D4080 -_08010D7C: .4byte gUnknown_20255F0 +_08010D7C: .4byte gRealInputs _08010D80: movs r0, 0x1 _08010D82: @@ -8378,7 +8378,7 @@ _08011098: .4byte 0x00004dd0 _0801109C: .4byte 0x00004018 _080110A0: .4byte 0x00004014 _080110A4: .4byte 0x00004a30 -_080110A8: .4byte gUnknown_20255F0 +_080110A8: .4byte gRealInputs _080110AC: .4byte gUnknown_80D40C4 thumb_func_end sub_8010F28 @@ -9177,7 +9177,7 @@ sub_801169C: ldr r0, [r0] bl IncrementPlayTime bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl CopySpritesToOam bl sub_8005304 bl TransferBGPaletteBuffer diff --git a/asm/code_8012A18.s b/asm/code_8012A18.s index 675e92d..872b678 100644 --- a/asm/code_8012A18.s +++ b/asm/code_8012A18.s @@ -67,7 +67,7 @@ sub_8012AE8: movs r0, 0xB b _08012BBE .align 2, 0 -_08012B08: .4byte gUnknown_20255F0 +_08012B08: .4byte gRealInputs _08012B0C: ldrh r1, [r2, 0x4] movs r0, 0x40 @@ -3450,7 +3450,7 @@ _08014418: str r1, [r0] ldr r0, _08014464 str r1, [r0] - bl sub_80048F8 + bl UnpressButtons ldr r1, _08014468 movs r0, 0 strb r0, [r1] @@ -3853,7 +3853,7 @@ _08014750: .align 2, 0 _08014760: .4byte gUnknown_202E77C _08014764: .4byte gUnknown_202E748 -_08014768: .4byte gUnknown_20255F0 +_08014768: .4byte gRealInputs _0801476C: .4byte gUnknown_202E790 _08014770: .4byte 0x0001869f _08014774: .4byte gUnknown_202E744 @@ -4042,7 +4042,7 @@ _0801487A: movs r0, 0x70 b _08014932 .align 2, 0 -_080148E4: .4byte gUnknown_20255F0 +_080148E4: .4byte gRealInputs _080148E8: .4byte gUnknown_202E791 _080148EC: .4byte gUnknown_202E77C _080148F0: .4byte gUnknown_202E6E0 diff --git a/asm/code_803D110.s b/asm/code_803D110.s index 63efd41..4ab65ff 100644 --- a/asm/code_803D110.s +++ b/asm/code_803D110.s @@ -2675,7 +2675,7 @@ _0803E5A2: ldr r0, [r0] bl IncrementPlayTime bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl CopySpritesToOam bl nullsub_13 bl sub_8005304 @@ -2750,7 +2750,7 @@ sub_803E668: ldr r0, [r0] bl IncrementPlayTime bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl CopySpritesToOam bl nullsub_13 bl sub_8005304 @@ -2822,7 +2822,7 @@ _0803E72C: pop {r0} bx r0 .align 2, 0 -_0803E744: .4byte gUnknown_20255F0 +_0803E744: .4byte gRealInputs thumb_func_end sub_803E724 thumb_func_start sub_803E748 diff --git a/asm/code_80521D0.s b/asm/code_80521D0.s index ea2fb9e..af7b646 100644 --- a/asm/code_80521D0.s +++ b/asm/code_80521D0.s @@ -526,7 +526,7 @@ _080527A4: _080527B0: .4byte gUnknown_203B418 _080527B4: .4byte 0x0001bdd4 _080527B8: .4byte 0x0001c064 -_080527BC: .4byte gUnknown_20255F0 +_080527BC: .4byte gRealInputs _080527C0: .4byte 0x0000030f thumb_func_end sub_8052740 @@ -1648,7 +1648,7 @@ _080530E0: .4byte 0x0000efff _080530E4: .4byte 0x0000dfff _080530E8: .4byte 0x00003fff _080530EC: .4byte 0x00000fff -_080530F0: .4byte gUnknown_20255F0 +_080530F0: .4byte gRealInputs _080530F4: mov r0, r8 cmp r0, 0 @@ -1978,7 +1978,7 @@ _0805336C: _08053374: .4byte gUnknown_202F1F8 _08053378: .4byte gUnknown_202F1FC _0805337C: .4byte gUnknown_8106990 -_08053380: .4byte gUnknown_20255F0 +_08053380: .4byte gRealInputs _08053384: adds r0, r5, 0 ands r0, r1 @@ -2131,7 +2131,7 @@ _08053498: .align 2, 0 _0805349C: .4byte 0x0001c070 _080534A0: .4byte gUnknown_202F1FC -_080534A4: .4byte gUnknown_20255F0 +_080534A4: .4byte gRealInputs _080534A8: movs r0, 0 bl sub_8083CE0 @@ -2252,7 +2252,7 @@ _08053592: b _08053622 .align 2, 0 _08053598: .4byte gUnknown_202F1FC -_0805359C: .4byte gUnknown_20255F0 +_0805359C: .4byte gRealInputs _080535A0: movs r0, 0 bl sub_8083CE0 @@ -22509,7 +22509,7 @@ _0805D928: bl sub_805E804 bl sub_8083600 bl sub_80647F0 - bl sub_80048D0 + bl ResetRepeatTimers bl sub_8004914 bl sub_805F1AC lsls r0, 16 @@ -22820,7 +22820,7 @@ _0805DBDA: strb r5, [r0] b _0805E1AE .align 2, 0 -_0805DBEC: .4byte gUnknown_20255F0 +_0805DBEC: .4byte gRealInputs _0805DBF0: .4byte gUnknown_203B418 _0805DBF4: .4byte 0x00000673 _0805DBF8: @@ -23030,7 +23030,7 @@ _0805DD66: bl sub_804AA60 ldr r0, _0805DDD4 strb r4, [r0] - bl sub_80048D0 + bl ResetRepeatTimers bl sub_8004914 _0805DD7E: ldr r2, _0805DDC8 @@ -23047,7 +23047,7 @@ _0805DD7E: cmp r0, 0 beq _0805DDA4 bl sub_80532B4 - bl sub_80048D0 + bl ResetRepeatTimers bl sub_8004914 _0805DDA4: movs r4, 0 @@ -23070,7 +23070,7 @@ _0805DDC2: strb r3, [r1] b _0805DDFE .align 2, 0 -_0805DDC8: .4byte gUnknown_20255F0 +_0805DDC8: .4byte gRealInputs _0805DDCC: .4byte 0x00000707 _0805DDD0: .4byte gUnknown_203B46C _0805DDD4: .4byte gUnknown_202F22D @@ -23135,7 +23135,7 @@ _0805DE2C: adds r1, 0x34 movs r0, 0xFF strb r0, [r1] - bl sub_80048D0 + bl ResetRepeatTimers _0805DE54: ldr r0, _0805DF00 ldr r1, [r0] @@ -23222,7 +23222,7 @@ _0805DEDC: .align 2, 0 _0805DEF8: .4byte gUnknown_202F22C _0805DEFC: .4byte gUnknown_203B46C -_0805DF00: .4byte gUnknown_20255F0 +_0805DF00: .4byte gRealInputs _0805DF04: .4byte gUnknown_202F22D _0805DF08: .4byte 0x01000200 _0805DF0C: .4byte gUnknown_203B460 @@ -23295,7 +23295,7 @@ _0805DF82: b _0805DFCC .align 2, 0 _0805DFA0: .4byte gUnknown_202EE00 -_0805DFA4: .4byte gUnknown_20255F0 +_0805DFA4: .4byte gRealInputs _0805DFA8: .4byte gUnknown_203B418 _0805DFAC: .4byte 0x00018214 _0805DFB0: .4byte gUnknown_203B46C @@ -23391,7 +23391,7 @@ _0805E020: bl sub_806CDD4 b _0805E1A0 .align 2, 0 -_0805E05C: .4byte gUnknown_20255F0 +_0805E05C: .4byte gRealInputs _0805E060: .4byte gUnknown_202F22C _0805E064: .4byte gUnknown_202F22D _0805E068: @@ -23536,7 +23536,7 @@ _0805E174: strb r5, [r0] b _0805E1AE .align 2, 0 -_0805E17C: .4byte gUnknown_20255F0 +_0805E17C: .4byte gRealInputs _0805E180: .4byte gUnknown_203B418 _0805E184: .4byte 0x0000066c _0805E188: @@ -23627,7 +23627,7 @@ _0805E238: lsrs r1, 24 adds r0, r2, 0 bl ShowFieldMenu - bl sub_80048D0 + bl ResetRepeatTimers bl sub_8004914 ldr r1, _0805E294 movs r0, 0 @@ -24397,7 +24397,7 @@ _0805E85C: _0805E864: .4byte gUnknown_203B418 _0805E868: .4byte 0x0000066d _0805E86C: .4byte 0x0000066c -_0805E870: .4byte gUnknown_20255F0 +_0805E870: .4byte gRealInputs thumb_func_end sub_805E804 thumb_func_start sub_805E874 @@ -25085,7 +25085,7 @@ _0805EDA0: movs r0, 0 b _0805EDCA .align 2, 0 -_0805EDC0: .4byte gUnknown_20255F0 +_0805EDC0: .4byte gRealInputs _0805EDC4: adds r1, r7, 0 adds r1, 0x48 @@ -25816,7 +25816,7 @@ _0805F35C: .align 2, 0 _0805F388: .4byte gUnknown_202F260 _0805F38C: .4byte gUnknown_202EE10 -_0805F390: .4byte gUnknown_20255F0 +_0805F390: .4byte gRealInputs _0805F394: .4byte gUnknown_202749A _0805F398: .4byte 0xffffff00 _0805F39C: .4byte 0xffff00ff @@ -26453,7 +26453,7 @@ _0805F904: ldr r3, [sp, 0x14] cmp r3, 0 bne _0805F920 - bl sub_80048D0 + bl ResetRepeatTimers bl sub_8004914 b _0805F240 .align 2, 0 @@ -26466,7 +26466,7 @@ _0805F92A: movs r0, 0 movs r1, 0 bl sub_803EAF0 - bl sub_80048D0 + bl ResetRepeatTimers bl sub_8004914 add sp, 0x18 pop {r3-r5} @@ -27322,7 +27322,7 @@ _08060034: .align 2, 0 _08060050: .4byte gUnknown_202EE10 _08060054: .4byte gUnknown_202F258 -_08060058: .4byte gUnknown_20255F0 +_08060058: .4byte gRealInputs _0806005C: movs r0, 0x10 ands r0, r1 @@ -27425,7 +27425,7 @@ _080600D8: add r2, sp, 0x68 b _08060152 .align 2, 0 -_08060134: .4byte gUnknown_20255F0 +_08060134: .4byte gRealInputs _08060138: .4byte gUnknown_202EE10 _0806013C: .4byte gUnknown_202F248 _08060140: .4byte gUnknown_202F240 @@ -27697,7 +27697,7 @@ _0806034C: .4byte gUnknown_202EE10 _08060350: .4byte gUnknown_202F248 _08060354: .4byte gUnknown_203B460 _08060358: .4byte gUnknown_202F240 -_0806035C: .4byte gUnknown_20255F0 +_0806035C: .4byte gRealInputs _08060360: .4byte gUnknown_203B418 _08060364: .4byte 0x00018212 _08060368: .4byte gUnknown_202F238 @@ -29272,7 +29272,7 @@ _08061020: .4byte 0x0001357c _08061024: .4byte 0x00000157 _08061028: .4byte 0x0000065b _0806102C: .4byte gUnknown_202EE10 -_08061030: .4byte gUnknown_20255F0 +_08061030: .4byte gRealInputs _08061034: .4byte gUnknown_202EE39 _08061038: .4byte gUnknown_202EE3A _0806103C: .4byte gUnknown_202F260 @@ -29369,7 +29369,7 @@ _080610FC: movs r7, 0 b _08061116 .align 2, 0 -_08061100: .4byte gUnknown_20255F0 +_08061100: .4byte gRealInputs _08061104: .4byte gUnknown_202EE39 _08061108: .4byte gUnknown_202EE10 _0806110C: @@ -30131,7 +30131,7 @@ _08061720: .4byte gUnknown_202F270 _08061724: .4byte gUnknown_203B418 _08061728: .4byte 0x0001357c _0806172C: .4byte gUnknown_202EE10 -_08061730: .4byte gUnknown_20255F0 +_08061730: .4byte gRealInputs _08061734: .4byte gUnknown_203B080 _08061738: mov r0, r9 @@ -30173,7 +30173,7 @@ _08061780: str r1, [sp, 0x70] b _08061926 .align 2, 0 -_08061788: .4byte gUnknown_20255F0 +_08061788: .4byte gRealInputs _0806178C: .4byte gUnknown_202EE10 _08061790: .4byte gUnknown_203B084 _08061794: @@ -30203,7 +30203,7 @@ _080617C4: movs r7, 0 b _08061926 .align 2, 0 -_080617C8: .4byte gUnknown_20255F0 +_080617C8: .4byte gRealInputs _080617CC: bl sub_8083D08 mov r0, r9 @@ -30866,7 +30866,7 @@ _08061CF0: _08061CF8: .4byte gUnknown_202EE10 _08061CFC: .4byte gUnknown_8106B8C _08061D00: .4byte gUnknown_202F270 -_08061D04: .4byte gUnknown_20255F0 +_08061D04: .4byte gRealInputs _08061D08: movs r0, 0x20 ands r0, r1 @@ -30979,7 +30979,7 @@ _08061DC2: add r2, sp b _08061EFE .align 2, 0 -_08061DDC: .4byte gUnknown_20255F0 +_08061DDC: .4byte gRealInputs _08061DE0: .4byte gUnknown_202EE10 _08061DE4: .4byte gUnknown_203B080 _08061DE8: @@ -31054,7 +31054,7 @@ _08061E58: add r1, sp b _08061F90 .align 2, 0 -_08061E74: .4byte gUnknown_20255F0 +_08061E74: .4byte gRealInputs _08061E78: .4byte gUnknown_202EE10 _08061E7C: .4byte gUnknown_203B084 _08061E80: @@ -31130,7 +31130,7 @@ _08061F04: mov r8, r0 b _080621E6 .align 2, 0 -_08061F0C: .4byte gUnknown_20255F0 +_08061F0C: .4byte gRealInputs _08061F10: .4byte gUnknown_202EE10 _08061F14: .4byte gUnknown_203B080 _08061F18: @@ -31202,7 +31202,7 @@ _08061F96: mov r8, r2 b _080621E6 .align 2, 0 -_08061F9C: .4byte gUnknown_20255F0 +_08061F9C: .4byte gRealInputs _08061FA0: .4byte gUnknown_202EE10 _08061FA4: .4byte gUnknown_203B084 _08061FA8: @@ -31316,7 +31316,7 @@ _08062082: mov r10, r0 b _080621E6 .align 2, 0 -_0806208C: .4byte gUnknown_20255F0 +_0806208C: .4byte gRealInputs _08062090: .4byte gUnknown_202EE10 _08062094: .4byte gUnknown_202EE6C _08062098: @@ -32013,7 +32013,7 @@ _0806261A: pop {r0} bx r0 .align 2, 0 -_08062628: .4byte gUnknown_20255F0 +_08062628: .4byte gRealInputs thumb_func_end sub_80625A4 thumb_func_start sub_806262C @@ -32133,7 +32133,7 @@ _08062718: bl sub_80625A4 b _08062650 .align 2, 0 -_0806272C: .4byte gUnknown_20255F0 +_0806272C: .4byte gRealInputs _08062730: movs r0, 0x4 movs r1, 0x3E @@ -32263,7 +32263,7 @@ _0806282C: bl sub_80625A4 b _0806276C .align 2, 0 -_08062840: .4byte gUnknown_20255F0 +_08062840: .4byte gRealInputs _08062844: movs r0, 0x4 movs r1, 0x3E @@ -32409,7 +32409,7 @@ _0806295C: pop {r0} bx r0 .align 2, 0 -_08062974: .4byte gUnknown_20255F0 +_08062974: .4byte gRealInputs thumb_func_end sub_806285C thumb_func_start sub_8062978 @@ -32629,7 +32629,7 @@ _08062B3C: b _08062B5A .align 2, 0 _08062B40: .4byte gUnknown_202EE10 -_08062B44: .4byte gUnknown_20255F0 +_08062B44: .4byte gRealInputs _08062B48: .4byte gUnknown_202EE3A _08062B4C: ldr r0, _08062B6C @@ -33313,7 +33313,7 @@ _0806305C: .align 2, 0 _080630A4: .4byte gUnknown_202F2D8 _080630A8: .4byte gUnknown_202EE10 -_080630AC: .4byte gUnknown_20255F0 +_080630AC: .4byte gRealInputs _080630B0: bl sub_8083D30 _080630B4: @@ -33366,7 +33366,7 @@ _080630DE: b _08063128 .align 2, 0 _08063118: .4byte gUnknown_202EE10 -_0806311C: .4byte gUnknown_20255F0 +_0806311C: .4byte gRealInputs _08063120: .4byte gUnknown_202F2D8 _08063124: bl sub_8083D30 @@ -33408,7 +33408,7 @@ _08063168: bl sub_8044C94 b _080631F4 .align 2, 0 -_08063174: .4byte gUnknown_20255F0 +_08063174: .4byte gRealInputs _08063178: .4byte gUnknown_202EE10 _0806317C: movs r0, 0x20 @@ -33657,7 +33657,7 @@ _08063376: b _080633A0 .align 2, 0 _0806337C: .4byte gUnknown_202EE10 -_08063380: .4byte gUnknown_20255F0 +_08063380: .4byte gRealInputs _08063384: bl sub_8083D30 _08063388: @@ -34390,7 +34390,7 @@ _0806392C: _0806393C: .4byte gUnknown_202EE10 _08063940: .4byte gUnknown_2027370 _08063944: .4byte gUnknown_202EE38 -_08063948: .4byte gUnknown_20255F0 +_08063948: .4byte gRealInputs _0806394C: movs r0, 0x2 ands r0, r1 @@ -35194,7 +35194,7 @@ _08063F76: .align 2, 0 _08063F80: .4byte gUnknown_202F2D8 _08063F84: .4byte gUnknown_202EE10 -_08063F88: .4byte gUnknown_20255F0 +_08063F88: .4byte gRealInputs _08063F8C: movs r0, 0x8 ands r0, r1 @@ -35314,7 +35314,7 @@ _0806406E: bl sub_8083D08 b _08064094 .align 2, 0 -_0806408C: .4byte gUnknown_20255F0 +_0806408C: .4byte gRealInputs _08064090: bl sub_8083D1C _08064094: @@ -35866,7 +35866,7 @@ _080644B2: b _0806452A .align 2, 0 _080644C8: .4byte gUnknown_202EE10 -_080644CC: .4byte gUnknown_20255F0 +_080644CC: .4byte gRealInputs _080644D0: movs r2, 0x18 ldrsh r0, [r5, r2] @@ -36203,7 +36203,7 @@ _08064774: adds r7, r4, 0x1 b _080647A0 .align 2, 0 -_08064788: .4byte gUnknown_20255F0 +_08064788: .4byte gRealInputs _0806478C: movs r0, 0x2 ands r0, r1 @@ -36242,7 +36242,7 @@ _080647CC: blt _08064774 b _08064640 .align 2, 0 -_080647D4: .4byte gUnknown_20255F0 +_080647D4: .4byte gRealInputs _080647D8: movs r0, 0 movs r1, 0 @@ -36393,7 +36393,7 @@ _080648F6: b _0806496E .align 2, 0 _0806490C: .4byte gUnknown_202EE10 -_08064910: .4byte gUnknown_20255F0 +_08064910: .4byte gRealInputs _08064914: movs r2, 0x18 ldrsh r0, [r5, r2] @@ -36695,7 +36695,7 @@ _08064B64: adds r7, r4, 0x1 b _08064B90 .align 2, 0 -_08064B78: .4byte gUnknown_20255F0 +_08064B78: .4byte gRealInputs _08064B7C: movs r0, 0x2 ands r0, r1 @@ -36734,7 +36734,7 @@ _08064BBC: blt _08064B64 b _08064A58 .align 2, 0 -_08064BC4: .4byte gUnknown_20255F0 +_08064BC4: .4byte gRealInputs _08064BC8: movs r0, 0 movs r1, 0 @@ -36842,7 +36842,7 @@ _08064C8C: _08064C94: .4byte gUnknown_203B418 _08064C98: .4byte gUnknown_202F2E0 _08064C9C: .4byte gUnknown_202EE10 -_08064CA0: .4byte gUnknown_20255F0 +_08064CA0: .4byte gRealInputs _08064CA4: bl sub_8083D30 b _08064CC0 @@ -36998,7 +36998,7 @@ _08064DDA: b _08064DFE .align 2, 0 _08064DE0: .4byte gUnknown_202EE10 -_08064DE4: .4byte gUnknown_20255F0 +_08064DE4: .4byte gRealInputs _08064DE8: movs r0, 0x2 ands r0, r1 @@ -37119,7 +37119,7 @@ _08064EC2: b _08064F2E .align 2, 0 _08064EDC: .4byte gUnknown_202EE10 -_08064EE0: .4byte gUnknown_20255F0 +_08064EE0: .4byte gRealInputs _08064EE4: movs r0, 0x10 ands r0, r1 @@ -37234,7 +37234,7 @@ _08064FAA: b _0806501C .align 2, 0 _08064FC8: .4byte gUnknown_202EE10 -_08064FCC: .4byte gUnknown_20255F0 +_08064FCC: .4byte gRealInputs _08064FD0: movs r0, 0x10 ands r0, r1 @@ -37417,7 +37417,7 @@ _0806512C: b _08065152 .align 2, 0 _08065134: .4byte gUnknown_202EE10 -_08065138: .4byte gUnknown_20255F0 +_08065138: .4byte gRealInputs _0806513C: movs r0, 0x2 ands r0, r1 @@ -38783,7 +38783,7 @@ _08065C5A: b _08065C7E .align 2, 0 _08065C60: .4byte gUnknown_202EE10 -_08065C64: .4byte gUnknown_20255F0 +_08065C64: .4byte gRealInputs _08065C68: movs r0, 0x2 ands r0, r1 @@ -39125,7 +39125,7 @@ _08065F2C: .4byte gUnknown_202EE10 _08065F30: .4byte gUnknown_2027370 _08065F34: .4byte gUnknown_80FF774 _08065F38: .4byte gUnknown_80FF7EC -_08065F3C: .4byte gUnknown_20255F0 +_08065F3C: .4byte gRealInputs _08065F40: movs r0, 0x20 ands r0, r1 @@ -39381,7 +39381,7 @@ _0806613C: .4byte gUnknown_202F2F8 _08066140: .4byte gUnknown_202F2FC _08066144: .4byte gUnknown_2027370 _08066148: .4byte gUnknown_8106D68 -_0806614C: .4byte gUnknown_20255F0 +_0806614C: .4byte gRealInputs _08066150: bl sub_80048C8 lsls r0, 24 @@ -39569,7 +39569,7 @@ _080662B4: .align 2, 0 _080662B8: .4byte gUnknown_202F2F8 _080662BC: .4byte gUnknown_202F2FC -_080662C0: .4byte gUnknown_20255F0 +_080662C0: .4byte gRealInputs _080662C4: movs r0, 0 bl sub_8083CE0 @@ -39671,7 +39671,7 @@ _08066390: .align 2, 0 _08066394: .4byte gUnknown_202F2F8 _08066398: .4byte gUnknown_202F2FC -_0806639C: .4byte gUnknown_20255F0 +_0806639C: .4byte gRealInputs _080663A0: movs r0, 0 bl sub_8083CE0 @@ -42663,7 +42663,7 @@ _08067BF0: mov r10, r0 b _08067CF6 .align 2, 0 -_08067BF8: .4byte gUnknown_20255F0 +_08067BF8: .4byte gRealInputs _08067BFC: .4byte gUnknown_202EE10 _08067C00: .4byte gUnknown_203B080 _08067C04: @@ -42736,7 +42736,7 @@ _08067C84: mov r10, r3 b _08067CF6 .align 2, 0 -_08067C8C: .4byte gUnknown_20255F0 +_08067C8C: .4byte gRealInputs _08067C90: .4byte gUnknown_202EE10 _08067C94: .4byte gUnknown_203B084 _08067C98: @@ -42771,7 +42771,7 @@ _08067CCC: movs r7, 0x1 b _08067CF6 .align 2, 0 -_08067CD4: .4byte gUnknown_20255F0 +_08067CD4: .4byte gRealInputs _08067CD8: .4byte gUnknown_202EE10 _08067CDC: movs r0, 0x2 @@ -42992,7 +42992,7 @@ _08067E82: b _08067EBC .align 2, 0 _08067EA0: .4byte gUnknown_202EE10 -_08067EA4: .4byte gUnknown_20255F0 +_08067EA4: .4byte gRealInputs _08067EA8: cmp r0, 0x1 bne _08067ECC @@ -43379,7 +43379,7 @@ _080681C0: .4byte gUnknown_203B418 _080681C4: .4byte 0x0000065a _080681C8: .4byte gUnknown_2027370 _080681CC: .4byte gUnknown_8106DA4 -_080681D0: .4byte gUnknown_20255F0 +_080681D0: .4byte gRealInputs _080681D4: movs r0, 0x20 ands r0, r1 @@ -43472,7 +43472,7 @@ _0806826C: strh r0, [r3] b _080682E8 .align 2, 0 -_0806828C: .4byte gUnknown_20255F0 +_0806828C: .4byte gRealInputs _08068290: .4byte gUnknown_203B084 _08068294: bl sub_80048C8 @@ -43499,7 +43499,7 @@ _080682B8: mov r8, r4 b _080682E8 .align 2, 0 -_080682C4: .4byte gUnknown_20255F0 +_080682C4: .4byte gRealInputs _080682C8: .4byte gUnknown_202EE10 _080682CC: movs r0, 0x2 @@ -100564,7 +100564,7 @@ _080842DA: pop {r0} bx r0 .align 2, 0 -_080842EC: .4byte gUnknown_20255F0 +_080842EC: .4byte gRealInputs thumb_func_end sub_80841EC thumb_func_start sub_80842F0 diff --git a/asm/code_8098468.s b/asm/code_8098468.s index 4a9a111..bff25f8 100644 --- a/asm/code_8098468.s +++ b/asm/code_8098468.s @@ -512,7 +512,7 @@ _080988F8: ldr r0, [r0] bl IncrementPlayTime bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl nullsub_120 bl sub_80A5E70 bl sub_809B638 @@ -524,7 +524,7 @@ _080988F8: .align 2, 0 _08098968: .4byte gUnknown_20398B9 _0809896C: .4byte gUnknown_20398B8 -_08098970: .4byte gUnknown_20255F0 +_08098970: .4byte gRealInputs _08098974: .4byte 0x0000030f _08098978: .4byte gUnknown_203B47C _0809897C: diff --git a/asm/code_8098BDC.s b/asm/code_8098BDC.s index 099d9d3..11db9fb 100644 --- a/asm/code_8098BDC.s +++ b/asm/code_8098BDC.s @@ -692,7 +692,7 @@ _08099524: mov r9, r1 b _080995AE .align 2, 0 -_0809953C: .4byte gUnknown_20255F0 +_0809953C: .4byte gRealInputs _08099540: adds r0, r6, 0 bl sub_809CFE8 @@ -768,7 +768,7 @@ _080995AE: bl sub_8099744 bl sub_8011860 bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl nullsub_120 bl sub_80A5E70 bl xxx_call_update_bg_vram @@ -5123,7 +5123,7 @@ _0809B72C: str r0, [r1] bl _0809C392 .align 2, 0 -_0809B754: .4byte gUnknown_20255F0 +_0809B754: .4byte gRealInputs _0809B758: bl sub_8094D14 lsls r0, 24 @@ -5164,7 +5164,7 @@ _0809B79C: bne _0809B784 bl _0809C392 .align 2, 0 -_0809B7A8: .4byte gUnknown_20255F0 +_0809B7A8: .4byte gRealInputs _0809B7AC: ldr r0, [r6] movs r3, 0x84 @@ -8026,7 +8026,7 @@ _0809CE54: movs r0, 0 b _0809CEA8 .align 2, 0 -_0809CE70: .4byte gUnknown_20255F0 +_0809CE70: .4byte gRealInputs _0809CE74: movs r3, 0x2 adds r0, r1, 0 @@ -8186,7 +8186,7 @@ _0809CF86: movs r0, 0x4 b _0809CFB6 .align 2, 0 -_0809CFA0: .4byte gUnknown_20255F0 +_0809CFA0: .4byte gRealInputs _0809CFA4: movs r0, 0x80 ands r1, r0 diff --git a/asm/code_809D148.s b/asm/code_809D148.s index bc5bed2..4ad534c 100644 --- a/asm/code_809D148.s +++ b/asm/code_809D148.s @@ -8200,7 +8200,7 @@ _080A1814: ands r0, r1 b _080A1720 .align 2, 0 -_080A1820: .4byte gUnknown_20255F0 +_080A1820: .4byte gRealInputs _080A1824: lsls r0, r5, 16 asrs r0, 16 @@ -9461,7 +9461,7 @@ _080A2282: negs r0, r0 b _080A236C .align 2, 0 -_080A2288: .4byte gUnknown_20255F0 +_080A2288: .4byte gRealInputs _080A228C: negs r0, r5 orrs r0, r5 diff --git a/asm/wonder_mail.s b/asm/wonder_mail.s index e41a22c..ba8c425 100644 --- a/asm/wonder_mail.s +++ b/asm/wonder_mail.s @@ -23474,7 +23474,7 @@ sub_80356A0: ldr r0, [r0] mov pc, r0 .align 2, 0 -_080356C4: .4byte gUnknown_20255F0 +_080356C4: .4byte gRealInputs _080356C8: .4byte gUnknown_80E5990 _080356CC: .4byte gUnknown_203B344 _080356D0: .4byte _080356D4 @@ -27022,7 +27022,7 @@ sub_80373C4: bl sub_8005838 bl sub_80060EC bl sub_800CB20 - bl sub_800485C + bl LoadBufferedInputs bl TransferBGPaletteBuffer bl xxx_call_update_bg_vram bl sub_8009908 diff --git a/include/input.h b/include/input.h index 1d8547a..e924486 100644 --- a/include/input.h +++ b/include/input.h @@ -5,11 +5,11 @@ struct UnkInputStruct1 { /* 0x0 */ u16 held; /* 0x2 */ u16 pressed; - /* 0x4 */ u16 unk4; - /* 0x6 */ u16 unk6; - /* 0x8 */ u16 unk8; + /* 0x4 */ u16 repeated; + /* 0x6 */ u16 shortPress; + /* 0x8 */ u16 heldDpad; /* 0xA */ u16 unkA; - /* 0xC */ s32 repeatTimer; + /* 0xC */ s32 repeatTimerDpad; }; struct UnkInputStruct2 @@ -48,15 +48,16 @@ struct Input }; void InitInput(void); -void sub_800485C(void); +void LoadBufferedInputs(void); u8 sub_80048B8(void); u8 sub_80048BC(void); u8 sub_80048C0(void); u8 sub_80048C4(void); u8 sub_80048C8(void); u8 sub_80048CC(void); -void sub_80048D0(void); -void sub_80048F8(void); +void ResetRepeatTimers(void); +void UnpressButtons(void); void sub_8004914(void); +void UpdateInput(void); #endif // GUARD_INPUT_H diff --git a/src/code_8040094.c b/src/code_8040094.c index 547569c..97458c9 100644 --- a/src/code_8040094.c +++ b/src/code_8040094.c @@ -7,7 +7,7 @@ extern struct PlayTimeStruct *gUnknown_203B47C; extern void sub_803F7BC(void); extern void sub_80060EC(void); extern void sub_800CB20(void); -extern void sub_800485C(void); +extern void LoadBufferedInputs(void); extern void xxx_call_update_bg_sound_input(void); extern void sub_8083F58(void); extern void sub_8011860(void); @@ -19,7 +19,7 @@ void sub_8040094(u8 r0) sub_80060EC(); IncrementPlayTime(gUnknown_203B47C); sub_800CB20(); - sub_800485C(); + LoadBufferedInputs(); xxx_call_update_bg_sound_input(); sub_8083F58(); sub_8011860(); diff --git a/src/code_8098BDC.c b/src/code_8098BDC.c index 491fdc9..40a25fa 100644 --- a/src/code_8098BDC.c +++ b/src/code_8098BDC.c @@ -33,7 +33,7 @@ extern void sub_8099BE4(); extern void sub_8099744(); extern void sub_8011860(); extern void sub_800CB20(); -extern void sub_800485C(); +extern void LoadBufferedInputs(); extern void nullsub_120(); extern void sub_80A5E70(); extern void sub_809B638(); @@ -83,7 +83,7 @@ void sub_8098BDC(void) sub_8011860(); IncrementPlayTime(gUnknown_203B47C); sub_800CB20(); - sub_800485C(); + LoadBufferedInputs(); nullsub_120(); sub_80A5E70(); sub_809B638(); diff --git a/src/input.c b/src/input.c index 91b20ac..5951103 100644 --- a/src/input.c +++ b/src/input.c @@ -2,8 +2,8 @@ #include "input.h" EWRAM_DATA struct Input gUnknown_2025600; -EWRAM_DATA struct UnkInputStruct1 gUnknown_20255F0; -EWRAM_DATA struct UnkInputStruct1 gUnknown_2025638; +EWRAM_DATA struct UnkInputStruct1 gRealInputs; +EWRAM_DATA struct UnkInputStruct1 gBufferedInputs; EWRAM_DATA struct UnkInputStruct1 gCurrentInputs; EWRAM_DATA struct UnkInputStruct1 gLastInputs; EWRAM_DATA struct UnkInputStruct2 gUnknown_2025668; @@ -13,15 +13,15 @@ void ReadKeyInput(struct UnkInputStruct1 *r0); void InitInput(void) { - gUnknown_20255F0.held = 0; - gUnknown_20255F0.pressed = 0; - gUnknown_20255F0.unk4 = 0; - gUnknown_20255F0.unk6 = 0; + gRealInputs.held = 0; + gRealInputs.pressed = 0; + gRealInputs.repeated = 0; + gRealInputs.shortPress = 0; - gUnknown_2025638.held = 0; - gUnknown_2025638.pressed = 0; - gUnknown_2025638.unk4 = 0; - gUnknown_2025638.unk6 = 0; + gBufferedInputs.held = 0; + gBufferedInputs.pressed = 0; + gBufferedInputs.repeated = 0; + gBufferedInputs.shortPress = 0; gUnusedScrambledInputJunk = 0x4a14c1; // seems like random keyboard mashing (see UpdateInput) @@ -47,14 +47,14 @@ void InitInput(void) gUnknown_2025668.holdTimerR = 0; } -void sub_800485C(void) +void LoadBufferedInputs(void) { - gUnknown_20255F0 = gUnknown_2025638; + gRealInputs = gBufferedInputs; - gUnknown_2025638.held = 0; - gUnknown_2025638.pressed = 0; - gUnknown_2025638.unk4 = 0; - gUnknown_2025638.unk6 = 0; + gBufferedInputs.held = 0; + gBufferedInputs.pressed = 0; + gBufferedInputs.repeated = 0; + gBufferedInputs.shortPress = 0; gUnknown_2025600.unk0 = 0xffff; gUnknown_2025600.unk2 = -1; @@ -107,20 +107,20 @@ u8 sub_80048CC(void) return 0; } -void sub_80048D0(void) +void ResetRepeatTimers(void) { - gUnknown_20255F0.unk4 = 0; - gCurrentInputs.repeatTimer = 0; - gCurrentInputs.unk8 = 0; + gRealInputs.repeated = 0; + gCurrentInputs.repeatTimerDpad = 0; + gCurrentInputs.heldDpad = 0; gUnknown_2025668.holdTimerB = 999; gUnknown_2025668.holdTimerR = 999; } -void sub_80048F8(void) +void UnpressButtons(void) { - gUnknown_20255F0.pressed = 0; - gUnknown_2025638.pressed = 0; + gRealInputs.pressed = 0; + gBufferedInputs.pressed = 0; gCurrentInputs.pressed = 0; } @@ -156,33 +156,33 @@ void UpdateInput(void) if (gCurrentInputs.held) { // 0xF0 -- DPAD buttons - if ((gCurrentInputs.unk8 & 0xf0) == (gCurrentInputs.held & 0xf0)) { - if (gCurrentInputs.repeatTimer < 50) - gCurrentInputs.repeatTimer = gCurrentInputs.repeatTimer + 1; + if ((gCurrentInputs.heldDpad & 0xf0) == (gCurrentInputs.held & 0xf0)) { + if (gCurrentInputs.repeatTimerDpad < 50) + gCurrentInputs.repeatTimerDpad++; } else { - gCurrentInputs.unk8 = gCurrentInputs.held & 0xf0; - gCurrentInputs.repeatTimer = 1; + gCurrentInputs.heldDpad = gCurrentInputs.held & 0xf0; + gCurrentInputs.repeatTimerDpad = 1; } } else { - gCurrentInputs.repeatTimer = 0; - gCurrentInputs.unk8 = 0; + gCurrentInputs.repeatTimerDpad = 0; + gCurrentInputs.heldDpad = 0; } - if (gCurrentInputs.repeatTimer == 1) { - gCurrentInputs.unk4 = (gCurrentInputs.unk8 & 0xf0) | gCurrentInputs.pressed; - } else if (gCurrentInputs.repeatTimer == 48) { - gCurrentInputs.repeatTimer = 43; - gCurrentInputs.unk4 = (gCurrentInputs.unk8 & 0xf0) | gCurrentInputs.pressed; + if (gCurrentInputs.repeatTimerDpad == 1) { + gCurrentInputs.repeated = (gCurrentInputs.heldDpad & 0xf0) | gCurrentInputs.pressed; + } else if (gCurrentInputs.repeatTimerDpad == 48) { + gCurrentInputs.repeatTimerDpad = 43; + gCurrentInputs.repeated = (gCurrentInputs.heldDpad & 0xf0) | gCurrentInputs.pressed; } else { - gCurrentInputs.unk4 = 0; + gCurrentInputs.repeated = 0; } - gCurrentInputs.unk6 = 0; + gCurrentInputs.shortPress = 0; if (gCurrentInputs.held & B_BUTTON) { if (gUnknown_2025668.holdTimerB < 100) gUnknown_2025668.holdTimerB++; } else if (1 < gUnknown_2025668.holdTimerB && gUnknown_2025668.holdTimerB < 12) { - gCurrentInputs.unk6 = B_BUTTON; + gCurrentInputs.shortPress = B_BUTTON; gUnknown_2025668.holdTimerB = 0; } else { gUnknown_2025668.holdTimerB = 0; @@ -192,16 +192,16 @@ void UpdateInput(void) if (gUnknown_2025668.holdTimerR < 100) gUnknown_2025668.holdTimerR++; } else if (1 < gUnknown_2025668.holdTimerR && gUnknown_2025668.holdTimerR < 12) { - gCurrentInputs.unk6 |= R_BUTTON; + gCurrentInputs.shortPress |= R_BUTTON; gUnknown_2025668.holdTimerR = 0; } else { gUnknown_2025668.holdTimerR = 0; } - gUnknown_2025638.held |= gCurrentInputs.held; - gUnknown_2025638.pressed |= gCurrentInputs.pressed; - gUnknown_2025638.unk4 |= gCurrentInputs.unk4; - gUnknown_2025638.unk6 |= gCurrentInputs.unk6; + gBufferedInputs.held |= gCurrentInputs.held; + gBufferedInputs.pressed |= gCurrentInputs.pressed; + gBufferedInputs.repeated |= gCurrentInputs.repeated; + gBufferedInputs.shortPress |= gCurrentInputs.shortPress; gUnusedScrambledInputJunk *= gCurrentInputs.held | 0x54a1c41; // very similar to odd constant in InitInput - probably keymashing } diff --git a/src/save1.c b/src/save1.c index a194557..dd0fc45 100644 --- a/src/save1.c +++ b/src/save1.c @@ -69,7 +69,7 @@ void sub_8012A18() sub_8005180(); sub_80060EC(); sub_800CB20(); - sub_800485C(); // Input related + LoadBufferedInputs(); // Input related CopySpritesToOam(); sub_8005304(); TransferBGPaletteBuffer(); diff --git a/sym_ewram.txt b/sym_ewram.txt index 79db77c..a6aea25 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -37,7 +37,7 @@ gBGPaletteUsed = .; /* 20251D0 */ gBGPaletteBuffer = .; /* 20251F0 */ . += 0x400; -gUnknown_20255F0 = .; /* 20255F0 */ +gRealInputs = .; /* 20255F0 */ . += 0x10; gUnknown_2025600 = .; /* 2025600 */ @@ -46,7 +46,7 @@ gUnknown_2025600 = .; /* 2025600 */ gUnusedScrambledInputJunk = .; /* 202562C */ . += 0xC; -gUnknown_2025638 = .; /* 2025638 */ +gBufferedInputs = .; /* 2025638 */ . += 0x10; gCurrentInputs = .; /* 2025648 */ |