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

Support for ppcomp, LS.dat & BetterAEP #3363

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

florianessl
Copy link
Member

@florianessl florianessl commented Mar 5, 2025

Support for the "Compact" version of Cherry's PowerPatch features. This version wasn't really a patch but just an external utility program named "ppcomp.exe" (sometimes renamed to ppcomp.dat or ppcomp.dll) which provided access to some new functions by accessing the memory of the running game process.

Detecting the original PowerPatch to give info about compatibility

This is not the full version of the original "Power Patch", which goes way deeper (including early Lua support) & barely found use in any games. But I also added a small heuristich check to detect the "Full" version & log a warning about limited compatibility:

  • This just check for the existence of a file named "powerp.oex" in the game's root

Supported PPCOMP functions

  • Quitting & Resetting the game ("QUIT", "RESTART")
  • Calling of in-game scenes ("DEBUG", "CALLLOADMENU", "CALLSAVEMENU")
  • Enabling / Disabling the "UnlockPictures" patch ("UNLOCKPICTURES")
  • Loading / Saving / Checking existence of Save for custom menuing ("SAVE", "LOAD", "CHECKSAVE")
  • GetSaveDateTime / GetSystemDateTime

Not implemented at the moment

  • "CALLGAMEMENU", "CALLTITLESCREEN" do not set the cursor index at the moment
  • Copying & deleting save files ("COPYSAVE", "DELETESAVE")
  • SetGlobalBrightness (Apparently this was only implemented to address a blackscreen issue caused by the original patch)
  • ChangeScene (Sounds a bit too dangerous)
  • SimulateKeyPress
  • ChangeFunctionKey
  • SetMsgBoxColor
  • PauseGame
  • PauseTimer
  • SetVar

For those, I only found instances of "DELETESAVE" & "SIMULATEKEYPRESS" actually being used in some archived games.

-> These are still TODO

Adjustments to Ineluki KeyPatch implementation

  • I refactored handling for script execution, so that the encountered script.wav files aren't solely handled in the audio mechanism inside Game_System, but will be handled inside the interpreter, when a PlaySE command comes across them there. This is, so that it is possible to get some context for the result of executed scripts & to properly set the field "_async_op" in some cases.
  • Async requests: While a script file isn't yet available, the PlaySE command will result in a "YieldRepeat" async op.
  • Added support for script.wav execution for the "PlayBGM" command. This is rarely seen in games, but is still possible & would have resulted in a warning by the Player when it tried to parse a script INI as Music.
  • I also added support for the known program "LS.dat" which was another way many games with custom title screens used to call the Load Scene.

BetterAEP patch support

While testing this implementation, it quickly became obvious, that many games that were using ppcomp, also relied on BetterAEP, and some used this patches' special functionality to access the Load Scene or even exiting the game via command. (Even though ppcomp also had these options).

So I added support for this patch as well:
Player.exe --patch-better-aep 3350 So far I've only seen games that use the default var-id of '3350' for this.
-> Issue #1182

Some games using ppcomp

Info

… one call in FileFinder; Moved constant for save file count to "Player::Constants::MaxSaveFiles" (Many instances did not check the overridden count)
… Maniac commands into "Game_Interpreter_Shared" (Many other patches implemented something similar before MP)
…mulation support for some external programs can be properly handled.
…euristic check for the "full" version of PowerPatch (unsupported)
…avior. (Could maybe also be used for improving compatibility the Maniac Load command)
…ript handling (Re-enabling it by default, for easier testing)
@github-actions github-actions bot added Window/Scenes FileFinder Building Settings All about customizable features, storing and applying them Input Input related (gamepads, keyboard mappings, mouse support). For KeyInputProc, add event/interpreter labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Building FileFinder Input Input related (gamepads, keyboard mappings, mouse support). For KeyInputProc, add event/interpreter Settings All about customizable features, storing and applying them Window/Scenes
Development

Successfully merging this pull request may close these issues.

1 participant