Document all of frontier pass

This commit is contained in:
DizzyEggg 2019-01-26 20:56:06 +01:00
parent 03549349f8
commit 01c3f3fc05
12 changed files with 763 additions and 2052 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,229 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.macro unk_trainer_card_struct text1, text2, short1, short2, short3, short4
.4byte \text1
.4byte \text2
.2byte \short1
.2byte \short2
.2byte \short3
.2byte \short4
.endm
.align 2
gUnknown_0856FB7C:: @ 856FB7C
.incbin "graphics/frontier_pass/map_heads.gbapal"
.align 2
gUnknown_0856FB9C:: @ 856FB9C
.incbin "graphics/frontier_pass/map_heads_female.gbapal"
.align 2
gUnknown_0856FBBC:: @ 856FBBC
.incbin "graphics/frontier_pass/map_screen.4bpp.lz"
.align 2
gFrontierPassCursor_Gfx:: @ 8570BA8
.incbin "graphics/frontier_pass/cursor.4bpp.lz"
.align 2
gUnknown_08570C44:: @ 8570C44
.incbin "graphics/frontier_pass/map_heads.4bpp.lz"
.align 2
gFrontierPassMapCursor_Gfx:: @ 8570D00
.incbin "graphics/frontier_pass/map_cursor.4bpp.lz"
.align 2
gUnknown_08570E00:: @ 8570E00
.incbin "graphics/frontier_pass/map_screen.bin.lz"
.align 2
gUnknown_08571060:: @ 8571060
.incbin "graphics/frontier_pass/small_map_and_card.bin.lz"
.align 2
gUnknown_08571298:: @ 8571298
.incbin "graphics/frontier_pass/unknown_571298.bin"
.align 2
gUnknown_085712C0:: @ 85712C0
.incbin "graphics/frontier_pass/record_frame.bin.lz"
.align 2
gUnknown_085712F8:: @ 85712F8
.incbin "graphics/frontier_pass/small_map_and_card_affine.bin.lz"
gUnknown_085713E0:: @ 85713E0
.2byte 0x00d8, 0x0020, 0x00d8, 0x0080
.align 2
gUnknown_085713E8:: @ 85713E8
.4byte 0x000011f8, 0x000021e1, 0x00000bd6
.align 2
gUnknown_085713F4:: @ 85713F4
.4byte 0x000001f8, 0x000011e1, 0x000021d2
.align 2
gUnknown_08571400:: @ 8571400
window_template 0x00, 0x02, 0x03, 0x0c, 0x03, 0x0f, 0x0001
window_template 0x00, 0x02, 0x0a, 0x0c, 0x03, 0x0f, 0x0026
window_template 0x00, 0x02, 0x0d, 0x0c, 0x04, 0x0f, 0x004b
window_template 0x00, 0x00, 0x12, 0x1e, 0x03, 0x0f, 0x007c
window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000
.align 2
gUnknown_08571428:: @ 8571428
window_template 0x00, 0x00, 0x01, 0x0f, 0x05, 0x0f, 0x0001
window_template 0x00, 0x14, 0x01, 0x0a, 0x0e, 0x0f, 0x004d
window_template 0x00, 0x02, 0x10, 0x1a, 0x04, 0x0f, 0x00da
window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000
gUnknown_08571448:: @ 8571448
.byte 0x00, 0x02, 0x03
gUnknown_0857144B:: @ 857144B
.byte 0x00, 0x01, 0x09
gUnknown_0857144E:: @ 857144E
.byte 0x00, 0x04, 0x05
.align 2
gUnknown_08571454:: @ 8571454
.2byte 0x001c, 0x004c, 0x0084, 0x00dc, 0x0054, 0x0084, 0x0084, 0x00dc, 0x0050, 0x0066, 0x0014, 0x006c, 0x0000, 0x0010, 0x0098, 0x00f0
.2byte 0x006c, 0x0086, 0x0014, 0x006c, 0x0018, 0x0030, 0x0014, 0x006c, 0x0032, 0x0042, 0x0014, 0x0024, 0x0042, 0x0052, 0x0020, 0x0030
.2byte 0x0032, 0x0042, 0x002c, 0x003c, 0x0042, 0x0052, 0x0038, 0x0048, 0x0032, 0x0042, 0x0044, 0x0054, 0x0042, 0x0052, 0x0050, 0x0060
.2byte 0x0032, 0x0042, 0x005c, 0x006c
.align 2
gUnknown_085714BC:: @ 85714BC
obj_tiles gFrontierPassCursor_Gfx, 0x100, 0
obj_tiles gFrontierPassMapCursor_Gfx, 0x400, 1
obj_tiles gFrontierPassMedals_Gfx, 0x380, 2
.align 2
gUnknown_085714D4:: @ 85714D4
obj_tiles gUnknown_08570C44, 0x100, 4
null_obj_tiles
.align 2
gUnknown_085714E4:: @ 85714E4
obj_pal gFrontierPassCursor_Pal, 0
obj_pal gFrontierPassMapCursor_Pal, 1
obj_pal gFrontierPassMedalsSilver_Pal, 2
obj_pal gFrontierPassMedalsGold_Pal, 3
obj_pal gUnknown_0856FB7C, 4
obj_pal gUnknown_0856FB9C, 5
null_obj_pal
.align 2
gSpriteAnim_857151C:: @ 857151C
.2byte 0x0000, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571524:: @ 8571524
.2byte 0x0000, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857152C:: @ 857152C
.2byte 0x0004, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571534:: @ 8571534
.2byte 0x0008, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857153C:: @ 857153C
.2byte 0x000c, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571544:: @ 8571544
.2byte 0x0010, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857154C:: @ 857154C
.2byte 0x0014, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571554:: @ 8571554
.2byte 0x0018, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857155C:: @ 857155C
.2byte 0x0000, 0x002d, 0x0008, 0x002d, 0xfffe, 0x0000
.align 2
gSpriteAnim_8571568:: @ 8571568
.2byte 0x0010, 0x002d, 0x0018, 0x002d, 0xfffe, 0x0000
.align 2
gSpriteAnimTable_08571574:: @ 8571574
.4byte gSpriteAnim_8571524
.4byte gSpriteAnim_857152C
.align 2
gSpriteAnimTable_0857157C:: @ 857157C
.4byte gSpriteAnim_8571524
.4byte gSpriteAnim_857152C
.4byte gSpriteAnim_8571534
.4byte gSpriteAnim_857153C
.4byte gSpriteAnim_8571544
.4byte gSpriteAnim_857154C
.4byte gSpriteAnim_8571554
.align 2
gSpriteAnimTable_08571598:: @ 8571598
.4byte gSpriteAnim_857155C
.4byte gSpriteAnim_8571568
.align 2
gSpriteAffineAnim_085715A0:: @ 85715A0
.2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gSpriteAffineAnimTable_085715B0:: @ 85715B0
.4byte gSpriteAffineAnim_085715A0
.align 2
gUnknown_085715B4:: @ 85715B4
spr_template 0, 0, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
spr_template 1, 1, gUnknown_08524934, gSpriteAnimTable_08571598, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_085715E4:: @ 85715E4
spr_template 2, 2, gUnknown_0852490C, gSpriteAnimTable_0857157C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_085715FC:: @ 85715FC
spr_template 4, 4, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, nullsub_39
.align 2
gUnknown_08571614:: @ 8571614
.4byte gUnknown_085EDA96
.4byte gUnknown_085ED932
.4byte gUnknown_085ED94D
.4byte gUnknown_085ED961
.4byte gUnknown_085ED977
.4byte gUnknown_085ED993
.4byte gUnknown_085ED9AF
.4byte gUnknown_085ED9C7
.4byte gUnknown_085ED9E5
.4byte gUnknown_085EDA02
.4byte gUnknown_085EDA21
.4byte gUnknown_085EDA3C
.4byte gUnknown_085EDA5E
.4byte gUnknown_085EDA78
.4byte gUnknown_085ED931
.align 2
gUnknown_08571650:: @ 8571650
unk_trainer_card_struct gUnknown_085EDAB1, gUnknown_085EDB0F, 0x59, 0x28, 1, 0
unk_trainer_card_struct gUnknown_085EDABE, gUnknown_085EDB4E, 0x21, 0x2A, 1, 0
unk_trainer_card_struct gUnknown_085EDACA, gUnknown_085EDB8B, 0x78, 0x56, 0, 0
unk_trainer_card_struct gUnknown_085EDAD8, gUnknown_085EDBC2, 0x72, 0x3B, 0, 0
unk_trainer_card_struct gUnknown_085EDAE5, gUnknown_085EDC00, 0x19, 0x43, 0, 0
unk_trainer_card_struct gUnknown_085EDAF4, gUnknown_085EDC45, 0x39, 0x39, 1, 0
unk_trainer_card_struct gUnknown_085EDB00, gUnknown_085EDC84, 0x86, 0x29, 1, 0

View File

@ -4866,6 +4866,12 @@ extern const u32 gUnknown_08DE2084[];
extern const u32 gUnknown_08DE3350[];
extern const u32 gUnknown_08DE3374[];
extern const u32 gUnknown_08DE3060[];
extern const u32 gFrontierPassMedals_Gfx[];
extern const u16 gUnknown_08DE07C8[][16];
extern const u16 gFrontierPassCursor_Pal[];
extern const u16 gFrontierPassMedalsGold_Pal[];
extern const u16 gFrontierPassMedalsSilver_Pal[];
extern const u16 gFrontierPassMapCursor_Pal[];
#endif //GUARD_GRAPHICS_H

View File

@ -25,6 +25,7 @@ struct PokemonStorage
extern struct PokemonStorage *gPokemonStoragePtr;
void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4);
u8 CountMonsInBox(u8 boxId);
s16 GetFirstFreeBoxSpot(u8 boxId);
u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore);

View File

@ -34,7 +34,7 @@ u8 *StringFill(u8 *dest, u8 c, u16 n);
u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n);
u8 *StringFillWithTerminator(u8 *dest, u16 n);
u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n);
u32 StringLength_Multibyte(u8 *str);
u32 StringLength_Multibyte(const u8 *str);
u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color);
bool32 IsStringJapanese(u8 *str);
bool32 sub_800924C(u8 *str, s32 n);

View File

@ -2252,5 +2252,35 @@ extern const u8 gText_BattlePtsWon[];
extern const u8 gText_SymbolsEarned[];
extern const u8 gText_BattleRecord[];
extern const u8 gText_BattlePoints[];
extern const u8 gUnknown_085EDA96[];
extern const u8 gUnknown_085ED932[];
extern const u8 gUnknown_085ED94D[];
extern const u8 gUnknown_085ED961[];
extern const u8 gUnknown_085ED977[];
extern const u8 gUnknown_085ED993[];
extern const u8 gUnknown_085ED9AF[];
extern const u8 gUnknown_085ED9C7[];
extern const u8 gUnknown_085ED9E5[];
extern const u8 gUnknown_085EDA02[];
extern const u8 gUnknown_085EDA21[];
extern const u8 gUnknown_085EDA3C[];
extern const u8 gUnknown_085EDA5E[];
extern const u8 gUnknown_085EDA78[];
extern const u8 gUnknown_085ED931[];
extern const u8 gUnknown_085EDAB1[];
extern const u8 gUnknown_085EDB0F[];
extern const u8 gUnknown_085EDABE[];
extern const u8 gUnknown_085EDB4E[];
extern const u8 gUnknown_085EDACA[];
extern const u8 gUnknown_085EDB8B[];
extern const u8 gUnknown_085EDAD8[];
extern const u8 gUnknown_085EDBC2[];
extern const u8 gUnknown_085EDAE5[];
extern const u8 gUnknown_085EDC00[];
extern const u8 gUnknown_085EDAF4[];
extern const u8 gUnknown_085EDC45[];
extern const u8 gUnknown_085EDB00[];
extern const u8 gUnknown_085EDC84[];
#endif // GUARD_STRINGS_H

View File

@ -126,7 +126,6 @@ SECTIONS {
src/pokedex.o(.text);
src/trainer_card.o(.text);
src/frontier_pass.o(.text);
asm/frontier_pass.o(.text);
src/pokemon_storage_system.o(.text);
src/pokemon_icon.o(.text);
src/script_movement.o(.text);
@ -460,7 +459,7 @@ SECTIONS {
src/option_menu.o(.rodata);
src/pokedex.o(.rodata);
src/trainer_card.o(.rodata);
data/frontier_pass.o(.rodata);
src/frontier_pass.o(.rodata);
src/pokemon_storage_system.o(.rodata);
src/pokemon_icon.o(.rodata);
src/fldeff_cut.o(.rodata);

File diff suppressed because it is too large Load Diff

View File

@ -1541,7 +1541,7 @@ static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cu
static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp");
// code
void sub_80C6D80(u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4)
void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4)
{
s32 i, val, val2;
u16 windowId;
@ -1586,121 +1586,29 @@ void sub_80C6D80(u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4)
RemoveWindow(windowId);
}
NAKED
void sub_80C6EAC()
// Unused
void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr3)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x2C\n\
str r0, [sp, 0x20]\n\
str r1, [sp, 0x24]\n\
adds r6, r3, 0\n\
ldr r0, [sp, 0x4C]\n\
mov r9, r0\n\
ldr r1, [sp, 0x50]\n\
mov r10, r1\n\
lsls r2, 16\n\
lsrs r2, 16\n\
str r2, [sp, 0x28]\n\
lsls r6, 24\n\
lsrs r6, 24\n\
mov r2, r9\n\
lsls r2, 24\n\
lsrs r2, 24\n\
mov r9, r2\n\
mov r0, r10\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r10, r0\n\
movs r0, 0\n\
movs r1, 0\n\
str r0, [sp, 0x18]\n\
str r1, [sp, 0x1C]\n\
ldr r0, [sp, 0x20]\n\
bl StringLength_Multibyte\n\
lsls r0, 24\n\
ldr r2, =0x00ffffff\n\
ldr r1, [sp, 0x18]\n\
ands r1, r2\n\
orrs r1, r0\n\
str r1, [sp, 0x18]\n\
ldr r1, =0xffffff00\n\
add r2, sp, 0x18\n\
mov r8, r2\n\
ldr r0, [r2, 0x4]\n\
ands r0, r1\n\
movs r1, 0x2\n\
orrs r0, r1\n\
str r0, [r2, 0x4]\n\
ldr r5, [sp, 0x18]\n\
lsrs r5, 24\n\
lsls r5, 5\n\
mov r0, r8\n\
bl AddWindow\n\
adds r4, r0, 0\n\
lsls r4, 24\n\
lsrs r4, 24\n\
lsls r1, r6, 4\n\
orrs r1, r6\n\
lsls r1, 24\n\
lsrs r1, 24\n\
adds r0, r4, 0\n\
bl FillWindowPixelBuffer\n\
adds r0, r4, 0\n\
movs r1, 0x7\n\
bl GetWindowAttribute\n\
adds r7, r0, 0\n\
mov r0, r8\n\
ldrb r0, [r0, 0x3]\n\
lsls r0, 5\n\
mov r8, r0\n\
add r8, r7\n\
add r0, sp, 0x14\n\
movs r1, 0\n\
strb r6, [r0]\n\
mov r2, r9\n\
strb r2, [r0, 0x1]\n\
mov r2, r10\n\
strb r2, [r0, 0x2]\n\
str r1, [sp]\n\
str r1, [sp, 0x4]\n\
str r0, [sp, 0x8]\n\
movs r0, 0x1\n\
negs r0, r0\n\
str r0, [sp, 0xC]\n\
ldr r0, [sp, 0x20]\n\
str r0, [sp, 0x10]\n\
adds r0, r4, 0\n\
movs r1, 0x1\n\
movs r2, 0\n\
movs r3, 0x2\n\
bl AddTextPrinterParameterized4\n\
lsrs r5, 1\n\
adds r0, r7, 0\n\
ldr r1, [sp, 0x24]\n\
adds r2, r5, 0\n\
bl CpuSet\n\
ldr r2, [sp, 0x24]\n\
ldr r0, [sp, 0x28]\n\
adds r1, r2, r0\n\
mov r0, r8\n\
adds r2, r5, 0\n\
bl CpuSet\n\
adds r0, r4, 0\n\
bl RemoveWindow\n\
add sp, 0x2C\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool");
u32 var;
u8 windowId;
u8 txtColor[3];
u8 *tileData1, *tileData2;
struct WindowTemplate winTemplate = {0};
winTemplate.width = StringLength_Multibyte(string);
winTemplate.height = 2;
var = winTemplate.width * 32;
windowId = AddWindow(&winTemplate);
FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3);
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
tileData2 = (winTemplate.width * 32) + tileData1;
txtColor[0] = arg3;
txtColor[1] = clr2;
txtColor[2] = clr3;
AddTextPrinterParameterized4(windowId, 1, 0, 2, 0, 0, txtColor, -1, string);
CpuCopy16(tileData1, dst, var);
CpuCopy16(tileData2, dst + arg2, var);
RemoveWindow(windowId);
}
u8 CountMonsInBox(u8 boxId)

View File

@ -587,7 +587,7 @@ u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n)
return dest;
}
u32 StringLength_Multibyte(u8 *str)
u32 StringLength_Multibyte(const u8 *str)
{
u32 length = 0;

View File

@ -26,6 +26,7 @@
#include "pokedex.h"
#include "pokemon_icon.h"
#include "pokemon_summary_screen.h"
#include "pokemon_storage_system.h"
#include "random.h"
#include "rom_8011DC0.h"
#include "save.h"
@ -49,8 +50,6 @@
#define Trade_SendData(ptr) (SendBlock(bitmask_all_link_players_but_self(), ptr->linkData, 20))
extern void sub_80C6D80(const u8 *, u8 *, u8, u8, u8);
struct InGameTrade {
/*0x00*/ u8 name[11];
/*0x0C*/ u16 species;

View File

@ -154,19 +154,7 @@ gUnknown_02039B88: @ 2039B88
.space 0x160
.include "src/trainer_card.o"
gUnknown_02039CEC: @ 2039CEC
.space 0x4
gUnknown_02039CF0: @ 2039CF0
.space 0x4
gUnknown_02039CF4: @ 2039CF4
.space 0x4
gUnknown_02039CF8: @ 2039CF8
.space 0x8
.include "src/frontier_pass.o"
.include "src/pokemon_storage_system.o"
.include "src/script_movement.o"
.include "src/fldeff_cut.o"