From c0a229f10834785a709c40035dab6da03b8a30ff Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 29 Oct 2017 11:12:28 -0400 Subject: [PATCH] Decompile field region map bg and window templates --- asm/field_region_map.s | 8 -------- data/field_region_map.s | 14 -------------- ld_script.txt | 2 -- src/field_region_map.c | 31 ++++++++++++++++++++++++++++--- 4 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 asm/field_region_map.s delete mode 100644 data/field_region_map.s diff --git a/asm/field_region_map.s b/asm/field_region_map.s deleted file mode 100644 index 2428f2984b..0000000000 --- a/asm/field_region_map.s +++ /dev/null @@ -1,8 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - .align 2, 0 @ Don't pad with nop. diff --git a/data/field_region_map.s b/data/field_region_map.s deleted file mode 100644 index f179ba8ceb..0000000000 --- a/data/field_region_map.s +++ /dev/null @@ -1,14 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_085E5068:: @ 85E5068 struct BgTemplate - .4byte 0x000001f0, 0x00002dca - - .align 2 -gUnknown_085E5070:: @ 85E5070 - window_template 0x00, 0x11, 0x11, 0x0c, 0x02, 0x0f, 0x0001 - window_template 0x00, 0x16, 0x01, 0x07, 0x02, 0x0f, 0x0019 - window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 diff --git a/ld_script.txt b/ld_script.txt index 252c0e11d0..38b024995a 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -213,7 +213,6 @@ SECTIONS { asm/intro.o(.text); src/reset_save_heap.o(.text); src/field_region_map.o(.text); - asm/field_region_map.o(.text); asm/battle_anim_8170478.o(.text); asm/hall_of_fame.o(.text); asm/credits.o(.text); @@ -435,7 +434,6 @@ SECTIONS { data/player_pc.o(.rodata); data/intro.o(.rodata); src/field_region_map.o(.rodata); - data/field_region_map.o(.rodata); data/battle_anim_8170478.o(.rodata); data/hall_of_fame.o(.rodata); data/credits.o(.rodata); diff --git a/src/field_region_map.c b/src/field_region_map.c index f782680189..c2a14d04ee 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -18,7 +18,7 @@ // Static RAM declarations -EWRAM_DATA struct { +static EWRAM_DATA struct { MainCallback callback; u32 filler_004; struct RegionMap regionMap; @@ -35,8 +35,33 @@ static void sub_8170428(void); // .rodata -extern const struct BgTemplate gUnknown_085E5068[]; -extern const struct WindowTemplate gUnknown_085E5070[]; +static const struct BgTemplate gUnknown_085E5068[] = { + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 28, + .screenSize = 2, + .paletteMode = 1, + .priority = 2, + .baseTile = 0 + } +}; + +static const struct WindowTemplate gUnknown_085E5070[] = { + { + 0, 17, 17, 12, 2, 15, 0x0001 + }, { + 0, 22, 1, 7, 2, 15, 0x0019 + }, DUMMY_WIN_TEMPLATE +}; // .text