Skip to content

Commit

Permalink
EnableNTSCMode: made starting game rank tweaks not require restart
Browse files Browse the repository at this point in the history
  • Loading branch information
pas-de-2 committed Mar 19, 2023
1 parent ec2c503 commit 3e0c2f7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
23 changes: 19 additions & 4 deletions dllmain/Gameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,27 @@ void re4t::init::Gameplay()
if (re4t::cfg->bEnableNTSCMode)
{
// Normal mode and Separate Ways: increased starting difficulty (3500->5500)
auto pattern = hook::pattern("8A 50 ? FE CA 0F B6 C2");
Patch(pattern.count(1).get(0).get<uint32_t>(0), { 0xB2, 0x01, 0x90 }); // GamePointInit, { mov dl, 1 }
auto pattern = hook::pattern("05 7C 15 00 00 6A 00 89 81 94 4F 00 00");
struct GamePointInit_NormalGameRank
{
void operator()(injector::reg_pack& regs)
{
*(uint32_t*)(regs.ecx + 0x4F94) = SystemSavePtr()->language_8 == 1 || re4t::cfg->bEnableNTSCMode ? 5500 : 3500;
}
}; injector::MakeInline<GamePointInit_NormalGameRank>(pattern.count(1).get(0).get<uint32_t>(7), pattern.count(1).get(0).get<uint32_t>(13));

// Assignment Ada: increased difficulty (4500->6500)
pattern = hook::pattern("66 39 B1 ? ? 00 00 75 10");
injector::MakeNOP(pattern.count(1).get(0).get<uint32_t>(7), 2); // GameAddPoint
pattern = hook::pattern("8B ? ? ? ? ? 80 7E 08 01 74");
struct GameAddPoint_AAdaGameRank
{
void operator()(injector::reg_pack& regs)
{
if (SystemSavePtr()->language_8 == 1 || re4t::cfg->bEnableNTSCMode)
regs.ef |= (1 << regs.zero_flag);
else
regs.ef &= ~(1 << regs.zero_flag);
}
}; injector::MakeInline<GameAddPoint_AAdaGameRank>(pattern.count(1).get(0).get<uint32_t>(0), pattern.count(1).get(0).get<uint32_t>(10));

// Shooting range: increased bottle cap score requirements (1000->3000)
pattern = hook::pattern("8B F9 8A ? ? 8B ? ? FE C9");
Expand Down
4 changes: 2 additions & 2 deletions dllmain/cfgMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,8 +1489,8 @@ void cfgMenuRender()
ImGui_ItemSeparator();

ImGui::Dummy(ImVec2(10, 10 * esHook._cur_monitor_dpi));
ImGui::TextWrapped("Unlocks minor difficulty boosts previously exclusive to the North American console versions of RE4.");
ImGui::TextWrapped("Higher starting adaptive difficulty, more difficult Ada missions, and a more difficult Mercenaries village stage.");
ImGui::TextWrapped("Unlocks minor difficulty modifiers previously exclusive to the North American console versions of RE4.");
ImGui::TextWrapped("Higher starting adaptive difficulty in Normal mode and Separate Ways, higher fixed difficulty in Assignment Ada, and unlocked dynamic difficulty in the Mercenaries village stage.");
ImGui::TextWrapped("Bottle caps require 3000 points in the shooting gallery, and Easy difficulty is removed from the title menu.");
}

Expand Down
4 changes: 2 additions & 2 deletions settings/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ AshleyJPCameraAngles = false
; Adds a menu to choose between Normal and Professional difficulty modes when starting a new game of Separate Ways.
SeparateWaysProfessional = true

; Unlocks minor difficulty boosts previously exclusive to the NTSC console versions of RE4.
; Higher starting adaptive difficulty, more difficult Ada missions, and a more difficult Mercenaries village stage.
; Unlocks minor difficulty modifiers previously exclusive to the North American console versions of RE4.
; Higher starting adaptive difficulty in Normal mode and Separate Ways, higher fixed difficulty in Assignment Ada, and unlocked dynamic difficulty in the Mercenaries village stage.
; Bottle caps require 3000 points in the shooting gallery, and Easy difficulty is removed from the title menu.
EnableNTSCMode = false

Expand Down

0 comments on commit 3e0c2f7

Please sign in to comment.