mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 22:30:12 +00:00
51 lines
498 B
ArmAsm
51 lines
498 B
ArmAsm
;
|
|
; 2023, Rumbledethumps
|
|
;
|
|
; Enables the C IRQ tools
|
|
|
|
.export initirq, doneirq
|
|
.import callirq, _exit
|
|
|
|
.include "rp6502.inc"
|
|
|
|
.segment "ONCE"
|
|
|
|
initirq:
|
|
lda #<handler
|
|
ldx #>handler
|
|
sei
|
|
sta $FFFE
|
|
stx $FFFF
|
|
cli
|
|
rts
|
|
|
|
.code
|
|
|
|
doneirq:
|
|
sei
|
|
rts
|
|
|
|
.segment "LOWCODE"
|
|
|
|
handler:
|
|
cld
|
|
phx
|
|
tsx
|
|
pha
|
|
inx
|
|
inx
|
|
lda $100,X
|
|
and #$10
|
|
bne break
|
|
phy
|
|
jsr callirq
|
|
ply
|
|
pla
|
|
plx
|
|
rti
|
|
|
|
break:
|
|
lda #$FF
|
|
sta RIA_A
|
|
jmp _exit
|