Permalink
Browse files

Merge pull request #11094 from unknownbrackets/ctrl-minor

Ctrl: Always mark non-user buttons released.
  • Loading branch information...
hrydgard committed Jun 6, 2018
2 parents 3d12f9a + 16e0a7c commit 708ea740d2e4f7ca3e61a75a32905e76b7e68266
Showing with 7 additions and 4 deletions.
  1. +6 −4 Core/HLE/sceCtrl.cpp
  2. +1 −0 headless/Headless.cpp
View
@@ -503,26 +503,28 @@ static int sceCtrlPeekBufferNegative(u32 ctrlDataPtr, u32 nBufs)
return done;
}
void __CtrlWriteUserLatch(CtrlLatch *userLatch) {
static void __CtrlWriteUserLatch(CtrlLatch *userLatch, int bufs) {
*userLatch = latch;
userLatch->btnBreak &= CTRL_MASK_USER;
userLatch->btnMake &= CTRL_MASK_USER;
userLatch->btnPress &= CTRL_MASK_USER;
userLatch->btnRelease &= CTRL_MASK_USER;
if (bufs > 0) {
userLatch->btnRelease |= CTRL_MASK_USER;
}
}
static u32 sceCtrlPeekLatch(u32 latchDataPtr) {
auto userLatch = PSPPointer<CtrlLatch>::Create(latchDataPtr);
if (userLatch.IsValid()) {
__CtrlWriteUserLatch(userLatch);
__CtrlWriteUserLatch(userLatch, ctrlLatchBufs);
}
return hleLogSuccessI(SCECTRL, ctrlLatchBufs);
}
static u32 sceCtrlReadLatch(u32 latchDataPtr) {
auto userLatch = PSPPointer<CtrlLatch>::Create(latchDataPtr);
if (userLatch.IsValid()) {
__CtrlWriteUserLatch(userLatch);
__CtrlWriteUserLatch(userLatch, ctrlLatchBufs);
}
return hleLogSuccessI(SCECTRL, __CtrlResetLatch());
}
View
@@ -374,6 +374,7 @@ int main(int argc, const char* argv[])
g_Config.bBlockTransferGPU = true;
g_Config.iSplineBezierQuality = 2;
g_Config.bHighQualityDepth = true;
g_Config.bMemStickInserted = true;
#ifdef _WIN32
InitSysDirectories();

0 comments on commit 708ea74

Please sign in to comment.