FDS: Fixed crash when using "Switch Disk Side" when game has 1 side (~64kb)
This commit is contained in:
parent
bb18cf9a3f
commit
e68892f62f
3 changed files with 4 additions and 3 deletions
|
@ -532,7 +532,7 @@ void FDS::EjectDisk()
|
|||
void FDS::InsertDisk(uint32_t diskNumber)
|
||||
{
|
||||
if(_diskNumber == FDS::NoDiskInserted) {
|
||||
_diskNumber = diskNumber;
|
||||
_diskNumber = diskNumber % GetSideCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
if(!IsAutoInsertDiskEnabled()) {
|
||||
shared_ptr<FDS> mapper = _mapper.lock();
|
||||
if(mapper && mapper->IsDiskInserted()) {
|
||||
InsertDisk(mapper->GetCurrentDisk() ^ 0x01);
|
||||
InsertDisk((mapper->GetCurrentDisk() ^ 0x01) % mapper->GetSideCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -637,6 +637,7 @@ namespace Mesen.GUI.Forms
|
|||
|
||||
Func<bool> runningNotNsf = () => { return _emuThread != null && !InteropEmu.IsNsf(); };
|
||||
Func<bool> runningFdsNoAutoInsert = () => { return _emuThread != null && InteropEmu.FdsGetSideCount() > 0 && !InteropEmu.FdsIsAutoInsertDiskEnabled() && !InteropEmu.MoviePlaying() && !InteropEmu.IsConnected(); };
|
||||
Func<bool> runningFdsMultipleDisks = () => { return runningFdsNoAutoInsert() && InteropEmu.FdsGetSideCount() > 1; };
|
||||
Func<bool> runningVsSystem = () => { return _emuThread != null && InteropEmu.IsVsSystem() && !InteropEmu.MoviePlaying() && !InteropEmu.IsConnected(); };
|
||||
Func<bool> hasBarcodeReader = () => { return InteropEmu.GetAvailableFeatures().HasFlag(ConsoleFeatures.BarcodeReader) && !InteropEmu.IsConnected(); };
|
||||
|
||||
|
@ -656,7 +657,7 @@ namespace Mesen.GUI.Forms
|
|||
BindShortcut(mnuPowerCycle, EmulatorShortcut.PowerCycle, runningNotClientNotMovie);
|
||||
BindShortcut(mnuPowerOff, EmulatorShortcut.PowerOff, runningNotClient);
|
||||
|
||||
BindShortcut(mnuSwitchDiskSide, EmulatorShortcut.SwitchDiskSide, runningFdsNoAutoInsert);
|
||||
BindShortcut(mnuSwitchDiskSide, EmulatorShortcut.SwitchDiskSide, runningFdsMultipleDisks);
|
||||
BindShortcut(mnuEjectDisk, EmulatorShortcut.EjectDisk, runningFdsNoAutoInsert);
|
||||
|
||||
BindShortcut(mnuInsertCoin1, EmulatorShortcut.InsertCoin1, runningVsSystem);
|
||||
|
|
Loading…
Add table
Reference in a new issue