Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pitfall The Mayan Adventure no music play #12

Closed
Hexaae opened this issue Feb 25, 2023 · 15 comments
Closed

Pitfall The Mayan Adventure no music play #12

Hexaae opened this issue Feb 25, 2023 · 15 comments

Comments

@Hexaae
Copy link

Hexaae commented Feb 25, 2023

Doesn't seem to work with Pitfall unfortunately.
/Music subdir contains the audio tracks (Track02.ogg... etc.) and winmm.dll + ini copied to game dir as per instructions.
Works fine using DAEMON Tools Lite and mounting my original CD image.

@ayuanx
Copy link
Owner

ayuanx commented Feb 26, 2023

Use this debug build to generate and upload a log.

[file removed]

@Hexaae
Copy link
Author

Hexaae commented Feb 26, 2023

Mmmh, no log generated in the game dir (?)
I can send you the files for testing, please send me a mail to the address in this encrypted paste.sh https://paste.sh/bJWToyiV#LsebQl-n6XbHsl1dMYs2pN5z
(I will remove it within 24h)

@ayuanx
Copy link
Owner

ayuanx commented Feb 27, 2023

If no log is generated, it means this game does not use winmm.dll to play CD music.
There are many ways to play CD-DA tracks not necessarily using winmm.dll.

@Hexaae
Copy link
Author

Hexaae commented Feb 27, 2023

There is a winmm.dll in the exe though:
image

@ayuanx
Copy link
Owner

ayuanx commented Feb 27, 2023

You have to run the game on WinXP or later.
Win98 and earlier versions do not support registered system DLL overloading from any arbitrary game folder.

@Hexaae
Copy link
Author

Hexaae commented Feb 27, 2023

Mmmh, I use these legacy fixes to make the game run under Win10+

image

Removing Win95VersionLie shim the game has no audio at all... Do you think dll are never loaded from its current path in this case?

@ayuanx
Copy link
Owner

ayuanx commented Feb 27, 2023

There won't be any log generated if the DLL is not loaded.

Anyway, the easiest way to test is changing the filename from "winmm.dll" to something else like "wincd.dll", and also change all the references of "winmm.dll" string inside the exe file accordingly.

@Hexaae
Copy link
Author

Hexaae commented Feb 27, 2023

Slick move... it worked renaming in the game exe "winmm.dll" to "wincd.dll" and renaming your winmm.dll. Here is the log, it seems to work but the game ignores Audio CD:

image

Log:

ogg-winmm music directory is C:\Users\Luca\RetroGames\Pitfall\MUSIC
ogg-winmm searching tracks...
Track 02: 00:27 @ 0 seconds
Track 03: 00:44 @ 27 seconds
Track 04: 02:26 @ 71 seconds
Track 05: 03:43 @ 217 seconds
Track 06: 01:34 @ 440 seconds
Track 07: 04:07 @ 534 seconds
Track 08: 04:32 @ 781 seconds
Track 09: 02:32 @ 1053 seconds
Track 10: 01:38 @ 1205 seconds
Track 11: 03:53 @ 1303 seconds
Track 12: 03:00 @ 1536 seconds
Track 13: 03:14 @ 1716 seconds
Track 14: 03:52 @ 1910 seconds
Track 15: 04:10 @ 2142 seconds
Track 16: 04:18 @ 2392 seconds
Track 17: 03:01 @ 2650 seconds
Track 18: 01:43 @ 2831 seconds
Track 19: 02:14 @ 2934 seconds
Track 20: 01:55 @ 3068 seconds
Track 21: 01:53 @ 3183 seconds
Track 22: 00:26 @ 3296 seconds
Track 23: 02:16 @ 3322 seconds
Track 24: 00:43 @ 3458 seconds
Emulating total of 24 CD tracks.

Maybe is just CD check (it's an original game version) fail, even though the game runs fine besides disabled CD music...
Same thing for Earthworm Jim SE, maybe would be worth investigating?

@Hexaae
Copy link
Author

Hexaae commented Feb 27, 2023

Ok, it's the missing CD... If I run PITFALL.EXE in non-admin mode it will run fine except there is no CD music (grayed out CD options as the pic above).
When I run the game in admin mode the game pops-up a requester saying the "Game must be run from CD" (???) even when using wincd.dll... Using DAEMON Tools Lite CD image and running as admin the game correctly finds and plays the CD music too (sound+music).

In brief it seems the game for some strange reason needs admin rights to identify CD and play music too, but if you don't have a CD mounted it will fail saying the "Game must be run from CD".
Running in non-admin makes the game run without CD requirements and without missing CD warning, but audio CD options will be greyed out even when using the renamed wincd.dll.

@ayuanx
Copy link
Owner

ayuanx commented Feb 27, 2023

Never use "right click context menu" to directly run as admin, always use the checkbox in "right click -> properties -> compatibility" dialog.

For detailed explanation of why, see https://ayuanx.wordpress.com/2022/01/26/windows-run-as-administrator-working-directory-bug/

@Hexaae
Copy link
Author

Hexaae commented Feb 27, 2023

I set the MS-ACT shim AdditiveRunAsHighest usually (same mechanic?), but thanks for the heads up about C:\Windows\System32\ path I didn't know.
https://techcommunity.microsoft.com/t5/windows-blog-archive/understanding-the-additiverunashighest-flag-on-windows-7/ba-p/228642

@YELLO-belly
Copy link

YELLO-belly commented Feb 27, 2023

I think Pitfall The Mayan Adventure is one of those games that check the length of the cdaudio tracks and if they do not precisely match then the music will not play. The ogg-winmm emulation will only get you the length of the ogg tracks in seconds (if I am not mistaken). It can not achieve the precision of TMSF (track, minutes, seconds, frames) that is possible with a real CD. Not to mention issues where a ripped music track might not match the original track length due to the ripping / conversion method used, etc...

Assuming you are running the game from the original CD (A cd image file might also have inaccurate track lengths) you could have better luck with Dxwnd and its ability to fake the track lengths or to play the disc using IOCTL instead of the MCI API. As I do not have this game I was not able to test it so there are no guarantees but you could also try it with the updated cdaudio-winmm project to see if it can handle it.

@Hexaae
Copy link
Author

Hexaae commented Feb 28, 2023

@YELLO-belly
@ayuanx
Thank you! With your help I was finally able to find a way to play Pitfall the Mayan Adventure and Earthworm Jim SE with audio tracks correctly pausing/stopping and... auto-restarting current track when finished! 🏆

How to, mixing all the hints (including my shims):

  • using cdaudio-winmm as suggested by YELLO-belly, renamed as wincd.dll and hex-edited the single occurrence inside the game exe of winmm.dll -> wincd.dll as suggested by ayuanx
  • mixed-mode* full CD game image mounted with DAEMON Tools Lite
  • running first "Pitfall\mcicda\cdaudioplr.exe" as admin
  • running the game with AdditiveRunAsHighest MS-ACT shim to enable CD detection

My own shims (MS-ACT available from https://learn.microsoft.com/it-it/windows-hardware/get-started/adk-install#adkwin10, install just the first component "Application Compatibility Tools" 8.2MB):
image
IgnoreMessageBox (Parameters:Commandline: *,Pitfall)

I'm probably the first person to finally enjoy these two old Win95-98 CD games as they should on modern Windows 10/11 😊
Hope the instructions above will help other nostalgic players too!

* mixed-mode: data track01 + audio track02...

@ayuanx ayuanx closed this as completed Feb 28, 2023
@Hexaae
Copy link
Author

Hexaae commented Mar 6, 2023

I think Pitfall The Mayan Adventure is one of those games that check the length of the cdaudio tracks and if they do not precisely match then the music will not play. The ogg-winmm emulation will only get you the length of the ogg tracks in seconds (if I am not mistaken). It can not achieve the precision of TMSF (track, minutes, seconds, frames) that is possible with a real CD. Not to mention issues where a ripped music track might not match the original track length due to the ripping / conversion method used, etc...

Assuming you are running the game from the original CD (A cd image file might also have inaccurate track lengths) you could have better luck with Dxwnd and its ability to fake the track lengths or to play the disc using IOCTL instead of the MCI API. As I do not have this game I was not able to test it so there are no guarantees but you could also try it with the updated cdaudio-winmm project to see if it can handle it.

@YELLO-belly
May I ask you a feature to solve a problem with cdaudio-winmm (sorry but I see no "Issues" button on the GitHub project to contact you):
cdaudioplr.exe sometimes takes too long to launch indirectly (as the game will load and use the new dll).
Can you add a sort of user-defined delay (1-2 secs) after the dll gets loaded, to let it start cdaudioplr.exe before the game goes on searching for the inserted audio CD?

@YELLO-belly
Copy link

Sorry about that. "Issues" are now enabled for cdaudio-winmm fork. Please re-post your question there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants