1
0
mirror of synced 2024-11-14 06:37:36 +01:00

complete merge

This commit is contained in:
Bobby Dilley 2023-12-13 14:13:52 +00:00
parent cba7e535aa
commit 711e27f489
2 changed files with 57 additions and 171 deletions

View File

@ -29,10 +29,7 @@
#include "securityboard.h"
#include "patch.h"
#include "pcidata.h"
<<<<<<< HEAD
#include "input.h"
=======
>>>>>>> More-patching
#define HOOK_FILE_NAME "/dev/zero"

View File

@ -237,16 +237,9 @@ int initPatch()
detourFunction(0x084d5b40, amDongleInit);
detourFunction(0x084d45f9, amDongleIsAvailable);
detourFunction(0x084d4fef, amDongleUpdate);
<<<<<<< HEAD
detourFunction(0x084d44fc, stub0);
detourFunction(0x084d4485, amDipswGetData);
detourFunction(0x084d9118, amLibInit);
detourFunction(0x084d438c, amDipswInit);
=======
// Fixes
detourFunction(0x084d44fc, stubRetZero); // Stub amDipswSetLed
detourFunction(0x084d4485, amDipswGetData);
>>>>>>> More-patching
}
break;
case AFTER_BURNER_CLIMAX_REVA:
@ -264,11 +257,7 @@ int initPatch()
setVariable(0x0a0a3a74, 2); // amOsinfoDebugLevel
setVariable(0x0a0a3a78, 2); // amSysDataDebugLevel
setVariable(0x0a0a3a80, 2); // bcLibDebugLevel
<<<<<<< HEAD
=======
// Security
>>>>>>> More-patching
detourFunction(0x081e4980, amDongleInit);
detourFunction(0x081e4cce, amDongleIsAvailable);
detourFunction(0x081e4bfa, amDongleUpdate);
@ -294,13 +283,6 @@ int initPatch()
setVariable(0x0a0a0fb4, 2); // amOsinfoDebugLevel
setVariable(0x0a0a0fb8, 2); // amSysDataDebugLevel
setVariable(0x0a0a0fc0, 2); // bcLibDebugLevel
<<<<<<< HEAD
detourFunction(0x081e3424, amDongleInit);
detourFunction(0x081e3772, amDongleIsAvailable);
detourFunction(0x081e369e, amDongleUpdate);
setVariable(0x081e7945, 0x00000001); // Test
=======
// Security
detourFunction(0x081e3424, amDongleInit);
detourFunction(0x081e3772, amDongleIsAvailable);
@ -308,7 +290,6 @@ int initPatch()
// Fixes
detourFunction(0x081e335a, amDipswGetData);
detourFunction(0x081e33d2, stubRetZero); // Stub amDipswSetLed
>>>>>>> More-patching
}
break;
case OUTRUN_2_SP_SDX_REVA:
@ -326,11 +307,7 @@ int initPatch()
setVariable(0x0893a4d4, 2); // amOsinfoDebugLevel
setVariable(0x0893a4d8, 2); // amSysDataDebugLevel
setVariable(0x0893a4e0, 2); // bcLibDebugLevel
<<<<<<< HEAD
=======
// Security
>>>>>>> More-patching
detourFunction(0x08190e80, amDongleInit);
detourFunction(0x08191201, amDongleIsAvailable);
detourFunction(0x08191125, amDongleUpdate);
@ -357,19 +334,7 @@ int initPatch()
setVariable(0x0a737f1c, 2); // amSysDataDebugLevel
setVariable(0x0a737f20, 2); // bcLibDebugLevel
setVariable(0x0a737f24, 0x0FFFFFFF); // s_logMask
<<<<<<< HEAD
detourFunction(0x08320178, amDongleInit);
detourFunction(0x08320459, amDongleIsAvailable);
detourFunction(0x083203c0, amDongleUpdate);
if (config->amdFix)
{
setVariable(0x0837d6aa, cpu_vendor.ebx);
setVariable(0x0837d6ba, cpu_vendor.edx);
setVariable(0x0837d6c5, cpu_vendor.ecx);
}
=======
// Security
detourFunction(0x08320178, amDongleInit);
detourFunction(0x08320459, amDongleIsAvailable);
@ -378,25 +343,30 @@ int initPatch()
detourFunction(0x0831ddd7, amDipswGetData);
detourFunction(0x0831de4f, stubRetZero); // Stub amDipswSetLed
// CPU patch to support AMD processors
setVariable(0x0837d6aa, cpu_vendor.ebx);
setVariable(0x0837d6ba, cpu_vendor.edx);
setVariable(0x0837d6c5, cpu_vendor.ecx);
>>>>>>> More-patching
if (config->amdFix)
{
setVariable(0x0837d6aa, cpu_vendor.ebx);
setVariable(0x0837d6ba, cpu_vendor.edx);
setVariable(0x0837d6c5, cpu_vendor.ecx);
}
}
break;
case THE_HOUSE_OF_THE_DEAD_4_STRIPPED:
{
//// Security
// Security
detourFunction(0x0831ad04, amDongleInit);
detourFunction(0x0831b017, amDongleIsAvailable);
detourFunction(0x0831af7e, amDongleUpdate);
//// Fixes
// Fixes
detourFunction(0x0831875f, amDipswGetData);
detourFunction(0x083187d7, stubRetZero); // Stub amDipswSetLed
//// CPU patch to support AMD processors
setVariable(0x0837963a, cpu_vendor.ebx);
setVariable(0x0837964a, cpu_vendor.edx);
setVariable(0x08379655, cpu_vendor.ecx);
// CPU patch to support AMD processors
if (config->amdFix)
{
setVariable(0x0837963a, cpu_vendor.ebx);
setVariable(0x0837964a, cpu_vendor.edx);
setVariable(0x08379655, cpu_vendor.ecx);
}
}
break;
case THE_HOUSE_OF_THE_DEAD_4_TEST:
@ -404,8 +374,10 @@ int initPatch()
detourFunction(0x080677a0, amDongleInit);
detourFunction(0x08067a81, amDongleIsAvailable);
detourFunction(0x080679e8, amDongleUpdate);
<<<<<<< HEAD
// Fixes
detourFunction(0x08067653, amDipswGetData);
detourFunction(0x080676cb, stubRetZero); // Stub amDipswSetLed
// CPU patch to support AMD processors
if (config->amdFix)
{
setVariable(0x0807217a, cpu_vendor.ebx);
@ -414,18 +386,7 @@ int initPatch()
}
}
break;
case VIRTUA_FIGHTER_5_REVC:
=======
// Fixes
detourFunction(0x08067653, amDipswGetData);
detourFunction(0x080676cb, stubRetZero); // Stub amDipswSetLed
// CPU patch to support AMD processors
setVariable(0x0807217a, cpu_vendor.ebx);
setVariable(0x0807218a, cpu_vendor.edx);
setVariable(0x08072195, cpu_vendor.ecx);
}
break;
case THE_HOUSE_OF_THE_DEAD_SP:
case THE_HOUSE_OF_THE_DEAD_4_SPECIAL:
{
detourFunction(0x08363438, amDongleInit);
detourFunction(0x0836374b, amDongleIsAvailable);
@ -434,12 +395,15 @@ int initPatch()
detourFunction(0x08360e93, amDipswGetData);
detourFunction(0x08360f0b, stubRetZero); // Stub amDipswSetLed
// CPU patch to support AMD processors
setVariable(0x083cef0a, cpu_vendor.ebx);
setVariable(0x083cef1a, cpu_vendor.edx);
setVariable(0x083cef25, cpu_vendor.ecx);
if (config->amdFix)
{
setVariable(0x083cef0a, cpu_vendor.ebx);
setVariable(0x083cef1a, cpu_vendor.edx);
setVariable(0x083cef25, cpu_vendor.ecx);
}
}
break;
case THE_HOUSE_OF_THE_DEAD_SP_TEST:
case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_TEST:
{
detourFunction(0x0806e914, amDongleInit);
detourFunction(0x0806ec27, amDongleIsAvailable);
@ -448,9 +412,12 @@ int initPatch()
detourFunction(0x0806e7c7, amDipswGetData);
detourFunction(0x0806e83f, stubRetZero); // Stub amDipswSetLed
// CPU patch to support AMD processors
setVariable(0x0807a3ba, cpu_vendor.ebx);
setVariable(0x0807a3ca, cpu_vendor.edx);
setVariable(0x0807a3d5, cpu_vendor.ecx);
if (config->amdFix)
{
setVariable(0x0807a3ba, cpu_vendor.ebx);
setVariable(0x0807a3ca, cpu_vendor.edx);
setVariable(0x0807a3d5, cpu_vendor.ecx);
}
}
break;
case THE_HOUSE_OF_THE_DEAD_EX:
@ -462,9 +429,12 @@ int initPatch()
detourFunction(0x084b6a69, amDipswGetData);
detourFunction(0x084b6adf, stubRetZero); // Stub amDipswSetLed
// CPU patch to support AMD processors
setVariable(0x0849E2AD, cpu_vendor.ebx);
setVariable(0x0849E2B7, cpu_vendor.edx);
setVariable(0x0849E2C1, cpu_vendor.ecx);
if (config->amdFix)
{
setVariable(0x0849E2AD, cpu_vendor.ebx);
setVariable(0x0849E2B7, cpu_vendor.edx);
setVariable(0x0849E2C1, cpu_vendor.ecx);
}
}
break;
case THE_HOUSE_OF_THE_DEAD_EX_TEST:
@ -476,26 +446,20 @@ int initPatch()
detourFunction(0x080772dd, amDipswGetData);
detourFunction(0x08077353, stubRetZero); // Stub amDipswSetLed
// CPU patch to support AMD processors
setVariable(0x080847BD, cpu_vendor.ebx);
setVariable(0x080847C7, cpu_vendor.edx);
setVariable(0x080847D1, cpu_vendor.ecx);
if (config->amdFix)
{
setVariable(0x080847BD, cpu_vendor.ebx);
setVariable(0x080847C7, cpu_vendor.edx);
setVariable(0x080847D1, cpu_vendor.ecx);
}
}
break;
case VF5_REVC:
>>>>>>> More-patching
case VIRTUA_FIGHTER_5_REVC:
{
// Security
detourFunction(0x085c6010, amDongleInit);
detourFunction(0x085c63cc, amDongleIsAvailable);
detourFunction(0x085c62f0, amDongleUpdate);
<<<<<<< HEAD
detourFunction(0x080b3426, stub0); // Stub returns 0
detourFunction(0x080cb6d4, stub0); // Stub returns 0
detourFunction(0x0840889e, stub0); // Stub returns 0
detourFunction(0x0840ab90, stub0); // Stub returns 0
setVariable(0x080e17af, 0x000000b8); // Patch IDK what
setVariable(0x080e17b3, 0x01e88300); // Patch IDK what
=======
// Fixes and patches to bypss network check
detourFunction(0x085c5f46, amDipswGetData);
detourFunction(0x085c5fbe, stubRetZero); // Stub amDipswSetLed
@ -505,7 +469,6 @@ int initPatch()
detourFunction(0x0840ab90, stubRetZero); // Stub returns 0
setVariable(0x080e17af, 0x000000b8); // Patch IDK what
setVariable(0x080e17b3, 0x01e88300); // Patch IDK what
>>>>>>> More-patching
}
break;
@ -525,33 +488,6 @@ int initPatch()
setVariable(0x08c08634, 2); // amOsinfoDebugLevel
setVariable(0x08c08644, 0x0FFFFFFF); // s_logMask
detourFunction(0x08074a8c, _putConsole); // Debug Messages
<<<<<<< HEAD
detourFunction(0x084e50d8, amDongleInit);
detourFunction(0x084e5459, amDongleIsAvailable);
detourFunction(0x084e537d, amDongleUpdate);
detourFunction(0x084e500e, amDipswGetData);
setVariable(0x080d1f02, 0x90909090); // Patch acpSystem::checkDongle
setVariable(0x080d1f06, 0xE8C3C990); // Patch acpSystem::checkDongle
setVariable(0x0807b76a, 0xc2839090); // Patch initializeArcadeBackup
// setVariable(0x082E006b, 0x00000280); // Set ResX
// setVariable(0x082E0078, 0x000001E0); // Set ResY
detourFunction(0x084e4efc, stub0); // Stub amDipswInit
detourFunction(0x084e500e, stub0); // Stub amDipswGetData
detourFunction(0x084e5086, stub0); // Stub amDipswSetLed
detourFunction(0x084e4f98, stub0); // Stub amDipswExit
setVariable(0x0840d858, 0x1c899090); // No more Full Screen from the Game
if (config->amdFix)
{
setVariable(0x083ef701, 0x00036ee9); // AMDFIX
setVariable(0x084032e0, 0x8b90c933); // fix shader compilation with AMD GPUs
setVariable(0x08523950, 0x000000c3); // Remove ADXM_SetupFramework (Not necessary)
}
=======
// Security
detourFunction(0x084e50d8, amDongleInit);
detourFunction(0x084e5459, amDongleIsAvailable);
@ -571,7 +507,6 @@ int initPatch()
// setVariable(0x083ef701, 0x00036ee9); // AMDFIX
// setVariable(0x084032e0, 0x8b90c933); // fix shader compilation with AMD GPUs
// setVariable(0x08523950, 0x000000c3); // Remove ADXM_SetupFramework (Not necessary)
>>>>>>> More-patching
}
break;
@ -595,12 +530,6 @@ int initPatch()
detourFunction(0x08510320, amDongleInit);
detourFunction(0x085106dc, amDongleIsAvailable);
detourFunction(0x08510600, amDongleUpdate);
<<<<<<< HEAD
detourFunction(0x08075012, _putConsole);
// setVariable(0x08303C4B, 0x00000780); // Set ResX
// setVariable(0x08303C58, 0x00000438); // Set ResY
=======
>>>>>>> More-patching
setVariable(0x080dad63, 0x90909090); // Patch acpSystem::checkDongle
setVariable(0x080dad67, 0xE8C3C990); // Patch acpSystem::checkDongle
setVariable(0x0807e609, 0xc2839090); // Patch initializeArcadeBackup
@ -631,22 +560,6 @@ int initPatch()
setVariable(0x08d719e0, 2); // bcLibDebugLevel
setVariable(0x08d719d4, 2); // amOsinfoDebugLevel
setVariable(0x08d719e4, 0x0FFFFFFF); // s_logMask
<<<<<<< HEAD
detourFunction(0x086e2336, amDongleInit);
detourFunction(0x086e0d81, amDongleIsAvailable);
detourFunction(0x086e17e5, amDongleUpdate);
detourFunction(0x086e0c0d, amDipswGetData);
detourFunction(0x086e0c84, stub0);
detourFunction(0x0808f9a8, _putConsole);
setVariable(0x080dad63, 0x90909090); // Patch acpSystem::checkDongle
setVariable(0x080dad67, 0xE8C3C990); // Patch acpSystem::checkDongle
setVariable(0x0807e609, 0x90909090); // Patch initializeArcadeBackup
setVariable(0x0807e60D, 0xC2839090); // Patch initializeArcadeBackup
}
break;
=======
// detourFunction(0x0808f9a8, _putConsole); // Crashes the game sometimes.
// Security
detourFunction(0x086e2336, amDongleInit);
@ -680,17 +593,16 @@ int initPatch()
setVariable(0x08248a2a, 0x00000438); // Set ResY
*/
// Hooked in graphics.c
//setVariable(0x085599f2, 0x0001d2e9); // Force not supported resolutions
//setVariable(0x085599f6, 0x01bb0000); // Force not supported resolutions
// setVariable(0x085599f2, 0x0001d2e9); // Force not supported resolutions
// setVariable(0x085599f6, 0x01bb0000); // Force not supported resolutions
// IDK if the following work (taken from TP)
// setVariable(0x08548ef3, 0x8990c031); // Shader Compiler
// setVariable(0x08799d8c, 0x082c9f52); // childTerminationHanlder
}
break;
case ID4_E:
case INITIALD_4_REVE:
{
// Debug
// detourFunction(0x08090478, _putConsole); // Crashes the game sometimes.
@ -714,40 +626,15 @@ int initPatch()
// setVariable(0x085700d3, 0x8990c031); // Fix something with the Shaders??
}
break;
>>>>>>> More-patching
case SEGABOOT_2_4_SYM:
{
detourFunction(0x0805e8b0, amDongleInit);
detourFunction(0x0805ebc3, amDongleIsAvailable);
detourFunction(0x0805eb2a, amDongleUpdate);
<<<<<<< HEAD
// detourFunction(0x08062cf8, amLibInit);
// detourFunction(0x0805c200, amDipswInit);
detourFunction(0x0805c30b, amDipswGetData);
}
break;
case VIRTUA_TENNIS_3:
{
detourFunction(0x0831c724, amDongleInit);
detourFunction(0x0831ca37, amDongleIsAvailable);
detourFunction(0x0831c99e, amDongleUpdate);
detourFunction(0x0831c5d7, amDipswGetData);
detourFunction(0x0831c64f, stub0);
setVariable(0x0827ae1b, 0x34891beb); // Disable Fullscreen
}
case VIRTUA_TENNIS_3_TEST:
{
detourFunction(0x0815f610, amDongleInit);
detourFunction(0x0815f923, amDongleIsAvailable);
detourFunction(0x0815f88a, amDongleUpdate);
detourFunction(0x0815d06b, amDipswGetData);
detourFunction(0x0815d0e3, stub0);
// setVariable(0x0827ae1b, 0x34891beb); //Disable Fullscreen
=======
detourFunction(0x0805c30b, amDipswGetData);
}
break;
case VT3:
{
// Security
detourFunction(0x0831c724, amDongleInit);
@ -759,7 +646,7 @@ int initPatch()
setVariable(0x0827ae1b, 0x34891beb); // Disable Fullscreen set from the game
}
break;
case VT3_TESTMODE:
case VIRTUA_TENNIS_3_TEST:
{
// Security
detourFunction(0x0815f610, amDongleInit);
@ -787,14 +674,16 @@ int initPatch()
detourFunction(0x0831cf02, amDongleInit);
detourFunction(0x0831b94d, amDongleIsAvailable);
detourFunction(0x0831c3b1, amDongleUpdate);
// Fixes
// Fixes
detourFunction(0x0831907d, amDipswGetData);
detourFunction(0x083190f4, stubRetZero);
// CPU patch to support AMD processors
setVariable(0x08399ADA, cpu_vendor.ebx);
setVariable(0x08399AEA, cpu_vendor.edx);
setVariable(0x08399AF5, cpu_vendor.ecx);
>>>>>>> More-patching
if (config->amdFix)
{
setVariable(0x08399ADA, cpu_vendor.ebx);
setVariable(0x08399AEA, cpu_vendor.edx);
setVariable(0x08399AF5, cpu_vendor.ecx);
}
}
break;
default: