-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmulatorLauncher.cs
More file actions
42 lines (41 loc) · 1.72 KB
/
EmulatorLauncher.cs
File metadata and controls
42 lines (41 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using ProcessorEmulator.Tools;
namespace ProcessorEmulator.Emulation
{
public static class EmulatorLauncher
{
public static void Launch(string binaryPath, string architecture, string platform = null, bool requireHardware = false, bool gpuPassthrough = false)
{
// Use QEMU for most architectures, fallback to custom emulator if implemented
if (requireHardware || platform == "RDK-B" || platform == "RDK-V")
{
var qemu = new QemuManager();
string extraArgs = "";
if (requireHardware)
{
extraArgs += "-usb -device usb-host -net user -net nic ";
}
if (gpuPassthrough)
{
extraArgs += "-vga qxl -display sdl "; // Example: QEMU accelerated graphics
}
QemuManager.LaunchWithArgs(binaryPath, architecture, extraArgs.Trim());
}
else
{
switch (architecture)
{
case "MIPS32": new Mips32Emulator().Run(); break;
case "ARM": new ArmEmulator().Run(); break;
case "ARM64": new Arm64Emulator().Run(); break;
case "PowerPC": new PowerPcEmulator().Run(); break;
case "x86": new X86Emulator().Run(); break;
case "x86-64": new X64Emulator().Run(); break;
default:
var qemu = new QemuManager();
QemuManager.LaunchWithArgs(binaryPath, architecture, gpuPassthrough ? "-vga qxl -display sdl" : "");
break;
}
}
}
}
}