15% faster SHR fizzle fade

This commit is contained in:
4am 2020-09-03 18:42:38 -04:00
parent 6ae0509874
commit 5a90ba8555
2 changed files with 27 additions and 28 deletions

View File

@ -1,5 +1,5 @@
;license:MIT ;license:MIT
;(c) 2017-2019 by qkumba ;(c) 2017-2020 by qkumba/4am
!cpu 6502 !cpu 6502
!to "build/FX/BIT.FIZZLE",plain !to "build/FX/BIT.FIZZLE",plain

View File

@ -1,16 +1,19 @@
;license:MIT ;license:MIT
;(c) 2019 by qkumba ;(c) 2019-2020 by qkumba/4am
!cpu 6502 !cpu 6502
!to "build/FX/SHR.FIZZLE",plain !to "build/FX/SHR.FIZZLE",plain
*=$a000 *=$a000
rnd1=$fe
rnd2=$ff
;init RNG ;init RNG
ldy #1 ldy #1
sty @rnd1+1 sty rnd1
dey dey
sty @rnd2+1 sty rnd2
;copy SCB and palette ;copy SCB and palette
@ -37,59 +40,55 @@
;iterate ;iterate
@loop @loop
ldy @rnd1+1 ldx rnd1
ldx @rnd2+1 @loop2
lsr @rnd2+1 stx $26
ror @rnd1+1 stx $3c
ldx rnd2
lsr rnd2
ror rnd1
bcc + bcc +
;feedback polynomial forms #$4001 for period of 32767 ;feedback polynomial forms #$4001 for period of 32767
lda @rnd1+1 lda rnd1
eor #1 eor #1
sta @rnd1+1 sta rnd1
lda @rnd2+1 lda rnd2
eor #$40 eor #$40
sta @rnd2+1 sta rnd2
;don't rewrite SCB or palette ;don't rewrite SCB or palette
;it will make the fizzle take longer than obviously needed ;it will make the fizzle take longer than obviously needed
+ cpx #$7d + cpx #$7d
bcs + bcs +
sty $26
sty $3c
txa txa
;select address ;select address
;clc
adc #$20 adc #$20
sta $27 sta $27
sta $3d sta $3d
;copy pixel from other page to this page ;copy pixel from other page to this page
ldy #0
lda ($3c),y lda ($3c),y
sta $c005 sta $c005
sta ($26),y sta ($26),y
sta $c004 sta $c004
;wait while checking for keypress +
;exit conditions
+ ;ldx #2 ldx rnd2
@wait lda $c000 bne @loop
ldx $c000
bmi @exit bmi @exit
;dex
;bne @wait
;and exit condition ldx rnd1
cpx #1
@rnd2 lda #0 bne @loop2
bne @loop
@rnd1 lda #0
cmp #1
bne @loop
@exit rts @exit rts