From 04955ea2286a517660383367f2645584fd54a7b7 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 5 Jan 2025 21:24:09 +1000 Subject: [PATCH] Use deterministic filenames for synthesised PSX `.cue`s resolves #4146 --- src/BizHawk.Client.Common/RomLoader.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index c65a2b3f6e..e5708e0df3 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -487,7 +487,8 @@ namespace BizHawk.Client.Common break; case VSystemID.Raw.PSX when ext is ".bin": const string FILE_EXT_CUE = ".cue"; - var cuePath = TempFileManager.GetTempFilename(friendlyName: "syn", dotAndExtension: FILE_EXT_CUE, delete: false); + var crc32Digest = CRC32Checksum.ComputeDigestHex(file.GetStream().ReadAllBytes()); // slow! + var cuePath = Path.Combine(Path.GetTempPath(), $"synthesised for {crc32Digest}{FILE_EXT_CUE}"); DiscMountJob.CreateSyntheticCue(cueFilePath: cuePath, binFilePath: file.Name); var gameBak = game; var nextEmulatorBak = nextEmulator;