summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/ym2413_emu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libgme/ym2413_emu.c')
-rw-r--r--apps/codecs/libgme/ym2413_emu.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/apps/codecs/libgme/ym2413_emu.c b/apps/codecs/libgme/ym2413_emu.c
index 9efd3dcc3d..d9ada431ca 100644
--- a/apps/codecs/libgme/ym2413_emu.c
+++ b/apps/codecs/libgme/ym2413_emu.c
@@ -1,45 +1,45 @@
1// Game_Music_Emu 0.5.5. http://www.slack.net/~ant/ 1// Game_Music_Emu 0.5.5. http://www.slack.net/~ant/
2 2
3#include "ym2413_emu.h" 3#include "ym2413_emu.h"
4 4
5void Ym2413_init( struct Ym2413_Emu* this ) 5void Ym2413_init( struct Ym2413_Emu* this )
6{ 6{
7 this->last_time = disabled_time; this->out = 0; 7 this->last_time = disabled_time; this->out = 0;
8} 8}
9 9
10int Ym2413_set_rate( struct Ym2413_Emu* this, int sample_rate, int clock_rate ) 10int Ym2413_set_rate( struct Ym2413_Emu* this, int sample_rate, int clock_rate )
11{ 11{
12 OPLL_new ( &this->opll, clock_rate, sample_rate ); 12 OPLL_new ( &this->opll, clock_rate, sample_rate );
13 OPLL_reset_patch( &this->opll, OPLL_2413_TONE ); 13 OPLL_reset_patch( &this->opll, OPLL_2413_TONE );
14 14
15 Ym2413_reset( this ); 15 Ym2413_reset( this );
16 return 0; 16 return 0;
17} 17}
18 18
19void Ym2413_reset( struct Ym2413_Emu* this ) 19void Ym2413_reset( struct Ym2413_Emu* this )
20{ 20{
21 OPLL_reset( &this->opll ); 21 OPLL_reset( &this->opll );
22 OPLL_setMask( &this->opll, 0 ); 22 OPLL_setMask( &this->opll, 0 );
23} 23}
24 24
25void Ym2413_write( struct Ym2413_Emu* this, int addr, int data ) 25void Ym2413_write( struct Ym2413_Emu* this, int addr, int data )
26{ 26{
27 OPLL_writeIO( &this->opll, 0, addr ); 27 OPLL_writeIO( &this->opll, 0, addr );
28 OPLL_writeIO( &this->opll, 1, data ); 28 OPLL_writeIO( &this->opll, 1, data );
29} 29}
30 30
31void Ym2413_mute_voices( struct Ym2413_Emu* this, int mask ) 31void Ym2413_mute_voices( struct Ym2413_Emu* this, int mask )
32{ 32{
33 OPLL_setMask( &this->opll, mask ); 33 OPLL_setMask( &this->opll, mask );
34} 34}
35 35
36void Ym2413_run( struct Ym2413_Emu* this, int pair_count, short* out ) 36void Ym2413_run( struct Ym2413_Emu* this, int pair_count, short* out )
37{ 37{
38 while ( pair_count-- ) 38 while ( pair_count-- )
39 { 39 {
40 int s = OPLL_calc( &this->opll ) << 1; 40 int s = OPLL_calc( &this->opll ) << 1;
41 out [0] = s; 41 out [0] = s;
42 out [1] = s; 42 out [1] = s;
43 out += 2; 43 out += 2;
44 } 44 }
45} 45}