diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 2bfe89383f..9650fef77e 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -248,6 +248,10 @@ namespace BizHawk.Client.Common } switch (discType) { + case DiscType.DOS: + game.System = VSystemID.Raw.DOS; + break; + case DiscType.SegaSaturn: game.System = VSystemID.Raw.SAT; break; @@ -297,9 +301,6 @@ namespace BizHawk.Client.Common case DiscType.Wii: NoCoreForSystem(VSystemID.Raw.Wii); break; - case DiscType.DOS: - game.System = VSystemID.Raw.DOS; - break; case DiscType.AudioDisc: case DiscType.UnknownCDFS: diff --git a/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs b/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs index df380bdcbc..e608529e77 100644 --- a/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs +++ b/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs @@ -36,7 +36,7 @@ namespace BizHawk.Client.Common ["Coleco"] = 59.9227510135505, ["Doom"] = 35.0, ["DOS"] = 70.086303, // Video dump from DOSBox-X has 70086303/1000000 (70.086303) framerate when launching into DOS. - ["FDS"] = 60.098813897440515532, + ["FDS"] = 60.098813897440515532, ["FDS_PAL"] = 50.006977968268290849, ["GEN"] = 53693175 / (3420.0 * 262), ["GEN_PAL"] = 53203424 / (3420.0 * 313), diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 2974245f86..608791e6d9 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -28,6 +28,7 @@ using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores.Computers.AppleII; using BizHawk.Emulation.Cores.Computers.Commodore64; +using BizHawk.Emulation.Cores.Computers.DOS; using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; using BizHawk.Emulation.Cores.Consoles.SNK; using BizHawk.Emulation.Cores.Nintendo.GBA; @@ -41,7 +42,6 @@ using BizHawk.Client.EmuHawk.CoreExtensions; using BizHawk.Client.EmuHawk.CustomControls; using BizHawk.Common.CollectionExtensions; using BizHawk.WinForms.Controls; -using BizHawk.Emulation.Cores.Computers.DOS; namespace BizHawk.Client.EmuHawk { @@ -1996,7 +1996,7 @@ namespace BizHawk.Client.EmuHawk byte[] sram; // some cores might not know how big the saveram ought to be, so just send it the whole file - if (Emulator is AppleII or C64 or MGBAHawk or NeoGeoPort or NES { BoardName: "FDS" } or DOSBox) + if (Emulator is AppleII or C64 or DOSBox or MGBAHawk or NeoGeoPort or NES { BoardName: "FDS" }) { sram = File.ReadAllBytes(saveRamPath); } diff --git a/src/BizHawk.Emulation.Common/Database/Database.cs b/src/BizHawk.Emulation.Common/Database/Database.cs index d88a58d382..83d726ddb8 100644 --- a/src/BizHawk.Emulation.Common/Database/Database.cs +++ b/src/BizHawk.Emulation.Common/Database/Database.cs @@ -463,14 +463,7 @@ namespace BizHawk.Emulation.Common game.System = VSystemID.Raw.Amiga; break; - case ".IMA": - case ".IMG": - case ".XDF": - case ".DMF": - case ".FDD": - //case ".FDI": - case ".NFD": - case ".D88": + case ".D88" or ".DMF" or ".FDD" /*or ".FDI"*/ or ".IMA" or ".IMG" or ".NFD" or ".XDF": game.System = VSystemID.Raw.DOS; break; diff --git a/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 48546a4b23..9ce95f6d9d 100644 --- a/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -25,8 +25,8 @@ - + diff --git a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.Controllers.cs b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.Controllers.cs index 76f8f87e0e..faace9d8a3 100644 --- a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.Controllers.cs @@ -5,7 +5,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.DOS { public partial class DOSBox - { + { // A class to store the current state of the mouse for delta and button activation calculation private class MouseState { @@ -60,8 +60,8 @@ namespace BizHawk.Emulation.Cores.Computers.DOS controller.BoolButtons.Add(Inputs.Mouse + " " + MouseInputs.LeftButton); controller.BoolButtons.Add(Inputs.Mouse + " " + MouseInputs.MiddleButton); controller.BoolButtons.Add(Inputs.Mouse + " " + MouseInputs.RightButton); - controller.AddAxis(Inputs.Mouse + " " + MouseInputs.PosX, (0).RangeTo(LibDOSBox.SVGA_MAX_WIDTH), LibDOSBox.SVGA_MAX_WIDTH / 2); - controller.AddAxis(Inputs.Mouse + " " + MouseInputs.PosY, (0).RangeTo(LibDOSBox.SVGA_MAX_HEIGHT), LibDOSBox.SVGA_MAX_HEIGHT / 2); + controller.AddAxis(Inputs.Mouse + " " + MouseInputs.PosX, 0.RangeTo(LibDOSBox.SVGA_MAX_WIDTH), LibDOSBox.SVGA_MAX_WIDTH / 2); + controller.AddAxis(Inputs.Mouse + " " + MouseInputs.PosY, 0.RangeTo(LibDOSBox.SVGA_MAX_HEIGHT), LibDOSBox.SVGA_MAX_HEIGHT / 2); controller.AddAxis(Inputs.Mouse + " " + MouseInputs.SpeedX, (-LibDOSBox.SVGA_MAX_WIDTH / 2).RangeTo(LibDOSBox.SVGA_MAX_WIDTH / 2), 0); controller.AddAxis(Inputs.Mouse + " " + MouseInputs.SpeedY, (-LibDOSBox.SVGA_MAX_HEIGHT / 2).RangeTo(LibDOSBox.SVGA_MAX_HEIGHT / 2), 0); } diff --git a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.IDriveLight.cs b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.IDriveLight.cs index 01a05b74f5..acf5dc6190 100644 --- a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.IDriveLight.cs +++ b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.IDriveLight.cs @@ -8,4 +8,4 @@ namespace BizHawk.Emulation.Cores.Computers.DOS public bool DriveLightOn { get; private set; } public string DriveLightIconDescription => "Drive Activity"; } -} \ No newline at end of file +} diff --git a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.ISettable.cs b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.ISettable.cs index cebc720371..915af0ba0c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.ISettable.cs @@ -287,7 +287,7 @@ namespace BizHawk.Emulation.Cores.Computers.DOS => SettingsUtil.SetDefaultValues(this); public SyncSettings Clone() - => (SyncSettings)MemberwiseClone(); + => (SyncSettings) MemberwiseClone(); public static bool NeedsReboot(SyncSettings x, SyncSettings y) => !DeepEquality.DeepEquals(x, y); diff --git a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs index 3f1a0c3e77..79459abf29 100644 --- a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs +++ b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs @@ -345,20 +345,20 @@ namespace BizHawk.Emulation.Cores.Computers.DOS // Setting joystick inputs if (_syncSettings.EnableJoystick1) { - fi.joystick1.up = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Up}") ? 1 : 0; - fi.joystick1.down = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Down}") ? 1 : 0; - fi.joystick1.left = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Left}") ? 1 : 0; - fi.joystick1.right = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Right}") ? 1 : 0; + fi.joystick1.up = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Up}") ? 1 : 0; + fi.joystick1.down = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Down}") ? 1 : 0; + fi.joystick1.left = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Left}") ? 1 : 0; + fi.joystick1.right = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Right}") ? 1 : 0; fi.joystick1.button1 = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Button1}") ? 1 : 0; fi.joystick1.button2 = controller.IsPressed($"P1 {Inputs.Joystick} {JoystickButtons.Button2}") ? 1 : 0; } if (_syncSettings.EnableJoystick2) { - fi.joystick2.up = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Up}") ? 1 : 0; - fi.joystick2.down = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Down}") ? 1 : 0; - fi.joystick2.left = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Left}") ? 1 : 0; - fi.joystick2.right = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Right}") ? 1 : 0; + fi.joystick2.up = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Up}") ? 1 : 0; + fi.joystick2.down = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Down}") ? 1 : 0; + fi.joystick2.left = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Left}") ? 1 : 0; + fi.joystick2.right = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Right}") ? 1 : 0; fi.joystick2.button1 = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Button1}") ? 1 : 0; fi.joystick2.button2 = controller.IsPressed($"P2 {Inputs.Joystick} {JoystickButtons.Button2}") ? 1 : 0; } @@ -397,10 +397,10 @@ namespace BizHawk.Emulation.Cores.Computers.DOS // Updating mouse state _mouseState = nextState; - } + } - // Processing floppy disks swaps - fi.driveActions.insertFloppyDisk = -1; + // Processing floppy disks swaps + fi.driveActions.insertFloppyDisk = -1; if (_floppyDiskCount > 1 && controller.IsPressed(Inputs.NextFloppyDisk) && !_nextFloppyDiskPressed) { _currentFloppyDisk = (_currentFloppyDisk + 1) % _floppyDiskCount; @@ -426,7 +426,7 @@ namespace BizHawk.Emulation.Cores.Computers.DOS { unsafe { - fi.Keys.Buffer[(int)key] = 1; + fi.Keys.Buffer[(int) key] = 1; } } } @@ -475,4 +475,4 @@ namespace BizHawk.Emulation.Cores.Computers.DOS public const string WHD = "__WritableHardDiskDrive"; } } -} \ No newline at end of file +} diff --git a/src/BizHawk.Emulation.Cores/Computers/DOS/LibDOSBox.cs b/src/BizHawk.Emulation.Cores/Computers/DOS/LibDOSBox.cs index d2268e72f9..05426d7b47 100644 --- a/src/BizHawk.Emulation.Cores/Computers/DOS/LibDOSBox.cs +++ b/src/BizHawk.Emulation.Cores/Computers/DOS/LibDOSBox.cs @@ -233,4 +233,4 @@ namespace BizHawk.Emulation.Cores.Computers.DOS Key_KeyPadPeriod } } -} \ No newline at end of file +} diff --git a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs index ca296ec40c..2cc6c6093d 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs @@ -180,7 +180,7 @@ namespace BizHawk.Emulation.Cores.Waterbox if (data.Length != _saveramSize) { Console.WriteLine($"Could not push SaveRam into the core: the length of the data provided ({data.Length}) is different than expected ({_saveramSize})"); - + // Here, the exception was too traumatic. The emulator shuts down when in debug mode, and is left in an unstable state on release. // Using a softer landing here, although returning true/false plus a string explanation would be more adequate. return; @@ -194,7 +194,7 @@ namespace BizHawk.Emulation.Cores.Waterbox MemoryBlockUtils.CopySome(source, new MemoryDomainStream(area), area.Size); } } - } + } protected abstract LibWaterboxCore.FrameInfo FrameAdvancePrep(IController controller, bool render, bool rendersound); protected virtual void FrameAdvancePost() diff --git a/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs b/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs index 255397d157..2e26cc9e16 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs @@ -190,11 +190,8 @@ namespace BizHawk.Emulation.DiscSystem if (DetectWii()) return DiscType.Wii; - if (DetectISO9660()) - return DiscType.DOS; - - if (DetectUDF()) - return DiscType.DOS; + if (DetectISO9660()) return DiscType.DOS; + if (DetectUDF()) return DiscType.DOS; var discView = EDiscStreamView.DiscStreamView_Mode1_2048; if (_disc.TOC.SessionFormat == SessionFormat.Type20_CDXA) @@ -405,7 +402,7 @@ namespace BizHawk.Emulation.DiscSystem return hexString == "5D1C9EA3"; } - // Detects ISO9660 / Joliet CD formats (target for DOS / Windows) + /// Detects ISO9660 / Joliet CD formats (target for DOS / Windows) /// private bool DetectISO9660() { @@ -414,7 +411,6 @@ namespace BizHawk.Emulation.DiscSystem return false; } - // Detects UDF /// private bool DetectUDF() {