1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-10 19:29:45 +00:00

Set cursor in top left corner in clrscr()

as documented in conio.h
This commit is contained in:
Stephan Mühlstrasser 2014-11-29 20:50:48 +01:00
parent ac88639f4a
commit 6dc8621fa5

View File

@ -2,6 +2,8 @@
; void clrscr (void); ; void clrscr (void);
; ;
.export _clrscr .export _clrscr
.import plot
.importzp CURS_X, CURS_Y
.include "c1p.inc" .include "c1p.inc"
; Adapted from the Challenger Character Graphics ; Adapted from the Challenger Character Graphics
@ -10,16 +12,20 @@
BANKS = VIDEORAMSIZE / $100 BANKS = VIDEORAMSIZE / $100
_clrscr: _clrscr:
lda #$20 ;' ' lda #$20 ;' '
ldy #BANKS ldy #BANKS
ldx #$00 ldx #$00
staloc: staloc:
sta SCRNBASE,X sta SCRNBASE,X
inx inx
bne staloc bne staloc
inc staloc+2 inc staloc+2
dey dey
bne staloc bne staloc
lda #>(SCRNBASE) ; load high byte lda #>(SCRNBASE); load high byte
sta staloc+2 ; restore base address sta staloc+2 ; restore base address
rts
lda #$00 ; cursor in upper left corner
sta CURS_X
sta CURS_Y
jmp plot ; Set the cursor position