Prev: C00D Up: Map Next: C075
C05C: Execute next interruptable command
Used by the routines at AA65, BF4B, BF8D, BFDD, BFFB, C07E, C084, C0B8, C11B, C158, C191, C204 and C288.
Input
IX Pointer to action table (AA11 - AA2B)
DE Current tick counter
The tick counter is decremented by the value pointed to by IX. If it overflows to 0, control goes to C096, otherwise the command from AA2D - AA47 is executed instead.
C05C LD C,(IX+$00) Put the amount to subtract in BC
C05F LD B,(IX+$01)
C062 LD H,D Copy DE to HL
C063 LD L,E
C064 AND A A = 0
C065 SBC HL,BC Subtract the amount from the tick counter and put it back in DE
C067 EX DE,HL
C068 JR C,$C096 Call the interrupt routine if counter overflows
C06A LD L,(IX+$1C) Put normal address to jump to in HL
C06D LD H,(IX+$1D)
C070 INC IX Next action table entry
C072 INC IX
C074 JP (HL) Move on to normal routine
Prev: C00D Up: Map Next: C075