;your logic here
logic
       if SCROLLING
curxscrollcounter=$+1
        ld a,3
        dec a
        jr nz,$+4
        ld a,3
        ld (curxscrollcounter),a
        jr nz,logic_noscroll
        ld a,(curtilegfx)
        add a,8+COLOUR
        jr nz,logic_noscrolltiles
        ld hl,tilemaptop+0x100
        ld a,(hl)
        ld d,h
        ld e,l
        inc l
        ld bc,255-(tilemaptop&0xff)
        ldir
        ld (de),a
        ld hl,tilemap+0x300
        ld a,(hl)
        ld d,h
        ld e,l
        inc l
        ld c,255-(tilemap&0xff)
        ldir
        ld (de),a
        ld hl,tilemap+0x500
        ld a,(hl)
        ld d,h
        ld e,l
        inc l
        ld c,+(8-TILEMAPBOTTOMSKIP)*32-2
        ldir
        ld (de),a
        ld a,tilegfx/256
logic_noscrolltiles
        ld (curtilegfx),a
logic_noscroll
       endif

        ld ix,objects
        ld b,NOBJECTS
objlogic0
        ld a,(ix+OBJ_Y)
        add a,(ix+OBJ_DY)
        ld (ix+OBJ_Y),a
        ld a,(ix+OBJ_X)
        add a,(ix+OBJ_DX)
        ld (ix+OBJ_X),a
         inc ix
        djnz objlogic0
        
       if DOTS
        ld ix,dots
        ld b,NDOTS
dotlogic0
        ld a,(ix+DOT_DY)
        cp 40
        jp p,dotlogic_nogravity
        inc (ix+DOT_DY)
dotlogic_nogravity
        sra a
        sra a
        sra a
        add a,(ix+DOT_Y)
        ld (ix+DOT_Y),a
        ld a,(ix+DOT_X)
        add a,(ix+DOT_DX)
        ld (ix+DOT_X),a
         inc ix
        djnz dotlogic0
       endif ;DOTS
        ret
