Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Starfield 1.12.32.0 #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/export/SFSEPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,30 @@ extern "C" DLLEXPORT bool SFSEAPI SFSEPlugin_Load(const SFSE::LoadInterface* a_s
{
auto hook = REL::Relocation<std::uintptr_t>(
RE::Offset::BSPCGamepadDevice::Poll,
0x2A0);

0x281);
REL::Pattern<"C6 43 08 01">().match_or_fail(hook.address());
REL::safe_fill(hook.address(), REL::NOP, 0x4);

const std::uint8_t data[] = { 0xC6, 0x43, 0x08, 0x0 };
REL::safe_write(hook.address(), std::span<const std::uint8_t>(data));
}

{
auto hookLocs = {
// Fix slow movement on 2 quadrants?
std::make_pair(RE::Offset::PlayerControls::LookHandler::Func10, 0xE),
// Fix look sensitivity
std::make_pair(RE::Offset::PlayerControls::Manager::ProcessLookInput, 0x68),
std::make_pair(RE::Offset::PlayerControls::Manager::ProcessLookInput, 0x81),
// Prevent cursor from escaping window
std::make_pair(RE::Offset::Main::Run_WindowsMessageLoop, 0x39),
// Fix mouse movement for ship reticle
std::make_pair(RE::Offset::ShipHudDataModel::PerformInputProcessing, 0x7AF),
std::make_pair(RE::Offset::ShipHudDataModel::PerformInputProcessing, 0x82A),
std::make_pair(RE::Offset::ShipHudDataModel::PerformInputProcessing, 0x842),
std::make_pair(RE::Offset::ShipHudDataModel::PerformInputProcessing, 0x8BD),
};

auto& trampoline = SFSE::GetTrampoline();
for (auto [id, offset] : hookLocs) {
auto hook = REL::Relocation<std::uintptr_t>(id, offset);

REL::Pattern<"E8">().match_or_fail(hook.address());

trampoline.write_call<5>(hook.address(), IsUsingThumbstickLook);
}
}
Expand Down