program Tutorial1_Image;
var 
	done : boolean = false;
	screen : pointer of integer;
	
	@export "images/image1.flf" "images/image1.bin" 256
	
	image : incbin("images/image1.bin");
	image_pal : incbin("images/image1.pal");
	
/*   
  Image is located in images/image1.flf, and is exported automatically on each buildm_params[p]->getValueAsInt(as);
  
  a) Download & set TRSE Settings path to the VASMm68K assembler (https://www.irio.co.uk/trse/assembler/vasmm68k_mot_win32.exe on windows)
  b) Download and set up the Hatari emulator ( https://hatari.tuxfamily.org/ )
  c) Download your favorite TOS image from http://www.avtandil.narod.ru/tose.html
  d) Set up a "fake" hard drive directory for your emulated Atari
  e) Set up the "Target executable directory for Atari ST" in the TRSE settings to point to this hard drive location
  f) Compile this program - the compiled program will be automatically copied into the (h)atari hdd
  e) Open up hatari -> your HDD -> double click on "tut1.tos"  


*/

interrupt VBLank();
begin
end;


begin
	// Set to lores mode
	SetLoRes();
	// Get screen pointer
	GetScreen(screen);
	
	setirq(VBLank(), irq_verticalblank);

	// Copy palette data
	memcpy(#image_pal,0,#palette_start,0,16,2);
	// Copy image data to the screen
	memcpy(#image,0,screen,0,40*200,4);
		
	while (done=false) do
	begin
		waitverticalblank();
		done:=keypressed(sc_key_space_pressed);
	end;	

end.

