diff options
author | RSDuck <RSDuck@users.noreply.github.com> | 2023-08-01 03:00:41 +0200 |
---|---|---|
committer | RSDuck <RSDuck@users.noreply.github.com> | 2023-08-01 03:00:41 +0200 |
commit | 7731f66e553a396f136953798751d5b6f84a9dd1 (patch) | |
tree | b302debfed8bdcccfbb76cee82f57d50c0774898 | |
parent | 3efbf1b813e40c02e3e12488712f33bb0b63f468 (diff) |
fix some UB
-rw-r--r-- | src/DMA.cpp | 1 | ||||
-rw-r--r-- | src/NonStupidBitfield.h | 7 | ||||
-rw-r--r-- | src/frontend/qt_sdl/Config.cpp | 2 | ||||
-rw-r--r-- | src/frontend/qt_sdl/ROMManager.cpp | 1 |
4 files changed, 7 insertions, 4 deletions
diff --git a/src/DMA.cpp b/src/DMA.cpp index 6877914..d296511 100644 --- a/src/DMA.cpp +++ b/src/DMA.cpp @@ -79,6 +79,7 @@ void DMA::Reset() Stall = false; Running = false; + Executing = false; InProgress = false; MRAMBurstCount = 0; } diff --git a/src/NonStupidBitfield.h b/src/NonStupidBitfield.h index badefaf..a4fe7ec 100644 --- a/src/NonStupidBitfield.h +++ b/src/NonStupidBitfield.h @@ -144,10 +144,11 @@ struct NonStupidBitField { for (u32 i = 0; i < DataLength; i++) { - u32 idx = __builtin_ctzll(Data[i]); - if (Data[i] && idx + i * 64 < Size) + if (Data[i]) { - return {*this, i, idx, Data[i] & ~(1ULL << idx)}; + u32 idx = __builtin_ctzll(Data[i]); + if (idx + i * 64 < Size) + return {*this, i, idx, Data[i] & ~(1ULL << idx)}; } } return End(); diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp index afdaaee..b4d78f7 100644 --- a/src/frontend/qt_sdl/Config.cpp +++ b/src/frontend/qt_sdl/Config.cpp @@ -301,7 +301,7 @@ ConfigEntry ConfigFile[] = {"AudioInterp", 0, &AudioInterp, 0, false}, {"AudioBitDepth", 0, &AudioBitDepth, 0, false}, {"AudioVolume", 0, &AudioVolume, 256, true}, - {"DSiVolumeSync", 0, &DSiVolumeSync, 0, true}, + {"DSiVolumeSync", 1, &DSiVolumeSync, false, true}, {"MicInputType", 0, &MicInputType, 1, false}, {"MicDevice", 2, &MicDevice, (std::string)"", false}, {"MicWavPath", 2, &MicWavPath, (std::string)"", false}, diff --git a/src/frontend/qt_sdl/ROMManager.cpp b/src/frontend/qt_sdl/ROMManager.cpp index a3a911c..3b2b72b 100644 --- a/src/frontend/qt_sdl/ROMManager.cpp +++ b/src/frontend/qt_sdl/ROMManager.cpp @@ -451,6 +451,7 @@ void UnloadCheats() { delete CheatFile; CheatFile = nullptr; + AREngine::SetCodeFile(nullptr); } } |