Prev: 8BCD Up: Map Next: 8C4D
8C08: Checks the current room's logic and acts on anything that is 'true'.
Used by the routine at Game_Start.
Input
Output
Room_TestEvents 8C08 LD A,(Wally_RoomNo) Gets the address of the room data, from the table of address based on the current room index number.
8C0B ADD A,A
8C0C LD E,A
8C0D LD D,$00
8C0F LD HL,Table_RoomDataPtr
8C12 ADD HL,DE
8C13 LD E,(HL)
8C14 INC HL
8C15 LD D,(HL)
8C16 EX DE,HL
Room_CllEvnt_NxtCmd 8C17 LD A,(HL)
8C18 INC HL
8C19 CP $FF
8C1B RET Z
8C1C CP $FD
8C1E JR Z,Room_TestEvents_0
8C20 ADD A,A
8C21 LD E,A
8C22 LD D,$00
8C24 PUSH HL
8C25 LD HL,Table_TestFuncPtrs Get address of function, pop onto stack so that return calls it, before returning to original caller.
8C28 ADD HL,DE
8C29 LD E,(HL)
8C2A INC HL
8C2B LD D,(HL)
8C2C POP HL
8C2D PUSH DE
8C2E RET
Room_CllEvnt_EndIf 8C2F LD A,(HL) Scan through commands looking for endif (FE) command.
8C30 INC HL
8C31 CP $FE
8C33 JR Z,Room_CllEvnt_NxtCmd
8C35 JR Room_CllEvnt_EndIf
Room_TestEvents_0 8C37 LD A,(HL)
8C38 INC HL
8C39 CP $FE
8C3B JP Z,Room_CllEvnt_NxtCmd
8C3E ADD A,A
8C3F LD E,A
8C40 LD D,$00
8C42 PUSH HL
8C43 LD HL,Table_ActionFuncPtrs Get address of function, pop onto stack so that return calls it, before returning to original caller.
8C46 ADD HL,DE
8C47 LD E,(HL)
8C48 INC HL
8C49 LD D,(HL)
8C4A POP HL
8C4B PUSH DE
8C4C RET
Prev: 8BCD Up: Map Next: 8C4D