mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-27 12:30:30 +00:00
shave some bytes
This commit is contained in:
parent
3b0149f9e9
commit
a249b986e9
@ -10,11 +10,10 @@ copymasks = $6200 ; [256 bytes, page-aligned]
|
||||
|
||||
ldx #(end-start) ; copy LFSR code to zero page
|
||||
- lda start-1, x
|
||||
sta $0, x
|
||||
sta $FF, x
|
||||
dex
|
||||
bne -
|
||||
lda #%00000001 ; create copymask lookup table
|
||||
-- ldy #$20
|
||||
-- ldy #$20 ; create copymask table
|
||||
ora #%10000000
|
||||
- sta copymasks, x
|
||||
inx
|
||||
@ -37,8 +36,9 @@ copymasks = $6200 ; [256 bytes, page-aligned]
|
||||
rts ; exit via LFSR code on zero page
|
||||
|
||||
start
|
||||
!pseudopc 1 {
|
||||
!pseudopc 0 {
|
||||
; in: X,Y=0
|
||||
!byte %00000001
|
||||
loop txa
|
||||
loop1 eor #$B4 ; LFSR form 0xB400 with period 65535
|
||||
tax ; X is LFSR high byte, Y is LFSR low byte
|
||||
|
@ -10,11 +10,10 @@ copymasks = $6200 ; [128 bytes, should not cross page boundar
|
||||
|
||||
ldx #(end-start) ; copy LFSR code to zero page
|
||||
- lda start-1, x
|
||||
sta $0, x
|
||||
sta $FF, x
|
||||
dex
|
||||
bne -
|
||||
lda #%00000011 ; create copymask lookup table
|
||||
-- ldy #$20
|
||||
-- ldy #$20 ; create copymask table
|
||||
ora #%10000000
|
||||
- sta copymasks, x
|
||||
inx
|
||||
@ -25,7 +24,7 @@ copymasks = $6200 ; [128 bytes, should not cross page boundar
|
||||
bne --
|
||||
pha
|
||||
pha
|
||||
tax ; X=0
|
||||
tax
|
||||
clc
|
||||
-- ldy #$20 ; create address lookup table
|
||||
tya
|
||||
@ -39,8 +38,9 @@ copymasks = $6200 ; [128 bytes, should not cross page boundar
|
||||
rts ; exit via LFSR code on zero page
|
||||
|
||||
start
|
||||
!pseudopc 1 {
|
||||
!pseudopc 0 {
|
||||
; in: X,Y=0
|
||||
!byte %00000011
|
||||
loop txa
|
||||
loop1 eor #$60 ; LFSR form 0x6000 with period 32767
|
||||
tax ; X is LFSR high byte, Y is LFSR low byte
|
||||
|
@ -33,7 +33,6 @@ shapemask = $8000 ; [$2000 bytes, page-aligned]
|
||||
inx
|
||||
cpx #$C0
|
||||
bne -
|
||||
|
||||
ldx #0 ; create shapemask table
|
||||
-- lda hgrlo, x
|
||||
sta $FE
|
||||
@ -71,26 +70,12 @@ shapemask = $8000 ; [$2000 bytes, page-aligned]
|
||||
inx
|
||||
cpx #$C0
|
||||
bne --
|
||||
|
||||
ldx #(end-start) ; copy LFSR code to zero page
|
||||
- lda start-1, x
|
||||
sta $0, x
|
||||
sta $FF, x
|
||||
dex
|
||||
bne -
|
||||
|
||||
clc ; create shapemaskaddrs lookup table
|
||||
-- ldy #$20
|
||||
lda #>shapemask
|
||||
- sta shapemaskaddrs, x
|
||||
adc #1
|
||||
inx
|
||||
dey
|
||||
bne -
|
||||
txa
|
||||
bne --
|
||||
|
||||
lda #%00000011 ; create copymask lookup table
|
||||
-- ldy #$20
|
||||
-- ldy #$20 ; create copymask lookup table
|
||||
ora #%10000000
|
||||
- sta copymasks, x
|
||||
inx
|
||||
@ -99,11 +84,21 @@ shapemask = $8000 ; [$2000 bytes, page-aligned]
|
||||
asl
|
||||
asl
|
||||
bne --
|
||||
tax ; X=0
|
||||
tax
|
||||
clc
|
||||
-- ldy #$20 ; create address lookup table
|
||||
tya
|
||||
- sta addrs, x
|
||||
adc #1
|
||||
inx
|
||||
dey
|
||||
bne -
|
||||
txa
|
||||
bne --
|
||||
clc ; create shapemaskaddrs lookup table
|
||||
-- ldy #$20
|
||||
lda #>shapemask
|
||||
- sta shapemaskaddrs, x
|
||||
adc #1
|
||||
inx
|
||||
dey
|
||||
@ -118,8 +113,9 @@ shapemask = $8000 ; [$2000 bytes, page-aligned]
|
||||
jmp $1
|
||||
|
||||
start
|
||||
!pseudopc 1 {
|
||||
!pseudopc 0 {
|
||||
; in: X,Y=0
|
||||
!byte %00000011
|
||||
loop txa
|
||||
loop1 eor #$60 ; LFSR form 0x6000 with period 32767
|
||||
tax ; X is LFSR high byte, Y is LFSR low byte
|
||||
|
Loading…
Reference in New Issue
Block a user