sub_81BF7E8

This commit is contained in:
scnorton 2017-09-18 14:04:00 -04:00
parent 097a38f054
commit 39e6bdf094
3 changed files with 36 additions and 97 deletions

View File

@ -5,102 +5,6 @@
.text
thumb_func_start sub_81BF7E8
sub_81BF7E8: @ 81BF7E8
push {r4-r6,lr}
sub sp, 0xC
adds r6, r0, 0
movs r0, 0x20
str r0, [sp]
str r0, [sp, 0x4]
movs r0, 0
movs r1, 0
movs r2, 0
movs r3, 0
bl FillBgTilemapBufferRect_Palette0
movs r0, 0x1
movs r1, 0xAA
bl FillWindowPixelBuffer
ldr r0, =gUnknown_08618158
str r0, [sp]
movs r0, 0x1
negs r0, r0
str r0, [sp, 0x4]
ldr r0, =gUnknown_08618160
lsls r4, r6, 2
adds r0, r4, r0
ldr r0, [r0]
str r0, [sp, 0x8]
movs r0, 0x1
movs r1, 0x1
movs r2, 0
movs r3, 0
bl box_print
movs r0, 0x1
bl PutWindowTilemap
movs r0, 0x1
movs r1, 0x2
bl CopyWindowToVram
cmp r6, 0x5
bhi _081BF87E
ldr r0, =_081BF850
adds r0, r4, r0
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_081BF850:
.4byte _081BF868
.4byte _081BF870
.4byte _081BF868
.4byte _081BF868
.4byte _081BF868
.4byte _081BF878
_081BF868:
movs r0, 0x2
bl PutWindowTilemap
b _081BF87E
_081BF870:
movs r0, 0x3
bl PutWindowTilemap
b _081BF87E
_081BF878:
movs r0, 0
bl PutWindowTilemap
_081BF87E:
movs r0, 0
bl CopyBgTilemapBufferToVram
ldr r5, =gUnknown_08618178
lsls r4, r6, 1
adds r4, r6
lsls r4, 2
adds r0, r4, r5
ldr r0, [r0]
ldr r1, =0x06004000
bl LZ77UnCompVram
adds r0, r5, 0x4
adds r0, r4, r0
ldr r0, [r0]
ldr r1, =0x0600f800
bl LZ77UnCompVram
adds r5, 0x8
adds r4, r5
ldr r0, [r4]
movs r1, 0xA0
lsls r1, 19
ldr r2, =0x04000040
bl CpuSet
movs r0, 0
bl ShowBg
movs r0, 0x1
bl ShowBg
add sp, 0xC
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BF7E8
thumb_func_start sub_81BF8D8
sub_81BF8D8: @ 81BF8D8
push {lr}

View File

@ -15,5 +15,9 @@ void ResetBgsAndClearDma3BusyFlags(u32);
void InitBgsFromTemplates(u8, const struct BgTemplate *, u8);
u32 ChangeBgX(u8, u32, u8);
u32 ChangeBgY(u8, u32, u8);
void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height);
void ShowBg(u8);
void HideBg(u8);
void CopyBgTilemapBufferToVram(u8);
#endif //GUARD_bg_H

View File

@ -31,7 +31,7 @@ extern berryfix_t *gUnknown_030012B8;
static void sub_81BF3DC(void);
static void sub_81BF5A4(void);
static int sub_81BF7A4(int);
void sub_81BF7E8(int);
static void sub_81BF7E8(int);
void sub_81BF8D8(int);
// .rodata
@ -48,6 +48,8 @@ extern const struct WindowTemplate gUnknown_08618110[7];
extern const u16 gUnknown_08618138[16];
extern const u8 gUnknown_08618158[3];
extern const u8 gUnknown_0861815B[3];
extern const u8 *const gUnknown_08618160[6];
extern const u8 *const gUnknown_08618178[6][3];
// .text
@ -454,3 +456,32 @@ __attribute__((naked)) static int sub_81BF7A4(int checkval)
}
#endif
static void sub_81BF7E8(int scene)
{
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
FillWindowPixelBuffer(1, 0xAA);
box_print(1, 1, 0, 0, gUnknown_08618158, -1, gUnknown_08618160[scene]);
PutWindowTilemap(1);
CopyWindowToVram(1, 2);
switch (scene)
{
case 0:
case 2:
case 3:
case 4:
PutWindowTilemap(2);
break;
case 1:
PutWindowTilemap(3);
break;
case 5:
PutWindowTilemap(0);
break;
}
CopyBgTilemapBufferToVram(0);
LZ77UnCompVram(gUnknown_08618178[scene][0], (void *)BG_CHAR_ADDR(1));
LZ77UnCompVram(gUnknown_08618178[scene][1], (void *)BG_SCREEN_ADDR(31));
CpuCopy32(gUnknown_08618178[scene][2], (void *)BG_PLTT, 0x100);
ShowBg(0);
ShowBg(1);
}