From 90408448541485e00e75c522036ae9559bac7322 Mon Sep 17 00:00:00 2001 From: jmaargh Date: Mon, 16 Oct 2023 22:45:59 +0100 Subject: [PATCH] Reserve IWRAM space for BIOS use --- agb/gba.ld | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agb/gba.ld b/agb/gba.ld index 525260d9..2d2da5ec 100644 --- a/agb/gba.ld +++ b/agb/gba.ld @@ -7,9 +7,13 @@ EXTERN(__RUST_INTERRUPT_HANDLER) EXTERN(__agbabi_memset) EXTERN(__agbabi_memcpy) +/* The bios reserves the final 256 bytes of iwram for its exclusive use, so we + * need to avoid writing there */ +__bios_reserved_iwram = 256; + MEMORY { ewram (w!x) : ORIGIN = 0x02000000, LENGTH = 256K - iwram (w!x) : ORIGIN = 0x03000000, LENGTH = 32K + iwram (w!x) : ORIGIN = 0x03000000, LENGTH = 32K - __bios_reserved_iwram rom (rx) : ORIGIN = 0x08000000, LENGTH = 32M }