Prev: 899C Up: Map Next: 8A37
8A07: Toggle Map Point
Used by the routines at 8055 and FlashLocationMapPoints.
Input
HL Map co-ordinates
ToggleMapPoint 8A07 LD A,L A=L.
8A08 AND %00000111 Keep only bits 0-2.
8A0A LD B,A B=A.
8A0B LD A,$80 A=80.
8A0D JR Z,ToggleMapPoint_1 Jump to ToggleMapPoint_1 if A is zero.
ToggleMapPoint_0 8A0F RRCA RRCA.
8A10 DJNZ ToggleMapPoint_0 Decrease counter by one and loop back to ToggleMapPoint_0 until counter is zero.
ToggleMapPoint_1 8A12 LD E,A E=A.
8A13 LD A,H A=H.
8A14 AND %00000111 Keep only bits 0-2.
8A16 LD D,A D=A.
8A17 RRC H Rotate H right three positions (with carry).
8A19 RRC H
8A1B RRC H
8A1D LD A,H A=H.
8A1E AND %00011000 Keep only bits 3-4.
8A20 OR %01000000 Set bits 6.
8A22 OR D Set the bits from D.
8A23 RR H Rotate H right.
8A25 RR L Rotate L right.
8A27 RR H Rotate H right.
8A29 RR L Rotate L right.
8A2B RR H Rotate H right.
8A2D RR L Rotate L right.
8A2F LD H,A H=A.
8A30 LD A,(HL) A=*HL.
8A31 XOR E Flip the bits according to E.
8A32 LD (HL),A Write A to *HL.
8A33 LD A,$00 A=00.
8A35 INC A Increment A by one.
8A36 RET Return.
Prev: 899C Up: Map Next: 8A37