Prev: 30085 Up: Map Next: 30137
30106: Calculate Screen Address
Used by the routines at MenuWriteText, 27916, DisplayPlayerLives, PrintString and 29861.
ScreenAddress 30106 LD A,L A=L.
30107 RRCA A=A / 8.
30108 RRCA
30109 RRCA
30110 AND %00011111 Keep only bits 0-4.
30112 LD L,A L=A.
30113 LD A,H A=H.
30114 RLCA A=A * 4.
30115 RLCA
30116 AND %11100000 Keep only bits 5-7.
30118 OR L
30119 LD L,A L=A.
30120 LD A,H A=H.
30121 AND %00000111 Keep only bits 0-2.
30123 EX AF,AF' Switch to the shadow AF register.
30124 LD A,H A=H.
30125 RRCA A=A / 8.
30126 RRCA
30127 RRCA
30128 AND %00011000 Keep only bits 3-4.
30130 OR %01000000 Set bit 6.
30132 LD H,A H=A.
30133 EX AF,AF' Switch to the shadow AF register.
30134 OR H
30135 LD H,A H=A.
30136 RET Return.
View the equivalent code in;
Prev: 30085 Up: Map Next: 30137