Prev: 49173 Up: Map Next: 49233
49213: Calculate Screen Address
Used by the routines at 38730, PrintLine, 46724 and StartGame.
Input
HL Screen co-ordinates
HL Shadow buffer address
ScreenAddress 49213 LD A,L Store L for later.
As one line is 32 bytes, this calculates the vertical co-ordinate.
49214 LD L,H Create an offset in HL with H.
49215 LD H,0
49217 ADD HL,HL HL*=32.
49218 ADD HL,HL
49219 ADD HL,HL
49220 ADD HL,HL
49221 ADD HL,HL
Calculate the horizontal co-ordinate.
49222 SRL A Shift A right three bits (A//=8).
49224 SRL A
49226 SRL A
55808 is the shadow buffer.
49228 LD C,A C=A.
49229 LD B,218 B=218.
49231 ADD HL,BC HL+=BC.
49232 RET Return.
Prev: 49173 Up: Map Next: 49233