From bc85d90468f6375d8ee426c9645940f07f8da241 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Mon, 12 Oct 2015 16:15:40 +0200 Subject: [PATCH] check for space bottom up, which is faster for the average case --- libsrc/c64/soft80_cputc.s | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/libsrc/c64/soft80_cputc.s b/libsrc/c64/soft80_cputc.s index 4f2eb7ada..9f27f64d7 100644 --- a/libsrc/c64/soft80_cputc.s +++ b/libsrc/c64/soft80_cputc.s @@ -482,30 +482,39 @@ soft80_putcolor: sta (CRAM_PTR),y ; vram rts +; ; test if there is a space or a character at current position -; in: y must be $00 +; +; in: x = $34 +; y must be $00 ; out: CLC: space SEC: character +; x = $34 ; y = $00 soft80_checkchar: - ;ldy #$00 ; is still $00 + ;ldy #$00 ; is still $00 ;lda CURS_X ;and #$01 lda soft80_internal_cursorxlsb - jne @l1a + bne @l1a + + ; check charset data from bottom up, since a lot of eg lowercase chars + ; have no data in the top rows, but all of the DO have data in the + ; second to bottom row, this will likely be faster in average. + ldy #7 .repeat 8,line lda (SCREEN_PTR),y and #$f0 cmp #$f0 bne @l2b .if (line < 7) - iny + dey .endif .endrepeat - ldy #$00 + ;ldy #$00 ; is 0 clc rts @l2b: @@ -513,16 +522,17 @@ soft80_checkchar: sec rts @l1a: + ldy #$07 .repeat 8,line lda (SCREEN_PTR),y and #$0f cmp #$0f bne @l2bb .if line < 7 - iny + dey .endif .endrepeat - ldy #$00 + ;ldy #$00 ; is 0 clc rts @l2bb: -- 2.39.5