atari5200: conio now uses just four colors altogether
See discussion in PR #870.
This commit is contained in:
committed by
Oliver Schmidt
parent
79b9a8d2df
commit
be6bba66a9
@@ -1 +1,37 @@
|
||||
.include "../atari/bgcolor.s"
|
||||
;
|
||||
; Christian Groessler, 05-Apr-2019
|
||||
;
|
||||
|
||||
.import conio_colors
|
||||
.export _bgcolor
|
||||
|
||||
.include "atari5200.inc"
|
||||
|
||||
.constructor init_old_bgcolor
|
||||
|
||||
.bss
|
||||
|
||||
old_bg_color:
|
||||
.res 1
|
||||
|
||||
.code
|
||||
|
||||
_bgcolor:
|
||||
and #3
|
||||
tax
|
||||
lda conio_colors,x
|
||||
ldx old_bg_color
|
||||
sta COLOR4 ; set new value
|
||||
sta old_bg_color
|
||||
txa
|
||||
ldx #0 ; fix X
|
||||
rts
|
||||
|
||||
.segment "ONCE"
|
||||
|
||||
init_old_bgcolor:
|
||||
lda conio_colors+3 ; see also conioscreen.s for initialization
|
||||
sta old_bg_color
|
||||
rts
|
||||
|
||||
.end
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
SCREEN_BUF_SIZE = 20 * 24
|
||||
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
||||
|
||||
.import conio_colors
|
||||
.export screen_setup
|
||||
.export screen_width, screen_height
|
||||
.export conio_color
|
||||
@@ -43,16 +44,15 @@ clrscr: sta (SAVMSC),y
|
||||
|
||||
; set default colors
|
||||
|
||||
lda #40
|
||||
lda conio_colors
|
||||
sta COLOR0
|
||||
lda #202
|
||||
lda conio_colors+1
|
||||
sta COLOR1
|
||||
lda #148
|
||||
lda conio_colors+2
|
||||
sta COLOR2
|
||||
lda #70
|
||||
lda conio_colors+3
|
||||
sta COLOR3
|
||||
lda #0
|
||||
sta COLOR4
|
||||
sta COLOR4 ; background
|
||||
|
||||
; set display list
|
||||
|
||||
|
||||
@@ -82,8 +82,8 @@ putchar:
|
||||
sta ptr4+1
|
||||
pla ; get char again
|
||||
|
||||
; and #$C0 ; without this we are compatible with the old version. user must not try to output a char >= $3F
|
||||
ora conio_color
|
||||
and #$3F ; clear palette index bits
|
||||
ora conio_color ; use currently selected palette
|
||||
|
||||
ldy COLCRS_5200
|
||||
sta (ptr4),y
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
SCREEN_BUF_SIZE = 20 * 12
|
||||
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
||||
|
||||
.import conio_colors
|
||||
.export screen_setup
|
||||
.export screen_width, screen_height
|
||||
.export conio_color
|
||||
@@ -43,16 +44,15 @@ clrscr: sta (SAVMSC),y
|
||||
|
||||
; set default colors
|
||||
|
||||
lda #40
|
||||
lda conio_colors
|
||||
sta COLOR0
|
||||
lda #202
|
||||
lda conio_colors+1
|
||||
sta COLOR1
|
||||
lda #148
|
||||
lda conio_colors+2
|
||||
sta COLOR2
|
||||
lda #70
|
||||
lda conio_colors+3
|
||||
sta COLOR3
|
||||
lda #0
|
||||
sta COLOR4
|
||||
sta COLOR4 ; background
|
||||
|
||||
; set display list
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
; Christian Groessler, 02-Apr-2019
|
||||
;
|
||||
; unsigned char __fastcall__ textcolor (unsigned char color);
|
||||
;
|
||||
; "color" value is a palette index (0..3) or COLOR_xxx value (0..3)
|
||||
|
||||
.export _textcolor
|
||||
.import conio_color
|
||||
|
||||
Reference in New Issue
Block a user