2007-10-11 23:11:58 +00:00
|
|
|
// Nintendo NES/Famicom NSFE music file emulator
|
|
|
|
|
2013-09-28 03:24:23 +00:00
|
|
|
// Game_Music_Emu $vers
|
2007-10-11 23:11:58 +00:00
|
|
|
#ifndef NSFE_EMU_H
|
|
|
|
#define NSFE_EMU_H
|
|
|
|
|
|
|
|
#include "blargg_common.h"
|
|
|
|
#include "Nsf_Emu.h"
|
2013-09-28 03:24:23 +00:00
|
|
|
class Nsfe_Emu;
|
2007-10-11 23:11:58 +00:00
|
|
|
|
|
|
|
// Allows reading info from NSFE file without creating emulator
|
|
|
|
class Nsfe_Info {
|
|
|
|
public:
|
2013-09-28 03:24:23 +00:00
|
|
|
blargg_err_t load( Data_Reader&, Nsfe_Emu* );
|
2007-10-11 23:11:58 +00:00
|
|
|
|
|
|
|
struct info_t : Nsf_Emu::header_t
|
|
|
|
{
|
|
|
|
char game [256];
|
|
|
|
char author [256];
|
|
|
|
char copyright [256];
|
|
|
|
char dumper [256];
|
|
|
|
} info;
|
2013-09-28 03:24:23 +00:00
|
|
|
|
|
|
|
blargg_vector<unsigned char> data;
|
|
|
|
|
2007-10-11 23:11:58 +00:00
|
|
|
void disable_playlist( bool = true );
|
|
|
|
|
|
|
|
blargg_err_t track_info_( track_info_t* out, int track ) const;
|
|
|
|
|
|
|
|
int remap_track( int i ) const;
|
|
|
|
|
|
|
|
void unload();
|
|
|
|
|
2013-09-28 03:24:23 +00:00
|
|
|
// Implementation
|
|
|
|
public:
|
2007-10-11 23:11:58 +00:00
|
|
|
Nsfe_Info();
|
|
|
|
~Nsfe_Info();
|
2013-09-28 03:24:23 +00:00
|
|
|
BLARGG_DISABLE_NOTHROW
|
2007-10-11 23:11:58 +00:00
|
|
|
private:
|
|
|
|
blargg_vector<char> track_name_data;
|
|
|
|
blargg_vector<const char*> track_names;
|
|
|
|
blargg_vector<unsigned char> playlist;
|
|
|
|
blargg_vector<char [4]> track_times;
|
|
|
|
int actual_track_count_;
|
|
|
|
bool playlist_disabled;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Nsfe_Emu : public Nsf_Emu {
|
|
|
|
public:
|
|
|
|
static gme_type_t static_type() { return gme_nsfe_type; }
|
|
|
|
|
|
|
|
struct header_t { char tag [4]; };
|
|
|
|
|
2013-09-28 03:24:23 +00:00
|
|
|
|
|
|
|
// Implementation
|
2007-10-11 23:11:58 +00:00
|
|
|
public:
|
|
|
|
Nsfe_Emu();
|
|
|
|
~Nsfe_Emu();
|
2013-09-28 03:24:23 +00:00
|
|
|
virtual void unload();
|
|
|
|
|
2007-10-11 23:11:58 +00:00
|
|
|
protected:
|
2013-09-28 03:24:23 +00:00
|
|
|
virtual blargg_err_t load_( Data_Reader& );
|
|
|
|
virtual blargg_err_t track_info_( track_info_t*, int track ) const;
|
|
|
|
virtual blargg_err_t start_track_( int );
|
|
|
|
virtual void clear_playlist_();
|
|
|
|
|
2007-10-11 23:11:58 +00:00
|
|
|
private:
|
|
|
|
Nsfe_Info info;
|
2013-09-28 03:24:23 +00:00
|
|
|
|
|
|
|
void disable_playlist_( bool b );
|
|
|
|
friend class Nsfe_Info;
|
2007-10-11 23:11:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|