fix build

remove underscore from non-private fields
expose wipe screen setting
This commit is contained in:
feos 2025-03-16 23:03:15 +03:00
parent 9351a045c0
commit f0765a3a72
5 changed files with 69 additions and 64 deletions

View File

@ -820,7 +820,7 @@ namespace BizHawk.Emulation.Common
}, },
[VSystemID.Raw.Doom] = new() [VSystemID.Raw.Doom] = new()
{ {
["Automap"] = "M", ["Automap"] = 'M',
["Backward"] = 'v', ["Backward"] = 'v',
["End Player"] = 'E', ["End Player"] = 'E',
["Fire"] = 'F', ["Fire"] = 'F',

View File

@ -64,57 +64,57 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
} }
// initial axis read // initial axis read
players[i]._RunSpeed = potReaders[i](controller, 0); players[i].RunSpeed = potReaders[i](controller, 0);
players[i]._StrafingSpeed = potReaders[i](controller, 1); players[i].StrafingSpeed = potReaders[i](controller, 1);
players[i]._TurningSpeed = potReaders[i](controller, 2); players[i].TurningSpeed = potReaders[i](controller, 2);
players[i]._WeaponSelect = potReaders[i](controller, 3); players[i].WeaponSelect = potReaders[i](controller, 3);
// override axis based on movement buttons (turning is reversed upstream) // override axis based on movement buttons (turning is reversed upstream)
if (controller.IsPressed($"P{i+1} Forward")) players[i]._RunSpeed = _runSpeeds[speedIndex]; if (controller.IsPressed($"P{i + 1} Forward")) players[i].RunSpeed = _runSpeeds[speedIndex];
if (controller.IsPressed($"P{i+1} Backward")) players[i]._RunSpeed = -_runSpeeds[speedIndex]; if (controller.IsPressed($"P{i + 1} Backward")) players[i].RunSpeed = -_runSpeeds[speedIndex];
if (controller.IsPressed($"P{i+1} Strafe Right")) players[i]._StrafingSpeed = _strafeSpeeds[speedIndex]; if (controller.IsPressed($"P{i + 1} Strafe Right")) players[i].StrafingSpeed = _strafeSpeeds[speedIndex];
if (controller.IsPressed($"P{i+1} Strafe Left")) players[i]._StrafingSpeed = -_strafeSpeeds[speedIndex]; if (controller.IsPressed($"P{i + 1} Strafe Left")) players[i].StrafingSpeed = -_strafeSpeeds[speedIndex];
if (controller.IsPressed($"P{i + 1} Turn Right")) players[i]._TurningSpeed = -turnSpeed; if (controller.IsPressed($"P{i + 1} Turn Right")) players[i].TurningSpeed = -turnSpeed;
if (controller.IsPressed($"P{i + 1} Turn Left")) players[i]._TurningSpeed = turnSpeed; if (controller.IsPressed($"P{i + 1} Turn Left")) players[i].TurningSpeed = turnSpeed;
// mouse-driven running // mouse-driven running
// divider matches the core // divider matches the core
players[i]._RunSpeed -= (int)(potReaders[i](controller, 4) * _syncSettings.MouseRunSensitivity / 8.0); players[i].RunSpeed -= (int)(potReaders[i](controller, 4) * _syncSettings.MouseRunSensitivity / 8.0);
players[i]._RunSpeed = players[i]._RunSpeed.Clamp<int>(-_runSpeeds[1], _runSpeeds[1]); players[i].RunSpeed = players[i].RunSpeed.Clamp<int>(-_runSpeeds[1], _runSpeeds[1]);
// mouse-driven turning // mouse-driven turning
// divider recalibrates minimal mouse movement to be 1 (requires global setting) // divider recalibrates minimal mouse movement to be 1 (requires global setting)
players[i]._TurningSpeed -= (int)(potReaders[i](controller, 5) * _syncSettings.MouseTurnSensitivity / 272.0); players[i].TurningSpeed -= (int)(potReaders[i](controller, 5) * _syncSettings.MouseTurnSensitivity / 272.0);
if (_syncSettings.TurningResolution == TurningResolution.Shorttics) if (_syncSettings.TurningResolution == TurningResolution.Shorttics)
{ {
// calc matches the core // calc matches the core
players[i]._TurningSpeed = ((players[i]._TurningSpeed << 8) + 128) >> 8; players[i].TurningSpeed = ((players[i].TurningSpeed << 8) + 128) >> 8;
} }
// bool buttons // bool buttons
var actionsBitfield = portReaders[i](controller); var actionsBitfield = portReaders[i](controller);
players[i]._Fire = actionsBitfield & 0b00001; players[i].Fire = actionsBitfield & 0b00001;
players[i]._Action = (actionsBitfield & 0b00010) >> 1; players[i].Action = (actionsBitfield & 0b00010) >> 1;
players[i]._Automap = (actionsBitfield & 0b00100) >> 2; players[i].Automap = (actionsBitfield & 0b00100) >> 2;
// Raven Games // Raven Games
if (_syncSettings.InputFormat is DoomControllerTypes.Heretic or DoomControllerTypes.Hexen) if (_syncSettings.InputFormat is DoomControllerTypes.Heretic or DoomControllerTypes.Hexen)
{ {
players[i]._FlyLook = potReaders[i](controller, 6); players[i].FlyLook = potReaders[i](controller, 6);
players[i]._ArtifactUse = potReaders[i](controller, 7); players[i].ArtifactUse = potReaders[i](controller, 7);
if (_syncSettings.InputFormat is DoomControllerTypes.Hexen) if (_syncSettings.InputFormat is DoomControllerTypes.Hexen)
{ {
players[i]._Jump = (actionsBitfield & 0b01000) >> 3; players[i].Jump = (actionsBitfield & 0b01000) >> 3;
players[i]._EndPlayer = (actionsBitfield & 0b10000) >> 4; players[i].EndPlayer = (actionsBitfield & 0b10000) >> 4;
} }
} }
} }
} }
PackedRenderInfo renderInfo = new PackedRenderInfo(); PackedRenderInfo renderInfo = new PackedRenderInfo();
renderInfo._RenderVideo = renderVideo ? 1 : 0; renderInfo.RenderVideo = renderVideo ? 1 : 0;
renderInfo._RenderAudio = renderAudio ? 1 : 0; renderInfo.RenderAudio = renderAudio ? 1 : 0;
renderInfo._PlayerPointOfView = _settings.DisplayPlayer - 1; renderInfo.PlayerPointOfView = _settings.DisplayPlayer - 1;
IsLagFrame = _core.dsda_frame_advance( IsLagFrame = _core.dsda_frame_advance(
ref players[0], ref players[0],

View File

@ -259,6 +259,11 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[DefaultValue(true)] [DefaultValue(true)]
public bool AlwaysRun { get; set; } public bool AlwaysRun { get; set; }
[DisplayName("Render Wipescreen")]
[Description("Enables screen melt - an effect seen when Doom changes scene, for example, when starting or exiting a level.")]
[DefaultValue(true)]
public bool RenderWipescreen { get; set; }
[DisplayName("Turning Resolution")] [DisplayName("Turning Resolution")]
[Description("\"Shorttics\" refers to decreased turning resolution used for demos. \"Longtics\" refers to the regular turning resolution outside of a demo-recording environment.")] [Description("\"Shorttics\" refers to decreased turning resolution used for demos. \"Longtics\" refers to the regular turning resolution outside of a demo-recording environment.")]
[DefaultValue(TurningResolution.Longtics)] [DefaultValue(TurningResolution.Longtics)]
@ -313,16 +318,16 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
{ {
return new CInterface.InitSettings return new CInterface.InitSettings
{ {
_Player1Present = Player1Present ? 1 : 0, Player1Present = Player1Present ? 1 : 0,
_Player2Present = Player2Present ? 1 : 0, Player2Present = Player2Present ? 1 : 0,
_Player3Present = Player3Present ? 1 : 0, Player3Present = Player3Present ? 1 : 0,
_Player4Present = Player4Present ? 1 : 0, Player4Present = Player4Present ? 1 : 0,
_Player1Class = (int) Player1Class, Player1Class = (int) Player1Class,
_Player2Class = (int) Player2Class, Player2Class = (int) Player2Class,
_Player3Class = (int) Player3Class, Player3Class = (int) Player3Class,
_Player4Class = (int) Player4Class, Player4Class = (int) Player4Class,
_PreventLevelExit = PreventLevelExit ? 1 : 0, PreventLevelExit = PreventLevelExit ? 1 : 0,
_PreventGameEnd = PreventGameEnd ? 1 : 0 PreventGameEnd = PreventGameEnd ? 1 : 0
// MouseRunSensitivity is handled at Bizhawk level // MouseRunSensitivity is handled at Bizhawk level
// MouseTurnSensitivity is handled at Bizhawk level // MouseTurnSensitivity is handled at Bizhawk level
}; };

View File

@ -77,16 +77,16 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
_nativeResolution.X * _settings.ScaleFactor}x{ _nativeResolution.X * _settings.ScaleFactor}x{
_nativeResolution.Y * _settings.ScaleFactor}\"\n" _nativeResolution.Y * _settings.ScaleFactor}\"\n"
+ $"usegamma {_settings.Gamma}\n" + $"usegamma {_settings.Gamma}\n"
+ "dsda_exhud 0\n" + $"render_wipescreen {(_syncSettings.RenderWipescreen ? 1 : 0)}\n"
+ "dsda_pistol_start 0\n"
+ "uncapped_framerate 0\n"
+ "render_aspect 3\n" // 4:3, controls FOV on higher resolutions (see SetRatio()) + "render_aspect 3\n" // 4:3, controls FOV on higher resolutions (see SetRatio())
+ "render_stretch_hud 0\n" + "render_stretch_hud 0\n"
+ "render_stretchsky 0\n" + "render_stretchsky 0\n"
+ "render_doom_lightmaps 1\n" + "render_doom_lightmaps 1\n"
+ "render_wipescreen 1\n" + "dsda_exhud 0\n"
+ "uncapped_framerate 0\n"
+ "map_coordinates 0\n" + "map_coordinates 0\n"
+ "map_totals 0\n" + "map_totals 0\n"
+ "map_time 0\n"
); );
_elf = new WaterboxHost(new WaterboxOptions _elf = new WaterboxHost(new WaterboxOptions
@ -178,7 +178,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
ConditionalArg(_syncSettings.MultiplayerMode == MultiplayerMode.Deathmatch, "-deathmatch"); ConditionalArg(_syncSettings.MultiplayerMode == MultiplayerMode.Deathmatch, "-deathmatch");
ConditionalArg(_syncSettings.MultiplayerMode == MultiplayerMode.Altdeath, "-altdeath"); ConditionalArg(_syncSettings.MultiplayerMode == MultiplayerMode.Altdeath, "-altdeath");
ConditionalArg(_syncSettings.Turbo > 0, $"-turbo {_syncSettings.Turbo}"); ConditionalArg(_syncSettings.Turbo > 0, $"-turbo {_syncSettings.Turbo}");
ConditionalArg((initSettings._Player1Present + initSettings._Player2Present + initSettings._Player3Present + initSettings._Player4Present) > 1, "-solo-net"); ConditionalArg((initSettings.Player1Present + initSettings.Player2Present + initSettings.Player3Present + initSettings.Player4Present) > 1, "-solo-net");
} }
private void ConditionalArg(bool condition, string setting) private void ConditionalArg(bool condition, string setting)

View File

@ -29,44 +29,44 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct InitSettings public struct InitSettings
{ {
public int _Player1Present; public int Player1Present;
public int _Player2Present; public int Player2Present;
public int _Player3Present; public int Player3Present;
public int _Player4Present; public int Player4Present;
public int _Player1Class; public int Player1Class;
public int _Player2Class; public int Player2Class;
public int _Player3Class; public int Player3Class;
public int _Player4Class; public int Player4Class;
public int _PreventLevelExit; public int PreventLevelExit;
public int _PreventGameEnd; public int PreventGameEnd;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct PackedPlayerInput public struct PackedPlayerInput
{ {
public int _RunSpeed; public int RunSpeed;
public int _StrafingSpeed; public int StrafingSpeed;
public int _TurningSpeed; public int TurningSpeed;
public int _WeaponSelect; public int WeaponSelect;
public int _Fire; public int Fire;
public int _Action; public int Action;
public int _Automap; public int Automap;
// Hexen + Heretic (Raven Games) // Hexen + Heretic (Raven Games)
public int _FlyLook; public int FlyLook;
public int _ArtifactUse; public int ArtifactUse;
// Hexen only // Hexen only
public int _Jump; public int Jump;
public int _EndPlayer; public int EndPlayer;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct PackedRenderInfo public struct PackedRenderInfo
{ {
public int _RenderVideo; public int RenderVideo;
public int _RenderAudio; public int RenderAudio;
public int _PlayerPointOfView; public int PlayerPointOfView;
} }
[BizImport(CallingConvention.Cdecl)] [BizImport(CallingConvention.Cdecl)]