From ea779d534f745f98265216d5ae4606664f565bf7 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Dec 2024 12:35:09 +0100 Subject: [PATCH 01/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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)); }