From 6b16b9919254f857c60f0f199deb307ea729db12 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen Date: Tue, 5 Apr 2022 10:35:59 +0300 Subject: [PATCH] Fix conflicts with some conio routines --- include/atari7800.h | 2 ++ libsrc/atari7800/cputc.s | 8 ++++---- libsrc/atari7800/setcursor.s | 21 ++++++++++++--------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/include/atari7800.h b/include/atari7800.h index 4fdaacfcc..3cbeedb8b 100644 --- a/include/atari7800.h +++ b/include/atari7800.h @@ -52,6 +52,8 @@ /* No support for dynamically loadable drivers */ #define DYN_DRV 0 +extern unsigned char get_tv(void); /* get TV system */ + #include <_tia.h> #define TIA (*(struct __tia*)0x0000) diff --git a/libsrc/atari7800/cputc.s b/libsrc/atari7800/cputc.s index 5f4346868..3cf8e9de1 100644 --- a/libsrc/atari7800/cputc.s +++ b/libsrc/atari7800/cputc.s @@ -10,7 +10,7 @@ .import _gotoxy, _gotox, _gotoy, tosaddax, tosumula0, pusha0 .import pushax .import _screen - .importzp ptr1 + .importzp ptr3 .import CURS_X, CURS_Y .include "atari7800.inc" @@ -132,12 +132,12 @@ txtcolor: lda #<(_screen) ldx #>(_screen) jsr tosaddax - sta ptr1 - stx ptr1+1 + sta ptr3 + stx ptr3+1 pla ldy #0 - sta (ptr1),y + sta (ptr3),y rts .endproc diff --git a/libsrc/atari7800/setcursor.s b/libsrc/atari7800/setcursor.s index 37ead5ca6..b283fdff0 100644 --- a/libsrc/atari7800/setcursor.s +++ b/libsrc/atari7800/setcursor.s @@ -24,11 +24,11 @@ ; .export _setcursor - .export _gotoxy, _gotox, _gotoy, wherex, wherey + .export gotoxy, _gotoxy, _gotox, _gotoy, wherex, wherey .export CURS_X, CURS_Y .constructor init_cursor - .importzp ptr1, sp + .importzp ptr3, sp .import _zones .import pusha, incsp1, pusha0, pushax, popax, tosumula0, incax5 .include "atari7800.inc" @@ -81,11 +81,11 @@ _cursorzone: clc adc #<_zones sta _cursorzone ; calculate new cursorzone - sta ptr1 + sta ptr3 txa adc #>_zones sta _cursorzone+1 - sta ptr1+1 + sta ptr3+1 rts .endproc @@ -112,7 +112,7 @@ _cursorzone: jsr calccursorzone ldy #1 lda #0 - sta (ptr1),y ; disable cursor + sta (ptr3),y ; disable cursor pla sta CURS_Y jsr calccursorzone @@ -120,7 +120,7 @@ _cursorzone: beq @L1 lda #30 ; enable cursor @L1: ldy #1 - sta (ptr1),y + sta (ptr3),y rts .endproc @@ -136,15 +136,15 @@ _cursorzone: tay lda _cursorzone ldx _cursorzone+1 - sta ptr1 - stx ptr1+1 + sta ptr3 + stx ptr3+1 tya ldy #3 clc rol rol rol - sta (ptr1),y + sta (ptr3),y rts .endproc @@ -160,6 +160,9 @@ _cursorzone: rts .endproc + .proc gotoxy + jmp _gotoxy + .endproc ;----------------------------------------------------------------------------- ; Get cursor X position ;