program Atari_Tutorial1;
@use "screen"
@ignoremethod "init16x8mul"
@ignoremethod "initeightbitmul"
var
/*
 Test : Proof-of-concept that the Atari 2600 can be included in TRSE
 Please contact me if you are interested in developing the library for this computer
*/

var
	i,j, time:byte at $80;
	

procedure ColorStuff();
begin
	Screen::TurnOnDisplay();
	// Have game logic here, before the scan starts
	
	for i:=0 to 24 do 
	begin
		Screen::WaitForVerticalBlank();
		
	end;

	for i:=0 to 192 do
	begin
		Screen::WaitForVerticalBlank();
		j:=(time)+(i*2);
		poke(background_color,0,j);
	end;
	time:=time+1;
end;

procedure OverScan();
begin
	Screen::TurnOffDisplay();
	// Have game logic here
end;



begin
	while (true) do
	begin
		Screen::WaitForVerticalSync();
		ColorStuff();
		OverScan(); // Game Logic
	end;


end.

