OpenGL patches

This commit is contained in:
nastys
2019-10-28 18:41:50 +01:00
parent 2224195ba3
commit bbef3564cc
3 changed files with 21 additions and 0 deletions
@@ -195,6 +195,10 @@ ConfigOptionBase* optionsArray[] = {
new BooleanOption(L"rumble", KEYCONFIG_SECTION, KEYCONFIG_FILE, L"XInput Rumble", L"Enables rumble during chainslides.", true, true),
new NumericOption(L"xinput_preferred", KEYCONFIG_SECTION, KEYCONFIG_FILE, L"XInput Controller Num:", L"Sets the preferred XInput controller.\nIf unavailable, the next connected controller is used.", 0, 0, 3),
new OptionMetaSpacer(8),
new BooleanOption(L"opengl_patch_a", LAUNCHER_SECTION, CONFIG_FILE, L"OpenGL Patch A", L"Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing.", L"", false),
new BooleanOption(L"opengl_patch_b", LAUNCHER_SECTION, CONFIG_FILE, L"OpenGL Patch B", L"Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing.", L"", false),
new OptionMetaSpacer(8),
new BooleanOption(L"no_gpu_dialog", LAUNCHER_SECTION, CONFIG_FILE, L"Disable GPU Warning", L"Disables the warning dialog for unsupported GPUs.", L"", false),
new StringOption(L"command_line", LAUNCHER_SECTION, CONFIG_FILE, L"Command Line:", L"Allows setting command line parameters for the game when using the launcher.\nDisabling the launcher will bypass this.", L"", false),
@@ -142,6 +142,8 @@ void ApplyPatches() {
auto nEStageManagerEncore = GetPrivateProfileIntW(L"patches", L"enhanced_stage_manager_encore", TRUE, CONFIG_FILE);
auto nUnlockPseudo = GetPrivateProfileIntW(L"patches", L"unlock_pseudo", FALSE, CONFIG_FILE);
auto nHardwareSlider = GetPrivateProfileIntW(L"patches", L"hardware_slider", FALSE, CONFIG_FILE);
auto nOGLPatchA = GetPrivateProfileIntW(L"patches", L"opengl_patch_a", FALSE, CONFIG_FILE);
auto nOGLPatchB = GetPrivateProfileIntW(L"patches", L"opengl_patch_b", FALSE, CONFIG_FILE);
// Replace the hardcoded videos with MP4s, if they exist
if (nMP4Movies)
@@ -326,6 +328,17 @@ void ApplyPatches() {
printf("[Patches] Enhanced Stage Manager enabled\n");
}
// OpenGL Patches
if (nOGLPatchA)
{
// (call cs:glGetError) -> (xor eax, eax); (nop); (nop); (nop); (nop);
InjectCode((void*)0x000000014069D21D, { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90 });
}
if (nOGLPatchB)
{
// (js loc_14069BC32) -> (nop)...
InjectCode((void*)0x000000014069BAF4, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 });
}
// Unlock PSEUDO modules (which will all default to Miku, unless we also patch them to match the first performer)
if (nUnlockPseudo)
{