MK.DEMO/Docs/Rotate sprites
Anatoliy Belyanskiy 0b262da641 Setup
2023-06-15 02:51:06 +10:00

75 lines
2.2 KiB
Plaintext

Orig:
##################
x0 #[] [] [] #
x1 # [] #
x2 # [] #
x3 # [] #
x4 # #
x5 # #
x6 # #
x7 # [] [] []#
##################
y0y1y2y3y4y5y6y7
1. Identical:
Set port_y, ACC_CopyBlock read RAM x0..x7, add sprite address, ACC_CopyBlock write VRAM x0..x7, inc port_y x0..x7
##################
x0 #[] [] [] #
x1 # [] #
x2 # [] #
x3 # [] #
x4 # #
x5 # #
x6 # #
x7 # [] [] []#
##################
y0y1y2y3y4y5y6y7
2. Mirrored horizontally
Set port_y, ACC_CopyBlock read RAM x7..x0, sub sprite address, ACC_CopyBlock write VRAM x0..x7, inc port_y x0..x7
OR
Set port_y, ACC_CopyBlock read RAM x0..x7, add sprite address, ACC_CopyBlock write VRAM x0..x7, dec port_y x7..x0
##################
x0 # [] [] []#
x1 # #
x2 # #
x3 # #
x4 # [] #
x5 # [] #
x6 # [] #
x7 #[] [] [] #
##################
y0y1y2y3y4y5y6y7
3. Rotated 90 degrees clockwise
Set port_y, ACC_CopyBlock read RAM x0..x7, add sprite address, ACC_CopyScreenBlock write VRAM y0..y7, inc VRAM address y0..y7
OR
Set port_y, ACC_CopyBlock read RAM x7..x0, sub sprite address, ACC_CopyScreenBlock write VRAM y7..y0, dec VRAM address y7..y0
##################
x0 #[] #
x1 # []#
x2 #[] #
x3 # [] #
x4 #[] #
x5 # [][] []#
x6 # #
x7 # []#
##################
y0y1y2y3y4y5y6y7
4. Rotated 90 degrees clockwise and mirrored vertically
Set port_y, ACC_CopyBlock read RAM x0..x7, add sprite address, ACC_CopyScreenBlock write VRAM y7..y0, dec VRAM address y7..y0
OR
Set port_y, ACC_CopyBlock read RAM x7..x0, sub sprite address, ACC_CopyScreenBlock write VRAM y0..y7, inc VRAM address y0..y7
##################
x0 # []#
x1 #[] #
x2 # []#
x3 # [] #
x4 # []#
x5 #[] [][] #
x6 # #
x7 #[] #
##################
y0y1y2y3y4y5y6y7