summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-02-10 13:39:28 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2020-02-11 08:57:39 -0500
commit2130218645148965162261bf31bff322ac03f580 (patch)
tree38e20544d25079c61515391b01a388ad214e96a3 /src
parentfafcdf3c60d34d09d6cac0058c5a679783cbb11c (diff)
Cleaner copy loop in rfu_initializeAPI
Diffstat (limited to 'src')
-rw-r--r--src/librfu_rfu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c
index 70117b4e0..cd5d9fd18 100644
--- a/src/librfu_rfu.c
+++ b/src/librfu_rfu.c
@@ -171,7 +171,14 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
src = (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1);
dst = gRfuFixed->fastCopyBuffer;
// rfu_REQ_changeMasterSlave is the function next to rfu_STC_fastCopy
- for (buffByteSizeMax = ((void *)rfu_REQ_changeMasterSlave - (void *)rfu_STC_fastCopy) / sizeof(u16), --buffByteSizeMax; buffByteSizeMax != 0xFFFF; --buffByteSizeMax)
+#if LIBRFU_VERSION < 1028
+//#if 0
+ buffByteSizeMax = ((void *)rfu_REQ_changeMasterSlave - (void *)rfu_STC_fastCopy) / sizeof(u16);
+#else
+ // register swap dst <--> buffByteSizeMax
+ buffByteSizeMax = 0x60 / sizeof(u16);
+#endif
+ while (buffByteSizeMax-- != 0)
*dst++ = *src++;
gRfuFixed->fastCopyPtr = (void *)gRfuFixed->fastCopyBuffer + 1;
return 0;