Skip to content

SteveHeist/maxpayne-grphmfc-jpg-patcher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

If you've somehow stumbled across this version in some half-baked attempt at getting your game to work, this is intentionally kinda borked to try and get it functioning with Max Payne through Proton on Linux. If you think you can do that, feel free to add a pull request.

Otherwise, just go here: https://github.com/luigoalma/maxpayne-grphmfc-jpg-patcher


Max Payne's grphmfc jpg patcher

This is mainly a "silencer" and a passthrough for the AMD Ryzen 3rd gen people.
Game has been crashing at jpg loads.

The game is getting jpg data passed to the jpg loader function corrupted time to time.
Unknown why exactly, but while so, this patch adds a jumper to a new dll with loader code.
This new code will suppress the error, only if it manages to get header decompressed.
If header comes corrupted too, nothing will be done, unless we fake width and height as well.
But only data seems to cause issue, headers seem fine.
Corruption happens before it gets to the loader.
So in the event of a bad jpg with an okay header, will get instead replaced with white image data.
This means some missing textures, but the game SHOULD run.
If a header gets corrupted, then we run to an issue.

Don't know to what extent the jpgs are failing within the game on these CPUs, and only had one friend to shortly test it out.

This is not very polished on the applying scripts, and not really intended to be, just good to apply it and make dll ready to the let game run with new code.

Maybe someone will want to use this to determine what image is supposed to be loaded, and load it some other way here.

For other people without the problem, this may come just as a possible little boost of speed.

Releases

I'll be providing releases time to time. At least if I do a significant change for it. Just check releases.

Applying

Have the game's grphmfc.dll in the in folder.
This needs NASM, Mingw-w64's gcc, Python 3, libjpeg-turbo on lib and include paths of mingw-w64, and make.
Just run make for AMD error suppressed patched version, or if just want the libjpeg-turbo itself and no error suppression, make all_noamdpatch.
If need just the dll patching and not the extra dll, run make grphmfc_patch or python3 patch.py.

License & Distribution

This code itself is under the Unlicensed (check LICENSE.txt).
At binary distribution, please comply with the 3rd party code license rules, and avoid distributing the patched grphmfc.dll, instead, include patch.py and needed libs.

3rd party code licenses

Original implementation uses libjpeg-turbo.
To comply with libjpeg-turbo license, a text file, or some other form of documentation, should be included at binary distribution, following the guidelines given on it's LICENSE.md of the distributed version of libjpeg-turbo.
In the event code is modified and use a different lib, then you'll shall follow it's guidelines instead.

About

DLL patch for Max Payne, for alternative jpg loader code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 49.6%
  • C 30.6%
  • Assembly 12.4%
  • Makefile 7.4%