Mercurial > audlegacy-plugins
annotate src/console/Nsfe_Emu.h @ 2171:a4387938cc7d
set have_subtune
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Sun, 18 Nov 2007 21:45:12 +0900 |
parents | 986f098da058 |
children |
rev | line source |
---|---|
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
1 // Nintendo NES/Famicom NSFE music file emulator |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 |
341 | 3 // Game_Music_Emu 0.5.2 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 #ifndef NSFE_EMU_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 #define NSFE_EMU_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 #include "blargg_common.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 #include "Nsf_Emu.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
9 |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
10 // Allows reading info from NSFE file without creating emulator |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 class Nsfe_Info { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 public: |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
13 blargg_err_t load( Data_Reader&, Nsf_Emu* ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 struct info_t : Nsf_Emu::header_t |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 { |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
17 char game [256]; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
18 char author [256]; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 char copyright [256]; |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
20 char dumper [256]; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
21 } info; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
22 |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
23 void disable_playlist( bool = true ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
24 |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
25 blargg_err_t track_info_( track_info_t* out, int track ) const; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
26 |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
27 int remap_track( int i ) const; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
28 |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
29 void unload(); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
30 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
31 Nsfe_Info(); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
32 ~Nsfe_Info(); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
33 private: |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
34 blargg_vector<char> track_name_data; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
35 blargg_vector<const char*> track_names; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
36 blargg_vector<unsigned char> playlist; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
37 blargg_vector<char [4]> track_times; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
38 int actual_track_count_; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
39 bool playlist_disabled; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
40 }; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
42 class Nsfe_Emu : public Nsf_Emu { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 public: |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
44 static gme_type_t static_type() { return gme_nsfe_type; } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
45 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 public: |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
47 // deprecated |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
48 struct header_t { char tag [4]; }; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
49 Music_Emu::load; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
50 blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
51 { return load_remaining_( &h, sizeof h, in ); } |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
52 void disable_playlist( bool = true ); // use clear_playlist() |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
53 |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
54 public: |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
55 Nsfe_Emu(); |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
56 ~Nsfe_Emu(); |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
57 protected: |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
58 blargg_err_t load_( Data_Reader& ); |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
59 blargg_err_t track_info_( track_info_t*, int track ) const; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
60 blargg_err_t start_track_( int ); |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
61 void unload(); |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
62 void clear_playlist_(); |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
63 private: |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
64 Nsfe_Info info; |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
12
diff
changeset
|
65 bool loading; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 }; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
67 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
68 #endif |