Prev: EF35 Up: Map Next: EFC7
EF91: Set the attributes for the fountain in the town square if it is repaired
Used by the routines at F277 and F572.
EF91 PUSH AF Remember AF.
EF92 EXX Exchange main registers.
EF93 LD A,($F26F) Put the current attribute (F26F) in C.
EF96 LD C,A
EF97 LD A,($A839) Get the Y co-ordinate to print. (A838)
EF9A AND $07 Select bits 0 - 2.
EF9C JR Z,$EFA2
EF9E LD B,$03
EFA0 JR $EFA4
EFA2 LD B,$02
EFA4 LD A,($A839) Get the Y co-ordinate to print.
EFA7 AND $F8 Select bits 3 - 8
EFA9 LD H,$00 Put this in HL.
EFAB LD L,A
EFAC ADD HL,HL Multiply by 4 to get a suitable offset.
EFAD ADD HL,HL
EFAE LD DE,$FB00 Add the base address to get an offset from FC00. Note that this address is modified by the routines in A83D and A8A0.
EFB1 ADD HL,DE
EFB2 LD DE,$001E Set DE as the amount to increment for each row.
EFB5 LD (HL),C Set the attribute for the next two columns.
EFB6 INC HL
EFB7 LD (HL),C
EFB8 INC HL
EFB9 LD A,($A838) Get the X co-ordinate to print.
EFBC AND $07 Select bits 0 - 2.
EFBE JR Z,$EFC1 Jump forward if this is 0.
EFC0 LD (HL),C Otherwise set the attribute here.
EFC1 ADD HL,DE Move on a row.
EFC2 DJNZ $EFB5 Loop while all rows are printed.
EFC4 EXX Exchange main registers.
EFC5 POP AF Restore AF and return.
EFC6 RET
Prev: EF35 Up: Map Next: EFC7