From 234db0da96270f3f10b25107ecb39bea98c7c8a7 Mon Sep 17 00:00:00 2001 From: GBA bot Date: Mon, 3 Jan 2022 23:27:31 +0000 Subject: [PATCH] Set waitstate to 0x4317 as is standard in most games --- agb/crt0.s | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agb/crt0.s b/agb/crt0.s index 9a20af8a..3bf46691 100644 --- a/agb/crt0.s +++ b/agb/crt0.s @@ -44,6 +44,11 @@ b .Initialise_mb @ see: https://mgba-emu.github.io/gbatek/#swi-0bh-gbands7nds9dsi7dsi9---cpuset .CommonInit: + @ set the waitstate control register to the normal value used in manufactured cartridges + ldr r0, =0x04000204 @ address for waitstate control register + ldr r1, =0x4317 @ WS0/ROM=3,1 clks; SRAM=8 clks; WS2/EEPROM: 8,8 clks; prefetch enabled + strh r1, [r0] + @ copies iwram section in rom to iwram in ram ldr r0, =__iwram_rom_start ldr r1, =__iwram_data_start