diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-04-21 08:49:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 08:49:55 -0400 |
commit | cf553c7006f2b7a290a1f000f40e437f102acb71 (patch) | |
tree | 07a783d06d71da62ffa3a436d77b84f9c4172ba2 /src/librfu_intr.c | |
parent | 03fb7d24e8ec9a3cd7eba17aa80ea4273a0a8da1 (diff) | |
parent | 576e63fd0a068e30b0bfdb838920543f17c2dc88 (diff) |
Merge pull request #422 from Kurausukun/final
Fix Final 2 Nonmatchings (ported from emerald)
Diffstat (limited to 'src/librfu_intr.c')
-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 ( |