Prev: B862 Up: Map Next: B881
B863: Mark the robot's room as seen
Used by the routine at ENTER_ROOM.
ROOMS_SEEN is a 256-bit map, a bit per room number: the byte is the room number divided by 8, the bit its low three bits. SET takes its bit number in the opcode, so the second byte of the SET instruction at the end is rewritten before it runs. Called as a room is entered (ENTER_ROOM); COUNT_ROOMS_SEEN counts the bits for the rating. Knight Lore's flag_room_visited, byte for byte in its logic.
MARK_ROOM_SEEN B863 LD A,(PLAYER_ROOM) HL = the room / 8
B866 LD C,A
B867 RRCA
B868 RRCA
B869 RRCA
B86A AND $1F
B86C LD L,A
B86D LD H,$00
B86F LD A,C the opcode byte for SET (room AND 7),(HL)
B870 RLCA
B871 RLCA
B872 RLCA
B873 AND $38
B875 OR $C6
B877 LD ($B87F),A
B87A LD BC,ROOMS_SEEN set the bit in the map
B87D ADD HL,BC
B87E SET 0,(HL)
B880 RET
Prev: B862 Up: Map Next: B881