cog/Frameworks/GME/gme/Sap_Emu.h

54 lines
1.2 KiB
C
Raw Normal View History

2007-10-11 23:11:58 +00:00
// Atari XL/XE SAP music file emulator
2013-09-28 03:24:23 +00:00
// Game_Music_Emu $vers
2007-10-11 23:11:58 +00:00
#ifndef SAP_EMU_H
#define SAP_EMU_H
#include "Classic_Emu.h"
#include "Sap_Apu.h"
2013-09-28 03:24:23 +00:00
#include "Sap_Core.h"
2007-10-11 23:11:58 +00:00
2013-09-28 03:24:23 +00:00
class Sap_Emu : public Classic_Emu {
2007-10-11 23:11:58 +00:00
public:
2013-09-28 03:24:23 +00:00
enum { max_tracks = 32 }; // TODO: no fixed limit
// SAP file info (see Sap_Core.h for more)
struct info_t : Sap_Core::info_t {
2007-10-11 23:11:58 +00:00
byte const* rom_data;
const char* warning;
int track_count;
2013-09-28 03:24:23 +00:00
int track_times [max_tracks];
2007-10-11 23:11:58 +00:00
char author [256];
char name [256];
char copyright [ 32];
};
2013-09-28 03:24:23 +00:00
// Info for currently loaded file
info_t const& info() const { return info_; }
blargg_err_t hash_( Hash_Function& ) const;
static gme_type_t static_type() { return gme_sap_type; }
// Implementation
public:
Sap_Emu();
~Sap_Emu();
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:
2013-09-28 03:24:23 +00:00
info_t info_;
2007-10-11 23:11:58 +00:00
byte const* file_end;
2013-09-28 03:24:23 +00:00
Sap_Core core;
2007-10-11 23:11:58 +00:00
};
#endif