]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm610/crtc.s
atari5200: conio now uses just four colors altogether
[cc65] / libsrc / cbm610 / crtc.s
index 18670b9df37790b64707b23acc4a8898af8351ae..ad9ddefb56f60e8b3c9d1aa94f4a0475a84a8984 100644 (file)
@@ -4,55 +4,54 @@
 ; Write to the CRTC.
 ;
 
-       .export         write_crtc, read_crtc
-       .importzp       crtc
+        .export         write_crtc, read_crtc
+        .importzp       crtc, ktmp
 
-       .include        "cbm610.inc"
-       .include        "zeropage.inc"
+        .include        "cbm610.inc"
 
 
 ; Write a value to the CRTC. The index is in Y, the value in A
 
-.proc  write_crtc
-       sta     sedt1
-       lda     IndReg
-       pha
-       lda     #$0F
-       sta     IndReg
-       tya
-       ldy     #$00
-       sei
-       sta     (crtc),y
-       iny
-       lda     sedt1
-       sta     (crtc),y
-       cli
-       pla
-       sta     IndReg
-       lda     sedt1
-       rts
+.proc   write_crtc
+        sta     ktmp
+        lda     IndReg
+        pha
+        lda     #$0F
+        sta     IndReg
+        tya
+        ldy     #$00
+        sei
+        sta     (crtc),y
+        iny
+        lda     ktmp
+        sta     (crtc),y
+        cli
+        pla
+        sta     IndReg
+        lda     ktmp
+        rts
 .endproc
 
 
-.proc  read_crtc
-       sty     sedt1
-       lda     IndReg
-       pha
-       lda     #$0F
-       sta     IndReg
-       lda     sedt1
-       ldy     #$00
-       sei
-       sta     (crtc),y
-       iny
-               lda     (crtc),y
-       cli
-       tay
-       pla
-       sta     IndReg
-       tya
-       ldy     sedt1
-       rts
+.proc   read_crtc
+        sty     ktmp
+        lda     IndReg
+        pha
+        lda     #$0F
+        sta     IndReg
+        lda     ktmp
+        ldy     #$00
+        sei
+        sta     (crtc),y
+        iny
+        lda     (crtc),y
+        cli
+        tay
+        pla
+        sta     IndReg
+        tya
+        ldy     ktmp
+        rts
 .endproc