through sub_8134CE8

This commit is contained in:
PikalaxALT 2017-11-24 20:46:29 -05:00
parent efd23cb91b
commit 2746967bef
4 changed files with 427 additions and 157 deletions

View File

@ -5,151 +5,6 @@
.text
thumb_func_start sub_8134C9C
sub_8134C9C: @ 8134C9C
push {lr}
bl RunTasks
bl AnimateSprites
bl BuildOamBuffer
bl do_scheduled_bg_tilemap_copies_to_vram
bl UpdatePaletteFade
pop {r0}
bx r0
thumb_func_end sub_8134C9C
thumb_func_start sub_8134CB8
sub_8134CB8: @ 8134CB8
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 _08134CD8
ldr r0, =gTasks
lsls r1, r2, 2
adds r1, r2
lsls r1, 3
adds r1, r0
ldr r0, =sub_8134CE8
str r0, [r1]
_08134CD8:
pop {r0}
bx r0
.pool
thumb_func_end sub_8134CB8
thumb_func_start sub_8134CE8
sub_8134CE8: @ 8134CE8
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
ldr r1, =gTasks
lsls r0, r6, 2
adds r0, r6
lsls r0, 3
adds r5, r0, r1
movs r1, 0x8
ldrsh r0, [r5, r1]
movs r1, 0x6
bl __modsi3
lsls r0, 16
cmp r0, 0
beq _08134D1C
ldrh r0, [r5, 0x8]
ldrb r1, [r5, 0x10]
ldrb r2, [r5, 0x14]
bl sub_8134FFC
strh r0, [r5, 0x8]
b _08134DBE
.pool
_08134D1C:
movs r2, 0xE
ldrsh r1, [r5, r2]
lsls r0, r1, 1
adds r0, r1
lsls r0, 1
strh r0, [r5, 0x8]
movs r3, 0xC
ldrsh r0, [r5, r3]
movs r1, 0xC
bl __modsi3
lsls r0, 16
asrs r0, 16
lsls r4, r0, 4
subs r4, r0
lsls r4, 1
movs r1, 0xE
ldrsh r0, [r5, r1]
movs r1, 0xA
bl __divsi3
lsls r0, 16
asrs r0, 16
lsls r1, r0, 2
adds r1, r0
adds r4, r1
strh r4, [r5, 0xA]
ldr r2, =gMain
ldrh r0, [r2, 0x2E]
movs r3, 0x1
adds r1, r3, 0
ands r1, r0
cmp r1, 0
beq _08134D70
ldr r0, =sub_8134DC4
str r0, [r5]
b _08134DBE
.pool
_08134D70:
strh r1, [r5, 0x10]
ldrh r1, [r2, 0x2C]
movs r0, 0x20
ands r0, r1
cmp r0, 0
beq _08134D7E
strh r3, [r5, 0x10]
_08134D7E:
ldrh r1, [r2, 0x2C]
movs r0, 0x10
ands r0, r1
cmp r0, 0
beq _08134D8C
movs r0, 0x2
strh r0, [r5, 0x10]
_08134D8C:
ldrh r1, [r5, 0x10]
movs r2, 0x10
ldrsh r0, [r5, r2]
cmp r0, 0
beq _08134DBC
ldrh r2, [r5, 0x14]
movs r3, 0x14
ldrsh r0, [r5, r3]
cmp r0, 0xFE
bgt _08134DA4
adds r0, r2, 0x1
strh r0, [r5, 0x14]
_08134DA4:
ldrh r0, [r5, 0x8]
lsls r1, 24
lsrs r1, 24
ldrb r2, [r5, 0x14]
bl sub_8134FFC
strh r0, [r5, 0x8]
ldrb r1, [r5, 0x10]
adds r0, r6, 0
bl sub_813504C
b _08134DBE
_08134DBC:
strh r0, [r5, 0x14]
_08134DBE:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_8134CE8
thumb_func_start sub_8134DC4
sub_8134DC4: @ 8134DC4
push {r4,r5,lr}

View File

@ -1,9 +0,0 @@
@ the fourth big chunk of data
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
gUnknown_085B22D0:: @ 85B22D0
.incbin "baserom.gba", 0x5b22d0, 0x2d0

View File

@ -427,7 +427,6 @@ SECTIONS {
data/data4.o(.rodata);
data/starter_choose.o(.rodata);
src/wallclock.o(.rodata);
data/wallclock.o(.rodata);
data/data4c.o(.rodata);
src/battle_controller_link_partner.o(.rodata);
src/battle_message.o(.rodata);

View File

@ -21,9 +21,13 @@
// static declarations
void sub_8134C9C(void);
void sub_8134CB8(u8 taskId);
static void sub_8134C9C(void);
static void sub_8134CB8(u8 taskId);
void sub_8134DC4(u8 taskId);
void sub_8134CE8(u8 taskId);
void sub_8134F10(u8 taskId);
u16 sub_8134FFC(u16 a0, u8 a1, u8 a2);
void sub_813504C(u8 taskId, u8 a1);
void sub_8135130(u8 taskId);
void sub_81351AC(struct Sprite *sprite);
void sub_8135244(struct Sprite *sprite);
@ -145,6 +149,368 @@ const struct SpriteTemplate gUnknown_085B22B8 = {
gDummySpriteAffineAnimTable,
sub_8135380
};
const s8 gUnknown_085B22D0[][2] = {
{ 0x00, -0x18},
{ 0x01, -0x19},
{ 0x01, -0x19},
{ 0x02, -0x19},
{ 0x02, -0x19},
{ 0x02, -0x19},
{ 0x03, -0x18},
{ 0x03, -0x19},
{ 0x04, -0x19},
{ 0x04, -0x19},
{ 0x04, -0x19},
{ 0x05, -0x19},
{ 0x05, -0x19},
{ 0x06, -0x18},
{ 0x06, -0x18},
{ 0x06, -0x18},
{ 0x07, -0x18},
{ 0x07, -0x18},
{ 0x07, -0x18},
{ 0x08, -0x18},
{ 0x08, -0x18},
{ 0x09, -0x18},
{ 0x09, -0x18},
{ 0x0a, -0x17},
{ 0x0a, -0x17},
{ 0x0b, -0x16},
{ 0x0b, -0x16},
{ 0x0b, -0x16},
{ 0x0c, -0x16},
{ 0x0c, -0x15},
{ 0x0d, -0x15},
{ 0x0d, -0x15},
{ 0x0d, -0x15},
{ 0x0e, -0x15},
{ 0x0e, -0x15},
{ 0x0e, -0x14},
{ 0x0e, -0x14},
{ 0x0f, -0x14},
{ 0x0f, -0x13},
{ 0x10, -0x13},
{ 0x10, -0x13},
{ 0x10, -0x13},
{ 0x10, -0x12},
{ 0x10, -0x12},
{ 0x11, -0x12},
{ 0x11, -0x11},
{ 0x11, -0x11},
{ 0x12, -0x11},
{ 0x12, -0x11},
{ 0x12, -0x10},
{ 0x12, -0x10},
{ 0x13, -0x10},
{ 0x13, -0x0f},
{ 0x13, -0x0f},
{ 0x14, -0x0f},
{ 0x14, -0x0e},
{ 0x14, -0x0e},
{ 0x14, -0x0d},
{ 0x14, -0x0d},
{ 0x15, -0x0d},
{ 0x15, -0x0d},
{ 0x15, -0x0c},
{ 0x16, -0x0c},
{ 0x16, -0x0c},
{ 0x16, -0x0b},
{ 0x16, -0x0b},
{ 0x16, -0x0a},
{ 0x17, -0x0a},
{ 0x17, -0x09},
{ 0x17, -0x09},
{ 0x17, -0x09},
{ 0x17, -0x09},
{ 0x17, -0x08},
{ 0x17, -0x08},
{ 0x17, -0x07},
{ 0x17, -0x07},
{ 0x17, -0x06},
{ 0x18, -0x06},
{ 0x18, -0x06},
{ 0x19, -0x05},
{ 0x19, -0x05},
{ 0x18, -0x04},
{ 0x19, -0x04},
{ 0x18, -0x03},
{ 0x19, -0x03},
{ 0x19, -0x03},
{ 0x19, -0x02},
{ 0x19, -0x02},
{ 0x18, -0x01},
{ 0x19, -0x01},
{ 0x18, 0x00},
{ 0x18, 0x00},
{ 0x18, 0x00},
{ 0x18, 0x01},
{ 0x18, 0x01},
{ 0x19, 0x02},
{ 0x18, 0x02},
{ 0x19, 0x02},
{ 0x18, 0x03},
{ 0x18, 0x03},
{ 0x19, 0x04},
{ 0x18, 0x04},
{ 0x18, 0x05},
{ 0x18, 0x05},
{ 0x18, 0x05},
{ 0x18, 0x06},
{ 0x17, 0x06},
{ 0x17, 0x06},
{ 0x17, 0x07},
{ 0x17, 0x08},
{ 0x17, 0x08},
{ 0x17, 0x08},
{ 0x17, 0x09},
{ 0x17, 0x09},
{ 0x17, 0x0a},
{ 0x16, 0x0a},
{ 0x16, 0x0a},
{ 0x16, 0x0b},
{ 0x16, 0x0b},
{ 0x16, 0x0b},
{ 0x16, 0x0c},
{ 0x15, 0x0c},
{ 0x15, 0x0c},
{ 0x15, 0x0d},
{ 0x14, 0x0d},
{ 0x14, 0x0d},
{ 0x13, 0x0d},
{ 0x13, 0x0d},
{ 0x13, 0x0e},
{ 0x13, 0x0e},
{ 0x13, 0x0f},
{ 0x13, 0x0f},
{ 0x12, 0x0f},
{ 0x12, 0x10},
{ 0x11, 0x10},
{ 0x11, 0x10},
{ 0x11, 0x11},
{ 0x11, 0x11},
{ 0x10, 0x11},
{ 0x10, 0x12},
{ 0x10, 0x12},
{ 0x0f, 0x12},
{ 0x0e, 0x12},
{ 0x0f, 0x13},
{ 0x0e, 0x13},
{ 0x0e, 0x13},
{ 0x0d, 0x13},
{ 0x0d, 0x14},
{ 0x0d, 0x14},
{ 0x0d, 0x14},
{ 0x0c, 0x14},
{ 0x0c, 0x14},
{ 0x0c, 0x15},
{ 0x0b, 0x15},
{ 0x0b, 0x15},
{ 0x0b, 0x15},
{ 0x0a, 0x15},
{ 0x0a, 0x16},
{ 0x0a, 0x16},
{ 0x09, 0x16},
{ 0x09, 0x16},
{ 0x08, 0x16},
{ 0x07, 0x16},
{ 0x07, 0x17},
{ 0x07, 0x17},
{ 0x06, 0x17},
{ 0x06, 0x17},
{ 0x05, 0x17},
{ 0x05, 0x17},
{ 0x05, 0x18},
{ 0x04, 0x18},
{ 0x04, 0x18},
{ 0x04, 0x18},
{ 0x03, 0x18},
{ 0x02, 0x18},
{ 0x02, 0x18},
{ 0x01, 0x18},
{ 0x01, 0x18},
{ 0x00, 0x18},
{ 0x00, 0x18},
{-0x01, 0x17},
{ 0x00, 0x18},
{ 0x00, 0x18},
{-0x01, 0x18},
{-0x01, 0x18},
{-0x02, 0x18},
{-0x02, 0x18},
{-0x03, 0x18},
{-0x03, 0x18},
{-0x04, 0x18},
{-0x04, 0x18},
{-0x05, 0x18},
{-0x05, 0x17},
{-0x05, 0x17},
{-0x06, 0x17},
{-0x06, 0x17},
{-0x07, 0x17},
{-0x07, 0x17},
{-0x07, 0x17},
{-0x08, 0x17},
{-0x08, 0x16},
{-0x09, 0x16},
{-0x09, 0x16},
{-0x0a, 0x16},
{-0x0a, 0x16},
{-0x0a, 0x15},
{-0x0b, 0x15},
{-0x0b, 0x15},
{-0x0b, 0x15},
{-0x0b, 0x14},
{-0x0c, 0x14},
{-0x0c, 0x14},
{-0x0d, 0x14},
{-0x0d, 0x14},
{-0x0d, 0x13},
{-0x0e, 0x13},
{-0x0e, 0x13},
{-0x0e, 0x13},
{-0x0e, 0x12},
{-0x0f, 0x12},
{-0x0f, 0x12},
{-0x0f, 0x11},
{-0x10, 0x11},
{-0x10, 0x11},
{-0x11, 0x11},
{-0x11, 0x10},
{-0x11, 0x10},
{-0x12, 0x10},
{-0x11, 0x0f},
{-0x12, 0x0f},
{-0x12, 0x0f},
{-0x13, 0x0f},
{-0x13, 0x0e},
{-0x13, 0x0e},
{-0x13, 0x0d},
{-0x13, 0x0d},
{-0x14, 0x0d},
{-0x14, 0x0c},
{-0x14, 0x0c},
{-0x15, 0x0c},
{-0x15, 0x0c},
{-0x15, 0x0b},
{-0x15, 0x0b},
{-0x15, 0x0a},
{-0x15, 0x0a},
{-0x15, 0x09},
{-0x16, 0x09},
{-0x16, 0x09},
{-0x16, 0x08},
{-0x16, 0x08},
{-0x16, 0x07},
{-0x17, 0x07},
{-0x17, 0x07},
{-0x17, 0x06},
{-0x17, 0x06},
{-0x17, 0x05},
{-0x18, 0x05},
{-0x17, 0x04},
{-0x17, 0x04},
{-0x18, 0x04},
{-0x18, 0x04},
{-0x18, 0x03},
{-0x18, 0x03},
{-0x18, 0x02},
{-0x18, 0x02},
{-0x18, 0x01},
{-0x18, 0x01},
{-0x18, 0x01},
{-0x18, 0x00},
{-0x19, 0x00},
{-0x18, -0x01},
{-0x19, -0x01},
{-0x18, -0x01},
{-0x18, -0x02},
{-0x18, -0x02},
{-0x18, -0x03},
{-0x18, -0x03},
{-0x18, -0x04},
{-0x18, -0x04},
{-0x18, -0x04},
{-0x18, -0x05},
{-0x18, -0x05},
{-0x18, -0x06},
{-0x18, -0x06},
{-0x17, -0x06},
{-0x17, -0x07},
{-0x17, -0x07},
{-0x17, -0x08},
{-0x17, -0x08},
{-0x17, -0x09},
{-0x17, -0x09},
{-0x16, -0x09},
{-0x16, -0x09},
{-0x16, -0x0a},
{-0x16, -0x0a},
{-0x15, -0x0a},
{-0x15, -0x0b},
{-0x16, -0x0b},
{-0x16, -0x0c},
{-0x15, -0x0c},
{-0x15, -0x0d},
{-0x15, -0x0d},
{-0x14, -0x0d},
{-0x15, -0x0e},
{-0x14, -0x0e},
{-0x14, -0x0e},
{-0x13, -0x0e},
{-0x13, -0x0f},
{-0x13, -0x0f},
{-0x12, -0x10},
{-0x12, -0x10},
{-0x12, -0x10},
{-0x12, -0x11},
{-0x12, -0x11},
{-0x11, -0x11},
{-0x11, -0x12},
{-0x11, -0x12},
{-0x10, -0x12},
{-0x10, -0x12},
{-0x10, -0x13},
{-0x10, -0x13},
{-0x0f, -0x13},
{-0x0f, -0x13},
{-0x0f, -0x14},
{-0x0e, -0x14},
{-0x0e, -0x14},
{-0x0e, -0x15},
{-0x0d, -0x15},
{-0x0d, -0x15},
{-0x0d, -0x15},
{-0x0c, -0x15},
{-0x0c, -0x16},
{-0x0b, -0x16},
{-0x0b, -0x16},
{-0x0b, -0x16},
{-0x0a, -0x16},
{-0x0a, -0x16},
{-0x09, -0x16},
{-0x09, -0x17},
{-0x09, -0x17},
{-0x08, -0x17},
{-0x08, -0x17},
{-0x07, -0x17},
{-0x07, -0x17},
{-0x07, -0x18},
{-0x06, -0x18},
{-0x06, -0x18},
{-0x05, -0x18},
{-0x05, -0x18},
{-0x04, -0x18},
{-0x04, -0x18},
{-0x04, -0x18},
{-0x04, -0x19},
{-0x03, -0x19},
{-0x02, -0x19},
{-0x02, -0x18},
{-0x02, -0x18},
{-0x01, -0x19},
{-0x01, -0x19},
{ 0x00, -0x19}
};
// text
@ -290,3 +656,62 @@ void Cb2_ViewWallClock(void)
PutWindowTilemap(1);
schedule_bg_copy_tilemap_to_vram(2);
}
static void sub_8134C9C(void)
{
RunTasks();
AnimateSprites();
BuildOamBuffer();
do_scheduled_bg_tilemap_copies_to_vram();
UpdatePaletteFade();
}
static void sub_8134CB8(u8 taskId)
{
if (!gPaletteFade.active)
{
gTasks[taskId].func = sub_8134CE8;
}
}
void sub_8134CE8(u8 taskId)
{
if (gTasks[taskId].data[0] % 6)
{
gTasks[taskId].data[0] = sub_8134FFC(gTasks[taskId].data[0], gTasks[taskId].data[4], gTasks[taskId].data[6]);
}
else
{
gTasks[taskId].data[0] = gTasks[taskId].data[3] * 6;
gTasks[taskId].data[1] = (gTasks[taskId].data[2] % 12) * 30 + (gTasks[taskId].data[3] / 10) * 5;
if (gMain.newKeys & A_BUTTON)
{
gTasks[taskId].func = sub_8134DC4;
}
else
{
gTasks[taskId].data[4] = 0;
if (gMain.heldKeys & DPAD_LEFT)
{
gTasks[taskId].data[4] = 1;
}
if (gMain.heldKeys & DPAD_RIGHT)
{
gTasks[taskId].data[4] = 2;
}
if (gTasks[taskId].data[4] != 0)
{
if (gTasks[taskId].data[6] <= 0xFE)
{
gTasks[taskId].data[6]++;
}
gTasks[taskId].data[0] = sub_8134FFC(gTasks[taskId].data[0], gTasks[taskId].data[4], gTasks[taskId].data[6]);
sub_813504C(taskId, gTasks[taskId].data[4]);
}
else
{
gTasks[taskId].data[6] = 0;
}
}
}
}