mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Also simplify __CtrlUpdateButtons to only do a single read and write to the global.
This commit is contained in:
parent
6a61a58b9f
commit
ad1f378902
1 changed files with 5 additions and 2 deletions
|
@ -206,9 +206,12 @@ u32 __CtrlReadLatch()
|
|||
|
||||
void __CtrlUpdateButtons(u32 bitsToSet, u32 bitsToClear)
|
||||
{
|
||||
bitsToClear &= CTRL_MASK_USER;
|
||||
bitsToSet &= CTRL_MASK_USER;
|
||||
|
||||
std::lock_guard<std::mutex> guard(ctrlMutex);
|
||||
ctrlCurrent.buttons &= ~(bitsToClear & CTRL_MASK_USER);
|
||||
ctrlCurrent.buttons |= (bitsToSet & CTRL_MASK_USER);
|
||||
// There's no atomic operation for this, so mutex it is.
|
||||
ctrlCurrent.buttons = (ctrlCurrent.buttons & ~bitsToClear) | bitsToSet;
|
||||
}
|
||||
|
||||
void __CtrlSetAnalogXY(int stick, float x, float y)
|
||||
|
|
Loading…
Add table
Reference in a new issue