diff --git a/README.md b/README.md index 10ed105..1aa7fb7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Optimized Linux Logo in 6502 assembly language for size. -Size: 664 ($298) bytes +Size: 660 ($294) bytes # Screenshots diff --git a/linuxlogo b/linuxlogo index 8255ecd..aa427cf 100644 Binary files a/linuxlogo and b/linuxlogo differ diff --git a/linuxlogo.s b/linuxlogo.s index bf83814..a731264 100644 --- a/linuxlogo.s +++ b/linuxlogo.s @@ -5,7 +5,9 @@ ; Zero Page ROM vars zCursorX = $24 ; CH zCursorY = $25 ; CH -zHgrPtr = $26 ; GBASL = Dst Pixel Addr + +; NOTE: We *don't* use this, instead we *re-use* zTxtPtr +;zHgrPtr = $26 ; GBASL = Dst Pixel Addr zTxtPtr = $28 ; BASL = Dst zDstOffset = $F9 ; dst @@ -306,12 +308,13 @@ MakeShiftMask lda zCursorY jsr BASCALC - lda zTxtPtr+0 ; every 8 HGR scanline address - sta zHgrPtr+0 ; is exactly same as Text low byte - +; Yes, this is evil ... +; Instead of copying zTxtPtr over to zHgrPtr +; We re-use it by forcing it to be a HGR address! +; This *is* safe BECAUSE we call JSR BASCALC _before_ we do any text printing. lda zTxtPtr+1 ; every 8 HGR scanline address eor #$24 ; is Text Page $04 + $1C = HGR Page $20; CLC, ADC #$1C - sta zHgrPtr+1 ; but we can optimize for HGR page 1 via EOR #$24 -- Thanks Mike B.! + sta zTxtPtr+1 ; but we can optimize for HGR page 1 via EOR #$24 -- Thanks Mike B.! ; ------------------------------------------------------------------------ ; Copy unpacked buffer to 8 HGR scanlines @@ -321,7 +324,7 @@ Draw8Rows ldy #39 ; 280/7 = 40 bytes/scanline CopyScanLine lda UnpackAddr,Y - sta (zHgrPtr),Y + sta (zTxtPtr),Y txa ; Clear source on last scanline copy bne CopyNextByte @@ -331,9 +334,9 @@ CopyNextByte bpl CopyScanLine clc ; y = y+1 - lda zHgrPtr+1 ; HGR addr_y+1 = addr_y + $0400 + lda zTxtPtr+1 ; HGR addr_y+1 = addr_y + $0400 adc #$04 - sta zHgrPtr+1 + sta zTxtPtr+1 stx zDstOffset ; X=0 last loop iteration txa ; A=0 zDstShift diff --git a/ll_6502.dsk b/ll_6502.dsk index 43b6395..2a5f52e 100644 Binary files a/ll_6502.dsk and b/ll_6502.dsk differ