From febfe3778e94ecc1e082c0d18d7f3be26f3b4897 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 4 Apr 2025 13:47:51 +0200 Subject: [PATCH] move const data to code_803E46C --- data/data_80F59C8_3.s | 25 ------------------------- ld_script.txt | 1 - src/code_803E46C.c | 28 +++++++++++++++++----------- 3 files changed, 17 insertions(+), 37 deletions(-) delete mode 100644 data/data_80F59C8_3.s diff --git a/data/data_80F59C8_3.s b/data/data_80F59C8_3.s deleted file mode 100644 index 0efc9a08f..000000000 --- a/data/data_80F59C8_3.s +++ /dev/null @@ -1,25 +0,0 @@ -#include "constants/status.h" -.section .rodata -#.incbin "baserom.gba", 0xF59C4, 0x4 - - -.global gUnknown_80F61EC -gUnknown_80F61EC: @ 80F61EC -@ replacing .incbin "baserom.gba", 0x000f61ec, 0x30 -.byte 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xfc, 0xff -.byte 0xf0, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xf8, 0xff - -.global gUnknown_80F621C -gUnknown_80F621C: @ 80F621C -@ replacing .incbin "baserom.gba", 0x000f621c, 0x8 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_80F6224 -gUnknown_80F6224: @ 80F6224 -@ replacing .incbin "baserom.gba", 0x000f6224, 0x88 -.byte 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x0a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00 - diff --git a/ld_script.txt b/ld_script.txt index 1be7de9a0..78436faf8 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -558,7 +558,6 @@ SECTIONS { data/data_80F59C8_1.o(.rodata); src/code_803DA7C.o(.rodata); src/code_803E46C.o(.rodata); - data/data_80F59C8_3.o(.rodata); src/code_803E724.o(.rodata); data/data_80F59C8_0.o(.rodata); src/dungeon_map.o(.rodata); diff --git a/src/code_803E46C.c b/src/code_803E46C.c index 9c617c607..79cf0b59f 100644 --- a/src/code_803E46C.c +++ b/src/code_803E46C.c @@ -40,17 +40,6 @@ void sub_8042E5C(); void sub_800F7D0(DungeonPos *); void sub_803E874(s32, s32); -struct Unk80F6224Struct -{ - s32 shape; - s32 size; - s32 tileNum; -}; - -extern const struct Unk80F6224Struct gUnknown_80F621C[2][6]; - -extern const DungeonPos gUnknown_80F61EC[2][6]; - EWRAM_DATA struct unkStruct_202ED28 gUnknown_202ED28[2][6] = {0}; EWRAM_DATA SpriteOAM gUnknown_202EDB8 = {0}; EWRAM_DATA SpriteOAM gUnknown_202EDC0 = {0}; @@ -58,6 +47,23 @@ EWRAM_DATA SpriteOAM gUnknown_202EDC0 = {0}; EWRAM_INIT u8 gUnknown_203B40C = 0; EWRAM_INIT u8 gUnknown_203B40D = 0; +static const DungeonPos gUnknown_80F61EC[2][6] = { + [0] = {{-4, -4}, {-8, -4}, {-16, -4}, {-16, -4}, {-16, -4}, {-16, -4}}, + [1] = {{-4, -4}, {-8, -4}, {-16, -8}, {-16, -8}, {-16, -8}, {-16, -8}}, +}; + +struct SpriteInfo +{ + s32 shape; + s32 size; + s32 tileNum; +}; + +static const struct SpriteInfo gUnknown_80F621C[2][6] = { + [0] = {{0, 0, 0x200}, {1, 0, 0x201}, {1, 1, 0x203}, {1, 1, 0x223}, {1, 1, 0x223}, {1, 1, 0x223}}, + [1] = {{0, 0, 0x207}, {1, 0, 0x208}, {1, 2, 0x20A}, {1, 2, 0x22A}, {1, 2, 0x22A}, {1, 2, 0x22A}}, +}; + void sub_803E250(void) { s32 i, j;