Skip to content

Commit 0fe3c33

Browse files
committed
dsda: disable BOOM demo import for now
passing rngseed didn't fix sync, and passing all the settings is too much work for this release. will support it afterwards. instead just tell the user BOOM demos are not supported
1 parent c84d292 commit 0fe3c33

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

src/BizHawk.Client.Common/movie/import/DoomLmpImport.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Buffers.Binary;
2+
13
using BizHawk.Common.IOExtensions;
24
using BizHawk.Emulation.Common;
35
using BizHawk.Emulation.Cores;
@@ -49,6 +51,7 @@ protected override void RunImport()
4951
var monstersRespawn = false;
5052
var fastMonsters = false;
5153
var noMonsters = false;
54+
//var rngSeed = 1993U;
5255

5356
Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.DSDA;
5457
Result.Movie.SystemID = VSystemID.Raw.Doom;
@@ -106,6 +109,10 @@ protected override void RunImport()
106109
}
107110
else // Boom territory
108111
{
112+
Result.Errors.Add($"Found BOOM demo format: v{(int)version}. Importing it is currently not supported.");
113+
return;
114+
115+
/*
109116
i++; // skip to signature's second byte
110117
var portID = input[i++];
111118
i += 4; // skip the rest of the signature
@@ -184,12 +191,10 @@ protected override void RunImport()
184191
monstersRespawn = input[i++] is not 0;
185192
fastMonsters = input[i++] is not 0;
186193
noMonsters = input[i++] is not 0;
187-
188-
var optionsSize = compLevel == DSDA.CompatibilityLevel.MBF21 ? 21 + 25 : 64;
189-
i += optionsSize - 9; // subtract the options we already parsed
190-
191-
if (version == DemoVersion.Boom_2_00)
192-
i += 256 - optionsSize;
194+
i++; // demo insurance
195+
rngSeed = BinaryPrimitives.ReadUInt32BigEndian(input.AsSpan(i, 4));
196+
i = 0x4D;
197+
*/
193198
}
194199

195200
DSDA.DoomSyncSettings syncSettings = new()
@@ -205,21 +210,22 @@ protected override void RunImport()
205210
NoMonsters = noMonsters,
206211
TurningResolution = turningResolution,
207212
RenderWipescreen = false,
213+
//RNGSeed = rngSeed,
208214
};
209215

210216
syncSettings.Player1Present = input[i++] is not 0;
211217
syncSettings.Player2Present = input[i++] is not 0;
212218
syncSettings.Player3Present = input[i++] is not 0;
213219
syncSettings.Player4Present = input[i++] is not 0;
214-
220+
/*
215221
if (compLevel >= DSDA.CompatibilityLevel.Boom_Compatibility
216222
&& version >= DemoVersion.Boom_2_00)
217223
{
218224
var FUTURE_MAXPLAYERS = 32;
219225
var g_maxplayers = 4;
220226
i += FUTURE_MAXPLAYERS - g_maxplayers;
221227
}
222-
228+
*/
223229
Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(syncSettings);
224230

225231
var doomController = new DoomControllerDeck(

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,12 @@ public class DoomSyncSettings
403403
[Description("How fast the Doom player will run when using the mouse.")]
404404
[DefaultValue(1)]
405405
public int MouseRunSensitivity { get; set; }
406-
406+
/*
407+
[DisplayName("Initial RNG Seed")]
408+
[Description("Boom demos.")]
409+
[DefaultValue(1993)]
410+
public uint RNGSeed { get; set; }
411+
*/
407412
[DisplayName("Player 1 Hexen Class")]
408413
[Description("The Hexen class to use for player 1. Has no effect for Doom / Heretic")]
409414
[DefaultValue(HexenClass.Fighter)]
@@ -441,7 +446,8 @@ public LibDSDA.InitSettings GetNativeSettings(GameInfo game)
441446
Player3Class = (int)Player3Class,
442447
Player4Class = (int)Player4Class,
443448
PreventLevelExit = PreventLevelExit ? 1 : 0,
444-
PreventGameEnd = PreventGameEnd ? 1 : 0
449+
PreventGameEnd = PreventGameEnd ? 1 : 0,
450+
//RNGSeed = RNGSeed,
445451
};
446452
}
447453

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public struct InitSettings
3636
public int Player4Class;
3737
public int PreventLevelExit;
3838
public int PreventGameEnd;
39+
//public uint RNGSeed;
3940
}
4041

4142
[StructLayout(LayoutKind.Sequential)]

waterbox/dsda/BizhawkInterface.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ ECL_EXPORT int dsda_init(struct InitSettings *settings, int argc, char **argv)
283283
break;
284284
}
285285

286+
//if (compatibility_level >= boom_202_compatibility)
287+
// rngseed = settings->RNGSeed;
288+
286289
// Initializing audio
287290
I_SetSoundCap();
288291
I_InitSound();

waterbox/dsda/BizhawkInterface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern void headlessSetTickCommand(int playerId, int forwardSpeed, int strafingS
2626
extern void headlessGetMapName(char *outString);
2727
extern void headlessSetSaveStatePointer(void *savePtr, int saveStateSize);
2828
extern size_t headlessGetEffectiveSaveSize();
29+
extern unsigned int rngseed;
2930

3031
// Video
3132
extern void headlessUpdateVideo();
@@ -140,6 +141,7 @@ struct InitSettings
140141
int Player4Class;
141142
int PreventLevelExit;
142143
int PreventGameEnd;
144+
//unsigned int RNGSeed;
143145
} __attribute__((packed));
144146

145147
struct PackedPlayerInput

0 commit comments

Comments
 (0)