Prev: 62830 Up: Map Next: 62971
62930: Plot A Pixel
Used by the routines at DrawingFill and DrawingLine.
Sets the pixel under the pen and paints its attribute with the ink at 62987.
PlotPixel 62930 PUSH HL Ask the ROM for this pixel's address and keep the mask.
62931 CALL PixelAddress
62934 PUSH AF
62935 PUSH HL
62936 LD A,H Take the high byte of the pixel address.
62937 AND 24 Keep the third of the screen it falls in.
62939 RRCA Shift that third down to the low bits.
62940 RRCA
62941 RRCA
62942 ADD A,88 Add 88 to reach the attribute file.
62944 LD H,A Point at the attribute and clear its ink.
62945 LD A,(HL)
62946 AND 56
62948 LD (HL),A
62949 LD A,(62987) Rotate the ink at 62987 into the paper bits and skip the clash test when it already differs from the attribute.
62952 RLCA
62953 RLCA
62954 RLCA
62955 CP (HL)
62956 JR NZ,PlotPixel_0
62958 XOR 56 Flip the ink when it matches the paper colour already there, so it stays visible.
PlotPixel_0 62960 RRCA Shift the ink back into place and merge it into the attribute.
62961 RRCA
62962 RRCA
62963 OR (HL)
62964 LD (HL),A
62965 POP HL Restore the pixel address and the mask from the stack.
62966 POP AF
62967 OR (HL) Set the pixel in the display byte.
62968 LD (HL),A
62969 POP HL
62970 RET Return.
View the equivalent code in;
Prev: 62830 Up: Map Next: 62971