Z80 Assembly 23: Graphics and Pixel Plotting (Bitwise Drawing)
The Screen Memory Layout On a bitmap Z80 system (like the ZX Spectrum), the screen is a large array of memory where each byte controls a group of 8 horizontal pixels. To plot a single pixel at coordinate (X, Y), you need two things: Memory Address: The 16-bit address of the byte that contains the pixel. Bit Mask: A byte with a single bit set (10000000B, 01000000B, etc.) to isolate the target pixel within that byte. Step 1: Calculating the Byte Address The calculation for the byte address is highly complex and specific to each system’s memory layout. It typically involves combining the Y-coordinate (row) and the X-coordinate (column). ...