mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-26 17:49:43 +00:00
factor out more FX routines
This commit is contained in:
parent
c9257aa5ed
commit
457ccfbbe8
@ -169,7 +169,9 @@ gGlobalPrefsStore
|
||||
+DEFINE_INDIRECT_VECTOR iReverseCoordinates2Bit, ReverseCoordinates2Bit
|
||||
+DEFINE_INDIRECT_VECTOR iBuildDHGRSparseBitmasks2Bit, BuildDHGRSparseBitmasks2Bit
|
||||
+DEFINE_INDIRECT_VECTOR iBuildHGRSparseBitmasks2Bit, BuildHGRSparseBitmasks2Bit
|
||||
+DEFINE_INDIRECT_VECTOR iDHGRDitherPrecomputed1Bit, DHGRDitherPrecomputed1Bit
|
||||
+DEFINE_INDIRECT_VECTOR iDHGRPrecomputed1Bit, DHGRPrecomputed1Bit
|
||||
+DEFINE_INDIRECT_VECTOR iHGRDitherPrecomputed1Bit, HGRDitherPrecomputed1Bit
|
||||
+DEFINE_INDIRECT_VECTOR iHGRPrecomputed1Bit, HGRPrecomputed1Bit
|
||||
+DEFINE_INDIRECT_VECTOR iBuildDHGRSparseBitmasks1Bit, BuildDHGRSparseBitmasks1Bit
|
||||
+DEFINE_INDIRECT_VECTOR iBuildHGRSparseBitmasks1Bit, BuildHGRSparseBitmasks1Bit
|
||||
|
@ -193,8 +193,10 @@ iRippleCoordinates1Bit4 = iRippleCoordinates1Bit3-3
|
||||
iBuildHGRSparseBitmasks1Bit = iRippleCoordinates1Bit4-3
|
||||
iBuildDHGRSparseBitmasks1Bit = iBuildHGRSparseBitmasks1Bit-3
|
||||
iHGRPrecomputed1Bit = iBuildDHGRSparseBitmasks1Bit-3
|
||||
iDHGRPrecomputed1Bit = iHGRPrecomputed1Bit-3
|
||||
iBuildHGRSparseBitmasks2Bit = iDHGRPrecomputed1Bit-3
|
||||
iHGRDitherPrecomputed1Bit = iHGRPrecomputed1Bit-3
|
||||
iDHGRPrecomputed1Bit = iHGRDitherPrecomputed1Bit-3
|
||||
iDHGRDitherPrecomputed1Bit = iDHGRPrecomputed1Bit-3
|
||||
iBuildHGRSparseBitmasks2Bit = iDHGRDitherPrecomputed1Bit-3
|
||||
iBuildDHGRSparseBitmasks2Bit = iBuildHGRSparseBitmasks2Bit-3
|
||||
iReverseCoordinates2Bit = iBuildDHGRSparseBitmasks2Bit-3
|
||||
iRippleCoordinates2Bit = iReverseCoordinates2Bit-3
|
||||
@ -283,7 +285,7 @@ EndCoordinates3Bit = Coordinates3Bit + $5000
|
||||
|
||||
hgrlomirror = $BB01 ; $C0 bytes
|
||||
hgr1himirror = $BC01 ; $C0 bytes
|
||||
dithermasks = $BDA8 ; $58 bytes
|
||||
dithermasks = $BDA8 ; $58 bytes, must not cross page boundary
|
||||
evenrow_masks = dithermasks
|
||||
oddrow_masks = dithermasks+2
|
||||
no_masks = dithermasks+44
|
||||
|
296
src/fx.lib.a
296
src/fx.lib.a
@ -25,7 +25,9 @@
|
||||
; - RippleCoordinates1Bit3
|
||||
; - RippleCoordinates1Bit4
|
||||
; - HGRPrecomputed1Bit
|
||||
; - HGRDitherPrecomputed1Bit
|
||||
; - DHGRPrecomputed1Bit
|
||||
; - DHGRDitherPrecomputed1Bit
|
||||
|
||||
; - BuildHGRSparseBitmasks2Bit
|
||||
; - BuildDHGRSparseBitmasks2Bit
|
||||
@ -498,6 +500,143 @@ HGRPrecomputed1Bit
|
||||
.end
|
||||
}
|
||||
|
||||
!zone {
|
||||
HGRDitherPrecomputed1Bit
|
||||
jsr BuildHGRDitherMasks
|
||||
jsr BuildHGRTables
|
||||
jsr BuildHGRMirrorTables
|
||||
jsr BuildHGRMirrorCols
|
||||
jsr BuildHGRSparseBitmasks1Bit
|
||||
|
||||
; phase 1 - in reverse, with additional masking
|
||||
+COPY_TO_0 .start, .end
|
||||
|
||||
; set up starting coordinate for reading coordinates in reverse order
|
||||
+LDADDR EndCoordinates1Bit-2
|
||||
sta <.input
|
||||
sty <.input+1
|
||||
|
||||
; set up EOF marker to stop reading coordinates in reverse order
|
||||
lda #$80
|
||||
sta Coordinates1Bit-2
|
||||
|
||||
; set up logic to advance to next coordinates in reverse order
|
||||
ldx #(.next2_end-.next2_start-1)
|
||||
- lda .next2_start, x
|
||||
sta <.next, x
|
||||
dex
|
||||
bpl -
|
||||
|
||||
jsr .InputLoop
|
||||
|
||||
bit KBD
|
||||
bmi .start
|
||||
|
||||
; phase 2 - in order, without additional masking
|
||||
+COPY_TO_0 .start, .end
|
||||
|
||||
; redirect additional masking pointers to an array that contains #$FFs (so no masking)
|
||||
lda #<no_masks
|
||||
sta <.evenrow_ptr
|
||||
sta <.oddrow_ptr
|
||||
|
||||
jmp .InputLoop
|
||||
.start
|
||||
!pseudopc 0 {
|
||||
.Exit1Bit rts
|
||||
.evenrow_ptr
|
||||
!word evenrow_masks
|
||||
.oddrow_ptr
|
||||
!word oddrow_masks
|
||||
.InputLoop
|
||||
ldy #0
|
||||
.input=*+1
|
||||
ldx Coordinates1Bit ; first value: HGR row (only 0..95 will be in input array)
|
||||
bmi .Exit1Bit ; if > 127 then we're done
|
||||
+ROW_X_TO_BASE_ADDRESSES .src1, .src2, .dest1, .dest2
|
||||
+ROW_X_TO_MIRROR_ADDRESSES .mirror_src1, .mirror_src2, .mirror_dest1, .mirror_dest2
|
||||
|
||||
iny
|
||||
lda (<.input), y
|
||||
+HIGH_3_LOW_5 .input
|
||||
|
||||
; main 1x2 block in top-left quadrant
|
||||
.src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.dest1), y
|
||||
and copymasks1bit, x
|
||||
and (<.evenrow_ptr), y
|
||||
eor (<.dest1), y
|
||||
.dest1=*+1
|
||||
sta $FDFD, y
|
||||
.src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.dest2), y
|
||||
and copymasks1bit, x
|
||||
and (<.oddrow_ptr), y
|
||||
eor (<.dest2), y
|
||||
.dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in top-right quadrant (same row, opposite column)
|
||||
lda mirror_cols, y
|
||||
tay
|
||||
+COPY_BIT_DITHER .src1, .dest1, mirror_copymasks1bit, .evenrow_ptr
|
||||
+COPY_BIT_DITHER .src2, .dest2, mirror_copymasks1bit, .oddrow_ptr
|
||||
|
||||
; corresponding 1x2 block in bottom-right quadrant (opposite row, opposite column)
|
||||
.mirror_src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.mirror_dest1), y
|
||||
and mirror_copymasks1bit, x
|
||||
and (<.oddrow_ptr), y
|
||||
eor (<.mirror_dest1), y
|
||||
.mirror_dest1=*+1
|
||||
sta $FDFD, y
|
||||
.mirror_src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.mirror_dest2), y
|
||||
and mirror_copymasks1bit, x
|
||||
and (<.evenrow_ptr), y
|
||||
eor (<.mirror_dest2), y
|
||||
.mirror_dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in bottom-left quadrant (opposite row, original column)
|
||||
lda mirror_cols, y
|
||||
tay
|
||||
+COPY_BIT_DITHER .mirror_src1, .mirror_dest1, copymasks1bit, .oddrow_ptr
|
||||
+COPY_BIT_DITHER .mirror_src2, .mirror_dest2, copymasks1bit, .evenrow_ptr
|
||||
|
||||
.next
|
||||
inc <.input
|
||||
inc <.input
|
||||
bne +
|
||||
bit KBD
|
||||
bmi ++
|
||||
inc <.input+1
|
||||
+ jmp .InputLoop
|
||||
++ rts
|
||||
}
|
||||
.end
|
||||
|
||||
.next2_start
|
||||
!pseudopc .next {
|
||||
lda <.input
|
||||
php
|
||||
dec <.input
|
||||
dec <.input
|
||||
plp
|
||||
bne +
|
||||
dec <.input+1
|
||||
bit KBD
|
||||
bmi ++
|
||||
+ jmp .InputLoop
|
||||
++ rts
|
||||
}
|
||||
.next2_end
|
||||
}
|
||||
|
||||
!zone {
|
||||
DHGRPrecomputed1Bit
|
||||
jsr BuildDHGRSparseBitmasks1Bit
|
||||
@ -590,6 +729,163 @@ DHGRPrecomputed1Bit
|
||||
.end
|
||||
}
|
||||
|
||||
!zone {
|
||||
DHGRDitherPrecomputed1Bit
|
||||
jsr BuildDHGRDitherMasks
|
||||
jsr BuildDHGRSparseBitmasks1Bit
|
||||
jsr BuildHGRTables
|
||||
jsr BuildHGRMirrorTables
|
||||
jsr BuildDHGRMirrorCols
|
||||
|
||||
; phase 1 - in reverse, with additional masking
|
||||
+COPY_TO_0 .start, .end
|
||||
|
||||
; set up starting coordinate for reading coordinates in reverse order
|
||||
+LDADDR EndCoordinates1Bit-2
|
||||
sta <.input
|
||||
sty <.input+1
|
||||
|
||||
; set up EOF marker to stop reading coordinates in reverse order
|
||||
lda #$80
|
||||
sta Coordinates1Bit-2
|
||||
|
||||
; set up logic to advance to next coordinates in reverse order
|
||||
ldx #(.next2_end-.next2_start-1)
|
||||
- lda .next2_start, x
|
||||
sta <.next, x
|
||||
dex
|
||||
bpl -
|
||||
|
||||
jsr .InputLoop
|
||||
|
||||
bit KBD
|
||||
bmi .start
|
||||
|
||||
; phase 2 - in order, without additional masking
|
||||
+COPY_TO_0 .start, .end
|
||||
|
||||
; redirect additional masking pointers to an array that contains #$FFs (so no masking)
|
||||
lda #<no_masks
|
||||
sta <.evenrow_ptr
|
||||
sta <.oddrow_ptr
|
||||
|
||||
jmp .InputLoop
|
||||
.start
|
||||
!pseudopc 0 {
|
||||
.Exit1Bit rts
|
||||
.evenrow_ptr
|
||||
!word evenrow_masks
|
||||
.oddrow_ptr
|
||||
!word oddrow_masks
|
||||
.InputLoop
|
||||
ldy #0
|
||||
.input=*+1
|
||||
ldx Coordinates1Bit ; first value: HGR row (only 0..95 will be in input array)
|
||||
bmi .Exit1Bit ; if > 127 then we're done
|
||||
+ROW_X_TO_BASE_ADDRESSES .src1, .src2, .dest1, .dest2
|
||||
+ROW_X_TO_MIRROR_ADDRESSES .mirror_src1, .mirror_src2, .mirror_dest1, .mirror_dest2
|
||||
|
||||
iny
|
||||
lda (.input), y
|
||||
+HIGH_3_LOW_5 .input
|
||||
sty <.y
|
||||
clc
|
||||
.bankloop
|
||||
lda copymasks1bit, x
|
||||
beq +
|
||||
sta <.copymask
|
||||
|
||||
; main 1x2 block in top-left quadrant
|
||||
.src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.dest1), y
|
||||
.copymask=*+1
|
||||
and #$FD ; SMC
|
||||
and (<.evenrow_ptr), y
|
||||
eor (<.dest1), y
|
||||
.dest1=*+1
|
||||
sta $FDFD, y
|
||||
.src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.dest2), y
|
||||
and <.copymask
|
||||
and (<.oddrow_ptr), y
|
||||
eor (<.dest2), y
|
||||
.dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in bottom-left quadrant (opposite row, original column)
|
||||
+COPY_BIT_ZP_DITHER .mirror_src1, .mirror_dest1, .copymask, .oddrow_ptr
|
||||
+COPY_BIT_ZP_DITHER .mirror_src2, .mirror_dest2, .copymask, .evenrow_ptr
|
||||
|
||||
+
|
||||
lda mirror_copymasks1bit, x
|
||||
beq +
|
||||
sta <.mirror_copymask
|
||||
; corresponding 1x2 block in bottom-right quadrant (opposite row, opposite column)
|
||||
lda mirror_cols, y
|
||||
tay
|
||||
.mirror_src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.mirror_dest1), y
|
||||
.mirror_copymask=*+1
|
||||
and #$FD ; SMC
|
||||
and (<.oddrow_ptr), y
|
||||
eor (<.mirror_dest1), y
|
||||
.mirror_dest1=*+1
|
||||
sta $FDFD, y
|
||||
.mirror_src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<.mirror_dest2), y
|
||||
and <.mirror_copymask
|
||||
and (<.evenrow_ptr), y
|
||||
eor (<.mirror_dest2), y
|
||||
.mirror_dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in top-right quadrant (same row, opposite column)
|
||||
+COPY_BIT_ZP_DITHER .src1, .dest1, .mirror_copymask, .evenrow_ptr
|
||||
+COPY_BIT_ZP_DITHER .src2, .dest2, .mirror_copymask, .oddrow_ptr
|
||||
+
|
||||
bcs +
|
||||
sta READAUXMEM
|
||||
sta WRITEAUXMEM
|
||||
.y=*+1
|
||||
ldy #$FD
|
||||
sec
|
||||
jmp .bankloop
|
||||
+ sta READMAINMEM
|
||||
sta WRITEMAINMEM
|
||||
|
||||
.next
|
||||
inc <.input
|
||||
inc <.input
|
||||
bne +
|
||||
bit KBD
|
||||
bmi ++
|
||||
inc <.input+1
|
||||
+ jmp .InputLoop
|
||||
++ rts
|
||||
}
|
||||
.end
|
||||
|
||||
.next2_start
|
||||
!pseudopc .next {
|
||||
lda <.input
|
||||
php
|
||||
dec <.input
|
||||
dec <.input
|
||||
plp
|
||||
bne +
|
||||
dec <.input+1
|
||||
bit KBD
|
||||
bmi ++
|
||||
+ jmp .InputLoop
|
||||
++ rts
|
||||
}
|
||||
.next2_end
|
||||
}
|
||||
|
||||
BuildHGRSparseBitmasks2Bit
|
||||
lda #%10000011
|
||||
sta copymasks2bit
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iDHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "BUBBLES.DATA"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iDHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "CORNER4.DATA"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iDHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "IRIS.DATA"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iDHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "SLOW.STAR.DATA"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iDHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "SNOWFLAKE.DATA"
|
||||
|
@ -3,159 +3,3 @@
|
||||
;
|
||||
|
||||
!source "src/fx/fx.hgr.precomputed.1bit.a"
|
||||
|
||||
!macro FX_PRECOMPUTED_1BIT_DHGR_DITHER .coords, .endcoords {
|
||||
jsr iBuildDHGRDitherMasks
|
||||
jsr iBuildDHGRSparseBitmasks1Bit
|
||||
jsr iBuildHGRTables
|
||||
jsr iBuildHGRMirrorTables
|
||||
jsr iBuildDHGRMirrorCols
|
||||
|
||||
; phase 1 - in reverse, with additional masking
|
||||
+COPY_TO_0 start, end
|
||||
|
||||
; set up starting coordinate for reading coordinates in reverse order
|
||||
+LDADDR .endcoords-2
|
||||
sta <input
|
||||
sty <input+1
|
||||
|
||||
; set up EOF marker to stop reading coordinates in reverse order
|
||||
lda #$80
|
||||
sta .coords-2
|
||||
|
||||
; set up logic to advance to next coordinates in reverse order
|
||||
ldx #(next2_end-next2_start-1)
|
||||
- lda next2_start, x
|
||||
sta <next, x
|
||||
dex
|
||||
bpl -
|
||||
|
||||
jsr InputLoop
|
||||
|
||||
bit KBD
|
||||
bmi start
|
||||
|
||||
; phase 2 - in order, without additional masking
|
||||
+COPY_TO_0 start, end
|
||||
|
||||
; redirect additional masking pointers to an array that contains #$FFs (so no masking)
|
||||
lda #<no_masks
|
||||
sta <evenrow_ptr
|
||||
sta <oddrow_ptr
|
||||
|
||||
jmp InputLoop
|
||||
start
|
||||
!pseudopc 0 {
|
||||
Exit1Bit rts
|
||||
evenrow_ptr
|
||||
!word evenrow_masks
|
||||
oddrow_ptr
|
||||
!word oddrow_masks
|
||||
InputLoop
|
||||
ldy #0
|
||||
input=*+1
|
||||
ldx .coords ; first value: HGR row (only 0..95 will be in input array)
|
||||
bmi Exit1Bit ; if > 127 then we're done
|
||||
+ROW_X_TO_BASE_ADDRESSES src1, src2, dest1, dest2
|
||||
+ROW_X_TO_MIRROR_ADDRESSES mirror_src1, mirror_src2, mirror_dest1, mirror_dest2
|
||||
|
||||
iny
|
||||
lda (input), y
|
||||
+HIGH_3_LOW_5 input
|
||||
sty <y
|
||||
clc
|
||||
bankloop
|
||||
lda copymasks1bit, x
|
||||
beq +
|
||||
sta <copymask
|
||||
|
||||
; main 1x2 block in top-left quadrant
|
||||
src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<dest1), y
|
||||
copymask=*+1
|
||||
and #$FD ; SMC
|
||||
and (<evenrow_ptr), y
|
||||
eor (<dest1), y
|
||||
dest1=*+1
|
||||
sta $FDFD, y
|
||||
src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<dest2), y
|
||||
and <copymask
|
||||
and (<oddrow_ptr), y
|
||||
eor (<dest2), y
|
||||
dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in bottom-left quadrant (opposite row, original column)
|
||||
+COPY_BIT_ZP_DITHER mirror_src1, mirror_dest1, copymask, oddrow_ptr
|
||||
+COPY_BIT_ZP_DITHER mirror_src2, mirror_dest2, copymask, evenrow_ptr
|
||||
|
||||
+
|
||||
lda mirror_copymasks1bit, x
|
||||
beq +
|
||||
sta <mirror_copymask
|
||||
; corresponding 1x2 block in bottom-right quadrant (opposite row, opposite column)
|
||||
lda mirror_cols, y
|
||||
tay
|
||||
mirror_src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<mirror_dest1), y
|
||||
mirror_copymask=*+1
|
||||
and #$FD ; SMC
|
||||
and (<oddrow_ptr), y
|
||||
eor (<mirror_dest1), y
|
||||
mirror_dest1=*+1
|
||||
sta $FDFD, y
|
||||
mirror_src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<mirror_dest2), y
|
||||
and <mirror_copymask
|
||||
and (<evenrow_ptr), y
|
||||
eor (<mirror_dest2), y
|
||||
mirror_dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in top-right quadrant (same row, opposite column)
|
||||
+COPY_BIT_ZP_DITHER src1, dest1, mirror_copymask, evenrow_ptr
|
||||
+COPY_BIT_ZP_DITHER src2, dest2, mirror_copymask, oddrow_ptr
|
||||
+
|
||||
bcs +
|
||||
sta READAUXMEM
|
||||
sta WRITEAUXMEM
|
||||
y=*+1
|
||||
ldy #$FD
|
||||
sec
|
||||
jmp bankloop
|
||||
+ sta READMAINMEM
|
||||
sta WRITEMAINMEM
|
||||
|
||||
next
|
||||
inc <input
|
||||
inc <input
|
||||
bne +
|
||||
bit KBD
|
||||
bmi ++
|
||||
inc <input+1
|
||||
+ jmp InputLoop
|
||||
++ rts
|
||||
}
|
||||
end
|
||||
|
||||
next2_start
|
||||
!pseudopc next {
|
||||
lda <input
|
||||
php
|
||||
dec <input
|
||||
dec <input
|
||||
plp
|
||||
bne +
|
||||
dec <input+1
|
||||
bit KBD
|
||||
bmi ++
|
||||
+ jmp InputLoop
|
||||
++ rts
|
||||
}
|
||||
next2_end
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "CORNER4.DATA"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "IRIS.DATA"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "SLOW.STAR.DATA"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
+FX_INITONCE_1BIT CoordinatesFile, Start
|
||||
Start
|
||||
+FX_PRECOMPUTED_1BIT_DITHER Coordinates1Bit, EndCoordinates1Bit
|
||||
jmp iHGRDitherPrecomputed1Bit
|
||||
|
||||
CoordinatesFile
|
||||
+PSTRING "SNOWFLAKE.DATA"
|
||||
|
@ -37,139 +37,3 @@ InitOnce
|
||||
lda #$80
|
||||
sta EndCoordinates1Bit
|
||||
}
|
||||
|
||||
!macro FX_PRECOMPUTED_1BIT_DITHER .coords, .endcoords {
|
||||
jsr iBuildHGRDitherMasks
|
||||
jsr iBuildHGRTables
|
||||
jsr iBuildHGRMirrorTables
|
||||
jsr iBuildHGRMirrorCols
|
||||
jsr iBuildHGRSparseBitmasks1Bit
|
||||
|
||||
; phase 1 - in reverse, with additional masking
|
||||
+COPY_TO_0 start, end
|
||||
|
||||
; set up starting coordinate for reading coordinates in reverse order
|
||||
+LDADDR .endcoords-2
|
||||
sta <input
|
||||
sty <input+1
|
||||
|
||||
; set up EOF marker to stop reading coordinates in reverse order
|
||||
lda #$80
|
||||
sta .coords-2
|
||||
|
||||
; set up logic to advance to next coordinates in reverse order
|
||||
ldx #(next2_end-next2_start-1)
|
||||
- lda next2_start, x
|
||||
sta <next, x
|
||||
dex
|
||||
bpl -
|
||||
|
||||
jsr InputLoop
|
||||
|
||||
bit KBD
|
||||
bmi start
|
||||
|
||||
; phase 2 - in order, without additional masking
|
||||
+COPY_TO_0 start, end
|
||||
|
||||
; redirect additional masking pointers to an array that contains #$FFs (so no masking)
|
||||
lda #<no_masks
|
||||
sta <evenrow_ptr
|
||||
sta <oddrow_ptr
|
||||
|
||||
jmp InputLoop
|
||||
start
|
||||
!pseudopc 0 {
|
||||
Exit1Bit rts
|
||||
evenrow_ptr
|
||||
!word evenrow_masks
|
||||
oddrow_ptr
|
||||
!word oddrow_masks
|
||||
InputLoop
|
||||
ldy #0
|
||||
input=*+1
|
||||
ldx .coords ; first value: HGR row (only 0..95 will be in input array)
|
||||
bmi Exit1Bit ; if > 127 then we're done
|
||||
+ROW_X_TO_BASE_ADDRESSES src1, src2, dest1, dest2
|
||||
+ROW_X_TO_MIRROR_ADDRESSES mirror_src1, mirror_src2, mirror_dest1, mirror_dest2
|
||||
|
||||
iny
|
||||
lda (<input), y
|
||||
+HIGH_3_LOW_5 input
|
||||
|
||||
; main 1x2 block in top-left quadrant
|
||||
src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<dest1), y
|
||||
and copymasks1bit, x
|
||||
and (<evenrow_ptr), y
|
||||
eor (<dest1), y
|
||||
dest1=*+1
|
||||
sta $FDFD, y
|
||||
src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<dest2), y
|
||||
and copymasks1bit, x
|
||||
and (<oddrow_ptr), y
|
||||
eor (<dest2), y
|
||||
dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in top-right quadrant (same row, opposite column)
|
||||
lda mirror_cols, y
|
||||
tay
|
||||
+COPY_BIT_DITHER src1, dest1, mirror_copymasks1bit, evenrow_ptr
|
||||
+COPY_BIT_DITHER src2, dest2, mirror_copymasks1bit, oddrow_ptr
|
||||
|
||||
; corresponding 1x2 block in bottom-right quadrant (opposite row, opposite column)
|
||||
mirror_src1=*+1
|
||||
lda $FDFD, y
|
||||
eor (<mirror_dest1), y
|
||||
and mirror_copymasks1bit, x
|
||||
and (<oddrow_ptr), y
|
||||
eor (<mirror_dest1), y
|
||||
mirror_dest1=*+1
|
||||
sta $FDFD, y
|
||||
mirror_src2=*+1
|
||||
lda $FDFD, y
|
||||
eor (<mirror_dest2), y
|
||||
and mirror_copymasks1bit, x
|
||||
and (<evenrow_ptr), y
|
||||
eor (<mirror_dest2), y
|
||||
mirror_dest2=*+1
|
||||
sta $FDFD, y
|
||||
|
||||
; corresponding 1x2 block in bottom-left quadrant (opposite row, original column)
|
||||
lda mirror_cols, y
|
||||
tay
|
||||
+COPY_BIT_DITHER mirror_src1, mirror_dest1, copymasks1bit, oddrow_ptr
|
||||
+COPY_BIT_DITHER mirror_src2, mirror_dest2, copymasks1bit, evenrow_ptr
|
||||
|
||||
next
|
||||
inc <input
|
||||
inc <input
|
||||
bne +
|
||||
bit KBD
|
||||
bmi ++
|
||||
inc <input+1
|
||||
+ jmp InputLoop
|
||||
++ rts
|
||||
}
|
||||
end
|
||||
|
||||
next2_start
|
||||
!pseudopc next {
|
||||
lda <input
|
||||
php
|
||||
dec <input
|
||||
dec <input
|
||||
plp
|
||||
bne +
|
||||
dec <input+1
|
||||
bit KBD
|
||||
bmi ++
|
||||
+ jmp InputLoop
|
||||
++ rts
|
||||
}
|
||||
next2_end
|
||||
}
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15893310
|
||||
!be24 15890352
|
||||
!le16 5130
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15837968
|
||||
!be24 15835010
|
||||
!le16 5732
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15769735
|
||||
!be24 15766777
|
||||
!le16 4194
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15784449
|
||||
!be24 15781491
|
||||
!le16 4652
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15803164
|
||||
!be24 15800206
|
||||
!le16 5621
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15824205
|
||||
!be24 15821247
|
||||
!le16 6199
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15898440
|
||||
!be24 15895482
|
||||
!le16 410
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15899194
|
||||
!be24 15896236
|
||||
!le16 449
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15899643
|
||||
!be24 15896685
|
||||
!le16 303
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 12665953
|
||||
!be24 12662995
|
||||
!le16 1652
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15846340
|
||||
!be24 15843382
|
||||
!le16 1640
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15898926
|
||||
!be24 15895968
|
||||
!le16 67
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15893251
|
||||
!be24 15890293
|
||||
!le16 59
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15891671
|
||||
!be24 15888713
|
||||
!le16 1426
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15876437
|
||||
!be24 15873479
|
||||
!le16 557
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15843700
|
||||
!be24 15840742
|
||||
!le16 2640
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15848338
|
||||
!be24 15845380
|
||||
!le16 473
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15848811
|
||||
!be24 15845853
|
||||
!le16 7564
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15898850
|
||||
!be24 15895892
|
||||
!le16 76
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15893097
|
||||
!be24 15890139
|
||||
!le16 154
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15898993
|
||||
!be24 15896035
|
||||
!le16 201
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15876994
|
||||
!be24 15874036
|
||||
!le16 4334
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15881328
|
||||
!be24 15878370
|
||||
!le16 1733
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15883061
|
||||
!be24 15880103
|
||||
!le16 1181
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15884242
|
||||
!be24 15881284
|
||||
!le16 3394
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15887636
|
||||
!be24 15884678
|
||||
!le16 3429
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15891065
|
||||
!be24 15888107
|
||||
!le16 479
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15891544
|
||||
!be24 15888586
|
||||
!le16 127
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15899946
|
||||
!be24 15896988
|
||||
!le16 2370
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15861780
|
||||
!be24 15858822
|
||||
!le16 5083
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15866863
|
||||
!be24 15863905
|
||||
!le16 2485
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15830404
|
||||
!be24 15827446
|
||||
!le16 7564
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15760152
|
||||
!be24 15757194
|
||||
!le16 9583
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15773929
|
||||
!be24 15770971
|
||||
!le16 10520
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15789101
|
||||
!be24 15786143
|
||||
!le16 14063
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15808785
|
||||
!be24 15805827
|
||||
!le16 15420
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15847980
|
||||
!be24 15845022
|
||||
!le16 358
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15856375
|
||||
!be24 15853417
|
||||
!le16 5405
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15869348
|
||||
!be24 15866390
|
||||
!le16 7089
|
||||
|
@ -4,5 +4,5 @@
|
||||
; This file is automatically generated
|
||||
;
|
||||
!byte 0
|
||||
!be24 15755804
|
||||
!be24 15752846
|
||||
!le16 4348
|
||||
|
Loading…
Reference in New Issue
Block a user