Prev: 9286 Up: Map Next: 92D8
9291: Draw everything in the player's room
Used by the routine at MAIN_LOOP_MONSTERS.
Walks the eight-byte records from the player up to the monster table, drawing each one whose room matches the player's and skipping any whose sprite is zero. It is the sweep that puts the room's objects, doors and the player back on the screen after the play area has been cleared.
DRAW_ROOM_CONTENTS 9291 LD IX,$EA90 From the player upwards.
DRAW_ROOM_CONTENTS_0 9295 LD A,(IX+$00) A zero sprite is an empty slot.
9298 AND A
9299 JR Z,DRAW_ROOM_CONTENTS_1
929B LD A,($EA91) And only things in this room.
929E CP (IX+$01)
92A1 JR NZ,DRAW_ROOM_CONTENTS_1
92A3 CALL DRAW_THING Draw it.
DRAW_ROOM_CONTENTS_1 92A6 LD DE,$0008 Eight bytes to the next.
92A9 ADD IX,DE
92AB PUSH IX
92AD POP HL
92AE LD DE,$EE60
92B1 AND A
92B2 SBC HL,DE
92B4 JR C,DRAW_ROOM_CONTENTS_0
DRAW_ROOM_CONTENTS_2 92B6 LD A,(IX+$00)
92B9 AND A
92BA JR Z,DRAW_ROOM_CONTENTS_3
92BC LD A,($EA91)
92BF CP (IX+$01)
92C2 JR NZ,DRAW_ROOM_CONTENTS_3
92C4 CALL DRAW_THING
DRAW_ROOM_CONTENTS_3 92C7 LD DE,$0010
92CA ADD IX,DE
92CC PUSH IX
92CE POP HL
92CF LD DE,$EEE0
92D2 AND A
92D3 SBC HL,DE
92D5 JR C,DRAW_ROOM_CONTENTS_2
92D7 RET
Prev: 9286 Up: Map Next: 92D8