Prev: 27032 Up: Map Next: 27068
27037: Plot Pixels
Used by the routine at ClearPixels.
Sets or clears a block of pixels, going up from the bottom row and across from the left column. Which of the two depends on the operands that have been written by ClearPixels or SetPixels.
Input
B Height of the block in pixels
C Width of the block in pixels
HL Pixel co-ordinates of the bottom left of the block (H is the Y position and L is the X position)
PlotPixels 27037 PUSH BC Stash BC and HL on the stack.
27038 PUSH HL
27039 LD A,L A=L.
27040 CPL Flip the bits.
27041 RLCA A=A * 8.
27042 RLCA
27043 RLCA
27044 AND %00111000 Keep only bits 3-5.
Self modifying code
Altered From Bytes bits
ClearPixels 134 10000110
SetPixels 198 11000110
27046 OR %11000110 Set bits 1-2, 6-7 (this operand is modified).
27048 LD (27055),A Store A as the opcode of the instruction at 27055.
27051 CALL ScreenAddress Call ScreenAddress.
PlotPixels_Column 27054 SET 0,(HL) Set (or reset) the bit of the byte at HL for this pixel.
27056 CALL ScreenPosition1PixelAbove Call ScreenPosition1PixelAbove to move up one pixel.
27059 DJNZ PlotPixels_Column Decrease the height counter by one and loop back to PlotPixels_Column until the whole column has been set (or cleared).
27061 POP HL Restore HL and BC from the stack.
27062 POP BC
27063 INC L Move on to the next pixel column.
27064 DEC C Decrease the width counter by one and loop back to PlotPixels until all of the columns have been done.
27065 JR NZ,PlotPixels
27067 RET Return.
Prev: 27032 Up: Map Next: 27068