summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-06-29 22:17:58 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-06-29 22:17:58 -0400
commit05c997bd75ce375425f1941c86b7643973e41e3f (patch)
tree716345f12151409d1a0852916c709b4c4fb75814
parentfe40c6053622e89dbc0f9e26493946fa098765fb (diff)
sub_81370A4
-rwxr-xr-xasm/use_pokeblock.s76
-rwxr-xr-xsrc/use_pokeblock.c24
2 files changed, 24 insertions, 76 deletions
diff --git a/asm/use_pokeblock.s b/asm/use_pokeblock.s
index d16abf724..d51560e52 100755
--- a/asm/use_pokeblock.s
+++ b/asm/use_pokeblock.s
@@ -6,82 +6,6 @@
.text
- thumb_func_start sub_8137058
-sub_8137058: @ 8137058
- push {lr}
- ldr r0, _0813708C @ =gPlayerParty
- ldr r1, _08137090 @ =gUnknown_083DFEC4
- ldr r2, [r1]
- ldr r3, _08137094 @ =0x000087dc
- adds r1, r2, r3
- movs r3, 0
- ldrsh r1, [r1, r3]
- lsls r1, 2
- adds r2, r1
- ldr r1, _08137098 @ =0x0000893e
- adds r2, r1
- ldrb r1, [r2]
- lsls r1, 27
- lsrs r1, 27
- movs r2, 0x64
- muls r1, r2
- adds r0, r1, r0
- movs r1, 0x30
- bl GetMonData
- cmp r0, 0xFF
- beq _0813709C
- movs r0, 0
- b _0813709E
- .align 2, 0
-_0813708C: .4byte gPlayerParty
-_08137090: .4byte gUnknown_083DFEC4
-_08137094: .4byte 0x000087dc
-_08137098: .4byte 0x0000893e
-_0813709C:
- movs r0, 0x1
-_0813709E:
- pop {r1}
- bx r1
- thumb_func_end sub_8137058
-
- thumb_func_start sub_81370A4
-sub_81370A4: @ 81370A4
- push {r4,r5,lr}
- lsls r0, 24
- lsrs r5, r0, 24
- movs r4, 0
-_081370AC:
- movs r0, 0x64
- muls r0, r4
- ldr r1, _081370C8 @ =gPlayerParty
- adds r0, r1
- movs r1, 0x2D
- bl GetMonData
- cmp r0, 0
- bne _081370D2
- cmp r5, 0
- bne _081370CC
- adds r0, r4, 0
- b _081370DE
- .align 2, 0
-_081370C8: .4byte gPlayerParty
-_081370CC:
- subs r0, r5, 0x1
- lsls r0, 24
- lsrs r5, r0, 24
-_081370D2:
- adds r0, r4, 0x1
- lsls r0, 24
- lsrs r4, r0, 24
- cmp r4, 0x5
- bls _081370AC
- movs r0, 0
-_081370DE:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_81370A4
-
thumb_func_start sub_81370E4
sub_81370E4: @ 81370E4
push {r4-r6,lr}
diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c
index 5a14f74fa..b29cb7454 100755
--- a/src/use_pokeblock.c
+++ b/src/use_pokeblock.c
@@ -828,3 +828,27 @@ void sub_8136F74(struct Pokeblock *pokeblock, struct Pokemon *pokemon)
}
}
}
+
+bool8 sub_8137058(void)
+{
+ struct Pokemon *pokemon = gPlayerParty;
+ pokemon += gUnknown_083DFEC4->unk893c[gUnknown_083DFEC4->unk87DC].partyIdx;
+ if (GetMonData(pokemon, MON_DATA_SHEEN) == 255)
+ return TRUE;
+ return FALSE;
+}
+
+u8 sub_81370A4(u8 a0)
+{
+ u8 i;
+ for (i=0; i<PARTY_SIZE; i++)
+ {
+ if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG))
+ {
+ if (a0 == 0)
+ return i;
+ a0--;
+ }
+ }
+ return 0;
+}