dsda: expose huds and automap stats

make settings changes require reboot explicitly. unsure if I still want them to have immediate effect
This commit is contained in:
feos 2025-03-17 20:33:55 +03:00
parent ebbdc1ad5c
commit 19374203da
3 changed files with 66 additions and 18 deletions

View File

@ -65,6 +65,13 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
NM = 5
}
public enum HudMode : int
{
Vanilla = 0,
DSDA = 1,
None = 2
}
public enum TurningResolution : int
{
[Display(Name = "16 bits (longtics)")]
@ -139,15 +146,40 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[DefaultValue(1)]
[TypeConverter(typeof(ConstrainedIntConverter))]
public int DisplayPlayer { get; set; }
[DisplayName("HUD Mode")]
[Description("Sets heads-up display mode.")]
[DefaultValue(HudMode.Vanilla)]
public HudMode HeadsUpMode { get; set; }
[DisplayName("Extended HUD")]
[Description("Shows DSDA-Doom-specific information above vanilla heads-up-display.")]
[DefaultValue(false)]
public bool DsdaExHud { get; set; }
[DisplayName("Automap Totals")]
[Description("Shows counts for kills, items, and secrets on automap.")]
[DefaultValue(true)]
public bool MapTotals { get; set; }
[DisplayName("Automap Time")]
[Description("Shows elapsed time on automap.")]
[DefaultValue(true)]
public bool MapTime { get; set; }
[DisplayName("Automap Coordinates")]
[Description("Shows in-level coordinates on automap.")]
[DefaultValue(true)]
public bool MapCoordinates { get; set; }
public DoomSettings()
=> SettingsUtil.SetDefaultValues(this);
public DoomSettings Clone()
=> (DoomSettings) MemberwiseClone();
=> (DoomSettings)MemberwiseClone();
public static bool NeedsReboot(DoomSettings x, DoomSettings y)
=> false;
=> !DeepEquality.DeepEquals(x, y);
}
public PutSettingsDirtyBits PutSettings(DoomSettings o)
{
@ -322,14 +354,12 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
Player2Present = Player2Present ? 1 : 0,
Player3Present = Player3Present ? 1 : 0,
Player4Present = Player4Present ? 1 : 0,
Player1Class = (int) Player1Class,
Player2Class = (int) Player2Class,
Player3Class = (int) Player3Class,
Player4Class = (int) Player4Class,
Player1Class = (int)Player1Class,
Player2Class = (int)Player2Class,
Player3Class = (int)Player3Class,
Player4Class = (int)Player4Class,
PreventLevelExit = PreventLevelExit ? 1 : 0,
PreventGameEnd = PreventGameEnd ? 1 : 0
// MouseRunSensitivity is handled at Bizhawk level
// MouseTurnSensitivity is handled at Bizhawk level
};
}

View File

@ -73,20 +73,38 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
uint totalWadSizeKb = (totalWadSize / 1024) + 1;
Console.WriteLine($"Reserving {totalWadSizeKb}kb for WAD file memory");
_configFile = Encoding.ASCII.GetBytes($"screen_resolution \"{
string hudMode = "";
switch (_settings.HeadsUpMode)
{
case HudMode.Vanilla:
hudMode = "screenblocks 10\nhud_displayed 1\n";
break;
case HudMode.DSDA:
hudMode = "screenblocks 11\nhud_displayed 1\n";
break;
case HudMode.None:
hudMode = "screenblocks 11\nhud_displayed 0\n";
break;
}
_configFile = Encoding.ASCII.GetBytes(
hudMode
+ $"screen_resolution \"{
_nativeResolution.X * _settings.ScaleFactor}x{
_nativeResolution.Y * _settings.ScaleFactor}\"\n"
+ $"usegamma {_settings.Gamma}\n"
+ $"render_wipescreen {(_syncSettings.RenderWipescreen ? 1 : 0)}\n"
+ "render_aspect 3\n" // 4:3, controls FOV on higher resolutions (see SetRatio())
+ "render_stretch_hud 0\n"
+ $"dsda_exhud {(_settings.DsdaExHud ? 1 : 0)}\n"
+ $"map_totals {(_settings.MapTotals ? 1 : 0)}\n"
+ $"map_time {(_settings.MapTime ? 1 : 0)}\n"
+ $"map_coordinates {(_settings.MapCoordinates ? 1 : 0)}\n"
+ "render_stretchsky 0\n"
+ "render_doom_lightmaps 1\n"
+ "dsda_exhud 0\n"
+ "render_aspect 3\n" // 4:3, controls FOV on higher resolutions (see SetRatio())
+ "render_stretch_hud 0\n"
+ "uncapped_framerate 0\n"
+ "map_coordinates 0\n"
+ "map_totals 0\n"
+ "map_time 0\n"
+ "dsda_show_level_splits 0\n"
);
_elf = new WaterboxHost(new WaterboxOptions

View File

@ -23,9 +23,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
Indetermined = 1 << 4 // no IWAD found.
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int load_archive_cb(string filename, IntPtr buffer, int maxsize);
[StructLayout(LayoutKind.Sequential)]
public struct InitSettings
{
@ -86,6 +83,9 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[BizImport(CallingConvention.Cdecl)]
public abstract void dsda_get_video(out int w, out int h, out int pitch, ref IntPtr buffer, out int palSize, ref IntPtr palBuffer);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int load_archive_cb(string filename, IntPtr buffer, int maxsize);
[BizImport(CallingConvention.Cdecl)]
public abstract int dsda_add_wad_file(
string fileName,