![]() |
Routines |
| Prev: 44149 | Up: Map | Next: 44203 |
|
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 88 or more).
The pixel within the byte is bit 7 less the lowest three bits of the x position.
|
||||||||||
| Plot_Pixel | 44186 | LD A,H | Fetch the high byte of the address. | |||||||
| 44187 | CP 88 | Return if it is not in the display file. | ||||||||
| 44189 | RET NC | |||||||||
| 44190 | LD A,C | Fetch the x position. | ||||||||
| 44191 | AND %00000111 | Keep only the lowest three bits. | ||||||||
| 44193 | INC A | Add one to make the number of rotations. | ||||||||
| 44194 | LD B,A | Store the number in B. | ||||||||
| 44195 | XOR A | Start with an empty byte. | ||||||||
| 44196 | SCF | Set the carry flag, which is the pixel. | ||||||||
| Plot_Pixel_Rotate_Loop | 44197 | RRA | Rotate the pixel along the byte. | |||||||
| 44198 | DJNZ Plot_Pixel_Rotate_Loop | Decrease the rotation counter and loop back until the pixel is in the right place. | ||||||||
| 44200 | XOR (HL) | Combine the pixel with the display file byte using XOR. | ||||||||
| 44201 | LD (HL),A | Write the result back to the display file. | ||||||||
| 44202 | RET | Return. | ||||||||
| Prev: 44149 | Up: Map | Next: 44203 |