Prev: A733 Up: Map Next: A7A4
A75C: Draw Shifted Row In Buffer
Draws one row of a sprite that is not aligned to a byte into 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 DrawShiftedRowInBuffer to one byte at A78C.
Input
B High byte of the shift table
DE Address of the data of the sprite
HL Address in the buffer
DrawShiftedRowInBuffer A75C LD A,(DE) Fetch a byte of the sprite.
A75D LD C,A Use it to look up the left part in the shift table.
A75E LD A,(BC) Fetch the left part.
A75F OR (HL) Set the pixels of the buffer.
A760 LD (HL),A Store the byte.
A761 INC B Move to the table of right parts.
A762 INC L Move on to the next byte of the buffer.
A763 LD A,(BC) Fetch the right part.
A764 OR (HL) Set the pixels of the buffer.
A765 LD (HL),A Store the byte.
A766 DEC B Move back to the table of left parts.
A767 INC DE Move on to the next byte of the sprite.
A768 LD A,(DE) Fetch a byte of the sprite.
A769 LD C,A Use it to look up the left part in the shift table.
A76A LD A,(BC) Fetch the left part.
A76B OR (HL) Set the pixels of the buffer.
A76C LD (HL),A Store the byte.
A76D INC B Move to the table of right parts.
A76E INC L Move on to the next byte of the buffer.
A76F LD A,(BC) Fetch the right part.
A770 OR (HL) Set the pixels of the buffer.
A771 LD (HL),A Store the byte.
A772 DEC B Move back to the table of left parts.
A773 INC DE Move on to the next byte of the sprite.
A774 LD A,(DE) Fetch a byte of the sprite.
A775 LD C,A Use it to look up the left part in the shift table.
A776 LD A,(BC) Fetch the left part.
A777 OR (HL) Set the pixels of the buffer.
A778 LD (HL),A Store the byte.
A779 INC B Move to the table of right parts.
A77A INC L Move on to the next byte of the buffer.
A77B LD A,(BC) Fetch the right part.
A77C OR (HL) Set the pixels of the buffer.
A77D LD (HL),A Store the byte.
A77E DEC B Move back to the table of left parts.
A77F INC DE Move on to the next byte of the sprite.
A780 LD A,(DE) Fetch a byte of the sprite.
A781 LD C,A Use it to look up the left part in the shift table.
A782 LD A,(BC) Fetch the left part.
A783 OR (HL) Set the pixels of the buffer.
A784 LD (HL),A Store the byte.
A785 INC B Move to the table of right parts.
A786 INC L Move on to the next byte of the buffer.
A787 LD A,(BC) Fetch the right part.
A788 OR (HL) Set the pixels of the buffer.
A789 LD (HL),A Store the byte.
A78A DEC B Move back to the table of left parts.
A78B INC DE Move on to the next byte of the sprite.
A78C LD A,(DE) Fetch a byte of the sprite.
A78D LD C,A Use it to look up the left part in the shift table.
A78E LD A,(BC) Fetch the left part.
A78F OR (HL) Set the pixels of the buffer.
A790 LD (HL),A Store the byte.
A791 INC B Move to the table of right parts.
A792 INC L Move on to the next byte of the buffer.
A793 LD A,(BC) Fetch the right part.
A794 OR (HL) Set the pixels of the buffer.
A795 LD (HL),A Store the byte.
A796 DEC B Move back to the table of left parts.
A797 INC DE Move on to the next byte of the sprite.
A798 LD A,$00 Fetch the amount to skip, which was set at A488.
A79A ADD A,L Add it to the address in the buffer.
A79B LD L,A Store it in L.
A79C EX AF,AF' Switch to the count of rows.
A79D DEC A Take one off.
A79E JP Z,DrawSprites_Dissolve Jump to DrawSprites_Dissolve to finish when there are none left.
A7A1 EX AF,AF' Switch back.
A7A2 JP (IX) Draw the next row.
Prev: A733 Up: Map Next: A7A4