![]() |
Routines |
| Prev: 7E93 | Up: Map | Next: 7EE6 |
|
Used by the routine at MainLoop.
Called whenever FRAMES has changed. Runs the handlers of the three entities at Player, ticks the clock with ClockTick and records the new value of FRAMES in LastFrame. InHandlers is set while the handlers are running.
|
||||
| UpdateFixedEntities | 7EB2 | DI | Disable interrupts. | |
| 7EB3 | PUSH IX | Stash IX on the stack. | ||
| 7EB5 | LD A,$01 | Set the flag in InHandlers that shows the handlers are running. | ||
| 7EB7 | LD ($5E04),A | |||
| 7EBA | LD IX,$EA90 | Point IX at the player at Player. | ||
| UpdateFixedEntities_Loop | 7EBE | LD HL,$7EC5 | Point HL at the address for the handler to return to at UpdateFixedEntities_Next. | |
| 7EC1 | PUSH HL | Stash the return address on the stack. | ||
| 7EC2 | JP ProcessAction_Dispatch | Jump to ProcessAction_Dispatch to run the handler. | ||
| UpdateFixedEntities_Next | 7EC5 | LD DE,$0008 | DE=0008 (the size of an entity). | |
| 7EC8 | ADD IX,DE | Move IX on to the next entity. | ||
| 7ECA | PUSH IX | Copy IX to HL (using the stack). | ||
| 7ECC | POP HL | |||
| 7ECD | LD DE,$EAA8 | Point DE at the end of the fixed entities at ItemEntities. | ||
| 7ED0 | AND A | Loop back to UpdateFixedEntities_Loop until all three entities are done. | ||
| 7ED1 | SBC HL,DE | |||
| 7ED3 | JR C,UpdateFixedEntities_Loop | |||
| 7ED5 | CALL ClockTick | Call ClockTick to update the clock. | ||
| 7ED8 | LD A,($5C78) | Write FRAMES to LastFrame. | ||
| 7EDB | LD ($5E03),A | |||
| 7EDE | XOR A | Clear the flag in InHandlers that shows the handlers are running. | ||
| 7EDF | LD ($5E04),A | |||
| 7EE2 | POP IX | Restore IX from the stack. | ||
| 7EE4 | EI | Enable interrupts. | ||
| 7EE5 | RET | Return. | ||
| Prev: 7E93 | Up: Map | Next: 7EE6 |