librfu rodata

This commit is contained in:
jiangzhengwenjz
2020-01-10 04:13:33 +08:00
parent 0ce29c0ee9
commit aa98431995
4 changed files with 32 additions and 43 deletions
-28
View File
@@ -1,28 +0,0 @@
.section .rodata
.set VERSION_MAJOR, 1
.set VERSION_MINOR, 0
.set VERSION_REVISION, 24
.align 2
_Str_RfuHeader::
.byte 2, 14, 0, 10, 9, 5, 7, 2
.byte 0, 15, 1, 3, 3, 0, 31, 0
.byte 3, 22, 18, 14, 13, 9, 11, 3
.byte 15, 15, 1, 3, 3, 0, 0x7f, 0
@ .ascii "RFU_V1024"
.ascii "RFU_V"
.byte VERSION_MAJOR + 0x30
.byte VERSION_MINOR + 0x30
.byte (VERSION_REVISION / 10) + 0x30
.byte (VERSION_REVISION % 10) + 0x30
.byte 0
.align 2
_Str_RFU_MBOOT::
.asciz "RFU-MBOOT"
.align 2
_Str_Sio32ID::
.asciz "NINTENDOSio32ID_030820"
+2 -1
View File
@@ -940,7 +940,8 @@ SECTIONS {
src/agb_flash_1m.o(.rodata);
src/agb_flash_mx.o(.rodata);
src/agb_flash_le.o(.rodata);
data/librfu_rodata.o(.rodata);
src/librfu_rfu.o(.rodata);
src/librfu_s32id.o(.rodata);
src/isagbprn.o(.rodata);
*libgcc.a:_divdi3.o(.rodata);
*libgcc.a:_udivdi3.o(.rodata);
+26 -11
View File
@@ -1,6 +1,6 @@
#include "librfu.h"
struct RfuHeader
struct LLSFStruct
{
u8 unk00;
u8 unk01;
@@ -67,15 +67,30 @@ static void rfu_STC_NI_receive_Sender(u8, u8, const struct RfuLocalStruct *, UNU
static void rfu_STC_NI_initSlot_asRecvDataEntity(u8, struct NIComm *);
static void rfu_STC_NI_initSlot_asRecvControllData(u8, struct NIComm *);
extern const char _Str_RFU_MBOOT[];
extern const struct RfuHeader _Str_RfuHeader[2];
struct RfuSlotStatusUNI *gRfuSlotStatusUNI[RFU_CHILD_MAX];
struct RfuSlotStatusNI *gRfuSlotStatusNI[RFU_CHILD_MAX];
struct RfuLinkStatus *gRfuLinkStatus;
struct RfuStatic *gRfuStatic;
struct RfuFixed *gRfuFixed;
static const struct LLSFStruct llsf_struct[2] = {
{
2, 14, 0, 10, 9, 5, 7, 2,
0, 15, 1, 3, 3, 0x1f
}, {
3, 22, 18, 14, 13, 9, 11, 3,
15, 15, 1, 3, 3, 0x7f
}
};
#ifdef EMERALD
static const char lib_ver[] = "RFU_V1026";
#else
static const char lib_ver[] = "RFU_V1024";
#endif
static const char str_checkMbootLL[] = "RFU-MBOOT";
u16 rfu_initializeAPI(struct RfuAPIBuffer *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p, bool8 copyInterruptToRam)
{
u16 i;
@@ -264,7 +279,7 @@ u16 rfu_getRFUStatus(u8 *rfuState)
u16 rfu_MBOOT_CHILD_inheritanceLinkStatus(void)
{
const char *s1 = _Str_RFU_MBOOT;
const char *s1 = str_checkMbootLL;
char *s2 = (char *)0x30000F0;
u16 checksum;
u16 *r2;
@@ -1315,7 +1330,7 @@ static u16 rfu_STC_setSendData_org(u8 r6, u8 bmSendSlot, u8 subFrameSize, const
r9 = &gRfuLinkStatus->remainLLFrameSizeParent;
else if (gRfuLinkStatus->parentChild == MODE_CHILD)
r9 = &gRfuLinkStatus->remainLLFrameSizeChild[r2];
r4 = _Str_RfuHeader[gRfuLinkStatus->parentChild].unk00;
r4 = llsf_struct[gRfuLinkStatus->parentChild].unk00;
if (subFrameSize > *r9 || subFrameSize <= r4)
return ERR_SUBFRAME_SIZE;
sp04 = REG_IME;
@@ -1672,7 +1687,7 @@ static u16 rfu_STC_NI_constructLLSF(u8 r10, u8 **r12, struct NIComm *r4)
u32 sp00;
u8 i;
u8 *r2;
const struct RfuHeader *r8 = &_Str_RfuHeader[gRfuLinkStatus->parentChild];
const struct LLSFStruct *r8 = &llsf_struct[gRfuLinkStatus->parentChild];
if (r4->state == SLOT_STATE_SENDING)
{
@@ -1732,7 +1747,7 @@ static u16 rfu_STC_NI_constructLLSF(u8 r10, u8 **r12, struct NIComm *r4)
static u16 rfu_STC_UNI_constructLLSF(u8 r8, u8 **r6)
{
const struct RfuHeader *r5;
const struct LLSFStruct *r5;
const u8 *sp04;
u32 sp00;
u8 *r2;
@@ -1741,7 +1756,7 @@ static u16 rfu_STC_UNI_constructLLSF(u8 r8, u8 **r6)
if (!r4->dataReadyFlag || !r4->bmSlot)
return 0;
r5 = &_Str_RfuHeader[gRfuLinkStatus->parentChild];
r5 = &llsf_struct[gRfuLinkStatus->parentChild];
sp00 = (r4->state & 0xF) << r5->unk03
| r4->payloadSize;
if (gRfuLinkStatus->parentChild == MODE_PARENT)
@@ -1857,13 +1872,13 @@ static void rfu_STC_CHILD_analyzeRecvPacket(void)
static u16 rfu_STC_analyzeLLSF(u8 r12, const u8 *r7, u16 r3)
{
struct RfuLocalStruct sp00;
const struct RfuHeader *r6;
const struct LLSFStruct *r6;
u32 r5;
u8 r4;
u32 r0;
u16 r10;
r6 = &_Str_RfuHeader[~gRfuLinkStatus->parentChild & (MODE_NEUTRAL & MODE_PARENT)];
r6 = &llsf_struct[~gRfuLinkStatus->parentChild & (MODE_NEUTRAL & MODE_PARENT)];
if (r3 < r6->unk00)
return r3;
r5 = 0;
+4 -3
View File
@@ -1,13 +1,14 @@
#include "librfu.h"
extern const u16 _Str_Sio32ID[];
static void Sio32IDIntr(void);
static void Sio32IDInit(void);
static s32 Sio32IDMain(void);
struct RfuS32Id gRfuS32Id;
static const u16 Sio32ConnectionData[] = { 0x494e, 0x544e, 0x4e45, 0x4f44 }; // NINTENDO
static const char Sio32IDLib_Var[] = "Sio32ID_030820";
s32 AgbRFU_checkID(u8 r5)
{
u16 r8;
@@ -147,7 +148,7 @@ static void Sio32IDIntr(void)
}
}
if (gRfuS32Id.unk2 < 4)
gRfuS32Id.unk4 = *(gRfuS32Id.unk2 + _Str_Sio32ID);
gRfuS32Id.unk4 = *(gRfuS32Id.unk2 + Sio32ConnectionData);
else
gRfuS32Id.unk4 = 0x8001;
gRfuS32Id.unk6 = ~r5;