1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 19:29:37 +00:00

C64 soft80 conio: save 6 bytes in firstinit

As a bonus, save 6 cycles.
This commit is contained in:
compyx 2020-07-10 19:35:23 +02:00 committed by Oliver Schmidt
parent df97570471
commit 695b1b01d8

View File

@ -67,22 +67,20 @@ firstinit:
inc soft80_first_init inc soft80_first_init
lda #<soft80_charset ; save 6 bytes due to soft80_charset, soft80_lo_charset and
; soft80_hi_charset being page-aligned.
ldy #0
ldx #>soft80_charset ldx #>soft80_charset
sta ptr1 sty ptr1
stx ptr1+1 stx ptr1+1
lda #<soft80_lo_charset
ldx #>soft80_lo_charset ldx #>soft80_lo_charset
sta ptr2 sty ptr2
stx ptr2+1 stx ptr2+1
lda #<soft80_hi_charset
ldx #>soft80_hi_charset ldx #>soft80_hi_charset
sta ptr3 sty ptr3
stx ptr3+1 stx ptr3+1
ldx #4 ldx #4
@l2:
ldy #0
@l1: @l1:
lda (ptr1),y lda (ptr1),y
sta (ptr2),y sta (ptr2),y
@ -97,17 +95,17 @@ firstinit:
inc ptr2+1 inc ptr2+1
inc ptr3+1 inc ptr3+1
dex dex
bne @l2 bne @l1
; copy the kplot tables to ram under I/O ; copy the kplot tables to ram under I/O
;ldx #0 ; is 0 ;ldx #0 ; is 0
@l3: @l2:
lda soft80_tables_data_start,x lda soft80_tables_data_start,x
sta soft80_bitmapxlo,x sta soft80_bitmapxlo,x
lda soft80_tables_data_start + (soft80_tables_data_end - soft80_tables_data_start - $0100),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 sta soft80_bitmapxlo + (soft80_tables_data_end - soft80_tables_data_start - $0100),x
inx inx
bne @l3 bne @l2
pla pla
sta $01 sta $01