program Texty;
@use "screen"
var  
	// Define four variables : position x, position y, time and a counter i
   x,y,time,i: byte = 0;  

@donotremove trans_char
@donotremove roof
/*
@startblock "$4000" "Vars"
  trans_char : array[64] of byte;
  roof : array[] of byte = (
  0,1,2,3,4,5,6,7);

@endblock
*/

begin
	Screen::Init();
	Screen::EnableVIC4();
	DefineScreen();
 	// First, fill color ram with white
	Screen::FillColorRam80(white);
	// Set black border
	screen_bg_col:=black;
	// infinite loop
	while (true) do
	begin
		// Make sure we wait for 1 raster cycle to complete
		waitforverticalblank();
		// Clear screen with character $20 (space)
		ClearScreen(key_space, screen_char_loc);
		// Calculate x,y some sine values (making a circle)
		// if sine[x] then sine[x+64] is equal to cosine  
		x:=sine[time]/6 + 6;		
		y:=sine[time+64]/16 + 4;		
		// move "screenmemory" cursor to x,y at screen memory 
		screenmemory := Screen::ytable80[y] + x;
		
		i:=time/64; // i will now have values between 0 and 3 (since time is between 0 and 255)
		// Print some random string
		case i of
			0:	printstring("I AM FISH",0,40);
			1:	printstring("ARE YOU FISH",0,40);
			2:	printstring("ME AM CAT",0,40);
			3:	printstring("OM NOM NOM",0,40);
		end;
		// Increase the timer
		time:=time+1;
	end;

end.
