1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-10 19:29:45 +00:00

fix initial text- and background colors

This commit is contained in:
mrdudz 2015-09-27 18:36:53 +02:00
parent 9e08c53b01
commit fba28f46f6
3 changed files with 15 additions and 15 deletions

View File

@ -25,15 +25,13 @@ soft80_textcolor:
asl a asl a
asl a asl a
ora __textcolor ora __textcolor
sta CHARCOLOR sta CHARCOLOR ; text/bg combo for new chars
txa ; get old value txa ; get old value
rts rts
soft80_bgcolor: soft80_bgcolor:
cmp __bgcolor
beq _donothing
ldx __bgcolor ; get old value ldx __bgcolor ; get old value
sta __bgcolor ; set new value sta __bgcolor ; set new value
asl a asl a
@ -62,8 +60,8 @@ lp2:
.scope .scope
lda soft80_vram+(page*$100),x lda soft80_vram+(page*$100),x
and #$0f and #$0f
cmp tmp1 ; old bg color ;cmp tmp1 ; old bg color
bne as ;bne as
; is old bg color ; is old bg color
; is space ; is space
;lda __bgcolor ;lda __bgcolor
@ -82,7 +80,6 @@ as:
cli cli
pla ; get old value pla ; get old value
_donothing:
rts rts

View File

@ -6,7 +6,7 @@
.destructor soft80_shutdown .destructor soft80_shutdown
.import soft80_kclrscr, soft80_plotinit .import soft80_kclrscr, soft80_plotinit
.import __textcolor, __bgcolor ; CHECK/FIX .import soft80_textcolor, soft80_bgcolor
.include "c64.inc" .include "c64.inc"
.include "soft80.inc" .include "soft80.inc"
@ -52,10 +52,12 @@ soft80_init:
jsr soft80_plotinit jsr soft80_plotinit
lda #1 lda 646 ; use current textcolor
sta __textcolor jsr soft80_textcolor
lda #0
sta __bgcolor lda VIC_BG_COLOR0 ; use current bgcolor
and #$0f
jsr soft80_bgcolor
jmp soft80_kclrscr jmp soft80_kclrscr

View File

@ -5,13 +5,14 @@
void main(void) void main(void)
{ {
int i, j; int i, j, n;
unsigned char xsize, ysize, n; unsigned char xsize, ysize, tcol;
clrscr(); clrscr();
screensize(&xsize, &ysize); screensize(&xsize, &ysize);
cputs("cc65 conio test"); cputs("cc65 conio test");
tcol = textcolor(1);
cputsxy(0, 2, "colors:" ); cputsxy(0, 2, "colors:" );
for (i = 3; i < 6; ++i) { for (i = 3; i < 6; ++i) {
gotoxy(i,i); gotoxy(i,i);
@ -20,7 +21,7 @@ void main(void)
cputc('X'); cputc('X');
} }
} }
textcolor(1); textcolor(tcol);
cprintf("\n\n\rscreensize is: %dx%d", xsize, ysize ); cprintf("\n\n\rscreensize is: %dx%d", xsize, ysize );