Prev: 9E96 Up: Map Next: 9ECE
9E9B: Erase the old rows and draw the new, interleaved
Used by the routines at DRAW_THING, ERASE_THING and REDRAW_MOVED.
The loop behind REDRAW_MOVED, DRAW_THING and ERASE_THING. One register bank holds the erase of a thing at its old place (through ERASE_SHIFT_CHAIN), the other the draw at its new place (through SHIFT_CHAIN), each with a row count in C; the loop takes a row from each in turn, bottom up, both XORed onto the screen. ERASE_ROWS and DRAW_ROWS ($5E18, $5E19) hold the rows still to do once ALIGN_ROWS has done the rows the two do not share. Nothing is clipped against the play area.
ERASE_DRAW_ROWS 9E9B LD A,C
9E9C AND A
9E9D JR Z,ERASE_DRAW_ROWS_2
9E9F DEC C
9EA0 CALL FETCH_ROW
9EA3 EXX
9EA4 LD A,C
9EA5 AND A
9EA6 JR Z,ERASE_DRAW_ROWS_1
ERASE_DRAW_ROWS_0 9EA8 DEC C
9EA9 CALL SHIFT_AND_PLOT
ERASE_DRAW_ROWS_1 9EAC EXX
9EAD JR ERASE_DRAW_ROWS
ERASE_DRAW_ROWS_2 9EAF EXX
9EB0 LD A,C
9EB1 AND A
9EB2 JR NZ,ERASE_DRAW_ROWS_0
This entry point is used by the routine at REDRAW_MOVED.
ROWS_TOGETHER_SWAP 9EB4 EXX
This entry point is used by the routine at REDRAW_MOVED.
ROWS_TOGETHER 9EB5 LD A,($5E18)
9EB8 LD C,A
9EB9 LD A,($5E19)
9EBC OR C
9EBD RET Z
9EBE XOR A
9EBF LD ($5E18),A
9EC2 EXX
9EC3 LD A,($5E19)
9EC6 LD C,A
9EC7 XOR A
This entry point is used by the routine at REDRAW_MOVED.
ROWS_DRAW_ONLY 9EC8 LD ($5E19),A
9ECB EXX
9ECC JR ERASE_DRAW_ROWS
Prev: 9E96 Up: Map Next: 9ECE