From 6b5c858b2069345532f64f3214721429ac91b2d9 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen Date: Thu, 7 Apr 2022 07:22:19 +0300 Subject: [PATCH] Cleanup --- libsrc/atari7800/clrscr.s | 23 ++++++++++++++++++----- libsrc/atari7800/cputc.s | 4 ++-- libsrc/atari7800/setcursor.s | 8 +++----- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/libsrc/atari7800/clrscr.s b/libsrc/atari7800/clrscr.s index 4d3873499..36af7cce2 100644 --- a/libsrc/atari7800/clrscr.s +++ b/libsrc/atari7800/clrscr.s @@ -4,7 +4,8 @@ .export _clrscr .import _screen - .import pusha0,pushax, __bzero + .import pusha0,pushax + .include "extzp.inc" .code @@ -12,10 +13,22 @@ lda #<(_screen) ldx #>(_screen) - jsr pushax - ldx #>(charsperline * screenrows) - lda #<(charsperline * screenrows) - jmp __bzero + sta ptr7800 + stx ptr7800+1 + ldx #screenrows +@L1: ldy #charsperline + lda #0 +@L2: sta (ptr7800),y + dey + bne @L2 + lda ptr7800 + clc + adc #charsperline + bcc @L3 + inc ptr7800+1 +@L3: dex + bne @L1 + rts .endproc diff --git a/libsrc/atari7800/cputc.s b/libsrc/atari7800/cputc.s index 773227c8a..d954921ff 100644 --- a/libsrc/atari7800/cputc.s +++ b/libsrc/atari7800/cputc.s @@ -152,8 +152,8 @@ umula0: sta ptr7800 bcc @L12 inx -@L12: clc - txa +@L12: txa + clc adc #>(_screen) sta ptr7800+1 diff --git a/libsrc/atari7800/setcursor.s b/libsrc/atari7800/setcursor.s index dda92f060..81a89144b 100644 --- a/libsrc/atari7800/setcursor.s +++ b/libsrc/atari7800/setcursor.s @@ -24,7 +24,7 @@ ; .export _setcursor - .export gotoxy, _gotoxy, _gotox, _gotoy, wherex, wherey + .export gotoxy, _gotoxy, _gotox, _gotoy, _wherex, _wherey .export CURS_X, CURS_Y .constructor init_cursor @@ -189,20 +189,18 @@ umula0: ;----------------------------------------------------------------------------- ; Get cursor X position ; - .proc wherex + .proc _wherex lda CURS_X - jsr pusha0 rts .endproc ;----------------------------------------------------------------------------- ; Get cursor Y position ; - .proc wherey + .proc _wherey lda CURS_Y - jsr pusha0 rts .endproc