From 30b418c734011a358d6c8c477dfc314c26f9fb40 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Thu, 13 Mar 2014 02:38:35 +0100 Subject: [PATCH] add gotox, gotoy, and gotoxy --- asminc/atari5200.inc | 26 ++++++++++++++++++++++++++ libsrc/atari5200/gotox.s | 15 +++++++++++++++ libsrc/atari5200/gotoxy.s | 19 +++++++++++++++++++ libsrc/atari5200/gotoy.s | 13 +++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 libsrc/atari5200/gotox.s create mode 100644 libsrc/atari5200/gotoxy.s create mode 100644 libsrc/atari5200/gotoy.s diff --git a/asminc/atari5200.inc b/asminc/atari5200.inc index d6dd5e48e..d8bf93c7c 100644 --- a/asminc/atari5200.inc +++ b/asminc/atari5200.inc @@ -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 index 000000000..be8cfe540 --- /dev/null +++ b/libsrc/atari5200/gotox.s @@ -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 index 000000000..b4c86c95a --- /dev/null +++ b/libsrc/atari5200/gotoxy.s @@ -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 index 000000000..fcdd05e4c --- /dev/null +++ b/libsrc/atari5200/gotoy.s @@ -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 -- 2.39.5