diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-25 21:32:25 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-04-25 22:13:20 +0200 |
commit | f40bfc9267b13b54e6379dfe7539447662879d24 (patch) | |
tree | 9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libgme/sms_fm_apu.h | |
parent | a0009907de7a0107d49040d8a180f140e2eff299 (diff) | |
download | rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip |
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libgme/sms_fm_apu.h')
-rw-r--r-- | lib/rbcodec/codecs/libgme/sms_fm_apu.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libgme/sms_fm_apu.h b/lib/rbcodec/codecs/libgme/sms_fm_apu.h new file mode 100644 index 0000000000..921db6cef1 --- /dev/null +++ b/lib/rbcodec/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 | |||
8 | enum { fm_apu_osc_count = 1 }; | ||
9 | |||
10 | struct 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 | |||
24 | void Fm_apu_create( struct Sms_Fm_Apu* this ); | ||
25 | |||
26 | static inline bool Fm_apu_supported( void ) { return Ym2413_supported(); } | ||
27 | blargg_err_t Fm_apu_init( struct Sms_Fm_Apu* this, int clock_rate, int sample_rate ); | ||
28 | |||
29 | static inline void Fm_apu_set_output( struct Sms_Fm_Apu* this, struct Blip_Buffer* b ) | ||
30 | { | ||
31 | this->output_ = b; | ||
32 | } | ||
33 | |||
34 | static inline void Fm_apu_volume( struct Sms_Fm_Apu* this, int v ) { Synth_volume( &this->synth, (v*2) / 5 / 4096 ); } | ||
35 | |||
36 | void Fm_apu_reset( struct Sms_Fm_Apu* this ); | ||
37 | |||
38 | static inline void Fm_apu_write_addr( struct Sms_Fm_Apu* this, int data ) { this->addr = data; } | ||
39 | void Fm_apu_write_data( struct Sms_Fm_Apu* this, blip_time_t, int data ); | ||
40 | |||
41 | void Fm_apu_end_frame( struct Sms_Fm_Apu* this, blip_time_t t ); | ||
42 | |||
43 | #endif | ||