summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-06-28 09:51:41 -0400
committerscnorton <scnorton@biociphers.org>2017-06-28 09:51:41 -0400
commitc038b3a51cd82ec56ed09965513e8f846a3490df (patch)
tree7b3fb625cf7d74e1d2ad436515392f6036bdda3b
parent8f84aa839874e2b69bd0e31694fad7560ca90d17 (diff)
sub_810C23C
-rwxr-xr-xasm/pokeblock.s60
-rwxr-xr-xsrc/pokeblock.c18
2 files changed, 18 insertions, 60 deletions
diff --git a/asm/pokeblock.s b/asm/pokeblock.s
index c00294e94..a8156d6a4 100755
--- a/asm/pokeblock.s
+++ b/asm/pokeblock.s
@@ -6,66 +6,6 @@
.text
- thumb_func_start sub_810C23C
-sub_810C23C: @ 810C23C
- push {r4-r7,lr}
- lsls r0, 24
- lsrs r1, r0, 24
- ldr r7, _0810C25C @ =gUnknown_02039248
- ldrb r0, [r7]
- ldrb r2, [r7, 0x1]
- adds r0, r2
- lsls r0, 24
- lsrs r0, 24
- ldrb r2, [r7, 0x2]
- cmp r0, r2
- bne _0810C260
- movs r0, 0
- bl sub_810BDAC
- b _0810C2A2
- .align 2, 0
-_0810C25C: .4byte gUnknown_02039248
-_0810C260:
- ldr r4, _0810C2A8 @ =gSaveBlock1
- lsls r3, r0, 3
- movs r0, 0xFF
- lsls r0, 3
- adds r4, r0
- adds r3, r4
- ldr r5, [r3]
- ldr r6, [r3, 0x4]
- ldr r0, _0810C2AC @ =gTasks
- lsls r2, r1, 2
- adds r2, r1
- lsls r2, 3
- adds r2, r0
- movs r1, 0x8
- ldrsh r0, [r2, r1]
- lsls r0, 3
- adds r0, r4
- ldr r1, [r0, 0x4]
- ldr r0, [r0]
- str r0, [r3]
- str r1, [r3, 0x4]
- movs r1, 0x8
- ldrsh r0, [r2, r1]
- lsls r0, 3
- adds r0, r4
- str r5, [r0]
- str r6, [r0, 0x4]
- ldrb r0, [r7, 0x1]
- bl sub_810BB88
- movs r0, 0
- bl sub_810BDAC
-_0810C2A2:
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0810C2A8: .4byte gSaveBlock1
-_0810C2AC: .4byte gTasks
- thumb_func_end sub_810C23C
-
thumb_func_start sub_810C2B0
sub_810C2B0: @ 810C2B0
push {lr}
diff --git a/src/pokeblock.c b/src/pokeblock.c
index 775bc42ab..a47890fe9 100755
--- a/src/pokeblock.c
+++ b/src/pokeblock.c
@@ -710,3 +710,21 @@ void sub_810C1C8(u8 taskId, u8 flag)
}
}
}
+
+void sub_810C23C(u8 taskId)
+{
+ struct Pokeblock buf;
+ u8 selidx = gUnknown_02039248[1] + gUnknown_02039248[0];
+ if (selidx == gUnknown_02039248[2])
+ {
+ sub_810BDAC(FALSE);
+ }
+ else
+ {
+ buf = gSaveBlock1.pokeblocks[selidx];
+ gSaveBlock1.pokeblocks[selidx] = gSaveBlock1.pokeblocks[gTasks[taskId].data[0]];
+ gSaveBlock1.pokeblocks[gTasks[taskId].data[0]] = buf;
+ sub_810BB88(gUnknown_02039248[1]);
+ sub_810BDAC(FALSE);
+ }
+}