From 5decadcabc266ae43ea3264716e5eab3061431f8 Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 14 Dec 2021 00:19:32 -0500 Subject: [PATCH] shave some bytes --- src/fx/fx.gr.fizzle.a | 124 ++++++++++++++----------------------- src/index/credits.idx.a | 2 +- src/index/decrunch.idx.a | 2 +- src/index/dgr.fizzle.idx.a | 2 +- src/index/gr.fizzle.idx.a | 2 +- src/index/helptext.idx.a | 2 +- src/index/joystick.idx.a | 2 +- 7 files changed, 53 insertions(+), 83 deletions(-) diff --git a/src/fx/fx.gr.fizzle.a b/src/fx/fx.gr.fizzle.a index fc030fa00..ae27edd82 100644 --- a/src/fx/fx.gr.fizzle.a +++ b/src/fx/fx.gr.fizzle.a @@ -1,86 +1,56 @@ ;license:MIT -;(c) 2019 by qkumba +;(c) 2017-2021 by qkumba/4am/John Brooks !cpu 6502 !to "build/GR.FIZZLE",plain *=$6000 - ;init RNG - - ldx #1 - stx @rnd1+1 + ldx #(end-start+1) ; copy LFSR code to zero page +- ldy start-2, x + sty $FE, x dex - stx @rnd2+1 + bne - + jmp loop - ;iterate - -@loop - ldy @rnd1+1 - ldx @rnd2+1 - lsr @rnd2+1 - ror @rnd1+1 - bcc + - - ;feedback polynomial forms #$402 for period of 2047 - - lda @rnd1+1 - eor #2 - sta @rnd1+1 - lda @rnd2+1 - eor #4 - sta @rnd2+1 - - ;little hack to avoid missing offset zero - ;screen hole at $xxFF is missed instead - -+ tya - eor #$ff - sta $26 - sta $3c - and #$78 - cmp #$78 - beq @rnd2 - txa - and #3 - - ;target page 1 - - ora #4 - sta $3d +start +!pseudopc 0 { + ;X=0 + ;Y=0 +loop txa +loop1 eor #$05 ; LFSR form 0x0500 with period 2047 +wait inx + bpl wait + tax +loop2 txa + and #$03 + ora #$04 + sta