through sub_8134FB0

This commit is contained in:
PikalaxALT 2017-11-24 21:17:50 -05:00
parent 4a81b595c3
commit 046e5ebf69
2 changed files with 35 additions and 98 deletions

View file

@ -5,103 +5,6 @@
.text
thumb_func_start sub_8134F10
sub_8134F10: @ 8134F10
push {lr}
lsls r0, 24
lsrs r2, r0, 24
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _08134F30
ldr r0, =gTasks
lsls r1, r2, 2
adds r1, r2
lsls r1, 3
adds r1, r0
ldr r0, =sub_8134F40
str r0, [r1]
_08134F30:
pop {r0}
bx r0
.pool
thumb_func_end sub_8134F10
thumb_func_start sub_8134F40
sub_8134F40: @ 8134F40
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
bl sub_8135130
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x3
ands r0, r1
cmp r0, 0
beq _08134F66
ldr r0, =gTasks
lsls r1, r4, 2
adds r1, r4
lsls r1, 3
adds r1, r0
ldr r0, =sub_8134F78
str r0, [r1]
_08134F66:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_8134F40
thumb_func_start sub_8134F78
sub_8134F78: @ 8134F78
push {r4,lr}
sub sp, 0x4
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
movs r0, 0x1
negs r0, r0
movs r1, 0
str r1, [sp]
movs r2, 0
movs r3, 0x10
bl BeginNormalPaletteFade
ldr r1, =gTasks
lsls r0, r4, 2
adds r0, r4
lsls r0, 3
adds r0, r1
ldr r1, =sub_8134FB0
str r1, [r0]
add sp, 0x4
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_8134F78
thumb_func_start sub_8134FB0
sub_8134FB0: @ 8134FB0
push {lr}
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _08134FC6
ldr r0, =gMain
ldr r0, [r0, 0x8]
bl SetMainCallback2
_08134FC6:
pop {r0}
bx r0
.pool
thumb_func_end sub_8134FB0
thumb_func_start sub_8134FD4
sub_8134FD4: @ 8134FD4
push {lr}

View file

@ -30,7 +30,10 @@ static void sub_8134DC4(u8 taskId);
static void c3_80BF560(u8 taskId);
static void sub_8134EA4(u8 taskId);
static void c2_080111BC(u8 taskId);
void sub_8134F10(u8 taskId);
static void sub_8134F10(u8 taskId);
static void sub_8134F40(u8 taskId);
static void sub_8134F78(u8 taskId);
static void sub_8134FB0(u8 taskId);
u16 sub_8134FFC(u16 a0, u8 a1, u8 a2);
void sub_813504C(u8 taskId, u8 a1);
void sub_8135130(u8 taskId);
@ -764,3 +767,34 @@ static void c2_080111BC(u8 taskId)
SetMainCallback2(gMain.savedCallback);
}
}
static void sub_8134F10(u8 taskId)
{
if (!gPaletteFade.active)
{
gTasks[taskId].func = sub_8134F40;
}
}
static void sub_8134F40(u8 taskId)
{
sub_8135130(taskId);
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
gTasks[taskId].func = sub_8134F78;
}
}
static void sub_8134F78(u8 taskId)
{
BeginNormalPaletteFade(-1, 0, 0, 16, 0);
gTasks[taskId].func = sub_8134FB0;
}
static void sub_8134FB0(u8 taskId)
{
if (!gPaletteFade.active)
{
SetMainCallback2(gMain.savedCallback);
}
}