Fix Turntable extension's table range

This commit is contained in:
shockdude 2023-01-18 19:17:09 -08:00
parent 1b333727e9
commit a32b85691b
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ void Turntable::BuildDesiredExtensionState(DesiredExtensionState* target_state)
// left table
{
const ControllerEmu::Slider::StateData lt = m_left_table->GetState(m_input_override_function);
const s8 tt = MapFloat<u8>(lt.value, 0, 0, TABLE_RANGE);
const s8 tt = MapFloat<s8>(lt.value, 0, -TABLE_RANGE, TABLE_RANGE);
tt_data.ltable1 = tt;
tt_data.ltable2 = tt >> 5;
@ -105,7 +105,7 @@ void Turntable::BuildDesiredExtensionState(DesiredExtensionState* target_state)
// right table
{
const ControllerEmu::Slider::StateData rt = m_right_table->GetState(m_input_override_function);
const s8 tt = MapFloat<u8>(rt.value, 0, 0, TABLE_RANGE);
const s8 tt = MapFloat<s8>(rt.value, 0, -TABLE_RANGE, TABLE_RANGE);
tt_data.rtable1 = tt;
tt_data.rtable2 = tt >> 1;

View File

@ -83,7 +83,7 @@ public:
static constexpr u8 STICK_GATE_RADIUS = 0x16;
static constexpr int TABLE_BIT_COUNT = 6;
static constexpr u8 TABLE_RANGE = (1 << STICK_BIT_COUNT) / 2 - 1;
static constexpr u8 TABLE_RANGE = (1 << TABLE_BIT_COUNT) / 2 - 1;
static constexpr int EFFECT_DIAL_BIT_COUNT = 5;
static constexpr u8 EFFECT_DIAL_CENTER = (1 << EFFECT_DIAL_BIT_COUNT) / 2;