2021-03-07 04:58:59 +11:00
|
|
|
.arm
|
|
|
|
.global __start
|
|
|
|
__start:
|
|
|
|
b .Initialise
|
|
|
|
|
|
|
|
@ Filled in by gbafix
|
|
|
|
.fill 188, 1, 0
|
|
|
|
|
|
|
|
.Initialise:
|
|
|
|
@ Set interrupt handler
|
|
|
|
ldr r0, =InterruptHandlerSimple
|
|
|
|
ldr r1, =0x03007FFC
|
|
|
|
str r0, [r1]
|
|
|
|
|
2021-04-13 10:32:40 +10:00
|
|
|
|
|
|
|
@ copies iwram section in rom to iwram in ram
|
|
|
|
ldr r0, =__iwram_rom_start @ load memory address storing start of data for iwram in rom
|
|
|
|
ldr r1, =__iwram_data_start @ load memory address storing location of iwram in ram
|
|
|
|
ldr r2, =__iwram_rom_length_halfwords @ load number of 16 bit values to copy
|
|
|
|
swi 0x000B0000 @ call interrupt CpuSet.
|
|
|
|
@ r0: source
|
|
|
|
@ r1: destination
|
|
|
|
@ r2: length + size information
|
|
|
|
@
|
|
|
|
@ see: https://mgba-emu.github.io/gbatek/#swi-0bh-gbands7nds9dsi7dsi9---cpuset
|
|
|
|
|
2021-03-07 04:58:59 +11:00
|
|
|
@ load main and branch
|
|
|
|
ldr r0, =main
|
|
|
|
bx r0
|
2021-04-13 10:33:05 +10:00
|
|
|
.pool
|
2021-03-07 04:58:59 +11:00
|
|
|
|
|
|
|
.include "interrupt_simple.s"
|