Skip to content

Commit eef983c

Browse files
committed
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
1 parent 8fcaaed commit eef983c

File tree

2 files changed

+1
-43
lines changed

2 files changed

+1
-43
lines changed

src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,96 +157,81 @@ public class DoomSettings
157157
[TypeConverter(typeof(ConstrainedIntConverter))]
158158
public int ScaleFactor { get; set; }
159159

160-
[JsonIgnore]
161160
[DisplayName("Sfx Volume")]
162161
[Description("Sound effects volume [0 - 15].")]
163162
[Range(0, 15)]
164163
[DefaultValue(8)]
165164
public int SfxVolume { get; set; }
166165

167-
[JsonIgnore]
168166
[DisplayName("Music Volume")]
169167
[Description("[0 - 15]")]
170168
[Range(0, 15)]
171169
[DefaultValue(8)]
172170
public int MusicVolume { get; set; }
173171

174-
[JsonIgnore]
175172
[DisplayName("Gamma Correction Level")]
176173
[Description("Increases brightness [0 - 4].\n\nDefault value in vanilla is \"OFF\" (0).")]
177174
[Range(0, 4)]
178175
[DefaultValue(0)]
179176
[TypeConverter(typeof(ConstrainedIntConverter))]
180177
public int Gamma { get; set; }
181178

182-
[JsonIgnore]
183179
[DisplayName("Show Messages")]
184180
[Description("Displays messages about items you pick up.\n\nDefault value in vanilla is \"ON\".")]
185181
[DefaultValue(true)]
186182
public bool ShowMessages { get; set; }
187183

188-
[JsonIgnore]
189184
[DisplayName("Report Revealed Secrets")]
190185
[Description("Shows an on-screen notification when revealing a secret.")]
191186
[DefaultValue(false)]
192187
public bool ReportSecrets { get; set; }
193188

194-
[JsonIgnore]
195189
[DisplayName("HUD Mode")]
196190
[Description("Sets heads-up display mode.")]
197191
[DefaultValue(HudMode.Vanilla)]
198192
public HudMode HeadsUpMode { get; set; }
199193

200-
[JsonIgnore]
201194
[DisplayName("Extended HUD")]
202195
[Description("Shows DSDA-Doom-specific information above vanilla heads-up-display.")]
203196
[DefaultValue(false)]
204197
public bool DsdaExHud { get; set; }
205198

206-
[JsonIgnore]
207199
[DisplayName("Display Coordinates")]
208200
[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.")]
209201
[DefaultValue(false)]
210202
public bool DisplayCoordinates { get; set; }
211203

212-
[JsonIgnore]
213204
[DisplayName("Display Commands")]
214205
[Description("Shows input history on the screen. History size is 10, empty commands are excluded.")]
215206
[DefaultValue(false)]
216207
public bool DisplayCommands { get; set; }
217208

218-
[JsonIgnore]
219209
[DisplayName("Automap Totals")]
220210
[Description("Shows counts for kills, items, and secrets on automap.")]
221211
[DefaultValue(false)]
222212
public bool MapTotals { get; set; }
223213

224-
[JsonIgnore]
225214
[DisplayName("Automap Time")]
226215
[Description("Shows elapsed time on automap.")]
227216
[DefaultValue(false)]
228217
public bool MapTime { get; set; }
229218

230-
[JsonIgnore]
231219
[DisplayName("Automap Coordinates")]
232220
[Description("Shows in-level coordinates on automap.")]
233221
[DefaultValue(false)]
234222
public bool MapCoordinates { get; set; }
235223

236-
[JsonIgnore]
237224
[DisplayName("Automap Overlay")]
238225
[Description("Shows automap on top of gameplay.")]
239226
[DefaultValue(MapOverlays.Disabled)]
240227
public MapOverlays MapOverlay { get; set; }
241228

242-
[JsonIgnore]
243229
[DisplayName("Automap Details")]
244230
[Description("Exposes all linedefs and things.\n\nAvailable in vanilla via the IDDT cheat code.")]
245231
[DefaultValue(MapDetail.Normal)]
246232
[TypeConverter(typeof(DescribableEnumConverter))]
247233
public MapDetail MapDetails { get; set; }
248234

249-
[JsonIgnore]
250235
[DisplayName("Player Point of View")]
251236
[Description("Which of the players' point of view to use during rendering")]
252237
[Range(1, 4)]

src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,37 +71,10 @@ public DSDA(CoreLoadParameters<DoomSettings, DoomSyncSettings> lp)
7171
uint totalWadSizeKb = (totalWadSize / 1024) + 1;
7272
Console.WriteLine($"Reserving {totalWadSizeKb}kb for WAD file memory");
7373

74-
string hudMode = "";
75-
switch (_settings.HeadsUpMode)
76-
{
77-
case HudMode.Vanilla:
78-
hudMode = "screenblocks 10\nhud_displayed 1\n";
79-
break;
80-
case HudMode.DSDA:
81-
hudMode = "screenblocks 11\nhud_displayed 1\n";
82-
break;
83-
case HudMode.None:
84-
hudMode = "screenblocks 11\nhud_displayed 0\n";
85-
break;
86-
}
87-
8874
_configFile = Encoding.ASCII.GetBytes(
89-
hudMode
90-
+ $"screen_resolution \"{
75+
$"screen_resolution \"{
9176
_nativeResolution.X * _settings.ScaleFactor}x{
9277
_nativeResolution.Y * _settings.ScaleFactor}\"\n"
93-
+ $"usegamma { _settings.Gamma}\n"
94-
+ $"sfx_volume { _settings.SfxVolume}\n"
95-
+ $"music_volume { _settings.MusicVolume}\n"
96-
+ $"automap_overlay { (int)_settings.MapOverlay}\n"
97-
+ $"dsda_exhud { (_settings.DsdaExHud ? 1 : 0)}\n"
98-
+ $"map_totals { (_settings.MapTotals ? 1 : 0)}\n"
99-
+ $"map_time { (_settings.MapTime ? 1 : 0)}\n"
100-
+ $"map_coordinates { (_settings.MapCoordinates ? 1 : 0)}\n"
101-
+ $"hudadd_secretarea { (_settings.ReportSecrets ? 1 : 0)}\n"
102-
+ $"show_messages { (_settings.ShowMessages ? 1 : 0)}\n"
103-
+ $"dsda_coordinate_display {(_settings.DisplayCoordinates ? 1 : 0)}\n"
104-
+ $"dsda_command_display { (_settings.DisplayCommands ? 1 : 0)}\n"
10578
+ $"render_wipescreen { (_syncSettings.RenderWipescreen ? 1 : 0)}\n"
10679
+ "boom_translucent_sprites 0\n"
10780
+ "render_aspect 3\n" // 4:3, controls FOV on higher resolutions (see SetRatio() in the core)

0 commit comments

Comments
 (0)