diff options
author | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2021-05-23 10:51:26 -0400 |
---|---|---|
committer | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2021-05-23 10:51:26 -0400 |
commit | c723d980e772f7e7ab82dbcb7ad07132c09ab5b4 (patch) | |
tree | 0bed002b2990b9e837220618a321f3b6517a1099 /src/librfu_intr.c | |
parent | c50a21fba07db80ac44c6f09fd202ba4b2e2c7d3 (diff) | |
parent | ffbbc88801de3fc56d0bf5f0af1418ca7cfcfa4f (diff) |
Merge branch 'master' of https://github.com/pret/pokeemerald
Diffstat (limited to 'src/librfu_intr.c')
-rw-r--r-- | src/librfu_intr.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/librfu_intr.c b/src/librfu_intr.c index 1361be40e..19ea60b06 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -148,11 +148,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); @@ -165,10 +161,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)) { - gSTWIStatus->reqLength = reqLen = regSIODATA32 >> 8; - gSTWIStatus->reqActiveCommand = regSIODATA32; + // only reqLen = regSIODATA32 >> 8 is needed 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 = reqLen = (regSIODATA32 >> 0); if (gSTWIStatus->reqLength == 0) { if ( |