mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-12 01:51:34 +11:00
don't use register 4
This commit is contained in:
parent
47b02d29cf
commit
a959e8e06b
|
@ -3,12 +3,12 @@
|
||||||
.global InterruptHandlerSimple
|
.global InterruptHandlerSimple
|
||||||
.align
|
.align
|
||||||
InterruptHandlerSimple:
|
InterruptHandlerSimple:
|
||||||
ldr r4, =0x04000200 @ interrupt enable register location
|
ldr r2, =0x04000200 @ interrupt enable register location
|
||||||
|
|
||||||
ldrh r1, [r4] @ load 16 bit interrupt enable to r1
|
ldrh r1, [r2] @ load 16 bit interrupt enable to r1
|
||||||
ldrh r3, [r4, #2] @ load 16 bit interrupt request to r3
|
ldrh r3, [r2, #2] @ load 16 bit interrupt request to r3
|
||||||
and r0, r1, r3 @ interrupts both enabled and requested
|
and r0, r1, r3 @ interrupts both enabled and requested
|
||||||
strh r0, [r4, #2] @ store to interrupt request
|
strh r0, [r2, #2] @ store to interrupt request
|
||||||
|
|
||||||
ldr r2, =0x03007FF8 @ load bios interrupt request location
|
ldr r2, =0x03007FF8 @ load bios interrupt request location
|
||||||
ldrh r1, [r2] @ load bios interrupt requests
|
ldrh r1, [r2] @ load bios interrupt requests
|
||||||
|
@ -22,10 +22,10 @@ InterruptHandlerSimple:
|
||||||
|
|
||||||
@ call the rust interrupt handler with r0 set to the triggered interrupts
|
@ call the rust interrupt handler with r0 set to the triggered interrupts
|
||||||
ldr r1, =__RUST_INTERRUPT_HANDLER
|
ldr r1, =__RUST_INTERRUPT_HANDLER
|
||||||
push {lr, r4-r11}
|
push {lr, r4-r9}
|
||||||
mov lr, pc
|
mov lr, pc
|
||||||
bx r1
|
bx r1
|
||||||
pop {lr, r4-r11}
|
pop {lr, r4-r9}
|
||||||
|
|
||||||
@ change back to interrupt mode
|
@ change back to interrupt mode
|
||||||
mrs r2, cpsr
|
mrs r2, cpsr
|
||||||
|
|
Loading…
Reference in a new issue