mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
SA newsteam/RGL: Remove censorships
This commit is contained in:
parent
082a9e7156
commit
37957a1256
1 changed files with 47 additions and 0 deletions
|
@ -1561,6 +1561,21 @@ namespace Localization
|
||||||
// If fails, default to metric. Hopefully never fails though
|
// If fails, default to metric. Hopefully never fails though
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only used in "new binary" executables
|
||||||
|
bool* germanGame;
|
||||||
|
bool* frenchGame;
|
||||||
|
bool* nastyGame;
|
||||||
|
void SetUncensoredGame()
|
||||||
|
{
|
||||||
|
*germanGame = false;
|
||||||
|
*frenchGame = false;
|
||||||
|
*nastyGame = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyStub()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============= LS-RP Mode stuff =============
|
// ============= LS-RP Mode stuff =============
|
||||||
|
@ -5499,6 +5514,38 @@ void Patch_SA_NewBinaries_Common()
|
||||||
InjectHook( findExactWord.get<void>( -5 ), strncpy_Fix );
|
InjectHook( findExactWord.get<void>( -5 ), strncpy_Fix );
|
||||||
InjectHook( findExactWord.get<void>( 9 ), strncmp_Fix );
|
InjectHook( findExactWord.get<void>( 9 ), strncmp_Fix );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No censorships (not set nor loaded from savegame)
|
||||||
|
{
|
||||||
|
using namespace Localization;
|
||||||
|
|
||||||
|
auto loadCensorshipValues = pattern( "0F B6 8E ED 00 00 00 88 0D" ).get_one();
|
||||||
|
void* initialiseLanguage1 = get_pattern( "E8 ? ? ? ? 8B 35 ? ? ? ? FF D6" );
|
||||||
|
auto initialiseLanguage2 = pattern( "E8 ? ? ? ? 83 FB 07" ).get_one();
|
||||||
|
|
||||||
|
germanGame = *loadCensorshipValues.get<bool*>( 7 + 2 );
|
||||||
|
frenchGame = *loadCensorshipValues.get<bool*>( 0x14 + 2 );
|
||||||
|
nastyGame = *loadCensorshipValues.get<bool*>( 0x21 + 1 );
|
||||||
|
|
||||||
|
// Don't load censorship values
|
||||||
|
Nop( loadCensorshipValues.get<bool*>( 7 ), 6 );
|
||||||
|
Nop( loadCensorshipValues.get<bool*>( 0x14 ), 6 );
|
||||||
|
Nop( loadCensorshipValues.get<bool*>( 0x21 ), 5 );
|
||||||
|
|
||||||
|
// Unified censorship levels for all regions
|
||||||
|
InjectHook( initialiseLanguage1, EmptyStub );
|
||||||
|
|
||||||
|
void* setNormalGame;
|
||||||
|
void* setGermanGame;
|
||||||
|
void* setFrenchGame;
|
||||||
|
ReadCall( initialiseLanguage2.get<void>(), setNormalGame );
|
||||||
|
ReadCall( initialiseLanguage2.get<void>( 0x15 ), setGermanGame );
|
||||||
|
ReadCall( initialiseLanguage2.get<void>( 0x2A ), setFrenchGame );
|
||||||
|
|
||||||
|
InjectHook( setNormalGame, SetUncensoredGame, PATCH_JUMP );
|
||||||
|
InjectHook( setGermanGame, SetUncensoredGame, PATCH_JUMP );
|
||||||
|
InjectHook( setFrenchGame, SetUncensoredGame, PATCH_JUMP );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue