2014-05-28 21:38:22 +00:00
|
|
|
; setup default CONIO screen (20x24, Antic mode 6, BASIC mode 1)
|
|
|
|
;
|
|
|
|
; 28-May-2014, Christian Groessler <chris@groessler.org>
|
2014-04-25 01:02:44 +00:00
|
|
|
|
|
|
|
.include "atari5200.inc"
|
|
|
|
|
2014-05-16 00:10:19 +00:00
|
|
|
SCREEN_BUF_SIZE = 20 * 24
|
|
|
|
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
2014-04-25 01:02:44 +00:00
|
|
|
|
2019-04-12 10:39:37 +00:00
|
|
|
.export screen_setup
|
2019-04-02 19:11:11 +00:00
|
|
|
.export screen_width, screen_height
|
|
|
|
.export conio_color
|
|
|
|
|
|
|
|
screen_width = 20
|
|
|
|
screen_height = 24
|
|
|
|
|
2014-04-25 01:02:44 +00:00
|
|
|
|
2016-03-06 20:26:22 +00:00
|
|
|
.segment "ONCE"
|
2015-10-09 19:44:20 +00:00
|
|
|
|
2019-04-10 20:15:27 +00:00
|
|
|
; initialize color registers, display list, and screen memory
|
2019-04-12 10:39:37 +00:00
|
|
|
screen_setup:
|
2014-04-25 01:02:44 +00:00
|
|
|
|
2014-05-16 00:10:19 +00:00
|
|
|
; 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
|
|
|
|
|
2019-04-09 12:34:28 +00:00
|
|
|
lda #GTIA_COLOR_WHITE
|
2014-05-16 00:10:19 +00:00
|
|
|
sta COLOR0
|
2019-04-09 12:34:28 +00:00
|
|
|
lda #GTIA_COLOR_LIGHTRED
|
2014-05-16 00:10:19 +00:00
|
|
|
sta COLOR1
|
2019-04-09 12:34:28 +00:00
|
|
|
lda #GTIA_COLOR_LIGHTGREEN
|
2014-05-16 00:10:19 +00:00
|
|
|
sta COLOR2
|
2019-04-09 12:34:28 +00:00
|
|
|
lda #GTIA_COLOR_BLACK
|
2014-05-16 00:10:19 +00:00
|
|
|
sta COLOR3
|
2019-04-04 23:26:34 +00:00
|
|
|
sta COLOR4 ; background
|
2014-05-16 00:10:19 +00:00
|
|
|
|
|
|
|
; set display list
|
|
|
|
|
|
|
|
lda #<dlist
|
|
|
|
sta SDLSTL
|
|
|
|
lda #>dlist
|
|
|
|
sta SDLSTH
|
|
|
|
|
|
|
|
rts
|
2014-04-25 01:02:44 +00:00
|
|
|
|
2019-04-10 20:15:27 +00:00
|
|
|
.bss
|
2019-04-02 19:11:11 +00:00
|
|
|
|
2019-04-10 20:15:27 +00:00
|
|
|
conio_color: .res 1
|
2014-04-25 01:02:44 +00:00
|
|
|
|
2018-01-19 14:18:43 +00:00
|
|
|
.segment "DLIST"
|
2014-04-25 01:02:44 +00:00
|
|
|
|
|
|
|
; display list for 20x24 text mode
|
|
|
|
|
|
|
|
dlist: .repeat 3
|
|
|
|
.byte DL_BLK8
|
|
|
|
.endrepeat
|
2022-04-17 14:06:22 +00:00
|
|
|
|
2014-04-25 01:02:44 +00:00
|
|
|
.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
|