2013-02-12 22:39:38 +00:00
|
|
|
;
|
|
|
|
; IRQ handling (ATARI 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 "atari.inc"
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.segment "INIT"
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
initirq:
|
2013-05-09 11:56:54 +00:00
|
|
|
lda VVBLKI
|
|
|
|
ldx VVBLKI+1
|
|
|
|
sta IRQInd+1
|
|
|
|
stx IRQInd+2
|
|
|
|
lda #6
|
|
|
|
ldy #<IRQStub
|
|
|
|
ldx #>IRQStub
|
|
|
|
jsr SETVBV
|
|
|
|
rts
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.code
|
|
|
|
|
|
|
|
doneirq:
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #6
|
|
|
|
ldy IRQInd+1
|
|
|
|
ldx IRQInd+2
|
|
|
|
jsr SETVBV
|
|
|
|
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
|
|
|
cld ; Just to be sure
|
2013-08-25 09:20:27 +00:00
|
|
|
.if .defined(__ATARIXL__)
|
|
|
|
pha
|
|
|
|
lda PORTB
|
|
|
|
pha
|
|
|
|
and #$fe
|
|
|
|
sta PORTB ; disable ROM @@@ TODO: update CHARGEN
|
|
|
|
.endif
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr callirq ; Call the functions
|
2013-08-25 09:20:27 +00:00
|
|
|
.if .defined(__ATARIXL__)
|
|
|
|
pla
|
|
|
|
sta PORTB
|
|
|
|
pla
|
|
|
|
.endif
|
2013-05-09 11:56:54 +00:00
|
|
|
jmp IRQInd ; Jump to the saved IRQ vector
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.data
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
IRQInd: jmp $0000
|