#include <io.h>
#include <system.h>
#include <stdio.h>
#include "vga_update.h"
int x;
    
int main()
{
    alt_irq_register( SPRITE_BUF_IRQ, NULL, sprite_refresh );
    int i, y, cnt, rom, sprite;
    rom = 6;
    sprite = 10;
    x = 90;
    y = 15;
    cnt = 4000;
    i = 0;
    while(1){
        IOWR_SET_SPRITE(190, 300, 21, 9);
        //for(i = 0; i<16; i++){
            //IOWR_SET_SPRITE( x+i*30, y+i*50, rom+i, i );
            //IOWR_SET_SPRITE( x+100+i*30, y+i*50, rom+i, i+6 );
            //IOWR_SET_SPRITE( 2047, 2047, rom+i, i );
        //}
        if(cnt != 0){
            cnt--;
        }else{
            if ( x <= 30|| x>= 610 ) x = 30;
            x=x+1;         
            cnt = 4000;
        }
    }
    return 0;
    
}
