Merge pull request #1383 from Kurausukun/fr_doc
Port Some Documentation from FR
This commit is contained in:
+1
-2
@@ -1398,8 +1398,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
|||||||
|
|
||||||
if (lineWidth > width)
|
if (lineWidth > width)
|
||||||
return lineWidth;
|
return lineWidth;
|
||||||
else
|
return width;
|
||||||
return width;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str)
|
u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str)
|
||||||
|
|||||||
+4
-4
@@ -152,10 +152,10 @@ u16 sub_8087288(void);
|
|||||||
u16 sub_808729C(void);
|
u16 sub_808729C(void);
|
||||||
u16 QueueExitLinkRoomKey(void);
|
u16 QueueExitLinkRoomKey(void);
|
||||||
u16 sub_80872C4(void);
|
u16 sub_80872C4(void);
|
||||||
bool32 sub_8087598(void);
|
bool32 Overworld_LinkRecvQueueLengthMoreThan2(void);
|
||||||
bool32 sub_80875C8(void);
|
bool32 Overworld_RecvKeysFromLinkIsRunning(void);
|
||||||
bool32 sub_8087634(void);
|
bool32 Overworld_SendKeysToLinkIsRunning(void);
|
||||||
bool32 sub_808766C(void);
|
bool32 IsSendingKeysOverCable(void);
|
||||||
void ClearLinkPlayerObjectEvents(void);
|
void ClearLinkPlayerObjectEvents(void);
|
||||||
|
|
||||||
#endif // GUARD_OVERWORLD_H
|
#endif // GUARD_OVERWORLD_H
|
||||||
|
|||||||
+2
-3
@@ -1791,15 +1791,14 @@ bool8 HandleLinkConnection(void)
|
|||||||
{
|
{
|
||||||
gLinkStatus = LinkMain1(&gShouldAdvanceLinkState, gSendCmd, gRecvCmds);
|
gLinkStatus = LinkMain1(&gShouldAdvanceLinkState, gSendCmd, gRecvCmds);
|
||||||
LinkMain2(&gMain.heldKeys);
|
LinkMain2(&gMain.heldKeys);
|
||||||
|
if ((gLinkStatus & LINK_STAT_RECEIVED_NOTHING) && IsSendingKeysOverCable() == TRUE)
|
||||||
if ((gLinkStatus & LINK_STAT_RECEIVED_NOTHING) && sub_808766C() == TRUE)
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
r4 = sub_8010EC0();
|
r4 = sub_8010EC0();
|
||||||
r5 = sub_8010F1C();
|
r5 = sub_8010F1C();
|
||||||
if (sub_808766C() == TRUE)
|
if (IsSendingKeysOverCable() == TRUE)
|
||||||
{
|
{
|
||||||
if (r4 == TRUE || IsRfuRecvQueueEmpty() || r5)
|
if (r4 == TRUE || IsRfuRecvQueueEmpty() || r5)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
+1
-1
@@ -593,7 +593,7 @@ static bool8 MailReadBuildGraphics(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
if (sub_8087598() == TRUE)
|
if (Overworld_LinkRecvQueueLengthMoreThan2() == TRUE)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -132,7 +132,7 @@ void AgbMain()
|
|||||||
DoSoftReset();
|
DoSoftReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sub_8087634() == 1)
|
if (Overworld_SendKeysToLinkIsRunning() == TRUE)
|
||||||
{
|
{
|
||||||
gLinkTransferringData = TRUE;
|
gLinkTransferringData = TRUE;
|
||||||
UpdateLinkAndCallCallbacks();
|
UpdateLinkAndCallCallbacks();
|
||||||
@@ -143,7 +143,7 @@ void AgbMain()
|
|||||||
gLinkTransferringData = FALSE;
|
gLinkTransferringData = FALSE;
|
||||||
UpdateLinkAndCallCallbacks();
|
UpdateLinkAndCallCallbacks();
|
||||||
|
|
||||||
if (sub_80875C8() == 1)
|
if (Overworld_RecvKeysFromLinkIsRunning() == TRUE)
|
||||||
{
|
{
|
||||||
gMain.newKeys = 0;
|
gMain.newKeys = 0;
|
||||||
ClearSpriteCopyRequests();
|
ClearSpriteCopyRequests();
|
||||||
|
|||||||
+1
-1
@@ -312,7 +312,7 @@ static bool8 sub_81221D0(void)
|
|||||||
if (!MenuHelpers_LinkSomething())
|
if (!MenuHelpers_LinkSomething())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
return sub_8087598();
|
return Overworld_LinkRecvQueueLengthMoreThan2();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 MenuHelpers_CallLinkSomething(void)
|
bool8 MenuHelpers_CallLinkSomething(void)
|
||||||
|
|||||||
+30
-30
@@ -125,14 +125,14 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion);
|
|||||||
static void GetLinkPlayerCoords(u8 linkPlayerId, u16 *x, u16 *y);
|
static void GetLinkPlayerCoords(u8 linkPlayerId, u16 *x, u16 *y);
|
||||||
static u8 GetLinkPlayerFacingDirection(u8 linkPlayerId);
|
static u8 GetLinkPlayerFacingDirection(u8 linkPlayerId);
|
||||||
static u8 GetLinkPlayerElevation(u8 linkPlayerId);
|
static u8 GetLinkPlayerElevation(u8 linkPlayerId);
|
||||||
static s32 sub_80878E4(u8 linkPlayerId);
|
static s32 GetLinkPlayerObjectStepTimer(u8 linkPlayerId);
|
||||||
static u8 GetLinkPlayerIdAt(s16 x, s16 y);
|
static u8 GetLinkPlayerIdAt(s16 x, s16 y);
|
||||||
static void SetPlayerFacingDirection(u8 linkPlayerId, u8 a2);
|
static void SetPlayerFacingDirection(u8 linkPlayerId, u8 a2);
|
||||||
static void ZeroObjectEvent(struct ObjectEvent *objEvent);
|
static void ZeroObjectEvent(struct ObjectEvent *objEvent);
|
||||||
static void SpawnLinkPlayerObjectEvent(u8 linkPlayerId, s16 x, s16 y, u8 a4);
|
static void SpawnLinkPlayerObjectEvent(u8 linkPlayerId, s16 x, s16 y, u8 a4);
|
||||||
static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s16 y);
|
static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s16 y);
|
||||||
static void sub_80877DC(u8 linkPlayerId, u8 a2);
|
static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 a2);
|
||||||
static void sub_808780C(u8 linkPlayerId);
|
static void DestroyLinkPlayerObject(u8 linkPlayerId);
|
||||||
static u8 GetSpriteForLinkedPlayer(u8 linkPlayerId);
|
static u8 GetSpriteForLinkedPlayer(u8 linkPlayerId);
|
||||||
static void RunTerminateLinkScript(void);
|
static void RunTerminateLinkScript(void);
|
||||||
static u32 GetLinkSendQueueLength(void);
|
static u32 GetLinkSendQueueLength(void);
|
||||||
@@ -172,7 +172,7 @@ static u8 sPlayerTradingStates[MAX_LINK_PLAYERS];
|
|||||||
// adjusted key code, effectively intercepting the input before anything
|
// adjusted key code, effectively intercepting the input before anything
|
||||||
// can process it.
|
// can process it.
|
||||||
static u16 (*sPlayerKeyInterceptCallback)(u32);
|
static u16 (*sPlayerKeyInterceptCallback)(u32);
|
||||||
static bool8 sUnknown_03000E18;
|
static bool8 sReceivingFromLink;
|
||||||
static u8 sRfuKeepAliveTimer;
|
static u8 sRfuKeepAliveTimer;
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
@@ -1626,7 +1626,7 @@ static void CB2_ReturnToFieldLocal(void)
|
|||||||
|
|
||||||
static void CB2_ReturnToFieldLink(void)
|
static void CB2_ReturnToFieldLink(void)
|
||||||
{
|
{
|
||||||
if (!sub_8087598() && ReturnToFieldLink(&gMain.state))
|
if (!Overworld_LinkRecvQueueLengthMoreThan2() && ReturnToFieldLink(&gMain.state))
|
||||||
SetMainCallback2(CB2_Overworld);
|
SetMainCallback2(CB2_Overworld);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2823,18 +2823,18 @@ static void RunTerminateLinkScript(void)
|
|||||||
ScriptContext2_Enable();
|
ScriptContext2_Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_8087598(void)
|
bool32 Overworld_LinkRecvQueueLengthMoreThan2(void)
|
||||||
{
|
{
|
||||||
if (!IsUpdateLinkStateCBActive())
|
if (!IsUpdateLinkStateCBActive())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (GetLinkRecvQueueLength() >= 3)
|
if (GetLinkRecvQueueLength() >= 3)
|
||||||
sUnknown_03000E18 = TRUE;
|
sReceivingFromLink = TRUE;
|
||||||
else
|
else
|
||||||
sUnknown_03000E18 = FALSE;
|
sReceivingFromLink = FALSE;
|
||||||
return sUnknown_03000E18;
|
return sReceivingFromLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_80875C8(void)
|
bool32 Overworld_RecvKeysFromLinkIsRunning(void)
|
||||||
{
|
{
|
||||||
u8 temp;
|
u8 temp;
|
||||||
|
|
||||||
@@ -2849,8 +2849,8 @@ bool32 sub_80875C8(void)
|
|||||||
else if (sPlayerKeyInterceptCallback != KeyInterCB_DeferToEventScript)
|
else if (sPlayerKeyInterceptCallback != KeyInterCB_DeferToEventScript)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
temp = sUnknown_03000E18;
|
temp = sReceivingFromLink;
|
||||||
sUnknown_03000E18 = FALSE;
|
sReceivingFromLink = FALSE;
|
||||||
|
|
||||||
if (temp == TRUE)
|
if (temp == TRUE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -2860,7 +2860,7 @@ bool32 sub_80875C8(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_8087634(void)
|
bool32 Overworld_SendKeysToLinkIsRunning(void)
|
||||||
{
|
{
|
||||||
if (GetLinkSendQueueLength() < 2)
|
if (GetLinkSendQueueLength() < 2)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -2874,7 +2874,7 @@ bool32 sub_8087634(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_808766C(void)
|
bool32 IsSendingKeysOverCable(void)
|
||||||
{
|
{
|
||||||
if (gWirelessCommType != 0)
|
if (gWirelessCommType != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -2923,15 +2923,15 @@ static void SpawnLinkPlayerObjectEvent(u8 linkPlayerId, s16 x, s16 y, u8 gender)
|
|||||||
ZeroLinkPlayerObjectEvent(linkPlayerObjEvent);
|
ZeroLinkPlayerObjectEvent(linkPlayerObjEvent);
|
||||||
ZeroObjectEvent(objEvent);
|
ZeroObjectEvent(objEvent);
|
||||||
|
|
||||||
linkPlayerObjEvent->active = 1;
|
linkPlayerObjEvent->active = TRUE;
|
||||||
linkPlayerObjEvent->linkPlayerId = linkPlayerId;
|
linkPlayerObjEvent->linkPlayerId = linkPlayerId;
|
||||||
linkPlayerObjEvent->objEventId = objEventId;
|
linkPlayerObjEvent->objEventId = objEventId;
|
||||||
linkPlayerObjEvent->movementMode = MOVEMENT_MODE_FREE;
|
linkPlayerObjEvent->movementMode = MOVEMENT_MODE_FREE;
|
||||||
|
|
||||||
objEvent->active = 1;
|
objEvent->active = TRUE;
|
||||||
linkGender(objEvent) = gender;
|
linkGender(objEvent) = gender;
|
||||||
linkDirection(objEvent) = DIR_NORTH;
|
linkDirection(objEvent) = DIR_NORTH;
|
||||||
objEvent->spriteId = 64;
|
objEvent->spriteId = MAX_SPRITES;
|
||||||
|
|
||||||
InitLinkPlayerObjectEventPos(objEvent, x, y);
|
InitLinkPlayerObjectEventPos(objEvent, x, y);
|
||||||
}
|
}
|
||||||
@@ -2947,7 +2947,7 @@ static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s1
|
|||||||
ObjectEventUpdateZCoord(objEvent);
|
ObjectEventUpdateZCoord(objEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_80877DC(u8 linkPlayerId, u8 dir)
|
static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 dir)
|
||||||
{
|
{
|
||||||
if (gLinkPlayerObjectEvents[linkPlayerId].active)
|
if (gLinkPlayerObjectEvents[linkPlayerId].active)
|
||||||
{
|
{
|
||||||
@@ -2957,7 +2957,7 @@ static void sub_80877DC(u8 linkPlayerId, u8 dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_808780C(u8 linkPlayerId)
|
static void DestroyLinkPlayerObject(u8 linkPlayerId)
|
||||||
{
|
{
|
||||||
struct LinkPlayerObjectEvent *linkPlayerObjEvent = &gLinkPlayerObjectEvents[linkPlayerId];
|
struct LinkPlayerObjectEvent *linkPlayerObjEvent = &gLinkPlayerObjectEvents[linkPlayerId];
|
||||||
u8 objEventId = linkPlayerObjEvent->objEventId;
|
u8 objEventId = linkPlayerObjEvent->objEventId;
|
||||||
@@ -2998,7 +2998,7 @@ static u8 GetLinkPlayerElevation(u8 linkPlayerId)
|
|||||||
return objEvent->currentElevation;
|
return objEvent->currentElevation;
|
||||||
}
|
}
|
||||||
|
|
||||||
static s32 sub_80878E4(u8 linkPlayerId)
|
static s32 GetLinkPlayerObjectStepTimer(u8 linkPlayerId)
|
||||||
{
|
{
|
||||||
u8 objEventId = gLinkPlayerObjectEvents[linkPlayerId].objEventId;
|
u8 objEventId = gLinkPlayerObjectEvents[linkPlayerId].objEventId;
|
||||||
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
|
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
|
||||||
@@ -3048,32 +3048,32 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3)
|
static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
|
||||||
{
|
{
|
||||||
return gLinkPlayerFacingHandlers[a3](linkPlayerObjEvent, objEvent, a3);
|
return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3)
|
static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
|
||||||
{
|
{
|
||||||
return FACING_UP;
|
return FACING_UP;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duplicate Function
|
// Duplicate Function
|
||||||
static u8 MovementEventModeCB_Normal_2(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3)
|
static u8 MovementEventModeCB_Normal_2(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
|
||||||
{
|
{
|
||||||
return gLinkPlayerFacingHandlers[a3](linkPlayerObjEvent, objEvent, a3);
|
return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3)
|
static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3)
|
static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
|
||||||
{
|
{
|
||||||
s16 x, y;
|
s16 x, y;
|
||||||
|
|
||||||
linkDirection(objEvent) = FlipVerticalAndClearForced(a3, linkDirection(objEvent));
|
linkDirection(objEvent) = FlipVerticalAndClearForced(dir, linkDirection(objEvent));
|
||||||
ObjectEventMoveDestCoords(objEvent, linkDirection(objEvent), &x, &y);
|
ObjectEventMoveDestCoords(objEvent, linkDirection(objEvent), &x, &y);
|
||||||
|
|
||||||
if (LinkPlayerDetectCollision(linkPlayerObjEvent->objEventId, linkDirection(objEvent), x, y))
|
if (LinkPlayerDetectCollision(linkPlayerObjEvent->objEventId, linkDirection(objEvent), x, y))
|
||||||
@@ -3089,9 +3089,9 @@ static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3)
|
static bool8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
|
||||||
{
|
{
|
||||||
linkDirection(objEvent) = FlipVerticalAndClearForced(a3, linkDirection(objEvent));
|
linkDirection(objEvent) = FlipVerticalAndClearForced(dir, linkDirection(objEvent));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -288,7 +288,7 @@ static void Task_RunLoopedTask_LinkMode(u8 taskId)
|
|||||||
s16 *state;
|
s16 *state;
|
||||||
u32 action;
|
u32 action;
|
||||||
|
|
||||||
if (sub_8087598())
|
if (Overworld_LinkRecvQueueLengthMoreThan2())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
task = (LoopedTask)GetWordTaskArg(taskId, 1);
|
task = (LoopedTask)GetWordTaskArg(taskId, 1);
|
||||||
|
|||||||
+3
-3
@@ -456,7 +456,7 @@ static void Task_TrainerCard(u8 taskId)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATE_WAIT_FLIP_TO_BACK:
|
case STATE_WAIT_FLIP_TO_BACK:
|
||||||
if (IsCardFlipTaskActive() && sub_8087598() != TRUE)
|
if (IsCardFlipTaskActive() && Overworld_LinkRecvQueueLengthMoreThan2() != TRUE)
|
||||||
{
|
{
|
||||||
PlaySE(SE_RG_CARD_OPEN);
|
PlaySE(SE_RG_CARD_OPEN);
|
||||||
sData->mainState = STATE_HANDLE_INPUT_BACK;
|
sData->mainState = STATE_HANDLE_INPUT_BACK;
|
||||||
@@ -513,7 +513,7 @@ static void Task_TrainerCard(u8 taskId)
|
|||||||
CloseTrainerCard(taskId);
|
CloseTrainerCard(taskId);
|
||||||
break;
|
break;
|
||||||
case STATE_WAIT_FLIP_TO_FRONT:
|
case STATE_WAIT_FLIP_TO_FRONT:
|
||||||
if (IsCardFlipTaskActive() && sub_8087598() != TRUE)
|
if (IsCardFlipTaskActive() && Overworld_LinkRecvQueueLengthMoreThan2() != TRUE)
|
||||||
{
|
{
|
||||||
sData->mainState = STATE_HANDLE_INPUT_FRONT;
|
sData->mainState = STATE_HANDLE_INPUT_FRONT;
|
||||||
PlaySE(SE_RG_CARD_OPEN);
|
PlaySE(SE_RG_CARD_OPEN);
|
||||||
@@ -1663,7 +1663,7 @@ static bool8 Task_AnimateCardFlipDown(struct Task* task)
|
|||||||
static bool8 Task_DrawFlippedCardSide(struct Task* task)
|
static bool8 Task_DrawFlippedCardSide(struct Task* task)
|
||||||
{
|
{
|
||||||
sData->allowDMACopy = FALSE;
|
sData->allowDMACopy = FALSE;
|
||||||
if (sub_8087598() == TRUE)
|
if (Overworld_LinkRecvQueueLengthMoreThan2() == TRUE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user