diff --git a/src/ui.credits.a b/src/ui.credits.a index a1a339b20..0d6ac010c 100644 --- a/src/ui.credits.a +++ b/src/ui.credits.a @@ -18,70 +18,14 @@ Credits lda OffscreenPage ror ; draw on offscreen page +LDADDR $8000 - jsr .DrawPage - jsr ShowOtherPage - jsr WaitForKeyFor30Seconds - jsr ShowOtherPage - bit CLEARKBD - clc + jsr DrawPage ; draw credits + jsr ShowOtherPage ; show credits + jsr WaitForKeyFor30Seconds; wait + bit CLEARKBD ; don't care about key + jsr ShowOtherPage ; back to previous page + clc ; if called from search mode, tell caller not to refresh rts .CreditsFile !byte 7 !text "CREDITS" - -.DrawPage -; A/Y contains address of character buffer -; carry bit clear -> draw on page 1 -; carry bit set -> draw on page 2 -; drawing starts at VTAB 0, HTAB 0 -; clobbers PTR -; clobbers A/X/Y -; preserves all flags, by a quirk of implementation - php - ldx #0 - stx VTAB - +STAY PTR -@drawLine - ldy #0 - sty HTAB -@parseLine - lda (PTR),y - cmp #$5B ; '[' at beginning on line - bne + ; ends the parsing - tya - beq @donePage -+ cmp #$0D - beq @doneParsingLine - cmp #$2A - bne + - lda #$10 - sta (PTR),y ; asterisk -> dot, small -+ cmp #$7E - bne + - lda #$11 - sta (PTR),y ; tilde -> dot, medium -+ iny - bne @parseLine -@doneParsingLine - sty SAVE - cpy #0 - beq @skip - ldx SAVE - +LDAY PTR - plp - php - jsr DrawBuffer -@skip inc SAVE ; skip carriage return - lda SAVE ; advance PTR to start of next line - clc - adc PTR - sta PTR - bcc + - inc PTR+1 -+ inc VTAB ; this will print 255 lines if you give it - bne @drawLine ; 255 lines, so don't do that -@donePage - plp - rts - } diff --git a/src/ui.font.a b/src/ui.font.a index b9d038115..09299d9d6 100644 --- a/src/ui.font.a +++ b/src/ui.font.a @@ -4,11 +4,67 @@ ; hi-res font drawing routines ; ; Public functions +; - DrawPage ; - Draw40Chars ; - DrawString ; - DrawBuffer ; +DrawPage +; A/Y contains address of character buffer +; carry bit clear -> draw on page 1 +; carry bit set -> draw on page 2 +; drawing starts at VTAB 0, HTAB 0 +; clobbers PTR +; clobbers A/X/Y +; preserves all flags, by a quirk of implementation + php + ldx #0 + stx VTAB + +STAY PTR +@drawLine + ldy #0 + sty HTAB +@parseLine + lda (PTR),y + cmp #$5B ; '[' at beginning on line + bne + ; ends the parsing + tya + beq @donePage ++ cmp #$0D + beq @doneParsingLine + cmp #$2A + bne + + lda #$10 + sta (PTR),y ; asterisk -> dot, small ++ cmp #$7E + bne + + lda #$11 + sta (PTR),y ; tilde -> dot, medium ++ iny + bne @parseLine +@doneParsingLine + sty SAVE + cpy #0 + beq @skip + ldx SAVE + +LDAY PTR + plp + php + jsr DrawBuffer +@skip inc SAVE ; skip carriage return + lda SAVE ; advance PTR to start of next line + clc + adc PTR + sta PTR + bcc + + inc PTR+1 ++ inc VTAB ; this will print 255 lines if you give it + bne @drawLine ; 255 lines, so don't do that +@donePage + plp + rts + Draw40Chars ; A/Y contains address of character buffer ; carry bit clear -> draw on page 1