// SIMPLE PROGAM TO TEST SPINNERS SUPPORT
// NOTE : FOR USE WITH A ROLLER CONTROLLER

#include <coleco.h>
#include <getput1.h>

void nmi(void) { }

void main(void)
{
	char x,y;
	screen_mode_2_text();
	fill_vram0(0,0,0x4000);
	fill_vram0(0x2000,0x1800,0xf0);
	load_ascii();
	duplicate_pattern();
	x = 16;
	y = 12;
	enable_nmi();
	screen_on();
	enable_spinner();
loop:
	reset_spinners();
	delay(3);
	if (spinner_1 | spinner_2 != 0) {
		put_char((byte)x,(byte)y,' ');
		x -= spinner_1; // I don't know why spinner_1 value is reversed... but it is!
		y += spinner_2;
		if (x<0) x = 0;
		if (x>31) x = 31;
		if (y<0) y = 0;
		if (y>23) y = 23;
	}
	put_char((byte)x,(byte)y,'O');
	goto loop;
}