From 0d05c1d263f8acd06d78960fd23bfa0ecf714d50 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 16 Jan 2025 05:33:40 +1000 Subject: [PATCH] Prevent CDL's "Disassemble..." when not implemented crashing EmuHawk (by disabling the button) see #1274 --- src/BizHawk.Client.EmuHawk/tools/CDL.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.cs index 9e2ee76479..55ea9efcaf 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.cs @@ -108,6 +108,8 @@ namespace BizHawk.Client.EmuHawk public override void Restart() { + DisassembleMenuItem.Tag = CodeDataLogger.GetType().GetMethod(nameof(ICodeDataLogger.DisassembleCDL))! + .IsImplemented(); //don't try to recover the current CDL! //even though it seems like it might be nice, it might get mixed up between games. even if we use CheckCDL. Switching games with the same memory map will be bad. _cdl = null; @@ -283,8 +285,8 @@ namespace BizHawk.Client.EmuHawk SaveAsMenuItem.Enabled = AppendMenuItem.Enabled = ClearMenuItem.Enabled = - DisassembleMenuItem.Enabled = _cdl != null; + DisassembleMenuItem.Enabled = _cdl is not null && /*core implements feature*/(bool) DisassembleMenuItem.Tag; miAutoSave.Checked = CDLAutoSave; miAutoStart.Checked = CDLAutoStart;