Add AllowMultiInstance.

This commit is contained in:
Ray Koopa 2020-07-20 20:17:20 +02:00
parent 2b94e09e39
commit 518207b7e6

View File

@ -7,6 +7,7 @@
// ---- Configuration ---- // ---- Configuration ----
BOOL cfgAllowMultiInstance;
BOOL cfgEnableAllControls; BOOL cfgEnableAllControls;
BOOL cfgUnlockCamera; BOOL cfgUnlockCamera;
BOOL cfgUnlockCursor; BOOL cfgUnlockCursor;
@ -16,11 +17,13 @@ void configure()
wk::Config config("wkUnlimiter.ini"); wk::Config config("wkUnlimiter.ini");
// Load INI settings. // Load INI settings.
config.get("Common", "AllowMultiInstance", cfgAllowMultiInstance, TRUE);
config.get("Frontend", "EnableAllControls", cfgEnableAllControls, TRUE); config.get("Frontend", "EnableAllControls", cfgEnableAllControls, TRUE);
config.get("Game", "UnlockCamera", cfgUnlockCamera, TRUE); config.get("Game", "UnlockCamera", cfgUnlockCamera, TRUE);
config.get("Game", "UnlockCursor", cfgUnlockCursor, TRUE); config.get("Game", "UnlockCursor", cfgUnlockCursor, TRUE);
// Ensure INI file has been created with default setting. // Ensure INI file has been created with default setting.
config.set("Common", "AllowMultiInstance", cfgAllowMultiInstance);
config.set("Frontend", "EnableAllControls", cfgEnableAllControls); config.set("Frontend", "EnableAllControls", cfgEnableAllControls);
config.set("Game", "UnlockCamera", cfgUnlockCamera); config.set("Game", "UnlockCamera", cfgUnlockCamera);
config.set("Game", "UnlockCursor", cfgUnlockCursor); config.set("Game", "UnlockCursor", cfgUnlockCursor);
@ -30,6 +33,11 @@ void configure()
void patch(wk::Exe& exe, int gameVersion) void patch(wk::Exe& exe, int gameVersion)
{ {
if (cfgAllowMultiInstance)
{
wk::Patch patch(exe.Offset(0x000E7AD1), 1);
patch.write((char)0xEB); // Requires WormKitDS as game executable loads modules after this patched out check.
}
if (cfgEnableAllControls) if (cfgEnableAllControls)
{ {
wk::Patch patch(exe.Offset(0x001C5D26), 4); wk::Patch patch(exe.Offset(0x001C5D26), 4);