diff options
author | Kurausukun <lord.uber1@gmail.com> | 2021-04-20 22:21:20 -0400 |
---|---|---|
committer | Kurausukun <lord.uber1@gmail.com> | 2021-04-20 22:21:20 -0400 |
commit | 576e63fd0a068e30b0bfdb838920543f17c2dc88 (patch) | |
tree | 07a783d06d71da62ffa3a436d77b84f9c4172ba2 /src | |
parent | 3f2fc649f23526d3be54524e51dd84b1bfb63d76 (diff) |
fix librfu_intr fakematching (port from emerald)
Diffstat (limited to 'src')
-rw-r--r-- | src/librfu_intr.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librfu_intr.c b/src/librfu_intr.c index 41085182a..4c2f2573a 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -147,11 +147,7 @@ static void sio32intr_clock_slave(void) { u32 regSIODATA32; u32 r0; - #ifndef NONMATCHING - register u32 reqLen asm("r2"); - #else - u32 reqLen; - #endif + u32 reqLen; gSTWIStatus->timerActive = 0; STWI_set_timer_in_RAM(100); @@ -164,10 +160,14 @@ static void sio32intr_clock_slave(void) ((u32*)gSTWIStatus->rxPacket)[0] = regSIODATA32; gSTWIStatus->reqNext = 1; r0 = 0x99660000; - if ((regSIODATA32 >> 16) == (r0 >> 16)) + // variable reuse required + reqLen = (regSIODATA32 >> 16); + if (reqLen == (r0 >> 16)) { + // only reqLen = regSIODATA32 >> 8 is required to match, but it looks a bit + // more consistent when both lines update the variables. Might have been a macro? gSTWIStatus->reqLength = reqLen = regSIODATA32 >> 8; - gSTWIStatus->reqActiveCommand = regSIODATA32; + gSTWIStatus->reqActiveCommand = reqLen = (regSIODATA32 >> 0); if (gSTWIStatus->reqLength == 0) { if ( |