Link common syms

This commit is contained in:
PikalaxALT 2017-11-11 00:25:05 -05:00
parent e874cbd9d9
commit 3321548956
5 changed files with 75 additions and 116 deletions

View File

@ -5,16 +5,6 @@
.text
thumb_func_start SetLinkDebugValues
SetLinkDebugValues: @ 800A994
ldr r2, =gUnknown_0300302C
str r0, [r2]
ldr r0, =gUnknown_03003070
str r1, [r0]
bx lr
.pool
thumb_func_end SetLinkDebugValues
thumb_func_start sub_800A9A8
sub_800A9A8: @ 800A9A8
push {r4,lr}

View File

@ -1 +1,37 @@
gUnknown_03003020
gLinkDebugSeed
gLocalLinkPlayerBlock
gLinkErrorOccurred
gLinkDebugFlags
gUnknown_03003074
gUnknown_03003078
gUnknown_0300307C
gFiller_03003080
gLinkHeldKeys
gRecvCmds
gLinkStatus
gUnknown_030030E4
gUnknown_030030E8
gUnknown_030030EC
gUnknown_030030F0
gUnknown_030030F4
gSuppressLinkErrorMessage
gSerialIsRFU
gUnknown_03003100
gSendCmd
gUnknown_03003120
gReceivedRemoteLinkPlayers
gLinkTestBGInfo
gLinkCallback
gShouldAdvanceLinkState
gLinkTestBlockChecksums
gBlockRequestType
gFiller_03003154
gFiller_03003158
gFiller_0300315c
gUnknown_03003160
gLink
gUnknown_03004130
gUnknown_03004134
gFiller_03004138
gFiller_0300413C

View File

@ -149,7 +149,7 @@ struct BlockRequest
extern const struct BlockRequest sBlockRequestLookupTable[5];
extern struct Link gLink;
extern u16 gRecvCmds[MAX_LINK_PLAYERS][CMD_LENGTH];
extern u16 gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH];
extern u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE]; // gBlockSendBuffer
extern u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE];
extern u16 gLinkType;
@ -218,18 +218,18 @@ u8 sub_800B320(void);
u8 sub_800B33C(void);
extern u16 gUnknown_03003020[6];
extern u32 gUnknown_0300302C;
extern u32 gLinkDebugSeed;
extern struct LinkPlayerBlock gLocalLinkPlayerBlock;
extern bool8 gLinkErrorOccurred;
extern u32 gUnknown_03003070;
extern bool8 gUnknown_03003078[4];
extern u8 gUnknown_0300307C[4];
extern u32 gLinkDebugFlags;
extern bool8 gUnknown_03003078[MAX_LINK_PLAYERS];
extern u8 gUnknown_0300307C[MAX_LINK_PLAYERS];
extern u16 gLinkHeldKeys;
extern u32 gLinkStatus;
extern u8 gUnknown_030030E4;
extern u8 gUnknown_030030E8;
extern u8 gUnknown_030030EC[4];
extern u8 gUnknown_030030F0[4];
extern u8 gUnknown_030030EC[MAX_LINK_PLAYERS];
extern u8 gUnknown_030030F0[MAX_LINK_PLAYERS];
extern u16 gUnknown_030030F4;
extern u8 gSuppressLinkErrorMessage;
extern bool8 gSerialIsRFU;
@ -238,9 +238,17 @@ extern u8 gUnknown_03003120;
extern struct LinkTestBGInfo gLinkTestBGInfo;
extern void (*gLinkCallback)(void);
extern bool8 gShouldAdvanceLinkState;
extern u16 gLinkTestBlockChecksums[4];
extern u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS];
extern u8 gBlockRequestType;
extern u8 gUnknown_03003160;
extern u8 gUnknown_03004130;
extern u16 gUnknown_03004134;
extern u32 gUnknown_03003074;
extern u32 gFiller_03003154;
extern u32 gFiller_03003158;
extern u32 gFiller_0300315c;
extern u32 gFiller_03004138;
extern u32 gFiller_0300413C;
extern u32 gFiller_03003080;
#endif // GUARD_LINK_H

View File

@ -67,14 +67,16 @@ IWRAM_DATA void *gUnknown_03000DAC;
IWRAM_DATA bool32 gUnknown_03000DB0;
u16 gUnknown_03003020[6];
u32 gUnknown_0300302C;
u32 gLinkDebugSeed;
struct LinkPlayerBlock gLocalLinkPlayerBlock;
bool8 gLinkErrorOccurred;
u32 gUnknown_03003070;
u32 gLinkDebugFlags;
u32 gUnknown_03003074;
bool8 gUnknown_03003078[MAX_LINK_PLAYERS];
u8 gUnknown_0300307C[MAX_LINK_PLAYERS];
u32 gFiller_03003080;
u16 gLinkHeldKeys;
u16 gRecvCmds[MAX_LINK_PLAYERS][8];
u16 gRecvCmds[MAX_RFU_PLAYERS][8];
u32 gLinkStatus;
u8 gUnknown_030030E4;
bool8 gUnknown_030030E8;
@ -92,9 +94,15 @@ void (*gLinkCallback)(void);
bool8 gShouldAdvanceLinkState;
u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS];
u8 gBlockRequestType;
u32 gFiller_03003154;
u32 gFiller_03003158;
u32 gFiller_0300315c;
u8 gUnknown_03003160;
struct Link gLink;
u8 gUnknown_03004130;
u16 gUnknown_03004134;
u32 gFiller_03004138;
u32 gFiller_0300413C;
EWRAM_DATA u8 gLinkTestDebugValuesEnabled = 0;
EWRAM_DATA u8 gUnknown_020223BD = 0;
@ -124,7 +132,7 @@ static void SetBlockReceivedFlag(u8 who);
static u16 LinkTestCalcBlockChecksum(const u16 *src, u16 size);
static void LinkTest_prnthex(u32 pos, u8 a0, u8 a1, u8 a2);
static void LinkCB_RequestPlayerDataExchange(void);
static void task00_link_test(u8 taskId);
static void Task_PrintTestData(u8 taskId);
void sub_800AEB4(void);
u8 sub_800B2F8(void);
void sub_800B4A4(void);
@ -260,7 +268,7 @@ void LinkTestScreen(void)
UpdatePaletteFade();
gUnknown_03000D60 = 0;
InitLocalLinkPlayer();
CreateTask(task00_link_test, 0);
CreateTask(Task_PrintTestData, 0);
SetMainCallback2(CB2_LinkTest);
}
@ -1218,7 +1226,7 @@ static void LinkCB_RequestPlayerDataExchange(void)
gLinkCallback = NULL;
}
static void task00_link_test(u8 taskId)
static void Task_PrintTestData(u8 taskId)
{
char sp[32];
int i;
@ -1233,8 +1241,8 @@ static void task00_link_test(u8 taskId)
LinkTest_prnthex(gUnknown_03003160, 25, 1, 2);
LinkTest_prnthex(gUnknown_03004130, 25, 2, 2);
LinkTest_prnthex(GetBlockReceivedStatus(), 15, 5, 2);
LinkTest_prnthex(gUnknown_0300302C, 2, 12, 8);
LinkTest_prnthex(gUnknown_03003070, 2, 13, 8);
LinkTest_prnthex(gLinkDebugSeed, 2, 12, 8);
LinkTest_prnthex(gLinkDebugFlags, 2, 13, 8);
LinkTest_prnthex(sub_800B2E8(), 25, 5, 1);
LinkTest_prnthex(sub_800B2F8(), 25, 6, 1);
LinkTest_prnthex(sub_800B320(), 25, 7, 1);
@ -1244,3 +1252,9 @@ static void task00_link_test(u8 taskId)
LinkTest_prnthex(gLinkTestBlockChecksums[i], 10, 4 + i, 4);
}
}
void SetLinkDebugValues(u32 seed, u32 flags)
{
gLinkDebugSeed = seed;
gLinkDebugFlags = flags;
}

View File

@ -11,96 +11,7 @@ gUnknown_03002F70: @ 3002F70
.include "text.o"
.include "sprite.o"
gUnknown_03003020: @ 3003020
.space 0xC
gUnknown_0300302C: @ 300302C
.space 0x4
gLocalLinkPlayerBlock: @ 3003030
.space 0x3C
gLinkErrorOccurred: @ 300306C
.space 0x4
gUnknown_03003070: @ 3003070
.space 0x8
gUnknown_03003078: @ 3003078
.space 0x4
gUnknown_0300307C: @ 300307C
.space 0x8
gLinkHeldKeys: @ 3003084
.space 0xC
gRecvCmds: @ 3003090
.space 0x50
gLinkStatus: @ 30030E0
.space 0x4
gUnknown_030030E4: @ 30030E4
.space 0x4
gUnknown_030030E8: @ 30030E8
.space 0x4
gUnknown_030030EC: @ 30030EC
.space 0x4
gUnknown_030030F0: @ 30030F0
.space 0x4
gUnknown_030030F4: @ 30030F4
.space 0x4
gSuppressLinkErrorMessage: @ 30030F8
.space 0x4
gSerialIsRFU: @ 30030FC
.space 0x4
gUnknown_03003100: @ 3003100
.space 0x10
gSendCmd: @ 3003110
.space 0x10
gUnknown_03003120: @ 3003120
.space 0x4
gReceivedRemoteLinkPlayers: @ 3003124
.space 0xC
gLinkTestBGInfo: @ 3003130
.space 0x10
gLinkCallback: @ 3003140
.space 0x4
gShouldAdvanceLinkState: @ 3003144
.space 0x4
gLinkTestBlockChecksums: @ 3003148
.space 0x8
gBlockRequestType: @ 3003150
.space 0x10
gUnknown_03003160: @ 3003160
.space 0x10
gLink: @ 3003170
.space 0xFC0
gUnknown_03004130: @ 3004130
.space 0x4
gUnknown_03004134: @ 3004134
.space 0xC
.include "link.o"
gUnknown_03004140: @ 3004140
.space 0x10