mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Decompiled AnyMonHasRibbon
This commit is contained in:
parent
5441d80ebc
commit
729e7116f2
@ -5,69 +5,7 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81C7388
|
||||
sub_81C7388: @ 81C7388
|
||||
push {r4-r6,lr}
|
||||
movs r5, 0
|
||||
_081C738C:
|
||||
movs r0, 0x64
|
||||
adds r1, r5, 0
|
||||
muls r1, r0
|
||||
ldr r0, =gPlayerParty
|
||||
adds r4, r1, r0
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x5
|
||||
bl GetMonData
|
||||
cmp r0, 0
|
||||
beq _081C73BA
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x6
|
||||
bl GetMonData
|
||||
cmp r0, 0
|
||||
bne _081C73BA
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x52
|
||||
bl GetMonData
|
||||
cmp r0, 0
|
||||
bne _081C73E2
|
||||
_081C73BA:
|
||||
adds r5, 0x1
|
||||
cmp r5, 0x5
|
||||
ble _081C738C
|
||||
movs r4, 0
|
||||
_081C73C2:
|
||||
movs r5, 0
|
||||
lsls r6, r4, 24
|
||||
_081C73C6:
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl CheckBoxMonSanityAt
|
||||
cmp r0, 0
|
||||
beq _081C73EC
|
||||
lsls r1, r5, 24
|
||||
lsrs r1, 24
|
||||
lsrs r0, r6, 24
|
||||
movs r2, 0x52
|
||||
bl GetBoxMonDataAt
|
||||
cmp r0, 0
|
||||
beq _081C73EC
|
||||
_081C73E2:
|
||||
movs r0, 0x1
|
||||
b _081C73FA
|
||||
.pool
|
||||
_081C73EC:
|
||||
adds r5, 0x1
|
||||
cmp r5, 0x1D
|
||||
ble _081C73C6
|
||||
adds r4, 0x1
|
||||
cmp r4, 0xD
|
||||
ble _081C73C2
|
||||
movs r0, 0
|
||||
_081C73FA:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81C7388
|
||||
|
||||
|
||||
thumb_func_start sub_81C7400
|
||||
sub_81C7400: @ 81C7400
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "overworld.h"
|
||||
#include "field_weather.h"
|
||||
#include "palette.h"
|
||||
#include "pokemon_storage_system.h"
|
||||
|
||||
struct UnknownStruct_0203CF40 {
|
||||
u32 field_0;
|
||||
@ -24,7 +25,7 @@ extern void sub_81C7418(void);
|
||||
extern void sub_81C7170(u8 a0);
|
||||
extern void sub_81C71E4(u8 a0);
|
||||
extern void sub_81C7650(s32 a0);
|
||||
extern u32 sub_81C7388(void);
|
||||
extern u32 AnyMonHasRibbon(void);
|
||||
|
||||
void sub_81C72BC(void);
|
||||
void sub_81C7360(struct UnknownStruct_0203CF40 *a0);
|
||||
@ -202,6 +203,32 @@ void sub_81C7360(struct UnknownStruct_0203CF40 *a0) {
|
||||
}
|
||||
a0->field_2 = 0;
|
||||
a0->field_1 = 0;
|
||||
a0->field_3 = sub_81C7388();
|
||||
a0->field_3 = AnyMonHasRibbon();
|
||||
a0->field_0 = 0;
|
||||
}
|
||||
|
||||
bool32 AnyMonHasRibbon() {
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES)
|
||||
&& !GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_EGG)
|
||||
&& GetMonData(&gPlayerParty[i], MON_DATA_RIBBON_COUNT) != 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; j < 14; j++) {
|
||||
for (i = 0; i < 30; i++) {
|
||||
if (CheckBoxMonSanityAt(j, i)
|
||||
&& GetBoxMonDataAt(j, i, MON_DATA_RIBBON_COUNT) != 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
Loading…
Reference in New Issue
Block a user