Prev: 43125 Up: Map Next: 43197
43182: Calculate Screen Buffer
Input
D Source Y position
E Source X position
Output
HL Screen buffer location
CalculateScreenBuffer 43182 LD A,%00000111 Mask out the bottom 3 bits of the Y position.
43184 AND D
43185 RRCA Rotate the bits right three positions.
43186 RRCA
43187 RRCA
43188 OR E Combine with the X position.
43189 LD L,A L=low byte of the screen buffer address.
43190 LD A,D Mask out bits 3-4 of the Y position.
43191 AND %00011000
43193 OR %01000000 Add the screen buffer memory base address (16384).
43195 LD H,A H=high byte of the screen buffer address.
43196 RET Return.
Prev: 43125 Up: Map Next: 43197