![]() |
Routines |
| Prev: B70E | Up: Map | Next: B753 |
|
Used by the routine at Handler_ChangeRoom.
Move the player into the room held in A and update events there.
|
||||
| Handler_SetCurrentRoom | B714 | LD C,A | Remember the destination room. | |
| B715 | LD A,($AEF8) | Read the scenic-event count into A. | ||
| B718 | AND A | Skip scenic events when the game defines none. | ||
| B719 | JR Z,Handler_SetCurrentRoom_Next | |||
| B71B | LD B,A | Take the scenic-event count. | ||
| B71C | LD HL,($AEEC) | Load the word at *Pointer_Spare into HL. | ||
| B71F | JR Handler_SetCurrentRoom_Scenic | Read the first scenic item at Handler_SetCurrentRoom_Scenic. | ||
| Handler_SetCurrentRoom_Loop | B721 | INC HL | Advance HL to the next byte. | |
| Handler_SetCurrentRoom_Scenic | B722 | LD A,(HL) | Read this scenic item. | |
| B723 | CALL Get_ObjectLocation | Call Get_ObjectLocation to find where the object is. | ||
| B726 | JR NZ,Handler_SetCurrentRoom_ScenicNext | Leave a scenic item that is not here. | ||
| B728 | PUSH HL | Keep this scenic item while it is moved. | ||
| B729 | PUSH BC | |||
| B72A | LD B,(HL) | Read the buffer byte into B. | ||
| B72B | CALL SetItemRoom | Call SetItemRoom to store the item's room. | ||
| B72E | POP BC | Restore the scenic item count and this scenic item from the stack. | ||
| B72F | POP HL | |||
| Handler_SetCurrentRoom_ScenicNext | B730 | DJNZ Handler_SetCurrentRoom_Loop | Count down B and repeat from Handler_SetCurrentRoom_Loop until the count is exhausted. | |
| Handler_SetCurrentRoom_Next | B732 | LD A,C | Restore the destination room. | |
| B733 | LD ($AECD),A | Store A in the current room. | ||
| B736 | LD A,($AE91) | Read the event-state flags into A. | ||
| B739 | AND A | Leave the turn-based events alone when none are armed. | ||
| B73A | RET Z | |||
| B73B | LD B,$08 | Use 08 as the count in B. | ||
| B73D | LD HL,$AE92 | Point HL at the turn-based event items. | ||
| B740 | LD C,A | Hold the event flags while each one is tested. | ||
| B741 | JR Handler_SetCurrentRoom_Event | Test the first turn-based event at Handler_SetCurrentRoom_Event. | ||
| Handler_SetCurrentRoom_EventLoop | B743 | INC HL | Advance HL to the next byte. | |
| Handler_SetCurrentRoom_Event | B744 | SRL C | Test the next turn-based event flag. | |
| B746 | JR NC,Handler_SetCurrentRoom_EventNext | Branch to Handler_SetCurrentRoom_EventNext when the carry flag is clear. | ||
| B748 | LD A,(HL) | Read the item this event places in the room. | ||
| B749 | PUSH HL | Keep this turn-based event while its item is placed. | ||
| B74A | PUSH BC | |||
| B74B | CALL HandlerUpdateItemEventForTheCurrentRoom | Call HandlerUpdateItemEventForTheCurrentRoom to update the item for this room. | ||
| B74E | POP BC | Restore the event count and flags, and this turn-based event from the stack. | ||
| B74F | POP HL | |||
| Handler_SetCurrentRoom_EventNext | B750 | DJNZ Handler_SetCurrentRoom_EventLoop | Count down B and repeat from Handler_SetCurrentRoom_EventLoop until the count is exhausted. | |
| B752 | RET | Return. | ||
|
View the equivalent code in;
|
||||
| Prev: B70E | Up: Map | Next: B753 |