diff --git a/Makefile b/Makefile index 2828dc4b..e17925d4 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ endif #$(C_BUILDDIR)/need_interworking_file_name.o: CFLAGS += -mthumb-interwork $(C_BUILDDIR)/arm_proxy.o: CFLAGS += -mthumb-interwork -$(C_BUILDDIR)/code_080B1520.o: CFLAGS = -O1 -mthumb-interwork -Wimplicit -Wparentheses -Werror -Wno-multichar +$(C_BUILDDIR)/eeprom.o: CFLAGS = -O1 -mthumb-interwork -Wimplicit -Wparentheses -Werror -Wno-multichar C_SRCS := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c) C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) diff --git a/include/gba/eeprom.h b/include/gba/eeprom.h index 964f3c34..eccc2032 100644 --- a/include/gba/eeprom.h +++ b/include/gba/eeprom.h @@ -14,6 +14,7 @@ * @return 1 on invalid argument, 0 otherwise */ u32 EEPROMConfigure(u16 unk_1); +u32 EEPROMRead(u16 address, u16* data); u16 EEPROMCompare(u16 address, u16* data); u32 EEPROMWrite0_8k_Check(u16 address, u16* data); diff --git a/linker.ld b/linker.ld index 70dee721..9c6827c9 100644 --- a/linker.ld +++ b/linker.ld @@ -900,7 +900,7 @@ SECTIONS { asm/m4a_asm.o(.text); asm/m4a.o(.text); asm/libagbsyscall.o(.text); - src/code_080B1520.o(.text); + src/eeprom.o(.text); *libc.a:memcpy.o(.text); /* handwritten assembly in arm mode */ @@ -1033,7 +1033,7 @@ SECTIONS { data/strings.o(.rodata); data/sprite_table.o(.rodata); data/data_089FC6C4.o(.rodata); - src/code_080B1520.o(.rodata); + src/eeprom.o(.rodata); } >rom /* DWARF 2 sections */ diff --git a/src/code_080B1520.c b/src/eeprom.c similarity index 99% rename from src/code_080B1520.c rename to src/eeprom.c index d9118149..38f13943 100644 --- a/src/code_080B1520.c +++ b/src/eeprom.c @@ -8,6 +8,7 @@ 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 };