]> git.sur5r.net Git - cc65/commitdiff
use 'soft80_internal_cellcolor' for the current cell color, and CHARCOLOR for the...
authormrdudz <mrdudz@users.noreply.github.com>
Wed, 14 Oct 2015 15:24:16 +0000 (17:24 +0200)
committermrdudz <mrdudz@users.noreply.github.com>
Wed, 14 Oct 2015 15:24:16 +0000 (17:24 +0200)
libsrc/c64/soft80_cgetc.s
libsrc/c64/soft80_color.s
libsrc/c64/soft80_conio.s
libsrc/c64/soft80_cputc.s
libsrc/c64/soft80_kclrscr.s

index ba16614afddc4588000a679dd7ceff52a9a9f9a7..5343027bbcbc175dc3b5510ff5b5c6e30236f2ab 100644 (file)
@@ -5,7 +5,7 @@
 ;
 
         .export         soft80_cgetc
-        .import         soft80_internal_cursorxlsb
+        .import         soft80_internal_cellcolor, soft80_internal_cursorxlsb
         .import         cursor
         .importzp       tmp1
 
@@ -74,7 +74,7 @@ setcolor:
         ; save old value
         lda     (CRAM_PTR),y    ; vram
         sta     tmp1
-        lda     CHARCOLOR
+        lda     soft80_internal_cellcolor
         sta     (CRAM_PTR),y    ; vram
         rts
 
index e84b6fa6057047ea0a4b39dbe74ced9943b2a26c..bbd666af78afabddcab63c5d6085d9f73d2a4524 100644 (file)
@@ -6,7 +6,7 @@
 ;
 
         .export         soft80_textcolor, soft80_bgcolor
-        .import         soft80_internal_textcolor, soft80_internal_bgcolor
+        .import         soft80_internal_cellcolor, soft80_internal_bgcolor
         .import         soft80_internal_cursorxlsb
         .import         soft80_kplot, soft80_checkchar
 
@@ -16,8 +16,8 @@
         .include        "soft80.inc"
 
 soft80_textcolor:
-        ldx     soft80_internal_textcolor       ; get old value
-        sta     soft80_internal_textcolor       ; set new value
+        ldx     CHARCOLOR                       ; get old value
+        sta     CHARCOLOR                       ; set new value
 
 mkcharcolor:
         lda     soft80_internal_bgcolor
@@ -26,8 +26,8 @@ mkcharcolor:
         asl     a
         asl     a
         sta     tmp1                            ; remember new bg color (high nibble)
-        ora     soft80_internal_textcolor
-        sta     CHARCOLOR                       ; text/bg combo for new chars
+        ora     CHARCOLOR
+        sta     soft80_internal_cellcolor       ; text/bg combo for new chars
 
         txa                                     ; get old value
         rts
index 06bebc907a2c032016f7a09b17c0299646cfe88d..d2dfb913e80aa5b5afe28abb21dc4d80f8205326 100644 (file)
@@ -8,7 +8,7 @@
         .destructor     soft80_shutdown
 
         .import         soft80_kclrscr, soft80_charset
-        .export         soft80_internal_textcolor, soft80_internal_bgcolor
+        .export         soft80_internal_bgcolor, soft80_internal_cellcolor
         .export         soft80_internal_cursorxlsb
 
         .importzp       ptr1, ptr2, ptr3
@@ -25,9 +25,9 @@ soft80_init:
         ; colorram being set up as expected, which is why we cant use the
         ; _bgcolor and _textcolor functions here.
 
-        lda     646                             ; use current textcolor
-        and     #$0f
-        sta     soft80_internal_textcolor
+        lda     CHARCOLOR                       ; use current textcolor
+        and     #$0f                            ; make sure the upper nibble is 0s
+        sta     CHARCOLOR
 
         lda     VIC_BG_COLOR0                   ; use current bgcolor
         and     #$0f
@@ -36,8 +36,8 @@ soft80_init:
         asl     a
         asl     a
         asl     a
-        ora     soft80_internal_textcolor
-        sta     CHARCOLOR
+        ora     CHARCOLOR
+        sta     soft80_internal_cellcolor
 
         lda     #$3b
         sta     VIC_CTRL1
@@ -154,7 +154,7 @@ soft80_tables_data_end:
 ;        code has been run.
 
         .data           ; FIXME
-soft80_internal_textcolor:
+soft80_internal_cellcolor:
         .res 1
 soft80_internal_bgcolor:
         .res 1
index 92aa728de1f280a8f467c0e8b7cfeb67baac10e6..1ded7ef6aa7be2e1b8a9a8f3fffa897412f739dc 100644 (file)
@@ -13,7 +13,7 @@
         .import         popa, _gotoxy
 
         .import         soft80_kplot
-        .import         soft80_internal_bgcolor, soft80_internal_textcolor
+        .import         soft80_internal_bgcolor, soft80_internal_cellcolor
         .import         soft80_internal_cursorxlsb
 
         .importzp       tmp4,tmp3
@@ -148,7 +148,7 @@ draw_spaceinvers:
 .if SOFT80COLORVOODOO = 1
         jsr     soft80_putcolor
 .else
-        lda     CHARCOLOR
+        lda     soft80_internal_cellcolor
         sta     (CRAM_PTR),y    ; vram
 .endif
 
@@ -232,7 +232,7 @@ soft80_putchar:
 .if SOFT80COLORVOODOO = 1
         jsr     soft80_putcolor
 .else
-        lda     CHARCOLOR
+        lda     soft80_internal_cellcolor
         sta     (CRAM_PTR),y    ; vram
 .endif
 
@@ -436,7 +436,7 @@ soft80_putcolor:
         bne     @sk2            ; jump if odd xpos
 
         ; vram = textcol
-        lda     CHARCOLOR
+        lda     soft80_internal_cellcolor
         sta     (CRAM_PTR),y    ; vram
         rts
 
@@ -449,7 +449,7 @@ soft80_putcolor:
         beq     @sk3            ; jump if even xpos
 @sk2:
         ; colram = textcol
-        lda     soft80_internal_textcolor
+        lda     CHARCOLOR
         inc     $01             ; $35
         sta     (CRAM_PTR),y    ; colram
         stx     $01             ; $34
@@ -463,7 +463,7 @@ soft80_putcolor:
         stx     $01             ; $34
 @sk1:
         ; vram = textcol
-        lda     CHARCOLOR
+        lda     soft80_internal_cellcolor
         sta     (CRAM_PTR),y    ; vram
         rts
 
index 811ea665f36faa7a63861438b3afac4d9ae452e7..7c313afcf89bd5d2fa43add44c3c63b6d991777d 100644 (file)
@@ -6,7 +6,7 @@
 
         .export         soft80_kclrscr
         .import         soft80_kplot
-        .import         soft80_internal_bgcolor
+        .import         soft80_internal_bgcolor, soft80_internal_cellcolor
         .importzp       ptr1
 
         .include        "c64.inc"
@@ -48,7 +48,7 @@ soft80_kclrscr:
         lda     #$34                            ; enable RAM under I/O
         sta     $01
 
-        lda     CHARCOLOR
+        lda     soft80_internal_cellcolor
         and     #$f0
         ora     soft80_internal_bgcolor
         jsr     clear                           ; clear vram