![]() |
Routines |
| Prev: C6DA | Up: Map | Next: C70C |
|
Used by the routines at Main_Game_Loop, Animate_Wave_Start_Sequence, Dispatch_Narrow_Entity_Approach and Stage_Next_Wave.
Chained trampoline: pushes resume address DispatchWordFromHL, loads a 16-bit routine pointer from HL, advances HL by 02 then jumps to that pointer via the stack. When the handler RETs, execution continues at DispatchWordFromHL for the next table entry, so handlers should leave HL valid for the following word unless the chain ends. Used from CC5F, CEBF, CF45, D27C with tables such as Entity_List_Base.
|
||||
| DispatchWordFromHL | C702 | LD DE,$C702 | DE=DispatchWordFromHL (resume address after each nested RET). | |
| C705 | PUSH DE | Save the resume address on the stack. | ||
| C706 | LD E,(HL) | E=*HL (handler pointer, low byte). | ||
| C707 | INC HL | Advance HL. | ||
| C708 | LD D,(HL) | D=*HL (handler pointer, high byte). | ||
| C709 | INC HL | Advance HL past the pointer. | ||
| C70A | PUSH DE | Stack the handler address. | ||
| C70B | RET | RET to the handler (next RET pops back to DispatchWordFromHL). | ||
| Prev: C6DA | Up: Map | Next: C70C |