From 4cfc20e3ffc9029658205f44c44fd3096c34dc89 Mon Sep 17 00:00:00 2001 From: feos Date: Sun, 27 Apr 2025 23:36:39 +0300 Subject: [PATCH] dsda: rename cinterface because this thing is not limited to it --- .../Computers/Doom/DSDA.IEmulator.cs | 13 ++++++------- .../Computers/Doom/DSDA.IMemoryDomains.cs | 2 +- .../Computers/Doom/DSDA.ISettable.cs | 4 ++-- src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs | 14 +++++++------- .../Computers/Doom/LibDSDA.cs | 6 +++--- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs index 70faced6d8..182273f51a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs @@ -1,6 +1,5 @@ using BizHawk.Common.NumberExtensions; using BizHawk.Emulation.Common; -using static BizHawk.Emulation.Cores.Computers.Doom.CInterface; namespace BizHawk.Emulation.Cores.Computers.Doom { @@ -17,11 +16,11 @@ namespace BizHawk.Emulation.Cores.Computers.Doom public bool FrameAdvance(IController controller, bool renderVideo, bool renderAudio) { // Declaring inputs - PackedPlayerInput[] players = [ - new PackedPlayerInput(), - new PackedPlayerInput(), - new PackedPlayerInput(), - new PackedPlayerInput() + LibDSDA.PackedPlayerInput[] players = [ + new LibDSDA.PackedPlayerInput(), + new LibDSDA.PackedPlayerInput(), + new LibDSDA.PackedPlayerInput(), + new LibDSDA.PackedPlayerInput() ]; ReadAxis[] axisReaders = @@ -149,7 +148,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom } } - PackedRenderInfo renderInfo = new PackedRenderInfo() + LibDSDA.PackedRenderInfo renderInfo = new LibDSDA.PackedRenderInfo() { SfxVolume = _settings.SfxVolume, MusicVolume = _settings.MusicVolume, diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IMemoryDomains.cs index a465ec6d65..d54d577dac 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IMemoryDomains.cs @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom addr => { if (addr > 0xFFFFFF) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); - return _core.dsda_read_memory_array(CInterface.MemoryArrayType.Things, (uint)addr); + return _core.dsda_read_memory_array(LibDSDA.MemoryArrayType.Things, (uint)addr); }, null, 1), diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs index 3a80da5065..e07e235cfb 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs @@ -407,9 +407,9 @@ namespace BizHawk.Emulation.Cores.Computers.Doom [TypeConverter(typeof(DescribableEnumConverter))] public HexenClass Player4Class { get; set; } - public CInterface.InitSettings GetNativeSettings(GameInfo game) + public LibDSDA.InitSettings GetNativeSettings(GameInfo game) { - return new CInterface.InitSettings + return new LibDSDA.InitSettings { Player1Present = Player1Present ? 1 : 0, Player2Present = Player2Present ? 1 : 0, diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs index 40b3a28783..d265bc8d73 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs @@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom using (_elf.EnterExit()) { - _core = BizInvoker.GetInvoker(_elf, _elf, callingConventionAdapter); + _core = BizInvoker.GetInvoker(_elf, _elf, callingConventionAdapter); // Adding dsda-doom wad file _core.dsda_add_wad_file(_dsdaWadFileName, _dsdaWadFileData.Length, _loadCallback); @@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom { var loadWadResult = _core.dsda_add_wad_file(wadFile.RomPath, wadFile.RomData.Length, _loadCallback); if (loadWadResult is 0) throw new Exception($"Could not load WAD file: '{wadFile.RomPath}'"); - _gameMode = (CInterface.GameMode)loadWadResult; + _gameMode = (LibDSDA.GameMode)loadWadResult; } _elf.AddReadonlyFile(_configFile, "dsda-doom.cfg"); @@ -178,7 +178,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom } } - private void CreateArguments(CInterface.InitSettings initSettings) + private void CreateArguments(LibDSDA.InitSettings initSettings) { _args = new List { @@ -187,7 +187,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom _args.Add("-warp"); ConditionalArg(_syncSettings.InitialEpisode is not 0 - && _gameMode != CInterface.GameMode.Commercial, + && _gameMode != LibDSDA.GameMode.Commercial, $"{_syncSettings.InitialEpisode}"); _args.Add($"{_syncSettings.InitialMap}"); _args.AddRange([ "-skill", $"{(int)_syncSettings.SkillLevel}" ]); @@ -216,8 +216,8 @@ namespace BizHawk.Emulation.Cores.Computers.Doom // ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable private readonly WaterboxHost _elf; - private readonly CInterface _core; - private readonly CInterface.load_archive_cb _loadCallback; + private readonly LibDSDA _core; + private readonly LibDSDA.load_archive_cb _loadCallback; private readonly DoomControllerDeck _controllerDeck; private readonly Point _nativeResolution = new(320, 200); private readonly int[] _runSpeeds = [ 25, 50 ]; @@ -230,7 +230,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom private int _turnCarry = 0; // Chocolate Doom mouse behaviour (enabled in upstream by default) private List _args; private List _wadFiles; - private CInterface.GameMode _gameMode; + private LibDSDA.GameMode _gameMode; public string RomDetails { get; } // IRomInfo /// diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs index e03a98a6f7..b0638fe23c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs @@ -4,12 +4,12 @@ using BizHawk.BizInvoke; namespace BizHawk.Emulation.Cores.Computers.Doom { - public abstract class CInterface + public abstract class LibDSDA { public enum MemoryArrayType : int { - Things = 0, - Lines = 1, + Things = 0, + Lines = 1, Sectors = 2 }