mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 13:20:57 -06:00
fix some UB
This commit is contained in:
@ -79,6 +79,7 @@ void DMA::Reset()
|
|||||||
Stall = false;
|
Stall = false;
|
||||||
|
|
||||||
Running = false;
|
Running = false;
|
||||||
|
Executing = false;
|
||||||
InProgress = false;
|
InProgress = false;
|
||||||
MRAMBurstCount = 0;
|
MRAMBurstCount = 0;
|
||||||
}
|
}
|
||||||
|
@ -144,9 +144,10 @@ struct NonStupidBitField
|
|||||||
{
|
{
|
||||||
for (u32 i = 0; i < DataLength; i++)
|
for (u32 i = 0; i < DataLength; i++)
|
||||||
{
|
{
|
||||||
u32 idx = __builtin_ctzll(Data[i]);
|
if (Data[i])
|
||||||
if (Data[i] && idx + i * 64 < Size)
|
|
||||||
{
|
{
|
||||||
|
u32 idx = __builtin_ctzll(Data[i]);
|
||||||
|
if (idx + i * 64 < Size)
|
||||||
return {*this, i, idx, Data[i] & ~(1ULL << idx)};
|
return {*this, i, idx, Data[i] & ~(1ULL << idx)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ ConfigEntry ConfigFile[] =
|
|||||||
{"AudioInterp", 0, &AudioInterp, 0, false},
|
{"AudioInterp", 0, &AudioInterp, 0, false},
|
||||||
{"AudioBitDepth", 0, &AudioBitDepth, 0, false},
|
{"AudioBitDepth", 0, &AudioBitDepth, 0, false},
|
||||||
{"AudioVolume", 0, &AudioVolume, 256, true},
|
{"AudioVolume", 0, &AudioVolume, 256, true},
|
||||||
{"DSiVolumeSync", 0, &DSiVolumeSync, 0, true},
|
{"DSiVolumeSync", 1, &DSiVolumeSync, false, true},
|
||||||
{"MicInputType", 0, &MicInputType, 1, false},
|
{"MicInputType", 0, &MicInputType, 1, false},
|
||||||
{"MicDevice", 2, &MicDevice, (std::string)"", false},
|
{"MicDevice", 2, &MicDevice, (std::string)"", false},
|
||||||
{"MicWavPath", 2, &MicWavPath, (std::string)"", false},
|
{"MicWavPath", 2, &MicWavPath, (std::string)"", false},
|
||||||
|
@ -451,6 +451,7 @@ void UnloadCheats()
|
|||||||
{
|
{
|
||||||
delete CheatFile;
|
delete CheatFile;
|
||||||
CheatFile = nullptr;
|
CheatFile = nullptr;
|
||||||
|
AREngine::SetCodeFile(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user