Fix input state mapping.

This commit is contained in:
Skyth 2024-11-18 21:54:14 +03:00
parent 57fe789903
commit 6f31815f7d
3 changed files with 4 additions and 10 deletions

View file

@ -11,10 +11,9 @@ namespace SWA
// TODO: Hedgehog::Base::TSynchronizedPtr<CInputState> // TODO: Hedgehog::Base::TSynchronizedPtr<CInputState>
static CInputState* GetInstance(); static CInputState* GetInstance();
SPadState m_PadStates[40]; SWA_INSERT_PADDING(0x4);
SWA_INSERT_PADDING(0x50); SPadState m_PadStates[8];
be<uint32_t> m_CurrentPadStateIndex; be<uint32_t> m_CurrentPadStateIndex;
SWA_INSERT_PADDING(0x04);
const SPadState& GetPadState() const; const SPadState& GetPadState() const;
}; };

View file

@ -3,7 +3,7 @@ namespace SWA
// TODO: Hedgehog::Base::TSynchronizedPtr<CInputState> // TODO: Hedgehog::Base::TSynchronizedPtr<CInputState>
inline CInputState* CInputState::GetInstance() inline CInputState* CInputState::GetInstance()
{ {
return *(xpointer<CInputState>*)MmGetHostAddress(0x833671EC); return *(xpointer<CInputState>*)MmGetHostAddress(0x83361F5C);
} }
inline const SPadState& CInputState::GetPadState() const inline const SPadState& CInputState::GetPadState() const

View file

@ -43,16 +43,11 @@ namespace SWA
struct SPadState struct SPadState
{ {
SWA_INSERT_PADDING(0x20);
be<uint32_t> DownState; be<uint32_t> DownState;
be<uint32_t> UpState; be<uint32_t> UpState;
be<uint32_t> TappedState; be<uint32_t> TappedState;
be<uint32_t> ReleasedState; be<uint32_t> ReleasedState;
// TODO: This structure seems different than the Generations counterpart,
// these paddings might not be there.
be<float> LeftStickHorizontal; be<float> LeftStickHorizontal;
be<float> LeftStickVertical; be<float> LeftStickVertical;
@ -66,7 +61,7 @@ namespace SWA
be<float> LeftTrigger; be<float> LeftTrigger;
be<float> RightTrigger; be<float> RightTrigger;
SWA_INSERT_PADDING(0x24); SWA_INSERT_PADDING(0x08);
bool IsDown(const EKeyState in_Keys) const; bool IsDown(const EKeyState in_Keys) const;
bool IsUp(const EKeyState in_Keys) const; bool IsUp(const EKeyState in_Keys) const;