The Battle Arena overlay: the lobby where linked and monster battles start, the exchange of the two parties, the attendant and the records of wins. More...
Go to the source code of this file.
Data Structures | |
| struct | LinkPeer |
| The partner console's signature as the lobby reads it: a word for each slot column. More... | |
Macros | |
| #define | LOBBY_UNIT_RECORD_BYTES 0x154 |
| #define | LOBBY_RECOVERY_RECORD_BYTES 0x140 |
| #define | LOBBY_UNIT_RECORD_COUNT 3 |
| #define | LOBBY_LINK_READY_MASK 3 |
| #define | LOBBY_TRANSFER_RETRY_LIMIT 24 |
| #define | LOBBY_SEND_TIMEOUT_FRAMES 600 |
| #define | LOBBY_RECEIVE_TIMEOUT_FRAMES 900 |
| #define | LOBBY_PEER_WAIT_FRAMES 25 |
| #define | PEER_TAG(a, b, c, d) |
| #define | LOBBY_NO_RESULT |
| What a lobby handler's early exit returns. | |
Functions | |
| u8 * | LinkLobby_GetEntrances (void) |
| s32 | SceneData_ReturnZero (void) |
| static s32 | LinkLobby_InitializeSerial (void) |
| Reinitializes the serial runtime while interrupts are locked. | |
| u8 * | LinkLobby_GetExits (void) |
| s32 | LinkLobby_SelectPlacements (void) |
| Selects the post-link-battle placements for entrances nine and eleven. | |
| static s32 | LinkLobby_PeerSlotMatches (s32 slot) |
| Checks one language-specific peer signature slot and updates link-side flags. | |
| static void | LinkLobby_WriteSlotValue (s32 slot) |
| Publishes a protocol slot value in the outgoing signature payload. | |
| static s32 | LinkLobby_PollPeerReady (void) |
| static s32 | LinkLobby_PromptToParticipate (void) |
| Prompts for participation unless entering battle or a prompt is still pending. | |
| static s32 | LinkLobby_ReportDisconnection (void) |
| Resets the disconnect trigger and displays the attendant's warning. | |
| static s32 | LinkLobby_ReceivePartyRecords (void) |
| Receives three unit records and a recovery table; returns the occupied count or the original transfer failure. | |
| static s32 | LinkLobby_CopyPartyOwnerIds (u16 *ownerIds) |
| Copies at most three active owner IDs, terminates with 0xff, and returns count. | |
| static s32 | LinkLobby_SendPartyRecords (void) |
| Sends up to three active owners, pads missing records, then sends recovery data. | |
| static s32 | LinkLobby_ExchangePartyRecords (void) |
| Orders send/receive by link side and records the received owner count. | |
| static s32 | LinkLobby_EnterBattle (void) |
| Waits for the opponent, exchanges parties and starts the arena battle. | |
| static s32 | LinkLobby_ChooseBattleMode (void) |
| Offers a linked challenge or a monster battle and publishes the response. | |
| static s32 | LinkLobby_ReportWinTallies (s32 actor) |
| Reports total or consecutive linked wins according to the leader's facing. | |
| static s32 | LinkLobby_ChooseDebugPartyPreset (s32 actorId) |
| Selects a debug party preset; A accepts and B cancels. | |
| static s32 | LinkLobby_OpenSanctum (s32 actorId) |
| Runs the sanctum service for this actor within an event. | |
| static s32 | LinkLobby_PartyContains (s32 ownerId) |
| Tests the first three linked-battle owners, or four outside linked finals. | |
| static UNUSED void | State_NoOp (void) |
| UNUSED: the original empty lobby callback. | |
| static s32 | LinkLobby_TalkByProgress (s32 actor) |
| Chooses each party member's dialogue from participation and round outcome. | |
| static s32 | LinkLobby_LeaveArena (void) |
| Removes the link IRQ handlers, restores sound parameters and leaves the arena. | |
| static s32 | LinkLobby_TalkToAttendant (s32 actor) |
| Selects the attendant's rules or post-battle line from the round outcome. | |
| static s32 | LinkLobby_ExplainPartyOrder (s32 actor) |
| Alternates between the linked-party size and reorder instructions. | |
| static s32 | LinkLobby_ReportMonsterRecord (s32 actorId) |
| Reports the stored consecutive-monster-battle record when nonzero. | |
| u8 * | LinkLobby_GetEvents (void) |
| static s32 | LinkLobby_SaveBattleResults (void) |
| Shows saving/saved messages around the linked battle results save. | |
| static s32 | LinkLobby_SaveMonsterBattleResults (void) |
| Shows saving/saved messages around the monster battle record save. | |
| static s32 | LinkLobby_DrawThreeDigitValue (s32 value) |
| Draws a right-to-left three-digit value capped at 999, then redraws the map. | |
| s32 | LinkLobby_RunRoundResult (void) |
| Processes the entry's monster/link result and restores lobby polling. | |
Variables | |
| const s32 | gLinkLobby_SlotValues [] |
| static s32 | sLinkLobbyWaitFrames |
| u32 | gLinkLobbyCallFrames |
| u8 | gLinkLobby_SlotColumns [] |
| struct SceneEntrance | gLinkLobbyEntrances [] |
| u32 | gLinkLobbyExits [] |
| struct ScenePlacement | gLinkLobbyPlacements [] |
| struct ScenePlacement | gLinkLobbyBattlePlacements [] |
| struct SceneEvent | gLinkLobbyEvents [] |
The Battle Arena overlay: the lobby where linked and monster battles start, the exchange of the two parties, the attendant and the records of wins.
Definition in file lobby.c.
| #define LOBBY_UNIT_RECORD_BYTES 0x154 |
Definition at line 50 of file lobby.c.
Referenced by LinkLobby_ReceivePartyRecords(), and LinkLobby_SendPartyRecords().
| #define LOBBY_RECOVERY_RECORD_BYTES 0x140 |
Definition at line 51 of file lobby.c.
Referenced by LinkLobby_ReceivePartyRecords(), and LinkLobby_SendPartyRecords().
| #define LOBBY_UNIT_RECORD_COUNT 3 |
Definition at line 52 of file lobby.c.
Referenced by LinkLobby_CopyPartyOwnerIds().
| #define LOBBY_LINK_READY_MASK 3 |
Definition at line 53 of file lobby.c.
Referenced by LinkLobby_PeerSlotMatches(), LinkLobby_ReceivePartyRecords(), and LinkLobby_SendPartyRecords().
| #define LOBBY_TRANSFER_RETRY_LIMIT 24 |
Definition at line 54 of file lobby.c.
Referenced by LinkLobby_ReceivePartyRecords(), and LinkLobby_SendPartyRecords().
| #define LOBBY_SEND_TIMEOUT_FRAMES 600 |
Definition at line 55 of file lobby.c.
Referenced by LinkLobby_SendPartyRecords().
| #define LOBBY_RECEIVE_TIMEOUT_FRAMES 900 |
Definition at line 56 of file lobby.c.
Referenced by LinkLobby_ReceivePartyRecords().
| #define LOBBY_PEER_WAIT_FRAMES 25 |
Definition at line 57 of file lobby.c.
Referenced by LinkLobby_EnterBattle(), and LinkLobby_PollPeerReady().
| #define PEER_TAG | ( | a, | |
| b, | |||
| c, | |||
| d ) |
| #define LOBBY_NO_RESULT |
What a lobby handler's early exit returns.
The ROM's s32 handlers return nothing there, leaving whatever the last call put in r0 (UB); UBFIX returns 0, as the function ends that fall off do.
Definition at line 117 of file lobby.c.
Referenced by LinkLobby_EnterBattle().
| u8 * LinkLobby_GetEntrances | ( | void | ) |
Definition at line 120 of file lobby.c.
Referenced by LinkLobby_GetEntrances().
|
static |
Reinitializes the serial runtime while interrupts are locked.
The original s32 entry produces no defined result; its callers ignore it.
Definition at line 126 of file lobby.c.
Referenced by LinkLobby_ChooseBattleMode(), LinkLobby_InitializeSerial(), and LinkLobby_RunRoundResult().
| u8 * LinkLobby_GetExits | ( | void | ) |
Definition at line 141 of file lobby.c.
Referenced by LinkLobby_GetExits().
| s32 LinkLobby_SelectPlacements | ( | void | ) |
Selects the post-link-battle placements for entrances nine and eleven.
Definition at line 144 of file lobby.c.
Referenced by LinkLobby_SelectPlacements().
Checks one language-specific peer signature slot and updates link-side flags.
Definition at line 155 of file lobby.c.
Referenced by LinkLobby_ChooseBattleMode(), LinkLobby_EnterBattle(), LinkLobby_PeerSlotMatches(), and LinkLobby_PollPeerReady().
|
static |
Publishes a protocol slot value in the outgoing signature payload.
Definition at line 187 of file lobby.c.
Referenced by LinkLobby_ChooseBattleMode(), LinkLobby_EnterBattle(), LinkLobby_PollPeerReady(), LinkLobby_ReportDisconnection(), LinkLobby_RunRoundResult(), and LinkLobby_WriteSlotValue().
|
static |
Definition at line 202 of file lobby.c.
Referenced by LinkLobby_EnterBattle(), LinkLobby_PollPeerReady(), and LinkLobby_RunRoundResult().
|
static |
Prompts for participation unless entering battle or a prompt is still pending.
Retains the original handler's missing result on the message path.
Definition at line 269 of file lobby.c.
Referenced by LinkLobby_PromptToParticipate().
|
static |
Resets the disconnect trigger and displays the attendant's warning.
The original handler has no defined return value.
Definition at line 297 of file lobby.c.
Referenced by LinkLobby_ReportDisconnection().
|
static |
Receives three unit records and a recovery table; returns the occupied count or the original transfer failure.
All size checks observe fresh serial reads.
Definition at line 317 of file lobby.c.
Referenced by LinkLobby_ExchangePartyRecords(), and LinkLobby_ReceivePartyRecords().
Copies at most three active owner IDs, terminates with 0xff, and returns count.
Passing a null destination only counts the entries.
Definition at line 441 of file lobby.c.
Referenced by LinkLobby_CopyPartyOwnerIds(), and LinkLobby_SendPartyRecords().
|
static |
Sends up to three active owners, pads missing records, then sends recovery data.
Returns zero on completion or the original serial failure.
Definition at line 477 of file lobby.c.
Referenced by LinkLobby_ExchangePartyRecords(), and LinkLobby_SendPartyRecords().
|
static |
Orders send/receive by link side and records the received owner count.
A failed exchange resets the transfer state.
Definition at line 616 of file lobby.c.
Referenced by LinkLobby_EnterBattle(), and LinkLobby_ExchangePartyRecords().
|
static |
Waits for the opponent, exchanges parties and starts the arena battle.
Disconnects restore the lobby callback and actor position; original returns have no defined status.
Definition at line 660 of file lobby.c.
Referenced by LinkLobby_EnterBattle().
|
static |
Offers a linked challenge or a monster battle and publishes the response.
Retains the original shared message tails and ignored return value.
Definition at line 796 of file lobby.c.
Referenced by LinkLobby_ChooseBattleMode().
Reports total or consecutive linked wins according to the leader's facing.
Retains the original handler's missing return and event-end behavior.
Definition at line 896 of file lobby.c.
Referenced by LinkLobby_ReportWinTallies().
Selects a debug party preset; A accepts and B cancels.
The preset loader's nonzero result selects the unavailable-preset message.
Definition at line 934 of file lobby.c.
Referenced by LinkLobby_ChooseDebugPartyPreset().
Runs the sanctum service for this actor within an event.
Definition at line 993 of file lobby.c.
Referenced by LinkLobby_OpenSanctum().
Tests the first three linked-battle owners, or four outside linked finals.
Definition at line 1003 of file lobby.c.
Referenced by LinkLobby_PartyContains(), LinkLobby_RunRoundResult(), and LinkLobby_TalkByProgress().
|
static |
UNUSED: the original empty lobby callback.
Definition at line 1028 of file lobby.c.
Referenced by State_NoOp().
Chooses each party member's dialogue from participation and round outcome.
Definition at line 1031 of file lobby.c.
Referenced by LinkLobby_TalkByProgress().
|
static |
Removes the link IRQ handlers, restores sound parameters and leaves the arena.
Definition at line 1069 of file lobby.c.
Referenced by LinkLobby_LeaveArena().
Selects the attendant's rules or post-battle line from the round outcome.
Definition at line 1082 of file lobby.c.
Referenced by LinkLobby_TalkToAttendant().
Alternates between the linked-party size and reorder instructions.
Definition at line 1111 of file lobby.c.
Referenced by LinkLobby_ExplainPartyOrder().
Reports the stored consecutive-monster-battle record when nonzero.
Definition at line 1135 of file lobby.c.
Referenced by LinkLobby_ReportMonsterRecord().
| u8 * LinkLobby_GetEvents | ( | void | ) |
Definition at line 1154 of file lobby.c.
Referenced by LinkLobby_GetEvents().
|
static |
Shows saving/saved messages around the linked battle results save.
Definition at line 1157 of file lobby.c.
Referenced by LinkLobby_RunRoundResult(), and LinkLobby_SaveBattleResults().
|
static |
Shows saving/saved messages around the monster battle record save.
Definition at line 1179 of file lobby.c.
Referenced by LinkLobby_RunRoundResult(), and LinkLobby_SaveMonsterBattleResults().
Draws a right-to-left three-digit value capped at 999, then redraws the map.
Definition at line 1200 of file lobby.c.
Referenced by LinkLobby_DrawThreeDigitValue(), and LinkLobby_RunRoundResult().
| s32 LinkLobby_RunRoundResult | ( | void | ) |
Processes the entry's monster/link result and restores lobby polling.
Returns zero after updating records, messages and party recovery.
Definition at line 1217 of file lobby.c.
Referenced by LinkLobby_RunRoundResult().
| const s32 gLinkLobby_SlotValues[] |
Definition at line 71 of file lobby.c.
Referenced by LinkLobby_PeerSlotMatches(), and LinkLobby_WriteSlotValue().
|
static |
Definition at line 109 of file lobby.c.
Referenced by LinkLobby_PollPeerReady(), and LinkLobby_RunRoundResult().
| u32 gLinkLobbyCallFrames |
Definition at line 265 of file lobby.c.
Referenced by LinkLobby_PromptToParticipate(), and LinkLobby_RunRoundResult().
| u8 gLinkLobby_SlotColumns[] |
Definition at line 1406 of file lobby.c.
Referenced by LinkLobby_PeerSlotMatches(), and LinkLobby_WriteSlotValue().
| struct SceneEntrance gLinkLobbyEntrances[] |
Definition at line 1410 of file lobby.c.
Referenced by LinkLobby_GetEntrances().
| u32 gLinkLobbyExits[] |
Definition at line 1420 of file lobby.c.
Referenced by LinkLobby_GetExits().
| struct ScenePlacement gLinkLobbyPlacements[] |
Definition at line 1424 of file lobby.c.
Referenced by LinkLobby_SelectPlacements().
| struct ScenePlacement gLinkLobbyBattlePlacements[] |
Definition at line 1470 of file lobby.c.
Referenced by LinkLobby_SelectPlacements().
| struct SceneEvent gLinkLobbyEvents[] |
Definition at line 1517 of file lobby.c.
Referenced by LinkLobby_GetEvents().