Skip to content

Commit

Permalink
Document more of unk_200C5DC.c
Browse files Browse the repository at this point in the history
  • Loading branch information
citrusbolt committed Mar 2, 2024
1 parent 9a019ef commit e6635c7
Show file tree
Hide file tree
Showing 7 changed files with 249 additions and 223 deletions.
6 changes: 3 additions & 3 deletions payload/include/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct MonData
u32 setMailTo1:1;
u32 preserveHeldItem:1;
u32 heldItem:16; // 0x28
u16 unk2A;
u16 unused;
u16 moves[MAX_MON_MOVES]; // 0x2C , 0x2E , 0x30, 0x32
u8 pps[MAX_MON_MOVES]; // 0x34-0x37
u8 textBuffer[320];
Expand All @@ -46,7 +46,7 @@ struct MonLinkData
u32 unk_03_0:7;
u32 unk_03_7:1;
u32 unk4:24;
u32 unk7:8;
u32 monCount:8;
u32 personality;
u32 otId;
u16 species;
Expand All @@ -71,7 +71,7 @@ struct MonLinkData
u32 unk850_2:24;
u32 *monPtr;
u8 unk_858;
u8 unk_859;
u8 numMonsToSelect;
u8 unk_85A;
u8 species3; // Only 1 byte, so can not contain a Hoenn species
u8 ALIGNED(4) giftRibbons[GIFT_RIBBONS_COUNT + 1]; // Aligned for u32 copy
Expand Down
9 changes: 9 additions & 0 deletions payload/include/gba/io_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,15 @@
#define SIO_MULTI_DI_SHIFT 3
#define SIO_MULTI_DI_MASK 0x1

// joy bus
#define JOYCNT_RESET (1 << 0)
#define JOYCNT_RECV_CMPLT (1 << 1)
#define JOYCNT_TRAN_CMPLT (1 << 2)
#define JOYCNT_RESET_IRQ (1 << 6)

#define RCNT_JOYBUS1 (1 << 14)
#define RCNT_JOYBUS2 (1 << 15)

// keys
#define A_BUTTON 0x0001
#define B_BUTTON 0x0002
Expand Down
25 changes: 20 additions & 5 deletions payload/include/unk_200C5DC.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
#define LOBBY_SAVEWARP (1 << 2)
#define CHAMPION_SAVEWARP (1 << 7)

#define LINK_CMD_RESET 0x00
#define LINK_CMD_0x01 0x01
#define LINK_CMD_TRAN_PLAYER_DATA2 0x04
#define LINK_CMD_RECV_GIFT_DATA 0x22
#define LINK_CMD_TRAN_GIFT_DATA 0x33
#define LINK_CMD_0x44 0x44
#define LINK_CMD_RECV_PARTY_MON 0x55
#define LINK_CMD_SOFT_RESET_ROM 0x60
#define LINK_CMD_SOFT_RESET 0x61
#define LINK_CMD_RECV_MON_DATA 0x66
#define LINK_CMD_RECV_UNKNOWN 0x77
#define LINK_CMD_RECV_TEXT 0x88
#define LINK_CMD_TRAN_PLAYER_DATA1 0x99
#define LINK_CMD_READ_INPUT 0xAA

struct TransferData
{
volatile u32 *data;
Expand All @@ -18,7 +33,7 @@ struct TransferData
u8 field14;
u8 field15;
u8 field16;
u8 field17;
u8 currentCmd;
u8 field18;
u8 fill19;
u8 field20;
Expand All @@ -30,11 +45,11 @@ struct TransferData
u8 fill26;
u8 fill27;
u32 transferBytes;
u32 field32;
u32 gameCode;
u32 field36;
u32 field40;
u32 field44;
u32 field48;
u32 lowerCaseGameCode;
u32 gameCode2;
u32 makerCode;
};

extern volatile struct TransferData gTransferData;
Expand Down
Loading

0 comments on commit e6635c7

Please sign in to comment.