@ Cartridge header, start-up and IRQ handler for test programs built against libgba_shim. @ @ build_test_roms.py fills the logo (0x004-0x09F) and the complement check (0x0BD). @ The IRQ handler is what libgba's does for VBlankIntrWait: acknowledge IE & IF and set the @ same bits in the BIOS's IRQ check flags at 03007FF8h (GBATEK "BIOS Halt Functions"). .section .header, "ax", %progbits .arm .global _start _start: b rom_start .fill 156, 1, 0 @ logo, from build_test_roms.py .ascii "SHIMTEST\0\0\0\0" @ 0x0A0 title, 12 bytes .ascii "ZSHM" @ 0x0AC game code .ascii "00" @ 0x0B0 maker code .byte 0x96 @ 0x0B2 fixed value .byte 0x00 @ 0x0B3 main unit .byte 0x00 @ 0x0B4 device type .fill 7, 1, 0 @ 0x0B5 reserved .byte 0x00 @ 0x0BC version .byte 0x00 @ 0x0BD complement, from build_test_roms.py .hword 0 @ 0x0BE reserved rom_start: ldr r0, =__iwram_lma ldr r1, =__iwram_start ldr r2, =__iwram_end bl copy ldr r1, =__bss_start ldr r2, =__bss_end mov r3, #0 2: cmp r1, r2 strlo r3, [r1], #4 blo 2b ldr r0, =main mov lr, pc bx r0 3: b 3b copy: cmp r1, r2 ldrlo r3, [r0], #4 strlo r3, [r1], #4 blo copy bx lr .global irq_handler irq_handler: @ called by the BIOS with r0 = 04000000h mov r0, #0x04000000 ldr r1, [r0, #0x200] @ IE | IF << 16 and r1, r1, r1, lsr #16 add r2, r0, #0x200 strh r1, [r2, #2] @ IF: acknowledge ldr r2, =0x03007FF8 ldrh r3, [r2] orr r3, r3, r1 strh r3, [r2] bx lr .pool