sub_8146288

This commit is contained in:
PikalaxALT
2018-12-02 17:25:59 -05:00
parent 39a9e186e0
commit 5151db6054
4 changed files with 55 additions and 62 deletions
-50
View File
@@ -5,56 +5,6 @@
.text
@ file boundary maybe
thumb_func_start sub_8146288
sub_8146288: @ 8146288
push {r4-r6,lr}
adds r4, r0, 0
cmp r4, 0
beq _0814629E
ldr r5, =gUnknown_203F3CC
ldr r0, =0x000013a4
bl AllocZeroed
str r0, [r5]
cmp r0, 0
bne _081462AC
_0814629E:
movs r0, 0
b _081462DC
.pool
_081462AC:
movs r6, 0xDE
lsls r6, 1
adds r1, r4, 0
adds r2, r6, 0
bl memcpy
ldr r1, [r5]
ldrb r0, [r1, 0x3]
cmp r0, 0x7
bls _081462C4
movs r0, 0
strb r0, [r1, 0x3]
_081462C4:
ldr r2, [r5]
adds r3, r2, r6
ldrb r0, [r2, 0x3]
lsls r0, 4
ldr r1, =gUnknown_8468720
adds r0, r1
str r0, [r3]
ldr r0, =0x000001c1
adds r1, r2, r0
movs r0, 0xFF
strb r0, [r1]
movs r0, 0x1
_081462DC:
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end sub_8146288
thumb_func_start sub_81462EC
sub_81462EC: @ 81462EC
push {r4,lr}
+13 -3
View File
@@ -3,14 +3,24 @@
.section .rodata
.macro window_template bg, left, top, width, height, pal, baseTile
.byte \bg, \left, \top, \width, \height, \pal
.2byte \baseTile
.endm
gUnknown_8468038:: @ 8468038
.incbin "baserom.gba", 0x468038, 0x8
.byte 0x00, 0x02, 0x03
.byte 0x00, 0x01, 0x02
.align 2
gUnknown_8468040:: @ 8468040
.incbin "baserom.gba", 0x468040, 0x10
window_template 0x00, 0x01, 0x00, 0x1c, 0x03, 0x0f, 0x0000
window_template 0x02, 0x01, 0x03, 0x1c, 0x14, 0x0f, 0x0000
.align 2
gUnknown_8468050:: @ 8468050
.incbin "baserom.gba", 0x468050, 0x10
.byte 0x02, 0xe8, 0x18, 0x03, 0xe8, 0x98
.2byte 0x0000, 0x0002, 0x1000, 0x1000, 0x0000
gUnknown_8468060::
.incbin "baserom.gba", 0x468060, 0x20
+1
View File
@@ -599,6 +599,7 @@ struct MEventBuffer_3120_Sub
{
u16 unk_00;
u8 unk_02;
u8 unk_03;
u8 filler_04[440];
};
+41 -9
View File
@@ -48,13 +48,7 @@ struct UnkStruct_203F3C8
/*045C*/ u8 buffer_045C[0x1000];
};
struct UnkStruct_203F3CC
{
/*0000*/ u8 filler_0000[0x13a4];
};
EWRAM_DATA struct UnkStruct_203F3C8 * gUnknown_203F3C8 = NULL;
EWRAM_DATA struct UnkStruct_203F3CC * gUnknown_203F3CC = NULL;
void sub_8145A98(void);
void sub_8145D18(u8 whichWindow);
@@ -138,11 +132,11 @@ bool32 sub_8145654(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_S
return FALSE;
gUnknown_203F3C8->unk_0000 = *r5;
gUnknown_203F3C8->unk_014C = *r6;
if (gUnknown_203F3C8->unk_0000.unk_08_2 > 7)
if (gUnknown_203F3C8->unk_0000.unk_08_2 >= NELEMS(gUnknown_8467FB8))
gUnknown_203F3C8->unk_0000.unk_08_2 = 0;
if (gUnknown_203F3C8->unk_0000.unk_08_0 > 2)
if (gUnknown_203F3C8->unk_0000.unk_08_0 >= NELEMS(gUnknown_8467070))
gUnknown_203F3C8->unk_0000.unk_08_0 = 0;
if (gUnknown_203F3C8->unk_0000.unk_09 > 7)
if (gUnknown_203F3C8->unk_0000.unk_09 > NELEMS(gUnknown_203F3C8->unk_017D))
gUnknown_203F3C8->unk_0000.unk_09 = 0;
gUnknown_203F3C8->unk_0170 = &gUnknown_8467FB8[gUnknown_203F3C8->unk_0000.unk_08_2];
return TRUE;
@@ -445,3 +439,41 @@ void sub_81461D8(void)
FreeSpritePaletteByTag(0x8000);
}
}
struct UnkStruct_8468720
{
u8 unk0;
const void * unk4;
const void * unk8;
const void * unkC;
};
struct UnkStruct_203F3CC
{
/*0000*/ struct MEventBuffer_3120_Sub unk_0000;
/*01bc*/ const struct UnkStruct_8468720 * unk_01BC;
/*01c0*/ u8 unk_01C0;
/*01c1*/ u8 unk_01C1;
/*01c2*/ u8 filler_01C2[0x11e2];
};
EWRAM_DATA struct UnkStruct_203F3CC * gUnknown_203F3CC = NULL;
extern const struct TextColor gUnknown_8468038[2];
extern const struct UnkStruct_8468720 gUnknown_8468720[8];
extern const struct ScrollIndicatorArrowPairTemplate gUnknown_8468050;
bool32 sub_8146288(const struct MEventBuffer_3120_Sub * a0)
{
if (a0 == NULL)
return FALSE;
gUnknown_203F3CC = AllocZeroed(sizeof(struct UnkStruct_203F3CC));
if (gUnknown_203F3CC == NULL)
return FALSE;
gUnknown_203F3CC->unk_0000 = *a0;
if (gUnknown_203F3CC->unk_0000.unk_03 >= NELEMS(gUnknown_8468720))
gUnknown_203F3CC->unk_0000.unk_03 = 0;
gUnknown_203F3CC->unk_01BC = &gUnknown_8468720[gUnknown_203F3CC->unk_0000.unk_03];
gUnknown_203F3CC->unk_01C1 = 0xFF;
return TRUE;
}