Compare firmware customisations to movie header (partial fix for #2498)
This commit is contained in:
parent
0410a4f291
commit
8b07f9ecde
|
@ -414,9 +414,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private string CanProvideFirmware(FirmwareID id, string hash)
|
||||
=> FirmwareManager.Resolve(
|
||||
Config.PathEntries,
|
||||
Config.FirmwareUserSpecifications,
|
||||
FirmwareDatabase.FirmwareRecords.First(fr => fr.ID == id),
|
||||
// exactFile: hash, //TODO re-scan FW dir for this file, then try autopatching
|
||||
forbidScan: true)?.Hash;
|
||||
|
||||
private void PlayMovieMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var form = new PlayMovie(this, Config, Game, Emulator, MovieSession);
|
||||
using var form = new PlayMovie(this, Config, Game, Emulator, MovieSession, CanProvideFirmware);
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class PlayMovie : Form, IDialogParent
|
||||
{
|
||||
private readonly Func<FirmwareID, string, string> _canProvideFirmware;
|
||||
|
||||
private readonly IMainFormForTools _mainForm;
|
||||
private readonly Config _config;
|
||||
private readonly GameInfo _game;
|
||||
|
@ -36,9 +38,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
Config config,
|
||||
GameInfo game,
|
||||
IEmulator emulator,
|
||||
IMovieSession movieSession)
|
||||
IMovieSession movieSession,
|
||||
Func<FirmwareID, string, string> canProvideFirmware)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
_canProvideFirmware = canProvideFirmware;
|
||||
_config = config;
|
||||
_game = game;
|
||||
_emulator = emulator;
|
||||
|
@ -412,6 +416,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
item.ToolTipText = $"Expected: {v}\n Actual: {_emulator.SystemId}";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (k.Contains("_Firmware_"))
|
||||
{
|
||||
var split = k.Split(new[] { "_Firmware_" }, StringSplitOptions.None);
|
||||
var actualHash = _canProvideFirmware(new(split[0], split[1]), v);
|
||||
if (actualHash != v)
|
||||
{
|
||||
item.BackColor = Color.Yellow;
|
||||
item.ToolTipText = $"Expected: {v}\nActual: {actualHash}";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
DetailsView.Items.Add(item);
|
||||
|
|
Loading…
Reference in New Issue