rockbox/apps/codecs/libgme/opl_apu.h
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

63 lines
1.6 KiB
C

#ifndef OPL_APU_H
#define OPL_APU_H
#include "blargg_common.h"
#include "blargg_source.h"
#include "blip_buffer.h"
#include "emu8950.h"
#include "emu2413.h"
enum opl_type_t { type_opll = 0x10, type_msxmusic = 0x11, type_smsfmunit = 0x12,
type_vrc7 = 0x13, type_msxaudio = 0x21 };
enum { opl_osc_count = 1 };
struct Opl_Apu {
struct Blip_Buffer* output_;
enum opl_type_t type_;
blip_time_t next_time;
int last_amp;
int addr;
long clock_;
long rate_;
blip_time_t period_;
struct Blip_Synth synth;
// OPL chips
struct Y8950 opl;
OPLL opll;
unsigned char regs[ 0x100 ];
unsigned char opl_memory[ 32768 ];
};
blargg_err_t Opl_init( struct Opl_Apu* this, long clock, long rate, blip_time_t period, enum opl_type_t type );
void Opl_shutdown( struct Opl_Apu* this );
void Opl_reset( struct Opl_Apu* this );
static inline void Opl_volume( struct Opl_Apu* this, int v ) { Synth_volume( &this->synth, v / (4096 * 6) ); }
static inline void Opl_osc_output( struct Opl_Apu* this, int i, struct Blip_Buffer* buf )
{
#if defined(ROCKBOX)
(void) i;
#endif
assert( (unsigned) i < opl_osc_count );
this->output_ = buf;
}
static inline void Opl_set_output( struct Opl_Apu* this, struct Blip_Buffer* buf ) { Opl_osc_output( this, 0, buf ); }
void Opl_end_frame( struct Opl_Apu* this, blip_time_t );
static inline void Opl_write_addr( struct Opl_Apu* this, int data ) { this->addr = data; }
void Opl_write_data( struct Opl_Apu* this, blip_time_t, int data );
int Opl_read( struct Opl_Apu* this, blip_time_t, int port );
static inline bool Opl_supported( void ) { return true; }
#endif