2013-02-12 22:39:38 +00:00
|
|
|
;
|
|
|
|
; IRQ handling (Lynx version)
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export initirq, doneirq
|
|
|
|
.import callirq
|
2013-02-12 22:39:38 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "lynx.inc"
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
|
2016-03-06 20:26:22 +00:00
|
|
|
.segment "ONCE"
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
initirq:
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #<IRQStub
|
|
|
|
ldx #>IRQStub
|
|
|
|
sei
|
|
|
|
sta INTVECTL
|
|
|
|
stx INTVECTH
|
|
|
|
cli
|
|
|
|
rts
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.code
|
|
|
|
|
|
|
|
doneirq:
|
2013-05-09 11:56:54 +00:00
|
|
|
; as Lynx is a console there is not much point in releasing the IRQ
|
|
|
|
rts
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.segment "LOWCODE"
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
IRQStub:
|
2013-05-09 11:56:54 +00:00
|
|
|
phy
|
|
|
|
phx
|
|
|
|
pha
|
|
|
|
jsr callirq
|
|
|
|
lda INTSET
|
|
|
|
sta INTRST
|
|
|
|
pla
|
|
|
|
plx
|
|
|
|
ply
|
|
|
|
rti
|