From 13482984ca38c5a34a51321d0806f3e4a73122ff Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sun, 5 Jun 2016 14:58:38 +0200
Subject: [PATCH] Introduced internal gotoxy that pops both parameters.
About all CONIO functions offering a <...>xy variant call
popa
_gotoxy
By providing an internal gotoxy variant that starts with a popa all those CONIO function can be shortened by 3 bytes. As soon as program calls more than one CONIO function this means an overall code size reduction.
---
libsrc/apple2/cclear.s | 5 ++---
libsrc/apple2/chline.s | 5 ++---
libsrc/apple2/cputc.s | 7 +++----
libsrc/apple2/cvline.s | 5 ++---
libsrc/apple2/gotoxy.s | 5 ++++-
libsrc/atari/cclear.s | 5 ++---
libsrc/atari/chline.s | 5 ++---
libsrc/atari/cputc.s | 5 ++---
libsrc/atari/cvline.s | 5 ++---
libsrc/atari/gotoxy.s | 7 +++++--
libsrc/atari5200/cputc.s | 5 ++---
libsrc/atari5200/gotoxy.s | 5 ++++-
libsrc/c128/cputc.s | 5 ++---
libsrc/c16/cputc.s | 5 ++---
libsrc/c64/cputc.s | 5 ++---
libsrc/c64/soft80_cputc.s | 5 ++---
libsrc/c64/soft80mono_cputc.s | 5 ++---
libsrc/cbm/cclear.s | 9 ++-------
libsrc/cbm/chline.s | 9 ++-------
libsrc/cbm/cvline.s | 8 ++------
libsrc/cbm/gotoxy.s | 5 ++++-
libsrc/cbm510/cputc.s | 5 ++---
libsrc/cbm610/cputc.s | 6 ++----
libsrc/conio/cputs.s | 5 ++---
libsrc/gamate/chline.s | 5 ++---
libsrc/gamate/cputc.s | 5 ++---
libsrc/gamate/cvline.s | 5 ++---
libsrc/gamate/gotoxy.s | 5 ++++-
libsrc/geos-common/conio/cclear.s | 5 ++---
libsrc/geos-common/conio/chline.s | 5 ++---
libsrc/geos-common/conio/cputc.s | 6 ++----
libsrc/geos-common/conio/cvline.s | 5 ++---
libsrc/geos-common/conio/gotoxy.s | 5 ++++-
libsrc/nes/cclear.s | 5 ++---
libsrc/nes/chline.s | 5 ++---
libsrc/nes/cputc.s | 5 ++---
libsrc/nes/cvline.s | 5 ++---
libsrc/nes/gotoxy.s | 10 ++++------
libsrc/osic1p/cclear.s | 5 ++---
libsrc/osic1p/chline.s | 5 ++---
libsrc/osic1p/cvline.s | 5 ++---
libsrc/osic1p/gotoxy.s | 5 ++++-
libsrc/osic1p/osiscreen.inc | 5 ++---
libsrc/pce/chline.s | 5 ++---
libsrc/pce/cputc.s | 5 ++---
libsrc/pce/cvline.s | 5 ++---
libsrc/pce/gotoxy.s | 5 ++++-
libsrc/pet/cputc.s | 5 ++---
libsrc/plus4/cputc.s | 5 ++---
libsrc/vic20/cputc.s | 5 ++---
50 files changed, 120 insertions(+), 152 deletions(-)
diff --git a/libsrc/apple2/cclear.s b/libsrc/apple2/cclear.s
index c06cb0812..4106752eb 100644
--- a/libsrc/apple2/cclear.s
+++ b/libsrc/apple2/cclear.s
@@ -6,12 +6,11 @@
;
.export _cclearxy, _cclear
- .import popa, _gotoxy, chlinedirect
+ .import gotoxy, chlinedirect
_cclearxy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cclear
_cclear:
diff --git a/libsrc/apple2/chline.s b/libsrc/apple2/chline.s
index dba094365..6cf77de1b 100644
--- a/libsrc/apple2/chline.s
+++ b/libsrc/apple2/chline.s
@@ -6,15 +6,14 @@
;
.export _chlinexy, _chline, chlinedirect
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.include "zeropage.inc"
.include "apple2.inc"
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _chline
_chline:
diff --git a/libsrc/apple2/cputc.s b/libsrc/apple2/cputc.s
index 2db2962f9..6607c6178 100644
--- a/libsrc/apple2/cputc.s
+++ b/libsrc/apple2/cputc.s
@@ -10,7 +10,7 @@
.endif
.export _cputcxy, _cputc
.export cputdirect, newline, putchar
- .import popa, _gotoxy, VTABZ
+ .import gotoxy, VTABZ
.include "apple2.inc"
@@ -29,9 +29,8 @@ initconio:
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy
- pla ; Restore C
+ jsr gotoxy ; Call this one, will pop params
+ pla ; Restore C and run into _cputc
_cputc:
cmp #$0D ; Test for \r = carrage return
diff --git a/libsrc/apple2/cvline.s b/libsrc/apple2/cvline.s
index 1ac3fad74..a26cc7063 100644
--- a/libsrc/apple2/cvline.s
+++ b/libsrc/apple2/cvline.s
@@ -6,14 +6,13 @@
;
.export _cvlinexy, _cvline, cvlinedirect
- .import popa, _gotoxy, putchar, newline
+ .import gotoxy, putchar, newline
.include "zeropage.inc"
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cvline
_cvline:
diff --git a/libsrc/apple2/gotoxy.s b/libsrc/apple2/gotoxy.s
index dc96ac75e..6755af8d8 100644
--- a/libsrc/apple2/gotoxy.s
+++ b/libsrc/apple2/gotoxy.s
@@ -5,11 +5,14 @@
; void __fastcall__ gotox (unsigned char x);
;
- .export _gotoxy, _gotox
+ .export gotoxy, _gotoxy, _gotox
.import popa, VTABZ
.include "apple2.inc"
+gotoxy:
+ jsr popa ; Get Y
+
_gotoxy:
clc
adc WNDTOP
diff --git a/libsrc/atari/cclear.s b/libsrc/atari/cclear.s
index ceb17aca5..7fe3f0f1b 100644
--- a/libsrc/atari/cclear.s
+++ b/libsrc/atari/cclear.s
@@ -6,13 +6,12 @@
;
.export _cclearxy, _cclear
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
_cclearxy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cclear
_cclear:
diff --git a/libsrc/atari/chline.s b/libsrc/atari/chline.s
index a096f35a0..194fe0bb3 100644
--- a/libsrc/atari/chline.s
+++ b/libsrc/atari/chline.s
@@ -6,7 +6,7 @@
;
.export _chlinexy, _chline
- .import popa, _gotoxy, cputdirect, setcursor
+ .import gotoxy, cputdirect, setcursor
.importzp tmp1
.ifdef __ATARI5200__
@@ -17,8 +17,7 @@ CHRCODE = $12+64
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
diff --git a/libsrc/atari/cputc.s b/libsrc/atari/cputc.s
index cd2aefe79..a06daa691 100644
--- a/libsrc/atari/cputc.s
+++ b/libsrc/atari/cputc.s
@@ -7,7 +7,7 @@
.export _cputcxy, _cputc
.export plot, cputdirect, putchar
- .import popa, _gotoxy, mul40
+ .import gotoxy, mul40
.importzp tmp4,ptr4
.import _revflag,setcursor
@@ -15,8 +15,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
_cputc:
diff --git a/libsrc/atari/cvline.s b/libsrc/atari/cvline.s
index da6c8dca4..1b4ba0b1b 100644
--- a/libsrc/atari/cvline.s
+++ b/libsrc/atari/cvline.s
@@ -7,7 +7,7 @@
.include "atari.inc"
.export _cvlinexy, _cvline
- .import popa, _gotoxy, putchar, setcursor
+ .import gotoxy, putchar, setcursor
.importzp tmp1
.ifdef __ATARI5200__
@@ -18,8 +18,7 @@ CHRCODE = $7C ; Vertical bar
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cvline
_cvline:
diff --git a/libsrc/atari/gotoxy.s b/libsrc/atari/gotoxy.s
index 1f00c3b23..aeaa732c0 100644
--- a/libsrc/atari/gotoxy.s
+++ b/libsrc/atari/gotoxy.s
@@ -6,14 +6,17 @@
.include "atari.inc"
- .export _gotoxy
+ .export gotoxy, _gotoxy
.import popa
.import setcursor
+gotoxy:
+ jsr popa ; Get Y
+
_gotoxy: ; Set the cursor position
sta ROWCRS ; Set Y
jsr popa ; Get X
sta COLCRS ; Set X
lda #0
- sta COLCRS+1 ;
+ sta COLCRS+1
jmp setcursor
diff --git a/libsrc/atari5200/cputc.s b/libsrc/atari5200/cputc.s
index 4bee0fba2..860eea88d 100644
--- a/libsrc/atari5200/cputc.s
+++ b/libsrc/atari5200/cputc.s
@@ -10,7 +10,7 @@
.export _cputcxy, _cputc
.export plot, cputdirect, putchar
- .import popa, _gotoxy, mul20
+ .import gotoxy, mul20
.importzp ptr4
.import setcursor
@@ -21,8 +21,7 @@ screen_setup = screen_setup_20x24
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
_cputc:
diff --git a/libsrc/atari5200/gotoxy.s b/libsrc/atari5200/gotoxy.s
index a4b7c61d0..24e2c2e35 100644
--- a/libsrc/atari5200/gotoxy.s
+++ b/libsrc/atari5200/gotoxy.s
@@ -6,10 +6,13 @@
.include "atari5200.inc"
- .export _gotoxy
+ .export gotoxy, _gotoxy
.import popa
.import setcursor
+gotoxy:
+ jsr popa ; Get Y
+
_gotoxy: ; Set the cursor position
sta ROWCRS_5200 ; Set Y
jsr popa ; Get X
diff --git a/libsrc/c128/cputc.s b/libsrc/c128/cputc.s
index e906c242a..9d269a47e 100644
--- a/libsrc/c128/cputc.s
+++ b/libsrc/c128/cputc.s
@@ -8,7 +8,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import PLOT
.include "c128.inc"
@@ -21,8 +21,7 @@ newline = NEWLINE
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/c16/cputc.s b/libsrc/c16/cputc.s
index a83a9c60b..49b3a84dd 100644
--- a/libsrc/c16/cputc.s
+++ b/libsrc/c16/cputc.s
@@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import PLOT
.include "plus4.inc"
@@ -15,8 +15,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/c64/cputc.s b/libsrc/c64/cputc.s
index 606d6f596..d6b49607a 100644
--- a/libsrc/c64/cputc.s
+++ b/libsrc/c64/cputc.s
@@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import PLOT
.include "c64.inc"
@@ -15,8 +15,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/c64/soft80_cputc.s b/libsrc/c64/soft80_cputc.s
index acbe5b560..f00f7792f 100644
--- a/libsrc/c64/soft80_cputc.s
+++ b/libsrc/c64/soft80_cputc.s
@@ -12,7 +12,7 @@
.export soft80_newline, soft80_plot
.export soft80_checkchar
- .import popa, _gotoxy
+ .import gotoxy
.import soft80_kplot
.import soft80_internal_bgcolor, soft80_internal_cellcolor
@@ -25,8 +25,7 @@
soft80_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/c64/soft80mono_cputc.s b/libsrc/c64/soft80mono_cputc.s
index c89362cb5..252de0319 100644
--- a/libsrc/c64/soft80mono_cputc.s
+++ b/libsrc/c64/soft80mono_cputc.s
@@ -11,7 +11,7 @@
.export soft80mono_cputdirect, soft80mono_putchar
.export soft80mono_newline, soft80mono_plot
- .import popa, _gotoxy
+ .import gotoxy
.import soft80mono_kplot
.import soft80mono_internal_bgcolor, soft80mono_internal_cellcolor
@@ -24,8 +24,7 @@
soft80mono_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/cbm/cclear.s b/libsrc/cbm/cclear.s
index 233c112c6..14b9d0e8b 100644
--- a/libsrc/cbm/cclear.s
+++ b/libsrc/cbm/cclear.s
@@ -6,13 +6,12 @@
;
.export _cclearxy, _cclear
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
_cclearxy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cclear
_cclear:
@@ -24,7 +23,3 @@ L1: lda #$20 ; Blank - screen code
dec tmp1
bne L1
L9: rts
-
-
-
-
diff --git a/libsrc/cbm/chline.s b/libsrc/cbm/chline.s
index fe7e7255d..73782f344 100644
--- a/libsrc/cbm/chline.s
+++ b/libsrc/cbm/chline.s
@@ -6,13 +6,12 @@
;
.export _chlinexy, _chline
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1, chlinechar
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
@@ -24,7 +23,3 @@ L1: lda #chlinechar ; Horizontal line, screen code
dec tmp1
bne L1
L9: rts
-
-
-
-
diff --git a/libsrc/cbm/cvline.s b/libsrc/cbm/cvline.s
index 2cf231e98..b6d2d86e6 100644
--- a/libsrc/cbm/cvline.s
+++ b/libsrc/cbm/cvline.s
@@ -6,13 +6,12 @@
;
.export _cvlinexy, _cvline
- .import popa, _gotoxy, putchar, newline
+ .import gotoxy, putchar, newline
.importzp tmp1, cvlinechar
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cvline
_cvline:
@@ -25,6 +24,3 @@ L1: lda #cvlinechar ; Vertical bar
dec tmp1
bne L1
L9: rts
-
-
-
diff --git a/libsrc/cbm/gotoxy.s b/libsrc/cbm/gotoxy.s
index 64c6bd21d..afc9c4d45 100644
--- a/libsrc/cbm/gotoxy.s
+++ b/libsrc/cbm/gotoxy.s
@@ -4,10 +4,13 @@
; void gotoxy (unsigned char x, unsigned char y);
;
- .export _gotoxy
+ .export gotoxy, _gotoxy
.import popa, plot
.importzp CURS_X, CURS_Y
+gotoxy:
+ jsr popa ; Get Y
+
_gotoxy:
sta CURS_Y ; Set Y
jsr popa ; Get X
diff --git a/libsrc/cbm510/cputc.s b/libsrc/cbm510/cputc.s
index bd8c364e8..73d45b422 100644
--- a/libsrc/cbm510/cputc.s
+++ b/libsrc/cbm510/cputc.s
@@ -8,7 +8,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import __VIDRAM_START__
.import CURS_X: zp, CURS_Y: zp, CHARCOLOR: zp, RVS: zp
.import SCREEN_PTR: zp, CRAM_PTR: zp
@@ -22,8 +22,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/cbm610/cputc.s b/libsrc/cbm610/cputc.s
index 831ead6d6..5888580ac 100644
--- a/libsrc/cbm610/cputc.s
+++ b/libsrc/cbm610/cputc.s
@@ -9,8 +9,7 @@
.export newline, plot
.destructor setsyscursor
- .import _gotoxy
- .import popa
+ .import gotoxy
.import PLOT
.import ktmp: zp, crtc: zp, CURS_X: zp, CURS_Y: zp, RVS: zp
@@ -21,8 +20,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/conio/cputs.s b/libsrc/conio/cputs.s
index 13cf84789..c9ca5df76 100644
--- a/libsrc/conio/cputs.s
+++ b/libsrc/conio/cputs.s
@@ -6,14 +6,13 @@
;
.export _cputsxy, _cputs
- .import popa, _gotoxy, _cputc
+ .import gotoxy, _cputc
.importzp ptr1, tmp1
_cputsxy:
sta ptr1 ; Save s for later
stx ptr1+1
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, pop x
+ jsr gotoxy ; Set cursor, pop x and y
jmp L0 ; Same as cputs...
_cputs: sta ptr1 ; Save s
diff --git a/libsrc/gamate/chline.s b/libsrc/gamate/chline.s
index 2d96c9d2f..4d4ebe2dc 100644
--- a/libsrc/gamate/chline.s
+++ b/libsrc/gamate/chline.s
@@ -6,15 +6,14 @@
;
.export _chlinexy, _chline
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
.include "gamate.inc"
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
diff --git a/libsrc/gamate/cputc.s b/libsrc/gamate/cputc.s
index c7b11c8c9..84742cb9d 100644
--- a/libsrc/gamate/cputc.s
+++ b/libsrc/gamate/cputc.s
@@ -5,7 +5,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import PLOT
.import xsize
.import fontdata
@@ -19,8 +19,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/gamate/cvline.s b/libsrc/gamate/cvline.s
index b22890815..89f49219a 100644
--- a/libsrc/gamate/cvline.s
+++ b/libsrc/gamate/cvline.s
@@ -6,15 +6,14 @@
;
.export _cvlinexy, _cvline
- .import popa, _gotoxy, putchar, newline
+ .import gotoxy, putchar, newline
.importzp tmp1
.include "gamate.inc"
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cvline
_cvline:
diff --git a/libsrc/gamate/gotoxy.s b/libsrc/gamate/gotoxy.s
index 407da1f2f..4a4871444 100644
--- a/libsrc/gamate/gotoxy.s
+++ b/libsrc/gamate/gotoxy.s
@@ -2,12 +2,15 @@
; void gotoxy (unsigned char x, unsigned char y);
;
- .export _gotoxy
+ .export gotoxy, _gotoxy
.import popa, plot
.include "gamate.inc"
.include "extzp.inc"
+gotoxy:
+ jsr popa ; Get X
+
_gotoxy:
sta CURS_Y ; Set Y
jsr popa ; Get X
diff --git a/libsrc/geos-common/conio/cclear.s b/libsrc/geos-common/conio/cclear.s
index 9857f70e8..903b9fe92 100644
--- a/libsrc/geos-common/conio/cclear.s
+++ b/libsrc/geos-common/conio/cclear.s
@@ -7,7 +7,7 @@
; void cclear (unsigned char length);
.export _cclearxy, _cclear
- .import popa, _gotoxy, fixcursor
+ .import gotoxy, fixcursor
.importzp cursor_x, cursor_y, cursor_c
.include "jumptab.inc"
@@ -15,8 +15,7 @@
_cclearxy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_cclear:
diff --git a/libsrc/geos-common/conio/chline.s b/libsrc/geos-common/conio/chline.s
index 328d01a01..1cf7a41f0 100644
--- a/libsrc/geos-common/conio/chline.s
+++ b/libsrc/geos-common/conio/chline.s
@@ -7,7 +7,7 @@
; void chline (unsigned char length);
.export _chlinexy, _chline
- .import popa, _gotoxy, fixcursor
+ .import gotoxy, fixcursor
.importzp cursor_x, cursor_y, cursor_c
.include "jumptab.inc"
@@ -15,8 +15,7 @@
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
diff --git a/libsrc/geos-common/conio/cputc.s b/libsrc/geos-common/conio/cputc.s
index 55674d583..014c2ed0b 100644
--- a/libsrc/geos-common/conio/cputc.s
+++ b/libsrc/geos-common/conio/cputc.s
@@ -23,8 +23,7 @@
; UPLINE = ?, KEY_UPARROW = GOTOY, ...
.export _cputcxy, _cputc
- .import _gotoxy, fixcursor
- .import popa
+ .import gotoxy, fixcursor
.import xsize,ysize
.importzp cursor_x, cursor_y, cursor_c, cursor_r
@@ -34,8 +33,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/geos-common/conio/cvline.s b/libsrc/geos-common/conio/cvline.s
index ade7f34c9..c12b8764b 100644
--- a/libsrc/geos-common/conio/cvline.s
+++ b/libsrc/geos-common/conio/cvline.s
@@ -7,7 +7,7 @@
; void cvline (unsigned char length);
.export _cvlinexy, _cvline
- .import popa, _gotoxy, fixcursor
+ .import gotoxy, fixcursor
.importzp cursor_x, cursor_y, cursor_r
.include "jumptab.inc"
@@ -15,8 +15,7 @@
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_cvline:
diff --git a/libsrc/geos-common/conio/gotoxy.s b/libsrc/geos-common/conio/gotoxy.s
index 48b413d5f..0519a7d59 100644
--- a/libsrc/geos-common/conio/gotoxy.s
+++ b/libsrc/geos-common/conio/gotoxy.s
@@ -8,7 +8,7 @@
; void gotoy (unsigned char y);
; void gotoxy (unsigned char x, unsigned char y);
- .export _gotox, _gotoy, _gotoxy, fixcursor
+ .export _gotox, _gotoy, gotoxy, _gotoxy, fixcursor
.import popa
.importzp cursor_x, cursor_y, cursor_c, cursor_r
@@ -22,6 +22,9 @@ _gotoy:
sta cursor_r
jmp fixcursor
+gotoxy:
+ jsr popa
+
_gotoxy:
sta cursor_r
jsr popa
diff --git a/libsrc/nes/cclear.s b/libsrc/nes/cclear.s
index 233c112c6..7a2413826 100644
--- a/libsrc/nes/cclear.s
+++ b/libsrc/nes/cclear.s
@@ -6,13 +6,12 @@
;
.export _cclearxy, _cclear
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
_cclearxy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cclear
_cclear:
diff --git a/libsrc/nes/chline.s b/libsrc/nes/chline.s
index 5f6e67c8f..d68a77df9 100644
--- a/libsrc/nes/chline.s
+++ b/libsrc/nes/chline.s
@@ -6,15 +6,14 @@
;
.export _chlinexy, _chline
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
.include "nes.inc"
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
diff --git a/libsrc/nes/cputc.s b/libsrc/nes/cputc.s
index 5bcdc7994..209d22db2 100644
--- a/libsrc/nes/cputc.s
+++ b/libsrc/nes/cputc.s
@@ -9,7 +9,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline
.constructor initconio
- .import popa, _gotoxy
+ .import gotoxy
.import ppuinit, paletteinit, ppubuf_put
.import setcursor
@@ -23,8 +23,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/nes/cvline.s b/libsrc/nes/cvline.s
index 3ab93f34a..d564a25cb 100644
--- a/libsrc/nes/cvline.s
+++ b/libsrc/nes/cvline.s
@@ -6,15 +6,14 @@
;
.export _cvlinexy, _cvline
- .import popa, _gotoxy, putchar, newline
+ .import gotoxy, putchar, newline
.importzp tmp1
.include "nes.inc"
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cvline
_cvline:
diff --git a/libsrc/nes/gotoxy.s b/libsrc/nes/gotoxy.s
index a670962fc..3460aad19 100644
--- a/libsrc/nes/gotoxy.s
+++ b/libsrc/nes/gotoxy.s
@@ -4,21 +4,19 @@
; void gotoxy (unsigned char x, unsigned char y);
;
- .export _gotoxy
+ .export gotoxy, _gotoxy
.import setcursor
.import popa
.include "nes.inc"
-.proc _gotoxy
+gotoxy:
+ jsr popa ; Get Y
+_gotoxy:
sta CURS_Y ; Set Y
jsr popa ; Get X
sta CURS_X ; Set X
tay
ldx CURS_Y
jmp setcursor ; Set the cursor position
-
-.endproc
-
-
diff --git a/libsrc/osic1p/cclear.s b/libsrc/osic1p/cclear.s
index 2036c38e0..f7e9b2984 100644
--- a/libsrc/osic1p/cclear.s
+++ b/libsrc/osic1p/cclear.s
@@ -9,13 +9,12 @@
;
.export _cclearxy, _cclear
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
_cclearxy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cclear
_cclear:
diff --git a/libsrc/osic1p/chline.s b/libsrc/osic1p/chline.s
index be40d40af..ae2df5014 100644
--- a/libsrc/osic1p/chline.s
+++ b/libsrc/osic1p/chline.s
@@ -9,13 +9,12 @@
;
.export _chlinexy, _chline
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
diff --git a/libsrc/osic1p/cvline.s b/libsrc/osic1p/cvline.s
index 84e5a45bf..7a393bdc8 100644
--- a/libsrc/osic1p/cvline.s
+++ b/libsrc/osic1p/cvline.s
@@ -8,13 +8,12 @@
;
.export _cvlinexy, _cvline
- .import popa, _gotoxy, putchar, newline
+ .import gotoxy, putchar, newline
.importzp tmp1
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cvline
_cvline:
diff --git a/libsrc/osic1p/gotoxy.s b/libsrc/osic1p/gotoxy.s
index f76537349..b9666a722 100644
--- a/libsrc/osic1p/gotoxy.s
+++ b/libsrc/osic1p/gotoxy.s
@@ -6,10 +6,13 @@
;
; void gotoxy (unsigned char x, unsigned char y);
;
- .export _gotoxy
+ .export gotoxy, _gotoxy
.import popa, plot
.include "extzp.inc"
+gotoxy:
+ jsr popa ; Get Y
+
_gotoxy:
sta CURS_Y ; Set Y
jsr popa ; Get X
diff --git a/libsrc/osic1p/osiscreen.inc b/libsrc/osic1p/osiscreen.inc
index 66c5e9fb0..fc8324781 100644
--- a/libsrc/osic1p/osiscreen.inc
+++ b/libsrc/osic1p/osiscreen.inc
@@ -73,8 +73,7 @@ ScrollLength = (ScrHeight - 1) * ScrollDist
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
@@ -157,7 +156,7 @@ putchar:
.macro osi_screen_funcs ScrBase, ScrRamSize, ScrFirstChar, \
ScrWidth, ScrHeight, ScrollDist
- .import popa, _gotoxy
+ .import gotoxy
.import _memmove, _memset, pushax
.importzp ptr1
diff --git a/libsrc/pce/chline.s b/libsrc/pce/chline.s
index 8bf8f1626..3c6589375 100644
--- a/libsrc/pce/chline.s
+++ b/libsrc/pce/chline.s
@@ -6,15 +6,14 @@
;
.export _chlinexy, _chline
- .import popa, _gotoxy, cputdirect
+ .import gotoxy, cputdirect
.importzp tmp1
.include "pce.inc"
_chlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
diff --git a/libsrc/pce/cputc.s b/libsrc/pce/cputc.s
index 8d1cec8eb..cfe6a1a27 100644
--- a/libsrc/pce/cputc.s
+++ b/libsrc/pce/cputc.s
@@ -5,7 +5,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import PLOT
.import xsize
@@ -16,8 +16,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/pce/cvline.s b/libsrc/pce/cvline.s
index abd74a5c7..279c691a9 100644
--- a/libsrc/pce/cvline.s
+++ b/libsrc/pce/cvline.s
@@ -6,15 +6,14 @@
;
.export _cvlinexy, _cvline
- .import popa, _gotoxy, putchar, newline
+ .import gotoxy, putchar, newline
.importzp tmp1
.include "pce.inc"
_cvlinexy:
pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
+ jsr gotoxy ; Call this one, will pop params
pla ; Restore the length and run into _cvline
_cvline:
diff --git a/libsrc/pce/gotoxy.s b/libsrc/pce/gotoxy.s
index fb61646d1..dae9e6e43 100644
--- a/libsrc/pce/gotoxy.s
+++ b/libsrc/pce/gotoxy.s
@@ -2,12 +2,15 @@
; void gotoxy (unsigned char x, unsigned char y);
;
- .export _gotoxy
+ .export gotoxy, _gotoxy
.import popa, plot
.include "pce.inc"
.include "extzp.inc"
+gotoxy:
+ jsr popa ; Get Y
+
_gotoxy:
sta CURS_Y ; Set Y
jsr popa ; Get X
diff --git a/libsrc/pet/cputc.s b/libsrc/pet/cputc.s
index f38d2759a..9b2c22323 100644
--- a/libsrc/pet/cputc.s
+++ b/libsrc/pet/cputc.s
@@ -7,14 +7,13 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.include "pet.inc"
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/plus4/cputc.s b/libsrc/plus4/cputc.s
index a83a9c60b..49b3a84dd 100644
--- a/libsrc/plus4/cputc.s
+++ b/libsrc/plus4/cputc.s
@@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import PLOT
.include "plus4.inc"
@@ -15,8 +15,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
diff --git a/libsrc/vic20/cputc.s b/libsrc/vic20/cputc.s
index 7a1014c1c..43aacdae3 100644
--- a/libsrc/vic20/cputc.s
+++ b/libsrc/vic20/cputc.s
@@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
- .import popa, _gotoxy
+ .import gotoxy
.import PLOT
.include "vic20.inc"
@@ -15,8 +15,7 @@
_cputcxy:
pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
+ jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function
--
2.39.5