Prev: B43C Up: Map Next: B4E8
B4C0: Draw Unshifted Rows
Draws the rows of a sprite that is not shifted, using the stack pointer to read the sprite data. Each pair of sprite bytes is a mask byte and a picture byte, and these are combined with the screen buffer. There are four entry points, which are for widths of four, three, two and one bytes. The address in the table at RowRoutineTable is the entry point for the width.
Input
HL The address in the screen buffer
B The number of rows
SP The sprite data
DrawUnshiftedRows B4C0 POP DE Draw one byte of the sprite.
B4C1 LD A,E
B4C2 CPL
B4C3 AND (HL)
B4C4 OR D
B4C5 LD (HL),A
B4C6 INC HL
DrawUnshiftedRows_Three B4C7 POP DE Draw one byte of the sprite.
B4C8 LD A,E
B4C9 CPL
B4CA AND (HL)
B4CB OR D
B4CC LD (HL),A
B4CD INC HL
DrawUnshiftedRows_Two B4CE POP DE Draw one byte of the sprite.
B4CF LD A,E
B4D0 CPL
B4D1 AND (HL)
B4D2 OR D
B4D3 LD (HL),A
B4D4 INC HL
This entry point is used by the routine at DrawNeedleTip.
DrawUnshiftedRows_One B4D5 POP DE Draw the last byte of the sprite.
B4D6 LD A,E
B4D7 CPL
B4D8 AND (HL)
B4D9 OR D
B4DA LD (HL),A
DrawUnshiftedRows_Next B4DB LD DE,$FF00 Move to the next row of the screen buffer.
B4DE ADD HL,DE
B4DF DEC B Repeat for the remaining rows.
B4E0 JP NZ,DrawUnshiftedRows_Next
B4E3 LD SP,($5CDA) Restore the stack pointer.
B4E7 RET Return.
Prev: B43C Up: Map Next: B4E8