From e8c50ae93e25808e66a0fae3058e152e20b0e10d Mon Sep 17 00:00:00 2001 From: Juan Segura Date: Fri, 19 Dec 2025 23:03:45 +0100 Subject: [PATCH] CSpect executing error --- ZXBStudio/MainWindow.axaml.cs | 44 +++++++++++++++++++++++------------ ZXBStudio/Program.cs | 4 ++-- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/ZXBStudio/MainWindow.axaml.cs b/ZXBStudio/MainWindow.axaml.cs index 946a87e..0859a00 100644 --- a/ZXBStudio/MainWindow.axaml.cs +++ b/ZXBStudio/MainWindow.axaml.cs @@ -1502,19 +1502,26 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven } else if (emulatorName.ToLower() == "cspect") { - outLog.Writer.WriteLine("Launching CSpect..."); - Process process = new Process(); - process.StartInfo.FileName = emulatorPath; - process.StartInfo.Arguments = string.Format( - "-zxnext -tv -w3 -brk -r -mmc=\"{0}\" \"{1}\"", - nextDrive, - Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex")); - process.StartInfo.WorkingDirectory = project.ProjectPath; - process.StartInfo.UseShellExecute = true; - process.StartInfo.CreateNoWindow = false; - outLog.Writer.WriteLine(process.StartInfo.FileName + " " + process.StartInfo.Arguments); - process.Start(); - process.WaitForExit(); + if (!File.Exists(emulatorPath)) + { + errorMsg = "Emulator not found on: " + emulatorPath; + } + else + { + outLog.Writer.WriteLine("Launching CSpect..."); + Process process = new Process(); + process.StartInfo.FileName = emulatorPath; + process.StartInfo.Arguments = string.Format( + "-zxnext -tv -w3 -brk -r -mmc=\"{0}\" \"{1}\"", + nextDrive, + Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex")); + process.StartInfo.WorkingDirectory = project.ProjectPath; + process.StartInfo.UseShellExecute = false; + process.StartInfo.CreateNoWindow = false; + outLog.Writer.WriteLine(process.StartInfo.FileName + " " + process.StartInfo.Arguments); + process.Start(); + process.WaitForExit(); + } } else if (emulatorName.ToLower() == "zesarux") { @@ -1526,7 +1533,7 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven nextDrive, Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex")); process.StartInfo.WorkingDirectory = Path.GetDirectoryName(emulatorPath); - process.StartInfo.UseShellExecute = true; + process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = false; outLog.Writer.WriteLine(process.StartInfo.FileName + " " + process.StartInfo.Arguments); process.Start(); @@ -1539,7 +1546,12 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven } catch (Exception ex) { - errorMsg = "Error executing emulator"; + errorMsg = "Error executing emulator: " + ex.Message + ex.StackTrace; + if (ex.InnerException != null) + { + var ex2= ex.InnerException; + errorMsg += "\r\nInner Exception: " + ex.Message + ex.StackTrace; + } } } @@ -1625,6 +1637,8 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven } }); } + + private async void BuildAndDebug(object? sender, Avalonia.Interactivity.RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(ZXOptions.Current.ZxbcPath) || string.IsNullOrWhiteSpace(ZXOptions.Current.ZxbasmPath)) diff --git a/ZXBStudio/Program.cs b/ZXBStudio/Program.cs index 04cb086..2d85834 100644 --- a/ZXBStudio/Program.cs +++ b/ZXBStudio/Program.cs @@ -8,8 +8,8 @@ namespace ZXBasicStudio { internal class Program { - public static string Version = "1.6.0 - beta 6"; - public static string VersionDate = "2025.10.09"; + public static string Version = "1.6.0 - beta 6.3"; + public static string VersionDate = "2025.11.16"; // Initialization code. Don't use any Avalonia, third-party APIs or any