]> git.sur5r.net Git - cc65/blob - libsrc/atari5200/extra/conioscreen_20x12.s
12043c74c8df2351c951abfda951bed26cdf9ced
[cc65] / libsrc / atari5200 / extra / conioscreen_20x12.s
1 ; setup alternative CONIO screen (20x12, Antic mode 7, BASIC mode 2)
2 ;
3 ; 02-Apr-2019, Christian Groessler <chris@groessler.org>
4
5                 .include "atari5200.inc"
6
7 SCREEN_BUF_SIZE =       20 * 12
8 SCREEN_BUF      =       $4000 - SCREEN_BUF_SIZE
9
10                 .export screen_setup
11                 .export screen_width, screen_height
12                 .export conio_color
13
14 screen_width    =       20
15 screen_height   =       12
16
17
18                 .segment "ONCE"
19
20 screen_setup:
21
22                 ; initialize SAVMSC
23                 lda     #<SCREEN_BUF
24                 sta     SAVMSC
25                 lda     #>SCREEN_BUF
26                 sta     SAVMSC+1
27
28                 ; initialize cursor position
29                 lda     #0
30                 sta     COLCRS_5200
31                 sta     ROWCRS_5200
32
33                 ; clear screen buffer
34                 ldy     #<(SCREEN_BUF_SIZE-1)
35                 ldx     #>(SCREEN_BUF_SIZE-1)
36 clrscr:         sta     (SAVMSC),y
37                 dey
38                 cpy     #$FF
39                 bne     clrscr
40                 dex
41                 cpx     #$FF
42                 bne     clrscr
43
44                 ; set default colors
45
46                 lda     #40
47                 sta     COLOR0
48                 lda     #202
49                 sta     COLOR1
50                 lda     #148
51                 sta     COLOR2
52                 lda     #70
53                 sta     COLOR3
54                 lda     #0
55                 sta     COLOR4
56
57                 ; set display list
58
59                 lda     #<dlist
60                 sta     SDLSTL
61                 lda     #>dlist
62                 sta     SDLSTH
63
64                 rts
65
66                 .data
67
68 conio_color:    .byte   0
69
70                 .segment "DLIST"
71
72 ; display list for 20x12 text mode
73
74 dlist:          .repeat 3
75                 .byte   DL_BLK8
76                 .endrepeat
77                 
78                 .byte   DL_CHR20x16x2 | DL_LMS
79                 .word   SCREEN_BUF
80
81                 .repeat 11
82                 .byte   DL_CHR20x16x2
83                 .endrepeat
84
85                 .byte  DL_JVB
86                 .word   dlist
87
88 ; end of display list
89
90 .assert ((* >> 10) = (dlist >> 10)), error, "Display list crosses 1K boundary"
91
92                 .end