]> git.sur5r.net Git - cc65/commitdiff
atari5200: add alternative conio screen (20x12 resolution)
authorChristian Groessler <chris@groessler.org>
Tue, 2 Apr 2019 19:31:12 +0000 (21:31 +0200)
committerOliver Schmidt <ol.sc@web.de>
Fri, 12 Apr 2019 10:49:38 +0000 (12:49 +0200)
libsrc/atari5200/conioscreen.s
libsrc/atari5200/cputc.s
libsrc/atari5200/extra/conioscreen_20x12.s [new file with mode: 0644]

index 2c6a8a4e472790bdae703d0792dc32b68a2f739b..a16557d2ac5f7966dcdae5a7a9a0a6d32b96443a 100644 (file)
@@ -7,7 +7,7 @@
 SCREEN_BUF_SIZE =       20 * 24
 SCREEN_BUF      =       $4000 - SCREEN_BUF_SIZE
 
-                .export screen_setup_20x24
+                .export screen_setup
                 .export screen_width, screen_height
                 .export conio_color
 
@@ -17,7 +17,7 @@ screen_height   =       24
 
                 .segment "ONCE"
 
-screen_setup_20x24:
+screen_setup:
 
                 ; initialize SAVMSC
                 lda     #<SCREEN_BUF
index 8fc00fcdcc3853e0d611b4de3d4619b94a176c38..b230df68c79a0d57238dbd7c8a898dbc545a0cc7 100644 (file)
         .importzp       screen_width, screen_height
         .importzp       ptr4
 
-        .constructor    screen_setup, 26
-        .import         screen_setup_20x24
-screen_setup    = screen_setup_20x24
-
+        .import         screen_setup
+        .constructor    screen_setup_constructor, 26
+screen_setup_constructor = screen_setup
 
 _cputcxy:
         pha                     ; Save C
diff --git a/libsrc/atari5200/extra/conioscreen_20x12.s b/libsrc/atari5200/extra/conioscreen_20x12.s
new file mode 100644 (file)
index 0000000..12043c7
--- /dev/null
@@ -0,0 +1,92 @@
+; setup alternative CONIO screen (20x12, Antic mode 7, BASIC mode 2)
+;
+; 02-Apr-2019, Christian Groessler <chris@groessler.org>
+
+                .include "atari5200.inc"
+
+SCREEN_BUF_SIZE =       20 * 12
+SCREEN_BUF      =       $4000 - SCREEN_BUF_SIZE
+
+                .export screen_setup
+                .export screen_width, screen_height
+                .export conio_color
+
+screen_width    =       20
+screen_height   =       12
+
+
+                .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     #40
+                sta     COLOR0
+                lda     #202
+                sta     COLOR1
+                lda     #148
+                sta     COLOR2
+                lda     #70
+                sta     COLOR3
+                lda     #0
+                sta     COLOR4
+
+                ; set display list
+
+                lda     #<dlist
+                sta     SDLSTL
+                lda     #>dlist
+                sta     SDLSTH
+
+                rts
+
+                .data
+
+conio_color:    .byte   0
+
+                .segment "DLIST"
+
+; display list for 20x12 text mode
+
+dlist:          .repeat 3
+                .byte   DL_BLK8
+                .endrepeat
+                
+                .byte   DL_CHR20x16x2 | DL_LMS
+                .word   SCREEN_BUF
+
+                .repeat 11
+                .byte   DL_CHR20x16x2
+                .endrepeat
+
+                .byte  DL_JVB
+                .word   dlist
+
+; end of display list
+
+.assert ((* >> 10) = (dlist >> 10)), error, "Display list crosses 1K boundary"
+
+                .end