1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 19:29:37 +00:00
This commit is contained in:
Karri Kaksonen 2022-04-07 07:22:19 +03:00
parent 3f8c29d303
commit 6b5c858b20
3 changed files with 23 additions and 12 deletions

View File

@ -4,7 +4,8 @@
.export _clrscr .export _clrscr
.import _screen .import _screen
.import pusha0,pushax, __bzero .import pusha0,pushax
.include "extzp.inc"
.code .code
@ -12,10 +13,22 @@
lda #<(_screen) lda #<(_screen)
ldx #>(_screen) ldx #>(_screen)
jsr pushax sta ptr7800
ldx #>(charsperline * screenrows) stx ptr7800+1
lda #<(charsperline * screenrows) ldx #screenrows
jmp __bzero @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 .endproc

View File

@ -152,8 +152,8 @@ umula0:
sta ptr7800 sta ptr7800
bcc @L12 bcc @L12
inx inx
@L12: clc @L12: txa
txa clc
adc #>(_screen) adc #>(_screen)
sta ptr7800+1 sta ptr7800+1

View File

@ -24,7 +24,7 @@
; ;
.export _setcursor .export _setcursor
.export gotoxy, _gotoxy, _gotox, _gotoy, wherex, wherey .export gotoxy, _gotoxy, _gotox, _gotoy, _wherex, _wherey
.export CURS_X, CURS_Y .export CURS_X, CURS_Y
.constructor init_cursor .constructor init_cursor
@ -189,20 +189,18 @@ umula0:
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Get cursor X position ; Get cursor X position
; ;
.proc wherex .proc _wherex
lda CURS_X lda CURS_X
jsr pusha0
rts rts
.endproc .endproc
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Get cursor Y position ; Get cursor Y position
; ;
.proc wherey .proc _wherey
lda CURS_Y lda CURS_Y
jsr pusha0
rts rts
.endproc .endproc