/*
    Ninja Sample

    COPYRIGHT (C) SEGA ENTERSRISES,LTD.

    Print Sample

    1999.1.14
*/

#include <shinobi.h>

void njUserInit(void)
{
	njSetBorderColor(0);
	if (syCblCheckCable() == SYE_CBL_CABLE_VGA) {
		sbInitSystem(NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1);
	} else {
		sbInitSystem(NJD_RESOLUTION_640x480_NTSCNI,
										NJD_FRAMEBUFFER_MODE_RGB565, 1);
	}

	njInitVertexBuffer(100000, 0, 100000, 0, 0);
	njInitPrint(NULL, 0, 0);
	njPrintSize(16);
	njSetBackColor(0x00000000, 0x00000000, 0x000000FF);
}


Sint32 i = 0;

Sint32 njUserMain(void)
{
	njPrintC(NJM_LOCATION(4,  2), "PRINT SAMPLE");
	njPrintH(NJM_LOCATION(20,  2), i++, 8);
	njPrintPeripheralInfo(NJM_LOCATION( 2,  4), NJD_PORT_A0);
	njPrintPeripheralInfo(NJM_LOCATION(22,  4), NJD_PORT_B0);
	njPrintPeripheralInfo(NJM_LOCATION( 2, 17), NJD_PORT_C0);
	njPrintPeripheralInfo(NJM_LOCATION(22, 17), NJD_PORT_D0);

	return NJD_USER_CONTINUE;
}

void njUserExit(void)
{
	sbExitSystem();
}

