From 9dafce5ae84c678d34564f23853de38218fecc11 Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 6 Sep 2020 14:44:37 -0400 Subject: [PATCH] ridiculously fast DHGR fizzle fade --- src/fx/fx.dhgr.fizzle.a | 126 ++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 76 deletions(-) diff --git a/src/fx/fx.dhgr.fizzle.a b/src/fx/fx.dhgr.fizzle.a index b2649fb92..d887c3124 100644 --- a/src/fx/fx.dhgr.fizzle.a +++ b/src/fx/fx.dhgr.fizzle.a @@ -1,84 +1,58 @@ ;license:MIT -;(c) 2017-2020 by qkumba/4am +;(c) 2017-2020 by qkumba/4am/John Brooks ; !cpu 6502 !to "build/FX/DHGR.FIZZLE",plain *=$6000 -rnd1=$fe -rnd2=$ff + ldx #(end-start) ; copy LFSR code to zero page +- lda start-1, x + sta $0, x + dex + bne - + txa + tay + pha + pha + rts -; performance notes: -; old: 10657266..12247971 = 1590705 -; new: 10196445..11493278 = 1296833 - - jsr CopySelfToAuxmem - - ;init RNG - - ldy #1 - sty rnd1 - dey - sty rnd2 - - ;iterate - - ldx rnd2 -@loop - lda rnd1 -@loop2 - eor #$ff - sta $26 - sta $3c - lsr rnd2 - ror rnd1 - bcc + - - ;feedback polynomial forms #$2015 for period of 16383 - - lda rnd1 - eor #$15 - sta rnd1 - lda rnd2 - eor #$20 - sta rnd2 - - ;little hack to avoid missing offset zero - ;screen hole at $xxFF is missed instead - -+ txa - and #$1f - - ;target page 1 - - ora #$20 - sta $27 +start +!pseudopc 1 { +; in: X,Y=0 +loop txa +loop1 eor #$35 ; LFSR form 0x3500 with period 16383 + tax +loop2 lda addrs, x + bpl + + and #$7F + sta $C003 + sta $C005 ++ sta