1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00
cc65/libsrc/atari5200/conioscreen.s
Christian Groessler be6bba66a9 atari5200: conio now uses just four colors altogether
See discussion in PR #870.
2019-04-12 12:49:38 +02:00

93 lines
2.2 KiB
ArmAsm

; setup default CONIO screen (20x24, Antic mode 6, BASIC mode 1)
;
; 28-May-2014, Christian Groessler <chris@groessler.org>
.include "atari5200.inc"
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
screen_width = 20
screen_height = 24
.segment "ONCE"
screen_setup:
; initialize SAVMSC
lda #<SCREEN_BUF
sta SAVMSC
lda #>SCREEN_BUF
sta SAVMSC+1
; initialize cursor position
lda #0
sta COLCRS_5200
sta ROWCRS_5200
; clear screen buffer
ldy #<(SCREEN_BUF_SIZE-1)
ldx #>(SCREEN_BUF_SIZE-1)
clrscr: sta (SAVMSC),y
dey
cpy #$FF
bne clrscr
dex
cpx #$FF
bne clrscr
; set default colors
lda conio_colors
sta COLOR0
lda conio_colors+1
sta COLOR1
lda conio_colors+2
sta COLOR2
lda conio_colors+3
sta COLOR3
sta COLOR4 ; background
; set display list
lda #<dlist
sta SDLSTL
lda #>dlist
sta SDLSTH
rts
.data
conio_color: .byte 0
.segment "DLIST"
; display list for 20x24 text mode
dlist: .repeat 3
.byte DL_BLK8
.endrepeat
.byte DL_CHR20x8x2 | DL_LMS
.word SCREEN_BUF
.repeat 23
.byte DL_CHR20x8x2
.endrepeat
.byte DL_JVB
.word dlist
; end of display list
.assert ((* >> 10) = (dlist >> 10)), error, "Display list crosses 1K boundary"
.end