Skip to content

Commit fd024e4

Browse files
committed
Fix ZL/ZR behaviour by improving IR Patch
1 parent 7fb7940 commit fd024e4

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

data/code.ips

12 Bytes
Binary file not shown.

patch.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,10 @@ RemoveZLZR:
9696
mov r1, #0
9797
stmea sp, {r1, r2}
9898
mov r3, #0
99+
100+
.org 0x1048D0 // Remove ZL/ZR from irrstSamplingThread
101+
orr r1, r1, #0x20000
102+
.org 0x1048E4
103+
orr r1, r1, #0x10000
104+
99105
.close

source/irrst.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,17 @@ void irSampling() {
297297
IrrstEntry entry;
298298
svcSetTimer(irtimer, 8000000LL, 0LL);
299299
volatile uint32_t latest = *latestKeysPA;
300+
301+
if ((latest & 0x10000) == 0x10000) {
302+
latest |= 0x4000;
303+
latest &= ~0x10000;
304+
}
305+
306+
if ((latest & 0x20000) == 0x20000) {
307+
latest |= 0x8000;
308+
latest &= ~0x20000;
309+
}
310+
300311
entry.pressedpadstate = (latest ^ latestkeys) & ~latestkeys;
301312
entry.releasedpadstate = (latest ^ latestkeys) & latestkeys;
302313
entry.currpadstate = latest;

0 commit comments

Comments
 (0)