better names for ewram ewram init start end

This commit is contained in:
DizzyEggg
2024-12-15 21:43:46 +01:00
parent 06b1d1d4fc
commit 0b46886c0b
2 changed files with 14 additions and 11 deletions

View File

@@ -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);

View File

@@ -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)