Prev: 7D9A Up: Map Next: 7E23
7DC3: Main Loop
Used by the routines at DrawRoom and EnterRoom.
MainLoop 7DC3 LD SP,$5E00 Set stack pointer to 5E00.
7DC6 EI Enable interrupts.
7DC7 XOR A Write 00 to NumCreatures.
7DC8 LD ($5E25),A
7DCB LD IX,$EAA8 IX=EAA8.
7DCF LD A,($5E14) Checking bit 0 of GameFlags; jump to MainLoop_0 if the room content is already drawn.
7DD2 BIT 0,A
7DD4 JR NZ,MainLoop_0
7DD6 LD IX,$EEE0 IX=EEE0.
7DDA JR DrawRoom Jump to DrawRoom.
MainLoop_0 7DDC LD A,($5C78) A=FRAMES.
7DDF LD C,A
7DE0 LD A,($5E03) A=5E03.
7DE3 CP C
7DE4 CALL NZ,ProcessAction_5
7DE7 LD A,($EA91) A=PlayerRoom.
7DEA CP (IX+$01)
7DED LD HL,$7DF3 HL=7DF3.
7DF0 JP Z,ProcessAction
7DF3 LD DE,$0008 DE=0008.
7DF6 ADD IX,DE
7DF8 PUSH IX
7DFA POP HL
7DFB LD DE,$EE60 DE=EE60.
7DFE AND A
7DFF SBC HL,DE
7E01 JR C,MainLoop_0
MainLoop_1 7E03 LD A,($5C78) A=FRAMES.
7E06 LD C,A
7E07 LD A,($5E03) A=5E03.
7E0A CP C
7E0B CALL NZ,ProcessAction_5
7E0E LD HL,$7E13 HL=7E13.
7E11 JR ProcessAction
7E13 LD DE,$0010 DE=0010.
7E16 ADD IX,DE
7E18 PUSH IX
7E1A POP HL
7E1B LD DE,$EEE0 DE=EEE0.
7E1E AND A
7E1F SBC HL,DE
7E21 JR C,MainLoop_1
Prev: 7D9A Up: Map Next: 7E23