.import callirq
.include "atari.inc"
+.ifdef __ATARIXL__
+ .import __CHARGEN_START__
+ .include "romswitch.inc"
+.endif
; ------------------------------------------------------------------------
IRQStub:
cld ; Just to be sure
.ifdef __ATARIXL__
- pha
- lda PORTB
- pha
- and #$fe
- sta PORTB ; disable ROM @@@ TODO: update CHARGEN
+ pha
+.ifdef CHARGEN_RELOC
+ lda CHBAS
+ pha
+.endif
+ lda PORTB
+ pha
+ and #$fe
+ sta PORTB ; disable ROM
+ set_chbase >__CHARGEN_START__
.endif
jsr callirq ; Call the functions
.ifdef __ATARIXL__
- pla
- sta PORTB
- pla
+ pla
+ sta PORTB ; restore old ROM setting
+.ifdef CHARGEN_RELOC
+ pla
+ sta CHBAS
+ sta CHBASE
+.endif
+ pla
.endif
jmp IRQInd ; Jump to the saved IRQ vector