]> git.sur5r.net Git - cc65/commitdiff
add gotox, gotoy, and gotoxy
authorChristian Groessler <chris@groessler.org>
Thu, 13 Mar 2014 01:38:35 +0000 (02:38 +0100)
committerChristian Groessler <chris@groessler.org>
Thu, 13 Mar 2014 01:38:35 +0000 (02:38 +0100)
asminc/atari5200.inc
libsrc/atari5200/gotox.s [new file with mode: 0644]
libsrc/atari5200/gotoxy.s [new file with mode: 0644]
libsrc/atari5200/gotoy.s [new file with mode: 0644]

index d6dd5e48e578eadfd786a24bdef09d9eb1849e3e..d8bf93c7ca2b630aa180195ded79785c7ef4064d 100644 (file)
@@ -1,4 +1,26 @@
 
+;-------------------------------------------------------------------------
+; ATASCII CHARACTER DEFS
+;-------------------------------------------------------------------------
+
+ATCLR   = $7D           ;CLEAR SCREEN CHARACTER
+ATRUB   = $7E           ;BACK SPACE (RUBOUT)
+ATTAB   = $7F           ;TAB
+ATEOL   = $9B           ;END-OF-LINE
+ATDELL  = $9C           ;delete line
+ATINSL  = $9D           ;insert line
+ATCTAB  = $9E           ;clear TAB
+ATSTAB  = $9F           ;set TAB
+ATBEL   = $FD           ;CONSOLE BELL
+ATDEL   = $FE           ;delete char.
+ATINS   = $FF           ;insert char.
+ATURW   = $1C           ;UP-ARROW
+ATDRW   = $1D           ;DOWN-ARROW
+ATLRW   = $1E           ;LEFT-ARROW
+ATRRW   = $1F           ;RIGHT-ARROW
+ATESC   = $1B           ;ESCAPE
+
+
 ;-------------------------------------------------------------------------
 ; Zero Page
 ;-------------------------------------------------------------------------
@@ -34,6 +56,10 @@ PADDL6  =  $17   ;POT6  "
 PADDL7  =  $18   ;POT7  "
 
 
+.importzp COLCRS_5200
+.importzp ROWCRS_5200
+
+
 ;-------------------------------------------------------------------------
 ; Page #2
 ;-------------------------------------------------------------------------
diff --git a/libsrc/atari5200/gotox.s b/libsrc/atari5200/gotox.s
new file mode 100644 (file)
index 0000000..be8cfe5
--- /dev/null
@@ -0,0 +1,15 @@
+;
+; Christian Groessler, 13-Mar-2014
+;
+; void gotox (unsigned char x);
+;
+
+        .include        "atari5200.inc"
+        .export         _gotox
+        .import         setcursor
+
+_gotox:
+        sta     COLCRS_5200     ; Set X
+        lda     #0
+        sta     COLCRS_5200+1
+        jmp     setcursor
diff --git a/libsrc/atari5200/gotoxy.s b/libsrc/atari5200/gotoxy.s
new file mode 100644 (file)
index 0000000..b4c86c9
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Christian Groessler, 13-Mar-2014
+;
+; void gotoxy (unsigned char x, unsigned char y);
+;
+
+        .include "atari5200.inc"
+
+        .export         _gotoxy
+        .import         popa
+        .import         setcursor
+
+_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
diff --git a/libsrc/atari5200/gotoy.s b/libsrc/atari5200/gotoy.s
new file mode 100644 (file)
index 0000000..fcdd05e
--- /dev/null
@@ -0,0 +1,13 @@
+;
+; Christian Groessler, 13-Mar-2014
+;
+; void gotoy (unsigned char y);
+;
+
+        .include        "atari5200.inc"
+        .export         _gotoy
+        .import         setcursor
+
+_gotoy:
+        sta     ROWCRS_5200     ; Set Y
+        jmp     setcursor