Merge pull request #152 from gwilymk/set-waitstate-control-to-standard

Set waitstate to 0x4317 as is standard in most games
This commit is contained in:
Corwin 2022-01-03 23:53:06 +00:00 committed by GitHub
commit e8ca7754e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,6 +44,11 @@ b .Initialise_mb
@ see: https://mgba-emu.github.io/gbatek/#swi-0bh-gbands7nds9dsi7dsi9---cpuset @ see: https://mgba-emu.github.io/gbatek/#swi-0bh-gbands7nds9dsi7dsi9---cpuset
.CommonInit: .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 @ copies iwram section in rom to iwram in ram
ldr r0, =__iwram_rom_start ldr r0, =__iwram_rom_start
ldr r1, =__iwram_data_start ldr r1, =__iwram_data_start