Prev: AC75 Up: Map Next: ACAB
AC9A: Plot Pixel
Used by the routines at Draw_Line and Draw_Line_Step.
Plots a pixel in the display file by combining it with the byte that is already there using XOR, so plotting the same pixel again erases it. Nothing is plotted when the address is not in the display file (when the high byte is 58 or more).
The pixel within the byte is bit 07 less the lowest three bits of the x position.
Input
HL Display file address
C x position (only the lowest three bits are used)
Plot_Pixel AC9A LD A,H Fetch the high byte of the address.
AC9B CP $58 Return if it is not in the display file.
AC9D RET NC
AC9E LD A,C Fetch the x position.
AC9F AND %00000111 Keep only the lowest three bits.
ACA1 INC A Add one to make the number of rotations.
ACA2 LD B,A Store the number in B.
ACA3 XOR A Start with an empty byte.
ACA4 SCF Set the carry flag, which is the pixel.
Plot_Pixel_Rotate_Loop ACA5 RRA Rotate the pixel along the byte.
ACA6 DJNZ Plot_Pixel_Rotate_Loop Decrease the rotation counter and loop back until the pixel is in the right place.
ACA8 XOR (HL) Combine the pixel with the display file byte using XOR.
ACA9 LD (HL),A Write the result back to the display file.
ACAA RET Return.
Prev: AC75 Up: Map Next: ACAB