Prev: D800 Up: Map Next: D826
D811: Buffer address of a pixel position
The buffer is plain rows of 32 bytes, the bottom line first, so the address is y * 32 + x / 8 from its start: BC shifted right three times.
Input
C the pixel x
B the pixel y, counted up from the bottom of the screen
BC on exit, the address in screen_buffer
calc_vidbuf_addr D811 PUSH HL BC / 8 = y * 32 + x / 8
D812 SRL B
D814 RR C
D816 SRL B
D818 RR C
D81A SRL B
D81C RR C
D81E LD HL,screen_buffer plus the start of the buffer
D821 ADD HL,BC
D822 LD C,L
D823 LD B,H
D824 POP HL
D825 RET
Prev: D800 Up: Map Next: D826