cog/Frameworks/GME/gme/Ay_Emu.h

61 lines
1.2 KiB
C
Raw Normal View History

2007-10-11 23:11:58 +00:00
// Sinclair Spectrum AY music file emulator
2013-09-28 03:24:23 +00:00
// Game_Music_Emu $vers
2007-10-11 23:11:58 +00:00
#ifndef AY_EMU_H
#define AY_EMU_H
#include "Classic_Emu.h"
2013-09-28 03:24:23 +00:00
#include "Ay_Core.h"
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
class Ay_Emu : public Classic_Emu {
2007-10-11 23:11:58 +00:00
public:
// AY file header
struct header_t
{
2013-09-28 03:24:23 +00:00
enum { size = 0x14 };
byte tag [8];
2007-10-11 23:11:58 +00:00
byte vers;
byte player;
2013-09-28 03:24:23 +00:00
byte unused [2];
byte author [2];
byte comment [2];
2007-10-11 23:11:58 +00:00
byte max_track;
byte first_track;
byte track_info [2];
};
static gme_type_t static_type() { return gme_ay_type; }
2013-09-28 03:24:23 +00:00
// Implementation
2007-10-11 23:11:58 +00:00
public:
Ay_Emu();
~Ay_Emu();
2013-09-28 03:24:23 +00:00
2007-10-11 23:11:58 +00:00
struct file_t {
header_t const* header;
byte const* tracks;
2013-09-28 03:24:23 +00:00
byte const* end; // end of file data
2007-10-11 23:11:58 +00:00
};
2013-09-28 03:24:23 +00:00
blargg_err_t hash_( Hash_Function& out ) const;
2007-10-11 23:11:58 +00:00
protected:
2013-09-28 03:24:23 +00:00
virtual blargg_err_t track_info_( track_info_t*, int track ) const;
virtual blargg_err_t load_mem_( byte const [], int );
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& );
2007-10-11 23:11:58 +00:00
private:
file_t file;
2013-09-28 03:24:23 +00:00
Ay_Core core;
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
void enable_cpc();
static void enable_cpc_( void* data );
2007-10-11 23:11:58 +00:00
};
#endif