parent
34e767ca27
commit
afa68ffd25
5 changed files with 43 additions and 6 deletions
@ -0,0 +1,30 @@ |
||||
#pragma once |
||||
|
||||
// Bink playback is prone to freezing in bordered window, we enforce borderless mode here
|
||||
namespace ForceBorderless |
||||
{ |
||||
void Install() |
||||
{ |
||||
if (REL::Module::IsVR()) { |
||||
return; |
||||
} |
||||
|
||||
std::uint8_t code[] = { 0xB8, 0x01, 0x00, 0x00, 0x00, REL::NOP, REL::NOP }; // mov eax,0x1
|
||||
auto version = REL::Module::get().version(); |
||||
|
||||
if (version >= REL::Version(1, 6, 1130, 0) && version <= REL::Version(1, 6, 1170, 0)) { |
||||
logger::info("Initializing borderless mode..."); |
||||
REL::Relocation<std::uintptr_t> target{ REL::ID(36547), 0xBEA }; |
||||
REL::safe_write(target.address(), code, sizeof(code)); |
||||
|
||||
} else if (version >= REL::Version(1, 5, 97, 0) && version < REL::Version(1, 6, 1130, 0)) { |
||||
logger::info("Initializing borderless mode..."); |
||||
REL::Relocation<std::uintptr_t> target{ REL::RelocationID(35548, 36547), REL::Relocate(0x83A, version >= REL::Version(1, 6, 342, 0) ? version >= REL::Version(1, 6, 629, 0) ? 0xCFA : 0xCDA : 0xCBB) }; |
||||
REL::safe_write(target.address(), code, sizeof(code)); |
||||
|
||||
} else { |
||||
logger::info("Untested version of Skyrim, skipping borderless mode..."); |
||||
return; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue