Merge pull request #1410 from GriffinRichards/doc-tradedata

Document trade sequence animation, some trade cleanup
This commit is contained in:
GriffinR 2021-04-26 13:26:12 -04:00 committed by GitHub
commit c0aedf8df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 930 additions and 832 deletions

View File

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 227 B

View File

Before

Width:  |  Height:  |  Size: 195 B

After

Width:  |  Height:  |  Size: 195 B

View File

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

View File

@ -4903,8 +4903,8 @@ extern const u16 gUnknown_08DDCF04[];
extern const u16 gTradeGba2_Pal[]; extern const u16 gTradeGba2_Pal[];
extern const u8 gTradeGba_Gfx[]; extern const u8 gTradeGba_Gfx[];
extern const u16 gTradeMenuMonBox_Tilemap[]; extern const u16 gTradeMenuMonBox_Tilemap[];
extern const u8 gTradeButtons_Gfx[]; extern const u8 gTradeCursor_Gfx[];
extern const u16 gUnknown_08DDB444[]; extern const u16 gTradeCursor_Pal[];
// Party menu // Party menu
extern const u32 gPartyMenuPokeball_Gfx[]; extern const u32 gPartyMenuPokeball_Gfx[];

View File

@ -1,3 +1,17 @@
#define GFXTAG_MENU_TEXT 200 // Used as a base tag in CB2_CreateTradeMenu and CB2_ReturnToTradeMenu
#define GFXTAG_CURSOR 300
#define GFXTAG_LINK_MON_GLOW 5550
#define GFXTAG_LINK_MON_SHADOW 5552
#define GFXTAG_CABLE_END 5554
#define GFXTAG_GBA_SCREEN 5556
#define GFXTAG_POKEBALL 5557
#define PALTAG_CURSOR 2345
#define PALTAG_MENU_TEXT 4925
#define PALTAG_LINK_MON 5551
#define PALTAG_GBA 5555
#define PALTAG_POKEBALL 5558
// Exists unused in RS as well // Exists unused in RS as well
static const u32 sUnusedStructSizes[] = static const u32 sUnusedStructSizes[] =
{ {
@ -25,7 +39,7 @@ static const u8 sText_Slash[] = _("/");
static const u8 sText_Lv[] = _("Lv. "); static const u8 sText_Lv[] = _("Lv. ");
static const u8 sText_ThreeDashes[] = _("---"); static const u8 sText_ThreeDashes[] = _("---");
static const u8 sText_FourQuestionMarks[] = _("????"); static const u8 sText_FourQuestionMarks[] = _("????");
static const u8 sText_832DAE4[] = _(""); static const u8 sText_UnusedEmpty[] = _("");
static const u8 sText_IsThisTradeOkay[] = _("Is this trade okay?"); static const u8 sText_IsThisTradeOkay[] = _("Is this trade okay?");
static const u8 sText_Cancel[] = _("CANCEL"); static const u8 sText_Cancel[] = _("CANCEL");
static const u8 sText_ChooseAPkmn[] = _("Choose a POKéMON."); static const u8 sText_ChooseAPkmn[] = _("Choose a POKéMON.");
@ -48,107 +62,113 @@ static const struct OamData sTradeOamData_32x16 =
.priority = 1 .priority = 1
}; };
static const struct OamData sTradeOamData_64x32 = static const struct OamData sOamData_Cursor =
{ {
.shape = SPRITE_SHAPE(64x32), .shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32), .size = SPRITE_SIZE(64x32),
.priority = 1 .priority = 1
}; };
static const union AnimCmd gSpriteAnim_832DC24[] = static const union AnimCmd sAnim_Cursor_Normal[] =
{ {
ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(0, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_832DC2C[] = static const union AnimCmd sAnim_Cursor_OnCancel[] =
{ {
ANIMCMD_FRAME(32, 5), ANIMCMD_FRAME(32, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const gSpriteAnimTable_832DC34[] = enum {
{ CURSOR_ANIM_NORMAL,
gSpriteAnim_832DC24, CURSOR_ANIM_ON_CANCEL,
gSpriteAnim_832DC2C
}; };
static const struct SpriteSheet sTradeButtonsSpriteSheet = static const union AnimCmd *const sAnims_Cursor[] =
{ {
.data = gTradeButtons_Gfx, [CURSOR_ANIM_NORMAL] = sAnim_Cursor_Normal,
[CURSOR_ANIM_ON_CANCEL] = sAnim_Cursor_OnCancel
};
static const struct SpriteSheet sCursor_SpriteSheet =
{
.data = gTradeCursor_Gfx,
.size = 0x800, .size = 0x800,
.tag = 300 .tag = GFXTAG_CURSOR
}; };
static const struct SpritePalette gUnknown_0832DC44 = static const struct SpritePalette sCursor_SpritePalette =
{ {
.data = gUnknown_08DDB444, .data = gTradeCursor_Pal,
.tag = 2345 .tag = PALTAG_CURSOR
}; };
static const union AnimCmd gSpriteAnim_832DC4C[] = static const union AnimCmd sAnim_MenuText_0[] =
{ {
ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(0, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_832DC54[] = static const union AnimCmd sAnim_MenuText_1[] =
{ {
ANIMCMD_FRAME(8, 5), ANIMCMD_FRAME(8, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_832DC5C[] = static const union AnimCmd sAnim_MenuText_2[] =
{ {
ANIMCMD_FRAME(16, 5), ANIMCMD_FRAME(16, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_832DC64[] = static const union AnimCmd sAnim_MenuText_3[] =
{ {
ANIMCMD_FRAME(24, 5), ANIMCMD_FRAME(24, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_832DC6C[] = static const union AnimCmd sAnim_MenuText_4[] =
{ {
ANIMCMD_FRAME(32, 5), ANIMCMD_FRAME(32, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_832DC74[] = static const union AnimCmd sAnim_MenuText_5[] =
{ {
ANIMCMD_FRAME(40, 5), ANIMCMD_FRAME(40, 5),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const gSpriteAnimTable_832DC7C[] = // These anims are not used
static const union AnimCmd *const sAnims_MenuText[] =
{ {
gSpriteAnim_832DC4C, sAnim_MenuText_0,
gSpriteAnim_832DC54, sAnim_MenuText_1,
gSpriteAnim_832DC5C, sAnim_MenuText_2,
gSpriteAnim_832DC64, sAnim_MenuText_3,
gSpriteAnim_832DC6C, sAnim_MenuText_4,
gSpriteAnim_832DC74 sAnim_MenuText_5
}; };
static const struct SpriteTemplate gSpriteTemplate_832DC94 = static const struct SpriteTemplate sSpriteTemplate_Cursor =
{ {
.tileTag = 300, .tileTag = GFXTAG_CURSOR,
.paletteTag = 2345, .paletteTag = PALTAG_CURSOR,
.oam = &sTradeOamData_64x32, .oam = &sOamData_Cursor,
.anims = gSpriteAnimTable_832DC34, .anims = sAnims_Cursor,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}; };
static const struct SpriteTemplate gSpriteTemplate_832DCAC = static const struct SpriteTemplate sSpriteTemplate_MenuText =
{ {
.tileTag = 200, .tileTag = GFXTAG_MENU_TEXT,
.paletteTag = 4925, .paletteTag = PALTAG_MENU_TEXT,
.oam = &sTradeOamData_32x16, .oam = &sTradeOamData_32x16,
.anims = gSpriteAnimTable_832DC7C, .anims = sAnims_MenuText,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
@ -158,7 +178,7 @@ static const u16 TradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbap
static const struct SpritePalette gSpritePalette_TradeScreenText = static const struct SpritePalette gSpritePalette_TradeScreenText =
{ {
.data = TradeScreenTextPalette, .data = TradeScreenTextPalette,
.tag = 4925 .tag = PALTAG_MENU_TEXT
}; };
// This is used to determine the next mon to select when the D-Pad is // This is used to determine the next mon to select when the D-Pad is
@ -337,26 +357,26 @@ static const u8 sTradeMonBoxCoords[][2][2] =
}, },
}; };
static const u8 sUnref_0832DE6E[] = static const u8 sUnusedCoords[][2] =
{ {
0x00, 0x0e, { 0, 14},
0x0f, 0x1d, {15, 29},
0x03, 0x05, { 3, 5},
0x03, 0x07, { 3, 7},
0x12, 0x05, {18, 5},
0x12, 0x07, {18, 7},
0x08, 0x07, { 8, 7},
0x16, 0x0c, {22, 12},
0x08, 0x07, { 8, 7},
0x16, 0x0c, {22, 12},
0x06, 0x07, { 6, 7},
0x18, 0x0c, {24, 12},
0x06, 0x07, { 6, 7},
0x18, 0x0c, {24, 12},
0x08, 0x07, { 8, 7},
0x16, 0x0c, {22, 12},
0x07, 0x07, { 7, 7},
0x17, 0x0c {23, 12}
}; };
static const u8 *const sTradeActionTexts[] = static const u8 *const sTradeActionTexts[] =
@ -620,42 +640,42 @@ static const u8 sTradeMenuPartyMonBoxDimensions[3][2] =
[TRADE_PARTNER] = {19, 3} [TRADE_PARTNER] = {19, 3}
}; };
static const u16 sTradePal_PokeBall[] = INCBIN_U16("graphics/trade/pokeball.gbapal"); static const u16 sPokeball_Pal[] = INCBIN_U16("graphics/trade/pokeball.gbapal");
static const u8 sTradeGfx_PokeBall[] = INCBIN_U8("graphics/trade/pokeball.4bpp"); static const u8 sPokeball_Gfx[] = INCBIN_U8("graphics/trade/pokeball.4bpp");
static const u8 sTradeGfx_PokeBallSymbol[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp"); // unused? static const u8 sPokeballSymbol_Gfx[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp"); // unused
static const u16 sTradeTilemap_Cable[] = INCBIN_U16("graphics/trade/cable_closeup_map.bin"); static const u16 sCrossingHighlightCable_Tilemap[] = INCBIN_U16("graphics/trade/crossing_highlight_cable.bin");
static const u16 sTradeTilemap_PokeBallSymbol[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin"); // unused? static const u16 sTradeTilemap_PokeBallSymbol[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin"); // unused?
static const u16 sUnref_083308C0[] = INCBIN_U16("graphics/trade/unknown_3308C0.gbapal"); static const u16 sUnusedPal1[] = INCBIN_U16("graphics/trade/unused1.gbapal");
static const u16 sTradePal_Gba[] = INCBIN_U16("graphics/trade/gba.gbapal"); static const u16 sGba_Pal[] = INCBIN_U16("graphics/trade/gba.gbapal");
static const u16 sTradePal_ShadowUnused[] = INCBIN_U16("graphics/trade/shadow.gbapal"); static const u16 sUnusedPal2[] = INCBIN_U16("graphics/trade/unused2.gbapal");
static const u16 sTradePal_BlackUnused[] = INCBIN_U16("graphics/trade/black.gbapal"); static const u16 sWirelessSignalNone_Pal_Unused[] = INCBIN_U16("graphics/trade/wireless_signal_none.gbapal");
static const u16 sTradePal_Misc[] = INCBIN_U16("graphics/trade/misc.gbapal"); static const u16 sLinkMon_Pal[] = INCBIN_U16("graphics/trade/link_mon.gbapal");
static const u8 sTradeGfx_Glow1[] = INCBIN_U8("graphics/trade/glow1.4bpp"); static const u8 sLinkMonGlow_Gfx[] = INCBIN_U8("graphics/trade/link_mon_glow.4bpp");
static const u8 sTradeGfx_Glow2[] = INCBIN_U8("graphics/trade/glow2.4bpp"); static const u8 sLinkMonShadow_Gfx[] = INCBIN_U8("graphics/trade/link_mon_shadow.4bpp");
static const u8 sTradeGfx_CableEnd[] = INCBIN_U8("graphics/trade/cable_end.4bpp"); static const u8 sCableEnd_Gfx[] = INCBIN_U8("graphics/trade/cable_end.4bpp");
static const u8 sTradeGfx_GbaScreen[] = INCBIN_U8("graphics/trade/gba_screen.4bpp"); static const u8 sGbaScreen_Gfx[] = INCBIN_U8("graphics/trade/gba_screen.4bpp");
const u16 gUnknown_08331F60[] = INCBIN_U16("graphics/trade/shadow_map.bin"); const u16 gTradePlatform_Tilemap[] = INCBIN_U16("graphics/trade/platform.bin");
static const u8 sTradeAffine_Gba[] = INCBIN_U8("graphics/trade/gba_affine.8bpp"); static const u8 sGbaAffine_Gfx[] = INCBIN_U8("graphics/trade/gba_affine.8bpp"); // Only the gfx for when the GBA is zooming in/out
static const u8 sFiller_08335760[64] = {}; static const u8 sEmptyGfx[64] = {};
static const u8 sTradeAffineMap_GbaCable[] = INCBIN_U8("graphics/trade/gba_affine_map_cable.bin"); static const u8 sGbaCable_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_cable.bin");
static const u8 sTradeAffineMap_GbaWireless[] = INCBIN_U8("graphics/trade/gba_affine_map_wireless.bin"); static const u8 sGbaWireless_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_wireless.bin");
static const u16 sTradeTilemap_GbaWireless[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin"); static const u16 sGbaWireless_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin");
static const u16 sTradeTilemap_GbaCable[] = INCBIN_U16("graphics/trade/gba_map_cable.bin"); static const u16 sGbaCable_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_cable.bin");
static const u32 gUnknown_083379A0[] = INCBIN_U32("graphics/trade/unknown_3379A0.bin.lz"); //some wireless tilemap static const u32 sCrossingHighlightWireless_Tilemap[] = INCBIN_U32("graphics/trade/crossing_highlight_wireless.bin.lz");
static const u16 sTradePal_WirelessSignalSend[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal"); static const u16 sWirelessSignalSend_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal");
static const u16 sTradePal_WirelessSignalReceive[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal"); static const u16 sWirelessSignalRecv_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal");
static const u16 sTradePal_Black[] = INCBIN_U16("graphics/trade/black.gbapal"); static const u16 sWirelessSignalNone_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_none.gbapal");
static const u32 sTradeGfx_WirelessSignal[] = INCBIN_U32("graphics/trade/wireless_signal.4bpp.lz"); static const u32 sWirelessSignal_Gfx[] = INCBIN_U32("graphics/trade/wireless_signal.4bpp.lz");
static const u32 sTradeTilemap_WirelessSignal[] = INCBIN_U32("graphics/trade/wireless_signal.bin.lz"); static const u32 sWirelessSignal_Tilemap[] = INCBIN_U32("graphics/trade/wireless_signal.bin.lz");
static const struct OamData sTradeOamData_16x16 = static const struct OamData sOamData_Pokeball =
{ {
.affineMode = ST_OAM_AFFINE_NORMAL, .affineMode = ST_OAM_AFFINE_NORMAL,
.shape = SPRITE_SHAPE(16x16), .shape = SPRITE_SHAPE(16x16),
.size = SPRITE_SIZE(16x16) .size = SPRITE_SIZE(16x16)
}; };
static const union AnimCmd gSpriteAnim_8338C4C[] = static const union AnimCmd sAnim_Pokeball_SpinOnce[] =
{ {
ANIMCMD_FRAME( 0, 3), ANIMCMD_FRAME( 0, 3),
ANIMCMD_FRAME( 4, 3), ANIMCMD_FRAME( 4, 3),
@ -674,7 +694,7 @@ static const union AnimCmd gSpriteAnim_8338C4C[] =
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_8338C88[] = static const union AnimCmd sAnim_Pokeball_SpinTwice[] =
{ {
ANIMCMD_FRAME( 0, 3), ANIMCMD_FRAME( 0, 3),
ANIMCMD_FRAME( 4, 3), ANIMCMD_FRAME( 4, 3),
@ -693,25 +713,25 @@ static const union AnimCmd gSpriteAnim_8338C88[] =
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const gSpriteAnimTable_8338C88[] = static const union AnimCmd *const sAnims_Pokeball[] =
{ {
gSpriteAnim_8338C4C, sAnim_Pokeball_SpinOnce,
gSpriteAnim_8338C88 sAnim_Pokeball_SpinTwice
}; };
static const union AffineAnimCmd gSpriteAffineAnim_8338CCC[] = static const union AffineAnimCmd sAffineAnim_Pokeball_Normal[] =
{ {
AFFINEANIMCMD_FRAME(0, 0, 0, 1), AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_END AFFINEANIMCMD_END
}; };
static const union AffineAnimCmd gSpriteAffineAnim_8338CDC[] = static const union AffineAnimCmd sAffineAnim_Pokeball_Squish[] =
{ {
AFFINEANIMCMD_FRAME(-8, 0, 0, 20), AFFINEANIMCMD_FRAME(-8, 0, 0, 20),
AFFINEANIMCMD_END AFFINEANIMCMD_END
}; };
static const union AffineAnimCmd gSpriteAffineAnim_8338CEC[] = static const union AffineAnimCmd sAffineAnim_Pokeball_Unsquish[] =
{ {
AFFINEANIMCMD_FRAME(0x60, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x60, 0x100, 0, 0),
AFFINEANIMCMD_FRAME( 0, 0, 0, 5), AFFINEANIMCMD_FRAME( 0, 0, 0, 5),
@ -719,38 +739,38 @@ static const union AffineAnimCmd gSpriteAffineAnim_8338CEC[] =
AFFINEANIMCMD_END AFFINEANIMCMD_END
}; };
static const union AffineAnimCmd *const gSpriteAffineAnimTable_8338D0C[] = static const union AffineAnimCmd *const sAffineAnims_Pokeball[] =
{ {
gSpriteAffineAnim_8338CCC, sAffineAnim_Pokeball_Normal,
gSpriteAffineAnim_8338CDC, sAffineAnim_Pokeball_Squish,
gSpriteAffineAnim_8338CEC sAffineAnim_Pokeball_Unsquish
}; };
static const struct SpriteSheet sPokeBallSpriteSheet = static const struct SpriteSheet sPokeBallSpriteSheet =
{ {
.data = sTradeGfx_PokeBall, .data = sPokeball_Gfx,
.size = 0x600, .size = 0x600,
.tag = 5557 .tag = GFXTAG_POKEBALL
}; };
static const struct SpritePalette sPokeBallSpritePalette = static const struct SpritePalette sPokeBallSpritePalette =
{ {
.data = sTradePal_PokeBall, .data = sPokeball_Pal,
.tag = 5558 .tag = PALTAG_POKEBALL
}; };
static const struct SpriteTemplate gSpriteTemplate_8338D28 = static const struct SpriteTemplate sSpriteTemplate_Pokeball =
{ {
.tileTag = 5557, .tileTag = GFXTAG_POKEBALL,
.paletteTag = 5558, .paletteTag = PALTAG_POKEBALL,
.oam = &sTradeOamData_16x16, .oam = &sOamData_Pokeball,
.anims = gSpriteAnimTable_8338C88, .anims = sAnims_Pokeball,
.images = NULL, .images = NULL,
.affineAnims = gSpriteAffineAnimTable_8338D0C, .affineAnims = sAffineAnims_Pokeball,
.callback = sub_807E55C .callback = SpriteCB_BouncingPokeball
}; };
static const struct OamData sTradeOamData_32x32 = static const struct OamData sOamData_LinkMonGlow =
{ {
.affineMode = ST_OAM_AFFINE_NORMAL, .affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND, .objMode = ST_OAM_OBJ_BLEND,
@ -759,146 +779,151 @@ static const struct OamData sTradeOamData_32x32 =
.priority = 1 .priority = 1
}; };
static const union AnimCmd gSpriteAnim_8338D48[] = static const union AnimCmd sAnim_LinkMonGlow[] =
{ {
ANIMCMD_FRAME(0, 5, .hFlip = TRUE, .vFlip = TRUE), ANIMCMD_FRAME(0, 5, .hFlip = TRUE, .vFlip = TRUE), // ? The graphic is a perfect circle, no need to flip
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const gSpriteAnimTable_8338D50[] = static const union AnimCmd *const sAnims_LinkMonGlow[] =
{ {
gSpriteAnim_8338D48 sAnim_LinkMonGlow
}; };
static const union AffineAnimCmd gSpriteAffineAnim_8338D54[] = static const union AffineAnimCmd sAffineAnim_LinkMonGlow[] =
{ {
AFFINEANIMCMD_FRAME(-10, -10, 0, 5), AFFINEANIMCMD_FRAME(-10, -10, 0, 5),
AFFINEANIMCMD_FRAME(10, 10, 0, 5), AFFINEANIMCMD_FRAME(10, 10, 0, 5),
AFFINEANIMCMD_JUMP(0) AFFINEANIMCMD_JUMP(0)
}; };
static const union AffineAnimCmd *const gSpriteAffineAnimTable_8338D6C[] = static const union AffineAnimCmd *const sAffineAnims_LinkMonGlow[] =
{ {
gSpriteAffineAnim_8338D54 sAffineAnim_LinkMonGlow
}; };
static const struct SpriteSheet sGlow1SpriteSheet = static const struct SpriteSheet sSpriteSheet_LinkMonGlow =
{ {
.data = sTradeGfx_Glow1, .data = sLinkMonGlow_Gfx,
.size = 0x200, .size = 0x200,
.tag = 5550 .tag = GFXTAG_LINK_MON_GLOW
}; };
static const struct SpritePalette sMiscTradeSpritePalette = static const struct SpritePalette sSpritePalette_LinkMon =
{ {
.data = sTradePal_Misc, .data = sLinkMon_Pal,
.tag = 5551 .tag = PALTAG_LINK_MON
}; };
static const struct SpritePalette sGbaSpritePalette = static const struct SpritePalette sSpritePalette_Gba =
{ {
.data = sTradePal_Gba, .data = sGba_Pal,
.tag = 5555 .tag = PALTAG_GBA
}; };
static const struct SpriteTemplate gUnknown_08338D88 = static const struct SpriteTemplate sSpriteTemplate_LinkMonGlow =
{ {
.tileTag = 5550, .tileTag = GFXTAG_LINK_MON_GLOW,
.paletteTag = 5551, .paletteTag = PALTAG_LINK_MON,
.oam = &sTradeOamData_32x32, .oam = &sOamData_LinkMonGlow,
.anims = gSpriteAnimTable_8338D50, .anims = sAnims_LinkMonGlow,
.images = NULL, .images = NULL,
.affineAnims = gSpriteAffineAnimTable_8338D6C, .affineAnims = sAffineAnims_LinkMonGlow,
.callback = sub_807AA28 .callback = SpriteCB_LinkMonGlow
}; };
static const struct OamData sTradeOamData_16x32 = static const struct OamData sOamData_LinkMonShadow =
{ {
.shape = SPRITE_SHAPE(16x32), .shape = SPRITE_SHAPE(16x32),
.size = SPRITE_SIZE(16x32), .size = SPRITE_SIZE(16x32),
.priority = 1 .priority = 1
}; };
static const union AnimCmd gSpriteAnim_8338DA8[] = static const union AnimCmd sAnim_LinkMonShadow_Big[] =
{ {
ANIMCMD_FRAME(0, 5, .vFlip = TRUE, .hFlip = TRUE), ANIMCMD_FRAME(0, 5, .vFlip = TRUE, .hFlip = TRUE),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_8338DB0[] = static const union AnimCmd sAnim_LinkMonShadow_Small[] =
{ {
ANIMCMD_FRAME(8, 5, .vFlip = TRUE, .hFlip = TRUE), ANIMCMD_FRAME(8, 5, .vFlip = TRUE, .hFlip = TRUE),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const gSpriteAnimTable_8338DB8[] = enum {
{ ANIM_LINKMON_BIG,
gSpriteAnim_8338DA8, ANIM_LINKMON_SMALL,
gSpriteAnim_8338DB0
}; };
static const struct SpriteSheet sGlow2SpriteSheet = static const union AnimCmd *const sAnims_LinkMonShadow[] =
{ {
.data = sTradeGfx_Glow2, [ANIM_LINKMON_BIG] = sAnim_LinkMonShadow_Big,
[ANIM_LINKMON_SMALL] = sAnim_LinkMonShadow_Small
};
static const struct SpriteSheet sSpriteSheet_LinkMonShadow =
{
.data = sLinkMonShadow_Gfx,
.size = 0x300, .size = 0x300,
.tag = 5552 .tag = GFXTAG_LINK_MON_SHADOW
}; };
static const struct SpriteTemplate sGlowBallSpriteTemplate = static const struct SpriteTemplate sSpriteTemplate_LinkMonShadow =
{ {
.tileTag = 5552, .tileTag = GFXTAG_LINK_MON_SHADOW,
.paletteTag = 5551, .paletteTag = PALTAG_LINK_MON,
.oam = &sTradeOamData_16x32, .oam = &sOamData_LinkMonShadow,
.anims = gSpriteAnimTable_8338DB8, .anims = sAnims_LinkMonShadow,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_807AA7C .callback = SpriteCB_LinkMonShadow
}; };
static const struct OamData sTradeOamData_16x32_2 = static const struct OamData sOamData_CableEnd =
{ {
.shape = SPRITE_SHAPE(16x32), .shape = SPRITE_SHAPE(16x32),
.size = SPRITE_SIZE(16x32), .size = SPRITE_SIZE(16x32),
.priority = 1 .priority = 1
}; };
static const union AnimCmd gSpriteAnim_8338DE8[] = static const union AnimCmd sAnim_CableEnd[] =
{ {
ANIMCMD_FRAME(0, 10), ANIMCMD_FRAME(0, 10),
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const gSpriteAnimTable_8338DF0[] = static const union AnimCmd *const sAnims_CableEnd[] =
{ {
gSpriteAnim_8338DE8 sAnim_CableEnd
}; };
static const struct SpriteSheet sCableEndSpriteSheet = static const struct SpriteSheet sSpriteSheet_CableEnd =
{ {
.data = sTradeGfx_CableEnd, .data = sCableEnd_Gfx,
.size = 0x100, .size = 0x100,
.tag = 5554 .tag = GFXTAG_CABLE_END
}; };
static const struct SpriteTemplate gSpriteTemplate_8338DFC = static const struct SpriteTemplate sSpriteTemplate_CableEnd =
{ {
.tileTag = 5554, .tileTag = GFXTAG_CABLE_END,
.paletteTag = 5555, .paletteTag = PALTAG_GBA,
.oam = &sTradeOamData_16x32_2, .oam = &sOamData_CableEnd,
.anims = gSpriteAnimTable_8338DF0, .anims = sAnims_CableEnd,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_807AABC .callback = SpriteCB_CableEndSending
}; };
static const struct OamData sTradeOamData_64x32_2 = static const struct OamData sOamData_GbaScreen =
{ {
.shape = SPRITE_SHAPE(64x32), .shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32), .size = SPRITE_SIZE(64x32),
.priority = 1 .priority = 1
}; };
static const union AnimCmd gSpriteAnim_8338E1C[] = static const union AnimCmd sAnim_GbaScreen_Long[] =
{ {
ANIMCMD_FRAME( 0, 2, .vFlip = TRUE, .hFlip = TRUE), ANIMCMD_FRAME( 0, 2, .vFlip = TRUE, .hFlip = TRUE),
ANIMCMD_FRAME(32, 2, .vFlip = TRUE, .hFlip = TRUE), ANIMCMD_FRAME(32, 2, .vFlip = TRUE, .hFlip = TRUE),
@ -911,7 +936,7 @@ static const union AnimCmd gSpriteAnim_8338E1C[] =
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd gSpriteAnim_8338E40[] = static const union AnimCmd sAnim_GbaScreen_Short[] =
{ {
ANIMCMD_FRAME( 0, 2, .vFlip = TRUE, .hFlip = TRUE), ANIMCMD_FRAME( 0, 2, .vFlip = TRUE, .hFlip = TRUE),
ANIMCMD_FRAME(32, 2, .vFlip = TRUE, .hFlip = TRUE), ANIMCMD_FRAME(32, 2, .vFlip = TRUE, .hFlip = TRUE),
@ -924,56 +949,56 @@ static const union AnimCmd gSpriteAnim_8338E40[] =
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const gSpriteAnimTable_8338E64[] = static const union AnimCmd *const sAnims_GbaScreen_Long[] =
{ {
gSpriteAnim_8338E1C sAnim_GbaScreen_Long
}; };
static const union AnimCmd *const gSpriteAnimTable_8338E68[] = static const union AnimCmd *const sAnims_GbaScreen_Short[] =
{ {
gSpriteAnim_8338E40 sAnim_GbaScreen_Short
}; };
static const struct SpriteSheet sGbaScreenSpriteSheet = static const struct SpriteSheet sSpriteSheet_GbaScreen =
{ {
.data = sTradeGfx_GbaScreen, .data = sGbaScreen_Gfx,
.size = 0x1000, .size = 0x1000,
.tag = 5556 .tag = GFXTAG_GBA_SCREEN
}; };
static const struct SpriteTemplate gSpriteTemplate_8338E74 = static const struct SpriteTemplate sSpriteTemplate_GbaScreenFlash_Long =
{ {
.tileTag = 5556, .tileTag = GFXTAG_GBA_SCREEN,
.paletteTag = 5555, .paletteTag = PALTAG_GBA,
.oam = &sTradeOamData_64x32_2, .oam = &sOamData_GbaScreen,
.anims = gSpriteAnimTable_8338E64, .anims = sAnims_GbaScreen_Long,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_807AB04 .callback = SpriteCB_GbaScreen
}; };
static const struct SpriteTemplate gSpriteTemplate_8338E8C = static const struct SpriteTemplate sSpriteTemplate_GbaScreenFlash_Short =
{ {
.tileTag = 5556, .tileTag = GFXTAG_GBA_SCREEN,
.paletteTag = 5555, .paletteTag = PALTAG_GBA,
.oam = &sTradeOamData_64x32_2, .oam = &sOamData_GbaScreen,
.anims = gSpriteAnimTable_8338E68, .anims = sAnims_GbaScreen_Short,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_807AB04 .callback = SpriteCB_GbaScreen
}; };
static const u16 gUnknown_08338EA4[] = INCBIN_U16("graphics/trade/unknown_338EA4.gbapal"); static const u16 sLinkMonShadow_Pal[] = INCBIN_U16("graphics/trade/link_mon_shadow.gbapal");
static const union AffineAnimCmd gSpriteAffineAnim_8338EBC[] = static const union AffineAnimCmd sAffineAnim_CrossingMonPic[] =
{ {
AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0),
AFFINEANIMCMD_JUMP(0) AFFINEANIMCMD_JUMP(0)
}; };
static const union AffineAnimCmd *const gSpriteAffineAnimTable_8338ECC[] = static const union AffineAnimCmd *const sAffineAnims_CrossingMonPics[] =
{ {
gSpriteAffineAnim_8338EBC sAffineAnim_CrossingMonPic
}; };
static const struct InGameTrade sIngameTrades[] = static const struct InGameTrade sIngameTrades[] =
@ -1146,69 +1171,54 @@ static const struct BgTemplate sTradeSequenceBgTemplates[] =
static const s8 sTradeBallVerticalVelocityTable[] = static const s8 sTradeBallVerticalVelocityTable[] =
{ {
0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1,
1, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
1, 1, 2, 2, 4, 4, 4, 4, -4, -4, -4, -3, -3,
2, 2, 3, 3, -3, -3, -2, -2, -2, -2, -1, -1, -1,
3, 3, 4, 4, -1, 0, -1, 0, -1, 0, 0, 0, 0,
4, 4, -4, -4, 0, 1, 0, 1, 0, 1, 1, 1, 1,
-4, -3, -3, -3, 2, 2, 2, 2, 3, 3, 3, 3, 4,
-3, -2, -2, -2, 4, 4, 4, -4, -3, -3, -2, -2, -1,
-2, -1, -1, -1, -1, -1, 0, -1, 0, 0, 0, 0, 0,
-1, 0, -1, 0, 0, 1, 0, 1, 1, 1, 2, 2, 3,
-1, 0, 0, 0, 3, 4, -4, -3, -2, -1, -1, -1, 0,
0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 2, 3
1, 0, 1, 1,
1, 1, 2, 2,
2, 2, 3, 3,
3, 3, 4, 4,
4, 4, -4, -3,
-3, -2, -2, -1,
-1, -1, 0, -1,
0, 0, 0, 0,
0, 0, 1, 0,
1, 1, 1, 2,
2, 3, 3, 4,
-4, -3, -2, -1,
-1, -1, 0, 0,
0, 0, 1, 0,
1, 1, 2, 3
}; };
static const u8 sWirelessSignalTiming[][2] = static const u8 sWirelessSignalTiming[][2] =
{ {
{0, 1}, { 0, 1},
{1, 1}, { 1, 1},
{2, 1}, { 2, 1},
{3, 1}, { 3, 1},
{4, 1}, { 4, 1},
{5, 2}, { 5, 2},
{6, 2}, { 6, 2},
{7, 2}, { 7, 2},
{8, 2}, { 8, 2},
{9, 2}, { 9, 2},
{10, 3}, {10, 3},
{11, 3}, {11, 3},
{12, 3}, {12, 3},
{13, 4}, {13, 4},
{14, 5}, {14, 5},
{15, 2}, {15, 2},
{0, 1}, { 0, 1},
{1, 1}, { 1, 1},
{2, 1}, { 2, 1},
{3, 1}, { 3, 1},
{4, 1}, { 4, 1},
{5, 2}, { 5, 2},
{6, 2}, { 6, 2},
{7, 2}, { 7, 2},
{8, 2}, { 8, 2},
{9, 2}, { 9, 2},
{10, 3}, {10, 3},
{11, 3}, {11, 3},
{12, 3}, {12, 3},
{13, 4}, {13, 4},
{14, 5}, {14, 5},
{16, 1}, {16, 1},
{16, 255}, {16, -1},
{0, 0} {}
}; };

View File

@ -54,7 +54,7 @@ struct EggHatchData
u8 textColor[3]; u8 textColor[3];
}; };
extern const u32 gUnknown_08331F60[]; // tilemap gameboy circle extern const u32 gTradePlatform_Tilemap[];
extern const u8 gText_HatchedFromEgg[]; extern const u8 gText_HatchedFromEgg[];
extern const u8 gText_NicknameHatchPrompt[]; extern const u8 gText_NicknameHatchPrompt[];
@ -546,7 +546,7 @@ static void CB2_EggHatch_0(void)
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
LoadPalette(gTradeGba2_Pal, 0x10, 0xA0); LoadPalette(gTradeGba2_Pal, 0x10, 0xA0);
LoadBgTiles(1, gTradeGba_Gfx, 0x1420, 0); LoadBgTiles(1, gTradeGba_Gfx, 0x1420, 0);
CopyToBgTilemapBuffer(1, gUnknown_08331F60, 0x1000, 0); CopyToBgTilemapBuffer(1, gTradePlatform_Tilemap, 0x1000, 0);
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
gMain.state++; gMain.state++;
break; break;

View File

@ -1474,9 +1474,9 @@ static const u16 sEmptyPal[16] = {0};
// Trade // Trade
const u16 gTradeMenu_Pal[] = INCBIN_U16("graphics/trade/menu.gbapal"); const u16 gTradeMenu_Pal[] = INCBIN_U16("graphics/trade/menu.gbapal");
const u16 gUnknown_08DDB444[] = INCBIN_U16("graphics/trade/unknown_DDB444.gbapal"); const u16 gTradeCursor_Pal[] = INCBIN_U16("graphics/trade/cursor.gbapal");
const u8 gTradeMenu_Gfx[] = INCBIN_U8("graphics/trade/menu.4bpp"); const u8 gTradeMenu_Gfx[] = INCBIN_U8("graphics/trade/menu.4bpp");
const u8 gTradeButtons_Gfx[] = INCBIN_U8("graphics/trade/buttons.4bpp"); const u8 gTradeCursor_Gfx[] = INCBIN_U8("graphics/trade/cursor.4bpp");
const u16 gUnused_DDCEE4[] = INCBIN_U16("graphics/unused/unused_DDCEE4.bin"); const u16 gUnused_DDCEE4[] = INCBIN_U16("graphics/unused/unused_DDCEE4.bin");
const u16 gUnknown_08DDCF04[] = INCBIN_U16("graphics/trade/unknown_DDCF04.bin"); const u16 gUnknown_08DDCF04[] = INCBIN_U16("graphics/trade/unknown_DDCF04.bin");
const u16 gTradeMenuMonBox_Tilemap[] = INCBIN_U16("graphics/trade/menu_mon_box.bin"); const u16 gTradeMenuMonBox_Tilemap[] = INCBIN_U16("graphics/trade/menu_mon_box.bin");

File diff suppressed because it is too large Load Diff