Prev: 7585 Up: Map Next: 75B9
759A: Calculate Screen Address
Used by the routines at MenuWriteText, 6D0C, DisplayPlayerLives, PrintString and 74A5.
ScreenAddress 759A LD A,L A=L.
759B RRCA A=A / 08.
759C RRCA
759D RRCA
759E AND %00011111 Keep only bits 0-4.
75A0 LD L,A L=A.
75A1 LD A,H A=H.
75A2 RLCA A=A * 04.
75A3 RLCA
75A4 AND %11100000 Keep only bits 5-7.
75A6 OR L
75A7 LD L,A L=A.
75A8 LD A,H A=H.
75A9 AND %00000111 Keep only bits 0-2.
75AB EX AF,AF' Switch to the shadow AF register.
75AC LD A,H A=H.
75AD RRCA A=A / 08.
75AE RRCA
75AF RRCA
75B0 AND %00011000 Keep only bits 3-4.
75B2 OR %01000000 Set bit 6.
75B4 LD H,A H=A.
75B5 EX AF,AF' Switch to the shadow AF register.
75B6 OR H
75B7 LD H,A H=A.
75B8 RET Return.
View the equivalent code in;
Prev: 7585 Up: Map Next: 75B9