Example #1
0
/*
	Initialize PVR to defaults and sndoggvorbis
*/
void Init(){
	vid_set_mode(DM_640x480,PM_RGB565);
	vid_border_color(0,255,0);
	pvr_init_defaults();
	
	snd_stream_init();
	sndoggvorbis_init();
	
}
Example #2
0
void SoundInit(void)
{
#ifndef NOSOUND
		unsigned char  i;
		int  ret;
		char buf[128];
		 

#ifdef DREAMCAST
		SoundEnable = TRUE;
		snd_stream_init();
		sndoggvorbis_init();
		  
		for(i=0;i<9;i++)
		{
			snprintf(buf, sizeof(buf), "/rd/se0%d.wav", i);
			SEPool[i] = snd_sfx_load(buf); 
		}

		for(i=0;i<5;i++)
		{
			snprintf(buf, sizeof(buf), "/rd/bgm00%d.ogg", i);
			snprintf(BGMPool[i], sizeof(BGMPool[i]), "%s", buf);
		}
#else
		
		track = 0;

		SoundEnable = TRUE;
		ret = Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 1024);
		if (ret != 0) 
		{
			SoundEnable = FALSE;
			return;
		}
		
		for(i=0; i<8; i++) 
		{
			Mix_Volume(i, VOLUMEDEFAULT);
		}
		
		Mix_VolumeMusic(VOLUMEDEFAULT);

		for(i=0; i<BGMMAX; i++) 
		{
			BGMPool[i][0] = 0;
		}
		
		for(i=0; i<SEMAX; i++) 
		{
			SEPool[i] = 0;
		}
	  
	#ifdef NO_SNPRINTF
		for(i=0;i<5;i++)
		{
			sprintf(buf, "./data/bgm00%d.ogg", i);
			sprintf(BGMPool[i], "%s", buf);
		}
		  
		for(i=0;i<9;i++)
		{
			sprintf(buf, "./data/se0%d.wav", i);
			SEPool[i] = Mix_LoadWAV(buf);
		}
	#else
		for(i=0;i<5;i++)
		{
			snprintf(buf, sizeof(buf), "./data/bgm00%d.ogg", i);
			snprintf(BGMPool[i], sizeof(BGMPool[i]), "%s", buf);
		}
		  
		for(i=0;i<9;i++)
		{
			snprintf(buf, sizeof(buf), "./data/se0%d.wav", i);
			SEPool[i] = Mix_LoadWAV(buf);
		}
	#endif
	
#endif
		
#endif	//NOSOUND
}