Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11464 from shockdude/turntable-range-fix
Fix DJ Turntable extension's table range
  • Loading branch information
JMC47 committed Jan 20, 2023
2 parents 1b33372 + a32b856 commit d1aacf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/Core/Core/HW/WiimoteEmu/Extension/Turntable.cpp
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/WiimoteEmu/Extension/Turntable.h
Expand Up @@ -83,7 +83,7 @@ class Turntable : public Extension1stParty
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;
Expand Down

0 comments on commit d1aacf8

Please sign in to comment.