Commit 828234f0 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Simplify sound functions

parent 4ae0a700
......@@ -754,23 +754,23 @@ static sscpu_timestamp_t MidSync(const sscpu_timestamp_t timestamp)
{
if(AllowMidSync)
{
//
// Don't call SOUND_Update() here, it's not necessary and will subtly alter emulation behavior from the perspective of the emulated program
// (which is not a problem in and of itself, but it's preferable to keep settings from altering emulation behavior when they don't need to).
//
//printf("MidSync: %d\n", VDP2::PeekLine());
{
espec->SoundBufSize += SOUND_FlushOutput(NULL, espec->SoundBufMaxSize - espec->SoundBufSize, false);
espec->MasterCycles = timestamp * cur_clock_div;
}
//printf("%d\n", espec->SoundBufSize);
//
//
//MDFN_MidSync(espec);
//
//
SMPC_UpdateInput();
AllowMidSync = false;
//
// Don't call SOUND_Update() here, it's not necessary and will subtly alter emulation behavior from the perspective of the emulated program
// (which is not a problem in and of itself, but it's preferable to keep settings from altering emulation behavior when they don't need to).
//
//printf("MidSync: %d\n", VDP2::PeekLine());
{
espec->SoundBufSize += SOUND_FlushOutput();
espec->MasterCycles = timestamp * cur_clock_div;
}
//printf("%d\n", espec->SoundBufSize);
//
//
//MDFN_MidSync(espec);
//
//
SMPC_UpdateInput();
AllowMidSync = false;
}
return SS_EVENT_DISABLED_TS;
......@@ -787,7 +787,6 @@ static void Emulate(EmulateSpecStruct* espec_arg)
cur_clock_div = SMPC_StartFrame(espec);
SMPC_UpdateInput();
VDP2::StartFrame(espec, cur_clock_div == 61);
SOUND_StartFrame(espec->SoundRate / espec->soundmultiplier, MDFN_GetSettingUI("ss.scsp.resamp_quality"));
espec->SoundBufSize = 0;
espec->MasterCycles = 0;
espec->soundmultiplier = 1;
......@@ -828,7 +827,7 @@ static void Emulate(EmulateSpecStruct* espec_arg)
//
//
espec->MasterCycles = end_ts * cur_clock_div;
espec->SoundBufSize += SOUND_FlushOutput(NULL, espec->SoundBufMaxSize - espec->SoundBufSize, espec->NeedSoundReverse);
espec->SoundBufSize += SOUND_FlushOutput();
espec->NeedSoundReverse = false;
//
//
......
......@@ -220,11 +220,7 @@ sscpu_timestamp_t SOUND_Update(sscpu_timestamp_t timestamp)
return timestamp + 128; // FIXME
}
void SOUND_StartFrame(double rate, uint32 quality)
{
}
int32 SOUND_FlushOutput(int16* SoundBuf, const int32 SoundBufMaxSize, const bool reverse)
int32 SOUND_FlushOutput(void)
{
int32 ret = IBufferCount;
......
......@@ -36,8 +36,7 @@ void SOUND_Reset68K(void);
void SOUND_SetClockRatio(uint32 ratio); // Ratio between SH-2 clock and 68K clock (sound clock / 2)
sscpu_timestamp_t SOUND_Update(sscpu_timestamp_t timestamp);
void SOUND_ResetTS(void);
void SOUND_StartFrame(double rate, uint32 quality);
int32 SOUND_FlushOutput(int16* SoundBuf, const int32 SoundBufMaxSize, const bool reverse);
int32 SOUND_FlushOutput(void);
void SOUND_StateAction(StateMem *sm, const unsigned load, const bool data_only);
uint16 SOUND_Read16(uint32 A);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment