#include <io.h>
#include <system.h>
#include <stdio.h>
#include "vga_update.h"
//------------------------------------------------
extern int x;
int vga_cnt = 0;
//------------------------------------------------
void sprite_refresh()
{
    IOWR_END_IRQ();
    sprite_clear_all();
    int half_second;
    half_second = vga_cnt / 8;
    if(vga_cnt < 191) vga_cnt++;
    else vga_cnt = 0;
    IOWR_SET_SPRITE(x, 300, 2+half_second, 2);
    //IOWR_SET_SPRITE(x, 300, 21, 9);
    //IOWR_SET_SPRITE(x+250, 300, 5, 2);
    //IOWR_SET_SPRITE(x, 250, 22, 3);
    //IOWR_SET_SPRITE(x+20, 250, 22, 4);
    //IOWR_SET_SPRITE(x+20, 180, 22, 5);
    //IOWR_SET_SPRITE(x+30, 180, 22, 6);
    //IOWR_END_IRQ();
}
void sprite_clear_all()
{
    int i;
    for(i = 0; i<16; i++){
        IOWR_SET_SPRITE( 2047, 2047, 0, i );
    }
}
