unit _MXDRVm_OPMEmu_const;

interface

uses
  SysUtils,Types;

const HT:char=char($09);
const CR:char=char($0d);
const LF:char=char($0a);
const SP:char=char($20);
const CRLF:string=char($0d)+char($0a);

// x68sound.dll

const X68SNDERR_PCMOUT=(-1);
const X68SNDERR_TIMER =(-2);
const X68SNDERR_MEMORY=(-3);
const X68SNDERR_NOTACTIVE=(-4);
const X68SNDERR_ALREADYACTIVE=(-5);
const X68SNDERR_BADARG=(-6);

const X68SNDERR_DLL   =(-1);
const X68SNDERR_FUNC  =(-2);

type
  TX68proc=procedure cdecl export;
  TX68func=function:longword cdecl export;

//int bet=5, pcmbuf=5, late=200; double rev=1.0;
function  X68Sound_Start(samprate,opmflag,adpcmflag,betw,pcmbuf,late:LongInt; rev:double):LongInt; cdecl; external 'X68Sound.dll';
function  X68Sound_Samprate(samprate:LongInt):LongInt; cdecl; external 'X68Sound.dll';
procedure X68Sound_Reset; cdecl; external 'X68Sound.dll';
procedure X68Sound_Free; cdecl; external 'X68Sound.dll';
function  X68Sound_TotalVolume(Volume:LongInt):LongInt; cdecl; external 'X68Sound.dll';

//extern "C" void (*X68Sound_BetwInt)(void (CALLBACK *proc)()=NULL);
procedure X68Sound_BetwInt(proc:TX68proc); cdecl; external 'X68Sound.dll';
//extern "C" void (*X68Sound_WaveFunc)(int (CALLBACK *func)()=NULL);
procedure X68Sound_WaveFunc(proc:TX68func); cdecl; external 'X68Sound.dll';

//int samprate=44100, opmflag=1, adpcmflag=1, pcmbuf=5);
function  X68Sound_StartPcm(samprate,opmflag,adpcmflag,pcmbuf:LongInt):LongInt; cdecl; external 'X68Sound.dll';
function  X68Sound_GetPcm(buf:PByteArray;len:LongInt):LongInt; cdecl; external 'X68Sound.dll';

function  X68Sound_OpmPeek:byte; cdecl; external 'X68Sound.dll';
procedure X68Sound_OpmReg(RegNo:byte); cdecl; external 'X68Sound.dll';
procedure X68Sound_OpmPoke(Data:byte); cdecl; external 'X68Sound.dll';
procedure X68Sound_OpmInt(proc:TX68proc); cdecl; external 'X68Sound.dll';

function  X68Sound_AdpcmPeek:byte; cdecl; external 'X68Sound.dll';
procedure X68Sound_AdpcmPoke(data:byte); cdecl; external 'X68Sound.dll';
function  X68Sound_PpiPeek:byte; cdecl; external 'X68Sound.dll';
procedure X68Sound_PpiPoke(data:byte); cdecl; external 'X68Sound.dll';
procedure X68Sound_PpiCtrl(data:byte); cdecl; external 'X68Sound.dll';
function  X68Sound_DmaPeek(adrs:byte):byte; cdecl; external 'X68Sound.dll';
procedure X68Sound_DmaPoke(adrs,data:byte); cdecl; external 'X68Sound.dll';
procedure X68Sound_DmaInt(proc:TX68proc); cdecl; external 'X68Sound.dll';
procedure X68Sound_DmaErrInt(proc:TX68proc); cdecl; external 'X68Sound.dll';
//procedure X68Sound_MemReadFunc(int (CALLBACK *func)(unsigned char *)=NULL); cdecl; external 'X68Sound.dll';

function X68Sound_Pcm8_Out(ch:LongInt; adrs:PByteArray; mode,len:LongInt):LongInt; cdecl; external 'X68Sound.dll';
function X68Sound_Pcm8_Aot(ch:LongInt; tbl:PByteArray; mode,cnt:LongInt):LongInt; cdecl; external 'X68Sound.dll';
function X68Sound_Pcm8_Lot(ch:LongInt; tbl:PByteArray; mode:LongInt):LongInt; cdecl; external 'X68Sound.dll';
function X68Sound_Pcm8_SetMode(ch:LongInt; mode:LongInt):LongInt; cdecl; external 'X68Sound.dll';
function X68Sound_Pcm8_GetRest(ch:LongInt):LongInt; cdecl; external 'X68Sound.dll';
function X68Sound_Pcm8_GetMode(ch:LongInt):LongInt; cdecl; external 'X68Sound.dll';
function X68Sound_Pcm8_Abort:LongInt; cdecl; external 'X68Sound.dll';

function  X68Sound_ErrorCode:LongInt; cdecl; external 'X68Sound.dll';
function  X68Sound_DebugValue:LongInt; cdecl; external 'X68Sound.dll';

implementation

end.



