Input: Change invalid input logic to cancel out both directions instead

This commit is contained in:
Sour 2019-11-14 18:11:29 -05:00
parent ea9e31f44e
commit 48db261942
2 changed files with 15 additions and 0 deletions

View file

@ -30,6 +30,18 @@ protected:
SetPressedState(Buttons::Y, keyMapping.TurboB);
SetPressedState(Buttons::L, keyMapping.LButton);
SetPressedState(Buttons::R, keyMapping.RButton);
if(!_console->GetSettings()->CheckFlag(EmulationFlags::AllowInvalidInput)) {
//If both U+D or L+R are pressed at the same time, act as if neither is pressed
if(IsPressed(Buttons::Up) && IsPressed(Buttons::Down)) {
ClearBit(Buttons::Down);
ClearBit(Buttons::Up);
}
if(IsPressed(Buttons::Left) && IsPressed(Buttons::Right)) {
ClearBit(Buttons::Left);
ClearBit(Buttons::Right);
}
}
}
}

View file

@ -51,10 +51,13 @@ protected:
}
if(!_console->GetSettings()->CheckFlag(EmulationFlags::AllowInvalidInput)) {
//If both U+D or L+R are pressed at the same time, act as if neither is pressed
if(IsPressed(Buttons::Up) && IsPressed(Buttons::Down)) {
ClearBit(Buttons::Down);
ClearBit(Buttons::Up);
}
if(IsPressed(Buttons::Left) && IsPressed(Buttons::Right)) {
ClearBit(Buttons::Left);
ClearBit(Buttons::Right);
}
}