dsda: put non-sync settings to ini but not pass them on init

if we set them on core init that's how it'd remember them in the reference state, so loading states made with different init options would fail to load

instead we set everything to default on init and then change to what the user set during the first frame advance. that way reference state remains the same so states using different options keep working across all variants

need to not show core messages tho when something is changed from default, because now they appear on init and state load rather than only on explicit change
This commit is contained in:
feos 2025-05-24 23:33:41 +03:00
parent 8fcaaedd2c
commit eef983cc2c
2 changed files with 1 additions and 43 deletions

View File

@ -157,21 +157,18 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[TypeConverter(typeof(ConstrainedIntConverter))] [TypeConverter(typeof(ConstrainedIntConverter))]
public int ScaleFactor { get; set; } public int ScaleFactor { get; set; }
[JsonIgnore]
[DisplayName("Sfx Volume")] [DisplayName("Sfx Volume")]
[Description("Sound effects volume [0 - 15].")] [Description("Sound effects volume [0 - 15].")]
[Range(0, 15)] [Range(0, 15)]
[DefaultValue(8)] [DefaultValue(8)]
public int SfxVolume { get; set; } public int SfxVolume { get; set; }
[JsonIgnore]
[DisplayName("Music Volume")] [DisplayName("Music Volume")]
[Description("[0 - 15]")] [Description("[0 - 15]")]
[Range(0, 15)] [Range(0, 15)]
[DefaultValue(8)] [DefaultValue(8)]
public int MusicVolume { get; set; } public int MusicVolume { get; set; }
[JsonIgnore]
[DisplayName("Gamma Correction Level")] [DisplayName("Gamma Correction Level")]
[Description("Increases brightness [0 - 4].\n\nDefault value in vanilla is \"OFF\" (0).")] [Description("Increases brightness [0 - 4].\n\nDefault value in vanilla is \"OFF\" (0).")]
[Range(0, 4)] [Range(0, 4)]
@ -179,74 +176,62 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[TypeConverter(typeof(ConstrainedIntConverter))] [TypeConverter(typeof(ConstrainedIntConverter))]
public int Gamma { get; set; } public int Gamma { get; set; }
[JsonIgnore]
[DisplayName("Show Messages")] [DisplayName("Show Messages")]
[Description("Displays messages about items you pick up.\n\nDefault value in vanilla is \"ON\".")] [Description("Displays messages about items you pick up.\n\nDefault value in vanilla is \"ON\".")]
[DefaultValue(true)] [DefaultValue(true)]
public bool ShowMessages { get; set; } public bool ShowMessages { get; set; }
[JsonIgnore]
[DisplayName("Report Revealed Secrets")] [DisplayName("Report Revealed Secrets")]
[Description("Shows an on-screen notification when revealing a secret.")] [Description("Shows an on-screen notification when revealing a secret.")]
[DefaultValue(false)] [DefaultValue(false)]
public bool ReportSecrets { get; set; } public bool ReportSecrets { get; set; }
[JsonIgnore]
[DisplayName("HUD Mode")] [DisplayName("HUD Mode")]
[Description("Sets heads-up display mode.")] [Description("Sets heads-up display mode.")]
[DefaultValue(HudMode.Vanilla)] [DefaultValue(HudMode.Vanilla)]
public HudMode HeadsUpMode { get; set; } public HudMode HeadsUpMode { get; set; }
[JsonIgnore]
[DisplayName("Extended HUD")] [DisplayName("Extended HUD")]
[Description("Shows DSDA-Doom-specific information above vanilla heads-up-display.")] [Description("Shows DSDA-Doom-specific information above vanilla heads-up-display.")]
[DefaultValue(false)] [DefaultValue(false)]
public bool DsdaExHud { get; set; } public bool DsdaExHud { get; set; }
[JsonIgnore]
[DisplayName("Display Coordinates")] [DisplayName("Display Coordinates")]
[Description("Shows player position, angle, velocity, and distance travelled per frame. Color indicates movement tiers: green - SR40, blue - SR50, red - turbo/wallrun.\n\nAvailable in vanilla via the IDMYPOS cheat code, however vanilla only shows angle, X, and Y.")] [Description("Shows player position, angle, velocity, and distance travelled per frame. Color indicates movement tiers: green - SR40, blue - SR50, red - turbo/wallrun.\n\nAvailable in vanilla via the IDMYPOS cheat code, however vanilla only shows angle, X, and Y.")]
[DefaultValue(false)] [DefaultValue(false)]
public bool DisplayCoordinates { get; set; } public bool DisplayCoordinates { get; set; }
[JsonIgnore]
[DisplayName("Display Commands")] [DisplayName("Display Commands")]
[Description("Shows input history on the screen. History size is 10, empty commands are excluded.")] [Description("Shows input history on the screen. History size is 10, empty commands are excluded.")]
[DefaultValue(false)] [DefaultValue(false)]
public bool DisplayCommands { get; set; } public bool DisplayCommands { get; set; }
[JsonIgnore]
[DisplayName("Automap Totals")] [DisplayName("Automap Totals")]
[Description("Shows counts for kills, items, and secrets on automap.")] [Description("Shows counts for kills, items, and secrets on automap.")]
[DefaultValue(false)] [DefaultValue(false)]
public bool MapTotals { get; set; } public bool MapTotals { get; set; }
[JsonIgnore]
[DisplayName("Automap Time")] [DisplayName("Automap Time")]
[Description("Shows elapsed time on automap.")] [Description("Shows elapsed time on automap.")]
[DefaultValue(false)] [DefaultValue(false)]
public bool MapTime { get; set; } public bool MapTime { get; set; }
[JsonIgnore]
[DisplayName("Automap Coordinates")] [DisplayName("Automap Coordinates")]
[Description("Shows in-level coordinates on automap.")] [Description("Shows in-level coordinates on automap.")]
[DefaultValue(false)] [DefaultValue(false)]
public bool MapCoordinates { get; set; } public bool MapCoordinates { get; set; }
[JsonIgnore]
[DisplayName("Automap Overlay")] [DisplayName("Automap Overlay")]
[Description("Shows automap on top of gameplay.")] [Description("Shows automap on top of gameplay.")]
[DefaultValue(MapOverlays.Disabled)] [DefaultValue(MapOverlays.Disabled)]
public MapOverlays MapOverlay { get; set; } public MapOverlays MapOverlay { get; set; }
[JsonIgnore]
[DisplayName("Automap Details")] [DisplayName("Automap Details")]
[Description("Exposes all linedefs and things.\n\nAvailable in vanilla via the IDDT cheat code.")] [Description("Exposes all linedefs and things.\n\nAvailable in vanilla via the IDDT cheat code.")]
[DefaultValue(MapDetail.Normal)] [DefaultValue(MapDetail.Normal)]
[TypeConverter(typeof(DescribableEnumConverter))] [TypeConverter(typeof(DescribableEnumConverter))]
public MapDetail MapDetails { get; set; } public MapDetail MapDetails { get; set; }
[JsonIgnore]
[DisplayName("Player Point of View")] [DisplayName("Player Point of View")]
[Description("Which of the players' point of view to use during rendering")] [Description("Which of the players' point of view to use during rendering")]
[Range(1, 4)] [Range(1, 4)]

View File

@ -71,37 +71,10 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
uint totalWadSizeKb = (totalWadSize / 1024) + 1; uint totalWadSizeKb = (totalWadSize / 1024) + 1;
Console.WriteLine($"Reserving {totalWadSizeKb}kb for WAD file memory"); Console.WriteLine($"Reserving {totalWadSizeKb}kb for WAD file memory");
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( _configFile = Encoding.ASCII.GetBytes(
hudMode $"screen_resolution \"{
+ $"screen_resolution \"{
_nativeResolution.X * _settings.ScaleFactor}x{ _nativeResolution.X * _settings.ScaleFactor}x{
_nativeResolution.Y * _settings.ScaleFactor}\"\n" _nativeResolution.Y * _settings.ScaleFactor}\"\n"
+ $"usegamma { _settings.Gamma}\n"
+ $"sfx_volume { _settings.SfxVolume}\n"
+ $"music_volume { _settings.MusicVolume}\n"
+ $"automap_overlay { (int)_settings.MapOverlay}\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"
+ $"hudadd_secretarea { (_settings.ReportSecrets ? 1 : 0)}\n"
+ $"show_messages { (_settings.ShowMessages ? 1 : 0)}\n"
+ $"dsda_coordinate_display {(_settings.DisplayCoordinates ? 1 : 0)}\n"
+ $"dsda_command_display { (_settings.DisplayCommands ? 1 : 0)}\n"
+ $"render_wipescreen { (_syncSettings.RenderWipescreen ? 1 : 0)}\n" + $"render_wipescreen { (_syncSettings.RenderWipescreen ? 1 : 0)}\n"
+ "boom_translucent_sprites 0\n" + "boom_translucent_sprites 0\n"
+ "render_aspect 3\n" // 4:3, controls FOV on higher resolutions (see SetRatio() in the core) + "render_aspect 3\n" // 4:3, controls FOV on higher resolutions (see SetRatio() in the core)