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

Mario Teaches Typing 2: Video Problems #835

Closed
teconmoon opened this issue Dec 13, 2020 · 9 comments · Fixed by #838 or #1187
Closed

Mario Teaches Typing 2: Video Problems #835

teconmoon opened this issue Dec 13, 2020 · 9 comments · Fixed by #838 or #1187

Comments

@teconmoon
Copy link

teconmoon commented Dec 13, 2020

Try the latest version first.
Go here and click Environment: THIS_BUILD_IS_RECOMMENDED__VCXPROJ_BUILD=1-> Artifacts 1-> zip to download the latest version.

Tested with build 1893

Describe the bug
Firstly, Trying to launch the game appears to work at first (once you set the compatibility mode to 256 color mode) but then after the intro video, the game crashes with an error. This appears to be related to the video codec used to play certain video files. The introduction and all game scenes are played back with msvideo1, but there are many video clips of Mario talking that use msrle instead. Every once in a while, the video tries to play instead of crashing, but when this occurs, there's no background and the video is very distorted. See screenshots.

Secondly, I tried to work-around this problem by setting Talking Mario=0 in the MARIO.INI config file so that the problematic videos in question wouldn't play at all. The game didn't crash when this was set, but did just sit at a black screen with the music playing.

Expected behavior
The expected behavior is to be able to launch RUNMARIO.exe, and have all videos playback without errors and be able to proceed through the game menus.

Screenshots
Error
Glitchy Video

Environment (please complete the following information):

  • OS: Windows 10 Professional
  • Version 2004

Additional context
trace.txt

@teconmoon
Copy link
Author

Hello again, my comments about runmario.exe not working were inaccurate and have been removed from the post. That problem was caused by a broken installation, not a problem with winevdm.

@cracyc
Copy link
Contributor

cracyc commented Dec 15, 2020

The above pr fixes the problems in this bug report other than the runmario.exe installer which has elevation privilege issues. This still blows up later when it tries to write to a freed wing dib section. It crashes in xp/ntvdm at the same place.

@teconmoon
Copy link
Author

Hey @cracyc thanks for the quick pr! Now that the videos no longer crash, any idea why the msrle videos would be playing back so much slower than the msvideo1 files? The intros and cutscenes play normally with no issue, but the talking mario head videos slow down a ton for some reason. I recorded a quick video of this below:

https://youtu.be/RiQQTUM4Skk

@cracyc
Copy link
Contributor

cracyc commented Dec 16, 2020

For the mario head video the game does it's own drawing which results in 2 cross thread sendmessage calls. The latency is very bad causing ~10 frames to be skipped. In ntvdm the decoding is done by the old windows 3.1 vfw libraries which are not multithreaded while winevdm uses the win32 ones.

@cracyc
Copy link
Contributor

cracyc commented Apr 16, 2022

I did a bit more on this and the real problem is the main thread that needs to process messages is blocked by WaitForSingleObject and so can't get the messages from the playback thread. Windows mciavi32.dll can be patched at offset 0x9900 on version 10.0.19041.1 from 2c 01 to 00 00 to suppress the wait. Unlike #755 (comment) this appears not to be a regression but happens on all versions of win32 windows.

@cracyc
Copy link
Contributor

cracyc commented Apr 17, 2022

#1143 works around the problem.

@teconmoon
Copy link
Author

teconmoon commented Aug 5, 2022

Hey @cracyc , sorry I only just got back around to revisiting this. I'm up to build 2324 and the issue still appears the same. I tried to go back and download the 2291 build from when this was originally merged to see if it was a regression, but looks like that old build is gone. (And mci16.c hasn't changed since this commit)

I'll try and patch mciavi32.dll in the meantime. What's the best way to determine the proper offset to patch? I might try and find an old 19041 DLL as a comparison, I'm up to 10.0.22000.653. I determined the correct offset for 10.0.22000.653 to be 9BD0.

@cracyc
Copy link
Contributor

cracyc commented Aug 20, 2022

#1187 has a revised fix for this.

@teconmoon teconmoon changed the title Mario Teaches Typing 2: EXE Launch issues and Video Problems Mario Teaches Typing 2: Video Problems Aug 20, 2022
@teconmoon
Copy link
Author

Nice, thanks! Your fixes combined with a proper installation now make this game actually playable! This issue can now be actually closed-closed.

To the miniscule population on the internet that would actually want to play this game, you can now use the latest master of otvdm to install and play this game out-of-the-box with only minor issues remaining. Now that I understand the installer and the pre-requisites needed for RUNMARIO.EXE to actually work I may try and craft some sort of alternate installer for it.

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