1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

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.
This commit is contained in:
Oliver Schmidt 2016-06-05 14:58:38 +02:00
parent d670998814
commit 13482984ca
50 changed files with 120 additions and 152 deletions

View File

@ -6,12 +6,11 @@
; ;
.export _cclearxy, _cclear .export _cclearxy, _cclear
.import popa, _gotoxy, chlinedirect .import gotoxy, chlinedirect
_cclearxy: _cclearxy:
pha ; Save the length 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 pla ; Restore the length and run into _cclear
_cclear: _cclear:

View File

@ -6,15 +6,14 @@
; ;
.export _chlinexy, _chline, chlinedirect .export _chlinexy, _chline, chlinedirect
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.include "zeropage.inc" .include "zeropage.inc"
.include "apple2.inc" .include "apple2.inc"
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _chline
_chline: _chline:

View File

@ -10,7 +10,7 @@
.endif .endif
.export _cputcxy, _cputc .export _cputcxy, _cputc
.export cputdirect, newline, putchar .export cputdirect, newline, putchar
.import popa, _gotoxy, VTABZ .import gotoxy, VTABZ
.include "apple2.inc" .include "apple2.inc"
@ -29,9 +29,8 @@ initconio:
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Call this one, will pop params
jsr _gotoxy pla ; Restore C and run into _cputc
pla ; Restore C
_cputc: _cputc:
cmp #$0D ; Test for \r = carrage return cmp #$0D ; Test for \r = carrage return

View File

@ -6,14 +6,13 @@
; ;
.export _cvlinexy, _cvline, cvlinedirect .export _cvlinexy, _cvline, cvlinedirect
.import popa, _gotoxy, putchar, newline .import gotoxy, putchar, newline
.include "zeropage.inc" .include "zeropage.inc"
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _cvline
_cvline: _cvline:

View File

@ -5,11 +5,14 @@
; void __fastcall__ gotox (unsigned char x); ; void __fastcall__ gotox (unsigned char x);
; ;
.export _gotoxy, _gotox .export gotoxy, _gotoxy, _gotox
.import popa, VTABZ .import popa, VTABZ
.include "apple2.inc" .include "apple2.inc"
gotoxy:
jsr popa ; Get Y
_gotoxy: _gotoxy:
clc clc
adc WNDTOP adc WNDTOP

View File

@ -6,13 +6,12 @@
; ;
.export _cclearxy, _cclear .export _cclearxy, _cclear
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
_cclearxy: _cclearxy:
pha ; Save the length 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 pla ; Restore the length and run into _cclear
_cclear: _cclear:

View File

@ -6,7 +6,7 @@
; ;
.export _chlinexy, _chline .export _chlinexy, _chline
.import popa, _gotoxy, cputdirect, setcursor .import gotoxy, cputdirect, setcursor
.importzp tmp1 .importzp tmp1
.ifdef __ATARI5200__ .ifdef __ATARI5200__
@ -17,8 +17,7 @@ CHRCODE = $12+64
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length
_chline: _chline:

View File

@ -7,7 +7,7 @@
.export _cputcxy, _cputc .export _cputcxy, _cputc
.export plot, cputdirect, putchar .export plot, cputdirect, putchar
.import popa, _gotoxy, mul40 .import gotoxy, mul40
.importzp tmp4,ptr4 .importzp tmp4,ptr4
.import _revflag,setcursor .import _revflag,setcursor
@ -15,8 +15,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
_cputc: _cputc:

View File

@ -7,7 +7,7 @@
.include "atari.inc" .include "atari.inc"
.export _cvlinexy, _cvline .export _cvlinexy, _cvline
.import popa, _gotoxy, putchar, setcursor .import gotoxy, putchar, setcursor
.importzp tmp1 .importzp tmp1
.ifdef __ATARI5200__ .ifdef __ATARI5200__
@ -18,8 +18,7 @@ CHRCODE = $7C ; Vertical bar
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _cvline
_cvline: _cvline:

View File

@ -6,14 +6,17 @@
.include "atari.inc" .include "atari.inc"
.export _gotoxy .export gotoxy, _gotoxy
.import popa .import popa
.import setcursor .import setcursor
gotoxy:
jsr popa ; Get Y
_gotoxy: ; Set the cursor position _gotoxy: ; Set the cursor position
sta ROWCRS ; Set Y sta ROWCRS ; Set Y
jsr popa ; Get X jsr popa ; Get X
sta COLCRS ; Set X sta COLCRS ; Set X
lda #0 lda #0
sta COLCRS+1 ; sta COLCRS+1
jmp setcursor jmp setcursor

View File

@ -10,7 +10,7 @@
.export _cputcxy, _cputc .export _cputcxy, _cputc
.export plot, cputdirect, putchar .export plot, cputdirect, putchar
.import popa, _gotoxy, mul20 .import gotoxy, mul20
.importzp ptr4 .importzp ptr4
.import setcursor .import setcursor
@ -21,8 +21,7 @@ screen_setup = screen_setup_20x24
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
_cputc: _cputc:

View File

@ -6,10 +6,13 @@
.include "atari5200.inc" .include "atari5200.inc"
.export _gotoxy .export gotoxy, _gotoxy
.import popa .import popa
.import setcursor .import setcursor
gotoxy:
jsr popa ; Get Y
_gotoxy: ; Set the cursor position _gotoxy: ; Set the cursor position
sta ROWCRS_5200 ; Set Y sta ROWCRS_5200 ; Set Y
jsr popa ; Get X jsr popa ; Get X

View File

@ -8,7 +8,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import PLOT .import PLOT
.include "c128.inc" .include "c128.inc"
@ -21,8 +21,7 @@ newline = NEWLINE
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import PLOT .import PLOT
.include "plus4.inc" .include "plus4.inc"
@ -15,8 +15,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import PLOT .import PLOT
.include "c64.inc" .include "c64.inc"
@ -15,8 +15,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -12,7 +12,7 @@
.export soft80_newline, soft80_plot .export soft80_newline, soft80_plot
.export soft80_checkchar .export soft80_checkchar
.import popa, _gotoxy .import gotoxy
.import soft80_kplot .import soft80_kplot
.import soft80_internal_bgcolor, soft80_internal_cellcolor .import soft80_internal_bgcolor, soft80_internal_cellcolor
@ -25,8 +25,7 @@
soft80_cputcxy: soft80_cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -11,7 +11,7 @@
.export soft80mono_cputdirect, soft80mono_putchar .export soft80mono_cputdirect, soft80mono_putchar
.export soft80mono_newline, soft80mono_plot .export soft80mono_newline, soft80mono_plot
.import popa, _gotoxy .import gotoxy
.import soft80mono_kplot .import soft80mono_kplot
.import soft80mono_internal_bgcolor, soft80mono_internal_cellcolor .import soft80mono_internal_bgcolor, soft80mono_internal_cellcolor
@ -24,8 +24,7 @@
soft80mono_cputcxy: soft80mono_cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -6,13 +6,12 @@
; ;
.export _cclearxy, _cclear .export _cclearxy, _cclear
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
_cclearxy: _cclearxy:
pha ; Save the length 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 pla ; Restore the length and run into _cclear
_cclear: _cclear:
@ -24,7 +23,3 @@ L1: lda #$20 ; Blank - screen code
dec tmp1 dec tmp1
bne L1 bne L1
L9: rts L9: rts

View File

@ -6,13 +6,12 @@
; ;
.export _chlinexy, _chline .export _chlinexy, _chline
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1, chlinechar .importzp tmp1, chlinechar
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length
_chline: _chline:
@ -24,7 +23,3 @@ L1: lda #chlinechar ; Horizontal line, screen code
dec tmp1 dec tmp1
bne L1 bne L1
L9: rts L9: rts

View File

@ -6,13 +6,12 @@
; ;
.export _cvlinexy, _cvline .export _cvlinexy, _cvline
.import popa, _gotoxy, putchar, newline .import gotoxy, putchar, newline
.importzp tmp1, cvlinechar .importzp tmp1, cvlinechar
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _cvline
_cvline: _cvline:
@ -25,6 +24,3 @@ L1: lda #cvlinechar ; Vertical bar
dec tmp1 dec tmp1
bne L1 bne L1
L9: rts L9: rts

View File

@ -4,10 +4,13 @@
; void gotoxy (unsigned char x, unsigned char y); ; void gotoxy (unsigned char x, unsigned char y);
; ;
.export _gotoxy .export gotoxy, _gotoxy
.import popa, plot .import popa, plot
.importzp CURS_X, CURS_Y .importzp CURS_X, CURS_Y
gotoxy:
jsr popa ; Get Y
_gotoxy: _gotoxy:
sta CURS_Y ; Set Y sta CURS_Y ; Set Y
jsr popa ; Get X jsr popa ; Get X

View File

@ -8,7 +8,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import __VIDRAM_START__ .import __VIDRAM_START__
.import CURS_X: zp, CURS_Y: zp, CHARCOLOR: zp, RVS: zp .import CURS_X: zp, CURS_Y: zp, CHARCOLOR: zp, RVS: zp
.import SCREEN_PTR: zp, CRAM_PTR: zp .import SCREEN_PTR: zp, CRAM_PTR: zp
@ -22,8 +22,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -9,8 +9,7 @@
.export newline, plot .export newline, plot
.destructor setsyscursor .destructor setsyscursor
.import _gotoxy .import gotoxy
.import popa
.import PLOT .import PLOT
.import ktmp: zp, crtc: zp, CURS_X: zp, CURS_Y: zp, RVS: zp .import ktmp: zp, crtc: zp, CURS_X: zp, CURS_Y: zp, RVS: zp
@ -21,8 +20,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -6,14 +6,13 @@
; ;
.export _cputsxy, _cputs .export _cputsxy, _cputs
.import popa, _gotoxy, _cputc .import gotoxy, _cputc
.importzp ptr1, tmp1 .importzp ptr1, tmp1
_cputsxy: _cputsxy:
sta ptr1 ; Save s for later sta ptr1 ; Save s for later
stx ptr1+1 stx ptr1+1
jsr popa ; Get Y jsr gotoxy ; Set cursor, pop x and y
jsr _gotoxy ; Set cursor, pop x
jmp L0 ; Same as cputs... jmp L0 ; Same as cputs...
_cputs: sta ptr1 ; Save s _cputs: sta ptr1 ; Save s

View File

@ -6,15 +6,14 @@
; ;
.export _chlinexy, _chline .export _chlinexy, _chline
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
.include "gamate.inc" .include "gamate.inc"
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length
_chline: _chline:

View File

@ -5,7 +5,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import PLOT .import PLOT
.import xsize .import xsize
.import fontdata .import fontdata
@ -19,8 +19,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -6,15 +6,14 @@
; ;
.export _cvlinexy, _cvline .export _cvlinexy, _cvline
.import popa, _gotoxy, putchar, newline .import gotoxy, putchar, newline
.importzp tmp1 .importzp tmp1
.include "gamate.inc" .include "gamate.inc"
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _cvline
_cvline: _cvline:

View File

@ -2,12 +2,15 @@
; void gotoxy (unsigned char x, unsigned char y); ; void gotoxy (unsigned char x, unsigned char y);
; ;
.export _gotoxy .export gotoxy, _gotoxy
.import popa, plot .import popa, plot
.include "gamate.inc" .include "gamate.inc"
.include "extzp.inc" .include "extzp.inc"
gotoxy:
jsr popa ; Get X
_gotoxy: _gotoxy:
sta CURS_Y ; Set Y sta CURS_Y ; Set Y
jsr popa ; Get X jsr popa ; Get X

View File

@ -7,7 +7,7 @@
; void cclear (unsigned char length); ; void cclear (unsigned char length);
.export _cclearxy, _cclear .export _cclearxy, _cclear
.import popa, _gotoxy, fixcursor .import gotoxy, fixcursor
.importzp cursor_x, cursor_y, cursor_c .importzp cursor_x, cursor_y, cursor_c
.include "jumptab.inc" .include "jumptab.inc"
@ -15,8 +15,7 @@
_cclearxy: _cclearxy:
pha ; Save the length 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 pla ; Restore the length
_cclear: _cclear:

View File

@ -7,7 +7,7 @@
; void chline (unsigned char length); ; void chline (unsigned char length);
.export _chlinexy, _chline .export _chlinexy, _chline
.import popa, _gotoxy, fixcursor .import gotoxy, fixcursor
.importzp cursor_x, cursor_y, cursor_c .importzp cursor_x, cursor_y, cursor_c
.include "jumptab.inc" .include "jumptab.inc"
@ -15,8 +15,7 @@
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length
_chline: _chline:

View File

@ -23,8 +23,7 @@
; UPLINE = ?, KEY_UPARROW = GOTOY, ... ; UPLINE = ?, KEY_UPARROW = GOTOY, ...
.export _cputcxy, _cputc .export _cputcxy, _cputc
.import _gotoxy, fixcursor .import gotoxy, fixcursor
.import popa
.import xsize,ysize .import xsize,ysize
.importzp cursor_x, cursor_y, cursor_c, cursor_r .importzp cursor_x, cursor_y, cursor_c, cursor_r
@ -34,8 +33,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -7,7 +7,7 @@
; void cvline (unsigned char length); ; void cvline (unsigned char length);
.export _cvlinexy, _cvline .export _cvlinexy, _cvline
.import popa, _gotoxy, fixcursor .import gotoxy, fixcursor
.importzp cursor_x, cursor_y, cursor_r .importzp cursor_x, cursor_y, cursor_r
.include "jumptab.inc" .include "jumptab.inc"
@ -15,8 +15,7 @@
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length
_cvline: _cvline:

View File

@ -8,7 +8,7 @@
; void gotoy (unsigned char y); ; void gotoy (unsigned char y);
; void gotoxy (unsigned char x, unsigned char y); ; void gotoxy (unsigned char x, unsigned char y);
.export _gotox, _gotoy, _gotoxy, fixcursor .export _gotox, _gotoy, gotoxy, _gotoxy, fixcursor
.import popa .import popa
.importzp cursor_x, cursor_y, cursor_c, cursor_r .importzp cursor_x, cursor_y, cursor_c, cursor_r
@ -22,6 +22,9 @@ _gotoy:
sta cursor_r sta cursor_r
jmp fixcursor jmp fixcursor
gotoxy:
jsr popa
_gotoxy: _gotoxy:
sta cursor_r sta cursor_r
jsr popa jsr popa

View File

@ -6,13 +6,12 @@
; ;
.export _cclearxy, _cclear .export _cclearxy, _cclear
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
_cclearxy: _cclearxy:
pha ; Save the length 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 pla ; Restore the length and run into _cclear
_cclear: _cclear:

View File

@ -6,15 +6,14 @@
; ;
.export _chlinexy, _chline .export _chlinexy, _chline
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
.include "nes.inc" .include "nes.inc"
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length
_chline: _chline:

View File

@ -9,7 +9,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline .export newline
.constructor initconio .constructor initconio
.import popa, _gotoxy .import gotoxy
.import ppuinit, paletteinit, ppubuf_put .import ppuinit, paletteinit, ppubuf_put
.import setcursor .import setcursor
@ -23,8 +23,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -6,15 +6,14 @@
; ;
.export _cvlinexy, _cvline .export _cvlinexy, _cvline
.import popa, _gotoxy, putchar, newline .import gotoxy, putchar, newline
.importzp tmp1 .importzp tmp1
.include "nes.inc" .include "nes.inc"
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _cvline
_cvline: _cvline:

View File

@ -4,21 +4,19 @@
; void gotoxy (unsigned char x, unsigned char y); ; void gotoxy (unsigned char x, unsigned char y);
; ;
.export _gotoxy .export gotoxy, _gotoxy
.import setcursor .import setcursor
.import popa .import popa
.include "nes.inc" .include "nes.inc"
.proc _gotoxy gotoxy:
jsr popa ; Get Y
_gotoxy:
sta CURS_Y ; Set Y sta CURS_Y ; Set Y
jsr popa ; Get X jsr popa ; Get X
sta CURS_X ; Set X sta CURS_X ; Set X
tay tay
ldx CURS_Y ldx CURS_Y
jmp setcursor ; Set the cursor position jmp setcursor ; Set the cursor position
.endproc

View File

@ -9,13 +9,12 @@
; ;
.export _cclearxy, _cclear .export _cclearxy, _cclear
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
_cclearxy: _cclearxy:
pha ; Save the length 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 pla ; Restore the length and run into _cclear
_cclear: _cclear:

View File

@ -9,13 +9,12 @@
; ;
.export _chlinexy, _chline .export _chlinexy, _chline
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length
_chline: _chline:

View File

@ -8,13 +8,12 @@
; ;
.export _cvlinexy, _cvline .export _cvlinexy, _cvline
.import popa, _gotoxy, putchar, newline .import gotoxy, putchar, newline
.importzp tmp1 .importzp tmp1
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _cvline
_cvline: _cvline:

View File

@ -6,10 +6,13 @@
; ;
; void gotoxy (unsigned char x, unsigned char y); ; void gotoxy (unsigned char x, unsigned char y);
; ;
.export _gotoxy .export gotoxy, _gotoxy
.import popa, plot .import popa, plot
.include "extzp.inc" .include "extzp.inc"
gotoxy:
jsr popa ; Get Y
_gotoxy: _gotoxy:
sta CURS_Y ; Set Y sta CURS_Y ; Set Y
jsr popa ; Get X jsr popa ; Get X

View File

@ -73,8 +73,7 @@ ScrollLength = (ScrHeight - 1) * ScrollDist
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function
@ -157,7 +156,7 @@ putchar:
.macro osi_screen_funcs ScrBase, ScrRamSize, ScrFirstChar, \ .macro osi_screen_funcs ScrBase, ScrRamSize, ScrFirstChar, \
ScrWidth, ScrHeight, ScrollDist ScrWidth, ScrHeight, ScrollDist
.import popa, _gotoxy .import gotoxy
.import _memmove, _memset, pushax .import _memmove, _memset, pushax
.importzp ptr1 .importzp ptr1

View File

@ -6,15 +6,14 @@
; ;
.export _chlinexy, _chline .export _chlinexy, _chline
.import popa, _gotoxy, cputdirect .import gotoxy, cputdirect
.importzp tmp1 .importzp tmp1
.include "pce.inc" .include "pce.inc"
_chlinexy: _chlinexy:
pha ; Save the length 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 pla ; Restore the length
_chline: _chline:

View File

@ -5,7 +5,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import PLOT .import PLOT
.import xsize .import xsize
@ -16,8 +16,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -6,15 +6,14 @@
; ;
.export _cvlinexy, _cvline .export _cvlinexy, _cvline
.import popa, _gotoxy, putchar, newline .import gotoxy, putchar, newline
.importzp tmp1 .importzp tmp1
.include "pce.inc" .include "pce.inc"
_cvlinexy: _cvlinexy:
pha ; Save the length 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 pla ; Restore the length and run into _cvline
_cvline: _cvline:

View File

@ -2,12 +2,15 @@
; void gotoxy (unsigned char x, unsigned char y); ; void gotoxy (unsigned char x, unsigned char y);
; ;
.export _gotoxy .export gotoxy, _gotoxy
.import popa, plot .import popa, plot
.include "pce.inc" .include "pce.inc"
.include "extzp.inc" .include "extzp.inc"
gotoxy:
jsr popa ; Get Y
_gotoxy: _gotoxy:
sta CURS_Y ; Set Y sta CURS_Y ; Set Y
jsr popa ; Get X jsr popa ; Get X

View File

@ -7,14 +7,13 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.include "pet.inc" .include "pet.inc"
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import PLOT .import PLOT
.include "plus4.inc" .include "plus4.inc"
@ -15,8 +15,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function

View File

@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar .export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot .export newline, plot
.import popa, _gotoxy .import gotoxy
.import PLOT .import PLOT
.include "vic20.inc" .include "vic20.inc"
@ -15,8 +15,7 @@
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr gotoxy ; Set cursor, drop x and y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C pla ; Restore C
; Plot a character - also used as internal function ; Plot a character - also used as internal function