faster SHR fizzle

This commit is contained in:
4am 2021-09-26 00:54:53 -04:00
parent c7960c1aa4
commit aae67d46fd

View File

@ -6,8 +6,12 @@
*=$A000 *=$A000
addrs=$80 ; [128 bytes] addrs=$80 ; [128 bytes]
src=addrs-$20 ; [word]
ldx #(end-start) ; copy LFSR code to zero page
- lda start-1, x
sta $FF, x
dex
bne -
lda #$A0 ; create address lookup table lda #$A0 ; create address lookup table
tax tax
tay tay
@ -24,13 +28,18 @@ src=addrs-$20 ; [word]
sta $9F00, y sta $9F00, y
iny iny
bne - bne -
jmp loop
start
!pseudopc 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 src+1 sta <src+1
lda (src), y src=*+1
sta (src), y lda $FD00, y ; SMC high byte
sta (<src), y
txa txa
lsr lsr
tax tax
@ -47,3 +56,5 @@ exit lda $2000 ; last lousy byte (because LFSR never hits
sta $2000 sta $2000
sta $C004 sta $C004
rts rts
}
end