service: hid: Fully implement abstract vibration

This commit is contained in:
Narr the Reg
2024-01-10 22:06:54 -06:00
committed by german77
parent 2c29c2b8dd
commit 2cacb9d48c
31 changed files with 905 additions and 448 deletions

View File

@ -200,6 +200,25 @@ void AppletResource::EnableInput(u64 aruid, bool is_enabled) {
data[index].flag.enable_touchscreen.Assign(is_enabled);
}
bool AppletResource::SetAruidValidForVibration(u64 aruid, bool is_enabled) {
const u64 index = GetIndexFromAruid(aruid);
if (index >= AruidIndexMax) {
return false;
}
if (!is_enabled && aruid == active_vibration_aruid) {
active_vibration_aruid = SystemAruid;
return true;
}
if (is_enabled && aruid != active_vibration_aruid) {
active_vibration_aruid = aruid;
return true;
}
return false;
}
void AppletResource::EnableSixAxisSensor(u64 aruid, bool is_enabled) {
const u64 index = GetIndexFromAruid(aruid);
if (index >= AruidIndexMax) {