]> git.sur5r.net Git - cc65/commitdiff
some CONIO fixes
authorChristian Groessler <chris@groessler.org>
Fri, 16 May 2014 00:10:19 +0000 (02:10 +0200)
committerChristian Groessler <chris@groessler.org>
Fri, 16 May 2014 00:10:19 +0000 (02:10 +0200)
asminc/atari5200.inc
libsrc/atari5200/conioscreen.s
libsrc/atari5200/cputc.s
libsrc/atari5200/gotox.s
libsrc/atari5200/gotoxy.s

index 6ae2483d27641587914d649514d6ec3b913631ed..10b71eba506a8c393c6cd0eb995718a4055434bf 100644 (file)
@@ -57,8 +57,8 @@ PADDL7  =  $18   ;POT7  "
 
 ; cc65 runtime zero page variables
 
-COLCRS_5200    =       $19
-ROWCRS_5200    =       $1A
+ROWCRS_5200    =       $19
+COLCRS_5200    =       $1A
 SAVMSC         =       $1B             ; pointer to screen memory (conio)
 
 ;-------------------------------------------------------------------------
index c9d95aa51ad991a8d4c0ae834857aba71fc390cc..ba47866ce906d0f7c33f723b3f9a1166726bd6df 100644 (file)
@@ -1,44 +1,57 @@
 
                 .include "atari5200.inc"
 
-SCREEN_BUF_SIZE        =       20 * 24
-SCREEN_BUF     =       $4000 - SCREEN_BUF_SIZE
+SCREEN_BUF_SIZE =       20 * 24
+SCREEN_BUF      =       $4000 - SCREEN_BUF_SIZE
 
                 .code
                 .export screen_setup_20x24
 
 screen_setup_20x24:
 
-               ; 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 display list
-
-               lda     #<dlist
-               sta     SDLSTL
-               lda     #>dlist
-               sta     SDLSTH
-
-               rts
+                ; 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
 
 
                 .segment "RODATA"
index 26527535dd4a9cb382662807bf64b9e88c99f839..976f910f0fd62c58a8a10da80bc6eda043b13c8b 100644 (file)
@@ -54,7 +54,7 @@ cputdirect:                     ; accepts screen code
 ; advance cursor
         inc     COLCRS_5200
         lda     COLCRS_5200
-        cmp     #40
+        cmp     #20
         bcc     plot
         lda     #0
         sta     COLCRS_5200
@@ -72,7 +72,6 @@ plot:   jsr     setcursor
         ldx     ROWCRS_5200
         rts
 
-; turn off cursor, update screen, turn on cursor
 putchar:
         pha                     ; save char
 
index be8cfe5400b39ce526ff6fd7adffd74f96cf61f2..99f7cfd22cf2f58fc95258f4098aa86906717cda 100644 (file)
@@ -10,6 +10,4 @@
 
 _gotox:
         sta     COLCRS_5200     ; Set X
-        lda     #0
-        sta     COLCRS_5200+1
         jmp     setcursor
index b4c86c95ab2e88f21bd68bec86055af3806c1271..a4b7c61d041df27068f6be31f8fa57d39e4d17ba 100644 (file)
@@ -14,6 +14,4 @@ _gotoxy:                        ; Set the cursor position
         sta     ROWCRS_5200     ; Set Y
         jsr     popa            ; Get X
         sta     COLCRS_5200     ; Set X
-        lda     #0
-        sta     COLCRS_5200+1   ;
         jmp     setcursor