Prev: 30416 Up: Map Next: 30466
30435: Calculate Screen Address
Used by the routines at 24545, MenuWriteText, 29560, PrintString, 30039 and 30084.
ScreenAddress 30435 LD A,L A=L.
30436 RRCA A=A / 8.
30437 RRCA
30438 RRCA
30439 AND %00011111 Keep only bits 0-4.
30441 LD L,A L=A.
30442 LD A,H A=H.
30443 RLCA A=A * 4.
30444 RLCA
30445 AND %11100000 Keep only bits 5-7.
30447 OR L
30448 LD L,A L=A.
30449 LD A,H A=H.
30450 AND %00000111 Keep only bits 0-2.
30452 EX AF,AF' Switch to the shadow AF register.
30453 LD A,H A=H.
30454 RRCA A=A / 8.
30455 RRCA
30456 RRCA
30457 AND %00011000 Keep only bits 3-4.
30459 OR %01000000 Set bit 6.
30461 LD H,A H=A.
30462 EX AF,AF' Switch to the shadow AF register.
30463 OR H
30464 LD H,A H=A.
30465 RET Return.
View the equivalent code in;
Prev: 30416 Up: Map Next: 30466