Match sub_080185B4

This commit is contained in:
Tal Hayon 2022-05-10 07:38:26 +03:00
parent 43fdd75b10
commit d77c346564
2 changed files with 14 additions and 37 deletions

View File

@ -97,39 +97,3 @@ _0801858C:
.align 2, 0
_080185B0: .4byte gUnk_080B3D20
thumb_func_start sub_080185B4
sub_080185B4: @ 0x080185B4
push {lr}
adds r2, r0, #0
ldrb r0, [r2]
cmp r0, #0xff
bne _080185C2
movs r0, #0
b _080185F6
_080185C2:
cmp r0, #0xfe
bne _080185D4
ldrb r0, [r2, #1]
bl GetInventoryValue
cmp r0, #0
beq _080185F6
movs r0, #1
b _080185F6
_080185D4:
cmp r0, #0xfd
beq _080185F0
ldr r1, _080185EC @ =gLocalFlagBanks
ldrb r0, [r2]
lsls r0, r0, #1
adds r0, r0, r1
ldrh r0, [r0]
ldrb r1, [r2, #1]
bl CheckLocalFlagByBank
b _080185F6
.align 2, 0
_080185EC: .4byte gLocalFlagBanks
_080185F0:
ldrb r0, [r2, #1]
bl CheckKinstoneFused
_080185F6:
pop {pc}

View File

@ -38,7 +38,20 @@ void sub_0801876C(int, int);
void sub_08018738(u32, int);
void sub_08018690(int param_1, u16* param_2);
void sub_08018500();
bool32 sub_080185B4(const struct_gUnk_080B3D20*);
bool32 sub_080185B4(const struct_gUnk_080B3D20* param_1) {
if (param_1->unk0 == 0xff)
return 0;
if (param_1->unk0 == 0xfe) {
return GetInventoryValue(param_1->unk1) != 0;
}
if (param_1->unk0 == 0xfd) {
return CheckKinstoneFused(param_1->unk1);
}
return CheckLocalFlagByBank(gLocalFlagBanks[param_1->unk0], param_1->unk1);
}
void sub_080185F8(void) {
struct_area_28* ptr2 = &gArea.unk28;