REMOVED unused global soundBufferTotalLen
MOVED soundNextPosition from sound core to DirectSound
This commit is contained in:
parent
99d5c6e6df
commit
c2b00fc595
|
@ -70,7 +70,6 @@ u16 soundFinalWave [1470];
|
|||
int soundBufferLen = sizeof soundFinalWave;
|
||||
|
||||
int soundDebug = 0;
|
||||
u32 soundNextPosition = 0;
|
||||
bool soundPaused = true;
|
||||
|
||||
void interp_rate() { /* empty for now */ }
|
||||
|
@ -548,8 +547,6 @@ void soundReset()
|
|||
SOUND_CLOCK_TICKS = SOUND_CLOCK_TICKS_;
|
||||
soundTicks = SOUND_CLOCK_TICKS_;
|
||||
|
||||
soundNextPosition = 0;
|
||||
|
||||
soundEvent( NR52, (u8) 0x80 );
|
||||
}
|
||||
|
||||
|
@ -570,13 +567,11 @@ void soundSetQuality(int quality)
|
|||
{
|
||||
soundShutdown();
|
||||
soundQuality = quality;
|
||||
soundNextPosition = 0;
|
||||
soundInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
soundQuality = quality;
|
||||
soundNextPosition = 0;
|
||||
}
|
||||
|
||||
remake_stereo_buffer();
|
||||
|
|
|
@ -59,8 +59,6 @@ extern int soundInterpolation; // 1 if PCM should have low-pass filtering
|
|||
extern float soundFiltering; // 0.0 = none, 1.0 = max (only if soundInterpolation!=0)
|
||||
|
||||
// Unknown purpose
|
||||
extern int soundBufferTotalLen;
|
||||
extern u32 soundNextPosition;
|
||||
extern bool soundPaused;
|
||||
|
||||
#endif // VBA_SOUND_H
|
||||
|
|
|
@ -41,7 +41,6 @@ extern int soundQuality;
|
|||
extern bool soundPaused;
|
||||
extern int soundTicks;
|
||||
extern int SOUND_CLOCK_TICKS;
|
||||
extern u32 soundNextPosition;
|
||||
|
||||
int const ticks_to_time = 2 * GB_APU_OVERCLOCK;
|
||||
|
||||
|
@ -189,7 +188,6 @@ void gbSoundReset()
|
|||
reset_apu();
|
||||
|
||||
soundPaused = 1;
|
||||
soundNextPosition = 0;
|
||||
|
||||
gbSoundEvent(0xff10, 0x80);
|
||||
gbSoundEvent(0xff11, 0xbf);
|
||||
|
@ -235,13 +233,11 @@ void gbSoundSetQuality(int quality)
|
|||
{
|
||||
soundShutdown();
|
||||
soundQuality = quality;
|
||||
soundNextPosition = 0;
|
||||
soundInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
soundQuality = quality;
|
||||
soundNextPosition = 0;
|
||||
}
|
||||
|
||||
remake_stereo_buffer();
|
||||
|
|
|
@ -47,6 +47,7 @@ private:
|
|||
HANDLE dsbEvent;
|
||||
WAVEFORMATEX wfx; // Primary buffer wave format
|
||||
int soundBufferTotalLen;
|
||||
unsigned int soundNextPosition;
|
||||
|
||||
public:
|
||||
DirectSound();
|
||||
|
@ -69,6 +70,7 @@ DirectSound::DirectSound()
|
|||
dsbEvent = NULL;
|
||||
|
||||
soundBufferTotalLen = 14700;
|
||||
soundNextPosition = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,6 +146,7 @@ bool DirectSound::init()
|
|||
// then multiply it with the size of a sample frame (16 bit * stereo)
|
||||
soundBufferLen = ( freq / 60 ) * 4;
|
||||
soundBufferTotalLen = soundBufferLen * 10;
|
||||
soundNextPosition = 0;
|
||||
|
||||
ZeroMemory( &wfx, sizeof(WAVEFORMATEX) );
|
||||
wfx.wFormatTag = WAVE_FORMAT_PCM;
|
||||
|
@ -227,6 +230,8 @@ void DirectSound::reset()
|
|||
dsbSecondary->Stop();
|
||||
|
||||
dsbSecondary->SetCurrentPosition( 0 );
|
||||
|
||||
soundNextPosition = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue