Add setup for profiling gamedb

simply build with
`-p:MachineExtraCompilationFlag=BIZHAWKBUILD_RUN_ONLY_GAMEDB_INIT`
This commit is contained in:
YoshiRulz 2024-10-24 04:45:01 +10:00
parent 4678d90646
commit 6f3fd9740e
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 13 additions and 0 deletions

View File

@ -316,6 +316,9 @@ namespace BizHawk.Client.EmuHawk
try
{
GameDBHelper.BackgroundInitAll();
#if BIZHAWKBUILD_RUN_ONLY_GAMEDB_INIT
GameDBHelper.WaitForThreadAndQuickTest();
#else
MainForm mf = new(
cliFlags,
workingGL,
@ -362,6 +365,7 @@ namespace BizHawk.Client.EmuHawk
movieSession.Movie.Save();
}
}
#endif
}
catch (Exception e) when (!Debugger.IsAttached)
{

View File

@ -1,5 +1,6 @@
using System.IO;
using BizHawk.Common;
using BizHawk.Common.PathExtensions;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Arcades.MAME;
@ -19,5 +20,13 @@ namespace BizHawk.Emulation.Cores
BootGodDb.Initialize(bundledGamedbPath);
MAMEMachineDB.Initialize(bundledGamedbPath);
}
public static void WaitForThreadAndQuickTest()
{
RomStatus StatusFor(string hashDigest)
=> Database.CheckDatabase(hashDigest)?.Status ?? RomStatus.NotInDatabase;
Console.WriteLine(StatusFor(SHA1Checksum.EmptyFile)); // NotInDatabase
Console.WriteLine(StatusFor("3064E664D34859649B67559F0ED0C2FFD6948031")); // BadDump
}
}
}