load radial2 data from external files and transform it at runtime

This commit is contained in:
Peter Ferrie 2020-11-14 15:48:38 -08:00
parent b247ef8f41
commit f2dbdb6bff
8 changed files with 48 additions and 6764 deletions

View File

@ -8,7 +8,7 @@
!source "src/fx/fx.hgr.precomputed.1bit.a"
+FX_INITONCE_1BIT CoordinatesFile, Start
+FX_RIPPLE_1BIT
+FX_RIPPLE_1BIT aslmod2
Start
+FX_PRECOMPUTED_1BIT Coordinates1Bit

View File

@ -174,7 +174,7 @@ InitOnce
++
}
!macro FX_RIPPLE_1BIT {
!macro FX_RIPPLE_1BIT .target {
lda #2 ; <(Coordinates1Bit + 2)
sta $f0
ldy #0
@ -200,7 +200,7 @@ InitOnce
--- ldx #4
-- ldy $ee, x
lda $ef, x
jsr aslmod
jsr .target
sty $ee, x
sta $ef, x
sty $ec
@ -229,8 +229,9 @@ InitOnce
dec $ef
bpl ---
bmi +++ ; always branches
aslmod
aslmod2
jsr +
aslmod
+ cmp #$1A
bcc +
bne ++

View File

@ -1,43 +1,43 @@
mirror_src1 = $E8 ; word
mirror_dest1 = $EA ; word
mirror_src2 = $EC ; word
mirror_dest2 = $EE ; word
src1 = $F0 ; word
dest1 = $F2 ; word
src2 = $F4 ; word
dest2 = $F6 ; word
mirror_src1_rad = $E8 ; word
mirror_dest1_rad = $EA ; word
mirror_src2_rad = $EC ; word
mirror_dest2_rad = $EE ; word
src1_rad = $F0 ; word
dest1_rad = $F2 ; word
src2_rad = $F4 ; word
dest2_rad = $F6 ; word
reverse_input = $FC ; word
input = $FE ; word
input_rad = $FE ; word
+BUILD_HGR_LOOKUP_TABLES hgrlo, hgr1hi
+BUILD_HGR_MIRROR_LOOKUP_TABLES hgrlomirror, hgr1himirror
+BUILD_MIRROR_COLS mirror_cols
+BUILD_SPARSE_BITMASKS copymasks, mirror_copymasks
+LDADDR Coordinates
+ST16 input
+ST16 input_rad
+LDADDR EndCoordinates-2
+ST16 reverse_input
jmp Loop
Exit rts
Loop ldy #0
lda (input),y
lda (input_rad),y
bmi Exit
tax
+ROW_X_TO_BASE_ADDRESSES
+ROW_X_TO_MIRROR_ADDRESSES
inc input
lda (input),y
+HIGH_3_LOW_5 input
inc input_rad
lda (input_rad),y
+HIGH_3_LOW_5 input_rad
; top-left quadrant (original row, original column, original input order)
+COPY_BIT src1, dest1, copymasks
+COPY_BIT src2, dest2, copymasks
; top-left quadrant (original row, original column, original input_rad order)
+COPY_BIT src1_rad, dest1_rad, copymasks
+COPY_BIT src2_rad, dest2_rad, copymasks
; bottom-right quadrant (opposite row, opposite column, original input order)
; bottom-right quadrant (opposite row, opposite column, original input_rad order)
lda mirror_cols,y
tay
+COPY_BIT mirror_src1, mirror_dest1, mirror_copymasks
+COPY_BIT mirror_src2, mirror_dest2, mirror_copymasks
+COPY_BIT mirror_src1_rad, mirror_dest1_rad, mirror_copymasks
+COPY_BIT mirror_src2_rad, mirror_dest2_rad, mirror_copymasks
ldy #0
lda (reverse_input),y
@ -48,19 +48,19 @@ Loop ldy #0
lda (reverse_input),y
+HIGH_3_LOW_5 reverse_input
; bottom-left quadrant (opposite row, original column, reverse input order)
+COPY_BIT mirror_src1, mirror_dest1, copymasks
+COPY_BIT mirror_src2, mirror_dest2, copymasks
; bottom-left quadrant (opposite row, original column, reverse input_rad order)
+COPY_BIT mirror_src1_rad, mirror_dest1_rad, copymasks
+COPY_BIT mirror_src2_rad, mirror_dest2_rad, copymasks
; top-right quadrant (same row, opposite column, reverse input order)
; top-right quadrant (same row, opposite column, reverse input_rad order)
lda mirror_cols,y
tay
+COPY_BIT src1, dest1, mirror_copymasks
+COPY_BIT src2, dest2, mirror_copymasks
+COPY_BIT src1_rad, dest1_rad, mirror_copymasks
+COPY_BIT src2_rad, dest2_rad, mirror_copymasks
inc input
inc input_rad
bne +
inc input+1
inc input_rad+1
+ lda reverse_input
beq +
dec reverse_input

View File

@ -1,17 +1,20 @@
;license:MIT
;(c) 2019 by 4am
;(c) 2019-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/RADIAL2",plain
*=$6000
!source "src/fx/fx.hgr.precomputed.1bit.a"
+FX_INITONCE_1BIT CoordinatesFile, Start
+FX_RIPPLE_1BIT aslmod
Start
Coordinates = Coordinates1Bit
EndCoordinates = Coordinates + $3480
+FX_PRECOMPUTED_1BIT Coordinates1Bit
!source "src/fx/fx.hgr.radial.common.a"
!if * and 1 {
!byte 0
}
Coordinates
!source "src/fx/fx.hgr.radial2.data.a"
EndCoordinates
!byte $80
CoordinatesFile
!byte 14
!text "FX/RADIAL.DATA"

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
!source "src/fx/fx.hgr.precomputed.1bit.a"
+FX_INITONCE_1BIT CoordinatesFile, Start
+FX_RIPPLE_1BIT
+FX_RIPPLE_1BIT aslmod2
Start
+FX_PRECOMPUTED_1BIT Coordinates1Bit

View File

@ -8,7 +8,7 @@
!source "src/fx/fx.hgr.precomputed.1bit.a"
+FX_INITONCE_1BIT CoordinatesFile, Start
+FX_RIPPLE_1BIT
+FX_RIPPLE_1BIT aslmod2
Start
+FX_PRECOMPUTED_1BIT Coordinates1Bit

View File

@ -8,7 +8,7 @@
!source "src/fx/fx.hgr.precomputed.1bit.a"
+FX_INITONCE_1BIT CoordinatesFile, Start
+FX_RIPPLE_1BIT
+FX_RIPPLE_1BIT aslmod2
Start
+FX_PRECOMPUTED_1BIT Coordinates1Bit