From a249b986e948dafafb862e973666824dc13f238e Mon Sep 17 00:00:00 2001 From: 4am Date: Mon, 7 Sep 2020 16:56:40 -0400 Subject: [PATCH] shave some bytes --- src/fx/fx.hgr.1bit.fizzle.a | 8 +++---- src/fx/fx.hgr.2bit.fizzle.a | 10 ++++----- src/fx/fx.hgr.checkerboard.fizzle.a | 34 +++++++++++++---------------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/fx/fx.hgr.1bit.fizzle.a b/src/fx/fx.hgr.1bit.fizzle.a index 5856a128b..5254ae288 100755 --- a/src/fx/fx.hgr.1bit.fizzle.a +++ b/src/fx/fx.hgr.1bit.fizzle.a @@ -10,11 +10,10 @@ copymasks = $6200 ; [256 bytes, page-aligned] ldx #(end-start) ; copy LFSR code to zero page - lda start-1, x - sta $0, x + sta $FF, x dex bne - - lda #%00000001 ; create copymask lookup table --- ldy #$20 +-- ldy #$20 ; create copymask table ora #%10000000 - sta copymasks, x inx @@ -37,8 +36,9 @@ copymasks = $6200 ; [256 bytes, page-aligned] rts ; exit via LFSR code on zero page start -!pseudopc 1 { +!pseudopc 0 { ; in: X,Y=0 + !byte %00000001 loop txa loop1 eor #$B4 ; LFSR form 0xB400 with period 65535 tax ; X is LFSR high byte, Y is LFSR low byte diff --git a/src/fx/fx.hgr.2bit.fizzle.a b/src/fx/fx.hgr.2bit.fizzle.a index 772019d23..0ef2c779b 100644 --- a/src/fx/fx.hgr.2bit.fizzle.a +++ b/src/fx/fx.hgr.2bit.fizzle.a @@ -10,11 +10,10 @@ copymasks = $6200 ; [128 bytes, should not cross page boundar ldx #(end-start) ; copy LFSR code to zero page - lda start-1, x - sta $0, x + sta $FF, x dex bne - - lda #%00000011 ; create copymask lookup table --- ldy #$20 +-- ldy #$20 ; create copymask table ora #%10000000 - sta copymasks, x inx @@ -25,7 +24,7 @@ copymasks = $6200 ; [128 bytes, should not cross page boundar bne -- pha pha - tax ; X=0 + tax clc -- ldy #$20 ; create address lookup table tya @@ -39,8 +38,9 @@ copymasks = $6200 ; [128 bytes, should not cross page boundar rts ; exit via LFSR code on zero page start -!pseudopc 1 { +!pseudopc 0 { ; in: X,Y=0 + !byte %00000011 loop txa loop1 eor #$60 ; LFSR form 0x6000 with period 32767 tax ; X is LFSR high byte, Y is LFSR low byte diff --git a/src/fx/fx.hgr.checkerboard.fizzle.a b/src/fx/fx.hgr.checkerboard.fizzle.a index 09fbce80f..69cd5b241 100644 --- a/src/fx/fx.hgr.checkerboard.fizzle.a +++ b/src/fx/fx.hgr.checkerboard.fizzle.a @@ -33,7 +33,6 @@ shapemask = $8000 ; [$2000 bytes, page-aligned] inx cpx #$C0 bne - - ldx #0 ; create shapemask table -- lda hgrlo, x sta $FE @@ -71,26 +70,12 @@ shapemask = $8000 ; [$2000 bytes, page-aligned] inx cpx #$C0 bne -- - ldx #(end-start) ; copy LFSR code to zero page - lda start-1, x - sta $0, x + sta $FF, x dex bne - - - clc ; create shapemaskaddrs lookup table --- ldy #$20 - lda #>shapemask -- sta shapemaskaddrs, x - adc #1 - inx - dey - bne - - txa - bne -- - - lda #%00000011 ; create copymask lookup table --- ldy #$20 +-- ldy #$20 ; create copymask lookup table ora #%10000000 - sta copymasks, x inx @@ -99,11 +84,21 @@ shapemask = $8000 ; [$2000 bytes, page-aligned] asl asl bne -- - tax ; X=0 + tax clc -- ldy #$20 ; create address lookup table tya - sta addrs, x + adc #1 + inx + dey + bne - + txa + bne -- + clc ; create shapemaskaddrs lookup table +-- ldy #$20 + lda #>shapemask +- sta shapemaskaddrs, x adc #1 inx dey @@ -118,8 +113,9 @@ shapemask = $8000 ; [$2000 bytes, page-aligned] jmp $1 start -!pseudopc 1 { +!pseudopc 0 { ; in: X,Y=0 + !byte %00000011 loop txa loop1 eor #$60 ; LFSR form 0x6000 with period 32767 tax ; X is LFSR high byte, Y is LFSR low byte