mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-25 03:04:15 +01:00
Incorporate feedback
This commit is contained in:
parent
eca329f9c5
commit
accea672f1
@ -4,5 +4,5 @@ gBGTilemapBuffers3
|
||||
gHeldKeyCodeToSend
|
||||
gFieldCallback
|
||||
gFieldCallback2
|
||||
LocalLinkPlayerId
|
||||
gLocalLinkPlayerId
|
||||
gFieldLinkPlayerCount
|
||||
|
@ -46,7 +46,6 @@
|
||||
],
|
||||
"coord_events": [
|
||||
{
|
||||
"comment": "This is trade seat #1.",
|
||||
"type": "trigger",
|
||||
"x": 4,
|
||||
"y": 5,
|
||||
|
@ -299,7 +299,7 @@ extern struct LinkPlayer gLocalLinkPlayer;
|
||||
|
||||
bool32 Link_AnyPartnersPlayingRubyOrSapphire(void);
|
||||
bool32 sub_800A03C(void);
|
||||
void SetLocalLinkPlayerId(u8);
|
||||
void SetgLocalLinkPlayerId(u8);
|
||||
u8 GetSavedPlayerCount(void);
|
||||
void sub_8009FAC(void);
|
||||
bool8 sub_800A4D8(u8 a0);
|
||||
|
@ -48,7 +48,7 @@ extern u16 *gBGTilemapBuffers3;
|
||||
extern u16 gHeldKeyCodeToSend;
|
||||
extern void (*gFieldCallback)(void);
|
||||
extern bool8 (*gFieldCallback2)(void);
|
||||
extern u8 LocalLinkPlayerId;
|
||||
extern u8 gLocalLinkPlayerId;
|
||||
extern u8 gFieldLinkPlayerCount;
|
||||
|
||||
// Exported ROM declarations
|
||||
|
@ -83,8 +83,8 @@ bool8 sub_8153380(void);
|
||||
bool8 sub_81533AC(void);
|
||||
u8 sub_81533E0(void);
|
||||
u8 sub_8153408(void);
|
||||
u8 FullSaveGame(void); //FullSaveGame
|
||||
bool8 CheckSaveFile(void); //CheckSaveFile
|
||||
u8 FullSaveGame(void);
|
||||
bool8 CheckSaveFile(void);
|
||||
u8 Save_LoadGameData(u8 a1);
|
||||
u16 sub_815355C(void);
|
||||
u8 sub_81534D0(u8);
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include "battle_records.h"
|
||||
#include "graphics.h"
|
||||
#include "new_game.h"
|
||||
#include "save.h"
|
||||
#include "link.h"
|
||||
|
||||
#define BLENDER_SCORE_BEST 0
|
||||
#define BLENDER_SCORE_GOOD 1
|
||||
@ -140,15 +142,8 @@ extern const u8 gText_Space[];
|
||||
extern const u8 gText_BlenderMaxSpeedRecord[];
|
||||
extern const u8 gText_234Players[];
|
||||
|
||||
extern void sub_800A418(void);
|
||||
extern u8 sub_800A9D8(void);
|
||||
extern void sub_81AABF0(void (*callback)(void));
|
||||
extern void sub_800B4C0(void);
|
||||
extern void ClearLinkCallback(void);
|
||||
extern void sub_8009F8C(void);
|
||||
extern void FullSaveGame(void);
|
||||
extern bool8 CheckSaveFile(void);
|
||||
extern void sub_80EECEC(void);
|
||||
|
||||
// this file's functions
|
||||
static void BerryBlender_SetBackgroundsPos(void);
|
||||
|
@ -352,7 +352,7 @@ static void sub_80B2918(u8 taskId)
|
||||
else
|
||||
{
|
||||
gFieldLinkPlayerCount = GetLinkPlayerCount_2();
|
||||
LocalLinkPlayerId = GetMultiplayerId();
|
||||
gLocalLinkPlayerId = GetMultiplayerId();
|
||||
sub_800AA04(gFieldLinkPlayerCount);
|
||||
card = (struct TrainerCard *)gBlockSendBuffer;
|
||||
TrainerCard_GenerateCardForPlayer(card);
|
||||
@ -399,7 +399,7 @@ static void sub_80B2A08(u8 taskId)
|
||||
else
|
||||
{
|
||||
gFieldLinkPlayerCount = GetLinkPlayerCount_2();
|
||||
LocalLinkPlayerId = GetMultiplayerId();
|
||||
gLocalLinkPlayerId = GetMultiplayerId();
|
||||
sub_800AA04(gFieldLinkPlayerCount);
|
||||
card = (struct TrainerCard *)gBlockSendBuffer;
|
||||
TrainerCard_GenerateCardForPlayer(card);
|
||||
@ -972,7 +972,7 @@ void sub_80B360C(void)
|
||||
|
||||
if (gSpecialVar_0x8004 == 1 || gSpecialVar_0x8004 == 2)
|
||||
{
|
||||
UpdatePlayerLinkBattleRecords(LocalLinkPlayerId ^ 1);
|
||||
UpdatePlayerLinkBattleRecords(gLocalLinkPlayerId ^ 1);
|
||||
if (gWirelessCommType)
|
||||
{
|
||||
switch (gBattleOutcome)
|
||||
@ -1028,7 +1028,7 @@ static void sub_80B3728(u8 taskId)
|
||||
if (IsFieldMessageBoxHidden())
|
||||
{
|
||||
sub_8087288();
|
||||
SetLocalLinkPlayerId(gSpecialVar_0x8005);
|
||||
SetgLocalLinkPlayerId(gSpecialVar_0x8005);
|
||||
task->data[0] = 2;
|
||||
}
|
||||
break;
|
||||
|
@ -302,7 +302,7 @@ void LinkTestScreen(void)
|
||||
SetMainCallback2(CB2_LinkTest);
|
||||
}
|
||||
|
||||
void SetLocalLinkPlayerId(u8 playerId)
|
||||
void SetgLocalLinkPlayerId(u8 playerId)
|
||||
{
|
||||
gLocalLinkPlayer.id = playerId;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ u16 *gBGTilemapBuffers3;
|
||||
u16 gHeldKeyCodeToSend;
|
||||
void (*gFieldCallback)(void);
|
||||
bool8 (*gFieldCallback2)(void);
|
||||
u8 LocalLinkPlayerId; // This is our player id in a multiplayer mode.
|
||||
u8 gLocalLinkPlayerId; // This is our player id in a multiplayer mode.
|
||||
u8 gFieldLinkPlayerCount;
|
||||
|
||||
// EWRAM vars
|
||||
@ -2194,13 +2194,13 @@ static void sub_8086A80(void)
|
||||
|
||||
static void SetCameraToTrackGuestPlayer(void)
|
||||
{
|
||||
InitCameraUpdateCallback(GetSpriteForLinkedPlayer(LocalLinkPlayerId));
|
||||
InitCameraUpdateCallback(GetSpriteForLinkedPlayer(gLocalLinkPlayerId));
|
||||
}
|
||||
|
||||
// Duplicate function.
|
||||
static void SetCameraToTrackGuestPlayer_2(void)
|
||||
{
|
||||
InitCameraUpdateCallback(GetSpriteForLinkedPlayer(LocalLinkPlayerId));
|
||||
InitCameraUpdateCallback(GetSpriteForLinkedPlayer(gLocalLinkPlayerId));
|
||||
}
|
||||
|
||||
static void sub_8086AE4(void)
|
||||
@ -2210,7 +2210,7 @@ static void sub_8086AE4(void)
|
||||
|
||||
// This is a hack of some kind; it's undone in sub_8086B14, which is called
|
||||
// soon after this function.
|
||||
sub_8088B3C(x + LocalLinkPlayerId, y);
|
||||
sub_8088B3C(x + gLocalLinkPlayerId, y);
|
||||
}
|
||||
|
||||
static void sub_8086B14(void)
|
||||
@ -2219,7 +2219,7 @@ static void sub_8086B14(void)
|
||||
u16 x, y;
|
||||
|
||||
GetCameraFocusCoords(&x, &y);
|
||||
x -= LocalLinkPlayerId;
|
||||
x -= gLocalLinkPlayerId;
|
||||
|
||||
for (i = 0; i < gFieldLinkPlayerCount; i++)
|
||||
{
|
||||
@ -2242,7 +2242,7 @@ static void CB1_UpdateLinkState(void)
|
||||
{
|
||||
if (gWirelessCommType == 0 || !IsRfuRecvQueueEmpty() || !IsSendingKeysToLink())
|
||||
{
|
||||
u8 selfId = LocalLinkPlayerId;
|
||||
u8 selfId = gLocalLinkPlayerId;
|
||||
UpdateAllLinkPlayers(gLinkPartnersHeldKeys, selfId);
|
||||
|
||||
// Note: Because guestId is between 0 and 4, while the smallest key code is
|
||||
@ -2296,7 +2296,7 @@ static void ResetAllTradingStates(void)
|
||||
}
|
||||
|
||||
// Returns true if all connected players are in tradingState.
|
||||
static bool32 AreAllPlayersInState(u16 tradingState)
|
||||
static bool32 AreAllPlayersInTradingState(u16 tradingState)
|
||||
{
|
||||
s32 i;
|
||||
s32 count = gFieldLinkPlayerCount;
|
||||
@ -2307,7 +2307,7 @@ static bool32 AreAllPlayersInState(u16 tradingState)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool32 AreAnyPlayersInTradingState(u16 tradingState)
|
||||
static bool32 IsAnyPlayerInTradingState(u16 tradingState)
|
||||
{
|
||||
s32 i;
|
||||
s32 count = gFieldLinkPlayerCount;
|
||||
@ -2336,7 +2336,7 @@ static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlay
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (AreAnyPlayersInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE)
|
||||
if (IsAnyPlayerInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE)
|
||||
{
|
||||
sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY;
|
||||
if (trainer->isLocalPlayer)
|
||||
@ -2629,7 +2629,7 @@ static u16 KeyInterCB_WaitForPlayersToExit(u32 keyOrPlayerId)
|
||||
// CB1_UpdateLinkState.
|
||||
if (sPlayerTradingStates[keyOrPlayerId] != PLAYER_TRADING_STATE_EXITING_ROOM)
|
||||
CheckRfuKeepAliveTimer();
|
||||
if (AreAllPlayersInState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE)
|
||||
if (AreAllPlayersInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE)
|
||||
{
|
||||
ScriptContext1_SetupScript(EventScript_DoLinkRoomExit);
|
||||
SetKeyInterceptCallback(KeyInterCB_SendNothing);
|
||||
@ -2651,20 +2651,20 @@ static u16 KeyInterCB_SendNothing_2(u32 key)
|
||||
|
||||
u32 sub_8087214(void)
|
||||
{
|
||||
if (AreAnyPlayersInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE)
|
||||
if (IsAnyPlayerInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE)
|
||||
return 2;
|
||||
if (sPlayerKeyInterceptCallback == sub_8087170 && sPlayerTradingStates[LocalLinkPlayerId] != PLAYER_TRADING_STATE_UNK_2)
|
||||
if (sPlayerKeyInterceptCallback == sub_8087170 && sPlayerTradingStates[gLocalLinkPlayerId] != PLAYER_TRADING_STATE_UNK_2)
|
||||
return 0;
|
||||
if (sPlayerKeyInterceptCallback == KeyInterCB_DoNothingAndKeepAlive && sPlayerTradingStates[LocalLinkPlayerId] == PLAYER_TRADING_STATE_BUSY)
|
||||
if (sPlayerKeyInterceptCallback == KeyInterCB_DoNothingAndKeepAlive && sPlayerTradingStates[gLocalLinkPlayerId] == PLAYER_TRADING_STATE_BUSY)
|
||||
return 2;
|
||||
if (AreAllPlayersInState(PLAYER_TRADING_STATE_UNK_2) != FALSE)
|
||||
if (AreAllPlayersInTradingState(PLAYER_TRADING_STATE_UNK_2) != FALSE)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool32 sub_808727C(void)
|
||||
{
|
||||
return AreAnyPlayersInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM);
|
||||
return IsAnyPlayerInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM);
|
||||
}
|
||||
|
||||
u16 sub_8087288(void)
|
||||
|
@ -324,7 +324,7 @@ static void Task_RecordMixing_Main(u8 taskId)
|
||||
case 0: // init
|
||||
sSentRecord = malloc(sizeof(union PlayerRecords));
|
||||
sReceivedRecords = malloc(sizeof(union PlayerRecords) * 4);
|
||||
SetLocalLinkPlayerId(gSpecialVar_0x8005);
|
||||
SetgLocalLinkPlayerId(gSpecialVar_0x8005);
|
||||
VarSet(VAR_TEMP_0, 1);
|
||||
gUnknown_03001130 = FALSE;
|
||||
PrepareExchangePacket();
|
||||
|
@ -188,7 +188,7 @@ extern u8 gUnknown_02022C3E;
|
||||
extern u16 gUnknown_02022C3C;
|
||||
extern u8 gUnknown_02022C20[];
|
||||
extern u8 gFieldLinkPlayerCount;
|
||||
extern u8 LocalLinkPlayerId;
|
||||
extern u8 gLocalLinkPlayerId;
|
||||
|
||||
// IWRAM vars
|
||||
IWRAM_DATA struct UnkStruct_Leader *gUnknown_03000DA0;
|
||||
@ -1641,7 +1641,7 @@ void sub_8014304(s8 mapGroup, s8 mapNum, s32 x, s32 y, u16 arg4)
|
||||
gSpecialVar_0x8004 = arg4;
|
||||
VarSet(VAR_0x4087, arg4);
|
||||
gFieldLinkPlayerCount = GetLinkPlayerCount();
|
||||
LocalLinkPlayerId = GetMultiplayerId();
|
||||
gLocalLinkPlayerId = GetMultiplayerId();
|
||||
SetCableClubWarp();
|
||||
SetWarpDestination(mapGroup, mapNum, -1, x, y);
|
||||
WarpIntoMap();
|
||||
|
@ -84,7 +84,7 @@ EWRAM_DATA static bool8 sSavingComplete = FALSE;
|
||||
EWRAM_DATA static u8 sSaveInfoWindowId = 0;
|
||||
|
||||
// Extern variables.
|
||||
extern u8 LocalLinkPlayerId;
|
||||
extern u8 gLocalLinkPlayerId;
|
||||
|
||||
// Extern functions in not decompiled files.
|
||||
extern void sub_80AF688(void);
|
||||
@ -734,7 +734,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void)
|
||||
{
|
||||
PlayRainSoundEffect();
|
||||
CleanupOverworldWindowsAndTilemaps();
|
||||
ShowTrainerCardInLink(LocalLinkPlayerId, CB2_ReturnToFieldWithOpenMenu);
|
||||
ShowTrainerCardInLink(gLocalLinkPlayerId, CB2_ReturnToFieldWithOpenMenu);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user