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-09-20 16:09:53 +00:00
|
|
|
.ifdef __ATARIXL__
|
|
|
|
.import __CHARGEN_START__
|
|
|
|
.include "romswitch.inc"
|
|
|
|
.endif
|
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:
|
2014-01-02 20:45:12 +00:00
|
|
|
lda VVBLKD
|
|
|
|
ldx VVBLKD+1
|
2013-05-09 11:56:54 +00:00
|
|
|
sta IRQInd+1
|
|
|
|
stx IRQInd+2
|
2014-01-02 20:45:12 +00:00
|
|
|
lda #7
|
2013-05-09 11:56:54 +00:00
|
|
|
ldy #<IRQStub
|
|
|
|
ldx #>IRQStub
|
|
|
|
jsr SETVBV
|
|
|
|
rts
|
2013-02-12 22:39:38 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.code
|
|
|
|
|
|
|
|
doneirq:
|
2014-01-02 20:45:12 +00:00
|
|
|
lda #7
|
2013-05-09 11:56:54 +00:00
|
|
|
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-09-19 20:36:22 +00:00
|
|
|
.ifdef __ATARIXL__
|
2013-09-20 16:09:53 +00:00
|
|
|
.ifdef CHARGEN_RELOC
|
|
|
|
lda CHBAS
|
|
|
|
pha
|
|
|
|
.endif
|
|
|
|
lda PORTB
|
|
|
|
pha
|
2013-10-01 09:32:08 +00:00
|
|
|
and #$FE
|
2013-09-20 16:09:53 +00:00
|
|
|
sta PORTB ; disable ROM
|
|
|
|
set_chbase >__CHARGEN_START__
|
2013-08-25 09:20:27 +00:00
|
|
|
.endif
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr callirq ; Call the functions
|
2013-09-19 20:36:22 +00:00
|
|
|
.ifdef __ATARIXL__
|
2013-09-20 16:09:53 +00:00
|
|
|
pla
|
|
|
|
sta PORTB ; restore old ROM setting
|
|
|
|
.ifdef CHARGEN_RELOC
|
|
|
|
pla
|
|
|
|
sta CHBAS
|
|
|
|
sta CHBASE
|
|
|
|
.endif
|
2013-08-25 09:20:27 +00:00
|
|
|
.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
|