]> git.sur5r.net Git - cc65/commitdiff
atari5200: changes from discussions in #870
authorChristian Groessler <chris@groessler.org>
Wed, 10 Apr 2019 20:15:27 +0000 (22:15 +0200)
committerOliver Schmidt <ol.sc@web.de>
Fri, 12 Apr 2019 10:49:38 +0000 (12:49 +0200)
- rename screen_setup to initconio
- use Greg King's version of bgcolor()

libsrc/atari5200/bgcolor.s
libsrc/atari5200/conioscreen.s
libsrc/atari5200/cputc.s
libsrc/atari5200/extra/conioscreen_20x12.s

index 127d26998639dc8966fbfdc7041fcd1346750d54..90db8892b98f7c1add5c5b3eae22674fefef2c69 100644 (file)
@@ -1,36 +1,26 @@
 ;
-; Christian Groessler, 05-Apr-2019
+; Greg King, 10-Apr-2019
 ;
 
         .export         _bgcolor
 
         .include        "atari5200.inc"
 
-        .constructor    init_old_bgcolor
+.data
 
-.bss
-
-old_bg_color:
-        .res    1
+old_bg_index:
+        .byte   COLOR_BLACK     ; see conioscreen.s for default palette
 
 .code
 
 _bgcolor:
-        and     #3
+        and     #$03
         tax
-        lda     COLOR0,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     COLOR0+3                ; see also conioscreen.s for initialization
-        sta     old_bg_color
+        ldy     COLOR0,x
+        lda     old_bg_index
+        sty     COLOR4          ; set new value
+        stx     old_bg_index
+        ldx     #0              ; fix high byte
         rts
 
-        .end
+.end
index 895e946ef06b9d12238b4680d9696a0bc4e26ed8..4e769b12683792c50e9aa2953e1b3f7cf6b79be4 100644 (file)
@@ -7,7 +7,7 @@
 SCREEN_BUF_SIZE =       20 * 24
 SCREEN_BUF      =       $4000 - SCREEN_BUF_SIZE
 
-                .export screen_setup
+                .export initconio
                 .export screen_width, screen_height
                 .export conio_color
 
@@ -17,7 +17,8 @@ screen_height   =       24
 
                 .segment "ONCE"
 
-screen_setup:
+; initialize color registers, display list, and screen memory
+initconio:
 
                 ; initialize SAVMSC
                 lda     #<SCREEN_BUF
@@ -62,9 +63,9 @@ clrscr:         sta     (SAVMSC),y
 
                 rts
 
-                .data
+                .bss
 
-conio_color:    .byte   0
+conio_color:    .res    1
 
                 .segment "DLIST"
 
index 6de397182bd584b50f53bb4997281925d3ced68f..3210f0a84da6307d40468623ac2be9aa8615484e 100644 (file)
@@ -15,9 +15,9 @@
         .importzp       screen_width, screen_height
         .importzp       ptr4
 
-        .import         screen_setup
-        .constructor    screen_setup_constructor, 26
-screen_setup_constructor = screen_setup
+        .import         initconio
+        .constructor    initconio_constructor
+initconio_constructor = initconio
 
 _cputcxy:
         pha                     ; Save C
index 9cde9826d7e95151b895c7f59352176bbb70a82a..b1e50aed7512dc0342083d04188b44b1bdcafcb7 100644 (file)
@@ -7,7 +7,7 @@
 SCREEN_BUF_SIZE =       20 * 12
 SCREEN_BUF      =       $4000 - SCREEN_BUF_SIZE
 
-                .export screen_setup
+                .export initconio
                 .export screen_width, screen_height
                 .export conio_color
 
@@ -17,7 +17,8 @@ screen_height   =       12
 
                 .segment "ONCE"
 
-screen_setup:
+; initialize color registers, display list, and screen memory
+initconio:
 
                 ; initialize SAVMSC
                 lda     #<SCREEN_BUF
@@ -62,9 +63,9 @@ clrscr:         sta     (SAVMSC),y
 
                 rts
 
-                .data
+                .bss
 
-conio_color:    .byte   0
+conio_color:    .res    1
 
                 .segment "DLIST"