Prev: 53734 Up: Map Next: 53815
53785: Visit Room
Used by the routine at BuildRoomObjects.
Flags the room that the player is in as visited, in the bitmap of the rooms at RoomsVisitedBitmap. The bit that is set is chosen by changing the instruction at VisitRoom_Set, which is a SET instruction, by changing the byte that follows it.
Set the bit of this room in RoomsVisitedBitmap.
VisitRoom 53785 LD A,(23568) Fetch the room number.
53788 LD C,A Stash it in C.
53789 RRCA Divide it by eight.
53790 RRCA
53791 RRCA
53792 AND %00011111 Keep the offset of the byte.
53794 LD L,A Stash it in L.
53795 LD H,0 Clear the high byte of the offset.
53797 LD A,C Fetch the room number.
53798 RLCA Move the low three bits to bits 3 to 5.
53799 RLCA
53800 RLCA
53801 AND %00111000 Keep them.
53803 OR %11000110 Make them into the second byte of an instruction to set that bit.
53805 LD (53813),A Put the byte into the instruction at VisitRoom_Set.
53808 LD BC,23528 Point BC at RoomsVisitedBitmap.
53811 ADD HL,BC Add the offset of the byte.
VisitRoom_Set 53812 SET 0,(HL) Set the bit of the room.
53814 RET Return.
View the equivalent code in;
Prev: 53734 Up: Map Next: 53815