Music_Emu::gme_t() { effects_buffer_ = NULL; sample_rate_ = 0; mute_mask_ = 0; tempo_ = 1.0; gain_ = 1.0; fade_set = false; // defaults tfilter = track_filter.setup(); set_max_initial_silence( 15 ); set_silence_lookahead( 3 ); ignore_silence( false ); equalizer_.treble = -1.0; equalizer_.bass = 60; static const char* const names [] = { "Voice 1", "Voice 2", "Voice 3", "Voice 4", "Voice 5", "Voice 6", "Voice 7", "Voice 8" }; set_voice_names( names ); Music_Emu::unload(); // clears fields }
Gym_Emu::Gym_Emu() { resampler.set_callback( play_frame_, this ); pos = NULL; disable_oversampling_ = false; set_type( gme_gym_type ); set_silence_lookahead( 1 ); // tracks should already be trimmed pcm_buf = stereo_buf.center(); }
Vgm_Emu::Vgm_Emu() { resampler.set_callback( play_frame_, this ); disable_oversampling_ = false; set_type( gme_vgm_type ); set_max_initial_silence( 1 ); set_silence_lookahead( 1 ); // tracks should already be trimmed static equalizer_t const eq = { -14.0, 80 }; set_equalizer( eq ); }
Nsf_Emu::Nsf_Emu() { vrc6 = 0; namco = 0; fme7 = 0; set_type( gme_nsf_type ); set_silence_lookahead( 6 ); apu.dmc_reader( pcm_read, this ); Music_Emu::set_equalizer( nes_eq ); set_gain( 1.4 ); memset( unmapped_code, Nes_Cpu::bad_opcode, sizeof unmapped_code ); }
Gbs_Emu::Gbs_Emu() { sound_hardware = sound_gbs; enable_clicking( false ); set_type( gme_gbs_type ); set_silence_lookahead( 6 ); set_max_initial_silence( 21 ); set_gain( 1.2 ); // kind of midway between headphones and speaker static equalizer_t const eq = { -1.0, 120 }; set_equalizer( eq ); }
Vgm_Emu::Vgm_Emu() { disable_oversampling_ = false; psg_rate = 0; set_type( gme_vgm_type ); static int const types [8] = { wave_type | 1, wave_type | 0, wave_type | 2, noise_type | 0 }; set_voice_types( types ); set_silence_lookahead( 1 ); // tracks should already be trimmed set_equalizer( make_equalizer( -14.0, 80 ) ); }
Ay_Emu::Ay_Emu() { beeper_output = 0; set_type( gme_ay_type ); static const char* const names [osc_count] = { "Wave 1", "Wave 2", "Wave 3", "Beeper" }; set_voice_names( names ); static int const types [osc_count] = { wave_type | 0, wave_type | 1, wave_type | 2, mixed_type | 0 }; set_voice_types( types ); set_silence_lookahead( 6 ); }
Sap_Emu::Sap_Emu() { set_type( gme_sap_type ); static const char* const names [Sap_Apu::osc_count * 2] = { "Wave 1", "Wave 2", "Wave 3", "Wave 4", "Wave 5", "Wave 6", "Wave 7", "Wave 8", }; set_voice_names( names ); static int const types [Sap_Apu::osc_count * 2] = { wave_type | 1, wave_type | 2, wave_type | 3, wave_type | 0, wave_type | 5, wave_type | 6, wave_type | 7, wave_type | 4, }; set_voice_types( types ); set_silence_lookahead( 6 ); }
Hes_Emu::Hes_Emu() { timer.raw_load = 0; set_type( gme_hes_type ); static const char* const names [Hes_Apu::osc_count] = { "Wave 1", "Wave 2", "Wave 3", "Wave 4", "Multi 1", "Multi 2" }; set_voice_names( names ); static int const types [Hes_Apu::osc_count] = { wave_type | 0, wave_type | 1, wave_type | 2, wave_type | 3, mixed_type | 0, mixed_type | 1 }; set_voice_types( types ); set_silence_lookahead( 6 ); set_gain( 1.11 ); }
Ay_Emu::Ay_Emu() { core.set_cpc_callback( enable_cpc_, this ); set_type( gme_ay_type ); set_silence_lookahead( 6 ); }
Hes_Emu::Hes_Emu() { set_type( gme_hes_type ); set_silence_lookahead( 6 ); set_gain( 1.11 ); }
Sap_Emu::Sap_Emu() { set_type( gme_sap_type ); set_silence_lookahead( 6 ); }
blargg_err_t Kss_Emu::load_( Data_Reader& in ) { RETURN_ERR( core.load( in ) ); set_warning( core.warning() ); set_track_count( get_le16( header().last_track ) + 1 ); core.scc_enabled = false; if ( header().device_flags & 0x02 ) // Sega Master System { int const osc_count = Sms_Apu::osc_count + Opl_Apu::osc_count; static const char* const names [osc_count] = { "Square 1", "Square 2", "Square 3", "Noise", "FM" }; set_voice_names( names ); static int const types [osc_count] = { wave_type+1, wave_type+3, wave_type+2, mixed_type+1, wave_type+0 }; set_voice_types( types ); // sms.psg set_voice_count( Sms_Apu::osc_count ); check( !core.sms.psg ); CHECK_ALLOC( core.sms.psg = BLARGG_NEW Sms_Apu ); // sms.fm if ( header().device_flags & 0x01 ) { set_voice_count( osc_count ); RETURN_ERR( new_opl_apu( Opl_Apu::type_smsfmunit, &core.sms.fm ) ); } } else // MSX { int const osc_count = Ay_Apu::osc_count + Opl_Apu::osc_count; static const char* const names [osc_count] = { "Square 1", "Square 2", "Square 3", "FM" }; set_voice_names( names ); static int const types [osc_count] = { wave_type+1, wave_type+3, wave_type+2, wave_type+0 }; set_voice_types( types ); // msx.psg set_voice_count( Ay_Apu::osc_count ); check( !core.msx.psg ); CHECK_ALLOC( core.msx.psg = BLARGG_NEW Ay_Apu ); if ( header().device_flags & 0x10 ) set_warning( "MSX stereo not supported" ); // msx.music if ( header().device_flags & 0x01 ) { set_voice_count( osc_count ); RETURN_ERR( new_opl_apu( Opl_Apu::type_msxmusic, &core.msx.music ) ); } // msx.audio if ( header().device_flags & 0x08 ) { set_voice_count( osc_count ); RETURN_ERR( new_opl_apu( Opl_Apu::type_msxaudio, &core.msx.audio ) ); } if ( !(header().device_flags & 0x80) ) { if ( !(header().device_flags & 0x84) ) core.scc_enabled = core.scc_enabled_true; // msx.scc check( !core.msx.scc ); CHECK_ALLOC( core.msx.scc = BLARGG_NEW Scc_Apu ); int const osc_count = Ay_Apu::osc_count + Scc_Apu::osc_count; static const char* const names [osc_count] = { "Square 1", "Square 2", "Square 3", "Wave 1", "Wave 2", "Wave 3", "Wave 4", "Wave 5" }; set_voice_names( names ); static int const types [osc_count] = { wave_type+1, wave_type+3, wave_type+2, wave_type+0, wave_type+4, wave_type+5, wave_type+6, wave_type+7, }; set_voice_types( types ); set_voice_count( osc_count ); } } set_silence_lookahead( 6 ); if ( core.sms.fm || core.msx.music || core.msx.audio ) { if ( !Opl_Apu::supported() ) set_warning( "FM sound not supported" ); else set_silence_lookahead( 3 ); // Opl_Apu is really slow } return setup_buffer( ::clock_rate ); }