sub_814571C and associated graphics dump

This commit is contained in:
PikalaxALT 2018-12-02 11:42:45 -05:00
parent 993df493cd
commit 8f0f725039
22 changed files with 268 additions and 263 deletions

View File

@ -5,247 +5,6 @@
.text
thumb_func_start sub_814571C
sub_814571C: @ 814571C
push {r4-r6,lr}
sub sp, 0x24
ldr r5, =gUnknown_203F3C8
ldr r0, [r5]
cmp r0, 0
bne _08145734
movs r0, 0x1
negs r0, r0
b _08145930
.pool
_08145734:
movs r4, 0xBA
lsls r4, 1
adds r0, r4
ldrb r0, [r0]
cmp r0, 0x7
bls _08145742
b _08145908
_08145742:
lsls r0, 2
ldr r1, =_08145750
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_08145750:
.4byte _08145770
.4byte _08145782
.4byte _08145790
.4byte _08145834
.4byte _081458AC
.4byte _081458B2
.4byte _081458CC
.4byte _081458D2
_08145770:
movs r0, 0x1
negs r0, r0
movs r1, 0
str r1, [sp]
movs r2, 0
movs r3, 0x10
bl BeginNormalPaletteFade
b _0814591E
_08145782:
bl UpdatePaletteFade
lsls r0, 24
cmp r0, 0
bne _0814578E
b _0814591E
_0814578E:
b _0814592E
_08145790:
movs r5, 0x1E
str r5, [sp]
movs r4, 0x14
str r4, [sp, 0x4]
movs r0, 0
movs r1, 0
movs r2, 0
movs r3, 0
bl FillBgTilemapBufferRect_Palette0
str r5, [sp]
str r4, [sp, 0x4]
movs r0, 0x1
movs r1, 0
movs r2, 0
movs r3, 0
bl FillBgTilemapBufferRect_Palette0
str r5, [sp]
str r4, [sp, 0x4]
movs r0, 0x2
movs r1, 0
movs r2, 0
movs r3, 0
bl FillBgTilemapBufferRect_Palette0
movs r0, 0
bl CopyBgTilemapBufferToVram
movs r0, 0x1
bl CopyBgTilemapBufferToVram
movs r0, 0x2
bl CopyBgTilemapBufferToVram
ldr r5, =gUnknown_203F3C8
ldr r0, [r5]
movs r1, 0xB8
lsls r1, 1
adds r0, r1
ldr r0, [r0]
ldr r1, [r0, 0x4]
movs r0, 0
str r0, [sp]
movs r0, 0x2
movs r2, 0
movs r3, 0x8
bl decompress_and_copy_tile_data_to_vram
ldr r4, =gUnknown_8467074
adds r0, r4, 0
bl AddWindow
ldr r1, [r5]
movs r2, 0xBB
lsls r2, 1
adds r1, r2
strh r0, [r1]
adds r0, r4, 0
adds r0, 0x8
bl AddWindow
ldr r1, [r5]
movs r2, 0xBC
lsls r2, 1
adds r1, r2
strh r0, [r1]
adds r4, 0x10
adds r0, r4, 0
bl AddWindow
ldr r1, [r5]
movs r2, 0xBD
lsls r2, 1
adds r1, r2
strh r0, [r1]
b _0814591E
.pool
_08145834:
bl free_temp_tile_data_buffers_if_possible
lsls r0, 24
lsrs r6, r0, 24
cmp r6, 0
bne _0814592E
ldr r2, =gPaletteFade
ldrb r0, [r2, 0x8]
movs r1, 0x80
orrs r0, r1
strb r0, [r2, 0x8]
ldr r5, =gUnknown_203F3C8
ldr r0, [r5]
movs r4, 0xB8
lsls r4, 1
adds r0, r4
ldr r0, [r0]
ldr r0, [r0, 0xC]
movs r1, 0x10
movs r2, 0x20
bl LoadPalette
ldr r1, [r5]
adds r4, r1, r4
ldr r0, [r4]
ldr r0, [r0, 0x8]
ldr r4, =0x0000045c
adds r1, r4
bl LZ77UnCompWram
ldr r1, [r5]
adds r1, r4
movs r2, 0x1E
str r2, [sp]
movs r0, 0x14
str r0, [sp, 0x4]
str r6, [sp, 0x8]
str r6, [sp, 0xC]
str r2, [sp, 0x10]
str r0, [sp, 0x14]
movs r0, 0x1
str r0, [sp, 0x18]
movs r0, 0x8
str r0, [sp, 0x1C]
str r6, [sp, 0x20]
movs r0, 0x2
movs r2, 0
movs r3, 0
bl CopyRectToBgTilemapBufferRect
movs r0, 0x2
bl CopyBgTilemapBufferToVram
b _0814591E
.pool
_081458AC:
bl sub_8145A98
b _0814591E
_081458B2:
movs r0, 0
bl sub_8145D18
movs r0, 0x1
bl sub_8145D18
movs r0, 0x2
bl sub_8145D18
movs r0, 0x1
bl CopyBgTilemapBufferToVram
b _0814591E
_081458CC:
bl sub_809707C
b _0814591E
_081458D2:
movs r0, 0x1
bl ShowBg
movs r0, 0x2
bl ShowBg
ldr r2, =gPaletteFade
ldrb r1, [r2, 0x8]
movs r0, 0x7F
ands r0, r1
strb r0, [r2, 0x8]
bl sub_8146060
movs r0, 0x1
negs r0, r0
movs r1, 0
str r1, [sp]
movs r2, 0x10
movs r3, 0
bl BeginNormalPaletteFade
bl UpdatePaletteFade
b _0814591E
.pool
_08145908:
bl UpdatePaletteFade
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
bne _0814592E
ldr r0, [r5]
adds r0, r4
strb r1, [r0]
movs r0, 0x1
b _08145930
_0814591E:
ldr r0, =gUnknown_203F3C8
ldr r1, [r0]
movs r0, 0xBA
lsls r0, 1
adds r1, r0
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
_0814592E:
movs r0, 0
_08145930:
add sp, 0x24
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end sub_814571C
thumb_func_start sub_814593C
sub_814593C: @ 814593C
push {r4,r5,lr}

View File

@ -25,58 +25,71 @@ gUnknown_8467074:: @ 8467074
.2byte 0x0130
gUnknown_846708C::
.incbin "baserom.gba", 0x46708c, 0x20
.incbin "data/graphics/mevent/pal_46708C.gbapal"
gUnknown_84670AC::
.incbin "baserom.gba", 0x4670ac, 0x20
.incbin "data/graphics/mevent/pal_4670AC.gbapal"
gUnknown_84670CC::
.incbin "baserom.gba", 0x4670cc, 0x20
.incbin "data/graphics/mevent/pal_4670CC.gbapal"
gUnknown_84670EC::
.incbin "baserom.gba", 0x4670ec, 0x20
.incbin "data/graphics/mevent/pal_4670EC.gbapal"
gUnknown_846710C::
.incbin "baserom.gba", 0x46710c, 0x20
.incbin "data/graphics/mevent/pal_46710C.gbapal"
gUnknown_846712C::
.incbin "baserom.gba", 0x46712c, 0x20
.incbin "data/graphics/mevent/pal_46712C.gbapal"
gUnknown_846714C::
.incbin "baserom.gba", 0x46714c, 0x20
.incbin "data/graphics/mevent/pal_46714C.gbapal"
gUnknown_846716C::
.incbin "baserom.gba", 0x46716c, 0x20
.incbin "data/graphics/mevent/pal_46716C.gbapal"
.align 2
gUnknown_846718C::
.incbin "baserom.gba", 0x46718c, 0xFC
.incbin "data/graphics/mevent/gfx_46718C.4bpp.lz"
.align 2
gUnknown_8467288::
.incbin "baserom.gba", 0x467288, 0xF4
.incbin "data/graphics/mevent/tilemap_467288.bin.lz"
.align 2
gUnknown_846737C::
.incbin "baserom.gba", 0x46737c, 0xF4
.incbin "data/graphics/mevent/gfx_46737C.4bpp.lz"
.align 2
gUnknown_8467470::
.incbin "baserom.gba", 0x467470, 0xE8
.incbin "data/graphics/mevent/tilemap_467470.bin.lz"
.align 2
gUnknown_8467558::
.incbin "baserom.gba", 0x467558, 0xD4
.incbin "data/graphics/mevent/gfx_467558.4bpp.lz"
.align 2
gUnknown_846762C::
.incbin "baserom.gba", 0x46762c, 0xD4
.incbin "data/graphics/mevent/tilemap_46762C.bin.lz"
.align 2
gUnknown_8467700::
.incbin "baserom.gba", 0x467700, 0x234
.incbin "data/graphics/mevent/gfx_467700.4bpp.lz"
.align 2
gUnknown_8467934::
.incbin "baserom.gba", 0x467934, 0x148
.incbin "data/graphics/mevent/tilemap_467934.bin.lz"
.align 2
gUnknown_8467A7C::
.incbin "baserom.gba", 0x467a7c, 0x230
.incbin "data/graphics/mevent/gfx_467A7C.4bpp.lz"
.align 2
gUnknown_8467CAC::
.incbin "baserom.gba", 0x467cac, 0x2AC
.incbin "data/graphics/mevent/tilemap_467CAC.bin.lz"
gUnknown_8467DF4::
.incbin "baserom.gba", 0x467DF4, 0x164
gUnknown_8467F58:: @ 8467F58
.incbin "baserom.gba", 0x467F58, 0x8

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
90 197 148
213 213 213
74 74 74
98 106 106
213 189 74
238 213 82
246 246 213
255 255 255
230 230 213
238 238 213
255 0 255
255 0 255
255 0 255
255 0 255
255 0 255
255 0 255

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
90 197 148
82 82 106
131 131 139
197 189 213
205 230 255
115 139 197
49 74 82
0 0 0
0 0 0
222 255 246
197 255 222
222 238 255
156 180 222
156 106 115
172 139 164
255 255 255

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
90 197 148
82 82 106
131 131 139
164 156 172
197 189 213
246 238 255
255 0 255
255 0 255
255 0 255
255 0 255
255 230 230
255 197 197
255 164 164
246 139 139
238 90 90
255 255 255

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
90 197 148
82 82 106
131 131 139
164 156 172
197 189 213
246 238 255
255 0 255
255 0 255
255 0 255
255 0 255
238 255 230
213 255 189
189 230 156
164 213 131
148 197 106
255 255 255

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
90 197 148
82 82 106
131 131 139
164 156 172
197 189 213
246 238 255
255 0 255
255 0 255
255 0 255
255 0 255
238 246 255
205 238 246
180 222 246
156 197 238
115 156 197
255 255 255

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
90 197 148
82 82 106
131 131 139
164 156 172
197 189 213
246 238 255
255 0 255
255 0 255
255 0 255
255 0 255
238 238 197
230 230 139
222 222 115
213 213 90
189 189 57
255 255 255

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
189 123 148
213 213 213
74 74 74
115 123 123
164 156 90
164 148 90
197 197 90
213 205 90
222 213 90
213 213 106
238 246 98
230 222 98
213 205 98
197 180 98
238 230 98
246 238 106

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
189 123 148
213 213 213
74 74 74
115 123 123
156 156 156
139 139 148
180 180 197
197 189 205
205 205 222
189 189 189
197 230 222
189 213 213
180 197 197
156 164 172
222 222 230
230 230 238

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -10,5 +10,6 @@ void sub_80D2F68(u16 iconId);
u8 sub_80D2D78(u16 iconId, void callback(struct Sprite *), u16 x, u16 y, u16 a4, u8 a5);
void sub_80D2FF0(u16 iconId);
void sub_80D2EF8(struct Sprite *sprite);
void sub_809707C(void);
#endif // GUARD_POKEMON_ICON_H

View File

@ -1,13 +1,18 @@
#include "global.h"
#include "bg.h"
#include "palette.h"
#include "decompress.h"
#include "malloc.h"
#include "menu.h"
#include "pokemon_icon.h"
#include "mevent.h"
struct UnkStruct_8467FB8
{
u16 ident;
const void * unk_04;
const void * unk_08;
const void * unk_0C;
const u8 * tiles;
const u8 * map;
const u16 * pal;
};
struct UnkStruct_203F3C8
@ -15,11 +20,22 @@ struct UnkStruct_203F3C8
/*0000*/ struct MEventBuffer_32E0_Sub unk_0000;
/*014c*/ struct MEventBuffer_3430_Sub unk_014c;
/*0170*/ const struct UnkStruct_8467FB8 * unk_0170;
/*0174*/ u8 filler_0174[0x12E8];
/*0174*/ u8 unk_0174;
/*0176*/ u16 unk_0176;
/*0178*/ u16 unk_0178;
/*017A*/ u16 unk_017A;
/*017C*/ u8 filler_0178[0x2E0];
/*045C*/ u8 buffer_045C[0x1000];
};
EWRAM_DATA struct UnkStruct_203F3C8 * gUnknown_203F3C8 = NULL;
void sub_8145A98(void);
void sub_8145D18(u8 bgId);
void sub_8146060(void);
extern const struct WindowTemplate gUnknown_8467074[3];
extern const struct UnkStruct_8467FB8 gUnknown_8467FB8[8];
bool32 sub_8145654(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6)
@ -50,3 +66,67 @@ void sub_81456F0(void)
gUnknown_203F3C8 = NULL;
}
}
s32 sub_814571C(void)
{
if (gUnknown_203F3C8 == NULL)
return -1;
switch(gUnknown_203F3C8->unk_0174)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
break;
case 1:
if (UpdatePaletteFade())
return 0;
break;
case 2:
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);
decompress_and_copy_tile_data_to_vram(2, gUnknown_203F3C8->unk_0170->tiles, 0, 0x008, 0);
gUnknown_203F3C8->unk_0176 = AddWindow(&gUnknown_8467074[0]);
gUnknown_203F3C8->unk_0178 = AddWindow(&gUnknown_8467074[1]);
gUnknown_203F3C8->unk_017A = AddWindow(&gUnknown_8467074[2]);
break;
case 3:
if (free_temp_tile_data_buffers_if_possible())
return 0;
gPaletteFade.bufferTransferDisabled = TRUE;
LoadPalette(gUnknown_203F3C8->unk_0170->pal, 0x10, 0x20);
LZ77UnCompWram(gUnknown_203F3C8->unk_0170->map, gUnknown_203F3C8->buffer_045C);
CopyRectToBgTilemapBufferRect(2, gUnknown_203F3C8->buffer_045C, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0);
CopyBgTilemapBufferToVram(2);
break;
case 4:
sub_8145A98();
break;
case 5:
sub_8145D18(0);
sub_8145D18(1);
sub_8145D18(2);
CopyBgTilemapBufferToVram(1);
break;
case 6:
sub_809707C();
break;
case 7:
ShowBg(1);
ShowBg(2);
gPaletteFade.bufferTransferDisabled = FALSE;
sub_8146060();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
UpdatePaletteFade();
break;
default:
if (UpdatePaletteFade())
return 0;
gUnknown_203F3C8->unk_0174 = 0;
return 1;
}
++gUnknown_203F3C8->unk_0174;
return 0;
}