Prev: 9641 Up: Map Next: 96C9
96AF: Visit Room
Used by the routine at EnterRoom.
Input
A The room ID
Create an offset in BC.
VisitRoom 96AF LD C,A C=A.
96B0 SRL C Divide by 08.
96B2 SRL C
96B4 SRL C
96B6 LD B,$00 B=00.
96B8 LD HL,$5E40 HL=VisitedRooms + BC.
96BB ADD HL,BC
96BC RLCA Multiply by 08.
96BD RLCA
96BE RLCA
96BF AND %00111000 Keep only bits 3-5.
96C1 OR %11000110 Set bits 1-2, 6-7.
96C3 LD ($96C7),A Write this value to 96C7 which updates the bit to set.
96C6 SET 0,(HL) With above, set the bit to mark the room as having been visited.
96C8 RET Return.
View the equivalent code in;
Prev: 9641 Up: Map Next: 96C9