Skip to content

Commit e8c50ae

Browse files
author
Juan Segura
committed
CSpect executing error
1 parent 33abf93 commit e8c50ae

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

ZXBStudio/MainWindow.axaml.cs

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,19 +1502,26 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
15021502
}
15031503
else if (emulatorName.ToLower() == "cspect")
15041504
{
1505-
outLog.Writer.WriteLine("Launching CSpect...");
1506-
Process process = new Process();
1507-
process.StartInfo.FileName = emulatorPath;
1508-
process.StartInfo.Arguments = string.Format(
1509-
"-zxnext -tv -w3 -brk -r -mmc=\"{0}\" \"{1}\"",
1510-
nextDrive,
1511-
Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex"));
1512-
process.StartInfo.WorkingDirectory = project.ProjectPath;
1513-
process.StartInfo.UseShellExecute = true;
1514-
process.StartInfo.CreateNoWindow = false;
1515-
outLog.Writer.WriteLine(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
1516-
process.Start();
1517-
process.WaitForExit();
1505+
if (!File.Exists(emulatorPath))
1506+
{
1507+
errorMsg = "Emulator not found on: " + emulatorPath;
1508+
}
1509+
else
1510+
{
1511+
outLog.Writer.WriteLine("Launching CSpect...");
1512+
Process process = new Process();
1513+
process.StartInfo.FileName = emulatorPath;
1514+
process.StartInfo.Arguments = string.Format(
1515+
"-zxnext -tv -w3 -brk -r -mmc=\"{0}\" \"{1}\"",
1516+
nextDrive,
1517+
Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex"));
1518+
process.StartInfo.WorkingDirectory = project.ProjectPath;
1519+
process.StartInfo.UseShellExecute = false;
1520+
process.StartInfo.CreateNoWindow = false;
1521+
outLog.Writer.WriteLine(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
1522+
process.Start();
1523+
process.WaitForExit();
1524+
}
15181525
}
15191526
else if (emulatorName.ToLower() == "zesarux")
15201527
{
@@ -1526,7 +1533,7 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
15261533
nextDrive,
15271534
Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex"));
15281535
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(emulatorPath);
1529-
process.StartInfo.UseShellExecute = true;
1536+
process.StartInfo.UseShellExecute = false;
15301537
process.StartInfo.CreateNoWindow = false;
15311538
outLog.Writer.WriteLine(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
15321539
process.Start();
@@ -1539,7 +1546,12 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
15391546
}
15401547
catch (Exception ex)
15411548
{
1542-
errorMsg = "Error executing emulator";
1549+
errorMsg = "Error executing emulator: " + ex.Message + ex.StackTrace;
1550+
if (ex.InnerException != null)
1551+
{
1552+
var ex2= ex.InnerException;
1553+
errorMsg += "\r\nInner Exception: " + ex.Message + ex.StackTrace;
1554+
}
15431555
}
15441556
}
15451557

@@ -1625,6 +1637,8 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
16251637
}
16261638
});
16271639
}
1640+
1641+
16281642
private async void BuildAndDebug(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
16291643
{
16301644
if (string.IsNullOrWhiteSpace(ZXOptions.Current.ZxbcPath) || string.IsNullOrWhiteSpace(ZXOptions.Current.ZxbasmPath))

ZXBStudio/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace ZXBasicStudio
88
{
99
internal class Program
1010
{
11-
public static string Version = "1.6.0 - beta 6";
12-
public static string VersionDate = "2025.10.09";
11+
public static string Version = "1.6.0 - beta 6.3";
12+
public static string VersionDate = "2025.11.16";
1313

1414

1515
// Initialization code. Don't use any Avalonia, third-party APIs or any

0 commit comments

Comments
 (0)