--- hatari/src/includes/sound.h 2019/04/01 07:10:56 1.1.1.5 +++ hatari/src/includes/sound.h 2019/04/09 08:48:42 1.1.1.10 @@ -3,39 +3,59 @@ This file is distributed under the GNU Public License, version 2 or at your option any later version. Read the file gpl.txt for details. + + Matthias Arndt 2008-08-15 + - cleanup to have definitions and declarations for both sound cores in one place */ #ifndef HATARI_SOUND_H #define HATARI_SOUND_H -/* Envelope shape table */ -typedef struct -{ - int WaveStart[4], WaveDelta[4]; -} ENVSHAPE; - -#define MIXBUFFER_SIZE 8192 /* Size of circular buffer to store sample to (44Khz) */ +/* definitions common for all sound rendering engines */ +#define MIXBUFFER_SIZE 16384 /* Size of circular buffer to store sample to (44Khz) */ -extern BOOL bWriteEnvelopeFreq,bWriteChannelAAmp,bWriteChannelBAmp,bWriteChannelCAmp; -extern BOOL bEnvelopeFreqFlag; -extern char MixBuffer[MIXBUFFER_SIZE]; -extern int SoundCycles; -extern int nGeneratedSamples; +extern Uint8 SoundRegs[ 14 ]; /* store YM regs 0 to 13 */ +extern int nGeneratedSamples; +extern bool bEnvelopeFreqFlag; +extern Sint16 MixBuffer[MIXBUFFER_SIZE][2]; + +/* STSound sound renderer active */ +#include + + +/* Internal data types */ + +typedef Sint64 yms64; + +typedef Sint8 yms8; +typedef Sint16 yms16; +typedef Sint32 yms32; + +typedef Uint8 ymu8; +typedef Uint16 ymu16; +typedef Uint32 ymu32; + +typedef yms16 ymsample; /* Output samples are mono 16bits signed PCM */ + + +#define YM_LINEAR_MIXING 1 /* Use ymout1c5bit[] to build ymout5[] */ +#define YM_TABLE_MIXING 2 /* Use volumetable_original to build ymout5[] */ + +extern int YmVolumeMixing; +extern bool UseLowPassFilter; extern void Sound_Init(void); extern void Sound_Reset(void); -extern void Sound_ClearMixBuffer(void); -extern void Sound_MemorySnapShot_Capture(BOOL bSave); -extern void Sound_CreateLogTables(void); -extern void Sound_CreateEnvelopeShapes(void); -extern void Sound_CreateSoundMixClipTable(void); +extern void Sound_ResetBufferIndex(void); +extern void Sound_MemorySnapShot_Capture(bool bSave); extern void Sound_Update(void); extern void Sound_Update_VBL(void); -extern void Sound_UpdateFromAudioCallBack(void); -extern BOOL Sound_BeginRecording(char *pszCaptureFileName); -extern void Sound_EndRecording(); -extern BOOL Sound_AreWeRecording(void); +extern void Sound_WriteReg( int reg , Uint8 data ); +extern bool Sound_BeginRecording(char *pszCaptureFileName); +extern void Sound_EndRecording(void); +extern bool Sound_AreWeRecording(void); + #endif /* HATARI_SOUND_H */