Prev: 9F13 Up: Map Next: 9F2B
9F21: Shift one row of a sprite into place and draw it
Used by the routine at ERASE_DRAW_ROWS.
Reads two bytes of the row into HL and then jumps into the chain below at whatever depth SETUP_SPRITE_DRAW patched in. Each step there is ADD HL,HL with ADC A,A behind it, so the pair behaves as a 17-bit shift left: the bit falling off HL is caught in A, which becomes the third byte on screen.
SHIFT_AND_PLOT 9F21 EX DE,HL The row.
9F22 PUSH DE
9F23 LD D,(HL) Two bytes of it, and step past them.
9F24 INC HL
9F25 LD E,(HL)
9F26 INC HL
9F27 EX DE,HL A starts empty and collects the bits pushed out of HL.
9F28 XOR A
DRAW_JR 9F29 JR DRAW_JR Reads as a jump to itself; by the time it runs the displacement has been overwritten, and it lands part-way down the chain.
Prev: 9F13 Up: Map Next: 9F2B