The link cable's runtime: serial packets, registers and transfer state. More...
Go to the source code of this file.
Data Structures | |
| struct | SerialPacket |
| A link cable packet: its sequence number, the consoles not yet heard from, its checksum and a 24-byte payload. More... | |
| union | SerialDataRegisters |
| The serial data registers read as two words or four halfwords; no TBS code names this union. More... | |
| struct | SerialRuntime |
| The link cable's runtime: its mode and phase, the consoles heard from, the send position and the packet buffers the interrupt handler fills. More... | |
| struct | SerialTransferState |
| A console's block transfer state, exchanged with the partner each VBlank: its block sequence, its status and flags, and a 20-byte block. More... | |
Macros | |
| #define | SERIAL_RUNTIME (&gSerialRuntime) |
Variables | |
| struct SerialTransferState | gSerialTransfer |
| struct SerialRuntime | gSerialRuntime |
| u16 | gSerialExchangeActive |
| s32 | gSerialSendSource |
| volatile u16 | gSerialSendSize |
| volatile: tagged where it steers, in SerialRuntime_StepBlockTransfer (tbs runtime.c) | |
| s32 | gSerialReceiveDest |
| volatile u16 | gSerialReceivedSize |
| volatile: tagged where it steers, in BattleLink_ReceiveActions (tbs battle.c) and LinkLobby_ReceivePartyRecords (tbs lobby.c) | |
| u8 | gSerialPeerPayloads [4][24] |
| volatile u8 | gSerialBlockSequence |
| volatile: tagged where it steers, in SerialRuntime_StepBlockTransfer (tbs runtime.c) | |
| u8 | gLinkExchangeState |
| volatile u16 | gLinkStatus |
| Link status, updated by the VBlank exchange handler. | |
The link cable's runtime: serial packets, registers and transfer state.
Definition in file serial_runtime.h.
| #define SERIAL_RUNTIME (&gSerialRuntime) |
Definition at line 115 of file serial_runtime.h.
Referenced by SerialRuntime_PrepareSendPacket().
| STATIC_ASSERT | ( | sizeof(struct SerialPacket) | = =32 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialPacket, sequence) | = =0 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialPacket, missingMask) | = =1 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialPacket, checksum) | = =2 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialPacket, payload) | = =4 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialPacket, reservedTail) | = =28 | ) |
| STATIC_ASSERT | ( | sizeof(struct SerialRuntime) | = =0x160 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialRuntime, mode) | = =0 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialRuntime, transferEnabled) | = =8 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialRuntime, sendIndex) | = =0x14 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialRuntime, storage) | = =0x60 | ) |
| STATIC_ASSERT | ( | sizeof(struct SerialTransferState) | = =24 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialTransferState, active) | = =0 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialTransferState, status) | = =1 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialTransferState, flags) | = =2 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialTransferState, peerFlags) | = =3 | ) |
| STATIC_ASSERT | ( | offsetof(struct SerialTransferState, payload) | = =4 | ) |
Definition at line 139 of file serial_runtime.h.
Referenced by SerialRuntime_AddParentFlag(), SerialRuntime_ExchangePayloads(), SerialRuntime_PollAndTransfer(), and SerialRuntime_PollStatus().
|
static |
Definition at line 145 of file serial_runtime.h.
Referenced by BattleLink_ResetTransferState(), LinkLobby_ExchangePartyRecords(), and SerialRuntime_ResetTransferState().
|
extern |
Referenced by Battle_ClearSerialTransferPayload(), Battle_CollectPartyCommands(), BattlePres_SyncTurn(), BattlePres_WaitSync(), LinkLobby_EnterBattle(), LinkLobby_RunRoundResult(), LinkLobby_WriteSlotValue(), SaveMenu_Run(), SerialRuntime_BeginReceive(), SerialRuntime_BeginSend(), SerialRuntime_ResetTransferState(), SerialRuntime_StepBlockTransfer(), and System_VBlankHandler().
|
extern |
Referenced by SerialRuntime_AddParentFlag(), SerialRuntime_CollectReceivedPayloads(), SerialRuntime_DisableTransfer(), SerialRuntime_EnableTransferTimer(), SerialRuntime_ExchangePayloads(), SerialRuntime_HandleTransferInterrupt(), SerialRuntime_Initialize(), SerialRuntime_PollAndTransfer(), SerialRuntime_PollStatus(), and WaitFrames().
|
extern |
Referenced by SerialRuntime_Initialize(), SerialRuntime_RemoveIrqHandlers(), System_VBlankHandler(), and WaitFrames().
|
extern |
|
extern |
volatile: tagged where it steers, in SerialRuntime_StepBlockTransfer (tbs runtime.c)
Referenced by SerialRuntime_BeginSend(), SerialRuntime_Initialize(), SerialRuntime_ResetTransferState(), and SerialRuntime_StepBlockTransfer().
|
extern |
|
extern |
volatile: tagged where it steers, in BattleLink_ReceiveActions (tbs battle.c) and LinkLobby_ReceivePartyRecords (tbs lobby.c)
Referenced by BattlePresentation_AppendLinkedActions(), LinkLobby_ReceivePartyRecords(), SerialRuntime_BeginReceive(), SerialRuntime_Initialize(), SerialRuntime_ResetTransferState(), and SerialRuntime_StepBlockTransfer().
|
extern |
Referenced by BattlePres_WaitSync(), SerialRuntime_StepBlockTransfer(), and System_VBlankHandler().
|
extern |
volatile: tagged where it steers, in SerialRuntime_StepBlockTransfer (tbs runtime.c)
Referenced by SerialRuntime_BeginReceive(), SerialRuntime_BeginSend(), and SerialRuntime_StepBlockTransfer().
|
extern |
Referenced by LinkLobby_ExchangePartyRecords(), and SerialRuntime_Initialize().
|
extern |
Link status, updated by the VBlank exchange handler.
Referenced by Battle_CollectPartyCommands(), Battle_RunEncounter(), BattlePres_SyncTurn(), BattlePres_WaitSync(), BattlePresentation_AppendLinkedActions(), BattlePresentation_UpdateCamera(), LinkLobby_PeerSlotMatches(), LinkLobby_ReceivePartyRecords(), LinkLobby_SendPartyRecords(), SaveMenu_Run(), SerialRuntime_StepBlockTransfer(), SerialRuntime_WaitForStatusMask(), and System_VBlankHandler().