shave some bytes

This commit is contained in:
4am 2021-12-14 14:02:51 -05:00
parent 92ec039a2f
commit 29512ad021
37 changed files with 72 additions and 97 deletions

View File

@ -1,71 +1,46 @@
;license:MIT
;(c) 2017-2018 by qkumba
;(c) 2017-2021 by qkumba/4am/John Brooks
!cpu 6502
!to "build/FX.INDEXED/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
;iterate
@loop
ldy @rnd1+1
ldx @rnd2+1
lsr @rnd2+1
ror @rnd1+1
bcc +
;feedback polynomial forms #$100D for period of 8191
lda @rnd1+1
eor #$0d
sta @rnd1+1
lda @rnd2+1
eor #$10
sta @rnd2+1
;little hack to avoid missing offset zero
;screen hole at $xxFF is missed instead
+ tya
eor #$ff
sta $26
sta $3c
txa
;target page 1
bne -
jmp loop
start
!pseudopc 0 {
;X=0
;Y=0
loop txa
loop1 eor #$1B ; LFSR form 0x1B00 with period 8191
wait dex
bne wait
tax
loop2 txa
ora #$20
sta $27
sta <dst+2
eor #$60
sta $3d
;copy pixel from other page to this page
ldy #0
lda ($3c),y
sta ($26),y
;wait while checking for keypress
ldx #8
@wait lda $c000
bmi @exit
dex
bne @wait
;and exit condition
@rnd2 lda #0
bne @loop
@rnd1 lda #0
cmp #1
bne @loop
@exit rts
sta <src+2
jsr src
txa
lsr
tax
tya
ror
tay
bcc loop2
bne loop
bit $C000
bmi exit
txa
bne loop1
src lda $FD00, y ; SMC high byte
dst sta $FD00, y ; SMC high byte
exit rts
}
end

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10949101
!be24 10949076
!le16 4281

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10901887
!be24 10901862
!le16 5239

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10844746
!be24 10844721
!le16 3586

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10857116
!be24 10857091
!le16 3946

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10872515
!be24 10872490
!le16 4998

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10890167
!be24 10890142
!le16 5571

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10953382
!be24 10953357
!le16 410

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10954136
!be24 10954111
!le16 448

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10954584
!be24 10954559
!le16 303

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10909272
!be24 10909247
!le16 1242

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10953868
!be24 10953843
!le16 67

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10949042
!be24 10949017
!le16 59

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10947712
!be24 10947687
!le16 1249

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10933702
!be24 10933677
!le16 464

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10907126
!be24 10907101
!le16 2146

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10910745
!be24 10910720
!le16 6149

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10953792
!be24 10953767
!le16 76

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10948961
!be24 10948936
!le16 81

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10953935
!be24 10953910
!le16 201

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10934166
!be24 10934141
!le16 4407

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10938573
!be24 10938548
!le16 1533

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10940106
!be24 10940081
!le16 1040

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10941146
!be24 10941121
!le16 3237

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10944383
!be24 10944358
!le16 2764

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10947147
!be24 10947122
!le16 460

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10947607
!be24 10947582
!le16 105

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10954887
!be24 10954862
!le16 2370

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10921807
!be24 10921782
!le16 6149

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10895738
!be24 10895713
!le16 6149

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10836714
!be24 10836689
!le16 8032

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10848332
!be24 10848307
!le16 8784

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10861062
!be24 10861037
!le16 11453

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10877513
!be24 10877488
!le16 12654

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10910514
!be24 10910489
!le16 231

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10916894
!be24 10916869
!le16 4913

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10927956
!be24 10927931
!le16 5746