2018-10-05 16:23:21 +02:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2018-10-06 05:14:42 +02:00
|
|
|
#include <cstring>
|
2018-10-05 16:23:21 +02:00
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "core/core_timing.h"
|
|
|
|
#include "core/hle/service/hid/controllers/stubbed.h"
|
|
|
|
|
|
|
|
namespace Service::HID {
|
2018-10-06 05:14:42 +02:00
|
|
|
|
|
|
|
Controller_Stubbed::Controller_Stubbed() = default;
|
2018-10-18 02:34:25 +02:00
|
|
|
Controller_Stubbed::~Controller_Stubbed() = default;
|
2018-10-06 05:14:42 +02:00
|
|
|
|
2018-10-05 16:23:21 +02:00
|
|
|
void Controller_Stubbed::OnInit() {}
|
2018-10-06 05:14:42 +02:00
|
|
|
|
2018-10-05 16:23:21 +02:00
|
|
|
void Controller_Stubbed::OnRelease() {}
|
2018-10-06 05:14:42 +02:00
|
|
|
|
2019-02-14 18:42:58 +01:00
|
|
|
void Controller_Stubbed::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
|
|
|
|
std::size_t size) {
|
2018-10-05 16:23:21 +02:00
|
|
|
if (!smart_update) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
CommonHeader header{};
|
2019-02-14 18:42:58 +01:00
|
|
|
header.timestamp = core_timing.GetTicks();
|
2018-10-05 16:23:21 +02:00
|
|
|
header.total_entry_count = 17;
|
|
|
|
header.entry_count = 0;
|
|
|
|
header.last_entry_index = 0;
|
|
|
|
|
|
|
|
std::memcpy(data + common_offset, &header, sizeof(CommonHeader));
|
|
|
|
}
|
2018-10-06 05:14:42 +02:00
|
|
|
|
2018-10-05 16:23:21 +02:00
|
|
|
void Controller_Stubbed::OnLoadInputDevices() {}
|
|
|
|
|
2018-10-06 05:14:42 +02:00
|
|
|
void Controller_Stubbed::SetCommonHeaderOffset(std::size_t off) {
|
2018-10-05 16:23:21 +02:00
|
|
|
common_offset = off;
|
|
|
|
smart_update = true;
|
|
|
|
}
|
2018-10-06 05:14:42 +02:00
|
|
|
} // namespace Service::HID
|