From 1ffa1f4eb6b09c3ccae2788323353caa379446f3 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Fri, 26 Feb 2021 23:01:23 +0100 Subject: [PATCH 1/3] testing globals stuff --- data/data_089FC6C4.s | 5 ----- linker.ld | 1 + src/code_080B1520.c | 8 ++++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/data/data_089FC6C4.s b/data/data_089FC6C4.s index 2a53d0cf..ce772176 100644 --- a/data/data_089FC6C4.s +++ b/data/data_089FC6C4.s @@ -10303,8 +10303,3 @@ gUnk_08DE7D18:: @ 08DE7D18 gUnk_08DE7D28:: @ 08DE7D28 .incbin "baserom.gba", 0xDE7D28, 0x0000018 -gEEPROMConfig512:: @ 08DE7D40 - .incbin "baserom.gba", 0xDE7D40, 0x000000C - -gEEPROMConfig8k:: @ 08DE7D4C - .incbin "baserom.gba", 0xDE7D4C, 0x0000058 diff --git a/linker.ld b/linker.ld index 41e04872..70dee721 100644 --- a/linker.ld +++ b/linker.ld @@ -1033,6 +1033,7 @@ SECTIONS { data/strings.o(.rodata); data/sprite_table.o(.rodata); data/data_089FC6C4.o(.rodata); + src/code_080B1520.o(.rodata); } >rom /* DWARF 2 sections */ diff --git a/src/code_080B1520.c b/src/code_080B1520.c index 389be1b4..1543aa33 100644 --- a/src/code_080B1520.c +++ b/src/code_080B1520.c @@ -1,6 +1,6 @@ #include "global.h" -typedef struct struct_08DE7D40 { +typedef struct EEPROMConfig { u32 unk_00; u16 size; u16 waitcnt; @@ -8,9 +8,9 @@ typedef struct struct_08DE7D40 { // u8 filler[3]; } EEPROMConfig; -extern EEPROMConfig* gEEPROMConfig; -extern EEPROMConfig gEEPROMConfig512; -extern EEPROMConfig gEEPROMConfig8k; +extern const EEPROMConfig* gEEPROMConfig; +const EEPROMConfig gEEPROMConfig512 = { 0x200, 0x40, 0x300, 0x6 }; +const EEPROMConfig gEEPROMConfig8k = { 0x2000, 0x400, 0x300, 0xe }; u16 sub_080B16AC(u16, u16*, u8); From abf4ecce50455cfe258d034ad1d3896380e84ecb Mon Sep 17 00:00:00 2001 From: Henny022p Date: Fri, 26 Feb 2021 23:08:05 +0100 Subject: [PATCH 2/3] extra global data --- data/data_089FC6C4.s | 1 - data/data_08DE7D58.s | 6 ++++++ linker.ld | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 data/data_08DE7D58.s diff --git a/data/data_089FC6C4.s b/data/data_089FC6C4.s index ce772176..78507def 100644 --- a/data/data_089FC6C4.s +++ b/data/data_089FC6C4.s @@ -10302,4 +10302,3 @@ gUnk_08DE7D18:: @ 08DE7D18 gUnk_08DE7D28:: @ 08DE7D28 .incbin "baserom.gba", 0xDE7D28, 0x0000018 - diff --git a/data/data_08DE7D58.s b/data/data_08DE7D58.s new file mode 100644 index 00000000..b36b3768 --- /dev/null +++ b/data/data_08DE7D58.s @@ -0,0 +1,6 @@ + + .section .rodata + .align 2 + +gUnk_08DE7D58:: @ 08DE7D58 + .incbin "baserom.gba", 0xDE7D58, 0x000004c diff --git a/linker.ld b/linker.ld index 70dee721..c141c87e 100644 --- a/linker.ld +++ b/linker.ld @@ -1034,6 +1034,7 @@ SECTIONS { data/sprite_table.o(.rodata); data/data_089FC6C4.o(.rodata); src/code_080B1520.o(.rodata); + data/data_08DE7D58.o(.rodata); } >rom /* DWARF 2 sections */ From 8fee68e0a28bc54dee580c7a5faf892d54f229a9 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Fri, 26 Feb 2021 23:32:02 +0100 Subject: [PATCH 3/3] matched eeprom rodata... --- data/data_089FC6C4.s | 2 +- data/data_08DE7D58.s | 6 ------ linker.ld | 1 - src/code_080B1520.c | 7 ++++++- 4 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 data/data_08DE7D58.s diff --git a/data/data_089FC6C4.s b/data/data_089FC6C4.s index 78507def..fb6fb436 100644 --- a/data/data_089FC6C4.s +++ b/data/data_089FC6C4.s @@ -10301,4 +10301,4 @@ gUnk_08DE7D18:: @ 08DE7D18 .incbin "baserom.gba", 0xDE7D18, 0x0000010 gUnk_08DE7D28:: @ 08DE7D28 - .incbin "baserom.gba", 0xDE7D28, 0x0000018 + .incbin "baserom.gba", 0xDE7D28, 0x000000C diff --git a/data/data_08DE7D58.s b/data/data_08DE7D58.s deleted file mode 100644 index b36b3768..00000000 --- a/data/data_08DE7D58.s +++ /dev/null @@ -1,6 +0,0 @@ - - .section .rodata - .align 2 - -gUnk_08DE7D58:: @ 08DE7D58 - .incbin "baserom.gba", 0xDE7D58, 0x000004c diff --git a/linker.ld b/linker.ld index c141c87e..70dee721 100644 --- a/linker.ld +++ b/linker.ld @@ -1034,7 +1034,6 @@ SECTIONS { data/sprite_table.o(.rodata); data/data_089FC6C4.o(.rodata); src/code_080B1520.o(.rodata); - data/data_08DE7D58.o(.rodata); } >rom /* DWARF 2 sections */ diff --git a/src/code_080B1520.c b/src/code_080B1520.c index 1543aa33..69cdff2d 100644 --- a/src/code_080B1520.c +++ b/src/code_080B1520.c @@ -7,11 +7,12 @@ typedef struct EEPROMConfig { u8 address_width; // u8 filler[3]; } EEPROMConfig; - +const char EEPROM_V124[] = "EEPROM_V124"; extern const EEPROMConfig* gEEPROMConfig; const EEPROMConfig gEEPROMConfig512 = { 0x200, 0x40, 0x300, 0x6 }; const EEPROMConfig gEEPROMConfig8k = { 0x2000, 0x400, 0x300, 0xe }; + u16 sub_080B16AC(u16, u16*, u8); u32 sub_080B1520(u16 unk_1) { @@ -200,6 +201,8 @@ u16 sub_080B180C(u16 unk_1, u16* unk_2) { return ret; } +const char EEPROM_NOWAIT[] = "EEPROM_NOWAIT"; + u32 sub_080B1864(u16 unk_1, u16* unk_2) { u8 i; u32 ret; @@ -241,3 +244,5 @@ u32 sub_080B18DC(u16 unk_1, u16* unk_2) { } return ret; } + +const char thing[0x1c] = "\xff\xff\xff\xff";