mirror of
https://github.com/a2-4am/4cade.git
synced 2025-01-16 11:30:45 +00:00
shave some bytes
This commit is contained in:
parent
951fb31fc3
commit
b247ef8f41
@ -5,20 +5,16 @@
|
|||||||
!to "build/FX/SHR.FIZZLE",plain
|
!to "build/FX/SHR.FIZZLE",plain
|
||||||
*=$A000
|
*=$A000
|
||||||
|
|
||||||
addrs=$80 ; [128 bytes, can be anywhere in main memory but don't cross page boundary]
|
addrs=$80 ; [128 bytes]
|
||||||
|
src=addrs-$20 ; [word]
|
||||||
|
|
||||||
ldx #(end-start) ; copy LFSR code to zero page
|
lda #$A0 ; create address lookup table
|
||||||
- lda start-1, x
|
tax
|
||||||
sta $0, x
|
tay
|
||||||
|
- dey
|
||||||
|
sty addrs-$21, x
|
||||||
dex
|
dex
|
||||||
bne -
|
bne -
|
||||||
ldy #$80 ; create address lookup table
|
|
||||||
lda #$9F
|
|
||||||
sec
|
|
||||||
- sta addrs-1, y
|
|
||||||
sbc #1
|
|
||||||
dey
|
|
||||||
bne -
|
|
||||||
sta $C005
|
sta $C005
|
||||||
- lda $9D00, y ; pre-copy SHR SCB and palette
|
- lda $9D00, y ; pre-copy SHR SCB and palette
|
||||||
sta $9D00, y
|
sta $9D00, y
|
||||||
@ -28,18 +24,13 @@ addrs=$80 ; [128 bytes, can be anywhere in main memor
|
|||||||
sta $9F00, y
|
sta $9F00, y
|
||||||
iny
|
iny
|
||||||
bne -
|
bne -
|
||||||
jmp loop ; exit via LFSR code on zero page
|
|
||||||
|
|
||||||
start
|
|
||||||
!pseudopc 1 {
|
|
||||||
; in: X,Y=0
|
|
||||||
loop txa
|
loop txa
|
||||||
loop1 eor #$60 ; LFSR form 0x6000 with period 32767
|
loop1 eor #$60 ; LFSR form 0x6000 with period 32767
|
||||||
tax
|
tax
|
||||||
loop2 lda addrs, x
|
loop2 lda addrs, x
|
||||||
sta <dst+2
|
sta src+1
|
||||||
lda (<dst+1), y
|
lda (src), y
|
||||||
dst sta $FD00, y
|
sta (src), y
|
||||||
txa
|
txa
|
||||||
lsr
|
lsr
|
||||||
tax
|
tax
|
||||||
@ -56,5 +47,3 @@ exit lda $2000 ; last lousy byte (because LFSR never hits
|
|||||||
sta $2000
|
sta $2000
|
||||||
sta $C004
|
sta $C004
|
||||||
rts
|
rts
|
||||||
}
|
|
||||||
end
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user