Prev: 22AA Up: Map Next: 22DC
22CB: THE 'POINT' SUBROUTINE
This subroutine is called from S_POINT. It is entered with the coordinates of a pixel on the calculator stack, and returns a last value of 1 if that pixel is ink colour, and 0 if it is paper colour.
POINT_SUB 22CB CALL STK_TO_BC y-coordinate to B, x to C.
22CE CALL PIXEL_ADD Pixel address to HL.
22D1 LD B,A B will count A+1 loops to get the wanted bit of (HL) to location 0.
22D2 INC B
22D3 LD A,(HL)
POINT_LP 22D4 RLCA The shifts.
22D5 DJNZ POINT_LP
22D7 AND $01 The bit is 1 for ink, 0 for paper.
22D9 JP STACK_A It is put on the calculator stack.
Prev: 22AA Up: Map Next: 22DC