mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-03-21 17:55:13 -05:00
Renaming and small structural changes in berry_patches.c - field_comm_manager.c
This commit is contained in:
parent
9285b69211
commit
903f2a89bd
|
|
@ -60,69 +60,69 @@ typedef struct CommPlayerManager {
|
|||
} CommPlayerManager;
|
||||
|
||||
CommPlayerManager *CommPlayerMan_Get(void);
|
||||
BOOL CommPlayerMan_Init(void *param0, FieldSystem *fieldSystem, BOOL param2);
|
||||
BOOL CommPlayerMan_Init(void *dest, FieldSystem *fieldSystem, BOOL isUnderground);
|
||||
void CommPlayerMan_Reset(void);
|
||||
void CommPlayerMan_Restart(void);
|
||||
void CommPlayerMan_Delete(BOOL param0);
|
||||
void CommPlayerMan_Delete(BOOL deletePlayerData);
|
||||
void CommPlayerMan_Reinit(void);
|
||||
void CommPlayerMan_Stop(void);
|
||||
void CommPlayer_InitPersonal(void);
|
||||
void CommPlayer_CopyPersonal(int param0);
|
||||
void CommPlayer_SendXZPos(BOOL param0, int param1, int param2);
|
||||
void CommPlayer_CopyPersonal(int netJd);
|
||||
void CommPlayer_SendXZPos(BOOL param0, int x, int z);
|
||||
void CommPlayer_SendPos(BOOL param0);
|
||||
void CommPlayer_SendPosServer(BOOL param0);
|
||||
u32 CommPlayer_Size(void);
|
||||
void CommPlayer_Destroy(u8 param0, BOOL param1, BOOL param2);
|
||||
void CommPlayer_Destroy(u8 netId, BOOL param1, BOOL param2);
|
||||
BOOL sub_02057FAC(void);
|
||||
void sub_02057FC4(BOOL param0);
|
||||
void sub_02058018(int param0, int param1, void *param2, void *param3);
|
||||
void sub_02058018(int netId, int param1, void *param2, void *unused);
|
||||
void sub_0205805C(FieldSystem *fieldSystem, BOOL param1);
|
||||
BOOL CommPlayer_CheckNPCCollision(int param0, int param1);
|
||||
void CommPlayer_RecvLocation(int param0, int param1, void *param2, void *param3);
|
||||
void CommPlayer_RecvDelete(int param0, int param1, void *param2, void *param3);
|
||||
BOOL CommPlayer_CheckNPCCollision(int x, int z);
|
||||
void CommPlayer_RecvLocation(int netId, int unused0, void *src, void *unused1);
|
||||
void CommPlayer_RecvDelete(int unused0, int unused1, void *src, void *unused2);
|
||||
int CommPacketSizeOf_RecvLocation(void);
|
||||
void CommPlayer_RecvLocationAndInit(int param0, int param1, void *param2, void *param3);
|
||||
void sub_02058B0C(int param0, int param1, BOOL param2);
|
||||
void sub_02058B7C(int param0);
|
||||
void sub_02058B94(int param0);
|
||||
void CommPlayer_StartBlowAnimation(int param0, int param1, BOOL param2);
|
||||
void CommPlayer_StopBlowAnimation(int param0);
|
||||
void CommPlayer_RecvLocationAndInit(int netId, int size, void *src, void *unused);
|
||||
void sub_02058B0C(int netId, int param1, BOOL param2);
|
||||
void sub_02058B7C(int netId);
|
||||
void sub_02058B94(int netId);
|
||||
void CommPlayer_StartBlowAnimation(int netId, int param1, BOOL unused);
|
||||
void CommPlayer_StopBlowAnimation(int netId);
|
||||
int CommPacketSizeOf_RecvLocationAndInit(void);
|
||||
BOOL sub_02058C40(void);
|
||||
BOOL CommPlayer_IsActive(int param0);
|
||||
int CommPlayer_XPos(int param0);
|
||||
int CommPlayer_ZPos(int param0);
|
||||
int sub_02058D48(int param0);
|
||||
int sub_02058D68(int param0);
|
||||
int sub_02058D88(int param0);
|
||||
int sub_02058DC0(int param0);
|
||||
int CommPlayer_GetXServer(int param0);
|
||||
int CommPlayer_GetZServer(int param0);
|
||||
int sub_02058EA0(int param0);
|
||||
int sub_02058EC0(int param0);
|
||||
int CommPlayer_AddXServer(int param0);
|
||||
int CommPlayer_AddZServer(int param0);
|
||||
int CommPlayer_Dir(int param0);
|
||||
int CommPlayer_DirServer(int param0);
|
||||
void CommPlayer_LookTowardsServer(int param0, int param1);
|
||||
void CommPlayer_LookTowards(int param0, int param1);
|
||||
int sub_0205900C(int param0, int param1);
|
||||
void sub_02059058(int param0, BOOL param1);
|
||||
BOOL sub_02059094(int param0);
|
||||
BOOL CommPlayer_IsActive(int netId);
|
||||
int CommPlayer_XPos(int netId);
|
||||
int CommPlayer_ZPos(int netId);
|
||||
int sub_02058D48(int netId);
|
||||
int sub_02058D68(int netId);
|
||||
int sub_02058D88(int netId);
|
||||
int sub_02058DC0(int netId);
|
||||
int CommPlayer_GetXServer(int netId);
|
||||
int CommPlayer_GetZServer(int netId);
|
||||
int sub_02058EA0(int netId);
|
||||
int sub_02058EC0(int netId);
|
||||
int CommPlayer_AddXServer(int netId);
|
||||
int CommPlayer_AddZServer(int netId);
|
||||
int CommPlayer_Dir(int netId);
|
||||
int CommPlayer_DirServer(int netId);
|
||||
void CommPlayer_LookTowardsServer(int netIdTarget, int netIdSet);
|
||||
void CommPlayer_LookTowards(int netIdTarget, int netIdSet);
|
||||
int sub_0205900C(int xPos, int yPos);
|
||||
void sub_02059058(int netId, BOOL param1);
|
||||
BOOL sub_02059094(int netId);
|
||||
BOOL sub_020590C4(void);
|
||||
void sub_02059180(int param0, int param1, void *param2, void *param3);
|
||||
void sub_02059180(int netId, int unused0, void *src, void *unused3);
|
||||
void CommPlayer_SetBattleDir(void);
|
||||
BOOL sub_0205928C(void);
|
||||
int CommPlayer_GetOppositeDir(int param0);
|
||||
void sub_02059354(int param0, int param1);
|
||||
void sub_02059378(int param0);
|
||||
void sub_02059390(int param0, int param1);
|
||||
void sub_020593B4(int param0);
|
||||
int CommPlayer_GetMovementTimer(int param0);
|
||||
int CommPlayer_GetMovementTimerServer(int param0);
|
||||
void CommPlayer_SetDir(int param0);
|
||||
void CommPlayer_SetDirClient(int param0, int param1);
|
||||
int CommPlayer_DirClient(int param0);
|
||||
int CommPlayer_GetOppositeDir(int dir);
|
||||
void sub_02059354(int netId, int param1);
|
||||
void sub_02059378(int netId);
|
||||
void sub_02059390(int netId, int param1);
|
||||
void sub_020593B4(int netId);
|
||||
int CommPlayer_GetMovementTimer(int netId);
|
||||
int CommPlayer_GetMovementTimerServer(int netId);
|
||||
void CommPlayer_SetDir(int dir);
|
||||
void CommPlayer_SetDirClient(int netId, int dir);
|
||||
int CommPlayer_DirClient(int netId);
|
||||
void sub_02059464(int param0);
|
||||
void sub_0205948C(int param0);
|
||||
void sub_020594EC(void);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef POKEPLATINUM_UNK_02032188_H
|
||||
#define POKEPLATINUM_UNK_02032188_H
|
||||
#ifndef POKEPLATINUM_COMM_RING_H
|
||||
#define POKEPLATINUM_COMM_RING_H
|
||||
|
||||
typedef struct {
|
||||
u8 *buffer;
|
||||
|
|
@ -9,13 +9,13 @@ typedef struct {
|
|||
s16 size;
|
||||
} CommRing;
|
||||
|
||||
void CommRing_Init(CommRing *ring, u8 *param1, int param2);
|
||||
void CommRring_Write(CommRing *ring, u8 *param1, int param2, int param3);
|
||||
int CommRing_Read(CommRing *ring, u8 *param1, int param2);
|
||||
void CommRing_Init(CommRing *ring, u8 *buffer, int size);
|
||||
void CommRring_Write(CommRing *ring, u8 *buffer, int size, int unused);
|
||||
int CommRing_Read(CommRing *ring, u8 *buffer, int size);
|
||||
u8 CommRing_ReadByte(CommRing *ring);
|
||||
int CommRing_Peek(CommRing *ring, u8 *param1, int param2);
|
||||
int CommRing_Peek(CommRing *ring, u8 *buffer, int size);
|
||||
int CommRing_DataSize(CommRing *ring);
|
||||
int CommRing_RemainingSize(CommRing *ring);
|
||||
void CommRing_UpdateEndPos(CommRing *ring);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_02032188_H
|
||||
#endif // POKEPLATINUM_COMM_RING_H
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ void CommInfo_Delete(void);
|
|||
BOOL CommInfo_IsInitialized(void);
|
||||
void CommInfo_SendBattleRegulation(void);
|
||||
int CommPlayerInfo_Size(void);
|
||||
void CommunicatitonInformaion_FinishReading(int param0, int param1, void *param2, void *param3);
|
||||
void CommunicatitonInformaion_FinishReading(int unused0, int unused1, void *unused2, void *unused3);
|
||||
BOOL CommInfo_IsDataFinishedReading(void);
|
||||
void CommInfo_RecvPlayerDataArray(int netId, int unused1, void *src, void *unused3);
|
||||
void CommInfo_RecvPlayerData(int netId, int unused1, void *src, void *unused3);
|
||||
|
|
|
|||
|
|
@ -17,18 +17,18 @@ void CommSys_Reset(void);
|
|||
void CommSys_ResetDS(void);
|
||||
void CommSys_ResetBattleClient(void);
|
||||
void sub_0203509C(u16 param0, u16 *param1, u16 param2);
|
||||
void sub_020351F8(u16 param0, u16 *param1, u16 param2);
|
||||
void sub_020351F8(u16 param0, u16 *buffer, u16 param2);
|
||||
void sub_020352C0(u16 param0, u16 *param1, u16 param2);
|
||||
void sub_02035664(void);
|
||||
void sub_02035678(void);
|
||||
void sub_0203568C(void);
|
||||
void sub_0203572C(void);
|
||||
void sub_02035938(u8 param0);
|
||||
BOOL CommSys_SendDataHuge(int param0, const void *param1, int param2);
|
||||
BOOL CommSys_SendData(int param0, const void *param1, int param2);
|
||||
BOOL sub_02035A3C(int param0, const void *param1, int param2);
|
||||
BOOL CommSys_SendDataServer(int param0, const void *param1, int param2);
|
||||
BOOL sub_02035B48(int param0, const void *param1);
|
||||
BOOL CommSys_SendDataHuge(int cmd, const void *data, int param2);
|
||||
BOOL CommSys_SendData(int cmd, const void *data, int param2);
|
||||
BOOL sub_02035A3C(int cmd, const void *data, int param2);
|
||||
BOOL CommSys_SendDataServer(int cmd, const void *data, int param2);
|
||||
BOOL sub_02035B48(int cmd, const void *data);
|
||||
int CommSys_SendRingRemainingSize(void);
|
||||
BOOL CommSys_IsPlayerConnected(u16 param0);
|
||||
int CommSys_ConnectedCount(void);
|
||||
|
|
@ -39,14 +39,14 @@ u16 sub_02035E84(int param0);
|
|||
void CommSys_EnableSendMovementData(void);
|
||||
void CommSys_DisableSendMovementData(void);
|
||||
BOOL CommSys_IsSendingMovementData(void);
|
||||
BOOL CommSys_WriteToQueueServer(int param0, const void *param1, int param2);
|
||||
BOOL CommSys_WriteToQueue(int param0, const void *param1, int param2);
|
||||
void sub_02036008(int param0, int param1, void *param2, void *param3);
|
||||
void sub_02036030(int param0, int param1, void *param2, void *param3);
|
||||
void sub_02036058(int param0, int param1, void *param2, void *param3);
|
||||
BOOL CommSys_WriteToQueueServer(int cmd, const void *data, int param2);
|
||||
BOOL CommSys_WriteToQueue(int cmd, const void *data, int param2);
|
||||
void sub_02036008(int unused0, int unused1, void *param2, void *unused3);
|
||||
void sub_02036030(int unused0, int unused1, void *param2, void *unused3);
|
||||
void sub_02036058(int unused0, int unused1, void *param2, void *unused3);
|
||||
u16 CommSys_CurNetId(void);
|
||||
BOOL CommSys_SendDataFixedSize(int param0, const void *param1);
|
||||
BOOL Link_Message(int param0);
|
||||
BOOL CommSys_SendDataFixedSize(int cmd, const void *data);
|
||||
BOOL Link_Message(int cmd);
|
||||
BOOL sub_020360E8(void);
|
||||
BOOL CommSys_CheckError(void);
|
||||
u16 sub_02036128(u16 param0);
|
||||
|
|
@ -63,7 +63,7 @@ BOOL sub_0203629C(void);
|
|||
void CommSys_SetWifiConnected(BOOL param0);
|
||||
BOOL CommSys_WifiConnected(void);
|
||||
void sub_020362DC(int param0, int param1);
|
||||
int sub_020362F4(int param0);
|
||||
int sub_020362F4(int networkId);
|
||||
BOOL sub_02036314(void);
|
||||
void sub_0203632C(BOOL param0);
|
||||
void sub_02036378(BOOL param0);
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@ void FieldCommMan_ReconnectBattleClient(void);
|
|||
void FieldCommMan_EnterBattleRoom(FieldSystem *fieldSystem);
|
||||
void FieldCommMan_EndBattle(void);
|
||||
void sub_020598A0(void);
|
||||
void sub_02059D0C(int param0, int param1, void *param2, void *param3);
|
||||
void sub_02059D0C(int unused0, int unused1, void *param2, void *unused3);
|
||||
BOOL sub_02059D2C(void);
|
||||
void sub_02059EAC(int param0, int param1, void *param2, void *param3);
|
||||
u8 *sub_02059EBC(int param0, void *param1, int param2);
|
||||
UnkStruct_02029894 *sub_0205A080(SaveData *param0);
|
||||
void sub_02059EAC(int param0, int unused1, void *unused2, void *unused3);
|
||||
u8 *sub_02059EBC(int param0, void *unused1, int unused2);
|
||||
UnkStruct_02029894 *sub_0205A080(SaveData *saveData);
|
||||
void sub_0205A0A0(void);
|
||||
void sub_0205A0BC(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,7 @@ BerryGrowthData *BerryGrowthData_Init(enum HeapId heapID)
|
|||
{
|
||||
BerryGrowthData *growthData;
|
||||
BerryData *berryData;
|
||||
NARC *narc;
|
||||
|
||||
narc = BerryData_NARC_ctor(heapID);
|
||||
NARC *narc = BerryData_NARC_ctor(heapID);
|
||||
growthData = Heap_AllocFromHeap(heapID, sizeof(BerryGrowthData) * NUM_BERRIES);
|
||||
|
||||
for (int i = 0; i < NUM_BERRIES; i++) {
|
||||
|
|
|
|||
|
|
@ -1840,13 +1840,12 @@ static void ClearWindowTilemapText(Window *window)
|
|||
return;
|
||||
}
|
||||
|
||||
u32 x, y, tilemapRight, tilemapBottom, idx, tilemapWidth;
|
||||
u16 *tilemap;
|
||||
u32 x, y, tilemapBottom, idx;
|
||||
u32 tilemapWidth = sScreenSizeToTilemapWidth[window->bgConfig->bgs[window->bgLayer].screenSize];
|
||||
u16 *tilemap = window->bgConfig->bgs[window->bgLayer].tilemapBuffer;
|
||||
u32 tilemapRight = window->tilemapLeft + window->width;
|
||||
|
||||
tilemapWidth = sScreenSizeToTilemapWidth[window->bgConfig->bgs[window->bgLayer].screenSize];
|
||||
tilemap = window->bgConfig->bgs[window->bgLayer].tilemapBuffer;
|
||||
tilemapRight = window->tilemapLeft + window->width;
|
||||
tilemapBottom = window->tilemapTop + window->height;
|
||||
tilemapBottom = window->tilemapTop + window->height; // required this way to match
|
||||
|
||||
for (y = window->tilemapTop; y < tilemapBottom; y++) {
|
||||
for (x = window->tilemapLeft; x < tilemapRight; x++) {
|
||||
|
|
@ -1862,11 +1861,8 @@ static void ClearWindowTilemapAffine(Window *window)
|
|||
return;
|
||||
}
|
||||
|
||||
int x, y, tilemapWidth;
|
||||
u8 *tilemap;
|
||||
|
||||
tilemapWidth = sScreenSizeToTilemapWidth[window->bgConfig->bgs[window->bgLayer].screenSize];
|
||||
tilemap = (u8 *)(window->bgConfig->bgs[window->bgLayer].tilemapBuffer) + window->tilemapTop * tilemapWidth + window->tilemapLeft;
|
||||
int x, y, tilemapWidth = sScreenSizeToTilemapWidth[window->bgConfig->bgs[window->bgLayer].screenSize];
|
||||
u8 *tilemap = (u8 *)(window->bgConfig->bgs[window->bgLayer].tilemapBuffer) + window->tilemapTop * tilemapWidth + window->tilemapLeft;
|
||||
|
||||
for (y = 0; y < window->height; y++) {
|
||||
for (x = 0; x < window->width; x++) {
|
||||
|
|
@ -2118,15 +2114,11 @@ void Window_FillRectWithColor(Window *window, u8 color, u16 x, u16 y, u16 width,
|
|||
|
||||
void Window_CopyGlyph(Window *window, const u8 *glyphPixels, u16 srcWidth, u16 srcHeight, u16 destX, u16 destY, u16 table)
|
||||
{
|
||||
u8 *windowPixels;
|
||||
u16 destWidth, destHeight;
|
||||
u8 *windowPixels = window->pixels;
|
||||
u16 destWidth = window->width * 8, destHeight = window->height * 8;
|
||||
int srcRight, srcBottom;
|
||||
u8 glyphSizeParam;
|
||||
|
||||
windowPixels = window->pixels;
|
||||
destWidth = window->width * 8;
|
||||
destHeight = window->height * 8;
|
||||
|
||||
if (destWidth - destX < srcWidth) {
|
||||
srcRight = destWidth - destX;
|
||||
} else {
|
||||
|
|
@ -2208,17 +2200,13 @@ void Window_Scroll(Window *window, u8 direction, u8 distance, u8 fillVal)
|
|||
|
||||
static void ScrollWindow4bpp(Window *window, u8 direction, u8 distance, u8 fillVal)
|
||||
{
|
||||
u8 *pixels;
|
||||
u8 *pixels = window->pixels;
|
||||
int y0, y1, y2;
|
||||
int fill, size;
|
||||
u32 width;
|
||||
int fill = (fillVal << 24) | (fillVal << 16) | (fillVal << 8) | (fillVal << 0);
|
||||
int size = window->height * window->width * TILE_SIZE_4BPP;
|
||||
u32 width = window->width;
|
||||
int i, j;
|
||||
|
||||
pixels = window->pixels;
|
||||
fill = (fillVal << 24) | (fillVal << 16) | (fillVal << 8) | (fillVal << 0);
|
||||
size = window->height * window->width * TILE_SIZE_4BPP;
|
||||
width = window->width;
|
||||
|
||||
switch (direction) {
|
||||
case SCROLL_DIRECTION_UP:
|
||||
for (i = 0; i < size; i += TILE_SIZE_4BPP) {
|
||||
|
|
@ -2269,17 +2257,13 @@ static void ScrollWindow4bpp(Window *window, u8 direction, u8 distance, u8 fillV
|
|||
|
||||
static void ScrollWindow8bpp(Window *window, u8 direction, u8 distance, u8 fillVal)
|
||||
{
|
||||
u8 *pixels;
|
||||
u8 *pixels = window->pixels;
|
||||
int y0, y1, y2;
|
||||
int fill, size;
|
||||
u32 width;
|
||||
int fill = (fillVal << 24) | (fillVal << 16) | (fillVal << 8) | fillVal;
|
||||
int size = window->height * window->width * TILE_SIZE_8BPP;
|
||||
u32 width = window->width;
|
||||
int i, j;
|
||||
|
||||
pixels = window->pixels;
|
||||
fill = (fillVal << 24) | (fillVal << 16) | (fillVal << 8) | fillVal;
|
||||
size = window->height * window->width * TILE_SIZE_8BPP;
|
||||
width = window->width;
|
||||
|
||||
switch (direction) {
|
||||
case SCROLL_DIRECTION_UP:
|
||||
for (i = 0; i < size; i += TILE_SIZE_8BPP) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "field_system.h"
|
||||
#include "game_records.h"
|
||||
#include "heap.h"
|
||||
#include "location.h"
|
||||
#include "map_header_data.h"
|
||||
#include "map_object.h"
|
||||
#include "map_object_move.h"
|
||||
|
|
@ -48,15 +49,15 @@
|
|||
#include "unk_0206CCB0.h"
|
||||
|
||||
static int sub_020581CC(int param0, int param1);
|
||||
static BOOL CommPlayer_MoveBlow(int param0, int param1);
|
||||
static BOOL CommPlayer_BlowAnimation(int param0, int param1, int param2, int param3);
|
||||
static void CommPlayer_SendDataTask(void *param0);
|
||||
static void sub_02057C2C(void *param0);
|
||||
static void CommPlayer_Add(u8 param0);
|
||||
static void CommPlayer_Move(SysTask *param0, void *param1);
|
||||
static void Task_CommPlayerManagerRun(SysTask *param0, void *param1);
|
||||
static void sub_02057EF8(void *param0);
|
||||
static void CommPlayer_MoveClient(int param0);
|
||||
static BOOL CommPlayer_MoveBlow(int netId, int param1);
|
||||
static BOOL CommPlayer_BlowAnimation(int netId, int param1, int unused, int animSpeed);
|
||||
static void CommPlayer_SendDataTask(void *data);
|
||||
static void sub_02057C2C(void *data);
|
||||
static void CommPlayer_Add(u8 netId);
|
||||
static void CommPlayer_Move(SysTask *unused0, void *unused1);
|
||||
static void Task_CommPlayerManagerRun(SysTask *task, void *data);
|
||||
static void sub_02057EF8(void *unused);
|
||||
static void CommPlayer_MoveClient(int netId);
|
||||
static void sub_020591A8(void);
|
||||
|
||||
static CommPlayerManager *sCommPlayerManager = NULL;
|
||||
|
|
@ -509,7 +510,7 @@ static void Task_CommPlayerManagerRun(SysTask *task, void *data)
|
|||
}
|
||||
}
|
||||
|
||||
static void sub_02057EF8(void *param0)
|
||||
static void sub_02057EF8(void *unused)
|
||||
{
|
||||
for (int netId = 0; netId < MAX_CONNECTED_PLAYERS; netId++) {
|
||||
if (!CommSys_IsPlayerConnected(netId)) {
|
||||
|
|
@ -568,7 +569,7 @@ static void sub_02057FF0(BOOL param0)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_02058018(int netId, int param1, void *param2, void *param3)
|
||||
void sub_02058018(int netId, int param1, void *param2, void *unused)
|
||||
{
|
||||
u8 *buffer = (u8 *)param2;
|
||||
|
||||
|
|
@ -630,11 +631,8 @@ static int CommPlayer_Direction(u16 unused, u16 keys)
|
|||
|
||||
BOOL CommPlayer_CheckNPCCollision(int x, int z)
|
||||
{
|
||||
int npcCnt, i;
|
||||
const ObjectEvent *npcList;
|
||||
|
||||
npcCnt = MapHeaderData_GetNumObjectEvents(sCommPlayerManager->fieldSystem);
|
||||
npcList = MapHeaderData_GetObjectEvents(sCommPlayerManager->fieldSystem);
|
||||
int npcCnt = MapHeaderData_GetNumObjectEvents(sCommPlayerManager->fieldSystem), i;
|
||||
const ObjectEvent *npcList = MapHeaderData_GetObjectEvents(sCommPlayerManager->fieldSystem);
|
||||
|
||||
for (i = 0; i < npcCnt; i++) {
|
||||
if ((npcList[i].x == x) && (npcList[i].z == z)) {
|
||||
|
|
@ -691,7 +689,7 @@ static int sub_020581E0(int param0)
|
|||
return v0[param0];
|
||||
}
|
||||
|
||||
static void CommPlayer_Move(SysTask *param0, void *param1)
|
||||
static void CommPlayer_Move(SysTask *unused0, void *unused1)
|
||||
{
|
||||
u16 keys;
|
||||
int dir, x, z, netId, v6;
|
||||
|
|
@ -814,7 +812,7 @@ static void CommPlayer_Move(SysTask *param0, void *param1)
|
|||
}
|
||||
}
|
||||
|
||||
void CommPlayer_RecvLocation(int netId, int param1, void *src, void *param3)
|
||||
void CommPlayer_RecvLocation(int netId, int unused0, void *src, void *unused1)
|
||||
{
|
||||
u8 *buffer = (u8 *)src;
|
||||
CommPlayerLocation *playerLocation;
|
||||
|
|
@ -854,7 +852,7 @@ void CommPlayer_RecvLocation(int netId, int param1, void *src, void *param3)
|
|||
}
|
||||
}
|
||||
|
||||
void CommPlayer_RecvDelete(int unused0, int unused2, void *src, void *param3)
|
||||
void CommPlayer_RecvDelete(int unused0, int unused1, void *src, void *unused2)
|
||||
{
|
||||
u8 *buffer = (u8 *)src;
|
||||
u8 netId = buffer[0];
|
||||
|
|
@ -888,9 +886,7 @@ void CommPlayer_RecvLocationAndInit(int netId, int size, void *src, void *unused
|
|||
{
|
||||
u8 *buffer = (u8 *)src;
|
||||
CommPlayerLocation *playerLocation;
|
||||
int netJd;
|
||||
|
||||
netJd = buffer[0] & 0xf;
|
||||
int netJd = buffer[0] & 0xf;
|
||||
|
||||
if (sCommPlayerManager == NULL) {
|
||||
return;
|
||||
|
|
@ -936,7 +932,7 @@ static void sub_02058644(int netId)
|
|||
}
|
||||
}
|
||||
|
||||
static BOOL CommPlayer_BlowAnimation(int netId, int param1, int param2, int animSpeed)
|
||||
static BOOL CommPlayer_BlowAnimation(int netId, int param1, int unused, int animSpeed)
|
||||
{
|
||||
MapObject *obj;
|
||||
u8 walkAnimationCode[] = {
|
||||
|
|
@ -983,12 +979,10 @@ static BOOL CommPlayer_BlowAnimation(int netId, int param1, int param2, int anim
|
|||
static void CommPlayer_MoveClient(int netId)
|
||||
{
|
||||
u16 pad = 0;
|
||||
CommPlayerLocation *playerLocation;
|
||||
CommPlayerLocation *playerLocation = &sCommPlayerManager->playerLocation[netId];
|
||||
PlayerAvatar *playerAvatar;
|
||||
int moveSpeed;
|
||||
|
||||
playerLocation = &sCommPlayerManager->playerLocation[netId];
|
||||
|
||||
if (sCommPlayerManager->moveTimer[netId] != 0) {
|
||||
sCommPlayerManager->moveTimer[netId]--;
|
||||
return;
|
||||
|
|
@ -1199,7 +1193,7 @@ void sub_02058B94(int netId)
|
|||
sCommPlayerManager->unk_10A[netId] = 0xff;
|
||||
}
|
||||
|
||||
void CommPlayer_StartBlowAnimation(int netId, int param1, BOOL param2)
|
||||
void CommPlayer_StartBlowAnimation(int netId, int param1, BOOL unused)
|
||||
{
|
||||
MapObject *obj;
|
||||
|
||||
|
|
@ -1514,7 +1508,7 @@ BOOL sub_020590C4(void)
|
|||
return v8;
|
||||
}
|
||||
|
||||
void sub_02059180(int netId, int unused1, void *src, void *unused3)
|
||||
void sub_02059180(int netId, int unused0, void *src, void *unused3)
|
||||
{
|
||||
u8 *buffer = src;
|
||||
|
||||
|
|
@ -1609,18 +1603,18 @@ BOOL sub_0205928C(void)
|
|||
|
||||
int CommPlayer_GetOppositeDir(int dir)
|
||||
{
|
||||
if (dir == 0) {
|
||||
return 1;
|
||||
} else if (dir == 1) {
|
||||
return 0;
|
||||
} else if (dir == 2) {
|
||||
return 3;
|
||||
} else if (dir == 3) {
|
||||
return 2;
|
||||
if (dir == FACE_UP) {
|
||||
return FACE_DOWN;
|
||||
} else if (dir == FACE_DOWN) {
|
||||
return FACE_UP;
|
||||
} else if (dir == FACE_LEFT) {
|
||||
return FACE_RIGHT;
|
||||
} else if (dir == FACE_RIGHT) {
|
||||
return FACE_LEFT;
|
||||
}
|
||||
|
||||
GF_ASSERT(FALSE);
|
||||
return 2;
|
||||
return FACE_LEFT;
|
||||
}
|
||||
|
||||
void sub_02059354(int netId, int param1)
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ int CommPlayerInfo_Size(void)
|
|||
return sizeof(CommPlayerInfo);
|
||||
}
|
||||
|
||||
void CommunicatitonInformaion_FinishReading(int param0, int param1, void *param2, void *param3)
|
||||
void CommunicatitonInformaion_FinishReading(int unused0, int unused1, void *unused2, void *unused3)
|
||||
{
|
||||
if (sCommInfo) {
|
||||
sCommInfo->dataFinishedReading = TRUE;
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ static BOOL CommSys_Init(BOOL shouldAlloc, int maxPacketSize)
|
|||
int maxMachines = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
|
||||
if (sCommunicationSystem != NULL) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
CommTool_Init(HEAP_ID_COMMUNICATION);
|
||||
|
|
@ -300,13 +300,11 @@ static void CommSys_ClearServerRecvData(int netId)
|
|||
sCommunicationSystem->unk_697[netId] = 1;
|
||||
sCommunicationSystem->unk_664[netId] = 0;
|
||||
|
||||
{
|
||||
int v0 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
int v1 = sCommunicationSystem->allocSize / v0;
|
||||
int v0 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
int v1 = sCommunicationSystem->allocSize / v0;
|
||||
|
||||
CommRing_Init(&sCommunicationSystem->unk_4B0[netId], &sCommunicationSystem->unk_488[netId * v1], v1);
|
||||
CommRing_Init(&sCommunicationSystem->sendRingClient[netId], &sCommunicationSystem->recvBufferRingServer[netId * v1], v1);
|
||||
}
|
||||
CommRing_Init(&sCommunicationSystem->unk_4B0[netId], &sCommunicationSystem->unk_488[netId * v1], v1);
|
||||
CommRing_Init(&sCommunicationSystem->sendRingClient[netId], &sCommunicationSystem->recvBufferRingServer[netId * v1], v1);
|
||||
|
||||
sCommunicationSystem->commRecvServer[netId].unk_0A = 0xee;
|
||||
sCommunicationSystem->commRecvServer[netId].unk_08 = 0xffff;
|
||||
|
|
@ -334,7 +332,7 @@ static void sub_02034770(int param0)
|
|||
|
||||
BOOL CommSys_InitServer(BOOL param0, BOOL param1, int param2, BOOL param3)
|
||||
{
|
||||
BOOL ret = 1;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
if (!CommLocal_IsWifiGroup(sub_0203895C())) {
|
||||
ret = CommServerClient_InitServer(param0, param1, param3);
|
||||
|
|
@ -347,7 +345,7 @@ BOOL CommSys_InitServer(BOOL param0, BOOL param1, int param2, BOOL param3)
|
|||
|
||||
BOOL CommSys_InitClient(BOOL param0, BOOL param1, int param2)
|
||||
{
|
||||
BOOL v0 = 1;
|
||||
BOOL v0 = TRUE;
|
||||
|
||||
if (!CommLocal_IsWifiGroup(sub_0203895C())) {
|
||||
v0 = CommServerClient_InitClient(param0, param1);
|
||||
|
|
@ -437,7 +435,7 @@ BOOL CommSys_TransitionTypeIsParallel(void)
|
|||
|
||||
void CommSys_Delete(void)
|
||||
{
|
||||
BOOL v0 = 0;
|
||||
BOOL v0 = FALSE;
|
||||
|
||||
if (sCommunicationSystem) {
|
||||
if (CommLocal_IsWifiGroup(sub_0203895C())) {
|
||||
|
|
@ -689,41 +687,40 @@ static BOOL sub_02034CF8(int param0)
|
|||
{
|
||||
int v0;
|
||||
int v1;
|
||||
int v2, v3, v4 = 0;
|
||||
int i, v3, v4 = 0;
|
||||
|
||||
v0 = sub_02036128(sub_0203895C());
|
||||
v1 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
|
||||
for (v2 = 0; v2 < v1; v2++) {
|
||||
CommRing_UpdateEndPos(&sCommunicationSystem->unk_4B0[v2]);
|
||||
for (i = 0; i < v1; i++) {
|
||||
CommRing_UpdateEndPos(&sCommunicationSystem->unk_4B0[i]);
|
||||
|
||||
if (CommSys_IsPlayerConnected(v2)) {
|
||||
sCommunicationSystem->sendBufferServer[param0][v2 * v0] = 0xe;
|
||||
if (CommSys_IsPlayerConnected(i)) {
|
||||
sCommunicationSystem->sendBufferServer[param0][i * v0] = 0xe;
|
||||
} else {
|
||||
sCommunicationSystem->sendBufferServer[param0][v2 * v0] = 0xff;
|
||||
sCommunicationSystem->sendBufferServer[param0][i * v0] = 0xff;
|
||||
v4++;
|
||||
continue;
|
||||
}
|
||||
|
||||
v3 = CommRing_Read(&sCommunicationSystem->unk_4B0[v2], &sCommunicationSystem->sendBufferServer[param0][v2 * v0], v0);
|
||||
v3 = CommRing_Read(&sCommunicationSystem->unk_4B0[i], &sCommunicationSystem->sendBufferServer[param0][i * v0], v0);
|
||||
|
||||
if (sCommunicationSystem->sendBufferServer[param0][v2 * v0] == 0xe) {
|
||||
if (sCommunicationSystem->sendBufferServer[param0][i * v0] == 0xe) {
|
||||
v4++;
|
||||
}
|
||||
}
|
||||
|
||||
if (v4 == v1) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void CommSys_UpdateServerClient(void)
|
||||
{
|
||||
int v0;
|
||||
int v0, v2, v3;
|
||||
int v1 = 0;
|
||||
int v2, v3;
|
||||
|
||||
if (!sCommunicationSystem) {
|
||||
return;
|
||||
|
|
@ -775,23 +772,23 @@ static void CommSys_UpdateServerClient(void)
|
|||
|
||||
static BOOL CommSys_CheckRecvLimit(void)
|
||||
{
|
||||
int v0;
|
||||
int i;
|
||||
int v1 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
|
||||
for (v0 = 1; v0 < v1; v0++) {
|
||||
if (CommSys_IsPlayerConnected(v0)) {
|
||||
if (sCommunicationSystem->unk_664[v0] > 3) {
|
||||
return 0;
|
||||
for (i = 1; i < v1; i++) {
|
||||
if (CommSys_IsPlayerConnected(i)) {
|
||||
if (sCommunicationSystem->unk_664[i] > 3) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void sub_02034F68(void)
|
||||
{
|
||||
int v0;
|
||||
int i;
|
||||
int v1 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
|
||||
if (CommLocal_IsWifiGroup(sub_0203895C())) {
|
||||
|
|
@ -823,9 +820,9 @@ static void sub_02034F68(void)
|
|||
if (ov4_021D14D4(sCommunicationSystem->sendBufferServer[0], 192)) {
|
||||
Unk_02100A1C = 4;
|
||||
|
||||
for (v0 = 0; v0 < v1; v0++) {
|
||||
if (CommSys_IsPlayerConnected(v0)) {
|
||||
sCommunicationSystem->unk_664[v0]++;
|
||||
for (i = 0; i < v1; i++) {
|
||||
if (CommSys_IsPlayerConnected(i)) {
|
||||
sCommunicationSystem->unk_664[i]++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -860,7 +857,7 @@ void sub_0203509C(u16 param0, u16 *param1, u16 param2)
|
|||
static void sub_020350A4(u16 param0, u16 *param1, u16 param2)
|
||||
{
|
||||
u8 *v0 = (u8 *)param1;
|
||||
int v1;
|
||||
int i;
|
||||
int v2 = param2;
|
||||
|
||||
sCommunicationSystem->unk_660--;
|
||||
|
|
@ -890,24 +887,24 @@ static void sub_020350A4(u16 param0, u16 *param1, u16 param2)
|
|||
int v3 = sub_02036128(sub_0203895C());
|
||||
int v4 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
|
||||
for (v1 = 0; v1 < v4; v1++) {
|
||||
for (i = 0; i < v4; i++) {
|
||||
if (v0[0] == 0xff) {
|
||||
sCommunicationSystem->unk_68C = sCommunicationSystem->unk_68C & ~(1 << v1);
|
||||
sCommunicationSystem->unk_68C = sCommunicationSystem->unk_68C & ~(1 << i);
|
||||
} else {
|
||||
sCommunicationSystem->unk_68C = sCommunicationSystem->unk_68C | (1 << v1);
|
||||
sCommunicationSystem->unk_68C = sCommunicationSystem->unk_68C | (1 << i);
|
||||
}
|
||||
|
||||
if (v0[0] == 0xff) {
|
||||
v0 += v3;
|
||||
} else if (v0[0] == 0xe) {
|
||||
v0 += v3;
|
||||
} else if ((sCommunicationSystem->unk_697[v1]) && (v0[0] & 0x1)) {
|
||||
} else if ((sCommunicationSystem->unk_697[i]) && (v0[0] & 0x1)) {
|
||||
v0 += v3;
|
||||
} else {
|
||||
v0++;
|
||||
CommRring_Write(&sCommunicationSystem->sendRingClient[v1], v0, v3 - 1, 1360 + v1);
|
||||
CommRring_Write(&sCommunicationSystem->sendRingClient[i], v0, v3 - 1, 1360 + i);
|
||||
v0 += (v3 - 1);
|
||||
sCommunicationSystem->unk_697[v1] = 0;
|
||||
sCommunicationSystem->unk_697[i] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1035,10 +1032,6 @@ static void sub_020353B0(BOOL param0)
|
|||
|
||||
static void sub_020353CC(void)
|
||||
{
|
||||
u16 v0;
|
||||
u8 *v1;
|
||||
int v2;
|
||||
|
||||
if (!sCommunicationSystem) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1172,7 +1165,6 @@ void sub_0203568C(void)
|
|||
|
||||
static BOOL sub_020356A0(u8 *param0, int param1)
|
||||
{
|
||||
int v0;
|
||||
u8 v1[2];
|
||||
|
||||
sCommunicationSystem->unk_63C[param1] = 0;
|
||||
|
|
@ -1193,7 +1185,7 @@ static BOOL sub_020356A0(u8 *param0, int param1)
|
|||
sCommunicationSystem->recvSpeed[param1] = (*param0 >> 5) & 0x7;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_0203572C(void)
|
||||
|
|
@ -1203,14 +1195,12 @@ void sub_0203572C(void)
|
|||
|
||||
static BOOL sub_02035730(u8 *param0)
|
||||
{
|
||||
int v0, v1;
|
||||
|
||||
if (sCommunicationSystem->unk_656) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CommSys_IsSendingMovementData() == 0) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (sCommunicationSystem->unk_6A9) {
|
||||
|
|
@ -1232,12 +1222,11 @@ static BOOL sub_02035730(u8 *param0)
|
|||
}
|
||||
|
||||
param0[0] |= (sCommunicationSystem->sendSpeed << 5);
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL sub_020357F0(u8 *param0)
|
||||
{
|
||||
int v0;
|
||||
int v1 = sub_02036128(sub_0203895C());
|
||||
int v2 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
|
||||
|
|
@ -1257,7 +1246,7 @@ static BOOL sub_020357F0(u8 *param0)
|
|||
param0[0] |= 0x2;
|
||||
|
||||
if (param0[0] == 0x2) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
UnkStruct_0203233C v3;
|
||||
|
|
@ -1276,13 +1265,11 @@ static BOOL sub_020357F0(u8 *param0)
|
|||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void sub_020358C0(u8 *param0)
|
||||
{
|
||||
int v0;
|
||||
|
||||
param0[0] = 0xb;
|
||||
|
||||
if (sCommunicationSystem->unk_6AD == 0) {
|
||||
|
|
@ -1291,26 +1278,22 @@ static void sub_020358C0(u8 *param0)
|
|||
param0[1] = 0x1;
|
||||
}
|
||||
|
||||
{
|
||||
u16 v1 = sub_020318EC();
|
||||
u16 v1 = sub_020318EC();
|
||||
|
||||
param0[2] = v1 >> 8;
|
||||
param0[3] = v1 & 0xff;
|
||||
param0[2] = v1 >> 8;
|
||||
param0[3] = v1 & 0xff;
|
||||
|
||||
{
|
||||
UnkStruct_0203233C v2;
|
||||
UnkStruct_0203233C v2;
|
||||
|
||||
v2.unk_04 = 192 - 5;
|
||||
v2.unk_00 = ¶m0[5];
|
||||
v2.unk_04 = 192 - 5;
|
||||
v2.unk_00 = ¶m0[5];
|
||||
|
||||
if (sub_02032574(&sCommunicationSystem->commQueueManSendServer, &v2, 0)) {
|
||||
sCommunicationSystem->unk_6AD = 0;
|
||||
param0[4] = (192 - 5) - v2.unk_04;
|
||||
} else {
|
||||
sCommunicationSystem->unk_6AD = 1;
|
||||
param0[4] = 192 - 5;
|
||||
}
|
||||
}
|
||||
if (sub_02032574(&sCommunicationSystem->commQueueManSendServer, &v2, 0)) {
|
||||
sCommunicationSystem->unk_6AD = 0;
|
||||
param0[4] = (192 - 5) - v2.unk_04;
|
||||
} else {
|
||||
sCommunicationSystem->unk_6AD = 1;
|
||||
param0[4] = 192 - 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1322,106 +1305,106 @@ void sub_02035938(u8 param0)
|
|||
static BOOL sub_0203594C(void)
|
||||
{
|
||||
if (sCommunicationSystem->unk_6B4 == 0) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((sCommunicationSystem->unk_6B5 % sCommunicationSystem->unk_6B4) == 0) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CommSys_SendDataHuge(int cmd, const void *param1, int param2)
|
||||
BOOL CommSys_SendDataHuge(int cmd, const void *data, int param2)
|
||||
{
|
||||
if (!CommSys_IsPlayerConnected(CommSys_CurNetId()) && !CommSys_IsAlone()) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)param1, param2, 1, 0)) {
|
||||
return 1;
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)data, param2, 1, 0)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (sub_0203895C() == 10) {
|
||||
sub_020363BC();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CommSys_SendData(int cmd, const void *param1, int param2)
|
||||
BOOL CommSys_SendData(int cmd, const void *data, int param2)
|
||||
{
|
||||
if (!CommSys_IsPlayerConnected(CommSys_CurNetId()) && !CommSys_IsAlone()) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)param1, param2, 1, 1)) {
|
||||
return 1;
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)data, param2, 1, 1)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (sub_0203895C() == 10) {
|
||||
sub_020363BC();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL sub_02035A3C(int cmd, const void *param1, int param2)
|
||||
BOOL sub_02035A3C(int cmd, const void *data, int param2)
|
||||
{
|
||||
if (CommSys_CurNetId() != 0) {
|
||||
GF_ASSERT(FALSE);
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!CommSys_IsPlayerConnected(0) && !CommSys_IsAlone()) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CommSys_TransmissionType() == 1) {
|
||||
return CommSys_SendDataHuge(cmd, param1, param2);
|
||||
return CommSys_SendDataHuge(cmd, data, param2);
|
||||
}
|
||||
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSendServer, cmd, (u8 *)param1, param2, 1, 0)) {
|
||||
return 1;
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSendServer, cmd, (u8 *)data, param2, 1, 0)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (sub_0203895C() == 10) {
|
||||
sub_020363BC();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CommSys_SendDataServer(int cmd, const void *param1, int param2)
|
||||
BOOL CommSys_SendDataServer(int cmd, const void *data, int param2)
|
||||
{
|
||||
if (CommSys_CurNetId() != 0) {
|
||||
sub_020363BC();
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!CommSys_IsPlayerConnected(0) && !CommSys_IsAlone()) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CommSys_TransmissionType() == 1) {
|
||||
return CommSys_SendData(cmd, param1, param2);
|
||||
return CommSys_SendData(cmd, data, param2);
|
||||
}
|
||||
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSendServer, cmd, (u8 *)param1, param2, 1, 1)) {
|
||||
return 1;
|
||||
if (CommQueue_Write(&sCommunicationSystem->commQueueManSendServer, cmd, (u8 *)data, param2, 1, 1)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (sub_0203895C() == 10) {
|
||||
sub_020363BC();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL sub_02035B48(int cmd, const void *param1)
|
||||
BOOL sub_02035B48(int cmd, const void *data)
|
||||
{
|
||||
return CommSys_SendDataServer(cmd, param1, 0);
|
||||
return CommSys_SendDataServer(cmd, data, 0);
|
||||
}
|
||||
|
||||
int CommSys_SendRingRemainingSize(void)
|
||||
|
|
@ -1523,9 +1506,6 @@ static void CommSys_RecvDataSingle(CommRing *ring, int netId, u8 *buffer, CommRe
|
|||
static void CommSys_RecvData(void)
|
||||
{
|
||||
int v0 = 0;
|
||||
int v1;
|
||||
u8 v2;
|
||||
int v3;
|
||||
|
||||
if (!sCommunicationSystem) {
|
||||
return;
|
||||
|
|
@ -1544,10 +1524,7 @@ static void CommSys_RecvData(void)
|
|||
|
||||
static void CommSys_RecvDataServer(void)
|
||||
{
|
||||
int v0;
|
||||
int v1;
|
||||
u8 v2;
|
||||
int v3;
|
||||
int i, v3;
|
||||
|
||||
if (!sCommunicationSystem) {
|
||||
return;
|
||||
|
|
@ -1559,11 +1536,11 @@ static void CommSys_RecvDataServer(void)
|
|||
|
||||
v3 = CommLocal_MaxMachines(sub_0203895C()) + 1;
|
||||
|
||||
for (v0 = 0; v0 < v3; v0++) {
|
||||
CommRing_UpdateEndPos(&sCommunicationSystem->sendRingClient[v0]);
|
||||
for (i = 0; i < v3; i++) {
|
||||
CommRing_UpdateEndPos(&sCommunicationSystem->sendRingClient[i]);
|
||||
|
||||
if (CommRing_DataSize(&sCommunicationSystem->sendRingClient[v0]) > 0) {
|
||||
CommSys_RecvDataSingle(&sCommunicationSystem->sendRingClient[v0], v0, sCommunicationSystem->tempBuffer, &sCommunicationSystem->commRecvServer[v0]);
|
||||
if (CommRing_DataSize(&sCommunicationSystem->sendRingClient[i]) > 0) {
|
||||
CommSys_RecvDataSingle(&sCommunicationSystem->sendRingClient[i], i, sCommunicationSystem->tempBuffer, &sCommunicationSystem->commRecvServer[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1571,7 +1548,7 @@ static void CommSys_RecvDataServer(void)
|
|||
BOOL CommSys_IsPlayerConnected(u16 param0)
|
||||
{
|
||||
if (!sCommunicationSystem) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CommLocal_IsWifiGroup(sub_0203895C())) {
|
||||
|
|
@ -1579,34 +1556,34 @@ BOOL CommSys_IsPlayerConnected(u16 param0)
|
|||
u16 v0 = DWC_GetAIDBitmap();
|
||||
|
||||
if (v0 & (1 << param0)) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!CommSys_IsInitialized()) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (sub_02031934() != 4) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CommSys_CurNetId() == param0) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
} else if (CommSys_CurNetId() == 0) {
|
||||
u16 v1 = sub_020318EC();
|
||||
|
||||
if (v1 & (1 << param0)) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
} else if (sCommunicationSystem->unk_68C & (1 << param0)) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int CommSys_ConnectedCount(void)
|
||||
|
|
@ -1677,26 +1654,26 @@ BOOL CommSys_IsSendingMovementData(void)
|
|||
return sCommunicationSystem->sendHeldKeys & 0x8000;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CommSys_WriteToQueueServer(int cmd, const void *param1, int param2)
|
||||
BOOL CommSys_WriteToQueueServer(int cmd, const void *data, int param2)
|
||||
{
|
||||
if (CommSys_TransmissionType() == 1) {
|
||||
return CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)param1, param2, 1, 0);
|
||||
return CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)data, param2, 1, 0);
|
||||
} else {
|
||||
return CommQueue_Write(&sCommunicationSystem->commQueueManSendServer, cmd, (u8 *)param1, param2, 1, 0);
|
||||
return CommQueue_Write(&sCommunicationSystem->commQueueManSendServer, cmd, (u8 *)data, param2, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CommSys_WriteToQueue(int cmd, const void *param1, int param2)
|
||||
BOOL CommSys_WriteToQueue(int cmd, const void *data, int param2)
|
||||
{
|
||||
return CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)param1, param2, 0, 0);
|
||||
return CommQueue_Write(&sCommunicationSystem->commQueueManSend, cmd, (u8 *)data, param2, 0, 0);
|
||||
}
|
||||
|
||||
static void CommSys_Transmission(void)
|
||||
{
|
||||
BOOL v0 = 0;
|
||||
BOOL v0 = FALSE;
|
||||
|
||||
if (!sCommunicationSystem) {
|
||||
return;
|
||||
|
|
@ -1723,10 +1700,9 @@ static void CommSys_Transmission(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_02036008(int param0, int param1, void *param2, void *param3)
|
||||
void sub_02036008(int unused0, int unused1, void *param2, void *unused3)
|
||||
{
|
||||
u8 *v0 = param2;
|
||||
int v1;
|
||||
|
||||
if (CommSys_CurNetId() != 0) {
|
||||
return;
|
||||
|
|
@ -1736,10 +1712,9 @@ void sub_02036008(int param0, int param1, void *param2, void *param3)
|
|||
sCommunicationSystem->unk_6A4 = v0[0];
|
||||
}
|
||||
|
||||
void sub_02036030(int param0, int param1, void *param2, void *param3)
|
||||
void sub_02036030(int unused0, int unused1, void *param2, void *unused3)
|
||||
{
|
||||
u8 *v0 = param2;
|
||||
int v1;
|
||||
|
||||
if (CommSys_CurNetId() == 0) {
|
||||
return;
|
||||
|
|
@ -1749,10 +1724,9 @@ void sub_02036030(int param0, int param1, void *param2, void *param3)
|
|||
sCommunicationSystem->transmissionState = 3;
|
||||
}
|
||||
|
||||
void sub_02036058(int param0, int param1, void *param2, void *param3)
|
||||
void sub_02036058(int unused0, int unused1, void *param2, void *unused3)
|
||||
{
|
||||
u8 *v0 = param2;
|
||||
int v1;
|
||||
|
||||
if (CommSys_CurNetId() != 0) {
|
||||
return;
|
||||
|
|
@ -1928,7 +1902,7 @@ int sub_020362F4(int networkId)
|
|||
BOOL sub_02036314(void)
|
||||
{
|
||||
if (!CommLocal_IsWifiGroup(sub_0203895C())) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return ov4_021D254C();
|
||||
|
|
@ -1936,7 +1910,7 @@ BOOL sub_02036314(void)
|
|||
|
||||
void sub_0203632C(BOOL param0)
|
||||
{
|
||||
int v0;
|
||||
int i;
|
||||
|
||||
if (CommLocal_IsWifiGroup(sub_0203895C())) {
|
||||
if (sCommunicationSystem->unk_65C == param0) {
|
||||
|
|
@ -1948,8 +1922,8 @@ void sub_0203632C(BOOL param0)
|
|||
if (param0) {
|
||||
sCommunicationSystem->unk_660 = 0;
|
||||
|
||||
for (v0 = 0; v0 < MAX_CONNECTED_PLAYERS; v0++) {
|
||||
sCommunicationSystem->unk_664[v0] = 0;
|
||||
for (i = 0; i < MAX_CONNECTED_PLAYERS; i++) {
|
||||
sCommunicationSystem->unk_664[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1971,10 +1945,10 @@ void sub_02036378(BOOL param0)
|
|||
BOOL sub_020363A0(void)
|
||||
{
|
||||
if (sCommunicationSystem->unk_6A9) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_020363BC(void)
|
||||
|
|
|
|||
|
|
@ -368,11 +368,8 @@ void Encounter_StartVsWild(FieldSystem *fieldSystem, FieldTask *task, FieldBattl
|
|||
|
||||
static BOOL FieldTask_WildEncounter(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem;
|
||||
WildEncounter *encounter;
|
||||
|
||||
fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
encounter = FieldTask_GetEnv(task);
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
WildEncounter *encounter = FieldTask_GetEnv(task);
|
||||
|
||||
switch (encounter->state) {
|
||||
case 0:
|
||||
|
|
@ -660,10 +657,8 @@ void Encounter_NewVsPalParkTransfer(FieldSystem *fieldSystem, FieldBattleDTO *dt
|
|||
|
||||
void Encounter_NewVsFirstBattle(FieldTask *task, int trainerID, int heapID, int *resultMaskPtr)
|
||||
{
|
||||
FieldBattleDTO *dto;
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
|
||||
dto = FieldBattleDTO_New(HEAP_ID_FIELDMAP, BATTLE_TYPE_TRAINER);
|
||||
FieldBattleDTO *dto = FieldBattleDTO_New(HEAP_ID_FIELDMAP, BATTLE_TYPE_TRAINER);
|
||||
FieldBattleDTO_Init(dto, fieldSystem);
|
||||
|
||||
dto->battleStatusMask = BATTLE_STATUS_FIRST_BATTLE;
|
||||
|
|
@ -724,12 +719,9 @@ static BOOL FieldTask_CatchingTutorialEncounter(FieldTask *task)
|
|||
|
||||
void Encounter_NewCatchingTutorial(FieldTask *task)
|
||||
{
|
||||
Encounter *encounter;
|
||||
FieldBattleDTO *dto;
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
|
||||
dto = FieldBattleDTO_NewCatchingTutorial(HEAP_ID_FIELDMAP, fieldSystem);
|
||||
encounter = NewEncounter(dto, EncEffects_CutInEffect(dto), EncEffects_BGM(dto), NULL);
|
||||
FieldBattleDTO *dto = FieldBattleDTO_NewCatchingTutorial(HEAP_ID_FIELDMAP, fieldSystem);
|
||||
Encounter *encounter = NewEncounter(dto, EncEffects_CutInEffect(dto), EncEffects_BGM(dto), NULL);
|
||||
|
||||
FieldTask_InitCall(task, FieldTask_CatchingTutorialEncounter, encounter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,15 +154,11 @@ FieldBattleDTO *FieldBattleDTO_NewCatchingTutorial(enum HeapId heapID, const Fie
|
|||
{
|
||||
TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData);
|
||||
Options *options = SaveData_Options(fieldSystem->saveData);
|
||||
MessageLoader *msgLoader;
|
||||
Strbuf *strbuf;
|
||||
FieldBattleDTO *dto;
|
||||
FieldBattleDTO *dto = FieldBattleDTO_New(heapID, BATTLE_TYPE_CATCH_TUTORIAL);
|
||||
MessageLoader *msgLoader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_counterpart_names, heapID);
|
||||
Strbuf *strbuf = Strbuf_Init(TRAINER_NAME_LEN + 1, heapID);
|
||||
Pokemon *mon;
|
||||
|
||||
dto = FieldBattleDTO_New(heapID, BATTLE_TYPE_CATCH_TUTORIAL);
|
||||
msgLoader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_counterpart_names, heapID);
|
||||
strbuf = Strbuf_Init(TRAINER_NAME_LEN + 1, heapID);
|
||||
|
||||
MessageLoader_GetStrbuf(msgLoader, TrainerInfo_Gender(trainerInfo) ^ 1, strbuf);
|
||||
TrainerInfo_SetName(dto->trainerInfo[BATTLER_PLAYER_SLOT_1], Strbuf_GetData(strbuf));
|
||||
Strbuf_Free(strbuf);
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
#include "unk_02071D40.h"
|
||||
#include "unk_02099500.h"
|
||||
|
||||
static void FieldCommMan_RunTask(SysTask *param0, void *param1);
|
||||
static void FieldCommMan_SetTask(FieldCommTask param0, int param1);
|
||||
static void FieldCommMan_RunTask(SysTask *task, void *unused);
|
||||
static void FieldCommMan_SetTask(FieldCommTask task, int time);
|
||||
static void Task_StartBattleServer(void);
|
||||
static void Task_ServerWait(void);
|
||||
static void Task_StartBattleClient(void);
|
||||
|
|
@ -208,7 +208,7 @@ void sub_020598A0(void)
|
|||
FieldCommMan_SetTask(sub_0205A018, 5);
|
||||
}
|
||||
|
||||
void FieldCommMan_RunTask(SysTask *task, void *param1)
|
||||
void FieldCommMan_RunTask(SysTask *task, void *unused)
|
||||
{
|
||||
if (sFieldCommMan == NULL) {
|
||||
SysTask_Done(task);
|
||||
|
|
@ -384,10 +384,8 @@ static void sub_02059B10(void)
|
|||
CommPlayerMan_Restart();
|
||||
CommPlayer_SendPos(0);
|
||||
|
||||
{
|
||||
u8 v0 = 1;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
}
|
||||
u8 v0 = 1;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
|
||||
StartScreenTransition(0, 1, 1, 0x0, 6, 1, 4);
|
||||
sub_0200F32C(0);
|
||||
|
|
@ -398,16 +396,16 @@ static void sub_02059B10(void)
|
|||
|
||||
static void sub_02059B74(void)
|
||||
{
|
||||
int v0, v1;
|
||||
int i, j;
|
||||
|
||||
for (v0 = 0; v0 < CommSys_ConnectedCount(); v0++) {
|
||||
if (v0 != CommSys_CurNetId()) {
|
||||
if (sub_02036564(v0) == 94) {
|
||||
for (i = 0; i < CommSys_ConnectedCount(); i++) {
|
||||
if (i != CommSys_CurNetId()) {
|
||||
if (sub_02036564(i) == 94) {
|
||||
if (sFieldCommMan->fieldSystem->task == NULL) {
|
||||
for (v1 = 0; v1 < 4; v1++) {
|
||||
if (sFieldCommMan->trainerCard[v1]) {
|
||||
Heap_FreeToHeap(sFieldCommMan->trainerCard[v1]);
|
||||
sFieldCommMan->trainerCard[v1] = NULL;
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (sFieldCommMan->trainerCard[j]) {
|
||||
Heap_FreeToHeap(sFieldCommMan->trainerCard[j]);
|
||||
sFieldCommMan->trainerCard[j] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -425,10 +423,8 @@ static void sub_02059BF4(void)
|
|||
if (!sub_020590C4()) {
|
||||
sFieldCommMan->unk_43 = 0;
|
||||
|
||||
{
|
||||
u8 v0 = 1;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
}
|
||||
u8 v0 = 1;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
|
||||
FieldCommMan_SetTask(sub_02059CD8, 0);
|
||||
}
|
||||
|
|
@ -446,10 +442,8 @@ static void sub_02059C2C(BOOL param0, const Party *party)
|
|||
if (param0) {
|
||||
FieldCommMan_SetTask(sub_02059E50, 3);
|
||||
} else {
|
||||
{
|
||||
u8 v0 = 3;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
}
|
||||
u8 v0 = 3;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
|
||||
FieldCommMan_SetTask(sub_02059BF4, 0);
|
||||
}
|
||||
|
|
@ -481,16 +475,14 @@ static void sub_02059CD8(void)
|
|||
if (sFieldCommMan->unk_43) {
|
||||
FieldCommMan_SetTask(sub_02059C8C, 5);
|
||||
|
||||
{
|
||||
u8 v0 = 0;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
}
|
||||
u8 v0 = 0;
|
||||
CommSys_SendDataFixedSize(94, &v0);
|
||||
}
|
||||
|
||||
sub_02059B74();
|
||||
}
|
||||
|
||||
void sub_02059D0C(int param0, int param1, void *param2, void *param3)
|
||||
void sub_02059D0C(int unused0, int unused1, void *param2, void *unused3)
|
||||
{
|
||||
u8 *v0 = param2;
|
||||
|
||||
|
|
@ -503,16 +495,16 @@ BOOL sub_02059D2C(void)
|
|||
{
|
||||
if (sFieldCommMan) {
|
||||
if ((sFieldCommMan->task == sub_02059CD8) || (sFieldCommMan->task == sub_02059BF4)) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_02059D58(void)
|
||||
{
|
||||
BOOL v0 = 1;
|
||||
BOOL v0 = TRUE;
|
||||
int v1;
|
||||
u8 v2[6];
|
||||
|
||||
|
|
@ -576,7 +568,7 @@ static void sub_02059E0C(void)
|
|||
|
||||
static void sub_02059E34(void)
|
||||
{
|
||||
BOOL v0 = 1;
|
||||
BOOL v0 = TRUE;
|
||||
|
||||
if (CommTiming_IsSyncState(3)) {
|
||||
FieldCommMan_SetTask(sub_02059E0C, 2);
|
||||
|
|
@ -585,7 +577,7 @@ static void sub_02059E34(void)
|
|||
|
||||
static void sub_02059E50(void)
|
||||
{
|
||||
BOOL v0 = 1;
|
||||
BOOL v0 = TRUE;
|
||||
|
||||
if (sFieldCommMan->timer != 0) {
|
||||
sFieldCommMan->timer--;
|
||||
|
|
@ -612,12 +604,12 @@ static void sub_02059E94(void)
|
|||
FieldCommMan_SetTask(sub_02059964, 10);
|
||||
}
|
||||
|
||||
void sub_02059EAC(int param0, int param1, void *param2, void *param3)
|
||||
void sub_02059EAC(int param0, int unused1, void *unused2, void *unused3)
|
||||
{
|
||||
sFieldCommMan->unk_10[param0] = 1;
|
||||
}
|
||||
|
||||
u8 *sub_02059EBC(int param0, void *param1, int param2)
|
||||
u8 *sub_02059EBC(int param0, void *unused1, int unused2)
|
||||
{
|
||||
GF_ASSERT(param0 < 4);
|
||||
return (u8 *)sFieldCommMan->trainerCard[param0];
|
||||
|
|
@ -625,7 +617,7 @@ u8 *sub_02059EBC(int param0, void *param1, int param2)
|
|||
|
||||
static void FieldCommTask_StartCopyTrainerCard(void)
|
||||
{
|
||||
int v0, v1 = CommSys_CurNetId();
|
||||
int v1 = CommSys_CurNetId();
|
||||
|
||||
if (CommTiming_IsSyncState(95)) {
|
||||
CommSys_SendDataHuge(88, sFieldCommMan->trainerCard[v1], sizeof(TrainerCard));
|
||||
|
|
@ -635,10 +627,10 @@ static void FieldCommTask_StartCopyTrainerCard(void)
|
|||
|
||||
static void FieldCommTask_CopyTrainerCard(void)
|
||||
{
|
||||
int v0;
|
||||
int i;
|
||||
|
||||
for (v0 = 0; v0 < CommSys_ConnectedCount(); v0++) {
|
||||
if (!sFieldCommMan->unk_10[v0]) {
|
||||
for (i = 0; i < CommSys_ConnectedCount(); i++) {
|
||||
if (!sFieldCommMan->unk_10[i]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -724,13 +716,13 @@ static void sub_0205A058(void)
|
|||
FieldCommMan_SetTask(FieldCommMan_Delete, 0);
|
||||
}
|
||||
|
||||
UnkStruct_02029894 *sub_0205A080(SaveData *param0)
|
||||
UnkStruct_02029894 *sub_0205A080(SaveData *saveData)
|
||||
{
|
||||
if (!sFieldCommMan || !sFieldCommMan->unk_41) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ov23_02242E10(param0);
|
||||
return ov23_02242E10(saveData);
|
||||
}
|
||||
|
||||
void sub_0205A0A0(void)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user