Prev: 8121 Up: Map Next: 813A
812B: Move the point up one, if it can
Used by the routines at FLOOD_FILL and DRAW_LINE.
y is 0-127, so bit 7 going high means it would leave the canvas: the move is undone and A returned with its low bit clear. Otherwise the low bit is set. The callers test that bit rather than the flags, which is why both exits go through the same tail.
INC_Y 812B INC E Up one; did y pass 127?
812C BIT 7,E
812E JR Z,Y_MOVED
8130 DEC E Yes: undo it, and return A with bit 0 clear
8131 LD H,A
8132 XOR A
8133 LD A,H
8134 RET
This entry point is used by the routine at DEC_Y.
Y_MOVED 8135 LD H,A No: return A with bit 0 set (DEC_Y shares this)
8136 OR $01
8138 LD A,H
8139 RET
Prev: 8121 Up: Map Next: 813A