![]() |
Routines |
| Prev: AFBD | Up: Map | Next: AFD5 |
|
Used by the routine at ret_from_tbl_jp.
The stack is reloaded to $5BA0 for every object, so it grows downwards into the printer buffer below and nothing a handler leaves on it can leak into the next one. The loop pushes its own continuation, ret_from_tbl_jp, before dispatching, so an object handler ends with a plain RET -- and a handler can jump away mid-routine, to another handler or out to the game-over code, without tidying the stack.
$5BBC counts up by one per object, so two objects of the same kind see opposite parities in the same frame; upd_176_177 uses that to make neighbouring fires flicker out of step.
|
||||
| update_sprite_loop | AFC7 | LD SP,$5BA0 | reset the stack for this object | |
| AFCA | LD HL,$5BBC | this object's phase: the frame counter plus its place in the table | ||
| AFCD | INC (HL) | |||
| AFCE | LD HL,ret_from_tbl_jp | push the return address the handler will RET to | ||
| AFD1 | PUSH HL | |||
| AFD2 | CALL save_2d_info | keep last frame's screen rectangle so the old image can be wiped | ||
| Prev: AFBD | Up: Map | Next: AFD5 |