Skip to content

Commit

Permalink
Fix system detection logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadareski committed Jan 3, 2025
1 parent ac649af commit fb2b1b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
- Fix misunderstanding on perfect offset
- Handle SCSI error count
- Update to DIC 20250101
- Fix system detection logging

### 3.2.4 (2024-11-24)

Expand Down
17 changes: 12 additions & 5 deletions MPF.Frontend/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,8 @@ private void DetermineSystemType()
{
VerboseLog($"Trying to detect system for drive {CurrentDrive.Name}.. ");
var currentSystem = GetRedumpSystem(CurrentDrive);
VerboseLogLn(currentSystem == null ? $"unable to detect, defaulting to {Options.DefaultSystem.LongName()}" : ($"detected {currentSystem.LongName()}."));
if (currentSystem != null)
VerboseLogLn($"detected {currentSystem.LongName()}.");

// If undetected system on inactive drive, and PC is the default system, check for potential Mac disc
if (currentSystem == null && CurrentDrive.MarkedActive == false && Options.DefaultSystem == RedumpSystem.IBMPCcompatible)
Expand All @@ -1270,14 +1271,20 @@ private void DetermineSystemType()
{
// If disc is readable on inactive drive, assume it is a Mac disc
if (PhysicalTool.GetFirstBytes(CurrentDrive, 1) != null)
{
currentSystem = RedumpSystem.AppleMacintosh;
VerboseLogLn($"unable to detect, defaulting to {currentSystem.LongName()}.");
}
}
catch {}
catch { }
}

// Fallback to default system only if drive is active
if (currentSystem == null && CurrentDrive.MarkedActive)
{
currentSystem = Options.DefaultSystem;
VerboseLogLn($"unable to detect, defaulting to {currentSystem.LongName()}.");
}

if (currentSystem != null)
{
Expand Down Expand Up @@ -1500,7 +1507,7 @@ public void GetOutputNames(bool driveChanged)
return detectedSegaSystem;
}
}
catch {}
catch { }

// Otherwise, return null
return null;
Expand Down Expand Up @@ -1651,8 +1658,8 @@ public void GetOutputNames(bool driveChanged)
return segaSystem;
}
}
catch {}
catch { }

// Sega Dreamcast
if (File.Exists(Path.Combine(drive.Name, "IP.BIN")))
{
Expand Down

0 comments on commit fb2b1b7

Please sign in to comment.