From 6dc8621fa537901bc9b19731ab3cb70780ff71b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20M=C3=BChlstrasser?= Date: Sat, 29 Nov 2014 20:50:48 +0100 Subject: [PATCH] Set cursor in top left corner in clrscr() as documented in conio.h --- libsrc/c1p/clrscr.s | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/libsrc/c1p/clrscr.s b/libsrc/c1p/clrscr.s index 5550d1d75..ce221f31e 100644 --- a/libsrc/c1p/clrscr.s +++ b/libsrc/c1p/clrscr.s @@ -2,6 +2,8 @@ ; void clrscr (void); ; .export _clrscr + .import plot + .importzp CURS_X, CURS_Y .include "c1p.inc" ; Adapted from the Challenger Character Graphics @@ -10,16 +12,20 @@ BANKS = VIDEORAMSIZE / $100 _clrscr: - lda #$20 ;' ' - ldy #BANKS - ldx #$00 + lda #$20 ;' ' + ldy #BANKS + ldx #$00 staloc: - sta SCRNBASE,X + sta SCRNBASE,X inx - bne staloc - inc staloc+2 + bne staloc + inc staloc+2 dey - bne staloc - lda #>(SCRNBASE) ; load high byte - sta staloc+2 ; restore base address - rts + bne staloc + lda #>(SCRNBASE); load high byte + sta staloc+2 ; restore base address + + lda #$00 ; cursor in upper left corner + sta CURS_X + sta CURS_Y + jmp plot ; Set the cursor position -- 2.39.2