summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-06-28 10:38:43 -0400
committerscnorton <scnorton@biociphers.org>2017-06-28 10:38:43 -0400
commit7018449024766d1b24d3de4271f998d285e19cd0 (patch)
tree7d7b53167a1b4fd285ce74239532b477403222e9
parentf01cdd2a380174613dc0da6e04dd19a1b0520b0a (diff)
sub_810C40C
-rwxr-xr-xasm/pokeblock.s85
-rwxr-xr-xsrc/pokeblock.c30
2 files changed, 30 insertions, 85 deletions
diff --git a/asm/pokeblock.s b/asm/pokeblock.s
index 443de3841..86e799586 100755
--- a/asm/pokeblock.s
+++ b/asm/pokeblock.s
@@ -6,91 +6,6 @@
.text
- thumb_func_start sub_810C40C
-sub_810C40C: @ 810C40C
- push {r4,r5,lr}
- lsls r0, 24
- lsrs r5, r0, 24
- adds r4, r5, 0
- ldr r2, _0810C43C @ =gMain
- ldrh r1, [r2, 0x30]
- movs r0, 0x40
- ands r0, r1
- cmp r0, 0
- beq _0810C440
- bl GetMenuCursorPos
- lsls r0, 24
- cmp r0, 0
- beq _0810C4BC
- movs r0, 0x5
- bl PlaySE
- movs r0, 0x1
- negs r0, r0
- bl MoveMenuCursor
- b _0810C4BC
- .align 2, 0
-_0810C43C: .4byte gMain
-_0810C440:
- movs r0, 0x80
- ands r0, r1
- cmp r0, 0
- beq _0810C46C
- bl GetMenuCursorPos
- lsls r0, 24
- lsrs r0, 24
- ldr r1, _0810C468 @ =gUnknown_0203924C
- ldrb r1, [r1]
- subs r1, 0x1
- cmp r0, r1
- beq _0810C4BC
- movs r0, 0x5
- bl PlaySE
- movs r0, 0x1
- bl MoveMenuCursor
- b _0810C4BC
- .align 2, 0
-_0810C468: .4byte gUnknown_0203924C
-_0810C46C:
- ldrh r1, [r2, 0x2E]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- beq _0810C4A8
- movs r0, 0x5
- bl PlaySE
- ldr r4, _0810C4A0 @ =gUnknown_083F7EF4
- bl GetMenuCursorPos
- lsls r0, 24
- lsrs r0, 24
- ldr r1, _0810C4A4 @ =gUnknown_03000758
- ldr r1, [r1]
- adds r1, r0
- ldrb r0, [r1]
- lsls r0, 3
- adds r4, 0x4
- adds r0, r4
- ldr r1, [r0]
- adds r0, r5, 0
- bl _call_via_r1
- b _0810C4BC
- .align 2, 0
-_0810C4A0: .4byte gUnknown_083F7EF4
-_0810C4A4: .4byte gUnknown_03000758
-_0810C4A8:
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _0810C4BC
- movs r0, 0x5
- bl PlaySE
- adds r0, r4, 0
- bl sub_810C748
-_0810C4BC:
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_810C40C
-
thumb_func_start sub_810C4C4
sub_810C4C4: @ 810C4C4
push {r4,lr}
diff --git a/src/pokeblock.c b/src/pokeblock.c
index e62e8cf90..8ea8de838 100755
--- a/src/pokeblock.c
+++ b/src/pokeblock.c
@@ -777,3 +777,33 @@ void sub_810C368(u8 taskId)
gScriptItemId = gUnknown_02039248[0] + gUnknown_02039248[1];
gTasks[taskId].func = sub_810C40C;
}
+
+void sub_810C40C(u8 taskId)
+{
+ if (gMain.newAndRepeatedKeys & DPAD_UP)
+ {
+ if (GetMenuCursorPos())
+ {
+ PlaySE(SE_SELECT);
+ MoveMenuCursor(-1);
+ }
+ }
+ else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
+ {
+ if (GetMenuCursorPos() != gUnknown_0203924C - 1)
+ {
+ PlaySE(SE_SELECT);
+ MoveMenuCursor(+1);
+ }
+ }
+ else if (gMain.newKeys & A_BUTTON)
+ {
+ PlaySE(SE_SELECT);
+ gUnknown_083F7EF4[gUnknown_03000758[GetMenuCursorPos()]].func(taskId);
+ }
+ else if (gMain.newKeys & B_BUTTON)
+ {
+ PlaySE(SE_SELECT);
+ sub_810C748(taskId);
+ }
+}