rockbox/apps/codecs/libgme/ym2413_emu.c
Torne Wuff 569285794b Bulk convert all DOS line endings to UNIX.
For the git migration we want a nice clean repository with UNIX line
endings. git does not use svn:eol-style, we just need the file contents to be
sane.

Sorry everybody. I know this messes up blame.

Scumbag *NIX developer says migrating to git will make line ending issues go
away; commits giant change to svn which changes line endings anyway. :)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30924 a1c6a512-1295-4272-9138-f99709370657
2011-11-06 22:44:25 +00:00

45 lines
956 B
C

// Game_Music_Emu 0.5.5. http://www.slack.net/~ant/
#include "ym2413_emu.h"
void Ym2413_init( struct Ym2413_Emu* this )
{
this->last_time = disabled_time; this->out = 0;
}
int Ym2413_set_rate( struct Ym2413_Emu* this, int sample_rate, int clock_rate )
{
OPLL_new ( &this->opll, clock_rate, sample_rate );
OPLL_reset_patch( &this->opll, OPLL_2413_TONE );
Ym2413_reset( this );
return 0;
}
void Ym2413_reset( struct Ym2413_Emu* this )
{
OPLL_reset( &this->opll );
OPLL_setMask( &this->opll, 0 );
}
void Ym2413_write( struct Ym2413_Emu* this, int addr, int data )
{
OPLL_writeIO( &this->opll, 0, addr );
OPLL_writeIO( &this->opll, 1, data );
}
void Ym2413_mute_voices( struct Ym2413_Emu* this, int mask )
{
OPLL_setMask( &this->opll, mask );
}
void Ym2413_run( struct Ym2413_Emu* this, int pair_count, short* out )
{
while ( pair_count-- )
{
int s = OPLL_calc( &this->opll ) << 1;
out [0] = s;
out [1] = s;
out += 2;
}
}