Prev: E8D2 Up: Map Next: E8F1
E8E3: Convert a room co-ordinate to an attribute address
Used by the routines at CA5B, CB8D, D7A2, D7D6, E84E, E8BA, E93F and E96B.
Input
DE On entry, holds the x and y co-ordinates. On return, holds the attribute address.
E8E3 LD A,E Get the Y co-ordinate.
E8E4 AND $18 Keep bits 3 and 4, which hold the correct third of the screen to use.
E8E6 SRA A Divide by 8 to get an appropriate offset for this line.
E8E8 SRA A
E8EA SRA A
E8EC ADD A,$58 Add the base address for the attribute buffer.
E8EE PUSH AF Store A and ensure the stack is correct for the next instruction.
E8EF JR $E8F7 Jump forward to set the low byte, which is the same as the screen.
Prev: E8D2 Up: Map Next: E8F1