diff options
-rw-r--r-- | common_syms/AgbRfu_LinkManager.txt (renamed from common_syms/link_rfu.txt) | 0 | ||||
-rw-r--r-- | src/librfu_rfu.c | 35 | ||||
-rw-r--r-- | sym_common.txt | 2 |
3 files changed, 30 insertions, 7 deletions
diff --git a/common_syms/link_rfu.txt b/common_syms/AgbRfu_LinkManager.txt index 7ff8cd53d..7ff8cd53d 100644 --- a/common_syms/link_rfu.txt +++ b/common_syms/AgbRfu_LinkManager.txt diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c index 5b0b92c4e..420fb7c9a 100644 --- a/src/librfu_rfu.c +++ b/src/librfu_rfu.c @@ -116,6 +116,14 @@ static const char lib_ver[] = "RFU_V1024"; static const char str_checkMbootLL[] = "RFU-MBOOT"; +#define COPY(src, dst, size) do { \ + const u16 *_src = (const u16 *)(src); \ + u16 *_dst = (u16 *)(dst); \ + u16 _size = (size); \ + while (_size-- != 0) \ + *_dst++ = *_src++; \ +} while (0) + u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p, bool8 copyInterruptToRam) { u16 i; @@ -168,18 +176,21 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p gRfuSlotStatusUNI[i]->recvBuffer = NULL; gRfuSlotStatusUNI[i]->recvBufferSize = 0; } - src = (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1); - dst = gRfuFixed->fastCopyBuffer; // rfu_REQ_changeMasterSlave is the function next to rfu_STC_fastCopy #if LIBRFU_VERSION < 1028 -//#if 0 + src = (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1); + dst = gRfuFixed->fastCopyBuffer; buffByteSizeMax = ((void *)rfu_REQ_changeMasterSlave - (void *)rfu_STC_fastCopy) / sizeof(u16); + while (buffByteSizeMax-- != 0) + *dst++ = *src++; #else // register swap dst <--> buffByteSizeMax - buffByteSizeMax = 0x60 / sizeof(u16); + COPY( + (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1), + gRfuFixed->fastCopyBuffer, + 0x60 / sizeof(u16) + ); #endif - while (buffByteSizeMax-- != 0) - *dst++ = *src++; gRfuFixed->fastCopyPtr = (void *)gRfuFixed->fastCopyBuffer + 1; return 0; } @@ -490,6 +501,13 @@ static void rfu_CB_configGameData(u8 reqCommand, u16 reqResult) void rfu_REQ_startSearchChild(void) { u16 result; +#if LIBRFU_VERSION >= 1028 + u16 i; + for (i = 0; i < RFU_CHILD_MAX; i++) + { + gRfuStatic->lsFixedCount[i] = 0; + } +#endif STWI_set_Callback_M(rfu_CB_defaultCallback); STWI_send_SystemStatusREQ(); @@ -576,6 +594,11 @@ static void rfu_STC_readChildList(void) u8 true_slots[RFU_CHILD_MAX]; u8 bm_slot_id; +#if LIBRFU_VERSION >= 1028 +//#if 1 + // TODO: decompile this +#endif + if (numSlots != 0) { stwiParam = gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0]; diff --git a/sym_common.txt b/sym_common.txt index d71df5ce2..e729f5515 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -91,7 +91,7 @@ gUnknown_3005078: @ 3005078 .align 4 .include "link_rfu_2.o" .align 4 - .include "link_rfu.o" + .include "AgbRfu_LinkManager.o" .align 4 .include "list_menu.o" .align 2 |