From fba28f46f6b71b1861db902291251d50facdb0de Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sun, 27 Sep 2015 18:36:53 +0200 Subject: [PATCH] fix initial text- and background colors --- libsrc/c64/soft80_color.s | 9 +++------ libsrc/c64/soft80_conio.s | 12 +++++++----- testcode/lib/conio.c | 9 +++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libsrc/c64/soft80_color.s b/libsrc/c64/soft80_color.s index 553bc7f29..c176eca7f 100644 --- a/libsrc/c64/soft80_color.s +++ b/libsrc/c64/soft80_color.s @@ -25,15 +25,13 @@ soft80_textcolor: asl a asl a ora __textcolor - sta CHARCOLOR + sta CHARCOLOR ; text/bg combo for new chars txa ; get old value rts soft80_bgcolor: - cmp __bgcolor - beq _donothing ldx __bgcolor ; get old value sta __bgcolor ; set new value asl a @@ -62,8 +60,8 @@ lp2: .scope lda soft80_vram+(page*$100),x and #$0f - cmp tmp1 ; old bg color - bne as + ;cmp tmp1 ; old bg color + ;bne as ; is old bg color ; is space ;lda __bgcolor @@ -82,7 +80,6 @@ as: cli pla ; get old value -_donothing: rts diff --git a/libsrc/c64/soft80_conio.s b/libsrc/c64/soft80_conio.s index 20d9926de..eb05e4e8b 100644 --- a/libsrc/c64/soft80_conio.s +++ b/libsrc/c64/soft80_conio.s @@ -6,7 +6,7 @@ .destructor soft80_shutdown .import soft80_kclrscr, soft80_plotinit - .import __textcolor, __bgcolor ; CHECK/FIX + .import soft80_textcolor, soft80_bgcolor .include "c64.inc" .include "soft80.inc" @@ -52,10 +52,12 @@ soft80_init: jsr soft80_plotinit - lda #1 - sta __textcolor - lda #0 - sta __bgcolor + lda 646 ; use current textcolor + jsr soft80_textcolor + + lda VIC_BG_COLOR0 ; use current bgcolor + and #$0f + jsr soft80_bgcolor jmp soft80_kclrscr diff --git a/testcode/lib/conio.c b/testcode/lib/conio.c index 6ec17eb1f..752687f34 100644 --- a/testcode/lib/conio.c +++ b/testcode/lib/conio.c @@ -5,13 +5,14 @@ void main(void) { - int i, j; - unsigned char xsize, ysize, n; + int i, j, n; + unsigned char xsize, ysize, tcol; clrscr(); screensize(&xsize, &ysize); - cputs("cc65 conio test"); + + tcol = textcolor(1); cputsxy(0, 2, "colors:" ); for (i = 3; i < 6; ++i) { gotoxy(i,i); @@ -20,7 +21,7 @@ void main(void) cputc('X'); } } - textcolor(1); + textcolor(tcol); cprintf("\n\n\rscreensize is: %dx%d", xsize, ysize ); -- 2.39.5