Navigation Menu

Skip to content

Commit

Permalink
Fix AMD freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
unk-1 committed Jan 8, 2018
1 parent 009ed36 commit c60afef
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ElDorito/Source/Patches/Core.cpp
Expand Up @@ -37,6 +37,7 @@ namespace
void DirtyDiskErrorHook();
int __cdecl GetScreenshotFolderHook(wchar_t *path);
void __cdecl HsPrintHook(const char *message);
void ContrailSystemRenderSetStreamSourceHook(void *vb, int offset);

std::vector<Patches::Core::ShutdownCallback> shutdownCallbacks;
std::string MapsFolder;
Expand Down Expand Up @@ -151,6 +152,9 @@ namespace Patches::Core

Pointer(0x530FAA).Write<float>(7); // podium duration in seconds

// fixes the amd freeze
Hook(0x65806D, ContrailSystemRenderSetStreamSourceHook, HookFlags::IsCall).Apply();

#ifndef _DEBUG
// Dirty disk error at 0x0xA9F6D0 is disabled in this build
Hook(0x69F6C0, DirtyDiskErrorHook).Apply();
Expand Down Expand Up @@ -467,4 +471,14 @@ namespace

Console::WriteLine(message);
}

void ContrailSystemRenderSetStreamSourceHook(void *vb, int offset)
{
const auto rasterizer_set_stream_source = (void(*)(void *vb, int offset))(0x00A5DB90);

if (offset < 0)
offset = 0;

rasterizer_set_stream_source(vb, offset);
}
}

1 comment on commit c60afef

@codymikol
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Please sign in to comment.