Prev: 7E23 Up: Map Next: 7E93
7E7E: Process Action
Used by the routine at MainLoop.
Calls the handler of an entity. The handler's address is read from HandlerTable, indexed by the first byte of the entity record, and entered through the E9 (JP (HL)) at 5CB0. The entry point at ProcessAction_Dispatch is used when the return address has already been stacked, and the one at ProcessAction_Lookup when the table of handlers in HL is not HandlerTable.
Input
IX The entity
HL The address for the handler to return to
ProcessAction 7E7E PUSH HL Stash the return address on the stack.
This entry point is used by the routine at UpdateFixedEntities.
ProcessAction_Dispatch 7E7F LD HL,$7EE6 Point HL at the handler table at HandlerTable.
This entry point is used by the routine at ProcessRoomItem.
Double the first byte of the entity to create an offset in BC.
ProcessAction_Lookup 7E82 LD C,(IX+$00) Fetch the first byte of the entity, which is its sprite ID.
This entry point is used by the routine at DrawGraphic.
ProcessAction_Offset 7E85 LD B,$00 B=00.
7E87 SLA C Double BC, which gives two bytes for each sprite ID.
7E89 RL B
7E8B ADD HL,BC Find the entry for the entity in the handler table.
7E8C LD A,(HL) Fetch the address of the handler.
7E8D INC HL
7E8E LD H,(HL)
7E8F LD L,A
7E90 JP $5CB0 Jump to the handler, using the E9 (JP (HL)) at 5CB0.
Prev: 7E23 Up: Map Next: 7E93