program BcdNumbers;
var  

// Take a look at the VBM commands in the help (press F1)
// and also in the platform section of the help file
//
// Note that TRSE for VIC 20 is using zero pages from $8F downwards
// and VBM uses zero pages from $00 upwards.
// The Zero page memory in between can be used by your programs.
// See VBM Memory in the Platforms help section for details. 

// display BCD numbers

// declare all your include files here

@export "resources/charsets/font4x8.flf" "resources/charsets/font4x8.bin" 0 64 // start end height
font: incbin("resources/charsets/font4x8.bin", $4000); // first 64 PETSCII Screen Codes

const adrNumbers : address = $4180;



// declare all your variables and procedures here

	numb : array[] of byte = ($00, $00, $00, $00, $00);
	add  : array[] of byte = ($01, $00, $00, $00, $00);
	
	strScore : cstring = ("SCORE");



/* **** MAIN PROGRAM **** */
begin

	// set the default display mode showing all 20 columns
	vbmSetDisplayMode( 0 );
	
	// Clear the bitmap with a value of 0
	vbmClear( 0 );
	
	// set the colour memory to GREEN
	vbmClearColor( GREEN );
	
	SCREEN_BG_COLOR := BLACK + SCREEN_BG_BLACK;

	vbmDrawSmallTextE( #strScore, #font, 1, 89, 8 );

	while (true) do
	begin
	
		bcdAdd( #numb, #add, 5 );
		vbmDrawSmallBcd( #numb, #adrNumbers, 1, 96, 5 );
		
		waitforraster(0);

	end;

	
	loop();

end.
