From 39b643de504ebbe9724b3c89985f1cd23ea08e25 Mon Sep 17 00:00:00 2001 From: 4am Date: Fri, 4 Sep 2020 19:11:30 -0400 Subject: [PATCH] slightly faster swapzp, and some comments --- src/fx/fx.hgr.1bit.fizzle.a | 56 ++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/fx/fx.hgr.1bit.fizzle.a b/src/fx/fx.hgr.1bit.fizzle.a index 04ecaeb7d..03c88cc37 100755 --- a/src/fx/fx.hgr.1bit.fizzle.a +++ b/src/fx/fx.hgr.1bit.fizzle.a @@ -5,12 +5,13 @@ !to "build/FX/BIT.FIZZLE",plain *=$6000 -copymasks = $6100 ; [256 bytes] -addrs = $6200 ; [256 bytes] +copymasks = $6100 ; [256 bytes, page-aligned] +addrs = $6200 ; [256 bytes, page-aligned] - jsr swapzp - ldx #0 - lda #1 + jsr swapzp ; copy LFSR code to zerp page + + inx + lda #1 ; create copymask lookup table -- ldy #$20 ora #$80 - sta copymasks, x @@ -19,8 +20,9 @@ addrs = $6200 ; [256 bytes] bne - asl bne -- + clc --- ldy #$20 +-- ldy #$20 ; create address lookup table tya - sta addrs, x adc #1 @@ -29,14 +31,17 @@ addrs = $6200 ; [256 bytes] bne - txa bne -- - jsr $0 + + jsr $0 ; call LFSR code on zero page + + lda $4000 ; last lousy byte (because LFSR never hits 0) + sta $2000 + ; fall through to restore and exit swapzp ldx #(end-start-1) -- lda $0, x - pha - lda start, x - sta $0, x - pla +- ldy start, x + lda $0, x sta start, x + sty $0, x dex bpl - rts @@ -45,31 +50,30 @@ start !pseudopc 0 { ; in: X,Y=0 loop txa -loop1 eor #$B4 - tax -loop2 lda addrs, x - sta