Prev: E2A2 Up: Map Next: E40F
E3FA: Flip 24 masked pixels
This horizontally flips the 24 pixels in E,C,B and counterpart masks in E',C',B'.
Used by the routine at plot_masked_sprite_24px.
Input
B Left eight pixels.
C Middle eight pixels.
E Right eight pixels.
B' Left eight mask pixels.
C' Middle eight mask pixels.
E' Right eight mask pixels.
Output
B Flipped left eight pixels.
C Flipped middle eight pixels.
E Flipped right eight pixels.
B' Flipped left eight mask pixels.
C' Flipped middle eight mask pixels.
E' Flipped right eight mask pixels.
Horizontally flip the bitmap bytes by looking up each byte in the flipped / bit-reversed table at $7F00 and swapping the left and right pixels over.
flip_24_masked_pixels E3FA LD H,$7F Point HL into the table of 256 flipped bytes at $7Fxx
E3FC LD L,E Point HL at the flipped byte for E (right pixels)
E3FD LD E,B Shuffle
E3FE LD B,(HL) Load the flipped byte into B
E3FF LD L,E Point HL at the flipped byte for E (left pixels)
E400 LD E,(HL) Load the flipped byte into E
E401 LD L,C Point HL at the flipped byte for C (middle pixels)
E402 LD C,(HL) Load the flipped byte into C
Likewise horizontally flip the mask bytes.
E403 EXX Swap bank to mask bytes
E404 LD H,$7F Point HL into the table of 256 flipped bytes at $7Fxx
E406 LD L,E Point HL at the flipped byte for E (right mask)
E407 LD E,B Shuffle
E408 LD B,(HL) Load the flipped byte into B
E409 LD L,E Point HL at the flipped byte for E (left mask)
E40A LD E,(HL) Load the flipped byte into E
E40B LD L,C Point HL at the flipped byte for C (middle mask)
E40C LD C,(HL) Load the flipped byte into C
E40D EXX Restore original bank
E40E RET Return
Prev: E2A2 Up: Map Next: E40F