summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/sms_fm_apu.h
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-08-07 20:01:04 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-08-07 20:01:04 +0000
commitacb0917556fc33681c1df5a530cf754193e67705 (patch)
tree052a47097009a210e4aed9c207bd6aa4828cc000 /apps/codecs/libgme/sms_fm_apu.h
parent93c6f1329a5691a8be158cefe15641bd1daf9ef8 (diff)
downloadrockbox-acb0917556fc33681c1df5a530cf754193e67705.tar.gz
rockbox-acb0917556fc33681c1df5a530cf754193e67705.zip
Submit initial patch from FS#12176. Adds support for several new game music formats (AY, GBS, HES, KSS, SGC, VGM and VGZ) and replaces the current NSF and NSFE with a new implementation based on a port of the Game Music Emu library 'GME'. This first submit does not cover the full functionality provided by the author's original patch: Coleco-SGV is not supported, some GME-specific m3u-support has been removed and IRAM is not used yet. Further changes are very likely to follow this submit. Thanks to Mauricio Garrido.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30264 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libgme/sms_fm_apu.h')
-rw-r--r--apps/codecs/libgme/sms_fm_apu.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/apps/codecs/libgme/sms_fm_apu.h b/apps/codecs/libgme/sms_fm_apu.h
new file mode 100644
index 0000000000..95e1f95e62
--- /dev/null
+++ b/apps/codecs/libgme/sms_fm_apu.h
@@ -0,0 +1,43 @@
1#ifndef SMS_FM_APU_H
2#define SMS_FM_APU_H
3
4#include "blargg_common.h"
5#include "blip_buffer.h"
6#include "ym2413_emu.h"
7
8enum { fm_apu_osc_count = 1 };
9
10struct Sms_Fm_Apu {
11 struct Blip_Buffer* output_;
12 blip_time_t next_time;
13 int last_amp;
14 int addr;
15
16 int clock_;
17 int rate_;
18 blip_time_t period_;
19
20 struct Blip_Synth synth;
21 struct Ym2413_Emu apu;
22};
23
24void Fm_apu_create( struct Sms_Fm_Apu* this );
25
26static inline bool Fm_apu_supported( void ) { return Ym2413_supported(); }
27blargg_err_t Fm_apu_init( struct Sms_Fm_Apu* this, double clock_rate, double sample_rate );
28
29static inline void Fm_apu_set_output( struct Sms_Fm_Apu* this, struct Blip_Buffer* b )
30{
31 this->output_ = b;
32}
33
34static inline void Fm_apu_volume( struct Sms_Fm_Apu* this, double v ) { Synth_volume( &this->synth, 0.4 / 4096 * v ); }
35
36void Fm_apu_reset( struct Sms_Fm_Apu* this );
37
38static inline void Fm_apu_write_addr( struct Sms_Fm_Apu* this, int data ) { this->addr = data; }
39void Fm_apu_write_data( struct Sms_Fm_Apu* this, blip_time_t, int data ) ICODE_ATTR;
40
41void Fm_apu_end_frame( struct Sms_Fm_Apu* this, blip_time_t t ) ICODE_ATTR;
42
43#endif