4cade/src/fx/fx.hgr.radial.common.a

76 lines
2.3 KiB
Plaintext
Raw Normal View History

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-11-23 18:45:21 +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
2020-11-15 05:05:14 +00:00
+LDADDR Coordinates
+ST16 input
2020-11-15 05:05:14 +00:00
+LDADDR EndCoordinates-2
2020-03-24 20:30:14 +00:00
+ST16 reverse_input
2019-11-23 18:45:21 +00:00
jmp Loop
Exit rts
Loop ldy #0
lda (input),y
2019-11-23 18:45:21 +00:00
bmi Exit
tax
+ROW_X_TO_BASE_ADDRESSES
+ROW_X_TO_MIRROR_ADDRESSES
inc input
lda (input),y
+HIGH_3_LOW_5 input
2019-11-23 18:45:21 +00:00
; top-left quadrant (original row, original column, original input order)
+COPY_BIT src1, dest1, copymasks
+COPY_BIT src2, dest2, copymasks
2019-11-23 18:45:21 +00:00
; bottom-right quadrant (opposite row, opposite column, original input order)
2019-11-23 18:45:21 +00:00
lda mirror_cols,y
tay
+COPY_BIT mirror_src1, mirror_dest1, mirror_copymasks
+COPY_BIT mirror_src2, mirror_dest2, mirror_copymasks
2019-11-23 18:45:21 +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)
+COPY_BIT mirror_src1, mirror_dest1, copymasks
+COPY_BIT mirror_src2, mirror_dest2, copymasks
2019-11-23 18:45:21 +00:00
; top-right quadrant (same row, opposite column, reverse input order)
2019-11-23 18:45:21 +00:00
lda mirror_cols,y
tay
+COPY_BIT src1, dest1, mirror_copymasks
+COPY_BIT src2, dest2, mirror_copymasks
2019-11-23 18:45:21 +00:00
inc input
2019-11-23 18:45:21 +00:00
bne +
inc input+1
2019-11-23 18:45:21 +00:00
+ 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