cog/Frameworks/GME/gme/Gbs_Emu.h

64 lines
1.8 KiB
C
Raw Normal View History

2007-10-11 23:11:58 +00:00
// Nintendo Game Boy GBS music file emulator
2013-09-28 03:24:23 +00:00
// Game_Music_Emu $vers
2007-10-11 23:11:58 +00:00
#ifndef GBS_EMU_H
#define GBS_EMU_H
#include "Classic_Emu.h"
2013-09-28 03:24:23 +00:00
#include "Gbs_Core.h"
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
class Gbs_Emu : public Classic_Emu {
2007-10-11 23:11:58 +00:00
public:
2013-09-28 03:24:23 +00:00
// Equalizer profiles for Game Boy speaker and headphones
2007-10-11 23:11:58 +00:00
static equalizer_t const handheld_eq;
static equalizer_t const headphones_eq;
2013-09-28 03:24:23 +00:00
static equalizer_t const cgb_eq; // Game Boy Color headphones have less bass
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
// GBS file header (see Gbs_Core.h)
typedef Gbs_Core::header_t header_t;
2007-10-11 23:11:58 +00:00
// Header for currently loaded file
2013-09-28 03:24:23 +00:00
header_t const& header() const { return core_.header(); }
// Selects which sound hardware to use. AGB hardware is cleaner than the
// others. Doesn't take effect until next start_track().
enum sound_t {
sound_dmg = Gb_Apu::mode_dmg, // Game Boy monochrome
sound_cgb = Gb_Apu::mode_cgb, // Game Boy Color
sound_agb = Gb_Apu::mode_agb, // Game Boy Advance
sound_gbs // Use DMG/CGB based on GBS (default)
};
void set_sound( sound_t s ) { sound_hardware = s; }
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
// If true, makes APU more accurate, which results in more clicking.
void enable_clicking( bool enable = true ) { core_.apu().reduce_clicks( !enable ); }
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
static gme_type_t static_type() { return gme_gbs_type; }
Gbs_Core& core() { return core_; }
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
blargg_err_t hash_( Hash_Function& ) const;
// Internal
2007-10-11 23:11:58 +00:00
public:
Gbs_Emu();
~Gbs_Emu();
2013-09-28 03:24:23 +00:00
2007-10-11 23:11:58 +00:00
protected:
2013-09-28 03:24:23 +00:00
// Overrides
virtual blargg_err_t track_info_( track_info_t*, int track ) const;
virtual blargg_err_t load_( Data_Reader& );
virtual blargg_err_t start_track_( int );
virtual blargg_err_t run_clocks( blip_time_t&, int );
virtual void set_tempo_( double );
virtual void set_voice( int, Blip_Buffer*, Blip_Buffer*, Blip_Buffer* );
virtual void update_eq( blip_eq_t const& );
virtual void unload();
2007-10-11 23:11:58 +00:00
private:
2013-09-28 03:24:23 +00:00
sound_t sound_hardware;
Gbs_Core core_;
2007-10-11 23:11:58 +00:00
};
#endif