More qkumba's optimizations: 673

This commit is contained in:
Michaelangel007 2017-07-19 09:16:13 -07:00
parent f5196c04ed
commit 102ca9438e
4 changed files with 10 additions and 16 deletions

View File

@ -3,7 +3,7 @@
Linux Logo in 6502 assembly language. Linux Logo in 6502 assembly language.
Size: 681 ($2A9) bytes Size: 673 ($2A1) bytes
# Screenshots # Screenshots

BIN
linuxlogo

Binary file not shown.

View File

@ -163,11 +163,10 @@ Unpack
lda #7 ; will INC, $0428 (Text) + $1C00 => $2028 (HGR) lda #7 ; will INC, $0428 (Text) + $1C00 => $2028 (HGR)
sta zCursorY ; Start Row=8 sta zCursorY ; Start Row=8
lda #0
tay ldy #0 ; zSrcOffset
tax ; SrcShift=0 sty zDstShift
sta zDstShift sty zDstOffset
sta zDstOffset
lda PackedBits lda PackedBits
sta zUnpackBits+0 sta zUnpackBits+0
@ -175,7 +174,7 @@ Unpack
NextSrcShift NextSrcShift
lda PackedBits+1,Y lda PackedBits+1,Y
sta zUnpackBits+1 sta zUnpackBits+1
ldx #0 ldx #0 ; zSrcShift
UpdateSrcShift UpdateSrcShift
stx zSrcShift stx zSrcShift
@ -277,16 +276,12 @@ Unpack2Bits
stx zMask stx zMask
ldy zDstShift ; which 280 px column is next pixel writing to? ldy zDstShift ; which 280 px column is next pixel writing to?
beq NoShiftSherlock
MakeShiftMask MakeShiftMask
asl
rol zMask
dey
bne MakeShiftMask
NoShiftSherlock
asl ; msb of byte0 set? asl ; msb of byte0 set?
rol zMask ; shift in to lsb of byte1 rol zMask ; shift in to lsb of byte1
dey
bpl MakeShiftMask
sec ; MSB=1 color=blue/orange sec ; MSB=1 color=blue/orange
ror ror
ldx zDstOffset ldx zDstOffset
@ -294,8 +289,7 @@ NoShiftSherlock
sta UnpackAddr,X sta UnpackAddr,X
lda zDstShift ; x={0,1,2} + 4 < 7 lda zDstShift ; x={0,1,2} + 4 < 7
clc adc #4 ; C=0 from ASL ROR above
adc #4
cmp #7 ; all bits fit into dest byte? cmp #7 ; all bits fit into dest byte?
bcc FitSameByte bcc FitSameByte

Binary file not shown.