mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-03 13:01:55 +01:00
sceHprm: Write zeroes to the latch buffer in sceHprmPeekLatch too
We don't support the headphone remote buttons, so we just leave the buffer all zeroes. Previously we didn't write, which could cause games to register a ghost "track forward" or the other buttons. Should fix the DJ Max 2 OST track-forwarding problem in #7468.
This commit is contained in:
1 parent
888abaa97e
commit
e443e84d3c
2 files changed
+17
-5
No files matched your search
+14
-4
@@ -48,14 +48,24 @@ static u32 sceHprmUnregisterCallback() {
|
||||
return hleLogError(Log::HLE, 0, "UNIMPL");
|
||||
}
|
||||
|
||||
// The latch is 4 x u32 (make, break, press, release). We don't support the headphone remote
|
||||
// buttons, so it's all zeroes.
|
||||
static void WriteEmptyLatch(u32 latchAddr) {
|
||||
if (!Memory::IsValid4AlignedRange(latchAddr, 16)) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Memory::WriteUnchecked_U32(0, latchAddr + i * 4);
|
||||
}
|
||||
}
|
||||
|
||||
static u32 sceHprmPeekLatch(u32 latchAddr) {
|
||||
return hleLogDebug(Log::HLE,0, "latchAddr %08x", latchAddr);
|
||||
WriteEmptyLatch(latchAddr);
|
||||
return hleLogDebug(Log::HLE, 0, "latchAddr %08x", latchAddr);
|
||||
}
|
||||
|
||||
static u32 sceHprmReadLatch(u32 latchAddr) {
|
||||
// Real hardware/JPCSP: 4 x u32 output struct, dummied out to all-zero (nothing held/pressed).
|
||||
for (int i = 0; i < 4; i++)
|
||||
Memory::WriteOrException_U32(0, latchAddr + i * 4);
|
||||
WriteEmptyLatch(latchAddr);
|
||||
return hleLogDebug(Log::HLE, 0, "latchAddr %08x", latchAddr);
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -17,5 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// HPRM - headphone remote. The PSP has a remote control for the headphones, which can be used to control music playback and volume.
|
||||
// This module is used by the music player and some games, including DJ Max Portable games.
|
||||
void Register_sceHprm();
|
||||
void Register_sceHprm_driver();
|
||||
void Register_sceHprm_driver();
|
||||
Reference in new issue
Block a user