From 9e6ccf2d5356486bb1c41c2443b5cc02376ab5b1 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 28 Sep 2017 08:14:53 +1000 Subject: [PATCH 01/35] [Audio] Make project64 audio the default plugin --- Source/Project64-core/Settings/SettingsClass.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp index 9493cbbce..5b0828c8d 100644 --- a/Source/Project64-core/Settings/SettingsClass.cpp +++ b/Source/Project64-core/Settings/SettingsClass.cpp @@ -346,7 +346,11 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) #ifdef _WIN32 AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll")); AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin", "Graphics Dll", "GFX\\Jabo_Direct3D8.dll")); - AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Jabo_Dsound.dll")); +#ifdef _DEBUG + AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Project64-Audio_d.dll")); +#else + AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Project64-Audio.dll")); +#endif AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin", "Controller Dll", "Input\\PJ64_NRage.dll")); #else AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "libProject64-rsp-hle.so")); From fd062c0739ff6c0d8685e33c4fe5b9f110b498f2 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 28 Sep 2017 08:51:38 +1000 Subject: [PATCH 02/35] [Audio] Turn off default fixed audio timing --- Source/Project64-core/Settings/SettingsClass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp index 5b0828c8d..8d7f5b25d 100644 --- a/Source/Project64-core/Settings/SettingsClass.cpp +++ b/Source/Project64-core/Settings/SettingsClass.cpp @@ -142,8 +142,8 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false)); AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true)); AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true)); - AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true)); - AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", false)); + AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", false)); + AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", true)); AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false)); AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start", 0)); AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", 0)); From 8eefd65cb3f629cbb0db8c7a27be096f237c1ec3 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 28 Sep 2017 17:40:20 +1000 Subject: [PATCH 03/35] [Audio] Remove Sync Audio from audio config --- Source/Project64-audio/ConfigUI.cpp | 3 --- Source/Project64-audio/Project64-audio.rc | Bin 11164 -> 10952 bytes Source/Project64-audio/resource.h | Bin 2474 -> 2382 bytes 3 files changed, 3 deletions(-) diff --git a/Source/Project64-audio/ConfigUI.cpp b/Source/Project64-audio/ConfigUI.cpp index 431566f2a..8baff9d38 100644 --- a/Source/Project64-audio/ConfigUI.cpp +++ b/Source/Project64-audio/ConfigUI.cpp @@ -115,9 +115,6 @@ public: m_BufferLevel.Attach(GetDlgItem(IDC_BUFFER_LEVEL)); m_BufferLevel.SetWindowText(stdstr_f("%d", g_settings->BufferLevel()).c_str()); - - m_btnSyncAudio.Attach(GetDlgItem(IDC_SYNC_AUDIO)); - m_btnSyncAudio.SetCheck(g_settings->SyncAudio() ? BST_CHECKED : BST_UNCHECKED); return TRUE; } diff --git a/Source/Project64-audio/Project64-audio.rc b/Source/Project64-audio/Project64-audio.rc index 6e8184f9eb02844b11d994b18ad34f5e5e7bfef8..965b1e2afbddc5c3672194d8a5402bdaebf9f48b 100644 GIT binary patch delta 12 TcmbOeej;?k9I?#>;yNM#CLRRs delta 128 zcmX>RIwyR?9I?q6+)BQ|43!Ld49N@%42}$?3@Hqm4EYR73_3u*CxZ)vGebN>FheAR zADHFH5DFCYWbg;eD=|0$b(8>MKF|cPp2<78tz{J$EWq-n3?^XOkinS26v{H#+%IM+ F0swn$7L5P^ diff --git a/Source/Project64-audio/resource.h b/Source/Project64-audio/resource.h index 919a05bfdec1c7c42e2121753194c061427eb821..e5e8000f8f1fa8e1e283351cdf86b3e3008c0fa7 100644 GIT binary patch delta 12 TcmZ1_d`@TsAM@rcW(PI^9W4XJ delta 36 rcmX>nv`TmbAG2^ULnMPAgEK=sgCj#IgA0Qvga2ejX6?-%nBv#~oYe?x From 0c1b5d3fb926916c35b66cdd5c92acbec70dca8b Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 28 Sep 2017 17:48:45 +1000 Subject: [PATCH 04/35] [Audio] Fix up monitoring system settings --- Source/Project64-audio/AudioSettings.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Project64-audio/AudioSettings.cpp b/Source/Project64-audio/AudioSettings.cpp index 9deb6e1e7..075d0bfd8 100644 --- a/Source/Project64-audio/AudioSettings.cpp +++ b/Source/Project64-audio/AudioSettings.cpp @@ -34,10 +34,10 @@ CSettings::CSettings() : RegisterSettings(); ReadSettings(); - if (m_Set_EnableAudio != 0) { SettingsRegisterChange(false, m_Set_EnableAudio, this, stSettingsChanged); } - if (m_Set_basic_mode != 0) { SettingsRegisterChange(false, m_Set_basic_mode, this, stSettingsChanged); } - if (m_Set_debugger != 0) { SettingsRegisterChange(false, m_Set_debugger, this, stSettingsChanged); } - if (m_Set_log_flush != 0) { SettingsRegisterChange(false, m_Set_log_flush, this, stSettingsChanged); } + if (m_Set_EnableAudio != 0) { SettingsRegisterChange(true, m_Set_EnableAudio, this, stSettingsChanged); } + if (m_Set_basic_mode != 0) { SettingsRegisterChange(true, m_Set_basic_mode, this, stSettingsChanged); } + if (m_Set_debugger != 0) { SettingsRegisterChange(true, m_Set_debugger, this, stSettingsChanged); } + if (m_Set_log_flush != 0) { SettingsRegisterChange(true, m_Set_log_flush, this, stSettingsChanged); } SettingsRegisterChange(false, Set_Volume, this, stSettingsChanged); SettingsRegisterChange(false, Set_Logging_MD5, this, stLogLevelChanged); @@ -50,10 +50,10 @@ CSettings::CSettings() : CSettings::~CSettings() { - if (m_Set_EnableAudio != 0) { SettingsUnregisterChange(false, m_Set_EnableAudio, this, stSettingsChanged); } - if (m_Set_basic_mode != 0) { SettingsUnregisterChange(false, m_Set_basic_mode, this, stSettingsChanged); } - if (m_Set_debugger != 0) { SettingsUnregisterChange(false, m_Set_debugger, this, stSettingsChanged); } - if (m_Set_log_flush != 0) { SettingsUnregisterChange(false, m_Set_log_flush, this, stSettingsChanged); } + if (m_Set_EnableAudio != 0) { SettingsUnregisterChange(true, m_Set_EnableAudio, this, stSettingsChanged); } + if (m_Set_basic_mode != 0) { SettingsUnregisterChange(true, m_Set_basic_mode, this, stSettingsChanged); } + if (m_Set_debugger != 0) { SettingsUnregisterChange(true, m_Set_debugger, this, stSettingsChanged); } + if (m_Set_log_flush != 0) { SettingsUnregisterChange(true, m_Set_log_flush, this, stSettingsChanged); } SettingsUnregisterChange(false, Set_Volume, this, stSettingsChanged); SettingsUnregisterChange(false, Set_Logging_MD5, this, stLogLevelChanged); From a5251619b7f4b683b82f1a85eb55916fd1490d68 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 28 Sep 2017 21:43:58 +1000 Subject: [PATCH 05/35] [Audio] Use sync to audio from project --- Config/Audio.rdb | 74 +------------------ Source/Project64-audio/AudioSettings.cpp | 20 +++-- Source/Project64-audio/AudioSettings.h | 5 +- Source/Project64-audio/ConfigUI.cpp | 2 - Source/Project64-audio/SettingsID.h | 1 - .../Project64-core/N64System/Mips/Audio.cpp | 6 +- Source/Project64-core/N64System/N64Class.cpp | 30 +------- Source/Project64-core/N64System/N64Class.h | 3 +- .../Project64-core/Settings/GameSettings.cpp | 10 +-- Source/Project64-core/Settings/GameSettings.h | 5 +- .../SettingType/SettingsType-TempBool.cpp | 31 ++++---- .../SettingType/SettingsType-TempBool.h | 31 ++++---- Source/Project64-core/Settings/Settings.h | 1 + .../Project64-core/Settings/SettingsClass.cpp | 14 +++- 14 files changed, 75 insertions(+), 158 deletions(-) diff --git a/Config/Audio.rdb b/Config/Audio.rdb index 50ab05a72..ea1ff6466 100644 --- a/Config/Audio.rdb +++ b/Config/Audio.rdb @@ -3,334 +3,270 @@ Good Name=A Bug's Life (U) BufferDivider=60 BufferLevel=2 -SyncAudio=1 [E6A95A4F-BAD2EA23-C:45] Good Name=Aidyn Chronicles - The First Mage (U) [!] (V1.0) BufferDivider=60 BufferLevel=2 -SyncAudio=1 [112051D2-68BEF8AC-C:45] Good Name=Aidyn Chronicles - The First Mage (U) [!] (V1.1) BufferDivider=60 BufferLevel=2 -SyncAudio=1 [1FB5D932-3BA9481B-C:45] Good Name=Armorines - Project S.W.A.R.M. (U) -SyncAudio=0 [4C52BBB2-CEAB0F6B-C:45] Good Name=Army Men - Air Combat (U) -SyncAudio=0 [B20F73B6-2975FC34-C:45] Good Name=Army Men - Sarge's Heroes 2 (U) -SyncAudio=0 [A4BF9306-BF0CDFD1-C:45] Good Name=Banjo-Kazooie (U) (V1.0) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [CD7559AC-B26CF5AE-C:45] Good Name=Banjo-Kazooie (U) (V1.1) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [C2E9AA9A-475D70AA-C:45] Good Name=Banjo-Tooie (U) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [6AA4DDE7-E3E2F4E7-C:45] Good Name=BattleTanx (U) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [75A4E247-6008963D-C:45] Good Name=BattleTanx - Global Assault (U) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [EDF419A8-BF1904CC-C:45] Good Name=Beetle Adventure Racing! (U) (M3) BufferDivider=60 -SyncAudio=1 [7C647C25-D9D901E6-C:45] Good Name=Blast Corps (U) (V1.0) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [7C647E65-1948D305-C:45] Good Name=Blast Corps (U) (V1.1) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [5326696F-FE9A99C3-C:45] Good Name=Body Harvest (U) BufferDivider=95 -SyncAudio=1 [F568D51E-7E49BA1E-C:45] Good Name=Bomberman 64 (U) BufferDivider=60 -SyncAudio=1 [F35D5F95-8AFE3D69-C:45] Good Name=Castlevania (U) (V1.0) BufferDivider=60 BufferLevel=2 -SyncAudio=1 [F35D5335-B7667CB7-C:45] Good Name=Castlevania (U) (V1.1) BufferDivider=60 BufferLevel=2 -SyncAudio=1 [4BCDFF47-AAA3AF8F-C:45] Good Name=Castlevania (U) (V1.2) BufferDivider=60 BufferLevel=2 -SyncAudio=1 [30C7AC50-7704072D-C:45] Good Name=Conker's Bad Fur Day (U) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [46A3F7AF-0F7591D0-C:45] Good Name=Cruis'n Exotica (U) - [FF2F2FB4-D161149A-C:45] Good Name=Cruis'n USA (U) (V1.0) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [5306CF45-CBC49250-C:45] Good Name=Cruis'n USA (U) (V1.1) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [B3402554-7340C004-C:45] Good Name=Cruis'n USA (U) (V1.2) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [DFE61153-D76118E6-C:45] Good Name=Cruis'n World (U) BufferDivider=60 -SyncAudio=1 [DEE584A2-0F161187-C:45] Good Name=Destruction Derby 64 (U) BufferDivider=60 -SyncAudio=1 [53D440E7-7519B011-C:45] Good Name=Diddy Kong Racing (U) (M2) (V1.0) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [E402430D-D2FCFC9D-C:45] Good Name=Diddy Kong Racing (U) (M2) (V1.1) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [EC58EABF-AD7C7169-C:45] Good Name=Donkey Kong 64 (U) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [A83E101A-E937B69D-C:45] Good Name=Doom 64 (U) (V1.0) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [423E96F4-CE88F05B-C:45] Good Name=Doom 64 (U) (V1.1) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [07861842-A12EBC9F-C:45] Good Name=Excitebike 64 (U) (V1.0) - [F9D411E3-7CB29BC0-C:45] Good Name=Excitebike 64 (U) (V1.1) - [FDA245D2-A74A3D47-C:45] Good Name=Extreme-G (U) BufferDivider=60 -SyncAudio=1 [B30ED978-3003C9F9-C:45] Good Name=F-ZERO X (U) BufferDivider=60 -SyncAudio=1 [4252A5AD-AE6FBF4E-C:45] Good Name=Goemon's Great Adventure (U) BufferDivider=60 -SyncAudio=1 [DCBC50D1-09FD1AA3-C:45] Good Name=GoldenEye 007 (U) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [C7C98F8E-42145DDE-C:45] Good Name=Hot Wheels Turbo Racing (U) - [8A6009B6-94ACE150-C:45] Good Name=Jet Force Gemini (U) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [9E8FE2BA-8B270770-C:45] Good Name=Killer Instinct Gold (U) (V1.0) BufferDivider=60 -SyncAudio=1 [9E8FCDFA-49F5652B-C:45] Good Name=Killer Instinct Gold (U) (V1.1) BufferDivider=60 -SyncAudio=1 [F908CA4C-36464327-C:45] Good Name=Killer Instinct Gold (U) (V1.2) BufferDivider=60 -SyncAudio=1 [7F304099-52CF5276-C:4A] Good Name=Last Legion UX (J) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [0160E9E5-29A4CB68-C:45] Good Name=Last Legion UX (J) [T] BufferDivider=30 BufferLevel=2 -SyncAudio=1 [664BA3D4-678A80B7-C:45] Good Name=Mario Golf (U) BufferDivider=60 -SyncAudio=1 [3E5055B6-2E92DA52-C:45] Good Name=Mario Kart 64 (U) BufferDivider=60 -SyncAudio=1 [7C3829D9-6E8247CE-C:45] Good Name=Mario Party 3 (U) BufferDivider=60 -SyncAudio=1 [5001CF4F-F30CB3BD-C:45] Good Name=Mario Tennis (U) BufferDivider=60 -SyncAudio=1 [28768D6D-B379976C-C:45] Good Name=Monaco Grand Prix (U) BufferDivider=60 -SyncAudio=1 [5AC383E1-D712E387-C:45] Good Name=Monopoly (U) (M2) - [FCBCCB21-72903C6B-C:45] Good Name=Mystical Ninja Starring Goemon (U) BufferDivider=60 -SyncAudio=1 [DF331A18-5FD4E044-C:45] Good Name=NASCAR 2000 (U) - [591A806E-A5E6921D-C:45] Good Name=NHL 99 (U) BufferDivider=60 -SyncAudio=1 [82EFDC30-806A2461-C:45] Good Name=NHL Blades of Steel '99 (U) BufferDivider=60 -SyncAudio=1 [6DFDCDC3-4DE701C8-C:45] Good Name=NHL Breakaway 98 (U) BufferDivider=60 -SyncAudio=0 [441768D0-7D73F24F-C:45] Good Name=NHL Breakaway 99 (U) BufferDivider=60 -SyncAudio=0 [E6419BC5-69011DE3-C:45] Good Name=Ogre Battle 64 - Person of Lordly Caliber (U) (V1.0) BufferDivider=60 -SyncAudio=1 [0ADAECA7-B17F9795-C:45] Good Name=Ogre Battle 64 - Person of Lordly Caliber (U) (V1.1) BufferDivider=60 -SyncAudio=1 [65EEE53A-ED7D733C-C:45] Good Name=Paper Mario (U) BufferDivider=60 -SyncAudio=1 [DDF460CC-3CA634C0-C:45] Good Name=Perfect Dark (U) (V1.0) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [41F2B98F-B458B466-C:45] Good Name=Perfect Dark (U) (V1.1) BufferDivider=30 BufferLevel=2 -SyncAudio=1 [C851961C-78FCAAFA-C:45] Good Name=Pilotwings 64 (U) BufferDivider=60 -SyncAudio=1 [03571182-892FD06D-C:45] Good Name=Pokemon Stadium 2 (U) BufferDivider=60 -SyncAudio=1 [BDA8F143-B1AF2D62-C:45] Good Name=Quake II (U) BufferDivider=60 -SyncAudio=0 [0F1FA987-BFC1AFA6-C:45] Good Name=Re-Volt (U) @@ -338,7 +274,6 @@ Good Name=Re-Volt (U) [F050746C-247B820B-C:45] Good Name=Road Rash 64 (U) BufferDivider=60 -SyncAudio=1 [0C5EE085-A167DD3E-C:45] Good Name=Rocket - Robot on Wheels (U) @@ -346,7 +281,6 @@ Good Name=Rocket - Robot on Wheels (U) [2500267E-2A7EC3CE-C:45] Good Name=RR64 - Ridge Racer 64 (U) BufferDivider=60 -SyncAudio=0 [769147F3-2033C10E-C:45] Good Name=S.C.A.R.S. (U) @@ -372,12 +306,10 @@ Good Name=StarCraft 64 (U) [635A2BFF-8B022326-C:45] Good Name=Super Mario 64 (U) BufferDivider=60 -SyncAudio=1 [916B8B5B-780B85A4-C:45] Good Name=Super Smash Bros. (U) BufferDivider=30 -SyncAudio=1 [204EC022-B119D185-C:45] Good Name=Tony Hawk's Pro Skater (U) (V1.0) @@ -386,7 +318,7 @@ Good Name=Tony Hawk's Pro Skater (U) (V1.0) Good Name=Tony Hawk's Pro Skater (U) (V1.1) [99150E18-1266E6A5-C:45] -Good Name=Tony Hawk's Pro Skater 2 (U) +Good Name=Tony Hawk's Pro Skater 2 (U [1A7F70B5-00B7B9FD-C:45] Good Name=Tony Hawk's Pro Skater 3 (U) @@ -412,17 +344,14 @@ Good Name=Turok 3 - Shadow of Oblivion (U) [3C059038-C8BF2182-C:45] Good Name=V-Rally Edition 99 (U) BufferDivider=60 -SyncAudio=1 [EA71056A-E4214847-C:45] Good Name=Vigilante 8 (U) BufferDivider=60 -SyncAudio=1 [F5C5866D-052713D9-C:45] Good Name=Vigilante 8 - 2nd Offense (U) BufferDivider=60 -SyncAudio=1 [ED98957E-8242DCAC-C:45] Good Name=WinBack - Covert Operations (U) @@ -430,4 +359,3 @@ Good Name=WinBack - Covert Operations (U) [2337D8E8-6B8E7CEC-C:45] Good Name=Yoshi's Story (U) (M2) BufferDivider=60 -SyncAudio=1 diff --git a/Source/Project64-audio/AudioSettings.cpp b/Source/Project64-audio/AudioSettings.cpp index 075d0bfd8..86aefe22e 100644 --- a/Source/Project64-audio/AudioSettings.cpp +++ b/Source/Project64-audio/AudioSettings.cpp @@ -17,6 +17,8 @@ CSettings * g_settings = NULL; CSettings::CSettings() : m_Set_EnableAudio(0), + m_Set_SyncAudio(0), + m_Set_FullSpeed(0), m_Set_basic_mode(0), m_Set_debugger(0), m_Set_log_dir(0), @@ -28,7 +30,8 @@ CSettings::CSettings() : m_Volume(100), m_BufferDivider(90), m_BufferLevel(4), - m_SyncAudio(false) + m_SyncAudio(false), + m_FullSpeed(true) { memset(m_log_dir, 0, sizeof(m_log_dir)); RegisterSettings(); @@ -38,6 +41,8 @@ CSettings::CSettings() : if (m_Set_basic_mode != 0) { SettingsRegisterChange(true, m_Set_basic_mode, this, stSettingsChanged); } if (m_Set_debugger != 0) { SettingsRegisterChange(true, m_Set_debugger, this, stSettingsChanged); } if (m_Set_log_flush != 0) { SettingsRegisterChange(true, m_Set_log_flush, this, stSettingsChanged); } + if (m_Set_SyncAudio != 0) { SettingsRegisterChange(true, m_Set_SyncAudio, this, stSettingsChanged); } + if (m_Set_FullSpeed != 0) { SettingsRegisterChange(true, m_Set_FullSpeed, this, stSettingsChanged); } SettingsRegisterChange(false, Set_Volume, this, stSettingsChanged); SettingsRegisterChange(false, Set_Logging_MD5, this, stLogLevelChanged); @@ -54,6 +59,8 @@ CSettings::~CSettings() if (m_Set_basic_mode != 0) { SettingsUnregisterChange(true, m_Set_basic_mode, this, stSettingsChanged); } if (m_Set_debugger != 0) { SettingsUnregisterChange(true, m_Set_debugger, this, stSettingsChanged); } if (m_Set_log_flush != 0) { SettingsUnregisterChange(true, m_Set_log_flush, this, stSettingsChanged); } + if (m_Set_SyncAudio != 0) { SettingsUnregisterChange(true, m_Set_SyncAudio, this, stSettingsChanged); } + if (m_Set_FullSpeed != 0) { SettingsUnregisterChange(true, m_Set_FullSpeed, this, stSettingsChanged); } SettingsUnregisterChange(false, Set_Volume, this, stSettingsChanged); SettingsUnregisterChange(false, Set_Logging_MD5, this, stLogLevelChanged); @@ -68,6 +75,8 @@ void CSettings::RegisterSettings(void) { SetModuleName("default"); m_Set_EnableAudio = FindSystemSettingId("Enable Audio"); + m_Set_SyncAudio = FindSystemSettingId("Sync Audio"); + m_Set_FullSpeed = FindSystemSettingId("Full Speed"); m_Set_basic_mode = FindSystemSettingId("Basic Mode"); m_Set_debugger = FindSystemSettingId("Debugger"); m_Set_log_flush = FindSystemSettingId("Log Auto Flush"); @@ -83,7 +92,6 @@ void CSettings::RegisterSettings(void) RegisterSetting(Set_Logging_Driver, Data_DWORD_General, "Driver", "Logging", g_ModuleLogLevel[TraceAudioDriver], NULL); RegisterSetting(Set_BufferDivider, Data_DWORD_Game, "BufferDivider", "", 90, NULL); RegisterSetting(Set_BufferLevel, Data_DWORD_Game, "BufferLevel", "", 4, NULL); - RegisterSetting(Set_SyncAudio, Data_DWORD_Game, "SyncAudio", "", (uint32_t)false, NULL); LogLevelChanged(); } @@ -113,11 +121,6 @@ void CSettings::SetBufferLevel(uint32_t BufferLevel) SetSetting(Set_BufferLevel, BufferLevel); } -void CSettings::SetSyncAudio(bool Enabled) -{ - SetSetting(Set_SyncAudio, Enabled ? 1 : 0); -} - void CSettings::LogLevelChanged(void) { g_ModuleLogLevel[TraceMD5] = GetSetting(Set_Logging_MD5); @@ -136,7 +139,8 @@ void CSettings::ReadSettings(void) m_debugger_enabled = m_advanced_options && m_Set_debugger ? GetSystemSetting(m_Set_debugger) == 1 : false; m_BufferDivider = GetSetting(Set_BufferDivider); m_BufferLevel = GetSetting(Set_BufferLevel); - m_SyncAudio = GetSetting(Set_SyncAudio) != 0; + m_SyncAudio = m_Set_SyncAudio ? GetSystemSetting(m_Set_SyncAudio) != 0 : false; + m_FullSpeed = m_Set_FullSpeed ? GetSystemSetting(m_Set_FullSpeed) != 0 : false; if (m_Set_log_dir != 0) { diff --git a/Source/Project64-audio/AudioSettings.h b/Source/Project64-audio/AudioSettings.h index feb8ac73a..da4a79e9c 100644 --- a/Source/Project64-audio/AudioSettings.h +++ b/Source/Project64-audio/AudioSettings.h @@ -22,6 +22,7 @@ public: inline uint32_t BufferDivider(void) const { return m_BufferDivider; } inline uint32_t BufferLevel(void) const { return m_BufferLevel; } inline bool SyncAudio(void) const { return m_SyncAudio; } + inline bool FullSpeed(void) const { return m_FullSpeed; } inline bool FlushLogs(void) const { return m_FlushLogs; } inline const char * log_dir(void) const { return m_log_dir; } @@ -29,7 +30,6 @@ public: void SetVolume(uint32_t Volume); void SetBufferDivider(uint32_t BufferDivider); void SetBufferLevel(uint32_t BufferLevel); - void SetSyncAudio(bool Enabled); void ReadSettings(); private: @@ -46,6 +46,8 @@ private: void LogLevelChanged(void); short m_Set_EnableAudio; + short m_Set_SyncAudio; + short m_Set_FullSpeed; short m_Set_basic_mode; short m_Set_debugger; short m_Set_log_dir; @@ -59,6 +61,7 @@ private: uint32_t m_BufferDivider; uint32_t m_BufferLevel; bool m_SyncAudio; + bool m_FullSpeed; }; extern CSettings * g_settings; diff --git a/Source/Project64-audio/ConfigUI.cpp b/Source/Project64-audio/ConfigUI.cpp index 8baff9d38..c9af36cad 100644 --- a/Source/Project64-audio/ConfigUI.cpp +++ b/Source/Project64-audio/ConfigUI.cpp @@ -125,7 +125,6 @@ public: g_settings->SetBufferDivider(atoi(buffer)); m_BufferLevel.GetWindowText(buffer, sizeof(buffer)); g_settings->SetBufferLevel(atoi(buffer)); - g_settings->SetSyncAudio(m_btnSyncAudio.GetCheck() == BST_CHECKED); FlushSettings(); return true; @@ -134,7 +133,6 @@ public: private: CEdit m_BufferDivider; CEdit m_BufferLevel; - CButton m_btnSyncAudio; LRESULT ItemChangedNotify(NMHDR* /*pNMHDR*/) { diff --git a/Source/Project64-audio/SettingsID.h b/Source/Project64-audio/SettingsID.h index 8e76072b3..35ccac7fa 100644 --- a/Source/Project64-audio/SettingsID.h +++ b/Source/Project64-audio/SettingsID.h @@ -22,5 +22,4 @@ enum Set_Logging_Driver, Set_BufferDivider, Set_BufferLevel, - Set_SyncAudio, }; \ No newline at end of file diff --git a/Source/Project64-core/N64System/Mips/Audio.cpp b/Source/Project64-core/N64System/Mips/Audio.cpp index c113741b2..df4fcf85b 100644 --- a/Source/Project64-core/N64System/Mips/Audio.cpp +++ b/Source/Project64-core/N64System/Mips/Audio.cpp @@ -116,10 +116,6 @@ void CAudio::InterruptTimerDone() { m_Status &= ~ai_busy; } - if (g_Reg->m_AudioIntrReg == 0) - { - g_System->SyncToAudio(); - } WriteTrace(TraceAudio, TraceDebug, "Done"); } @@ -157,4 +153,4 @@ void CAudio::SetFrequency(uint32_t Dacrate, uint32_t System) //m_BytesPerSecond = 128024; m_FramesPerSecond = System == SYSTEM_PAL ? 50 : 60; -} +} \ No newline at end of file diff --git a/Source/Project64-core/N64System/N64Class.cpp b/Source/Project64-core/N64System/N64Class.cpp index 2f56f5221..709bb43d3 100644 --- a/Source/Project64-core/N64System/N64Class.cpp +++ b/Source/Project64-core/N64System/N64Class.cpp @@ -475,6 +475,7 @@ bool CN64System::RunDiskImage(const char * FileLoc) void CN64System::CloseSystem() { WriteTrace(TraceN64System, TraceDebug, "Start"); + g_Settings->SaveBool(Game_FullSpeed, true); if (g_BaseSystem) { g_BaseSystem->CloseCpu(); @@ -2069,33 +2070,6 @@ void CN64System::RunRSP() WriteTrace(TraceRSP, TraceDebug, "Done (SP Status %X)", m_Reg.SP_STATUS_REG); } -void CN64System::SyncToAudio() -{ - if (!bSyncToAudio() || !bLimitFPS()) - { - return; - } - PROFILE_TIMERS PreviousTimer = Timer_None; - if (bShowCPUPer()) - { - PreviousTimer = m_CPU_Usage.StartTimer(Timer_Idel); - } - - for (int i = 0; i < 50; i++) - { - if (g_Reg->m_AudioIntrReg != 0) - { - WriteTrace(TraceAudio, TraceDebug, "Audio Interrupt done (%d)", i); - break; - } - pjutil::Sleep(1); - } - if (bShowCPUPer()) - { - m_CPU_Usage.StartTimer(PreviousTimer); - } -} - void CN64System::RefreshScreen() { PROFILE_TIMERS CPU_UsageAddr = Timer_None/*, ProfilingAddr = Timer_None*/; @@ -2148,7 +2122,7 @@ void CN64System::RefreshScreen() } g_MMU->UpdateFieldSerration((m_Reg.VI_STATUS_REG & 0x40) != 0); - if ((bBasicMode() || bLimitFPS()) && !bSyncToAudio()) + if ((bBasicMode() || bLimitFPS()) && (!bSyncToAudio() || !FullSpeed())) { if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_Idel); } uint32_t FrameRate; diff --git a/Source/Project64-core/N64System/N64Class.h b/Source/Project64-core/N64System/N64Class.h index 63d04d1b7..25204fb9c 100644 --- a/Source/Project64-core/N64System/N64Class.h +++ b/Source/Project64-core/N64System/N64Class.h @@ -67,9 +67,8 @@ public: void ExternalEvent(SystemEvent action); //covers gui interacting and timers etc.. void StartEmulation(bool NewThread); void EndEmulation(); - void SyncToAudio(); void AlterSpeed(const CSpeedLimiter::ESpeedChange SpeedChange) { m_Limiter.AlterSpeed(SpeedChange); } - void SetSpeed(int Speed) { m_Limiter.SetSpeed(Speed); } + void SetSpeed(int Speed) { m_Limiter.SetSpeed(Speed); } int GetSpeed(void) const { return m_Limiter.GetSpeed(); } int GetBaseSpeed(void) const { return m_Limiter.GetBaseSpeed(); } void Reset(bool bInitReg, bool ClearMenory); diff --git a/Source/Project64-core/Settings/GameSettings.cpp b/Source/Project64-core/Settings/GameSettings.cpp index 8886da9a2..cddb68ab2 100644 --- a/Source/Project64-core/Settings/GameSettings.cpp +++ b/Source/Project64-core/Settings/GameSettings.cpp @@ -27,8 +27,8 @@ bool CGameSettings::m_DelayDP = false; bool CGameSettings::m_DelaySI = false; uint32_t CGameSettings::m_RdramSize = 0; bool CGameSettings::m_bFixedAudio = true; -bool CGameSettings::m_bSyncingToAudio = true; bool CGameSettings::m_bSyncToAudio = true; +bool CGameSettings::m_FullSpeed = true; bool CGameSettings::m_bFastSP = true; bool CGameSettings::m_b32Bit = true; bool CGameSettings::m_RspAudioSignal; @@ -57,7 +57,8 @@ void CGameSettings::RefreshGameSettings() m_DelaySI = g_Settings->LoadBool(Game_DelaySI); m_DelayDP = g_Settings->LoadBool(Game_DelayDP); m_bFixedAudio = g_Settings->LoadBool(Game_FixedAudio); - m_bSyncToAudio = m_bFixedAudio ? g_Settings->LoadBool(Game_SyncViaAudio) : false; + m_bSyncToAudio = g_Settings->LoadBool(Game_SyncViaAudio); + m_FullSpeed = g_Settings->LoadBool(Game_FullSpeed); m_b32Bit = g_Settings->LoadBool(Game_32Bit); #ifdef ANDROID m_bFastSP = false; @@ -72,7 +73,6 @@ void CGameSettings::RefreshGameSettings() m_SystemType = (SYSTEM_TYPE)g_Settings->LoadDword(Game_SystemType); m_CpuType = (CPU_TYPE)g_Settings->LoadDword(Game_CpuType); m_OverClockModifier = g_Settings->LoadDword(Game_OverClockModifier); - m_bSyncingToAudio = m_bSyncToAudio; if (m_CountPerOp == 0) { m_CountPerOp = 2; @@ -84,6 +84,6 @@ void CGameSettings::RefreshGameSettings() void CGameSettings::SpeedChanged(int SpeedLimit) { - int FullSpeed = g_System->m_SystemType == SYSTEM_PAL ? 50 : 60; - m_bSyncingToAudio = SpeedLimit == FullSpeed ? m_bSyncToAudio : false; + m_FullSpeed = (g_System->m_SystemType == SYSTEM_PAL ? 50 : 60) == SpeedLimit; + g_Settings->SaveBool(Game_FullSpeed, m_FullSpeed); } \ No newline at end of file diff --git a/Source/Project64-core/Settings/GameSettings.h b/Source/Project64-core/Settings/GameSettings.h index 63109c0c1..2e337eb97 100644 --- a/Source/Project64-core/Settings/GameSettings.h +++ b/Source/Project64-core/Settings/GameSettings.h @@ -30,7 +30,8 @@ public: inline static bool bDelaySI(void) { return m_DelaySI; } inline static uint32_t RdramSize(void) { return m_RdramSize; } inline static bool bFixedAudio(void) { return m_bFixedAudio; } - inline static bool bSyncToAudio(void) { return m_bSyncingToAudio; } + inline static bool bSyncToAudio(void) { return m_bSyncToAudio; } + inline static bool FullSpeed(void) { return m_FullSpeed; } inline static bool bFastSP(void) { return m_bFastSP; } inline static bool b32BitCore(void) { return m_b32Bit; } inline static bool RspAudioSignal(void) { return m_RspAudioSignal; } @@ -61,8 +62,8 @@ private: static bool m_DelaySI; static uint32_t m_RdramSize; static bool m_bFixedAudio; - static bool m_bSyncingToAudio; static bool m_bSyncToAudio; + static bool m_FullSpeed; static bool m_bFastSP; static bool m_b32Bit; static bool m_RspAudioSignal; diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp b/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp index 4a53d8091..66078bfb4 100644 --- a/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp +++ b/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp @@ -11,70 +11,71 @@ #include "stdafx.h" #include "SettingsType-TempBool.h" -CSettingTypeTempBool::CSettingTypeTempBool(bool initialValue) : - m_value(initialValue) +CSettingTypeTempBool::CSettingTypeTempBool(bool initialValue, const char * Name) : + m_value(initialValue), + m_Name(Name ? Name : "") { } -CSettingTypeTempBool::~CSettingTypeTempBool ( void ) +CSettingTypeTempBool::~CSettingTypeTempBool(void) { } -bool CSettingTypeTempBool::Load ( int /*Index*/, bool & Value ) const +bool CSettingTypeTempBool::Load(int /*Index*/, bool & Value) const { Value = m_value; return true; } -bool CSettingTypeTempBool::Load ( int /*Index*/, uint32_t & /*Value*/ ) const +bool CSettingTypeTempBool::Load(int /*Index*/, uint32_t & /*Value*/) const { g_Notify->BreakPoint(__FILE__, __LINE__); return false; } -bool CSettingTypeTempBool::Load ( int /*Index*/, stdstr & /*Value*/ ) const +bool CSettingTypeTempBool::Load(int /*Index*/, stdstr & /*Value*/) const { g_Notify->BreakPoint(__FILE__, __LINE__); return false; } //return the default values -void CSettingTypeTempBool::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const +void CSettingTypeTempBool::LoadDefault(int /*Index*/, bool & /*Value*/) const { g_Notify->BreakPoint(__FILE__, __LINE__); } -void CSettingTypeTempBool::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const +void CSettingTypeTempBool::LoadDefault(int /*Index*/, uint32_t & /*Value*/) const { g_Notify->BreakPoint(__FILE__, __LINE__); } -void CSettingTypeTempBool::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const +void CSettingTypeTempBool::LoadDefault(int /*Index*/, stdstr & /*Value*/) const { g_Notify->BreakPoint(__FILE__, __LINE__); } -void CSettingTypeTempBool::Save ( int /*Index*/, bool Value ) +void CSettingTypeTempBool::Save(int /*Index*/, bool Value) { m_value = Value; } -void CSettingTypeTempBool::Save ( int /*Index*/, uint32_t /*Value*/ ) +void CSettingTypeTempBool::Save(int /*Index*/, uint32_t /*Value*/) { g_Notify->BreakPoint(__FILE__, __LINE__); } -void CSettingTypeTempBool::Save ( int /*Index*/, const stdstr & /*Value*/ ) +void CSettingTypeTempBool::Save(int /*Index*/, const stdstr & /*Value*/) { g_Notify->BreakPoint(__FILE__, __LINE__); } -void CSettingTypeTempBool::Save ( int /*Index*/, const char * /*Value*/ ) +void CSettingTypeTempBool::Save(int /*Index*/, const char * /*Value*/) { g_Notify->BreakPoint(__FILE__, __LINE__); } -void CSettingTypeTempBool::Delete( int /*Index*/ ) +void CSettingTypeTempBool::Delete(int /*Index*/) { g_Notify->BreakPoint(__FILE__, __LINE__); -} +} \ No newline at end of file diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.h b/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.h index c96ad9e34..51218c40c 100644 --- a/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.h +++ b/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.h @@ -16,31 +16,33 @@ class CSettingTypeTempBool : public CSettingType { public: - CSettingTypeTempBool(bool initialValue ); + CSettingTypeTempBool(bool initialValue, const char * name = NULL); ~CSettingTypeTempBool(); - bool IndexBasedSetting ( void ) const { return false; } - SettingType GetSettingType ( void ) const { return SettingType_BoolVariable; } + bool IndexBasedSetting(void) const { return false; } + SettingType GetSettingType(void) const { return SettingType_BoolVariable; } bool IsSettingSet(void) const { return false; } + const char * GetName(void) const { return m_Name.c_str(); } + //return the values - bool Load ( int32_t Index, bool & Value ) const; - bool Load ( int32_t Index, uint32_t & Value ) const; - bool Load ( int32_t Index, stdstr & Value ) const; + bool Load(int32_t Index, bool & Value) const; + bool Load(int32_t Index, uint32_t & Value) const; + bool Load(int32_t Index, stdstr & Value) const; //return the default values - void LoadDefault ( int32_t Index, bool & Value ) const; - void LoadDefault ( int32_t Index, uint32_t & Value ) const; - void LoadDefault ( int32_t Index, stdstr & Value ) const; + void LoadDefault(int32_t Index, bool & Value) const; + void LoadDefault(int32_t Index, uint32_t & Value) const; + void LoadDefault(int32_t Index, stdstr & Value) const; //Update the settings - void Save ( int32_t Index, bool Value ); - void Save ( int32_t Index, uint32_t Value ); - void Save ( int32_t Index, const stdstr & Value ); - void Save ( int32_t Index, const char * Value ); + void Save(int32_t Index, bool Value); + void Save(int32_t Index, uint32_t Value); + void Save(int32_t Index, const stdstr & Value); + void Save(int32_t Index, const char * Value); // Delete the setting - void Delete ( int32_t Index ); + void Delete(int32_t Index); private: CSettingTypeTempBool(void); // Disable default constructor @@ -48,4 +50,5 @@ private: CSettingTypeTempBool& operator=(const CSettingTypeTempBool&); // Disable assignment bool m_value; + std::string m_Name; }; diff --git a/Source/Project64-core/Settings/Settings.h b/Source/Project64-core/Settings/Settings.h index e62612b25..55aa82039 100644 --- a/Source/Project64-core/Settings/Settings.h +++ b/Source/Project64-core/Settings/Settings.h @@ -153,6 +153,7 @@ enum SettingID Game_Transferpak_Sav, Game_LoadSaveAtStart, Game_OverClockModifier, + Game_FullSpeed, // General Game running info GameRunning_LoadingInProgress, diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp index 8d7f5b25d..902293761 100644 --- a/Source/Project64-core/Settings/SettingsClass.cpp +++ b/Source/Project64-core/Settings/SettingsClass.cpp @@ -226,6 +226,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Game_Transferpak_Sav, new CSettingTypeGame("Tpak-Sav-dir", Default_None)); AddHandler(Game_LoadSaveAtStart, new CSettingTypeTempBool(false)); AddHandler(Game_OverClockModifier, new CSettingTypeGame("OverClockModifier", Rdb_OverClockModifier)); + AddHandler(Game_FullSpeed, new CSettingTypeTempBool(true, "Full Speed")); //User Interface AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false)); @@ -420,7 +421,7 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) } return iter->first; } - if (Setting->GetSettingType() == SettingType_CfgFile) + else if (Setting->GetSettingType() == SettingType_CfgFile) { CSettingTypeApplication * CfgSetting = (CSettingTypeApplication *)Setting; if (_stricmp(CfgSetting->GetKeyName(), Name) != 0) @@ -429,7 +430,7 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) } return iter->first; } - if (Setting->GetSettingType() == SettingType_SelectedDirectory) + else if (Setting->GetSettingType() == SettingType_SelectedDirectory) { CSettingTypeSelectedDirectory * SelectedDirectory = (CSettingTypeSelectedDirectory *)Setting; if (_stricmp(SelectedDirectory->GetName(), Name) != 0) @@ -438,6 +439,15 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) } return iter->first; } + else if (Setting->GetSettingType() == SettingType_BoolVariable) + { + CSettingTypeTempBool * BoolSetting = (CSettingTypeTempBool *)Setting; + if (_stricmp(BoolSetting->GetName(), Name) != 0) + { + continue; + } + return iter->first; + } } return 0; } From 34055759e456c203f731c2ea74f11d204c4b816a Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 29 Sep 2017 05:32:43 +1000 Subject: [PATCH 06/35] [Audio] Be able to tall if limit fps by core --- Source/Project64-audio/AudioMain.cpp | 9 +++++++++ Source/Project64-audio/AudioSettings.cpp | 10 +++++++++- Source/Project64-audio/AudioSettings.h | 1 + Source/Project64-audio/Driver/DirectSound.cpp | 4 ++-- Source/Project64-audio/Driver/SoundBase.cpp | 2 +- Source/Project64-audio/Driver/SoundBase.h | 2 +- .../Settings/SettingType/SettingsType-TempBool.cpp | 6 +++--- Source/Project64-core/Settings/SettingsClass.cpp | 2 +- 8 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Source/Project64-audio/AudioMain.cpp b/Source/Project64-audio/AudioMain.cpp index 08d3ba5f2..507359d1d 100644 --- a/Source/Project64-audio/AudioMain.cpp +++ b/Source/Project64-audio/AudioMain.cpp @@ -86,6 +86,15 @@ EXPORT void CALL AiDacrateChanged(int SystemType) case SYSTEM_MPAL: video_clock = 48628316; break; } uint32_t Frequency = video_clock / (g_Dacrate + 1); + + if ((Frequency > 7000) && (Frequency < 9000)) { Frequency = 8000; } + else if ((Frequency > 10000) && (Frequency < 12000)) { Frequency = 11025; } + else if ((Frequency > 15000) && (Frequency < 17000)) { Frequency = 16000; } + else if ((Frequency > 21000) && (Frequency < 23000)) { Frequency = 22050; } + else if ((Frequency > 31000) && (Frequency < 33000)) { Frequency = 32000; } + else if ((Frequency > 43000) && (Frequency < 45000)) { Frequency = 44100; } + else if ((Frequency > 47000) && (Frequency < 49000)) { Frequency = 48000; } + g_SoundDriver->AI_SetFrequency(Frequency); } WriteTrace(TraceAudioInterface, TraceDebug, "Done"); diff --git a/Source/Project64-audio/AudioSettings.cpp b/Source/Project64-audio/AudioSettings.cpp index 86aefe22e..8f7044de0 100644 --- a/Source/Project64-audio/AudioSettings.cpp +++ b/Source/Project64-audio/AudioSettings.cpp @@ -19,6 +19,7 @@ CSettings::CSettings() : m_Set_EnableAudio(0), m_Set_SyncAudio(0), m_Set_FullSpeed(0), + m_Set_LimitFPS(0), m_Set_basic_mode(0), m_Set_debugger(0), m_Set_log_dir(0), @@ -43,6 +44,7 @@ CSettings::CSettings() : if (m_Set_log_flush != 0) { SettingsRegisterChange(true, m_Set_log_flush, this, stSettingsChanged); } if (m_Set_SyncAudio != 0) { SettingsRegisterChange(true, m_Set_SyncAudio, 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); } SettingsRegisterChange(false, Set_Volume, this, stSettingsChanged); SettingsRegisterChange(false, Set_Logging_MD5, this, stLogLevelChanged); @@ -61,6 +63,7 @@ CSettings::~CSettings() if (m_Set_log_flush != 0) { SettingsUnregisterChange(true, m_Set_log_flush, this, stSettingsChanged); } if (m_Set_SyncAudio != 0) { SettingsUnregisterChange(true, m_Set_SyncAudio, 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); } SettingsUnregisterChange(false, Set_Volume, this, stSettingsChanged); SettingsUnregisterChange(false, Set_Logging_MD5, this, stLogLevelChanged); @@ -77,6 +80,7 @@ void CSettings::RegisterSettings(void) m_Set_EnableAudio = FindSystemSettingId("Enable Audio"); m_Set_SyncAudio = FindSystemSettingId("Sync Audio"); m_Set_FullSpeed = FindSystemSettingId("Full Speed"); + m_Set_LimitFPS = FindSystemSettingId("Limit FPS"); m_Set_basic_mode = FindSystemSettingId("Basic Mode"); m_Set_debugger = FindSystemSettingId("Debugger"); m_Set_log_flush = FindSystemSettingId("Log Auto Flush"); @@ -133,15 +137,19 @@ void CSettings::LogLevelChanged(void) void CSettings::ReadSettings(void) { + bool SyncAudio = m_Set_SyncAudio ? GetSystemSetting(m_Set_SyncAudio) != 0 : false; + bool bLimitFPS = m_Set_LimitFPS ? GetSystemSetting(m_Set_LimitFPS) != 0 : true; + m_Volume = GetSetting(Set_Volume); 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_debugger_enabled = m_advanced_options && m_Set_debugger ? GetSystemSetting(m_Set_debugger) == 1 : false; m_BufferDivider = GetSetting(Set_BufferDivider); m_BufferLevel = GetSetting(Set_BufferLevel); - m_SyncAudio = m_Set_SyncAudio ? GetSystemSetting(m_Set_SyncAudio) != 0 : false; m_FullSpeed = m_Set_FullSpeed ? GetSystemSetting(m_Set_FullSpeed) != 0 : false; + m_SyncAudio = ((!m_advanced_options || bLimitFPS) && SyncAudio && m_FullSpeed); + if (m_Set_log_dir != 0) { GetSystemSettingSz(m_Set_log_dir, m_log_dir, sizeof(m_log_dir)); diff --git a/Source/Project64-audio/AudioSettings.h b/Source/Project64-audio/AudioSettings.h index da4a79e9c..dd7cd40ea 100644 --- a/Source/Project64-audio/AudioSettings.h +++ b/Source/Project64-audio/AudioSettings.h @@ -48,6 +48,7 @@ private: short m_Set_EnableAudio; short m_Set_SyncAudio; short m_Set_FullSpeed; + short m_Set_LimitFPS; short m_Set_basic_mode; short m_Set_debugger; short m_Set_log_dir; diff --git a/Source/Project64-audio/Driver/DirectSound.cpp b/Source/Project64-audio/Driver/DirectSound.cpp index 19d2df018..64c7d91e5 100644 --- a/Source/Project64-audio/Driver/DirectSound.cpp +++ b/Source/Project64-audio/Driver/DirectSound.cpp @@ -70,7 +70,7 @@ bool DirectSoundDriver::Initialize() WAVEFORMATEX wfm = { 0 }; wfm.wFormatTag = WAVE_FORMAT_PCM; wfm.nChannels = 2; - wfm.nSamplesPerSec = 44100; + wfm.nSamplesPerSec = 48000; wfm.wBitsPerSample = 16; wfm.nBlockAlign = wfm.wBitsPerSample / 8 * wfm.nChannels; wfm.nAvgBytesPerSec = wfm.nSamplesPerSec * wfm.nBlockAlign; @@ -206,7 +206,7 @@ void DirectSoundDriver::AudioThreadProc() break; } // Check to see if the audio pointer moved on to the next segment - if (write_pos == last_pos) + if (write_pos == 0) { WriteTrace(TraceAudioDriver, TraceVerbose, "Sleep"); Sleep(1); diff --git a/Source/Project64-audio/Driver/SoundBase.cpp b/Source/Project64-audio/Driver/SoundBase.cpp index ac1529744..d62b67854 100644 --- a/Source/Project64-audio/Driver/SoundBase.cpp +++ b/Source/Project64-audio/Driver/SoundBase.cpp @@ -108,7 +108,7 @@ void SoundDriverBase::AI_Update(bool Wait) uint32_t SoundDriverBase::AI_ReadLength() { CGuard guard(m_CS); - return m_AI_DMAPrimaryBytes & ~0x3; + return m_AI_DMAPrimaryBytes & ~0x7; } void SoundDriverBase::LoadAiBuffer(uint8_t *start, uint32_t length) diff --git a/Source/Project64-audio/Driver/SoundBase.h b/Source/Project64-audio/Driver/SoundBase.h index 61b9895f2..4d20907ac 100644 --- a/Source/Project64-audio/Driver/SoundBase.h +++ b/Source/Project64-audio/Driver/SoundBase.h @@ -30,7 +30,7 @@ public: virtual void StopAudio(); protected: - enum { MAX_SIZE = 44100 * 2 * 2 }; // Max Buffer Size (44100Hz * 16bit * Stereo) + enum { MAX_SIZE = 48000 * 2 * 2 }; // Max Buffer Size (44100Hz * 16bit * Stereo) virtual bool Initialize(); void LoadAiBuffer(uint8_t *start, uint32_t length); // Reads in length amount of audio bytes diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp b/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp index 66078bfb4..13a0231d8 100644 --- a/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp +++ b/Source/Project64-core/Settings/SettingType/SettingsType-TempBool.cpp @@ -27,10 +27,10 @@ bool CSettingTypeTempBool::Load(int /*Index*/, bool & Value) const return true; } -bool CSettingTypeTempBool::Load(int /*Index*/, uint32_t & /*Value*/) const +bool CSettingTypeTempBool::Load(int /*Index*/, uint32_t & Value) const { - g_Notify->BreakPoint(__FILE__, __LINE__); - return false; + Value = m_value ? 1 : 0; + return true; } bool CSettingTypeTempBool::Load(int /*Index*/, stdstr & /*Value*/) const diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp index 902293761..34f41cfa9 100644 --- a/Source/Project64-core/Settings/SettingsClass.cpp +++ b/Source/Project64-core/Settings/SettingsClass.cpp @@ -299,7 +299,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(GameRunning_CPU_Paused, new CSettingTypeTempBool(false)); AddHandler(GameRunning_CPU_PausedType, new CSettingTypeTempNumber(Default_None)); AddHandler(GameRunning_InstantSaveFile, new CSettingTypeTempString("")); - AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true)); + AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true, "Limit FPS")); AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60)); AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false)); From 80e1bcaad091883fa150aba5964ebb07a214f99f Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:29:45 +0100 Subject: [PATCH 07/35] Update AudioMain.cpp --- Source/Project64-audio/AudioMain.cpp | 39 +++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/Source/Project64-audio/AudioMain.cpp b/Source/Project64-audio/AudioMain.cpp index 507359d1d..f9a52e321 100644 --- a/Source/Project64-audio/AudioMain.cpp +++ b/Source/Project64-audio/AudioMain.cpp @@ -87,15 +87,36 @@ EXPORT void CALL AiDacrateChanged(int SystemType) } uint32_t Frequency = video_clock / (g_Dacrate + 1); - if ((Frequency > 7000) && (Frequency < 9000)) { Frequency = 8000; } - else if ((Frequency > 10000) && (Frequency < 12000)) { Frequency = 11025; } - else if ((Frequency > 15000) && (Frequency < 17000)) { Frequency = 16000; } - else if ((Frequency > 21000) && (Frequency < 23000)) { Frequency = 22050; } - else if ((Frequency > 31000) && (Frequency < 33000)) { Frequency = 32000; } - else if ((Frequency > 43000) && (Frequency < 45000)) { Frequency = 44100; } - else if ((Frequency > 47000) && (Frequency < 49000)) { Frequency = 48000; } + if (Frequency < 4000) + { + WriteTrace(TraceAudioDriver, TraceDebug, "Not Audio Data!"); + return; + } + else + { + int32_t BufferSize = 0; double audio_clock = 0; + double framerate1 = 59.94004; double framerate2 = 64; double framerate = 0; - g_SoundDriver->AI_SetFrequency(Frequency); + if (g_settings->FPSBuffer() == true) + { + framerate = framerate1; + } + else + { + framerate = framerate2; + } + if (g_settings->TinyBuffer() == true) + { + audio_clock = ((video_clock / framerate) * 2); + } + else + { + audio_clock = ((video_clock / framerate) * 4); + } + + BufferSize = (int32_t)audio_clock / (g_Dacrate) + 1 & ~0x1; + g_SoundDriver->AI_SetFrequency(Frequency, BufferSize); + } } WriteTrace(TraceAudioInterface, TraceDebug, "Done"); } @@ -233,4 +254,4 @@ extern "C" void UseUnregisteredSetting(int /*SettingID*/) #ifdef _WIN32 DebugBreak(); #endif -} \ No newline at end of file +} From e7ce869a2543520a41143a6a8b76648ebd9fad17 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:37:49 +0100 Subject: [PATCH 08/35] Update SoundBase.cpp --- Source/Project64-audio/Driver/SoundBase.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Project64-audio/Driver/SoundBase.cpp b/Source/Project64-audio/Driver/SoundBase.cpp index d62b67854..db5d2f8fb 100644 --- a/Source/Project64-audio/Driver/SoundBase.cpp +++ b/Source/Project64-audio/Driver/SoundBase.cpp @@ -34,10 +34,10 @@ bool SoundDriverBase::Initialize() return true; } -void SoundDriverBase::AI_SetFrequency(uint32_t Frequency) +void SoundDriverBase::AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize) { - SetFrequency(Frequency); - m_MaxBufferSize = (uint32_t)((Frequency / g_settings->BufferDivider())) * 4 * g_settings->BufferLevel(); + SetFrequency(Frequency, BufferSize); + m_MaxBufferSize = (BufferSize * 4); m_BufferRemaining = 0; m_CurrentReadLoc = m_CurrentWriteLoc = m_BufferRemaining = 0; } @@ -187,7 +187,7 @@ void SoundDriverBase::BufferAudio() WriteTrace(TraceAudioDriver, TraceVerbose, "Done (m_BufferRemaining: 0x%08X)", m_BufferRemaining); } -void SoundDriverBase::SetFrequency(uint32_t /*Frequency*/) +void SoundDriverBase::SetFrequency(uint32_t /*Frequency*/, uint32_t /*Divider*/) { } @@ -197,4 +197,4 @@ void SoundDriverBase::StartAudio() void SoundDriverBase::StopAudio() { -} \ No newline at end of file +} From cc466d97355d1743c99edef7a400f81c016a4e67 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:42:18 +0100 Subject: [PATCH 09/35] Update DirectSound.cpp --- Source/Project64-audio/Driver/DirectSound.cpp | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Source/Project64-audio/Driver/DirectSound.cpp b/Source/Project64-audio/Driver/DirectSound.cpp index 64c7d91e5..2dff729d3 100644 --- a/Source/Project64-audio/Driver/DirectSound.cpp +++ b/Source/Project64-audio/Driver/DirectSound.cpp @@ -119,11 +119,11 @@ void DirectSoundDriver::StartAudio() WriteTrace(TraceAudioDriver, TraceDebug, "Done"); } -void DirectSoundDriver::SetFrequency(uint32_t Frequency) +void DirectSoundDriver::SetFrequency(uint32_t Frequency, uint32_t BufferSize) { WriteTrace(TraceAudioDriver, TraceDebug, "Start (Frequency: 0x%08X)", Frequency); StopAudio(); - m_LOCK_SIZE = (uint32_t)((Frequency / g_settings->BufferDivider())) * 4; + m_LOCK_SIZE = (BufferSize * 2); SetSegmentSize(m_LOCK_SIZE, Frequency); StartAudio(); @@ -132,10 +132,16 @@ void DirectSoundDriver::SetFrequency(uint32_t Frequency) void DirectSoundDriver::SetVolume(uint32_t Volume) { - /*DWORD dsVolume = ((DWORD)Volume * -25); - if (Volume == 100) dsVolume = (DWORD)DSBVOLUME_MIN; - if (Volume == 0) dsVolume = DSBVOLUME_MAX; - if (lpdsb != NULL) lpdsb->SetVolume(dsVolume);*/ + LPDIRECTSOUNDBUFFER & lpdsb = (LPDIRECTSOUNDBUFFER &)m_lpdsb; + int32_t dsVolume = -((100 - (int32_t)Volume) * 25); + if (Volume == 0) + { + dsVolume = DSBVOLUME_MIN; + } + if (lpdsb != NULL) + { + lpdsb->SetVolume(dsVolume); + } } void DirectSoundDriver::SetSegmentSize(uint32_t length, uint32_t SampleRate) @@ -278,4 +284,4 @@ void DirectSoundDriver::AudioThreadProc() lpdsbuf->Stop(); } WriteTrace(TraceAudioDriver, TraceDebug, "Audio Thread Terminated..."); -} \ No newline at end of file +} From 705df0af562caa5743c077f748acfc845255d035 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:44:08 +0100 Subject: [PATCH 10/35] Update DirectSound.h --- Source/Project64-audio/Driver/DirectSound.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64-audio/Driver/DirectSound.h b/Source/Project64-audio/Driver/DirectSound.h index 84736639a..0f405c290 100644 --- a/Source/Project64-audio/Driver/DirectSound.h +++ b/Source/Project64-audio/Driver/DirectSound.h @@ -21,7 +21,7 @@ public: bool Initialize(); void StopAudio(); // Stops the Audio PlayBack (as if paused) void StartAudio(); // Starts the Audio PlayBack (as if unpaused) - void SetFrequency(uint32_t Frequency); + void SetFrequency(uint32_t Frequency, uint32_t BufferSize); void SetVolume(uint32_t Volume); private: @@ -37,4 +37,4 @@ private: void * m_lpdsbuf; void * m_handleAudioThread; uint32_t m_dwAudioThreadId; -}; \ No newline at end of file +}; From d655879372a689084129507ba4b4b4ad1a11279e Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:45:41 +0100 Subject: [PATCH 11/35] Update SoundBase.h --- Source/Project64-audio/Driver/SoundBase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64-audio/Driver/SoundBase.h b/Source/Project64-audio/Driver/SoundBase.h index 4d20907ac..8cdaf372a 100644 --- a/Source/Project64-audio/Driver/SoundBase.h +++ b/Source/Project64-audio/Driver/SoundBase.h @@ -18,14 +18,14 @@ class SoundDriverBase public: SoundDriverBase(); - void AI_SetFrequency(uint32_t Frequency); + void AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize); void AI_LenChanged(uint8_t *start, uint32_t length); void AI_Startup(); void AI_Shutdown(); void AI_Update(bool Wait); uint32_t AI_ReadLength(); - virtual void SetFrequency(uint32_t Frequency); + virtual void SetFrequency(uint32_t Frequency, uint32_t BufferSize); virtual void StartAudio(); virtual void StopAudio(); From b22869e118d8072d890f63251c88474388ea8c5c Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:49:08 +0100 Subject: [PATCH 12/35] Update SettingsID.h --- Source/Project64-audio/SettingsID.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64-audio/SettingsID.h b/Source/Project64-audio/SettingsID.h index 35ccac7fa..53b445c2c 100644 --- a/Source/Project64-audio/SettingsID.h +++ b/Source/Project64-audio/SettingsID.h @@ -20,6 +20,6 @@ enum Set_Logging_InitShutdown, Set_Logging_Interface, Set_Logging_Driver, - Set_BufferDivider, - Set_BufferLevel, -}; \ No newline at end of file + Set_TinyBuffer, + Set_FPSBuffer, +}; From 96d424701376ec5183f57c667615a370d85704e4 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:49:49 +0100 Subject: [PATCH 13/35] Update SettingsID.h --- Source/Project64-audio/SettingsID.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64-audio/SettingsID.h b/Source/Project64-audio/SettingsID.h index 53b445c2c..f33316e6e 100644 --- a/Source/Project64-audio/SettingsID.h +++ b/Source/Project64-audio/SettingsID.h @@ -21,5 +21,5 @@ enum Set_Logging_Interface, Set_Logging_Driver, Set_TinyBuffer, - Set_FPSBuffer, + Set_FPSBuffer, }; From ee46ffb2cd2faaa87295c8b28c79ced0961cfd4d Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:53:36 +0100 Subject: [PATCH 14/35] Update AudioSettings.h --- Source/Project64-audio/AudioSettings.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Project64-audio/AudioSettings.h b/Source/Project64-audio/AudioSettings.h index dd7cd40ea..7dd0629ed 100644 --- a/Source/Project64-audio/AudioSettings.h +++ b/Source/Project64-audio/AudioSettings.h @@ -19,8 +19,8 @@ public: inline bool AudioEnabled(void) const { return m_AudioEnabled; } inline bool debugger_enabled(void) const { return m_debugger_enabled; } inline uint32_t GetVolume(void) const { return m_Volume; } - inline uint32_t BufferDivider(void) const { return m_BufferDivider; } - inline uint32_t BufferLevel(void) const { return m_BufferLevel; } + inline bool TinyBuffer(void) const { return m_TinyBuffer; } + inline bool FPSBuffer(void) const { return m_FPSBuffer; } inline bool SyncAudio(void) const { return m_SyncAudio; } inline bool FullSpeed(void) const { return m_FullSpeed; } inline bool FlushLogs(void) const { return m_FlushLogs; } @@ -28,8 +28,8 @@ public: void SetAudioEnabled(bool Enabled); void SetVolume(uint32_t Volume); - void SetBufferDivider(uint32_t BufferDivider); - void SetBufferLevel(uint32_t BufferLevel); + void SetTinyBuffer(bool TinyBuffer); + void SetFPSBuffer(bool FPSBuffer); void ReadSettings(); private: @@ -59,8 +59,8 @@ private: bool m_advanced_options; bool m_debugger_enabled; uint32_t m_Volume; - uint32_t m_BufferDivider; - uint32_t m_BufferLevel; + bool m_TinyBuffer; + bool m_FPSBuffer; bool m_SyncAudio; bool m_FullSpeed; }; From d45d9a7b446fa9e75f74239d2733f7b39709f398 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:57:24 +0100 Subject: [PATCH 15/35] Update AudioSettings.cpp --- Source/Project64-audio/AudioSettings.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Project64-audio/AudioSettings.cpp b/Source/Project64-audio/AudioSettings.cpp index 8f7044de0..3a126a455 100644 --- a/Source/Project64-audio/AudioSettings.cpp +++ b/Source/Project64-audio/AudioSettings.cpp @@ -29,8 +29,8 @@ CSettings::CSettings() : m_advanced_options(false), m_debugger_enabled(false), m_Volume(100), - m_BufferDivider(90), - m_BufferLevel(4), + m_TinyBuffer(true), + m_FPSBuffer(true), m_SyncAudio(false), m_FullSpeed(true) { @@ -94,8 +94,8 @@ void CSettings::RegisterSettings(void) 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_Driver, Data_DWORD_General, "Driver", "Logging", g_ModuleLogLevel[TraceAudioDriver], NULL); - RegisterSetting(Set_BufferDivider, Data_DWORD_Game, "BufferDivider", "", 90, NULL); - RegisterSetting(Set_BufferLevel, Data_DWORD_Game, "BufferLevel", "", 4, NULL); + RegisterSetting(Set_TinyBuffer, Data_DWORD_Game, "TinyBuffer", "", (bool)true, NULL); + RegisterSetting(Set_FPSBuffer, Data_DWORD_Game, "FPSBuffer", "", (bool)true, NULL); LogLevelChanged(); } @@ -115,14 +115,14 @@ void CSettings::SetVolume(uint32_t Volume) } } -void CSettings::SetBufferDivider(uint32_t BufferDivider) +void CSettings::SetTinyBuffer(bool TinyBuffer) { - SetSetting(Set_BufferDivider, BufferDivider); + SetSetting(Set_TinyBuffer, TinyBuffer ? 1 : 0); } -void CSettings::SetBufferLevel(uint32_t BufferLevel) +void CSettings::SetFPSBuffer(bool FPSBuffer) { - SetSetting(Set_BufferLevel, BufferLevel); + SetSetting(Set_FPSBuffer, FPSBuffer ? 1 : 0); } void CSettings::LogLevelChanged(void) @@ -144,8 +144,8 @@ void CSettings::ReadSettings(void) 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_debugger_enabled = m_advanced_options && m_Set_debugger ? GetSystemSetting(m_Set_debugger) == 1 : false; - m_BufferDivider = GetSetting(Set_BufferDivider); - m_BufferLevel = GetSetting(Set_BufferLevel); + m_TinyBuffer = GetSetting(Set_TinyBuffer) != 0; + m_FPSBuffer = GetSetting(Set_FPSBuffer) != 0; m_FullSpeed = m_Set_FullSpeed ? GetSystemSetting(m_Set_FullSpeed) != 0 : false; m_SyncAudio = ((!m_advanced_options || bLimitFPS) && SyncAudio && m_FullSpeed); @@ -172,4 +172,4 @@ void CleanupAudioSettings(void) delete g_settings; g_settings = NULL; } -} \ No newline at end of file +} From 4ea253d22dc1e9c8b6f9185450b551321c49cec3 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 01:58:35 +0100 Subject: [PATCH 16/35] Update AudioSettings.cpp --- Source/Project64-audio/AudioSettings.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Project64-audio/AudioSettings.cpp b/Source/Project64-audio/AudioSettings.cpp index 3a126a455..0d05f9721 100644 --- a/Source/Project64-audio/AudioSettings.cpp +++ b/Source/Project64-audio/AudioSettings.cpp @@ -30,7 +30,7 @@ CSettings::CSettings() : m_debugger_enabled(false), m_Volume(100), m_TinyBuffer(true), - m_FPSBuffer(true), + m_FPSBuffer(true), m_SyncAudio(false), m_FullSpeed(true) { @@ -95,7 +95,7 @@ void CSettings::RegisterSettings(void) 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_TinyBuffer, Data_DWORD_Game, "TinyBuffer", "", (bool)true, NULL); - RegisterSetting(Set_FPSBuffer, Data_DWORD_Game, "FPSBuffer", "", (bool)true, NULL); + RegisterSetting(Set_FPSBuffer, Data_DWORD_Game, "FPSBuffer", "", (bool)true, NULL); LogLevelChanged(); } @@ -117,12 +117,12 @@ void CSettings::SetVolume(uint32_t Volume) void CSettings::SetTinyBuffer(bool TinyBuffer) { - SetSetting(Set_TinyBuffer, TinyBuffer ? 1 : 0); + SetSetting(Set_TinyBuffer, TinyBuffer ? 1 : 0); } void CSettings::SetFPSBuffer(bool FPSBuffer) { - SetSetting(Set_FPSBuffer, FPSBuffer ? 1 : 0); + SetSetting(Set_FPSBuffer, FPSBuffer ? 1 : 0); } void CSettings::LogLevelChanged(void) @@ -145,7 +145,7 @@ void CSettings::ReadSettings(void) 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_TinyBuffer = GetSetting(Set_TinyBuffer) != 0; - m_FPSBuffer = GetSetting(Set_FPSBuffer) != 0; + m_FPSBuffer = GetSetting(Set_FPSBuffer) != 0; m_FullSpeed = m_Set_FullSpeed ? GetSystemSetting(m_Set_FullSpeed) != 0 : false; m_SyncAudio = ((!m_advanced_options || bLimitFPS) && SyncAudio && m_FullSpeed); From e31d4efc8dac0b36a1d9503d3cbdeb82dd4ede49 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 02:05:07 +0100 Subject: [PATCH 17/35] Update ConfigUI.cpp --- Source/Project64-audio/ConfigUI.cpp | 44 +++++++++++------------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/Source/Project64-audio/ConfigUI.cpp b/Source/Project64-audio/ConfigUI.cpp index c9af36cad..9625153d7 100644 --- a/Source/Project64-audio/ConfigUI.cpp +++ b/Source/Project64-audio/ConfigUI.cpp @@ -103,48 +103,38 @@ public: BEGIN_MSG_MAP(CDebugSettings) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_HANDLER(IDC_BUFFER_DIVIDER, EN_CHANGE, ItemChanged) - COMMAND_HANDLER(IDC_BUFFER_LEVEL, EN_CHANGE, ItemChanged) + COMMAND_ID_HANDLER_EX(IDC_TINYBUFFER, ItemChanged) + COMMAND_ID_HANDLER_EX(IDC_FPSBUFFER, ItemChanged) CHAIN_MSG_MAP(CPropertyPageImpl) END_MSG_MAP() LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { - m_BufferDivider.Attach(GetDlgItem(IDC_BUFFER_DIVIDER)); - m_BufferDivider.SetWindowText(stdstr_f("%d", g_settings->BufferDivider()).c_str()); - - m_BufferLevel.Attach(GetDlgItem(IDC_BUFFER_LEVEL)); - m_BufferLevel.SetWindowText(stdstr_f("%d", g_settings->BufferLevel()).c_str()); + m_btnTinyBuffer.Attach(GetDlgItem(IDC_TINYBUFFER)); + m_btnTinyBuffer.SetCheck(g_settings->TinyBuffer() ? BST_CHECKED : BST_UNCHECKED); + m_btnFPSBuffer.Attach(GetDlgItem(IDC_FPSBUFFER)); + m_btnFPSBuffer.SetCheck(g_settings->FPSBuffer() ? BST_CHECKED : BST_UNCHECKED); return TRUE; } bool OnApply() { - char buffer[100]; - m_BufferDivider.GetWindowText(buffer, sizeof(buffer)); - g_settings->SetBufferDivider(atoi(buffer)); - m_BufferLevel.GetWindowText(buffer, sizeof(buffer)); - g_settings->SetBufferLevel(atoi(buffer)); - + g_settings->SetTinyBuffer(m_btnTinyBuffer.GetCheck() == BST_CHECKED); + g_settings->SetFPSBuffer(m_btnFPSBuffer.GetCheck() == BST_CHECKED); FlushSettings(); return true; } private: - CEdit m_BufferDivider; - CEdit m_BufferLevel; + CButton m_btnTinyBuffer; + CButton m_btnFPSBuffer; - LRESULT ItemChangedNotify(NMHDR* /*pNMHDR*/) - { - SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); - return 0; - } - - LRESULT ItemChanged(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) - { - SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); - return 0; - } + void ItemChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) + { + SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); + g_settings->SetTinyBuffer(m_btnTinyBuffer.GetCheck() == BST_CHECKED); + g_settings->SetFPSBuffer(m_btnFPSBuffer.GetCheck() == BST_CHECKED); + } }; class CLogSettings : @@ -271,4 +261,4 @@ CAudioUI::~CAudioUI() void ConfigAudio(void * hParent) { CAudioUI().DoModal((HWND)hParent); -} \ No newline at end of file +} From f44ca6a203569f59136beb37ded3a4e82f68e42d Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 02:06:38 +0100 Subject: [PATCH 18/35] Update ConfigUI.cpp --- Source/Project64-audio/ConfigUI.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Project64-audio/ConfigUI.cpp b/Source/Project64-audio/ConfigUI.cpp index 9625153d7..61449d5da 100644 --- a/Source/Project64-audio/ConfigUI.cpp +++ b/Source/Project64-audio/ConfigUI.cpp @@ -130,11 +130,11 @@ private: CButton m_btnFPSBuffer; void ItemChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) - { - SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); - g_settings->SetTinyBuffer(m_btnTinyBuffer.GetCheck() == BST_CHECKED); - g_settings->SetFPSBuffer(m_btnFPSBuffer.GetCheck() == BST_CHECKED); - } + { + SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); + g_settings->SetTinyBuffer(m_btnTinyBuffer.GetCheck() == BST_CHECKED); + g_settings->SetFPSBuffer(m_btnFPSBuffer.GetCheck() == BST_CHECKED); + } }; class CLogSettings : From 5275ebe50e0652d850568123772611ab2c757465 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 02:08:59 +0100 Subject: [PATCH 19/35] Update resource.h --- Source/Project64-audio/resource.h | Bin 2382 -> 1193 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Source/Project64-audio/resource.h b/Source/Project64-audio/resource.h index e5e8000f8f1fa8e1e283351cdf86b3e3008c0fa7..0e0db1f81fe7de4d0997d0995ba7e0872a66e63e 100644 GIT binary patch literal 1193 zcmZ{j-)@^Q6vpo>^&KqjvT9?xbW1M@n8YgB2phIsSu~i93W3C*byL+R>%|^vuP}q! z5Ick$Bm3v$?|kQ+e{X*mieG#2h;vLf%;YWjS%)`vfIjF`czFyvLWSI|W6wj8i2`6jXz8>UvUBi2 z-|BQi{Ww6Uafcm6YqA{?#QY39(uQs)SPLH64icfwxB43vv^4)5G0~V{F4#8aF8xNv zYZknPy6$6|qsUXQ93D`#;mJhXv5Qq3ML79zQ_+Se{5yZw&9@P<-9upYW5KV6?unku za%JeAXj~PYU_bjVtDmd)ELVo^BbuCMxjL(RF3Xis%gK|uEbo=>aaxG{-2pWbX3SW}-(r4{P7 zAV?J;LX5_d>Yc>)<3nvNcsB<-Gze_s>MU47Z8)abYN~leeFInRe$>DdtwbU-^w0=H Ltz?xI`LzBA0|+mz literal 2382 zcmb7`-EPxB5Ju-3iFb&^C89}6f%MW%(lo+Jqc{olDx#r*ps11ZL#Yt24xDf8;F8*F zS1Zfj_4>^0x3e?;^Sf$Q`$_BDrA@76Z5wd)-BaJ1)}gYJZcEF z13f~k5v_}j4!t6N-D>vQOYT^J+U-Z|GUSt7aueQ}jnUy8_K;o+pC?Ww^?h{tT(kNU z*daD1T%ngMn=$*?%buWhi0@Lx=jY+On4Pb-H0i+|J&~LG?bo{r{R|r;^bLqZ?dgE0 zkzIJ#A;0UEAAj;Yi>(;!LRVB?xOKHq?gOK#GGZTd<((KGTRIJipLi`PbN>{x{c)1z zcYv>o#yA@dU0fcl~>YC53P_b1v@+wD`-*K(h`PF*;bopJwMplGou_N?U1u61c U=S%E;9@F29{yFA}rT_bX0eIXnaR2}S From ab764b723b5c7ed909a63c50d6a32abb30d7046c Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 02:10:30 +0100 Subject: [PATCH 20/35] Update Project64-audio.rc --- Source/Project64-audio/Project64-audio.rc | Bin 10952 -> 5408 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Source/Project64-audio/Project64-audio.rc b/Source/Project64-audio/Project64-audio.rc index 965b1e2afbddc5c3672194d8a5402bdaebf9f48b..0e222e86336d050507db508ba2f8a6e09e48d441 100644 GIT binary patch literal 5408 zcmc&&ZExC05dMzDf7o-sTvcDgTS9W*jJ-Ci7_a4BQ;;fI6bx8L?8=yHEA^kW^bE~tE*yfrgzZ`Toh;Mjfn@8DNIH?s(QV(Lq_f}P(at_aF>J2H ze@19If4dk6ImN~W_#iZ1ZKCa({O-pQ+E!#>;_d4_1>3@cOY&P`t;O$}IRQ%v?t3~7 z4BLK9zJ4Y3L8*CGKpp>evtetFF&BRb8!XMN-0v}9`ezH6ufH`A+PmK%g z8dcU!UU){c(XMxrW@A7t<}@1wo|;p?Z-HA=2Y@vjof8s|AB3{^8|8iaJ_hkzWnEGC zgre`syb9w*v_w^~o&8s|rw#F4iaaBlZIV^R8#9bR=Z?uNVld6-7M+lmioe}zxQ(?)q-=s%x%f+$kC`VFV7= zY*f992(v7TS6iSqSAMG!Wh97Lhno#CHY-IXy;cFK^|^guSpY6QZX=EPqbMpf^kB?w ze?(Q~VLQ(@+aOD4^S?gK(r!mlSn0mM+d>wE(EN~9EXHc(rm)bx` z?y9$HyQg+L>P=sT9nwi4qy~zpVbQ`ZERXx{fKT>##>r;)5EiJ4$!ZsVde`b*uMj!f z!f2P30wZ6-CI-7KOJYSWf$Kx6-{TTF%a6!zL2pNGxAyLhh6Qt?%^*Bl;#Zm1PF5>0 z?+dJZ#HIv8qAK-|w%P|8+r5_Bz5xeCzHQ6{74h(2k?S;^E&eRXmlGLCPlK>0hnTC> zHi-At>uaD)6(VrJBg|=K5=db+E22y3qrstkAIR>i_!oRr2jdtXcMbl|fiQ{Q1P(G5 zIyk3&V5#q5b!XZ72&t>dAuiHwzXWG44fs0!v!P^=XRgG0mo1V{@ey1c4XRPZ-Rr#s zH*=T_#L$;WCPMFlvCl*^i?c9Y&gS7Uct=vt1ph$b*S9YNUa0`M;8^DZt?d?3LX0%} zJ4}yoYkBo$cnpGA?vO9?l>;q+`{wQ?=*zr{fyaWZP(_|!6?m-KLrBh?=^<5sPF;*Q#f72BQOF;W)SHN<WX-{%*8Giyil|l zR4~h7j>)T1;=4tlPJX@b$ z#;M9vX5~@iyf_n3JO=1!1cDqk3a29`vuW9bmc$2|0d`|ehcm(4uEz~um-UG_tL&~# zL^;#eEHTo=eW4EO&7}=G_CrN?eWhHYoWjN9IJ{M0I2@636>{p*+Kg%(yUQ7Hx~flV zeQv?>HDeEKuHO?yWGU1^X0!=eyiCe7No^V~Qci94T6eA92R!#wOFx;2-DA!6DN#_P z5f)biaM*{+d%uYQzFgg7c_j~ZuSb;p2vq5OqNKDVD#%BknB}yBJWI#3jROI^)PPhm zOwo>J2Tq<`PC>B4)oi0DAHSs0YMtdeP=n6hX&x(1ug^g$g7uM&xWItY97GwekKXV+ z1~*L>yLndIM9yXDca{93RcZ{DqID7xz!R7K#wPMl7ZvSaN-r4C($n5jIsjDI@pd!I z3gfpvgY&={u+yr?%`$jiCIH|KMR5)dY;DSYS%ref3_-pzr{>ZpPC!2+SP#BGyy8LB w{DJG4Gjmwn8bBI8yp7u5Dx7(_vJiOYO0K)Vk1DU^E^xDPz}3zC6OG+nY@#^oXZ0DM3%@KA#WiU@bYZv0bd5F12#-Z1K4mD)jW7r8Hywv?xyWA$3-yA4}?A!YPEK)pTWSetB(F-py;e)%k*aD|b#XM2+|im!Z6{aUtTZ_W8L#Mp{{WgQuL{=Ouu z{-z|a;kRCciMCcGS{7+kT~ni*%6Xvv_!yQ(o3V>NBG2Efvd!m+>1KJBv^K7trx9lU zOk;&}_#Dq=%Dauy1}wa;Yi<+&TR?;BaSc}6Qwx8EoNcvc`>led75!h4XSmo8*YP8? z;JVeoKd#*S$ZKl9L*&xaSjhqM8rpvo{-uWXovo5`YVitrtbK&r%6`*c`)J#T*XRei zb@bAQG)58Kpu~Eh1bQ%Pnyp(xzbEjwOQ1xryogzwX#QNsT7sU`WuU9}RAa9Oeos-K zo^BTyrBT|JKYo$X}pz3442k z*zI?Di*znk*f_NsLN@23hL%J0K!ob>pN^@QkI?HON)2hxWz;o*y_e}YA@5&QA{S2MbQm&qb14!VyOgw!y4irzDi9Ib}YP`!jA>wu5x38G{D9Cfe zArG_XvA#R#sRBMx*U)>r#hP`xomuqQ(wY6XthWQ?PjQ*`+KO}6wtF=wneW}1M3*=(Sm(n zMR_KjdOT5!Aj`_&4gEw{Exrw}eY9dFwhMC>yEc}(UDS22cA5NV@Jz0SKbzmI$ClGj zyYIsz^k6642Qr#;-(;3ELQY-lF_JCzLpQ^<4@9{qyBgEJdM-w|h9_6V`@%DkZTRh| zXWcX`+wp#83p4dzJ>)U$^b>NgM%UZYw}ovT?_FJ4?uWmO1KVm<+|zI!b!L`x|{-z;a1HZYaIEN={0Pi#T zLvg>F>5R+#?2CS{jhKe$JL=Ew(XSNiVt7AA?BtB+n!#1$u6%ZW#M1&N8UJQuo^Nfx z(trq*aN$pxX5UpI+5KhGloZqKFFvD9A`8V!Nb^2%k~XC zB}?yJUf^G{=HF~(XN*31!vpB3&MqFA#XWjptH+|f|ewEXq( z;9i;5-q9W%i>k(C_lHFXn9y5IuZ2T3p0R2?Q-(umt?9Ff&3fjXQ6o>u1agdL9$e$Q z;A-!4DQofOsn^X;C3!Y#JZJ3MRT;&y@=piYK6@@h=B4*`)XwAZ{9e42Tx-H!58y$0 zqD!sVo1NWwEl;@)wGiv9)~~`2!u_+i;l6+#p$8dRDYS3f$$IUOF`nyVF51~{^7!rC zBRleZe7^)%=CR0-qE+!Sv?A=a^3IWcCN`HZ33G0Lmb+QrDXoorC{Ov$H~n7K^O^GI zewb&3Tv_SQcnUgJE2l?e>vT!l(?#$LZLC4I7A38n37%RH^+DUY6~NA4Y6YOEacQ*OGx%{wKt_|CW5SYHjZ`f1P<}%OYwMLk2o_7d7Xz@Zr?@&&XeuyXV?c! zVd=IT2z78)(bjD*-Bm<+#+U4(cuu$u3XB?0ReBwa`6z!Wn@(|BvjnDGd3d=FJY(;} z29mhqHskNbvdCVJ-?_nm{w5%i&9@bdW{3kBm3Xi(fkPjbhR5IiW8YVK(NU=Vl$>5{}u<(`T^$DSGC+I(}bd zT%-3h&qL-_a3;soi8P*xw#gIA(`)W#J-c?E@(s0p&yn5%jKSy{EQ?=v40XgD1>5lU zcshKyd%b@0{r-CIqwY##QRI7Ftgb)C;#l*`e95y}+)HcYT=LX*!8=QyS@-mGV8Sj_hs{4T#iUHx`*b>7+2e`v!N3jhEB From 771e719a1952858a8d6985fdb0818dd442bee2cf Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 03:19:59 +0100 Subject: [PATCH 21/35] Update Project64-audio.rc fix broken dialog --- Source/Project64-audio/Project64-audio.rc | 48 ++++++++++++----------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/Source/Project64-audio/Project64-audio.rc b/Source/Project64-audio/Project64-audio.rc index 0e222e863..c7636ae38 100644 --- a/Source/Project64-audio/Project64-audio.rc +++ b/Source/Project64-audio/Project64-audio.rc @@ -1,9 +1,7 @@ -// Microsoft Visual C++ generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" -#include "Version.h" - #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // @@ -46,7 +44,6 @@ END #endif // APSTUDIO_INVOKED - ///////////////////////////////////////////////////////////////////////////// // // Dialog @@ -85,10 +82,11 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM CAPTION "Game Settings" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "Tiny Buffer",IDC_TINYBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,46,59,10 - CONTROL "FPS Buffer",IDC_FPSBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,31,59,10 + CONTROL "FPS Buffer",IDC_FPSBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,50,10 + CONTROL "Tiny Buffer",IDC_TINYBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,36,51,10 END + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -112,8 +110,8 @@ BEGIN BOTTOMMARGIN, 170 END - IDD_GAME_SETTING, DIALOG - BEGIN + IDD_GAME_SETTING, DIALOG + BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 304 BOTTOMMARGIN, 170 @@ -121,31 +119,36 @@ BEGIN END #endif // APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO - FILEVERSION VER_FILE_VERSION - PRODUCTVERSION VER_PRODUCT_VERSION - FILEFLAGSMASK 0x1fL - FILEFLAGS VER_FILEFLAGS - FILEOS VER_FILEOS - FILETYPE VER_FILETYPE - FILESUBTYPE 0x0L + FILEVERSION 1,0,1,9999 + PRODUCTVERSION 1,0,1,9999 + FILEFLAGSMASK 0x1fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN - VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0" - VALUE "FileVersion", VER_FILE_VERSION_STR "\0" - VALUE "InternalName", VER_INTERNAL_NAME_STR "\0" - VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0" - VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0" - VALUE "ProductName", VER_PRODUCTNAME_STR - VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0" + VALUE "FileDescription", "Project64-audio" + VALUE "FileVersion", "1.0.1.9999" + VALUE "InternalName", "Project64-audio" + VALUE "LegalCopyright", "Copyright (C) 2017" + VALUE "OriginalFilename", "Project64-audio.dll" + VALUE "ProductName", "Project64-audio" + VALUE "ProductVersion", "1.0.1.9999" END END BLOCK "VarFileInfo" @@ -154,6 +157,7 @@ BEGIN END END + ///////////////////////////////////////////////////////////////////////////// // // AFX_DIALOG_LAYOUT From 125cbc79cf25aa79970bf5d097cf279ebc9bff54 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 03:21:14 +0100 Subject: [PATCH 22/35] Update resource.h fix broken dialog --- Source/Project64-audio/resource.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/Project64-audio/resource.h b/Source/Project64-audio/resource.h index 0e0db1f81..6de6540d9 100644 --- a/Source/Project64-audio/resource.h +++ b/Source/Project64-audio/resource.h @@ -1,14 +1,21 @@ -//{{NO_DEPENDENCIES}} +//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Project64-audio.rc // +#define VERSION_MINOR 0 +#define VER_VER_DEBUG 0 +#define VERSION_MAJOR 1 +#define VERSION_REVISION 1 #define IDD_CONFIG 9 #define IDD_LOG_SETTINGS 103 #define IDD_GAME_SETTING 104 -#define IDC_TINYBUFFER 1001 -#define IDC_FPSBUFFER 1002 +#define IDC_BUFFER_DIVIDER 1001 +#define IDC_BUFFER_LEVEL 1002 #define IDC_VOLUME 1003 #define IDC_MUTE 1004 +#define IDC_FPSBUFFER 1004 +#define IDC_CHECK2 1005 +#define IDC_TINYBUFFER 1005 #define IDC_CMB_TRACE_PATH 1019 #define IDC_CMB_TRACE_INIT_SHUTDOWN 1020 #define IDC_CMB_TRACE_INTERFACE 1021 @@ -19,6 +26,7 @@ #define IDC_TXT_TRACE_INTERFACE 1082 #define IDC_TXT_TRACE_AUDIO_DRIVER 1083 #define IDC_CMB_TRACE_THREAD 1090 +#define VERSION_BUILD 9999 // Next default values for new objects // @@ -26,7 +34,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1004 +#define _APS_NEXT_CONTROL_VALUE 1006 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif From dfdf089976f033d31e1ea62c3997cc85c9d092f4 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Fri, 13 Oct 2017 04:28:20 +0100 Subject: [PATCH 23/35] Update AudioMain.cpp --- Source/Project64-audio/AudioMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64-audio/AudioMain.cpp b/Source/Project64-audio/AudioMain.cpp index f9a52e321..260c4648c 100644 --- a/Source/Project64-audio/AudioMain.cpp +++ b/Source/Project64-audio/AudioMain.cpp @@ -156,7 +156,7 @@ EXPORT void CALL AiUpdate(int32_t Wait) } else { - pjutil::Sleep(1); + pjutil::Sleep(1); // TODO: Fixme -- Ai Update appears to be problematic } WriteTrace(TraceAudioInterface, TraceDebug, "Done"); } From 0f7a8c739b0d63251ede3729b4c47bdff869593b Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Sun, 15 Oct 2017 17:43:32 +0100 Subject: [PATCH 24/35] Update AudioMain.cpp Fix tabs/spaces --- Source/Project64-audio/AudioMain.cpp | 44 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Source/Project64-audio/AudioMain.cpp b/Source/Project64-audio/AudioMain.cpp index 260c4648c..70620d379 100644 --- a/Source/Project64-audio/AudioMain.cpp +++ b/Source/Project64-audio/AudioMain.cpp @@ -87,36 +87,36 @@ EXPORT void CALL AiDacrateChanged(int SystemType) } uint32_t Frequency = video_clock / (g_Dacrate + 1); - if (Frequency < 4000) - { - WriteTrace(TraceAudioDriver, TraceDebug, "Not Audio Data!"); - return; - } - else - { - int32_t BufferSize = 0; double audio_clock = 0; - double framerate1 = 59.94004; double framerate2 = 64; double framerate = 0; + if (Frequency < 4000) + { + WriteTrace(TraceAudioDriver, TraceDebug, "Not Audio Data!"); + return; + } + else + { + int32_t BufferSize = 0; double audio_clock = 0; + double framerate1 = 59.94004; double framerate2 = 64; double framerate = 0; - if (g_settings->FPSBuffer() == true) + if (g_settings->FPSBuffer() == true) { framerate = framerate1; } - else + else { framerate = framerate2; } - if (g_settings->TinyBuffer() == true) - { - audio_clock = ((video_clock / framerate) * 2); - } - else - { - audio_clock = ((video_clock / framerate) * 4); - } + if (g_settings->TinyBuffer() == true) + { + audio_clock = ((video_clock / framerate) * 2); + } + else + { + audio_clock = ((video_clock / framerate) * 4); + } - BufferSize = (int32_t)audio_clock / (g_Dacrate) + 1 & ~0x1; - g_SoundDriver->AI_SetFrequency(Frequency, BufferSize); - } + BufferSize = (int32_t)audio_clock / (g_Dacrate) + 1 & ~0x1; + g_SoundDriver->AI_SetFrequency(Frequency, BufferSize); + } } WriteTrace(TraceAudioInterface, TraceDebug, "Done"); } From 06e0dcfe23e1eb703a24e3d092f2745ac7092853 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Sun, 15 Oct 2017 17:47:23 +0100 Subject: [PATCH 25/35] fix tabs/spaces --- Source/Project64-audio/AudioSettings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Project64-audio/AudioSettings.h b/Source/Project64-audio/AudioSettings.h index 7dd0629ed..1632c3e65 100644 --- a/Source/Project64-audio/AudioSettings.h +++ b/Source/Project64-audio/AudioSettings.h @@ -20,7 +20,7 @@ public: inline bool debugger_enabled(void) const { return m_debugger_enabled; } inline uint32_t GetVolume(void) const { return m_Volume; } inline bool TinyBuffer(void) const { return m_TinyBuffer; } - inline bool FPSBuffer(void) const { return m_FPSBuffer; } + inline bool FPSBuffer(void) const { return m_FPSBuffer; } inline bool SyncAudio(void) const { return m_SyncAudio; } inline bool FullSpeed(void) const { return m_FullSpeed; } inline bool FlushLogs(void) const { return m_FlushLogs; } @@ -28,8 +28,8 @@ public: void SetAudioEnabled(bool Enabled); void SetVolume(uint32_t Volume); - void SetTinyBuffer(bool TinyBuffer); - void SetFPSBuffer(bool FPSBuffer); + void SetTinyBuffer(bool TinyBuffer); + void SetFPSBuffer(bool FPSBuffer); void ReadSettings(); private: @@ -60,7 +60,7 @@ private: bool m_debugger_enabled; uint32_t m_Volume; bool m_TinyBuffer; - bool m_FPSBuffer; + bool m_FPSBuffer; bool m_SyncAudio; bool m_FullSpeed; }; From f57e2f6bf775f43d3c6f0fd825547be971065bb7 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Sun, 15 Oct 2017 17:50:07 +0100 Subject: [PATCH 26/35] Fix tabs/spaces --- Source/Project64-audio/Driver/DirectSound.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Project64-audio/Driver/DirectSound.cpp b/Source/Project64-audio/Driver/DirectSound.cpp index 2dff729d3..354d923c1 100644 --- a/Source/Project64-audio/Driver/DirectSound.cpp +++ b/Source/Project64-audio/Driver/DirectSound.cpp @@ -132,16 +132,16 @@ void DirectSoundDriver::SetFrequency(uint32_t Frequency, uint32_t BufferSize) void DirectSoundDriver::SetVolume(uint32_t Volume) { - LPDIRECTSOUNDBUFFER & lpdsb = (LPDIRECTSOUNDBUFFER &)m_lpdsb; - int32_t dsVolume = -((100 - (int32_t)Volume) * 25); - if (Volume == 0) - { - dsVolume = DSBVOLUME_MIN; - } - if (lpdsb != NULL) - { - lpdsb->SetVolume(dsVolume); - } + LPDIRECTSOUNDBUFFER & lpdsb = (LPDIRECTSOUNDBUFFER &)m_lpdsb; + int32_t dsVolume = -((100 - (int32_t)Volume) * 25); + if (Volume == 0) + { + dsVolume = DSBVOLUME_MIN; + } + if (lpdsb != NULL) + { + lpdsb->SetVolume(dsVolume); + } } void DirectSoundDriver::SetSegmentSize(uint32_t length, uint32_t SampleRate) From 2686c98a8515c9a3ca06b32d22bb3cd7ef6dc6e6 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Sun, 15 Oct 2017 17:53:01 +0100 Subject: [PATCH 27/35] fix unlimited fps with tiny buffer --- Source/Project64-audio/Driver/SoundBase.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Project64-audio/Driver/SoundBase.cpp b/Source/Project64-audio/Driver/SoundBase.cpp index db5d2f8fb..26bf84cff 100644 --- a/Source/Project64-audio/Driver/SoundBase.cpp +++ b/Source/Project64-audio/Driver/SoundBase.cpp @@ -38,6 +38,10 @@ void SoundDriverBase::AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize) { SetFrequency(Frequency, BufferSize); m_MaxBufferSize = (BufferSize * 4); + if (g_settings->TinyBuffer() == true) + { + m_MaxBufferSize = m_MaxBufferSize * 2; + ] m_BufferRemaining = 0; m_CurrentReadLoc = m_CurrentWriteLoc = m_BufferRemaining = 0; } From d14e9b39ffac0095a04babd2ea552a4881981cc8 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Mon, 16 Oct 2017 06:23:55 +0100 Subject: [PATCH 28/35] Fix PAL framerate sync. PAL games were skipping because framerate was set for NTSC. --- Source/Project64-audio/AudioMain.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Project64-audio/AudioMain.cpp b/Source/Project64-audio/AudioMain.cpp index 70620d379..5b16a8392 100644 --- a/Source/Project64-audio/AudioMain.cpp +++ b/Source/Project64-audio/AudioMain.cpp @@ -94,16 +94,17 @@ EXPORT void CALL AiDacrateChanged(int SystemType) } else { - int32_t BufferSize = 0; double audio_clock = 0; - double framerate1 = 59.94004; double framerate2 = 64; double framerate = 0; + int32_t BufferSize = 0; double audio_clock = 0; double framerate = 0; if (g_settings->FPSBuffer() == true) { - framerate = framerate1; + framerate = 59.94004; + if (SystemType == SYSTEM_PAL) { framerate = 50; } } else { - framerate = framerate2; + framerate = 64; + if (SystemType == SYSTEM_PAL) { framerate = 53.33333; } } if (g_settings->TinyBuffer() == true) { From 6dd7f162eadb9abfa6b9ca70cf7e66701503ad6e Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 17 Oct 2017 07:14:23 +1100 Subject: [PATCH 29/35] Fix bracket --- Source/Project64-audio/Driver/SoundBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64-audio/Driver/SoundBase.cpp b/Source/Project64-audio/Driver/SoundBase.cpp index 26bf84cff..15a41aff4 100644 --- a/Source/Project64-audio/Driver/SoundBase.cpp +++ b/Source/Project64-audio/Driver/SoundBase.cpp @@ -41,7 +41,7 @@ void SoundDriverBase::AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize) if (g_settings->TinyBuffer() == true) { m_MaxBufferSize = m_MaxBufferSize * 2; - ] + } m_BufferRemaining = 0; m_CurrentReadLoc = m_CurrentWriteLoc = m_BufferRemaining = 0; } From 3b80425328d49218ee45ef8d8546b4d058cf8eef Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 17 Oct 2017 08:33:17 +1100 Subject: [PATCH 30/35] [Config] Fix up default files for config files --- Config/Project64.cfg.development | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Config/Project64.cfg.development b/Config/Project64.cfg.development index fa3563c36..d2e79b9a0 100644 --- a/Config/Project64.cfg.development +++ b/Config/Project64.cfg.development @@ -4,7 +4,8 @@ Auto Sleep=0 Basic Mode=0 Cheats=..\..\Config\Project64.cht ExtInfo=..\..\Config\Project64.rdx -Glide64RDB=..\..\Config\Glide64.rdb +VideoRDB=..\..\Config\Video.rdb +AudioRDB=..\..\Config\Audio.rdb Notes=..\..\Config\Project64.rdn RomDatabase=..\..\Config\Project64.rdb RomListCache=..\..\Config\Project64.cache3 From 4bcb0d10e9562d91aaa14ccdad678e47cdd7be5d Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 17 Oct 2017 08:34:02 +1100 Subject: [PATCH 31/35] [Audio] Read Sync Audio from Audio.rdb --- Config/Audio.rdb | 4 ++++ Source/Project64-core/Settings/SettingsClass.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Config/Audio.rdb b/Config/Audio.rdb index ea1ff6466..886012ffc 100644 --- a/Config/Audio.rdb +++ b/Config/Audio.rdb @@ -271,6 +271,10 @@ BufferDivider=60 [0F1FA987-BFC1AFA6-C:45] Good Name=Re-Volt (U) +[AA18B1A5-07DB6AEB-C:45] +Good Name=Resident Evil 2 (U) (V1.1) +Sync Audio=0 + [F050746C-247B820B-C:45] Good Name=Road Rash 64 (U) BufferDivider=60 diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp index 34f41cfa9..07445cb55 100644 --- a/Source/Project64-core/Settings/SettingsClass.cpp +++ b/Source/Project64-core/Settings/SettingsClass.cpp @@ -143,7 +143,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true)); AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true)); AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", false)); - AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", true)); + AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Audio-Sync Audio", true)); AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false)); AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start", 0)); AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", 0)); From 8c2d9a49f659b814f5a368aea454f99e6186c933 Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 17 Oct 2017 08:36:58 +1100 Subject: [PATCH 32/35] [Audio-Config] Remove BufferDivider BufferLevel --- Config/Audio.rdb | 91 ------------------------------------------------ 1 file changed, 91 deletions(-) diff --git a/Config/Audio.rdb b/Config/Audio.rdb index 886012ffc..6b807c3b1 100644 --- a/Config/Audio.rdb +++ b/Config/Audio.rdb @@ -1,18 +1,12 @@ // ============ Audio RDB for Project64 ==================================== [82DC04FD-CF2D82F4-C:45] Good Name=A Bug's Life (U) -BufferDivider=60 -BufferLevel=2 [E6A95A4F-BAD2EA23-C:45] Good Name=Aidyn Chronicles - The First Mage (U) [!] (V1.0) -BufferDivider=60 -BufferLevel=2 [112051D2-68BEF8AC-C:45] Good Name=Aidyn Chronicles - The First Mage (U) [!] (V1.1) -BufferDivider=60 -BufferLevel=2 [1FB5D932-3BA9481B-C:45] Good Name=Armorines - Project S.W.A.R.M. (U) @@ -25,120 +19,77 @@ Good Name=Army Men - Sarge's Heroes 2 (U) [A4BF9306-BF0CDFD1-C:45] Good Name=Banjo-Kazooie (U) (V1.0) -BufferDivider=30 -BufferLevel=2 [CD7559AC-B26CF5AE-C:45] Good Name=Banjo-Kazooie (U) (V1.1) -BufferDivider=30 -BufferLevel=2 [C2E9AA9A-475D70AA-C:45] Good Name=Banjo-Tooie (U) -BufferDivider=30 -BufferLevel=2 [6AA4DDE7-E3E2F4E7-C:45] Good Name=BattleTanx (U) -BufferDivider=30 -BufferLevel=2 [75A4E247-6008963D-C:45] Good Name=BattleTanx - Global Assault (U) -BufferDivider=30 -BufferLevel=2 [EDF419A8-BF1904CC-C:45] Good Name=Beetle Adventure Racing! (U) (M3) -BufferDivider=60 [7C647C25-D9D901E6-C:45] Good Name=Blast Corps (U) (V1.0) -BufferDivider=30 -BufferLevel=2 [7C647E65-1948D305-C:45] Good Name=Blast Corps (U) (V1.1) -BufferDivider=30 -BufferLevel=2 [5326696F-FE9A99C3-C:45] Good Name=Body Harvest (U) -BufferDivider=95 [F568D51E-7E49BA1E-C:45] Good Name=Bomberman 64 (U) -BufferDivider=60 [F35D5F95-8AFE3D69-C:45] Good Name=Castlevania (U) (V1.0) -BufferDivider=60 -BufferLevel=2 [F35D5335-B7667CB7-C:45] Good Name=Castlevania (U) (V1.1) -BufferDivider=60 -BufferLevel=2 [4BCDFF47-AAA3AF8F-C:45] Good Name=Castlevania (U) (V1.2) -BufferDivider=60 -BufferLevel=2 [30C7AC50-7704072D-C:45] Good Name=Conker's Bad Fur Day (U) -BufferDivider=30 -BufferLevel=2 [46A3F7AF-0F7591D0-C:45] Good Name=Cruis'n Exotica (U) [FF2F2FB4-D161149A-C:45] Good Name=Cruis'n USA (U) (V1.0) -BufferDivider=30 -BufferLevel=2 [5306CF45-CBC49250-C:45] Good Name=Cruis'n USA (U) (V1.1) -BufferDivider=30 -BufferLevel=2 [B3402554-7340C004-C:45] Good Name=Cruis'n USA (U) (V1.2) -BufferDivider=30 -BufferLevel=2 [DFE61153-D76118E6-C:45] Good Name=Cruis'n World (U) -BufferDivider=60 [DEE584A2-0F161187-C:45] Good Name=Destruction Derby 64 (U) -BufferDivider=60 [53D440E7-7519B011-C:45] Good Name=Diddy Kong Racing (U) (M2) (V1.0) -BufferDivider=30 -BufferLevel=2 [E402430D-D2FCFC9D-C:45] Good Name=Diddy Kong Racing (U) (M2) (V1.1) -BufferDivider=30 -BufferLevel=2 [EC58EABF-AD7C7169-C:45] Good Name=Donkey Kong 64 (U) -BufferDivider=30 -BufferLevel=2 [A83E101A-E937B69D-C:45] Good Name=Doom 64 (U) (V1.0) -BufferDivider=30 -BufferLevel=2 [423E96F4-CE88F05B-C:45] Good Name=Doom 64 (U) (V1.1) -BufferDivider=30 -BufferLevel=2 [07861842-A12EBC9F-C:45] Good Name=Excitebike 64 (U) (V1.0) @@ -146,127 +97,93 @@ Good Name=Excitebike 64 (U) (V1.0) Good Name=Excitebike 64 (U) (V1.1) [FDA245D2-A74A3D47-C:45] Good Name=Extreme-G (U) -BufferDivider=60 [B30ED978-3003C9F9-C:45] Good Name=F-ZERO X (U) -BufferDivider=60 [4252A5AD-AE6FBF4E-C:45] Good Name=Goemon's Great Adventure (U) -BufferDivider=60 [DCBC50D1-09FD1AA3-C:45] Good Name=GoldenEye 007 (U) -BufferDivider=30 -BufferLevel=2 [C7C98F8E-42145DDE-C:45] Good Name=Hot Wheels Turbo Racing (U) [8A6009B6-94ACE150-C:45] Good Name=Jet Force Gemini (U) -BufferDivider=30 -BufferLevel=2 [9E8FE2BA-8B270770-C:45] Good Name=Killer Instinct Gold (U) (V1.0) -BufferDivider=60 [9E8FCDFA-49F5652B-C:45] Good Name=Killer Instinct Gold (U) (V1.1) -BufferDivider=60 [F908CA4C-36464327-C:45] Good Name=Killer Instinct Gold (U) (V1.2) -BufferDivider=60 [7F304099-52CF5276-C:4A] Good Name=Last Legion UX (J) -BufferDivider=30 -BufferLevel=2 [0160E9E5-29A4CB68-C:45] Good Name=Last Legion UX (J) [T] -BufferDivider=30 -BufferLevel=2 [664BA3D4-678A80B7-C:45] Good Name=Mario Golf (U) -BufferDivider=60 [3E5055B6-2E92DA52-C:45] Good Name=Mario Kart 64 (U) -BufferDivider=60 [7C3829D9-6E8247CE-C:45] Good Name=Mario Party 3 (U) -BufferDivider=60 [5001CF4F-F30CB3BD-C:45] Good Name=Mario Tennis (U) -BufferDivider=60 [28768D6D-B379976C-C:45] Good Name=Monaco Grand Prix (U) -BufferDivider=60 [5AC383E1-D712E387-C:45] Good Name=Monopoly (U) (M2) [FCBCCB21-72903C6B-C:45] Good Name=Mystical Ninja Starring Goemon (U) -BufferDivider=60 [DF331A18-5FD4E044-C:45] Good Name=NASCAR 2000 (U) [591A806E-A5E6921D-C:45] Good Name=NHL 99 (U) -BufferDivider=60 [82EFDC30-806A2461-C:45] Good Name=NHL Blades of Steel '99 (U) -BufferDivider=60 [6DFDCDC3-4DE701C8-C:45] Good Name=NHL Breakaway 98 (U) -BufferDivider=60 [441768D0-7D73F24F-C:45] Good Name=NHL Breakaway 99 (U) -BufferDivider=60 [E6419BC5-69011DE3-C:45] Good Name=Ogre Battle 64 - Person of Lordly Caliber (U) (V1.0) -BufferDivider=60 [0ADAECA7-B17F9795-C:45] Good Name=Ogre Battle 64 - Person of Lordly Caliber (U) (V1.1) -BufferDivider=60 [65EEE53A-ED7D733C-C:45] Good Name=Paper Mario (U) -BufferDivider=60 [DDF460CC-3CA634C0-C:45] Good Name=Perfect Dark (U) (V1.0) -BufferDivider=30 -BufferLevel=2 [41F2B98F-B458B466-C:45] Good Name=Perfect Dark (U) (V1.1) -BufferDivider=30 -BufferLevel=2 [C851961C-78FCAAFA-C:45] Good Name=Pilotwings 64 (U) -BufferDivider=60 [03571182-892FD06D-C:45] Good Name=Pokemon Stadium 2 (U) -BufferDivider=60 [BDA8F143-B1AF2D62-C:45] Good Name=Quake II (U) -BufferDivider=60 [0F1FA987-BFC1AFA6-C:45] Good Name=Re-Volt (U) @@ -277,14 +194,12 @@ Sync Audio=0 [F050746C-247B820B-C:45] Good Name=Road Rash 64 (U) -BufferDivider=60 [0C5EE085-A167DD3E-C:45] Good Name=Rocket - Robot on Wheels (U) [2500267E-2A7EC3CE-C:45] Good Name=RR64 - Ridge Racer 64 (U) -BufferDivider=60 [769147F3-2033C10E-C:45] Good Name=S.C.A.R.S. (U) @@ -309,11 +224,9 @@ Good Name=StarCraft 64 (U) [635A2BFF-8B022326-C:45] Good Name=Super Mario 64 (U) -BufferDivider=60 [916B8B5B-780B85A4-C:45] Good Name=Super Smash Bros. (U) -BufferDivider=30 [204EC022-B119D185-C:45] Good Name=Tony Hawk's Pro Skater (U) (V1.0) @@ -347,19 +260,15 @@ Good Name=Turok 3 - Shadow of Oblivion (U) [3C059038-C8BF2182-C:45] Good Name=V-Rally Edition 99 (U) -BufferDivider=60 [EA71056A-E4214847-C:45] Good Name=Vigilante 8 (U) -BufferDivider=60 [F5C5866D-052713D9-C:45] Good Name=Vigilante 8 - 2nd Offense (U) -BufferDivider=60 [ED98957E-8242DCAC-C:45] Good Name=WinBack - Covert Operations (U) [2337D8E8-6B8E7CEC-C:45] Good Name=Yoshi's Story (U) (M2) -BufferDivider=60 From 8829076f8093a7d814201ff9ba776065354429ed Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 17 Oct 2017 08:38:55 +1100 Subject: [PATCH 33/35] [Audio-Config] Remove empty settings --- Config/Audio.rdb | 270 ----------------------------------------------- 1 file changed, 270 deletions(-) diff --git a/Config/Audio.rdb b/Config/Audio.rdb index 6b807c3b1..c06ae045b 100644 --- a/Config/Audio.rdb +++ b/Config/Audio.rdb @@ -1,274 +1,4 @@ // ============ Audio RDB for Project64 ==================================== -[82DC04FD-CF2D82F4-C:45] -Good Name=A Bug's Life (U) - -[E6A95A4F-BAD2EA23-C:45] -Good Name=Aidyn Chronicles - The First Mage (U) [!] (V1.0) - -[112051D2-68BEF8AC-C:45] -Good Name=Aidyn Chronicles - The First Mage (U) [!] (V1.1) - -[1FB5D932-3BA9481B-C:45] -Good Name=Armorines - Project S.W.A.R.M. (U) - -[4C52BBB2-CEAB0F6B-C:45] -Good Name=Army Men - Air Combat (U) - -[B20F73B6-2975FC34-C:45] -Good Name=Army Men - Sarge's Heroes 2 (U) - -[A4BF9306-BF0CDFD1-C:45] -Good Name=Banjo-Kazooie (U) (V1.0) - -[CD7559AC-B26CF5AE-C:45] -Good Name=Banjo-Kazooie (U) (V1.1) - -[C2E9AA9A-475D70AA-C:45] -Good Name=Banjo-Tooie (U) - -[6AA4DDE7-E3E2F4E7-C:45] -Good Name=BattleTanx (U) - -[75A4E247-6008963D-C:45] -Good Name=BattleTanx - Global Assault (U) - -[EDF419A8-BF1904CC-C:45] -Good Name=Beetle Adventure Racing! (U) (M3) - -[7C647C25-D9D901E6-C:45] -Good Name=Blast Corps (U) (V1.0) - -[7C647E65-1948D305-C:45] -Good Name=Blast Corps (U) (V1.1) - -[5326696F-FE9A99C3-C:45] -Good Name=Body Harvest (U) - -[F568D51E-7E49BA1E-C:45] -Good Name=Bomberman 64 (U) - -[F35D5F95-8AFE3D69-C:45] -Good Name=Castlevania (U) (V1.0) - -[F35D5335-B7667CB7-C:45] -Good Name=Castlevania (U) (V1.1) - -[4BCDFF47-AAA3AF8F-C:45] -Good Name=Castlevania (U) (V1.2) - -[30C7AC50-7704072D-C:45] -Good Name=Conker's Bad Fur Day (U) - -[46A3F7AF-0F7591D0-C:45] -Good Name=Cruis'n Exotica (U) -[FF2F2FB4-D161149A-C:45] -Good Name=Cruis'n USA (U) (V1.0) - -[5306CF45-CBC49250-C:45] -Good Name=Cruis'n USA (U) (V1.1) - -[B3402554-7340C004-C:45] -Good Name=Cruis'n USA (U) (V1.2) - -[DFE61153-D76118E6-C:45] -Good Name=Cruis'n World (U) - -[DEE584A2-0F161187-C:45] -Good Name=Destruction Derby 64 (U) - -[53D440E7-7519B011-C:45] -Good Name=Diddy Kong Racing (U) (M2) (V1.0) - -[E402430D-D2FCFC9D-C:45] -Good Name=Diddy Kong Racing (U) (M2) (V1.1) - -[EC58EABF-AD7C7169-C:45] -Good Name=Donkey Kong 64 (U) - -[A83E101A-E937B69D-C:45] -Good Name=Doom 64 (U) (V1.0) - -[423E96F4-CE88F05B-C:45] -Good Name=Doom 64 (U) (V1.1) - -[07861842-A12EBC9F-C:45] -Good Name=Excitebike 64 (U) (V1.0) -[F9D411E3-7CB29BC0-C:45] -Good Name=Excitebike 64 (U) (V1.1) -[FDA245D2-A74A3D47-C:45] -Good Name=Extreme-G (U) - -[B30ED978-3003C9F9-C:45] -Good Name=F-ZERO X (U) - -[4252A5AD-AE6FBF4E-C:45] -Good Name=Goemon's Great Adventure (U) - -[DCBC50D1-09FD1AA3-C:45] -Good Name=GoldenEye 007 (U) - -[C7C98F8E-42145DDE-C:45] -Good Name=Hot Wheels Turbo Racing (U) -[8A6009B6-94ACE150-C:45] -Good Name=Jet Force Gemini (U) - -[9E8FE2BA-8B270770-C:45] -Good Name=Killer Instinct Gold (U) (V1.0) - -[9E8FCDFA-49F5652B-C:45] -Good Name=Killer Instinct Gold (U) (V1.1) - -[F908CA4C-36464327-C:45] -Good Name=Killer Instinct Gold (U) (V1.2) - -[7F304099-52CF5276-C:4A] -Good Name=Last Legion UX (J) - -[0160E9E5-29A4CB68-C:45] -Good Name=Last Legion UX (J) [T] - -[664BA3D4-678A80B7-C:45] -Good Name=Mario Golf (U) - -[3E5055B6-2E92DA52-C:45] -Good Name=Mario Kart 64 (U) - -[7C3829D9-6E8247CE-C:45] -Good Name=Mario Party 3 (U) - -[5001CF4F-F30CB3BD-C:45] -Good Name=Mario Tennis (U) - -[28768D6D-B379976C-C:45] -Good Name=Monaco Grand Prix (U) - -[5AC383E1-D712E387-C:45] -Good Name=Monopoly (U) (M2) -[FCBCCB21-72903C6B-C:45] -Good Name=Mystical Ninja Starring Goemon (U) - -[DF331A18-5FD4E044-C:45] -Good Name=NASCAR 2000 (U) -[591A806E-A5E6921D-C:45] -Good Name=NHL 99 (U) - -[82EFDC30-806A2461-C:45] -Good Name=NHL Blades of Steel '99 (U) - -[6DFDCDC3-4DE701C8-C:45] -Good Name=NHL Breakaway 98 (U) - -[441768D0-7D73F24F-C:45] -Good Name=NHL Breakaway 99 (U) - -[E6419BC5-69011DE3-C:45] -Good Name=Ogre Battle 64 - Person of Lordly Caliber (U) (V1.0) - -[0ADAECA7-B17F9795-C:45] -Good Name=Ogre Battle 64 - Person of Lordly Caliber (U) (V1.1) - -[65EEE53A-ED7D733C-C:45] -Good Name=Paper Mario (U) - -[DDF460CC-3CA634C0-C:45] -Good Name=Perfect Dark (U) (V1.0) - -[41F2B98F-B458B466-C:45] -Good Name=Perfect Dark (U) (V1.1) - -[C851961C-78FCAAFA-C:45] -Good Name=Pilotwings 64 (U) - -[03571182-892FD06D-C:45] -Good Name=Pokemon Stadium 2 (U) - -[BDA8F143-B1AF2D62-C:45] -Good Name=Quake II (U) - -[0F1FA987-BFC1AFA6-C:45] -Good Name=Re-Volt (U) - [AA18B1A5-07DB6AEB-C:45] Good Name=Resident Evil 2 (U) (V1.1) Sync Audio=0 - -[F050746C-247B820B-C:45] -Good Name=Road Rash 64 (U) - -[0C5EE085-A167DD3E-C:45] -Good Name=Rocket - Robot on Wheels (U) - -[2500267E-2A7EC3CE-C:45] -Good Name=RR64 - Ridge Racer 64 (U) - -[769147F3-2033C10E-C:45] -Good Name=S.C.A.R.S. (U) - -[3A4760B5-2D74D410-C:45] -Good Name=Shadow Man (U) - -[7ECBE939-3C331795-C:45] -Good Name=South Park (U) - -[A60ED171-3D85D06E-C:45] -Good Name=Spider-Man (U) - -[A7D015F8-2289AA43-C:45] -Good Name=Star Fox 64 (U) (V1.0) - -[BA780BA0-0F21DB34-C:45] -Good Name=Star Fox 64 (U) (V1.1) - -[0684FBFB-5D3EA8A5-C:45] -Good Name=StarCraft 64 (U) - -[635A2BFF-8B022326-C:45] -Good Name=Super Mario 64 (U) - -[916B8B5B-780B85A4-C:45] -Good Name=Super Smash Bros. (U) - -[204EC022-B119D185-C:45] -Good Name=Tony Hawk's Pro Skater (U) (V1.0) - -[E0144180-650B78C9-C:45] -Good Name=Tony Hawk's Pro Skater (U) (V1.1) - -[99150E18-1266E6A5-C:45] -Good Name=Tony Hawk's Pro Skater 2 (U - -[1A7F70B5-00B7B9FD-C:45] -Good Name=Tony Hawk's Pro Skater 3 (U) - -[BE5973E0-89B0EDB8-C:45] -Good Name=Top Gear Rally 2 (U) - -[2F70F10D-5C4187FF-C:45] -Good Name=Turok - Dinosaur Hunter (U) (V1.0) - -[2F700DCD-176CC5C9-C:45] -Good Name=Turok - Dinosaur Hunter (U) (V1.1) (V1.2) - -[49088A11-6494957E-C:45] -Good Name=Turok 2 - Seeds of Evil (U) (V1.0) - -[E0B92B94-B9A7E025-C:45] -Good Name=Turok 2 - Seeds of Evil (U) (V1.1) - -[89A579F1-667E97EF-C:45] -Good Name=Turok 3 - Shadow of Oblivion (U) - -[3C059038-C8BF2182-C:45] -Good Name=V-Rally Edition 99 (U) - -[EA71056A-E4214847-C:45] -Good Name=Vigilante 8 (U) - -[F5C5866D-052713D9-C:45] -Good Name=Vigilante 8 - 2nd Offense (U) - -[ED98957E-8242DCAC-C:45] -Good Name=WinBack - Covert Operations (U) - -[2337D8E8-6B8E7CEC-C:45] -Good Name=Yoshi's Story (U) (M2) From 8e71e8bea909b91d4444fb33fbcd429faf14454e Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 17 Oct 2017 08:50:32 +1100 Subject: [PATCH 34/35] [Audio] Change how sleep works in DirectSoundDriver::AudioThreadProc --- Source/Project64-audio/Driver/DirectSound.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Project64-audio/Driver/DirectSound.cpp b/Source/Project64-audio/Driver/DirectSound.cpp index 354d923c1..26edd6b12 100644 --- a/Source/Project64-audio/Driver/DirectSound.cpp +++ b/Source/Project64-audio/Driver/DirectSound.cpp @@ -211,12 +211,6 @@ void DirectSoundDriver::AudioThreadProc() { break; } - // Check to see if the audio pointer moved on to the next segment - if (write_pos == 0) - { - WriteTrace(TraceAudioDriver, TraceVerbose, "Sleep"); - Sleep(1); - } uint32_t play_pos = 0; if (lpdsbuff == NULL || FAILED(lpdsbuff->GetCurrentPosition((unsigned long*)&play_pos, NULL))) { @@ -226,6 +220,11 @@ void DirectSoundDriver::AudioThreadProc() } write_pos = play_pos < m_LOCK_SIZE ? (m_LOCK_SIZE * DS_SEGMENTS) - m_LOCK_SIZE : ((play_pos / m_LOCK_SIZE) * m_LOCK_SIZE) - m_LOCK_SIZE; WriteTrace(TraceAudioDriver, TraceVerbose, "play_pos: 0x%08X m_write_pos: 0x%08X next_pos: 0x%08X m_LOCK_SIZE: 0x%08X", play_pos, write_pos, next_pos, m_LOCK_SIZE); + if (last_pos == write_pos) + { + WriteTrace(TraceAudioDriver, TraceVerbose, "Sleep"); + Sleep(1); + } } // This means we had a buffer segment skipped if (next_pos != write_pos) From 4091a4699c7e364e724c8c3a85b60d7e686cbb53 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 19 Oct 2017 21:56:59 +1100 Subject: [PATCH 35/35] [Audio] Make fixed audio on by default --- Source/Project64-core/Settings/SettingsClass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp index 07445cb55..690eb04ac 100644 --- a/Source/Project64-core/Settings/SettingsClass.cpp +++ b/Source/Project64-core/Settings/SettingsClass.cpp @@ -142,7 +142,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false)); AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true)); AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true)); - AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", false)); + AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true)); AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Audio-Sync Audio", true)); AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false)); AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start", 0));