]> git.sur5r.net Git - cc65/blobdiff - libsrc/vic20/color.s
Fixed a bug
[cc65] / libsrc / vic20 / color.s
index 03c8bef07ad783998cda73b2d5fd15e47f0ac9c8..4803df8247a28fa3c7082f53f34d7f657bd2f52a 100644 (file)
@@ -9,12 +9,11 @@
 
 
        .export         _textcolor, _bgcolor, _bordercolor
+       .importzp       tmp1
 
        .include        "vic20.inc"
 
-.bss
 
-clr_tmp:       .res    1       ; tempory storage for bitfield ops
 
 .code
 
@@ -30,12 +29,12 @@ _bgcolor:
        asl
        asl
        asl
-       sei     ; don't want anything messing around while we update
-       sta     clr_tmp
+       sta     tmp1
+       sei                     ; don't want anything messing around while we update
        lda     VIC_COLOR       ; get old value
        and     #$0F
        tax
-       ora     clr_tmp 
+       ora     tmp1
        sta     VIC_COLOR       ; set new value
        cli
        txa
@@ -48,12 +47,12 @@ _bgcolor:
 
 _bordercolor:
        and     #$07
-       sei     ; don't want anything messing around while we update
-       sta     clr_tmp
-               lda     VIC_COLOR   ; get old value
+       sta     tmp1
+       sei                     ; don't want anything messing around while we update
+               lda     VIC_COLOR       ; get old value
        and     #$F8
        tax
-       ora     clr_tmp
+       ora     tmp1
        sta     VIC_COLOR       ; set new value
        cli
        txa