1
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
1.1 KiB

#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;
}
}
}