--- hatari/src/includes/sound.h 2019/04/01 07:10:02 1.1.1.3 +++ hatari/src/includes/sound.h 2019/04/01 07:10:37 1.1.1.4 @@ -1,5 +1,8 @@ /* - Hatari + Hatari - sound.h + + 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. */ #ifndef HATARI_SOUND_H @@ -7,23 +10,26 @@ /* Envelope shape table */ -typedef struct { - int WaveStart[4],WaveDelta[4]; +typedef struct +{ + int WaveStart[4], WaveDelta[4]; } ENVSHAPE; -#define MIXBUFFER_SIZE 4096 /* Size of circular buffer to store sample to (44Khz) */ -#define MIXBUFFER_LENGTH (MIXBUFFER_SIZE-1) +#define MIXBUFFER_SIZE 8192 /* Size of circular buffer to store sample to (44Khz) */ #define SAMPLES_BUFFER_SIZE 1024 -#define SAMPLES_PER_FRAME SoundPlayBackFreqFrameLengths[OutputAudioFreqIndex][0] /* Number of generated samples per frame(eg 44Khz=882) */ -#define SAMPLES_FREQ (SAMPLES_PER_FRAME*50) /* Frequency of generated samples */ +/* Number of generated samples per frame (eg. 44Khz=882) : */ +#define SAMPLES_PER_FRAME ((SoundPlayBackFrequencies[OutputAudioFreqIndex]+25)/50) +/* Frequency of generated samples: */ +#define SAMPLES_FREQ (SoundPlayBackFrequencies[OutputAudioFreqIndex]) #define YM_FREQ (2000000/SAMPLES_FREQ) /* YM Frequency 2Mhz */ extern BOOL bWriteEnvelopeFreq,bWriteChannelAAmp,bWriteChannelBAmp,bWriteChannelCAmp; extern BOOL bEnvelopeFreqFlag; +extern char MixBuffer[MIXBUFFER_SIZE]; extern int SoundCycles; - +extern int nGeneratedSamples; extern void Sound_Init(void); extern void Sound_Reset(void); @@ -33,7 +39,6 @@ extern void Sound_CreateLogTables(void); extern void Sound_CreateEnvelopeShapes(void); extern void Sound_CreateSoundMixClipTable(void); extern void Sound_GenerateYMFrameSamples(void); -extern void Sound_PassYMSamplesToAudio(void); extern void Sound_UpdateHBL(void); extern void Sound_Update(void); extern void Sound_Update_VBL(void);