stubbed.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <cstring>
  5. #include "common/common_types.h"
  6. #include "common/swap.h"
  7. #include "core/core_timing.h"
  8. #include "core/hle/service/hid/controllers/stubbed.h"
  9. namespace Service::HID {
  10. Controller_Stubbed::Controller_Stubbed() = default;
  11. Controller_Stubbed::~Controller_Stubbed() = default;
  12. void Controller_Stubbed::OnInit() {}
  13. void Controller_Stubbed::OnRelease() {}
  14. void Controller_Stubbed::OnUpdate(u8* data, std::size_t size) {
  15. if (!smart_update) {
  16. return;
  17. }
  18. CommonHeader header{};
  19. header.timestamp = CoreTiming::GetTicks();
  20. header.total_entry_count = 17;
  21. header.entry_count = 0;
  22. header.last_entry_index = 0;
  23. std::memcpy(data + common_offset, &header, sizeof(CommonHeader));
  24. }
  25. void Controller_Stubbed::OnLoadInputDevices() {}
  26. void Controller_Stubbed::SetCommonHeaderOffset(std::size_t off) {
  27. common_offset = off;
  28. smart_update = true;
  29. }
  30. } // namespace Service::HID