4cade/src/fx/fx.hgr.radial3.a

91 lines
2.5 KiB
Plaintext
Raw Normal View History

2018-12-29 13:43:59 -05:00
;license:MIT
2020-11-14 20:19:35 -08:00
;(c) 2019-2020 by 4am/qkumba
2018-12-29 13:43:59 -05:00
;
!cpu 6502
!to "build/FX/RADIAL3",plain
*=$6000
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
reverse_input = $FC ; word
input = $FE ; word
2019-10-24 15:41:08 -04:00
!source "src/fx/fx.hgr.precomputed.1bit.a"
2020-11-14 20:19:35 -08:00
+FX_INITONCE_1BIT CoordinatesFile, Start
Start
2019-10-24 15:41:08 -04:00
+BUILD_MIRROR_COLS mirror_cols
2020-11-24 21:18:55 -05:00
+BUILD_HGR_LOOKUP_TABLES_X_IS_ALREADY_0 hgrlo, hgr1hi
+BUILD_HGR_MIRROR_LOOKUP_TABLES hgrlomirror, hgr1himirror
2019-10-24 15:41:08 -04:00
+BUILD_SPARSE_BITMASKS copymasks, mirror_copymasks
+LDADDR Coordinates1Bit
2020-03-24 16:30:14 -04:00
+ST16 input
+LDADDR EndCoordinates1Bit-2
2020-03-24 16:30:14 -04:00
+ST16 reverse_input
+HIDE_NEXT_BYTE
2019-10-24 15:41:08 -04:00
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
2019-10-24 15:41:08 -04:00
; top-left quadrant (original row, original column, original input order)
+COPY_BIT src1, dest1, copymasks
+COPY_BIT src2, dest2, copymasks
2019-10-24 15:41:08 -04:00
; bottom-right quadrant (opposite row, opposite column, original input order)
lda mirror_cols,y
tay
2019-10-25 22:20:10 -04:00
+COPY_BIT mirror_src1, mirror_dest1, mirror_copymasks
+COPY_BIT mirror_src2, mirror_dest2, mirror_copymasks
2019-10-24 15:41:08 -04: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-25 22:20:10 -04:00
+COPY_BIT mirror_src1, mirror_dest1, copymasks
+COPY_BIT mirror_src2, mirror_dest2, copymasks
2019-10-24 15:41:08 -04: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
2020-11-24 21:18:55 -05:00
php
2019-10-24 15:41:08 -04:00
dec reverse_input
dec reverse_input
2020-11-24 21:18:55 -05:00
plp
bne +
2019-10-24 15:41:08 -04:00
dec reverse_input+1
bit $c000
2020-11-24 21:18:55 -05:00
bmi ++
+ jmp Loop
++ rts
2019-10-24 15:41:08 -04:00
2020-11-14 20:19:35 -08:00
CoordinatesFile
2020-11-14 23:28:45 -05:00
!byte 14
2020-11-14 20:19:35 -08:00
!text "FX/RADIAL.DATA"