First post, by superfury
I've tried to implement the Dosbox Game Blaster emulation combined with my own methods for generating basic square waves(used in my OPL2 emulation) and get UniPCemu's Game Blaster emulation running that way. But for some reason, when trying to run The Secret of Monkey Island with Game Blaster emulation(also have Adlib enabled atm) using the "g" parameter only results in the CPU getting into an infinite loop for some reason? The same happens when trying to run the demo disks from the vogons Vintage Driver library ( https://www.vogonsdrivers.com/getfile.php?fil … =16&menustate=0 ). I'm using the CMSSONG1 combined with the driver in the root of the archive.
When I try to run demo.bat, it properly detects the hardware, then hangs (just like monkey island) on some little piece of code that keeps reading empty data from memory infinitely using mov, cmp and jz commands, with two little loops nested infinitely, keeping jumping back to the start of the loop to check the same address again) afaik.
Also, for some reason, since I've switched to SDL2 it seems that keyboard input suddenly switches caps lock on and sometimes sees normal numeric input (the numbers above the 1-...-9-0 keys with modifiers like !@#$%^&*()+ on top of them. It then suddenly sees them as if shift is held, while it actually isn't? Is this simply a problem when changing from SDL1 to SDL2? If so, that problem should be in input.c ( https://bitbucket.org/superfury/unipcemu/src/ … put.c?at=master )?
Why would Monkey Island crash this way when emulating the new hardware, or simply selecting it by parameter(executing "monkey g") on the VGA+adlib+pc speaker+game blaster emulation?
My current source code of the Game Blaster, based on Dosbox's, but adjusted a little, based on my OPL2 emulation:
https://bitbucket.org/superfury/unipcemu/src/ … ter.c?at=master
Edit: Btw, yes, the interface the CPU uses to detect and write the registers is written by me, together with the core frequencytime logic. I only based the sample generation on Dosbox's code SVN's gameblaster.cpp and createn my own version based on it(since it's simple and undocumented logic).
Could this mean this only is a problem regarding the core CPU emulation of UniPCemu? Since the CPU hangs in a loop both using Monkey Island in Game Blaster mode("g" parameter only) and the demo.bat from the zip archive. The cms driver detects and loads without problems(saying it installed at interrupt 80h), so detection itself shouldn't be the problem. Does the driver or executable contain and 80286+ code? I'm running 8086 emulation atm. Since it's executing code with CS pointing to the 1000h-2000h range, this is probably either a driver(cmsdrv), the player(called by demo.bat) or monkey.exe loaded there? Anyone can tell me more?
Anyone knows why I keep having keyboard problems with SDL2? SDL1.2.15 always worked without problems till now. Suddenly things become permanently 'shifted': all number keys(not numpad) react like shift is pressed, while stuff like enter etc. completely becomes 'unresponsive'(it might respond, but incorrectly due to stuck keys or something like that?).
Edit: Some problems have been fixed:
- Various hardware was responding to input that didn't apply to them, because of invalid masks on their responding I/O lines. A primary example in this case was, that the PIC(Programmable Interrupt Controller) was responding to output to the Game Blaster, since it only looked at the low 8 bits of it's I/O port(port 0x20/21(PIC) vs port 0x220/221(Game Blaster), but the PIC seeing port accesses to 0x220 as 0x20 and 0x221 as 0x21(since their upper 8 bits are masked off). This has now been fixed, and the Game Blaster is now working better(as does the input problems caused by incorrectly messing with the Interrupt Mask Register because of the bug). Correct writes to most mapped registers can now be seen from the compiler toolkit(Visual Studio)'s debugger.
After adding some amplification of the Dosbox's Game Blaster signal(which wasn't loud enough), it now generates proper Game Blaster sound (testing using the first Demo disk of the Game Blaster/CMS of vogons) 😀
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io