From a6d75e15ea893b6b84ff918ef615018d8b9210f0 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 30 Jan 2022 20:51:47 -0800 Subject: [PATCH] Check for $SystemUpdate folder for X360 discs --- CHANGELIST.md | 1 + MPF.Core/Data/Drive.cs | 75 ++++++++++++++++++++++++++---------------- 2 files changed, 47 insertions(+), 29 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 4eef95c7..fa0af950 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -68,6 +68,7 @@ - Add Sierra ID to list of pseudo-tags - Add another hand-formatted version of SS tag - Move internal serial before volume label +- Check for $SystemUpdate folder for X360 discs ### 2.2 (2021-12-30) - Fix Saturn header finding diff --git a/MPF.Core/Data/Drive.cs b/MPF.Core/Data/Drive.cs index e6faeb62..557e77ad 100644 --- a/MPF.Core/Data/Drive.cs +++ b/MPF.Core/Data/Drive.cs @@ -273,43 +273,19 @@ namespace MPF.Core.Data if (systemFromLabel != null) return systemFromLabel; - // BD-Video - if (Directory.Exists(Path.Combine(drivePath, "BDMV"))) - { - // Technically BD-Audio has this as well, but it's hard to split that out right now - return RedumpSystem.BDVideo; - } + #region Consoles - // DVD-Audio and DVD-Video + // Microsoft Xbox 360 try { - if (Directory.Exists(Path.Combine(drivePath, "AUDIO_TS")) - && Directory.EnumerateFiles(Path.Combine(drivePath, "AUDIO_TS")).Any()) + if (Directory.Exists(Path.Combine(drivePath, "$SystemUpdate")) + && Directory.EnumerateFiles(Path.Combine(drivePath, "$SystemUpdate")).Any()) { - return RedumpSystem.DVDAudio; - } - - else if (Directory.Exists(Path.Combine(drivePath, "VIDEO_TS")) - && Directory.EnumerateFiles(Path.Combine(drivePath, "VIDEO_TS")).Any()) - { - return RedumpSystem.DVDVideo; + return RedumpSystem.MicrosoftXbox360; } } catch { } - // HD-DVD-Video - try - { - if (Directory.Exists(Path.Combine(drivePath, "HVDVD_TS")) - && Directory.EnumerateFiles(Path.Combine(drivePath, "HVDVD_TS")).Any()) - { - return RedumpSystem.HDDVDVideo; - } - } - catch - { - } - // Sega Dreamcast if (File.Exists(Path.Combine(drivePath, "IP.BIN"))) { @@ -360,6 +336,45 @@ namespace MPF.Core.Data return RedumpSystem.VTechVFlashVSmilePro; } + #endregion + + #region Video Formats + + // BD-Video + if (Directory.Exists(Path.Combine(drivePath, "BDMV"))) + { + // Technically BD-Audio has this as well, but it's hard to split that out right now + return RedumpSystem.BDVideo; + } + + // DVD-Audio and DVD-Video + try + { + if (Directory.Exists(Path.Combine(drivePath, "AUDIO_TS")) + && Directory.EnumerateFiles(Path.Combine(drivePath, "AUDIO_TS")).Any()) + { + return RedumpSystem.DVDAudio; + } + + else if (Directory.Exists(Path.Combine(drivePath, "VIDEO_TS")) + && Directory.EnumerateFiles(Path.Combine(drivePath, "VIDEO_TS")).Any()) + { + return RedumpSystem.DVDVideo; + } + } + catch { } + + // HD-DVD-Video + try + { + if (Directory.Exists(Path.Combine(drivePath, "HVDVD_TS")) + && Directory.EnumerateFiles(Path.Combine(drivePath, "HVDVD_TS")).Any()) + { + return RedumpSystem.HDDVDVideo; + } + } + catch { } + // VCD try { @@ -371,6 +386,8 @@ namespace MPF.Core.Data } catch { } + #endregion + // Default return return defaultValue; }