![]() |
Routines |
| Prev: AFEB | Up: Map | Next: B05E |
|
Used by the routine at ChangeRoom.
|
||||||||
| MovePlayerToRoom | B01F | LD C,A | Load the destination room ID into C. | |||||
| B020 | LD A,($A7EE) | Jump to SetNewCurrentRoomID if *Count_ScenicEvents is zero. | ||||||
| B023 | AND A | |||||||
| B024 | JR Z,SetNewCurrentRoomID | |||||||
| B026 | LD B,A | B=Count_ScenicEvents. | ||||||
| B027 | LD HL,($A7E2) | HL=*Pointer_ScenicEventItems. | ||||||
| B02A | JR FindScenicEvents | Jump to FindScenicEvents. | ||||||
| FindScenicEvents_Loop | B02C | INC HL | Increment the scenic event item ID pointer by one. | |||||
| FindScenicEvents | B02D | LD A,(HL) | Load the next scenic event item ID into A. | |||||
| B02E | CALL ValidateItemPresent | Call ValidateItemPresent. | ||||||
| B031 | JR NZ,FindScenicEvents_Next | Jump to FindScenicEvents_Next if the scenic event item is neither here nor carried. | ||||||
|
The scenic event item is here or carried.
|
||||||||
| B033 | PUSH HL | Stash the scenic event item ID pointer and scenic events counter on the stack. | ||||||
| B034 | PUSH BC | |||||||
| B035 | LD B,(HL) | Load the scenic event item ID into B. | ||||||
| B036 | CALL Handler_UpdateItemLocation | Call Handler_UpdateItemLocation. | ||||||
| B039 | POP BC | Restore the scenic events counter and scenic event item ID pointer from the stack. | ||||||
| B03A | POP HL | |||||||
| FindScenicEvents_Next | B03B | DJNZ FindScenicEvents_Loop | Decrease counter by one and loop back to FindScenicEvents_Loop until counter is zero. | |||||
|
Sets the destination room ID as the new current room ID.
|
||||||||
| SetNewCurrentRoomID | B03D | LD A,C | Write C to *CurrentRoom. | |||||
| B03E | LD ($A7C3),A | |||||||
| B041 | LD A,($A787) | Return if *Flag_EventStates is zero. | ||||||
| B044 | AND A | |||||||
| B045 | RET Z | |||||||
| B046 | LD B,$08 | B=08. | ||||||
| B048 | LD HL,$A788 | HL=Table_TurnBasedEventItems. | ||||||
| B04B | LD C,A | C=A. | ||||||
| B04C | JR MovePlayerToRoom_1 | Jump to MovePlayerToRoom_1. | ||||||
| MovePlayerToRoom_0 | B04E | INC HL | Increment HL by one. | |||||
| MovePlayerToRoom_1 | B04F | SRL C | Shift C right. | |||||
| B051 | JR NC,MovePlayerToRoom_2 | Jump to MovePlayerToRoom_2 if the bit shifted out of C is reset. | ||||||
| B053 | LD A,(HL) | A=*HL. | ||||||
| B054 | PUSH HL | Stash HL and BC on the stack. | ||||||
| B055 | PUSH BC | |||||||
| B056 | CALL Handler_UpdateItemEventCurrentRoom | Call Handler_UpdateItemEventCurrentRoom. | ||||||
| B059 | POP BC | Restore BC and HL from the stack. | ||||||
| B05A | POP HL | |||||||
| MovePlayerToRoom_2 | B05B | DJNZ MovePlayerToRoom_0 | Decrease counter by one and loop back to MovePlayerToRoom_0 until counter is zero. | |||||
| B05D | RET | Return. | ||||||
|
View the equivalent code in The Jewels Of Babylon.
|
||||||||
| Prev: AFEB | Up: Map | Next: B05E |