add diagonal stripes HGR effect

This commit is contained in:
4am 2021-09-21 20:50:04 -04:00
parent c4652a9aac
commit 6d288a2df4
3 changed files with 141 additions and 0 deletions

View File

@ -28,6 +28,7 @@ R.BY.PIXEL
WAVY.IRIS
BIT.FIZZLE
STAR.IN
DIAG.STRIPES
APPLE
MANDELBROT.RIP
SOFT.L

View File

@ -139,6 +139,7 @@ FAVORITES1.CONF=Type(04),AuxType(4000),Access(C3)
FAVORITES2.CONF=Type(04),AuxType(4000),Access(C3)
FAVORITES3.CONF=Type(04),AuxType(4000),Access(C3)
FAVORITES4.CONF=Type(04),AuxType(4000),Access(C3)
FAVORITES5.CONF=Type(04),AuxType(4000),Access(C3)
GEBELLI.CONF=Type(04),AuxType(4000),Access(C3)
HIJKL.CONF=Type(04),AuxType(4000),Access(C3)
HIJKL2.CONF=Type(04),AuxType(4000),Access(C3)

View File

@ -0,0 +1,139 @@
;license:MIT
;(c) 2021 by 4am
;
!cpu 6502
!to "build/FX/DIAG.STRIPES",plain
*=$6000
hgrhi = $BE01 ; [$C0 bytes] HGR base addresses
hgrlo = $BD01 ; [$C0 bytes] HGR base addresses
src = $F0
dst = $F2
row1 = $F4
row2 = $F5
mask1 = $F6
mask2 = $F7
!source "src/fx/macros.a"
!source "src/constants.a"
+BUILD_HGR_LOOKUP_TABLES hgrlo, hgrhi
lda #$00
sta row1
lda #$C0
sta row2
lda #11
sta mask1
lda #13
sta mask2
RowLoop
ldx row1
lda hgrlo, x
sta src
sta dst
lda hgrhi, x
sta dst+1
eor #$60
sta src+1
ldx mask1
lda copymasks_even, x
sta @even1
lda copymasks_odd, x
sta @odd1
ldy #39
- lda (src), y
eor (dst), y ; merge source and destination bits
@odd1=*+1
and #$FD ; [SMC] isolate the bits to replace, zero the rest
eor (dst), y ; unmerge source and destination bits, leaves 'to keep' destination bits intact
sta (dst), y ; write the result
dey
lda (src), y
eor (dst), y ; merge source and destination bits
@even1=*+1
and #$FD ; [SMC] isolate the bits to replace, zero the rest
eor (dst), y ; unmerge source and destination bits, leaves 'to keep' destination bits intact
sta (dst), y ; write the result
dey
bpl -
ldx row2
lda hgrlo-1, x ; row2 is off-by-1 so we can use a BEQ to terminate
sta src
sta dst
lda hgrhi-1, x
sta dst+1
eor #$60
sta src+1
ldx mask2
lda copymasks_even, x
sta @even2
lda copymasks_odd, x
sta @odd2
ldy #39
- lda (src), y
eor (dst), y ; merge source and destination bits
@odd2=*+1
and #$FD ; [SMC] isolate the bits to replace, zero the rest
eor (dst), y ; unmerge source and destination bits, leaves 'to keep' destination bits intact
sta (dst), y ; write the result
dey
lda (src), y
eor (dst), y ; merge source and destination bits
@even2=*+1
and #$FD ; [SMC] isolate the bits to replace, zero the rest
eor (dst), y ; unmerge source and destination bits, leaves 'to keep' destination bits intact
sta (dst), y ; write the result
dey
bpl -
inc mask1
lda mask1
cmp #14
bne +
lda #0
sta mask1
+
dec mask2
bpl +
lda #13
sta mask2
+
bit $C000
bmi Exit
inc row1
dec row2
+LBNE RowLoop
Exit rts
copymasks_even
!byte %11111110
!byte %11111100
!byte %11111000
!byte %11110000
!byte %11100000
!byte %11000000
!byte %10000000
copymasks_odd
!byte %10000001
!byte %10000011
!byte %10000111
!byte %10001111
!byte %10011111
!byte %10111111
!byte %11111111
!byte %11111110
!byte %11111100
!byte %11111000
!byte %11110000
!byte %11100000
!byte %11000000
!byte %10000000