From ea779d534f745f98265216d5ae4606664f565bf7 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 12:35:09 +0100 Subject: [PATCH 01/23] start work on ewram init --- data/data_8270000.s | 2 - include/gba/defines.h | 1 + ld_script.txt | 109 +++++++++++++++++++++++++----------------- src/code_2.c | 5 +- src/main.c | 4 +- sym_ewram2.txt | 16 ------- 6 files changed, 71 insertions(+), 66 deletions(-) diff --git a/data/data_8270000.s b/data/data_8270000.s index fb475c2a1..a9ff4693a 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -4,8 +4,6 @@ gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 .byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 .byte 0x04, 0x00, 0x07, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 diff --git a/include/gba/defines.h b/include/gba/defines.h index 71dcbcde6..5ea69e969 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -9,6 +9,7 @@ #define IWRAM_DATA __attribute__((section("iwram_data"))) #define EWRAM_DATA __attribute__((section("ewram_data"))) #define EWRAM_DATA_2 __attribute__((section("ewram_data_2"))) +#define EWRAM_INIT __attribute__((section("ewram_init"))) #define UNUSED __attribute__((unused)) #define NAKED __attribute__((naked)) diff --git a/ld_script.txt b/ld_script.txt index e576aa391..8b4491a2d 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -3,10 +3,17 @@ ENTRY(Start) gNumMusicPlayers = 8; gMaxLines = 0; -SECTIONS { - . = 0x2000000; +MEMORY +{ + EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K + IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K + ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M +} - ewram (NOLOAD) : +SECTIONS { + + ewram 0x2000000 (NOLOAD) : + ALIGN(4) { ewram_start = .; @@ -17,24 +24,20 @@ SECTIONS { *libgcc.a:dp-bit.o(.bss); *libc.a:syscalls.o(.bss); . = ALIGN(16); - INCLUDE "sym_ewram2.ld" - *libc.a:impure.o(.data); - *libc.a:locale.o(.data); - *libc.a:mallocr.o(.data); - ewram2_end = .; - . = 0x40000; - } + src/m4a.o(ewram_data_2); + src/agb_flash.o(ewram_data_2); + *libc.a:sbrkr.o(COMMON); + } > EWRAM - . = 0x3000000; - - iwram (NOLOAD) : + iwram 0x3000000 (NOLOAD) : ALIGN(4) { iwram_start = .; INCLUDE "sym_iwram.ld" . = 0x8000; - } + } > IWRAM + /* BEGIN ROM DATA */ . = 0x8000000; .text : @@ -407,7 +410,7 @@ SECTIONS { *libc.a:lseekr.o(.text); *libc.a:readr.o(.text); *libgcc.a:_udivsi3.o(.text); - } =0 + } > ROM =0 .rodata : ALIGN(4) @@ -716,9 +719,35 @@ SECTIONS { *libc.a:locale.o(.rodata); *libc.a:mprec.o(.rodata); *libc.a:syscalls.o(.rodata); - . = ALIGN(4); - data/data_8270000.o(.rodata); - } =0 + . = ALIGN(4); + } > ROM =0 + + ewram_init : + ALIGN(4) + { + ewramClearEnd = .; + ewramClearEnd2 = .; + + src/code_2.o(ewram_init); + } > EWRAM AT>ROM + + EWRAM_INIT_ROM_START = LOADADDR(ewram_init); + + ewram_init_temp : + ALIGN(4) + { + data/data_8270000.o(.rodata); + } > ROM =0 + + ewram_temp (NOLOAD) : + ALIGN(4) + { + INCLUDE "sym_ewram2.ld" + *libc.a:impure.o(.data); + *libc.a:locale.o(.data); + *libc.a:mallocr.o(.data); + ewram2_end = .; + } > EWRAM unk_code_section : ALIGN(4) @@ -728,73 +757,65 @@ SECTIONS { src/code_8272724.o(.text); asm/code_8272724.o(.text); unk_code_end = .; - } + } > ROM =0 unk_code_section_size = (unk_code_end - unk_code); unk_code_ram_end = unk_code_ram + unk_code_section_size; end = unk_code_ram_end; - . = 0x8300000; - unk_data : + unk_data 0x8300000 : ALIGN(4) { data/unk_data.o(.rodata); - } + } > ROM =0 - . = 0x8300500; - system_sbin_section : + system_sbin_section 0x8300500 : ALIGN(4) { data/system_sbin.o(.rodata); - } + } > ROM =0 - . = 0x8380000; - titlemenu_sbin_section : + titlemenu_sbin_section 0x8380000 : ALIGN(4) { data/titlemenu_sbin.o(.rodata); - } + } > ROM =0 - . = 0x83B0000; - dungeon_sbin_section : + dungeon_sbin_section 0x83B0000 : ALIGN(4) { data/dungeon_sbin.o(.rodata); - } + } > ROM =0 - . = 0x8510000; - monster_sbin_section : + monster_sbin_section 0x8510000 : ALIGN(4) { data/monster_sbin.o(.rodata); - } + } > ROM =0 - . = 0x9740000; - effect_sbin_section : + effect_sbin_section 0x9740000 : ALIGN(4) { data/effect_sbin.o(.rodata); - } + } > ROM =0 - . = 0x9890000; - ground_sbin_section : + ground_sbin_section 0x9890000 : ALIGN(4) { data/ground_sbin.o(.rodata); - } + } > ROM =0 - . = 0x9E60000; - ornament_sbin_section : + ornament_sbin_section 0x9E60000 : ALIGN(4) { data/ornament_sbin.o(.rodata); - } + } > ROM =0 sound_data : ALIGN(4) { data/sound_data.o(.rodata); - } + } > ROM =0 /* DWARF 2 sections */ .debug_aranges 0 : { *(.debug_aranges) } diff --git a/src/code_2.c b/src/code_2.c index 504c999bb..21d74bf3c 100644 --- a/src/code_2.c +++ b/src/code_2.c @@ -38,10 +38,11 @@ extern void LoadTitleScreen(void); extern void nullsub_33(void); extern u32 sub_80009D0(u32); -extern u32 gUnknown_203B03C; extern u16 gUnknown_2026E4E; extern s32 gTitleBrightness; -extern OpenedFile *gTitlePaletteFile; + +EWRAM_INIT OpenedFile *gTitlePaletteFile = NULL; +EWRAM_INIT u32 gUnknown_203B03C = 0; extern char gPMDBuildVersion[]; diff --git a/src/main.c b/src/main.c index 325ea2ba2..ee9aa49d9 100644 --- a/src/main.c +++ b/src/main.c @@ -28,7 +28,7 @@ extern u8 unk_code_ram[]; extern u8 unk_code_ram_end[]; // data_8270000.s -extern const u8 gUnknown_8270000[]; +extern const u8 EWRAM_INIT_ROM_START[]; UNUSED static const char sStringRomUserData[] = "PKD ROM USER DATA 000000"; @@ -50,7 +50,7 @@ void AgbMain(void) DmaStop(3); if (ewram2_end - ewramClearEnd > 0) - CpuCopy32(gUnknown_8270000, ewramClearEnd, ewram2_end - ewramClearEnd); + CpuCopy32(EWRAM_INIT_ROM_START, ewramClearEnd, ewram2_end - ewramClearEnd); if (ewramClearEnd2 - ewram_start > 0) { memset(value, 0, 4); diff --git a/sym_ewram2.txt b/sym_ewram2.txt index 2b0b60b8b..55d96c8a8 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,23 +1,9 @@ .align 2 -.include "src/m4a.o" -.include "src/agb_flash.o" - -errno: /* 203B034 */ - .space 0x4 - -ewramClearEnd: -ewramClearEnd2: -gTitlePaletteFile: /* 203B038 (GameLoop) */ - .space 0x4 -gUnknown_203B03C: /* 203B03C */ - .space 0x4 gPersonalityRelated_203B040: /* 203B040 */ .space 0x30 .include "src/other_random.o" - .space 0x2 - .include "src/sprite.o" gUnknown_203B078: /* 203B078 (sub_80057E8 - SaveUnkTextStructAndXXX_8006438) */ @@ -44,8 +30,6 @@ gUnknown_203B090: /* 203B090 (InitGraphics) */ .include "src/main.o" .include "src/reg_control.o" .include "src/flash.o" - .space 0x3 - .include "src/code_800C9CC.o" gUnknown_203B0BE: /* 203B0BE (sub_800CDA8) */ From d59d39a0d777e16ce741da9c6820ee085c911e93 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 12:56:22 +0100 Subject: [PATCH 02/23] sym ewram init.txt --- Makefile | 5 ++++- data/data_8270000.s | 15 --------------- ld_script.txt | 2 +- src/code_2.c | 20 ++++++++++++++++++++ src/code_800558C.c | 2 +- src/other_random.c | 2 +- src/sprite.c | 2 +- sym_ewram2.txt | 9 --------- sym_ewram_init.txt | 7 +++++++ 9 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 sym_ewram_init.txt diff --git a/Makefile b/Makefile index 2109838df..12612ef27 100755 --- a/Makefile +++ b/Makefile @@ -254,8 +254,11 @@ $(BUILD_DIR)/sym_iwram.ld: sym_iwram.txt $(BUILD_DIR)/sym_ewram2.ld: sym_ewram2.txt $(RAMSCRGEN) ewram_data_2 $< ENGLISH > $@ + +$(BUILD_DIR)/sym_ewram_init.ld: sym_ewram_init.txt + $(RAMSCRGEN) ewram_init $< ENGLISH > $@ -$(LD_SCRIPT): ld_script.txt $(BUILD_DIR)/sym_ewram.ld $(BUILD_DIR)/sym_ewram2.ld $(BUILD_DIR)/sym_iwram.ld +$(LD_SCRIPT): ld_script.txt $(BUILD_DIR)/sym_ewram.ld $(BUILD_DIR)/sym_ewram2.ld $(BUILD_DIR)/sym_ewram_init.ld $(BUILD_DIR)/sym_iwram.ld cd $(BUILD_DIR) && sed -e "s#tools/#../../tools/#g" ../../ld_script.txt >ld_script.ld $(ELF): $(LD_SCRIPT) $(ALL_OBJECTS) $(LIBC) libagbsyscall tools diff --git a/data/data_8270000.s b/data/data_8270000.s index a9ff4693a..a284d861b 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -3,21 +3,6 @@ .global gUnknown_8270000 gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x07, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x8c, 0x34, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 .byte 0x01, 0x00, 0x00, 0x00 .byte 0x95, 0x1b, 0x00, 0x03 .byte 0xa5, 0x1c, 0x00, 0x03 diff --git a/ld_script.txt b/ld_script.txt index 8b4491a2d..7a5842ac5 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -728,7 +728,7 @@ SECTIONS { ewramClearEnd = .; ewramClearEnd2 = .; - src/code_2.o(ewram_init); + INCLUDE "sym_ewram_init.ld" } > EWRAM AT>ROM EWRAM_INIT_ROM_START = LOADADDR(ewram_init); diff --git a/src/code_2.c b/src/code_2.c index 21d74bf3c..bd490300c 100644 --- a/src/code_2.c +++ b/src/code_2.c @@ -41,8 +41,28 @@ extern u32 sub_80009D0(u32); extern u16 gUnknown_2026E4E; extern s32 gTitleBrightness; +// TODO: figure out the struct +struct UnkStruct203B040 +{ + u8 unk0[48]; +}; + EWRAM_INIT OpenedFile *gTitlePaletteFile = NULL; EWRAM_INIT u32 gUnknown_203B03C = 0; +EWRAM_INIT struct UnkStruct203B040 gPersonalityRelated_203B040 = { + {0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00} +}; extern char gPMDBuildVersion[]; diff --git a/src/code_800558C.c b/src/code_800558C.c index 817f05fd0..c7935f7cf 100644 --- a/src/code_800558C.c +++ b/src/code_800558C.c @@ -19,7 +19,7 @@ extern u32 *gUnknown_2026E58; extern s16 gUnknown_2026E60[]; extern s16 gUnknown_20270E8[]; -extern s16 *gUnknown_203B078; +EWRAM_INIT s16 *gUnknown_203B078 = NULL; // data.s extern const s16 gUnknown_80B8008[17]; diff --git a/src/other_random.c b/src/other_random.c index 6e96397e2..1b5e2bc57 100644 --- a/src/other_random.c +++ b/src/other_random.c @@ -1,7 +1,7 @@ #include "global.h" #include "other_random.h" -EWRAM_DATA_2 u16 gOtherRngState = {0}; +EWRAM_INIT u16 gOtherRngState = {0x348C}; static s32 OtherRandom16(void) { diff --git a/src/sprite.c b/src/sprite.c index ab7399bb6..216783e0e 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -27,7 +27,7 @@ static EWRAM_DATA unkStruct_20266B0 sUnknown_20266B0[UNK_20266B0_ARR_COUNT] = {0 static EWRAM_DATA void *sCharMemCursor = {0}; // 2026E30 UNUSED static EWRAM_DATA u32 sUnused3 = {0}; // 2026E34 -static EWRAM_DATA_2 unkStruct_20266B0 *sUnknown_203B074 = {0}; +static EWRAM_INIT unkStruct_20266B0 *sUnknown_203B074 = {0}; // code.c extern void nullsub_3(s32, s32); diff --git a/sym_ewram2.txt b/sym_ewram2.txt index 55d96c8a8..b5ed0c6a7 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,14 +1,5 @@ .align 2 -gPersonalityRelated_203B040: /* 203B040 */ - .space 0x30 - -.include "src/other_random.o" -.include "src/sprite.o" - -gUnknown_203B078: /* 203B078 (sub_80057E8 - SaveUnkTextStructAndXXX_8006438) */ - .space 0x4 - .include "src/random.o" gUnknown_203B080: /* 203B080 (sub_8053540 - sub_806806C) */ diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt new file mode 100644 index 000000000..3fc574f77 --- /dev/null +++ b/sym_ewram_init.txt @@ -0,0 +1,7 @@ + .align 2 + +.include "src/code_2.o" +.include "src/other_random.o" +.include "src/sprite.o" +.include "src/code_800558C.o" + \ No newline at end of file From 385200e1d69571aa3aadde858af77c526394f2b9 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 14:06:35 +0100 Subject: [PATCH 03/23] cpu --- data/data_8270000.s | 21 --------------------- src/code_800C9CC.c | 5 +++-- src/cpu.c | 16 ++++++++++++++-- src/file_system.c | 4 ++-- src/flash.c | 2 +- src/random.c | 2 +- src/reg_control.c | 26 +++++++++++++------------- src/text.c | 13 +++++++++++++ sym_ewram2.txt | 22 ---------------------- sym_ewram_init.txt | 9 ++++++++- sym_iwram.txt | 11 ++++++++++- 11 files changed, 65 insertions(+), 66 deletions(-) diff --git a/data/data_8270000.s b/data/data_8270000.s index a284d861b..a3c2946d3 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -3,27 +3,6 @@ .global gUnknown_8270000 gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x95, 0x1b, 0x00, 0x03 -.byte 0xa5, 0x1c, 0x00, 0x03 -.byte 0xd9, 0x1d, 0x00, 0x03 -.byte 0xad, 0x1e, 0x00, 0x03 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff - -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x41, 0x3e -.byte 0x42, 0x3c, 0x44, 0x3b -.byte 0x48, 0x37, 0x40, 0x30 -.byte 0x46, 0x38, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 diff --git a/src/code_800C9CC.c b/src/code_800C9CC.c index 115b2e7c1..2287df3b2 100644 --- a/src/code_800C9CC.c +++ b/src/code_800C9CC.c @@ -3,8 +3,9 @@ #include "random.h" #include "reg_control.h" -EWRAM_DATA_2 u32 gUnknown_203B0B8 = {0}; -EWRAM_DATA_2 u16 gRawKeyInput = {0}; +// Todo: Figure out if this file could be merged with bg_control and cpu? +EWRAM_INIT u32 gUnknown_203B0B8 = {0}; +extern u16 gRawKeyInput; void sub_800CB20(void) { diff --git a/src/cpu.c b/src/cpu.c index d0c6a2338..6610c04a2 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -3,14 +3,26 @@ #include "cpu.h" EWRAM_DATA u32 gUnknown_202D800 = {0}; -extern u16 gUnknown_203B0BE[]; + +EWRAM_INIT u16 gRawKeyInput = {0}; // Not used here, but has to be declare along with sBldCntTable for alignment. Perhaps this file should be merged with bg_control and code_800C9CC. +// Despite being in EWRAM, these never change. +static EWRAM_INIT u16 sBldCntTable[] = { + (BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD), + (BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD), + (BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD), + (BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD), + (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD), + (BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD), + (0), +}; + extern u16 *gUnknown_2026E3C; extern u8 gUnknown_2026E38; void sub_800CDA8(u32 r0) { gUnknown_202D800 = r0; - gBldCnt = gUnknown_203B0BE[r0]; + gBldCnt = sBldCntTable[r0]; } u32 sub_800CDC8(void) diff --git a/src/file_system.c b/src/file_system.c index 396265b9b..5f2be8f5a 100644 --- a/src/file_system.c +++ b/src/file_system.c @@ -5,7 +5,7 @@ EWRAM_DATA u32 gUnknown_202D2A4 = {0}; EWRAM_DATA OpenedFile gFileCache[64] = {0}; -static EWRAM_DATA_2 u32 sFileCacheCursorPosition = {0}; +static EWRAM_INIT u32 sFileCacheCursorPosition = {0}; #include "data/file_system.h" @@ -146,4 +146,4 @@ void CloseFile(OpenedFile *openedFile) return; } } -} \ No newline at end of file +} diff --git a/src/flash.c b/src/flash.c index fcb08e555..172f2be94 100644 --- a/src/flash.c +++ b/src/flash.c @@ -3,7 +3,7 @@ #include "flash.h" #include "memory.h" -EWRAM_DATA_2 bool8 gFlashEnabled = {0}; +EWRAM_INIT bool8 gFlashEnabled = {0}; extern FlashIntrFunc *GetInterruptHandler(s32); diff --git a/src/random.c b/src/random.c index d57aa516a..25768d74b 100644 --- a/src/random.c +++ b/src/random.c @@ -2,7 +2,7 @@ #include "globaldata.h" #include "random.h" -EWRAM_DATA_2 s32 gPRNGSequenceNum = {0}; +EWRAM_INIT s32 gPRNGSequenceNum = {1}; void SeedRng(u8 *seed) { diff --git a/src/reg_control.c b/src/reg_control.c index 6384be504..ad0d9d5f5 100644 --- a/src/reg_control.c +++ b/src/reg_control.c @@ -16,19 +16,19 @@ EWRAM_DATA IntrCallback gIntrCallbacks[6] = {0}; EWRAM_DATA unkStruct_202D648 gUnknown_202D608[8] = {0}; EWRAM_DATA unkStruct_202D648 gUnknown_202D648[8] = {0}; -EWRAM_DATA_2 u8 gInterruptsEnabled = {0}; -EWRAM_DATA_2 bool8 gUnknown_203B099 = {0}; -EWRAM_DATA_2 bool8 gUnknown_203B09A = {0}; -EWRAM_DATA_2 bool8 gUnknown_203B09B = {0}; -EWRAM_DATA_2 u32 gUnknown_203B09C = {0}; -EWRAM_DATA_2 u32 gUnknown_203B0A0 = {0}; -EWRAM_DATA_2 u32 gUnknown_203B0A4 = {0}; // Written to but never read -EWRAM_DATA_2 s16 gUnknown_203B0A8 = {0}; -EWRAM_DATA_2 s16 gUnknown_203B0AA = {0}; -EWRAM_DATA_2 s16 gUnknown_203B0AC = {0}; -EWRAM_DATA_2 s16 gUnknown_203B0AE = {0}; -EWRAM_DATA_2 s16 gUnknown_203B0B0 = {0}; // Written to but never read -EWRAM_DATA_2 s16 gUnknown_203B0B2 = {0}; // Written to but never read +EWRAM_INIT u8 gInterruptsEnabled = {0}; +EWRAM_INIT bool8 gUnknown_203B099 = {0}; +EWRAM_INIT bool8 gUnknown_203B09A = {0}; +EWRAM_INIT bool8 gUnknown_203B09B = {0}; +EWRAM_INIT u32 gUnknown_203B09C = {0}; +EWRAM_INIT u32 gUnknown_203B0A0 = {0}; +EWRAM_INIT u32 gUnknown_203B0A4 = {0}; // Written to but never read +EWRAM_INIT s16 gUnknown_203B0A8 = {0}; +EWRAM_INIT s16 gUnknown_203B0AA = {0}; +EWRAM_INIT s16 gUnknown_203B0AC = {0}; +EWRAM_INIT s16 gUnknown_203B0AE = {-1}; +EWRAM_INIT s16 gUnknown_203B0B0 = {-1}; // Written to but never read +EWRAM_INIT s16 gUnknown_203B0B2 = {-1}; // Written to but never read // code_800D090.c extern void sub_800D6AC(void); diff --git a/src/text.c b/src/text.c index 185598174..31e40a212 100644 --- a/src/text.c +++ b/src/text.c @@ -41,6 +41,19 @@ EWRAM_DATA static u32 sTextShadowMask = 0; // Some text color info is stored; re EWRAM_DATA static u8 sDrawTextShadow = 0; EWRAM_DATA ALIGNED(4) u16 gUnknown_202B038[4][32][32] = {0}; +extern ALIGNED(4) u8 gUnkIwramFunc1Buffer[]; +extern ALIGNED(4) u8 gUnkIwramFunc2Buffer[]; +extern ALIGNED(4) u8 gUnkIwramFunc3Buffer[]; +extern ALIGNED(4) u8 gUnkIwramFunc4Buffer[]; +// Despite these not being used anywhere in this file, file order and usage point to these variables being declared here +EWRAM_INIT void (*gUnknown_203B080)(s32 a0) = (void *) &gUnkIwramFunc1Buffer[1]; // + 1 because the function is in thumb! +EWRAM_INIT void (*gUnknown_203B084)(s32 a0) = (void *) &gUnkIwramFunc2Buffer[1]; // + 1 because the function is in thumb! +EWRAM_INIT void (*gUnknown_203B088)(s32 a0) = (void *) &gUnkIwramFunc3Buffer[1]; // + 1 because the function is in thumb! +EWRAM_INIT void (*gUnknown_203B08C)(s32 a0) = (void *) &gUnkIwramFunc4Buffer[1]; // + 1 because the function is in thumb! + +// This variable is only used in InitGraphics function, which could or could not belong to text.c +EWRAM_INIT u8 gUnknown_203B090 = 0; + static void SaveUnkTextStructAndXXX_8006438(const UnkTextStruct2 *a0, bool8 a1, bool8 a2, UnkTextStruct2_sub *a3); static void sub_8006554(UnkTextStruct1 *a0, u32 *a1, u32 *a2, u16 *a3, u32 a4, const UnkTextStruct2 *a5, bool8 a6, u32 a7, UnkTextStruct2_sub *a8, u8 a9); static void sub_800677C(UnkTextStruct1 *a0, s32 a1, u16 *a2, u8 a3); diff --git a/sym_ewram2.txt b/sym_ewram2.txt index b5ed0c6a7..92de4d813 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,30 +1,8 @@ .align 2 -.include "src/random.o" -gUnknown_203B080: /* 203B080 (sub_8053540 - sub_806806C) */ - .space 0x4 -gUnknown_203B084: /* 203B084 (sub_8053430 - sub_806806C) */ - .space 0x4 -gUnknown_203B088: /* 203B088 (xxx_draw_string_80144C4) */ - .space 0x4 - -gUnknown_203B08C: /* 203B08C (xxx_draw_string_80524F0) */ - .space 0x4 - -gUnknown_203B090: /* 203B090 (InitGraphics) */ - .space 0x4 - -.include "src/file_system.o" -.include "src/main.o" -.include "src/reg_control.o" -.include "src/flash.o" -.include "src/code_800C9CC.o" - -gUnknown_203B0BE: /* 203B0BE (sub_800CDA8) */ - .space 0xE gUnknown_203B0CC: /* 203B0CC (sub_800DE8C - sub_800DC14) */ .space 0x4 diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index 3fc574f77..52fc1154d 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -4,4 +4,11 @@ .include "src/other_random.o" .include "src/sprite.o" .include "src/code_800558C.o" - \ No newline at end of file +.include "src/random.o" +.include "src/text.o" +.include "src/file_system.o" +.include "src/main.o" +.include "src/reg_control.o" +.include "src/flash.o" +.include "src/code_800C9CC.o" +.include "src/cpu.o" diff --git a/sym_iwram.txt b/sym_iwram.txt index e0b7064f9..b07326724 100644 --- a/sym_iwram.txt +++ b/sym_iwram.txt @@ -46,6 +46,15 @@ gGroundEffects: /* 3001B8C */ .space 0x4 gGroundEvents: /* 3001B90 */ - .space 0x2470 + .space 0x4 + +gUnkIwramFunc1Buffer: /* 3001B94 */ + .space 0x110 +gUnkIwramFunc2Buffer: /* 3001CA4 */ + .space 0x134 +gUnkIwramFunc3Buffer: /* 3001DD8 */ + .space 0xD4 +gUnkIwramFunc4Buffer: /* 3001EAC */ + .space 0x2154 .include "src/code_80001DC.o" From 91ae3c4c241abbda8c82f28be11b55985d3e0b0b Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 14:35:10 +0100 Subject: [PATCH 04/23] gUnknown_203B0EC --- data/data_8270000.s | 35 +++-------------------------------- src/code_800DAC0.c | 2 +- src/code_800ED38.c | 9 +++++++-- src/code_8010EF0.c | 26 ++++++++++++++++++++++++++ sym_ewram2.txt | 28 ---------------------------- sym_ewram_init.txt | 3 +++ 6 files changed, 40 insertions(+), 63 deletions(-) diff --git a/data/data_8270000.s b/data/data_8270000.s index a3c2946d3..af84011b6 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -3,38 +3,9 @@ .global gUnknown_8270000 gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x0a, 0x00 -.byte 0x1a, 0x00, 0x09, 0x00 -.byte 0x09, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x06, 0x00 -.byte 0x05, 0x00, 0x03, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 + + + .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .4byte Ground_Text diff --git a/src/code_800DAC0.c b/src/code_800DAC0.c index 58710a317..ca0483da4 100644 --- a/src/code_800DAC0.c +++ b/src/code_800DAC0.c @@ -7,7 +7,7 @@ #include "file_system.h" #include "memory.h" -struct unkStruct_203B0CC *gUnknown_203B0CC; +EWRAM_INIT struct unkStruct_203B0CC *gUnknown_203B0CC = NULL; struct unkStruct_800F18C { diff --git a/src/code_800ED38.c b/src/code_800ED38.c index 872d54077..3435a619e 100644 --- a/src/code_800ED38.c +++ b/src/code_800ED38.c @@ -2,6 +2,8 @@ #include "file_system.h" #include "memory.h" #include "code_800E9E4.h" +#include "dungeon_pokemon_sprites.h" +#include "sprite.h" struct unkStruct_203B0D0_sub { @@ -23,7 +25,10 @@ struct unkStruct_203B0D0 { struct unkStruct_203B0D0_sub unk4[2]; }; -struct unkStruct_203B0D0 *gUnknown_203B0D0; +EWRAM_INIT struct unkStruct_203B0D0 *gUnknown_203B0D0 = NULL; +EWRAM_INIT void *gUnknown_203B0D4 = NULL; // TODO: figure out the actual struct +EWRAM_INIT DungeonPokemonSprites *gDungeonPokemonSprites = NULL; // Todo: move to a different file, or merge files in this rom region +EWRAM_INIT SpriteOAM gUnknown_203B0DC = {0}; extern s32 sub_8000728(); OpenedFile *sub_800F1C0(s32, s32); @@ -34,7 +39,7 @@ void sub_800F15C(s32); void sub_800ED38(s32 r0) { - if(gUnknown_203B0D0 == 0) + if(gUnknown_203B0D0 == 0) { gUnknown_203B0D0 = MemoryAlloc(sizeof(struct unkStruct_203B0D0), 0xB); MemoryClear8(gUnknown_203B0D0, sizeof(struct unkStruct_203B0D0)); diff --git a/src/code_8010EF0.c b/src/code_8010EF0.c index 56830b55d..0317597d8 100644 --- a/src/code_8010EF0.c +++ b/src/code_8010EF0.c @@ -1,5 +1,31 @@ #include "global.h" #include "code_8004AA0.h" +#include "text.h" + +EWRAM_INIT struct UnkBgStruct *gUnknown_203B0E4 = NULL; +EWRAM_INIT void *gUnknown_203B0E8 = NULL; // Pointer to some unknown struct +EWRAM_INIT UnkTextStruct2 gUnknown_203B0EC[4] = { // Exact location of this variable is unknown. Find a better place for it once more code is decompiled. + [0] = { + .unk4 = 3, + .unk8 = {2, 10}, + .unkC = 26, + .unkE = 9, + .unk10 = 9, + }, + [1] = { + .unk4 = 3, + .unk8 = {23, 6}, + .unkC = 5, + .unkE = 3, + .unk10 = 3, + }, + [2] = { + .unk4 = 3, + }, + [3] = { + .unk4 = 3, + }, +}; void sub_8010EF0(void) { diff --git a/sym_ewram2.txt b/sym_ewram2.txt index 92de4d813..d6c76999d 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,33 +1,5 @@ .align 2 - - - - -gUnknown_203B0CC: /* 203B0CC (sub_800DE8C - sub_800DC14) */ - .space 0x4 - -gUnknown_203B0D0: /* 203B0D0 (sub_800ED38 - sub_800EF64) */ - .space 0x4 - -gUnknown_203B0D4: /* 203B0D4 (sub_800F034 - sub_800F19C) */ - .space 0x4 - -gDungeonPokemonSprites: /* 203B0D8 (GetDungeonPokemonSprite - sub_800F958) */ - .space 0x4 - -gUnknown_203B0DC: /* 203B0DC (DrawStatusSprite) */ - .space 0x8 - -gUnknown_203B0E4: /* 203B0E4 (sub_800F990 - sub_801169C) */ - .space 0x4 - -gUnknown_203B0E8: /* 203B0E8 (sub_8010268 - sub_8010B74) */ - .space 0x4 - -gUnknown_203B0EC: /* 203B0EC (sub_8010C58) */ - .space 0x60 - .include "src/debug.o" .space 0x2B diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index 52fc1154d..e33c03b52 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -12,3 +12,6 @@ .include "src/flash.o" .include "src/code_800C9CC.o" .include "src/cpu.o" +.include "src/code_800DAC0.o" +.include "src/code_800ED38.o" +.include "src/code_8010EF0.o" From 8a7eeca82af69ba1a736aad9238ee2c290b94f0b Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 14:51:40 +0100 Subject: [PATCH 05/23] quick sav --- data/data_8270000.s | 21 --------------------- include/save.h | 4 ++-- src/debug.c | 28 +++++++++++++++------------- src/quick_save_read.c | 4 ++-- src/quick_save_write.c | 4 ++-- src/save.c | 20 +++++++++----------- src/save_read.c | 4 ++-- src/save_write.c | 2 +- sym_ewram2.txt | 10 +++------- sym_ewram_init.txt | 6 ++++++ 10 files changed, 42 insertions(+), 61 deletions(-) diff --git a/data/data_8270000.s b/data/data_8270000.s index af84011b6..a60aa4d2a 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -4,27 +4,6 @@ gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 - - -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte Ground_Text -.4byte GroundScript_Text -.4byte Dungeon_Text -.4byte Sound_Text -.4byte Bgm_Text -.4byte Se_Text -.4byte Flag_Text -.4byte Memory_Text -.4byte MemoryCard_Text -.4byte Performance_Text -.byte 0x00, 0x00, 0x00, 0x00 -.4byte sGameInternalVersion -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x02, 0x00, 0x0f, 0x00 diff --git a/include/save.h b/include/save.h index dfd000e0f..6b6113082 100644 --- a/include/save.h +++ b/include/save.h @@ -78,7 +78,7 @@ u32 sub_8011C1C(void); void sub_8011C28(u32 in); s32 sub_8011C34(void); void sub_8011C40(s32 in); -char *GetGameInternalName(void); +const char *GetGameInternalName(void); void sub_8011CA8(u32 *out, s32 size); u32 ReadSaveFromPak(u32 *a); u32 WriteSavetoPak(s32 *param_1, u32 param_2); @@ -103,4 +103,4 @@ bool8 ValidateChecksum(u8 *in, u32 size); s32 sub_80121D4(s32 *a, u8 *src, s32 size); u32 sub_80121E0(u32); -#endif // GUARD_SAVE_H \ No newline at end of file +#endif // GUARD_SAVE_H diff --git a/src/debug.c b/src/debug.c index 8e0aba6f9..7c3b310e6 100644 --- a/src/debug.c +++ b/src/debug.c @@ -7,8 +7,8 @@ extern void Hang(); static void FatalErrorHang(void) __attribute__((noreturn)); -EWRAM_DATA_2 bool32 gNDS_DebugEnabled = {0}; -EWRAM_DATA_2 u8 gUnknown_203B150 = {0}; +EWRAM_INIT bool32 gNDS_DebugEnabled = {0}; +EWRAM_INIT u8 gUnknown_203B150 = {0}; ALIGNED(4) const char gFuncFileLineString[] = "func = '%s'\nfile = '%s' line = %5d"; @@ -21,17 +21,19 @@ ALIGNED(4) const char debug_fill14[] = "pksdir0"; ALIGNED(4) const char gDebugPrintPrefix[] = " Print "; ALIGNED(4) static const char debug_fill13[] = "pksdir0"; -ALIGNED(4) const char Performance_Text[] = "Performance"; -ALIGNED(4) const char MemoryCard_Text[] = "Memory Card"; -ALIGNED(4) const char Memory_Text[] = "Memory"; -ALIGNED(4) const char Flag_Text[] = "Flag"; -ALIGNED(4) const char Se_Text[] = "Se"; -ALIGNED(4) const char Bgm_Text[] = "Bgm"; -ALIGNED(4) const char Sound_Text[] = "Sound"; -ALIGNED(4) const char Dungeon_Text[] = "Dungeon"; -ALIGNED(4) const char GroundScript_Text[] = "GroundScript"; -ALIGNED(4) const char Ground_Text[] = "Ground"; - +static UNUSED EWRAM_INIT const char *sUnusedEwramDebugStrings[] = +{ + "Ground", + "GroundScript", + "Dungeon", + "Sound", + "Bgm", + "Se", + "Flag", + "Memory", + "Memory Card", + "Performance", +}; ALIGNED(4) const char gNotMountText[] = "not mount log system"; ALIGNED(4) static const char debug_fill9[] = "pksdir0"; diff --git a/src/quick_save_read.c b/src/quick_save_read.c index 2a16f9d4f..f9fff3920 100644 --- a/src/quick_save_read.c +++ b/src/quick_save_read.c @@ -5,7 +5,7 @@ #include "quick_save_read.h" #include "save.h" -static EWRAM_DATA_2 QuickSaveRead *sQuickSaveRead = {0}; +static EWRAM_INIT QuickSaveRead *sQuickSaveRead = {NULL}; #include "data/quick_save_read.h" @@ -62,4 +62,4 @@ void FinishQuickSaveRead(void) MemoryFree(sQuickSaveRead); sQuickSaveRead = 0; } -} \ No newline at end of file +} diff --git a/src/quick_save_write.c b/src/quick_save_write.c index bec6b1ff2..841e6f460 100644 --- a/src/quick_save_write.c +++ b/src/quick_save_write.c @@ -5,7 +5,7 @@ #include "quick_save_write.h" #include "save.h" -static EWRAM_DATA_2 QuickSaveWrite *sQuickSaveWrite = {0}; +static EWRAM_INIT QuickSaveWrite *sQuickSaveWrite = {NULL}; #include "data/quick_save_write.h" @@ -89,4 +89,4 @@ void FinishQuickSaveWrite() MemoryFree(sQuickSaveWrite); sQuickSaveWrite = NULL; } -} \ No newline at end of file +} diff --git a/src/save.c b/src/save.c index f8c84a9e1..fc5d3ecee 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "code_80118A4.h" #include "string_format.h" #include "code_8097670.h" @@ -12,12 +13,6 @@ #include "random.h" #include "save.h" -EWRAM_DATA s32 gUnknown_202DE28 = {0}; - -EWRAM_DATA_2 u32 gUnknown_203B17C = {0}; -EWRAM_DATA_2 char *gUnknown_203B180 = {0}; -EWRAM_DATA_2 struct UnkStruct_203B184 *gUnknown_203B184 = {0}; - // size: 0x800 struct unk_struct { @@ -30,8 +25,11 @@ struct unk_struct u32 padding[503]; }; -ALIGNED(4) static const char debug_fill8[] = "pksdir0"; -ALIGNED(4) const char sGameInternalVersion[] = _("POKE_DUNGEON__05"); +EWRAM_DATA s32 gUnknown_202DE28 = {0}; + +EWRAM_INIT u32 gUnknown_203B17C = {0}; +EWRAM_INIT const char *gUnknown_203B180 = {"POKE_DUNGEON__05"}; +EWRAM_INIT struct UnkStruct_203B184 *gUnknown_203B184 = {0}; ALIGNED(4) static const char fill_save0[] = _("pksdir0"); ALIGNED(4) static const char fill_save1[] = _("pksdir0"); @@ -72,7 +70,7 @@ void sub_8011C40(s32 x) gUnknown_202DE28 = x; } -char *GetGameInternalName(void) +const char *GetGameInternalName(void) { return gUnknown_203B180; // returns POKE_DUNGEON__05 } @@ -321,7 +319,7 @@ bool8 IsSaveCorrupted(void) u32 WriteSavetoPak(s32 *param_1, u32 param_2) { struct UnkStruct_sub_8011DAC *playerSave; - char *gameName; + const char *gameName; int saveStatus1; int saveStatus2; u8 *array_ptr; @@ -384,7 +382,7 @@ s32 sub_80121D4(s32 *a, u8 *src, s32 size) u32 sub_80121E0(u32 r0) { u32 temp; - char *gameName; + const char *gameName; u32 saveStatus; struct unk_struct *r4 = MemoryAlloc(sizeof(struct unk_struct), 5); temp = 0x1F; diff --git a/src/save_read.c b/src/save_read.c index de8870b24..5cb152502 100644 --- a/src/save_read.c +++ b/src/save_read.c @@ -5,7 +5,7 @@ #include "save.h" #include "save_read.h" -EWRAM_DATA_2 SavePakRead *gSavePakRead = {0}; +EWRAM_INIT SavePakRead *gSavePakRead = {NULL}; #include "data/save_read.h" @@ -62,4 +62,4 @@ void FinishReadSavePak(void) MemoryFree(gSavePakRead); gSavePakRead = NULL; } -} \ No newline at end of file +} diff --git a/src/save_write.c b/src/save_write.c index b295510cb..6cbfaeaa4 100644 --- a/src/save_write.c +++ b/src/save_write.c @@ -6,7 +6,7 @@ #include "save.h" #include "save_write.h" -static EWRAM_DATA_2 SavePakWrite *sSavePakWrite = {0}; +static EWRAM_INIT SavePakWrite *sSavePakWrite = {NULL}; #include "data/save_write.h" diff --git a/sym_ewram2.txt b/sym_ewram2.txt index d6c76999d..d699a0d05 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,13 +1,9 @@ .align 2 -.include "src/debug.o" - .space 0x2B -.include "src/save.o" -.include "src/save_read.o" -.include "src/save_write.o" -.include "src/quick_save_read.o" -.include "src/quick_save_write.o" + + + gUnknown_203B198: /* 203B198 (sub_8014248 - sub_8014A88) */ .space 0x60 diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index e33c03b52..c1f2b5fbb 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -15,3 +15,9 @@ .include "src/code_800DAC0.o" .include "src/code_800ED38.o" .include "src/code_8010EF0.o" +.include "src/debug.o" +.include "src/save.o" +.include "src/save_read.o" +.include "src/save_write.o" +.include "src/quick_save_read.o" +.include "src/quick_save_write.o" From 1639432546f7951e4208ffbf3bf9ddce41c7a4e4 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 15:28:34 +0100 Subject: [PATCH 06/23] up to gUnknown_203B2A0 --- data/data_8270000.s | 67 ------------------------------------ src/code_8012A18_1.c | 2 +- src/code_8015080.c | 2 +- src/code_801602C.c | 2 +- src/code_801AFA4.c | 2 +- src/code_801B3C0.c | 2 +- src/code_801B60C.c | 2 +- src/code_801C8C4.c | 8 ++--- src/code_801D014.c | 4 +-- src/code_801D9E4.c | 2 +- src/code_801EE10.c | 2 +- src/code_801F428.c | 4 +-- src/code_801F808.c | 2 +- src/code_80227B8.c | 2 +- src/code_8023144.c | 8 ++--- src/felicity_bank.c | 2 +- src/gulpin_shop.c | 2 +- src/gulpin_shop_801FB50.c | 2 +- src/hints_menu1.c | 2 +- src/hints_menu2.c | 2 +- src/iq_skill_info_menu.c | 2 +- src/iq_skill_list_menu.c | 2 +- src/iq_skill_menu.c | 2 +- src/kangaskhan_storage1.c | 2 +- src/kangaskhan_storage2.c | 2 +- src/kecleon_bros1.c | 2 +- src/kecleon_bros2.c | 4 +-- src/kecleon_bros3.c | 4 +-- src/kecleon_bros4.c | 6 ++-- src/options_menu1.c | 2 +- src/options_menu2.c | 2 +- src/string_format.c | 72 ++++++++++++++++++++++++--------------- src/wigglytuff_shop1.c | 8 ++--- src/wigglytuff_shop2.c | 2 +- src/wigglytuff_shop3.c | 2 +- sym_ewram2.txt | 45 ------------------------ sym_ewram_init.txt | 34 ++++++++++++++++++ 37 files changed, 125 insertions(+), 189 deletions(-) diff --git a/data/data_8270000.s b/data/data_8270000.s index a60aa4d2a..32e5ca3e3 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -3,73 +3,6 @@ .global gUnknown_8270000 gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 - -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x0f, 0x00 -.byte 0x1a, 0x00, 0x05, 0x00 -.byte 0x07, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x40, 0x00, 0x00, 0x00 -.byte 0x07, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 .byte 0x02, 0x00, 0x00, 0x00 .byte 0x01, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 diff --git a/src/code_8012A18_1.c b/src/code_8012A18_1.c index 90c86568b..f22d32e7b 100644 --- a/src/code_8012A18_1.c +++ b/src/code_8012A18_1.c @@ -24,7 +24,7 @@ struct unkStruct_203B1FC u8 unkFC[54]; }; -extern struct unkStruct_203B1FC *gUnknown_203B1FC; +EWRAM_INIT struct unkStruct_203B1FC *gUnknown_203B1FC = NULL; s32 sub_8015F44(void) { diff --git a/src/code_8015080.c b/src/code_8015080.c index 8333ad277..f90e6288a 100644 --- a/src/code_8015080.c +++ b/src/code_8015080.c @@ -15,7 +15,7 @@ struct unkStruct_203B1F8 u8 buffer[0x400]; }; -EWRAM_DATA_2 struct unkStruct_203B1F8 *gUnknown_203B1F8 = {0}; +EWRAM_INIT struct unkStruct_203B1F8 *gUnknown_203B1F8 = {NULL}; const UnkTextStruct2 gUnknown_80DAF70 = { 0x00, 0x00, 0x00, 0x00, diff --git a/src/code_801602C.c b/src/code_801602C.c index e32492bda..7e166967b 100644 --- a/src/code_801602C.c +++ b/src/code_801602C.c @@ -9,7 +9,7 @@ #include "text_util.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B200 *sUnknown_203B200 = {0}; +static EWRAM_INIT struct unkStruct_203B200 *sUnknown_203B200 = {NULL}; #include "data/code_801602C.h" diff --git a/src/code_801AFA4.c b/src/code_801AFA4.c index be210b9d1..9e1a7999e 100644 --- a/src/code_801AFA4.c +++ b/src/code_801AFA4.c @@ -9,7 +9,7 @@ #include "moves.h" #include "pokemon_mid.h" -static EWRAM_DATA_2 unkStruct_203B22C *sUnknown_203B22C = {0}; +static EWRAM_INIT unkStruct_203B22C *sUnknown_203B22C = {NULL}; #include "data/code_801AFA4.h" diff --git a/src/code_801B3C0.c b/src/code_801B3C0.c index 934f5bcf1..0da13b7cb 100644 --- a/src/code_801B3C0.c +++ b/src/code_801B3C0.c @@ -10,7 +10,7 @@ #include "sprite.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B230 *sUnknown_203B230 = {0}; +static EWRAM_INIT unkStruct_203B230 *sUnknown_203B230 = {NULL}; #include "data/code_801B3C0.h" // 80DBA4C diff --git a/src/code_801B60C.c b/src/code_801B60C.c index de11bbf51..3873b1a66 100644 --- a/src/code_801B60C.c +++ b/src/code_801B60C.c @@ -16,7 +16,7 @@ #include "pokemon.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B234 *sUnknown_203B234 = {0}; +static EWRAM_INIT unkStruct_203B234 *sUnknown_203B234 = {NULL}; #include "data/code_801B60C.h" // 80DBA58 diff --git a/src/code_801C8C4.c b/src/code_801C8C4.c index ffe5c85b3..c8ade824b 100644 --- a/src/code_801C8C4.c +++ b/src/code_801C8C4.c @@ -8,10 +8,10 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B244 *sUnknown_203B244 = {0}; -static EWRAM_DATA_2 u32 sUnknown_203B248 = {0}; -static EWRAM_DATA_2 u16 sUnknown_203B24C = {0}; -static EWRAM_DATA_2 u16 sUnknown_203B24E = {0}; +static EWRAM_INIT struct unkStruct_203B244 *sUnknown_203B244 = {NULL}; +static EWRAM_INIT u32 sUnknown_203B248 = {0}; +static EWRAM_INIT u16 sUnknown_203B24C = {0}; +static EWRAM_INIT u16 sUnknown_203B24E = {0}; #include "data/code_801C8C4.h" diff --git a/src/code_801D014.c b/src/code_801D014.c index 9070cffc7..0769db871 100644 --- a/src/code_801D014.c +++ b/src/code_801D014.c @@ -29,8 +29,8 @@ #include "wonder_mail_802C4C8.h" #include "wonder_mail_802C860.h" -static EWRAM_DATA_2 struct unk_203B250 *sUnknown_203B250 = {0}; -static EWRAM_DATA_2 u32 sUnknown_203B254 = {0}; +static EWRAM_INIT struct unk_203B250 *sUnknown_203B250 = {NULL}; +static EWRAM_INIT u32 sUnknown_203B254 = {0}; extern const struct FileArchive gTitleMenuFileArchive; diff --git a/src/code_801D9E4.c b/src/code_801D9E4.c index c08511f99..bb9c1acf6 100644 --- a/src/code_801D9E4.c +++ b/src/code_801D9E4.c @@ -10,7 +10,7 @@ #include "text.h" #include "structs/struct_sub80095e4.h" -static EWRAM_DATA_2 struct struct_Sub80095E4_2 *sUnknown_203B258 = {0}; +static EWRAM_INIT struct struct_Sub80095E4_2 *sUnknown_203B258 = {NULL}; extern struct unkStruct_81188F0 gUnknown_81188F0[10]; diff --git a/src/code_801EE10.c b/src/code_801EE10.c index 64419cd96..8195a3377 100644 --- a/src/code_801EE10.c +++ b/src/code_801EE10.c @@ -10,7 +10,7 @@ #include "code_80118A4.h" #include "menu_input.h" -EWRAM_DATA_2 unkStruct_203B270 *gUnknown_203B270 = {0}; +EWRAM_INIT unkStruct_203B270 *gUnknown_203B270 = {NULL}; const UnkTextStruct2 gUnknown_80DC240 = { 0x00, 0x00, 0x00, 0x00, diff --git a/src/code_801F428.c b/src/code_801F428.c index 0ad2978d0..f6a3dc033 100644 --- a/src/code_801F428.c +++ b/src/code_801F428.c @@ -18,9 +18,7 @@ struct unkStruct_203B274 unkStruct_808E218_arg unk8; struct_Sub80095E4_2 s348; }; -EWRAM_DATA_2 struct unkStruct_203B274 *gUnknown_203B274 = {0}; - -extern u8 gFormatBuffer_Monsters[]; +EWRAM_INIT struct unkStruct_203B274 *gUnknown_203B274 = {NULL}; static const UnkTextStruct2 sUnknown_80DC2AC = { 0, 0, 0, 0, diff --git a/src/code_801F808.c b/src/code_801F808.c index 63602e66e..7e42bc5a9 100644 --- a/src/code_801F808.c +++ b/src/code_801F808.c @@ -29,7 +29,7 @@ struct unkStruct_203B278 MenuInputStructSub unkC8; }; -EWRAM_DATA_2 struct unkStruct_203B278 *gUnknown_203B278 = {0}; +EWRAM_INIT struct unkStruct_203B278 *gUnknown_203B278 = {NULL}; static const UnkTextStruct2 sUnknown_80DC2F8 = { 0, 0, 0, 0, diff --git a/src/code_80227B8.c b/src/code_80227B8.c index 0af45692d..1558bce6d 100644 --- a/src/code_80227B8.c +++ b/src/code_80227B8.c @@ -16,7 +16,7 @@ #include "pokemon_3.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B294 *sUnknown_203B294 = {0}; +static EWRAM_INIT unkStruct_203B294 *sUnknown_203B294 = {NULL}; #include "data/code_80227B8.h" diff --git a/src/code_8023144.c b/src/code_8023144.c index faa295813..5d6736145 100644 --- a/src/code_8023144.c +++ b/src/code_8023144.c @@ -13,11 +13,11 @@ #include "pokemon_3.h" #include "text.h" -static EWRAM_DATA_2 u32 gUnknown_203B298 = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B29C = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B29E = {0}; +static EWRAM_INIT u32 gUnknown_203B298 = {1}; +static EWRAM_INIT u16 gUnknown_203B29C = {0}; +static EWRAM_INIT u16 gUnknown_203B29E = {0}; -static IWRAM_DATA unkStruct_3001B5C *gUnknown_3001B5C = {0}; +static IWRAM_DATA unkStruct_3001B5C *gUnknown_3001B5C = {NULL}; #include "data/code_8023144.h" diff --git a/src/felicity_bank.c b/src/felicity_bank.c index e571720e1..1280b9034 100644 --- a/src/felicity_bank.c +++ b/src/felicity_bank.c @@ -10,7 +10,7 @@ #include "pokemon.h" #include "text.h" -static EWRAM_DATA_2 FelicityBankWork *sFelicityBankWork = {0}; +static EWRAM_INIT FelicityBankWork *sFelicityBankWork = {NULL}; #include "data/felicity_bank.h" diff --git a/src/gulpin_shop.c b/src/gulpin_shop.c index 8be813358..4db64dde4 100644 --- a/src/gulpin_shop.c +++ b/src/gulpin_shop.c @@ -13,7 +13,7 @@ #include "moves.h" #include "text.h" -static EWRAM_DATA_2 GulpinShopWork *sGulpinShopWork = {0}; +static EWRAM_INIT GulpinShopWork *sGulpinShopWork = {NULL}; #include "data/gulpin_shop.h" diff --git a/src/gulpin_shop_801FB50.c b/src/gulpin_shop_801FB50.c index 7759c94b0..6e23d53a7 100644 --- a/src/gulpin_shop_801FB50.c +++ b/src/gulpin_shop_801FB50.c @@ -19,7 +19,7 @@ #include "pokemon_mid.h" #include "text.h" -EWRAM_DATA_2 unkStruct_203B27C *gUnknown_203B27C = {0}; +EWRAM_INIT unkStruct_203B27C *gUnknown_203B27C = {NULL}; #include "data/gulpin_shop_801FB50.h" diff --git a/src/hints_menu1.c b/src/hints_menu1.c index aaa79b90b..fc94254bb 100644 --- a/src/hints_menu1.c +++ b/src/hints_menu1.c @@ -9,7 +9,7 @@ #include "text.h" #include "structs/struct_sub80095e4.h" -static EWRAM_DATA_2 struct_Sub80095E4 *sUnknown_203B264 = {0}; +static EWRAM_INIT struct_Sub80095E4 *sUnknown_203B264 = {NULL}; #include "data/hints_menu1.h" diff --git a/src/hints_menu2.c b/src/hints_menu2.c index 7c05d2472..f37017e67 100644 --- a/src/hints_menu2.c +++ b/src/hints_menu2.c @@ -9,7 +9,7 @@ #include "text.h" #include "structs/struct_sub80095e4.h" -static EWRAM_DATA_2 struct_Sub80095E4_2 *sUnknown_203B268 = {0}; +static EWRAM_INIT struct_Sub80095E4_2 *sUnknown_203B268 = {NULL}; #include "data/hints_menu2.h" diff --git a/src/iq_skill_info_menu.c b/src/iq_skill_info_menu.c index 66142d3d2..1a9091f84 100644 --- a/src/iq_skill_info_menu.c +++ b/src/iq_skill_info_menu.c @@ -11,7 +11,7 @@ #include "sprite.h" #include "text.h" -static EWRAM_DATA_2 struct IQSkillInfoMenu *sIQSkillInfoMenu = {0}; +static EWRAM_INIT struct IQSkillInfoMenu *sIQSkillInfoMenu = {NULL}; #include "data/iq_skill_info_menu.h" diff --git a/src/iq_skill_list_menu.c b/src/iq_skill_list_menu.c index fa684fcb6..8ae25c0a7 100644 --- a/src/iq_skill_list_menu.c +++ b/src/iq_skill_list_menu.c @@ -10,7 +10,7 @@ #include "pokemon_3.h" #include "text.h" -static EWRAM_DATA_2 struct IQSkillListMenu *sIQSkillListMenu = {0}; +static EWRAM_INIT struct IQSkillListMenu *sIQSkillListMenu = {NULL}; #include "data/iq_skill_list_menu.h" diff --git a/src/iq_skill_menu.c b/src/iq_skill_menu.c index 0a90295d3..b06603f73 100644 --- a/src/iq_skill_menu.c +++ b/src/iq_skill_menu.c @@ -11,7 +11,7 @@ #include "pokemon_3.h" #include "text.h" -static EWRAM_DATA_2 struct IQSkillMenu *sIQSkillMenu = {0}; +static EWRAM_INIT struct IQSkillMenu *sIQSkillMenu = {NULL}; #include "data/iq_skill_menu.h" diff --git a/src/kangaskhan_storage1.c b/src/kangaskhan_storage1.c index bf6a4a08e..410fbd3c3 100644 --- a/src/kangaskhan_storage1.c +++ b/src/kangaskhan_storage1.c @@ -13,7 +13,7 @@ #include "pokemon.h" #include "text.h" -EWRAM_DATA_2 struct KangaskhanStorageWork *gKangaskhanStorageWork = {0}; +EWRAM_INIT struct KangaskhanStorageWork *gKangaskhanStorageWork = {NULL}; #include "data/kangaskhan_storage1.h" // 80DB748 diff --git a/src/kangaskhan_storage2.c b/src/kangaskhan_storage2.c index 1989f52ec..830d2490c 100644 --- a/src/kangaskhan_storage2.c +++ b/src/kangaskhan_storage2.c @@ -12,7 +12,7 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B20C *sUnknown_203B20C = {0}; +static EWRAM_INIT unkStruct_203B20C *sUnknown_203B20C = {NULL}; #include "data/kangaskhan_storage2.h" diff --git a/src/kecleon_bros1.c b/src/kecleon_bros1.c index d4e8eb169..f42766aca 100644 --- a/src/kecleon_bros1.c +++ b/src/kecleon_bros1.c @@ -17,7 +17,7 @@ #include "pokemon.h" #include "text.h" -static EWRAM_DATA_2 KecleonBrosWork1 *sKecleonBrosWork1 = {0}; +static EWRAM_INIT KecleonBrosWork1 *sKecleonBrosWork1 = {NULL}; #include "data/kecleon_bros1.h" diff --git a/src/kecleon_bros2.c b/src/kecleon_bros2.c index 1389f1331..e071f6169 100644 --- a/src/kecleon_bros2.c +++ b/src/kecleon_bros2.c @@ -11,8 +11,8 @@ #include "text.h" #include "structs/struct_sub80095e4.h" -static EWRAM_DATA_2 struct_Sub80095E4_2 *gUnknown_203B214 = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B218 = {0}; +static EWRAM_INIT struct_Sub80095E4_2 *gUnknown_203B214 = {NULL}; +static EWRAM_INIT u16 gUnknown_203B218 = {0}; #include "data/kecleon_bros2.h" diff --git a/src/kecleon_bros3.c b/src/kecleon_bros3.c index a64ca4f7c..795957ecd 100644 --- a/src/kecleon_bros3.c +++ b/src/kecleon_bros3.c @@ -11,8 +11,8 @@ #include "text.h" #include "structs/struct_sub80095e4.h" -static EWRAM_DATA_2 struct_Sub80095E4_2 *gUnknown_203B21C = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B220 = {0}; +static EWRAM_INIT struct_Sub80095E4_2 *gUnknown_203B21C = {NULL}; +static EWRAM_INIT u16 gUnknown_203B220 = {0}; #include "data/kecleon_bros3.h" diff --git a/src/kecleon_bros4.c b/src/kecleon_bros4.c index 7e018a1ba..cb75b5065 100644 --- a/src/kecleon_bros4.c +++ b/src/kecleon_bros4.c @@ -12,9 +12,9 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B224 *gUnknown_203B224 = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B228 = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B22A = {0}; +static EWRAM_INIT unkStruct_203B224 *gUnknown_203B224 = {NULL}; +static EWRAM_INIT u16 gUnknown_203B228 = {0}; +static EWRAM_INIT u16 gUnknown_203B22A = {0}; #include "data/kecleon_bros4.h" diff --git a/src/options_menu1.c b/src/options_menu1.c index 9044fdf04..4e0222a96 100644 --- a/src/options_menu1.c +++ b/src/options_menu1.c @@ -33,7 +33,7 @@ enum OptionsMenuStates OPTIONS_MENU_CONFIRM_NEW_OPTIONS, }; -static EWRAM_DATA_2 struct unkStruct_203B25C *sUnknown_203B25C = {0}; +static EWRAM_INIT struct unkStruct_203B25C *sUnknown_203B25C = {NULL}; #include "data/options_menu1.h" diff --git a/src/options_menu2.c b/src/options_menu2.c index afc930945..80fe8e084 100644 --- a/src/options_menu2.c +++ b/src/options_menu2.c @@ -9,7 +9,7 @@ #include "options_menu2.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B260 *sUnknown_203B260 = {0}; +static EWRAM_INIT struct unkStruct_203B260 *sUnknown_203B260 = {NULL}; #include "data/options_menu2.h" diff --git a/src/string_format.c b/src/string_format.c index fcd6b0938..338be3397 100644 --- a/src/string_format.c +++ b/src/string_format.c @@ -100,7 +100,6 @@ struct UnkStruct_203B198 struct SubStruct_203B198 unk48; }; -extern struct UnkStruct_203B198 gUnknown_203B198; extern UnkTextStruct1 gUnknown_2027370[4]; extern void (*gUnknown_203B088)(s32 a0); @@ -177,6 +176,23 @@ static UNUSED EWRAM_DATA u8 sUnusedEwram1[4] = {0}; static EWRAM_DATA MenuInputStructSub gUnknown_202EC28 = {0}; +static EWRAM_INIT struct UnkStruct_203B198 sUnknown_203B198 = { + .unk0 = { + .unk8 = {2, 15}, + .unkC = 26, + .unkE = 5, + .unk10 = 7, + }, + .unk18 = 0x40, + .unk1C = 7, + .unk30 = { + .unk4 = 3, + }, + .unk48 = { + .unk4 = 3, + } +}; + void sub_8014144(void) { gUnknown_202E744 = 0; @@ -226,41 +242,41 @@ void CreateMenuDialogueBoxAndPortrait(const u8 *text, void *a1, u32 r9, const Me gUnknown_202EC1C = r9; sub_801317C(&gUnknown_202EC28); if (flags & 0x10) { - gUnknown_203B198.unk0 = gUnknown_80D48DC; + sUnknown_203B198.unk0 = gUnknown_80D48DC; } else { - gUnknown_203B198.unk0 = gUnknown_80D48C4; + sUnknown_203B198.unk0 = gUnknown_80D48C4; } - gUnknown_203B198.unk24 = 0; - gUnknown_203B198.unk26 = 0; - gUnknown_203B198.unk28 = 0; - gUnknown_203B198.unk18 = 0x40; + sUnknown_203B198.unk24 = 0; + sUnknown_203B198.unk26 = 0; + sUnknown_203B198.unk28 = 0; + sUnknown_203B198.unk18 = 0x40; if (monPortraitPtr != NULL && monPortraitPtr->faceData != NULL && monPortraitPtr->faceData->sprites[monPortraitPtr->spriteId].gfx != 0) { s32 i; - gUnknown_203B198.unk20.x = monPortraitPtr->pos.x; - gUnknown_203B198.unk20.y = monPortraitPtr->pos.y; - gUnknown_203B198.unk24 = 5; - gUnknown_203B198.unk26 = 5; - gUnknown_203B198.unk28 = 5; + sUnknown_203B198.unk20.x = monPortraitPtr->pos.x; + sUnknown_203B198.unk20.y = monPortraitPtr->pos.y; + sUnknown_203B198.unk24 = 5; + sUnknown_203B198.unk26 = 5; + sUnknown_203B198.unk28 = 5; for (i = 0; i < 16; i++) { SetBGPaletteBufferColorArray(224 + i, &monPortraitPtr->faceData->sprites[monPortraitPtr->spriteId].pal[i]); } portraitOn = TRUE; if (monPortraitPtr->unkE) { - gUnknown_203B198.unk1C = 7; + sUnknown_203B198.unk1C = 7; } else { - gUnknown_203B198.unk1C = 5; + sUnknown_203B198.unk1C = 5; } } - gUnknown_203B198.unk30 = gUnknown_80D48AC; - gUnknown_203B198.unk48 = gUnknown_80D48AC; + sUnknown_203B198.unk30 = gUnknown_80D48AC; + sUnknown_203B198.unk48 = gUnknown_80D48AC; ResetUnusedInputStruct(); - xxx_call_save_unk_text_struct_800641C(&gUnknown_203B198.unk0, TRUE, TRUE); + xxx_call_save_unk_text_struct_800641C(&sUnknown_203B198.unk0, TRUE, TRUE); gUnknown_202E748.unk0 = 4; gUnknown_202E748.unk2 = 4; gUnknown_202E748.unk8 = 0x70; @@ -632,7 +648,7 @@ static void sub_8014A88(void) if (menuItem->text == NULL) break; - r5 += 12;; + r5 += 12; FormatString(menuItem->text, text, text + sizeof(text), 0); val = sub_8008ED0(text); if (r7 < val) { @@ -644,21 +660,21 @@ static void sub_8014A88(void) if (r5 % 8) r2++; - gUnknown_203B198.unk30.unk4 = gUnknown_202EC10; + sUnknown_203B198.unk30.unk4 = gUnknown_202EC10; r1 = r7 / 8; r1 += 2; - gUnknown_203B198.unk30.unkC = r1; - gUnknown_203B198.unk30.unk10 = r2; - gUnknown_203B198.unk30.unkE = r2; - gUnknown_203B198.unk30.unk8 = 28 - r1; - gUnknown_203B198.unk30.unkA = 14 - r2; - gUnknown_203B198.unk0.unk0 = 0x80; - gUnknown_203B198.unk18 = 0xC0; + sUnknown_203B198.unk30.unkC = r1; + sUnknown_203B198.unk30.unk10 = r2; + sUnknown_203B198.unk30.unkE = r2; + sUnknown_203B198.unk30.unk8 = 28 - r1; + sUnknown_203B198.unk30.unkA = 14 - r2; + sUnknown_203B198.unk0.unk0 = 0x80; + sUnknown_203B198.unk18 = 0xC0; if (sNeverWrittenToUnknownStructPtr != NULL) { - gUnknown_203B198.unk48 = sNeverWrittenToUnknownStructPtr->unk0; + sUnknown_203B198.unk48 = sNeverWrittenToUnknownStructPtr->unk0; } ResetUnusedInputStruct(); - xxx_call_save_unk_text_struct_800641C(&gUnknown_203B198.unk0, TRUE, FALSE); + xxx_call_save_unk_text_struct_800641C(&sUnknown_203B198.unk0, TRUE, FALSE); sub_8012D60(&gUnknown_202EBC0, sDialogueMenuItems, gUnknown_80D48A0, gUnknown_202EC18, gUnknown_202EC1C, 2); if (sNeverWrittenToUnknownStructPtr != NULL) { sub_80073B8(3); diff --git a/src/wigglytuff_shop1.c b/src/wigglytuff_shop1.c index 75366c121..4a62baf7d 100644 --- a/src/wigglytuff_shop1.c +++ b/src/wigglytuff_shop1.c @@ -12,10 +12,10 @@ #include "text.h" #include "wigglytuff_shop1.h" -static EWRAM_DATA_2 WigglytuffShop1Work *sWigglytuffShop1Work = {0}; -static EWRAM_DATA_2 u32 sUnknown_203B284 = {0}; -static EWRAM_DATA_2 u16 sUnknown_203B288 = {0}; -static EWRAM_DATA_2 u16 sUnknown_203B28A = {0}; +static EWRAM_INIT WigglytuffShop1Work *sWigglytuffShop1Work = {NULL}; +static EWRAM_INIT u32 sUnknown_203B284 = {0}; +static EWRAM_INIT u16 sUnknown_203B288 = {0}; +static EWRAM_INIT u16 sUnknown_203B28A = {0}; #include "data/wigglytuff_shop1.h" diff --git a/src/wigglytuff_shop2.c b/src/wigglytuff_shop2.c index d4066b24c..da0764b3b 100644 --- a/src/wigglytuff_shop2.c +++ b/src/wigglytuff_shop2.c @@ -13,7 +13,7 @@ #include "text.h" #include "wigglytuff_shop2.h" -static EWRAM_DATA_2 WigglytuffShop2Work *sWigglytuffShop2Work = {0}; +static EWRAM_INIT WigglytuffShop2Work *sWigglytuffShop2Work = {NULL}; #include "data/wigglytuff_shop2.h" diff --git a/src/wigglytuff_shop3.c b/src/wigglytuff_shop3.c index 9523949fc..eabf966ef 100644 --- a/src/wigglytuff_shop3.c +++ b/src/wigglytuff_shop3.c @@ -17,7 +17,7 @@ #include "wigglytuff_shop2.h" #include "wigglytuff_shop3.h" -static EWRAM_DATA_2 WigglytuffShop3Work *sWigglytuffShop3Work = {0}; +static EWRAM_INIT WigglytuffShop3Work *sWigglytuffShop3Work = {NULL}; #include "data/wigglytuff_shop3.h" diff --git a/sym_ewram2.txt b/sym_ewram2.txt index d699a0d05..69f8d6365 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,50 +1,5 @@ .align 2 - - - - - -gUnknown_203B198: /* 203B198 (sub_8014248 - sub_8014A88) */ - .space 0x60 - -.include "src/code_8015080.o" - -gUnknown_203B1FC: /* 203B1FC (sub_80151C0 - sub_8015F84) */ - .space 0x4 - -.include "src/code_801602C.o" -.include "src/felicity_bank.o" -.include "src/kangaskhan_storage1.o" -.include "src/kangaskhan_storage2.o" -.include "src/kecleon_bros1.o" -.include "src/kecleon_bros2.o" -.include "src/kecleon_bros3.o" -.include "src/kecleon_bros4.o" -.include "src/code_801AFA4.o" -.include "src/code_801B3C0.o" -.include "src/code_801B60C.o" -.include "src/iq_skill_menu.o" -.include "src/iq_skill_list_menu.o" -.include "src/iq_skill_info_menu.o" -.include "src/code_801C8C4.o" -.include "src/code_801D014.o" -.include "src/code_801D9E4.o" -.include "src/options_menu1.o" -.include "src/options_menu2.o" -.include "src/hints_menu1.o" -.include "src/hints_menu2.o" -.include "src/gulpin_shop.o" -.include "src/code_801EE10.o" -.include "src/code_801F428.o" -.include "src/code_801F808.o" -.include "src/gulpin_shop_801FB50.o" -.include "src/wigglytuff_shop1.o" -.include "src/wigglytuff_shop2.o" -.include "src/wigglytuff_shop3.o" -.include "src/code_80227B8.o" -.include "src/code_8023144.o" - gUnknown_203B2A0: /* 203B2A0 (sub_8023868 - sub_8023C60) */ .space 0x4 diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index c1f2b5fbb..184f3f5ce 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -21,3 +21,37 @@ .include "src/save_write.o" .include "src/quick_save_read.o" .include "src/quick_save_write.o" +.include "src/string_format.o" +.include "src/code_8015080.o" +.include "src/code_8012A18_1.o" +.include "src/code_801602C.o" +.include "src/felicity_bank.o" +.include "src/kangaskhan_storage1.o" +.include "src/kangaskhan_storage2.o" +.include "src/kecleon_bros1.o" +.include "src/kecleon_bros2.o" +.include "src/kecleon_bros3.o" +.include "src/kecleon_bros4.o" +.include "src/code_801AFA4.o" +.include "src/code_801B3C0.o" +.include "src/code_801B60C.o" +.include "src/iq_skill_menu.o" +.include "src/iq_skill_list_menu.o" +.include "src/iq_skill_info_menu.o" +.include "src/code_801C8C4.o" +.include "src/code_801D014.o" +.include "src/code_801D9E4.o" +.include "src/options_menu1.o" +.include "src/options_menu2.o" +.include "src/hints_menu1.o" +.include "src/hints_menu2.o" +.include "src/gulpin_shop.o" +.include "src/code_801EE10.o" +.include "src/code_801F428.o" +.include "src/code_801F808.o" +.include "src/gulpin_shop_801FB50.o" +.include "src/wigglytuff_shop1.o" +.include "src/wigglytuff_shop2.o" +.include "src/wigglytuff_shop3.o" +.include "src/code_80227B8.o" +.include "src/code_8023144.o" From d8bb3a7338ae1fa6ea244ec594e1947b17d02771 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 17:10:15 +0100 Subject: [PATCH 07/23] gUnknown_203B3B8 --- data/data_8270000.s | 82 ----------------------------------- src/adventure_log.c | 2 +- src/code_8023144.c | 4 ++ src/code_8024458.c | 2 +- src/code_802DB28.c | 2 +- src/code_802DE84.c | 2 +- src/code_8031D70.c | 2 +- src/code_8072F3C.c | 2 +- src/credits1.c | 2 +- src/credits2.c | 2 +- src/friend_area_action_menu.c | 2 +- src/friend_list_menu.c | 2 +- src/friend_rescue.c | 2 +- src/load_screen.c | 19 +++++--- src/luminous_cave.c | 2 +- src/mailbox.c | 2 +- src/main_menu1.c | 2 +- src/main_menu2.c | 8 ++-- src/makuhita_dojo1.c | 2 +- src/makuhita_dojo2.c | 2 +- src/mission_reward.c | 5 +-- src/other_menus1.c | 4 +- src/party_list_menu.c | 2 +- src/pelipper_board.c | 2 +- src/pokemon_news1.c | 6 +-- src/pokemon_news2.c | 2 +- src/pokemon_news3.c | 4 +- src/post_office_guide1.c | 2 +- src/post_office_guide2.c | 2 +- src/rescue_password_menu.c | 6 +-- src/save_menu.c | 2 +- src/thank_you_wonder_mail.c | 2 +- src/trade_items_menu.c | 2 +- src/unk_menu_203B360.c | 2 +- src/wonder_mail.c | 2 +- src/wonder_mail_2.c | 2 +- src/wonder_mail_3_mid.c | 2 +- src/wonder_mail_4.c | 2 +- src/wonder_mail_5.c | 2 +- src/wonder_mail_6.c | 2 +- src/wonder_mail_802C10C.c | 4 +- src/wonder_mail_802C4C8.c | 4 +- src/wonder_mail_802C860.c | 2 +- src/wonder_mail_802CDD4.c | 2 +- src/wonder_mail_802D098.c | 2 +- sym_ewram2.txt | 54 ----------------------- sym_ewram_init.txt | 43 ++++++++++++++++++ 47 files changed, 114 insertions(+), 197 deletions(-) diff --git a/data/data_8270000.s b/data/data_8270000.s index 32e5ca3e3..999cc2183 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -3,88 +3,6 @@ .global gUnknown_8270000 gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 -.byte 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x10, 0x00, 0x00, 0x00 -.byte 0x11, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0xde, 0xff, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gUnkData_80E7628 -.byte 0x05, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 -.byte 0x0c, 0x00, 0x00, 0x00 -.byte 0x0c, 0x00, 0x00, 0x00 -.byte 0x0e, 0x00, 0x00, 0x00 -.byte 0x0e, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x00, 0x00 -.byte 0x0e, 0x00, 0x00, 0x00 -.byte 0x0c, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x00, 0x00 -.byte 0x0b, 0x00, 0x00, 0x00 -.byte 0x0b, 0x00, 0x00, 0x00 -.byte 0x0b, 0x00, 0x00, 0x00 -.byte 0x10, 0x00, 0x00, 0x00 -.byte 0x11, 0x00, 0x00, 0x00 -.byte 0x12, 0x00, 0x00, 0x00 -.byte 0x13, 0x00, 0x00, 0x00 -.byte 0x14, 0x00, 0x00, 0x00 -.byte 0x15, 0x00, 0x00, 0x00 -.byte 0x1a, 0x00, 0x00, 0x00 -.byte 0x18, 0x00, 0x00, 0x00 -.byte 0x1b, 0x00, 0x00, 0x00 -.byte 0x16, 0x00, 0x00, 0x00 -.byte 0x19, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 diff --git a/src/adventure_log.c b/src/adventure_log.c index 1b8f3fd21..32846c6b2 100644 --- a/src/adventure_log.c +++ b/src/adventure_log.c @@ -11,7 +11,7 @@ #include "text.h" #include "structs/struct_sub80095e4.h" -static EWRAM_DATA_2 struct_Sub80095E4_2 *sAdventureLog = {0}; +static EWRAM_INIT struct_Sub80095E4_2 *sAdventureLog = {NULL}; #include "data/adventure_log.h" diff --git a/src/code_8023144.c b/src/code_8023144.c index 5d6736145..3ffd6fdff 100644 --- a/src/code_8023144.c +++ b/src/code_8023144.c @@ -16,6 +16,10 @@ static EWRAM_INIT u32 gUnknown_203B298 = {1}; static EWRAM_INIT u16 gUnknown_203B29C = {0}; static EWRAM_INIT u16 gUnknown_203B29E = {0}; +EWRAM_INIT s32 gUnknown_203B2A0 = 2; +EWRAM_INIT s32 gUnknown_203B2A4 = 1; +EWRAM_INIT u16 gUnknown_203B2A8 = 0; +EWRAM_INIT u16 gUnknown_203B2AA = 0; static IWRAM_DATA unkStruct_3001B5C *gUnknown_3001B5C = {NULL}; diff --git a/src/code_8024458.c b/src/code_8024458.c index a900360a5..7734c9af6 100644 --- a/src/code_8024458.c +++ b/src/code_8024458.c @@ -11,7 +11,7 @@ #include "pokemon_3.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B2AC *sUnknown_203B2AC = {0}; +static EWRAM_INIT struct unkStruct_203B2AC *sUnknown_203B2AC = {NULL}; #include "data/code_8024458.h" diff --git a/src/code_802DB28.c b/src/code_802DB28.c index ac45cfda9..8205833b3 100644 --- a/src/code_802DB28.c +++ b/src/code_802DB28.c @@ -12,7 +12,7 @@ #include "pokemon.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B2FC *sUnknown_203B2FC = {0}; +static EWRAM_INIT struct unkStruct_203B2FC *sUnknown_203B2FC = {NULL}; #include "data/code_802DB28.h" diff --git a/src/code_802DE84.c b/src/code_802DE84.c index 5b502fe63..943d909a1 100644 --- a/src/code_802DE84.c +++ b/src/code_802DE84.c @@ -8,7 +8,7 @@ #include "pokemon_mail.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B300 *sUnknown_203B300 = {0}; +static EWRAM_INIT struct unkStruct_203B300 *sUnknown_203B300 = {NULL}; #include "data/code_802DE84.h" diff --git a/src/code_8031D70.c b/src/code_8031D70.c index 3903193d4..50fd743b0 100644 --- a/src/code_8031D70.c +++ b/src/code_8031D70.c @@ -23,7 +23,7 @@ struct unkStruct_203B334 u8 unk78[4]; }; -EWRAM_DATA_2 struct unkStruct_203B334 *gUnknown_203B334 = {0}; +EWRAM_INIT struct unkStruct_203B334 *gUnknown_203B334 = {NULL}; extern unkStruct_203B480 *gUnknown_203B480; const UnkTextStruct2 gUnknown_80E1FA8 = { diff --git a/src/code_8072F3C.c b/src/code_8072F3C.c index 48473590d..29c6f7496 100644 --- a/src/code_8072F3C.c +++ b/src/code_8072F3C.c @@ -27,7 +27,7 @@ struct unkStruct_203B314 struct struct_Sub80095E4_2 sBC; }; -EWRAM_DATA_2 struct unkStruct_203B314 *gUnknown_203B314 = {0}; +EWRAM_INIT struct unkStruct_203B314 *gUnknown_203B314 = {NULL}; const UnkTextStruct2 gUnknown_80E06FC = { 0x00, 0x00, 0x00, 0x00, diff --git a/src/credits1.c b/src/credits1.c index 8e66b3580..0008e6101 100644 --- a/src/credits1.c +++ b/src/credits1.c @@ -6,7 +6,7 @@ #include "memory.h" #include "text.h" -static EWRAM_DATA_2 Credits1Work *sCredits1Work = {0}; +static EWRAM_INIT Credits1Work *sCredits1Work = {NULL}; extern const UnkTextStruct2 gUnknown_80E4A10; extern const UnkTextStruct2 gUnknown_80E4A28; diff --git a/src/credits2.c b/src/credits2.c index a206ce4c3..4e4073545 100644 --- a/src/credits2.c +++ b/src/credits2.c @@ -5,7 +5,7 @@ #include "input.h" #include "memory.h" -static EWRAM_DATA_2 Credits2Work *sCredits2Work = {0}; +static EWRAM_INIT Credits2Work *sCredits2Work = {NULL}; #include "data/credits2.h" diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index 399846252..bad311ce8 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -23,7 +23,7 @@ #include "sprite.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B2BC *sUnknown_203B2BC = {0}; +static EWRAM_INIT struct unkStruct_203B2BC *sUnknown_203B2BC = {NULL}; void sub_8027D40(u32, BulkItem *heldItem); void sub_8027794(void); diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index 70796aa72..4f391f3c9 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -25,7 +25,7 @@ #include "pokemon.h" #include "text.h" -EWRAM_DATA_2 unkStruct_203B2B4 *gUnknown_203B2B4 = {0}; +EWRAM_INIT unkStruct_203B2B4 *gUnknown_203B2B4 = {NULL}; #include "data/friend_list_menu.h" diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 797f31491..c5926d6f1 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -212,7 +212,7 @@ extern u8 gUnknown_80E4964[]; extern u8 gUnknown_80E499C[]; extern u8 gUnknown_80E49C4[]; -EWRAM_DATA_2 WonderMailStruct_203B33C *gUnknown_203B33C = {0}; +EWRAM_INIT WonderMailStruct_203B33C *gUnknown_203B33C = {NULL}; extern u8 sub_8039880(void); diff --git a/src/load_screen.c b/src/load_screen.c index 7f0e64c4b..f816767a4 100644 --- a/src/load_screen.c +++ b/src/load_screen.c @@ -38,10 +38,7 @@ struct LoadScreen /* 0x258 */ u8 formattedHelperInfo[0x24]; }; -EWRAM_DATA_2 struct LoadScreen *gLoadScreen = {0}; -EWRAM_DATA_2 MenuItem gUnknown_203B378[2] = {0}; -EWRAM_DATA_2 u32 gUnknown_203B388[12] = {0}; -EWRAM_DATA_2 u32 gUnknown_203B3B8[12] = {0}; +EWRAM_INIT struct LoadScreen *gLoadScreen = {NULL}; extern unkStruct_203B484 *gUnknown_203B484; @@ -69,7 +66,19 @@ const UnkTextStruct2 gUnknown_80E7610 = { NULL }; -const u8 gUnkData_80E7628[] = {0x20, 0x00, 0x00, 0x00}; +EWRAM_INIT MenuItem gUnknown_203B378[2] = { + [0] = { + .text = " ", + .menuAction = 5, + }, + [1] = { + .text = NULL, + .menuAction = 3, + } +}; + +EWRAM_INIT u32 gUnknown_203B388[12] = {0xC, 0xC, 0xE, 0xE, 0xD, 0xE, 0xC, 0xD, 0xD, 0xB, 0xB, 0xB}; +EWRAM_INIT u32 gUnknown_203B3B8[12] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x1A, 0x18, 0x1B, 0x16, 0x19, 0x17}; const UnkTextStruct2 gUnknown_80E762C = { 0x00, 0x00, 0x00, 0x00, diff --git a/src/luminous_cave.c b/src/luminous_cave.c index fe4c0ea94..edbb0cf20 100644 --- a/src/luminous_cave.c +++ b/src/luminous_cave.c @@ -59,7 +59,7 @@ enum LuminousCaveMenuActions }; -static EWRAM_DATA_2 LuminousCaveWork *sLuminousCaveWork = {0}; +static EWRAM_INIT LuminousCaveWork *sLuminousCaveWork = {NULL}; #include "data/luminous_cave.h" diff --git a/src/mailbox.c b/src/mailbox.c index 2e1b65946..2e3a5a1f1 100644 --- a/src/mailbox.c +++ b/src/mailbox.c @@ -18,7 +18,7 @@ #include "wonder_mail_802C4C8.h" #include "wonder_mail_802C860.h" -EWRAM_DATA_2 struct unkStruct_203B304 *gUnknown_203B304 = {0}; +EWRAM_INIT struct unkStruct_203B304 *gUnknown_203B304 = {NULL}; const UnkTextStruct2 gUnknown_80E0284 = { diff --git a/src/main_menu1.c b/src/main_menu1.c index b39e972d9..8a79f8eb2 100644 --- a/src/main_menu1.c +++ b/src/main_menu1.c @@ -35,7 +35,7 @@ // NOTE: 0x2E // Deletes the Save -static EWRAM_DATA_2 MainMenu1Work *sMainMenu = {0}; +static EWRAM_INIT MainMenu1Work *sMainMenu = {NULL}; #include "data/main_menu1.h" diff --git a/src/main_menu2.c b/src/main_menu2.c index 8f83268b8..220930b9d 100644 --- a/src/main_menu2.c +++ b/src/main_menu2.c @@ -11,9 +11,9 @@ #include "save.h" #include "text.h" -static EWRAM_DATA_2 MainMenu2Work *sUnknown_203B34C = {0}; -static EWRAM_DATA_2 u32 sUnknown_203B350 = {0}; -static EWRAM_DATA_2 u32 sUnknown_203B354 = {0}; +static EWRAM_INIT MainMenu2Work *sUnknown_203B34C = {NULL}; +static EWRAM_INIT u32 sUnknown_203B350 = {MENU_DEBUG}; +static EWRAM_INIT u32 sUnknown_203B354 = {MENU_SEND_ITEMS}; #include "data/main_menu2.h" @@ -295,4 +295,4 @@ bool8 sub_80363E0(void) if (sUnknown_203B34C->unk0 == 12) return FALSE; return TRUE; -} \ No newline at end of file +} diff --git a/src/makuhita_dojo1.c b/src/makuhita_dojo1.c index d6ac388b4..bfcf7f211 100644 --- a/src/makuhita_dojo1.c +++ b/src/makuhita_dojo1.c @@ -14,7 +14,7 @@ #include "pokemon.h" #include "text.h" -static EWRAM_DATA_2 MakuhitaDojoWork1 *sMakuhitaDojoWork1 = {0}; +static EWRAM_INIT MakuhitaDojoWork1 *sMakuhitaDojoWork1 = {NULL}; #include "data/makuhita_dojo1.h" diff --git a/src/makuhita_dojo2.c b/src/makuhita_dojo2.c index 289641f01..0555b3045 100644 --- a/src/makuhita_dojo2.c +++ b/src/makuhita_dojo2.c @@ -13,7 +13,7 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 MakuhitaDojoWork2 *sMakuhitaDojoWork2 = {0}; +static EWRAM_INIT MakuhitaDojoWork2 *sMakuhitaDojoWork2 = {NULL}; #include "data/makuhita_dojo2.h" // 80E07EC diff --git a/src/mission_reward.c b/src/mission_reward.c index 15c0f98f4..ddb071465 100644 --- a/src/mission_reward.c +++ b/src/mission_reward.c @@ -26,10 +26,7 @@ struct unkStruct_203B310 UnkTextStruct2 unk24[4]; }; -EWRAM_DATA_2 struct unkStruct_203B310 *gUnknown_203B310 = {0}; - -extern u8 gFormatBuffer_FriendArea[]; -extern u8 gSpeakerNameBuffer[]; +EWRAM_INIT struct unkStruct_203B310 *gUnknown_203B310 = {NULL}; enum FriendRewardStates { diff --git a/src/other_menus1.c b/src/other_menus1.c index 4f1a30682..1c0c21a60 100644 --- a/src/other_menus1.c +++ b/src/other_menus1.c @@ -18,7 +18,7 @@ #include "sprite.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B35C *sUnknown_203B35C = {0}; +static EWRAM_INIT unkStruct_203B35C *sUnknown_203B35C = {NULL}; #include "data/other_menus1.h" @@ -492,4 +492,4 @@ void sub_8037900(void) UNUSED static void nullsub_202(void) { -} \ No newline at end of file +} diff --git a/src/party_list_menu.c b/src/party_list_menu.c index c29350bbe..420c611a8 100644 --- a/src/party_list_menu.c +++ b/src/party_list_menu.c @@ -25,7 +25,7 @@ #include "text_util.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B2B8 *sUnknown_203B2B8 = {0}; +static EWRAM_INIT unkStruct_203B2B8 *sUnknown_203B2B8 = {NULL}; #include "data/party_list_menu.h" diff --git a/src/pelipper_board.c b/src/pelipper_board.c index 8ce19a7e3..43d2d0b16 100644 --- a/src/pelipper_board.c +++ b/src/pelipper_board.c @@ -18,7 +18,7 @@ #include "wonder_mail_802C4C8.h" #include "wonder_mail_802C860.h" -EWRAM_DATA_2 struct unkStruct_203B308 *gPelipperBoard = {0}; +EWRAM_INIT struct unkStruct_203B308 *gPelipperBoard = {NULL}; const UnkTextStruct2 gUnknown_80E0330 = { diff --git a/src/pokemon_news1.c b/src/pokemon_news1.c index a56f66db9..b88b50255 100644 --- a/src/pokemon_news1.c +++ b/src/pokemon_news1.c @@ -12,9 +12,9 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B2CC *sUnknown_203B2CC = {0}; -static EWRAM_DATA_2 u16 sUnknown_203B2D0 = {0}; -static EWRAM_DATA_2 u16 sUnknown_203B2D2 = {0}; +static EWRAM_INIT struct unkStruct_203B2CC *sUnknown_203B2CC = {NULL}; +static EWRAM_INIT u16 sUnknown_203B2D0 = {0}; +static EWRAM_INIT u16 sUnknown_203B2D2 = {0}; #include "data/pokemon_news1.h" diff --git a/src/pokemon_news2.c b/src/pokemon_news2.c index 12b7abc12..3008c523b 100644 --- a/src/pokemon_news2.c +++ b/src/pokemon_news2.c @@ -11,7 +11,7 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B2D4 *sUnknown_203B2D4 = {0}; +static EWRAM_INIT struct unkStruct_203B2D4 *sUnknown_203B2D4 = {NULL}; #include "data/pokemon_news2.h" diff --git a/src/pokemon_news3.c b/src/pokemon_news3.c index 432f4d75f..e8be8f5a7 100644 --- a/src/pokemon_news3.c +++ b/src/pokemon_news3.c @@ -17,8 +17,8 @@ #include "text.h" #include "string_format.h" -static EWRAM_DATA_2 struct unkStruct_203B2D8 *sUnknown_203B2D8 = {0}; -static EWRAM_DATA_2 u16 sUnknown_203B2DC = {0}; +static EWRAM_INIT struct unkStruct_203B2D8 *sUnknown_203B2D8 = {NULL}; +static EWRAM_INIT u16 sUnknown_203B2DC = {0}; #include "data/pokemon_news3.h" diff --git a/src/post_office_guide1.c b/src/post_office_guide1.c index 7500d5591..76f5cd9ea 100644 --- a/src/post_office_guide1.c +++ b/src/post_office_guide1.c @@ -24,7 +24,7 @@ enum PostOfficeStates extern u8 gSpeakerNameBuffer[]; -static EWRAM_DATA_2 PostOfficeWork *sPostOfficeHelper = {0}; +static EWRAM_INIT PostOfficeWork *sPostOfficeHelper = {NULL}; #include "data/post_office_guide1.h" diff --git a/src/post_office_guide2.c b/src/post_office_guide2.c index 9af8a43e6..c5e99e742 100644 --- a/src/post_office_guide2.c +++ b/src/post_office_guide2.c @@ -18,7 +18,7 @@ #include "text.h" #include "string_format.h" -static EWRAM_DATA_2 unkStruct_203B330 *sUnknown_203B330 = {0}; +static EWRAM_INIT unkStruct_203B330 *sUnknown_203B330 = {NULL}; #include "data/post_office_guide2.h" diff --git a/src/rescue_password_menu.c b/src/rescue_password_menu.c index cfecc723a..87220eff3 100644 --- a/src/rescue_password_menu.c +++ b/src/rescue_password_menu.c @@ -22,9 +22,9 @@ EWRAM_DATA u8 gRescuePasswordBuffer[RESCUE_PASSWORD_SIZE] = {0}; extern unkStruct_203B484 *gUnknown_203B484; -EWRAM_DATA_2 u8 gUnknown_203B368 = {0}; -EWRAM_DATA_2 u32 gUnknown_203B36C = {0}; -EWRAM_DATA_2 struct RescuePasswordMenu *gRescuePasswordMenu = {0}; +EWRAM_INIT u8 gUnknown_203B368 = {1}; +EWRAM_INIT u32 gUnknown_203B36C = {65502}; +EWRAM_INIT struct RescuePasswordMenu *gRescuePasswordMenu = {NULL}; const UnkTextStruct2 gUnknown_80E71E4 = { 0x00, 0x00, 0x00, 0x00, diff --git a/src/save_menu.c b/src/save_menu.c index 7d4274083..e8112b02f 100644 --- a/src/save_menu.c +++ b/src/save_menu.c @@ -10,7 +10,7 @@ #include "sprite.h" #include "text.h" -static EWRAM_DATA_2 SaveMenuWork *sUnknown_203B364 = {0}; +static EWRAM_INIT SaveMenuWork *sUnknown_203B364 = {NULL}; const UnkTextStruct2 gUnknown_80E6F20 = { diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index 9ae508095..7ee792b70 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -25,7 +25,7 @@ #include "wonder_mail_4.h" #include "wonder_mail_5.h" -static EWRAM_DATA_2 WonderMailStruct_203B2C4 *sUnknown_203B2C4 = {0}; +static EWRAM_INIT WonderMailStruct_203B2C4 *sUnknown_203B2C4 = {NULL}; #define THANK_YOU_MAIL_MAIN_MENU 0 #define ANYTHING_ELSE_THANK_YOU_MAIN_MENU 1 diff --git a/src/trade_items_menu.c b/src/trade_items_menu.c index 1271db154..a9b1415ef 100644 --- a/src/trade_items_menu.c +++ b/src/trade_items_menu.c @@ -16,7 +16,7 @@ #include "text.h" #include "trade_items_menu.h" -static EWRAM_DATA_2 struct TradeItemsMenu *sTradeItemsMenu = {0}; +static EWRAM_INIT struct TradeItemsMenu *sTradeItemsMenu = {NULL}; #include "data/trade_items_menu.h" diff --git a/src/unk_menu_203B360.c b/src/unk_menu_203B360.c index e8fd87df9..2c3e7ea06 100644 --- a/src/unk_menu_203B360.c +++ b/src/unk_menu_203B360.c @@ -20,7 +20,7 @@ typedef struct unkStruct_203B360 u32 unk1B0; // sprite count? } unkStruct_203B360; -static EWRAM_DATA_2 unkStruct_203B360 *sUnknown_203B360 = {0}; +static EWRAM_INIT unkStruct_203B360 *sUnknown_203B360 = {NULL}; const UnkTextStruct2 gUnknown_80E6E7C = { 0x00, 0x00, 0x00, 0x00, diff --git a/src/wonder_mail.c b/src/wonder_mail.c index e7d42aa72..d53fd48cb 100644 --- a/src/wonder_mail.c +++ b/src/wonder_mail.c @@ -23,7 +23,7 @@ #include "wonder_mail_4.h" #include "wonder_mail_5.h" -static EWRAM_DATA_2 WonderMailStruct_203B2C0 *sUnknown_203B2C0 = {0}; +static EWRAM_INIT WonderMailStruct_203B2C0 *sUnknown_203B2C0 = {NULL}; extern void sub_8011C28(u32); diff --git a/src/wonder_mail_2.c b/src/wonder_mail_2.c index 4346f3bdf..839c18d29 100644 --- a/src/wonder_mail_2.c +++ b/src/wonder_mail_2.c @@ -36,7 +36,7 @@ enum States { EXIT_STATE = 5 }; -static EWRAM_DATA_2 struct unkStruct_203B2C8 *sUnknown_203B2C8 = {0}; +static EWRAM_INIT struct unkStruct_203B2C8 *sUnknown_203B2C8 = {NULL}; extern void sub_80920D8(u8 *buffer); extern void sub_802B548(u32); diff --git a/src/wonder_mail_3_mid.c b/src/wonder_mail_3_mid.c index 17e5f0a2f..e344f72a1 100644 --- a/src/wonder_mail_3_mid.c +++ b/src/wonder_mail_3_mid.c @@ -21,7 +21,7 @@ struct unkStruct_203B30C MenuItem unkB0[8]; UnkTextStruct2 unkF0[4]; }; -static EWRAM_DATA_2 struct unkStruct_203B30C *gUnknown_203B30C = {0}; +static EWRAM_INIT struct unkStruct_203B30C *gUnknown_203B30C = {NULL}; extern void sub_802EFEC(u32); extern void sub_802F148(void); diff --git a/src/wonder_mail_4.c b/src/wonder_mail_4.c index 5189d3ded..a7be19ec0 100644 --- a/src/wonder_mail_4.c +++ b/src/wonder_mail_4.c @@ -22,7 +22,7 @@ struct unkStruct_203B320 u32 wonderMailType; struct_Sub80095E4_2 s28; }; -static EWRAM_DATA_2 struct unkStruct_203B320 *gUnknown_203B320 = {0}; +static EWRAM_INIT struct unkStruct_203B320 *gUnknown_203B320 = {NULL}; extern unkStruct_203B480 *gUnknown_203B480; diff --git a/src/wonder_mail_5.c b/src/wonder_mail_5.c index 4f1d8c86e..9486643b0 100644 --- a/src/wonder_mail_5.c +++ b/src/wonder_mail_5.c @@ -24,7 +24,7 @@ struct unkStruct_203B324 UnkTextStruct2 unk18[4]; }; -static EWRAM_DATA_2 struct unkStruct_203B324 *gUnknown_203B324 = {0}; +static EWRAM_INIT struct unkStruct_203B324 *gUnknown_203B324 = {NULL}; extern unkStruct_203B480 *gUnknown_203B480; diff --git a/src/wonder_mail_6.c b/src/wonder_mail_6.c index d81e03a38..486d6316e 100644 --- a/src/wonder_mail_6.c +++ b/src/wonder_mail_6.c @@ -21,7 +21,7 @@ struct unkStruct_203B328 /* 0x108 */ struct MonPortraitMsg monPortrait; u32 wonderMailType; }; -static EWRAM_DATA_2 struct unkStruct_203B328 *gUnknown_203B328 = {0}; +static EWRAM_INIT struct unkStruct_203B328 *gUnknown_203B328 = {NULL}; extern unkStruct_203B480 *gUnknown_203B480; diff --git a/src/wonder_mail_802C10C.c b/src/wonder_mail_802C10C.c index 78666ca5b..23f80463a 100644 --- a/src/wonder_mail_802C10C.c +++ b/src/wonder_mail_802C10C.c @@ -11,8 +11,8 @@ #include "text.h" #include "wonder_mail_802C10C.h" -static EWRAM_DATA_2 struct unkStruct_203B2E0 *gUnknown_203B2E0 = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B2E4 = {0}; +static EWRAM_INIT struct unkStruct_203B2E0 *gUnknown_203B2E0 = {NULL}; +static EWRAM_INIT u16 gUnknown_203B2E4 = {0}; #include "data/wonder_mail_802C10C.h" diff --git a/src/wonder_mail_802C4C8.c b/src/wonder_mail_802C4C8.c index 6f9ba7aad..4ecafc075 100644 --- a/src/wonder_mail_802C4C8.c +++ b/src/wonder_mail_802C4C8.c @@ -14,8 +14,8 @@ #include "text.h" #include "wonder_mail_802C4C8.h" -static EWRAM_DATA_2 struct unkStruct_203B2E0* gUnknown_203B2E8 = {0}; -static EWRAM_DATA_2 u16 gUnknown_203B2EC = {0}; +static EWRAM_INIT struct unkStruct_203B2E0* gUnknown_203B2E8 = {NULL}; +static EWRAM_INIT u16 gUnknown_203B2EC = {0}; #include "data/wonder_mail_802C4C8.h" diff --git a/src/wonder_mail_802C860.c b/src/wonder_mail_802C860.c index 331a4038b..a7c3beb22 100644 --- a/src/wonder_mail_802C860.c +++ b/src/wonder_mail_802C860.c @@ -13,7 +13,7 @@ #include "wonder_mail_802C860.h" #include "text.h" -static EWRAM_DATA_2 struct unkStruct_203B2F0 *sUnknown_203B2F0 = {0}; +static EWRAM_INIT struct unkStruct_203B2F0 *sUnknown_203B2F0 = {NULL}; #include "data/wonder_mail_802C860.h" diff --git a/src/wonder_mail_802CDD4.c b/src/wonder_mail_802CDD4.c index 98cace658..2cdb48b5b 100644 --- a/src/wonder_mail_802CDD4.c +++ b/src/wonder_mail_802CDD4.c @@ -13,7 +13,7 @@ #include "text.h" #include "wonder_mail_802CDD4.h" -static EWRAM_DATA_2 struct_Sub80095E4_2 *sUnknown_203B2F4 = {0}; +static EWRAM_INIT struct_Sub80095E4_2 *sUnknown_203B2F4 = {NULL}; #include "data/wonder_mail_802CDD4.h" diff --git a/src/wonder_mail_802D098.c b/src/wonder_mail_802D098.c index 246346f26..4b6650dcc 100644 --- a/src/wonder_mail_802D098.c +++ b/src/wonder_mail_802D098.c @@ -43,7 +43,7 @@ enum menuActions { OLD_MAIL_ACTION }; -static EWRAM_DATA_2 unkStruct_203B2F8 *sUnknown_203B2F8 = {0}; +static EWRAM_INIT unkStruct_203B2F8 *sUnknown_203B2F8 = {NULL}; #include "data/wonder_mail_802D098.h" diff --git a/sym_ewram2.txt b/sym_ewram2.txt index 69f8d6365..141a74c04 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,60 +1,6 @@ .align 2 -gUnknown_203B2A0: /* 203B2A0 (sub_8023868 - sub_8023C60) */ - .space 0x4 -gUnknown_203B2A4: /* 203B2A4 (sub_8023868 - sub_8023C60) */ - .space 0x4 - -gUnknown_203B2A8: /* 203B2A8 (sub_8023868 - sub_8023C60) */ - .space 0x2 - -gUnknown_203B2AA: /* 203B2AA (sub_8023868 - sub_8023C60) */ - .space 0x2 - -.include "src/code_8024458.o" -.include "src/luminous_cave.o" -.include "src/friend_list_menu.o" -.include "src/party_list_menu.o" -.include "src/friend_area_action_menu.o" -.include "src/wonder_mail.o" -.include "src/thank_you_wonder_mail.o" -.include "src/wonder_mail_2.o" -.include "src/pokemon_news1.o" -.include "src/pokemon_news2.o" -.include "src/pokemon_news3.o" -.include "src/wonder_mail_802C10C.o" -.include "src/wonder_mail_802C4C8.o" -.include "src/wonder_mail_802C860.o" -.include "src/wonder_mail_802CDD4.o" -.include "src/wonder_mail_802D098.o" -.include "src/code_802DB28.o" -.include "src/code_802DE84.o" -.include "src/mailbox.o" -.include "src/pelipper_board.o" -.include "src/wonder_mail_3_mid.o" -.include "src/mission_reward.o" -.include "src/code_8072F3C.o" -.include "src/makuhita_dojo1.o" -.include "src/makuhita_dojo2.o" -.include "src/wonder_mail_4.o" -.include "src/wonder_mail_5.o" -.include "src/wonder_mail_6.o" -.include "src/post_office_guide1.o" -.include "src/post_office_guide2.o" -.include "src/code_8031D70.o" -.include "src/adventure_log.o" -.include "src/friend_rescue.o" -.include "src/credits1.o" -.include "src/credits2.o" -.include "src/main_menu1.o" -.include "src/main_menu2.o" -.include "src/trade_items_menu.o" -.include "src/other_menus1.o" -.include "src/unk_menu_203B360.o" -.include "src/save_menu.o" -.include "src/rescue_password_menu.o" -.include "src/load_screen.o" .include "src/wonder_mail_main_menu.o" .include "src/debug_menu1.o" .include "src/debug_menu2.o" diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index 184f3f5ce..2f27377be 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -55,3 +55,46 @@ .include "src/wigglytuff_shop3.o" .include "src/code_80227B8.o" .include "src/code_8023144.o" +.include "src/code_8024458.o" +.include "src/luminous_cave.o" +.include "src/friend_list_menu.o" +.include "src/party_list_menu.o" +.include "src/friend_area_action_menu.o" +.include "src/wonder_mail.o" +.include "src/thank_you_wonder_mail.o" +.include "src/wonder_mail_2.o" +.include "src/pokemon_news1.o" +.include "src/pokemon_news2.o" +.include "src/pokemon_news3.o" +.include "src/wonder_mail_802C10C.o" +.include "src/wonder_mail_802C4C8.o" +.include "src/wonder_mail_802C860.o" +.include "src/wonder_mail_802CDD4.o" +.include "src/wonder_mail_802D098.o" +.include "src/code_802DB28.o" +.include "src/code_802DE84.o" +.include "src/mailbox.o" +.include "src/pelipper_board.o" +.include "src/wonder_mail_3_mid.o" +.include "src/mission_reward.o" +.include "src/code_8072F3C.o" +.include "src/makuhita_dojo1.o" +.include "src/makuhita_dojo2.o" +.include "src/wonder_mail_4.o" +.include "src/wonder_mail_5.o" +.include "src/wonder_mail_6.o" +.include "src/post_office_guide1.o" +.include "src/post_office_guide2.o" +.include "src/code_8031D70.o" +.include "src/adventure_log.o" +.include "src/friend_rescue.o" +.include "src/credits1.o" +.include "src/credits2.o" +.include "src/main_menu1.o" +.include "src/main_menu2.o" +.include "src/trade_items_menu.o" +.include "src/other_menus1.o" +.include "src/unk_menu_203B360.o" +.include "src/save_menu.o" +.include "src/rescue_password_menu.o" +.include "src/load_screen.o" From 6a3dbaabdeb71b4c25f3a4be10a5ae1d07c95343 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 20:58:06 +0100 Subject: [PATCH 08/23] up to playtime --- data/data_8270000.s | 38 ------------------ src/code_803B050.c | 3 ++ src/code_803D0D8.c | 2 +- src/code_803E46C.c | 5 ++- src/code_8042B34.c | 9 +++-- src/code_805D8C8_1.c | 2 + src/code_807CD9C.c | 3 +- src/code_8094D28.c | 5 ++- src/debug_menu1.c | 2 +- src/debug_menu2.c | 2 +- src/debug_menu3.c | 2 +- src/debug_menu4.c | 2 +- src/dungeon_ai_items.c | 2 +- src/dungeon_leader.c | 2 +- src/dungeon_map_access.c | 2 +- src/dungeon_message.c | 2 +- src/dungeon_move.c | 3 +- src/dungeon_random.c | 4 +- src/friend_area.c | 2 +- src/game_options.c | 2 +- src/items.c | 2 +- src/personality_test1.c | 2 +- src/personality_test2.c | 2 +- src/play_time.c | 2 +- src/pokemon.c | 2 +- src/rescue_team_info.c | 2 +- src/wonder_mail_main_menu.c | 2 +- sym_ewram2.txt | 79 +++---------------------------------- sym_ewram_init.txt | 27 +++++++++++++ 29 files changed, 73 insertions(+), 141 deletions(-) create mode 100644 src/code_803B050.c diff --git a/data/data_8270000.s b/data/data_8270000.s index 999cc2183..4b57a69ab 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -11,44 +11,6 @@ gUnknown_8270000: @ 8270000 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x64, 0x00, 0x64, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x15, 0x00, 0x16, 0x00 -.byte 0x15, 0x00, 0x16, 0x00 -.byte 0x02, 0x03, 0x01, 0x01 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x0d, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x28, 0x00, 0x00, 0x00 -.byte 0x28, 0x00, 0x00, 0x00 -.byte 0x50, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x71, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0xdf, 0xb0, 0x08, 0x99 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 .4byte gUnknown_8116390 .4byte gUnknown_811636C .4byte gUnknown_811633C diff --git a/src/code_803B050.c b/src/code_803B050.c new file mode 100644 index 000000000..86981ae61 --- /dev/null +++ b/src/code_803B050.c @@ -0,0 +1,3 @@ +#include "global.h" + +EWRAM_INIT void *gUnknown_203B3FC = NULL; diff --git a/src/code_803D0D8.c b/src/code_803D0D8.c index bafa162e1..d3d4082fa 100644 --- a/src/code_803D0D8.c +++ b/src/code_803D0D8.c @@ -7,7 +7,7 @@ #include "code_80958E8.h" #include "memory.h" -static EWRAM_DATA_2 u8 sUnknown_203B408 = {0}; +static EWRAM_INIT u8 sUnknown_203B408 = {1}; #include "data/code_803D0D8.h" diff --git a/src/code_803E46C.c b/src/code_803E46C.c index 6dc8deae5..78a58cffc 100644 --- a/src/code_803E46C.c +++ b/src/code_803E46C.c @@ -16,8 +16,9 @@ #include "play_time.h" #include "sprite.h" -extern u8 gUnknown_203B40C; -extern u8 gUnknown_203B40D; +EWRAM_INIT u8 gUnknown_203B40C = 0; +EWRAM_INIT u8 gUnknown_203B40D = 0; + extern s32 gDungeonBrightness; extern s32 gUnknown_202EDCC; extern u32 gUnknown_202EDD0; diff --git a/src/code_8042B34.c b/src/code_8042B34.c index ce3fa2e29..ba6c1d9e1 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -59,7 +59,12 @@ struct UnkStruct_203B414 struct Sub_UnkStruct_203B414 unk8C[16]; }; -static EWRAM_DATA_2 struct UnkStruct_203B414 *sUnknown_203B414 = NULL; +EWRAM_INIT DungeonPos gUnknown_203B410 = {100, 100}; +static EWRAM_INIT struct UnkStruct_203B414 *sUnknown_203B414 = NULL; +EWRAM_INIT Dungeon *gDungeon = NULL; +EWRAM_INIT u8 *gSerializedData_203B41C = NULL; +EWRAM_INIT u8 gUnknown_203B420[8] = {0x15, 0x00, 0x16, 0x00, 0x15, 0x00, 0x16, 0x00}; // Could be a different file? +EWRAM_INIT u8 gUnknown_203B428[8] = {0x02, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x02}; // Could be a different file? struct UnkStruct_80F6624 { @@ -247,8 +252,6 @@ void sub_8042EC8(Entity *a0, s32 a1) } extern u8 gUnknown_203B40C; -extern DungeonPos gUnknown_203B410; -extern u8 *gSerializedData_203B41C; struct Substruct_xxx_dungeon_8042F6C { diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 7e3fc0ef1..87ad465bf 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -3716,3 +3716,5 @@ void PrintMonTactics(s32 firstId, u8 *tacticIds, EntityInfo *mon, s32 windowId) sub_80073E0(windowId); } + +EWRAM_INIT u8 gUnknown_203B43C[4] = {2, 0, 0xD, 0}; // TODO: Move to a better file and figure out the array count. Apparently it's only written to. diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 4ea9b3ecf..1ff30c326 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -26,7 +26,6 @@ #include "dungeon_config.h" extern u32 gUnknown_202EDCC; -extern u32 gUnknown_203B444[]; extern u8 *gUnknown_80FCA10[]; extern u8 *gUnknown_80F8A0C[]; @@ -57,6 +56,8 @@ extern void sub_804216C(Entity *pokemon, Entity *target, u32 r2); extern void sub_80461C8(DungeonPos *, u32); extern void sub_804218C(Entity *pokemon, Entity *target); +EWRAM_INIT u32 gUnknown_203B444[3] = {0x28, 0x28, 0x50}; + void sub_804EB30(); bool8 ExposeTrap(s32 x, s32 y); void sub_8040A84(); diff --git a/src/code_8094D28.c b/src/code_8094D28.c index f8d9453b3..8270dba59 100644 --- a/src/code_8094D28.c +++ b/src/code_8094D28.c @@ -1,8 +1,9 @@ #include "global.h" IWRAM_DATA u32 gUnknown_3001198[0x270] = {0}; -EWRAM_DATA_2 s32 gUnknown_203B470 = {0}; -EWRAM_DATA_2 s32 gUnknown_203B474 = {0}; +EWRAM_INIT s32 gUnknown_203B470 = 0x271; +EWRAM_INIT s32 gUnknown_203B474 = 0; +UNUSED static EWRAM_INIT s32 sUnusedEwramVar = 0x9908b0df; // Hm... void sub_8094D28(s32 r0) { diff --git a/src/debug_menu1.c b/src/debug_menu1.c index d0d952994..3b34de591 100644 --- a/src/debug_menu1.c +++ b/src/debug_menu1.c @@ -28,7 +28,7 @@ enum DebugMenuOptions MENU_DEBUG_MENU_H_OPEN = 9, }; -static EWRAM_DATA_2 struct DebugMenu *sDebugMenu = {0}; +static EWRAM_INIT struct DebugMenu *sDebugMenu = {NULL}; #include "data/debug_menu1.h" diff --git a/src/debug_menu2.c b/src/debug_menu2.c index 17da741d4..39a8c6d67 100644 --- a/src/debug_menu2.c +++ b/src/debug_menu2.c @@ -10,7 +10,7 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B3F0 *sUnknown_203B3F0 = {0}; +static EWRAM_INIT unkStruct_203B3F0 *sUnknown_203B3F0 = {NULL}; #include "data/debug_menu2.h" diff --git a/src/debug_menu3.c b/src/debug_menu3.c index 2d5ac1a5d..dffb89dab 100644 --- a/src/debug_menu3.c +++ b/src/debug_menu3.c @@ -12,7 +12,7 @@ #include "wigglytuff_shop1.h" #include "wigglytuff_shop2.h" -static EWRAM_DATA_2 unkStruct_203B3F4 *sUnknown_203B3F4 = {0}; +static EWRAM_INIT unkStruct_203B3F4 *sUnknown_203B3F4 = {NULL}; #include "data/debug_menu3.h" diff --git a/src/debug_menu4.c b/src/debug_menu4.c index acdb448ce..a808ecef5 100644 --- a/src/debug_menu4.c +++ b/src/debug_menu4.c @@ -9,7 +9,7 @@ #include "menu_input.h" #include "text.h" -static EWRAM_DATA_2 unkStruct_203B3F8 *sUnknown_203B3F8 = {0}; +static EWRAM_INIT unkStruct_203B3F8 *sUnknown_203B3F8 = {NULL}; #include "data/debug_menu4.h" diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index 6f1685096..f12fb2501 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -34,7 +34,7 @@ enum ItemTargetFlag ITEM_TARGET_ALLY = 1 << 1 }; -EWRAM_DATA_2 s32 gAIThrowItemActionChoiceCount = {0}; +EWRAM_INIT s32 gAIThrowItemActionChoiceCount = {0}; EWRAM_DATA u32 gAIThrownItemDirections[NUM_DIRECTIONS] = {0}; EWRAM_DATA bool8 gAIThrownItemDirectionIsUsed[NUM_DIRECTIONS] = {0}; diff --git a/src/dungeon_leader.c b/src/dungeon_leader.c index 499ff89be..770e6e89a 100644 --- a/src/dungeon_leader.c +++ b/src/dungeon_leader.c @@ -3,7 +3,7 @@ #include "dungeon_leader.h" #include "dungeon_util.h" -extern Entity *gLeaderPointer; +EWRAM_INIT Entity *gLeaderPointer = NULL; Entity* GetLeader(void) { diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 15bbe2fb7..c0d47fe11 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -34,7 +34,7 @@ EWRAM_DATA unkStruct_202EE8C gUnknown_202EE8C[32] = {0}; EWRAM_DATA OpenedFile *gUnknown_202F18C = {0}; EWRAM_DATA Tile gOutOfBoundsTileData = {0}; -EWRAM_DATA_2 const Tile *gCurTilesetOobTile = {0}; +EWRAM_INIT const Tile *gCurTilesetOobTile = {NULL}; extern u8 sub_8043CE4(u32); extern void sub_80402AC(s32, s32); diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 4c58ba61e..6f1f4299f 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -44,7 +44,6 @@ extern void sub_8083CE0(u8 param_1); extern u32 gUnknown_202EDD0; extern u8 gUnknown_203B40C; extern u8 gUnknown_202EE01; -extern u8 gUnknown_203B434; extern void (*gUnknown_203B08C)(s32); extern void (*gUnknown_203B084)(s32 a0); extern void (*gUnknown_203B080)(s32 a0); @@ -65,6 +64,7 @@ static EWRAM_DATA SpriteOAM sUnknown_202F1F0 = {0}; static EWRAM_DATA s32 sMessageLogCursor = 0; static EWRAM_DATA u8 sMessageLogFlags = 0; static EWRAM_DATA SpriteOAM sMessageLogArrowSpriteOAM = {0}; +EWRAM_INIT u8 gUnknown_203B434 = 1; // Used for sMessageLogFlags #define FLAG_CAN_SCROLL_UP 0x1 diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 1c7a46a66..6fbe5bd96 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -361,8 +361,6 @@ extern const u8 *const gUnknown_80F93A4; extern const u8 *const gUnknown_80F9384; extern const u8 *const gUnknown_80F9380; -extern Entity *gUnknown_203B438; - EWRAM_DATA s32 gUnknown_202F208 = 0; EWRAM_DATA s32 gUnknown_202F20C = 0; EWRAM_DATA s32 gUnknown_202F210 = 0; @@ -376,6 +374,7 @@ EWRAM_DATA u8 gUnknown_202F221 = 0; EWRAM_DATA u8 gUnknown_202F222 = 0; EWRAM_DATA s32 gUnknown_202F224 = 0; EWRAM_DATA s32 gMetronomeCalledArrayId = 0; +static EWRAM_INIT Entity *gUnknown_203B438 = NULL; #define MAX_MOVE_TARGETS 64 diff --git a/src/dungeon_random.c b/src/dungeon_random.c index bb77e3e8f..058e72fc8 100644 --- a/src/dungeon_random.c +++ b/src/dungeon_random.c @@ -1,8 +1,8 @@ #include "global.h" #include "dungeon_random.h" -EWRAM_DATA_2 u32 gDungeonRngState = {0}; -EWRAM_DATA_2 u32 gUnknown_203B458 = {0}; +EWRAM_INIT u32 gDungeonRngState = {1}; +EWRAM_INIT u32 gUnknown_203B458 = {1}; void sub_808408C(u32 param_1) { diff --git a/src/friend_area.c b/src/friend_area.c index 5bdb0c9bb..400375320 100644 --- a/src/friend_area.c +++ b/src/friend_area.c @@ -9,7 +9,7 @@ EWRAM_DATA static bool8 sBoughtFriendAreas[NUM_FRIEND_AREAS] = {0}; -EWRAM_DATA_2 bool8 *gFriendAreas = {0}; +EWRAM_INIT bool8 *gFriendAreas = {NULL}; // data_8107010.s extern const u8 sUnknown_81098A4[]; diff --git a/src/game_options.c b/src/game_options.c index cefcd194d..77c73ba59 100644 --- a/src/game_options.c +++ b/src/game_options.c @@ -10,7 +10,7 @@ struct unkStruct_8094CB0 s16 unk2; }; -EWRAM_DATA_2 GameOptions *gGameOptionsRef = {0}; +EWRAM_INIT GameOptions *gGameOptionsRef = {NULL}; EWRAM_DATA GameOptions gGameOptions = {0}; void LoadGameOptions(void) diff --git a/src/items.c b/src/items.c index b7b44fa92..57f4c6972 100644 --- a/src/items.c +++ b/src/items.c @@ -31,7 +31,7 @@ extern u8 gInvalidItemIDs[0x10]; EWRAM_DATA OpenedFile *gItemParametersFile = {0}; EWRAM_DATA ItemDataEntry *gItemParametersData = {0}; EWRAM_DATA TeamInventory gTeamInventory = {0}; -EWRAM_DATA_2 TeamInventory *gTeamInventoryRef = {0}; +EWRAM_INIT TeamInventory *gTeamInventoryRef = {NULL}; extern s32 sub_8091E94(s32 a1, s32 a2, s32 a3); extern void SortKecleonShopInventory(); diff --git a/src/personality_test1.c b/src/personality_test1.c index 63ebb82f5..fc055c070 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -39,7 +39,7 @@ enum PERSONALITY_TEST_END, }; -static EWRAM_DATA_2 struct PersonalityTestTracker *sPersonalityTestTracker = {0}; +static EWRAM_INIT struct PersonalityTestTracker *sPersonalityTestTracker = {NULL}; #include "data/personality_test1.h" diff --git a/src/personality_test2.c b/src/personality_test2.c index cd6284fef..a413780b5 100644 --- a/src/personality_test2.c +++ b/src/personality_test2.c @@ -13,7 +13,7 @@ #include "text.h" #include "string_format.h" -EWRAM_DATA_2 struct PersonalityStruct_203B404 *gUnknown_203B404 = {0}; +EWRAM_INIT struct PersonalityStruct_203B404 *gUnknown_203B404 = {NULL}; #include "data/personality_test2.h" diff --git a/src/play_time.c b/src/play_time.c index 893a53892..7665ab99d 100644 --- a/src/play_time.c +++ b/src/play_time.c @@ -2,7 +2,7 @@ #include "play_time.h" #include "code_8092334.h" -EWRAM_DATA_2 struct PlayTimeStruct *gPlayTimeRef = {0}; +EWRAM_INIT struct PlayTimeStruct *gPlayTimeRef = {NULL}; EWRAM_DATA struct PlayTimeStruct gPlayTime = {0}; diff --git a/src/pokemon.c b/src/pokemon.c index 865661bcf..eb1002b9c 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -14,7 +14,7 @@ EWRAM_DATA OpenedFile *gMonsterParametersFile; EWRAM_DATA unkStruct_203B45C gRecruitedPokemon; EWRAM_DATA u16 gLevelCurrentPokeId; -EWRAM_DATA_2 unkStruct_203B45C *gRecruitedPokemonRef = {0}; +EWRAM_INIT unkStruct_203B45C *gRecruitedPokemonRef = {NULL}; extern void sub_808E490(Move* a1, s32 species); diff --git a/src/rescue_team_info.c b/src/rescue_team_info.c index 7f0789c9f..df4a3e2de 100644 --- a/src/rescue_team_info.c +++ b/src/rescue_team_info.c @@ -4,7 +4,7 @@ #include "text_util.h" #include "event_flag.h" -EWRAM_DATA_2 struct RescueTeamData *gRescueTeamInfoRef = {0}; +EWRAM_INIT struct RescueTeamData *gRescueTeamInfoRef = {NULL}; EWRAM_DATA struct RescueTeamData gRescueTeamInfo = {0}; extern void BoundedCopyStringtoBuffer(u8 *buffer, u8 *string, s32 size); diff --git a/src/wonder_mail_main_menu.c b/src/wonder_mail_main_menu.c index d8e0862ca..a1d2b2d1a 100644 --- a/src/wonder_mail_main_menu.c +++ b/src/wonder_mail_main_menu.c @@ -65,7 +65,7 @@ struct unkStruct_203B3E8 /* 0x498 */ bool8 wonderMailAccepted; }; -EWRAM_DATA_2 struct unkStruct_203B3E8 *gUnknown_203B3E8 = {0}; +EWRAM_INIT struct unkStruct_203B3E8 *gUnknown_203B3E8 = {NULL}; #include "data/wonder_mail_main_menu.h" diff --git a/sym_ewram2.txt b/sym_ewram2.txt index 141a74c04..f8b98b4c1 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -1,80 +1,13 @@ .align 2 -.include "src/wonder_mail_main_menu.o" -.include "src/debug_menu1.o" -.include "src/debug_menu2.o" -.include "src/debug_menu3.o" -.include "src/debug_menu4.o" -gUnknown_203B3FC: /* 203B3FC (sub_803B050 - sub_803B284) */ - .space 0x4 - -.include "src/personality_test1.o" -.include "src/personality_test2.o" -.include "src/code_803D0D8.o" - .space 0x3 - -gUnknown_203B40C: /* 203B40C (sub_803E46C - PrintFieldMessage) */ - .space 0x1 - -gUnknown_203B40D: /* 203B40D (sub_803E250 - sub_807E698) */ - .space 0x3 - -gUnknown_203B410: /* 203B410 (sub_8040150 - ReadMonster) */ - .space 0x4 - -.include "src/code_8042B34.o" - -gDungeon: /* 203B418 */ - .space 0x4 - -gSerializedData_203B41C: /* 203B41C (xxx_dungeon_8042F6C) */ - .space 0x4 - -gUnknown_203B420: /* 203B420 (sub_80462AC) */ - .space 0x8 - -gUnknown_203B428: /* 203B428 (sub_80462AC) */ - .space 0x8 - - .include "src/dungeon_map_access.o" - -gUnknown_203B434: /* 203B434 (sub_80521D0 - sub_8072CF4) */ - .space 0x4 - -gUnknown_203B438: /* 203B438 (sub_8055FA0 - sub_8056F80) */ - .space 0x4 - -gUnknown_203B43C: /* 203B43C (sub_8065FB4) */ - .space 0x4 - - .include "src/dungeon_ai_items.o" - -gUnknown_203B444: /* 203B444 (HandleExplosion) */ - .space 0xC - -gLeaderPointer: /* 203B450 (xxx_dungeon_8042F6C - ReadMonster) */ - .space 0x4 - - .include "src/dungeon_random.o" - .include "src/dungeon_music.o" - .include "src/pokemon.o" - .include "src/items.o" - .include "src/rescue_team_info.o" - .include "src/friend_area.o" - .include "src/game_options.o" - .include "src/code_8094D28.o" - - .space 0x4 - - .include "src/play_time.o" - .include "src/code_8094F88.o" - .include "src/code_80958E8.o" - .include "src/code_8097670.o" - .include "src/exclusive_pokemon.o" - .include "src/ground_main.o" - .space 0x2 +.include "src/code_8094F88.o" +.include "src/code_80958E8.o" +.include "src/code_8097670.o" +.include "src/exclusive_pokemon.o" +.include "src/ground_main.o" +.space 0x2 gUnknown_203B4A0: /* 203B4A0 (sub_809CCDC) */ .space 0xC diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index 2f27377be..d61f65e7d 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -98,3 +98,30 @@ .include "src/save_menu.o" .include "src/rescue_password_menu.o" .include "src/load_screen.o" +.include "src/wonder_mail_main_menu.o" +.include "src/debug_menu1.o" +.include "src/debug_menu2.o" +.include "src/debug_menu3.o" +.include "src/debug_menu4.o" +.include "src/code_803B050.o" +.include "src/personality_test1.o" +.include "src/personality_test2.o" +.include "src/code_803D0D8.o" +.include "src/code_803E46C.o" +.include "src/code_8042B34.o" +.include "src/dungeon_map_access.o" +.include "src/dungeon_message.o" +.include "src/dungeon_move.o" +.include "src/code_805D8C8_1.o" +.include "src/dungeon_ai_items.o" +.include "src/code_807CD9C.o" +.include "src/dungeon_leader.o" +.include "src/dungeon_random.o" +.include "src/dungeon_music.o" +.include "src/pokemon.o" +.include "src/items.o" +.include "src/rescue_team_info.o" +.include "src/friend_area.o" +.include "src/game_options.o" +.include "src/code_8094D28.o" +.include "src/play_time.o" From edd2454349b40f4544ecfd36c1119fab9941c5c7 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 21:12:36 +0100 Subject: [PATCH 09/23] remove EWRAM_DATA_2 --- Makefile | 5 +-- data/data_8270000.s | 15 ------- include/gba/defines.h | 2 +- ld_script.txt | 4 +- src/agb_flash.c | 18 ++++----- src/code_8094F88.c | 12 +++--- src/code_80958E8.c | 86 ++++++++++++++++++++--------------------- src/code_8097670.c | 4 +- src/code_809C5C4.c | 6 +++ src/code_809D148.c | 2 +- src/exclusive_pokemon.c | 2 +- src/ground_link.c | 2 +- src/ground_main.c | 4 +- src/ground_script_1.c | 17 ++++---- src/ground_sprite.c | 2 +- src/m4a.c | 10 ++--- sym_ewram2.txt | 22 ----------- sym_ewram_init.txt | 10 +++++ 18 files changed, 100 insertions(+), 123 deletions(-) delete mode 100644 sym_ewram2.txt diff --git a/Makefile b/Makefile index 12612ef27..6f4071571 100755 --- a/Makefile +++ b/Makefile @@ -252,13 +252,10 @@ $(BUILD_DIR)/sym_ewram.ld: sym_ewram.txt $(BUILD_DIR)/sym_iwram.ld: sym_iwram.txt $(RAMSCRGEN) iwram_data $< ENGLISH > $@ -$(BUILD_DIR)/sym_ewram2.ld: sym_ewram2.txt - $(RAMSCRGEN) ewram_data_2 $< ENGLISH > $@ - $(BUILD_DIR)/sym_ewram_init.ld: sym_ewram_init.txt $(RAMSCRGEN) ewram_init $< ENGLISH > $@ -$(LD_SCRIPT): ld_script.txt $(BUILD_DIR)/sym_ewram.ld $(BUILD_DIR)/sym_ewram2.ld $(BUILD_DIR)/sym_ewram_init.ld $(BUILD_DIR)/sym_iwram.ld +$(LD_SCRIPT): ld_script.txt $(BUILD_DIR)/sym_ewram.ld $(BUILD_DIR)/sym_ewram_init.ld $(BUILD_DIR)/sym_iwram.ld cd $(BUILD_DIR) && sed -e "s#tools/#../../tools/#g" ../../ld_script.txt >ld_script.ld $(ELF): $(LD_SCRIPT) $(ALL_OBJECTS) $(LIBC) libagbsyscall tools diff --git a/data/data_8270000.s b/data/data_8270000.s index 4b57a69ab..3d3aec50e 100644 --- a/data/data_8270000.s +++ b/data/data_8270000.s @@ -4,21 +4,6 @@ gUnknown_8270000: @ 8270000 @ replacing .incbin "baserom.gba", 0x00270000, 0x2724 .byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8116390 -.4byte gUnknown_811636C -.4byte gUnknown_811633C -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 .4byte _impure_ptr - 0x108 .4byte _impure_ptr - 0xb0 .4byte _impure_ptr - 0x58 diff --git a/include/gba/defines.h b/include/gba/defines.h index 5ea69e969..557c4ed00 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -8,7 +8,7 @@ #define IWRAM_DATA __attribute__((section("iwram_data"))) #define EWRAM_DATA __attribute__((section("ewram_data"))) -#define EWRAM_DATA_2 __attribute__((section("ewram_data_2"))) +#define EWRAM_LIB __attribute__((section("ewram_lib"))) // Used only for agb flash and m4a #define EWRAM_INIT __attribute__((section("ewram_init"))) #define UNUSED __attribute__((unused)) #define NAKED __attribute__((naked)) diff --git a/ld_script.txt b/ld_script.txt index 7a5842ac5..1c6b3f08f 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -24,8 +24,8 @@ SECTIONS { *libgcc.a:dp-bit.o(.bss); *libc.a:syscalls.o(.bss); . = ALIGN(16); - src/m4a.o(ewram_data_2); - src/agb_flash.o(ewram_data_2); + src/m4a.o(ewram_lib); + src/agb_flash.o(ewram_lib); *libc.a:sbrkr.o(COMMON); } > EWRAM diff --git a/src/agb_flash.c b/src/agb_flash.c index 67ed407ec..3a851b4b9 100644 --- a/src/agb_flash.c +++ b/src/agb_flash.c @@ -6,16 +6,16 @@ static u16 sTimerCount; static vu16 *sTimerReg; static u16 sSavedIme; -EWRAM_DATA_2 u8 gFlashTimeoutFlag = {0}; -EWRAM_DATA_2 u8 (*PollFlashStatus)(u8 *) = {0}; -EWRAM_DATA_2 u16 (*WaitForFlashWrite)(u8 phase, u8 *addr, u8 lastData) = {0}; -EWRAM_DATA_2 u16 (*ProgramFlashSector)(u16 sectorNum, u8 *src) = {0}; -EWRAM_DATA_2 const struct FlashType *gFlash = {0}; +EWRAM_LIB u8 gFlashTimeoutFlag = {0}; +EWRAM_LIB u8 (*PollFlashStatus)(u8 *) = {0}; +EWRAM_LIB u16 (*WaitForFlashWrite)(u8 phase, u8 *addr, u8 lastData) = {0}; +EWRAM_LIB u16 (*ProgramFlashSector)(u16 sectorNum, u8 *src) = {0}; +EWRAM_LIB const struct FlashType *gFlash = {0}; // u16 (*ProgramFlashByte)(u16 sectorNum, u32 offset, u8 data); // not used in PMD: Red -EWRAM_DATA_2 u16 gFlashNumRemainingBytes = {0}; -EWRAM_DATA_2 u16 (*EraseFlashChip)() = {0}; -EWRAM_DATA_2 u16 (*EraseFlashSector)(u16 sectorNum) = {0}; -EWRAM_DATA_2 const u16 *gFlashMaxTime = {0}; +EWRAM_LIB u16 gFlashNumRemainingBytes = {0}; +EWRAM_LIB u16 (*EraseFlashChip)() = {0}; +EWRAM_LIB u16 (*EraseFlashSector)(u16 sectorNum) = {0}; +EWRAM_LIB const u16 *gFlashMaxTime = {0}; void SetReadFlash1(u16 *dest); diff --git a/src/code_8094F88.c b/src/code_8094F88.c index 2da05ce3c..b6a444174 100644 --- a/src/code_8094F88.c +++ b/src/code_8094F88.c @@ -10,10 +10,10 @@ #include "save.h" #include "text_util.h" -EWRAM_DATA_2 unkStruct_203B480 *gUnknown_203B480 = {0}; -EWRAM_DATA_2 unkStruct_203B484 *gUnknown_203B484 = {0}; -EWRAM_DATA_2 u32 *gUnknown_203B488 = {0}; -EWRAM_DATA_2 unkStruct_203B48C *gUnknown_203B48C = {0}; +EWRAM_INIT unkStruct_203B480 *gUnknown_203B480 = {NULL}; +EWRAM_INIT unkStruct_203B484 *gUnknown_203B484 = {NULL}; +EWRAM_INIT u32 *gUnknown_203B488 = {NULL}; +EWRAM_INIT unkStruct_203B48C *gUnknown_203B48C = {NULL}; EWRAM_DATA unkStruct_203B480 gUnknown_2038C88[0x20] = {0}; EWRAM_DATA unkStruct_203B484 gUnknown_2039288 = {0}; @@ -410,7 +410,7 @@ u32 sub_8095624(u8 *buffer, u32 b) for (i = 0; i < 32; i++) { WriteBits(&backup, &gUnknown_203B48C->unk4[i], 32); } - + FinishBitSerializer(&backup); return backup.count; } @@ -468,4 +468,4 @@ void sub_8095824(DataSerializer * a, unkStruct_203B480 *b) void sub_80958E4(u32 *a, u32 b) { *a = b; -} \ No newline at end of file +} diff --git a/src/code_80958E8.c b/src/code_80958E8.c index 25847f048..48648e714 100644 --- a/src/code_80958E8.c +++ b/src/code_80958E8.c @@ -42,7 +42,7 @@ extern u8 gUnknown_8109984[]; static EWRAM_DATA unkStruct_203B490 sUnknown_2039448 = {0}; -EWRAM_DATA_2 unkStruct_203B490 *gUnknown_203B490 = {0}; +EWRAM_INIT unkStruct_203B490 *gUnknown_203B490 = {0}; void LoadMailInfo(void) { @@ -280,7 +280,7 @@ bool8 GenerateMailJobDungeonInfo(WonderMail *mail) s32 halfFloorCount; s32 floorCount; DungeonLocation dungeonLoc; - + cap = sub_80A29B0(dungeonStack); if (cap == 0) { @@ -335,7 +335,7 @@ bool8 GenerateMailJobDungeonInfo(WonderMail *mail) floor = halfFloorCount; } } while (floor != floor_1); - + counter++; if (counter == cap) { counter = 0; @@ -369,7 +369,7 @@ u8 sub_8095E78(void) s32 counter; u8 friendAreaStack[NUM_FRIEND_AREAS]; - + counter = 0; for(friendAreaIndex = BOUNTIFUL_SEA; friendAreaIndex < NUM_FRIEND_AREAS; friendAreaIndex++) { @@ -383,7 +383,7 @@ u8 sub_8095E78(void) if((gUnknown_203B490->mailboxSlots[index].mailType != MAIL_TYPE_NONE) && (gUnknown_203B490->mailboxSlots[index].rewardType == FRIEND_AREA)) flag = TRUE; } - + for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { @@ -410,7 +410,7 @@ u8 sub_8095F28(u8 param_1) s32 itemID; s32 counter; u8 itemStack [NUMBER_OF_ITEM_IDS]; - + counter = 0; for(itemID = ITEM_STICK; itemID < NUMBER_OF_ITEM_IDS; itemID++) { @@ -493,8 +493,8 @@ void ShiftMailboxSlotsDown(void) { int counter1; // r5 int counter2; - - + + counter1 = 0; counter2 = 0; @@ -504,7 +504,7 @@ void ShiftMailboxSlotsDown(void) if (gUnknown_203B490->mailboxSlots[counter1].mailType != 0) break; } - + if (counter1 == NUM_MAILBOX_SLOTS) { break; } @@ -527,15 +527,15 @@ static void SortMailboxSlots(void) s32 r1; s32 r6; WonderMail job; - + for(r1 = 0; r1 < NUM_MAILBOX_SLOTS - 1; r1++) { for(r6 = r1 + 1; r6 < NUM_MAILBOX_SLOTS; r6++) { if(gUnknown_203B490->mailboxSlots[r6].mailType != 0) { - if((gUnknown_203B490->mailboxSlots[r1].unk4.dungeon.id > gUnknown_203B490->mailboxSlots[r6].unk4.dungeon.id) || - ((gUnknown_203B490->mailboxSlots[r1].unk4.dungeon.id == gUnknown_203B490->mailboxSlots[r6].unk4.dungeon.id) && + if((gUnknown_203B490->mailboxSlots[r1].unk4.dungeon.id > gUnknown_203B490->mailboxSlots[r6].unk4.dungeon.id) || + ((gUnknown_203B490->mailboxSlots[r1].unk4.dungeon.id == gUnknown_203B490->mailboxSlots[r6].unk4.dungeon.id) && (gUnknown_203B490->mailboxSlots[r1].unk4.dungeon.floor > gUnknown_203B490->mailboxSlots[r6].unk4.dungeon.floor))) { job = gUnknown_203B490->mailboxSlots[r1]; @@ -562,11 +562,11 @@ bool8 sub_80961D8(void) s32 friendAreaReward; WonderMail *slot; bool8 flag = FALSE; - + num = CountFilledMailboxSlots(); index = RandRange(num, NUM_MAILBOX_SLOTS); if(num >= NUM_MAILBOX_SLOTS) return 0; - if(!gUnknown_203B490->unk328) + if(!gUnknown_203B490->unk328) return 0; else { @@ -598,7 +598,7 @@ bool8 sub_80961D8(void) if(!gUnknown_203B490->PKMNNewsReceived[0x37]) if(!sub_8096E80(0x37)) floor = 0x37; } - + if(floor != 0x38) goto _slot; if(num > index) goto _08096392; floor = sub_8096E2C(); @@ -653,7 +653,7 @@ bool8 sub_80963B4(void) s32 num; WonderMail *slot; bool8 flag = FALSE; - + floor = sub_8096E2C(); num = CountFilledMailboxSlots(); if(num >= NUM_MAILBOX_SLOTS) return FALSE; @@ -675,7 +675,7 @@ void sub_80963FC(void) { s32 index; WonderMail *slot; - + for(index = 0; index < NUM_MAILBOX_SLOTS; index++) { slot = GetMailboxSlotInfo(index); @@ -749,7 +749,7 @@ s32 CountFilledPelipperBoardSlots(void) if (!IsPelipperBoardSlotEmpty(index)) { slots++; } - } + } return slots; } @@ -793,8 +793,8 @@ void ShiftPelipperJobsDown(void) { int counter1; // r5 int counter2; - - + + counter1 = 0; counter2 = 0; @@ -804,7 +804,7 @@ void ShiftPelipperJobsDown(void) if (gUnknown_203B490->pelipperBoardJobs[counter1].mailType != 0) break; } - + if (counter1 == MAX_ACCEPTED_JOBS) { break; } @@ -840,11 +840,11 @@ void SortPelipperJobs(void) ((gUnknown_203B490->pelipperBoardJobs[index1].unk4.dungeon.id == gUnknown_203B490->pelipperBoardJobs[index2].unk4.dungeon.id) && (gUnknown_203B490->pelipperBoardJobs[index1].unk4.dungeon.floor > gUnknown_203B490->pelipperBoardJobs[index2].unk4.dungeon.floor))) { mail = gUnknown_203B490->pelipperBoardJobs[index1]; - gUnknown_203B490->pelipperBoardJobs[index1] = gUnknown_203B490->pelipperBoardJobs[index2]; + gUnknown_203B490->pelipperBoardJobs[index1] = gUnknown_203B490->pelipperBoardJobs[index2]; gUnknown_203B490->pelipperBoardJobs[index2] = mail; } } - } + } } } @@ -853,13 +853,13 @@ void GeneratePelipperJobs(void) s32 range; WonderMail *mail; s32 index; - + range = RandRange(4,8); for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { gUnknown_203B490->pelipperBoardJobs[index].mailType = MAIL_TYPE_NONE; } - + index = 0; if (sub_8097318(0xe) != 0) { mail = GetPelipperBoardSlotInfo(0); @@ -924,11 +924,11 @@ bool8 IsMailinJobSlot(WonderMail *mail) { WonderMail *jobSlot; s32 index; - + for(index = 0, jobSlot = &gUnknown_203B490->jobSlots[0]; index < MAX_ACCEPTED_JOBS; jobSlot++, index++) { if(jobSlot->mailType != MAIL_TYPE_NONE) - if(mail->missionType == jobSlot->missionType) + if(mail->missionType == jobSlot->missionType) if(mail->unk2 == jobSlot->unk2) if(mail->unk4.dungeon.id == jobSlot->unk4.dungeon.id) if(mail->unk4.dungeon.floor == jobSlot->unk4.dungeon.floor) @@ -939,7 +939,7 @@ bool8 IsMailinJobSlot(WonderMail *mail) if(mail->rewardType == jobSlot->rewardType) if(mail->itemReward == jobSlot->itemReward) if(mail->friendAreaReward == jobSlot->friendAreaReward) - return TRUE; + return TRUE; } return FALSE; } @@ -950,7 +950,7 @@ bool8 sub_809693C(WonderMail *mail) u8 floor; bool8 escortMission; s32 index; - + dungeonIndex = mail->unk4.dungeon.id; floor = mail->unk4.dungeon.floor; escortMission = FALSE; @@ -977,7 +977,7 @@ s32 GetNumAcceptedJobs(void) { s32 index; s32 count; - + count = 0; for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { @@ -993,7 +993,7 @@ s32 CountJobsinDungeon(u8 dungeon) WonderMail *mail; s32 index; s32 count; - + count = 0; for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { @@ -1002,7 +1002,7 @@ s32 CountJobsinDungeon(u8 dungeon) (((mail->mailType == MAIL_TYPE_TAKEN_JOB || (mail->mailType == MAIL_TYPE_UNK8)) || (mail->mailType == MAIL_TYPE_UNK9)))) { count++; } - } + } return count; } @@ -1070,7 +1070,7 @@ void sub_8096AF8(struct unkStruct_8096AF8 *param_1, u8 slotIndex,u8 dungeon) WonderMail *jobSlot; Item *item; s32 index; - + jobSlot = GetJobSlotInfo(slotIndex); param_1->unk0 = FALSE; param_1->clientSpecies = jobSlot->clientSpecies; @@ -1110,7 +1110,7 @@ s16 sub_8096B98(u8 dungeon) { WonderMail *mail; s32 index; - + for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { mail = GetJobSlotInfo(index); @@ -1171,8 +1171,8 @@ void ShiftJobSlotsDown(void) { int counter1; // r5 int counter2; - - + + counter1 = 0; counter2 = 0; @@ -1182,7 +1182,7 @@ void ShiftJobSlotsDown(void) if (gUnknown_203B490->jobSlots[counter1].mailType != 0) break; } - + if (counter1 == MAX_ACCEPTED_JOBS) { break; } @@ -1205,15 +1205,15 @@ void SortJobSlots(void) s32 r1; s32 r6; WonderMail job; - + for(r1 = 0; r1 < MAX_ACCEPTED_JOBS - 1; r1++) { for(r6 = r1 + 1; r6 < MAX_ACCEPTED_JOBS; r6++) { if(gUnknown_203B490->jobSlots[r6].mailType != 0) { - if((gUnknown_203B490->jobSlots[r1].unk4.dungeon.id > gUnknown_203B490->jobSlots[r6].unk4.dungeon.id) || - ((gUnknown_203B490->jobSlots[r1].unk4.dungeon.id == gUnknown_203B490->jobSlots[r6].unk4.dungeon.id) && + if((gUnknown_203B490->jobSlots[r1].unk4.dungeon.id > gUnknown_203B490->jobSlots[r6].unk4.dungeon.id) || + ((gUnknown_203B490->jobSlots[r1].unk4.dungeon.id == gUnknown_203B490->jobSlots[r6].unk4.dungeon.id) && (gUnknown_203B490->jobSlots[r1].unk4.dungeon.floor > gUnknown_203B490->jobSlots[r6].unk4.dungeon.floor))) { job = gUnknown_203B490->jobSlots[r1]; @@ -1254,7 +1254,7 @@ u8 sub_8096E2C(void) if(gUnknown_203B490->mailboxSlots[index].mailType == 1) { if(floor <= gUnknown_203B490->mailboxSlots[index].unk4.dungeon.floor) - if( gUnknown_203B490->mailboxSlots[index].unk4.dungeon.floor < 0x32) + if( gUnknown_203B490->mailboxSlots[index].unk4.dungeon.floor < 0x32) floor = gUnknown_203B490->mailboxSlots[index].unk4.dungeon.floor + 1; } } @@ -1285,7 +1285,7 @@ s32 CalculateMailChecksum(WonderMail *mail) s32 sum; sum = (mail->unk2 + mail->missionType); - + sum += mail->unk4.dungeon.id; sum += mail->unk4.dungeon.floor; @@ -1370,7 +1370,7 @@ u32 RestoreMailInfo(u8 *r0, u32 size) gUnknown_203B490->unk328 = TRUE; else gUnknown_203B490->unk328 = FALSE; - + ReadBits(&backup, gUnknown_203B490->unk190, 40 * 8); ReadBits(&backup, gUnknown_203B490->unk1B8, 120 * 8); for (index = 0; index < 16; index++) diff --git a/src/code_8097670.c b/src/code_8097670.c index c1ff0c248..87b5f02d3 100644 --- a/src/code_8097670.c +++ b/src/code_8097670.c @@ -8,7 +8,7 @@ static EWRAM_DATA struct unkStruct_203B494 sUnknown_2039778 = {0}; -EWRAM_DATA_2 struct unkStruct_203B494 *gUnknown_203B494 = {0}; +EWRAM_INIT struct unkStruct_203B494 *gUnknown_203B494 = {0}; // data_810AE24.s extern const u8 *gAdventureLogText[]; @@ -392,4 +392,4 @@ u32 RestoreAdventureData(u8 *buffer, u32 bufLen) FinishBitSerializer(&seri); return seri.count; -} \ No newline at end of file +} diff --git a/src/code_809C5C4.c b/src/code_809C5C4.c index bc0ab88d3..cf3f9e4ab 100644 --- a/src/code_809C5C4.c +++ b/src/code_809C5C4.c @@ -50,6 +50,12 @@ void nullsub_114(); void nullsub_115(); void nullsub_116(); +extern const char gUnknown_8116390[]; +extern const char gUnknown_811636C[]; +extern const char gUnknown_811633C[]; + +EWRAM_INIT const char *gUnknown_203B4A0[3] = {gUnknown_8116390, gUnknown_811636C, gUnknown_811633C}; + void sub_809C5C4(void) { gUnknown_3001B68 = MemoryAlloc(sizeof(struct unkStruct_3001B68), 6); diff --git a/src/code_809D148.c b/src/code_809D148.c index bff257538..f0b85c674 100644 --- a/src/code_809D148.c +++ b/src/code_809D148.c @@ -377,7 +377,7 @@ void nullsub_120(void) // Different file below? -extern void *gUnknown_203B4B0; +EWRAM_INIT void *gUnknown_203B4B0 = NULL; void sub_809D490(void) { diff --git a/src/exclusive_pokemon.c b/src/exclusive_pokemon.c index 536f07b50..a4dde740f 100644 --- a/src/exclusive_pokemon.c +++ b/src/exclusive_pokemon.c @@ -26,7 +26,7 @@ const u8 filler_ex1[8] = 'p', 'k', 's', 'd', 'i', 'r', '0', 0 }; -EWRAM_DATA_2 struct ExclusivePokemonData *gUnknown_203B498 = {0}; +EWRAM_INIT struct ExclusivePokemonData *gUnknown_203B498 = {0}; EWRAM_DATA struct ExclusivePokemonData gExclusivePokemonInfo = {0}; void LoadExclusivePokemon(void) diff --git a/src/ground_link.c b/src/ground_link.c index fe1648cfd..f6a553b3c 100644 --- a/src/ground_link.c +++ b/src/ground_link.c @@ -4,7 +4,7 @@ #include "ground_script.h" #include "number_util.h" -EWRAM_DATA_2 const struct GroundLink *gCurrentGroundLink = NULL; +EWRAM_INIT const struct GroundLink *gCurrentGroundLink = NULL; extern DebugLocation gUnknown_8118798; extern const struct GroundScriptHeader *GetGroundScript(s16 r0, DebugLocation *r1); diff --git a/src/ground_main.c b/src/ground_main.c index 9602fd0c4..afd6a94bf 100644 --- a/src/ground_main.c +++ b/src/ground_main.c @@ -22,8 +22,8 @@ EWRAM_DATA u16 gUnknown_20398BE = {0}; EWRAM_DATA u32 gUnknown_20398C0 = {0}; EWRAM_DATA s16 gUnknown_20398C4 = {0}; -EWRAM_DATA_2 u8 gUnknown_203B49C = {0}; -EWRAM_DATA_2 u8 gUnknown_203B49D = {0}; +EWRAM_INIT u8 gUnknown_203B49C = {0}; +EWRAM_INIT u8 gUnknown_203B49D = {0}; #include "data/ground_main.h" diff --git a/src/ground_script_1.c b/src/ground_script_1.c index af9f00c9e..e59716a85 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -136,7 +136,6 @@ extern s16 gUnknown_2039A34; extern struct { const char *unk0; s32 unk4; } gChoices[9]; extern u8 gUnknown_2039D98[12]; -extern int gNumChoices; extern PixelPos gUnknown_81164DC; extern char gUnknown_81165D4[]; @@ -155,6 +154,8 @@ extern DebugLocation gUnknown_81166F8; extern DebugLocation gUnknown_8116704; extern ScriptCommand gUnknown_81164E4; +EWRAM_INIT static int sNumChoices = 0; + // Return values: // This function returns what's likely an enum, which controls the state of the script engine state machine, and possibly provides information to code calling the engine. // The enum is shared at least with HandleAction. @@ -1680,7 +1681,7 @@ s32 ExecuteScriptCommand(Action *action) { case 0xd2 ... 0xd8: { // DS: Assert(TRUE, "Script command call error SWITCH MENY") [sic] const char *out = curCmd.argPtr; - gNumChoices = 0; + sNumChoices = 0; scriptData->branchDiscriminant = 0; switch(curCmd.op) { case 0xd6: case 0xd7: case 0xd8: { @@ -1696,13 +1697,13 @@ s32 ExecuteScriptCommand(Action *action) { } if (!out) out = gUnknown_81166D8; // "" for (; scriptData->script.ptr->op == 0xd9; scriptData->script.ptr++) { - gChoices[gNumChoices].unk0 = scriptData->script.ptr->argPtr; - gChoices[gNumChoices].unk4 = gNumChoices + 1; - gNumChoices++; + gChoices[sNumChoices].unk0 = scriptData->script.ptr->argPtr; + gChoices[sNumChoices].unk4 = sNumChoices + 1; + sNumChoices++; } - if (gNumChoices <= 0) break; - gChoices[gNumChoices].unk0 = NULL; - gChoices[gNumChoices].unk4 = curCmd.argShort; + if (sNumChoices <= 0) break; + gChoices[sNumChoices].unk0 = NULL; + gChoices[sNumChoices].unk4 = curCmd.argShort; switch (curCmd.op) { case 0xd2: case 0xd3: case 0xd6: { sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, 0, (s16)curCmd.arg1, out); diff --git a/src/ground_sprite.c b/src/ground_sprite.c index 42b206ff8..7fe9f301a 100644 --- a/src/ground_sprite.c +++ b/src/ground_sprite.c @@ -20,7 +20,7 @@ EWRAM_DATA u8 gUnknown_2039DD0 = {0}; EWRAM_DATA u8 gUnknown_2039DD1[3] = {0, 0, 0}; // Unused, for alignment EWRAM_DATA u32 gUnknown_2039DD4 = {0}; -EWRAM_DATA_2 OpenedFile *gUnknown_203B4B4 = {0}; +EWRAM_INIT OpenedFile *gUnknown_203B4B4 = {NULL}; // dungeon_sbin.s extern const struct FileArchive gDungeonFileArchive; diff --git a/src/m4a.c b/src/m4a.c index 8846b23e9..a14060dae 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -15,11 +15,11 @@ EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE3 = {0}; EWRAM_DATA u8 gMPlayMemAccArea[0x10] = {0}; EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE2 = {0}; -EWRAM_DATA_2 struct SoundInfo gSoundInfo = {0}; -EWRAM_DATA_2 MPlayFunc gMPlayJumpTable[34] = {0}; -EWRAM_DATA_2 u32 gUnknown_203AF08 = {0}; -EWRAM_DATA_2 u32 gUnknown_203AF0C = {0}; -EWRAM_DATA_2 struct CgbChannel gCgbChans[4] = {0}; +EWRAM_LIB struct SoundInfo gSoundInfo = {0}; +EWRAM_LIB MPlayFunc gMPlayJumpTable[34] = {0}; +EWRAM_LIB u32 gUnknown_203AF08 = {0}; +EWRAM_LIB u32 gUnknown_203AF0C = {0}; +EWRAM_LIB struct CgbChannel gCgbChans[4] = {0}; u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust) { diff --git a/sym_ewram2.txt b/sym_ewram2.txt deleted file mode 100644 index f8b98b4c1..000000000 --- a/sym_ewram2.txt +++ /dev/null @@ -1,22 +0,0 @@ - .align 2 - - - -.include "src/code_8094F88.o" -.include "src/code_80958E8.o" -.include "src/code_8097670.o" -.include "src/exclusive_pokemon.o" -.include "src/ground_main.o" -.space 0x2 - -gUnknown_203B4A0: /* 203B4A0 (sub_809CCDC) */ - .space 0xC - -gNumChoices: /* 203B4AC (ExecuteScriptCommand) */ - .space 0x4 - -gUnknown_203B4B0: /* 203B4B0 (sub_809D490 - HandleAction) */ - .space 0x4 - -.include "src/ground_sprite.o" -.include "src/ground_link.o" diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index d61f65e7d..94b88dc2c 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -125,3 +125,13 @@ .include "src/game_options.o" .include "src/code_8094D28.o" .include "src/play_time.o" +.include "src/code_8094F88.o" +.include "src/code_80958E8.o" +.include "src/code_8097670.o" +.include "src/exclusive_pokemon.o" +.include "src/ground_main.o" +.include "src/code_809C5C4.o" +.include "src/ground_script_1.o" +.include "src/code_809D148.o" +.include "src/ground_sprite.o" +.include "src/ground_link.o" From 06b1d1d4fc6ef4448e26b589a90c433e7fc85d65 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 21:39:32 +0100 Subject: [PATCH 10/23] all ewram in rom --- data/data_8270000.s | 682 -------------------------------------------- ld_script.txt | 21 +- 2 files changed, 5 insertions(+), 698 deletions(-) delete mode 100644 data/data_8270000.s diff --git a/data/data_8270000.s b/data/data_8270000.s deleted file mode 100644 index 3d3aec50e..000000000 --- a/data/data_8270000.s +++ /dev/null @@ -1,682 +0,0 @@ - .section .rodata - - .global gUnknown_8270000 -gUnknown_8270000: @ 8270000 -@ replacing .incbin "baserom.gba", 0x00270000, 0x2724 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte _impure_ptr - 0x108 -.4byte _impure_ptr - 0xb0 -.4byte _impure_ptr - 0x58 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte __mprec_tens - 0x4c -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gCurrentGroundLink + 0x4 -.byte 0x01, 0x00, 0x00, 0x00 -.byte 0x43, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x43, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte __malloc_av_ -.4byte __malloc_av_ -.4byte __malloc_av_ + 0x8 -.4byte __malloc_av_ + 0x8 -.4byte __malloc_av_ + 0x10 -.4byte __malloc_av_ + 0x10 -.4byte __malloc_av_ + 0x18 -.4byte __malloc_av_ + 0x18 -.4byte __malloc_av_ + 0x20 -.4byte __malloc_av_ + 0x20 -.4byte __malloc_av_ + 0x28 -.4byte __malloc_av_ + 0x28 -.4byte __malloc_av_ + 0x30 -.4byte __malloc_av_ + 0x30 -.4byte __malloc_av_ + 0x38 -.4byte __malloc_av_ + 0x38 -.4byte __malloc_av_ + 0x40 -.4byte __malloc_av_ + 0x40 -.4byte __malloc_av_ + 0x48 -.4byte __malloc_av_ + 0x48 -.4byte __malloc_av_ + 0x50 -.4byte __malloc_av_ + 0x50 -.4byte __malloc_av_ + 0x58 -.4byte __malloc_av_ + 0x58 -.4byte __malloc_av_ + 0x60 -.4byte __malloc_av_ + 0x60 -.4byte __malloc_av_ + 0x68 -.4byte __malloc_av_ + 0x68 -.4byte __malloc_av_ + 0x70 -.4byte __malloc_av_ + 0x70 -.4byte __malloc_av_ + 0x78 -.4byte __malloc_av_ + 0x78 -.4byte __malloc_av_ + 0x80 -.4byte __malloc_av_ + 0x80 -.4byte __malloc_av_ + 0x88 -.4byte __malloc_av_ + 0x88 -.4byte __malloc_av_ + 0x90 -.4byte __malloc_av_ + 0x90 -.4byte __malloc_av_ + 0x98 -.4byte __malloc_av_ + 0x98 -.4byte __malloc_av_ + 0xa0 -.4byte __malloc_av_ + 0xa0 -.4byte __malloc_av_ + 0xa8 -.4byte __malloc_av_ + 0xa8 -.4byte __malloc_av_ + 0xb0 -.4byte __malloc_av_ + 0xb0 -.4byte __malloc_av_ + 0xb8 -.4byte __malloc_av_ + 0xb8 -.4byte __malloc_av_ + 0xc0 -.4byte __malloc_av_ + 0xc0 -.4byte __malloc_av_ + 0xc8 -.4byte __malloc_av_ + 0xc8 -.4byte __malloc_av_ + 0xd0 -.4byte __malloc_av_ + 0xd0 -.4byte __malloc_av_ + 0xd8 -.4byte __malloc_av_ + 0xd8 -.4byte __malloc_av_ + 0xe0 -.4byte __malloc_av_ + 0xe0 -.4byte __malloc_av_ + 0xe8 -.4byte __malloc_av_ + 0xe8 -.4byte __malloc_av_ + 0xf0 -.4byte __malloc_av_ + 0xf0 -.4byte __malloc_av_ + 0xf8 -.4byte __malloc_av_ + 0xf8 -.4byte __malloc_av_ + 0x100 -.4byte __malloc_av_ + 0x100 -.4byte __malloc_av_ + 0x108 -.4byte __malloc_av_ + 0x108 -.4byte __malloc_av_ + 0x110 -.4byte __malloc_av_ + 0x110 -.4byte __malloc_av_ + 0x118 -.4byte __malloc_av_ + 0x118 -.4byte __malloc_av_ + 0x120 -.4byte __malloc_av_ + 0x120 -.4byte __malloc_av_ + 0x128 -.4byte __malloc_av_ + 0x128 -.4byte __malloc_av_ + 0x130 -.4byte __malloc_av_ + 0x130 -.4byte __malloc_av_ + 0x138 -.4byte __malloc_av_ + 0x138 -.4byte __malloc_av_ + 0x140 -.4byte __malloc_av_ + 0x140 -.4byte __malloc_av_ + 0x148 -.4byte __malloc_av_ + 0x148 -.4byte __malloc_av_ + 0x150 -.4byte __malloc_av_ + 0x150 -.4byte __malloc_av_ + 0x158 -.4byte __malloc_av_ + 0x158 -.4byte __malloc_av_ + 0x160 -.4byte __malloc_av_ + 0x160 -.4byte __malloc_av_ + 0x168 -.4byte __malloc_av_ + 0x168 -.4byte __malloc_av_ + 0x170 -.4byte __malloc_av_ + 0x170 -.4byte __malloc_av_ + 0x178 -.4byte __malloc_av_ + 0x178 -.4byte __malloc_av_ + 0x180 -.4byte __malloc_av_ + 0x180 -.4byte __malloc_av_ + 0x188 -.4byte __malloc_av_ + 0x188 -.4byte __malloc_av_ + 0x190 -.4byte __malloc_av_ + 0x190 -.4byte __malloc_av_ + 0x198 -.4byte __malloc_av_ + 0x198 -.4byte __malloc_av_ + 0x1a0 -.4byte __malloc_av_ + 0x1a0 -.4byte __malloc_av_ + 0x1a8 -.4byte __malloc_av_ + 0x1a8 -.4byte __malloc_av_ + 0x1b0 -.4byte __malloc_av_ + 0x1b0 -.4byte __malloc_av_ + 0x1b8 -.4byte __malloc_av_ + 0x1b8 -.4byte __malloc_av_ + 0x1c0 -.4byte __malloc_av_ + 0x1c0 -.4byte __malloc_av_ + 0x1c8 -.4byte __malloc_av_ + 0x1c8 -.4byte __malloc_av_ + 0x1d0 -.4byte __malloc_av_ + 0x1d0 -.4byte __malloc_av_ + 0x1d8 -.4byte __malloc_av_ + 0x1d8 -.4byte __malloc_av_ + 0x1e0 -.4byte __malloc_av_ + 0x1e0 -.4byte __malloc_av_ + 0x1e8 -.4byte __malloc_av_ + 0x1e8 -.4byte __malloc_av_ + 0x1f0 -.4byte __malloc_av_ + 0x1f0 -.4byte __malloc_av_ + 0x1f8 -.4byte __malloc_av_ + 0x1f8 -.4byte __malloc_av_ + 0x200 -.4byte __malloc_av_ + 0x200 -.4byte __malloc_av_ + 0x208 -.4byte __malloc_av_ + 0x208 -.4byte __malloc_av_ + 0x210 -.4byte __malloc_av_ + 0x210 -.4byte __malloc_av_ + 0x218 -.4byte __malloc_av_ + 0x218 -.4byte __malloc_av_ + 0x220 -.4byte __malloc_av_ + 0x220 -.4byte __malloc_av_ + 0x228 -.4byte __malloc_av_ + 0x228 -.4byte __malloc_av_ + 0x230 -.4byte __malloc_av_ + 0x230 -.4byte __malloc_av_ + 0x238 -.4byte __malloc_av_ + 0x238 -.4byte __malloc_av_ + 0x240 -.4byte __malloc_av_ + 0x240 -.4byte __malloc_av_ + 0x248 -.4byte __malloc_av_ + 0x248 -.4byte __malloc_av_ + 0x250 -.4byte __malloc_av_ + 0x250 -.4byte __malloc_av_ + 0x258 -.4byte __malloc_av_ + 0x258 -.4byte __malloc_av_ + 0x260 -.4byte __malloc_av_ + 0x260 -.4byte __malloc_av_ + 0x268 -.4byte __malloc_av_ + 0x268 -.4byte __malloc_av_ + 0x270 -.4byte __malloc_av_ + 0x270 -.4byte __malloc_av_ + 0x278 -.4byte __malloc_av_ + 0x278 -.4byte __malloc_av_ + 0x280 -.4byte __malloc_av_ + 0x280 -.4byte __malloc_av_ + 0x288 -.4byte __malloc_av_ + 0x288 -.4byte __malloc_av_ + 0x290 -.4byte __malloc_av_ + 0x290 -.4byte __malloc_av_ + 0x298 -.4byte __malloc_av_ + 0x298 -.4byte __malloc_av_ + 0x2a0 -.4byte __malloc_av_ + 0x2a0 -.4byte __malloc_av_ + 0x2a8 -.4byte __malloc_av_ + 0x2a8 -.4byte __malloc_av_ + 0x2b0 -.4byte __malloc_av_ + 0x2b0 -.4byte __malloc_av_ + 0x2b8 -.4byte __malloc_av_ + 0x2b8 -.4byte __malloc_av_ + 0x2c0 -.4byte __malloc_av_ + 0x2c0 -.4byte __malloc_av_ + 0x2c8 -.4byte __malloc_av_ + 0x2c8 -.4byte __malloc_av_ + 0x2d0 -.4byte __malloc_av_ + 0x2d0 -.4byte __malloc_av_ + 0x2d8 -.4byte __malloc_av_ + 0x2d8 -.4byte __malloc_av_ + 0x2e0 -.4byte __malloc_av_ + 0x2e0 -.4byte __malloc_av_ + 0x2e8 -.4byte __malloc_av_ + 0x2e8 -.4byte __malloc_av_ + 0x2f0 -.4byte __malloc_av_ + 0x2f0 -.4byte __malloc_av_ + 0x2f8 -.4byte __malloc_av_ + 0x2f8 -.4byte __malloc_av_ + 0x300 -.4byte __malloc_av_ + 0x300 -.4byte __malloc_av_ + 0x308 -.4byte __malloc_av_ + 0x308 -.4byte __malloc_av_ + 0x310 -.4byte __malloc_av_ + 0x310 -.4byte __malloc_av_ + 0x318 -.4byte __malloc_av_ + 0x318 -.4byte __malloc_av_ + 0x320 -.4byte __malloc_av_ + 0x320 -.4byte __malloc_av_ + 0x328 -.4byte __malloc_av_ + 0x328 -.4byte __malloc_av_ + 0x330 -.4byte __malloc_av_ + 0x330 -.4byte __malloc_av_ + 0x338 -.4byte __malloc_av_ + 0x338 -.4byte __malloc_av_ + 0x340 -.4byte __malloc_av_ + 0x340 -.4byte __malloc_av_ + 0x348 -.4byte __malloc_av_ + 0x348 -.4byte __malloc_av_ + 0x350 -.4byte __malloc_av_ + 0x350 -.4byte __malloc_av_ + 0x358 -.4byte __malloc_av_ + 0x358 -.4byte __malloc_av_ + 0x360 -.4byte __malloc_av_ + 0x360 -.4byte __malloc_av_ + 0x368 -.4byte __malloc_av_ + 0x368 -.4byte __malloc_av_ + 0x370 -.4byte __malloc_av_ + 0x370 -.4byte __malloc_av_ + 0x378 -.4byte __malloc_av_ + 0x378 -.4byte __malloc_av_ + 0x380 -.4byte __malloc_av_ + 0x380 -.4byte __malloc_av_ + 0x388 -.4byte __malloc_av_ + 0x388 -.4byte __malloc_av_ + 0x390 -.4byte __malloc_av_ + 0x390 -.4byte __malloc_av_ + 0x398 -.4byte __malloc_av_ + 0x398 -.4byte __malloc_av_ + 0x3a0 -.4byte __malloc_av_ + 0x3a0 -.4byte __malloc_av_ + 0x3a8 -.4byte __malloc_av_ + 0x3a8 -.4byte __malloc_av_ + 0x3b0 -.4byte __malloc_av_ + 0x3b0 -.4byte __malloc_av_ + 0x3b8 -.4byte __malloc_av_ + 0x3b8 -.4byte __malloc_av_ + 0x3c0 -.4byte __malloc_av_ + 0x3c0 -.4byte __malloc_av_ + 0x3c8 -.4byte __malloc_av_ + 0x3c8 -.4byte __malloc_av_ + 0x3d0 -.4byte __malloc_av_ + 0x3d0 -.4byte __malloc_av_ + 0x3d8 -.4byte __malloc_av_ + 0x3d8 -.4byte __malloc_av_ + 0x3e0 -.4byte __malloc_av_ + 0x3e0 -.4byte __malloc_av_ + 0x3e8 -.4byte __malloc_av_ + 0x3e8 -.4byte __malloc_av_ + 0x3f0 -.4byte __malloc_av_ + 0x3f0 -.4byte __malloc_av_ + 0x3f8 -.4byte __malloc_av_ + 0x3f8 -.byte 0x00, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff - -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 diff --git a/ld_script.txt b/ld_script.txt index 1c6b3f08f..cf45d1ac0 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -729,26 +729,15 @@ SECTIONS { ewramClearEnd2 = .; INCLUDE "sym_ewram_init.ld" + *libc.a:impure.o(.data); + *libc.a:locale.o(.data); + *libc.a:mallocr.o(.data); + ewram2_end = .; + . = 0x2724; } > EWRAM AT>ROM EWRAM_INIT_ROM_START = LOADADDR(ewram_init); - ewram_init_temp : - ALIGN(4) - { - data/data_8270000.o(.rodata); - } > ROM =0 - - ewram_temp (NOLOAD) : - ALIGN(4) - { - INCLUDE "sym_ewram2.ld" - *libc.a:impure.o(.data); - *libc.a:locale.o(.data); - *libc.a:mallocr.o(.data); - ewram2_end = .; - } > EWRAM - unk_code_section : ALIGN(4) { From 0b46886c0b86aff5fbdbf836b3194f4ebd52470f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 21:43:46 +0100 Subject: [PATCH 11/23] better names for ewram ewram init start end --- ld_script.txt | 11 +++++++---- src/main.c | 14 +++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ld_script.txt b/ld_script.txt index cf45d1ac0..a6cc698e3 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -17,6 +17,7 @@ SECTIONS { ALIGN(4) { ewram_start = .; + data/sound_data.o(.bss); INCLUDE "sym_ewram.ld" src/agb_flash.o(.bss); @@ -27,6 +28,8 @@ SECTIONS { src/m4a.o(ewram_lib); src/agb_flash.o(ewram_lib); *libc.a:sbrkr.o(COMMON); + + ewram_end = .; } > EWRAM iwram 0x3000000 (NOLOAD) : @@ -725,15 +728,15 @@ SECTIONS { ewram_init : ALIGN(4) { - ewramClearEnd = .; - ewramClearEnd2 = .; + ewram_init_start = .; INCLUDE "sym_ewram_init.ld" *libc.a:impure.o(.data); *libc.a:locale.o(.data); *libc.a:mallocr.o(.data); - ewram2_end = .; - . = 0x2724; + + ewram_init_end = .; + . = 0x2724; /* This doesn't really do anything other than setting following 0x2724 bytes to 0 in rom */ } > EWRAM AT>ROM EWRAM_INIT_ROM_START = LOADADDR(ewram_init); diff --git a/src/main.c b/src/main.c index ee9aa49d9..01353d588 100644 --- a/src/main.c +++ b/src/main.c @@ -18,9 +18,9 @@ #include "text.h" extern u8 ewram_start[]; -extern u8 ewramClearEnd[]; -extern u8 ewramClearEnd2[]; // Force a second storage in the asm -extern u8 ewram2_end[]; +extern u8 ewram_end[]; // Force a second storage in the asm +extern u8 ewram_init_start[]; +extern u8 ewram_init_end[]; extern u8 iwram_start[]; extern u8 iwramClearEnd[]; extern u8 unk_code[]; @@ -49,12 +49,12 @@ void AgbMain(void) DmaStop(2); DmaStop(3); - if (ewram2_end - ewramClearEnd > 0) - CpuCopy32(EWRAM_INIT_ROM_START, ewramClearEnd, ewram2_end - ewramClearEnd); + if (ewram_init_end - ewram_init_start > 0) + CpuCopy32(EWRAM_INIT_ROM_START, ewram_init_start, ewram_init_end - ewram_init_start); - if (ewramClearEnd2 - ewram_start > 0) { + if (ewram_end - ewram_start > 0) { memset(value, 0, 4); - CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((ewramClearEnd2 - ewram_start) / 4) & 0x1FFFFF)); + CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((ewram_end - ewram_start) / 4) & 0x1FFFFF)); } if (unk_code_ram_end - unk_code_ram > 0) From 427a390b4a46bde378cbd795b7b35822e50a290b Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 21:46:14 +0100 Subject: [PATCH 12/23] remove comment in main --- src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 01353d588..09f5fe5ed 100644 --- a/src/main.c +++ b/src/main.c @@ -27,7 +27,6 @@ extern u8 unk_code[]; extern u8 unk_code_ram[]; extern u8 unk_code_ram_end[]; -// data_8270000.s extern const u8 EWRAM_INIT_ROM_START[]; UNUSED static const char sStringRomUserData[] = "PKD ROM USER DATA 000000"; @@ -40,7 +39,7 @@ extern void Hang(void); void AgbMain(void) { - u8 value[4]; + ALIGNED(4) u8 value[4]; REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3; @@ -53,7 +52,7 @@ void AgbMain(void) CpuCopy32(EWRAM_INIT_ROM_START, ewram_init_start, ewram_init_end - ewram_init_start); if (ewram_end - ewram_start > 0) { - memset(value, 0, 4); + memset(value, 0, sizeof(value)); CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((ewram_end - ewram_start) / 4) & 0x1FFFFF)); } @@ -61,7 +60,7 @@ void AgbMain(void) CpuCopy32(unk_code, unk_code_ram, unk_code_ram_end - unk_code_ram); if (iwramClearEnd - iwram_start > 0) { - memset(value, 0, 4); + memset(value, 0, sizeof(value)); CpuSet(&value, iwram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((iwramClearEnd - iwram_start) / 4) & 0x1FFFFF)); } From ba3f4714b1c374f2acc75972b9250391eea7e5b0 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Mon, 2 Dec 2024 21:54:14 -0800 Subject: [PATCH 13/23] Decomp more of pokemon.s --- asm/pokemon.s | 499 ---------------------------------------------- include/pokemon.h | 14 +- src/pokemon.c | 203 +++++++++++++++++++ 3 files changed, 212 insertions(+), 504 deletions(-) diff --git a/asm/pokemon.s b/asm/pokemon.s index 1ce0b21da..7b70b2b25 100644 --- a/asm/pokemon.s +++ b/asm/pokemon.s @@ -5,505 +5,6 @@ .text - thumb_func_start sub_808D1DC -sub_808D1DC: - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - movs r2, 0x8 - ldrsh r1, [r0, r2] - ldr r0, _0808D204 - ldr r2, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r6, [r0, 0x16] - ldr r0, _0808D208 - ldr r0, [r0] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - bne _0808D238 - b _0808D268 - .align 2, 0 -_0808D204: .4byte gMonsterParameters -_0808D208: .4byte gFriendAreas -_0808D20C: - ldr r0, [r7] - adds r0, r5 - mov r1, r8 - movs r2, 0x58 - bl memcpy - ldr r1, [r7] - adds r1, r5 - ldrh r2, [r1] - ldr r0, _0808D234 - ands r0, r2 - strh r0, [r1] - mov r1, r8 - movs r2, 0x8 - ldrsh r0, [r1, r2] - bl sub_80980B4 - ldr r0, [r7] - adds r0, r5 - b _0808D26A - .align 2, 0 -_0808D234: .4byte 0x0000bfff -_0808D238: - movs r4, 0 - ldr r7, _0808D274 -_0808D23C: - movs r0, 0x58 - adds r5, r4, 0 - muls r5, r0 - ldr r0, [r7] - adds r0, r5, r0 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0808D25E - adds r0, r4, 0 - bl sub_80923D4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r6 - beq _0808D20C -_0808D25E: - adds r4, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _0808D23C -_0808D268: - movs r0, 0 -_0808D26A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_0808D274: .4byte gRecruitedPokemonRef - thumb_func_end sub_808D1DC - - thumb_func_start sub_808D278 -sub_808D278: - push {r4-r7,lr} - lsls r0, 16 - asrs r0, 16 - ldr r1, _0808D29C - ldr r2, [r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r6, [r1, 0x16] - ldr r0, _0808D2A0 - ldr r0, [r0] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - bne _0808D2AA - b _0808D2DA - .align 2, 0 -_0808D29C: .4byte gMonsterParameters -_0808D2A0: .4byte gFriendAreas -_0808D2A4: - ldr r0, [r7] - adds r0, r5 - b _0808D2DC -_0808D2AA: - movs r4, 0 - ldr r7, _0808D2E4 -_0808D2AE: - movs r0, 0x58 - adds r5, r4, 0 - muls r5, r0 - ldr r0, [r7] - adds r0, r5, r0 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0808D2D0 - adds r0, r4, 0 - bl sub_80923D4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r6 - beq _0808D2A4 -_0808D2D0: - adds r4, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _0808D2AE -_0808D2DA: - movs r0, 0 -_0808D2DC: - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_0808D2E4: .4byte gRecruitedPokemonRef - thumb_func_end sub_808D278 - - thumb_func_start sub_808D2E8 -sub_808D2E8: - push {r4-r6,lr} - sub sp, 0x60 - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - ldr r0, [sp, 0x70] - lsls r4, 16 - asrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - str r3, [sp] - str r0, [sp, 0x4] - add r0, sp, 0x8 - adds r1, r4, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_808CFD0 - add r0, sp, 0x8 - bl sub_808D1DC - add sp, 0x60 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808D2E8 - - thumb_func_start sub_808D31C -sub_808D31C: - push {lr} - adds r1, r0, 0 - ldrb r0, [r1, 0x2] - cmp r0, 0 - bne _0808D338 - movs r2, 0 - ldrb r0, [r1, 0x4] - cmp r0, 0x41 - bne _0808D330 - movs r2, 0x1 -_0808D330: - adds r0, r2, 0 - cmp r0, 0 - bne _0808D338 - strh r0, [r1] -_0808D338: - pop {r0} - bx r0 - thumb_func_end sub_808D31C - - thumb_func_start GetPlayerPokemonStruct -GetPlayerPokemonStruct: - push {r4,lr} - movs r3, 0 - ldr r0, _0808D360 - ldr r4, [r0] -_0808D344: - movs r0, 0x58 - muls r0, r3 - adds r2, r0, r4 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808D364 - ldrb r0, [r2, 0x2] - cmp r0, 0 - beq _0808D364 - adds r0, r2, 0 - b _0808D370 - .align 2, 0 -_0808D360: .4byte gRecruitedPokemonRef -_0808D364: - adds r3, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r3, r0 - ble _0808D344 - movs r0, 0 -_0808D370: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetPlayerPokemonStruct - - thumb_func_start sub_808D378 -sub_808D378: - push {r4,lr} - movs r3, 0 - ldr r0, _0808D3A4 - ldr r4, [r0] -_0808D380: - movs r0, 0x58 - muls r0, r3 - adds r2, r0, r4 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808D3A8 - movs r1, 0 - ldrb r0, [r2, 0x4] - cmp r0, 0x41 - bne _0808D39A - movs r1, 0x1 -_0808D39A: - cmp r1, 0 - beq _0808D3A8 - adds r0, r2, 0 - b _0808D3B4 - .align 2, 0 -_0808D3A4: .4byte gRecruitedPokemonRef -_0808D3A8: - adds r3, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r3, r0 - ble _0808D380 - movs r0, 0 -_0808D3B4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808D378 - - thumb_func_start sub_808D3BC -sub_808D3BC: - push {r4-r6,lr} - movs r4, 0 - ldr r0, _0808D3E0 - ldr r2, [r0] - adds r3, r2, 0 - movs r6, 0x1 - movs r5, 0xCE - lsls r5, 1 -_0808D3CC: - ldrb r1, [r2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0808D3E4 - ldrb r0, [r2, 0x4] - cmp r0, 0x40 - bne _0808D3E4 - adds r0, r3, 0 - b _0808D3F0 - .align 2, 0 -_0808D3E0: .4byte gRecruitedPokemonRef -_0808D3E4: - adds r2, 0x58 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - ble _0808D3CC - movs r0, 0 -_0808D3F0: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808D3BC - - thumb_func_start sub_808D3F8 -sub_808D3F8: - push {r4-r6,lr} - movs r4, 0 - ldr r0, _0808D41C - ldr r2, [r0] - adds r3, r2, 0 - movs r6, 0x1 - movs r5, 0xCE - lsls r5, 1 -_0808D408: - ldrb r1, [r2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0808D420 - ldrb r0, [r2, 0x4] - cmp r0, 0x41 - bne _0808D420 - adds r0, r3, 0 - b _0808D42C - .align 2, 0 -_0808D41C: .4byte gRecruitedPokemonRef -_0808D420: - adds r2, 0x58 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - ble _0808D408 - movs r0, 0 -_0808D42C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808D3F8 - - thumb_func_start sub_808D434 -sub_808D434: - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 16 - asrs r5, r0, 16 - ldr r0, _0808D468 - ldr r2, [r0] - movs r4, 0 - movs r3, 0 - movs r0, 0x1 - mov r12, r0 - movs r7, 0xCE - lsls r7, 1 -_0808D44C: - ldrb r1, [r2] - mov r0, r12 - ands r0, r1 - cmp r0, 0 - beq _0808D46E - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, r5 - bne _0808D46E - cmp r4, r6 - bne _0808D46C - adds r0, r2, 0 - b _0808D478 - .align 2, 0 -_0808D468: .4byte gRecruitedPokemonRef -_0808D46C: - adds r4, 0x1 -_0808D46E: - adds r3, 0x1 - adds r2, 0x58 - cmp r3, r7 - ble _0808D44C - movs r0, 0 -_0808D478: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808D434 - - thumb_func_start GetFriendSum_808D480 -GetFriendSum_808D480: - push {r4,r5,lr} - ldr r0, _0808D4A8 - ldr r2, [r0] - movs r4, 0 - movs r5, 0x1 - ldr r3, _0808D4AC -_0808D48C: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0808D498 - adds r4, 0x1 -_0808D498: - subs r3, 0x1 - adds r2, 0x58 - cmp r3, 0 - bne _0808D48C - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .align 2, 0 -_0808D4A8: .4byte gRecruitedPokemonRef -_0808D4AC: .4byte 0x0000019d - thumb_func_end GetFriendSum_808D480 - - thumb_func_start sub_808D4B0 -sub_808D4B0: - push {r4-r6,lr} - ldr r0, _0808D4F8 - ldr r2, [r0] - movs r5, 0 - movs r4, 0 - ldr r6, _0808D4FC -_0808D4BC: - ldrh r3, [r2] - lsrs r0, r3, 1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808D4E4 - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _0808D4E4 - movs r1, 0 - ldrb r0, [r2, 0x4] - cmp r0, 0x41 - bne _0808D4D8 - movs r1, 0x1 -_0808D4D8: - cmp r1, 0 - bne _0808D4E4 - movs r5, 0x1 - adds r0, r6, 0 - ands r0, r3 - strh r0, [r2] -_0808D4E4: - adds r4, 0x1 - adds r2, 0x58 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _0808D4BC - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .align 2, 0 -_0808D4F8: .4byte gRecruitedPokemonRef -_0808D4FC: .4byte 0x0000fffd - thumb_func_end sub_808D4B0 - - thumb_func_start sub_808D500 -sub_808D500: - push {r4-r6,lr} - ldr r0, _0808D53C - ldr r2, [r0] - movs r5, 0 - movs r4, 0 - ldr r6, _0808D540 -_0808D50C: - ldrh r3, [r2] - lsrs r0, r3, 1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808D526 - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _0808D526 - movs r5, 0x1 - adds r0, r6, 0 - ands r0, r3 - strh r0, [r2] -_0808D526: - adds r4, 0x1 - adds r2, 0x58 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _0808D50C - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .align 2, 0 -_0808D53C: .4byte gRecruitedPokemonRef -_0808D540: .4byte 0x0000fffd - thumb_func_end sub_808D500 - thumb_func_start GetUnitSum_808D544 GetUnitSum_808D544: push {r4-r7,lr} diff --git a/include/pokemon.h b/include/pokemon.h index dfe0b30fb..9a3275a48 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -87,13 +87,17 @@ void ReadPoke1Bits(DataSerializer *, PokemonStruct1 *); s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon); void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID); void sub_808D0D8(PokemonStruct1 *pokemon); +PokemonStruct1 *GetPlayerPokemonStruct(void); +PokemonStruct1 *sub_808D1DC(PokemonStruct1*); +PokemonStruct1 *sub_808D378(void); +PokemonStruct1 *sub_808D3BC(void); +PokemonStruct1 *sub_808D3F8(void); +PokemonStruct1 * sub_808D434(s16 species, s32 param_2); +s32 GetFriendSum_808D480(void); +bool8 sub_808D4B0(void); +bool8 sub_808D500(void); // pokemon.s -extern PokemonStruct1 *GetPlayerPokemonStruct(void); -extern u32 sub_808D1DC(PokemonStruct1*); -extern PokemonStruct1 *sub_808D378(void); -extern PokemonStruct1 *sub_808D3BC(void); -extern PokemonStruct1 *sub_808D3F8(void); extern s32 GetUnitSum_808D544(u32); extern s32 sub_808D580(s32 *); diff --git a/src/pokemon.c b/src/pokemon.c index 865661bcf..15af66608 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -238,3 +238,206 @@ void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1) } } + +PokemonStruct1 *sub_808D1DC(PokemonStruct1 *pokemon) +{ + u32 friendArea; + s32 i; + + s32 species = pokemon->speciesNum; + friendArea = gMonsterParameters[species].friendArea; + + if(!gFriendAreas[friendArea]) return NULL; + for (i = 0; i < NUM_MONSTERS; i++) { + if (!PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + u8 speciesFriendArea = sub_80923D4(i); + if (speciesFriendArea == friendArea) { + gRecruitedPokemonRef->pokemon[i] = *pokemon; + gRecruitedPokemonRef->pokemon[i].unk0 &= 0xbfff; + sub_80980B4(pokemon->speciesNum); + return &gRecruitedPokemonRef->pokemon[i]; + } + } + } + return NULL; +} + +PokemonStruct1 *sub_808D278(s16 species, PokemonStruct1 *pokemon) +{ + u32 friendArea; + s32 i; + + friendArea = gMonsterParameters[species].friendArea; + + if(!gFriendAreas[friendArea]) return NULL; + for (i = 0; i < NUM_MONSTERS; i++) { + if (!PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + u8 speciesFriendArea = sub_80923D4(i); + if (speciesFriendArea == friendArea) { + return &gRecruitedPokemonRef->pokemon[i]; + } + } + } + return NULL; +} + +PokemonStruct1 *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation *location, u16 *moveID) +{ + PokemonStruct1 pokemon; + + sub_808CFD0(&pokemon, species, name, (u8)_itemID, location, moveID); + return sub_808D1DC(&pokemon); +} + +void sub_808D31C(PokemonStruct1 *param_1) +{ + bool8 flag; +#ifndef NONMATCHING + register bool32 flag_32 asm("r0"); +#else + bool32 flag_32; +#endif + + if ((!param_1->isTeamLeader)){ + flag = ((param_1->dungeonLocation).id == 0x41); + flag_32 = flag; + if(!flag_32) param_1->unk0 = flag_32; + } +} + +PokemonStruct1 * GetPlayerPokemonStruct(void) +{ + s32 index; + + for(index = 0; index < NUM_MONSTERS; index++) + { + if(((PokemonFlag1(&gRecruitedPokemonRef->pokemon[index])))){ + if(IsMonTeamLeader(&gRecruitedPokemonRef->pokemon[index])) { + return &gRecruitedPokemonRef->pokemon[index]; + } + } + } + return NULL; +} + +PokemonStruct1 * sub_808D378(void) +{ + s32 index; + + for(index = 0; index < NUM_MONSTERS; index++) + { + if(((PokemonFlag1(&gRecruitedPokemonRef->pokemon[index])))){ + if(IsMonPartner(&gRecruitedPokemonRef->pokemon[index])) { + return &gRecruitedPokemonRef->pokemon[index]; + } + } + } + return NULL; +} + +// NOTE: couldn't match with macros.. +// https://decomp.me/scratch/Qorg0 +PokemonStruct1 * sub_808D3BC(void) +{ + PokemonStruct1 *pokeStruct; + s32 index; + + for(index = 0; index < NUM_MONSTERS; index++) + { + pokeStruct = &gRecruitedPokemonRef->pokemon[index]; + if(((*(u8 *)&pokeStruct->unk0 & FLAG_UNK_1) && (pokeStruct->dungeonLocation.id == DUNGEON_JOIN_LOCATION_LEADER))) { + return pokeStruct; + } + } + return NULL; +} + +// NOTE: couldn't match with macros.. +// https://decomp.me/scratch/jCa3V +PokemonStruct1 * sub_808D3F8(void) +{ + PokemonStruct1 *pokeStruct; + s32 index; + + for(index = 0; index < NUM_MONSTERS; index++) + { + pokeStruct = &gRecruitedPokemonRef->pokemon[index]; + if(((*(u8 *)&pokeStruct->unk0 & FLAG_UNK_1) && (pokeStruct->dungeonLocation.id == DUNGEON_JOIN_LOCATION_PARTNER))) { + return &gRecruitedPokemonRef->pokemon[index]; + } + } + return NULL; +} + +PokemonStruct1 * sub_808D434(s16 species, s32 param_2) +{ + PokemonStruct1 *pokeStruct; + s32 index; + s32 counter; + s32 species_s32 = species; + + pokeStruct = gRecruitedPokemonRef->pokemon; + counter = 0; + for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++) + { + if(((PokemonFlag1(pokeStruct)) && (pokeStruct->speciesNum == species_s32))) { + if (counter == param_2) + return pokeStruct; + counter++; + } + } + return NULL; +} + +s32 GetFriendSum_808D480(void) +{ + s32 index; + s32 count; + PokemonStruct1 *pokeStruct; + + pokeStruct = gRecruitedPokemonRef->pokemon; + count = 0; + for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++) + { + if(PokemonFlag1(pokeStruct)){ + count++; + } + } + return count; +} + +bool8 sub_808D4B0(void) +{ + s32 index; + PokemonStruct1 *pokeStruct; + bool8 flag; + + pokeStruct = gRecruitedPokemonRef->pokemon; + flag = FALSE; + for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++) + { + if(PokemonFlag2(pokeStruct) && !IsMonTeamLeader(pokeStruct) && !IsMonPartner(pokeStruct)){ + flag = TRUE; + pokeStruct->unk0 &= 0xFFFD; + } + } + return flag; +} + +bool8 sub_808D500(void) +{ + s32 index; + PokemonStruct1 *pokeStruct; + bool8 flag; + + pokeStruct = gRecruitedPokemonRef->pokemon; + flag = FALSE; + for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++) + { + if(PokemonFlag2(pokeStruct) && !IsMonTeamLeader(pokeStruct)){ + flag = TRUE; + pokeStruct->unk0 &= 0xFFFD; + } + } + return flag; +} From 456dfec6b0c54743aed23edfd150fb3fb3d15365 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Fri, 6 Dec 2024 12:02:30 -0800 Subject: [PATCH 14/23] move some data over and nonmatch GetUnitSum --- asm/pokemon.s | 163 ----- data/data_8107224.s | 1371 ------------------------------------------- data/data_81076E4.s | 1345 ++++++++++++++++++++++++++++++++++++++++++ include/pokemon.h | 2 +- ld_script.txt | 4 +- src/pokemon.c | 1094 +++++++++++++++++++++++++++++++++- src/pokemon_mid.c | 969 ------------------------------ 7 files changed, 2427 insertions(+), 2521 deletions(-) delete mode 100644 asm/pokemon.s create mode 100644 data/data_81076E4.s delete mode 100644 src/pokemon_mid.c diff --git a/asm/pokemon.s b/asm/pokemon.s deleted file mode 100644 index 7b70b2b25..000000000 --- a/asm/pokemon.s +++ /dev/null @@ -1,163 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start GetUnitSum_808D544 -GetUnitSum_808D544: - push {r4-r7,lr} - adds r4, r0, 0 - ldr r0, _0808D57C - ldr r3, [r0] - movs r5, 0 - movs r2, 0 - movs r7, 0x1 - movs r6, 0xCE - lsls r6, 1 - adds r1, r4, 0 -_0808D558: - ldrh r0, [r3] - lsrs r0, 1 - ands r0, r7 - cmp r0, 0 - beq _0808D56C - cmp r4, 0 - beq _0808D568 - str r2, [r1] -_0808D568: - adds r1, 0x4 - adds r5, 0x1 -_0808D56C: - adds r2, 0x1 - adds r3, 0x58 - cmp r2, r6 - ble _0808D558 - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_0808D57C: .4byte gRecruitedPokemonRef - thumb_func_end GetUnitSum_808D544 - - thumb_func_start sub_808D580 -sub_808D580: - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, _0808D5AC - ldr r2, [r0] - movs r5, 0 - movs r4, 0 - mov r12, r0 - adds r3, r6, 0 -_0808D590: - ldrb r0, [r2, 0x2] - cmp r0, 0 - beq _0808D5B0 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808D5B0 - cmp r6, 0 - beq _0808D5B0 - str r4, [r3] - adds r5, 0x1 - b _0808D5BC - .align 2, 0 -_0808D5AC: .4byte gRecruitedPokemonRef -_0808D5B0: - adds r4, 0x1 - adds r2, 0x58 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _0808D590 -_0808D5BC: - mov r0, r12 - ldr r2, [r0] - movs r4, 0 - lsls r0, r5, 2 - adds r7, r0, r6 -_0808D5C6: - movs r1, 0 - ldrb r0, [r2, 0x4] - cmp r0, 0x41 - bne _0808D5D0 - movs r1, 0x1 -_0808D5D0: - cmp r1, 0 - beq _0808D5F8 - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _0808D5F8 - ldrh r1, [r2] - lsrs r0, r1, 1 - movs r3, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0808D5F8 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0808D5F8 - cmp r6, 0 - beq _0808D5F8 - str r4, [r7] - adds r5, 0x1 - b _0808D604 -_0808D5F8: - adds r4, 0x1 - adds r2, 0x58 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _0808D5C6 -_0808D604: - mov r0, r12 - ldr r2, [r0] - movs r4, 0 - movs r3, 0x1 - lsls r0, r5, 2 - adds r7, r0, r6 -_0808D610: - ldrh r1, [r2] - lsrs r0, r1, 1 - ands r0, r3 - cmp r0, 0 - beq _0808D63E - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0808D63E - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _0808D63E - movs r1, 0 - ldrb r0, [r2, 0x4] - cmp r0, 0x41 - bne _0808D632 - movs r1, 0x1 -_0808D632: - cmp r1, 0 - bne _0808D63E - cmp r6, 0 - beq _0808D63E - stm r7!, {r4} - adds r5, 0x1 -_0808D63E: - adds r4, 0x1 - adds r2, 0x58 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _0808D610 - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808D580 - - .align 2,0 diff --git a/data/data_8107224.s b/data/data_8107224.s index 4574e5be7..bdc0e4353 100644 --- a/data/data_8107224.s +++ b/data/data_8107224.s @@ -148,1376 +148,5 @@ gUnknown_8107544: @ 8107544 .byte 0x0d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 .byte 0x17, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 .byte 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 -@ pokemon -.string "pksdir0\0" -.global gUnknown_81075F4 -gUnknown_81075F4: @ 81075F4 -.string "monspara\0" -.align 2,0 - -.global gUnknown_8107600 -gUnknown_8107600: @ 8107600 -.string "{color YELLOW_RAW}%s{reset}" -.align 2,0 - -.global gUnknown_8107608 -gUnknown_8107608: @ 8107608 -.string "{color CYAN_RAW}%s{reset}" -.align 2,0 - -.global gUnownLetters -gUnownLetters: @ 8107610 -.string "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?\0" -.align 2,0 - -.global gUnknown_8107630 -gUnknown_8107630: @ 8107630 -.string "%s%c\0" -.align 2,0 - -.global gUnknown_8107638 -gUnknown_8107638: @ 8107638 -.string "%s\0" -.align 2,0 - -.global gUnknown_810763C -gUnknown_810763C: @ 810763C -.string "{color}%c%s{reset}\0" - -.global gUnknown_8107645 -gUnknown_8107645: @ 8107645 -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107654 -gUnknown_8107654: @ 8107654 -.byte 0x9d, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00 -.byte 0x33, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107684 -gUnknown_8107684: @ 8107684 -.string "kao%03d\0" -.align 2,0 - -.global gUnknown_810768C -gUnknown_810768C: @ 810768C -.string "lvmp%03d\0" -.align 2,0 - -.global gShadowSpriteSizeFlags_8107698 -gShadowSpriteSizeFlags_8107698: @ 8107698 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 - -.global gUnknown_81076BC -gUnknown_81076BC: @ 81076BC -.string "etcfont\0" -.align 2,0 - -.global gUnknown_81076C4 -gUnknown_81076C4: @ 81076C4 -.4byte -4 -.4byte -8 -.4byte -16 -.4byte -4 -.4byte -8 -.4byte -16 -@ pokemon_3 #1 -.string "pksdir0\0" - -.global gIQSkillGroups -gIQSkillGroups: @ 81076E4 -.4byte 9999 -.4byte 4 -.4byte 1 -.4byte 2 -.4byte 4 -.4byte 4 -.4byte 6 -.4byte 7 -.4byte 8 -.4byte 9 -.4byte 9 -.4byte 9 -.4byte 10 -.4byte 10 -.4byte 11 -.4byte 11 -.4byte 14 -.4byte 14 -.4byte 14 -.4byte 16 -.4byte 16 -.4byte 9 -.4byte 17 -.4byte 6 -@ pokemon_3 #2 -.string "pksdir0\0" -@ pokemon_3 #3 -.string "pksdir0\0" - -.global gUnknown_8107754 -gUnknown_8107754: @ 8107754 -.string "Stats\0" -.align 2,0 - -.global gUnknown_810775C -gUnknown_810775C: @ 810775C -.string "Features\0" -.align 2,0 - -.global gUnknown_8107768 -gUnknown_8107768: @ 8107768 -.string "Type:\0" -.align 2,0 - -.global gUnknown_8107770 -gUnknown_8107770: @ 8107770 -.string "Special Abilities:\0" -.align 2,0 - -.global gUnknown_8107784 -gUnknown_8107784: @ 8107784 -.string "{MOVE_ITEM_1}\0" -.align 2,0 - -.global gUnknown_8107788 -gUnknown_8107788: @ 8107788 -.byte 0x87, 0x42, 0x00, 0x00 - -.global gUnknown_810778C -gUnknown_810778C: @ 810778C -.byte 0x87, 0x40, 0x00, 0x00 - -.global gUnknown_8107790 -gUnknown_8107790: @ 8107790 -.string "{MOVE_ITEM_0}{MOVE_ITEM_1}\0" -.align 2,0 - -.global gUnknown_8107798 -gUnknown_8107798: @ 8107798 -.string "Info\0" -.align 2,0 -@ dungeon -.string "pksdir0\0" -.align 2,0 - -.global gDungeonFloorCount -gDungeonFloorCount: @ 81077A8 -@ replacing .incbin "baserom.gba", 0x1077A8, 0x40 -.byte 0x04, 0x06, 0x0a, 0x0e, 0x0a, 0x0b, 0x04, 0x0d, 0x0f, 0x0d, 0x04, 0x0a, 0x06, 0x10, 0x06, 0x18 -.byte 0x04, 0x1a, 0x0a, 0x29, 0x64, 0x15, 0x05, 0x64, 0x15, 0x0c, 0x64, 0x64, 0x1a, 0x1a, 0x0d, 0x15 -.byte 0x33, 0x1f, 0x1f, 0x1f, 0x15, 0x1f, 0x10, 0x0d, 0x14, 0x1f, 0x0b, 0x10, 0x15, 0x15, 0x1f, 0x05 -.byte 0x05, 0x0b, 0x03, 0x33, 0x46, 0x10, 0x1f, 0x14, 0x14, 0x0c, 0x64, 0x4c, 0x29, 0x64, 0x64, 0x02 - -.global gUnknown_81077E8 -gUnknown_81077E8: @ 81077E8 -@ replacing .incbin "baserom.gba", 0x1077E8, 0x40 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107828 -gUnknown_8107828: @ 8107828 -@ replacing .incbin "baserom.gba", 0x107828, 0x85C -.byte 0x02, 0x09, 0x00, 0x00, 0x03, 0x0d, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00 -.byte 0x0c, 0x05, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00 -.byte 0x12, 0x09, 0x00, 0x00, 0x13, 0x28, 0x00, 0x00, 0x14, 0x63, 0x00, 0x00, 0x15, 0x14, 0x00, 0x00 -.byte 0x17, 0x3b, 0x00, 0x00, 0x17, 0x63, 0x00, 0x00, 0x1a, 0x14, 0x00, 0x00, 0x1a, 0x32, 0x00, 0x00 -.byte 0x1a, 0x63, 0x00, 0x00, 0x1b, 0x0f, 0x00, 0x00, 0x1b, 0x19, 0x00, 0x00, 0x1b, 0x23, 0x00, 0x00 -.byte 0x1b, 0x2d, 0x00, 0x00, 0x1b, 0x3c, 0x00, 0x00, 0x1b, 0x46, 0x00, 0x00, 0x1b, 0x50, 0x00, 0x00 -.byte 0x1d, 0x19, 0x00, 0x00, 0x21, 0x14, 0x00, 0x00, 0x21, 0x1e, 0x00, 0x00, 0x22, 0x1e, 0x00, 0x00 -.byte 0x23, 0x14, 0x00, 0x00, 0x23, 0x1e, 0x00, 0x00, 0x24, 0x0a, 0x00, 0x00, 0x24, 0x0f, 0x00, 0x00 -.byte 0x24, 0x14, 0x00, 0x00, 0x25, 0x1e, 0x00, 0x00, 0x29, 0x0f, 0x00, 0x00, 0x29, 0x19, 0x00, 0x00 -.byte 0x2a, 0x0a, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x31, 0x03, 0x00, 0x00 -.byte 0x31, 0x04, 0x00, 0x00, 0x31, 0x05, 0x00, 0x00, 0x31, 0x06, 0x00, 0x00, 0x31, 0x07, 0x00, 0x00 -.byte 0x31, 0x08, 0x00, 0x00, 0x31, 0x09, 0x00, 0x00, 0x31, 0x0a, 0x00, 0x00, 0x34, 0x03, 0x00, 0x00 -.byte 0x34, 0x06, 0x00, 0x00, 0x34, 0x09, 0x00, 0x00, 0x34, 0x0c, 0x00, 0x00, 0x34, 0x0f, 0x00, 0x00 -.byte 0x34, 0x12, 0x00, 0x00, 0x34, 0x15, 0x00, 0x00, 0x34, 0x18, 0x00, 0x00, 0x34, 0x1b, 0x00, 0x00 -.byte 0x34, 0x1e, 0x00, 0x00, 0x34, 0x21, 0x00, 0x00, 0x34, 0x24, 0x00, 0x00, 0x34, 0x27, 0x00, 0x00 -.byte 0x34, 0x2a, 0x00, 0x00, 0x34, 0x2d, 0x00, 0x00, 0x34, 0x30, 0x00, 0x00, 0x34, 0x33, 0x00, 0x00 -.byte 0x34, 0x36, 0x00, 0x00, 0x34, 0x39, 0x00, 0x00, 0x34, 0x3c, 0x00, 0x00, 0x34, 0x3f, 0x00, 0x00 -.byte 0x34, 0x42, 0x00, 0x00, 0x34, 0x45, 0x00, 0x00, 0x35, 0x0f, 0x00, 0x00, 0x3b, 0x32, 0x00, 0x00 -.byte 0x3b, 0x48, 0x00, 0x00, 0x3c, 0x1e, 0x00, 0x00, 0x3c, 0x28, 0x00, 0x00, 0x3e, 0x63, 0x00, 0x00 -.byte 0x3f, 0xff, 0x00, 0x00 - -.global gUnknown_810795C -gUnknown_810795C: @ 810795C -.byte 0x00, 0x01, 0x01, 0x01 - -.global gUnknown_8107960 -gUnknown_8107960: @ 8107960 -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107966 -gUnknown_8107966: @ 8107966 -.byte 0x00, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107970 -gUnknown_8107970: @ 8107970 -.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 -.byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 - -.global gUnknown_810797E -gUnknown_810797E: @ 810797E -.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03 - -.global gUnknown_8107988 -gUnknown_8107988: @ 8107988 -.byte 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 - -.global gUnknown_8107993 -gUnknown_8107993: @ 8107993 -.byte 0x00, 0x03, 0x03, 0x03 - -.global gUnknown_8107997 -gUnknown_8107997: @ 8107997 -.byte 0x00 -.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 - -.global gUnknown_81079A4 -gUnknown_81079A4: @ 81079A4 -.byte 0x00, 0x04, 0x04, 0x04 -.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 - -.global gUnknown_81079B3 -gUnknown_81079B3: @ 81079B3 -.byte 0x00, 0x04, 0x04, 0x04, 0x04 -.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 - -.global gUnknown_81079C0 -gUnknown_81079C0: @ 81079C0 -.byte 0x00, 0x04, 0x04, 0x04 - -.global gUnknown_81079C4 -gUnknown_81079C4: @ 81079C4 -.byte 0x00, 0x04, 0x04, 0x04 -.byte 0x04, 0x04, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_81079CE -gUnknown_81079CE: @ 81079CE -.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_81079D4 -gUnknown_81079D4: @ 81079D4 -.byte 0x00, 0x05, 0x05, 0x05 -.byte 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_81079E4 -gUnknown_81079E4: @ 81079E4 -.byte 0x00, 0x05, 0x05, 0x05 -.byte 0x05, 0x05 - -.global gUnknown_81079EA -gUnknown_81079EA: @ 81079EA -.byte 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 -.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 - -.global gUnknown_8107A02 -gUnknown_8107A02: @ 8107A02 -.byte 0x00, 0x06, 0x06, 0x06 - -.global gUnknown_8107A06 -gUnknown_8107A06: @ 8107A06 -.byte 0x00, 0x06 -.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 -.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 - -.global gUnknown_8107A20 -gUnknown_8107A20: @ 8107A20 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07 - -.global gUnknown_8107A2A -gUnknown_8107A2A: @ 8107A2A -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107A53 -gUnknown_8107A53: @ 8107A53 -.byte 0x00, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b - -.global gUnknown_8107AB7 -gUnknown_8107AB7: @ 8107AB7 -.byte 0x00 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107ACC -gUnknown_8107ACC: @ 8107ACC -.byte 0x00, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_8107AD1 -gUnknown_8107AD1: @ 8107AD1 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_8107B35 -gUnknown_8107B35: @ 8107B35 -.byte 0x00, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08 - -.global gUnknown_8107B4A -gUnknown_8107B4A: @ 8107B4A -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107B56 -gUnknown_8107B56: @ 8107B56 -.byte 0x00, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09 -.byte 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c - -.global gUnknown_8107BBA -gUnknown_8107BBA: @ 8107BBA -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_8107C1E -gUnknown_8107C1E: @ 8107C1E -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107C38 -gUnknown_8107C38: @ 8107C38 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107C52 -gUnknown_8107C52: @ 8107C52 -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107C5F -gUnknown_8107C5F: @ 8107C5F -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107C74 -gUnknown_8107C74: @ 8107C74 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107CA7 -gUnknown_8107CA7: @ 8107CA7 -.byte 0x00 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107CC6 -gUnknown_8107CC6: @ 8107CC6 -.byte 0x00, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107CE5 -gUnknown_8107CE5: @ 8107CE5 -.byte 0x00, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107D04 -gUnknown_8107D04: @ 8107D04 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08 - -.global gUnknown_8107D19 -gUnknown_8107D19: @ 8107D19 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107D38 -gUnknown_8107D38: @ 8107D38 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107D48 -gUnknown_8107D48: @ 8107D48 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 - -.global gUnknown_8107D55 -gUnknown_8107D55: @ 8107D55 -.byte 0x00, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08 - -.global gUnknown_8107D69 -gUnknown_8107D69: @ 8107D69 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107D88 -gUnknown_8107D88: @ 8107D88 -.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_8107D93 -gUnknown_8107D93: @ 8107D93 -.byte 0x00, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107DA3 -gUnknown_8107DA3: @ 8107DA3 -.byte 0x00, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107DB8 -gUnknown_8107DB8: @ 8107DB8 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x08 - -.global gUnknown_8107DCD -gUnknown_8107DCD: @ 8107DCD -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107DEC -gUnknown_8107DEC: @ 8107DEC -.byte 0x00, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107DF1 -gUnknown_8107DF1: @ 8107DF1 -.byte 0x00, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107DF6 -gUnknown_8107DF6: @ 8107DF6 -.byte 0x00, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107E01 -gUnknown_8107E01: @ 8107E01 -.byte 0x00, 0x01, 0x01 - -.global gUnknown_8107E04 -gUnknown_8107E04: @ 8107E04 -.byte 0x00, 0x0f, 0x0f, 0x0f -.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f -.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f -.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f - -.global gUnknown_8107E37 -gUnknown_8107E37: @ 8107E37 -.byte 0x00 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107E7D -gUnknown_8107E7D: @ 8107E7D -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107E8D -gUnknown_8107E8D: @ 8107E8D -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107EAC -gUnknown_8107EAC: @ 8107EAC -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107EC0 -gUnknown_8107EC0: @ 8107EC0 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107ED4 -gUnknown_8107ED4: @ 8107ED4 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107EE0 -gUnknown_8107EE0: @ 8107EE0 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_8107F44 -gUnknown_8107F44: @ 8107F44 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c - -.global gUnknown_8107F90 -gUnknown_8107F90: @ 8107F90 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a - -.global gUnknown_8107FB9 -gUnknown_8107FB9: @ 8107FB9 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_810801D -gUnknown_810801D: @ 810801D -.byte 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e -.byte 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e - -.global gUnknown_8108081 -gUnknown_8108081: @ 8108081 -.byte 0x00, 0x07, 0x00 - -.global gUnknown_8108084 -gUnknown_8108084: @ 8108084 -@ replacing .incbin "baserom.gba", 0x108084, 0xDD4 -.4byte gUnknown_810795C -.4byte gUnknown_8107960 -.4byte gUnknown_8107966 -.4byte gUnknown_8107970 -.4byte gUnknown_810797E -.4byte gUnknown_8107988 -.4byte gUnknown_8107993 -.4byte gUnknown_8107997 -.4byte gUnknown_81079A4 -.4byte gUnknown_81079B3 -.4byte gUnknown_81079C0 -.4byte gUnknown_81079C4 -.4byte gUnknown_81079CE -.4byte gUnknown_81079D4 -.4byte gUnknown_81079E4 -.4byte gUnknown_81079EA -.4byte gUnknown_8107A02 -.4byte gUnknown_8107A06 -.4byte gUnknown_8107A20 -.4byte gUnknown_8107A2A -.4byte gUnknown_8107A53 -.4byte gUnknown_8107AB7 -.4byte gUnknown_8107ACC -.4byte gUnknown_8107AD1 -.4byte gUnknown_8107B35 -.4byte gUnknown_8107B4A -.4byte gUnknown_8107B56 -.4byte gUnknown_8107BBA -.4byte gUnknown_8107C1E -.4byte gUnknown_8107C38 -.4byte gUnknown_8107C52 -.4byte gUnknown_8107C5F -.4byte gUnknown_8107C74 -.4byte gUnknown_8107CA7 -.4byte gUnknown_8107CC6 -.4byte gUnknown_8107CE5 -.4byte gUnknown_8107D04 -.4byte gUnknown_8107D19 -.4byte gUnknown_8107D38 -.4byte gUnknown_8107D48 -.4byte gUnknown_8107D55 -.4byte gUnknown_8107D69 -.4byte gUnknown_8107D88 -.4byte gUnknown_8107D93 -.4byte gUnknown_8107DA3 -.4byte gUnknown_8107DB8 -.4byte gUnknown_8107DCD -.4byte gUnknown_8107DEC -.4byte gUnknown_8107DF1 -.4byte gUnknown_8107DF6 -.4byte gUnknown_8107E01 -.4byte gUnknown_8107E04 -.4byte gUnknown_8107E37 -.4byte gUnknown_8107E7D -.4byte gUnknown_8107E8D -.4byte gUnknown_8107EAC -.4byte gUnknown_8107EC0 -.4byte gUnknown_8107ED4 -.4byte gUnknown_8107EE0 -.4byte gUnknown_8107F44 -.4byte gUnknown_8107F90 -.4byte gUnknown_8107FB9 -.4byte gUnknown_810801D -.4byte gUnknown_8108081 - -.global gUnknown_8108184 -gUnknown_8108184: @ 8108184 -.byte 0x31, 0x75, 0xa0, 0x0f, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x62, 0x75, 0xa0, 0x0f, 0x38, 0x75 -.byte 0x70, 0x17, 0x39, 0x75, 0x10, 0x27, 0xd2, 0x75 - -.global gUnknown_810819C -gUnknown_810819C: @ 810819C -.byte 0x31, 0x75, 0x98, 0x04, 0x62, 0x12, 0x2b, 0x20 -.byte 0x10, 0x27, 0x3e, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x3c, 0x75, 0x10, 0x27 -.byte 0x43, 0x75, 0xd0, 0x07, 0x34, 0x75, 0xa0, 0x0f, 0x38, 0x75, 0x70, 0x17, 0x39, 0x75, 0x10, 0x27 -.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 -.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 -.byte 0xc4, 0x24, 0x10, 0x27, 0xb9, 0x75 - -.global gUnknown_81081EA -gUnknown_81081EA: @ 81081EA -.byte 0x31, 0x75, 0x20, 0x03, 0x80, 0x0c, 0x40, 0x1f, 0xf0, 0x23 -.byte 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27, 0x3a, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x3c, 0x75 -.byte 0x10, 0x27, 0x43, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 -.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 -.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 -.byte 0x10, 0x27, 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75 -.byte 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10 -.byte 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17 -.byte 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_8108274 -gUnknown_8108274: @ 8108274 -.byte 0x31, 0x75, 0x01, 0x03, 0x05, 0x0c, 0x0c, 0x1e, 0x8e, 0x22, 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27 -.byte 0x3a, 0x75, 0xd0, 0x07, 0xa0, 0x0f, 0x70, 0x17, 0x3c, 0x75, 0x40, 0x1f, 0x3b, 0x75, 0x10, 0x27 -.byte 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02 -.byte 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14 -.byte 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27 -.byte 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b -.byte 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75 -.byte 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75 -.byte 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_8108302 -gUnknown_8108302: @ 8108302 -.byte 0x32, 0x75 -.byte 0xd0, 0x07, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d -.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d -.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 -.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 -.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x49, 0x75, 0x65, 0x01 -.byte 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75 -.byte 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13 -.byte 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d -.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_810838E -gUnknown_810838E: @ 810838E -.byte 0x32, 0x75, 0x04, 0x09, 0x09, 0x15 -.byte 0x0c, 0x1e, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d, 0x88, 0x13, 0x0b, 0x1a -.byte 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a -.byte 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b -.byte 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d -.byte 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 -.byte 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b -.byte 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75 -.byte 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15 -.byte 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19 -.byte 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_8108432 -gUnknown_8108432: @ 8108432 -.byte 0x32, 0x75 -.byte 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d -.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d -.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 -.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 -.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00 -.byte 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75 -.byte 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e -.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 -.byte 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19 -.byte 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27 -.byte 0x75, 0x75 - -.global gUnknown_81084D6 -gUnknown_81084D6: @ 81084D6 -.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x95, 0x05 -.byte 0x37, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0x3c, 0x75, 0xe7, 0x1b, 0x33, 0x75, 0x7b, 0x21 -.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27 -.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 -.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 -.byte 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 -.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d -.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 -.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 -.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e -.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_810857E -gUnknown_810857E: @ 810857E -.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13 -.byte 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11 -.byte 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22, 0x37, 0x75 -.byte 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 -.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 -.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 -.byte 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 -.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 -.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 -.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 -.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 -.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_810862C -gUnknown_810862C: @ 810862C -.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18 -.byte 0x02, 0x25, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d -.byte 0x5c, 0x11, 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22 -.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d -.byte 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 -.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d -.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 -.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 -.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e -.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e -.byte 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_81086C8 -gUnknown_81086C8: @ 81086C8 -.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18, 0x02, 0x25, 0x34, 0x75 -.byte 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13 -.byte 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75 -.byte 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75 -.byte 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 -.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 -.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 -.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 -.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 -.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27 -.byte 0x34, 0x75 - -.global gUnknown_8108766 -gUnknown_8108766: @ 8108766 -.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27 -.byte 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75 -.byte 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27 -.byte 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27 -.byte 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05 -.byte 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d -.byte 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11 -.byte 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18 -.byte 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22 -.byte 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_8108804 -gUnknown_8108804: @ 8108804 -.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75 -.byte 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17 -.byte 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x37, 0x75 -.byte 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75 -.byte 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08 -.byte 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d -.byte 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13 -.byte 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75 -.byte 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 -.byte 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_81088A2 -gUnknown_81088A2: @ 81088A2 -.byte 0x32, 0x75 -.byte 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03 -.byte 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75 -.byte 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07 -.byte 0x33, 0x75, 0xa0, 0x0f, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75 -.byte 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a -.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f -.byte 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13 -.byte 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75 -.byte 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75 -.byte 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_810893E -gUnknown_810893E: @ 810893E -.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75 -.byte 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07 -.byte 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f -.byte 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07, 0x33, 0x75, 0xa0, 0x0f -.byte 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04 -.byte 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75 -.byte 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10 -.byte 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75 -.byte 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b -.byte 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75 -.byte 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_81089DA -gUnknown_81089DA: @ 81089DA -.byte 0x31, 0x75, 0xe2, 0x04, 0x6a, 0x18, 0x10, 0x27, 0x3f, 0x75 -.byte 0x10, 0x27, 0x5f, 0x75, 0x83, 0x06, 0x32, 0x75, 0xa6, 0x0e, 0x34, 0x75, 0xe7, 0x11, 0x32, 0x75 -.byte 0x29, 0x15, 0x6a, 0x18, 0x31, 0x75, 0xab, 0x1b, 0x31, 0x75, 0x4c, 0x1d, 0x8d, 0x20, 0x33, 0x75 -.byte 0xcf, 0x23, 0x10, 0x27, 0x34, 0x75, 0x88, 0x13, 0x10, 0x27, 0xcc, 0x75 - -.global gUnknown_8108A10 -gUnknown_8108A10: @ 8108A10 -.byte 0x35, 0x75, 0xc4, 0x09 -.byte 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08 -.byte 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75 -.byte 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16 -.byte 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27 -.byte 0x3b, 0x75, 0xca, 0x02, 0x5f, 0x08, 0x29, 0x0b, 0x34, 0x75, 0xf3, 0x0d, 0x3a, 0x75, 0xe7, 0x1b -.byte 0xb1, 0x1e, 0x7b, 0x21, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108A6E -gUnknown_8108A6E: @ 8108A6E -.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17 -.byte 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75 -.byte 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75 -.byte 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75, 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75 -.byte 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 - -.global gUnknown_8108AB4 -gUnknown_8108AB4: @ 8108AB4 -.byte 0x35, 0x75, 0xc4, 0x09, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75 -.byte 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75 -.byte 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14 -.byte 0x71, 0x02, 0x52, 0x16, 0xb7, 0x17, 0x34, 0x75, 0xe2, 0x04, 0x31, 0x75, 0x82, 0x1a, 0x4c, 0x1d -.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e -.byte 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75, 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27 -.byte 0x45, 0x75 - -.global gUnknown_8108B16 -gUnknown_8108B16: @ 8108B16 -.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20 -.byte 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75, 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10 -.byte 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75, 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75 -.byte 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75, 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75 -.byte 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 - -.global gUnknown_8108B5C -gUnknown_8108B5C: @ 8108B5C -.byte 0x35, 0x75, 0x6a, 0x18, 0x33, 0x75, 0x10, 0x27 -.byte 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x33, 0x75, 0x63, 0x05, 0x15, 0x08, 0x31, 0x75, 0xc7, 0x0a -.byte 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d, 0x34, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75 -.byte 0x83, 0x11, 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x71, 0x02, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18 -.byte 0x33, 0x75, 0xe2, 0x04, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21, 0x5e, 0x24 -.byte 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e, 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75 -.byte 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108BC0 -gUnknown_8108BC0: @ 8108BC0 -.byte 0xe8, 0x03, 0xd0, 0x07 -.byte 0x58, 0x1b, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27 -.byte 0x32, 0x75, 0x57, 0x04, 0x36, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11, 0xb4, 0x15, 0x0b, 0x1a -.byte 0x62, 0x1e, 0x3a, 0x75, 0xb9, 0x22, 0x3a, 0x75, 0xe4, 0x24, 0x10, 0x27, 0x37, 0x75, 0xe5, 0x02 -.byte 0x34, 0x75, 0xae, 0x08, 0x34, 0x75, 0x78, 0x0e, 0x41, 0x14, 0x32, 0x75, 0x0b, 0x1a, 0x36, 0x75 -.byte 0x7d, 0x1b, 0x31, 0x75, 0x47, 0x21, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 - -.global gUnknown_8108C12 -gUnknown_8108C12: @ 8108C12 -.byte 0x35, 0x75 -.byte 0x88, 0x13, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x31, 0x75, 0xa1, 0x01 -.byte 0x31, 0x75, 0x63, 0x05, 0x15, 0x08, 0x41, 0x03, 0xc7, 0x0a, 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d -.byte 0x31, 0x75, 0xe2, 0x04, 0x32, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75, 0x83, 0x11 -.byte 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x83, 0x06, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18, 0x31, 0x75 -.byte 0x23, 0x08, 0x31, 0x75, 0xc4, 0x09, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21 -.byte 0x5e, 0x24, 0x10, 0x27, 0x38, 0x75, 0x65, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x47, 0x10, 0xe7, 0x11 -.byte 0x88, 0x13, 0x33, 0x75, 0x29, 0x15, 0x35, 0x75, 0x6a, 0x18, 0xab, 0x1b, 0x34, 0x75, 0x4c, 0x1d -.byte 0xed, 0x1e, 0x8d, 0x20, 0x2e, 0x22, 0xcf, 0x23, 0x3c, 0x75, 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108C92 -gUnknown_8108C92: @ 8108C92 -.byte 0x01, 0x03 -.byte 0x02, 0x06, 0x0a, 0x18, 0x0b, 0x1b, 0x0c, 0x1e, 0x34, 0x75, 0x10, 0x27, 0x33, 0x75, 0xb6, 0x16 -.byte 0x56, 0x24, 0x10, 0x27, 0x33, 0x75, 0x58, 0x1b, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x50, 0x75 -.byte 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09 -.byte 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b -.byte 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x7c, 0x75, 0x81, 0x01, 0x32, 0x75 -.byte 0x01, 0x03, 0x02, 0x06, 0x83, 0x07, 0x04, 0x09, 0x84, 0x0a, 0x31, 0x75, 0x86, 0x0d, 0x06, 0x0f -.byte 0x87, 0x10, 0x88, 0x13, 0x33, 0x75, 0x89, 0x16, 0x8a, 0x19, 0x8c, 0x1c, 0x31, 0x75, 0x0c, 0x1e -.byte 0x31, 0x75, 0x8d, 0x1f, 0x0e, 0x21, 0x34, 0x75, 0x8e, 0x22, 0x33, 0x75, 0x0f, 0x24, 0x36, 0x75 -.byte 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108D18 -gUnknown_8108D18: @ 8108D18 -.byte 0x56, 0x0c, 0x31, 0x75, 0x81, 0x12, 0x9d, 0x16, 0xba, 0x1a, 0xd7, 0x1e -.byte 0x33, 0x75, 0xf3, 0x22, 0x10, 0x27, 0x35, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x10, 0x27, 0x33, 0x75 -.byte 0xb3, 0x01, 0x66, 0x03, 0x31, 0x75, 0x18, 0x05, 0xcb, 0x06, 0x32, 0x75, 0x7e, 0x08, 0x31, 0x0a -.byte 0xe3, 0x0b, 0x96, 0x0d, 0x49, 0x0f, 0xfc, 0x10, 0x36, 0x75, 0xaf, 0x12, 0x61, 0x14, 0x14, 0x16 -.byte 0xc7, 0x17, 0x7a, 0x19, 0x2d, 0x1b, 0x33, 0x75, 0xdf, 0x1c, 0x92, 0x1e, 0x45, 0x20, 0xf8, 0x21 -.byte 0xaa, 0x23, 0x31, 0x75, 0x5d, 0x25, 0x10, 0x27, 0x3c, 0x75, 0x05, 0x0d, 0x3f, 0x75, 0x0b, 0x1a -.byte 0x32, 0x75, 0x10, 0x27, 0x49, 0x75, 0x10, 0x27, 0x45, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 -.byte 0x08, 0x04, 0x57, 0x04, 0xc4, 0x00, 0x31, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x88, 0x01, 0x8a, 0x0a -.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x31, 0x75, 0x4c, 0x02, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e -.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 -.byte 0xd7, 0x13, 0x15, 0x15, 0x10, 0x03, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x31, 0x75, 0xd4, 0x03 -.byte 0x1d, 0x19, 0x98, 0x04, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 -.byte 0x10, 0x27, 0x32, 0x75, 0x5d, 0x05, 0x35, 0x75, 0x21, 0x06, 0xe5, 0x06, 0xa9, 0x07, 0x6d, 0x08 -.byte 0xf5, 0x09, 0xb9, 0x0a, 0x7d, 0x0b, 0x41, 0x0c, 0x05, 0x0d, 0x8d, 0x0e, 0x52, 0x0f, 0x16, 0x10 -.byte 0x9e, 0x11, 0x62, 0x12, 0x26, 0x13, 0x31, 0x75, 0xae, 0x14, 0x36, 0x16, 0xbe, 0x17, 0x83, 0x18 -.byte 0x47, 0x19, 0x0b, 0x1a, 0xcf, 0x1a, 0x93, 0x1b, 0x57, 0x1c, 0x1b, 0x1d, 0xdf, 0x1d, 0x31, 0x75 -.byte 0xa3, 0x1e, 0x33, 0x75, 0x67, 0x1f, 0x2b, 0x20, 0xef, 0x20, 0xb3, 0x21, 0x78, 0x22, 0x32, 0x75 -.byte 0x00, 0x24, 0xc4, 0x24, 0x31, 0x75, 0x88, 0x25, 0x4c, 0x26, 0x10, 0x27, 0x38, 0x75, 0x10, 0x27 -.byte 0x37, 0x75 - -.global gUnknown_8108E36 -gUnknown_8108E36: @ 8108E36 -.byte 0x33, 0x75, 0x83, 0x06, 0x34, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x99, 0x75, 0x10, 0x27 -.byte 0x34, 0x75, 0xc4, 0x09, 0x32, 0x75, 0x88, 0x13, 0x4c, 0x1d, 0x3a, 0x75, 0x10, 0x27, 0x89, 0x75 -.byte 0x10, 0x27, 0x4a, 0x75 - -.global gUnknown_8108E58 -gUnknown_8108E58: @ 8108E58 -@ replacing .incbin "baserom.gba", 0x00108e58, 0x68 -@ u16*s -.4byte gUnknown_8108184 -.4byte gUnknown_810819C -.4byte gUnknown_81081EA -.4byte gUnknown_8108274 -.4byte gUnknown_8108302 -.4byte gUnknown_810838E -.4byte gUnknown_8108432 -.4byte gUnknown_81084D6 -.4byte gUnknown_810857E -.4byte gUnknown_810862C -.4byte gUnknown_81086C8 -.4byte gUnknown_8108766 -.4byte gUnknown_8108804 -.4byte gUnknown_81088A2 -.4byte gUnknown_810893E -.4byte gUnknown_81089DA -.4byte gUnknown_8108A10 -.4byte gUnknown_8108A6E -.4byte gUnknown_8108AB4 -.4byte gUnknown_8108B16 -.4byte gUnknown_8108B5C -.4byte gUnknown_8108BC0 -.4byte gUnknown_8108C12 -.4byte gUnknown_8108C92 -.4byte gUnknown_8108D18 -.4byte gUnknown_8108E36 - -.global gUnknown_8108EC0 -gUnknown_8108EC0: @ 8108EC0 -@ replacing .incbin "baserom.gba", 0x108EC0, 0x50 -.byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -.byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x10, 0x17, 0x18, 0x19, 0x14, 0x17, 0x1c, 0x1d, 0x1e, 0x1f -.byte 0x20, 0x21, 0x1c, 0x23, 0x24, 0x25, 0x1e, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f -.byte 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x2d, 0x2d, 0x3b, 0x3c, 0x30, 0x3e, 0x3f -.byte 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f - -.global gUnknown_8108F10 -gUnknown_8108F10: @ 8108F10 -.string "{color YELLOW_D}%s{reset}\0" -.align 2,0 - -.global gUnknown_8108F18 -gUnknown_8108F18: @ 8108F18 -.string "{color YELLOW_D}%s{reset} {color CYAN}%d{reset}F\0" -.align 2,0 - -.global gUnknown_8108F2C -gUnknown_8108F2C: @ 8108F2C -.string "{color YELLOW_D}%s{reset} B{color CYAN}%d{reset}F\0" -.align 2,0 - -.global gUnknown_8108F40 -gUnknown_8108F40: @ 8108F40 -.byte 0x00, 0x00 - -.global gUnknown_8108F42 -gUnknown_8108F42: @ 8108F42 -.byte 0x99, 0x00, 0x9c, 0x00, 0x9e, 0x00, 0xdb, 0x00 - -.global gUnknown_8108F4A -gUnknown_8108F4A: @ 8108F4A -.byte 0xe1, 0xe7, 0xe6, 0xe2, 0x00, 0x00 - -.global gUnknown_8108F50 -gUnknown_8108F50: @ 8108F50 -.string "No problem.\0" -.align 2,0 -@ items.c -.string "pksdir0\0" -.align 2,0 - -.global gUnknown_8108F64 -gUnknown_8108F64: @ 8108F64 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x2c, 0x01, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x40, 0x10, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x21, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84, 0x0c, 0x21, 0x44, 0xff, 0x03, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x02, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x25, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x21, 0xc0, 0xfe, 0x44, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0xfc, 0x45, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x80, 0x00, 0x18, 0x82, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x45, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x64, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x18, 0x80, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x44, 0xfd, 0x61, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x00, 0x09, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x84, 0x04, 0x38, 0x80, 0x02, 0x00, 0x80, 0x04, 0x0c, 0x21, 0x44, 0xfd, 0x7d, 0x02, 0x00, 0x00 -.byte 0x66, 0x83, 0x93, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7e, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x64, 0x02, 0x00, 0x20 -.byte 0x66, 0x81, 0xd7, 0xcd, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x0c, 0x14, 0x7e, 0xa2, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xa8, 0x0c, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x14, 0x7f, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x20, 0xbe, 0x21, 0xc0, 0xff, 0x7f, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8c, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x80, 0xbc, 0x20, 0x10, 0x01, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x84, 0x3c, 0xe1, 0x03, 0x00, 0x00, 0x02, 0x00, 0x08 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xbe, 0x7e, 0xe9, 0x4e, 0x3c, 0xa0, 0xa7, 0xbf, 0x39, 0x20, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x79, 0xec, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xfe, 0x7e, 0xe9, 0x4e, 0x34, 0xa0, 0xa7, 0xbf, 0x39, 0x04, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x59, 0xec, 0x00, 0x01, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x04, 0x38, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x28 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x02, 0x08, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x10, 0xa0, 0xae, 0xbf, 0x39, 0x08, 0x00, 0x00, 0x02, 0x20, 0x60 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x02, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x04, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x82, 0x3c, 0x06, 0xc0, 0x0c, 0x30, 0xa0, 0x00, 0x0d, 0x21, 0x00, 0x00, 0x00, 0x82, 0x01, 0x28 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x12, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xfd, 0x7f, 0xe9, 0xcf, 0x37, 0xa0, 0x84, 0x3c, 0x21, 0x10, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x35, 0x7b, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0c, 0x01, 0x04, 0x02, 0x02, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0x34, 0xfb, 0xab, 0xc9, 0x01, 0xa0, 0xad, 0xbf, 0x39, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0x8c, 0x21, 0xc4, 0xff, 0x7f, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xac, 0x1c, 0x19, 0x04, 0x56, 0x02, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8c, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc5, 0x7f, 0x88, 0x8e, 0x1b, 0xa0, 0xad, 0xbf, 0xe5, 0x2b, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x07, 0xf4, 0xff, 0xb9, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 -.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x28 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x39, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xfd, 0xff, 0xeb, 0xef, 0x3f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x27, 0xfc, 0xff, 0xfb, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x7f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 - -.global gItemParaFileName -gItemParaFileName: @ 8109764 -.string "itempara\0" -.align 2,0 - -.global gUnknown_8109770 -gUnknown_8109770: @ 8109770 -.string "%s %d\0" -.align 2,0 - -.global gUnknown_8109778 -gUnknown_8109778: @ 8109778 -.string "%s\0" -.align 2,0 - -.global gUnknown_810977C -gUnknown_810977C: @ 810977C -@ replacing .incbin "baserom.gba", 0x0010977c, 0x8 -.string "%d {POKE}\0" - -.global gUnknown_8109784 -gUnknown_8109784: @ 8109784 -@ replacing .incbin "baserom.gba", 0x00109784, 0x8 -.byte 0x87, 0x44 -.asciz "%s\0" -.align 2,0 - -.global gUnknown_810978C -gUnknown_810978C: @ 810978C -@ replacing .incbin "baserom.gba", 0x0010978c, 0x8 -.byte 0x87, 0x41 -.asciz "%s\0" -.align 2,0 - -.global gUnknown_8109794 -gUnknown_8109794: @ 8109794 -@ replacing .incbin "baserom.gba", 0x00109794, 0x10 -.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" -.align 2, 0 - -.global gUnknown_81097A4 -gUnknown_81097A4: @ 81097A4 -@ replacing .incbin "baserom.gba", 0x001097a4, 0xc -.string "%s{COLOR GREEN_RAW}%s{RESET}\0" -.align 2, 0 - -.global gPowersOfTen -gPowersOfTen: @ 81097B0 -@ replacing .incbin "baserom.gba", 0x001097b0, 0x14 -.byte 0xa0, 0x86, 0x01, 0x00, 0x10, 0x27, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00 - -.global gHighDigits -gHighDigits: @ 81097C4 -.byte 0x83 - -.global gUnknown_81097C5 -gUnknown_81097C5: @ 81097C5 -.byte 0x9f, 0x83, 0xa0, 0x83, 0xa1, 0x83, 0xa2, 0x83, 0xa3, 0x83, 0xa4, 0x83, 0xa5, 0x83, 0xa6, 0x83, 0xa7, 0x83, 0xa8, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x97, 0x10, 0x08 - -.global gGummiStatBoostLUT -gGummiStatBoostLUT: @ 81097E0 -.2byte 1 -.2byte 2 -.2byte 4 -.2byte 8 - -.global gUnknown_81097E8 -gUnknown_81097E8: @ 81097E8 -.byte 0x10, 0x00, 0x00, 0x00 -.byte 0x12, 0x00, 0x00, 0x00 -.byte 0x14, 0x00, 0x00, 0x00 -.byte 0x16, 0x00, 0x00, 0x00 - -.global gUnknown_81097F8 -gUnknown_81097F8: @ 81097F8 -.byte 0x11, 0x00, 0x00, 0x00 -.byte 0x13, 0x00, 0x00, 0x00 -.byte 0x15, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x00, 0x00 -@ START rescue_team_info.c -.string "pksdir0\0" - -.global gRescueRankMaxPoints -gRescueRankMaxPoints: @ 8109810 -.4byte 50 -.4byte 500 -.4byte 1500 -.4byte 3000 -.4byte 7500 -.4byte 15000 -.4byte 100000000 - -.global gTeamNamePlaceholder -gTeamNamePlaceholder: @ 810982C -.string "Pokémon\0" -@ END rescue_team_info.c -@ text_util -.string "pksdir0\0" - -.global gUnknown_810983C -gUnknown_810983C: @ 810983C -.4byte gUnknown_8109888 -.4byte gUnknown_8109884 -.4byte gUnknown_8109880 -.4byte gUnknown_810987C -.4byte gUnknown_8109878 -.4byte gUnknown_8109874 -.4byte gUnknown_8109870 -.4byte gUnknown_810986C -.4byte gUnknown_8109868 -.4byte gUnknown_8109864 - -.global gUnknown_8109864 -gUnknown_8109864: @ 8109864 -.byte 0x82, 0x58, 0x00, 0x00 - -.global gUnknown_8109868 -gUnknown_8109868: @ 8109868 -.byte 0x82, 0x57, 0x00, 0x00 - -.global gUnknown_810986C -gUnknown_810986C: @ 810986C -.byte 0x82, 0x56, 0x00, 0x00 - -.global gUnknown_8109870 -gUnknown_8109870: @ 8109870 -.byte 0x82, 0x55, 0x00, 0x00 - -.global gUnknown_8109874 -gUnknown_8109874: @ 8109874 -.byte 0x82, 0x54, 0x00, 0x00 - -.global gUnknown_8109878 -gUnknown_8109878: @ 8109878 -.byte 0x82, 0x53, 0x00, 0x00 - -.global gUnknown_810987C -gUnknown_810987C: @ 810987C -.byte 0x82, 0x52, 0x00, 0x00 - -.global gUnknown_8109880 -gUnknown_8109880: @ 8109880 -.byte 0x82, 0x51, 0x00, 0x00 - -.global gUnknown_8109884 -gUnknown_8109884: @ 8109884 -.byte 0x82, 0x50, 0x00, 0x00 - -.global gUnknown_8109888 -gUnknown_8109888: @ 8109888 -.byte 0x82, 0x4f, 0x00, 0x00 -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ START friend_area.c -.string "pksdir0\0" - -.global sUnknown_81098A4 -sUnknown_81098A4: @ 81098A4 -.string "{color GREEN_RAW}%s{reset}\0" -.align 2,0 - -.global sUnknown_81098AC -sUnknown_81098AC: @ 81098AC -.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" -.align 2,0 -@ END friend_area.c -@ moves.c -.string "pksdir0" -.align 2,0 - -.global gUnknown_81098C4 -gUnknown_81098C4: @ 81098C4 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_81098D0 -gUnknown_81098D0: @ 81098D0 -.string "wazapara\0" -.align 2,0 - -.global gUnknown_81098DC -gUnknown_81098DC: @ 81098DC -.string "%+d\0" - -.global gUnknown_81098E0 -gUnknown_81098E0: @ 81098E0 -.string "{color}%c%s%s{reset}\0" -.align 2,0 - -.global gUnknown_81098EC -gUnknown_81098EC: @ 81098EC -.string "{color}%c#:%s%s%s#;%c%2d/%2d{reset}\0" -.align 2,0 - -.global gUnknown_8109908 -gUnknown_8109908: @ 8109908 -.byte 0x87, 0x41, 0x00, 0x00 @ apparently shows A in memory viewer - -.global gUnknown_810990C -gUnknown_810990C: @ 810990C -.byte 0x87, 0x40, 0x00, 0x00 @ apparently shows @ in memory viewer - -.global gUnknown_8109910 -gUnknown_8109910: @ 8109910 -.string "{color}%c%s%s%s{UNK_MACRO_3D}%c%2d/%2d{reset}\0" -.align 2,0 - -.global gUnknown_8109928 -gUnknown_8109928: @ 8109928 -.byte 0x87, 0x42, 0x00 @ apparently shows B in memory viewer - -.global gUnknown_810992B -gUnknown_810992B: @ 810992B -.byte 0x00 - -.global gUnknown_810992C -gUnknown_810992C: @ 810992C -.string "%s\0" -.align 2,0 - -.global gUnknown_8109930 -gUnknown_8109930: @ 8109930 -.string "{POKEMON_0}\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 -@ ??? -.string "pksdir0\0" .align 2,0 diff --git a/data/data_81076E4.s b/data/data_81076E4.s new file mode 100644 index 000000000..9adb67e84 --- /dev/null +++ b/data/data_81076E4.s @@ -0,0 +1,1345 @@ +.section .rodata + +.global gUnknown_810763C +gUnknown_810763C: @ 810763C +.string "{color}%c%s{reset}\0" + +.global gUnknown_8107645 +gUnknown_8107645: @ 8107645 +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107654 +gUnknown_8107654: @ 8107654 +.byte 0x9d, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00 +.byte 0x33, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107684 +gUnknown_8107684: @ 8107684 +.string "kao%03d\0" +.align 2,0 + +.global gUnknown_810768C +gUnknown_810768C: @ 810768C +.string "lvmp%03d\0" +.align 2,0 + +.global gShadowSpriteSizeFlags_8107698 +gShadowSpriteSizeFlags_8107698: @ 8107698 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x03, 0x00, 0x00, 0x00 + +.global gUnknown_81076BC +gUnknown_81076BC: @ 81076BC +.string "etcfont\0" +.align 2,0 + +.global gUnknown_81076C4 +gUnknown_81076C4: @ 81076C4 +.4byte -4 +.4byte -8 +.4byte -16 +.4byte -4 +.4byte -8 +.4byte -16 +.align 2,0 + +@ pokemon_3 #1 +.string "pksdir0\0" + +.global gIQSkillGroups +gIQSkillGroups: @ 81076E4 +.4byte 9999 +.4byte 4 +.4byte 1 +.4byte 2 +.4byte 4 +.4byte 4 +.4byte 6 +.4byte 7 +.4byte 8 +.4byte 9 +.4byte 9 +.4byte 9 +.4byte 10 +.4byte 10 +.4byte 11 +.4byte 11 +.4byte 14 +.4byte 14 +.4byte 14 +.4byte 16 +.4byte 16 +.4byte 9 +.4byte 17 +.4byte 6 +@ pokemon_3 #2 +.string "pksdir0\0" +@ pokemon_3 #3 +.string "pksdir0\0" + +.global gUnknown_8107754 +gUnknown_8107754: @ 8107754 +.string "Stats\0" +.align 2,0 + +.global gUnknown_810775C +gUnknown_810775C: @ 810775C +.string "Features\0" +.align 2,0 + +.global gUnknown_8107768 +gUnknown_8107768: @ 8107768 +.string "Type:\0" +.align 2,0 + +.global gUnknown_8107770 +gUnknown_8107770: @ 8107770 +.string "Special Abilities:\0" +.align 2,0 + +.global gUnknown_8107784 +gUnknown_8107784: @ 8107784 +.string "{MOVE_ITEM_1}\0" +.align 2,0 + +.global gUnknown_8107788 +gUnknown_8107788: @ 8107788 +.byte 0x87, 0x42, 0x00, 0x00 + +.global gUnknown_810778C +gUnknown_810778C: @ 810778C +.byte 0x87, 0x40, 0x00, 0x00 + +.global gUnknown_8107790 +gUnknown_8107790: @ 8107790 +.string "{MOVE_ITEM_0}{MOVE_ITEM_1}\0" +.align 2,0 + +.global gUnknown_8107798 +gUnknown_8107798: @ 8107798 +.string "Info\0" +.align 2,0 +@ dungeon +.string "pksdir0\0" +.align 2,0 + +.global gDungeonFloorCount +gDungeonFloorCount: @ 81077A8 +@ replacing .incbin "baserom.gba", 0x1077A8, 0x40 +.byte 0x04, 0x06, 0x0a, 0x0e, 0x0a, 0x0b, 0x04, 0x0d, 0x0f, 0x0d, 0x04, 0x0a, 0x06, 0x10, 0x06, 0x18 +.byte 0x04, 0x1a, 0x0a, 0x29, 0x64, 0x15, 0x05, 0x64, 0x15, 0x0c, 0x64, 0x64, 0x1a, 0x1a, 0x0d, 0x15 +.byte 0x33, 0x1f, 0x1f, 0x1f, 0x15, 0x1f, 0x10, 0x0d, 0x14, 0x1f, 0x0b, 0x10, 0x15, 0x15, 0x1f, 0x05 +.byte 0x05, 0x0b, 0x03, 0x33, 0x46, 0x10, 0x1f, 0x14, 0x14, 0x0c, 0x64, 0x4c, 0x29, 0x64, 0x64, 0x02 + +.global gUnknown_81077E8 +gUnknown_81077E8: @ 81077E8 +@ replacing .incbin "baserom.gba", 0x1077E8, 0x40 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107828 +gUnknown_8107828: @ 8107828 +@ replacing .incbin "baserom.gba", 0x107828, 0x85C +.byte 0x02, 0x09, 0x00, 0x00, 0x03, 0x0d, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00 +.byte 0x0c, 0x05, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00 +.byte 0x12, 0x09, 0x00, 0x00, 0x13, 0x28, 0x00, 0x00, 0x14, 0x63, 0x00, 0x00, 0x15, 0x14, 0x00, 0x00 +.byte 0x17, 0x3b, 0x00, 0x00, 0x17, 0x63, 0x00, 0x00, 0x1a, 0x14, 0x00, 0x00, 0x1a, 0x32, 0x00, 0x00 +.byte 0x1a, 0x63, 0x00, 0x00, 0x1b, 0x0f, 0x00, 0x00, 0x1b, 0x19, 0x00, 0x00, 0x1b, 0x23, 0x00, 0x00 +.byte 0x1b, 0x2d, 0x00, 0x00, 0x1b, 0x3c, 0x00, 0x00, 0x1b, 0x46, 0x00, 0x00, 0x1b, 0x50, 0x00, 0x00 +.byte 0x1d, 0x19, 0x00, 0x00, 0x21, 0x14, 0x00, 0x00, 0x21, 0x1e, 0x00, 0x00, 0x22, 0x1e, 0x00, 0x00 +.byte 0x23, 0x14, 0x00, 0x00, 0x23, 0x1e, 0x00, 0x00, 0x24, 0x0a, 0x00, 0x00, 0x24, 0x0f, 0x00, 0x00 +.byte 0x24, 0x14, 0x00, 0x00, 0x25, 0x1e, 0x00, 0x00, 0x29, 0x0f, 0x00, 0x00, 0x29, 0x19, 0x00, 0x00 +.byte 0x2a, 0x0a, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x31, 0x03, 0x00, 0x00 +.byte 0x31, 0x04, 0x00, 0x00, 0x31, 0x05, 0x00, 0x00, 0x31, 0x06, 0x00, 0x00, 0x31, 0x07, 0x00, 0x00 +.byte 0x31, 0x08, 0x00, 0x00, 0x31, 0x09, 0x00, 0x00, 0x31, 0x0a, 0x00, 0x00, 0x34, 0x03, 0x00, 0x00 +.byte 0x34, 0x06, 0x00, 0x00, 0x34, 0x09, 0x00, 0x00, 0x34, 0x0c, 0x00, 0x00, 0x34, 0x0f, 0x00, 0x00 +.byte 0x34, 0x12, 0x00, 0x00, 0x34, 0x15, 0x00, 0x00, 0x34, 0x18, 0x00, 0x00, 0x34, 0x1b, 0x00, 0x00 +.byte 0x34, 0x1e, 0x00, 0x00, 0x34, 0x21, 0x00, 0x00, 0x34, 0x24, 0x00, 0x00, 0x34, 0x27, 0x00, 0x00 +.byte 0x34, 0x2a, 0x00, 0x00, 0x34, 0x2d, 0x00, 0x00, 0x34, 0x30, 0x00, 0x00, 0x34, 0x33, 0x00, 0x00 +.byte 0x34, 0x36, 0x00, 0x00, 0x34, 0x39, 0x00, 0x00, 0x34, 0x3c, 0x00, 0x00, 0x34, 0x3f, 0x00, 0x00 +.byte 0x34, 0x42, 0x00, 0x00, 0x34, 0x45, 0x00, 0x00, 0x35, 0x0f, 0x00, 0x00, 0x3b, 0x32, 0x00, 0x00 +.byte 0x3b, 0x48, 0x00, 0x00, 0x3c, 0x1e, 0x00, 0x00, 0x3c, 0x28, 0x00, 0x00, 0x3e, 0x63, 0x00, 0x00 +.byte 0x3f, 0xff, 0x00, 0x00 + +.global gUnknown_810795C +gUnknown_810795C: @ 810795C +.byte 0x00, 0x01, 0x01, 0x01 + +.global gUnknown_8107960 +gUnknown_8107960: @ 8107960 +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107966 +gUnknown_8107966: @ 8107966 +.byte 0x00, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107970 +gUnknown_8107970: @ 8107970 +.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 +.byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 + +.global gUnknown_810797E +gUnknown_810797E: @ 810797E +.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03 + +.global gUnknown_8107988 +gUnknown_8107988: @ 8107988 +.byte 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 + +.global gUnknown_8107993 +gUnknown_8107993: @ 8107993 +.byte 0x00, 0x03, 0x03, 0x03 + +.global gUnknown_8107997 +gUnknown_8107997: @ 8107997 +.byte 0x00 +.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 + +.global gUnknown_81079A4 +gUnknown_81079A4: @ 81079A4 +.byte 0x00, 0x04, 0x04, 0x04 +.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 + +.global gUnknown_81079B3 +gUnknown_81079B3: @ 81079B3 +.byte 0x00, 0x04, 0x04, 0x04, 0x04 +.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 + +.global gUnknown_81079C0 +gUnknown_81079C0: @ 81079C0 +.byte 0x00, 0x04, 0x04, 0x04 + +.global gUnknown_81079C4 +gUnknown_81079C4: @ 81079C4 +.byte 0x00, 0x04, 0x04, 0x04 +.byte 0x04, 0x04, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_81079CE +gUnknown_81079CE: @ 81079CE +.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_81079D4 +gUnknown_81079D4: @ 81079D4 +.byte 0x00, 0x05, 0x05, 0x05 +.byte 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_81079E4 +gUnknown_81079E4: @ 81079E4 +.byte 0x00, 0x05, 0x05, 0x05 +.byte 0x05, 0x05 + +.global gUnknown_81079EA +gUnknown_81079EA: @ 81079EA +.byte 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 +.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 + +.global gUnknown_8107A02 +gUnknown_8107A02: @ 8107A02 +.byte 0x00, 0x06, 0x06, 0x06 + +.global gUnknown_8107A06 +gUnknown_8107A06: @ 8107A06 +.byte 0x00, 0x06 +.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 +.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 + +.global gUnknown_8107A20 +gUnknown_8107A20: @ 8107A20 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07 + +.global gUnknown_8107A2A +gUnknown_8107A2A: @ 8107A2A +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107A53 +gUnknown_8107A53: @ 8107A53 +.byte 0x00, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b + +.global gUnknown_8107AB7 +gUnknown_8107AB7: @ 8107AB7 +.byte 0x00 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107ACC +gUnknown_8107ACC: @ 8107ACC +.byte 0x00, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_8107AD1 +gUnknown_8107AD1: @ 8107AD1 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_8107B35 +gUnknown_8107B35: @ 8107B35 +.byte 0x00, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08 + +.global gUnknown_8107B4A +gUnknown_8107B4A: @ 8107B4A +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107B56 +gUnknown_8107B56: @ 8107B56 +.byte 0x00, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09 +.byte 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c + +.global gUnknown_8107BBA +gUnknown_8107BBA: @ 8107BBA +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_8107C1E +gUnknown_8107C1E: @ 8107C1E +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107C38 +gUnknown_8107C38: @ 8107C38 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107C52 +gUnknown_8107C52: @ 8107C52 +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107C5F +gUnknown_8107C5F: @ 8107C5F +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107C74 +gUnknown_8107C74: @ 8107C74 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107CA7 +gUnknown_8107CA7: @ 8107CA7 +.byte 0x00 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107CC6 +gUnknown_8107CC6: @ 8107CC6 +.byte 0x00, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107CE5 +gUnknown_8107CE5: @ 8107CE5 +.byte 0x00, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107D04 +gUnknown_8107D04: @ 8107D04 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08 + +.global gUnknown_8107D19 +gUnknown_8107D19: @ 8107D19 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107D38 +gUnknown_8107D38: @ 8107D38 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107D48 +gUnknown_8107D48: @ 8107D48 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 + +.global gUnknown_8107D55 +gUnknown_8107D55: @ 8107D55 +.byte 0x00, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08 + +.global gUnknown_8107D69 +gUnknown_8107D69: @ 8107D69 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107D88 +gUnknown_8107D88: @ 8107D88 +.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_8107D93 +gUnknown_8107D93: @ 8107D93 +.byte 0x00, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107DA3 +gUnknown_8107DA3: @ 8107DA3 +.byte 0x00, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107DB8 +gUnknown_8107DB8: @ 8107DB8 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x08 + +.global gUnknown_8107DCD +gUnknown_8107DCD: @ 8107DCD +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107DEC +gUnknown_8107DEC: @ 8107DEC +.byte 0x00, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107DF1 +gUnknown_8107DF1: @ 8107DF1 +.byte 0x00, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107DF6 +gUnknown_8107DF6: @ 8107DF6 +.byte 0x00, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107E01 +gUnknown_8107E01: @ 8107E01 +.byte 0x00, 0x01, 0x01 + +.global gUnknown_8107E04 +gUnknown_8107E04: @ 8107E04 +.byte 0x00, 0x0f, 0x0f, 0x0f +.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f +.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f +.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f + +.global gUnknown_8107E37 +gUnknown_8107E37: @ 8107E37 +.byte 0x00 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107E7D +gUnknown_8107E7D: @ 8107E7D +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107E8D +gUnknown_8107E8D: @ 8107E8D +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107EAC +gUnknown_8107EAC: @ 8107EAC +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107EC0 +gUnknown_8107EC0: @ 8107EC0 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107ED4 +gUnknown_8107ED4: @ 8107ED4 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107EE0 +gUnknown_8107EE0: @ 8107EE0 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_8107F44 +gUnknown_8107F44: @ 8107F44 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c + +.global gUnknown_8107F90 +gUnknown_8107F90: @ 8107F90 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a + +.global gUnknown_8107FB9 +gUnknown_8107FB9: @ 8107FB9 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_810801D +gUnknown_810801D: @ 810801D +.byte 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e +.byte 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e + +.global gUnknown_8108081 +gUnknown_8108081: @ 8108081 +.byte 0x00, 0x07, 0x00 + +.global gUnknown_8108084 +gUnknown_8108084: @ 8108084 +@ replacing .incbin "baserom.gba", 0x108084, 0xDD4 +.4byte gUnknown_810795C +.4byte gUnknown_8107960 +.4byte gUnknown_8107966 +.4byte gUnknown_8107970 +.4byte gUnknown_810797E +.4byte gUnknown_8107988 +.4byte gUnknown_8107993 +.4byte gUnknown_8107997 +.4byte gUnknown_81079A4 +.4byte gUnknown_81079B3 +.4byte gUnknown_81079C0 +.4byte gUnknown_81079C4 +.4byte gUnknown_81079CE +.4byte gUnknown_81079D4 +.4byte gUnknown_81079E4 +.4byte gUnknown_81079EA +.4byte gUnknown_8107A02 +.4byte gUnknown_8107A06 +.4byte gUnknown_8107A20 +.4byte gUnknown_8107A2A +.4byte gUnknown_8107A53 +.4byte gUnknown_8107AB7 +.4byte gUnknown_8107ACC +.4byte gUnknown_8107AD1 +.4byte gUnknown_8107B35 +.4byte gUnknown_8107B4A +.4byte gUnknown_8107B56 +.4byte gUnknown_8107BBA +.4byte gUnknown_8107C1E +.4byte gUnknown_8107C38 +.4byte gUnknown_8107C52 +.4byte gUnknown_8107C5F +.4byte gUnknown_8107C74 +.4byte gUnknown_8107CA7 +.4byte gUnknown_8107CC6 +.4byte gUnknown_8107CE5 +.4byte gUnknown_8107D04 +.4byte gUnknown_8107D19 +.4byte gUnknown_8107D38 +.4byte gUnknown_8107D48 +.4byte gUnknown_8107D55 +.4byte gUnknown_8107D69 +.4byte gUnknown_8107D88 +.4byte gUnknown_8107D93 +.4byte gUnknown_8107DA3 +.4byte gUnknown_8107DB8 +.4byte gUnknown_8107DCD +.4byte gUnknown_8107DEC +.4byte gUnknown_8107DF1 +.4byte gUnknown_8107DF6 +.4byte gUnknown_8107E01 +.4byte gUnknown_8107E04 +.4byte gUnknown_8107E37 +.4byte gUnknown_8107E7D +.4byte gUnknown_8107E8D +.4byte gUnknown_8107EAC +.4byte gUnknown_8107EC0 +.4byte gUnknown_8107ED4 +.4byte gUnknown_8107EE0 +.4byte gUnknown_8107F44 +.4byte gUnknown_8107F90 +.4byte gUnknown_8107FB9 +.4byte gUnknown_810801D +.4byte gUnknown_8108081 + +.global gUnknown_8108184 +gUnknown_8108184: @ 8108184 +.byte 0x31, 0x75, 0xa0, 0x0f, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x62, 0x75, 0xa0, 0x0f, 0x38, 0x75 +.byte 0x70, 0x17, 0x39, 0x75, 0x10, 0x27, 0xd2, 0x75 + +.global gUnknown_810819C +gUnknown_810819C: @ 810819C +.byte 0x31, 0x75, 0x98, 0x04, 0x62, 0x12, 0x2b, 0x20 +.byte 0x10, 0x27, 0x3e, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x3c, 0x75, 0x10, 0x27 +.byte 0x43, 0x75, 0xd0, 0x07, 0x34, 0x75, 0xa0, 0x0f, 0x38, 0x75, 0x70, 0x17, 0x39, 0x75, 0x10, 0x27 +.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 +.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 +.byte 0xc4, 0x24, 0x10, 0x27, 0xb9, 0x75 + +.global gUnknown_81081EA +gUnknown_81081EA: @ 81081EA +.byte 0x31, 0x75, 0x20, 0x03, 0x80, 0x0c, 0x40, 0x1f, 0xf0, 0x23 +.byte 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27, 0x3a, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x3c, 0x75 +.byte 0x10, 0x27, 0x43, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 +.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 +.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 +.byte 0x10, 0x27, 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75 +.byte 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10 +.byte 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17 +.byte 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_8108274 +gUnknown_8108274: @ 8108274 +.byte 0x31, 0x75, 0x01, 0x03, 0x05, 0x0c, 0x0c, 0x1e, 0x8e, 0x22, 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27 +.byte 0x3a, 0x75, 0xd0, 0x07, 0xa0, 0x0f, 0x70, 0x17, 0x3c, 0x75, 0x40, 0x1f, 0x3b, 0x75, 0x10, 0x27 +.byte 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02 +.byte 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14 +.byte 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27 +.byte 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b +.byte 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75 +.byte 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75 +.byte 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_8108302 +gUnknown_8108302: @ 8108302 +.byte 0x32, 0x75 +.byte 0xd0, 0x07, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d +.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d +.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 +.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 +.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x49, 0x75, 0x65, 0x01 +.byte 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75 +.byte 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13 +.byte 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d +.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_810838E +gUnknown_810838E: @ 810838E +.byte 0x32, 0x75, 0x04, 0x09, 0x09, 0x15 +.byte 0x0c, 0x1e, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d, 0x88, 0x13, 0x0b, 0x1a +.byte 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a +.byte 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b +.byte 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d +.byte 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 +.byte 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b +.byte 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75 +.byte 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15 +.byte 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19 +.byte 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_8108432 +gUnknown_8108432: @ 8108432 +.byte 0x32, 0x75 +.byte 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d +.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d +.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 +.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 +.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00 +.byte 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75 +.byte 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e +.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 +.byte 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19 +.byte 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27 +.byte 0x75, 0x75 + +.global gUnknown_81084D6 +gUnknown_81084D6: @ 81084D6 +.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x95, 0x05 +.byte 0x37, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0x3c, 0x75, 0xe7, 0x1b, 0x33, 0x75, 0x7b, 0x21 +.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27 +.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 +.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 +.byte 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 +.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d +.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 +.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 +.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e +.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_810857E +gUnknown_810857E: @ 810857E +.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13 +.byte 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11 +.byte 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22, 0x37, 0x75 +.byte 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 +.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 +.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 +.byte 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 +.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 +.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 +.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 +.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 +.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_810862C +gUnknown_810862C: @ 810862C +.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18 +.byte 0x02, 0x25, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d +.byte 0x5c, 0x11, 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22 +.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d +.byte 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 +.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d +.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 +.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 +.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e +.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e +.byte 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_81086C8 +gUnknown_81086C8: @ 81086C8 +.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18, 0x02, 0x25, 0x34, 0x75 +.byte 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13 +.byte 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75 +.byte 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75 +.byte 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 +.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 +.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 +.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 +.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 +.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27 +.byte 0x34, 0x75 + +.global gUnknown_8108766 +gUnknown_8108766: @ 8108766 +.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27 +.byte 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75 +.byte 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27 +.byte 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27 +.byte 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05 +.byte 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d +.byte 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11 +.byte 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18 +.byte 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22 +.byte 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_8108804 +gUnknown_8108804: @ 8108804 +.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75 +.byte 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17 +.byte 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x37, 0x75 +.byte 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75 +.byte 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08 +.byte 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d +.byte 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13 +.byte 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75 +.byte 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 +.byte 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_81088A2 +gUnknown_81088A2: @ 81088A2 +.byte 0x32, 0x75 +.byte 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03 +.byte 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75 +.byte 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07 +.byte 0x33, 0x75, 0xa0, 0x0f, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75 +.byte 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a +.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f +.byte 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13 +.byte 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75 +.byte 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75 +.byte 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_810893E +gUnknown_810893E: @ 810893E +.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75 +.byte 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07 +.byte 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f +.byte 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07, 0x33, 0x75, 0xa0, 0x0f +.byte 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04 +.byte 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75 +.byte 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10 +.byte 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75 +.byte 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b +.byte 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75 +.byte 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_81089DA +gUnknown_81089DA: @ 81089DA +.byte 0x31, 0x75, 0xe2, 0x04, 0x6a, 0x18, 0x10, 0x27, 0x3f, 0x75 +.byte 0x10, 0x27, 0x5f, 0x75, 0x83, 0x06, 0x32, 0x75, 0xa6, 0x0e, 0x34, 0x75, 0xe7, 0x11, 0x32, 0x75 +.byte 0x29, 0x15, 0x6a, 0x18, 0x31, 0x75, 0xab, 0x1b, 0x31, 0x75, 0x4c, 0x1d, 0x8d, 0x20, 0x33, 0x75 +.byte 0xcf, 0x23, 0x10, 0x27, 0x34, 0x75, 0x88, 0x13, 0x10, 0x27, 0xcc, 0x75 + +.global gUnknown_8108A10 +gUnknown_8108A10: @ 8108A10 +.byte 0x35, 0x75, 0xc4, 0x09 +.byte 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08 +.byte 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75 +.byte 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16 +.byte 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27 +.byte 0x3b, 0x75, 0xca, 0x02, 0x5f, 0x08, 0x29, 0x0b, 0x34, 0x75, 0xf3, 0x0d, 0x3a, 0x75, 0xe7, 0x1b +.byte 0xb1, 0x1e, 0x7b, 0x21, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108A6E +gUnknown_8108A6E: @ 8108A6E +.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17 +.byte 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75 +.byte 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75 +.byte 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75, 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75 +.byte 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 + +.global gUnknown_8108AB4 +gUnknown_8108AB4: @ 8108AB4 +.byte 0x35, 0x75, 0xc4, 0x09, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75 +.byte 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75 +.byte 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14 +.byte 0x71, 0x02, 0x52, 0x16, 0xb7, 0x17, 0x34, 0x75, 0xe2, 0x04, 0x31, 0x75, 0x82, 0x1a, 0x4c, 0x1d +.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e +.byte 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75, 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27 +.byte 0x45, 0x75 + +.global gUnknown_8108B16 +gUnknown_8108B16: @ 8108B16 +.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20 +.byte 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75, 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10 +.byte 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75, 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75 +.byte 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75, 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75 +.byte 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 + +.global gUnknown_8108B5C +gUnknown_8108B5C: @ 8108B5C +.byte 0x35, 0x75, 0x6a, 0x18, 0x33, 0x75, 0x10, 0x27 +.byte 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x33, 0x75, 0x63, 0x05, 0x15, 0x08, 0x31, 0x75, 0xc7, 0x0a +.byte 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d, 0x34, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75 +.byte 0x83, 0x11, 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x71, 0x02, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18 +.byte 0x33, 0x75, 0xe2, 0x04, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21, 0x5e, 0x24 +.byte 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e, 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75 +.byte 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108BC0 +gUnknown_8108BC0: @ 8108BC0 +.byte 0xe8, 0x03, 0xd0, 0x07 +.byte 0x58, 0x1b, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27 +.byte 0x32, 0x75, 0x57, 0x04, 0x36, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11, 0xb4, 0x15, 0x0b, 0x1a +.byte 0x62, 0x1e, 0x3a, 0x75, 0xb9, 0x22, 0x3a, 0x75, 0xe4, 0x24, 0x10, 0x27, 0x37, 0x75, 0xe5, 0x02 +.byte 0x34, 0x75, 0xae, 0x08, 0x34, 0x75, 0x78, 0x0e, 0x41, 0x14, 0x32, 0x75, 0x0b, 0x1a, 0x36, 0x75 +.byte 0x7d, 0x1b, 0x31, 0x75, 0x47, 0x21, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 + +.global gUnknown_8108C12 +gUnknown_8108C12: @ 8108C12 +.byte 0x35, 0x75 +.byte 0x88, 0x13, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x31, 0x75, 0xa1, 0x01 +.byte 0x31, 0x75, 0x63, 0x05, 0x15, 0x08, 0x41, 0x03, 0xc7, 0x0a, 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d +.byte 0x31, 0x75, 0xe2, 0x04, 0x32, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75, 0x83, 0x11 +.byte 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x83, 0x06, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18, 0x31, 0x75 +.byte 0x23, 0x08, 0x31, 0x75, 0xc4, 0x09, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21 +.byte 0x5e, 0x24, 0x10, 0x27, 0x38, 0x75, 0x65, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x47, 0x10, 0xe7, 0x11 +.byte 0x88, 0x13, 0x33, 0x75, 0x29, 0x15, 0x35, 0x75, 0x6a, 0x18, 0xab, 0x1b, 0x34, 0x75, 0x4c, 0x1d +.byte 0xed, 0x1e, 0x8d, 0x20, 0x2e, 0x22, 0xcf, 0x23, 0x3c, 0x75, 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108C92 +gUnknown_8108C92: @ 8108C92 +.byte 0x01, 0x03 +.byte 0x02, 0x06, 0x0a, 0x18, 0x0b, 0x1b, 0x0c, 0x1e, 0x34, 0x75, 0x10, 0x27, 0x33, 0x75, 0xb6, 0x16 +.byte 0x56, 0x24, 0x10, 0x27, 0x33, 0x75, 0x58, 0x1b, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x50, 0x75 +.byte 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09 +.byte 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b +.byte 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x7c, 0x75, 0x81, 0x01, 0x32, 0x75 +.byte 0x01, 0x03, 0x02, 0x06, 0x83, 0x07, 0x04, 0x09, 0x84, 0x0a, 0x31, 0x75, 0x86, 0x0d, 0x06, 0x0f +.byte 0x87, 0x10, 0x88, 0x13, 0x33, 0x75, 0x89, 0x16, 0x8a, 0x19, 0x8c, 0x1c, 0x31, 0x75, 0x0c, 0x1e +.byte 0x31, 0x75, 0x8d, 0x1f, 0x0e, 0x21, 0x34, 0x75, 0x8e, 0x22, 0x33, 0x75, 0x0f, 0x24, 0x36, 0x75 +.byte 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108D18 +gUnknown_8108D18: @ 8108D18 +.byte 0x56, 0x0c, 0x31, 0x75, 0x81, 0x12, 0x9d, 0x16, 0xba, 0x1a, 0xd7, 0x1e +.byte 0x33, 0x75, 0xf3, 0x22, 0x10, 0x27, 0x35, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x10, 0x27, 0x33, 0x75 +.byte 0xb3, 0x01, 0x66, 0x03, 0x31, 0x75, 0x18, 0x05, 0xcb, 0x06, 0x32, 0x75, 0x7e, 0x08, 0x31, 0x0a +.byte 0xe3, 0x0b, 0x96, 0x0d, 0x49, 0x0f, 0xfc, 0x10, 0x36, 0x75, 0xaf, 0x12, 0x61, 0x14, 0x14, 0x16 +.byte 0xc7, 0x17, 0x7a, 0x19, 0x2d, 0x1b, 0x33, 0x75, 0xdf, 0x1c, 0x92, 0x1e, 0x45, 0x20, 0xf8, 0x21 +.byte 0xaa, 0x23, 0x31, 0x75, 0x5d, 0x25, 0x10, 0x27, 0x3c, 0x75, 0x05, 0x0d, 0x3f, 0x75, 0x0b, 0x1a +.byte 0x32, 0x75, 0x10, 0x27, 0x49, 0x75, 0x10, 0x27, 0x45, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 +.byte 0x08, 0x04, 0x57, 0x04, 0xc4, 0x00, 0x31, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x88, 0x01, 0x8a, 0x0a +.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x31, 0x75, 0x4c, 0x02, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e +.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 +.byte 0xd7, 0x13, 0x15, 0x15, 0x10, 0x03, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x31, 0x75, 0xd4, 0x03 +.byte 0x1d, 0x19, 0x98, 0x04, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 +.byte 0x10, 0x27, 0x32, 0x75, 0x5d, 0x05, 0x35, 0x75, 0x21, 0x06, 0xe5, 0x06, 0xa9, 0x07, 0x6d, 0x08 +.byte 0xf5, 0x09, 0xb9, 0x0a, 0x7d, 0x0b, 0x41, 0x0c, 0x05, 0x0d, 0x8d, 0x0e, 0x52, 0x0f, 0x16, 0x10 +.byte 0x9e, 0x11, 0x62, 0x12, 0x26, 0x13, 0x31, 0x75, 0xae, 0x14, 0x36, 0x16, 0xbe, 0x17, 0x83, 0x18 +.byte 0x47, 0x19, 0x0b, 0x1a, 0xcf, 0x1a, 0x93, 0x1b, 0x57, 0x1c, 0x1b, 0x1d, 0xdf, 0x1d, 0x31, 0x75 +.byte 0xa3, 0x1e, 0x33, 0x75, 0x67, 0x1f, 0x2b, 0x20, 0xef, 0x20, 0xb3, 0x21, 0x78, 0x22, 0x32, 0x75 +.byte 0x00, 0x24, 0xc4, 0x24, 0x31, 0x75, 0x88, 0x25, 0x4c, 0x26, 0x10, 0x27, 0x38, 0x75, 0x10, 0x27 +.byte 0x37, 0x75 + +.global gUnknown_8108E36 +gUnknown_8108E36: @ 8108E36 +.byte 0x33, 0x75, 0x83, 0x06, 0x34, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x99, 0x75, 0x10, 0x27 +.byte 0x34, 0x75, 0xc4, 0x09, 0x32, 0x75, 0x88, 0x13, 0x4c, 0x1d, 0x3a, 0x75, 0x10, 0x27, 0x89, 0x75 +.byte 0x10, 0x27, 0x4a, 0x75 + +.global gUnknown_8108E58 +gUnknown_8108E58: @ 8108E58 +@ replacing .incbin "baserom.gba", 0x00108e58, 0x68 +@ u16*s +.4byte gUnknown_8108184 +.4byte gUnknown_810819C +.4byte gUnknown_81081EA +.4byte gUnknown_8108274 +.4byte gUnknown_8108302 +.4byte gUnknown_810838E +.4byte gUnknown_8108432 +.4byte gUnknown_81084D6 +.4byte gUnknown_810857E +.4byte gUnknown_810862C +.4byte gUnknown_81086C8 +.4byte gUnknown_8108766 +.4byte gUnknown_8108804 +.4byte gUnknown_81088A2 +.4byte gUnknown_810893E +.4byte gUnknown_81089DA +.4byte gUnknown_8108A10 +.4byte gUnknown_8108A6E +.4byte gUnknown_8108AB4 +.4byte gUnknown_8108B16 +.4byte gUnknown_8108B5C +.4byte gUnknown_8108BC0 +.4byte gUnknown_8108C12 +.4byte gUnknown_8108C92 +.4byte gUnknown_8108D18 +.4byte gUnknown_8108E36 + +.global gUnknown_8108EC0 +gUnknown_8108EC0: @ 8108EC0 +@ replacing .incbin "baserom.gba", 0x108EC0, 0x50 +.byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f +.byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x10, 0x17, 0x18, 0x19, 0x14, 0x17, 0x1c, 0x1d, 0x1e, 0x1f +.byte 0x20, 0x21, 0x1c, 0x23, 0x24, 0x25, 0x1e, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f +.byte 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x2d, 0x2d, 0x3b, 0x3c, 0x30, 0x3e, 0x3f +.byte 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f + +.global gUnknown_8108F10 +gUnknown_8108F10: @ 8108F10 +.string "{color YELLOW_D}%s{reset}\0" +.align 2,0 + +.global gUnknown_8108F18 +gUnknown_8108F18: @ 8108F18 +.string "{color YELLOW_D}%s{reset} {color CYAN}%d{reset}F\0" +.align 2,0 + +.global gUnknown_8108F2C +gUnknown_8108F2C: @ 8108F2C +.string "{color YELLOW_D}%s{reset} B{color CYAN}%d{reset}F\0" +.align 2,0 + +.global gUnknown_8108F40 +gUnknown_8108F40: @ 8108F40 +.byte 0x00, 0x00 + +.global gUnknown_8108F42 +gUnknown_8108F42: @ 8108F42 +.byte 0x99, 0x00, 0x9c, 0x00, 0x9e, 0x00, 0xdb, 0x00 + +.global gUnknown_8108F4A +gUnknown_8108F4A: @ 8108F4A +.byte 0xe1, 0xe7, 0xe6, 0xe2, 0x00, 0x00 + +.global gUnknown_8108F50 +gUnknown_8108F50: @ 8108F50 +.string "No problem.\0" +.align 2,0 +@ items.c +.string "pksdir0\0" +.align 2,0 + +.global gUnknown_8108F64 +gUnknown_8108F64: @ 8108F64 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x2c, 0x01, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x40, 0x10, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x21, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84, 0x0c, 0x21, 0x44, 0xff, 0x03, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x02, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x25, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x21, 0xc0, 0xfe, 0x44, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0xfc, 0x45, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x80, 0x00, 0x18, 0x82, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x45, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x64, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x18, 0x80, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x44, 0xfd, 0x61, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x00, 0x09, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x84, 0x04, 0x38, 0x80, 0x02, 0x00, 0x80, 0x04, 0x0c, 0x21, 0x44, 0xfd, 0x7d, 0x02, 0x00, 0x00 +.byte 0x66, 0x83, 0x93, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7e, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x64, 0x02, 0x00, 0x20 +.byte 0x66, 0x81, 0xd7, 0xcd, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x0c, 0x14, 0x7e, 0xa2, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xa8, 0x0c, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x14, 0x7f, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x20, 0xbe, 0x21, 0xc0, 0xff, 0x7f, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8c, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x80, 0xbc, 0x20, 0x10, 0x01, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x84, 0x3c, 0xe1, 0x03, 0x00, 0x00, 0x02, 0x00, 0x08 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xbe, 0x7e, 0xe9, 0x4e, 0x3c, 0xa0, 0xa7, 0xbf, 0x39, 0x20, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x79, 0xec, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xfe, 0x7e, 0xe9, 0x4e, 0x34, 0xa0, 0xa7, 0xbf, 0x39, 0x04, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x59, 0xec, 0x00, 0x01, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x04, 0x38, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x28 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x02, 0x08, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x10, 0xa0, 0xae, 0xbf, 0x39, 0x08, 0x00, 0x00, 0x02, 0x20, 0x60 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x02, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x04, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x82, 0x3c, 0x06, 0xc0, 0x0c, 0x30, 0xa0, 0x00, 0x0d, 0x21, 0x00, 0x00, 0x00, 0x82, 0x01, 0x28 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x12, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xfd, 0x7f, 0xe9, 0xcf, 0x37, 0xa0, 0x84, 0x3c, 0x21, 0x10, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x35, 0x7b, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0c, 0x01, 0x04, 0x02, 0x02, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0x34, 0xfb, 0xab, 0xc9, 0x01, 0xa0, 0xad, 0xbf, 0x39, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0x8c, 0x21, 0xc4, 0xff, 0x7f, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xac, 0x1c, 0x19, 0x04, 0x56, 0x02, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8c, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc5, 0x7f, 0x88, 0x8e, 0x1b, 0xa0, 0xad, 0xbf, 0xe5, 0x2b, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x07, 0xf4, 0xff, 0xb9, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 +.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x28 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x39, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xfd, 0xff, 0xeb, 0xef, 0x3f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x27, 0xfc, 0xff, 0xfb, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x7f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 + +.global gItemParaFileName +gItemParaFileName: @ 8109764 +.string "itempara\0" +.align 2,0 + +.global gUnknown_8109770 +gUnknown_8109770: @ 8109770 +.string "%s %d\0" +.align 2,0 + +.global gUnknown_8109778 +gUnknown_8109778: @ 8109778 +.string "%s\0" +.align 2,0 + +.global gUnknown_810977C +gUnknown_810977C: @ 810977C +@ replacing .incbin "baserom.gba", 0x0010977c, 0x8 +.string "%d {POKE}\0" + +.global gUnknown_8109784 +gUnknown_8109784: @ 8109784 +@ replacing .incbin "baserom.gba", 0x00109784, 0x8 +.byte 0x87, 0x44 +.asciz "%s\0" +.align 2,0 + +.global gUnknown_810978C +gUnknown_810978C: @ 810978C +@ replacing .incbin "baserom.gba", 0x0010978c, 0x8 +.byte 0x87, 0x41 +.asciz "%s\0" +.align 2,0 + +.global gUnknown_8109794 +gUnknown_8109794: @ 8109794 +@ replacing .incbin "baserom.gba", 0x00109794, 0x10 +.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" +.align 2, 0 + +.global gUnknown_81097A4 +gUnknown_81097A4: @ 81097A4 +@ replacing .incbin "baserom.gba", 0x001097a4, 0xc +.string "%s{COLOR GREEN_RAW}%s{RESET}\0" +.align 2, 0 + +.global gPowersOfTen +gPowersOfTen: @ 81097B0 +@ replacing .incbin "baserom.gba", 0x001097b0, 0x14 +.byte 0xa0, 0x86, 0x01, 0x00, 0x10, 0x27, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00 + +.global gHighDigits +gHighDigits: @ 81097C4 +.byte 0x83 + +.global gUnknown_81097C5 +gUnknown_81097C5: @ 81097C5 +.byte 0x9f, 0x83, 0xa0, 0x83, 0xa1, 0x83, 0xa2, 0x83, 0xa3, 0x83, 0xa4, 0x83, 0xa5, 0x83, 0xa6, 0x83, 0xa7, 0x83, 0xa8, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x97, 0x10, 0x08 + +.global gGummiStatBoostLUT +gGummiStatBoostLUT: @ 81097E0 +.2byte 1 +.2byte 2 +.2byte 4 +.2byte 8 + +.global gUnknown_81097E8 +gUnknown_81097E8: @ 81097E8 +.byte 0x10, 0x00, 0x00, 0x00 +.byte 0x12, 0x00, 0x00, 0x00 +.byte 0x14, 0x00, 0x00, 0x00 +.byte 0x16, 0x00, 0x00, 0x00 + +.global gUnknown_81097F8 +gUnknown_81097F8: @ 81097F8 +.byte 0x11, 0x00, 0x00, 0x00 +.byte 0x13, 0x00, 0x00, 0x00 +.byte 0x15, 0x00, 0x00, 0x00 +.byte 0x17, 0x00, 0x00, 0x00 +@ START rescue_team_info.c +.string "pksdir0\0" + +.global gRescueRankMaxPoints +gRescueRankMaxPoints: @ 8109810 +.4byte 50 +.4byte 500 +.4byte 1500 +.4byte 3000 +.4byte 7500 +.4byte 15000 +.4byte 100000000 + +.global gTeamNamePlaceholder +gTeamNamePlaceholder: @ 810982C +.string "Pokémon\0" +@ END rescue_team_info.c +@ text_util +.string "pksdir0\0" + +.global gUnknown_810983C +gUnknown_810983C: @ 810983C +.4byte gUnknown_8109888 +.4byte gUnknown_8109884 +.4byte gUnknown_8109880 +.4byte gUnknown_810987C +.4byte gUnknown_8109878 +.4byte gUnknown_8109874 +.4byte gUnknown_8109870 +.4byte gUnknown_810986C +.4byte gUnknown_8109868 +.4byte gUnknown_8109864 + +.global gUnknown_8109864 +gUnknown_8109864: @ 8109864 +.byte 0x82, 0x58, 0x00, 0x00 + +.global gUnknown_8109868 +gUnknown_8109868: @ 8109868 +.byte 0x82, 0x57, 0x00, 0x00 + +.global gUnknown_810986C +gUnknown_810986C: @ 810986C +.byte 0x82, 0x56, 0x00, 0x00 + +.global gUnknown_8109870 +gUnknown_8109870: @ 8109870 +.byte 0x82, 0x55, 0x00, 0x00 + +.global gUnknown_8109874 +gUnknown_8109874: @ 8109874 +.byte 0x82, 0x54, 0x00, 0x00 + +.global gUnknown_8109878 +gUnknown_8109878: @ 8109878 +.byte 0x82, 0x53, 0x00, 0x00 + +.global gUnknown_810987C +gUnknown_810987C: @ 810987C +.byte 0x82, 0x52, 0x00, 0x00 + +.global gUnknown_8109880 +gUnknown_8109880: @ 8109880 +.byte 0x82, 0x51, 0x00, 0x00 + +.global gUnknown_8109884 +gUnknown_8109884: @ 8109884 +.byte 0x82, 0x50, 0x00, 0x00 + +.global gUnknown_8109888 +gUnknown_8109888: @ 8109888 +.byte 0x82, 0x4f, 0x00, 0x00 +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ START friend_area.c +.string "pksdir0\0" + +.global sUnknown_81098A4 +sUnknown_81098A4: @ 81098A4 +.string "{color GREEN_RAW}%s{reset}\0" +.align 2,0 + +.global sUnknown_81098AC +sUnknown_81098AC: @ 81098AC +.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" +.align 2,0 +@ END friend_area.c +@ moves.c +.string "pksdir0" +.align 2,0 + +.global gUnknown_81098C4 +gUnknown_81098C4: @ 81098C4 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_81098D0 +gUnknown_81098D0: @ 81098D0 +.string "wazapara\0" +.align 2,0 + +.global gUnknown_81098DC +gUnknown_81098DC: @ 81098DC +.string "%+d\0" + +.global gUnknown_81098E0 +gUnknown_81098E0: @ 81098E0 +.string "{color}%c%s%s{reset}\0" +.align 2,0 + +.global gUnknown_81098EC +gUnknown_81098EC: @ 81098EC +.string "{color}%c#:%s%s%s#;%c%2d/%2d{reset}\0" +.align 2,0 + +.global gUnknown_8109908 +gUnknown_8109908: @ 8109908 +.byte 0x87, 0x41, 0x00, 0x00 @ apparently shows A in memory viewer + +.global gUnknown_810990C +gUnknown_810990C: @ 810990C +.byte 0x87, 0x40, 0x00, 0x00 @ apparently shows @ in memory viewer + +.global gUnknown_8109910 +gUnknown_8109910: @ 8109910 +.string "{color}%c%s%s%s{UNK_MACRO_3D}%c%2d/%2d{reset}\0" +.align 2,0 + +.global gUnknown_8109928 +gUnknown_8109928: @ 8109928 +.byte 0x87, 0x42, 0x00 @ apparently shows B in memory viewer + +.global gUnknown_810992B +gUnknown_810992B: @ 810992B +.byte 0x00 + +.global gUnknown_810992C +gUnknown_810992C: @ 810992C +.string "%s\0" +.align 2,0 + +.global gUnknown_8109930 +gUnknown_8109930: @ 8109930 +.string "{POKEMON_0}\0" +.align 2,0 +@ ??? +.string "pksdir0\0" +.align 2,0 +@ ??? +.string "pksdir0\0" +.align 2,0 +@ ??? +.string "pksdir0\0" +.align 2,0 + diff --git a/include/pokemon.h b/include/pokemon.h index 9a3275a48..a9013ba96 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -98,7 +98,7 @@ bool8 sub_808D4B0(void); bool8 sub_808D500(void); // pokemon.s -extern s32 GetUnitSum_808D544(u32); +extern s32 GetUnitSum_808D544(s32 *); extern s32 sub_808D580(s32 *); static inline bool8 PokemonFlag1(PokemonStruct1 *mon) diff --git a/ld_script.txt b/ld_script.txt index e576aa391..768e36b08 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -286,8 +286,6 @@ SECTIONS { src/code_80869E4.o(.text); src/dungeon_cutscenes.o(.text); src/pokemon.o(.text); - asm/pokemon.o(.text); - src/pokemon_mid.o(.text); asm/pokemon_2.o(.text); src/pokemon_3.o(.text); asm/pokemon_3.o(.text); @@ -549,6 +547,8 @@ SECTIONS { data/data_8107010.o(.rodata); src/dungeon_serializer.o(.rodata); data/data_8107224.o(.rodata); + src/pokemon.o(.rodata); + data/data_81076E4.o(.rodata); src/game_options.o(.rodata); data/data_8109964.o(.rodata); src/code_80972F4.o(.rodata); diff --git a/src/pokemon.c b/src/pokemon.c index 15af66608..0e7dea0a3 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1,5 +1,10 @@ #include "global.h" +#include "globaldata.h" #include "pokemon.h" +#include "code_800D090.h" +#include "code_8097DD0.h" +#include "constants/colors.h" +#include "decompress.h" #include "file_system.h" #include "pokemon_3.h" #include "text_util.h" @@ -8,20 +13,62 @@ #include "exclusive_pokemon.h" extern struct FileArchive gSystemFileArchive; -extern const char gUnknown_81075F4; +extern struct FileArchive gMonsterFileArchive; + EWRAM_DATA MonsterDataEntry *gMonsterParameters; EWRAM_DATA OpenedFile *gMonsterParametersFile; +EWRAM_DATA SpriteOAM gShadowSprites[3]; // Shadow sprites of some kind EWRAM_DATA unkStruct_203B45C gRecruitedPokemon; EWRAM_DATA u16 gLevelCurrentPokeId; +EWRAM_DATA LevelData gLevelCurrentData[0x64]; EWRAM_DATA_2 unkStruct_203B45C *gRecruitedPokemonRef = {0}; extern void sub_808E490(Move* a1, s32 species); +struct unkStruct_8107654 { + s16 unk0; + s16 fill2; + s32 unk4; +}; + +//const char gUnknown_810763C[] = "{color}%c%s{reset}" ; +//const u8 gUnknown_8107645[12] = {0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +//struct unkStruct_8107654 gUnknown_8107654[6]; +//ALIGNED(4) const char gUnknown_8107684[] = "kao%03d"; +//ALIGNED(4) const char gUnknown_810768C[] = "lvmp%03d"; // lvmp%03d\0 +//const u8 gShadowSpriteSizeFlags_8107698[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 }; +//ALIGNED(4) const char gUnknown_81076BC[] = "etcfont"; +//const s32 gUnknown_81076C4[6] = {-4, -8, -16, -4, -8, -16}; // x-coord positioning for shadow sprites + +ALIGNED(4) static const char sMonsterParameterFileName[] = "monspara"; +ALIGNED(4) static const char gUnknown_8107600[] = _("{color YELLOW_RAW}%s{reset}"); +ALIGNED(4) static const char gUnknown_8107608[] = _("{color CYAN_RAW}%s{reset}"); +ALIGNED(4) static const char gUnownLetters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?"; +ALIGNED(4) static const char gUnknown_8107630[] = "%s%c"; +ALIGNED(4) static const char gUnknown_8107638[] = "%s"; +extern const char gUnknown_810763C[]; +extern const u8 gUnknown_8107645[12]; +extern struct unkStruct_8107654 gUnknown_8107654[6]; +extern const char gUnknown_8107684[]; +extern const char gUnknown_810768C[]; // lvmp%03d +extern const u8 gShadowSpriteSizeFlags_8107698[]; +extern const char gUnknown_81076BC[]; +extern const s32 gUnknown_81076C4[6]; + +extern s16 gFrenzyPlantIQReq; // 0x14d +extern s16 gHydroCannonIQReq; // 0x14d +extern s16 gBlastBurnIQReq; // 0x14d +extern s16 gVoltTackleIQReq; // 0x14d +extern char* gFormattedStatusNames[]; + +extern int sprintf(char *, const char *, ...); +extern u32 ReturnIntFromChar(u8 r0); +extern void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1*, PokemonStruct2*); void LoadMonsterParameters(void) { gRecruitedPokemonRef = &gRecruitedPokemon; - gMonsterParametersFile = OpenFileAndGetFileDataPtr(&gUnknown_81075F4, &gSystemFileArchive); + gMonsterParametersFile = OpenFileAndGetFileDataPtr(sMonsterParameterFileName, &gSystemFileArchive); gMonsterParameters = (MonsterDataEntry *)gMonsterParametersFile->data; gLevelCurrentPokeId = 0; } @@ -290,19 +337,9 @@ PokemonStruct1 *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation } void sub_808D31C(PokemonStruct1 *param_1) -{ - bool8 flag; -#ifndef NONMATCHING - register bool32 flag_32 asm("r0"); -#else - bool32 flag_32; -#endif - - if ((!param_1->isTeamLeader)){ - flag = ((param_1->dungeonLocation).id == 0x41); - flag_32 = flag; - if(!flag_32) param_1->unk0 = flag_32; - } +{ + if ((!IsMonTeamLeader(param_1)) && !IsMonPartner(param_1)) + param_1->unk0 = 0; } PokemonStruct1 * GetPlayerPokemonStruct(void) @@ -441,3 +478,1030 @@ bool8 sub_808D500(void) } return flag; } + +#ifdef NONMATCHING +s32 GetUnitSum_808D544(s32 *team) +{ + int *ptr; + int index; + s32 count; + PokemonStruct1 *pokemon; + + pokemon = gRecruitedPokemonRef->pokemon; + count = 0; + for(index = 0, ptr = team; index < NUM_MONSTERS; index++, pokemon++) + { + if ((PokemonFlag2(pokemon))) { + if (team != 0) *ptr = index; + ptr++; + count++; + } + } + return count; +} +#else +NAKED +s32 GetUnitSum_808D544(s32 *team) +{ + asm_unified( + "\tpush {r4-r7,lr}\n" + "\tadds r4, r0, 0\n" + "\tldr r0, _0808D57C\n" + "\tldr r3, [r0]\n" + "\tmovs r5, 0\n" + "\tmovs r2, 0\n" + "\tmovs r7, 0x1\n" + "\tmovs r6, 0xCE\n" + "\tlsls r6, 1\n" + "\tadds r1, r4, 0\n" +"_0808D558:\n" + "\tldrh r0, [r3]\n" + "\tlsrs r0, 1\n" + "\tands r0, r7\n" + "\tcmp r0, 0\n" + "\tbeq _0808D56C\n" + "\tcmp r4, 0\n" + "\tbeq _0808D568\n" + "\tstr r2, [r1]\n" +"_0808D568:\n" + "\tadds r1, 0x4\n" + "\tadds r5, 0x1\n" +"_0808D56C:\n" + "\tadds r2, 0x1\n" + "\tadds r3, 0x58\n" + "\tcmp r2, r6\n" + "\tble _0808D558\n" + "\tadds r0, r5, 0\n" + "\tpop {r4-r7}\n" + "\tpop {r1}\n" + "\tbx r1\n" + "\t.align 2, 0\n" +"_0808D57C: .4byte gRecruitedPokemonRef"); +} +#endif + +s32 sub_808D580(s32 *team) +{ + PokemonStruct1 *mon; + s32 index; + s32 counter; + + mon = gRecruitedPokemonRef->pokemon; + counter = 0; + + for(index = 0; index < NUM_MONSTERS; index++, mon++) + { + if (((IsMonTeamLeader(mon)) && (PokemonFlag1(mon))) && (team != NULL)) { + team[counter] = index; + counter++; + break; + } + } + + for(mon = gRecruitedPokemonRef->pokemon, index = 0; index < NUM_MONSTERS; index++, mon++) + { + if (((IsMonPartner(mon) && !IsMonTeamLeader(mon) && PokemonFlag2(mon)) && (PokemonFlag1(mon))) && + ((((team != NULL))))) + { + team[counter] = index; + counter++; + break; + } + } + + + for(mon = gRecruitedPokemonRef->pokemon, index = 0; index < NUM_MONSTERS; index++, mon++) + { + if ((((PokemonFlag2(mon)) && (PokemonFlag1(mon))) && + (!IsMonTeamLeader(mon))) && + (((!IsMonPartner(mon) && (team != NULL))))) { + team[counter] = index; + counter++; + } + } + return counter; +} + +s32 sub_808D654(s32 *ptr) +{ + s32 i; + PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[0]; + s32 count = 0; + s32 *ptr2; + + for (i = 0, ptr2 = ptr; i < NUM_MONSTERS; i++, mon++) { + if (PokemonFlag2(mon) && !IsMonTeamLeader(mon) && !IsMonPartner(mon)) { + if (ptr != NULL) { + *ptr2 = i; + } + ptr2++; + count++; + } + } + + return count; +} + +// The same as sub_808D654 except it doesn't exclude partner. +s32 sub_808D6A4(s32 *ptr) +{ + s32 i; + PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[0]; + s32 count = 0; + s32 *ptr2; + + for (i = 0, ptr2 = ptr; i < NUM_MONSTERS; i++, mon++) { + if (PokemonFlag2(mon) && !IsMonTeamLeader(mon)) { + if (ptr != NULL) { + *ptr2 = i; + } + ptr2++; + count++; + } + } + + return count; +} + +bool8 sub_808D6E8() +{ + s32 i; + s32 count = 0; + s32 size_count = 0; + for (i = 0; i < NUM_MONSTERS; i++) { + PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[i]; + if (PokemonFlag1(pokemon) && PokemonFlag2(pokemon)) { + size_count += GetBodySize(pokemon->speciesNum); + count++; + } + } + if ((size_count < 6) && (count < 4)) { + return 1; + } + return 0; +} + +// this one is surprisingly frustrating +// https://decomp.me/scratch/OIMII - (99.24% matching - Seth) +NAKED +bool8 sub_808D750(s16 index_) { + asm_unified( +"\tpush {r4-r7,lr}\n" +"\tmov r7, r9\n" +"\tmov r6, r8\n" +"\tpush {r6,r7}\n" +"\tlsls r0, 16\n" +"\tasrs r0, 16\n" +"\tmov r8, r0\n" +"\tmovs r6, 0\n" +"\tmovs r5, 0\n" +"\tmovs r4, 0\n" +"\tldr r0, _0808D7C8\n" +"\tmov r9, r0\n" +"\tmovs r7, 0x1\n" +"_0808D76A:\n" +"\tmovs r0, 0x58\n" +"\tadds r1, r4, 0\n" +"\tmuls r1, r0\n" +"\tmov r2, r9\n" +"\tldr r0, [r2]\n" +"\tadds r1, r0, r1\n" +"\tldrh r2, [r1]\n" +"\tadds r0, r7, 0\n" +"\tands r0, r2\n" +"\tcmp r0, 0\n" +"\tbeq _0808D798\n" +"\tlsrs r0, r2, 1\n" +"\tands r0, r7\n" +"\tcmp r0, 0\n" +"\tbeq _0808D798\n" +"\tmovs r2, 0x8\n" +"\tldrsh r0, [r1, r2]\n" +"\tbl GetBodySize\n" +"\tlsls r0, 24\n" +"\tlsrs r0, 24\n" +"\tadds r5, r0\n" +"\tadds r6, 0x1\n" +"_0808D798:\n" +"\tadds r4, 0x1\n" +"\tmovs r0, 0xCE\n" +"\tlsls r0, 1\n" +"\tcmp r4, r0\n" +"\tble _0808D76A\n" +"\tcmp r6, 0x3\n" +"\tbgt _0808D7CC\n" +"\tldr r2, _0808D7C8\n" +"\tmovs r0, 0x58\n" +"\tmov r1, r8\n" +"\tmuls r1, r0\n" +"\tldr r0, [r2]\n" +"\tadds r1, r0, r1\n" +"\tmovs r2, 0x8\n" +"\tldrsh r0, [r1, r2]\n" +"\tbl GetBodySize\n" +"\tlsls r0, 24\n" +"\tlsrs r0, 24\n" +"\tadds r5, r0\n" +"\tcmp r5, 0x6\n" +"\tbgt _0808D7CC\n" +"\tmovs r0, 0x1\n" +"\tb _0808D7CE\n" +"\t.align 2, 0\n" +"_0808D7C8: .4byte gRecruitedPokemonRef\n" +"_0808D7CC:\n" +"\tmovs r0, 0\n" +"_0808D7CE:\n" +"\tpop {r3,r4}\n" +"\tmov r8, r3\n" +"\tmov r9, r4\n" +"\tpop {r4-r7}\n" +"\tpop {r1}\n" +"\tbx r1\n" + ); +} + +// bool8 sub_808D750(s16 index_) { +// s32 i; +// register s32 index asm("r8") = index_; +// s32 count = 0; +// s32 size_count = 0; + +// for (i = 0; i < 413; i++) { +// register PokemonStruct1* pokemon = &i[gRecruitedPokemonRef->pokemon]; +// register u16 unk0 = pokemon->unk0; +// if ((unk0 & 1) && ((pokemon->unk0 >> 1) & 1)) { +// size_count += GetBodySize(pokemon->speciesNum); +// count++; +// } +// } + +// if (count < 4) { +// PokemonStruct1* pokemon; + +// pokemon = &gRecruitedPokemonRef->pokemon[index]; + +// size_count += GetBodySize(pokemon->speciesNum); +// if (size_count < 7) { +// return TRUE; +// } +// } +// return FALSE; +// } + + +void PeekPokemonItem(s16 index_, BulkItem* item) { + s32 index = index_; + PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[index]; + item->id = pokemon->heldItem.id; + item->quantity = pokemon->heldItem.quantity; +} + +void GivePokemonItem(s16 index_, BulkItem* item) { + s32 index = index_; + PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[index]; + pokemon->heldItem.id = item->id; + pokemon->heldItem.quantity = item->quantity; +} + +bool8 IsPokemonRenamed(PokemonStruct1* pokemon) { + char species_name[20]; + char* species = GetMonSpecies(pokemon->speciesNum); + s32 i; + CopyStringtoBuffer(species_name, species); + for (i = 0; i < POKEMON_NAME_LENGTH; i++) { + if (pokemon->name[i] != species_name[i]) { + return FALSE; + } + if (!pokemon->name[i]) { + return TRUE; + } + } + return TRUE; +} + +bool8 ComparePokemonNames(s16 a1, s16 a2) +{ + s32 index1 = a1; + s32 index2 = a2; + u8* name1 = gRecruitedPokemonRef->pokemon[index1].name; + u8* name2 = gRecruitedPokemonRef->pokemon[index2].name; + + s32 i; + for (i = 0; i < POKEMON_NAME_LENGTH; i++) { + s32 c1 = ReturnIntFromChar(*name1); + s32 c2 = ReturnIntFromChar(*name2); + if (c1 > c2) { + return TRUE; + } + if (c1 < c2) { + return FALSE; + } + name1++; + name2++; + } + return FALSE; +} + +void CopyMonsterNameToBuffer(u8 * buffer, s32 index) +{ + s16 index_s16 = index; + strncpy(buffer, gMonsterParameters[index_s16].species, 0x14); +} + +void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index) +{ + s32 new_index = index; + sprintfStatic(buffer, gUnknown_8107600, gMonsterParameters[new_index].species); // {color YELLOW}%s{reset} +} + +void CopyCyanMonsterNametoBuffer(u8 *buffer, s16 index) +{ + s32 new_index = index; + sprintfStatic(buffer, gUnknown_8107608, gMonsterParameters[new_index].species); // {color CYAN}%s{reset} +} + +void sub_808D930(u8 *buffer, s32 index) +{ + char *unownString; + s32 unownIndex; + const char *preload; + s16 index_s16 = index; + + if (GetBaseSpecies(index_s16) == MONSTER_UNOWN) { + preload = gUnknown_8107630; // %s%c + unownString = GetMonSpecies(MONSTER_UNOWN); + unownIndex = GetUnownIndex(index_s16); + sprintfStatic(buffer,preload,unownString,gUnownLetters[unownIndex]); // ABCDEFGHIJKLMNOPQRSTUVWXYZ!? + } + else { + sprintfStatic(buffer,gUnknown_8107638, gMonsterParameters[index_s16].species); // %s + } +} + +char * GetMonSpecies(s16 index) +{ + return gMonsterParameters[index].species; +} + +void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum) +{ + u8 nameBuffer [20]; + + sub_80922B4(nameBuffer, pokemon->name, POKEMON_NAME_LENGTH); + if (colorNum == COLOR_WHITE) { + colorNum = COLOR_CYAN; + } + sprintfStatic(buffer,gUnknown_810763C,colorNum,nameBuffer); // {color}%c%s{reset} +} + +void sub_808D9DC(u8 *buffer, PokemonStruct2 *param_2, s32 colorNum) +{ + u8 nameBuffer [20]; + + sub_80922B4(nameBuffer, param_2->name, POKEMON_NAME_LENGTH); + if (colorNum == COLOR_WHITE) { + colorNum = COLOR_YELLOW; + } + sprintfStatic(buffer,gUnknown_810763C,colorNum,nameBuffer); // {color}%c%s{reset} +} + +void sub_808DA0C(u8 *buffer, PokemonStruct2 *param_2) +{ + u8 nameBuffer [20]; + + sub_80922B4(nameBuffer, param_2->name, POKEMON_NAME_LENGTH); + sprintfStatic(buffer,gUnknown_8107638,nameBuffer); // %s +} + +void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon) +{ + sub_80922B4(buffer, pokemon->name, POKEMON_NAME_LENGTH); +} + +bool8 sub_808DA44(s32 a1_, u32 a2_) +{ + // this is the dumbest thing ever, but just making a1 a s16 and + // a2 a u8 did weird stuff with shifting... + s32 a1 = (s16)a1_; + u32 a2 = (u8)a2_; + if (a2 > 0xc) { + s32 i; + struct unkStruct_8107654 data[6]; + memcpy(data, gUnknown_8107654, 6 * sizeof(struct unkStruct_8107654)); + + for (i = 0; i < 10 && data[i].unk0; i++) { + if (data[i].unk0 == a1 && data[i].unk4 == a2) { + return 1; + } + } + return 0; + } + else { + return gUnknown_8107645[a2]; + } +} + +u8 *GetCategoryString(s16 index) +{ + return gMonsterParameters[index].category; +} + +u8 GetBodySize(s32 index) +{ + s16 index_s16 = index; + return gMonsterParameters[index_s16].bodySize; +} + +u8 GetShadowSize(s16 index) +{ + return gMonsterParameters[index].shadowSize; +} + +s32 GetMovementSpeed(s16 index) +{ + return gMonsterParameters[index].movementSpeed; +} + +u8 GetMovementType(s16 index) +{ + return gMonsterParameters[index].movementType; +} + +u8 GetRegenSpeed(s16 index) +{ + return ((u8)(gMonsterParameters[index].regenSpeed) << 25) >> 24; +} + +bool8 GetCanMoveFlag(s16 index) +{ + return gMonsterParameters[index].canMove; +} + +u8 GetChanceAsleep(s16 index) +{ + return gMonsterParameters[index].chanceAsleep; +} + +u32 GetWeight(s16 index) +{ + return gMonsterParameters[index].weight; +} + +u32 GetSize(s16 index) +{ + return gMonsterParameters[index].size; +} + +u8 GetFriendArea(s32 index) +{ + s16 index_s32 = index; + return gMonsterParameters[index_s32].friendArea; +} + +s32 GetBaseHP(s32 index) +{ + s16 index_s32 = index; + return gMonsterParameters[index_s32].baseHP; +} + +bool8 MonsterIDCanThrowItems(s16 index) +{ + return gMonsterParameters[index].canThrowItems; +} + +u8 GetUnk12(s16 index) +{ + return gMonsterParameters[index].unk12; +} + +s16 GetPokemonEvolveFrom(s16 index) +{ + return gMonsterParameters[index].preEvolution.evolveFrom; +} + +s32 GetBaseOffensiveStat(s32 index, u32 r1) +{ + s16 index_s16 = index; + return gMonsterParameters[index_s16].baseAtkSpAtk[r1]; +} + +s32 GetBaseDefensiveStat(s32 index, u32 r1) +{ + s16 index_s16 = index; + return gMonsterParameters[index_s16].baseDefSpDef[r1]; +} + +u8 GetPokemonType(s32 index, u32 typeIndex) +{ + s16 newIndex = index; + return gMonsterParameters[newIndex].types[typeIndex]; +} + +u8 GetPokemonAbility(s16 index, u32 abilityIndex) +{ + return gMonsterParameters[index].abilities[abilityIndex]; +} + +s16 GetDexInternalNo(s32 index, u32 r1) +{ + s16 index_s16 = index; + return gMonsterParameters[index_s16].dexInternal[r1]; +} + +s16 GetRecruitRate(s16 index) +{ + return gMonsterParameters[index].recruitRate; +} + +s16 GetAlphabetParentNo(s16 index, s32 r1) +{ + return gMonsterParameters[index].alphabetParent[r1]; +} + + +s16 GetInternalNo(s16 index) +{ + return gMonsterParameters[index].dexInternal[1]; +} + +s32 CalculateEXPGain(s16 index, s32 level) +{ + s32 expYield = gMonsterParameters[index].expYield; + return expYield + (expYield * (level - 1)) / 10; +} + +s16 GetPokemonEvolveConditions(s16 index, unkEvolve *r1) +{ + PreEvolution temp2; + EvolutionRequirements temp1; + temp1 = gMonsterParameters[index].evolutionRequirements; + temp2 = gMonsterParameters[index].preEvolution; + r1->preEvolution = temp2; + r1->evolutionRequirements = temp1; + // The return value is not used anywhere, but necessary for the function to match. + return index; +} + +u8 GetPokemonOverworldPalette(s16 index, u32 r1) +{ + s32 id = SpeciesId(index); + if (r1 != 0) + { + return 10; + } + else + { + return gMonsterParameters[id].overworldPalette; + } +} + +OpenedFile *OpenPokemonDialogueSpriteFile(s16 index) +{ + // Looks like this loads the dialogue sprite for the pokemon + + char buffer[0xC]; + if(gMonsterParameters[index].dialogueSprites == 0) + { + return NULL; + } + sprintf(buffer, gUnknown_8107684, index); // "kao%03d" + return OpenFile(buffer, &gMonsterFileArchive); +} + +OpenedFile *GetDialogueSpriteDataPtr(s32 index) +{ + // Looks like this loads the dialogue sprite for the pokemon + char buffer[0xC]; + s16 id = SpeciesId(index); + + if(gMonsterParameters[id].dialogueSprites == 0) + { + return NULL; + } + sprintf(buffer, gUnknown_8107684, id); // "kao%03d" + return OpenFileAndGetFileDataPtr(buffer, &gMonsterFileArchive); +} + +bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 spriteId) +{ + // checking to see if dialogue sprite is available?? + return (gMonsterParameters[index].dialogueSprites >> spriteId) & 1; +} + +void xxx_pokemonstruct_index_to_pokemon2_808DE30(void* r0, u32 r1) +{ + xxx_pokemonstruct_to_pokemon2_808DE50(r0, &gRecruitedPokemonRef->pokemon[r1], r1); +} + +void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 * a1, PokemonStruct1 *pokemon, s32 a3) +{ + s32 i; + BulkItem* held; + Item* slot; + + a1->unk0 = pokemon->unk0; + a1->level = pokemon->level; + a1->IQ = pokemon->IQ; + a1->IQSkills = pokemon->IQSkills; + GenerateHiddenPower(&a1->hiddenPower); + a1->dungeonLocation = pokemon->dungeonLocation; + a1->isTeamLeader = pokemon->isTeamLeader; + a1->unkA = a3; + a1->speciesNum = pokemon->speciesNum; + a1->tacticIndex = pokemon->tacticIndex; + a1->unk12 = pokemon->pokeHP; + a1->unk10 = pokemon->pokeHP; + + for (i = 0; i < 2; i++) { + a1->offense.att[i] = pokemon->offense.att[i]; + a1->offense.def[i] = pokemon->offense.def[i]; + } + + a1->currExp = pokemon->currExp; + CopyAndResetMoves(&a1->moves, pokemon->moves); + + for (i = 0; i < POKEMON_NAME_LENGTH; i++) { + a1->name[i] = pokemon->name[i]; + } + + held = &pokemon->heldItem; + slot = &a1->itemSlot; + + if ((u32)(-held->id | held->id) >> 31) { + HeldItemToSlot(slot, held); + } + else { + slot->id = ITEM_NOTHING; + slot->quantity = 0; + slot->flags = 0; + } + + a1->belly = IntToFixedPoint(100); + a1->maxBelly = IntToFixedPoint(100); +} + +void xxx_pokemon2_to_pokemonstruct_index_808DF2C(s32 a1, PokemonStruct2* a2) +{ + xxx_pokemon2_to_pokemonstruct_808DF44(&a1[gRecruitedPokemonRef->pokemon], a2); +} + + +void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1* pokemon, PokemonStruct2* a2) +{ + s32 i; + + pokemon->unk0 = a2->unk0; + pokemon->level = a2->level; + pokemon->IQ = a2->IQ; + pokemon->IQSkills = a2->IQSkills; + pokemon->dungeonLocation = a2->dungeonLocation; + pokemon->isTeamLeader = a2->isTeamLeader; + pokemon->speciesNum = a2->speciesNum; + pokemon->tacticIndex = a2->tacticIndex; + pokemon->pokeHP = a2->unk12; + + for (i = 0; i < 2; i++) { + pokemon->offense.att[i] = a2->offense.att[i]; + pokemon->offense.def[i] = a2->offense.def[i]; + } + + pokemon->currExp = a2->currExp; + CopyBareMoveData(pokemon->moves, a2->moves.moves); + + for (i = 0; i < POKEMON_NAME_LENGTH; i++) { + pokemon->name[i] = a2->name[i]; + } + + if (a2->itemSlot.flags & ITEM_FLAG_EXISTS) { + SlotToHeldItem(&pokemon->heldItem, &a2->itemSlot); + } + else { + pokemon->heldItem.id = ITEM_NOTHING; + } +} + +void sub_808DFDC(s32 a1, PokemonStruct2* a2) +{ + // transfer item from unk to pokemon at index + PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[a1]; + if (a2->itemSlot.flags & ITEM_FLAG_EXISTS) { + SlotToHeldItem(&pokemon->heldItem, &a2->itemSlot); + } + else { + pokemon->heldItem.id = ITEM_NOTHING; + } +} + +void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level) +{ + u8 buffer[12]; + s32 id = SpeciesId(_id); + + if ((s16)gLevelCurrentPokeId != id) + { + OpenedFile *file; + + gLevelCurrentPokeId = id; + // lvmp%03d\0 + sprintf(buffer, gUnknown_810768C, id); + file = OpenFileAndGetFileDataPtr(buffer, &gSystemFileArchive); + DecompressATFile((char*)gLevelCurrentData, 0, file); + CloseFile(file); + } + level -= 1; + if ( level < 0 ) + level = 0; + + *a1 = gLevelCurrentData[level]; +} + +const u8* DecompressMoveID(const u8* src, u16* moveID) +{ + u32 byte0; + u32 byte1 = *src++; + // If move >= 127 which means it uses 2 bytes and not one + if (byte1 & 0x80) { + byte0 = *src++; + } + else { + byte0 = byte1; + byte1 = 0; + } + + *moveID = (byte0 & 0x7F) | ((byte1 & 0x7F) << 7); + return src; +} + +s32 GetMovesLearnedAtLevel(u16* dst, s16 species, s32 level, s32 IQPoints) +{ + const u8* stream; + u16 moveID; // moveID + s32 count; + s32 _species; + + _species = SpeciesId(species); + count = 0; + + if (species == MONSTER_DECOY) return 0; + if (species == MONSTER_NONE) return 0; + if (species == MONSTER_MUNCHLAX) return 0; + // get stream + stream = GetLevelUpMoves(_species); + + while (*stream) + { + u8 v12; + + // read from stream + stream = DecompressMoveID(stream, &moveID); + v12 = *stream++; + + if (v12 > level) + break; + if (v12 == level) { + bool8 cond = TRUE; + + // NOTE: these moves require IQ to be > 333 + if ((moveID == MOVE_FRENZY_PLANT) && (IQPoints < gFrenzyPlantIQReq)) cond = FALSE; + if ((moveID == MOVE_HYDRO_CANNON) && (IQPoints < gHydroCannonIQReq)) cond = FALSE; + if ((moveID == MOVE_BLAST_BURN) && (IQPoints < gBlastBurnIQReq)) cond = FALSE; + if ((moveID == MOVE_VOLT_TACKLE) && (IQPoints < gVoltTackleIQReq)) cond = FALSE; + + if (cond) { + if (count < 16) { + *dst++ = moveID; + ++count; + } + } + } + } + return count; +} + +bool8 CanMonLearnMove(u16 moveID, s16 _species) +{ + u16 levelUpMoveID; + u16 HMTMMoveID; + s32 species = _species; // r4 + const u8* learnsetPtr; + + if (species == MONSTER_DECOY) return 0; + if (species == MONSTER_NONE) return 0; + if (species == MONSTER_MUNCHLAX) return 0; + if (moveID == MOVE_STRUGGLE) return 0; + + learnsetPtr = GetLevelUpMoves(_species); + while (*learnsetPtr) { + learnsetPtr = DecompressMoveID(learnsetPtr, &levelUpMoveID); + learnsetPtr++; + if (moveID == levelUpMoveID) { + return TRUE; + } + } + + learnsetPtr = GetHMTMMoves(species); + while (*learnsetPtr) { + learnsetPtr = DecompressMoveID(learnsetPtr, &HMTMMoveID); + if (HMTMMoveID == moveID) { + return TRUE; + } + } + return FALSE; +} + + +s32 sub_808E218(unkStruct_808E218_arg* a1, PokemonStruct1* pokemon) +{ + s32 i; + s32 count; + struct EvolveStage evolve_sequence[3]; + s32 sequence_length; + + count = 0; + a1->count = 0; + if (pokemon->speciesNum == MONSTER_DECOY) return 0; + if (pokemon->speciesNum == MONSTER_NONE) return 0; + if (pokemon->speciesNum == MONSTER_MUNCHLAX) return 0; + + sequence_length = GetEvolutionSequence(pokemon, evolve_sequence); + for (i = 0; i < sequence_length; i++) { + const u8 *ptr; + u16 result; + + ptr = GetLevelUpMoves(evolve_sequence[i].speciesNum); + while (*ptr) { + s32 value; + ptr = DecompressMoveID(ptr, &result); + value = *ptr++; + + if (value > evolve_sequence[i].level) { + break; + } + + if (count < NUM_MONSTERS) { + s32 j; + bool8 cond = 1; + + if ((result == MOVE_FRENZY_PLANT) && (pokemon->IQ < gFrenzyPlantIQReq)) cond = 0; + if ((result == MOVE_HYDRO_CANNON) && (pokemon->IQ < gHydroCannonIQReq)) cond = 0; + if ((result == MOVE_BLAST_BURN) && (pokemon->IQ < gBlastBurnIQReq)) cond = 0; + if ((result == MOVE_VOLT_TACKLE) && (pokemon->IQ < gVoltTackleIQReq)) cond = 0; + + for (j = 0; j < MAX_MON_MOVES; j++) { + if ((pokemon->moves[j].moveFlags & MOVE_FLAG_EXISTS) && pokemon->moves[j].id == result) { + cond = 0; + } + } + + if (cond) { + s32 k; + for (k = 0; k < count && a1->unk0[k] != result; k++) {} + + if (k == count) { + a1->unk0[count++] = result; + } + } + } + } + } + + a1->count = count; + return count; +} + + +s32 GetEvolutionSequence(PokemonStruct1* pokemon, struct EvolveStage* a2) +{ +#ifdef NONMATCHING + s32 count; + s32 species; + s32 i; + + a2[0].speciesNum = pokemon->speciesNum; + a2[0].level = pokemon->level; + + count = 1; + species = pokemon->speciesNum; + i = 0; + + for (; i < 2; i++) { + if (!pokemon->unkC[i].level) { + break; + } + species = GetPokemonEvolveFrom(species); + if (!species) { + break; + } + a2[1 + i].speciesNum = species; + a2[1 + i].level = pokemon->unkC[i].level; + // wrong increment order: + count++; + } + return count; +#else + s32 count; + s32 species; + s32 i; + struct EvolveStage* stage; + struct unkPokeSubStruct_C* has_next_stage; + + a2[0].speciesNum = pokemon->speciesNum; + a2[0].level = pokemon->level; + + count = 1; + species = pokemon->speciesNum; + i = 0; + has_next_stage = pokemon->unkC; + stage = &a2[1]; + + for (; i < 2; i++) { + if (!has_next_stage->level) { + break; + } + species = GetPokemonEvolveFrom(species); + if (!species) { + break; + } + stage->speciesNum = species; + stage->level = has_next_stage->level; + stage++; + count++; + has_next_stage++; + } + return count; +#endif +} + +s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaCheck) +{ + // This is horrible + s32 species = SpeciesId(_species); + bool8 bodySizeCheck = _bodySizeCheck; + bool8 shedinjaCheck = _shedinjaCheck; + s32 count = 0; + s32 i = 1; + s16 *a2 = _a2; + + for (i = 1; i < MONSTER_MAX; i++) { + s32 loopSpeciesId = SpeciesId(i); + #ifdef NONMATCHING + s32 loopSpeciesId2 = SpeciesId(i); + #else + register s32 loopSpeciesId2 asm("r8") = SpeciesId(i); + #endif // NONMATCHING + + if (species != GetPokemonEvolveFrom(loopSpeciesId)) { + continue; + } + if (!bodySizeCheck && GetBodySize(species) != GetBodySize(loopSpeciesId)) { + continue; + } + if (!shedinjaCheck && loopSpeciesId == MONSTER_SHEDINJA) { + continue; + } + *a2++ = loopSpeciesId2; + count++; + } + return count; +} + +void sub_808E490(Move* a1, s32 species) +{ + u16 buffer[0x10]; // of moveIDs + s32 i; + s16 index_s32 = species; + + s32 count = GetMovesLearnedAtLevel(buffer, index_s32, 1, 999); + if (count == 0) { + count = 1; + buffer[0] = MOVE_ITEM_TOSS; + } + + i = 0; + if (i < count) { + while (i < count) { + InitZeroedPPPokemonMove(&a1[i], buffer[i]); + i++; + } + i = count; + } + while (i < MAX_MON_MOVES) { + a1[i].moveFlags = 0; + i++; + } +} + +char* sub_808E4FC(s32 a1) +{ + struct subStruct_203B240 *result[4]; + sub_8097DF0(gFormattedStatusNames[a1], result); + return result[0]->pokeName; +} + +char* sub_808E51C(s32 a1) +{ + struct subStruct_203B240 *result[4]; + sub_8097DF0(gFormattedStatusNames[a1], result); + return result[0]->unk4; +} + diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c deleted file mode 100644 index 9aff7e2be..000000000 --- a/src/pokemon_mid.c +++ /dev/null @@ -1,969 +0,0 @@ -#include "global.h" -#include "code_800D090.h" -#include "code_8097DD0.h" -#include "constants/colors.h" -#include "constants/dungeon.h" -#include "constants/move_id.h" -#include "decompress.h" -#include "items.h" -#include "moves.h" -#include "pokemon.h" -#include "pokemon_3.h" -#include "pokemon_mid.h" -#include "text_util.h" - -extern MonsterDataEntry *gMonsterParameters; -extern const char gUnknown_8107600[]; -extern const char gUnknown_8107608[]; -extern const char gUnownLetters[]; -extern const char gUnknown_8107630[]; -extern const char gUnknown_8107638[]; -extern const char gUnknown_810763C[]; -extern const char gUnknown_810768C[]; // lvmp%03d\0 -extern struct FileArchive gSystemFileArchive; -extern s16 gFrenzyPlantIQReq; // 0x14d -extern s16 gHydroCannonIQReq; // 0x14d -extern s16 gBlastBurnIQReq; // 0x14d -extern s16 gVoltTackleIQReq; // 0x14d -extern char* gFormattedStatusNames[]; - -// wram data: -extern u16 gLevelCurrentPokeId; -extern LevelData gLevelCurrentData[]; - - -extern int sprintf(char *, const char *, ...); -extern u32 ReturnIntFromChar(u8 r0); -extern void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1*, PokemonStruct2*); - -struct unkStruct_8107654 { - s16 unk0; - s16 fill2; - s32 unk4; -}; - -extern u8 gUnknown_8107645[12]; -extern struct unkStruct_8107654 gUnknown_8107654[6]; -extern MonsterDataEntry *gMonsterParameters; -extern struct FileArchive gMonsterFileArchive; -extern const char gUnknown_8107684[]; - -s32 sub_808D654(s32 *ptr) -{ - s32 i; - PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[0]; - s32 count = 0; - s32 *ptr2; - - for (i = 0, ptr2 = ptr; i < NUM_MONSTERS; i++, mon++) { - if (PokemonFlag2(mon) && !IsMonTeamLeader(mon) && !IsMonPartner(mon)) { - if (ptr != NULL) { - *ptr2 = i; - } - ptr2++; - count++; - } - } - - return count; -} - -// The same as sub_808D654 except it doesn't exclude partner. -s32 sub_808D6A4(s32 *ptr) -{ - s32 i; - PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[0]; - s32 count = 0; - s32 *ptr2; - - for (i = 0, ptr2 = ptr; i < NUM_MONSTERS; i++, mon++) { - if (PokemonFlag2(mon) && !IsMonTeamLeader(mon)) { - if (ptr != NULL) { - *ptr2 = i; - } - ptr2++; - count++; - } - } - - return count; -} - -bool8 sub_808D6E8() -{ - s32 i; - s32 count = 0; - s32 size_count = 0; - for (i = 0; i < NUM_MONSTERS; i++) { - PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(pokemon) && PokemonFlag2(pokemon)) { - size_count += GetBodySize(pokemon->speciesNum); - count++; - } - } - if ((size_count < 6) && (count < 4)) { - return 1; - } - return 0; -} - -// this one is surprisingly frustrating -NAKED -bool8 sub_808D750(s16 index_) { - asm_unified( -"\tpush {r4-r7,lr}\n" -"\tmov r7, r9\n" -"\tmov r6, r8\n" -"\tpush {r6,r7}\n" -"\tlsls r0, 16\n" -"\tasrs r0, 16\n" -"\tmov r8, r0\n" -"\tmovs r6, 0\n" -"\tmovs r5, 0\n" -"\tmovs r4, 0\n" -"\tldr r0, _0808D7C8\n" -"\tmov r9, r0\n" -"\tmovs r7, 0x1\n" -"_0808D76A:\n" -"\tmovs r0, 0x58\n" -"\tadds r1, r4, 0\n" -"\tmuls r1, r0\n" -"\tmov r2, r9\n" -"\tldr r0, [r2]\n" -"\tadds r1, r0, r1\n" -"\tldrh r2, [r1]\n" -"\tadds r0, r7, 0\n" -"\tands r0, r2\n" -"\tcmp r0, 0\n" -"\tbeq _0808D798\n" -"\tlsrs r0, r2, 1\n" -"\tands r0, r7\n" -"\tcmp r0, 0\n" -"\tbeq _0808D798\n" -"\tmovs r2, 0x8\n" -"\tldrsh r0, [r1, r2]\n" -"\tbl GetBodySize\n" -"\tlsls r0, 24\n" -"\tlsrs r0, 24\n" -"\tadds r5, r0\n" -"\tadds r6, 0x1\n" -"_0808D798:\n" -"\tadds r4, 0x1\n" -"\tmovs r0, 0xCE\n" -"\tlsls r0, 1\n" -"\tcmp r4, r0\n" -"\tble _0808D76A\n" -"\tcmp r6, 0x3\n" -"\tbgt _0808D7CC\n" -"\tldr r2, _0808D7C8\n" -"\tmovs r0, 0x58\n" -"\tmov r1, r8\n" -"\tmuls r1, r0\n" -"\tldr r0, [r2]\n" -"\tadds r1, r0, r1\n" -"\tmovs r2, 0x8\n" -"\tldrsh r0, [r1, r2]\n" -"\tbl GetBodySize\n" -"\tlsls r0, 24\n" -"\tlsrs r0, 24\n" -"\tadds r5, r0\n" -"\tcmp r5, 0x6\n" -"\tbgt _0808D7CC\n" -"\tmovs r0, 0x1\n" -"\tb _0808D7CE\n" -"\t.align 2, 0\n" -"_0808D7C8: .4byte gRecruitedPokemonRef\n" -"_0808D7CC:\n" -"\tmovs r0, 0\n" -"_0808D7CE:\n" -"\tpop {r3,r4}\n" -"\tmov r8, r3\n" -"\tmov r9, r4\n" -"\tpop {r4-r7}\n" -"\tpop {r1}\n" -"\tbx r1\n" - ); -} - -// bool8 sub_808D750(s16 index_) { -// s32 i; -// register s32 index asm("r8") = index_; -// s32 count = 0; -// s32 size_count = 0; - -// for (i = 0; i < 413; i++) { -// register PokemonStruct1* pokemon = &i[gRecruitedPokemonRef->pokemon]; -// register u16 unk0 = pokemon->unk0; -// if ((unk0 & 1) && ((pokemon->unk0 >> 1) & 1)) { -// size_count += GetBodySize(pokemon->speciesNum); -// count++; -// } -// } - -// if (count < 4) { -// PokemonStruct1* pokemon; - -// pokemon = &gRecruitedPokemonRef->pokemon[index]; - -// size_count += GetBodySize(pokemon->speciesNum); -// if (size_count < 7) { -// return TRUE; -// } -// } -// return FALSE; -// } - - -void PeekPokemonItem(s16 index_, BulkItem* item) { - s32 index = index_; - PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[index]; - item->id = pokemon->heldItem.id; - item->quantity = pokemon->heldItem.quantity; -} - -void GivePokemonItem(s16 index_, BulkItem* item) { - s32 index = index_; - PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[index]; - pokemon->heldItem.id = item->id; - pokemon->heldItem.quantity = item->quantity; -} - -bool8 IsPokemonRenamed(PokemonStruct1* pokemon) { - char species_name[20]; - char* species = GetMonSpecies(pokemon->speciesNum); - s32 i; - CopyStringtoBuffer(species_name, species); - for (i = 0; i < POKEMON_NAME_LENGTH; i++) { - if (pokemon->name[i] != species_name[i]) { - return FALSE; - } - if (!pokemon->name[i]) { - return TRUE; - } - } - return TRUE; -} - -bool8 ComparePokemonNames(s16 a1, s16 a2) -{ - s32 index1 = a1; - s32 index2 = a2; - u8* name1 = gRecruitedPokemonRef->pokemon[index1].name; - u8* name2 = gRecruitedPokemonRef->pokemon[index2].name; - - s32 i; - for (i = 0; i < POKEMON_NAME_LENGTH; i++) { - s32 c1 = ReturnIntFromChar(*name1); - s32 c2 = ReturnIntFromChar(*name2); - if (c1 > c2) { - return TRUE; - } - if (c1 < c2) { - return FALSE; - } - name1++; - name2++; - } - return FALSE; -} - -void CopyMonsterNameToBuffer(u8 * buffer, s32 index) -{ - s16 index_s16 = index; - strncpy(buffer, gMonsterParameters[index_s16].species, 0x14); -} - -void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index) -{ - s32 new_index = index; - sprintfStatic(buffer, gUnknown_8107600, gMonsterParameters[new_index].species); // {color YELLOW}%s{reset} -} - -void CopyCyanMonsterNametoBuffer(u8 *buffer, s16 index) -{ - s32 new_index = index; - sprintfStatic(buffer, gUnknown_8107608, gMonsterParameters[new_index].species); // {color CYAN}%s{reset} -} - -void sub_808D930(u8 *buffer, s32 index) -{ - char *unownString; - s32 unownIndex; - const char *preload; - s16 index_s16 = index; - - if (GetBaseSpecies(index_s16) == MONSTER_UNOWN) { - preload = gUnknown_8107630; // %s%c - unownString = GetMonSpecies(MONSTER_UNOWN); - unownIndex = GetUnownIndex(index_s16); - sprintfStatic(buffer,preload,unownString,gUnownLetters[unownIndex]); // ABCDEFGHIJKLMNOPQRSTUVWXYZ!? - } - else { - sprintfStatic(buffer,gUnknown_8107638, gMonsterParameters[index_s16].species); // %s - } -} - -char * GetMonSpecies(s16 index) -{ - return gMonsterParameters[index].species; -} - -void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum) -{ - u8 nameBuffer [20]; - - sub_80922B4(nameBuffer, pokemon->name, POKEMON_NAME_LENGTH); - if (colorNum == COLOR_WHITE) { - colorNum = COLOR_CYAN; - } - sprintfStatic(buffer,gUnknown_810763C,colorNum,nameBuffer); // {color}%c%s{reset} -} - -void sub_808D9DC(u8 *buffer, PokemonStruct2 *param_2, s32 colorNum) -{ - u8 nameBuffer [20]; - - sub_80922B4(nameBuffer, param_2->name, POKEMON_NAME_LENGTH); - if (colorNum == COLOR_WHITE) { - colorNum = COLOR_YELLOW; - } - sprintfStatic(buffer,gUnknown_810763C,colorNum,nameBuffer); // {color}%c%s{reset} -} - -void sub_808DA0C(u8 *buffer, PokemonStruct2 *param_2) -{ - u8 nameBuffer [20]; - - sub_80922B4(nameBuffer, param_2->name, POKEMON_NAME_LENGTH); - sprintfStatic(buffer,gUnknown_8107638,nameBuffer); // %s -} - -void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon) -{ - sub_80922B4(buffer, pokemon->name, POKEMON_NAME_LENGTH); -} - -bool8 sub_808DA44(s32 a1_, u32 a2_) -{ - // this is the dumbest thing ever, but just making a1 a s16 and - // a2 a u8 did weird stuff with shifting... - s32 a1 = (s16)a1_; - u32 a2 = (u8)a2_; - if (a2 > 0xc) { - s32 i; - struct unkStruct_8107654 data[6]; - memcpy(data, gUnknown_8107654, 6 * sizeof(struct unkStruct_8107654)); - - for (i = 0; i < 10 && data[i].unk0; i++) { - if (data[i].unk0 == a1 && data[i].unk4 == a2) { - return 1; - } - } - return 0; - } - else { - return gUnknown_8107645[a2]; - } -} - -u8 *GetCategoryString(s16 index) -{ - return gMonsterParameters[index].category; -} - -u8 GetBodySize(s32 index) -{ - s16 index_s16 = index; - return gMonsterParameters[index_s16].bodySize; -} - -u8 GetShadowSize(s16 index) -{ - return gMonsterParameters[index].shadowSize; -} - -s32 GetMovementSpeed(s16 index) -{ - return gMonsterParameters[index].movementSpeed; -} - -u8 GetMovementType(s16 index) -{ - return gMonsterParameters[index].movementType; -} - -u8 GetRegenSpeed(s16 index) -{ - return ((u8)(gMonsterParameters[index].regenSpeed) << 25) >> 24; -} - -bool8 GetCanMoveFlag(s16 index) -{ - return gMonsterParameters[index].canMove; -} - -u8 GetChanceAsleep(s16 index) -{ - return gMonsterParameters[index].chanceAsleep; -} - -u32 GetWeight(s16 index) -{ - return gMonsterParameters[index].weight; -} - -u32 GetSize(s16 index) -{ - return gMonsterParameters[index].size; -} - -u8 GetFriendArea(s32 index) -{ - s16 index_s32 = index; - return gMonsterParameters[index_s32].friendArea; -} - -s32 GetBaseHP(s32 index) -{ - s16 index_s32 = index; - return gMonsterParameters[index_s32].baseHP; -} - -bool8 MonsterIDCanThrowItems(s16 index) -{ - return gMonsterParameters[index].canThrowItems; -} - -u8 GetUnk12(s16 index) -{ - return gMonsterParameters[index].unk12; -} - -s16 GetPokemonEvolveFrom(s16 index) -{ - return gMonsterParameters[index].preEvolution.evolveFrom; -} - -s32 GetBaseOffensiveStat(s32 index, u32 r1) -{ - s16 index_s16 = index; - return gMonsterParameters[index_s16].baseAtkSpAtk[r1]; -} - -s32 GetBaseDefensiveStat(s32 index, u32 r1) -{ - s16 index_s16 = index; - return gMonsterParameters[index_s16].baseDefSpDef[r1]; -} - -u8 GetPokemonType(s32 index, u32 typeIndex) -{ - s16 newIndex = index; - return gMonsterParameters[newIndex].types[typeIndex]; -} - -u8 GetPokemonAbility(s16 index, u32 abilityIndex) -{ - return gMonsterParameters[index].abilities[abilityIndex]; -} - -s16 GetDexInternalNo(s32 index, u32 r1) -{ - s16 index_s16 = index; - return gMonsterParameters[index_s16].dexInternal[r1]; -} - -s16 GetRecruitRate(s16 index) -{ - return gMonsterParameters[index].recruitRate; -} - -s16 GetAlphabetParentNo(s16 index, s32 r1) -{ - return gMonsterParameters[index].alphabetParent[r1]; -} - - -s16 GetInternalNo(s16 index) -{ - return gMonsterParameters[index].dexInternal[1]; -} - -s32 CalculateEXPGain(s16 index, s32 level) -{ - s32 expYield = gMonsterParameters[index].expYield; - return expYield + (expYield * (level - 1)) / 10; -} - -s16 GetPokemonEvolveConditions(s16 index, unkEvolve *r1) -{ - PreEvolution temp2; - EvolutionRequirements temp1; - temp1 = gMonsterParameters[index].evolutionRequirements; - temp2 = gMonsterParameters[index].preEvolution; - r1->preEvolution = temp2; - r1->evolutionRequirements = temp1; - // The return value is not used anywhere, but necessary for the function to match. - return index; -} - -u8 GetPokemonOverworldPalette(s16 index, u32 r1) -{ - s32 id = SpeciesId(index); - if (r1 != 0) - { - return 10; - } - else - { - return gMonsterParameters[id].overworldPalette; - } -} - -OpenedFile *OpenPokemonDialogueSpriteFile(s16 index) -{ - // Looks like this loads the dialogue sprite for the pokemon - - char buffer[0xC]; - if(gMonsterParameters[index].dialogueSprites == 0) - { - return NULL; - } - sprintf(buffer, gUnknown_8107684, index); // "kao%03d" - return OpenFile(buffer, &gMonsterFileArchive); -} - -OpenedFile *GetDialogueSpriteDataPtr(s32 index) -{ - // Looks like this loads the dialogue sprite for the pokemon - char buffer[0xC]; - s16 id = SpeciesId(index); - - if(gMonsterParameters[id].dialogueSprites == 0) - { - return NULL; - } - sprintf(buffer, gUnknown_8107684, id); // "kao%03d" - return OpenFileAndGetFileDataPtr(buffer, &gMonsterFileArchive); -} - -bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 spriteId) -{ - // checking to see if dialogue sprite is available?? - return (gMonsterParameters[index].dialogueSprites >> spriteId) & 1; -} - -void xxx_pokemonstruct_index_to_pokemon2_808DE30(void* r0, u32 r1) -{ - xxx_pokemonstruct_to_pokemon2_808DE50(r0, &gRecruitedPokemonRef->pokemon[r1], r1); -} - -void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 * a1, PokemonStruct1 *pokemon, s32 a3) -{ - s32 i; - BulkItem* held; - Item* slot; - - a1->unk0 = pokemon->unk0; - a1->level = pokemon->level; - a1->IQ = pokemon->IQ; - a1->IQSkills = pokemon->IQSkills; - GenerateHiddenPower(&a1->hiddenPower); - a1->dungeonLocation = pokemon->dungeonLocation; - a1->isTeamLeader = pokemon->isTeamLeader; - a1->unkA = a3; - a1->speciesNum = pokemon->speciesNum; - a1->tacticIndex = pokemon->tacticIndex; - a1->unk12 = pokemon->pokeHP; - a1->unk10 = pokemon->pokeHP; - - for (i = 0; i < 2; i++) { - a1->offense.att[i] = pokemon->offense.att[i]; - a1->offense.def[i] = pokemon->offense.def[i]; - } - - a1->currExp = pokemon->currExp; - CopyAndResetMoves(&a1->moves, pokemon->moves); - - for (i = 0; i < POKEMON_NAME_LENGTH; i++) { - a1->name[i] = pokemon->name[i]; - } - - held = &pokemon->heldItem; - slot = &a1->itemSlot; - - if ((u32)(-held->id | held->id) >> 31) { - HeldItemToSlot(slot, held); - } - else { - slot->id = ITEM_NOTHING; - slot->quantity = 0; - slot->flags = 0; - } - - a1->belly = IntToFixedPoint(100); - a1->maxBelly = IntToFixedPoint(100); -} - -void xxx_pokemon2_to_pokemonstruct_index_808DF2C(s32 a1, PokemonStruct2* a2) -{ - xxx_pokemon2_to_pokemonstruct_808DF44(&a1[gRecruitedPokemonRef->pokemon], a2); -} - - -void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1* pokemon, PokemonStruct2* a2) -{ - s32 i; - - pokemon->unk0 = a2->unk0; - pokemon->level = a2->level; - pokemon->IQ = a2->IQ; - pokemon->IQSkills = a2->IQSkills; - pokemon->dungeonLocation = a2->dungeonLocation; - pokemon->isTeamLeader = a2->isTeamLeader; - pokemon->speciesNum = a2->speciesNum; - pokemon->tacticIndex = a2->tacticIndex; - pokemon->pokeHP = a2->unk12; - - for (i = 0; i < 2; i++) { - pokemon->offense.att[i] = a2->offense.att[i]; - pokemon->offense.def[i] = a2->offense.def[i]; - } - - pokemon->currExp = a2->currExp; - CopyBareMoveData(pokemon->moves, a2->moves.moves); - - for (i = 0; i < POKEMON_NAME_LENGTH; i++) { - pokemon->name[i] = a2->name[i]; - } - - if (a2->itemSlot.flags & ITEM_FLAG_EXISTS) { - SlotToHeldItem(&pokemon->heldItem, &a2->itemSlot); - } - else { - pokemon->heldItem.id = ITEM_NOTHING; - } -} - -void sub_808DFDC(s32 a1, PokemonStruct2* a2) -{ - // transfer item from unk to pokemon at index - PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[a1]; - if (a2->itemSlot.flags & ITEM_FLAG_EXISTS) { - SlotToHeldItem(&pokemon->heldItem, &a2->itemSlot); - } - else { - pokemon->heldItem.id = ITEM_NOTHING; - } -} - -void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level) -{ - u8 buffer[12]; - s32 id = SpeciesId(_id); - - if ((s16)gLevelCurrentPokeId != id) - { - OpenedFile *file; - - gLevelCurrentPokeId = id; - // lvmp%03d\0 - sprintf(buffer, gUnknown_810768C, id); - file = OpenFileAndGetFileDataPtr(buffer, &gSystemFileArchive); - DecompressATFile((char*)gLevelCurrentData, 0, file); - CloseFile(file); - } - level -= 1; - if ( level < 0 ) - level = 0; - - *a1 = gLevelCurrentData[level]; -} - -const u8* DecompressMoveID(const u8* src, u16* moveID) -{ - u32 byte0; - u32 byte1 = *src++; - // If move >= 127 which means it uses 2 bytes and not one - if (byte1 & 0x80) { - byte0 = *src++; - } - else { - byte0 = byte1; - byte1 = 0; - } - - *moveID = (byte0 & 0x7F) | ((byte1 & 0x7F) << 7); - return src; -} - -s32 GetMovesLearnedAtLevel(u16* dst, s16 species, s32 level, s32 IQPoints) -{ - const u8* stream; - u16 moveID; // moveID - s32 count; - s32 _species; - - _species = SpeciesId(species); - count = 0; - - if (species == MONSTER_DECOY) return 0; - if (species == MONSTER_NONE) return 0; - if (species == MONSTER_MUNCHLAX) return 0; - // get stream - stream = GetLevelUpMoves(_species); - - while (*stream) - { - u8 v12; - - // read from stream - stream = DecompressMoveID(stream, &moveID); - v12 = *stream++; - - if (v12 > level) - break; - if (v12 == level) { - bool8 cond = TRUE; - - // NOTE: these moves require IQ to be > 333 - if ((moveID == MOVE_FRENZY_PLANT) && (IQPoints < gFrenzyPlantIQReq)) cond = FALSE; - if ((moveID == MOVE_HYDRO_CANNON) && (IQPoints < gHydroCannonIQReq)) cond = FALSE; - if ((moveID == MOVE_BLAST_BURN) && (IQPoints < gBlastBurnIQReq)) cond = FALSE; - if ((moveID == MOVE_VOLT_TACKLE) && (IQPoints < gVoltTackleIQReq)) cond = FALSE; - - if (cond) { - if (count < 16) { - *dst++ = moveID; - ++count; - } - } - } - } - return count; -} - -bool8 CanMonLearnMove(u16 moveID, s16 _species) -{ - u16 levelUpMoveID; - u16 HMTMMoveID; - s32 species = _species; // r4 - const u8* learnsetPtr; - - if (species == MONSTER_DECOY) return 0; - if (species == MONSTER_NONE) return 0; - if (species == MONSTER_MUNCHLAX) return 0; - if (moveID == MOVE_STRUGGLE) return 0; - - learnsetPtr = GetLevelUpMoves(_species); - while (*learnsetPtr) { - learnsetPtr = DecompressMoveID(learnsetPtr, &levelUpMoveID); - learnsetPtr++; - if (moveID == levelUpMoveID) { - return TRUE; - } - } - - learnsetPtr = GetHMTMMoves(species); - while (*learnsetPtr) { - learnsetPtr = DecompressMoveID(learnsetPtr, &HMTMMoveID); - if (HMTMMoveID == moveID) { - return TRUE; - } - } - return FALSE; -} - - -s32 sub_808E218(unkStruct_808E218_arg* a1, PokemonStruct1* pokemon) -{ - s32 i; - s32 count; - struct EvolveStage evolve_sequence[3]; - s32 sequence_length; - - count = 0; - a1->count = 0; - if (pokemon->speciesNum == MONSTER_DECOY) return 0; - if (pokemon->speciesNum == MONSTER_NONE) return 0; - if (pokemon->speciesNum == MONSTER_MUNCHLAX) return 0; - - sequence_length = GetEvolutionSequence(pokemon, evolve_sequence); - for (i = 0; i < sequence_length; i++) { - const u8 *ptr; - u16 result; - - ptr = GetLevelUpMoves(evolve_sequence[i].speciesNum); - while (*ptr) { - s32 value; - ptr = DecompressMoveID(ptr, &result); - value = *ptr++; - - if (value > evolve_sequence[i].level) { - break; - } - - if (count < NUM_MONSTERS) { - s32 j; - bool8 cond = 1; - - if ((result == MOVE_FRENZY_PLANT) && (pokemon->IQ < gFrenzyPlantIQReq)) cond = 0; - if ((result == MOVE_HYDRO_CANNON) && (pokemon->IQ < gHydroCannonIQReq)) cond = 0; - if ((result == MOVE_BLAST_BURN) && (pokemon->IQ < gBlastBurnIQReq)) cond = 0; - if ((result == MOVE_VOLT_TACKLE) && (pokemon->IQ < gVoltTackleIQReq)) cond = 0; - - for (j = 0; j < MAX_MON_MOVES; j++) { - if ((pokemon->moves[j].moveFlags & MOVE_FLAG_EXISTS) && pokemon->moves[j].id == result) { - cond = 0; - } - } - - if (cond) { - s32 k; - for (k = 0; k < count && a1->unk0[k] != result; k++) {} - - if (k == count) { - a1->unk0[count++] = result; - } - } - } - } - } - - a1->count = count; - return count; -} - - -s32 GetEvolutionSequence(PokemonStruct1* pokemon, struct EvolveStage* a2) -{ -#ifdef NONMATCHING - s32 count; - s32 species; - s32 i; - - a2[0].speciesNum = pokemon->speciesNum; - a2[0].level = pokemon->level; - - count = 1; - species = pokemon->speciesNum; - i = 0; - - for (; i < 2; i++) { - if (!pokemon->unkC[i].level) { - break; - } - species = GetPokemonEvolveFrom(species); - if (!species) { - break; - } - a2[1 + i].speciesNum = species; - a2[1 + i].level = pokemon->unkC[i].level; - // wrong increment order: - count++; - } - return count; -#else - s32 count; - s32 species; - s32 i; - struct EvolveStage* stage; - struct unkPokeSubStruct_C* has_next_stage; - - a2[0].speciesNum = pokemon->speciesNum; - a2[0].level = pokemon->level; - - count = 1; - species = pokemon->speciesNum; - i = 0; - has_next_stage = pokemon->unkC; - stage = &a2[1]; - - for (; i < 2; i++) { - if (!has_next_stage->level) { - break; - } - species = GetPokemonEvolveFrom(species); - if (!species) { - break; - } - stage->speciesNum = species; - stage->level = has_next_stage->level; - stage++; - count++; - has_next_stage++; - } - return count; -#endif -} - -s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaCheck) -{ - // This is horrible - s32 species = SpeciesId(_species); - bool8 bodySizeCheck = _bodySizeCheck; - bool8 shedinjaCheck = _shedinjaCheck; - s32 count = 0; - s32 i = 1; - s16 *a2 = _a2; - - for (i = 1; i < MONSTER_MAX; i++) { - s32 loopSpeciesId = SpeciesId(i); - #ifdef NONMATCHING - s32 loopSpeciesId2 = SpeciesId(i); - #else - register s32 loopSpeciesId2 asm("r8") = SpeciesId(i); - #endif // NONMATCHING - - if (species != GetPokemonEvolveFrom(loopSpeciesId)) { - continue; - } - if (!bodySizeCheck && GetBodySize(species) != GetBodySize(loopSpeciesId)) { - continue; - } - if (!shedinjaCheck && loopSpeciesId == MONSTER_SHEDINJA) { - continue; - } - *a2++ = loopSpeciesId2; - count++; - } - return count; -} - -void sub_808E490(Move* a1, s16 species) -{ - u16 buffer[0x10]; // of moveIDs - s32 i; - s32 count = GetMovesLearnedAtLevel(buffer, species, 1, 999); - if (count == 0) { - count = 1; - buffer[0] = MOVE_ITEM_TOSS; - } - - i = 0; - if (i < count) { - while (i < count) { - InitZeroedPPPokemonMove(&a1[i], buffer[i]); - i++; - } - i = count; - } - while (i < MAX_MON_MOVES) { - a1[i].moveFlags = 0; - i++; - } -} - -char* sub_808E4FC(s32 a1) -{ - struct subStruct_203B240 *result[4]; - sub_8097DF0(gFormattedStatusNames[a1], result); - return result[0]->pokeName; -} - -char* sub_808E51C(s32 a1) -{ - struct subStruct_203B240 *result[4]; - sub_8097DF0(gFormattedStatusNames[a1], result); - return result[0]->unk4; -} From fd1e3ad9816a31fe68afe33722f65ed59a024fab Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Fri, 6 Dec 2024 16:03:33 -0800 Subject: [PATCH 15/23] clean up include and add ewram for pokemon.c --- include/pokemon.h | 13 +++++++++---- include/pokemon_mid.h | 8 ++------ src/code_801AFA4.c | 2 +- src/code_8023868.c | 3 +-- src/code_8042B34.c | 2 +- src/code_8069D4C.c | 2 +- src/code_8069E0C.c | 1 - src/code_806CD90.c | 1 - src/code_80718D8.c | 2 -- src/code_8072B78.c | 1 - src/code_8094F88.c | 4 ++-- src/gulpin_shop_801FB50.c | 2 +- src/mission_reward.c | 1 - src/pokemon.c | 14 +++++++------- src/pokemon_news2.c | 2 +- src/pokemon_news3.c | 2 +- sym_ewram.txt | 13 +------------ 17 files changed, 28 insertions(+), 45 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index a9013ba96..d2265bc69 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -81,6 +81,8 @@ OpenedFile *GetDialogueSpriteDataPtr(s32 index); s32 GetUnownIndex(s16 index); void GenerateHiddenPower(HiddenPower *); s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *); +s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaCheck); +void sub_808E490(Move* a1, s32 species); void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32); void WritePoke1Bits(DataSerializer *, PokemonStruct1 *pokemon); void ReadPoke1Bits(DataSerializer *, PokemonStruct1 *); @@ -96,10 +98,13 @@ PokemonStruct1 * sub_808D434(s16 species, s32 param_2); s32 GetFriendSum_808D480(void); bool8 sub_808D4B0(void); bool8 sub_808D500(void); - -// pokemon.s -extern s32 GetUnitSum_808D544(s32 *); -extern s32 sub_808D580(s32 *); +s32 GetUnitSum_808D544(s32 *); +s32 sub_808D580(s32 *); +bool8 ComparePokemonNames(s16, s16); +void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon); +void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); +const u8* DecompressMoveID(const u8* a1, u16* moveID); +bool8 sub_808DA44(s32, u32); static inline bool8 PokemonFlag1(PokemonStruct1 *mon) { diff --git a/include/pokemon_mid.h b/include/pokemon_mid.h index 7bb43c764..46e2dee28 100644 --- a/include/pokemon_mid.h +++ b/include/pokemon_mid.h @@ -3,12 +3,8 @@ #include "pokemon.h" -bool8 ComparePokemonNames(s16, s16); +// NOTE: this is kept separate since TransferOrbAction needs index to be s32 +// and I haven't had the time to fix matching void CopyCyanMonsterNametoBuffer(u8 *buffer, s16 index); -void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon); -void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); -const u8* DecompressMoveID(const u8* a1, u16* moveID); - -bool8 sub_808DA44(s32, u32); #endif // GUARD_POKEMON_MID_H diff --git a/src/code_801AFA4.c b/src/code_801AFA4.c index be210b9d1..b4081660e 100644 --- a/src/code_801AFA4.c +++ b/src/code_801AFA4.c @@ -7,7 +7,7 @@ #include "gulpin_shop.h" #include "memory.h" #include "moves.h" -#include "pokemon_mid.h" +#include "pokemon.h" static EWRAM_DATA_2 unkStruct_203B22C *sUnknown_203B22C = {0}; diff --git a/src/code_8023868.c b/src/code_8023868.c index 4e8a88d17..fa10220d9 100644 --- a/src/code_8023868.c +++ b/src/code_8023868.c @@ -3,7 +3,6 @@ #include "code_800D090.h" #include "code_8023868.h" #include "pokemon.h" -#include "pokemon_mid.h" #include "structs/str_text.h" #include "text_util.h" @@ -172,4 +171,4 @@ UNUSED static PokemonStruct1 *sub_80243E8(void) sub_80922B4(nameBuffer, pokeStruct->name, POKEMON_NAME_LENGTH); sprintfStatic(buffer, sUnknown_80DC9A4, nameBuffer); return pokeStruct; -} \ No newline at end of file +} diff --git a/src/code_8042B34.c b/src/code_8042B34.c index ce3fa2e29..ee6f28b6f 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -26,7 +26,7 @@ #include "code_803E668.h" #include "dungeon_engine.h" #include "dungeon_map_access.h" -#include "pokemon_mid.h" +#include "pokemon.h" #include "weather.h" #include "moves.h" #include "code_8094F88.h" diff --git a/src/code_8069D4C.c b/src/code_8069D4C.c index 48c5e9210..f93a9c07d 100644 --- a/src/code_8069D4C.c +++ b/src/code_8069D4C.c @@ -1,5 +1,5 @@ #include "global.h" -#include "pokemon_mid.h" +#include "pokemon.h" #include "dungeon_util.h" #include "code_8069D4C.h" diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 1ca70b73c..67fd08d70 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -21,7 +21,6 @@ #include "move_effects_target.h" #include "moves.h" #include "pokemon.h" -#include "pokemon_mid.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" #include "text_util.h" diff --git a/src/code_806CD90.c b/src/code_806CD90.c index 90d51630c..16aefe58a 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -18,7 +18,6 @@ #include "game_options.h" #include "dungeon_items.h" #include "status.h" -#include "pokemon_mid.h" #include "pokemon.h" #include "random.h" #include "targeting.h" diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 76fb35877..4a6076a0f 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -54,8 +54,6 @@ extern bool8 sub_806AA0C(s32, u32); extern bool8 sub_8083660(DungeonPos *param_1); extern bool8 sub_803D930(u32); extern void sub_8072B78(Entity *pokemon, Entity *target, s16 id); -extern s32 sub_808E400(s32 _species, s16* _a2, bool32 bodySizeCheck, bool32 shedinjaCheck); -void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); // TODO: change to s32 void sub_8071B48(void) { diff --git a/src/code_8072B78.c b/src/code_8072B78.c index 831ca2b8f..b0227f48d 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -8,7 +8,6 @@ #include "dungeon_util.h" #include "moves.h" #include "pokemon_mid.h" -#include "pokemon_mid.h" #include "status_checks_1.h" #include "structs/dungeon_entity.h" #include "structs/map.h" diff --git a/src/code_8094F88.c b/src/code_8094F88.c index 2da05ce3c..9d9c5e29f 100644 --- a/src/code_8094F88.c +++ b/src/code_8094F88.c @@ -5,7 +5,7 @@ #include "dungeon.h" #include "memory.h" #include "moves.h" -#include "pokemon_mid.h" +#include "pokemon.h" #include "random.h" #include "save.h" #include "text_util.h" @@ -468,4 +468,4 @@ void sub_8095824(DataSerializer * a, unkStruct_203B480 *b) void sub_80958E4(u32 *a, u32 b) { *a = b; -} \ No newline at end of file +} diff --git a/src/gulpin_shop_801FB50.c b/src/gulpin_shop_801FB50.c index 7759c94b0..757e15352 100644 --- a/src/gulpin_shop_801FB50.c +++ b/src/gulpin_shop_801FB50.c @@ -16,7 +16,7 @@ #include "menu_input.h" #include "moves.h" #include "pokemon_3.h" -#include "pokemon_mid.h" +#include "pokemon.h" #include "text.h" EWRAM_DATA_2 unkStruct_203B27C *gUnknown_203B27C = {0}; diff --git a/src/mission_reward.c b/src/mission_reward.c index 15c0f98f4..10fec39eb 100644 --- a/src/mission_reward.c +++ b/src/mission_reward.c @@ -2,7 +2,6 @@ #include "globaldata.h" #include "code_802F204.h" #include "pokemon.h" -#include "pokemon_mid.h" #include "rescue_team_info.h" #include "friend_area.h" #include "input.h" diff --git a/src/pokemon.c b/src/pokemon.c index 0e7dea0a3..5d930a24f 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -15,15 +15,15 @@ extern struct FileArchive gSystemFileArchive; extern struct FileArchive gMonsterFileArchive; -EWRAM_DATA MonsterDataEntry *gMonsterParameters; -EWRAM_DATA OpenedFile *gMonsterParametersFile; -EWRAM_DATA SpriteOAM gShadowSprites[3]; // Shadow sprites of some kind -EWRAM_DATA unkStruct_203B45C gRecruitedPokemon; -EWRAM_DATA u16 gLevelCurrentPokeId; -EWRAM_DATA LevelData gLevelCurrentData[0x64]; +static EWRAM_DATA MonsterDataEntry *gMonsterParameters = {0}; +static EWRAM_DATA OpenedFile *gMonsterParametersFile = {0}; +EWRAM_DATA SpriteOAM gShadowSprites[3] = {0}; // TODO: make static once pokemon_2.s is ded +static EWRAM_DATA unkStruct_203B45C gRecruitedPokemon = {0}; +static EWRAM_DATA u16 gLevelCurrentPokeId = {0}; +UNUSED static EWRAM_DATA u16 unused_data[3] = {0}; +static EWRAM_DATA LevelData gLevelCurrentData[0x64] = {0}; EWRAM_DATA_2 unkStruct_203B45C *gRecruitedPokemonRef = {0}; -extern void sub_808E490(Move* a1, s32 species); struct unkStruct_8107654 { s16 unk0; diff --git a/src/pokemon_news2.c b/src/pokemon_news2.c index 12b7abc12..85f91ceb0 100644 --- a/src/pokemon_news2.c +++ b/src/pokemon_news2.c @@ -5,7 +5,7 @@ #include "game_options.h" #include "input.h" #include "pokemon_mail.h" -#include "pokemon_mid.h" +#include "pokemon.h" #include "pokemon_news2.h" #include "memory.h" #include "menu_input.h" diff --git a/src/pokemon_news3.c b/src/pokemon_news3.c index 432f4d75f..b9aafea33 100644 --- a/src/pokemon_news3.c +++ b/src/pokemon_news3.c @@ -11,7 +11,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon_mail.h" -#include "pokemon_mid.h" +#include "pokemon.h" #include "pokemon_news3.h" #include "structs/str_802C39C.h" #include "text.h" diff --git a/sym_ewram.txt b/sym_ewram.txt index 242181b17..0069640b5 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -276,19 +276,8 @@ gUnknown_202F3D0: /* 202F3D0 (sub_80867F4 - sub_8086854) */ gUnknown_202F3D8: /* 202F3D8 (sub_8085B4C - sub_8085B80) */ .space 0x8 -gMonsterParameters: /* 202F3E0 (LoadMonsterParameters - IsPokemonDialogueSpriteAvail) */ - .space 0x4 -gMonsterParametersFile: /* 202F3E4 (LoadMonsterParameters) */ - .space 0x4 -gShadowSprites: /* 202F3E8 (InitShadowSprites - AddShadowSprite) */ - .space 0x18 -gRecruitedPokemon: /* 202F400 [used everywhere tbh] */ - .space 0x90E8 -gLevelCurrentPokeId: /* 20384E8 (LoadMonsterParameters - GetPokemonLevelData) */ - .space 0x8 -gLevelCurrentData: /* 20384F0 (GetPokemonLevelData) */ - .space 0x4B0 + .include "src/pokemon.o" .include "src/items.o" .include "src/rescue_team_info.o" .space 0x4 From c7248641eefc282154facc9979090cba92ca1408 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sat, 7 Dec 2024 19:20:44 -0800 Subject: [PATCH 16/23] decomp sub_808F798 --- asm/pokemon_3.s | 92 --------------------------------------------- include/pokemon_3.h | 4 +- src/code_8069E0C.c | 3 +- src/pokemon_3.c | 60 +++++++++++++++++++++++++---- 4 files changed, 57 insertions(+), 102 deletions(-) diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s index 5a3b14ddf..8a2481a24 100644 --- a/asm/pokemon_3.s +++ b/asm/pokemon_3.s @@ -5,98 +5,6 @@ .text - thumb_func_start sub_808F798 -sub_808F798: - push {r4-r6,lr} - sub sp, 0xA4 - adds r4, r0, 0 - lsls r1, 16 - asrs r5, r1, 16 - mov r0, sp - adds r1, r4, 0 - movs r2, 0x58 - bl memcpy - mov r0, sp - movs r1, 0x8 - ldrsh r6, [r0, r1] - add r0, sp, 0x58 - mov r1, sp - ldrb r2, [r1, 0x3] - adds r1, r5, 0 - bl GetPokemonLevelData - ldr r0, [sp, 0x58] - str r0, [sp, 0x1C] - movs r0, 0 - strh r0, [r4] - mov r0, sp - strh r5, [r0, 0x8] - ldrb r0, [r0, 0xC] - cmp r0, 0 - bne _0808F7DA - mov r0, sp - mov r1, sp - ldrb r1, [r1, 0x3] - strb r1, [r0, 0xC] - b _0808F7EA -_0808F7DA: - mov r0, sp - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _0808F7EA - mov r0, sp - mov r1, sp - ldrb r1, [r1, 0x3] - strb r1, [r0, 0x10] -_0808F7EA: - add r4, sp, 0x64 - adds r0, r6, 0 - bl GetMonSpecies - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyStringtoBuffer - movs r2, 0 - b _0808F800 -_0808F7FE: - adds r2, 0x1 -_0808F800: - cmp r2, 0x9 - bgt _0808F816 - adds r1, r4, r2 - add r0, sp, 0x4C - adds r0, r2 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bne _0808F82E - cmp r1, 0 - bne _0808F7FE -_0808F816: - movs r0, 0x1 - cmp r0, 0 - beq _0808F82E - add r4, sp, 0x4C - adds r0, r5, 0 - bl GetMonSpecies - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0xA - bl BoundedCopyStringtoBuffer -_0808F82E: - mov r0, sp - bl sub_808D1DC - add sp, 0xA4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808F798 - - thumb_func_start sub_808F83C -sub_808F83C: - movs r0, 0 - strb r0, [r2] - bx lr - thumb_func_end sub_808F83C - thumb_func_start CreatePokemonInfoTabScreen CreatePokemonInfoTabScreen: push {r4-r7,lr} diff --git a/include/pokemon_3.h b/include/pokemon_3.h index 8e5fc1766..dbda724fe 100644 --- a/include/pokemon_3.h +++ b/include/pokemon_3.h @@ -30,10 +30,12 @@ void SetIQSkill(IqSkillFlags *iq, u32 skillIndex); bool8 IsIQSkillSet(IqSkillFlags *iq, u32 IQSkillBit); void SetDefaultIQSkills(IqSkillFlags *iq, bool8 enableSelfCurer); void sub_808F468(PokemonStruct1 *param_1, EvolveStatus *evolveStatus, u8 param_3); -u32 sub_808F734(PokemonStruct1 *pokemon, s16 _species); +s32 sub_808F700(PokemonStruct1 *pokemon); +PokemonStruct1 *sub_808F734(PokemonStruct1 *pokemon, s16 _species); s16 ExtractSpeciesIndex(UnkDungeonGlobal_unk1CD98 *r0); void SetSpeciesLevelToExtract(UnkDungeonGlobal_unk1CD98 *r0, s32 level, s32 species); s32 ExtractLevel(UnkDungeonGlobal_unk1CD98 *r0); +PokemonStruct1 *sub_808F798(PokemonStruct1 *pokemon, short _species); // pokemon_3.s extern void CreatePokemonInfoTabScreen(u32, s16, u32 *, u32 *, u32); diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 67fd08d70..cf559ce08 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -10,6 +10,7 @@ #include "constants/status.h" #include "constants/type.h" #include "constants/weather.h" +#include "dungeon_engine.h" #include "dungeon_leader.h" #include "dungeon_map_access.h" #include "dungeon_movement.h" @@ -65,7 +66,6 @@ extern void sub_803F4A0(Entity *a0); extern bool8 sub_80860A8(u8 id); extern u8 gUnknown_202F32C; extern u8 sub_803D73C(s32 a0); -extern bool8 IsBossFight(void); extern void DeletePokemonDungeonSprite(s32 id); extern void sub_80429E8(Entity *r0); extern s32 sub_803DA20(s32 param_1); @@ -84,7 +84,6 @@ extern void sub_803F580(s32); extern void sub_8040A84(void); extern void sub_806B678(void); extern void EntityUpdateStatusSprites(Entity *); -extern s32 sub_808F700(PokemonStruct1 *pokemon); extern Entity *sub_80696A8(Entity *a0); extern int sprintf(char *, const char *, ...); extern const u8 gUnknown_8106EA8[]; // talkp%d diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 0f1a14a9c..9dc2b1145 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -8,6 +8,7 @@ #include "constants/iq_skill.h" #include "constants/tactic.h" #include "constants/type.h" +#include "structs/str_pokemon.h" #include "sprite.h" #include "text_util.h" #include "friend_area.h" @@ -57,8 +58,6 @@ extern void ReadBellyBits(DataSerializer*, FixedPoint *dst); extern void ReadHiddenPowerBits(DataSerializer*, HiddenPower*); s16 GetPokemonEvolveConditions(s16 index, unkEvolve *r1); -u32 sub_808F798(PokemonStruct1 *, s16); - bool8 AddShadowSprite(s16 species, s16* a2, s16* a3) { if (species != MONSTER_DIGLETT && species != MONSTER_DUGTRIO) { @@ -1093,14 +1092,14 @@ s32 sub_808F700(PokemonStruct1 *pokemon) } } -u32 sub_808F734(PokemonStruct1 *pokemon, s16 _species) +PokemonStruct1 *sub_808F734(PokemonStruct1 *pokemon, s16 _species) { - u32 uVar1; - int iVar3; + PokemonStruct1 *uVar1; + PokemonStruct1 *iVar3; PokemonStruct1 pokeStruct; s32 species = _species; - iVar3 = 0; + iVar3 = NULL; pokeStruct = *pokemon; uVar1 = sub_808F798(pokemon, species); if (species == MONSTER_NINJASK) { @@ -1109,8 +1108,55 @@ u32 sub_808F734(PokemonStruct1 *pokemon, s16 _species) BoundedCopyStringtoBuffer(pokeStruct.name, GetMonSpecies(MONSTER_SHEDINJA),POKEMON_NAME_LENGTH); iVar3 = sub_808F798(&pokeStruct,MONSTER_SHEDINJA); } - if (iVar3 != 0) { + if (iVar3 != NULL) { IncrementAdventureNumJoined(); } return uVar1; } + +PokemonStruct1 *sub_808F798(PokemonStruct1 *pokemon, short _species) +{ + s32 r6; + s32 index; + PokemonStruct1 pokeStruct; + LevelData levelData; + u8 buffer [64]; + s32 species = _species; + bool32 flag = TRUE; + + pokeStruct = *pokemon; + r6 = pokeStruct.speciesNum; + GetPokemonLevelData(&levelData,species,pokeStruct.level); + pokeStruct.currExp = levelData.expRequired; + pokemon->unk0 = 0; + pokeStruct.speciesNum = species; + if (pokeStruct.unkC[0].level == 0) { + pokeStruct.unkC[0].level = pokeStruct.level; + } + else if (pokeStruct.unkC[1].level == 0) { + pokeStruct.unkC[1].level = pokeStruct.level; + } + + CopyStringtoBuffer(buffer, GetMonSpecies(r6)); + + index = 0; + goto _start; + do + { + index++; +_start: + if(index >= POKEMON_NAME_LENGTH) break; + if(buffer[index] != pokeStruct.name[index]) goto _end; + if(buffer[index] == 0) break; + + } while(TRUE); + if(flag) + BoundedCopyStringtoBuffer(pokeStruct.name, GetMonSpecies(species), POKEMON_NAME_LENGTH); +_end: + return sub_808D1DC(&pokeStruct); +} + +UNUSED void sub_808F83C(PokemonStruct1 *pokemon, s16 species, u8 *r2) +{ + *r2 = 0; +} From ad0ec301b9bef5992ca87db846b137da11692dfe Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sun, 8 Dec 2024 17:22:41 -0800 Subject: [PATCH 17/23] move more data to src --- data/data_8109964.s | 23 ----------------------- ld_script.txt | 5 ++++- src/code_8094D28.c | 1 + src/code_8094F88.c | 1 + src/code_80958E8.c | 5 +++-- src/code_80972F4.c | 1 + src/play_time.c | 1 + 7 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 data/data_8109964.s diff --git a/data/data_8109964.s b/data/data_8109964.s deleted file mode 100644 index bc25b2149..000000000 --- a/data/data_8109964.s +++ /dev/null @@ -1,23 +0,0 @@ -.section .rodata - -@ ??? -.string "pksdir0\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 - -.global gUnknown_8109984 -gUnknown_8109984: @ 8109984 -.byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x00 - -@ ??? -.string "pksdir0\0" -.align 2,0 - diff --git a/ld_script.txt b/ld_script.txt index 768e36b08..930594965 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -550,7 +550,10 @@ SECTIONS { src/pokemon.o(.rodata); data/data_81076E4.o(.rodata); src/game_options.o(.rodata); - data/data_8109964.o(.rodata); + src/code_8094D28.o(.rodata); + src/play_time.o(.rodata); + src/code_8094F88.o(.rodata); + src/code_80958E8.o(.rodata); src/code_80972F4.o(.rodata); src/code_8097504.o(.rodata); data/data_8109D10.o(.rodata); diff --git a/src/code_8094D28.c b/src/code_8094D28.c index f8d9453b3..97b4ff2a2 100644 --- a/src/code_8094D28.c +++ b/src/code_8094D28.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" IWRAM_DATA u32 gUnknown_3001198[0x270] = {0}; EWRAM_DATA_2 s32 gUnknown_203B470 = {0}; diff --git a/src/code_8094F88.c b/src/code_8094F88.c index 9d9c5e29f..69791ca01 100644 --- a/src/code_8094F88.c +++ b/src/code_8094F88.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "code_8094D28.h" #include "code_8094F88.h" #include "constants/wonder_mail.h" diff --git a/src/code_80958E8.c b/src/code_80958E8.c index 25847f048..337a80fdb 100644 --- a/src/code_80958E8.c +++ b/src/code_80958E8.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "code_803C1D0.h" #include "code_80958E8.h" #include "code_80A26CC.h" @@ -38,7 +39,7 @@ extern void sub_803C45C(WonderMail *); extern void sub_803C610(WonderMail *); extern void sub_803C580(WonderMail *); -extern u8 gUnknown_8109984[]; +static const u8 sPossibleMissionTypes[] = {MISSION_TYPE_FRIEND_RESCUE, MISSION_TYPE_FIND_ITEM, MISSION_TYPE_DELIVER_ITEM, MISSION_TYPE_RESCUE_CLIENT, MISSION_TYPE_RESCUE_TARGET, MISSION_TYPE_DELIVER_ITEM, MISSION_TYPE_FIND_ITEM, MISSION_TYPE_FRIEND_RESCUE}; static EWRAM_DATA unkStruct_203B490 sUnknown_2039448 = {0}; @@ -187,7 +188,7 @@ bool8 GenerateMailJobInfo(struct WonderMail *mail) } mail->mailType = MAIL_TYPE_SUSPENDED_JOB; rand = RandInt(8); - missionType = gUnknown_8109984[rand]; + missionType = sPossibleMissionTypes[rand]; mail->missionType = missionType; if (missionType == MISSION_TYPE_DELIVER_ITEM && GetRescueTeamRank() == 0) { mail->missionType = MISSION_TYPE_FRIEND_RESCUE; diff --git a/src/code_80972F4.c b/src/code_80972F4.c index 7765d413b..7868e734c 100644 --- a/src/code_80972F4.c +++ b/src/code_80972F4.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "dungeon.h" #include "exclusive_pokemon.h" #include "event_flag.h" diff --git a/src/play_time.c b/src/play_time.c index 893a53892..7b668d352 100644 --- a/src/play_time.c +++ b/src/play_time.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "play_time.h" #include "code_8092334.h" From fb98bb9ec179ca92aaed8989be3d073f2f55dc81 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sat, 14 Dec 2024 09:01:36 -0800 Subject: [PATCH 18/23] decompile more of code_2 and move some data --- asm/code_2.s | 554 +------------------------- data/data_80D47B8.s | 54 +-- include/structs/str_dungeon_8042F6C.h | 36 ++ include/structs/str_wonder_mail.h | 2 +- src/code.c | 266 ++++++++++++- src/code_8042B34.c | 34 +- src/string_format.c | 48 ++- 7 files changed, 342 insertions(+), 652 deletions(-) create mode 100644 include/structs/str_dungeon_8042F6C.h diff --git a/asm/code_2.s b/asm/code_2.s index 96cb0c1b1..03f93b406 100644 --- a/asm/code_2.s +++ b/asm/code_2.s @@ -1059,556 +1059,4 @@ _08000EC6: bx r1 thumb_func_end sub_80009D0 - thumb_func_start SaveLoadRelated_8000EDC -SaveLoadRelated_8000EDC: - push {r4-r7,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r5, 0x1 - ldr r0, _08000F24 - str r5, [r0] - movs r0, 0x3 - bl sub_800A8F8 - bl sub_8014144 - add r1, sp, 0x4 - mov r0, sp - bl sub_8043D50 - ldr r0, [sp] - movs r1, 0x7 - bl MemoryAlloc - str r0, [r4, 0x74] - ldr r0, [sp, 0x4] - movs r1, 0x7 - bl MemoryAlloc - str r0, [r4, 0x78] - ldrb r0, [r4, 0x8] - cmp r0, 0 - beq _08000F68 - ldr r0, [r4, 0x74] - ldr r1, [sp] - bl PrepareQuickSaveRead - adds r7, r4, 0 - adds r7, 0x7C - b _08000F2E - .align 2, 0 -_08000F24: .4byte gUnknown_203B03C -_08000F28: - movs r0, 0 - bl xxx_update_stuff -_08000F2E: - bl ReadQuickSave - lsls r0, 24 - cmp r0, 0 - bne _08000F28 - bl IsQuickSaveValid - lsls r0, 24 - lsrs r5, r0, 24 - bl FinishQuickSaveRead - bl sub_8011830 - cmp r5, 0 - beq _08000F58 - ldr r0, _08000F54 - bl sub_80121E0 - b _08000F5E - .align 2, 0 -_08000F54: .4byte 0x000f1208 -_08000F58: - ldr r0, _08000F64 - bl sub_80121E0 -_08000F5E: - bl xxx_call_start_bg_music - b _08000F78 - .align 2, 0 -_08000F64: .4byte 0x000f1209 -_08000F68: - bl GeneratePelipperJobs - bl sub_80961B4 - bl sub_808ED00 - adds r7, r4, 0 - adds r7, 0x7C -_08000F78: - cmp r5, 0 - beq _08000F92 - adds r0, r4, 0 - bl xxx_dungeon_8001340 - bl sub_8099648 - bl SetWindowBGColor - movs r0, 0 - bl sub_8099690 - b _08000F96 -_08000F92: - movs r0, 0x5 - strh r0, [r7] -_08000F96: - adds r5, r7, 0 - movs r1, 0 - ldrsh r0, [r5, r1] - movs r6, 0x2 - negs r6, r6 - cmp r0, r6 - bne _08000FAC - adds r0, r4, 0 - adds r0, 0x84 - bl sub_809542C -_08000FAC: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - beq _08000FB8 - cmp r0, r6 - bne _0800100C -_08000FB8: - adds r0, r4, 0 - adds r0, 0x80 - bl SetDungeonLocationInfo - bl xxx_call_stop_bgm - movs r1, 0 - ldrsh r0, [r7, r1] - cmp r0, r6 - bne _08000FD8 - ldr r0, [r4, 0x74] - ldr r1, [sp] - movs r2, 0x1 - bl PrepareQuickSaveWrite - b _08000FFA -_08000FD8: - ldr r0, [r4, 0x74] - ldr r1, [sp] - movs r2, 0 - bl PrepareQuickSaveWrite - b _08000FFA -_08000FE4: - cmp r0, 0x1 - bne _08000FF4 - ldr r0, [r4, 0x78] - bl MemoryFree - ldr r0, [r4, 0x74] - bl MemoryFree -_08000FF4: - movs r0, 0 - bl xxx_update_stuff -_08000FFA: - bl WriteQuickSave - cmp r0, 0x2 - beq _08001006 - cmp r0, 0x3 - bne _08000FE4 -_08001006: - bl FinishQuickSaveWrite - b _0800101C -_0800100C: - bl sub_808ED00 - ldr r0, [r4, 0x78] - bl MemoryFree - ldr r0, [r4, 0x74] - bl MemoryFree -_0800101C: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end SaveLoadRelated_8000EDC - - thumb_func_start sub_8001024 -sub_8001024: - push {r4,lr} - ldr r1, _08001040 - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08001040: .4byte gPersonalityRelated_203B040 - thumb_func_end sub_8001024 - - thumb_func_start sub_8001044 -sub_8001044: - push {r4,lr} - ldr r1, _08001060 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08001060: .4byte gPersonalityRelated_203B040 - thumb_func_end sub_8001044 - - thumb_func_start sub_8001064 -sub_8001064: - push {r4,r5,lr} - sub sp, 0x28 - bl GetPlayerPokemonStruct - cmp r0, 0 - bne _080010AE - ldr r5, _0800109C - ldrb r0, [r5, 0x8] - cmp r0, 0 - bne _080010A0 - add r4, sp, 0x14 - movs r0, 0x4 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl CopyMonsterNameToBuffer - mov r0, sp - adds r1, r4, 0 - bl CopyStringtoBuffer - movs r1, 0x4 - ldrsh r0, [r5, r1] - movs r1, 0x1 - mov r2, sp - bl sub_808CE74 - b _080010AE - .align 2, 0 -_0800109C: .4byte gPersonalityRelated_203B040 -_080010A0: - movs r4, 0x4 - ldrsh r0, [r5, r4] - adds r2, r5, 0 - adds r2, 0x8 - movs r1, 0x1 - bl sub_808CE74 -_080010AE: - bl sub_808D378 - cmp r0, 0 - bne _080010F2 - ldr r5, _080010E0 - ldrb r0, [r5, 0x1C] - cmp r0, 0 - bne _080010E4 - add r4, sp, 0x14 - movs r0, 0x6 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl CopyMonsterNameToBuffer - mov r0, sp - adds r1, r4, 0 - bl CopyStringtoBuffer - movs r1, 0x6 - ldrsh r0, [r5, r1] - movs r1, 0 - mov r2, sp - bl sub_808CE74 - b _080010F2 - .align 2, 0 -_080010E0: .4byte gPersonalityRelated_203B040 -_080010E4: - movs r4, 0x6 - ldrsh r0, [r5, r4] - adds r2, r5, 0 - adds r2, 0x1C - movs r1, 0 - bl sub_808CE74 -_080010F2: - ldr r3, _08001164 - movs r0, 0x4 - ldrsh r1, [r3, r0] - cmp r1, 0 - beq _08001126 - ldr r2, _08001168 - movs r4, 0x4 - ldrsh r0, [r2, r4] - cmp r0, 0 - beq _0800111C - cmp r1, r0 - beq _0800111C -_0800110A: - adds r2, 0x8 - movs r0, 0x4 - ldrsh r1, [r2, r0] - cmp r1, 0 - beq _0800111C - movs r4, 0x4 - ldrsh r0, [r3, r4] - cmp r0, r1 - bne _0800110A -_0800111C: - ldr r2, [r2] - movs r0, 0 - movs r1, 0x27 - bl SetScriptVarValue -_08001126: - ldr r3, _08001164 - movs r0, 0x6 - ldrsh r1, [r3, r0] - cmp r1, 0 - beq _0800115A - ldr r2, _0800116C - movs r4, 0x4 - ldrsh r0, [r2, r4] - cmp r0, 0 - beq _08001150 - cmp r1, r0 - beq _08001150 -_0800113E: - adds r2, 0x8 - movs r0, 0x4 - ldrsh r1, [r2, r0] - cmp r1, 0 - beq _08001150 - movs r4, 0x6 - ldrsh r0, [r3, r4] - cmp r0, r1 - bne _0800113E -_08001150: - ldr r2, [r2] - movs r0, 0 - movs r1, 0x26 - bl SetScriptVarValue -_0800115A: - add sp, 0x28 - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08001164: .4byte gPersonalityRelated_203B040 -_08001168: .4byte gBaseKindTable -_0800116C: .4byte gTalkKindTable - thumb_func_end sub_8001064 - - thumb_func_start sub_8001170 -sub_8001170: - push {r4,lr} - sub sp, 0x8 - add r4, sp, 0x4 - movs r0, 0x63 - strb r0, [r4] - mov r1, sp - adds r1, 0x2 - mov r0, sp - bl sub_80992E0 - lsls r0, 24 - cmp r0, 0 - beq _08001196 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - bl sub_80A2740 - b _080011BE -_08001196: - adds r0, r4, 0 - bl sub_8099328 - lsls r0, 24 - cmp r0, 0 - bne _080011C0 - adds r0, r4, 0 - bl sub_8099360 - lsls r0, 24 - cmp r0, 0 - bne _080011C0 - mov r0, sp - adds r0, 0x5 - bl sub_8099394 - lsls r0, 24 - cmp r0, 0 - beq _080011C0 - movs r0, 0x3F -_080011BE: - strb r0, [r4] -_080011C0: - ldrb r0, [r4] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8001170 - - thumb_func_start sub_80011CC -sub_80011CC: - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - strb r1, [r4] - strb r5, [r4, 0x1] - bl sub_80011E8 - strb r5, [r4, 0xB] - strb r5, [r4, 0x4] - strb r5, [r4, 0xC] - strb r5, [r4, 0xD] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80011CC - - thumb_func_start sub_80011E8 -sub_80011E8: - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x8 - bl sub_80023E4 - strb r0, [r4, 0x5] - movs r0, 0x3 - bl sub_80023E4 - strb r0, [r4, 0x6] - movs r0, 0x7 - bl sub_80023E4 - strb r0, [r4, 0x8] - movs r0, 0 - bl sub_80023E4 - strb r0, [r4, 0x9] - movs r0, 0x5 - bl sub_80023E4 - strb r0, [r4, 0xA] - movs r0, 0x18 - bl sub_80023E4 - lsls r0, 24 - cmp r0, 0 - beq _0800123C - movs r0, 0x19 - bl sub_80023E4 - lsls r0, 24 - cmp r0, 0 - beq _0800123C - movs r0, 0x1A - bl sub_80023E4 - lsls r0, 24 - cmp r0, 0 - beq _0800123C - movs r0, 0x1 - b _0800123E -_0800123C: - movs r0, 0 -_0800123E: - strb r0, [r4, 0x7] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80011E8 - - thumb_func_start sub_8001248 -sub_8001248: - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_0800124E: - movs r0, 0x64 - bl RandInt - cmp r0, 0x31 - bgt _08001266 - lsls r0, r4, 2 - ldr r1, _080012B8 - ldr r1, [r1] - adds r0, r1 - strb r5, [r0, 0x2] - strb r5, [r0, 0x1] - strb r5, [r0] -_08001266: - adds r4, 0x1 - cmp r4, 0x13 - ble _0800124E - bl FillInventoryGaps - movs r4, 0 - ldr r5, _080012BC - movs r3, 0x1 -_08001276: - movs r0, 0x58 - adds r1, r4, 0 - muls r1, r0 - ldr r0, [r5] - adds r1, r0, r1 - ldrh r2, [r1] - adds r0, r3, 0 - ands r0, r2 - cmp r0, 0 - beq _08001298 - lsrs r0, r2, 1 - ands r0, r3 - cmp r0, 0 - beq _08001298 - adds r1, 0x28 - movs r0, 0 - strb r0, [r1] -_08001298: - adds r4, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _08001276 - ldr r0, _080012B8 - ldr r0, [r0] - movs r1, 0x98 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080012B8: .4byte gTeamInventoryRef -_080012BC: .4byte gRecruitedPokemonRef - thumb_func_end sub_8001248 - - thumb_func_start sub_80012C0 -sub_80012C0: - push {r4,r5,lr} - movs r3, 0 - ldr r4, _08001324 - movs r2, 0 -_080012C8: - lsls r1, r3, 2 - ldr r0, [r4] - adds r1, r0 - strb r2, [r1, 0x2] - strb r2, [r1, 0x1] - strb r2, [r1] - adds r3, 0x1 - cmp r3, 0x13 - ble _080012C8 - bl FillInventoryGaps - movs r3, 0 - ldr r5, _08001328 - movs r4, 0x1 -_080012E4: - movs r0, 0x58 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r5] - adds r1, r0, r1 - ldrh r2, [r1] - adds r0, r4, 0 - ands r0, r2 - cmp r0, 0 - beq _08001306 - lsrs r0, r2, 1 - ands r0, r4 - cmp r0, 0 - beq _08001306 - adds r1, 0x28 - movs r0, 0 - strb r0, [r1] -_08001306: - adds r3, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r3, r0 - ble _080012E4 - ldr r0, _08001324 - ldr r0, [r0] - movs r1, 0x98 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08001324: .4byte gTeamInventoryRef -_08001328: .4byte gRecruitedPokemonRef - thumb_func_end sub_80012C0 - - .align 2,0 + .align 2,0 diff --git a/data/data_80D47B8.s b/data/data_80D47B8.s index 3cc9971d1..6f1003350 100644 --- a/data/data_80D47B8.s +++ b/data/data_80D47B8.s @@ -3,61 +3,9 @@ @ START code_80130A8 - .global gUnknown_80D48A0 -gUnknown_80D48A0: @ 80D48A0 - .byte 0x07, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x00, 0x00 - - .global gUnknown_80D48AC -gUnknown_80D48AC: @ 80D48AC - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .global gUnknown_80D48C4 -gUnknown_80D48C4: @ 80D48C4 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x0f, 0x00 - .byte 0x1a, 0x00, 0x05, 0x00 - .byte 0x07, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .global gUnknown_80D48DC -gUnknown_80D48DC: @ 80D48DC - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x08, 0x00 - .byte 0x1a, 0x00, 0x05, 0x00 - .byte 0x07, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .global gSpeakerNameSeparator -gSpeakerNameSeparator: @ 80D48F4 - .byte 0x3A, 0x20, 0x00, 0x00 @ maybe just a colon and space - - .global gUnknown_80D48F8 -gUnknown_80D48F8: @ 80D48F8 - .string "????\0" - .align 2,0 - - .global gUnknown_80D4900 -gUnknown_80D4900: @ 80D4900 - .string "%d\0" - .align 2,0 - - .global gUnknown_80D4904 -gUnknown_80D4904: @ 80D4904 - .string "%*d\0" - .align 2,0 - .global gUnknown_80D4908 gUnknown_80D4908: @ 80D4908 - .string "%0*d\0" + .asciz "%0*d" .align 2,0 .global gUnknown_80D4910 diff --git a/include/structs/str_dungeon_8042F6C.h b/include/structs/str_dungeon_8042F6C.h new file mode 100644 index 000000000..536d093e4 --- /dev/null +++ b/include/structs/str_dungeon_8042F6C.h @@ -0,0 +1,36 @@ +#ifndef GUARD_STR_DUNGEON_8042F6C_H +#define GUARD_STR_DUNGEON_8042F6C_H + +#include "structs/str_dungeon.h" +#include "structs/str_dungeon_location.h" +#include "structs/str_pokemon.h" +#include "structs/str_wonder_mail.h" + +struct UnkStruct_xxx_dungeon_8042F6C +{ + u8 unk0; + DungeonLocation unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u8 unkC; + u8 unkD; + u8 unkE; + u8 unkF; + u8 unk10; + u8 unk11; + unkStruct_Dungeon64C unk14; + PokemonStruct1 unk1C; + u8 *unk74; + Dungeon *unk78; + s16 unk7C; + u8 unk7E; + DungeonLocation unk80; + WonderMailSub unk84; +}; + +void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8); + +#endif // GUARD_STR_DUNGEON_8042F6C_H + diff --git a/include/structs/str_wonder_mail.h b/include/structs/str_wonder_mail.h index 101e96928..04f2bbd61 100644 --- a/include/structs/str_wonder_mail.h +++ b/include/structs/str_wonder_mail.h @@ -79,4 +79,4 @@ typedef struct WonderMailStruct_203B2C0_sub /* 0x30 */ PokemonStruct1 pokemon; } WonderMailStruct_203B2C0_sub; -#endif // GUARD_STR_WONDER_MAIL_H \ No newline at end of file +#endif // GUARD_STR_WONDER_MAIL_H diff --git a/src/code.c b/src/code.c index 2bff18715..fcb41a7a5 100644 --- a/src/code.c +++ b/src/code.c @@ -1,16 +1,276 @@ #include "global.h" +#include "structs/str_dungeon_8042F6C.h" +#include "structs/str_wonder_mail.h" +#include "code_80118A4.h" +#include "code_80A26CC.h" +#include "code_8099360.h" #include "event_flag.h" +#include "items.h" +#include "memory.h" +#include "pokemon.h" +#include "quick_save_read.h" +#include "quick_save_write.h" +#include "random.h" +#include "save.h" +#include "string_format.h" +#include "text_util.h" -extern void xxx_dungeon_8042F6C(u32 r0); extern void NDS_LoadOverlay_GroundMain(); extern u32 xxx_script_related_8098468(u32); +extern u8 sub_80992E0(s16 *, s16 *); +extern bool8 sub_8099328(u8 *dungeonId); +extern bool8 sub_8099360(u8 *); +extern u8 sub_8099394(u8 *); +extern void GeneratePelipperJobs(); +extern void sub_8043D50(s32 *a0, s32 *a1); +extern void xxx_update_stuff(u32); +extern void sub_80961B4(); +extern void sub_808ED00(); +extern void SetDungeonLocationInfo(DungeonLocation *dl); +extern void sub_808CE74(s16, bool32, u8*); + +void xxx_dungeon_8001340(struct UnkStruct_xxx_dungeon_8042F6C *r0); +void sub_80011E8(u8 *param_1); +void sub_809542C(WonderMailSub *param_1); + +struct unkTalkTable +{ + u32 unk0; + s16 species; +}; + +extern struct unkTalkTable gTalkKindTable[]; +extern struct unkTalkTable gBaseKindTable[]; + +// size: 0x30 +struct PersonalityRelated +{ + u8 fill0[4]; + s16 speciesID1; + s16 speciesID2; + u8 speciesName1[0x14]; + u8 speciesName2[0x14]; +}; +struct PersonalityRelated gPersonalityRelated_203B040; +extern u32 gUnknown_203B03C; + +void SaveLoadRelated_8000EDC(struct UnkStruct_xxx_dungeon_8042F6C *param_1) +{ + u8 quickSaveValid; + s32 quickSaveStatus; + s32 local_1c; // 0x4800 + s32 local_18; // sizeof(Dungeon) + + quickSaveValid = TRUE; + gUnknown_203B03C = 1; + sub_800A8F8(3); + sub_8014144(); + sub_8043D50(&local_1c,&local_18); + param_1->unk74 = MemoryAlloc(local_1c,7); // size: 0x4800 + param_1->unk78 = MemoryAlloc(local_18,7); // size: sizeof(Dungeon) + if (param_1->unk8) { + PrepareQuickSaveRead(param_1->unk74,local_1c); + while( TRUE ) { + if (!ReadQuickSave()) break; + xxx_update_stuff(0); + } + quickSaveValid = IsQuickSaveValid(); + FinishQuickSaveRead(); + sub_8011830(); + if (quickSaveValid) { + sub_80121E0(0xf1208); + } + else { + sub_80121E0(0xf1209); + } + xxx_call_start_bg_music(); + } + else { + GeneratePelipperJobs(); + sub_80961B4(); + sub_808ED00(); + } + if (quickSaveValid) { + xxx_dungeon_8001340(param_1); + sub_8099648(); + SetWindowBGColor(); + sub_8099690(0); + } + else { + param_1->unk7C = 5; + } + if (param_1->unk7C == -2) { + sub_809542C(¶m_1->unk84); + } + if ((param_1->unk7C == 3) || (param_1->unk7C == -2)) { + SetDungeonLocationInfo(¶m_1->unk80); + xxx_call_stop_bgm(); + if (param_1->unk7C == -2) { + PrepareQuickSaveWrite(param_1->unk74,local_1c,1); + } + else { + PrepareQuickSaveWrite(param_1->unk74,local_1c,0); + } + while ((quickSaveStatus = WriteQuickSave(), (quickSaveStatus != 2))) { + if (quickSaveStatus == 3) break; + if (quickSaveStatus == 1) { + MemoryFree(param_1->unk78); + MemoryFree(param_1->unk74); + } + xxx_update_stuff(0); + } + FinishQuickSaveWrite(); + } + else { + sub_808ED00(); + MemoryFree(param_1->unk78); + MemoryFree(param_1->unk74); + } +} + +void sub_8001024(struct PersonalityRelated *r0) +{ + *r0 = gPersonalityRelated_203B040; +} + +void sub_8001044(struct PersonalityRelated *r0) +{ + gPersonalityRelated_203B040 = *r0; +} + +void sub_8001064(void) +{ + struct unkTalkTable *psVar2; + u8 buffer2 [20]; + u8 buffer1 [20]; + + if (GetPlayerPokemonStruct() == NULL) { + if (gPersonalityRelated_203B040.speciesName1[0] == '\0') { + CopyMonsterNameToBuffer(buffer1,gPersonalityRelated_203B040.speciesID1); + CopyStringtoBuffer(buffer2,buffer1); + sub_808CE74(gPersonalityRelated_203B040.speciesID1,TRUE,buffer2); + } + else { + sub_808CE74(gPersonalityRelated_203B040.speciesID1,TRUE,gPersonalityRelated_203B040.speciesName1); + } + } + if (sub_808D378() == NULL) { + if (gPersonalityRelated_203B040.speciesName2[0] == '\0') { + CopyMonsterNameToBuffer(buffer1,gPersonalityRelated_203B040.speciesID2); + CopyStringtoBuffer(buffer2,buffer1); + sub_808CE74(gPersonalityRelated_203B040.speciesID2,FALSE,buffer2); + } + else { + sub_808CE74(gPersonalityRelated_203B040.speciesID2,FALSE,gPersonalityRelated_203B040.speciesName2); + } + } + if (gPersonalityRelated_203B040.speciesID1 != MONSTER_NONE) { + psVar2 = &gBaseKindTable[0]; + while ((psVar2->species != MONSTER_NONE && (gPersonalityRelated_203B040.speciesID1 != psVar2->species))) { + psVar2++; + } + SetScriptVarValue(NULL,BASE_KIND,psVar2->unk0); + } + if (gPersonalityRelated_203B040.speciesID2 != MONSTER_NONE) { + psVar2 = &gTalkKindTable[0]; + while ((psVar2->species != MONSTER_NONE && (gPersonalityRelated_203B040.speciesID2 != psVar2->species))) { + psVar2++; + } + SetScriptVarValue(NULL,PARTNER_TALK_KIND,psVar2->unk0); + } +} + +u8 sub_8001170(void) +{ + s16 local_10; + s16 auStack_e; + u8 dungeonID; + u8 auStack_b; + + dungeonID = 0x63; + if (sub_80992E0(&local_10,&auStack_e) != 0) { + dungeonID = sub_80A2740(local_10); + } + else { + if (!sub_8099328(&dungeonID) && (!sub_8099360(&dungeonID) && sub_8099394(&auStack_b) != 0)) { + dungeonID = 0x3F; + } + } + return dungeonID; +} + +void sub_80011CC(u8 *param_1,u8 param_2) +{ + u32 zero = 0; + param_1[0] = param_2; + param_1[1] = zero; + sub_80011E8(param_1); + param_1[0xb] = 0; + param_1[4] = 0; + param_1[0xc] = 0; + param_1[0xd] = 0; +} + +void sub_80011E8(u8 *param_1) +{ + param_1[5] = sub_80023E4(8); + param_1[6] = sub_80023E4(3); + param_1[8] = sub_80023E4(7); + param_1[9] = sub_80023E4(0); + param_1[10] = sub_80023E4(5); + if (sub_80023E4(0x18) && sub_80023E4(0x19) && sub_80023E4(0x1a)) { + param_1[7] = 1; + } + else { + param_1[7] = 0; + } +} + +void sub_8001248(void) +{ + s32 index; + s32 counter; + + for(index = 0; index < INVENTORY_SIZE; index++) + { + counter = RandInt(100); + if(counter < 50) + ZeroOutItem(&gTeamInventoryRef->teamItems[index]); + } + FillInventoryGaps(); + for(index = 0; index < NUM_MONSTERS; index++) + { + PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[index]; + if(PokemonFlag1(mon) && PokemonFlag2(mon)) + mon->heldItem.id = ITEM_NOTHING; + } + gTeamInventoryRef->teamMoney = 0; +} + +void sub_80012C0(void) +{ + s32 index; + + for(index = 0; index < INVENTORY_SIZE; index++) + { + ZeroOutItem(&gTeamInventoryRef->teamItems[index]); + } + FillInventoryGaps(); + for(index = 0; index < NUM_MONSTERS; index++) + { + PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[index]; + if(PokemonFlag1(mon) && PokemonFlag2(mon)) + mon->heldItem.id = ITEM_NOTHING; + } + gTeamInventoryRef->teamMoney = 0; +} void NDS_LoadOverlay_GroundMain() { } -void nullsub_2(u32 r0) +void nullsub_2(struct UnkStruct_xxx_dungeon_8042F6C *r0) { } @@ -20,7 +280,7 @@ u32 xxx_script_related_8001334(u32 r0) return xxx_script_related_8098468(r0); } -void xxx_dungeon_8001340(u32 r0) +void xxx_dungeon_8001340(struct UnkStruct_xxx_dungeon_8042F6C *r0) { nullsub_2(r0); xxx_dungeon_8042F6C(r0); diff --git a/src/code_8042B34.c b/src/code_8042B34.c index ee6f28b6f..a4ffb82b3 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -2,6 +2,7 @@ #include "dungeon_util_1.h" #include "memory.h" #include "structs/rgb.h" +#include "structs/str_dungeon_8042F6C.h" #include "code_803E46C.h" #include "code_800E9E4.h" #include "code_800DAC0.h" @@ -250,35 +251,6 @@ extern u8 gUnknown_203B40C; extern DungeonPos gUnknown_203B410; extern u8 *gSerializedData_203B41C; -struct Substruct_xxx_dungeon_8042F6C -{ - DungeonLocation a0; - u32 a4; -}; - -struct UnkStruct_xxx_dungeon_8042F6C -{ - u8 unk0; - DungeonLocation unk4; - u8 unk8; - u8 unk9; - u8 unkA; - u8 unkB; - u8 unkC; - u8 unkD; - u8 unkE; - u8 unkF; - u8 unk10; - u8 unk11; - unkStruct_Dungeon64C unk14; - PokemonStruct1 unk1C; - u8 *unk74; - Dungeon *unk78; - s16 unk7C; - u8 unk7E; - DungeonLocation unk80; - struct Substruct_xxx_dungeon_8042F6C unk84; -}; extern void sub_8040094(u8 r0); extern void sub_8068BDC(u8 r0); @@ -915,8 +887,8 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) r8->unk7C = -2; memset(&r8->unk84, 0, sizeof(r8->unk84)); r8->unk80 = gDungeon->unk644.dungeonLocation; - r8->unk84.a0 = gDungeon->unk644.dungeonLocation; - r8->unk84.a4 = gDungeon->unk644.unk38; + r8->unk84.dungeon = gDungeon->unk644.dungeonLocation; + r8->unk84.seed = gDungeon->unk644.unk38; } else { diff --git a/src/string_format.c b/src/string_format.c index fcd6b0938..4e4f5dd82 100644 --- a/src/string_format.c +++ b/src/string_format.c @@ -83,7 +83,7 @@ struct SubStruct_203B198 u16 unkC; // x3C u16 unkE; // x3E u16 unk10; // x40 - u8 fill12[0x48-0x42]; // x42 + u8 fill12[6]; // x42 }; struct UnkStruct_203B198 @@ -104,16 +104,42 @@ extern struct UnkStruct_203B198 gUnknown_203B198; extern UnkTextStruct1 gUnknown_2027370[4]; extern void (*gUnknown_203B088)(s32 a0); -extern const struct SubStruct_203B198 gUnknown_80D48AC; -extern const struct UnkTextStruct2 gUnknown_80D48DC; -extern const struct UnkTextStruct2 gUnknown_80D48C4; -extern const u32 gUnknown_80D48A0[]; -extern const u8 gUnknown_80D48F8[]; -extern const u8 gUnknown_80D4900[]; -extern const u8 gUnknown_80D4904[]; +static const u32 gUnknown_80D48A0[] = {0x7, 0x2, 0x2}; +static const struct SubStruct_203B198 gUnknown_80D48AC = { + 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 + +}; + +static const UnkTextStruct2 gUnknown_80D48C4 = { + 0x00, 0x00, 0x00, 0x00, + 0x00, + 0x02, 0x0F, + 0x1A, 0x05, + 0x07, 0x00, + NULL +}; + +static const UnkTextStruct2 gUnknown_80D48DC = { + 0x00, 0x00, 0x00, 0x00, + 0x02, + 0x02, 0x08, + 0x1A, 0x05, + 0x07, 0x00, + NULL +}; + + +ALIGNED(4) static const u8 sSpeakerNameSeparator[] = ": "; +ALIGNED(4) static const u8 sUnknownTeamName[] = "????"; +ALIGNED(4) static const u8 gUnknown_80D4900[] = "%d"; +ALIGNED(4) static const u8 gUnknown_80D4904[] = "%*d" ; extern const u8 gUnknown_80D4908[]; extern const u8 gUnknown_80D4910[]; -extern const u8 gSpeakerNameSeparator[]; extern void SetCharacterMask(int a0); extern void DisplayMonPortraitSprite(s32 a0, const u8 *compressedData, s32 a2); @@ -705,7 +731,7 @@ const u8 *FormatString(const u8 *str, u8 *dst, u8 *dstMax, u16 flags) r9 = FALSE; if (flags & 8) { AppendString(gSpeakerNameBuffer, &dst, dstMax, flags); - AppendString(gSpeakerNameSeparator, &dst, dstMax, flags); + AppendString(sSpeakerNameSeparator, &dst, dstMax, flags); } } else if (r9) { @@ -759,7 +785,7 @@ const u8 *FormatString(const u8 *str, u8 *dst, u8 *dstMax, u16 flags) sub_80920D8(sFormatBuffer_TeamName); } else { - strcpy(sFormatBuffer_TeamName, gUnknown_80D48F8); // ???? + strcpy(sFormatBuffer_TeamName, sUnknownTeamName); // ???? } txtPtr = sFormatBuffer_TeamName; break; From 073a207c0e045c94e895981a17cab075deb4d179 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sat, 14 Dec 2024 09:08:41 -0800 Subject: [PATCH 19/23] remove extra variable --- src/code.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/code.c b/src/code.c index fcb41a7a5..207672504 100644 --- a/src/code.c +++ b/src/code.c @@ -229,12 +229,10 @@ void sub_80011E8(u8 *param_1) void sub_8001248(void) { s32 index; - s32 counter; for(index = 0; index < INVENTORY_SIZE; index++) { - counter = RandInt(100); - if(counter < 50) + if(RandInt(100) < 50) ZeroOutItem(&gTeamInventoryRef->teamItems[index]); } FillInventoryGaps(); From cd2c46d027e31a2126ebe89c305a68b0d92b53f9 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sun, 15 Dec 2024 10:08:16 -0800 Subject: [PATCH 20/23] finish off pokemon_3.s thanks to @DizzyEggg --- asm/pokemon_3.s | 1001 ---------------------------------------- include/code_8024458.h | 4 +- include/pokemon_3.h | 40 +- ld_script.txt | 1 - src/code_8024458.c | 4 +- src/pokemon_3.c | 910 ++++++++++++++++++++++++++++++++++++ 6 files changed, 950 insertions(+), 1010 deletions(-) delete mode 100644 asm/pokemon_3.s diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s deleted file mode 100644 index 8a2481a24..000000000 --- a/asm/pokemon_3.s +++ /dev/null @@ -1,1001 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start CreatePokemonInfoTabScreen -CreatePokemonInfoTabScreen: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - adds r5, r0, 0 - adds r4, r1, 0 - mov r10, r2 - str r3, [sp, 0x2C] - ldr r0, [sp, 0x50] - bl sub_80073B8 - ldr r0, _0808F880 - mov r1, r10 - adds r1, 0x2 - movs r2, 0x14 - bl strncpy - movs r0, 0x20 - mov r9, r0 - cmp r5, 0x5 - bls _0808F874 - b _0808FED6 -_0808F874: - lsls r0, r5, 2 - ldr r1, _0808F884 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_0808F880: .4byte gFormatBuffer_Monsters -_0808F884: .4byte _0808F888 - .align 2, 0 -_0808F888: - .4byte _0808FED6 - .4byte _0808FBF4 - .4byte _0808F8A0 - .4byte _0808FB44 - .4byte _0808FCB0 - .4byte _0808FDB0 -_0808F8A0: - lsls r0, r4, 3 - adds r0, 0x10 - ldr r2, _0808F998 - movs r5, 0 - str r5, [sp] - movs r1, 0 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - ldr r4, _0808F99C - mov r1, r10 - ldr r0, [r1, 0x2C] - str r0, [r4] - ldr r0, [r1, 0x30] - str r0, [r4, 0x4] - ldr r0, _0808F9A0 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r2, 0xA - add r9, r2 - ldr r0, _0808F9A4 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r3, 0xA - add r9, r3 - mov r0, r10 - ldr r2, [r0, 0x2C] - cmp r2, 0x63 - bgt _0808F914 - movs r3, 0 - ldrsh r1, [r0, r3] - adds r2, 0x1 - add r0, sp, 0x8 - bl GetPokemonLevelData - ldr r0, [sp, 0x8] - mov r2, r10 - ldr r1, [r2, 0x30] - subs r0, r1 - str r0, [r4] - ldr r0, _0808F9A8 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow -_0808F914: - movs r3, 0xC - add r9, r3 - mov r1, r10 - ldr r0, [r1, 0x24] - str r0, [r4] - ldr r0, [r1, 0x28] - str r0, [r4, 0x4] - ldr r0, _0808F9AC - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r2, 0xA - add r9, r2 - ldr r0, _0808F9B0 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - ldr r0, _0808F9B4 - ldr r2, [r0] - mov r0, r10 - adds r0, 0x34 - ldrb r3, [r0] - str r3, [r4] - mov r1, r10 - adds r1, 0x39 - ldrb r0, [r1] - cmp r0, 0 - beq _0808F964 - adds r0, r3, r0 - str r0, [r4] - ldr r0, _0808F9B8 - ldr r2, [r0] -_0808F964: - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - mov r1, r10 - adds r1, 0x3B - ldrb r3, [r1] - cmp r3, 0 - beq _0808F9C0 - mov r0, r10 - adds r0, 0x36 - ldrb r0, [r0] - adds r1, r3, 0 - adds r0, r1 - str r0, [r4] - ldr r0, _0808F9BC - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - b _0808F9D8 - .align 2, 0 -_0808F998: .4byte gUnknown_8107754 -_0808F99C: .4byte gFormatArgs -_0808F9A0: .4byte gLevel810DD6C_Ptr -_0808F9A4: .4byte gExpPts810DD9C_Ptr -_0808F9A8: .4byte gUnknown_810DDB8 -_0808F9AC: .4byte gUnknown_810DDD0 -_0808F9B0: .4byte gUnknown_810DDE4 -_0808F9B4: .4byte gUnknown_810DE0C -_0808F9B8: .4byte gUnknown_810DE20 -_0808F9BC: .4byte gUnknown_810DE4C -_0808F9C0: - mov r0, r10 - adds r0, 0x36 - ldrb r0, [r0] - str r0, [r4] - ldr r0, _0808FA44 - ldr r2, [r0] - str r3, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow -_0808F9D8: - movs r3, 0xA - add r9, r3 - ldr r0, _0808FA48 - ldr r2, [r0] - movs r5, 0 - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - ldr r0, _0808FA4C - ldr r2, [r0] - ldr r4, _0808FA50 - mov r0, r10 - adds r0, 0x35 - ldrb r3, [r0] - str r3, [r4] - mov r1, r10 - adds r1, 0x3A - ldrb r0, [r1] - cmp r0, 0 - beq _0808FA0E - adds r0, r3, r0 - str r0, [r4] - ldr r0, _0808FA54 - ldr r2, [r0] -_0808FA0E: - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - mov r1, r10 - adds r1, 0x3C - ldrb r3, [r1] - cmp r3, 0 - beq _0808FA5C - mov r0, r10 - adds r0, 0x37 - ldrb r0, [r0] - adds r1, r3, 0 - adds r0, r1 - str r0, [r4] - ldr r0, _0808FA58 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - b _0808FA74 - .align 2, 0 -_0808FA44: .4byte gUnknown_810DE38 -_0808FA48: .4byte gUnknown_810DDFC -_0808FA4C: .4byte gUnknown_810DE24 -_0808FA50: .4byte gFormatArgs -_0808FA54: .4byte gUnknown_810DE28 -_0808FA58: .4byte gUnknown_810DE54 -_0808FA5C: - mov r0, r10 - adds r0, 0x37 - ldrb r0, [r0] - str r0, [r4] - ldr r0, _0808FA94 - ldr r2, [r0] - str r3, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow -_0808FA74: - movs r0, 0xA - add r9, r0 - mov r2, r10 - adds r2, 0x20 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808FA9C - ldr r0, _0808FA98 - adds r1, r2, 0 - movs r2, 0 - bl sub_8090E14 - b _0808FAA6 - .align 2, 0 -_0808FA94: .4byte gUnknown_810DE50 -_0808FA98: .4byte gFormatBuffer_Items -_0808FA9C: - ldr r0, _0808FB24 - ldr r1, _0808FB28 - ldr r1, [r1] - bl strcpy -_0808FAA6: - ldr r0, _0808FB2C - ldr r2, [r0] - movs r4, 0 - str r4, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r1, 0xC - add r9, r1 - ldr r1, _0808FB30 - mov r2, r10 - movs r3, 0x3E - ldrsh r0, [r2, r3] - str r0, [r1] - movs r1, 0x3E - ldrsh r0, [r2, r1] - movs r1, 0xA - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0808FADA - movs r0, 0 -_0808FADA: - cmp r0, 0x62 - ble _0808FAE0 - movs r0, 0x63 -_0808FAE0: - ldr r1, _0808FB34 - lsls r0, 2 - adds r0, r1 - ldr r5, _0808FB38 - ldr r1, [r0] - adds r0, r5, 0 - bl strcpy - ldr r0, _0808FB3C - ldr r2, [r0] - str r4, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r2, 0xA - add r9, r2 - mov r0, r10 - adds r0, 0x38 - ldrb r4, [r0] - cmp r4, 0 - beq _0808FB10 - b _0808FED6 -_0808FB10: - adds r0, 0x1C - ldrb r1, [r0] - adds r0, r5, 0 - bl CopyTacticsNameToBuffer - ldr r0, _0808FB40 - ldr r2, [r0] - str r4, [sp] - b _0808FECC - .align 2, 0 -_0808FB24: .4byte gFormatBuffer_Items -_0808FB28: .4byte gUnknown_810DE58 -_0808FB2C: .4byte gUnknown_810DE6C -_0808FB30: .4byte gFormatArgs -_0808FB34: .4byte gUnknown_8115718 -_0808FB38: .4byte gFormatBuffer_Monsters -_0808FB3C: .4byte gUnknown_810DE80 -_0808FB40: .4byte gUnknown_810DE98 -_0808FB44: - lsls r0, r4, 3 - adds r0, 0x10 - ldr r2, _0808FBE8 - movs r4, 0 - str r4, [sp] - movs r1, 0 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - ldr r2, _0808FBEC - str r4, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - mov r3, r10 - ldrb r0, [r3, 0x16] - bl GetFormattedTypeString - adds r2, r0, 0 - str r4, [sp] - movs r0, 0x38 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - mov r1, r10 - ldrb r0, [r1, 0x17] - cmp r0, 0 - beq _0808FB94 - bl GetFormattedTypeString - adds r2, r0, 0 - str r4, [sp] - movs r0, 0x60 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow -_0808FB94: - movs r2, 0xC - add r9, r2 - ldr r2, _0808FBF0 - str r4, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r3, 0xC - add r9, r3 - mov r1, r10 - ldrb r0, [r1, 0x18] - bl GetAbilityDescription - adds r2, r0, 0 - str r4, [sp] - movs r5, 0xB - str r5, [sp, 0x4] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow2 - movs r2, 0x21 - add r9, r2 - mov r3, r10 - ldrb r0, [r3, 0x19] - cmp r0, 0 - bne _0808FBD2 - b _0808FED6 -_0808FBD2: - bl GetAbilityDescription - adds r2, r0, 0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow2 - b _0808FED6 - .align 2, 0 -_0808FBE8: .4byte gUnknown_810775C -_0808FBEC: .4byte gUnknown_8107768 -_0808FBF0: .4byte gUnknown_8107770 -_0808FBF4: - lsls r0, r4, 3 - adds r0, 0x10 - ldr r1, _0808FC34 - ldr r2, [r1] - movs r1, 0 - str r1, [sp] - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - mov r0, r10 - adds r0, 0x56 - movs r1, 0 - ldrsh r0, [r0, r1] - subs r5, r0, 0x1 - movs r2, 0xC - negs r2, r2 - add r9, r2 - movs r7, 0 - ldr r6, [sp, 0x2C] - adds r6, 0xC - adds r1, r6, 0 - movs r2, 0 - ldr r0, [sp, 0x2C] - adds r0, 0x2C -_0808FC24: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _0808FC24 - movs r3, 0 - mov r8, r3 - b _0808FC88 - .align 2, 0 -_0808FC34: .4byte gUnknown_810DD58 -_0808FC38: - mov r0, r10 - adds r0, 0x58 - adds r4, r0, r5 - ldrb r0, [r4] - cmp r0, 0 - beq _0808FC78 - movs r7, 0x1 - ldr r0, _0808FCA0 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, _0808FCA4 - ldr r1, [r1] - movs r2, 0x50 - bl strncpy - ldr r2, _0808FCA8 - movs r0, 0 - str r0, [sp] - movs r0, 0xC - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - mov r0, r8 - cmp r0, 0 - ble _0808FC78 - subs r0, 0x1 - lsls r0, 2 - adds r0, r6, r0 - ldrb r1, [r4] - str r1, [r0] -_0808FC78: - movs r1, 0x1 - add r8, r1 - adds r5, 0x1 - movs r2, 0xC - add r9, r2 - mov r3, r8 - cmp r3, 0x9 - bgt _0808FC90 -_0808FC88: - cmp r5, 0 - blt _0808FC78 - cmp r5, 0xB - ble _0808FC38 -_0808FC90: - cmp r7, 0 - beq _0808FC96 - b _0808FED6 -_0808FC96: - ldr r0, _0808FCAC - ldr r2, [r0] - str r7, [sp] - b _0808FD98 - .align 2, 0 -_0808FCA0: .4byte gStatusNames -_0808FCA4: .4byte gFormatBuffer_Items + 0x50 -_0808FCA8: .4byte gUnknown_8107784 -_0808FCAC: .4byte gUnknown_810DF78 -_0808FCB0: - lsls r0, r4, 3 - adds r0, 0x10 - ldr r1, _0808FCF8 - ldr r2, [r1] - movs r1, 0 - str r1, [sp] - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - add r4, sp, 0x14 - mov r0, r10 - movs r2, 0x3E - ldrsh r1, [r0, r2] - adds r0, r4, 0 - bl GetNumAvailableIQSkills - mov r0, r10 - adds r0, 0x40 - movs r3, 0 - ldrsh r0, [r0, r3] - subs r7, r0, 0x1 - mov r1, r9 - subs r1, 0xC - movs r2, 0 - ldr r0, [sp, 0x2C] - adds r0, 0x8 -_0808FCE4: - strb r2, [r0] - subs r0, 0x1 - ldr r3, [sp, 0x2C] - cmp r0, r3 - bge _0808FCE4 - mov r9, r1 - movs r4, 0 - mov r8, r4 - b _0808FD84 - .align 2, 0 -_0808FCF8: .4byte gIQSkill810DD68_Ptr -_0808FCFC: - mov r5, sp - adds r5, r7 - adds r5, 0x14 - ldrb r0, [r5] - cmp r0, 0 - beq _0808FD74 - movs r4, 0x1 - bl GetIQSkillName - adds r1, r0, 0 - ldr r6, _0808FD3C - adds r0, r6, 0 - movs r2, 0x50 - bl strncpy - mov r0, r10 - adds r0, 0x50 - adds r1, r4, 0 - ldrb r5, [r5] - lsls r1, r5 - bl IsIQSkillSet - lsls r0, 24 - cmp r0, 0 - beq _0808FD44 - adds r0, r6, 0 - subs r0, 0x50 - ldr r1, _0808FD40 - bl strcpy - b _0808FD4E - .align 2, 0 -_0808FD3C: .4byte gFormatBuffer_Items + 0x50 -_0808FD40: .4byte gUnknown_8107788 -_0808FD44: - adds r0, r6, 0 - subs r0, 0x50 - ldr r1, _0808FDA4 - bl strcpy -_0808FD4E: - mov r0, r8 - cmp r0, 0 - ble _0808FD64 - subs r0, 0x1 - ldr r1, [sp, 0x2C] - adds r0, r1, r0 - mov r1, sp - adds r1, r7 - adds r1, 0x14 - ldrb r1, [r1] - strb r1, [r0] -_0808FD64: - ldr r2, _0808FDA8 - movs r0, 0 - str r0, [sp] - movs r0, 0xC - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow -_0808FD74: - movs r2, 0x1 - add r8, r2 - adds r7, 0x1 - movs r3, 0xC - add r9, r3 - mov r0, r8 - cmp r0, 0x9 - bgt _0808FD8C -_0808FD84: - cmp r7, 0 - blt _0808FD74 - cmp r7, 0x17 - ble _0808FCFC -_0808FD8C: - cmp r4, 0 - beq _0808FD92 - b _0808FED6 -_0808FD92: - ldr r0, _0808FDAC - ldr r2, [r0] - str r4, [sp] -_0808FD98: - movs r0, 0xC - movs r1, 0x20 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - b _0808FED6 - .align 2, 0 -_0808FDA4: .4byte gUnknown_810778C -_0808FDA8: .4byte gUnknown_8107790 -_0808FDAC: .4byte gUnknown_810DF84 -_0808FDB0: - lsls r0, r4, 3 - adds r0, 0x10 - ldr r2, _0808FEEC - movs r5, 0 - str r5, [sp] - movs r1, 0 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - ldr r6, _0808FEF0 - mov r2, r10 - movs r3, 0 - ldrsh r1, [r2, r3] - adds r0, r6, 0 - bl CopyMonsterNameToBuffer - ldr r1, _0808FEF4 - mov r2, r10 - movs r3, 0 - ldrsh r0, [r2, r3] - str r0, [r1] - ldr r0, _0808FEF8 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r0, 0xA - add r9, r0 - mov r1, r10 - movs r2, 0 - ldrsh r0, [r1, r2] - bl GetFriendArea - lsls r0, 24 - lsrs r0, 24 - bl GetFriendAreaName - adds r1, r0, 0 - ldr r4, _0808FEFC - adds r0, r4, 0 - movs r2, 0x50 - bl strncpy - ldr r0, _0808FF00 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r3, 0xA - add r9, r3 - ldr r0, _0808FF04 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r0, 0xD - add r9, r0 - ldr r0, _0808FF08 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r1, 0xA - add r9, r1 - mov r1, r10 - adds r1, 0x1C - adds r0, r4, 0 - bl PrintYellowDungeonNametoBuffer - ldr r0, _0808FF0C - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r2, 0xD - add r9, r2 - mov r3, r10 - movs r1, 0 - ldrsh r0, [r3, r1] - bl GetCategoryString - adds r1, r0, 0 - adds r0, r6, 0 - movs r2, 0x14 - bl strncpy - ldr r0, _0808FF10 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r2, 0xD - add r9, r2 - ldr r4, _0808FF14 - mov r3, r10 - movs r1, 0 - ldrsh r0, [r3, r1] - bl GetBodySize - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r1, [r0] - adds r0, r6, 0 - bl strcpy - ldr r0, _0808FF18 - ldr r2, [r0] - str r5, [sp] - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow - movs r2, 0xD - add r9, r2 - ldr r1, _0808FF1C - mov r0, r10 - adds r0, 0x4C - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - str r5, [sp] -_0808FECC: - movs r0, 0x4 - mov r1, r9 - ldr r3, [sp, 0x50] - bl PrintFormattedStringOnWindow -_0808FED6: - ldr r0, [sp, 0x50] - bl sub_80073E0 - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_0808FEEC: .4byte gUnknown_8107798 -_0808FEF0: .4byte gFormatBuffer_Monsters -_0808FEF4: .4byte gFormatArgs -_0808FEF8: .4byte gUnknown_810DEB4 -_0808FEFC: .4byte gFormatBuffer_Items -_0808FF00: .4byte gUnknown_810DEC8 -_0808FF04: .4byte gUnknown_810DEDC -_0808FF08: .4byte gUnknown_810DFB4 -_0808FF0C: .4byte gUnknown_810DFC8 -_0808FF10: .4byte gUnknown_810DEF4 -_0808FF14: .4byte gUnknown_810E02C -_0808FF18: .4byte gUnknown_810DF98 -_0808FF1C: .4byte gEvolutionStrings - thumb_func_end CreatePokemonInfoTabScreen - - thumb_func_start sub_808FF20 -sub_808FF20: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - adds r0, r5, 0x2 - movs r2, 0 - bl PrintColoredPokeNameToBuffer - ldrh r0, [r6, 0x8] - strh r0, [r5] - movs r1, 0x16 - ldrsh r0, [r6, r1] - str r0, [r5, 0x24] - str r0, [r5, 0x28] - ldrb r0, [r6, 0x3] - str r0, [r5, 0x2C] - ldr r0, [r6, 0x1C] - str r0, [r5, 0x30] - movs r4, 0 -_0808FF50: - adds r1, r5, 0 - adds r1, 0x34 - adds r1, r4 - adds r0, r6, 0 - adds r0, 0x18 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r5, 0 - adds r1, 0x36 - adds r1, r4 - adds r0, r6, 0 - adds r0, 0x1A - adds r0, r4 - ldrb r0, [r0] - strb r0, [r1] - movs r7, 0x8 - ldrsh r0, [r6, r7] - adds r1, r4, 0 - bl GetPokemonType - adds r1, r5, 0 - adds r1, 0x16 - adds r1, r4 - strb r0, [r1] - movs r1, 0x8 - ldrsh r0, [r6, r1] - adds r1, r4, 0 - bl GetPokemonAbility - adds r1, r5, 0 - adds r1, 0x18 - adds r1, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x1 - ble _0808FF50 - ldrb r2, [r6, 0x2] - adds r1, r5, 0 - adds r1, 0x38 - movs r0, 0 - strb r2, [r1] - adds r2, r5, 0 - adds r2, 0x39 - strb r0, [r2] - adds r3, r5, 0 - adds r3, 0x3A - strb r0, [r3] - movs r7, 0x3B - adds r7, r5 - mov r12, r7 - strb r0, [r7] - movs r1, 0x3C - adds r1, r5 - mov r9, r1 - strb r0, [r1] - adds r0, r6, 0 - adds r0, 0x28 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0 - beq _08090026 - cmp r1, 0x13 - bne _0808FFDA - ldr r0, _08090060 - ldrb r0, [r0] - ldrb r7, [r2] - adds r0, r7 - strb r0, [r2] -_0808FFDA: - ldrb r1, [r4] - cmp r1, 0x21 - bne _0808FFEA - ldr r0, _08090064 - ldrb r0, [r0] - ldrb r7, [r3] - adds r0, r7 - strb r0, [r3] -_0808FFEA: - cmp r1, 0x2B - bne _0808FFFE - ldr r0, _08090068 - ldrb r0, [r0] - ldrb r7, [r2] - adds r1, r0, r7 - strb r1, [r2] - ldrb r1, [r3] - adds r0, r1 - strb r0, [r3] -_0808FFFE: - ldrb r0, [r4] - cmp r0, 0x1E - bne _08090012 - ldr r0, _0809006C - ldrb r0, [r0] - mov r2, r12 - ldrb r2, [r2] - adds r0, r2 - mov r7, r12 - strb r0, [r7] -_08090012: - ldrb r0, [r4] - cmp r0, 0x22 - bne _08090026 - ldr r0, _08090070 - ldrb r0, [r0] - mov r1, r9 - ldrb r1, [r1] - adds r0, r1 - mov r2, r9 - strb r0, [r2] -_08090026: - adds r0, r6, 0 - adds r0, 0x24 - ldrb r1, [r0] - adds r0, r5, 0 - adds r0, 0x54 - strb r1, [r0] - subs r0, 0x34 - adds r1, r4, 0 - bl HeldItemToSlot - ldrh r0, [r6, 0x14] - strh r0, [r5, 0x3E] - ldr r0, [r6, 0x4] - str r0, [r5, 0x1C] - ldr r0, [r6, 0xC] - str r0, [r5, 0x44] - ldr r0, [r6, 0x10] - str r0, [r5, 0x48] - ldr r0, [r6, 0x20] - str r0, [r5, 0x50] - mov r7, r8 - cmp r7, 0 - beq _08090074 - adds r0, r6, 0 - bl sub_808F700 - adds r1, r5, 0 - adds r1, 0x4C - b _0809007A - .align 2, 0 -_08090060: .4byte gUnknown_810AC60 -_08090064: .4byte gUnknown_810AC62 -_08090068: .4byte gUnknown_810AC68 -_0809006C: .4byte gUnknown_810AC64 -_08090070: .4byte gUnknown_810AC66 -_08090074: - adds r1, r5, 0 - adds r1, 0x4C - movs r0, 0x3 -_0809007A: - strb r0, [r1] - adds r1, r5, 0 - adds r1, 0x58 - movs r2, 0 - adds r0, r5, 0 - adds r0, 0x63 -_08090086: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _08090086 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808FF20 - - .align 2,0 diff --git a/include/code_8024458.h b/include/code_8024458.h index 865bc5d5f..f9f50961d 100644 --- a/include/code_8024458.h +++ b/include/code_8024458.h @@ -4,6 +4,7 @@ #include "structs/menu.h" #include "structs/str_text.h" +#include "pokemon_3.h" struct unkStruct_203B2AC { @@ -11,8 +12,7 @@ struct unkStruct_203B2AC u32 unk34[3]; u8 unk40[0x48 - 0x40]; s16 speciesNum; - u32 unk4C; - u8 unk50[0xB0 - 0x50]; + struct unkStruct_808FF20 unk4C; u32 unkB0; u8 fillB4[0xE0 - 0xB4]; u32 unkE0; diff --git a/include/pokemon_3.h b/include/pokemon_3.h index dbda724fe..436a5ad73 100644 --- a/include/pokemon_3.h +++ b/include/pokemon_3.h @@ -15,6 +15,40 @@ typedef struct EvolveStatus /* 0x6 */ s16 targetEvolveSpecies; } EvolveStatus; +struct unkStruct_808FF20 +{ + // size: 0x64 + s16 species; + u8 nameBuffer[0x14]; + u8 types[2]; // 0x16 + u8 abilities[2]; // 0x18 + u8 fill1A[0x1C - 0x1A]; + DungeonLocation dungeonLocation; // 0x1C + Item item; // 0x20 + s32 HP1; + s32 HP2; + s32 level; + u32 exp; + Offense offense; + bool8 isTeamLeader; + u8 atkBoost; + u8 spAtkBoost; + u8 defBoost; + u8 spDefBoost; + u8 fill3D; + s16 IQ; // 0x3E + s16 unk40; + s16 fill42; + struct unkPokeSubStruct_C unk44[2]; + u8 unk4C; + u8 fill4D[3]; + IqSkillFlags IQSkills; // 0x50 + u8 tactic; + u8 fill55[1]; + s16 unk56; + u8 unk58[12]; +}; + bool8 HasRecruitedMon(s16 species); s16 GetBaseSpecies(s16 index); s16 GetBaseSpeciesNoUnown(s16 index); @@ -36,9 +70,7 @@ s16 ExtractSpeciesIndex(UnkDungeonGlobal_unk1CD98 *r0); void SetSpeciesLevelToExtract(UnkDungeonGlobal_unk1CD98 *r0, s32 level, s32 species); s32 ExtractLevel(UnkDungeonGlobal_unk1CD98 *r0); PokemonStruct1 *sub_808F798(PokemonStruct1 *pokemon, short _species); - -// pokemon_3.s -extern void CreatePokemonInfoTabScreen(u32, s16, u32 *, u32 *, u32); -extern void sub_808FF20(u32 *, PokemonStruct1 *, bool8); +void CreatePokemonInfoTabScreen(u32, s32, struct unkStruct_808FF20 *, u8 *, u32); +void sub_808FF20(struct unkStruct_808FF20 *param_1, struct PokemonStruct1 *pokemon, bool8 param_3); #endif // GUARD_POKEMON_3_H diff --git a/ld_script.txt b/ld_script.txt index 930594965..c8719c443 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -288,7 +288,6 @@ SECTIONS { src/pokemon.o(.text); asm/pokemon_2.o(.text); src/pokemon_3.o(.text); - asm/pokemon_3.o(.text); src/dungeon.o(.text); asm/dungeon_2.o(.text); src/dungeon_2_1.o(.text); diff --git a/src/code_8024458.c b/src/code_8024458.c index a900360a5..c7c4915df 100644 --- a/src/code_8024458.c +++ b/src/code_8024458.c @@ -83,13 +83,13 @@ static void sub_8024588(void) static void sub_80245D0(void) { - CreatePokemonInfoTabScreen(sUnknown_203B2AC->unk34[sUnknown_203B2AC->input.unk1E], sUnknown_203B2AC->input.unk1E, &sUnknown_203B2AC->unk4C, &sUnknown_203B2AC->unkB0, sUnknown_203B2AC->unkE0); + CreatePokemonInfoTabScreen(sUnknown_203B2AC->unk34[sUnknown_203B2AC->input.unk1E], sUnknown_203B2AC->input.unk1E, &sUnknown_203B2AC->unk4C, (u8 *)&sUnknown_203B2AC->unkB0, sUnknown_203B2AC->unkE0); } static void sub_8024604(void) { PokemonStruct1 *pokeStruct; - u32 *iVar3; + struct unkStruct_808FF20 *iVar3; sUnknown_203B2AC->unk34[0] = 2; sUnknown_203B2AC->unk34[1] = 3; diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 9dc2b1145..cf84f4f07 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -2,6 +2,7 @@ #include "pokemon.h" #include "pokemon_3.h" #include "random.h" +#include "constants/colors.h" #include "constants/dungeon.h" #include "constants/evolve_type.h" #include "constants/evolution_status.h" @@ -41,6 +42,48 @@ extern s16 gUnknown_810AC62; // 0xC extern s16 gUnknown_810AC68; // 0x8 extern s16 gUnknown_810AC64; // 0x8 extern s16 gUnknown_810AC66; // 0x8 +extern u8 *gUnknown_810DD58[]; +extern u8 *gEvolutionStrings[]; +extern u8 *gExpPts810DD9C_Ptr[]; +extern u8 *gIQSkill810DD68_Ptr[]; +extern u8 *gLevel810DD6C_Ptr[]; +extern u8 *gStatusNames[]; +extern u8 gUnknown_8107754[]; +extern u8 gUnknown_810775C[]; +extern u8 gUnknown_8107768[]; +extern u8 gUnknown_8107770[]; +extern u8 gUnknown_8107784[]; +extern u8 gUnknown_8107788[]; +extern u8 gUnknown_810778C[]; +extern u8 gUnknown_8107790[]; +extern u8 gUnknown_8107798[]; +extern u8 *gUnknown_810DDB8[]; +extern u8 *gUnknown_810DDD0[]; +extern u8 *gUnknown_810DDE4[]; +extern u8 *gUnknown_810DDFC[]; +extern u8 *gUnknown_810DE0C[]; +extern u8 *gUnknown_810DE20[]; +extern u8 *gUnknown_810DE24[]; +extern u8 *gUnknown_810DE28[]; +extern u8 *gUnknown_810DE38[]; +extern u8 *gUnknown_810DE4C[]; +extern u8 *gUnknown_810DE50[]; +extern u8 *gUnknown_810DE54[]; +extern u8 *gUnknown_810DE58[]; +extern u8 *gUnknown_810DE6C[]; +extern u8 *gUnknown_810DE80[]; +extern u8 *gUnknown_810DE98[]; +extern u8 *gUnknown_810DEB4[]; +extern u8 *gUnknown_810DEC8[]; +extern u8 *gUnknown_810DEDC[]; +extern u8 *gUnknown_810DEF4[]; +extern u8 *gUnknown_810DF78[]; +extern u8 *gUnknown_810DF84[]; +extern u8 *gUnknown_810DF98[]; +extern u8 *gUnknown_810DFB4[]; +extern u8 *gUnknown_810DFC8[]; +extern u8 *gUnknown_810E02C[]; +extern u8 *gUnknown_8115718[]; // 2, 4, 6, 7, 8, 9, 0xA, 0xD, 0xF, 0x11 extern s32 gUnknown_810AC90[10]; @@ -1160,3 +1203,870 @@ UNUSED void sub_808F83C(PokemonStruct1 *pokemon, s16 species, u8 *r2) { *r2 = 0; } + + +// https://decomp.me/scratch/qONOW - 91.59% matched (Seth) +NAKED +void CreatePokemonInfoTabScreen(u32 param_1, s32 param_2, struct unkStruct_808FF20 *param_3, u8 *param_4, u32 param_5) +{ + asm_unified( +" push {r4-r7,lr}\n" +" mov r7, r10\n" +" mov r6, r9\n" +" mov r5, r8\n" +" push {r5-r7}\n" +" sub sp, 0x30\n" +" adds r5, r0, 0\n" +" adds r4, r1, 0\n" +" mov r10, r2\n" +" str r3, [sp, 0x2C]\n" +" ldr r0, [sp, 0x50]\n" +" bl sub_80073B8\n" +" ldr r0, _0808F880\n" +" mov r1, r10\n" +" adds r1, 0x2\n" +" movs r2, 0x14\n" +" bl strncpy\n" +" movs r0, 0x20\n" +" mov r9, r0\n" +" cmp r5, 0x5\n" +" bls _0808F874\n" +" b _0808FED6\n" +"_0808F874:\n" +" lsls r0, r5, 2\n" +" ldr r1, _0808F884\n" +" adds r0, r1\n" +" ldr r0, [r0]\n" +" mov pc, r0\n" +" .align 2, 0\n" +"_0808F880: .4byte gFormatBuffer_Monsters\n" +"_0808F884: .4byte _0808F888\n" +" .align 2, 0\n" +"_0808F888:\n" +" .4byte _0808FED6\n" +" .4byte _0808FBF4\n" +" .4byte _0808F8A0\n" +" .4byte _0808FB44\n" +" .4byte _0808FCB0\n" +" .4byte _0808FDB0\n" +"_0808F8A0:\n" +" lsls r0, r4, 3\n" +" adds r0, 0x10\n" +" ldr r2, _0808F998\n" +" movs r5, 0\n" +" str r5, [sp]\n" +" movs r1, 0\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" ldr r4, _0808F99C\n" +" mov r1, r10\n" +" ldr r0, [r1, 0x2C]\n" +" str r0, [r4]\n" +" ldr r0, [r1, 0x30]\n" +" str r0, [r4, 0x4]\n" +" ldr r0, _0808F9A0\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r2, 0xA\n" +" add r9, r2\n" +" ldr r0, _0808F9A4\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r3, 0xA\n" +" add r9, r3\n" +" mov r0, r10\n" +" ldr r2, [r0, 0x2C]\n" +" cmp r2, 0x63\n" +" bgt _0808F914\n" +" movs r3, 0\n" +" ldrsh r1, [r0, r3]\n" +" adds r2, 0x1\n" +" add r0, sp, 0x8\n" +" bl GetPokemonLevelData\n" +" ldr r0, [sp, 0x8]\n" +" mov r2, r10\n" +" ldr r1, [r2, 0x30]\n" +" subs r0, r1\n" +" str r0, [r4]\n" +" ldr r0, _0808F9A8\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +"_0808F914:\n" +" movs r3, 0xC\n" +" add r9, r3\n" +" mov r1, r10\n" +" ldr r0, [r1, 0x24]\n" +" str r0, [r4]\n" +" ldr r0, [r1, 0x28]\n" +" str r0, [r4, 0x4]\n" +" ldr r0, _0808F9AC\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r2, 0xA\n" +" add r9, r2\n" +" ldr r0, _0808F9B0\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" ldr r0, _0808F9B4\n" +" ldr r2, [r0]\n" +" mov r0, r10\n" +" adds r0, 0x34\n" +" ldrb r3, [r0]\n" +" str r3, [r4]\n" +" mov r1, r10\n" +" adds r1, 0x39\n" +" ldrb r0, [r1]\n" +" cmp r0, 0\n" +" beq _0808F964\n" +" adds r0, r3, r0\n" +" str r0, [r4]\n" +" ldr r0, _0808F9B8\n" +" ldr r2, [r0]\n" +"_0808F964:\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" mov r1, r10\n" +" adds r1, 0x3B\n" +" ldrb r3, [r1]\n" +" cmp r3, 0\n" +" beq _0808F9C0\n" +" mov r0, r10\n" +" adds r0, 0x36\n" +" ldrb r0, [r0]\n" +" adds r1, r3, 0\n" +" adds r0, r1\n" +" str r0, [r4]\n" +" ldr r0, _0808F9BC\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" b _0808F9D8\n" +" .align 2, 0\n" +"_0808F998: .4byte gUnknown_8107754\n" +"_0808F99C: .4byte gFormatArgs\n" +"_0808F9A0: .4byte gLevel810DD6C_Ptr\n" +"_0808F9A4: .4byte gExpPts810DD9C_Ptr\n" +"_0808F9A8: .4byte gUnknown_810DDB8\n" +"_0808F9AC: .4byte gUnknown_810DDD0\n" +"_0808F9B0: .4byte gUnknown_810DDE4\n" +"_0808F9B4: .4byte gUnknown_810DE0C\n" +"_0808F9B8: .4byte gUnknown_810DE20\n" +"_0808F9BC: .4byte gUnknown_810DE4C\n" +"_0808F9C0:\n" +" mov r0, r10\n" +" adds r0, 0x36\n" +" ldrb r0, [r0]\n" +" str r0, [r4]\n" +" ldr r0, _0808FA44\n" +" ldr r2, [r0]\n" +" str r3, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +"_0808F9D8:\n" +" movs r3, 0xA\n" +" add r9, r3\n" +" ldr r0, _0808FA48\n" +" ldr r2, [r0]\n" +" movs r5, 0\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" ldr r0, _0808FA4C\n" +" ldr r2, [r0]\n" +" ldr r4, _0808FA50\n" +" mov r0, r10\n" +" adds r0, 0x35\n" +" ldrb r3, [r0]\n" +" str r3, [r4]\n" +" mov r1, r10\n" +" adds r1, 0x3A\n" +" ldrb r0, [r1]\n" +" cmp r0, 0\n" +" beq _0808FA0E\n" +" adds r0, r3, r0\n" +" str r0, [r4]\n" +" ldr r0, _0808FA54\n" +" ldr r2, [r0]\n" +"_0808FA0E:\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" mov r1, r10\n" +" adds r1, 0x3C\n" +" ldrb r3, [r1]\n" +" cmp r3, 0\n" +" beq _0808FA5C\n" +" mov r0, r10\n" +" adds r0, 0x37\n" +" ldrb r0, [r0]\n" +" adds r1, r3, 0\n" +" adds r0, r1\n" +" str r0, [r4]\n" +" ldr r0, _0808FA58\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" b _0808FA74\n" +" .align 2, 0\n" +"_0808FA44: .4byte gUnknown_810DE38\n" +"_0808FA48: .4byte gUnknown_810DDFC\n" +"_0808FA4C: .4byte gUnknown_810DE24\n" +"_0808FA50: .4byte gFormatArgs\n" +"_0808FA54: .4byte gUnknown_810DE28\n" +"_0808FA58: .4byte gUnknown_810DE54\n" +"_0808FA5C:\n" +" mov r0, r10\n" +" adds r0, 0x37\n" +" ldrb r0, [r0]\n" +" str r0, [r4]\n" +" ldr r0, _0808FA94\n" +" ldr r2, [r0]\n" +" str r3, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +"_0808FA74:\n" +" movs r0, 0xA\n" +" add r9, r0\n" +" mov r2, r10\n" +" adds r2, 0x20\n" +" ldrb r1, [r2]\n" +" movs r0, 0x1\n" +" ands r0, r1\n" +" cmp r0, 0\n" +" beq _0808FA9C\n" +" ldr r0, _0808FA98\n" +" adds r1, r2, 0\n" +" movs r2, 0\n" +" bl sub_8090E14\n" +" b _0808FAA6\n" +" .align 2, 0\n" +"_0808FA94: .4byte gUnknown_810DE50\n" +"_0808FA98: .4byte gFormatBuffer_Items\n" +"_0808FA9C:\n" +" ldr r0, _0808FB24\n" +" ldr r1, _0808FB28\n" +" ldr r1, [r1]\n" +" bl strcpy\n" +"_0808FAA6:\n" +" ldr r0, _0808FB2C\n" +" ldr r2, [r0]\n" +" movs r4, 0\n" +" str r4, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r1, 0xC\n" +" add r9, r1\n" +" ldr r1, _0808FB30\n" +" mov r2, r10\n" +" movs r3, 0x3E\n" +" ldrsh r0, [r2, r3]\n" +" str r0, [r1]\n" +" movs r1, 0x3E\n" +" ldrsh r0, [r2, r1]\n" +" movs r1, 0xA\n" +" bl __divsi3\n" +" lsls r0, 16\n" +" asrs r0, 16\n" +" cmp r0, 0\n" +" bge _0808FADA\n" +" movs r0, 0\n" +"_0808FADA:\n" +" cmp r0, 0x62\n" +" ble _0808FAE0\n" +" movs r0, 0x63\n" +"_0808FAE0:\n" +" ldr r1, _0808FB34\n" +" lsls r0, 2\n" +" adds r0, r1\n" +" ldr r5, _0808FB38\n" +" ldr r1, [r0]\n" +" adds r0, r5, 0\n" +" bl strcpy\n" +" ldr r0, _0808FB3C\n" +" ldr r2, [r0]\n" +" str r4, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r2, 0xA\n" +" add r9, r2\n" +" mov r0, r10\n" +" adds r0, 0x38\n" +" ldrb r4, [r0]\n" +" cmp r4, 0\n" +" beq _0808FB10\n" +" b _0808FED6\n" +"_0808FB10:\n" +" adds r0, 0x1C\n" +" ldrb r1, [r0]\n" +" adds r0, r5, 0\n" +" bl CopyTacticsNameToBuffer\n" +" ldr r0, _0808FB40\n" +" ldr r2, [r0]\n" +" str r4, [sp]\n" +" b _0808FECC\n" +" .align 2, 0\n" +"_0808FB24: .4byte gFormatBuffer_Items\n" +"_0808FB28: .4byte gUnknown_810DE58\n" +"_0808FB2C: .4byte gUnknown_810DE6C\n" +"_0808FB30: .4byte gFormatArgs\n" +"_0808FB34: .4byte gUnknown_8115718\n" +"_0808FB38: .4byte gFormatBuffer_Monsters\n" +"_0808FB3C: .4byte gUnknown_810DE80\n" +"_0808FB40: .4byte gUnknown_810DE98\n" +"_0808FB44:\n" +" lsls r0, r4, 3\n" +" adds r0, 0x10\n" +" ldr r2, _0808FBE8\n" +" movs r4, 0\n" +" str r4, [sp]\n" +" movs r1, 0\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" ldr r2, _0808FBEC\n" +" str r4, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" mov r3, r10\n" +" ldrb r0, [r3, 0x16]\n" +" bl GetFormattedTypeString\n" +" adds r2, r0, 0\n" +" str r4, [sp]\n" +" movs r0, 0x38\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" mov r1, r10\n" +" ldrb r0, [r1, 0x17]\n" +" cmp r0, 0\n" +" beq _0808FB94\n" +" bl GetFormattedTypeString\n" +" adds r2, r0, 0\n" +" str r4, [sp]\n" +" movs r0, 0x60\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +"_0808FB94:\n" +" movs r2, 0xC\n" +" add r9, r2\n" +" ldr r2, _0808FBF0\n" +" str r4, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r3, 0xC\n" +" add r9, r3\n" +" mov r1, r10\n" +" ldrb r0, [r1, 0x18]\n" +" bl GetAbilityDescription\n" +" adds r2, r0, 0\n" +" str r4, [sp]\n" +" movs r5, 0xB\n" +" str r5, [sp, 0x4]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow2\n" +" movs r2, 0x21\n" +" add r9, r2\n" +" mov r3, r10\n" +" ldrb r0, [r3, 0x19]\n" +" cmp r0, 0\n" +" bne _0808FBD2\n" +" b _0808FED6\n" +"_0808FBD2:\n" +" bl GetAbilityDescription\n" +" adds r2, r0, 0\n" +" str r4, [sp]\n" +" str r5, [sp, 0x4]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow2\n" +" b _0808FED6\n" +" .align 2, 0\n" +"_0808FBE8: .4byte gUnknown_810775C\n" +"_0808FBEC: .4byte gUnknown_8107768\n" +"_0808FBF0: .4byte gUnknown_8107770\n" +"_0808FBF4:\n" +" lsls r0, r4, 3\n" +" adds r0, 0x10\n" +" ldr r1, _0808FC34\n" +" ldr r2, [r1]\n" +" movs r1, 0\n" +" str r1, [sp]\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" mov r0, r10\n" +" adds r0, 0x56\n" +" movs r1, 0\n" +" ldrsh r0, [r0, r1]\n" +" subs r5, r0, 0x1\n" +" movs r2, 0xC\n" +" negs r2, r2\n" +" add r9, r2\n" +" movs r7, 0\n" +" ldr r6, [sp, 0x2C]\n" +" adds r6, 0xC\n" +" adds r1, r6, 0\n" +" movs r2, 0\n" +" ldr r0, [sp, 0x2C]\n" +" adds r0, 0x2C\n" +"_0808FC24:\n" +" str r2, [r0]\n" +" subs r0, 0x4\n" +" cmp r0, r1\n" +" bge _0808FC24\n" +" movs r3, 0\n" +" mov r8, r3\n" +" b _0808FC88\n" +" .align 2, 0\n" +"_0808FC34: .4byte gUnknown_810DD58\n" +"_0808FC38:\n" +" mov r0, r10\n" +" adds r0, 0x58\n" +" adds r4, r0, r5\n" +" ldrb r0, [r4]\n" +" cmp r0, 0\n" +" beq _0808FC78\n" +" movs r7, 0x1\n" +" ldr r0, _0808FCA0\n" +" ldrb r1, [r4]\n" +" lsls r1, 2\n" +" adds r1, r0\n" +" ldr r0, _0808FCA4\n" +" ldr r1, [r1]\n" +" movs r2, 0x50\n" +" bl strncpy\n" +" ldr r2, _0808FCA8\n" +" movs r0, 0\n" +" str r0, [sp]\n" +" movs r0, 0xC\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" mov r0, r8\n" +" cmp r0, 0\n" +" ble _0808FC78\n" +" subs r0, 0x1\n" +" lsls r0, 2\n" +" adds r0, r6, r0\n" +" ldrb r1, [r4]\n" +" str r1, [r0]\n" +"_0808FC78:\n" +" movs r1, 0x1\n" +" add r8, r1\n" +" adds r5, 0x1\n" +" movs r2, 0xC\n" +" add r9, r2\n" +" mov r3, r8\n" +" cmp r3, 0x9\n" +" bgt _0808FC90\n" +"_0808FC88:\n" +" cmp r5, 0\n" +" blt _0808FC78\n" +" cmp r5, 0xB\n" +" ble _0808FC38\n" +"_0808FC90:\n" +" cmp r7, 0\n" +" beq _0808FC96\n" +" b _0808FED6\n" +"_0808FC96:\n" +" ldr r0, _0808FCAC\n" +" ldr r2, [r0]\n" +" str r7, [sp]\n" +" b _0808FD98\n" +" .align 2, 0\n" +"_0808FCA0: .4byte gStatusNames\n" +"_0808FCA4: .4byte gFormatBuffer_Items + 0x50\n" +"_0808FCA8: .4byte gUnknown_8107784\n" +"_0808FCAC: .4byte gUnknown_810DF78\n" +"_0808FCB0:\n" +" lsls r0, r4, 3\n" +" adds r0, 0x10\n" +" ldr r1, _0808FCF8\n" +" ldr r2, [r1]\n" +" movs r1, 0\n" +" str r1, [sp]\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" add r4, sp, 0x14\n" +" mov r0, r10\n" +" movs r2, 0x3E\n" +" ldrsh r1, [r0, r2]\n" +" adds r0, r4, 0\n" +" bl GetNumAvailableIQSkills\n" +" mov r0, r10\n" +" adds r0, 0x40\n" +" movs r3, 0\n" +" ldrsh r0, [r0, r3]\n" +" subs r7, r0, 0x1\n" +" mov r1, r9\n" +" subs r1, 0xC\n" +" movs r2, 0\n" +" ldr r0, [sp, 0x2C]\n" +" adds r0, 0x8\n" +"_0808FCE4:\n" +" strb r2, [r0]\n" +" subs r0, 0x1\n" +" ldr r3, [sp, 0x2C]\n" +" cmp r0, r3\n" +" bge _0808FCE4\n" +" mov r9, r1\n" +" movs r4, 0\n" +" mov r8, r4\n" +" b _0808FD84\n" +" .align 2, 0\n" +"_0808FCF8: .4byte gIQSkill810DD68_Ptr\n" +"_0808FCFC:\n" +" mov r5, sp\n" +" adds r5, r7\n" +" adds r5, 0x14\n" +" ldrb r0, [r5]\n" +" cmp r0, 0\n" +" beq _0808FD74\n" +" movs r4, 0x1\n" +" bl GetIQSkillName\n" +" adds r1, r0, 0\n" +" ldr r6, _0808FD3C\n" +" adds r0, r6, 0\n" +" movs r2, 0x50\n" +" bl strncpy\n" +" mov r0, r10\n" +" adds r0, 0x50\n" +" adds r1, r4, 0\n" +" ldrb r5, [r5]\n" +" lsls r1, r5\n" +" bl IsIQSkillSet\n" +" lsls r0, 24\n" +" cmp r0, 0\n" +" beq _0808FD44\n" +" adds r0, r6, 0\n" +" subs r0, 0x50\n" +" ldr r1, _0808FD40\n" +" bl strcpy\n" +" b _0808FD4E\n" +" .align 2, 0\n" +"_0808FD3C: .4byte gFormatBuffer_Items + 0x50\n" +"_0808FD40: .4byte gUnknown_8107788\n" +"_0808FD44:\n" +" adds r0, r6, 0\n" +" subs r0, 0x50\n" +" ldr r1, _0808FDA4\n" +" bl strcpy\n" +"_0808FD4E:\n" +" mov r0, r8\n" +" cmp r0, 0\n" +" ble _0808FD64\n" +" subs r0, 0x1\n" +" ldr r1, [sp, 0x2C]\n" +" adds r0, r1, r0\n" +" mov r1, sp\n" +" adds r1, r7\n" +" adds r1, 0x14\n" +" ldrb r1, [r1]\n" +" strb r1, [r0]\n" +"_0808FD64:\n" +" ldr r2, _0808FDA8\n" +" movs r0, 0\n" +" str r0, [sp]\n" +" movs r0, 0xC\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +"_0808FD74:\n" +" movs r2, 0x1\n" +" add r8, r2\n" +" adds r7, 0x1\n" +" movs r3, 0xC\n" +" add r9, r3\n" +" mov r0, r8\n" +" cmp r0, 0x9\n" +" bgt _0808FD8C\n" +"_0808FD84:\n" +" cmp r7, 0\n" +" blt _0808FD74\n" +" cmp r7, 0x17\n" +" ble _0808FCFC\n" +"_0808FD8C:\n" +" cmp r4, 0\n" +" beq _0808FD92\n" +" b _0808FED6\n" +"_0808FD92:\n" +" ldr r0, _0808FDAC\n" +" ldr r2, [r0]\n" +" str r4, [sp]\n" +"_0808FD98:\n" +" movs r0, 0xC\n" +" movs r1, 0x20\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" b _0808FED6\n" +" .align 2, 0\n" +"_0808FDA4: .4byte gUnknown_810778C\n" +"_0808FDA8: .4byte gUnknown_8107790\n" +"_0808FDAC: .4byte gUnknown_810DF84\n" +"_0808FDB0:\n" +" lsls r0, r4, 3\n" +" adds r0, 0x10\n" +" ldr r2, _0808FEEC\n" +" movs r5, 0\n" +" str r5, [sp]\n" +" movs r1, 0\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" ldr r6, _0808FEF0\n" +" mov r2, r10\n" +" movs r3, 0\n" +" ldrsh r1, [r2, r3]\n" +" adds r0, r6, 0\n" +" bl CopyMonsterNameToBuffer\n" +" ldr r1, _0808FEF4\n" +" mov r2, r10\n" +" movs r3, 0\n" +" ldrsh r0, [r2, r3]\n" +" str r0, [r1]\n" +" ldr r0, _0808FEF8\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r0, 0xA\n" +" add r9, r0\n" +" mov r1, r10\n" +" movs r2, 0\n" +" ldrsh r0, [r1, r2]\n" +" bl GetFriendArea\n" +" lsls r0, 24\n" +" lsrs r0, 24\n" +" bl GetFriendAreaName\n" +" adds r1, r0, 0\n" +" ldr r4, _0808FEFC\n" +" adds r0, r4, 0\n" +" movs r2, 0x50\n" +" bl strncpy\n" +" ldr r0, _0808FF00\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r3, 0xA\n" +" add r9, r3\n" +" ldr r0, _0808FF04\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r0, 0xD\n" +" add r9, r0\n" +" ldr r0, _0808FF08\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r1, 0xA\n" +" add r9, r1\n" +" mov r1, r10\n" +" adds r1, 0x1C\n" +" adds r0, r4, 0\n" +" bl PrintYellowDungeonNametoBuffer\n" +" ldr r0, _0808FF0C\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r2, 0xD\n" +" add r9, r2\n" +" mov r3, r10\n" +" movs r1, 0\n" +" ldrsh r0, [r3, r1]\n" +" bl GetCategoryString\n" +" adds r1, r0, 0\n" +" adds r0, r6, 0\n" +" movs r2, 0x14\n" +" bl strncpy\n" +" ldr r0, _0808FF10\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r2, 0xD\n" +" add r9, r2\n" +" ldr r4, _0808FF14\n" +" mov r3, r10\n" +" movs r1, 0\n" +" ldrsh r0, [r3, r1]\n" +" bl GetBodySize\n" +" lsls r0, 24\n" +" lsrs r0, 22\n" +" adds r0, r4\n" +" ldr r1, [r0]\n" +" adds r0, r6, 0\n" +" bl strcpy\n" +" ldr r0, _0808FF18\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +" movs r2, 0xD\n" +" add r9, r2\n" +" ldr r1, _0808FF1C\n" +" mov r0, r10\n" +" adds r0, 0x4C\n" +" ldrb r0, [r0]\n" +" lsls r0, 2\n" +" adds r0, r1\n" +" ldr r2, [r0]\n" +" str r5, [sp]\n" +"_0808FECC:\n" +" movs r0, 0x4\n" +" mov r1, r9\n" +" ldr r3, [sp, 0x50]\n" +" bl PrintFormattedStringOnWindow\n" +"_0808FED6:\n" +" ldr r0, [sp, 0x50]\n" +" bl sub_80073E0\n" +" add sp, 0x30\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" +" .align 2, 0\n" +"_0808FEEC: .4byte gUnknown_8107798\n" +"_0808FEF0: .4byte gFormatBuffer_Monsters\n" +"_0808FEF4: .4byte gFormatArgs\n" +"_0808FEF8: .4byte gUnknown_810DEB4\n" +"_0808FEFC: .4byte gFormatBuffer_Items\n" +"_0808FF00: .4byte gUnknown_810DEC8\n" +"_0808FF04: .4byte gUnknown_810DEDC\n" +"_0808FF08: .4byte gUnknown_810DFB4\n" +"_0808FF0C: .4byte gUnknown_810DFC8\n" +"_0808FF10: .4byte gUnknown_810DEF4\n" +"_0808FF14: .4byte gUnknown_810E02C\n" +"_0808FF18: .4byte gUnknown_810DF98\n" +"_0808FF1C: .4byte gEvolutionStrings"); +} + +void sub_808FF20(struct unkStruct_808FF20 *param_1, struct PokemonStruct1 *pokemon, bool8 param_3) +{ + s32 index; + + PrintColoredPokeNameToBuffer(param_1->nameBuffer, pokemon, COLOR_WHITE); + param_1->species = pokemon->speciesNum; + param_1->HP1 = pokemon->pokeHP; + param_1->HP2 = pokemon->pokeHP; + param_1->level = pokemon->level; + param_1->exp = pokemon->currExp; + for(index = 0; index < 2; index++) + { + param_1->offense.att[index] = pokemon->offense.att[index]; + param_1->offense.def[index] = pokemon->offense.def[index]; + param_1->types[index] = GetPokemonType(pokemon->speciesNum,index); + param_1->abilities[index] = GetPokemonAbility(pokemon->speciesNum,index); + } + param_1->isTeamLeader = pokemon->isTeamLeader; + param_1->atkBoost = 0; + param_1->spAtkBoost = 0; + param_1->defBoost = 0; + param_1->spDefBoost = 0; + + if (pokemon->heldItem.id != 0) { + if (pokemon->heldItem.id == ITEM_POWER_BAND) { + param_1->atkBoost += gUnknown_810AC60; + } + if (pokemon->heldItem.id == ITEM_SPECIAL_BAND) { + param_1->spAtkBoost+= gUnknown_810AC62; + } + if (pokemon->heldItem.id == ITEM_MUNCH_BELT) { + param_1->atkBoost += gUnknown_810AC68; + } + if (pokemon->heldItem.id == ITEM_MUNCH_BELT) { + param_1->spAtkBoost+= gUnknown_810AC68; + } + if (pokemon->heldItem.id == ITEM_DEF_SCARF) { + param_1->defBoost += gUnknown_810AC64; + } + if (pokemon->heldItem.id == ITEM_ZINC_BAND) { + param_1->spDefBoost += gUnknown_810AC66; + } + } + param_1->tactic = pokemon->tacticIndex; + HeldItemToSlot(¶m_1->item,&pokemon->heldItem); + param_1->IQ = pokemon->IQ; + param_1->dungeonLocation = pokemon->dungeonLocation; + param_1->unk44[0] = pokemon->unkC[0]; + param_1->unk44[1] = pokemon->unkC[1]; + param_1->IQSkills = pokemon->IQSkills; + if (param_3) { + param_1->unk4C = sub_808F700(pokemon); + } + else { + param_1->unk4C = 3; + } + + for(index = 0; index < 0xC; index++) + { + param_1->unk58[index] = 0; + } +} From 0776e271cc81e7e337535129d39111b2586b6c80 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sun, 15 Dec 2024 10:08:29 -0800 Subject: [PATCH 21/23] more code_2 work --- include/code_2.h | 9 +++++---- include/personality_test1.h | 15 ++++++++++----- src/code.c | 38 +++++++++++++++---------------------- src/personality_test1.c | 14 +++++++------- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/include/code_2.h b/include/code_2.h index 658fe3cc0..d5372d251 100644 --- a/include/code_2.h +++ b/include/code_2.h @@ -1,8 +1,9 @@ #ifndef GUARD_CODE_2_H #define GUARD_CODE_2_H -// code_2.s -extern void sub_8001024(u32 *); -extern void sub_8001044(u32 *); +#include "personality_test1.h" -#endif // GUARD_CODE_2_H \ No newline at end of file +void sub_8001024(struct PersonalityRelated *); +void sub_8001044(struct PersonalityRelated *); + +#endif // GUARD_CODE_2_H diff --git a/include/personality_test1.h b/include/personality_test1.h index 6eba0269d..7c1dc7979 100644 --- a/include/personality_test1.h +++ b/include/personality_test1.h @@ -14,14 +14,19 @@ typedef struct PersonalityQuestion /* 0x8 */ const PersonalityEffects *effects; } PersonalityQuestion; +struct PersonalityRelated +{ + u32 unk4; + s16 StarterID; + s16 PartnerID; + u8 StarterName[0x14]; + u8 PartnerNick[0x14]; +}; + struct PersonalityTestTracker { /* 0x0 */ s32 FrameCounter; - u32 unk4; - /* 0x8 */ s16 StarterID; - /* 0xA */ s16 PartnerID; - u8 fillC[0x20 - 0xC]; - /* 0x20 */ u8 PartnerNick[20]; + struct PersonalityRelated unk4; /* 0x34 */ u32 TestState; /* 0x38 */ s32 QuestionCounter; /* 0x3C */ u32 currQuestionIndex; diff --git a/src/code.c b/src/code.c index 207672504..6ffcc36b2 100644 --- a/src/code.c +++ b/src/code.c @@ -7,6 +7,7 @@ #include "event_flag.h" #include "items.h" #include "memory.h" +#include "personality_test1.h" #include "pokemon.h" #include "quick_save_read.h" #include "quick_save_write.h" @@ -42,17 +43,8 @@ struct unkTalkTable extern struct unkTalkTable gTalkKindTable[]; extern struct unkTalkTable gBaseKindTable[]; -// size: 0x30 -struct PersonalityRelated -{ - u8 fill0[4]; - s16 speciesID1; - s16 speciesID2; - u8 speciesName1[0x14]; - u8 speciesName2[0x14]; -}; -struct PersonalityRelated gPersonalityRelated_203B040; -extern u32 gUnknown_203B03C; +EWRAM_DATA_2 u32 gUnknown_203B03C = {0}; +EWRAM_DATA_2 struct PersonalityRelated gPersonalityRelated_203B040 = {0}; void SaveLoadRelated_8000EDC(struct UnkStruct_xxx_dungeon_8042F6C *param_1) { @@ -145,35 +137,35 @@ void sub_8001064(void) u8 buffer1 [20]; if (GetPlayerPokemonStruct() == NULL) { - if (gPersonalityRelated_203B040.speciesName1[0] == '\0') { - CopyMonsterNameToBuffer(buffer1,gPersonalityRelated_203B040.speciesID1); + if (gPersonalityRelated_203B040.StarterName[0] == '\0') { + CopyMonsterNameToBuffer(buffer1,gPersonalityRelated_203B040.StarterID); CopyStringtoBuffer(buffer2,buffer1); - sub_808CE74(gPersonalityRelated_203B040.speciesID1,TRUE,buffer2); + sub_808CE74(gPersonalityRelated_203B040.StarterID,TRUE,buffer2); } else { - sub_808CE74(gPersonalityRelated_203B040.speciesID1,TRUE,gPersonalityRelated_203B040.speciesName1); + sub_808CE74(gPersonalityRelated_203B040.StarterID,TRUE,gPersonalityRelated_203B040.StarterName); } } if (sub_808D378() == NULL) { - if (gPersonalityRelated_203B040.speciesName2[0] == '\0') { - CopyMonsterNameToBuffer(buffer1,gPersonalityRelated_203B040.speciesID2); + if (gPersonalityRelated_203B040.PartnerNick[0] == '\0') { + CopyMonsterNameToBuffer(buffer1,gPersonalityRelated_203B040.PartnerID); CopyStringtoBuffer(buffer2,buffer1); - sub_808CE74(gPersonalityRelated_203B040.speciesID2,FALSE,buffer2); + sub_808CE74(gPersonalityRelated_203B040.PartnerID,FALSE,buffer2); } else { - sub_808CE74(gPersonalityRelated_203B040.speciesID2,FALSE,gPersonalityRelated_203B040.speciesName2); + sub_808CE74(gPersonalityRelated_203B040.PartnerID,FALSE,gPersonalityRelated_203B040.PartnerNick); } } - if (gPersonalityRelated_203B040.speciesID1 != MONSTER_NONE) { + if (gPersonalityRelated_203B040.StarterID != MONSTER_NONE) { psVar2 = &gBaseKindTable[0]; - while ((psVar2->species != MONSTER_NONE && (gPersonalityRelated_203B040.speciesID1 != psVar2->species))) { + while ((psVar2->species != MONSTER_NONE && (gPersonalityRelated_203B040.StarterID != psVar2->species))) { psVar2++; } SetScriptVarValue(NULL,BASE_KIND,psVar2->unk0); } - if (gPersonalityRelated_203B040.speciesID2 != MONSTER_NONE) { + if (gPersonalityRelated_203B040.PartnerID != MONSTER_NONE) { psVar2 = &gTalkKindTable[0]; - while ((psVar2->species != MONSTER_NONE && (gPersonalityRelated_203B040.speciesID2 != psVar2->species))) { + while ((psVar2->species != MONSTER_NONE && (gPersonalityRelated_203B040.PartnerID != psVar2->species))) { psVar2++; } SetScriptVarValue(NULL,PARTNER_TALK_KIND,psVar2->unk0); diff --git a/src/personality_test1.c b/src/personality_test1.c index 63ebb82f5..05f64ca44 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -273,7 +273,7 @@ static void RevealPersonality(void) sPersonalityTestTracker->playerNature = currentNature; } - sPersonalityTestTracker->StarterID = gStarters[sPersonalityTestTracker->playerNature][sPersonalityTestTracker->playerGender]; + sPersonalityTestTracker->unk4.StarterID = gStarters[sPersonalityTestTracker->playerNature][sPersonalityTestTracker->playerGender]; PrintPersonalityTypeDescription(); sPersonalityTestTracker->TestState = PERSONALITY_STARTER_REVEAL; } @@ -313,7 +313,7 @@ static void AdvanceToPartnerSelection(void) static void CallCreatePartnerSelectionMenu(void) { - CreatePartnerSelectionMenu(sPersonalityTestTracker->StarterID); + CreatePartnerSelectionMenu(sPersonalityTestTracker->unk4.StarterID); sPersonalityTestTracker->TestState = PERSONALITY_ADVANCE_TO_PARTNER_NICKNAME_1; } @@ -326,7 +326,7 @@ static void PromptForPartnerNickname(void) if (selectedPartner != 0xFFFF) { if (selectedPartner != 0xFFFE) { sub_803CE6C(); - sPersonalityTestTracker->PartnerID = selectedPartner; + sPersonalityTestTracker->unk4.PartnerID = selectedPartner; CreateDialogueBoxAndPortrait(gPartnerNickPrompt, 0, 0, 0x301); sPersonalityTestTracker->TestState = PERSONALITY_ADVANCE_TO_PARTNER_NICKNAME_2; } @@ -343,8 +343,8 @@ static void AdvanceToPartnerNicknameScreen(void) static void NicknamePartner(void) { - CopyStringtoBuffer(sPersonalityTestTracker->PartnerNick, GetMonSpecies(sPersonalityTestTracker->PartnerID)); - CreateConfirmNameMenu(3, sPersonalityTestTracker->PartnerNick); + CopyStringtoBuffer(sPersonalityTestTracker->unk4.PartnerNick, GetMonSpecies(sPersonalityTestTracker->unk4.PartnerID)); + CreateConfirmNameMenu(3, sPersonalityTestTracker->unk4.PartnerNick); sPersonalityTestTracker->TestState = PERSONALITY_END_INTRO; } @@ -375,7 +375,7 @@ static void PromptNewQuestion(void) static void PrintPersonalityTypeDescription(void) { - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->StarterID); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->unk4.StarterID); CreateDialogueBoxAndPortrait(sPersonalityTypeDescriptionTable[sPersonalityTestTracker->playerNature], 0, 0, 0x101); } @@ -388,7 +388,7 @@ static void PersonalityTest_DisplayStarterSprite(void) const u8 *gfx; UnkTextStruct2 stackArray[4]; - starterID = sPersonalityTestTracker->StarterID; + starterID = sPersonalityTestTracker->unk4.StarterID; RestoreUnkTextStruct_8006518(stackArray); stackArray[1] = sUnknown_80F4244; ResetUnusedInputStruct(); From 62ca91f7715de5c2ed404e4eabbb37622db2dec3 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 16 Dec 2024 10:38:11 +0100 Subject: [PATCH 22/23] Match sub_801F280 --- asm/code_801EE10.s | 190 ----------------------------------------- include/code_801EE10.h | 4 +- ld_script.txt | 2 - src/code_801EE10.c | 88 +++++++++++++++++-- src/code_801EE10_mid.c | 21 ----- 5 files changed, 84 insertions(+), 221 deletions(-) delete mode 100644 asm/code_801EE10.s delete mode 100644 src/code_801EE10_mid.c diff --git a/asm/code_801EE10.s b/asm/code_801EE10.s deleted file mode 100644 index d40ea219e..000000000 --- a/asm/code_801EE10.s +++ /dev/null @@ -1,190 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_801F280 -sub_801F280: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, _0801F30C - ldr r0, [r4] - ldr r0, [r0, 0x50] - bl CallPrepareTextbox_8008C54 - ldr r0, [r4] - ldr r0, [r0, 0x50] - bl sub_80073B8 - ldr r0, [r4] - ldr r1, [r0, 0x8] - adds r1, 0x4C - add r0, sp, 0x4 - movs r2, 0xA - bl sub_80922B4 - ldr r0, _0801F310 - add r1, sp, 0x4 - bl strcpy - ldr r2, _0801F314 - ldr r0, [r4] - ldr r3, [r0, 0x50] - movs r0, 0 - str r0, [sp] - movs r0, 0xC - movs r1, 0 - bl PrintFormattedStringOnWindow - movs r7, 0 - ldr r0, [r4] - movs r1, 0x36 - ldrsh r0, [r0, r1] - cmp r7, r0 - bge _0801F394 - add r5, sp, 0x18 - mov r8, r4 - movs r0, 0x1 - mov r9, r0 -_0801F2E0: - adds r0, r5, 0 - movs r1, 0 - movs r2, 0xC - bl memset - movs r0, 0x6A - str r0, [r5, 0x4] - mov r1, r8 - ldr r2, [r1] - lsls r1, r7, 3 - ldr r0, [r2, 0x10] - adds r4, r0, r1 - ldrb r1, [r4] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - beq _0801F386 - ldrb r0, [r2, 0xC] - cmp r0, 0 - beq _0801F318 - movs r0, 0x2 - b _0801F31A - .align 2, 0 -_0801F30C: .4byte gUnknown_203B270 -_0801F310: .4byte gFormatBuffer_Monsters -_0801F314: .4byte gUnknown_80DC28C -_0801F318: - movs r0, 0x4 -_0801F31A: - str r0, [sp, 0x18] - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x6] - cmp r0, 0 - beq _0801F328 - mov r0, r9 -_0801F328: - strb r0, [r5, 0x9] - cmp r7, 0x3 - ble _0801F332 - mov r1, r9 - strb r1, [r5, 0x8] -_0801F332: - ldr r0, _0801F3EC - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80928A0 - ldr r2, _0801F3F0 - ldr r0, [r2] - adds r0, 0x1C - adds r1, r7, 0 - str r2, [sp, 0x24] - bl sub_8013800 - adds r6, r0, 0 - ldrb r1, [r4] - movs r0, 0x2 - ands r0, r1 - movs r4, 0xD - ldr r2, [sp, 0x24] - cmp r0, 0 - bne _0801F372 - movs r4, 0x8 - cmp r7, 0 - beq _0801F372 - ldr r0, [r2] - ldr r0, [r0, 0x50] - subs r2, r6, 0x2 - movs r1, 0x7 - str r1, [sp] - movs r1, 0xC - movs r3, 0x78 - bl sub_800792C -_0801F372: - mov r1, r8 - ldr r0, [r1] - ldr r3, [r0, 0x50] - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - adds r1, r6, 0 - ldr r2, _0801F3F4 - bl PrintFormattedStringOnWindow -_0801F386: - adds r7, 0x1 - mov r1, r8 - ldr r0, [r1] - movs r1, 0x36 - ldrsh r0, [r0, r1] - cmp r7, r0 - blt _0801F2E0 -_0801F394: - ldr r4, _0801F3F0 - ldr r0, [r4] - ldr r0, [r0, 0x50] - bl sub_80073E0 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xB8 - ldr r0, [r0] - cmp r0, 0 - beq _0801F3DC - mov r0, r10 - cmp r0, 0 - beq _0801F3DC - ldr r0, [r1, 0x54] - bl CallPrepareTextbox_8008C54 - ldr r0, [r4] - ldr r0, [r0, 0x54] - bl sub_80073B8 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xB8 - ldr r2, [r0] - ldr r3, [r1, 0x54] - movs r0, 0 - str r0, [sp] - movs r0, 0x8 - movs r1, 0 - bl PrintFormattedStringOnWindow - ldr r0, [r4] - ldr r0, [r0, 0x54] - bl sub_80073E0 -_0801F3DC: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_0801F3EC: .4byte gFormatBuffer_Items -_0801F3F0: .4byte gUnknown_203B270 -_0801F3F4: .4byte gUnknown_80DC2A0 - thumb_func_end sub_801F280 - - .align 2,0 diff --git a/include/code_801EE10.h b/include/code_801EE10.h index 94c95baf6..71c95f515 100644 --- a/include/code_801EE10.h +++ b/include/code_801EE10.h @@ -31,8 +31,6 @@ s32 sub_801F194(void); bool8 sub_801F1A4(void); void sub_801F1B0(bool8, bool8); void sub_801F214(void); - -// code_801EE10.s -extern void sub_801F280(u32); // Probably bool +void sub_801F280(bool8); #endif // CODE_801EE10_H diff --git a/ld_script.txt b/ld_script.txt index e576aa391..cad2d9b8d 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -125,8 +125,6 @@ SECTIONS { src/hints_menu2.o(.text); src/gulpin_shop.o(.text); src/code_801EE10.o(.text); - asm/code_801EE10.o(.text); - src/code_801EE10_mid.o(.text); src/code_801F428.o(.text); src/code_801F808.o(.text); src/gulpin_shop_801FB50.o(.text); diff --git a/src/code_801EE10.c b/src/code_801EE10.c index 64419cd96..fa4278d0d 100644 --- a/src/code_801EE10.c +++ b/src/code_801EE10.c @@ -9,6 +9,7 @@ #include "code_801EE10.h" #include "code_80118A4.h" #include "menu_input.h" +#include "string_format.h" EWRAM_DATA_2 unkStruct_203B270 *gUnknown_203B270 = {0}; @@ -95,7 +96,7 @@ u8 sub_801EE10(u32 param_1, s16 species, Move *moves, u32 param_4, const u8 *tex xxx_call_save_unk_text_struct_800641C(gUnknown_203B270->unk58, TRUE, TRUE); sub_8013818(&gUnknown_203B270->input,iVar5,iVar5,param_6); sub_8013780(&gUnknown_203B270->input,0); - sub_801F280(1); + sub_801F280(TRUE); return 1; } @@ -147,7 +148,7 @@ u32 sub_801EF38(char param_1) else { goto _134; } - sub_801F280(1); + sub_801F280(TRUE); return 1; case INPUT_R_DPAD_UP_BUTTONS: if (gUnknown_203B270->unk5 == 0) break; @@ -160,7 +161,7 @@ u32 sub_801EF38(char param_1) _134: PlayMenuSoundEffect(2); } - sub_801F280(1); + sub_801F280(TRUE); return 1; case INPUT_R_A_BUTTONS: if (gUnknown_203B270->unk6 != 0) { @@ -225,7 +226,7 @@ _134: } if (flag) { _ret: - sub_801F280(1); + sub_801F280(TRUE); return 1; } else @@ -253,7 +254,7 @@ void sub_801F1B0(bool8 param_1, bool8 param_2) gUnknown_203B270->input.unk22 = sub_801F3F8(); sub_8013984(&gUnknown_203B270->input); gUnknown_203B270->input.menuIndex = sub_8092F4C(gUnknown_203B270->moves, gUnknown_203B270->input.menuIndex); - sub_801F280(1); + sub_801F280(TRUE); if(param_1) AddMenuCursorSprite(&gUnknown_203B270->input); } @@ -273,3 +274,80 @@ void sub_801F214(void) gUnknown_203B270 = NULL; } } + +extern void sub_80922B4(u8 *buffer, u8 *string, s32 size); + +void sub_801F280(bool8 param_1) +{ + int i; + u8 buffer[20]; + + CallPrepareTextbox_8008C54(gUnknown_203B270->unk50); + sub_80073B8(gUnknown_203B270->unk50); + sub_80922B4(buffer,gUnknown_203B270->pokeStruct->name,10); + strcpy(gFormatBuffer_Monsters[0],buffer); + PrintFormattedStringOnWindow(0xc,0,gUnknown_80DC28C,gUnknown_203B270->unk50,0); // Move: {COLOR_1 YELLOW}{ARG_POKEMON_0){END_COLOR_TEXT_1} + + for (i = 0; i < gUnknown_203B270->input.unk1A; i++) { + struct Move *move; + bool8 linkChain; + s32 x, y; + struct unkStruct_80928C0 uStack_30 = {0}; + + uStack_30.unk4 = 0x6a; + move = &gUnknown_203B270->moves[i]; + if (MoveFlagExists(move)) { + if (gUnknown_203B270->isTeamLeader) { + uStack_30.unk0 = 2; + } + else { + uStack_30.unk0 = 4; + } + + if (gUnknown_203B270->unk6) { + uStack_30.unk9 = 1; + } + else { + uStack_30.unk9 = 0; + } + + if (i >= MAX_MON_MOVES) { + uStack_30.unk8 = 1; + } + + sub_80928A0(gFormatBuffer_Items[0],move,&uStack_30); + y = sub_8013800(&gUnknown_203B270->input,i); + linkChain = MoveFlagLinkChain(move); + x = !linkChain ? 0x8 : 0xD; + if (!linkChain && i != 0) { + sub_800792C(gUnknown_203B270->unk50,0xc,y - 2,0x78,7); + } + PrintFormattedStringOnWindow(x,y,gUnknown_80DC2A0,gUnknown_203B270->unk50,0); // {ARG_MOVE_ITEM_0} + } + } + + sub_80073E0(gUnknown_203B270->unk50); + if ((gUnknown_203B270->text != NULL) && (param_1)) { + CallPrepareTextbox_8008C54(gUnknown_203B270->unk54); + sub_80073B8(gUnknown_203B270->unk54); + PrintFormattedStringOnWindow(8,0,gUnknown_203B270->text,gUnknown_203B270->unk54,0); + sub_80073E0(gUnknown_203B270->unk54); + } +} + +s32 sub_801F3F8(void) +{ + Move *move; + int index; + s32 counter; + + counter = 0; + for(index = 0; index < 8; index++) + { + move = &gUnknown_203B270->moves[index]; + if ((move->moveFlags & MOVE_FLAG_EXISTS)) { + counter++; + } + } + return counter; +} diff --git a/src/code_801EE10_mid.c b/src/code_801EE10_mid.c deleted file mode 100644 index 50bf825cf..000000000 --- a/src/code_801EE10_mid.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "global.h" -#include "code_801EE10.h" - -extern unkStruct_203B270 *gUnknown_203B270; - -s32 sub_801F3F8(void) -{ - Move *move; - int index; - s32 counter; - - counter = 0; - for(index = 0; index < 8; index++) - { - move = &gUnknown_203B270->moves[index]; - if ((move->moveFlags & MOVE_FLAG_EXISTS)) { - counter++; - } - } - return counter; -} From 6418d9a00f80bfeb1697d070892e1edfa9820c29 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 16 Dec 2024 17:33:47 +0100 Subject: [PATCH 23/23] Update src/code_801EE10.c Co-authored-by: Seth Barberee --- src/code_801EE10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/code_801EE10.c b/src/code_801EE10.c index fa4278d0d..ff9470fe7 100644 --- a/src/code_801EE10.c +++ b/src/code_801EE10.c @@ -284,7 +284,7 @@ void sub_801F280(bool8 param_1) CallPrepareTextbox_8008C54(gUnknown_203B270->unk50); sub_80073B8(gUnknown_203B270->unk50); - sub_80922B4(buffer,gUnknown_203B270->pokeStruct->name,10); + sub_80922B4(buffer,gUnknown_203B270->pokeStruct->name,POKEMON_NAME_LENGTH); strcpy(gFormatBuffer_Monsters[0],buffer); PrintFormattedStringOnWindow(0xc,0,gUnknown_80DC28C,gUnknown_203B270->unk50,0); // Move: {COLOR_1 YELLOW}{ARG_POKEMON_0){END_COLOR_TEXT_1}