![]() |
Routines |
| Prev: E2A2 | Up: Map | Next: E40F |
|
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.
|
||||||||||||||||||||||||||||||||
|
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 |