From dfa049472da6cfd24ded41bb9dffb37ae03c460a Mon Sep 17 00:00:00 2001 From: StewBC Date: Fri, 30 Apr 2021 14:17:31 -0700 Subject: [PATCH] Text drawing works with modified font --- src/apple2/text.inc | 66 ++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/src/apple2/text.inc b/src/apple2/text.inc index 56305b2..3554b7a 100644 --- a/src/apple2/text.inc +++ b/src/apple2/text.inc @@ -31,13 +31,16 @@ read: lda PLACEHOLDER, x ; get the character in the string sec sbc #32 ; the font only starts at space (char 32 or $20) + beq :+ + sbc #9 ; gap after space asl ; mult by 16 as that's how wide a char is in bytes - asl + asl rol fontH - asl + asl rol fontH - asl + asl rol fontH ; srcPtr now points at the char but $0000 based +: adc #((64*8)-2) sta write + 2 - clc + clc inc sizeL ; move to the next character in the string dec dstPtrL ; see if 32 characters were done @@ -236,7 +242,7 @@ step: done: rts -.endproc +.endproc ;----------------------------------------------------------------------------- ; x has digit (5 means 1's, 4 means 10's, etc) @@ -247,7 +253,7 @@ done: adc score, x ; get the current digit cmp #'9'+1 ; has it rolled over bcc okay ; then simply increment - sec + sec sbc #10 sta score, x ; and save over the 9 lda #1 @@ -255,7 +261,7 @@ done: bmi over ; if it rolls over 999999 cpx #1 ; if the digit is now the 010000 (1) bne textAddScore ; no, then work with this digit - ldy lives + ldy lives cpy #9 ; max out at 9 lives (keeps cheat boot on-screen) bcs textAddScore inc lives ; yes, then add a life @@ -269,7 +275,7 @@ over: done: rts -.endproc +.endproc ;----------------------------------------------------------------------------- .proc textCheckHighScore @@ -285,14 +291,14 @@ done: bcc :- ; x is 5 or less, keep checking digits done: - rts + rts newHigh: ldx #5 ; copy the 6 score digits over the highscore digits : - lda score, x - sta highScore, x - dex + lda score, x + sta highScore, x + dex bpl :- lda #UI_COMPONENT_HIGHSCORE jmp uiUpdateComponent @@ -327,6 +333,6 @@ prntLoop: jmp prntLoop ;and print this character done: - rts + rts .endproc