Spice86: "An unhandled exception occured" running a DOS game
Describe the bug
I tried to run Spice86 -e <path/to>/ROE2MAIN.EXE to run the main executable for Rules of Engagement II and it immediately shows an error - does that mean it’s not a real-mode DOS binary?
To Reproduce Steps to reproduce the behavior:
- Run
Spice86 -e <path/to>/ROE2MAIN.EXE - See error message that says:
{"TargetSite":"Void Grp5()","Message":"An error occurred while machine was in this state: Cycles=6770 CS:IP=0x1:0xEE2/0xEF2 EAX=0x7F06 EBX=0x5 ECX=0xE50 EDX=0x0 ESI=0x0 EDI=0x0 EBP=0xD9A8 ESP=0xD978 SS=0x0 DS=0xA ES=0xA FS=0x0 GS=0x0 flags=0x7016 ( AP ).\nError is: Invalid group index 0x7","StackTrace":" at Spice86.Core.Emulator.CPU.InstructionsImpl.Instructions16Or32.Grp5() in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86.Core/Emulator/CPU/InstructionsImpl/Instructions16Or32.cs:line 96\n at Spice86.Core.Emulator.CPU.Cpu.ExecOpcode(Byte opcode) in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86.Core/Emulator/CPU/CPU.cs:line 1076\n at Spice86.Core.Emulator.CPU.Cpu.ExecuteNext() in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86.Core/Emulator/CPU/CPU.cs:line 127\n at Spice86.Core.Emulator.VM.EmulationLoop.RunLoop() in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86.Core/Emulator/VM/EmulationLoop.cs:line 103\n at Spice86.Core.Emulator.VM.EmulationLoop.StartRunLoop(FunctionHandler functionHandler) in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86.Core/Emulator/VM/EmulationLoop.cs:line 92\n at Spice86.Core.Emulator.VM.EmulationLoop.Run() in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86.Core/Emulator/VM/EmulationLoop.cs:line 68\n at Spice86.Core.Emulator.ProgramExecutor.Run() in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86.Core/Emulator/ProgramExecutor.cs:line 108\n at Spice86.ViewModels.MainWindowViewModel.EmulatorThread() in /home/sardaukar/Code/FOREIGN/Spice86/src/Spice86/ViewModels/MainWindowViewModel.cs:line 387"}
Expected behavior Game should start…?
Screenshots
Desktop (please complete the following information):
- OS: EndeavourOS (Linux)
- Version: rolling releases, doesn’t have a version
Additional context Is this not supported in Linux? I can try Windows too
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 33 (23 by maintainers)
There’s a new release of the master branch on github.
For the nuget package, I intented to make a new version once Rules of Engagement 2 was fixed and once testing and documentation was done. Including testing Cryogenic with it (that’s Dune with C# overrides).
The rules of Engagement 2 branch will be closed once it is merged into master.
There’s a lot to fix in the sound and music department.
Thankfully I’ve been on it too for a long while.
After that, xms and why it doesn’t find its files are also problems to be fixed.
All of it will take probably a while. But this already benefited the emulator a lot with full dos ioctl implementation.
It uses it to get VESA information and the current video mode.
But since the standardization was late, it works if the video card does not implement it. Tested with a modified dosbox.
Fine for me.
Guess by disabling the Sound Blaster (for now) and skipping the intro I get…
A moving mouse on a black screen! Progress… ?!
MouseDriver now implements: QueryButtonReleasedCounter
https://github.com/OpenRakis/Spice86/pull/1179/commits/9aa532e617f1b6d164fa2f0d4fd2e52ee9696f63
This test was with EMS Memory enabled. But it also boots up without it.
Now I have the Sound Blaster card emulation to re-enable and fix.
There were several bugfixes in DOS INT21H that already makes wizardry 7 go further too and sucesfully load its memory overlays. Now it demands some interrupt instead of crashing the CPU.
Now there is some bug to fix in the soundblaster’s behavior in response to port reads/writes, and an unimplemented interruption in the mouse driver to implement for Rules of Engagement 2.
All those basic fixes touch several games and aspects.
Today:
Last night it crashed at:
Progress… https://github.com/OpenRakis/Spice86/pull/1179/commits/38d4f3fdfed2d937f82c4a215f77bab984157497
I think I’m nearly there. At least for the IOCTL side.
However I’ve uncovered that it’s far from over:
[…]
I ‘just’ need a proper PSP with its open files table… which is the core of DOS Process Managment.
Something that I attempted to port eariler but it was not readable/manageable in the end.
Perhaps just by implementing only what’s needed will I be able to have a IOCTL function that parses the game’s input as intended.
OK actually now the last DOS call before the crash is to GetCurrentDirectory which returns “”
Progress !
I’ll try to follow the code in
dosbox-staging, but my C is rustier than my C# 😄 - thanks for the experimental branch!This may be way over my head, but I’ll give it a shot 😃
@sardaukar
Here it is :
https://github.com/OpenRakis/Spice86/blob/master/CONTRIBUTING.md
One caveat : PR can be fine even if the github CI fails. the Windows CI fails to run sometimes for some reason.
The game doesn’t use
So it’s really a bug that it doesn’t work.
The good news is, it’s probably not a lot to fix.