Prev: 7DC3 Up: Map Next: 7E7E
7E13: The second pass: the monsters
Sixteen bytes a record rather than eight, and no room test -- every monster is dispatched every pass wherever it is. That is what keeps the castle alive behind the player rather than freezing rooms they have left.
MAIN_LOOP_MONSTERS 7E13 LD DE,$0010 Sixteen bytes to the next monster.
7E16 ADD IX,DE
7E18 PUSH IX Until the door table is reached.
7E1A POP HL
7E1B LD DE,$EEE0
7E1E AND A
7E1F SBC HL,DE
7E21 JR C,NEXT_MONSTER
This entry point is used by the routine at MAIN_LOOP.
ROOM_LIST_PASS 7E23 LD A,($EA91)
7E26 LD L,A
7E27 LD H,$00
7E29 ADD HL,HL
7E2A LD BC,ROOM_CONTENTS
7E2D ADD HL,BC
7E2E LD A,(HL)
7E2F INC HL
7E30 LD H,(HL)
7E31 LD L,A
7E32 LD ($5E1B),HL
NEXT_IN_LIST 7E35 LD HL,($5E1B)
7E38 LD A,(HL)
7E39 INC HL
7E3A INC HL
7E3B LD ($5E1B),HL
7E3E DEC HL
7E3F LD H,(HL)
7E40 LD L,A
7E41 OR H
7E42 JR NZ,DISPATCH_FROM_LIST
7E44 LD HL,($5E12)
7E47 INC HL
7E48 LD ($5E12),HL
7E4B LD HL,$5E14
7E4E BIT 0,(HL)
7E50 JR NZ,MAIN_LOOP_MONSTERS_0
7E52 CALL DRAW_ROOM_CONTENTS
MAIN_LOOP_MONSTERS_0 7E55 LD HL,$5E14
7E58 SET 0,(HL)
7E5A LD HL,($5E05)
7E5D LD DE,($5C78)
7E61 ADD HL,DE
7E62 LD A,($5E12)
7E65 ADD A,L
7E66 LD L,A
7E67 LD ($5E05),HL
7E6A CALL READ_PICKUP_KEY
7E6D CALL PAUSE
7E70 CALL REGROW_FOOD
7E73 LD A,($EA91)
7E76 CP $8E
7E78 JP Z,SHOW_END_SCREEN
7E7B JP MAIN_LOOP
Prev: 7DC3 Up: Map Next: 7E7E