Skip to content

Commit

Permalink
Merge pull request #11094 from unknownbrackets/ctrl-minor
Browse files Browse the repository at this point in the history
Ctrl: Always mark non-user buttons released.
  • Loading branch information
hrydgard authored Jun 6, 2018
2 parents 3d12f9a + 16e0a7c commit 708ea74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Core/HLE/sceCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
1 change: 1 addition & 0 deletions headless/Headless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 708ea74

Please sign in to comment.