
ball db 0,1,2,2,2,2,1,0
     db 1,2,2,3,3,2,2,1
     db 2,2,3,4,4,3,2,2
     db 2,3,4,5,5,4,3,2
     db 2,3,4,5,5,4,3,2
     db 2,2,3,4,4,3,2,2
     db 1,2,2,3,3,2,2,1
     db 0,1,2,2,2,2,1,0



Make_Pal_VBalls:
  mov dx,03c8h
  mov al,0
  out dx,al
  inc dx
  mov cx,6
  .loop_MPV:
    mov al,6
    sub al,cl
    shl al,3
    out dx,al
    out dx,al
    out dx,al
    dec cl
  jnz .loop_MPV
ret


;ES=
Move_VBalls:
  mov cx,10
  xor di,di
  .loop_mvb:
    mov ax,[es:di]
    mov bx,[es:di+2]
    add ax,bx
    cmp ax,250*255
    ja .neg_it
    cmp ax,10*255
    jb .neg_it
    jmp .no_neg
    .neg_it:
      neg bx
;      mov [es:di+2]
    .no_neg:
    stosw
    add di,2
  loop .loop_mvb
ret


; ES:DI = 
Aff_a_Ball:
  
  mov si,ball
  mov cx,8

  .loop_ab:
    movq mm0,[ds:si]
    movq [es:di],mm0
    add si,8
    add di,320
    dec cx
  jnz .loop_ab
ret

; ES = dest
; FS = coords
Aff_Balls:
  mov cx,10
  xor si,si
  db 64h ; =fs:
  lodsb
  add si,3
  mov ah,al
  db 64h ; =fs:
  lodsb
  mov di,ax











