// ------------------------------------------------------------------------------------------------
// main.c
//
// This is a boilerplate main function
//
// COPYRIGHT (C) SEGA OF AMERICA, INC. 1998
// All rights reserved.
//
// Information and source code samples contained herein are 
// provided "as-is", without representations or warranties, and 
// are subject to change without notice.
//
// SEGA OF AMERICA, INC. cannot support modifications or 
// derivative works created from the sample source code provided. 
// Developers may use, reproduce, and modify portions or entire 
// sections of the sample source code for the purposes of creating
// Dreamcast applications.  
//
// Sample source code contained herein may not be appropriate 
// for use under all circumstances.  Please consult Developer 
// documentation provided along with your Dreamcast unit for
// additional information and suggestions.
//
// Author: Ralph "Cooksey" Thomas
//
// Tabs: 4
//
// Rev:		04/09/99 File Originated		
//			04/15/99 Cable code added.
// ------------------------------------------------------------------------------------------------

// headers
#include <shinobi.h>
#include <am.h>

// proto's
void UserVBlankIn( void );
void main( void );


void main(void)
{
	SYE_CBL_CABLE Cable;
	static Sint32  i = 0;
	PDS_PERIPHERAL *pad;
	
    /* Init */
	njSetBorderColor(0x00000000);

	/* Check the cable for NTSC or VGA */
	Cable = syCblCheckCable();

	switch( Cable )
	{
	case SYE_CBL_CABLE_VGA:
		sbInitSystem(NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1);
		break;

	case SYE_CBL_CABLE_NTSC:
		sbInitSystem(NJD_RESOLUTION_640x480_NTSCNI, NJD_FRAMEBUFFER_MODE_RGB565, 1);
		break;
	}
	njInitVertexBuffer(20000,0,20000,0,0);
	njInitPrint(NULL,0,NJD_TEXFMT_ARGB_1555);
	njSetBackColor(0x00000000,0x00000000,0x000000FF);
	//njSetVSyncFunction(UserVBlankIn);
	
	playRawSoundTest();
	
	while(1) 
		{
		pad = (PDS_PERIPHERAL *) pdGetPeripheral( PDD_PORT_A0 );
		njWaitVSync();
		}
}

// ******************************* end of file *******************************
