mc.mitm: shift the battery level mapping for sony controllers to avoid reporting critical battery levels too early

This commit is contained in:
ndeadly 2022-06-20 21:44:42 +02:00
parent 4f5cb51c1e
commit d38ca828dd
2 changed files with 2 additions and 2 deletions

View file

@ -131,7 +131,7 @@ namespace ams::controller {
if (battery_level > 10) if (battery_level > 10)
battery_level = 10; battery_level = 10;
m_battery = static_cast<uint8_t>(8 * (battery_level + 1) / 10) & 0x0e; m_battery = static_cast<uint8_t>(8 * (battery_level + 2) / 10) & 0x0e;
m_left_stick.SetData( m_left_stick.SetData(
static_cast<uint16_t>(stick_scale_factor * src->input0x31.left_stick.x) & 0xfff, static_cast<uint16_t>(stick_scale_factor * src->input0x31.left_stick.x) & 0xfff,

View file

@ -119,7 +119,7 @@ namespace ams::controller {
if (battery_level > 10) if (battery_level > 10)
battery_level = 10; battery_level = 10;
m_battery = static_cast<uint8_t>(8 * (battery_level + 1) / 10) & 0x0e; m_battery = static_cast<uint8_t>(8 * (battery_level + 2) / 10) & 0x0e;
m_left_stick.SetData( m_left_stick.SetData(
static_cast<uint16_t>(stick_scale_factor * src->input0x11.left_stick.x) & 0xfff, static_cast<uint16_t>(stick_scale_factor * src->input0x11.left_stick.x) & 0xfff,