mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-25 14:52:30 +01:00
Crash when entering advanced display options on a dual monitor machine - 1.0
This commit is contained in:
parent
0f91f1d3e0
commit
ac349ec844
@ -808,6 +808,20 @@ void MSAAText( char* buffer, const char*, DWORD level )
|
|||||||
sprintf( buffer, "%ux", 1 << level );
|
sprintf( buffer, "%ux", 1 << level );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static RwInt32 numSavedVideoModes;
|
||||||
|
static RwInt32 (*orgGetNumVideoModes)();
|
||||||
|
RwInt32 GetNumVideoModes_Store()
|
||||||
|
{
|
||||||
|
return numSavedVideoModes = orgGetNumVideoModes();
|
||||||
|
}
|
||||||
|
|
||||||
|
RwInt32 GetNumVideoModes_Retrieve()
|
||||||
|
{
|
||||||
|
return numSavedVideoModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void* (*orgMemMgrMalloc)(RwUInt32, RwUInt32);
|
static void* (*orgMemMgrMalloc)(RwUInt32, RwUInt32);
|
||||||
void* CollisionData_MallocAndInit( RwUInt32 size, RwUInt32 hint )
|
void* CollisionData_MallocAndInit( RwUInt32 size, RwUInt32 hint )
|
||||||
{
|
{
|
||||||
@ -2869,6 +2883,16 @@ void Patch_SA_10()
|
|||||||
InjectHook(0x40F81D, CollisionData_NewAndInit);
|
InjectHook(0x40F81D, CollisionData_NewAndInit);
|
||||||
|
|
||||||
|
|
||||||
|
// Crash when entering advanced display options on a dual monitor machine after:
|
||||||
|
// - starting game on primary monitor in maximum resolution, exiting,
|
||||||
|
// starting again in maximum resolution on secondary monitor.
|
||||||
|
// Secondary monitor maximum resolution had to be greater than maximum resolution of primary monitor.
|
||||||
|
int pGetNumVideoModes = 0x745B1E;
|
||||||
|
orgGetNumVideoModes = (RwInt32(*)())(*(int*)(pGetNumVideoModes+1) + pGetNumVideoModes + 5);
|
||||||
|
InjectHook(0x745B1E, GetNumVideoModes_Store);
|
||||||
|
InjectHook(0x745A81, GetNumVideoModes_Retrieve);
|
||||||
|
|
||||||
|
|
||||||
// Fixed police scanner names
|
// Fixed police scanner names
|
||||||
char* pScannerNames = *(char**)0x4E72D4;
|
char* pScannerNames = *(char**)0x4E72D4;
|
||||||
strcpy(pScannerNames + (8*113), "WESTP");
|
strcpy(pScannerNames + (8*113), "WESTP");
|
||||||
|
Loading…
Reference in New Issue
Block a user