Update Project64-Audio
This commit is contained in:
parent
25bd63cc9b
commit
5d80fdaaa4
|
@ -33,12 +33,15 @@
|
||||||
void SetTimerResolution ( void );
|
void SetTimerResolution ( void );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ENDIAN_SWAP_BYTE (~0 & 0x7 & 3)
|
||||||
|
#define BES(address) ((address) ^ ENDIAN_SWAP_BYTE)
|
||||||
|
|
||||||
/* Read header for type definition */
|
/* Read header for type definition */
|
||||||
AUDIO_INFO g_AudioInfo;
|
AUDIO_INFO g_AudioInfo;
|
||||||
|
|
||||||
bool g_PluginInit = false;
|
bool g_PluginInit = false;
|
||||||
bool g_romopen = false;
|
bool g_romopen = false;
|
||||||
uint32_t g_Dacrate = 0;
|
uint32_t g_Dacrate = 0, hack = 0;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
DirectSoundDriver * g_SoundDriver = NULL;
|
DirectSoundDriver * g_SoundDriver = NULL;
|
||||||
|
@ -89,37 +92,49 @@ EXPORT void CALL AiDacrateChanged(int SystemType)
|
||||||
WriteTrace(TraceAudioInterface, TraceNotice, "Unknown/reserved bits in AI_DACRATE_REG set. 0x%08X", *g_AudioInfo.AI_DACRATE_REG);
|
WriteTrace(TraceAudioInterface, TraceNotice, "Unknown/reserved bits in AI_DACRATE_REG set. 0x%08X", *g_AudioInfo.AI_DACRATE_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t video_clock = 0; int32_t BufferSize = 0;
|
uint32_t video_clock = 0, BufferSize = 0, Frequency = 0, divider = 0;
|
||||||
double audio_clock = 0; double framerate = (30 / 1.001);
|
|
||||||
|
|
||||||
switch (SystemType)
|
switch (SystemType)
|
||||||
{
|
{
|
||||||
case SYSTEM_NTSC: video_clock = 48681812; break;
|
case SYSTEM_NTSC: video_clock = 48681812; break;
|
||||||
case SYSTEM_PAL: video_clock = 49656530; framerate = 25; break;
|
case SYSTEM_PAL: video_clock = 49656530; break;
|
||||||
case SYSTEM_MPAL: video_clock = 48628316; break;
|
case SYSTEM_MPAL: video_clock = 48628316; break;
|
||||||
}
|
}
|
||||||
uint32_t Frequency = (video_clock / (g_Dacrate + 1));
|
|
||||||
|
|
||||||
if (Frequency < 4000)
|
Frequency = (video_clock / (g_Dacrate + 1));
|
||||||
|
|
||||||
|
if (Frequency < 8000)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceAudioDriver, TraceDebug, "Not Audio Data!");
|
WriteTrace(TraceAudioDriver, TraceDebug, "Not Audio Data!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
switch (g_settings->GetBuffer())
|
||||||
{
|
{
|
||||||
if (g_settings->FPSBuffer() == false && SystemType != SYSTEM_PAL)
|
case 1: divider = 50; break;
|
||||||
{
|
case 2: divider = 45; break;
|
||||||
framerate = 30.475; // Needed for Body Harvest (U)
|
case 3: divider = 40; break;
|
||||||
|
case 4: divider = 30; break;
|
||||||
|
case 5: divider = 25; break;
|
||||||
|
case 6: divider = 20; break;
|
||||||
|
case 7: divider = 15; break;
|
||||||
}
|
}
|
||||||
if (g_settings->TinyBuffer() == false)
|
|
||||||
|
BufferSize = ((Frequency / divider) + (int32_t)2.49 & ~0x3);
|
||||||
|
|
||||||
|
if (hack == 'BH' && SystemType != SYSTEM_PAL) BufferSize -= 16;
|
||||||
|
|
||||||
|
if (g_settings->RoundFreq())
|
||||||
{
|
{
|
||||||
framerate = (framerate / 2);
|
Frequency = ((Frequency / 25) + 1) * 25;
|
||||||
}
|
}
|
||||||
audio_clock = (video_clock / framerate);
|
WriteTrace(TraceAudioDriver, TraceInfo, "Frequency = %d", Frequency);
|
||||||
BufferSize = (int32_t)(audio_clock / (g_Dacrate + 1)) + 1 & ~0x1;
|
WriteTrace(TraceAudioDriver, TraceInfo, "Divider = %.3f", (double)divider);
|
||||||
|
WriteTrace(TraceAudioDriver, TraceInfo, "Buffer = %d", g_settings->GetBuffer());
|
||||||
|
WriteTrace(TraceAudioDriver, TraceInfo, "Buffer Size = %d", BufferSize);
|
||||||
|
|
||||||
g_SoundDriver->AI_SetFrequency(Frequency, BufferSize);
|
g_SoundDriver->AI_SetFrequency(Frequency, BufferSize);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
WriteTrace(TraceAudioInterface, TraceDebug, "Done");
|
WriteTrace(TraceAudioInterface, TraceDebug, "Done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,6 +239,11 @@ EXPORT int32_t CALL InitiateAudio(AUDIO_INFO Audio_Info)
|
||||||
#else
|
#else
|
||||||
g_SoundDriver = new OpenSLESDriver;
|
g_SoundDriver = new OpenSLESDriver;
|
||||||
#endif
|
#endif
|
||||||
|
const uint16_t cart_ID = 0x0000
|
||||||
|
| (g_AudioInfo.HEADER[BES(0x3C)] << 8)
|
||||||
|
| (g_AudioInfo.HEADER[BES(0x3D)] << 0)
|
||||||
|
;
|
||||||
|
hack = cart_ID;
|
||||||
WriteTrace(TraceAudioInterface, TraceDebug, "Done (res: true)");
|
WriteTrace(TraceAudioInterface, TraceDebug, "Done (res: true)");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,8 @@ CSettings::CSettings() :
|
||||||
m_advanced_options(false),
|
m_advanced_options(false),
|
||||||
m_debugger_enabled(false),
|
m_debugger_enabled(false),
|
||||||
m_Volume(100),
|
m_Volume(100),
|
||||||
m_TinyBuffer(true),
|
m_Buffer(4),
|
||||||
m_FPSBuffer(true),
|
m_RoundFreq(false),
|
||||||
m_FixedAudio(false),
|
m_FixedAudio(false),
|
||||||
m_SyncAudio(false),
|
m_SyncAudio(false),
|
||||||
m_FullSpeed(true)
|
m_FullSpeed(true)
|
||||||
|
@ -50,6 +50,8 @@ CSettings::CSettings() :
|
||||||
if (m_Set_FullSpeed != 0) { SettingsRegisterChange(true, m_Set_FullSpeed, this, stSettingsChanged); }
|
if (m_Set_FullSpeed != 0) { SettingsRegisterChange(true, m_Set_FullSpeed, this, stSettingsChanged); }
|
||||||
if (m_Set_LimitFPS != 0) { SettingsRegisterChange(true, m_Set_LimitFPS, this, stSettingsChanged); }
|
if (m_Set_LimitFPS != 0) { SettingsRegisterChange(true, m_Set_LimitFPS, this, stSettingsChanged); }
|
||||||
SettingsRegisterChange(false, Set_Volume, this, stSettingsChanged);
|
SettingsRegisterChange(false, Set_Volume, this, stSettingsChanged);
|
||||||
|
SettingsRegisterChange(false, Set_Buffer, this, stSettingsChanged);
|
||||||
|
SettingsRegisterChange(false, Set_RoundFreq, this, stSettingsChanged);
|
||||||
|
|
||||||
SettingsRegisterChange(false, Set_Logging_MD5, this, stLogLevelChanged);
|
SettingsRegisterChange(false, Set_Logging_MD5, this, stLogLevelChanged);
|
||||||
SettingsRegisterChange(false, Set_Logging_Thread, this, stLogLevelChanged);
|
SettingsRegisterChange(false, Set_Logging_Thread, this, stLogLevelChanged);
|
||||||
|
@ -70,6 +72,8 @@ CSettings::~CSettings()
|
||||||
if (m_Set_FullSpeed != 0) { SettingsUnregisterChange(true, m_Set_FullSpeed, this, stSettingsChanged); }
|
if (m_Set_FullSpeed != 0) { SettingsUnregisterChange(true, m_Set_FullSpeed, this, stSettingsChanged); }
|
||||||
if (m_Set_LimitFPS != 0) { SettingsUnregisterChange(true, m_Set_LimitFPS, this, stSettingsChanged); }
|
if (m_Set_LimitFPS != 0) { SettingsUnregisterChange(true, m_Set_LimitFPS, this, stSettingsChanged); }
|
||||||
SettingsUnregisterChange(false, Set_Volume, this, stSettingsChanged);
|
SettingsUnregisterChange(false, Set_Volume, this, stSettingsChanged);
|
||||||
|
SettingsUnregisterChange(false, Set_Buffer, this, stSettingsChanged);
|
||||||
|
SettingsUnregisterChange(false, Set_RoundFreq, this, stSettingsChanged);
|
||||||
|
|
||||||
SettingsUnregisterChange(false, Set_Logging_MD5, this, stLogLevelChanged);
|
SettingsUnregisterChange(false, Set_Logging_MD5, this, stLogLevelChanged);
|
||||||
SettingsUnregisterChange(false, Set_Logging_Thread, this, stLogLevelChanged);
|
SettingsUnregisterChange(false, Set_Logging_Thread, this, stLogLevelChanged);
|
||||||
|
@ -101,8 +105,8 @@ void CSettings::RegisterSettings(void)
|
||||||
RegisterSetting(Set_Logging_InitShutdown, Data_DWORD_General, "InitShutdown", "Logging", g_ModuleLogLevel[TraceAudioInitShutdown], NULL);
|
RegisterSetting(Set_Logging_InitShutdown, Data_DWORD_General, "InitShutdown", "Logging", g_ModuleLogLevel[TraceAudioInitShutdown], NULL);
|
||||||
RegisterSetting(Set_Logging_Interface, Data_DWORD_General, "Interface", "Logging", g_ModuleLogLevel[TraceAudioInterface], NULL);
|
RegisterSetting(Set_Logging_Interface, Data_DWORD_General, "Interface", "Logging", g_ModuleLogLevel[TraceAudioInterface], NULL);
|
||||||
RegisterSetting(Set_Logging_Driver, Data_DWORD_General, "Driver", "Logging", g_ModuleLogLevel[TraceAudioDriver], NULL);
|
RegisterSetting(Set_Logging_Driver, Data_DWORD_General, "Driver", "Logging", g_ModuleLogLevel[TraceAudioDriver], NULL);
|
||||||
RegisterSetting(Set_TinyBuffer, Data_DWORD_Game, "TinyBuffer", "", (bool)true, NULL);
|
RegisterSetting(Set_RoundFreq, Data_DWORD_General, "RoundFrequency", "Settings", (bool)false, NULL);
|
||||||
RegisterSetting(Set_FPSBuffer, Data_DWORD_Game, "FPSBuffer", "", (bool)true, NULL);
|
RegisterSetting(Set_Buffer, Data_DWORD_Game, "Buffer", "", 4, NULL);
|
||||||
LogLevelChanged();
|
LogLevelChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,14 +134,14 @@ void CSettings::SetVolume(uint32_t Volume)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettings::SetTinyBuffer(bool TinyBuffer)
|
void CSettings::SetBuffer(uint32_t Buffer)
|
||||||
{
|
{
|
||||||
SetSetting(Set_TinyBuffer, TinyBuffer ? 1 : 0);
|
SetSetting(Set_Buffer, Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettings::SetFPSBuffer(bool FPSBuffer)
|
void CSettings::SetRoundFreq(bool RoundFreq)
|
||||||
{
|
{
|
||||||
SetSetting(Set_FPSBuffer, FPSBuffer ? 1 : 0);
|
SetSetting(Set_RoundFreq, RoundFreq ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettings::LogLevelChanged(void)
|
void CSettings::LogLevelChanged(void)
|
||||||
|
@ -153,15 +157,14 @@ void CSettings::LogLevelChanged(void)
|
||||||
void CSettings::ReadSettings(void)
|
void CSettings::ReadSettings(void)
|
||||||
{
|
{
|
||||||
bool bLimitFPS = m_Set_LimitFPS ? GetSystemSetting(m_Set_LimitFPS) != 0 : true;
|
bool bLimitFPS = m_Set_LimitFPS ? GetSystemSetting(m_Set_LimitFPS) != 0 : true;
|
||||||
|
|
||||||
m_Volume = GetSetting(Set_Volume);
|
m_Volume = GetSetting(Set_Volume);
|
||||||
m_AudioEnabled = m_Set_EnableAudio ? GetSystemSetting(m_Set_EnableAudio) != 0 : true;
|
m_AudioEnabled = m_Set_EnableAudio ? GetSystemSetting(m_Set_EnableAudio) != 0 : true;
|
||||||
m_advanced_options = m_Set_basic_mode ? GetSystemSetting(m_Set_basic_mode) == 0 : false;
|
m_advanced_options = m_Set_basic_mode ? GetSystemSetting(m_Set_basic_mode) == 0 : false;
|
||||||
m_debugger_enabled = m_advanced_options && m_Set_debugger ? GetSystemSetting(m_Set_debugger) == 1 : false;
|
m_debugger_enabled = m_advanced_options && m_Set_debugger ? GetSystemSetting(m_Set_debugger) == 1 : false;
|
||||||
m_TinyBuffer = GetSetting(Set_TinyBuffer) != 0;
|
m_RoundFreq = GetSetting(Set_RoundFreq) != 0;
|
||||||
m_FPSBuffer = GetSetting(Set_FPSBuffer) != 0;
|
m_Buffer = GetSetting(Set_Buffer);
|
||||||
m_FullSpeed = m_Set_FullSpeed ? GetSystemSetting(m_Set_FullSpeed) != 0 : false;
|
m_FullSpeed = m_Set_FullSpeed ? GetSystemSetting(m_Set_FullSpeed) != 0 : false;
|
||||||
|
m_FixedAudio = m_Set_FixedAudio ? GetSystemSetting(m_Set_FixedAudio) != 0 : false;
|
||||||
m_SyncAudio = (!m_advanced_options || bLimitFPS);
|
m_SyncAudio = (!m_advanced_options || bLimitFPS);
|
||||||
|
|
||||||
if (m_Set_log_dir != 0)
|
if (m_Set_log_dir != 0)
|
||||||
|
|
|
@ -19,8 +19,9 @@ public:
|
||||||
inline bool AudioEnabled(void) const { return m_AudioEnabled; }
|
inline bool AudioEnabled(void) const { return m_AudioEnabled; }
|
||||||
inline bool debugger_enabled(void) const { return m_debugger_enabled; }
|
inline bool debugger_enabled(void) const { return m_debugger_enabled; }
|
||||||
inline uint32_t GetVolume(void) const { return m_Volume; }
|
inline uint32_t GetVolume(void) const { return m_Volume; }
|
||||||
inline bool TinyBuffer(void) const { return m_TinyBuffer; }
|
inline uint32_t GetBuffer(void) const { return m_Buffer; }
|
||||||
inline bool FPSBuffer(void) const { return m_FPSBuffer; }
|
inline bool RoundFreq(void) const { return m_RoundFreq; }
|
||||||
|
inline bool FixedAudio(void) const { return m_FixedAudio; }
|
||||||
inline bool SyncAudio(void) const { return m_SyncAudio; }
|
inline bool SyncAudio(void) const { return m_SyncAudio; }
|
||||||
inline bool FullSpeed(void) const { return m_FullSpeed; }
|
inline bool FullSpeed(void) const { return m_FullSpeed; }
|
||||||
inline bool FlushLogs(void) const { return m_FlushLogs; }
|
inline bool FlushLogs(void) const { return m_FlushLogs; }
|
||||||
|
@ -29,8 +30,8 @@ public:
|
||||||
void SetSyncViaAudioEnabled(bool Enabled);
|
void SetSyncViaAudioEnabled(bool Enabled);
|
||||||
void SetAudioEnabled(bool Enabled);
|
void SetAudioEnabled(bool Enabled);
|
||||||
void SetVolume(uint32_t Volume);
|
void SetVolume(uint32_t Volume);
|
||||||
void SetTinyBuffer(bool TinyBuffer);
|
void SetBuffer(uint32_t Buffer);
|
||||||
void SetFPSBuffer(bool FPSBuffer);
|
void SetRoundFreq(bool RoundFreq);
|
||||||
void ReadSettings();
|
void ReadSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -62,8 +63,8 @@ private:
|
||||||
bool m_advanced_options;
|
bool m_advanced_options;
|
||||||
bool m_debugger_enabled;
|
bool m_debugger_enabled;
|
||||||
uint32_t m_Volume;
|
uint32_t m_Volume;
|
||||||
bool m_TinyBuffer;
|
uint32_t m_Buffer;
|
||||||
bool m_FPSBuffer;
|
bool m_RoundFreq;
|
||||||
bool m_FixedAudio;
|
bool m_FixedAudio;
|
||||||
bool m_SyncAudio;
|
bool m_SyncAudio;
|
||||||
bool m_FullSpeed;
|
bool m_FullSpeed;
|
||||||
|
|
|
@ -54,6 +54,7 @@ public:
|
||||||
BEGIN_MSG_MAP(CDebugSettings)
|
BEGIN_MSG_MAP(CDebugSettings)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_MUTE, ItemChanged)
|
COMMAND_ID_HANDLER_EX(IDC_MUTE, ItemChanged)
|
||||||
|
COMMAND_ID_HANDLER_EX(IDC_ROUND, ItemChanged)
|
||||||
NOTIFY_HANDLER_EX(IDC_VOLUME, NM_RELEASEDCAPTURE, ItemChangedNotify);
|
NOTIFY_HANDLER_EX(IDC_VOLUME, NM_RELEASEDCAPTURE, ItemChangedNotify);
|
||||||
CHAIN_MSG_MAP(CPropertyPageImpl<CGeneralSettings>)
|
CHAIN_MSG_MAP(CPropertyPageImpl<CGeneralSettings>)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
@ -68,6 +69,8 @@ public:
|
||||||
m_Volume.SetTicFreq(20);
|
m_Volume.SetTicFreq(20);
|
||||||
m_Volume.SetRangeMin(0);
|
m_Volume.SetRangeMin(0);
|
||||||
m_Volume.SetRangeMax(100);
|
m_Volume.SetRangeMax(100);
|
||||||
|
m_btnRound.Attach(GetDlgItem(IDC_ROUND));
|
||||||
|
m_btnRound.SetCheck(g_settings->RoundFreq() ? BST_CHECKED : BST_UNCHECKED);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +78,7 @@ public:
|
||||||
{
|
{
|
||||||
g_settings->SetAudioEnabled(m_btnMute.GetCheck() != BST_CHECKED);
|
g_settings->SetAudioEnabled(m_btnMute.GetCheck() != BST_CHECKED);
|
||||||
g_settings->SetVolume(100 - m_Volume.GetPos());
|
g_settings->SetVolume(100 - m_Volume.GetPos());
|
||||||
|
g_settings->SetRoundFreq(m_btnRound.GetCheck() == BST_CHECKED);
|
||||||
FlushSettings();
|
FlushSettings();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -89,10 +93,12 @@ private:
|
||||||
void ItemChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
void ItemChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
||||||
{
|
{
|
||||||
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
|
g_settings->SetRoundFreq(m_btnRound.GetCheck() == BST_CHECKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTrackBarCtrl m_Volume;
|
CTrackBarCtrl m_Volume;
|
||||||
CButton m_btnMute;
|
CButton m_btnMute;
|
||||||
|
CButton m_btnRound;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CGameSettings :
|
class CGameSettings :
|
||||||
|
@ -103,37 +109,40 @@ public:
|
||||||
|
|
||||||
BEGIN_MSG_MAP(CDebugSettings)
|
BEGIN_MSG_MAP(CDebugSettings)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_TINYBUFFER, ItemChanged)
|
NOTIFY_HANDLER_EX(IDC_BUFFER, NM_RELEASEDCAPTURE, ItemChangedNotify);
|
||||||
COMMAND_ID_HANDLER_EX(IDC_FPSBUFFER, ItemChanged)
|
|
||||||
CHAIN_MSG_MAP(CPropertyPageImpl<CGameSettings>)
|
CHAIN_MSG_MAP(CPropertyPageImpl<CGameSettings>)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||||
{
|
{
|
||||||
m_btnTinyBuffer.Attach(GetDlgItem(IDC_TINYBUFFER));
|
m_Buffer.Attach(GetDlgItem(IDC_BUFFER));
|
||||||
m_btnTinyBuffer.SetCheck(g_settings->TinyBuffer() ? BST_CHECKED : BST_UNCHECKED);
|
m_Buffer.SetTicFreq(1);
|
||||||
m_btnFPSBuffer.Attach(GetDlgItem(IDC_FPSBUFFER));
|
m_Buffer.SetRangeMin(1);
|
||||||
m_btnFPSBuffer.SetCheck(g_settings->FPSBuffer() ? BST_CHECKED : BST_UNCHECKED);
|
m_Buffer.SetRangeMax(7);
|
||||||
|
m_Buffer.SetPos(g_settings->GetBuffer());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnApply()
|
bool OnApply()
|
||||||
{
|
{
|
||||||
g_settings->SetTinyBuffer(m_btnTinyBuffer.GetCheck() == BST_CHECKED);
|
g_settings->SetBuffer(m_Buffer.GetPos());
|
||||||
g_settings->SetFPSBuffer(m_btnFPSBuffer.GetCheck() == BST_CHECKED);
|
|
||||||
FlushSettings();
|
FlushSettings();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CButton m_btnTinyBuffer;
|
CTrackBarCtrl m_Buffer;
|
||||||
CButton m_btnFPSBuffer;
|
|
||||||
|
|
||||||
void ItemChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
void ItemChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
||||||
{
|
{
|
||||||
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
g_settings->SetTinyBuffer(m_btnTinyBuffer.GetCheck() == BST_CHECKED);
|
}
|
||||||
g_settings->SetFPSBuffer(m_btnFPSBuffer.GetCheck() == BST_CHECKED);
|
|
||||||
|
LRESULT ItemChangedNotify(NMHDR* /*pNMHDR*/)
|
||||||
|
{
|
||||||
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
|
g_settings->SetBuffer(m_Buffer.GetPos());
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ void DirectSoundDriver::SetFrequency(uint32_t Frequency, uint32_t BufferSize)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceAudioDriver, TraceDebug, "Start (Frequency: 0x%08X)", Frequency);
|
WriteTrace(TraceAudioDriver, TraceDebug, "Start (Frequency: 0x%08X)", Frequency);
|
||||||
StopAudio();
|
StopAudio();
|
||||||
m_LOCK_SIZE = (BufferSize * 2);
|
m_LOCK_SIZE = (BufferSize * 4);
|
||||||
SetSegmentSize(m_LOCK_SIZE, Frequency);
|
SetSegmentSize(m_LOCK_SIZE, Frequency);
|
||||||
|
|
||||||
StartAudio();
|
StartAudio();
|
||||||
|
|
|
@ -37,12 +37,7 @@ bool SoundDriverBase::Initialize()
|
||||||
void SoundDriverBase::AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize)
|
void SoundDriverBase::AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize)
|
||||||
{
|
{
|
||||||
SetFrequency(Frequency, BufferSize);
|
SetFrequency(Frequency, BufferSize);
|
||||||
m_MaxBufferSize = (BufferSize * 4);
|
m_MaxBufferSize = (BufferSize * 8);
|
||||||
if (g_settings->TinyBuffer() == true)
|
|
||||||
{
|
|
||||||
m_MaxBufferSize = m_MaxBufferSize * 2;
|
|
||||||
}
|
|
||||||
m_BufferRemaining = 0;
|
|
||||||
m_CurrentReadLoc = m_CurrentWriteLoc = m_BufferRemaining = 0;
|
m_CurrentReadLoc = m_CurrentWriteLoc = m_BufferRemaining = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -58,6 +59,7 @@ BEGIN
|
||||||
CONTROL "",IDC_VOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_VERT | TBS_BOTH | WS_BORDER | WS_TABSTOP,8,14,32,67,WS_EX_STATICEDGE
|
CONTROL "",IDC_VOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_VERT | TBS_BOTH | WS_BORDER | WS_TABSTOP,8,14,32,67,WS_EX_STATICEDGE
|
||||||
GROUPBOX "Volume",IDC_STATIC,3,3,45,94
|
GROUPBOX "Volume",IDC_STATIC,3,3,45,94
|
||||||
CONTROL "Mute",IDC_MUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,83,32,10
|
CONTROL "Mute",IDC_MUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,83,32,10
|
||||||
|
CONTROL "Rounded Frequencies",IDC_ROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,103,85,10
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LOG_SETTINGS DIALOGEX 0, 0, 311, 177
|
IDD_LOG_SETTINGS DIALOGEX 0, 0, 311, 177
|
||||||
|
@ -83,8 +85,8 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM
|
||||||
CAPTION "Game Settings"
|
CAPTION "Game Settings"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL "FPS Buffer",IDC_FPSBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,50,10
|
CONTROL "",IDC_BUFFER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,35,79,240,19
|
||||||
CONTROL "Tiny Buffer",IDC_TINYBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,36,51,10
|
GROUPBOX "Buffer Size",IDC_BUFFERTEXT,31,67,249,44,BS_CENTER
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,6 @@ enum
|
||||||
Set_Logging_InitShutdown,
|
Set_Logging_InitShutdown,
|
||||||
Set_Logging_Interface,
|
Set_Logging_Interface,
|
||||||
Set_Logging_Driver,
|
Set_Logging_Driver,
|
||||||
Set_TinyBuffer,
|
Set_Buffer,
|
||||||
Set_FPSBuffer,
|
Set_RoundFreq,
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,13 +9,12 @@
|
||||||
#define IDD_CONFIG 9
|
#define IDD_CONFIG 9
|
||||||
#define IDD_LOG_SETTINGS 103
|
#define IDD_LOG_SETTINGS 103
|
||||||
#define IDD_GAME_SETTING 104
|
#define IDD_GAME_SETTING 104
|
||||||
#define IDC_BUFFER_DIVIDER 1001
|
#define VERSION_BUILD 835
|
||||||
#define IDC_BUFFER_LEVEL 1002
|
#define IDC_VOLUME 1001
|
||||||
#define IDC_VOLUME 1003
|
#define IDC_MUTE 1002
|
||||||
#define IDC_MUTE 1004
|
#define IDC_BUFFER 1003
|
||||||
#define IDC_FPSBUFFER 1004
|
#define IDC_ROUND 1004
|
||||||
#define IDC_CHECK2 1005
|
#define IDC_BUFFERTEXT 1005
|
||||||
#define IDC_TINYBUFFER 1005
|
|
||||||
#define IDC_CMB_TRACE_PATH 1019
|
#define IDC_CMB_TRACE_PATH 1019
|
||||||
#define IDC_CMB_TRACE_INIT_SHUTDOWN 1020
|
#define IDC_CMB_TRACE_INIT_SHUTDOWN 1020
|
||||||
#define IDC_CMB_TRACE_INTERFACE 1021
|
#define IDC_CMB_TRACE_INTERFACE 1021
|
||||||
|
|
Loading…
Reference in New Issue