コード例 #1
0
ファイル: gx_audio.c プロジェクト: IVBeatz/genplus-gx
/*** 
      gx_audio_Start

     This function restarts the audio engine
     This is called when coming back from Main Menu
 ***/
void gx_audio_Start(void)
{
  /* shutdown background music */
  PauseOgg(1);	
  StopOgg();	
  
  /* shutdown menu audio processing */
  ASND_Pause(1);
  ASND_End();
  AUDIO_StopDMA();
  AUDIO_RegisterDMACallback(NULL);
  DSP_Halt();

  /* DMA Interrupt callback */
  AUDIO_RegisterDMACallback(ai_callback);

  /* emulation is synchronized with audio hardware by default */
  audioSync = AUDIO_WAIT;

  /* reset emulation audio processing */
  memset(soundbuffer, 0, sizeof(soundbuffer));
  audioWait = 0;
  bufferSize = 0;
  bufferIndex = 0;
}
コード例 #2
0
ファイル: sound.c プロジェクト: Oibaf66/fbzx-wii
void sound_close() {

	switch(sound_type) {
	case SOUND_NO:
	break;
	case SOUND_SDL:
	SDL_CloseAudio();
	break;
#ifdef D_SOUND_OSS
	case SOUND_OSS:
		close(audio_fd);
	break;
#endif
#ifdef D_SOUND_ALSA
	case SOUND_ALSA:
		snd_pcm_drain (_soundDevice);
		snd_pcm_close (_soundDevice);
	break;
#endif
#ifdef D_SOUND_PULSE
	case SOUND_PULSEAUDIO:
		pa_simple_free(pulse_s);
	break;
#endif
#ifdef GEKKO
	case SOUND_ASND:
		ASND_End();
	break;
#endif

	default:
	break;
	}
}
コード例 #3
0
ファイル: gx_audio.c プロジェクト: IVBeatz/genplus-gx
/* AUDIO engine shutdown */
void gx_audio_Shutdown(void)
{
  PauseOgg(1);
  StopOgg();
  ASND_Pause(1);
  ASND_End();
  if (Bg_music_ogg)
  {
    free(Bg_music_ogg);
  }
}
コード例 #4
0
ファイル: main.cpp プロジェクト: EaganRackley/SwimFishySwim
//---------------------------------------------------------------------------------
// main!
//---------------------------------------------------------------------------------
int main(int argc, char **argv) 
{
#ifdef PLATFORM_IS_WII
	try
	{
		// Setup the remote debugger if possible...
		DEBUG_Init(GDBSTUB_DEVICE_USB, 1);

		// Initialize filesystem to load from SD Card - This should change to NAND for official releases ...
		fatInitDefault();

		for(int i = 0; i < 100; i++)
		{
			usleep(100);
		}	

		//setupTrace("//Map.csv");
		
		srand ( time(NULL) );

		AUDIO_Init(NULL);
        ASND_Init();
        ASND_Pause(0);

		//setupUnitTesting();
		
		RunGameMain();
		
		ASND_Pause(1);
        ASND_End();

		//MemTrack::TrackListMemoryUsage();

		//shutDownTrace();

	}
	catch(int ex)
	{
		printf("\x1b[2;0H");printf("Exception Triggered, Executing Breakpoint!\n");
		ASSERT(false);

		_break();
	}
#endif

#ifdef PLATFORM_IS_WIN
	runUnitTests();
#endif

	return 0;
}
コード例 #5
0
ファイル: audio.cpp プロジェクト: gnils/usbloader-gx
/****************************************************************************
 * ShutdownAudio
 *
 * Shuts down audio subsystem. Useful to avoid unpleasant sounds if a
 * crash occurs during shutdown.
 ***************************************************************************/
void ShutdownAudio() {
    ASND_Pause(1);
    ASND_End();
}
コード例 #6
0
ファイル: music.c プロジェクト: MajorBootman/cfg-loader
void Music_Stop()
{
	dbg_printf("Music_Stop\n");
	_Music_Stop();
	ASND_End();
}
コード例 #7
0
ファイル: legal.c プロジェクト: XiaoDuan/OpenEmu
void legal ()
{
  int count = 2000;
  int vis = 0;

#ifdef HW_RVL
  gx_texture *button = gxTextureOpenPNG(Key_A_wii_png,0);
#else
  gx_texture *button = gxTextureOpenPNG(Key_A_gcn_png,0);
#endif

  gx_texture *logo_left= gxTextureOpenPNG(Bg_intro_c5_png,0);
  gx_texture *logo_right = gxTextureOpenPNG(Bg_intro_c4_png,0);

  gxClearScreen((GXColor)BLACK);
  show_disclaimer(56);
  gxDrawTexture(logo_left, (640-logo_left->width-logo_right->width -32)/2, 480-logo_left->height-24, logo_left->width, logo_left->height,255);
  gxDrawTexture(logo_right, (640-logo_left->width-logo_right->width -32)/2+logo_left->width+32, 480-logo_right->height-24, logo_right->width, logo_right->height,255);
  gxSetScreen();

  sleep(1);

  while (!(m_input.keys & PAD_BUTTON_A) && (count > 0))
  {
    gxClearScreen((GXColor)BLACK);
    show_disclaimer(56);
    if (count%25 == 0) vis^=1;
    if (vis)
    {
      FONT_writeCenter("Press    button to continue.",24,0,640,366,(GXColor)SKY_BLUE);
      gxDrawTexture(button, 220, 366-24+(24-button->height)/2,  button->width, button->height,255);
    }
    gxDrawTexture(logo_left, (640-logo_left->width-logo_right->width -32)/2, 480-logo_left->height-24, logo_left->width, logo_left->height,255);
    gxDrawTexture(logo_right, (640-logo_left->width-logo_right->width -32)/2+logo_left->width+32, 480-logo_right->height-24, logo_right->width, logo_right->height,255);
    gxSetScreen();
    count--;
  }

  gxTextureClose(&button);
  gxTextureClose(&logo_left);
  gxTextureClose(&logo_right);

  if (count > 0)
  {
    ASND_Init();
    ASND_Pause(0);
    int voice = ASND_GetFirstUnusedVoice();
    ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)button_select_pcm,button_select_pcm_size,200,200,NULL);
    GUI_FadeOut();
    ASND_Pause(1);
    ASND_End();
    return;
  }

  gxClearScreen((GXColor)BLACK);
  gx_texture *texture = gxTextureOpenPNG(Bg_intro_c1_png,0);
  if (texture)
  {
    gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2,  texture->width, texture->height,255);
    if (texture->data) free(texture->data);
    free(texture);
  }
  gxSetScreen();

  sleep (1);

  gxClearScreen((GXColor)WHITE);
  texture = gxTextureOpenPNG(Bg_intro_c2_png,0);
  if (texture)
  {
    gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2,  texture->width, texture->height,255);
    if (texture->data) free(texture->data);
    free(texture);
  }
  gxSetScreen();

  sleep (1);

  gxClearScreen((GXColor)BLACK);
  texture = gxTextureOpenPNG(Bg_intro_c3_png,0);
  if (texture)
  {
    gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2,  texture->width, texture->height,255);
    if (texture->data) free(texture->data);
    free(texture);
  }
  gxSetScreen();

  ASND_Pause(0);
  int voice = ASND_GetFirstUnusedVoice();
  ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)intro_pcm,intro_pcm_size,200,200,NULL);
  sleep (2);
  ASND_Pause(1);
}