![]() |
Routines |
| Prev: C3FA | Up: Map | Next: C463 |
|
Used by the routines at Handler_InjuryCheck and Action_Blow.
Move the player to the given room and retarget any scenic events that watched the old room.
|
||||
| MovePlayerToRoom | C42F | LD C,A | Read the current room and the scenic list. Jump to FindScenicEvents to continue. | |
| C430 | LD A,($BB00) | |||
| C433 | LD B,A | |||
| C434 | LD A,($BA9B) | |||
| C437 | LD HL,$BA48 | |||
| C43A | JR FindScenicEvents | |||
| FindScenicEvents_Loop | C43C | INC HL | Step to the next scenic entry. | |
| FindScenicEvents | C43D | CP (HL) | Jump to FindScenicEvents_Next unless this scenic entry watched the old room. | |
| C43E | JR NZ,FindScenicEvents_Next | |||
| C440 | LD (HL),C | Retarget this scenic entry to the new room. | ||
| FindScenicEvents_Next | C441 | DJNZ FindScenicEvents_Loop | Repeat from FindScenicEvents_Loop for the remaining scenic entries. | |
| C443 | LD A,C | Remember the new room. Return when no event bits are set. | ||
| C444 | LD ($BA9B),A | |||
| C447 | LD A,($BA3F) | |||
| C44A | AND A | |||
| C44B | JR Z,MovePlayerToRoom_Return | |||
| C44D | LD B,$08 | Take the eight event bits and the objects they summon. | ||
| C44F | LD HL,$BA40 | |||
| C452 | LD C,A | |||
| C453 | JR FollowingItems_CheckBit | |||
| FollowingItems_Loop | C455 | INC HL | Step to the next event object. | |
| FollowingItems_CheckBit | C456 | SRL C | Skip this object when its event bit is clear. | |
| C458 | JR NC,FollowingItems_Next | |||
| C45A | LD A,(HL) | Call Handler_UpdateItemForTheCurrentRoom to move that event's object into this room. | ||
| C45B | EXX | |||
| C45C | CALL Handler_UpdateItemForTheCurrentRoom | |||
| C45F | EXX | Switch back to the event scan. | ||
| FollowingItems_Next | C460 | DJNZ FollowingItems_Loop | Repeat from FollowingItems_Loop for the remaining event bits. | |
| MovePlayerToRoom_Return | C462 | RET | Return. | |
|
View the equivalent code in;
|
||||
| Prev: C3FA | Up: Map | Next: C463 |