]> git.sur5r.net Git - cc65/commitdiff
adapt to CHARGEN_RELOC
authorChristian Groessler <chris@groessler.org>
Fri, 20 Sep 2013 16:09:53 +0000 (18:09 +0200)
committerChristian Groessler <chris@groessler.org>
Fri, 20 Sep 2013 16:09:53 +0000 (18:09 +0200)
libsrc/atari/irq.s

index 3fbdc971b0b870ae50342c7bf573a1d8d58480ec..4a266630c3be6a40969a3797ea8b611c0cb7e9bf 100644 (file)
@@ -6,6 +6,10 @@
         .import         callirq
 
         .include        "atari.inc"
+.ifdef __ATARIXL__
+        .import         __CHARGEN_START__
+        .include        "romswitch.inc"
+.endif
 
 ; ------------------------------------------------------------------------
 
@@ -40,17 +44,27 @@ doneirq:
 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