Exemple #1
0
void sound_stop(void)
{
#if 0	/* forQUASI88 */
	int totalsound = 0;


	while (Machine->drv->sound[totalsound].sound_type != 0 && totalsound < MAX_SOUND)
	{
		if (sndintf[Machine->drv->sound[totalsound].sound_type].stop)
			(*sndintf[Machine->drv->sound[totalsound].sound_type].stop)();

		totalsound++;
	}
#else	/* forQUASI88 */
	{
		if (sndintf[ fm_interface.sound_type ].stop)
			(*sndintf[ fm_interface.sound_type ].stop)();

		if (sndintf[ beep_interface.sound_type ].stop)
			(*sndintf[ beep_interface.sound_type ].stop)();
	}
#endif	/* forQUASI88 */

	streams_sh_stop();
	mixer_sh_stop();

#if 0	/* forQUASI88 */
	/* free audio samples */
	Machine->samples = 0;
#endif	/* forQUASI88 */
}
Exemple #2
0
void sound_shutdown(void) {
#ifdef Z80_EMULATED
//puts("sound_shutdown");
    sound_stop();
    streams_sh_stop();
    YM2610_sh_stop();
    SDL_CloseAudio();
#endif
}
Exemple #3
0
SDL_bool init_game(char *rom_name) {
    DRIVER *dr;
    char *drconf,*gpath;
    dr=dr_get_by_name(rom_name);
    if (!dr) {
#ifdef USE_GUI
	gui_error_box(20,80,264,60,
		      "Error!","No valid romset found for\n%s\n",
		      file_basename(rom_name));
#else
	printf("No valid romset found for %s\n",rom_name);
#endif
	return SDL_FALSE;
    }

    if (conf.game!=NULL) {
	save_nvram(conf.game);
	if (conf.sound) {
	    close_sdl_audio();
	    YM2610_sh_stop();
	    streams_sh_stop();
	}
	free_game_memory();
    }


    /* open transpack if need */
    trans_pack_open(CF_STR(cf_get_item_by_name("transpack")));

    //open_rom(rom_name);
    if (dr_load_game(dr,rom_name)==SDL_FALSE) {
#ifdef USE_GUI
	gui_error_box(20,80,264,60,
		      "Error!","Couldn't load\n%s\n",
		      file_basename(rom_name));
#else
	printf("Can't load %s\n",rom_name);
#endif
	return SDL_FALSE;
    }
    /* per game config */
    gpath=get_gngeo_dir();
    drconf=alloca(strlen(gpath)+strlen(dr->name)+strlen(".cf")+1);
    sprintf(drconf,"%s%s.cf",gpath,dr->name);
    cf_open_file(drconf);
    open_bios();
    open_nvram(conf.game);
    init_sdl();
    sdl_set_title(conf.game);
    init_neo(conf.game);
    if (conf.sound) 
	init_sdl_audio();
    return SDL_TRUE;
}
Exemple #4
0
void sound_stop(void)
{
	int totalsound = 0;


	while (totalsound < MAX_SOUND && Machine->drv->sound[totalsound].sound_type != 0)
	{
		if (sndintf[Machine->drv->sound[totalsound].sound_type].stop)
			(*sndintf[Machine->drv->sound[totalsound].sound_type].stop)();

		totalsound++;
	}

	streams_sh_stop();
	mixer_sh_stop();

	/* free audio samples */
	Machine->samples = 0;
}
Exemple #5
0
void saStopSoundEmulators(void)
{
   int i;
   print_debug("SaStopSoundEmulators()\n");

   emulators_active = 0;
   saResetPlayChannels();
   if( SndMachine == NULL ){
      SndMachine = &snd_entry;
   }
   else{
     if(SndMachine->first!=0){		// YM3812 fix crashes
       streams_sh_stop();
       for( i = 0; i < SndMachine->control_max; i++ ){

	 if( sound_chip_list[SndMachine->init[i]].shutdown )
	   sound_chip_list[SndMachine->init[i]].shutdown();
       }
       SndMachine->first	   = 0;
     }
   }
}