program PetsciiAnimations;
@use "screen/screen"
// The unit is accessible in the C64 Turbl Rascal Units project from the front page 
@use "animation/animation"

var  
	i:byte;
	const animPos : address = $4000;

// Images are imported using TRSE's petscii importer. Check out the .flf file!
// You can create your own petscii animation frames by simply importing a .png or .jpg in the
// TRSE image editor. 
@export "resources/images/petscii_animation.flf" "resources/images/petscii_animation.trm" 0

	anim: incbin("resources/images/petscii_animation.trm",animPos);
	

procedure Render();
begin
	while (true) do
	begin
		screenoff();
		Animations::RenderNextPackedFrameCompressionType2(#screen_char_loc, screen_width,0,0);
		screenon();
		for i:=0 to 100 do
			Screen::WaitForVerticalBlank();
	end;
end;


begin
	Screen::background := black;
	Screen::border := black;
	Animations::ReadAnimationHeader(#anim);
	Render();	
end.
