updateEntities: ld hl, $C706 ld (pointerToSpriteTerminator), hl ; Clear SAT in RAM ld ix, (pointerToEntityData) ld a, (lengthEntityData) ld b, a -: ld a, (ix+0) ; ix+0 = type of entity (0 means no entity) and $7F jp z, ++ push bc ld hl, jumpTableUpdateEntities - 2 rst $20 ; jp(HL+2A) ld a, (ix+0) ; ix+0 = type of entity (0 means no entity) or a jp z, + call updateEntityHpos call updateEntityVpos call updateEntitySprites +: pop bc ++: ld de, $0020 add ix, de djnz - ld hl, (pointerToSpriteTerminator) ld a, l cp $40 jr c, + ld l, $3F ld (pointerToSpriteTerminator), hl +: ld (hl), $D0 ret