mirror of
https://github.com/Michaelangel007/6502_linux_logo.git
synced 2024-06-15 13:29:30 +00:00
Shaved off anothe 4 bytes, 660 now. Thanks Mike B.
This commit is contained in:
parent
197efce928
commit
5805947c93
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
Optimized Linux Logo in 6502 assembly language for size.
|
Optimized Linux Logo in 6502 assembly language for size.
|
||||||
|
|
||||||
Size: 664 ($298) bytes
|
Size: 660 ($294) bytes
|
||||||
|
|
||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
|
|
19
linuxlogo.s
19
linuxlogo.s
|
@ -5,7 +5,9 @@
|
||||||
; Zero Page ROM vars
|
; Zero Page ROM vars
|
||||||
zCursorX = $24 ; CH
|
zCursorX = $24 ; CH
|
||||||
zCursorY = $25 ; 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
|
zTxtPtr = $28 ; BASL = Dst
|
||||||
|
|
||||||
zDstOffset = $F9 ; dst
|
zDstOffset = $F9 ; dst
|
||||||
|
@ -306,12 +308,13 @@ MakeShiftMask
|
||||||
lda zCursorY
|
lda zCursorY
|
||||||
jsr BASCALC
|
jsr BASCALC
|
||||||
|
|
||||||
lda zTxtPtr+0 ; every 8 HGR scanline address
|
; Yes, this is evil ...
|
||||||
sta zHgrPtr+0 ; is exactly same as Text low byte
|
; 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
|
lda zTxtPtr+1 ; every 8 HGR scanline address
|
||||||
eor #$24 ; is Text Page $04 + $1C = HGR Page $20; CLC, ADC #$1C
|
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
|
; Copy unpacked buffer to 8 HGR scanlines
|
||||||
|
@ -321,7 +324,7 @@ Draw8Rows
|
||||||
ldy #39 ; 280/7 = 40 bytes/scanline
|
ldy #39 ; 280/7 = 40 bytes/scanline
|
||||||
CopyScanLine
|
CopyScanLine
|
||||||
lda UnpackAddr,Y
|
lda UnpackAddr,Y
|
||||||
sta (zHgrPtr),Y
|
sta (zTxtPtr),Y
|
||||||
|
|
||||||
txa ; Clear source on last scanline copy
|
txa ; Clear source on last scanline copy
|
||||||
bne CopyNextByte
|
bne CopyNextByte
|
||||||
|
@ -331,9 +334,9 @@ CopyNextByte
|
||||||
bpl CopyScanLine
|
bpl CopyScanLine
|
||||||
|
|
||||||
clc ; y = y+1
|
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
|
adc #$04
|
||||||
sta zHgrPtr+1
|
sta zTxtPtr+1
|
||||||
|
|
||||||
stx zDstOffset ; X=0 last loop iteration
|
stx zDstOffset ; X=0 last loop iteration
|
||||||
txa ; A=0 zDstShift
|
txa ; A=0 zDstShift
|
||||||
|
|
BIN
ll_6502.dsk
BIN
ll_6502.dsk
Binary file not shown.
Loading…
Reference in New Issue
Block a user