From e45e57d7ce95ffce2b39f7bb5bffc974782c93a1 Mon Sep 17 00:00:00 2001 From: compyx Date: Fri, 10 Jul 2020 20:08:44 +0200 Subject: [PATCH] C64 soft80 conio: save 4 bytes in `firstinit` Also save 6 cycles as a very small bonus. --- libsrc/c64/soft80_conio.s | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/libsrc/c64/soft80_conio.s b/libsrc/c64/soft80_conio.s index 48039d288..4291c2078 100644 --- a/libsrc/c64/soft80_conio.s +++ b/libsrc/c64/soft80_conio.s @@ -67,22 +67,21 @@ firstinit: inc soft80_first_init + ; save 4 bytes due to soft80_lo_charset and soft80_hi_charset being + ; page-aligned. + ldy #0 lda #soft80_charset sta ptr1 stx ptr1+1 - lda #soft80_lo_charset - sta ptr2 + sty ptr2 stx ptr2+1 - lda #soft80_hi_charset - sta ptr3 + sty ptr3 stx ptr3+1 ldx #4 -@l2: - ldy #0 @l1: lda (ptr1),y sta (ptr2),y @@ -97,17 +96,17 @@ firstinit: inc ptr2+1 inc ptr3+1 dex - bne @l2 + bne @l1 ; copy the kplot tables to ram under I/O ;ldx #0 ; is 0 -@l3: +@l2: lda soft80_tables_data_start,x sta soft80_bitmapxlo,x lda soft80_tables_data_start + (soft80_tables_data_end - soft80_tables_data_start - $0100),x sta soft80_bitmapxlo + (soft80_tables_data_end - soft80_tables_data_start - $0100),x inx - bne @l3 + bne @l2 pla sta $01