/*
** BITMAP.C - displays an Xmem bitmap a few times, with and without 
**            buffer lock.
*/

#use op71l.lib
#use op71hw.lib
#use vdriver.lib

xdata oneBitmap { '\xff', '\xfe', '\xfc', '\xf8', '\xf0', '\xe0', '\xc0', '\x80' };

main()
{
	int i;
	
	VdInit();	// init virtual driver, timers, do _GLOBAL_INIT()
	glInit();	// init op71xx, turn on backlight, set default contrast
	
	op71BackLight(1);
	op71SetContrast(35);
	glSetBrushType(GL_XOR);
	
	glBlankScreen();
	for(i = 0; i < (OP71XS / 8); i++)
	{
		glXPutBitmap(i * 8,i * 4,8,8,oneBitmap);
	}
	tdelay(1000);	// 1 second delay
	glBlankScreen();
	tdelay(1000);	// 1 second delay again
	op71BackLight(0);	// turn off the lights for a moment
	tdelay(1000);
	op71BackLight(1);	// turn on the lights, we're about to start again
	glBuffLock();
	for(i = 0; i < (OP71XS / 8); i++)
	{
		glXPutBitmap(i * 8,i * 4,8,8,oneBitmap);
	}
	glBuffUnlock();
	tdelay(10000);	// 10 second delay
	op71BackLight(0);	// turn off the lights, we're done
}
