Prev: EB09 Up: Map Next: EB9D
EB10: Change Room
Input
A Destination room ID
ChangeRoom EB10 LD ($A773),A Store the room ID in *TemporaryStorage_SingleByte.
Look up the destination room in the list of room IDs at Table_ActionPreEnterRoomIDs.
EB13 LD HL,$EB3A HL=Table_ActionPreEnterRoomIDs.
EB16 LD DE,$EB45 DE=Table_ActionPreEnterRoom.
EB19 LD BC,$000B BC=000B.
EB1C CALL EventRouting Call EventRouting.
Set the destination room ID as the current room.
EB1F LD A,($A773) Restore the destination room ID from *TemporaryStorage_SingleByte.
EB22 CALL MovePlayerToRoom Call MovePlayerToRoom.
EB25 LD E,$00 Call Handler_DisplayRoomImage with E set to 00 (which does not display room images).
EB27 CALL Handler_DisplayRoomImage
Now look up the current room in the list of room IDs at Table_ActionEnteredRoomIDs.
EB2A LD A,($A7C3) A=*CurrentRoom.
EB2D LD HL,$EB5B HL=Table_ActionEnteredRoomIDs.
EB30 LD DE,$EB71 DE=Table_ActionEnteredRoom.
EB33 LD BC,$0016 BC=16.
EB36 CALL EventRouting Call EventRouting.
EB39 RET Return.
The room ID table to identify which rooms are applicable:
Table_ActionPreEnterRoomIDs EB3A DEFB $43 Room 01: The Crystal Cavern.
EB3B DEFB $4F Room 02: The Fomorians' Cavern.
EB3C DEFB $52 Room 03: The Danaan Settlement.
EB3D DEFB $2B Room 04: The Village Of Bridon.
EB3E DEFB $05 Room 05: The Sea Cavern.
EB3F DEFB $3A Room 06: The Cadwell Hillfort.
EB40 DEFB $1A Room 07: A Mountain Path.
EB41 DEFB $41 Room 08: A Narrow Gorge.
EB42 DEFB $1B Room 09: The Causeway.
EB43 DEFB $42 Room 0A: Inside A Rock Cavern.
EB44 DEFB $22 Room 0B: The Bridon Road.
The actions table for before the player enters a room:
Table_ActionPreEnterRoom EB45 DEFW Process_PreEnterCrystalCavern Action 01.
EB47 DEFW Process_PreEnterFomoriansCavern Action 02.
EB49 DEFW Process_PreEnterFomoriansCavern Action 03.
EB4B DEFW Process_PreEnterVarious Action 04.
EB4D DEFW Process_PreEnterVarious Action 05.
EB4F DEFW Process_PreEnterVarious Action 06.
EB51 DEFW Process_PreEnterVarious Action 07.
EB53 DEFW Process_PreEnterVarious Action 08.
EB55 DEFW Process_PreEnterCauseway Action 09.
EB57 DEFW Process_PreEnterInsideRockCavern Action 0A.
EB59 DEFW Process_PreEnterBridonRoad Action 0B.
The room ID table to identify which rooms are applicable:
Table_ActionEnteredRoomIDs EB5B DEFB $37 Room 01: A Forest Path.
EB5C DEFB $0D Room 02: A Narrow Underwater Passage.
EB5D DEFB $56 Room 03: Congratulations!!.
EB5E DEFB $27 Room 04: In An Oozing Quagmire.
EB5F DEFB $4F Room 05: The Fomorians' Cavern.
EB60 DEFB $14 Room 06: Lug's Cavern.
EB61 DEFB $57 Room 07: The Vale Of Cuchulainn.
EB62 DEFB $63 Room 08: The Inner Courtyard.
EB63 DEFB $4C Room 09: The Enchanted Hills.
EB64 DEFB $0C Room 0A: In A Deep Pool Of Water. Inside The Sea Cavern.
EB65 DEFB $18 Room 0B: Bleak Moorland.
EB66 DEFB $43 Room 0C: The Crystal Cavern.
EB67 DEFB $1E Room 0D: The Vale Of Rhia.
EB68 DEFB $1B Room 0E: The Causeway.
EB69 DEFB $2C Room 0F: A Small Clearing.
EB6A DEFB $25 Room 10: The Swamp.
EB6B DEFB $26 Room 11: The Swamp.
EB6C DEFB $2D Room 12: The Swamp.
EB6D DEFB $35 Room 13: The Swamp.
EB6E DEFB $36 Room 14: The Swamp.
EB6F DEFB $3D Room 15: The Swamp.
EB70 DEFB $3E Room 16: The Swamp.
The actions table for when a player enters a room:
Table_ActionEnteredRoom EB71 DEFW Process_EnterForestPath Action 01.
EB73 DEFW Process_EnterNarrowUnderwaterPassage Action 02.
EB75 DEFW Process_CongratulationsGameOver Action 03.
EB77 DEFW Process_EnterOozingQuagmire Action 04.
EB79 DEFW Process_EnterFomoriansCavern Action 05.
EB7B DEFW Process_EnterLugsCavern Action 06.
EB7D DEFW Process_EnterValeOfCuchulainn Action 07.
EB7F DEFW Process_EnterInnerCourtyard Action 08.
EB81 DEFW Process_EnterEnchantedHills Action 09.
EB83 DEFW Process_EnterDeepPoolOfWater Action 0A.
EB85 DEFW Process_EnterBleakMoorland Action 0B.
EB87 DEFW Process_EnterCrystalCavern Action 0C.
EB89 DEFW Process_EnterValeOfRhia Action 0D.
EB8B DEFW Process_EnterCauseway Action 0E.
EB8D DEFW Process_EnterSmallClearing Action 0F.
EB8F DEFW Process_EnterSwamp_01 Action 10.
EB91 DEFW Process_EnterSwamp_01 Action 11.
EB93 DEFW Process_EnterSwamp_02 Action 12.
EB95 DEFW Process_EnterSwamp_03 Action 13.
EB97 DEFW Process_EnterSwamp_04 Action 14.
EB99 DEFW Process_EnterSwamp_05 Action 15.
EB9B DEFW Process_EnterSwamp_05 Action 16.
Prev: EB09 Up: Map Next: EB9D