Merge branch 'master' into sync-menuhelpers
This commit is contained in:
+1
-1
@@ -581,7 +581,7 @@ struct BattleBarInfo
|
||||
u8 healthboxSpriteId;
|
||||
s32 maxValue;
|
||||
s32 oldValue;
|
||||
s32 receivedValue;
|
||||
s32 receivedValue; // if positive/negative, fills the bar to the left/right respectively
|
||||
s32 currValue;
|
||||
};
|
||||
|
||||
|
||||
+21
-15
@@ -25,25 +25,31 @@ enum
|
||||
HP_BAR_FULL,
|
||||
};
|
||||
|
||||
#define TAG_HEALTHBOX_PLAYER1_TILE 0xD6FF
|
||||
#define TAG_HEALTHBOX_PLAYER2_TILE 0xD700
|
||||
#define TAG_HEALTHBOX_OPPONENT1_TILE 0xD701
|
||||
#define TAG_HEALTHBOX_OPPONENT2_TILE 0xD702
|
||||
#define TAG_HEALTHBOX_PLAYER1_TILE 55039
|
||||
#define TAG_HEALTHBOX_PLAYER2_TILE 55040
|
||||
#define TAG_HEALTHBOX_OPPONENT1_TILE 55041
|
||||
#define TAG_HEALTHBOX_OPPONENT2_TILE 55042
|
||||
|
||||
#define TAG_HEALTHBAR_PLAYER1_TILE 0xD704
|
||||
#define TAG_HEALTHBAR_OPPONENT1_TILE 0xD705
|
||||
#define TAG_HEALTHBAR_PLAYER2_TILE 0xD706
|
||||
#define TAG_HEALTHBAR_OPPONENT2_TILE 0xD707
|
||||
#define TAG_HEALTHBAR_PLAYER1_TILE 55044
|
||||
#define TAG_HEALTHBAR_OPPONENT1_TILE 55045
|
||||
#define TAG_HEALTHBAR_PLAYER2_TILE 55046
|
||||
#define TAG_HEALTHBAR_OPPONENT2_TILE 55047
|
||||
|
||||
#define TAG_HEALTHBOX_SAFARI_TILE 0xD70B
|
||||
#define TAG_HEALTHBOX_PALS_1 55049
|
||||
#define TAG_HEALTHBOX_PALS_2 55050
|
||||
#define TAG_HEALTHBOX_SAFARI_TILE 55051
|
||||
#define TAG_PARTY_SUMMARY_BAR_PLAYER_TILE 55052
|
||||
#define TAG_PARTY_SUMMARY_BAR_OPPONENT_TILE 55053
|
||||
|
||||
#define TAG_STATUS_SUMMARY_BAR_TILE 0xD70C
|
||||
#define TAG_STATUS_SUMMARY_BALLS_TILE 0xD714
|
||||
#define TAG_PARTY_SUMMARY_BAR_PLAYER_PAL 55056
|
||||
#define TAG_PARTY_SUMMARY_BAR_OPPONENT_PAL 55057
|
||||
#define TAG_PARTY_SUMMARY_BALL_PLAYER_PAL 55058
|
||||
#define TAG_PARTY_SUMMARY_BALL_OPPONENT_PAL 55059
|
||||
#define TAG_PARTY_SUMMARY_BALL_PLAYER_TILE 55060
|
||||
#define TAG_PARTY_SUMMARY_BALL_OPPONENT_TILE 55061
|
||||
|
||||
#define TAG_HEALTHBOX_PAL 0xD6FF
|
||||
#define TAG_HEALTHBAR_PAL 0xD704
|
||||
#define TAG_STATUS_SUMMARY_BAR_PAL 0xD710
|
||||
#define TAG_STATUS_SUMMARY_BALLS_PAL 0xD712
|
||||
#define TAG_HEALTHBOX_PAL TAG_HEALTHBOX_PLAYER1_TILE
|
||||
#define TAG_HEALTHBAR_PAL TAG_HEALTHBAR_PLAYER1_TILE
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -189,10 +189,21 @@
|
||||
#define TRACKS_FOOT 1
|
||||
#define TRACKS_BIKE_TIRE 2
|
||||
|
||||
#define OBJ_EVENT_ID_PLAYER 0xFF
|
||||
#define OBJ_EVENT_ID_CAMERA 0x7F
|
||||
|
||||
#define OBJ_KIND_NORMAL 0
|
||||
#define OBJ_KIND_CLONE 255
|
||||
|
||||
// Special object event local ids
|
||||
#define OBJ_EVENT_ID_PLAYER 0xFF
|
||||
#define OBJ_EVENT_ID_CAMERA 0x7F
|
||||
|
||||
// Object event local ids referenced in C files
|
||||
#define LOCALID_UNION_ROOM_PLAYER_4 2
|
||||
#define LOCALID_UNION_ROOM_PLAYER_8 3
|
||||
#define LOCALID_UNION_ROOM_PLAYER_7 4
|
||||
#define LOCALID_UNION_ROOM_PLAYER_6 5
|
||||
#define LOCALID_UNION_ROOM_PLAYER_5 6
|
||||
#define LOCALID_UNION_ROOM_PLAYER_3 7
|
||||
#define LOCALID_UNION_ROOM_PLAYER_2 8
|
||||
#define LOCALID_UNION_ROOM_PLAYER_1 9
|
||||
|
||||
#endif // GUARD_CONSTANTS_EVENT_OBJECTS_H
|
||||
|
||||
@@ -1,47 +1,51 @@
|
||||
#ifndef GUARD_CONSTANTS_UNION_ROOM_H
|
||||
#define GUARD_CONSTANTS_UNION_ROOM_H
|
||||
|
||||
// The number of possible group leaders visible in the Union Room.
|
||||
// Note that this is different than the number of people actively
|
||||
// connected as children via the Wireless Adapter, which cannot
|
||||
// exceed RFU_CHILD_MAX (4), for a total of 5 including the player.
|
||||
#define MAX_UNION_ROOM_LEADERS 8
|
||||
|
||||
#define UNION_ROOM_SPAWN_NONE 0
|
||||
#define UNION_ROOM_SPAWN_IN 1
|
||||
#define UNION_ROOM_SPAWN_OUT 2
|
||||
|
||||
#define ACTIVITY_NONE 0
|
||||
#define ACTIVITY_BATTLE 1
|
||||
#define ACTIVITY_DBLBATTLE 2
|
||||
#define ACTIVITY_MLTBATTLE 3
|
||||
#define ACTIVITY_TRADE 4
|
||||
#define ACTIVITY_CHAT 5
|
||||
#define ACTIVITY_WCARD 6
|
||||
#define ACTIVITY_WNEWS 7
|
||||
#define ACTIVITY_CARD 8
|
||||
#define ACTIVITY_PJUMP 9
|
||||
#define ACTIVITY_BCRUSH 10
|
||||
#define ACTIVITY_BPICK 11
|
||||
#define ACTIVITY_SEARCH 12
|
||||
#define ACTIVITY_SPINTRADE 13
|
||||
#define ACTIVITY_ITEMTRADE 14
|
||||
#define UNION_ROOM_MAX_LEVEL 30
|
||||
|
||||
// The number of possible trainer classes for a trainer of a given gender in the Union Room.
|
||||
// This value is necessarily a power of 2 because of the way it's treated in GetUnionRoomTrainerPic / GetUnionRoomTrainerClass
|
||||
#define NUM_UNION_ROOM_CLASSES (1 << 3) // 8
|
||||
|
||||
#define ACTIVITY_NONE 0
|
||||
#define ACTIVITY_BATTLE_SINGLE 1
|
||||
#define ACTIVITY_BATTLE_DOUBLE 2
|
||||
#define ACTIVITY_BATTLE_MULTI 3
|
||||
#define ACTIVITY_TRADE 4
|
||||
#define ACTIVITY_CHAT 5
|
||||
#define ACTIVITY_WONDER_CARD_DUP 6 // Duplicates of later WONDER constants
|
||||
#define ACTIVITY_WONDER_NEWS_DUP 7 //
|
||||
#define ACTIVITY_CARD 8
|
||||
#define ACTIVITY_POKEMON_JUMP 9
|
||||
#define ACTIVITY_BERRY_CRUSH 10
|
||||
#define ACTIVITY_BERRY_PICK 11
|
||||
#define ACTIVITY_SEARCH 12
|
||||
#define ACTIVITY_SPIN_TRADE 13
|
||||
#define ACTIVITY_ITEM_TRADE 14 // Replaced with ACTIVITY_BATTLE_TOWER_OPEN in Emerald
|
||||
#define ACTIVITY_RECORD_CORNER 15
|
||||
#define ACTIVITY_BERRY_BLENDER 16
|
||||
|
||||
// Player response
|
||||
#define ACTIVITY_ACCEPT 17
|
||||
#define ACTIVITY_DECLINE 18
|
||||
#define ACTIVITY_ACCEPT 17
|
||||
#define ACTIVITY_DECLINE 18
|
||||
|
||||
#define ACTIVITY_NPCTALK 19
|
||||
#define ACTIVITY_PLYRTALK 20
|
||||
#define ACTIVITY_NPCTALK 19
|
||||
#define ACTIVITY_PLYRTALK 20
|
||||
|
||||
// Duplicate IDs?
|
||||
#define ACTIVITY_WCARD2 21
|
||||
#define ACTIVITY_WNEWS2 22
|
||||
#define ACTIVITY_WONDER_CARD 21
|
||||
#define ACTIVITY_WONDER_NEWS 22
|
||||
|
||||
#define IN_UNION_ROOM 0x40
|
||||
|
||||
// Used in UR_AddTextPrinterParameterized
|
||||
#define UR_COLOR_DKE_WHT_LTE 0
|
||||
#define UR_COLOR_RED_WHT_LTR 1
|
||||
#define UR_COLOR_GRN_WHT_LTG 2
|
||||
#define UR_COLOR_WHT_WHT_LTE 3
|
||||
#define UR_COLOR_WHT_DKE_LTE 4
|
||||
#define UR_COLOR_GRN_DN6_LTB 5
|
||||
#define UR_COLOR_DN5_DN6_LTB 6
|
||||
#define IN_UNION_ROOM (1 << 6)
|
||||
|
||||
#define LINK_GROUP_SINGLE_BATTLE 0
|
||||
#define LINK_GROUP_DOUBLE_BATTLE 1
|
||||
@@ -52,9 +56,30 @@
|
||||
#define LINK_GROUP_BERRY_PICKING 6
|
||||
#define LINK_GROUP_WONDER_CARD 7
|
||||
#define LINK_GROUP_WONDER_NEWS 8
|
||||
#define NUM_LINK_GROUP_TYPES 9
|
||||
|
||||
#define LINK_GROUP_UNION_ROOM_RESUME 9
|
||||
#define LINK_GROUP_UNION_ROOM_INIT 10
|
||||
#define LINK_GROUP_UNK_11 11
|
||||
#define LINK_GROUP_UNK_12 12
|
||||
#define NUM_LINK_GROUP_TYPES 13
|
||||
|
||||
#define UR_TRADE_MATCH 0
|
||||
#define UR_TRADE_NOTYPE 1
|
||||
#define UR_TRADE_NOEGG 2
|
||||
|
||||
#define UR_TRADE_READY 0
|
||||
#define UR_TRADE_PLAYER_NOT_READY 1
|
||||
#define UR_TRADE_PARTNER_NOT_READY 2
|
||||
|
||||
#define UR_INTERACT_PLAYER_1 1
|
||||
#define UR_INTERACT_PLAYER_2 2
|
||||
#define UR_INTERACT_PLAYER_3 3
|
||||
#define UR_INTERACT_PLAYER_4 4
|
||||
#define UR_INTERACT_PLAYER_5 5
|
||||
#define UR_INTERACT_PLAYER_6 6
|
||||
#define UR_INTERACT_PLAYER_7 7
|
||||
#define UR_INTERACT_PLAYER_8 8
|
||||
#define UR_INTERACT_ATTENDANT 9
|
||||
#define UR_INTERACT_UNUSED 10
|
||||
#define UR_INTERACT_START_MENU 11
|
||||
|
||||
#endif //GUARD_CONSTANTS_UNION_ROOM_H
|
||||
|
||||
@@ -27,6 +27,9 @@ typedef double f64;
|
||||
typedef u8 bool8;
|
||||
typedef u16 bool16;
|
||||
typedef u32 bool32;
|
||||
typedef vu8 vbool8;
|
||||
typedef vu16 vbool16;
|
||||
typedef vu32 vbool32;
|
||||
|
||||
struct BgCnt
|
||||
{
|
||||
|
||||
+17
-19
@@ -2866,21 +2866,19 @@ extern const u16 gFameCheckerBg3Tilemap[0x400];
|
||||
extern const u16 gFameCheckerBg2Tilemap[0x400];
|
||||
|
||||
// tm_case
|
||||
extern const u32 gUnknown_8E845D8[];
|
||||
extern const u32 gUnknown_8E84A24[];
|
||||
extern const u32 gUnknown_8E84B70[];
|
||||
extern const u32 gUnknown_8E84CB0[];
|
||||
extern const u32 gUnknown_8E84D20[];
|
||||
extern const u32 gTMCase_TMSpriteGfx[];
|
||||
extern const u32 gUnknown_8E84F20[];
|
||||
extern const u32 gUnknown_8E85068[];
|
||||
extern const u8 gUnknown_8E99118[];
|
||||
extern const u32 gTMCase_Gfx[];
|
||||
extern const u32 gTMCaseMenu_Tilemap[];
|
||||
extern const u32 gTMCase_Tilemap[];
|
||||
extern const u32 gTMCaseMenu_Male_Pal[];
|
||||
extern const u32 gTMCaseMenu_Female_Pal[];
|
||||
extern const u32 gTMCaseDisc_Gfx[];
|
||||
extern const u32 gTMCaseDiscTypes1_Pal[];
|
||||
extern const u32 gTMCaseDiscTypes2_Pal[];
|
||||
extern const u8 gTMCaseHM_Gfx[];
|
||||
|
||||
extern const u16 gStandardMenuPalette[];
|
||||
|
||||
// egg_hatch
|
||||
extern const u32 gBattleTextboxTiles[];
|
||||
extern const u32 gBattleTextboxTilemap[];
|
||||
extern const u32 gBattleTextboxPalette[];
|
||||
extern const u32 gTradeGba2_Pal[];
|
||||
extern const u32 gTradeGba_Gfx[];
|
||||
|
||||
@@ -4322,8 +4320,6 @@ extern const u32 gHealthboxDoublesPlayerGfx[];
|
||||
extern const u32 gHealthboxDoublesOpponentGfx[];
|
||||
extern const u32 gHealthboxSafariGfx[];
|
||||
extern const u32 gBlankGfxCompressed[];
|
||||
extern const u16 gBattleInterface_BallStatusBarPal[];
|
||||
extern const u16 gBattleInterface_BallDisplayPal[];
|
||||
extern const u32 gInterfaceGfx_HPNumbers[];
|
||||
extern const u32 gGhostFrontPic[];
|
||||
extern const u32 gGhostPalette[];
|
||||
@@ -4861,11 +4857,13 @@ extern const u16 gHoennTrainerCard_Pal[];
|
||||
extern const u32 gHoennTrainerCard_Gfx[];
|
||||
|
||||
// battle_interface
|
||||
extern const u32 gFile_graphics_battle_interface_ball_status_bar_sheet[];
|
||||
extern const u8 gHealthboxElementsGfxTable[][32];
|
||||
extern const u16 gBattleInterface_BallStatusBarPal[];
|
||||
extern const u16 gBattleInterface_BallDisplayPal[];
|
||||
extern const u16 gBattleInterface_SummaryBallDisplayGfx[];
|
||||
extern const u32 gBattleInterface_Textbox_Gfx[];
|
||||
extern const u32 gBattleInterface_Textbox_Pal[];
|
||||
extern const u32 gBattleInterface_Textbox_Tilemap[];
|
||||
extern const u32 gBattleInterface_PartySummaryBar_Gfx[];
|
||||
extern const u8 gBattleInterface_Gfx[][32];
|
||||
extern const u16 gBattleInterface_Healthbox_Pal[];
|
||||
extern const u16 gBattleInterface_Healthbar_Pal[];
|
||||
|
||||
// item_menu
|
||||
extern const u32 gUnknown_8E830CC[];
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ struct Item
|
||||
u8 holdEffectParam;
|
||||
const u8 *description;
|
||||
u8 importance;
|
||||
u8 exitsBagOnUse;
|
||||
u8 registrability;
|
||||
u8 pocket;
|
||||
u8 type; // unused for balls
|
||||
ItemUseFunc fieldUseFunc;
|
||||
@@ -69,7 +69,7 @@ ItemUseFunc ItemId_GetFieldFunc(u16 itemId);
|
||||
u8 ItemId_GetBattleUsage(u16 itemId);
|
||||
ItemUseFunc ItemId_GetBattleFunc(u16 itemId);
|
||||
u8 ItemId_GetSecondaryId(u16 itemId);
|
||||
u16 itemid_get_market_price(u16 itemId);
|
||||
u16 ItemId_GetPrice(u16 itemId);
|
||||
void ClearBag(void);
|
||||
void ClearPCItemSlots(void);
|
||||
void TrySetObtainedItemQuestLogEvent(u16 itemId);
|
||||
@@ -79,7 +79,7 @@ void SortPocketAndPlaceHMsFirst(struct BagPocket * pocket);
|
||||
u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 itemId);
|
||||
u16 BagGetQuantityByPocketPosition(u8 pocketId, u16 itemId);
|
||||
u16 BagGetQuantityByItemId(u16 item);
|
||||
bool8 itemid_is_unique(u16 itemId);
|
||||
u8 ItemId_GetImportance(u16 itemId);
|
||||
void BagPocketCompaction(struct ItemSlot * slots, u8 capacity);
|
||||
u16 GetPcItemQuantity(u16 *);
|
||||
void SetBagPocketsPointers(void);
|
||||
|
||||
+1
-2
@@ -269,7 +269,7 @@ void SetSuppressLinkErrorMessage(bool8);
|
||||
bool8 HasLinkErrorOccurred(void);
|
||||
void ResetSerial(void);
|
||||
u32 LinkMain1(u8 *, u16 *, u16[MAX_RFU_PLAYERS][CMD_LENGTH]);
|
||||
void RFUVSync(void);
|
||||
void RfuVSync(void);
|
||||
void Timer3Intr(void);
|
||||
void SerialCB(void);
|
||||
u8 GetLinkPlayerCount(void);
|
||||
@@ -277,7 +277,6 @@ bool32 InUnionRoom(void);
|
||||
|
||||
void SetLinkStandbyCallback(void);
|
||||
void SetWirelessCommType1(void);
|
||||
void LinkRfu_DestroyIdleTask(void);
|
||||
void SetCloseLinkCallback(void);
|
||||
void OpenLink(void);
|
||||
bool8 IsLinkMaster(void);
|
||||
|
||||
+162
-140
@@ -6,35 +6,29 @@
|
||||
#include "link.h"
|
||||
#include "AgbRfu_LinkManager.h"
|
||||
|
||||
#define RFUCMD_MASK 0xFF00
|
||||
#define RFUCMD_MASK 0xFF00
|
||||
|
||||
#define RFUCMD_SEND_PACKET 0x2F00
|
||||
#define RFUCMD_READY_CLOSE_LINK 0x5f00
|
||||
#define RFUCMD_READY_EXIT_STANDBY 0x6600
|
||||
#define RFUCMD_PLAYERS_LIST 0x7700
|
||||
#define RFUCMD_PLAYERS_LIST_2 0x7800
|
||||
#define RFUCMD_SEND_BLOCK_INIT 0x8800
|
||||
#define RFUCMD_SEND_BLOCK_STEP 0x8900
|
||||
#define RFUCMD_SEND_BLOCK_REQ 0xa100
|
||||
#define RFUCMD_SEND_HELD_KEYS 0xbe00
|
||||
#define RFUCMD_PARENT_DISCONNECT 0xed00
|
||||
#define RFUCMD_CHILD_DISCONNECT 0xee00
|
||||
#define RFUCMD_SEND_PACKET 0x2F00
|
||||
#define RFUCMD_BLENDER_SEND_KEYS 0x4400
|
||||
#define RFUCMD_READY_CLOSE_LINK 0x5F00
|
||||
#define RFUCMD_READY_EXIT_STANDBY 0x6600
|
||||
#define RFUCMD_SEND_PLAYER_IDS 0x7700
|
||||
#define RFUCMD_SEND_PLAYER_IDS_NEW 0x7800
|
||||
#define RFUCMD_SEND_BLOCK_INIT 0x8800
|
||||
#define RFUCMD_SEND_BLOCK 0x8900
|
||||
#define RFUCMD_SEND_BLOCK_REQ 0xA100
|
||||
#define RFUCMD_SEND_HELD_KEYS 0xBE00
|
||||
#define RFUCMD_DISCONNECT 0xED00
|
||||
#define RFUCMD_DISCONNECT_PARENT 0xEE00
|
||||
|
||||
#define RFU_PACKET_SIZE 6
|
||||
|
||||
#define RFU_SERIAL_7F7D 0x7F7D
|
||||
#define RFU_SERIAL_GAME 0x0002 // Serial number for Pokémon game (FRLG or Emerald)
|
||||
#define RFU_SERIAL_WONDER_DISTRIBUTOR 0x7F7D // Serial number for distributing Wonder Cards / News
|
||||
#define RFU_SERIAL_END 0xFFFF
|
||||
|
||||
#define COMM_SLOT_LENGTH 14
|
||||
#define RECV_QUEUE_NUM_SLOTS 20
|
||||
#define RECV_QUEUE_SLOT_LENGTH (14 * MAX_RFU_PLAYERS)
|
||||
|
||||
#define SEND_QUEUE_NUM_SLOTS 40
|
||||
#define SEND_QUEUE_SLOT_LENGTH 14
|
||||
|
||||
#define BACKUP_QUEUE_NUM_SLOTS 2
|
||||
#define BACKUP_QUEUE_SLOT_LENGTH 14
|
||||
|
||||
#define UNUSED_QUEUE_NUM_SLOTS 2
|
||||
#define UNUSED_QUEUE_SLOT_LENGTH 256
|
||||
|
||||
#define RFU_PACKET_SIZE 6
|
||||
|
||||
@@ -48,50 +42,88 @@
|
||||
#define RFU_STATUS_WAIT_ACK_JOIN_GROUP 7
|
||||
#define RFU_STATUS_LEAVE_GROUP_NOTICE 8
|
||||
#define RFU_STATUS_LEAVE_GROUP 9
|
||||
#define RFU_STATUS_10 10
|
||||
#define RFU_STATUS_11 11
|
||||
#define RFU_STATUS_CHILD_LEAVE_READY 10
|
||||
#define RFU_STATUS_CHILD_LEAVE 11
|
||||
#define RFU_STATUS_ACK_JOIN_GROUP 12
|
||||
|
||||
#define RFU_RECV_IDLE 0
|
||||
#define RFU_RECV_RECEIVING 1
|
||||
#define RFU_RECV_FINISHED 2
|
||||
// Values for disconnectMode
|
||||
enum {
|
||||
RFU_DISCONNECT_NONE,
|
||||
RFU_DISCONNECT_ERROR,
|
||||
RFU_DISCONNECT_NORMAL,
|
||||
};
|
||||
|
||||
// Values for errorState
|
||||
enum {
|
||||
RFU_ERROR_STATE_NONE,
|
||||
RFU_ERROR_STATE_OCCURRED,
|
||||
RFU_ERROR_STATE_PROCESSED,
|
||||
RFU_ERROR_STATE_DISCONNECTING,
|
||||
RFU_ERROR_STATE_IGNORE,
|
||||
};
|
||||
|
||||
// These error flags are set in errorInfo, and given as
|
||||
// the uppermost 16 bits of 'status' for sLinkErrorBuffer.
|
||||
// The first 8 bits are reserved for the link manager msg
|
||||
// when the error occurred, and the last 8 bits are this
|
||||
// sequence of presumably meaningful error flags, but
|
||||
// ultimately sLinkErrorBuffer's status is never read.
|
||||
#define F_RFU_ERROR_1 (1 << 8)
|
||||
#define F_RFU_ERROR_2 (1 << 9) // Never set
|
||||
#define F_RFU_ERROR_3 (1 << 10) // Never set
|
||||
#define F_RFU_ERROR_4 (1 << 11) // Never set
|
||||
#define F_RFU_ERROR_5 (1 << 12)
|
||||
#define F_RFU_ERROR_6 (1 << 13)
|
||||
#define F_RFU_ERROR_7 (1 << 14)
|
||||
#define F_RFU_ERROR_8 (1 << 15)
|
||||
|
||||
// RfuTgtData.gname is read as these structs.
|
||||
struct GFtgtGnameSub
|
||||
struct RfuGameCompatibilityData
|
||||
{
|
||||
u16 language:4;
|
||||
u16 hasNews:1;
|
||||
u16 hasCard:1;
|
||||
u16 unknown:1;
|
||||
u16 unknown:1; // Never read
|
||||
u16 isChampion:1;
|
||||
u16 hasNationalDex:1;
|
||||
u16 gameClear:1;
|
||||
u16 version:4;
|
||||
u16 unk_01_6:2;
|
||||
u16 unused:2;
|
||||
u8 playerTrainerId[2];
|
||||
};
|
||||
|
||||
struct __attribute__((packed, aligned(2))) GFtgtGname
|
||||
// This struct is sent via the Wireless Adapter as the game name or "gname" data.
|
||||
// Gname is only applicable during Wireless Single Game Pak Multiplay, when the
|
||||
// adapter needs this data for connection. Per the RFU manual, during "normal"
|
||||
// wireless play (the kind the Pokémon games use) the gname data can be used for
|
||||
// anything the developers want. This struct is what GF decided to use it for.
|
||||
// It can be up to 13 bytes in size (RFU_GAME_NAME_LENGTH).
|
||||
// The player's name is sent separately as the username ("uname"), and does not
|
||||
// use a struct (gHostRfuUsername).
|
||||
struct __attribute__((packed, aligned(2))) RfuGameData
|
||||
{
|
||||
struct GFtgtGnameSub unk_00;
|
||||
u8 child_sprite_gender[RFU_CHILD_MAX]; // u8 sprite_idx:3;
|
||||
// u8 gender:1;
|
||||
// u8 unk_4:3
|
||||
// u8 active:1
|
||||
u16 species:10;
|
||||
u16 type:6;
|
||||
struct RfuGameCompatibilityData compatibility;
|
||||
u8 partnerInfo[RFU_CHILD_MAX];
|
||||
u16 tradeSpecies:10;
|
||||
u16 tradeType:6;
|
||||
u8 activity:7;
|
||||
u8 started:1;
|
||||
u8 startedActivity:1;
|
||||
u8 playerGender:1;
|
||||
u8 level:7;
|
||||
u8 tradeLevel:7;
|
||||
u8 padding;
|
||||
}; // size: RFU_GNAME_SIZE
|
||||
|
||||
struct Padded_U8
|
||||
{
|
||||
u8 value;
|
||||
};
|
||||
|
||||
// Constants for getting/setting information in 'partnerInfo' of RfuGameData.
|
||||
// This data is used to determine what the link partners look like from
|
||||
// the host's perspective.
|
||||
// Bits 0-2 are a shortened trainerId
|
||||
// Bit 3 is the player's gender
|
||||
// Bits 4-6 are unknown/unused
|
||||
// Bit 7 is an 'active' flag
|
||||
#define PINFO_TID_MASK 0x7
|
||||
#define PINFO_GENDER_SHIFT 3
|
||||
#define PINFO_ACTIVE_FLAG (1 << 7)
|
||||
|
||||
struct RfuBlockSend
|
||||
{
|
||||
/* 0x00 */ u16 next;
|
||||
@@ -106,59 +138,50 @@ struct RfuBlockSend
|
||||
|
||||
struct RfuRecvQueue
|
||||
{
|
||||
/* 0x000 */ u8 slots[RECV_QUEUE_NUM_SLOTS][RECV_QUEUE_SLOT_LENGTH];
|
||||
/* 0x578 */ vu8 recv_slot;
|
||||
/* 0x579 */ vu8 send_slot;
|
||||
/* 0x000 */ u8 slots[RECV_QUEUE_NUM_SLOTS][COMM_SLOT_LENGTH * MAX_RFU_PLAYERS];
|
||||
/* 0x578 */ vu8 recvSlot;
|
||||
/* 0x579 */ vu8 sendSlot;
|
||||
/* 0x57a */ vu8 count;
|
||||
/* 0x57b */ vu8 full;
|
||||
};
|
||||
|
||||
struct RfuSendQueue
|
||||
{
|
||||
/* 0x000 */ u8 slots[SEND_QUEUE_NUM_SLOTS][SEND_QUEUE_SLOT_LENGTH];
|
||||
/* 0x230 */ vu8 recv_slot;
|
||||
/* 0x231 */ vu8 send_slot;
|
||||
/* 0x000 */ u8 slots[SEND_QUEUE_NUM_SLOTS][COMM_SLOT_LENGTH];
|
||||
/* 0x230 */ vu8 recvSlot;
|
||||
/* 0x231 */ vu8 sendSlot;
|
||||
/* 0x232 */ vu8 count;
|
||||
/* 0x233 */ vu8 full;
|
||||
};
|
||||
|
||||
struct RfuBackupQueue
|
||||
{
|
||||
/* 0x00 */ u8 slots[BACKUP_QUEUE_NUM_SLOTS][BACKUP_QUEUE_SLOT_LENGTH];
|
||||
/* 0x1c */ vu8 recv_slot;
|
||||
/* 0x1d */ vu8 send_slot;
|
||||
/* 0x00 */ u8 slots[BACKUP_QUEUE_NUM_SLOTS][COMM_SLOT_LENGTH];
|
||||
/* 0x1c */ vu8 recvSlot;
|
||||
/* 0x1d */ vu8 sendSlot;
|
||||
/* 0x1e */ vu8 count;
|
||||
};
|
||||
|
||||
struct RfuUnusedQueue
|
||||
struct RfuManager
|
||||
{
|
||||
/* 0x000 */ u8 slots[UNUSED_QUEUE_NUM_SLOTS][UNUSED_QUEUE_SLOT_LENGTH];
|
||||
/* 0x200 */ vu8 recv_slot;
|
||||
/* 0x201 */ vu8 send_slot;
|
||||
/* 0x202 */ vu8 count;
|
||||
/* 0x203 */ vu8 full;
|
||||
};
|
||||
|
||||
typedef struct UnkRfuStruct_2
|
||||
{
|
||||
/* 0x000 */ void (*RfuFunc)(void);
|
||||
/* 0x000 */ void (*callback)(void);
|
||||
/* 0x004 */ u16 state;
|
||||
/* 0x006 */ u8 filler_06[4];
|
||||
/* 0x00a */ u16 linkman_msg;
|
||||
/* 0x00c */ u8 parent_child;
|
||||
/* 0x006 */ u8 unused1[4];
|
||||
/* 0x00a */ u16 errorInfo;
|
||||
/* 0x00c */ u8 parentChild;
|
||||
/* 0x00d */ u8 playerCount;
|
||||
/* 0x00e */ u8 unk_0e;
|
||||
/* 0x00f */ u8 unk_0f;
|
||||
/* 0x010 */ u16 linkman_param[2];
|
||||
/* 0x014 */ u8 main_UNI_recvBuffer[RFU_CHILD_MAX][14];
|
||||
/* 0x04c */ u8 lastCmdBeforeCommInterrupt[14];
|
||||
/* 0x05a */ u8 cmdA100_blockRequestType;
|
||||
/* 0x00e */ bool8 runParentMain2;
|
||||
/* 0x00f */ u8 unused2;
|
||||
/* 0x010 */ u16 errorParams[2];
|
||||
/* 0x014 */ u8 childRecvBuffer[RFU_CHILD_MAX][COMM_SLOT_LENGTH];
|
||||
/* 0x04c */ u8 childSendBuffer[COMM_SLOT_LENGTH];
|
||||
/* 0x05a */ u8 blockRequestType;
|
||||
/* 0x05b */ u8 sendBlockInitDelay;
|
||||
/* 0x05c */ bool8 blockReceived[MAX_RFU_PLAYERS];
|
||||
/* 0x061 */ u8 numBlocksReceived[MAX_RFU_PLAYERS];
|
||||
/* 0x066 */ u8 idleTaskId;
|
||||
/* 0x067 */ u8 searchTaskId;
|
||||
/* 0x068 */ u8 filler_68[4];
|
||||
/* 0x068 */ u8 unused3[4];
|
||||
/* 0x06c */ struct RfuBlockSend sendBlock;
|
||||
/* 0x080 */ struct RfuBlockSend recvBlock[MAX_RFU_PLAYERS];
|
||||
/* 0x0e4 */ bool8 readyCloseLink[MAX_RFU_PLAYERS];
|
||||
@@ -170,67 +193,66 @@ typedef struct UnkRfuStruct_2
|
||||
/* 0x0f2 */ u16 packet[RFU_PACKET_SIZE];
|
||||
/* 0x0fe */ u16 resendExitStandbyTimer;
|
||||
/* 0x100 */ u16 resendExitStandbyCount;
|
||||
/* 0x102 */ u8 unk_102;
|
||||
/* 0x104 */ struct RfuTgtData tgtData;
|
||||
/* 0x102 */ u8 childSendCmdId;
|
||||
/* 0x104 */ struct RfuTgtData parent;
|
||||
/* 0x124 */ struct RfuRecvQueue recvQueue;
|
||||
/* 0x6a0 */ struct RfuSendQueue sendQueue;
|
||||
/* 0x8d4 */ struct RfuBackupQueue backupQueue;
|
||||
/* 0x8f4 */ vu8 linkRecovered;
|
||||
/* 0x8f5 */ u8 reconnectedParentIdx;
|
||||
/* 0x8f6 */ vu8 child_slot;
|
||||
/* 0x8f7 */ u8 unk_c3f[70];
|
||||
/* 0x8f5 */ u8 reconnectParentId;
|
||||
/* 0x8f6 */ vu8 childSlot;
|
||||
/* 0x8f7 */ u8 childRecvQueue[COMM_SLOT_LENGTH * MAX_RFU_PLAYERS];
|
||||
/* 0x93d */ u8 sendStatus;
|
||||
/* 0x93e */ u8 recvStatus;
|
||||
/* 0x93f */ u8 recvCmds[MAX_RFU_PLAYERS][7][2];
|
||||
/* 0x93f */ u8 recvCmds[MAX_RFU_PLAYERS][CMD_LENGTH - 1][2];
|
||||
/* 0x985 */ u8 parentId;
|
||||
/* 0x986 */ u8 multiplayerId; // childId
|
||||
/* 0x987 */ u8 unk_ccf;
|
||||
/* 0x988 */ vu8 sem_UNI_SendRecv;
|
||||
/* 0x987 */ u8 connectParentFailures;
|
||||
/* 0x988 */ vu8 childSendCount;
|
||||
/* 0x989 */ u8 partnerSendStatuses[RFU_CHILD_MAX];
|
||||
/* 0x98d */ u8 partnerRecvStatuses[RFU_CHILD_MAX];
|
||||
/* 0x991 */ u8 linkClosing;
|
||||
/* 0x992 */ u8 unk_cda;
|
||||
/* 0x993 */ volatile bool8 unk_cdb;
|
||||
/* 0x994 */ volatile bool8 unk_cdc;
|
||||
/* 0x995 */ u8 unk_cdd;
|
||||
/* 0x991 */ bool8 stopNewConnections;
|
||||
/* 0x992 */ u8 parentSendSlot;
|
||||
/* 0x993 */ vbool8 parentFinished;
|
||||
/* 0x994 */ vbool8 parentMain2Failed;
|
||||
/* 0x995 */ u8 unused5;
|
||||
/* 0x996 */ u8 linkPlayerIdx[RFU_CHILD_MAX];
|
||||
/* 0x99a */ u8 bm_PartnerFlags;
|
||||
/* 0x99b */ u8 bm_DisconnectSlot;
|
||||
/* 0x99c */ u8 unk_ce4;
|
||||
/* 0x99d */ u8 bmChatLeaderMaybe;
|
||||
/* 0x99e */ u8 unionRoomChatters;
|
||||
/* 0x99a */ u8 parentSlots;
|
||||
/* 0x99b */ u8 disconnectSlots;
|
||||
/* 0x99c */ u8 disconnectMode;
|
||||
/* 0x99d */ u8 nextChildBits;
|
||||
/* 0x99e */ u8 newChildQueue;
|
||||
/* 0x99f */ u8 acceptSlot_flag;
|
||||
/* 0x9a0 */ bool8 foundNewLeaderMaybe;
|
||||
/* 0x9a1 */ u8 unk_ce9;
|
||||
/* 0x9a2 */ u8 unk_cea[RFU_CHILD_MAX];
|
||||
/* 0x9a6 */ u8 unk_cee[RFU_CHILD_MAX];
|
||||
} GF_RFU_MANAGER; // size: 0x9AC
|
||||
/* 0x9a0 */ bool8 playerExchangeActive;
|
||||
/* 0x9a1 */ u8 incomingChild;
|
||||
/* 0x9a2 */ u8 numChildRecvErrors[RFU_CHILD_MAX];
|
||||
/* 0x9a6 */ u8 childRecvIds[RFU_CHILD_MAX];
|
||||
}; // size: 0x9AC
|
||||
|
||||
extern struct GFtgtGname gHostRFUtgtGnameBuffer;
|
||||
extern u8 gHostRFUtgtUnameBuffer[];
|
||||
extern GF_RFU_MANAGER Rfu;
|
||||
extern struct RfuGameData gHostRfuGameData;
|
||||
extern u8 gHostRfuUsername[];
|
||||
extern struct RfuManager gRfu;
|
||||
|
||||
// GameFreak signatures
|
||||
void AddTextPrinterToWindow1(const u8 *str);
|
||||
bool32 MG_PrintTextOnWindow1AndWaitButton(u8 * cmdPtr, const u8 * src);
|
||||
bool32 PrintMysteryGiftMenuMessage(u8 * cmdPtr, const u8 * src);
|
||||
void LinkRfu_FatalError(void);
|
||||
void MG_DrawCheckerboardPattern(void);
|
||||
void Rfu_SetCloseLinkCallback(void);
|
||||
bool8 IsLinkRfuTaskFinished(void);
|
||||
void DestroyWirelessStatusIndicatorSprite(void);
|
||||
void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0);
|
||||
void MEvent_CreateTask_CardOrNewsOverWireless(u32 arg0);
|
||||
void MEvent_CreateTask_Leader(u32 arg0);
|
||||
void CreateTask_LinkMysteryGiftWithFriend(u32 activity);
|
||||
void CreateTask_LinkMysteryGiftOverWireless(u32 activity);
|
||||
void CreateTask_SendMysteryGift(u32 activity);
|
||||
void Rfu_SendPacket(void *data);
|
||||
u8 CreateTask_ListenToWireless(void);
|
||||
void LinkRfu_DestroyIdleTask(void);
|
||||
void DestroyTask_RfuIdle(void);
|
||||
void InitRFUAPI(void);
|
||||
void sub_80FB128(bool32 a0);
|
||||
void RfuSetIgnoreError(bool32 enable);
|
||||
bool32 IsSendingKeysToRfu(void);
|
||||
void ClearLinkRfuCallback(void);
|
||||
u8 GetRfuPlayerCount(void);
|
||||
u8 Rfu_GetLinkPlayerCount(void);
|
||||
void StartSendingKeysToRfu(void);
|
||||
u8 LinkRfu_GetMultiplayerId(void);
|
||||
u8 Rfu_GetMultiplayerId(void);
|
||||
bool32 Rfu_InitBlockSend(const u8 * src, size_t size);
|
||||
bool8 Rfu_SendBlockRequest(u8 blockRequestType);
|
||||
u8 Rfu_GetBlockReceivedStatus(void);
|
||||
@@ -238,15 +260,15 @@ void Rfu_SetBlockReceivedFlag(u8 linkPlayerId);
|
||||
void Rfu_ResetBlockReceivedFlag(u8 linkPlayerId);
|
||||
bool8 Rfu_IsMaster(void);
|
||||
void ResetLinkRfuGFLayer(void);
|
||||
bool32 LinkRfuMain1(void);
|
||||
bool32 LinkRfuMain2(void);
|
||||
bool32 RfuMain1(void);
|
||||
bool32 RfuMain2(void);
|
||||
bool32 IsRfuRecvQueueEmpty(void);
|
||||
u32 GetRfuRecvQueueLength(void);
|
||||
void LinkRfu_Shutdown(void);
|
||||
void LinkRfu_CreateIdleTask(void);
|
||||
bool8 ToggleLMANlinkRecovery(bool32 enable);
|
||||
void var_800D_set_xB(void);
|
||||
struct GFtgtGname *GetHostRFUtgtGname(void);
|
||||
void CreateTask_RfuIdle(void);
|
||||
bool8 Rfu_SetLinkRecovery(bool32 enable);
|
||||
void SetUsingUnionRoomStartMenu(void);
|
||||
struct RfuGameData *GetHostRfuGameData(void);
|
||||
void UpdateWirelessStatusIndicatorSprite(void);
|
||||
void InitRFU(void);
|
||||
bool32 RfuHasErrored(void);
|
||||
@@ -262,44 +284,44 @@ bool8 RfuBackupQueue_Dequeue(struct RfuBackupQueue *queue, u8 *dest);
|
||||
void RfuBackupQueue_Enqueue(struct RfuBackupQueue *queue, const u8 *dest);
|
||||
bool8 RfuRecvQueue_Dequeue(struct RfuRecvQueue * queue, u8 *dest);
|
||||
void RfuSendQueue_Enqueue(struct RfuSendQueue * queue, u8 *src);
|
||||
void InitHostRFUtgtGname(struct GFtgtGname *data, u8 activity, bool32 started, s32 child_sprite_genders);
|
||||
void InitHostRfuGameData(struct RfuGameData *data, u8 activity, bool32 started, s32 partnerInfo);
|
||||
void UpdateGameData_GroupLockedIn(bool8 started);
|
||||
bool32 IsRfuSerialNumberValid(u32 serialNo);
|
||||
bool8 IsRfuRecoveringFromLinkLoss(void);
|
||||
bool8 LmanAcceptSlotFlagIsNotZero(void);
|
||||
void LinkRfu_StopManagerAndFinalizeSlots(void);
|
||||
bool32 sub_80FA5D4(void);
|
||||
bool32 sub_80FC1CC(void);
|
||||
bool32 WaitRfuState(bool32 a0);
|
||||
bool32 CheckTrainerHasLeftByIdAndName(u16 trainerId, const u8 *trainerName);
|
||||
void SendByteToPartnerByIdAndName(u8 a0, u16 a1, const u8 *a2);
|
||||
u32 WaitSendByteToPartnerByIdAndName(u16 a0, const u8 *a1);
|
||||
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, u32 a2);
|
||||
bool32 RfuTryDisconnectLeavingChildren(void);
|
||||
bool32 IsRfuCommunicatingWithAllChildren(void);
|
||||
bool32 WaitRfuState(bool32 force);
|
||||
bool32 HasTrainerLeftPartnersList(u16 trainerId, const u8 *trainerName);
|
||||
void SendRfuStatusToPartner(u8 status, u16 trainerId, const u8 *name);
|
||||
u32 WaitSendRfuStatusToPartner(u16 trainerId, const u8 *name);
|
||||
void SetHostRfuGameData(u8 activity, u32 partnerInfo, bool32 startedActivity);
|
||||
void InitializeRfuLinkManager_LinkLeader(u32 availSlots);
|
||||
void RequestDisconnectSlotByTrainerNameAndId(const u8 *trainerName, u16 trainerId);
|
||||
void LinkRfu3_SetGnameUnameFromStaticBuffers(struct GFtgtGname *gname, u8 *uname);
|
||||
void CopyHostRfuGameDataAndUsername(struct RfuGameData *gameData, u8 *username);
|
||||
void InitializeRfuLinkManager_JoinGroup(void);
|
||||
void SendLeaveGroupNotice(void);
|
||||
void CreateTask_RfuReconnectWithParent(const u8 *src, u16 trainerId);
|
||||
void UpdateGameDataWithActivitySpriteGendersFlag(u8 activity, u32 child_sprite_genders, u32 started);
|
||||
void RecordMixTrainerNames(void);
|
||||
void UpdateGameData_SetActivity(u8 activity, u32 partnerInfo, u32 startedActivity);
|
||||
void SaveLinkTrainerNames(void);
|
||||
void LinkRfu_CreateConnectionAsParent();
|
||||
void LinkRfu_StopManagerBeforeEnteringChat();
|
||||
void SetGnameBufferWonderFlags(bool32 hasNews, bool32 hasCard);
|
||||
void ClearAndInitHostRFUtgtGname(void);
|
||||
void sub_80F8FA0(void);
|
||||
void RfuUpdatePlayerGnameStateAndSend(u32 type, u32 species, u32 level);
|
||||
void SetHostRfuWonderFlags(bool32 hasNews, bool32 hasCard);
|
||||
void ResetHostRfuGameData(void);
|
||||
void StopUnionRoomLinkManager(void);
|
||||
void SetTradeBoardRegisteredMonInfo(u32 type, u32 species, u32 level);
|
||||
bool32 IsUnionRoomListenTaskActive(void);
|
||||
void InitializeRfuLinkManager_EnterUnionRoom(void);
|
||||
void sub_80FBD6C(u32 a0);
|
||||
void sub_80FC114(const u8 *name, struct GFtgtGname *structPtr, u8 a2);
|
||||
void Rfu_DisconnectPlayerById(u32 playerIdx);
|
||||
void TryConnectToUnionRoomParent(const u8 *name, struct RfuGameData *parent, u8 activity);
|
||||
bool32 PlayerHasMetTrainerBefore(u16 id, u8 *name);
|
||||
bool8 LinkRfu_GetNameIfCompatible(struct GFtgtGname *gname, u8 *uname, u8 idx);
|
||||
bool8 LinkRfu_GetNameIfSerial7F7D(struct GFtgtGname *gname, u8 *uname, u8 idx);
|
||||
bool32 RfuHasFoundNewLeader(void);
|
||||
void Rfu_UnionRoomChat_StopLinkManager(void);
|
||||
void sub_80FB9D0(void);
|
||||
void sub_80FB030(u32 a0);
|
||||
bool8 Rfu_GetCompatiblePlayerData(struct RfuGameData *gameData, u8 *username, u8 idx);
|
||||
bool8 Rfu_GetWonderDistributorPlayerData(struct RfuGameData *gameData, u8 *username, u8 idx);
|
||||
bool32 Rfu_IsPlayerExchangeActive(void);
|
||||
void Rfu_StopPartnerSearch(void);
|
||||
void RfuSetNormalDisconnectMode(void);
|
||||
void SetUnionRoomChatPlayerData(u32 numPlayers);
|
||||
void ClearRecvCommands(void);
|
||||
|
||||
#include "mevent_server.h"
|
||||
|
||||
+2
-2
@@ -101,8 +101,8 @@ void InitMEventData(void);
|
||||
u16 MEvent_GetBattleCardCount(u32 command);
|
||||
void MysteryGift_TryIncrementStat(u32 eventId, u32 trainerId);
|
||||
u16 *GetMEventProfileECWordsMaybe(void);
|
||||
void ResetReceivedWonderCardFlag(void);
|
||||
bool32 MEventHandleReceivedWonderCard(u16 flagId);
|
||||
void MysteryGift_DisableStats(void);
|
||||
bool32 MysteryGift_TryEnableStatsByFlagId(u16 flagId);
|
||||
u16 GetWonderCardFlagId(void);
|
||||
|
||||
#endif //GUARD_MEVENT_H
|
||||
|
||||
@@ -6,8 +6,8 @@ extern bool8 gGiftIsFromEReader;
|
||||
void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void);
|
||||
void PrintMysteryGiftOrEReaderTopMenu(bool8, bool32);
|
||||
void c2_mystery_gift(void);
|
||||
void c2_mystery_gift_e_reader_run(void);
|
||||
s8 mevent_message_print_and_prompt_yes_no(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, const u8 * str);
|
||||
void CB2_MysteryGiftEReader(void);
|
||||
s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, const u8 * str);
|
||||
void MG_DrawTextBorder(u8 windowId);
|
||||
u16 GetMysteryGiftBaseBlock(void);
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef GUARD_UNION_ROOM_PLAYER_AVATAR_H
|
||||
#define GUARD_UNION_ROOM_PLAYER_AVATAR_H
|
||||
|
||||
#include "union_room.h"
|
||||
|
||||
u8 ZeroUnionObjWork(struct UnionObj * ptr);
|
||||
void DeleteUnionObjWorkAndStopTask(void);
|
||||
void CreateGroupMemberObjectsInvisible(u8 *spriteIds, s32 group);
|
||||
void DestroyGroupMemberObjects(u8 *spriteIds);
|
||||
void MakeGroupAssemblyAreasPassable(void);
|
||||
void ScheduleUnionRoomPlayerRefresh(struct UnkStruct_URoom *uroom_p);
|
||||
void HandleUnionRoomPlayerRefresh(struct UnkStruct_URoom *uroom_p);
|
||||
bool32 RfuUnionTool_GetGroupAndMemberInFrontOfPlayer(struct UnkStruct_Main0 *main0_p, s16 *member_p, s16 *group_p, u8 *spriteIds);
|
||||
void UpdateUnionGroupMemberFacing(u32 member, u32 group, struct UnkStruct_Main0 *main0_p);
|
||||
|
||||
#endif //GUARD_UNION_ROOM_PLAYER_AVATAR_H
|
||||
+2
-2
@@ -103,8 +103,8 @@ extern const u8 gText_ItemCantBeHeld[];
|
||||
extern const u8 gText_TMCase[];
|
||||
extern const u8 gText_Close[];
|
||||
extern const u8 gText_TMCaseWillBePutAway[];
|
||||
extern const u8 gText_FontSize0[];
|
||||
extern const u8 gText_FontSize2[];
|
||||
extern const u8 gText_Font0[];
|
||||
extern const u8 gText_Font2[];
|
||||
extern const u8 gText_OhNoICantBuyThat[];
|
||||
extern const u8 gText_HowManyWouldYouLikeToSell[];
|
||||
extern const u8 gText_ICanPayThisMuch_WouldThatBeOkay[];
|
||||
|
||||
+13
-9
@@ -1,17 +1,21 @@
|
||||
#ifndef GUARD_TM_CASE_H
|
||||
#define GUARD_TM_CASE_H
|
||||
|
||||
enum TmCaseType
|
||||
{
|
||||
TMCASE_FROMFIELD,
|
||||
TMCASE_FROMPARTYGIVE,
|
||||
TMCASE_FROMMARTSELL,
|
||||
TMCASE_FROMPOKEMONSTORAGEPC,
|
||||
TMCASE_FROMBATTLE,
|
||||
TMCASE_NA
|
||||
// Values for 'type' argument to InitTMCase
|
||||
enum {
|
||||
TMCASE_FIELD,
|
||||
TMCASE_GIVE_PARTY,
|
||||
TMCASE_SELL,
|
||||
TMCASE_GIVE_PC,
|
||||
TMCASE_POKEDUDE,
|
||||
TMCASE_REOPENING,
|
||||
};
|
||||
|
||||
void InitTMCase(u8 a0, void (* a1)(void), u8 a2);
|
||||
// Alternative value for 'allowSelectClose' argument to InitTMCase.
|
||||
// Indicates that the previous value should be preserved
|
||||
#define TMCASE_KEEP_PREV 0xFF
|
||||
|
||||
void InitTMCase(u8 type, void (* exitCallback)(void), bool8 allowSelectClose);
|
||||
void ResetTMCaseCursorPos(void);
|
||||
void Pokedude_InitTMCase(void);
|
||||
|
||||
|
||||
+3
-3
@@ -13,10 +13,10 @@ extern const u8 gText_FemaleSymbol4[];
|
||||
extern const u8 gText_GenderlessSymbol[];
|
||||
|
||||
extern const u16 gTradeOrHatchMonShadowTilemap[];
|
||||
void CB2_ReturnFromLinkTrade(void);
|
||||
void CB2_StartCreateTradeMenu(void);
|
||||
s32 Trade_CalcLinkPlayerCompatibilityParam(void);
|
||||
s32 CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isEventLegal);
|
||||
s32 GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal);
|
||||
s32 CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData rfuPlayer, u16 species2, u16 species, u8 isEventLegal);
|
||||
s32 GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData rfuPlayer, struct RfuGameCompatibilityData rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal);
|
||||
void CB2_ReturnToTradeMenuFromSummary(void);
|
||||
|
||||
#endif //GUARD_TRADE_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_TRADE_SCENE_H
|
||||
#define GUARD_TRADE_SCENE_H
|
||||
|
||||
void CB2_InitTradeAnim_LinkTrade(void);
|
||||
void CB2_LinkTrade(void);
|
||||
void CreateInGameTradePokemon(void);
|
||||
void DoInGameTradeScene(void);
|
||||
void DrawTextOnTradeWindow(u8 windowId, const u8 *str, s8 speed);
|
||||
|
||||
+85
-97
@@ -3,58 +3,60 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "link_rfu.h"
|
||||
#include "constants/union_room.h"
|
||||
|
||||
// Return value of IsRequestedTypeAndSpeciesInPlayerParty
|
||||
#define UR_TRADE_MATCH 0
|
||||
#define UR_TRADE_NOTYPE 1
|
||||
#define UR_TRADE_NOEGG 2
|
||||
// In the Union Room the player is only ever connected to ≤ 4 other players.
|
||||
// However, there can be up to MAX_UNION_ROOM_LEADERS (8) object events to
|
||||
// represent leaders of recently discovered link groups, and each of those groups
|
||||
// may have up to MAX_RFU_PLAYERS (5) players in it including the leader.
|
||||
// These players are represented on-screen by NPC sprites drawn around the leader.
|
||||
// Thus there can be 40 sprites of other players on-screen, in 8 groups of 5.
|
||||
#define NUM_UNION_ROOM_SPRITES (MAX_UNION_ROOM_LEADERS * MAX_RFU_PLAYERS)
|
||||
|
||||
#define UROOM_MAX_GROUP_COUNT 8
|
||||
#define UROOM_MAX_PARTY_SIZE 5
|
||||
// The maximum number of recently connected players that can be tracked.
|
||||
// Note that this is significantly less than NUM_UNION_ROOM_SPRITES, i.e. not
|
||||
// every player that can be shown in the Union Room can be tracked at once.
|
||||
// Information such as a group member's gender can instead be read from partnerInfo
|
||||
// of the leader's RfuGameData by tracking at least all of the group leaders.
|
||||
#define MAX_RFU_PLAYER_LIST_SIZE 16
|
||||
|
||||
struct UnionGnameUnamePair
|
||||
struct RfuPlayerData
|
||||
{
|
||||
struct GFtgtGname gname;
|
||||
u8 ALIGNED(4) uname[PLAYER_NAME_LENGTH + 1];
|
||||
struct RfuGameData data;
|
||||
u8 ALIGNED(4) name[RFU_USER_NAME_LENGTH];
|
||||
};
|
||||
|
||||
struct UnkStruct_x1C
|
||||
struct RfuPlayer
|
||||
{
|
||||
struct UnionGnameUnamePair gname_uname;
|
||||
struct RfuPlayerData rfu;
|
||||
u16 timeoutCounter;
|
||||
u8 groupScheduledAnim:2;
|
||||
bool8 useRedText:1; // Never set
|
||||
u8 newPlayerCountdown;
|
||||
u8 unused;
|
||||
};
|
||||
|
||||
struct RfuPlayerList
|
||||
{
|
||||
struct RfuPlayer players[MAX_RFU_PLAYER_LIST_SIZE];
|
||||
};
|
||||
|
||||
struct RfuIncomingPlayer
|
||||
{
|
||||
struct RfuPlayerData rfu;
|
||||
u8 active:1;
|
||||
};
|
||||
|
||||
struct UnkStruct_x20
|
||||
struct RfuIncomingPlayerList
|
||||
{
|
||||
struct UnionGnameUnamePair gname_uname;
|
||||
u16 field_18;
|
||||
u8 groupScheduledAnim:2;
|
||||
bool8 field_1A_1:1;
|
||||
u8 field_1B;
|
||||
u32 field_1C; // unused
|
||||
struct RfuIncomingPlayer players[MAX_RFU_PLAYERS];
|
||||
};
|
||||
|
||||
// These arrays are dynamically allocated but must be
|
||||
// represented as structs to match.
|
||||
// Don't ask me why.
|
||||
|
||||
// FIXME: Find a way around this.
|
||||
|
||||
struct UnkStruct_Main0
|
||||
struct WirelessLink_Leader
|
||||
{
|
||||
struct UnkStruct_x20 arr[0];
|
||||
};
|
||||
|
||||
struct UnkStruct_Main4
|
||||
{
|
||||
struct UnkStruct_x1C arr[0];
|
||||
};
|
||||
|
||||
struct UnkStruct_Leader
|
||||
{
|
||||
struct UnkStruct_Main0 * field_0;
|
||||
struct UnkStruct_Main4 * field_4;
|
||||
struct UnkStruct_Main0 * field_8;
|
||||
struct RfuPlayerList * playerList;
|
||||
struct RfuIncomingPlayerList * incomingPlayerList;
|
||||
struct RfuPlayerList * playerListBackup;
|
||||
u8 state;
|
||||
u8 textState;
|
||||
u8 delayTimerAfterOk;
|
||||
@@ -63,36 +65,35 @@ struct UnkStruct_Leader
|
||||
u8 nPlayerModeWindowId;
|
||||
u8 listTaskId;
|
||||
u8 playerCount;
|
||||
u8 messageWindowId;
|
||||
u8 field_15;
|
||||
u8 field_16;
|
||||
u16 yesNoWindowId;
|
||||
u8 unused;
|
||||
u8 listenTaskId;
|
||||
u8 activity;
|
||||
u8 field_19;
|
||||
u16 field_1A;
|
||||
u8 joinRequestAnswer;
|
||||
u16 memberConfirmTimeout;
|
||||
};
|
||||
|
||||
struct UnkStruct_Group
|
||||
struct WirelessLink_Group
|
||||
{
|
||||
struct UnkStruct_Main0 * field_0;
|
||||
struct UnkStruct_Main4 * field_4;
|
||||
struct RfuPlayerList * playerList;
|
||||
struct RfuIncomingPlayerList * incomingPlayerList;
|
||||
u8 state;
|
||||
u8 textState;
|
||||
u8 field_A; // unused
|
||||
u8 delayTimerAfterOk; // unused
|
||||
u8 listWindowId;
|
||||
u8 bButtonCancelWindowId;
|
||||
u8 playerNameAndIdWindowId;
|
||||
u8 listTaskId;
|
||||
u8 leaderId;
|
||||
u8 field_10;
|
||||
u8 unused;
|
||||
u8 listenTaskId;
|
||||
u8 cardOrNews;
|
||||
u8 field_13; // referenced but never set
|
||||
bool8 isWonderNews;
|
||||
bool8 showListMenu; // referenced but never set
|
||||
u8 refreshTimer;
|
||||
u8 delayBeforePrint;
|
||||
};
|
||||
|
||||
struct UnionObj
|
||||
struct UnionRoomObject
|
||||
{
|
||||
u8 state;
|
||||
u8 gfxId;
|
||||
@@ -100,69 +101,56 @@ struct UnionObj
|
||||
u8 schedAnim;
|
||||
};
|
||||
|
||||
struct UnkStruct_URoom
|
||||
struct WirelessLink_URoom
|
||||
{
|
||||
/* 0x000 */ struct UnkStruct_Main0 * field_0;
|
||||
/* 0x004 */ struct UnkStruct_Main4 * field_4;
|
||||
/* 0x008 */ struct UnkStruct_Main0 * field_8;
|
||||
/* 0x00C */ struct UnkStruct_Main4 * field_C;
|
||||
/* 0x010 */ u16 field_10;
|
||||
/* 0x012 */ u16 field_12;
|
||||
/* 0x014 */ u8 state;
|
||||
/* 0x015 */ u8 stateAfterPrint;
|
||||
/* 0x016 */ u8 textState;
|
||||
/* 0x017 */ u8 field_17;
|
||||
/* 0x018 */ u8 field_18;
|
||||
/* 0x019 */ u8 field_19;
|
||||
/* 0x01A */ u8 field_1A;
|
||||
/* 0x01B */ u8 topListMenuWindowId;
|
||||
/* 0x01C */ u8 topListMenuListMenuId;
|
||||
/* 0x01D */ u8 tradeBoardSelectWindowId;
|
||||
/* 0x01E */ u8 tradeBoardDetailsWindowId;
|
||||
/* 0x01F */ u8 field_1F;
|
||||
/* 0x020 */ u8 field_20;
|
||||
/* 0x021 */ u8 spriteIds[40];
|
||||
/* 0x049 */ u8 field_49;
|
||||
/* 0x04A */ u8 tradeBoardListMenuId;
|
||||
|
||||
// For communication with potential link partners
|
||||
/* 0x04C */ u16 playerSendBuffer[6];
|
||||
/* 0x058 */ u8 activityRequestStrbufs[4][11];
|
||||
/* 0x084 */ u16 partnerYesNoResponse;
|
||||
/* 0x086 */ u16 recvActivityRequest[3]; // activity[, species, level]
|
||||
/* 0x08C */ struct UnionObj unionObjs[8];
|
||||
/* 0x0AC */ u8 trainerCardStrbufs[12][15];
|
||||
/* 0x160 */ u8 field_174[48];
|
||||
/* 0x190 */ u8 field_1A4[200];
|
||||
};
|
||||
|
||||
union UnkUnion_Main
|
||||
{
|
||||
struct UnkStruct_Leader * leader;
|
||||
struct UnkStruct_Group * group;
|
||||
struct UnkStruct_URoom * uRoom;
|
||||
struct RfuPlayerList * playerList;
|
||||
struct RfuIncomingPlayerList * incomingChildList;
|
||||
struct RfuPlayerList * spawnPlayer;
|
||||
struct RfuIncomingPlayerList * incomingParentList;
|
||||
u16 unknown; // Never read
|
||||
u16 unreadPlayerId;
|
||||
u8 state;
|
||||
u8 stateAfterPrint;
|
||||
u8 textState;
|
||||
u8 filler[4];
|
||||
u8 topListMenuWindowId;
|
||||
u8 topListMenuId;
|
||||
u8 tradeBoardMainWindowId;
|
||||
u8 tradeBoardHeaderWindowId;
|
||||
u8 unused1;
|
||||
u8 searchTaskId;
|
||||
u8 spriteIds[NUM_UNION_ROOM_SPRITES];
|
||||
u8 unused2;
|
||||
u8 tradeBoardListMenuId;
|
||||
// For communication with potential link partners
|
||||
u16 playerSendBuffer[6];
|
||||
u8 activityRequestStrbufs[4][11];
|
||||
u16 partnerYesNoResponse;
|
||||
u16 recvActivityRequest[3]; // activity[, species, level]
|
||||
struct UnionRoomObject objects[MAX_UNION_ROOM_LEADERS];
|
||||
u8 trainerCardStrBuffer[12][15];
|
||||
u8 trainerCardColorStrBuffer[48];
|
||||
u8 trainerCardMsgStrBuffer[200];
|
||||
};
|
||||
|
||||
struct UnionRoomTrade
|
||||
{
|
||||
u16 field_0;
|
||||
u16 state;
|
||||
u16 type;
|
||||
u32 playerPersonality;
|
||||
u8 field_8;
|
||||
u8 field_9;
|
||||
u8 offerPlayerId;
|
||||
u16 playerSpecies;
|
||||
u16 playerLevel;
|
||||
u16 species;
|
||||
u16 level;
|
||||
u16 field_12;
|
||||
u32 personality;
|
||||
};
|
||||
|
||||
extern struct GFtgtGnameSub gPartnerTgtGnameSub;
|
||||
extern struct RfuGameCompatibilityData gRfuPartnerCompatibilityData;
|
||||
extern u16 gUnionRoomOfferedSpecies;
|
||||
extern u8 gUnionRoomRequestedMonType;
|
||||
|
||||
void StartUnionRoomBattle(u16 battleFlags);
|
||||
u8 UnionRoom_CreateTask_CallCB2ReturnFromLinkTrade(void);
|
||||
u8 CreateTask_CreateTradeMenu(void);
|
||||
|
||||
#endif //GUARD_UNION_ROOM_H
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef GUARD_UNION_ROOM_PLAYER_AVATAR_H
|
||||
#define GUARD_UNION_ROOM_PLAYER_AVATAR_H
|
||||
|
||||
#include "union_room.h"
|
||||
|
||||
u8 InitUnionRoomPlayerObjects(struct UnionRoomObject * players);
|
||||
void DestroyUnionRoomPlayerObjects(void);
|
||||
void CreateUnionRoomPlayerSprites(u8 *spriteIds, s32 leaderId);
|
||||
void DestroyUnionRoomPlayerSprites(u8 *spriteIds);
|
||||
void MakeGroupAssemblyAreasPassable(void);
|
||||
void ScheduleUnionRoomPlayerRefresh(struct WirelessLink_URoom *uroom);
|
||||
void HandleUnionRoomPlayerRefresh(struct WirelessLink_URoom *uroom);
|
||||
bool32 TryInteractWithUnionRoomMember(struct RfuPlayerList *list, s16 *memberIdPtr, s16 *leaderIdPtr, u8 *spriteIds);
|
||||
void UpdateUnionRoomMemberFacing(u32 memberId, u32 leaderId, struct RfuPlayerList *list);
|
||||
|
||||
#endif //GUARD_UNION_ROOM_PLAYER_AVATAR_H
|
||||
Reference in New Issue
Block a user