rockbox/lib/rbcodec/codecs/libgme/emuadpcm.h
Sean Bartell f40bfc9267 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>
2012-04-25 22:13:20 +02:00

52 lines
1,021 B
C

#ifndef __Y8950ADPCM_HH__
#define __Y8950ADPCM_HH__
#include "blargg_common.h"
#include "blargg_source.h"
#include "msxtypes.h"
typedef unsigned short word;
typedef unsigned __int64 uint64;
struct Y8950;
struct Y8950Adpcm
{
struct Y8950* y8950;
int sampleRate;
int clockRate;
int ramSize;
int startAddr;
int stopAddr;
int playAddr;
int addrMask;
int memPntr;
bool romBank;
byte* ramBank;
bool playing;
int volume;
word delta;
unsigned int nowStep, step;
int out, output;
int diff;
int nextLeveling;
int sampleStep;
int volumeWStep;
byte reg7;
byte reg15;
};
void ADPCM_init(struct Y8950Adpcm* this_, struct Y8950* y8950, byte* ramBank, int sampleRam);
void ADPCM_reset(struct Y8950Adpcm* this_);
void ADPCM_setSampleRate(struct Y8950Adpcm* this_, int sr, int clk);
bool ADPCM_muted(struct Y8950Adpcm* this_);
void ADPCM_writeReg(struct Y8950Adpcm* this_, byte rg, byte data);
byte ADPCM_readReg(struct Y8950Adpcm* this_, byte rg);
int ADPCM_calcSample(struct Y8950Adpcm* this_);
#endif