From c7080313746fafb082e29ffa65355030bf8f4aaa Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 14 Oct 2015 17:24:16 +0200 Subject: [PATCH] use 'soft80_internal_cellcolor' for the current cell color, and CHARCOLOR for the actual textcolor --- libsrc/c64/soft80_cgetc.s | 4 ++-- libsrc/c64/soft80_color.s | 10 +++++----- libsrc/c64/soft80_conio.s | 14 +++++++------- libsrc/c64/soft80_cputc.s | 12 ++++++------ libsrc/c64/soft80_kclrscr.s | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libsrc/c64/soft80_cgetc.s b/libsrc/c64/soft80_cgetc.s index ba16614af..5343027bb 100644 --- a/libsrc/c64/soft80_cgetc.s +++ b/libsrc/c64/soft80_cgetc.s @@ -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 diff --git a/libsrc/c64/soft80_color.s b/libsrc/c64/soft80_color.s index e84b6fa60..bbd666af7 100644 --- a/libsrc/c64/soft80_color.s +++ b/libsrc/c64/soft80_color.s @@ -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 diff --git a/libsrc/c64/soft80_conio.s b/libsrc/c64/soft80_conio.s index 06bebc907..d2dfb913e 100644 --- a/libsrc/c64/soft80_conio.s +++ b/libsrc/c64/soft80_conio.s @@ -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 diff --git a/libsrc/c64/soft80_cputc.s b/libsrc/c64/soft80_cputc.s index 92aa728de..1ded7ef6a 100644 --- a/libsrc/c64/soft80_cputc.s +++ b/libsrc/c64/soft80_cputc.s @@ -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 diff --git a/libsrc/c64/soft80_kclrscr.s b/libsrc/c64/soft80_kclrscr.s index 811ea665f..7c313afcf 100644 --- a/libsrc/c64/soft80_kclrscr.s +++ b/libsrc/c64/soft80_kclrscr.s @@ -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 -- 2.39.5