#include "mini.h"
#include "win/win.h"
#include "view/view.h"
#include "surf/surf.h"
#include "pal/pal.h"
#include "draw/draw.h"

uint16_t ants = 0xc936;
float t = 0;

using namespace mini;

void exception_loop() {
    //if (t==0) t= time();
    if (sys::time()-t > 0.25) {
        t = sys::time();
        surf::clip::reset();
        view::origin::set(0,0);
        surf::target::set(0);
        pal::trans::set(255);
        pal::color::set(0,0xffffff00);
        pal::color::set(1,0xff000000);
        const int w=win::res::getw();
        const int h=win::res::geth();
        draw::mode::set(0);
        draw::rect(0,0,w,h,1);
        draw::rect(1,1,w-2,h-2,1);
        draw::mode::set(1);
        draw::pattern::set(ants);
        draw::rect(0,0,w,h,0);
        draw::rect(1,1,w-2,h-2,0);
        ants = (ants<<12) | (ants>>4);
    }
}