Skip to content

Commit

Permalink
dolphin plugin fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Oct 14, 2024
1 parent fa3c50b commit 8b34678
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions includes/dolphin/dolphin.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ class Dolphin
auto candidate_stringref = utility::scan_displacement_reference(current_module, *candidate_string);
if (candidate_stringref)
{
for (size_t i = 0; i < 4000; ++i)
for (size_t i = 0; i < 8000; ++i)
{
const auto mov = utility::scan_mnemonic(*candidate_stringref + i, 5, "MOV");
if (mov)
{
if (injector::ReadMemory<uint32_t>(*mov + 1, true) == 19)
if (injector::ReadMemory<uint32_t>(*mov + 1, true) == 19 || injector::ReadMemory<uint32_t>(*mov + 1, true) == 20)
{
const auto next_fn_call1 = utility::scan_mnemonic(*mov, 100, "CALL");
if (next_fn_call1)
Expand All @@ -51,7 +51,7 @@ class Dolphin
const auto next_mov = utility::scan_mnemonic(*next_fn_call2, 100, "MOV");
if (next_mov)
{
if (injector::ReadMemory<uint32_t>(*next_mov + 1, true) == 17)
if (injector::ReadMemory<uint32_t>(*next_mov + 1, true) == 17 || injector::ReadMemory<uint32_t>(*next_mov + 1, true) == 18)
{
_SetIsThrottlerTempDisabled = (void(__fastcall*)(bool disable))(injector::GetBranchDestination(*next_fn_call2).as_int());
return _SetIsThrottlerTempDisabled(disable);
Expand Down
8 changes: 4 additions & 4 deletions source/ResidentEvil2.RE3.Dolphin.FusionMod/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ void PluginThread(std::future<void> futureObj)
{
[&]()
{
auto pattern = hook::pattern(Dolphin::GameMemoryStart, Dolphin::GameMemoryEnd, "38 a0 00 01 3c 60 ? ? 38 83 ? ? 90 a4");
auto pattern = hook::pattern(Dolphin::GameMemoryStart, Dolphin::GameMemoryEnd, "38 ? 00 01 3c 60 ? ? 38 ? ? ? 90 ? ? ? 3c ? ? ? 38 63 ? ? 80 63 00 00 88 ? 00 09 28 ? 00 0b ? ? ? ? 3c 60 ? ? 38 ? ? ? 54 ? ? ? 7c ? ? ? 7c");
if (gameVersion == RE3)
pattern = hook::pattern(Dolphin::GameMemoryStart, Dolphin::GameMemoryEnd, "38 00 00 01 3c 60 ? ? 38 63 ? ? ? ? 00 00 3c 60");
pattern = hook::pattern(Dolphin::GameMemoryStart, Dolphin::GameMemoryEnd, "38 00 00 01 3c 60 ? ? 38 63 ? ? 98 03 00 00 3c 60 ? ? 38 63 ? ? 93 83 21 58 3c 60");
if (pattern.size() >= 1)
{
memcheck = pattern.get(0).get<uint32_t>(4);
Expand Down Expand Up @@ -165,7 +165,7 @@ void PluginThread(std::future<void> futureObj)
}
else if (gameVersion == RECV)
{

}
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ void InitLED()
std::this_thread::sleep_for(std::chrono::milliseconds(100));

auto gameVersion = GameVersion::UNDEFINED;
if (Dolphin::GameID() == "GHAE08" || Dolphin::GameID() == "GHAP08" || Dolphin::GameID() == "GHAJ08")
if (Dolphin::GameID() == "GHAE08" || Dolphin::GameID() == "GHAP08" /* || Dolphin::GameID() == "GHAJ08"*/)
gameVersion = GameVersion::RE2;
else if (Dolphin::GameID() == "GLEE08" || Dolphin::GameID() == "GLEJ08" || Dolphin::GameID() == "GLEP08")
gameVersion = GameVersion::RE3;
Expand Down

0 comments on commit 8b34678

Please sign in to comment.