mamedev / mame

MAME
https://www.mamedev.org/
Other
8.4k stars 2.04k forks source link

isa/sblaster.cpp: Prince of Persia freezes between levels when Sound Blaster is configured #12308

Open synthic opened 7 months ago

synthic commented 7 months ago

MAME version

0.265

System information

Windows 7 64-bit

INI configuration details

No response

Emulated system/software

ct486, isa2:sblaster_16

Incorrect behaviour

At the end of any level in Prince of Persia for MS-DOS, the game freezes upon the exit door opening or closing and the sound gets stuck in a loop.

Expected behaviour

Being able to finish the level and have the sound output properly without the game crashing.

Steps to reproduce

This issue occurs on the ct486 / at486 machines when any Sound Blaster card is attached to an ISA slot and Prince of Persia 1.3 is configured to use Sound Blaster for sound effects. I am running a clean installation of MAME and booting into the ct486 core from the msdos622 disk image. I then installed the game from the ppersia35 disk in the software list and chose Sound Blaster in the setup utility before launching. At the end of the first level when opening the exit door, the game crashes entirely. Instead of having to play through the first level to reproduce this, you can launch the game using the command PRINCE IMPROVED 2 to skip straight to the second level and trigger the crash immediately. My full command line is below.

mame ct486 -ramsize 16M -hard msdos622 -isa1 svga_s3 -isa2 sblaster_16

At first I assumed this was an issue with the core and was going to report it as such, but now I believe the issue lies in the sblaster device files because after some searching I stumbled on the exact issue happening with the ao486 MiSTer core. More information is available at the following issue: MiSTer-devel/ao486_MiSTer#34

In that issue there is a pull request referenced which seems to fix the problem. This goes over my head a bit, but apparently it is due to the game and DSP being deadlocked waiting on each other. Hopefully this fix can be evaluated and added back into MAME if applicable: MiSTer-devel/ao486_MiSTer#88

Additional details

No response

angelosa commented 7 months ago

Out of comprehension, if I use the cheat command it also triggers what it seems a manual copy protection, I gather it's unrelated?

0862

synthic commented 7 months ago

That is unrelated, yes. It pops up during normal play once you pass the first level. After pressing a key, the door closes and the game freezes for me.