dsda: rename cinterface because this thing is not limited to it

This commit is contained in:
feos 2025-04-27 23:36:39 +03:00
parent e733d28600
commit 4cfc20e3ff
5 changed files with 19 additions and 20 deletions

View File

@ -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,

View File

@ -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),

View File

@ -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,

View File

@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
using (_elf.EnterExit())
{
_core = BizInvoker.GetInvoker<CInterface>(_elf, _elf, callingConventionAdapter);
_core = BizInvoker.GetInvoker<LibDSDA>(_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<string>
{
@ -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<string> _args;
private List<IRomAsset> _wadFiles;
private CInterface.GameMode _gameMode;
private LibDSDA.GameMode _gameMode;
public string RomDetails { get; } // IRomInfo
/// <summary>

View File

@ -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
}