program Lbm8_10_Tall;
var
	// This example shows a new 8x16 sized sprite. It currently only supports compiled sprites
	
	
	// 6 chars required for the buffer for Tall 8x16 sprite 
@DEFINE BGBUFFERS 6
// if set, this character is treated as empty or transparent which speeds up rendering
// a little cost of some extra bytes
@DEFINE LBM8TRANSPARENT 32 
// unexpanded Vic 20
@vicmemoryconfig "none" 

@use "output/lbm8"
//@use "lbm8"
@use screen

	
	// export the default characterset
	@export "chr/char.flf" "chr/char.bin" 64
	charset: incbin("chr/char.bin", $1c00); // unexpanded location for char setcharset 


	// Export compiled sprite data that is 2 characters tall (16 pixels)
	@vbmcompilechunk "chr/sprites.flf" "sprites3.inc" "MySprite" "lbm8_d" "" 80 16 2 0

	@include "sprites3.inc" // this file has been generated by the vbmcompilechunk above

	
	
	// x and y position
	xp, yp, zp, time: byte;
	
	
begin

	DefineScreen();

	ClearScreen( 32, #SCREEN_CHAR_LOC); 	// ^$9600 - unexpanded colour location

	ClearScreen( GREEN, #SCREEN_COL_LOC); 	// ^$9600 - unexpanded colour location

	AUX_COLOR_AND_VOLUME := %00000010;
	SCREEN_BG_COLOR := BLACK + SCREEN_BG_BLACK;

	Screen::SetScreenCharAddress( 
		Screen::SCREEN_1c00 + Screen::CHAR_1c00, 
		Screen::SCREEN_ADD_0200 );

	// put some characters on the screen
	screenmemory := $1e00+88;
	// Fill with last char
	clearscreen($3F,$1e00);
	fill(^$1c00+$3F*8,0,8);
	
	xp := 0;
	yp := 12;


	while (true) do
	begin
		SCREEN_BG_COLOR := BLACK + SCREEN_BG_BLACK;

		WaitForRaster(120);
		SCREEN_BG_COLOR := RED + SCREEN_BG_BLACK;
		
		lbm8::RestoreBG();

		xp += 1;
		lbm8::DrawTCAt( 0, xp, yp, #MySprite );
		
	end;

end.
