2018-12-29 18:43:59 +00:00
|
|
|
;license:MIT
|
2019-10-24 19:41:08 +00:00
|
|
|
;(c) 2019 by 4am
|
2018-12-29 18:43:59 +00:00
|
|
|
;
|
2018-11-04 15:18:30 +00:00
|
|
|
!cpu 6502
|
|
|
|
!to "build/FX/RADIAL3",plain
|
|
|
|
*=$6000
|
|
|
|
|
2019-10-24 19:41:08 +00:00
|
|
|
!source "src/fx/fx.hgr.precomputed.1bit.a"
|
2018-11-04 16:09:37 +00:00
|
|
|
|
2019-10-24 19:41:08 +00:00
|
|
|
+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
|
|
|
|
+STAY input
|
|
|
|
+LDADDR EndCoordinates-2
|
|
|
|
+STAY reverse_input
|
|
|
|
jmp Loop
|
|
|
|
Exit rts
|
|
|
|
Loop ldy #0
|
|
|
|
lda (input),y
|
|
|
|
bmi Exit
|
|
|
|
tax
|
|
|
|
+ROW_X_TO_BASE_ADDRESSES
|
|
|
|
+ROW_X_TO_MIRROR_ADDRESSES
|
|
|
|
inc input
|
|
|
|
lda (input),y
|
|
|
|
+HIGH_3_LOW_5 input
|
2018-11-04 15:18:30 +00:00
|
|
|
|
2019-10-24 19:41:08 +00:00
|
|
|
; top-left quadrant (original row, original column, original input order)
|
|
|
|
+COPY_BIT src1, dest1, copymasks
|
|
|
|
+COPY_BIT src2, dest2, copymasks
|
2019-06-24 18:54:49 +00:00
|
|
|
|
2019-10-24 19:41:08 +00:00
|
|
|
; bottom-right quadrant (opposite row, opposite column, original input order)
|
|
|
|
lda mirror_cols,y
|
|
|
|
tay
|
2019-10-26 02:20:10 +00:00
|
|
|
+COPY_BIT mirror_src1, mirror_dest1, mirror_copymasks
|
|
|
|
+COPY_BIT mirror_src2, mirror_dest2, mirror_copymasks
|
2019-10-24 19:41:08 +00:00
|
|
|
|
|
|
|
ldy #0
|
|
|
|
lda (reverse_input),y
|
|
|
|
tax
|
|
|
|
+ROW_X_TO_BASE_ADDRESSES
|
|
|
|
+ROW_X_TO_MIRROR_ADDRESSES
|
|
|
|
iny
|
|
|
|
lda (reverse_input),y
|
|
|
|
+HIGH_3_LOW_5 reverse_input
|
|
|
|
|
|
|
|
; bottom-left quadrant (opposite row, original column, reverse input order)
|
2019-10-26 02:20:10 +00:00
|
|
|
+COPY_BIT mirror_src1, mirror_dest1, copymasks
|
|
|
|
+COPY_BIT mirror_src2, mirror_dest2, copymasks
|
2019-10-24 19:41:08 +00:00
|
|
|
|
|
|
|
; top-right quadrant (same row, opposite column, reverse input order)
|
|
|
|
lda mirror_cols,y
|
|
|
|
tay
|
|
|
|
+COPY_BIT src1, dest1, mirror_copymasks
|
|
|
|
+COPY_BIT src2, dest2, mirror_copymasks
|
|
|
|
|
|
|
|
inc input
|
|
|
|
bne +
|
|
|
|
inc input+1
|
|
|
|
+ lda reverse_input
|
|
|
|
beq +
|
|
|
|
dec reverse_input
|
|
|
|
dec reverse_input
|
|
|
|
jmp Loop
|
|
|
|
+ dec reverse_input
|
|
|
|
dec reverse_input
|
|
|
|
dec reverse_input+1
|
|
|
|
bit $c000
|
|
|
|
bmi +
|
|
|
|
jmp Loop
|
|
|
|
+ rts
|
|
|
|
|
|
|
|
!if * and 1 {
|
|
|
|
!byte 0
|
|
|
|
}
|
2019-06-24 18:54:49 +00:00
|
|
|
Coordinates
|
2019-10-24 19:41:08 +00:00
|
|
|
!source "src/fx/fx.hgr.radial.data.a"
|
|
|
|
EndCoordinates
|
2018-11-04 15:18:30 +00:00
|
|
|
!byte $80
|