Prev: A6B2 Up: Map Next: A733
A6E1: Erase Shifted Row In Buffer
Erases one row of a sprite that is not aligned to a byte from the buffer used by DrawSprites, using the shift table that B points to. Each byte of the sprite makes two bytes in the buffer. The entry point depends on the width of the sprite in bytes, from five bytes at EraseShiftedRowInBuffer to one byte at A719.
Input
B High byte of the shift table
DE' Address of the data of the sprite
HL' Address in the buffer
EraseShiftedRowInBuffer A6E1 LD A,(DE) Fetch a byte of the sprite.
A6E2 LD C,A Use it to look up the left part in the shift table.
A6E3 LD A,(BC) Fetch the left part.
A6E4 CPL Invert it.
A6E5 AND (HL) Clear the pixels of the buffer.
A6E6 LD (HL),A Store the byte.
A6E7 INC B Move to the table of right parts.
A6E8 INC L Move on to the next byte of the buffer.
A6E9 LD A,(BC) Fetch the right part.
A6EA CPL Invert it.
A6EB DEC B Move back to the table of left parts.
A6EC AND (HL) Clear the pixels of the buffer.
A6ED LD (HL),A Store the byte.
A6EE INC DE Move on to the next byte of the sprite.
A6EF LD A,(DE) Fetch a byte of the sprite.
A6F0 LD C,A Use it to look up the left part in the shift table.
A6F1 LD A,(BC) Fetch the left part.
A6F2 CPL Invert it.
A6F3 AND (HL) Clear the pixels of the buffer.
A6F4 LD (HL),A Store the byte.
A6F5 INC B Move to the table of right parts.
A6F6 INC L Move on to the next byte of the buffer.
A6F7 LD A,(BC) Fetch the right part.
A6F8 CPL Invert it.
A6F9 AND (HL) Clear the pixels of the buffer.
A6FA LD (HL),A Store the byte.
A6FB DEC B Move back to the table of left parts.
A6FC INC DE Move on to the next byte of the sprite.
A6FD LD A,(DE) Fetch a byte of the sprite.
A6FE LD C,A Use it to look up the left part in the shift table.
A6FF LD A,(BC) Fetch the left part.
A700 CPL Invert it.
A701 AND (HL) Clear the pixels of the buffer.
A702 LD (HL),A Store the byte.
A703 INC B Move to the table of right parts.
A704 INC L Move on to the next byte of the buffer.
A705 LD A,(BC) Fetch the right part.
A706 CPL Invert it.
A707 DEC B Move back to the table of left parts.
A708 AND (HL) Clear the pixels of the buffer.
A709 LD (HL),A Store the byte.
A70A INC DE Move on to the next byte of the sprite.
A70B LD A,(DE) Fetch a byte of the sprite.
A70C LD C,A Use it to look up the left part in the shift table.
A70D LD A,(BC) Fetch the left part.
A70E CPL Invert it.
A70F AND (HL) Clear the pixels of the buffer.
A710 LD (HL),A Store the byte.
A711 INC B Move to the table of right parts.
A712 INC L Move on to the next byte of the buffer.
A713 LD A,(BC) Fetch the right part.
A714 CPL Invert it.
A715 DEC B Move back to the table of left parts.
A716 AND (HL) Clear the pixels of the buffer.
A717 LD (HL),A Store the byte.
A718 INC DE Move on to the next byte of the sprite.
A719 LD A,(DE) Fetch a byte of the sprite.
A71A LD C,A Use it to look up the left part in the shift table.
A71B LD A,(BC) Fetch the left part.
A71C CPL Invert it.
A71D AND (HL) Clear the pixels of the buffer.
A71E LD (HL),A Store the byte.
A71F INC B Move to the table of right parts.
A720 INC L Move on to the next byte of the buffer.
A721 LD A,(BC) Fetch the right part.
A722 CPL Invert it.
A723 DEC B Move back to the table of left parts.
A724 AND (HL) Clear the pixels of the buffer.
A725 LD (HL),A Store the byte.
A726 INC DE Move on to the next byte of the sprite.
A727 LD A,$00 Fetch the amount to skip, which was set at A460.
A729 ADD A,L Add it to the address in the buffer.
A72A LD L,A Store it in L.
A72B EX AF,AF' Switch to the count of rows.
A72C DEC A Take one off.
A72D JP Z,DrawSprites_Draw Jump to DrawSprites_Draw to draw the second sprite when there are none left.
A730 EX AF,AF' Switch back.
A731 JP (IY) Erase the next row.
Prev: A6B2 Up: Map Next: A733