Prev: C015 Up: Map Next: C051
C03D: Calculate Screen Address
Used by the routines at 974A, PrintLine, B684 and StartGame.
Input
HL Screen co-ordinates
HL Shadow buffer address
ScreenAddress C03D LD A,L Store L for later.
As one line is 20 bytes, this calculates the vertical co-ordinate.
C03E LD L,H Create an offset in HL with H.
C03F LD H,$00
C041 ADD HL,HL HL*=20.
C042 ADD HL,HL
C043 ADD HL,HL
C044 ADD HL,HL
C045 ADD HL,HL
Calculate the horizontal co-ordinate.
C046 SRL A Shift A right three bits (A//=08).
C048 SRL A
C04A SRL A
DA00 is the shadow buffer.
C04C LD C,A C=A.
C04D LD B,$DA B=DA.
C04F ADD HL,BC HL+=BC.
C050 RET Return.
Prev: C015 Up: Map Next: C051