Prev: EDB1 Up: Map Next: EED2
EDD9: Handler: Events
Used by the routine at Dispatch_Events.
Dispatches the event ID in A. Each ID is a collectible, door or scenery action for the current room.
Handler_Events EDD9 PUSH IX Stash IX and *CHARS on the stack.
EDDB LD HL,($5C36)
EDDE PUSH HL
EDDF LD HL,$EECB Push Handler_Events_Restore as the return address.
EDE2 PUSH HL
EDE3 LD HL,$7C70 Write Buffer_ActiveFont to *CHARS.
EDE6 LD ($5C36),HL
EDE9 CP $26 Return if the event is 26.
EDEB RET Z
EDEC LD L,A Return if *EventTimer is already running.
EDED LD A,($649F)
EDF0 OR A
EDF1 RET NZ
EDF2 BIT 7,L Jump to Handler_Events_Dispatch if this is a collectible event.
EDF4 JR NZ,Handler_Events_Dispatch
EDF6 LD A,$10 Write 10 to *SoundFlags.
EDF8 LD ($6472),A
Jump to the handler for this event ID.
Handler_Events_Dispatch EDFB LD A,L Copy the event ID into A.
EDFC AND %01111111 Keep only bits 0-6.
EDFE OR A Jump to Event_DrawHeader if the event is 00.
EDFF JP Z,Event_DrawHeader
EE02 CP $01 Jump to Event_DrawHeaderNext if the event is 01.
EE04 JP Z,Event_DrawHeaderNext
EE07 CP $03 Jump to Event_DrawHeaderPair if the event is 03.
EE09 JP Z,Event_DrawHeaderPair
EE0C CP $02 Jump to Event_NudgeActor if the event is 02.
EE0E JP Z,Event_NudgeActor
EE11 CP $04 Jump to Event_PrintMessage if the event is 04.
EE13 JP Z,Event_PrintMessage
EE16 CP $05 Jump to Event_StartEnemy if the event is 05.
EE18 JP Z,Event_StartEnemy
EE1B CP $06 Jump to Event_RevealHeader if the event is 06.
EE1D JP Z,Event_RevealHeader
EE20 CP $07 Jump to Event_RevealHeaderTriple if the event is 07.
EE22 JP Z,Event_RevealHeaderTriple
EE25 CP $08 Jump to Event_StartActor if the event is 08.
EE27 JP Z,Event_StartActor
EE2A CP $09 Jump to Event_ToggleTune if the event is 09.
EE2C JP Z,Event_ToggleTune
EE2F CP $0A Jump to Event_ShortTimer if the event is 0A.
EE31 JP Z,Event_ShortTimer
EE34 CP $0B Jump to Event_RevealDecorAndMover if the event is 0B.
EE36 JP Z,Event_RevealDecorAndMover
EE39 CP $0C Jump to Event_RevealNextPair if the event is 0C.
EE3B JP Z,Event_RevealNextPair
EE3E CP $0D Jump to Event_HideLaterActor if the event is 0D.
EE40 JP Z,Event_HideLaterActor
EE43 CP $0E Jump to Event_SwapKeys if the event is 0E.
EE45 JP Z,Event_SwapKeys
EE48 CP $0F Jump to Event_HideActor if the event is 0F.
EE4A JP Z,Event_HideActor
EE4D CP $11 Jump to Event_HideFurniture if the event is 11.
EE4F JP Z,Event_HideFurniture
EE52 CP $12 Jump to Event_RevealDoor if the event is 12.
EE54 JP Z,Event_RevealDoor
EE57 CP $13 Jump to Event_RevealNextDoor if the event is 13.
EE59 JP Z,Event_RevealNextDoor
EE5C CP $14 Jump to Event_RevealDecorations if the event is 14.
EE5E JP Z,Event_RevealDecorations
EE61 CP $15 Jump to Event_RevealThirdDoor if the event is 15.
EE63 JP Z,Event_RevealThirdDoor
EE66 CP $16 Jump to Event_RandomCombination if the event is 16.
EE68 JP Z,Event_RandomCombination
EE6B CP $17 Jump to Event_HeaderAndTimer if the event is 17.
EE6D JP Z,Event_HeaderAndTimer
EE70 CP $18 Jump to Event_ShowEnemy if the event is 18.
EE72 JP Z,Event_ShowEnemy
EE75 CP $19 Jump to Event_RevealFurniture if the event is 19.
EE77 JP Z,Event_RevealFurniture
EE7A CP $1A Jump to Event_RevealPair if the event is 1A.
EE7C JP Z,Event_RevealPair
EE7F CP $1B Jump to Event_RevealLadder if the event is 1B.
EE81 JP Z,Event_RevealLadder
EE84 CP $1C Jump to Event_RevealTriple if the event is 1C.
EE86 JP Z,Event_RevealTriple
EE89 CP $1D Jump to Event_RevealAllDecorations if the event is 1D.
EE8B JP Z,Event_RevealAllDecorations
EE8E CP $1E Jump to Event_RevealThreeDecorations if the event is 1E.
EE90 JP Z,Event_RevealThreeDecorations
EE93 CP $1F Jump to Event_ShowMovers if the event is 1F.
EE95 JP Z,Event_ShowMovers
EE98 CP $20 Jump to Event_DigitFour if the event is 20.
EE9A JP Z,Event_DigitFour
EE9D CP $21 Jump to Event_DigitThree if the event is 21.
EE9F JP Z,Event_DigitThree
EEA2 CP $22 Jump to Event_AwardDigit if the event is 22.
EEA4 JP Z,Event_AwardDigit
EEA7 CP $23 Jump to Event_DigitTwo if the event is 23.
EEA9 JP Z,Event_DigitTwo
EEAC CP $24 Jump to Event_HideHeaderPair if the event is 24.
EEAE JP Z,Event_HideHeaderPair
EEB1 CP $25 Jump to Event_DigitOne if the event is 25.
EEB3 JP Z,Event_DigitOne
EEB6 CP $27 Jump to Event_DrawHeaderFourth if the event is 27.
EEB8 JP Z,Event_DrawHeaderFourth
EEBB CP $28 Jump to Event_HideHeaderFourth if the event is 28.
EEBD JP Z,Event_HideHeaderFourth
EEC0 CP $29 Jump to Event_TestHeader if the event is 29.
EEC2 JP Z,Event_TestHeader
EEC5 CP $2A Jump to Event_HideEnemies if the event is 2A.
EEC7 JP Z,Event_HideEnemies
Handler_Events_Done EECA POP HL Drop the unused return address.
Handler_Events_Restore EECB POP HL Restore *CHARS from the stack.
EECC LD ($5C36),HL Write it back to *CHARS.
EECF POP IX Restore IX from the stack.
EED1 RET Return.
Prev: EDB1 Up: Map Next: EED2