gregdivis / Aeon

C# x86/DOS emulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error of EMS corrupt (using QBX compiler)

elGuille-info opened this issue · comments

Hi,

I get the EMS corrupt error when running QBX.EXE in the emulator.

See the capture:

image

I set manually the environment variables (I don't know how to set using the configuration file or using the actual AeonConfiguration class)
And load the application using an own configuration.

I add this property to the AeonConfiguration class:

[JsonPropertyName("environment-vars")]
public Dictionary<string, string> EnvironmentVars { get; set; } = new();

Then set on the ApplyConfiguration method:

foreach (var key in config.EnvironmentVars)
{
    if (!this.emulatorDisplay.EmulatorHost.VirtualMachine.EnvironmentVariables.ContainsKey(key.Key.ToUpper()))
    {
        this.emulatorDisplay.EmulatorHost.VirtualMachine.EnvironmentVariables.Add(key.Key.ToUpper(), key.Value);
    }
}

The code to use the QBX configuration on a new MenuItem I added to the MainMenu:

public static AeonConfiguration QBXConfig(
    string title = null,
    string pathRealDiscoE = null,
    string launchTarget = null, string argumentos = null)
{
    // El path real para montar el disco E.
    if (pathRealDiscoE == null)
        pathRealDiscoE = @"E:\discoM";

    string hostPath = pathRealDiscoE;

    if (launchTarget == null)
        launchTarget = @"E:\QBX\BIN\QBX.EXE";

    // /CMD/D\TMP\ es para usar con QBX.
    if (argumentos == null)
        argumentos = @"/H /CMD/D\TMP\";

    if (title == null)
        title = "QBX (compilador para MS-DOS)";

    string startupPath = "E:\\gsCodigo\\gsdEuro\\gsd2002";

    // Para QBX, pero no funciona, da error de EMS corrupt.
    System.Collections.Generic.Dictionary<string, string> envVars = new()
    {
        { "PATH", @"E:\EXEDOS;E:\QBX\BIN;E:\QBX\BINB;E:\UTIL2;" },
        { "LIB", @"E:\QBX\LIB" },
        { "INCLUDE", @"E:\gsCodigo\BC7\BI" }
    };

    var config = new AeonConfiguration
    {
        StartupPath = startupPath,
        Launch = $"{launchTarget} {argumentos}",
        Title = title,
        PhysicalMemorySize = 64, //2047, 
        EnvironmentVars = envVars,
        Drives =
        {
            ["C"] = new AeonDriveConfiguration
            {
                Type = DriveType.Fixed,
                HostPath = hostPath
            },
            ["E"] = new AeonDriveConfiguration
            {
                Type = DriveType.Fixed,
                HostPath = pathRealDiscoE
            }
        }
    };

    return config;
}

private void QBX_Click(object sender, RoutedEventArgs e)
{
    this.currentConfig = QBXConfig();
    this.LaunchCurrentConfig();

}

I'll try using the configuration file, but I hope this helps.

Thank you.
Guillermo

In the configuration file you can use the environment-vars that way:

  "environment-vars": {
    "path": "E:\\EXEDOS",
    "tmp": "\\TMP\\"
  }

I made some changes to EMS emulation recently, it's possible I broke something. Do you know if it used to work in an older version?

No, I use the version you have when I did the comment.