diff options
| author | bunnei <bunneidev@gmail.com> | 2022-04-27 12:31:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-27 12:31:27 -0700 |
| commit | 9ed0b5c5f9393e379a929131e2d8f7a21320b4f8 (patch) | |
| tree | 157c7a8d8a5505e64b25fcd0e84dfb2c68c4295b /src/core/hle/service/hid/controllers/stubbed.cpp | |
| parent | 5295a925d8fd5e0115838fd8f96db4d386d42d4b (diff) | |
| parent | 0f3ad939a85494a8a9bdcb6f357c774f385f647e (diff) | |
Merge pull request #8229 from german77/reinterpret2
service: hid: Access shared memory directly
Diffstat (limited to 'src/core/hle/service/hid/controllers/stubbed.cpp')
| -rw-r--r-- | src/core/hle/service/hid/controllers/stubbed.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/service/hid/controllers/stubbed.cpp b/src/core/hle/service/hid/controllers/stubbed.cpp index 4d3b9d2be..df9ee0c3f 100644 --- a/src/core/hle/service/hid/controllers/stubbed.cpp +++ b/src/core/hle/service/hid/controllers/stubbed.cpp @@ -9,15 +9,18 @@ namespace Service::HID { -Controller_Stubbed::Controller_Stubbed(Core::HID::HIDCore& hid_core_) : ControllerBase{hid_core_} {} +Controller_Stubbed::Controller_Stubbed(Core::HID::HIDCore& hid_core_, u8* raw_shared_memory_) + : ControllerBase{hid_core_} { + raw_shared_memory = raw_shared_memory_; +} + Controller_Stubbed::~Controller_Stubbed() = default; void Controller_Stubbed::OnInit() {} void Controller_Stubbed::OnRelease() {} -void Controller_Stubbed::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data, - std::size_t size) { +void Controller_Stubbed::OnUpdate(const Core::Timing::CoreTiming& core_timing) { if (!smart_update) { return; } @@ -28,7 +31,7 @@ void Controller_Stubbed::OnUpdate(const Core::Timing::CoreTiming& core_timing, u header.entry_count = 0; header.last_entry_index = 0; - std::memcpy(data + common_offset, &header, sizeof(CommonHeader)); + std::memcpy(raw_shared_memory + common_offset, &header, sizeof(CommonHeader)); } void Controller_Stubbed::SetCommonHeaderOffset(std::size_t off) { |
