through sub_811A8A4

This commit is contained in:
PikalaxALT 2017-11-02 19:44:03 -04:00
parent 46068c0a6f
commit 85eb28ba42
2 changed files with 35 additions and 60 deletions

View file

@ -5,64 +5,6 @@
.text
thumb_func_start sub_811A868
sub_811A868: @ 811A868
push {lr}
lsls r0, 16
lsrs r2, r0, 16
movs r0, 0
ldr r1, =gUnknown_08597530
_0811A872:
ldrh r3, [r1]
cmp r2, r3
beq _0811A884
adds r1, 0x8
adds r0, 0x1
cmp r0, 0x3
bls _0811A872
movs r0, 0x1
negs r0, r0
_0811A884:
pop {r1}
bx r1
.pool
thumb_func_end sub_811A868
thumb_func_start sub_811A88C
sub_811A88C: @ 811A88C
push {lr}
lsls r0, 16
lsrs r0, 16
bl sub_811A868
adds r1, r0, 0
mvns r1, r1
negs r0, r1
orrs r0, r1
lsrs r0, 31
pop {r1}
bx r1
thumb_func_end sub_811A88C
thumb_func_start sub_811A8A4
sub_811A8A4: @ 811A8A4
push {r4,lr}
lsls r0, 16
lsrs r0, 16
bl sub_811A868
adds r4, r0, 0
bl ResetTasks
ldr r0, =gUnknown_08597530
lsls r4, 3
adds r0, 0x4
adds r4, r0
ldr r0, [r4]
bl sub_811A4D0
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_811A8A4
thumb_func_start sub_811A8CC
sub_811A8CC: @ 811A8CC
push {lr}

View file

@ -28,8 +28,8 @@ static void sub_811A278(void);
static bool8 sub_811A428(u8);
static void sub_811A2FC(u8);
/*static*/ void sub_811A4D0(MainCallback);
/*static*/ bool32 sub_811A88C(u16);
/*static*/ void sub_811A8A4(u16);
static bool32 sub_811A88C(u16);
static void sub_811A8A4(u16);
void sub_811A8F0(void);
bool8 sub_811A95C(u8, u32, u8);
void sub_811AA90(void);
@ -46,6 +46,11 @@ void sub_811F2B8(void);
// .rodata
extern const struct {
u16 word;
MainCallback callback;
} gUnknown_08597530[4];
// .text
void sub_811A20C(u8 kind, u16 *words, MainCallback callback, u8 sizeParam)
@ -333,3 +338,31 @@ void sub_811A858(void)
{
SetMainCallback2(sub_811A7E4);
}
static int sub_811A868(u16 word)
{
int i;
for (i = 0; i < ARRAY_COUNT(gUnknown_08597530); i ++)
{
if (word == gUnknown_08597530[i].word)
{
return i;
}
}
return -1;
}
static bool32 sub_811A88C(u16 word)
{
return sub_811A868(word) == -1 ? FALSE : TRUE;
}
static void sub_811A8A4(u16 word)
{
int i;
i = sub_811A868(word);
ResetTasks();
sub_811A4D0(gUnknown_08597530[i].callback);
}