Skip to content

Commit 415e193

Browse files
committed
Bug launching emulator with spaces in the .nex path
1 parent 5abe3d1 commit 415e193

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

ZXBStudio/MainWindow.axaml.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,7 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
14291429
{
14301430
// Cleaning...
14311431
{
1432+
outLog.Writer.WriteLine("Cleaning temp files...");
14321433
var file = Path.Combine(project.ProjectPath, Path.GetFileNameWithoutExtension(settings.MainFile) + ".bin");
14331434
if (File.Exists(file))
14341435
{
@@ -1454,6 +1455,7 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
14541455
try
14551456
{
14561457
var emulatorName = Path.GetFileNameWithoutExtension(emulatorPath);
1458+
var nextDrive = Path.Combine(project.ProjectPath, "nextdrive");
14571459
switch (emulatorName.ToLower())
14581460
{
14591461
case "cspect":
@@ -1462,11 +1464,13 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
14621464
Process process = new Process();
14631465
process.StartInfo.FileName = emulatorPath;
14641466
process.StartInfo.Arguments = string.Format(
1465-
"-zxnext -tv -w3 -brk -r -mmc=.\\nextdrive\\ .\\nextdrive\\{0}",
1466-
Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex");
1467+
"-zxnext -tv -w3 -brk -r -mmc=\"{0}\" \"{1}\"",
1468+
nextDrive,
1469+
Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex"));
14671470
process.StartInfo.WorkingDirectory = project.ProjectPath;
14681471
process.StartInfo.UseShellExecute = true;
14691472
process.StartInfo.CreateNoWindow = false;
1473+
outLog.Writer.WriteLine(process.StartInfo.FileName+" "+process.StartInfo.Arguments);
14701474
process.Start();
14711475
process.WaitForExit();
14721476
}
@@ -1477,12 +1481,13 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
14771481
Process process = new Process();
14781482
process.StartInfo.FileName = emulatorPath;
14791483
process.StartInfo.Arguments = string.Format(
1480-
"--noconfigfile --zoom 1 --machine TBBlue --realvideo --enabletimexvideo --tbblue-fast-boot-mode --enable-esxdos-handler --esxdos-root-dir {0} {1} --snap-no-change-machine",
1481-
Path.Combine(project.ProjectPath, "nextdrive"),
1482-
Path.Combine(project.ProjectPath, "nextdrive", Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex"));
1484+
"--noconfigfile --zoom 1 --machine TBBlue --realvideo --enabletimexvideo --tbblue-fast-boot-mode --enable-esxdos-handler --esxdos-root-dir \"{0}\" \"{1}\" --snap-no-change-machine",
1485+
nextDrive,
1486+
Path.Combine(nextDrive, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex"));
14831487
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(emulatorPath);
14841488
process.StartInfo.UseShellExecute = true;
14851489
process.StartInfo.CreateNoWindow = false;
1490+
outLog.Writer.WriteLine(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
14861491
process.Start();
14871492
process.WaitForExit();
14881493
}

0 commit comments

Comments
 (0)