Merge branch 'master' of github.com:pret/pokeemerald into item_expansion_sync

This commit is contained in:
ultima-soul 2021-04-28 23:20:01 -07:00
commit 00c3f060b1
126 changed files with 5934 additions and 5716 deletions

View File

@ -918,10 +918,10 @@
.byte 0x76
.endm
@ Draws an image of the winner of the contest. In FireRed, this command is a nop. (The argument is discarded.)
.macro showcontestwinner a:req
@ Draws an image of the winner of the contest. winnerId is any CONTEST_WINNER_* constant.
.macro showcontestpainting winnerId:req
.byte 0x77
.byte \a
.byte \winnerId
.endm
@ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille

View File

@ -160,7 +160,7 @@ LilycoveCity_EventScript_MotelSign:: @ 81E2D11
LilycoveCity_EventScript_MuseumSign:: @ 81E2D1A
lockall
specialvar VAR_0x8004, CountPlayerContestPaintings
specialvar VAR_0x8004, CountPlayerMuseumPaintings
switch VAR_0x8004
case 0, LilycoveCity_EventScript_MuseumSignNoPaintings
msgbox LilycoveCity_Text_MuseumSignPlayersExhibit, MSGBOX_DEFAULT

View File

@ -49,7 +49,7 @@ LilycoveCity_ContestLobby_EventScript_ContestArtist:: @ 821A264
msgbox LilycoveCity_ContestLobby_Text_YourPokemonSpurredMeToPaint, MSGBOX_DEFAULT
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_ARTIST
showcontestpainting CONTEST_WINNER_ARTIST
lockall
msgbox LilycoveCity_ContestLobby_Text_ShouldITakePaintingToMuseum, MSGBOX_YESNO
compare VAR_RESULT, YES
@ -108,7 +108,7 @@ LilycoveCity_ContestLobby_EventScript_ReceivedArtistRibbon:: @ 821A314
return
LilycoveCity_ContestLobby_EventScript_UpdateMuseumPatrons:: @ 821A360
specialvar VAR_0x8004, CountPlayerContestPaintings
specialvar VAR_0x8004, CountPlayerMuseumPaintings
switch VAR_0x8004
case 1, LilycoveCity_ContestLobby_EventScript_ShowPatron1
case 2, LilycoveCity_ContestLobby_EventScript_ShowPatron2
@ -223,7 +223,7 @@ LilycoveCity_ContestLobby_EventScript_LinkContestArtist:: @ 821A436
msgbox LilycoveCity_ContestLobby_Text_YourPokemonSpurredMeToPaint, MSGBOX_DEFAULT
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_ARTIST
showcontestpainting CONTEST_WINNER_ARTIST
msgbox LilycoveCity_ContestLobby_Text_ShouldITakePaintingToMuseum, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink
@ -511,42 +511,42 @@ LilycoveCity_ContestLobby_EventScript_NinjaBoy:: @ 821A735
LilycoveCity_ContestLobby_EventScript_ContestWinner1:: @ 821A73E
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_HALL_1
showcontestpainting CONTEST_WINNER_HALL_1
releaseall
end
LilycoveCity_ContestLobby_EventScript_ContestWinner2:: @ 821A745
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_HALL_2
showcontestpainting CONTEST_WINNER_HALL_2
releaseall
end
LilycoveCity_ContestLobby_EventScript_ContestWinner3:: @ 821A74C
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_HALL_3
showcontestpainting CONTEST_WINNER_HALL_3
releaseall
end
LilycoveCity_ContestLobby_EventScript_ContestWinner4:: @ 821A753
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_HALL_4
showcontestpainting CONTEST_WINNER_HALL_4
releaseall
end
LilycoveCity_ContestLobby_EventScript_ContestWinner5:: @ 821A75A
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_HALL_5
showcontestpainting CONTEST_WINNER_HALL_5
releaseall
end
LilycoveCity_ContestLobby_EventScript_ContestWinner6:: @ 821A761
lockall
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_HALL_6
showcontestpainting CONTEST_WINNER_HALL_6
releaseall
end

View File

@ -94,7 +94,7 @@ LilycoveCity_LilycoveMuseum_2F_Movement_FaceExhibitHall: @ 8219863
LilycoveCity_LilycoveMuseum_2F_EventScript_Curator:: @ 8219866
lockall
goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_ReceivedGlassOrnament
specialvar VAR_0x8004, CountPlayerContestPaintings
specialvar VAR_0x8004, CountPlayerMuseumPaintings
switch VAR_0x8004
case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_AddedPainting
case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_AddedPainting
@ -185,35 +185,35 @@ LilycoveCity_LilycoveMuseum_2F_EventScript_RichBoy:: @ 821999C
LilycoveCity_LilycoveMuseum_2F_EventScript_ShowCoolPainting:: @ 82199A5
msgbox LilycoveCity_LilycoveMuseum_2F_Text_ItsPaintingOfPokemon, MSGBOX_SIGN
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_MUSEUM_COOL
showcontestpainting CONTEST_WINNER_MUSEUM_COOL
releaseall
end
LilycoveCity_LilycoveMuseum_2F_EventScript_ShowBeautyPainting:: @ 82199B3
msgbox LilycoveCity_LilycoveMuseum_2F_Text_ItsPaintingOfPokemon, MSGBOX_SIGN
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_MUSEUM_BEAUTY
showcontestpainting CONTEST_WINNER_MUSEUM_BEAUTY
releaseall
end
LilycoveCity_LilycoveMuseum_2F_EventScript_ShowCutePainting:: @ 82199C1
msgbox LilycoveCity_LilycoveMuseum_2F_Text_ItsPaintingOfPokemon, MSGBOX_SIGN
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_MUSEUM_CUTE
showcontestpainting CONTEST_WINNER_MUSEUM_CUTE
releaseall
end
LilycoveCity_LilycoveMuseum_2F_EventScript_ShowSmartPainting:: @ 82199CF
msgbox LilycoveCity_LilycoveMuseum_2F_Text_ItsPaintingOfPokemon, MSGBOX_SIGN
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_MUSEUM_SMART
showcontestpainting CONTEST_WINNER_MUSEUM_SMART
releaseall
end
LilycoveCity_LilycoveMuseum_2F_EventScript_ShowToughPainting:: @ 82199DD
msgbox LilycoveCity_LilycoveMuseum_2F_Text_ItsPaintingOfPokemon, MSGBOX_SIGN
fadescreen FADE_TO_BLACK
showcontestwinner CONTEST_WINNER_MUSEUM_TOUGH
showcontestpainting CONTEST_WINNER_MUSEUM_TOUGH
releaseall
end

View File

@ -173,7 +173,7 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan:: @ 821C9AE
return
LilycoveCity_PokemonTrainerFanClub_EventScript_TrySetUpTVShow:: @ 821C9B4
special TrySetUpTrainerFanClubSpecial
special TryPutTrainerFanClubOnAir
return
LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember1ToFarTable:: @ 821C9B8

View File

@ -119,7 +119,7 @@ gScriptCmdTable:: @ 81DB67C
.4byte ScrCmd_drawboxtext @ 0x74
.4byte ScrCmd_showmonpic @ 0x75
.4byte ScrCmd_hidemonpic @ 0x76
.4byte ScrCmd_showcontestwinner @ 0x77
.4byte ScrCmd_showcontestpainting @ 0x77
.4byte ScrCmd_braillemessage @ 0x78
.4byte ScrCmd_givemon @ 0x79
.4byte ScrCmd_giveegg @ 0x7a

View File

@ -1,6 +1,6 @@
@ Gabby and Ty always move to the same spots for the first 5 battles
@ From the 6th battle onwards, they move randomly between locations 6-8
@ Note: The local IDs of Gabby and Ty are hard-coded in GabbyAndTySetScriptVarsToObjectEventLocalIds
@ Note: The local IDs of Gabby and Ty are hard-coded in GetGabbyAndTyLocalIds
GabbyAndTy_EventScript_UpdateLocation:: @ 828CCC7
cleartrainerflag TRAINER_GABBY_AND_TY_6
specialvar VAR_RESULT, GabbyAndTyGetBattleNum
@ -198,7 +198,7 @@ GabbyAndTy_EventScript_TyBattle6:: @ 828CF36
GabbyAndTy_EventScript_FirstInterview:: @ 828CF56
special GabbyAndTyBeforeInterview
special GabbyAndTySetScriptVarsToObjectEventLocalIds
special GetGabbyAndTyLocalIds
compare VAR_FACING, DIR_NORTH
call_if_eq GabbyAndTy_EventScript_FacePlayerNorth
compare VAR_FACING, DIR_SOUTH
@ -229,7 +229,7 @@ GabbyAndTy_EventScript_FacePlayerEast:: @ 828CFB1
GabbyAndTy_EventScript_RequestInterview:: @ 828CFC3
special GabbyAndTyBeforeInterview
special GabbyAndTySetScriptVarsToObjectEventLocalIds
special GetGabbyAndTyLocalIds
compare VAR_FACING, DIR_NORTH
call_if_eq GabbyAndTy_EventScript_FacePlayerNorth
compare VAR_FACING, DIR_SOUTH

View File

@ -2,14 +2,14 @@ EventScript_TV:: @ 827EE0B
lockall
incrementgamestat GAME_STAT_WATCHED_TV
special ResetTVShowState
specialvar VAR_RESULT, CheckForBigMovieOrEmergencyNewsOnTV
compare VAR_RESULT, 2
specialvar VAR_RESULT, CheckForPlayersHouseNews
compare VAR_RESULT, PLAYERS_HOUSE_TV_MOVIE
goto_if_eq EventScript_PlayersHouseMovie
compare VAR_RESULT, 1
compare VAR_RESULT, PLAYERS_HOUSE_TV_LATI
goto_if_eq EventScript_PlayersHouseLatiNewsFlash
goto_if_unset FLAG_SYS_TV_START, EventScript_MomDadMightLikeThis1
goto_if_set FLAG_SYS_TV_WATCH, EventScript_MomDadMightLikeThis1
specialvar VAR_RESULT, IsTVShowInSearchOfTrainersAiring
specialvar VAR_RESULT, IsGabbyAndTyShowOnTheAir
compare VAR_RESULT, TRUE
goto_if_eq EventScript_DoInSearchOfTrainers
goto EventScript_TryDoPokeNews

View File

@ -83,20 +83,20 @@ gSpecials:: @ 81DBA64
def_special IsLeadMonNicknamedOrNotEnglish
def_special SetContestCategoryStringVarForInterview
def_special GetNextActiveShowIfMassOutbreak
def_special TV_IsScriptShowKindAlreadyInQueue
def_special CheckForBigMovieOrEmergencyNewsOnTV
def_special IsTVShowAlreadyInQueue
def_special CheckForPlayersHouseNews
def_special GetMomOrDadStringForTVMessage
def_special ResetTVShowState
def_special GetContestWinnerId
def_special GetContestPlayerId
def_special sub_80F8814
def_special GetNpcContestantLocalId
def_special BufferContestWinnerTrainerName
def_special BufferContestWinnerMonName
def_special BufferContestTrainerAndMonNames
def_special GetContestMonConditionRanking
def_special SetContestTrainerGfxIds
def_special TryEnterContestMon
def_special sub_80F8970
def_special GetContestantNamesAtRank
def_special SetLinkContestPlayerGfx
def_special GetContestMonCondition
def_special HasMonWonThisContestBefore
@ -147,9 +147,9 @@ gSpecials:: @ 81DBA64
def_special CountPartyAliveNonEggMons_IgnoreVar0x8004Slot
def_special ShouldReadyContestArtist
def_special SaveMuseumContestPainting
def_special DoesContestCategoryHaveWinner
def_special CountPlayerContestPaintings
def_special ShowContestWinnerPainting
def_special DoesContestCategoryHaveMuseumPainting
def_special CountPlayerMuseumPaintings
def_special ShowContestPainting @ Unused, redundant with showcontestpainting command
def_special MauvilleGymSetDefaultBarriers
def_special MauvilleGymPressSwitch
def_special ShowFieldMessageStringVar4
@ -187,10 +187,10 @@ gSpecials:: @ 81DBA64
def_special GabbyAndTyAfterInterview
def_special GabbyAndTyBeforeInterview
def_special DoTVShowInSearchOfTrainers
def_special IsTVShowInSearchOfTrainersAiring
def_special IsGabbyAndTyShowOnTheAir
def_special GabbyAndTyGetLastQuote
def_special GabbyAndTyGetLastBattleTrivia
def_special GabbyAndTySetScriptVarsToObjectEventLocalIds
def_special GetGabbyAndTyLocalIds
def_special GetBattleOutcome
def_special GetDaycareMonNicknames
def_special GetDaycareState
@ -354,7 +354,7 @@ gSpecials:: @ 81DBA64
def_special SetChampionSaveWarp
def_special TryPutTreasureInvestigatorsOnAir
def_special TryPutLotteryWinnerReportOnAir
def_special TrySetUpTrainerFanClubSpecial
def_special TryPutTrainerFanClubOnAir
def_special ShouldHideFanClubInterviewer
def_special ShowGlassWorkshopMenu
def_special PutFanClubSpecialOnTheAir

View File

@ -1,4 +1,4 @@
gContestPaintingCaption:: @ 827EA0C
gContestHallPaintingCaption:: @ 827EA0C
.string "{STR_VAR_1}\n"
.string "{STR_VAR_2}'s {STR_VAR_3}$"

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 666 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

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

@ -476,7 +476,7 @@ $(RAYQUAZAGFXDIR)/scene_4/streaks.4bpp: %.4bpp: %.png
$(RAYQUAZAGFXDIR)/scene_4/rayquaza.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 155
graphics/picture_frame/frame5.4bpp: %.4bpp: %.png
graphics/picture_frame/lobby.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 86
$(ROULETTEGFXDIR)/roulette_tilt.4bpp: $(ROULETTEGFXDIR)/shroomish.4bpp \

View File

@ -75,8 +75,8 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId);
// battle_anim_mons.c
void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite);
void AnimUnused_80A8AEC(struct Sprite *sprite);
void AnimUnused_80A8A6C(struct Sprite *sprite);
void AnimTranslateLinearAndFlicker(struct Sprite *sprite);
void AnimTranslateLinearAndFlicker_Flipped(struct Sprite *sprite);
void AnimWeatherBallUp(struct Sprite *sprite);
void AnimWeatherBallDown(struct Sprite *sprite);
void AnimSpinningSparkle(struct Sprite *sprite);

View File

@ -3,48 +3,72 @@
#include "list_menu.h"
struct PyramidBagResources
enum {
PYRAMIDBAG_LOC_FIELD,
PYRAMIDBAG_LOC_BATTLE,
PYRAMIDBAG_LOC_PARTY,
PYRAMIDBAG_LOC_CHOOSE_TOSS,
PYRAMIDBAG_LOC_PREV,
};
enum {
PBAG_SPRITE_BAG,
PBAG_SPRITE_ITEM_ICON,
PBAG_SPRITE_ITEM_ICON_ALT,
PBAG_SPRITE_SWAP_LINE_START, // Swap line consists of 8 sprites
PBAG_SPRITE_SWAP_LINE_2,
PBAG_SPRITE_SWAP_LINE_3,
PBAG_SPRITE_SWAP_LINE_4,
PBAG_SPRITE_SWAP_LINE_5,
PBAG_SPRITE_SWAP_LINE_6,
PBAG_SPRITE_SWAP_LINE_7,
PBAG_SPRITE_SWAP_LINE_END,
PBAG_SPRITE_COUNT
};
#define NUM_SWAP_LINE_SPRITES (1 + PBAG_SPRITE_SWAP_LINE_END - PBAG_SPRITE_SWAP_LINE_START)
struct PyramidBagMenu
{
void (*callback2)(void);
u8 tilemapBuffer[0x800];
u8 itemsSpriteIds[PYRAMID_BAG_ITEMS_COUNT + 1];
void (*exitCallback)(void);
u8 tilemapBuffer[BG_SCREEN_SIZE];
u8 spriteIds[PBAG_SPRITE_COUNT];
u8 windowIds[5];
u8 unk814;
u8 unk815;
u8 toSwapPos;
bool8 isAltIcon; // Two item icons loaded at a time. Tracks which to show next
u8 scrollIndicatorsTaskId;
const u8 *menuActionIds;
u8 filler81C[0x820 - 0x81C];
u8 unused1[4];
u8 menuActionsCount;
u8 listMenuCount;
u8 listMenuMaxShown;
struct ListMenuItem bagListItems[PYRAMID_BAG_ITEMS_COUNT + 1];
u8 itemStrings[PYRAMID_BAG_ITEMS_COUNT + 1][ITEM_NAME_LENGTH + 10];
s16 state;
u8 filler986[0x98C - 0x986];
u8 unused2[4];
};
struct PyramidBagCursorData
struct PyramidBagMenuState
{
void (*callback)(void);
u8 unk4;
u8 location;
u16 cursorPosition;
u16 scrollPosition;
};
extern struct PyramidBagResources *gPyramidBagResources;
extern struct PyramidBagCursorData gPyramidBagCursorData;
extern struct PyramidBagMenu *gPyramidBagMenu;
extern struct PyramidBagMenuState gPyramidBagMenuState;
void InitBattlePyramidBagCursorPosition(void);
void CB2_PyramidBagMenuFromStartMenu(void);
void CB2_ReturnToPyramidBagMenu(void);
void sub_81C5924(void);
void sub_81C59BC(void);
void UpdatePyramidBagList(void);
void UpdatePyramidBagCursorPos(void);
void sub_81C4EFC(void);
void GoToBattlePyramidBagMenu(u8 a0, void (*callback)(void));
void Task_CloseBattlePyramidBagMessage(u8 taskId);
void TryStoreHeldItemsInPyramidBag(void);
void ChooseItemsToTossFromPyramidBag(void);
void CloseBattlePyramidBagAndSetCallback(u8 taskId);
void CloseBattlePyramidBag(u8 taskId);
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId));
#endif // GUARD_BATTLE_PYRAMID_BAG_H

View File

@ -78,6 +78,21 @@
#define FRONTIER_MANIAC_MESSAGE_COUNT 3
// Frontier TV Show
#define FRONTIER_SHOW_TOWER_SINGLES 1
#define FRONTIER_SHOW_TOWER_DOUBLES 2
#define FRONTIER_SHOW_TOWER_MULTIS 3
#define FRONTIER_SHOW_TOWER_LINK_MULTIS 4
#define FRONTIER_SHOW_DOME_SINGLES 5
#define FRONTIER_SHOW_DOME_DOUBLES 6
#define FRONTIER_SHOW_FACTORY_SINGLES 7
#define FRONTIER_SHOW_FACTORY_DOUBLES 8
#define FRONTIER_SHOW_PIKE 9
#define FRONTIER_SHOW_ARENA 10
#define FRONTIER_SHOW_PALACE_SINGLES 11
#define FRONTIER_SHOW_PALACE_DOUBLES 12
#define FRONTIER_SHOW_PYRAMID 13
// Frontier Gambler
#define FRONTIER_GAMBLER_WAITING 0
#define FRONTIER_GAMBLER_PLACED_BET 1

View File

@ -22,7 +22,9 @@
#define CONTEST_TYPE_NPC_MASTER (CONTEST_RANK_MASTER + 1)
#define CONTEST_TYPE_LINK (CONTEST_RANK_LINK + 1)
#define CONTEST_WINNER_ARTIST 0 // Winner shown by the artist, painting not necessarily saved
// IDs below - 1 are indexes into gSaveBlock1Ptr->contestWinners[]
// CONTEST_WINNER_ARTIST is for the winner of the most recent contest, and is not saved.
#define CONTEST_WINNER_ARTIST 0
#define CONTEST_WINNER_HALL_1 1
#define CONTEST_WINNER_HALL_2 2
#define CONTEST_WINNER_HALL_3 3
@ -30,8 +32,8 @@
#define CONTEST_WINNER_HALL_5 5
#define CONTEST_WINNER_HALL_6 6
#define NUM_CONTEST_HALL_WINNERS 6
#define CONTEST_WINNER_7 7
#define CONTEST_WINNER_8 8
#define CONTEST_WINNER_HALL_UNUSED_1 7 // These two have data for gDefaultContestWinners
#define CONTEST_WINNER_HALL_UNUSED_2 8 // but there are only 6 paintings in the Contest Hall
#define CONTEST_WINNER_MUSEUM_COOL 9
#define CONTEST_WINNER_MUSEUM_BEAUTY 10
#define CONTEST_WINNER_MUSEUM_CUTE 11
@ -39,6 +41,14 @@
#define CONTEST_WINNER_MUSEUM_TOUGH 13
// NUM_CONTEST_WINNERS in constants/global.h
#define MUSEUM_CONTEST_WINNERS_START (CONTEST_WINNER_MUSEUM_COOL - 1)
#define CONTEST_SAVE_FOR_MUSEUM ((u8)-1)
#define CONTEST_SAVE_FOR_ARTIST ((u8)-2)
// The number of possible captions for a Contest painting, per category
#define NUM_PAINTING_CAPTIONS 3
#define CANT_ENTER_CONTEST 0
#define CAN_ENTER_CONTEST_EQUAL_RANK 1
#define CAN_ENTER_CONTEST_HIGH_RANK 2

View File

@ -9,7 +9,7 @@
#define EASY_CHAT_TYPE_INTERVIEW 5
#define EASY_CHAT_TYPE_BARD_SONG 6
#define EASY_CHAT_TYPE_FAN_CLUB 7
#define EASY_CHAT_TYPE_UNK_8 8
#define EASY_CHAT_TYPE_DUMMY_SHOW 8
#define EASY_CHAT_TYPE_TRENDY_PHRASE 9
#define EASY_CHAT_TYPE_GABBY_AND_TY 10
#define EASY_CHAT_TYPE_CONTEST_INTERVIEW 11

View File

@ -42,6 +42,8 @@
#define METATILE_General_BlueCaveOpen 0x1B1
// gTileset_Building
#define METATILE_Building_TV_Off 0x002
#define METATILE_Building_TV_On 0x003
#define METATILE_Building_PC_Off 0x004
#define METATILE_Building_PC_On 0x005

View File

@ -37,8 +37,9 @@
#define TRAINER_HILL_TEXT_PLAYER_WON 4
#define TRAINER_HILL_TEXT_AFTER 5
#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * 2)
#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * 2)
#define TRAINER_HILL_TRAINERS_PER_FLOOR 2
#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * TRAINER_HILL_TRAINERS_PER_FLOOR)
#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * TRAINER_HILL_TRAINERS_PER_FLOOR)
// Values returned by TrainerHillGetChallengeStatus
#define TRAINER_HILL_PLAYER_STATUS_LOST 0

View File

@ -6,12 +6,22 @@
#define POKENEWS_GAME_CORNER 2
#define POKENEWS_LILYCOVE 3
#define POKENEWS_BLENDMASTER 4
#define NUM_POKENEWS_TYPES 4 // Excludes NONE
// TV shows are categorized as being in one of 3 groups
// - TVGROUP_NORMAL, TV shows that can appear without Record Mixing
// - TVGROUP_RECORD_MIX, TV shows that can only appear via Record Mixing
// - TVGROUP_OUTBREAK, just contains TVSHOW_MASS_OUTBREAK
// Each group was allotted 20 spaces arbitrarily, though none use all 20
#define TVSHOW_OFF_AIR 0
// TVGROUP_NORMAL
#define TVGROUP_NORMAL_START 1
#define TVSHOW_FAN_CLUB_LETTER 1
#define TVSHOW_RECENT_HAPPENINGS 2
#define TVSHOW_PKMN_FAN_CLUB_OPINIONS 3
#define TVSHOW_UNKN_SHOWTYPE_04 4
#define TVSHOW_DUMMY 4
#define TVSHOW_NAME_RATER_SHOW 5
#define TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE 6
#define TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE 7
@ -20,7 +30,11 @@
#define TVSHOW_BATTLE_UPDATE 10
#define TVSHOW_FAN_CLUB_SPECIAL 11
#define TVSHOW_LILYCOVE_CONTEST_LADY 12
// //
//
#define TVGROUP_NORMAL_END 20
// TVGROUP_RECORD_MIX
#define TVGROUP_RECORD_MIX_START 21
#define TVSHOW_POKEMON_TODAY_CAUGHT 21
#define TVSHOW_SMART_SHOPPER 22
#define TVSHOW_POKEMON_TODAY_FAILED 23
@ -40,8 +54,22 @@
#define TVSHOW_NUMBER_ONE 37
#define TVSHOW_SECRET_BASE_SECRETS 38
#define TVSHOW_SAFARI_FAN_CLUB 39
// //
#define TVSHOW_MASS_OUTBREAK 41
#define TVGROUP_RECORD_MIX_END 40
// TVGROUP_OUTBREAK
#define TVGROUP_OUTBREAK_START 41
#define TVSHOW_MASS_OUTBREAK 41
//
#define TVGROUP_OUTBREAK_END 60
// The first 5 elements of gSaveBlock1Ptr->tvShows are reserved
// for TV shows from TVGROUP_NORMAL. The remainder are for TV
// shows from TVGROUP_RECORD_MIX.
#define NUM_NORMAL_TVSHOW_SLOTS 5
#define PLAYERS_HOUSE_TV_NONE 0
#define PLAYERS_HOUSE_TV_LATI 1
#define PLAYERS_HOUSE_TV_MOVIE 2
// Number of ribbons to put Spot the Cuties on air
#define NUM_CUTIES_RIBBONS 4
@ -221,4 +249,6 @@
#define CONTESTLADYLIVE_STATE_LOST 2
#define CONTESTLADYLIVE_STATE_LOST_BADLY 3
#define SMARTSHOPPER_NUM_ITEMS 3
#endif //GUARD_CONSTANTS_TV_H

View File

@ -111,11 +111,11 @@ struct ContestPokemon
u32 otId;
};
struct Shared1A004
struct ContestTempSave
{
u16 cachedWindowPalettes[16][16]; // Saved palette data before a move happens?
u16 unk18204[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferUnfaded
u16 unk18604[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferFaded
u16 cachedPlttBufferUnfaded[PLTT_BUFFER_SIZE];
u16 cachedPlttBufferFaded[PLTT_BUFFER_SIZE];
u8 savedJunk[0x800];
};
@ -306,7 +306,7 @@ struct ContestResources
#define eUnzippedContestAudience_Gfx (gHeap + 0x18000)
#define eContestAudienceFrame2_Gfx (gHeap + 0x19000)
#define eContestDebugMode (gHeap[0x1a000])
#define eUnknownHeap1A004 (*(struct Shared1A004 *)(gHeap + 0x1a004))
#define eContestTempSave (*(struct ContestTempSave *)(gHeap + 0x1a004))
extern struct ContestPokemon gContestMons[CONTESTANT_COUNT];
extern s16 gContestMonRound1Points[CONTESTANT_COUNT];
@ -326,8 +326,8 @@ extern u8 gHighestRibbonRank;
extern struct ContestResources *gContestResources;
extern u8 sContestBgCopyFlags;
extern struct ContestWinner gCurContestWinner;
extern u8 gUnknown_02039F5C;
extern u8 gUnknown_02039F5D;
extern u8 gCurContestWinnerIsForArtist;
extern u8 gCurContestWinnerSaveIdx;
extern u32 gContestRngValue;
// contest.c
@ -351,8 +351,8 @@ s8 Contest_GetMoveExcitement(u16 move);
bool8 IsContestantAllowedToCombo(u8 contestant);
void Contest_PrintTextToBg0WindowAt(u32 windowId, u8 *currChar, s32 x, s32 y, s32 fontId);
void ResetContestLinkResults(void);
bool8 sub_80DEDA8(u8 a);
u8 sub_80DEFA8(u8 a, u8 b);
bool8 SaveContestWinner(u8 rank);
u8 GetContestWinnerSaveIdx(u8 rank, bool8 shift);
void ClearContestWinnerPicsInContestHall(void);
void StripPlayerAndMonNamesForLinkContest(struct ContestPokemon *mon, s32 language);

View File

@ -7,8 +7,8 @@ void StartContest(void);
void BufferContestantMonSpecies(void);
void ShowContestResults(void);
void ContestLinkTransfer(u8);
void ShowContestWinnerPainting(void);
void ShowContestPainting(void);
u16 GetContestRand(void);
u8 CountPlayerContestPaintings(void);
u8 CountPlayerMuseumPaintings(void);
#endif // GUARD_CONTEST_UTIL_H

View File

@ -5,6 +5,12 @@
#define SPECIES_SHINY_TAG 500
enum {
BATTLER_AFFINE_NORMAL,
BATTLER_AFFINE_EMERGE,
BATTLER_AFFINE_RETURN,
};
struct MonCoords
{
// This would use a bitfield, but some function
@ -87,9 +93,9 @@ extern const struct SpriteFrameImage gTrainerBackPicTable_Steven[];
extern const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[];
extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[];
extern const union AffineAnimCmd *const gUnknown_082FF6C0[];
extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[];
extern const union AnimCmd *const gUnknown_082FF70C[];
extern const union AnimCmd *const gAnims_MonPic[];
extern const struct MonCoords gMonFrontPicCoords[];
extern const struct CompressedSpriteSheet gMonStillFrontPicTable[];
extern const struct MonCoords gMonBackPicCoords[];

View File

@ -6,7 +6,7 @@
u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest);
u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest);
u8 CountPokemonInDaycare(struct DayCare *daycare);
void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail);
void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *daycareMail);
void StoreSelectedPokemonInDaycare(void);
u16 TakePokemonFromDaycare(void);
void GetDaycareCost(void);

View File

@ -5,30 +5,29 @@
struct EReaderTrainerHillTrainer
{
u8 unk0;
struct TrainerHillTrainer unk4;
struct TrHillDisplay unk14C;
u8 trainerNum;
struct TrainerHillTrainer trainer;
struct TrHillDisplay display;
u32 checksum;
}; // size=0x274
struct EReaderTrainerHillSet
{
u8 count;
u8 numTrainers;
u8 id;
u16 dummy;
u32 checksum;
struct EReaderTrainerHillTrainer unk_8[6];
struct EReaderTrainerHillTrainer trainers[6];
u8 unk_ec0[40];
}; // size = 0xf00
bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer);
bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0);
bool8 ValidateTrainerHillData(struct EReaderTrainerHillSet *);
bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *);
bool32 ReadTrainerHillAndValidate(void);
int EReaderHandleTransfer(u8, u32, u32*, u32*);
void sub_81D3F9C(void);
void sub_81D3FAC(void);
int EReaderHandleTransfer(u8, size_t, const void *, void *);
void EReaderHelper_Timer3Callback(void);
void EReaderHelper_SerialCallback(void);
void EReaderHelper_SaveRegsState(void);
void EReaderHelper_RestoreRegsState(void);
void sub_81D4238(void);
void EReaderHelper_ClearSendRecvMgr(void);
#endif // GUARD_EREADER_HELPERS_H

View File

@ -733,7 +733,7 @@ struct ContestWinner
u8 contestRank;
};
struct DayCareMail
struct DaycareMail
{
struct MailStruct message;
u8 OT_name[PLAYER_NAME_LENGTH + 1];
@ -745,7 +745,7 @@ struct DayCareMail
struct DaycareMon
{
struct BoxPokemon mon;
struct DayCareMail mail;
struct DaycareMail mail;
u32 steps;
};
@ -756,9 +756,9 @@ struct DayCare
u8 stepCounter;
};
struct RecordMixingDayCareMail
struct RecordMixingDaycareMail
{
struct DayCareMail mail[DAYCARE_MON_COUNT];
struct DaycareMail mail[DAYCARE_MON_COUNT];
u32 numDaycareMons;
bool16 holdsItem[DAYCARE_MON_COUNT];
};

View File

@ -1,13 +1,15 @@
#ifndef GUARD_GLOBAL_TV_H
#define GUARD_GLOBAL_TV_H
#include "constants/tv.h"
typedef union // size = 0x24
{
// Common
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u8 pad02[26];
/*0x02*/ u8 data[26];
/*0x1C*/ u8 srcTrainerId3Lo;
/*0x1D*/ u8 srcTrainerId3Hi;
/*0x1E*/ u8 srcTrainerId2Lo;
@ -22,7 +24,7 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u8 pad02[34];
/*0x02*/ u8 data[34];
} commonInit;
// Local shows
@ -40,7 +42,7 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 var02;
/*0x02*/ u16 species;
/*0x04*/ u16 words[6];
/*0x10*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x18*/ u8 language;
@ -62,16 +64,16 @@ typedef union // size = 0x24
/*0x1C*/ u16 words[4];
} fanclubOpinions;
// TVSHOW_UNKN_SHOWTYPE_04 (dummied out)
// TVSHOW_DUMMY
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 words[2];
/*0x06*/ u16 var06;
/*0x06*/ u16 species;
/*0x08*/ u8 pad_08[3];
/*0x0b*/ u8 string_0b[12];
/*0x0b*/ u8 name[12];
/*0x17*/ u8 language;
} unkShow04;
} dummy;
// TVSHOW_NAME_RATER_SHOW
struct {
@ -212,8 +214,8 @@ typedef union // size = 0x24
/*0x02*/ u8 priceReduced;
/*0x03*/ u8 language;
/*0x04*/ u8 pad04[2];
/*0x06*/ u16 itemIds[3];
/*0x0C*/ u16 itemAmounts[3];
/*0x06*/ u16 itemIds[SMARTSHOPPER_NUM_ITEMS];
/*0x0C*/ u16 itemAmounts[SMARTSHOPPER_NUM_ITEMS];
/*0x12*/ u8 shopLocation;
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} smartshopperShow;
@ -401,7 +403,7 @@ typedef union // size = 0x24
/*0x08*/ u16 species3;
/*0x0a*/ u16 species4;
/*0x0c*/ u8 language;
/*0x0d*/ u8 facility;
/*0x0d*/ u8 facilityAndMode;
/*0x0e*/ u8 filler_0e[5];
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} frontier;

View File

@ -5564,8 +5564,8 @@ extern const u16 gUnknown_08DDCF04[];
extern const u16 gTradeGba2_Pal[];
extern const u8 gTradeGba_Gfx[];
extern const u16 gTradeMenuMonBox_Tilemap[];
extern const u8 gTradeButtons_Gfx[];
extern const u16 gUnknown_08DDB444[];
extern const u8 gTradeCursor_Gfx[];
extern const u16 gTradeCursor_Pal[];
// Party menu
extern const u32 gPartyMenuPokeball_Gfx[];
@ -5585,21 +5585,21 @@ extern const u32 gRouletteMultiplier_Gfx[];
// Contest util
extern const u32 gContestResults_Gfx[];
extern const u32 gUnknown_08C19EEC[];
extern const u32 gUnknown_08C1A000[];
extern const u32 gUnknown_08C1A12C[];
extern const u32 gContestResults_WinnerBanner_Tilemap[];
extern const u32 gContestResults_Interface_Tilemap[];
extern const u32 gContestResults_Bg_Tilemap[];
extern const u32 gContestResults_Pal[];
extern const u16 gLinkContestResults_Tilemap[];
extern const u16 gNormalContestResults_Tilemap[];
extern const u16 gSuperContestResults_Tilemap[];
extern const u16 gHyperContestResults_Tilemap[];
extern const u16 gMasterContestResults_Tilemap[];
extern const u16 gCoolContestResults_Tilemap[];
extern const u16 gBeautyContestResults_Tilemap[];
extern const u16 gCuteContestResults_Tilemap[];
extern const u16 gSmartContestResults_Tilemap[];
extern const u16 gToughContestResults_Tilemap[];
extern const u16 gContestResults_Tilemap[];
extern const u16 gContestResultsTitle_Link_Tilemap[];
extern const u16 gContestResultsTitle_Normal_Tilemap[];
extern const u16 gContestResultsTitle_Super_Tilemap[];
extern const u16 gContestResultsTitle_Hyper_Tilemap[];
extern const u16 gContestResultsTitle_Master_Tilemap[];
extern const u16 gContestResultsTitle_Cool_Tilemap[];
extern const u16 gContestResultsTitle_Beauty_Tilemap[];
extern const u16 gContestResultsTitle_Cute_Tilemap[];
extern const u16 gContestResultsTitle_Smart_Tilemap[];
extern const u16 gContestResultsTitle_Tough_Tilemap[];
extern const u16 gContestResultsTitle_Tilemap[];
// Trainer Card.
extern const u16 gHoennTrainerCard0Star_Pal[];

View File

@ -17,7 +17,7 @@ void CopyMonCategoryText(int dexNum, u8 *dest);
u8 *sub_81DB494(u8 *str, int fontId, const u8 *str2, int totalStringWidth);
void PadNameString(u8 *dest, u8 padChar);
void ConvertInternationalPlayerNameStripChar(u8 *, u8);
void sub_81DB5AC(u8 *);
void ConvertInternationalContestantName(u8 *);
int sub_81DB604(u8 *);
void sub_81DB620(int windowId, int columnStart, int rowStart, int numFillTiles, int numRows);

View File

@ -323,7 +323,7 @@ extern bool8 gSavedLinkPlayerCount;
extern u8 gSavedMultiplayerId;
extern struct LinkTestBGInfo gLinkTestBGInfo;
extern void (*gLinkCallback)(void);
extern bool8 gShouldAdvanceLinkState;
extern u8 gShouldAdvanceLinkState;
extern u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS];
extern u8 gBlockRequestType;
extern u8 gLastSendQueueCount;

View File

@ -7,7 +7,7 @@ void SetMauvilleOldMan(void);
u8 GetCurrentMauvilleOldMan(void);
void ScrSpecial_SetMauvilleOldManObjEventGfx(void);
u8 sub_81201C8(void);
void sub_8120B70(OldMan *dest);
void SanitizeMauvilleOldManForRuby(OldMan *dest);
void sub_8120670(void);
void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6);
void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2);

View File

@ -90,8 +90,8 @@ void *malloc_and_decompress(const void *src, u32 *sizeOut);
u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode);
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8);
void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY);
u8 GetStartMenuWindowId(void);
void ListMenuLoadStdPalAt(u8, u8);

View File

@ -29,7 +29,7 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1);
u8 GetLRKeysPressed(void);
u8 GetLRKeysPressedAndHeld(void);
bool8 sub_8122148(u16 itemId);
bool8 itemid_80BF6D8_mail_related(u16 itemId);
bool8 IsWritingMailAllowed(u16 itemId);
bool8 MenuHelpers_LinkSomething(void);
bool8 MenuHelpers_CallLinkSomething(void);
void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount);

View File

@ -982,7 +982,8 @@ extern const u8 gText_RibbonsVar1[];
extern const u8 gText_OneDash[];
extern const u8 gText_TwoDashes[];
extern const u8 *const gReturnToXStringsTable2[];
extern const u8 *const gBagMenu_ReturnToStrings[];
extern const u8 *const gPyramidBagMenu_ReturnToStrings[];
extern const u8 gText_NumPlayerLink[];
extern const u8 gText_ConfirmLinkWhenPlayersReady[];

View File

@ -1,13 +1,10 @@
#ifndef GUARD_TV_H
#define GUARD_TV_H
#define SLOT_MACHINE 0
#define ROULETTE 1
extern u8 *const gTVStringVarPtrs[3];
void ClearTVShowData(void);
void sub_80EE184(void);
void TryPutBreakingNewsOnAir(void);
void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove);
void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility);
void DoTVShow(void);
@ -23,41 +20,37 @@ void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx);
void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx);
u32 GetPlayerIDAsU32(void);
bool8 GetPriceReduction(u8 newsKind);
void sub_80F14F8(TVShow *shows);
void SanitizeTVShowLocationsForRuby(TVShow *shows);
size_t CountDigits(int value);
u8 GetRibbonCount(struct Pokemon *pokemon);
void AlertTVThatPlayerPlayedSlotMachine(u16 nCoinsSpent);
void AlertTVThatPlayerPlayedRoulette(u16 nCoinsSpent);
void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut);
void TryPutFindThatGamerOnAir(u16 nCoinsPaidOut);
void TryPutSecretBaseSecretsOnAir(void);
void TryPutTodaysRivalTrainerOnAir(void);
void TryPutTrendWatcherOnAir(const u16 *words);
void sub_80EDA80(void);
void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx);
void sub_80F0BB8(void);
void DeactivateAllNormalTVShows(void);
void RecordFishingAttemptForTV(bool8 caughtFish);
void IncrementDailySlotsUses(void);
void IncrementDailyRouletteUses(void);
void IncrementDailyWildBattles(void);
void IncrementDailyBerryBlender(void);
void sub_80F1208(TVShow *shows);
void sub_80EE44C(u8 nMonsCaught, u8 nPkblkUsed);
void sub_80F14F8(TVShow *shows);
size_t sub_80EF370(int value);
void SanitizeTVShowsForRuby(TVShow *shows);
void TryPutSafariFanClubOnAir(u8 nMonsCaught, u8 nPkblkUsed);
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language);
void SetPokemonAnglerSpecies(u16 species);
void UpdateTVShowsPerDay(u16 days);
void PutPokemonTodayCaughtOnAir(void);
void TV_PutSecretBaseVisitOnTheAir(void);
void TryPutPokemonTodayOnAir(void);
void TryPutSecretBaseVisitOnAir(void);
void PutBattleUpdateOnTheAir(u8 opponentLinkPlayerId, u16 move, u16 speciesPlayer, u16 speciesOpponent);
void BravoTrainerPokemonProfile_BeforeInterview1(u16 move);
void InterviewBefore(void);
void InterviewAfter(void);
void UpdateTVScreensOnMap(int, int);
void TV_PrintIntToStringVar(u8 varIdx, int value);
void SaveRecordedItemPurchasesForTVShow(void);
void ConvertIntToDecimalString(u8 varIdx, int value);
void TryPutSmartShopperOnAir(void);
bool8 ShouldAirFrontierTVShow(void);
void sub_80EE8C8(u16 winStreak, u8 facilityAndMode);
void BravoTrainerPokemonProfile_BeforeInterview2(u8 contestStandingPlace);
void ContestLiveUpdates_Init(u8 round1Placing);
void ContestLiveUpdates_SetRound2Placing(u8 round2Placing);
@ -65,5 +58,8 @@ void ContestLiveUpdates_SetWinnerAppealFlag(u8 flag);
void ContestLiveUpdates_SetWinnerMoveUsed(u16 move);
void ContestLiveUpdates_SetLoserData(u8 flag, u8 loser);
void ResetGabbyAndTy(void);
u8 CheckForPlayersHouseNews(void);
bool8 IsGabbyAndTyShowOnTheAir(void);
void TryPutTrainerFanClubOnAir(void);
#endif //GUARD_TV_H

View File

@ -2319,11 +2319,11 @@ void AnimTask_TransformMon(u8 taskId)
}
if (IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies))
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0;
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest;
else
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteOpponentSide;
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0);
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], BATTLER_AFFINE_NORMAL);
}
gTasks[taskId].data[0]++;
@ -4733,8 +4733,8 @@ void AnimTask_MonToSubstitute(u8 taskId)
LoadBattleMonGfxAndAnimate(gBattleAnimAttacker, 0, spriteId);
if (IsContest())
{
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0;
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0);
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest;
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], BATTLER_AFFINE_NORMAL);
}
for (i = 0; i < NUM_TASK_DATA; i++)

View File

@ -2078,8 +2078,8 @@ u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16
if (IsContest())
{
gSprites[spriteId].affineAnims = gUnknown_082FF6C0;
StartSpriteAffineAnim(&gSprites[spriteId], 0);
gSprites[spriteId].affineAnims = gAffineAnims_BattleSpriteContest;
StartSpriteAffineAnim(&gSprites[spriteId], BATTLER_AFFINE_NORMAL);
}
return spriteId;
}
@ -2273,7 +2273,7 @@ u8 CreateInvisibleSpriteCopy(int battlerId, u8 spriteId, int species)
return newSpriteId;
}
void AnimUnused_80A8A6C(struct Sprite *sprite)
void AnimTranslateLinearAndFlicker_Flipped(struct Sprite *sprite)
{
SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker))
@ -2296,7 +2296,7 @@ void AnimUnused_80A8A6C(struct Sprite *sprite)
}
// Used by three different unused battle anim sprite templates.
void AnimUnused_80A8AEC(struct Sprite *sprite)
void AnimTranslateLinearAndFlicker(struct Sprite *sprite)
{
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{

View File

@ -26,7 +26,7 @@ static void Task_DoStatusAnimation(u8 taskId);
static void AnimFlashingCircleImpact(struct Sprite *sprite);
static void AnimFlashingCircleImpact_Step(struct Sprite *sprite);
static const union AnimCmd sAnim_Unused_853EDE4[] =
static const union AnimCmd sAnim_FlickeringOrb[] =
{
ANIMCMD_FRAME(0, 3),
ANIMCMD_FRAME(4, 3),
@ -35,33 +35,33 @@ static const union AnimCmd sAnim_Unused_853EDE4[] =
ANIMCMD_JUMP(0)
};
static const union AnimCmd *const sAnims_Unused_853EDF8[] =
static const union AnimCmd *const sAnims_FlickeringOrb[] =
{
sAnim_Unused_853EDE4
sAnim_FlickeringOrb
};
// Unused
const struct SpriteTemplate gUnusedSpriteTemplate_0853EDFC =
static const struct SpriteTemplate sFlickeringOrbSpriteTemplate =
{
.tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = sAnims_Unused_853EDF8,
.anims = sAnims_FlickeringOrb,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimUnused_80A8AEC,
.callback = AnimTranslateLinearAndFlicker,
};
// Unused
const struct SpriteTemplate gUnusedSpriteTemplate_0853EE14 =
static const struct SpriteTemplate sFlickeringOrbFlippedSpriteTemplate =
{
.tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = sAnims_Unused_853EDF8,
.anims = sAnims_FlickeringOrb,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimUnused_80A8A6C,
.callback = AnimTranslateLinearAndFlicker_Flipped,
};
static const union AnimCmd sAnim_WeatherBallNormal[] =
@ -124,7 +124,7 @@ const struct SpriteTemplate gSpinningSparkleSpriteTemplate =
};
// Unused
const struct SpriteTemplate gUnusedSpriteTemplate_0853EE9C =
static const struct SpriteTemplate sFlickeringFootSpriteTemplate =
{
.tileTag = ANIM_TAG_MONSTER_FOOT,
.paletteTag = ANIM_TAG_MONSTER_FOOT,
@ -132,79 +132,79 @@ const struct SpriteTemplate gUnusedSpriteTemplate_0853EE9C =
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimUnused_80A8AEC,
.callback = AnimTranslateLinearAndFlicker,
};
static const union AnimCmd sAnim_Unused_853EEB4[] =
static const union AnimCmd sAnim_FlickeringImpact_0[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_JUMP(0)
};
static const union AnimCmd sAnim_Unused_853EEBC[] =
static const union AnimCmd sAnim_FlickeringImpact_1[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_JUMP(0)
};
static const union AnimCmd sAnim_Unused_853EEC4[] =
static const union AnimCmd sAnim_FlickeringImpact_2[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_JUMP(0)
};
static const union AnimCmd *const sAnims_Unused_853EECC[] =
static const union AnimCmd *const sAnims_FlickeringImpact[] =
{
sAnim_Unused_853EEB4,
sAnim_Unused_853EEBC,
sAnim_Unused_853EEC4,
sAnim_FlickeringImpact_0,
sAnim_FlickeringImpact_1,
sAnim_FlickeringImpact_2,
};
// Unused
const struct SpriteTemplate gUnusedSpriteTemplate_0853EED8 =
static const struct SpriteTemplate sFlickeringImpactSpriteTemplate =
{
.tileTag = ANIM_TAG_IMPACT,
.paletteTag = ANIM_TAG_IMPACT,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = sAnims_Unused_853EECC,
.anims = sAnims_FlickeringImpact,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimUnused_80A8AEC,
.callback = AnimTranslateLinearAndFlicker,
};
static const union AnimCmd sAnim_Unused_853EEF0[] =
static const union AnimCmd sAnim_FlickeringShrinkOrb[] =
{
ANIMCMD_FRAME(0, 15),
ANIMCMD_JUMP(0)
};
static const union AnimCmd *const sAnims_Unused_853EEF8[] =
static const union AnimCmd *const sAnims_FlickeringShrinkOrb[] =
{
sAnim_Unused_853EEF0
sAnim_FlickeringShrinkOrb
};
static const union AffineAnimCmd sAffineAnim_Unused_853EEFC[] =
static const union AffineAnimCmd sAffineAnim_FlickeringShrinkOrb[] =
{
AFFINEANIMCMD_FRAME(96, 96, 0, 0),
AFFINEANIMCMD_FRAME(2, 2, 0, 1),
AFFINEANIMCMD_JUMP(1)
};
static const union AffineAnimCmd *const sAffineAnims_Unused_853EEF8[] =
static const union AffineAnimCmd *const sAffineAnims_FlickeringShrinkOrb[] =
{
sAffineAnim_Unused_853EEFC
sAffineAnim_FlickeringShrinkOrb
};
// Unused
const struct SpriteTemplate gUnusedSpriteTemplate_0853EF18 =
static const struct SpriteTemplate sFlickeringShrinkOrbSpriteTemplate =
{
.tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB,
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = sAnims_Unused_853EEF8,
.anims = sAnims_FlickeringShrinkOrb,
.images = NULL,
.affineAnims = sAffineAnims_Unused_853EEF8,
.callback = AnimUnused_80A8A6C,
.affineAnims = sAffineAnims_FlickeringShrinkOrb,
.callback = AnimTranslateLinearAndFlicker_Flipped,
};
static const struct Subsprite sFrozenIceCubeSubsprites[] =

View File

@ -16,6 +16,7 @@
#include "task.h"
#include "trig.h"
#include "util.h"
#include "data.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/songs.h"
@ -1725,7 +1726,7 @@ static void SpriteCB_Ball_Release_Step(struct Sprite *sprite)
// Animate Pokémon emerging from Poké Ball
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].invisible = FALSE;
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]], 1);
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]], BATTLER_AFFINE_EMERGE);
AnimateSprite(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]]);
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].sOffsetY = 4096;
}
@ -1739,7 +1740,7 @@ static void SpriteCB_Ball_Release_Wait(struct Sprite *sprite)
if (gSprites[gBattlerSpriteIds[gBattleAnimTarget]].affineAnimEnded)
{
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]], 0);
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]], BATTLER_AFFINE_NORMAL);
released = TRUE;
}
else

View File

@ -5040,7 +5040,7 @@ static void HandleEndTurn_FinishBattle(void)
}
}
}
PutPokemonTodayCaughtOnAir();
TryPutPokemonTodayOnAir();
}
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK
@ -5053,7 +5053,7 @@ static void HandleEndTurn_FinishBattle(void)
| BATTLE_TYPE_WALLY_TUTORIAL))
&& gBattleResults.shinyWildMon)
{
sub_80EE184();
TryPutBreakingNewsOnAir();
}
sub_8186444();

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,6 @@
#include "constants/event_objects.h"
#include "constants/moves.h"
#include "constants/easy_chat.h"
#include "constants/tv.h"
extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_MaxieTrainer[];
extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_TabithaTrainer[];

View File

@ -42,7 +42,6 @@
#include "constants/moves.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/tv.h"
// This file's functions.
static void LoadContestPalettes(void);
@ -350,8 +349,8 @@ EWRAM_DATA u8 gHighestRibbonRank = 0;
EWRAM_DATA struct ContestResources *gContestResources = NULL;
EWRAM_DATA u8 sContestBgCopyFlags = 0;
EWRAM_DATA struct ContestWinner gCurContestWinner = {0};
EWRAM_DATA bool8 gUnknown_02039F5C = 0;
EWRAM_DATA u8 gUnknown_02039F5D = 0;
EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0;
EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0;
// IWRAM common vars.
u32 gContestRngValue;
@ -1034,7 +1033,7 @@ void LoadContestBgAfterMoveAnim(void)
{
u32 contestantWindowId = 5 + i;
LoadPalette(eUnknownHeap1A004.cachedWindowPalettes[contestantWindowId], 16 * (5 + gContestantTurnOrder[i]), sizeof((eUnknownHeap1A004.cachedWindowPalettes[contestantWindowId])));
LoadPalette(eContestTempSave.cachedWindowPalettes[contestantWindowId], 16 * (5 + gContestantTurnOrder[i]), sizeof((eContestTempSave.cachedWindowPalettes[contestantWindowId])));
}
}
@ -1320,7 +1319,7 @@ static bool8 SetupContestGraphics(u8 *stateVar)
CopyToBgTilemapBuffer(2, gUnknown_08C17170, 0, 0);
CopyBgTilemapBufferToVram(2);
// This is a bug, and copies random junk. savedJunk is never read.
DmaCopy32Defvars(3, gContestResources->contestBgTilemaps[2], eUnknownHeap1A004.savedJunk, sizeof(eUnknownHeap1A004.savedJunk));
DmaCopy32Defvars(3, gContestResources->contestBgTilemaps[2], eContestTempSave.savedJunk, sizeof(eContestTempSave.savedJunk));
break;
case 5:
LoadCompressedPalette(gOldContestPalette, 0, 0x200);
@ -1328,7 +1327,7 @@ static bool8 SetupContestGraphics(u8 *stateVar)
CpuCopy32(gPlttBufferUnfaded + (5 + gContestPlayerMonIndex) * 16, tempPalette2, 16 * sizeof(u16));
CpuCopy32(tempPalette2, gPlttBufferUnfaded + 128, 16 * sizeof(u16));
CpuCopy32(tempPalette1, gPlttBufferUnfaded + (5 + gContestPlayerMonIndex) * 16, 16 * sizeof(u16));
DmaCopy32Defvars(3, gPlttBufferUnfaded, eUnknownHeap1A004.cachedWindowPalettes, sizeof(eUnknownHeap1A004.cachedWindowPalettes));
DmaCopy32Defvars(3, gPlttBufferUnfaded, eContestTempSave.cachedWindowPalettes, sizeof(eContestTempSave.cachedWindowPalettes));
LoadContestPalettes();
break;
case 6:
@ -1468,7 +1467,7 @@ static void Task_DisplayAppealNumberText(u8 taskId)
gBattle_BG0_Y = 0;
gBattle_BG2_Y = 0;
ContestDebugDoPrint();
DmaCopy32Defvars(3, gPlttBufferUnfaded, eUnknownHeap1A004.unk18204, PLTT_BUFFER_SIZE * 2);
DmaCopy32Defvars(3, gPlttBufferUnfaded, eContestTempSave.cachedPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2);
ConvertIntToDecimalStringN(gStringVar1, eContest.appealNumber + 1, STR_CONV_MODE_LEFT_ALIGN, 1);
if (!Contest_IsMonsTurnDisabled(gContestPlayerMonIndex))
StringCopy(gDisplayedStringBattle, gText_AppealNumWhichMoveWillBePlayed);
@ -1667,8 +1666,8 @@ static void Task_HideMoveSelectScreen(u8 taskId)
}
Contest_SetBgCopyFlags(0);
// This seems to be a bug; it should have just copied PLTT_BUFFER_SIZE.
DmaCopy32Defvars(3, gPlttBufferFaded, eUnknownHeap1A004.unk18604, PLTT_BUFFER_SIZE * 2);
LoadPalette(eUnknownHeap1A004.unk18204, 0, PLTT_BUFFER_SIZE * 2);
DmaCopy32Defvars(3, gPlttBufferFaded, eContestTempSave.cachedPlttBufferFaded, PLTT_BUFFER_SIZE * 2);
LoadPalette(eContestTempSave.cachedPlttBufferUnfaded, 0, PLTT_BUFFER_SIZE * 2);
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = 0;
gTasks[taskId].func = Task_HideApplauseMeterForAppealStart;
@ -2554,7 +2553,7 @@ static void Task_WaitForHeartSliders(u8 taskId)
static void sub_80DA348(u8 taskId)
{
DmaCopy32Defvars(3, eUnknownHeap1A004.unk18204, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2);
DmaCopy32Defvars(3, eContestTempSave.cachedPlttBufferUnfaded, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2);
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = 2;
gTasks[taskId].func = Task_WaitPrintRoundResult;
@ -3133,10 +3132,10 @@ static u8 CreateContestantSprite(u16 species, u32 otId, u32 personality, u32 ind
gSprites[spriteId].data[0] = gSprites[spriteId].oam.paletteNum;
gSprites[spriteId].data[2] = species;
if (IsSpeciesNotUnown(species))
gSprites[spriteId].affineAnims = gUnknown_082FF6C0;
gSprites[spriteId].affineAnims = gAffineAnims_BattleSpriteContest;
else
gSprites[spriteId].affineAnims = gAffineAnims_BattleSpriteOpponentSide;
StartSpriteAffineAnim(gSprites + spriteId, 0);
StartSpriteAffineAnim(&gSprites[spriteId], BATTLER_AFFINE_NORMAL);
return spriteId;
}
@ -4412,7 +4411,7 @@ static void DrawContestantWindows(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
s32 windowId = i + 5;
LoadPalette(eUnknownHeap1A004.cachedWindowPalettes[windowId], (gContestantTurnOrder[i] + 5) * 16, sizeof(eUnknownHeap1A004.cachedWindowPalettes[0]));
LoadPalette(eContestTempSave.cachedWindowPalettes[windowId], (gContestantTurnOrder[i] + 5) * 16, sizeof(eContestTempSave.cachedWindowPalettes[0]));
}
DrawContestantWindowText();
}
@ -5516,40 +5515,46 @@ void ResetContestLinkResults(void)
gSaveBlock2Ptr->contestLinkResults[i][j] = 0;
}
bool8 sub_80DEDA8(u8 rank)
bool8 SaveContestWinner(u8 rank)
{
s32 i;
u8 r7 = Random() % 3;
u8 captionId = Random() % NUM_PAINTING_CAPTIONS;
// Get the index of the winner among the contestants
for (i = 0; i < CONTESTANT_COUNT - 1; i++)
{
if (gContestFinalStandings[i] == 0)
break;
}
if (rank == 0xFF && i != gContestPlayerMonIndex)
// Exit if attempting to save a Pokémon other than the player's to the museum
if (rank == CONTEST_SAVE_FOR_MUSEUM && i != gContestPlayerMonIndex)
return FALSE;
// Adjust the random painting caption depending on the category
switch (gSpecialVar_ContestCategory)
{
case CONTEST_CATEGORY_COOL:
r7 += 0;
captionId += NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_COOL;
break;
case CONTEST_CATEGORY_BEAUTY:
r7 += 3;
captionId += NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_BEAUTY;
break;
case CONTEST_CATEGORY_CUTE:
r7 += 6;
captionId += NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_CUTE;
break;
case CONTEST_CATEGORY_SMART:
r7 += 9;
captionId += NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_SMART;
break;
case CONTEST_CATEGORY_TOUGH:
r7 += 12;
captionId += NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_TOUGH;
break;
}
if (rank != 0xFE)
{
u8 id = sub_80DEFA8(rank, 1);
if (rank != CONTEST_SAVE_FOR_ARTIST)
{
// Save winner in the saveblock
// Used to save any winner for the Contest Hall or the Museum
// but excludes the temporary save used by the artist
u8 id = GetContestWinnerSaveIdx(rank, TRUE);
gSaveBlock1Ptr->contestWinners[id].personality = gContestMons[i].personality;
gSaveBlock1Ptr->contestWinners[id].species = gContestMons[i].species;
gSaveBlock1Ptr->contestWinners[id].trainerId = gContestMons[i].otId;
@ -5560,24 +5565,29 @@ bool8 sub_80DEDA8(u8 rank)
else
gSaveBlock1Ptr->contestWinners[id].contestRank = gSpecialVar_ContestRank;
if (rank != 0xFF)
if (rank != CONTEST_SAVE_FOR_MUSEUM)
gSaveBlock1Ptr->contestWinners[id].contestCategory = gSpecialVar_ContestCategory;
else
gSaveBlock1Ptr->contestWinners[id].contestCategory = r7;
gSaveBlock1Ptr->contestWinners[id].contestCategory = captionId;
}
else
{
// Set the most recent winner so the artist can show the player their painting
gCurContestWinner.personality = gContestMons[i].personality;
gCurContestWinner.trainerId = gContestMons[i].otId;
gCurContestWinner.species = gContestMons[i].species;
StringCopy(gCurContestWinner.monName, gContestMons[i].nickname);
StringCopy(gCurContestWinner.trainerName, gContestMons[i].trainerName);
gCurContestWinner.contestCategory = r7;
gCurContestWinner.contestCategory = captionId;
}
return TRUE;
}
u8 sub_80DEFA8(u8 rank, u8 b)
// Rank is either a regular contest rank (for saving winners to show in the Contest Hall)
// Or one of two special IDs listed below (for saving winners to show in Museum, or from the artist)
// If just retrieving the index where the winner *would* go, shift is FALSE
// If actually preparing to insert the winner into the saveblock, shift is TRUE
u8 GetContestWinnerSaveIdx(u8 rank, bool8 shift)
{
s32 i;
@ -5587,13 +5597,15 @@ u8 sub_80DEFA8(u8 rank, u8 b)
case CONTEST_RANK_SUPER:
case CONTEST_RANK_HYPER:
case CONTEST_RANK_MASTER:
if (b != 0)
if (shift)
{
for (i = NUM_CONTEST_HALL_WINNERS - 1; i >= 1; i--)
for (i = NUM_CONTEST_HALL_WINNERS - 1; i > 0; i--)
memcpy(&gSaveBlock1Ptr->contestWinners[i], &gSaveBlock1Ptr->contestWinners[i - 1], sizeof(struct ContestWinner));
}
return 0;
return CONTEST_WINNER_HALL_1 - 1;
default:
// case CONTEST_SAVE_FOR_MUSEUM:
// case CONTEST_SAVE_FOR_ARTIST:
switch (gSpecialVar_ContestCategory)
{
case CONTEST_CATEGORY_COOL:
@ -5615,7 +5627,7 @@ void ClearContestWinnerPicsInContestHall(void)
{
s32 i;
for (i = 0; i < 8; i++)
for (i = 0; i < MUSEUM_CONTEST_WINNERS_START; i++)
gSaveBlock1Ptr->contestWinners[i] = gDefaultContestWinners[i];
}

View File

@ -21,18 +21,16 @@
#include "window.h"
#include "constants/rgb.h"
// IWRAM common
u16 (*gContestMonPixels)[][32];
struct ImageProcessingContext gImageProcessingContext;
struct ContestWinner *gContestPaintingWinner;
u16 *gContestPaintingMonPalette;
// IWRAM bss
static u8 gContestPaintingState;
static u16 gContestPaintingMosaicVal;
static u16 gContestPaintingFadeCounter;
static bool8 gUnknown_030011F6;
static u8 gContestPaintingWindowId;
static u8 sHoldState;
static u16 sMosaicVal;
static u16 sFadeCounter;
static bool8 sVarsInitialized;
static u8 sWindowId;
static void ShowContestPainting(void);
static void HoldContestPainting(void);
@ -44,7 +42,7 @@ static void PrintContestPaintingCaption(u8, u8);
static void VBlankCB_ContestPainting(void);
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64]);
extern const u8 gContestPaintingCaption[];
extern const u8 gContestHallPaintingCaption[];
extern const u8 gContestCoolness[];
extern const u8 gContestBeauty[];
extern const u8 gContestCuteness[];
@ -71,39 +69,39 @@ extern const u8 gContestPaintingTough1[];
extern const u8 gContestPaintingTough2[];
extern const u8 gContestPaintingTough3[];
const u16 gPictureFramePalettes[] = INCBIN_U16("graphics/picture_frame/bg.gbapal");
const u8 gPictureFrameTiles_0[] = INCBIN_U8("graphics/picture_frame/frame0.4bpp.rl");
const u8 gPictureFrameTiles_1[] = INCBIN_U8("graphics/picture_frame/frame1.4bpp.rl");
const u8 gPictureFrameTiles_2[] = INCBIN_U8("graphics/picture_frame/frame2.4bpp.rl");
const u8 gPictureFrameTiles_3[] = INCBIN_U8("graphics/picture_frame/frame3.4bpp.rl");
const u8 gPictureFrameTiles_4[] = INCBIN_U8("graphics/picture_frame/frame4.4bpp.rl");
const u8 gPictureFrameTiles_5[] = INCBIN_U8("graphics/picture_frame/frame5.4bpp.rl");
const u8 gPictureFrameTilemap_0[] = INCBIN_U8("graphics/picture_frame/frame0_map.bin.rl");
const u8 gPictureFrameTilemap_1[] = INCBIN_U8("graphics/picture_frame/frame1_map.bin.rl");
const u8 gPictureFrameTilemap_2[] = INCBIN_U8("graphics/picture_frame/frame2_map.bin.rl");
const u8 gPictureFrameTilemap_3[] = INCBIN_U8("graphics/picture_frame/frame3_map.bin.rl");
const u8 gPictureFrameTilemap_4[] = INCBIN_U8("graphics/picture_frame/frame4_map.bin.rl");
const u8 gPictureFrameTilemap_5[] = INCBIN_U8("graphics/picture_frame/frame5_map.bin.rl");
static const u16 sPictureFramePalettes[] = INCBIN_U16("graphics/picture_frame/bg.gbapal");
static const u8 sPictureFrameTiles_Cool[] = INCBIN_U8("graphics/picture_frame/cool.4bpp.rl");
static const u8 sPictureFrameTiles_Beauty[] = INCBIN_U8("graphics/picture_frame/beauty.4bpp.rl");
static const u8 sPictureFrameTiles_Cute[] = INCBIN_U8("graphics/picture_frame/cute.4bpp.rl");
static const u8 sPictureFrameTiles_Smart[] = INCBIN_U8("graphics/picture_frame/smart.4bpp.rl");
static const u8 sPictureFrameTiles_Tough[] = INCBIN_U8("graphics/picture_frame/tough.4bpp.rl");
static const u8 sPictureFrameTiles_HallLobby[] = INCBIN_U8("graphics/picture_frame/lobby.4bpp.rl");
static const u8 sPictureFrameTilemap_Cool[] = INCBIN_U8("graphics/picture_frame/cool_map.bin.rl");
static const u8 sPictureFrameTilemap_Beauty[] = INCBIN_U8("graphics/picture_frame/beauty_map.bin.rl");
static const u8 sPictureFrameTilemap_Cute[] = INCBIN_U8("graphics/picture_frame/cute_map.bin.rl");
static const u8 sPictureFrameTilemap_Smart[] = INCBIN_U8("graphics/picture_frame/smart_map.bin.rl");
static const u8 sPictureFrameTilemap_Tough[] = INCBIN_U8("graphics/picture_frame/tough_map.bin.rl");
static const u8 sPictureFrameTilemap_HallLobby[] = INCBIN_U8("graphics/picture_frame/lobby_map.bin.rl");
static const u8 *const sContestCategoryNames_Unused[] =
{
gContestCoolness,
gContestBeauty,
gContestCuteness,
gContestSmartness,
gContestToughness,
[CONTEST_CATEGORY_COOL] = gContestCoolness,
[CONTEST_CATEGORY_BEAUTY] = gContestBeauty,
[CONTEST_CATEGORY_CUTE] = gContestCuteness,
[CONTEST_CATEGORY_SMART] = gContestSmartness,
[CONTEST_CATEGORY_TOUGH] = gContestToughness,
};
static const u8 *const sContestRankNames[] =
{
gContestRankNormal,
gContestRankSuper,
gContestRankHyper,
gContestRankMaster,
gContestLink,
[CONTEST_RANK_NORMAL] = gContestRankNormal,
[CONTEST_RANK_SUPER] = gContestRankSuper,
[CONTEST_RANK_HYPER] = gContestRankHyper,
[CONTEST_RANK_MASTER] = gContestRankMaster,
[CONTEST_RANK_LINK] = gContestLink,
};
static const struct BgTemplate sContestPaintingBgTemplates[] =
static const struct BgTemplate sBgTemplates[] =
{
{
.bg = 1,
@ -116,7 +114,7 @@ static const struct BgTemplate sContestPaintingBgTemplates[] =
},
};
static const struct WindowTemplate sContestPaintingWindowTemplate =
static const struct WindowTemplate sWindowTemplate =
{
.bg = 1,
.tilemapLeft = 2,
@ -127,23 +125,23 @@ static const struct WindowTemplate sContestPaintingWindowTemplate =
.baseBlock = 1,
};
static const u8 *const sContestPaintingDescriptionPointers[] =
static const u8 *const sMuseumCaptions[NUM_PAINTING_CAPTIONS * CONTEST_CATEGORIES_COUNT] =
{
gContestPaintingCool1,
gContestPaintingCool2,
gContestPaintingCool3,
gContestPaintingBeauty1,
gContestPaintingBeauty2,
gContestPaintingBeauty3,
gContestPaintingCute1,
gContestPaintingCute2,
gContestPaintingCute3,
gContestPaintingSmart1,
gContestPaintingSmart2,
gContestPaintingSmart3,
gContestPaintingTough1,
gContestPaintingTough2,
gContestPaintingTough3,
[0 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_COOL] = gContestPaintingCool1,
[1 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_COOL] = gContestPaintingCool2,
[2 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_COOL] = gContestPaintingCool3,
[0 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_BEAUTY] = gContestPaintingBeauty1,
[1 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_BEAUTY] = gContestPaintingBeauty2,
[2 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_BEAUTY] = gContestPaintingBeauty3,
[0 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_CUTE] = gContestPaintingCute1,
[1 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_CUTE] = gContestPaintingCute2,
[2 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_CUTE] = gContestPaintingCute3,
[0 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_SMART] = gContestPaintingSmart1,
[1 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_SMART] = gContestPaintingSmart2,
[2 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_SMART] = gContestPaintingSmart3,
[0 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_TOUGH] = gContestPaintingTough1,
[1 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_TOUGH] = gContestPaintingTough2,
[2 + NUM_PAINTING_CAPTIONS * CONTEST_CATEGORY_TOUGH] = gContestPaintingTough3,
};
static const struct OamData sContestPaintingMonOamData =
@ -161,15 +159,15 @@ static const struct OamData sContestPaintingMonOamData =
.paletteNum = 0,
};
const u16 gUnknown_085B0838[] = {RGB(0, 0, 0), RGB(0, 0, 0)};
static const u16 sBgPalette[] = {RGB_BLACK, RGB_BLACK};
void SetContestWinnerForPainting(int contestWinnerId)
{
u8 *ptr1 = &gUnknown_02039F5D;
u8 *ptr2 = &gUnknown_02039F5C;
u8 *saveIdx = &gCurContestWinnerSaveIdx;
u8 *isForArtist = &gCurContestWinnerIsForArtist;
gCurContestWinner = gSaveBlock1Ptr->contestWinners[contestWinnerId - 1];
*ptr1 = contestWinnerId - 1;
*ptr2 = FALSE;
*saveIdx = contestWinnerId - 1;
*isForArtist = FALSE;
}
void CB2_ContestPainting(void)
@ -189,7 +187,7 @@ static void CB2_QuitContestPainting(void)
SetMainCallback2(gMain.savedCallback);
FREE_AND_SET_NULL(gContestPaintingMonPalette);
FREE_AND_SET_NULL(gContestMonPixels);
RemoveWindow(gContestPaintingWindowId);
RemoveWindow(sWindowId);
Free(GetBgTilemapBuffer(1));
FreeMonSpritesGfx();
}
@ -203,13 +201,13 @@ static void ShowContestPainting(void)
SetVBlankCallback(NULL);
AllocateMonSpritesGfx();
gContestPaintingWinner = &gCurContestWinner;
InitContestPaintingVars(1);
InitContestPaintingVars(TRUE);
InitContestPaintingBg();
gMain.state++;
break;
case 1:
ResetPaletteFade();
DmaFillLarge32(3, 0, (void *)BG_VRAM, 0x18000, 0x1000);
DmaFillLarge32(3, 0, (void *)VRAM, VRAM_SIZE, 0x1000);
ResetSpriteData();
gMain.state++;
break;
@ -220,16 +218,16 @@ static void ShowContestPainting(void)
gMain.state++;
break;
case 3:
CreateContestPaintingPicture(gUnknown_02039F5D, gUnknown_02039F5C);
CreateContestPaintingPicture(gCurContestWinnerSaveIdx, gCurContestWinnerIsForArtist);
gMain.state++;
break;
case 4:
PrintContestPaintingCaption(gUnknown_02039F5D, gUnknown_02039F5C);
LoadPalette(gUnknown_085B0838, 0, 1 * 2);
PrintContestPaintingCaption(gCurContestWinnerSaveIdx, gCurContestWinnerIsForArtist);
LoadPalette(sBgPalette, 0, 1 * 2);
DmaClear32(3, PLTT, PLTT_SIZE);
BeginFastPaletteFade(2);
SetVBlankCallback(VBlankCB_ContestPainting);
gContestPaintingState = 0;
sHoldState = 0;
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_OBJ_ON);
SetMainCallback2(CB2_HoldContestPainting);
break;
@ -238,29 +236,29 @@ static void ShowContestPainting(void)
static void HoldContestPainting(void)
{
switch (gContestPaintingState)
switch (sHoldState)
{
case 0:
if (!gPaletteFade.active)
gContestPaintingState = 1;
if (gUnknown_030011F6 && gContestPaintingFadeCounter)
gContestPaintingFadeCounter--;
sHoldState = 1;
if (sVarsInitialized && sFadeCounter)
sFadeCounter--;
break;
case 1:
if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))
{
gContestPaintingState++;
sHoldState++;
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0));
}
if (gUnknown_030011F6)
gContestPaintingFadeCounter = 0;
if (sVarsInitialized)
sFadeCounter = 0;
break;
case 2:
if (!gPaletteFade.active)
SetMainCallback2(CB2_QuitContestPainting);
if (gUnknown_030011F6 && gContestPaintingFadeCounter < 30)
gContestPaintingFadeCounter++;
if (sVarsInitialized && sFadeCounter < 30)
sFadeCounter++;
break;
}
}
@ -268,45 +266,48 @@ static void HoldContestPainting(void)
static void InitContestPaintingWindow(void)
{
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sContestPaintingBgTemplates, ARRAY_COUNT(sContestPaintingBgTemplates));
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
ChangeBgX(1, 0, 0);
ChangeBgY(1, 0, 0);
SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE));
gContestPaintingWindowId = AddWindow(&sContestPaintingWindowTemplate);
sWindowId = AddWindow(&sWindowTemplate);
DeactivateAllTextPrinters();
FillWindowPixelBuffer(gContestPaintingWindowId, PIXEL_FILL(0));
PutWindowTilemap(gContestPaintingWindowId);
CopyWindowToVram(gContestPaintingWindowId, 3);
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0));
PutWindowTilemap(sWindowId);
CopyWindowToVram(sWindowId, 3);
ShowBg(1);
}
static void PrintContestPaintingCaption(u8 contestType, bool8 arg1)
static void PrintContestPaintingCaption(u8 contestType, bool8 isForArtist)
{
int x;
u8 category;
if (arg1 == TRUE)
// Artist's painting has no caption
if (isForArtist == TRUE)
return;
category = gContestPaintingWinner->contestCategory;
if (contestType < 8)
if (contestType < MUSEUM_CONTEST_WINNERS_START)
{
// Contest Hall caption
BufferContestName(gStringVar1, category);
StringAppend(gStringVar1, gText_Space);
StringAppend(gStringVar1, sContestRankNames[gContestPaintingWinner->contestRank]);
StringCopy(gStringVar2, gContestPaintingWinner->trainerName);
sub_81DB5AC(gStringVar2);
ConvertInternationalContestantName(gStringVar2);
StringCopy(gStringVar3, gContestPaintingWinner->monName);
StringExpandPlaceholders(gStringVar4, gContestPaintingCaption);
StringExpandPlaceholders(gStringVar4, gContestHallPaintingCaption);
}
else
{
// Museum caption
StringCopy(gStringVar1, gContestPaintingWinner->monName);
StringExpandPlaceholders(gStringVar4, sContestPaintingDescriptionPointers[category]);
StringExpandPlaceholders(gStringVar4, sMuseumCaptions[category]);
}
x = GetStringCenterAlignXOffset(1, gStringVar4, 208);
AddTextPrinterParameterized(gContestPaintingWindowId, 1, gStringVar4, x, 1, 0, 0);
AddTextPrinterParameterized(sWindowId, 1, gStringVar4, x, 1, 0, 0);
CopyBgTilemapBufferToVram(1);
}
@ -321,33 +322,34 @@ static void InitContestPaintingBg(void)
SetGpuReg(REG_OFFSET_BLDY, 0);
}
static void InitContestPaintingVars(bool8 arg0)
static void InitContestPaintingVars(bool8 reset)
{
if (arg0 == FALSE)
if (reset == FALSE)
{
gUnknown_030011F6 = FALSE;
gContestPaintingMosaicVal = 0;
gContestPaintingFadeCounter = 0;
// Never reached
sVarsInitialized = FALSE;
sMosaicVal = 0;
sFadeCounter = 0;
}
else
{
gUnknown_030011F6 = TRUE;
gContestPaintingMosaicVal = 15;
gContestPaintingFadeCounter = 30;
sVarsInitialized = TRUE;
sMosaicVal = 15;
sFadeCounter = 30;
}
}
static void UpdateContestPaintingMosaicEffect(void)
{
if (!gUnknown_030011F6)
if (!sVarsInitialized)
{
SetGpuReg(REG_OFFSET_MOSAIC, 0);
}
else
{
SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(10) | BGCNT_MOSAIC | BGCNT_16COLOR | BGCNT_TXT256x256);
gContestPaintingMosaicVal = gContestPaintingFadeCounter / 2;
SetGpuReg(REG_OFFSET_MOSAIC, (gContestPaintingMosaicVal << 12) | (gContestPaintingMosaicVal << 8) | (gContestPaintingMosaicVal << 4) | (gContestPaintingMosaicVal << 0));
sMosaicVal = sFadeCounter / 2;
SetGpuReg(REG_OFFSET_MOSAIC, (sMosaicVal << 12) | (sMosaicVal << 8) | (sMosaicVal << 4) | (sMosaicVal << 0));
}
}
@ -414,34 +416,35 @@ static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)
#define VRAM_PICTURE_DATA(x, y) (((u16 *)(BG_SCREEN_ADDR(12)))[(y) * 32 + (x)])
static void LoadContestPaintingFrame(u8 contestWinnerId, bool8 arg1)
static void LoadContestPaintingFrame(u8 contestWinnerId, bool8 isForArtist)
{
u8 x, y;
LoadPalette(gPictureFramePalettes, 0, 0x100);
if (arg1 == TRUE)
LoadPalette(sPictureFramePalettes, 0, 0x100);
if (isForArtist == TRUE)
{
switch (gContestPaintingWinner->contestCategory / 3)
// Load Artist's frame
switch (gContestPaintingWinner->contestCategory / NUM_PAINTING_CAPTIONS)
{
case CONTEST_CATEGORY_COOL:
RLUnCompVram(gPictureFrameTiles_0, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_0, gContestMonPixels);
RLUnCompVram(sPictureFrameTiles_Cool, (void *)VRAM);
RLUnCompWram(sPictureFrameTilemap_Cool, gContestMonPixels);
break;
case CONTEST_CATEGORY_BEAUTY:
RLUnCompVram(gPictureFrameTiles_1, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_1, gContestMonPixels);
RLUnCompVram(sPictureFrameTiles_Beauty, (void *)VRAM);
RLUnCompWram(sPictureFrameTilemap_Beauty, gContestMonPixels);
break;
case CONTEST_CATEGORY_CUTE:
RLUnCompVram(gPictureFrameTiles_2, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_2, gContestMonPixels);
RLUnCompVram(sPictureFrameTiles_Cute, (void *)VRAM);
RLUnCompWram(sPictureFrameTilemap_Cute, gContestMonPixels);
break;
case CONTEST_CATEGORY_SMART:
RLUnCompVram(gPictureFrameTiles_3, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_3, gContestMonPixels);
RLUnCompVram(sPictureFrameTiles_Smart, (void *)VRAM);
RLUnCompWram(sPictureFrameTilemap_Smart, gContestMonPixels);
break;
case CONTEST_CATEGORY_TOUGH:
RLUnCompVram(gPictureFrameTiles_4, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_4, gContestMonPixels);
RLUnCompVram(sPictureFrameTiles_Tough, (void *)VRAM);
RLUnCompWram(sPictureFrameTilemap_Tough, gContestMonPixels);
break;
}
@ -463,34 +466,36 @@ static void LoadContestPaintingFrame(u8 contestWinnerId, bool8 arg1)
for (x = 0; x < 16; x++)
VRAM_PICTURE_DATA(x + 7, 2) = (*gContestMonPixels)[2][7];
}
else if (contestWinnerId < 8)
else if (contestWinnerId < MUSEUM_CONTEST_WINNERS_START)
{
RLUnCompVram(gPictureFrameTiles_5, (void *)VRAM);
RLUnCompVram(gPictureFrameTilemap_5, (void *)(BG_SCREEN_ADDR(12)));
// Load Contest Hall lobby frame
RLUnCompVram(sPictureFrameTiles_HallLobby, (void *)VRAM);
RLUnCompVram(sPictureFrameTilemap_HallLobby, (void *)(BG_SCREEN_ADDR(12)));
}
else
{
switch (gContestPaintingWinner->contestCategory / 3)
// Load Museum frame
switch (gContestPaintingWinner->contestCategory / NUM_PAINTING_CAPTIONS)
{
case CONTEST_CATEGORY_COOL:
RLUnCompVram(gPictureFrameTiles_0, (void *)VRAM);
RLUnCompVram(gPictureFrameTilemap_0, (void *)(BG_SCREEN_ADDR(12)));
RLUnCompVram(sPictureFrameTiles_Cool, (void *)VRAM);
RLUnCompVram(sPictureFrameTilemap_Cool, (void *)(BG_SCREEN_ADDR(12)));
break;
case CONTEST_CATEGORY_BEAUTY:
RLUnCompVram(gPictureFrameTiles_1, (void *)VRAM);
RLUnCompVram(gPictureFrameTilemap_1, (void *)(BG_SCREEN_ADDR(12)));
RLUnCompVram(sPictureFrameTiles_Beauty, (void *)VRAM);
RLUnCompVram(sPictureFrameTilemap_Beauty, (void *)(BG_SCREEN_ADDR(12)));
break;
case CONTEST_CATEGORY_CUTE:
RLUnCompVram(gPictureFrameTiles_2, (void *)VRAM);
RLUnCompVram(gPictureFrameTilemap_2, (void *)(BG_SCREEN_ADDR(12)));
RLUnCompVram(sPictureFrameTiles_Cute, (void *)VRAM);
RLUnCompVram(sPictureFrameTilemap_Cute, (void *)(BG_SCREEN_ADDR(12)));
break;
case CONTEST_CATEGORY_SMART:
RLUnCompVram(gPictureFrameTiles_3, (void *)VRAM);
RLUnCompVram(gPictureFrameTilemap_3, (void *)(BG_SCREEN_ADDR(12)));
RLUnCompVram(sPictureFrameTiles_Smart, (void *)VRAM);
RLUnCompVram(sPictureFrameTilemap_Smart, (void *)(BG_SCREEN_ADDR(12)));
break;
case CONTEST_CATEGORY_TOUGH:
RLUnCompVram(gPictureFrameTiles_4, (void *)VRAM);
RLUnCompVram(gPictureFrameTilemap_4, (void *)(BG_SCREEN_ADDR(12)));
RLUnCompVram(sPictureFrameTiles_Tough, (void *)VRAM);
RLUnCompVram(sPictureFrameTilemap_Tough, (void *)(BG_SCREEN_ADDR(12)));
break;
}
}
@ -519,10 +524,10 @@ static u8 GetImageEffectForContestWinner(u8 contestWinnerId)
{
u8 contestCategory;
if (contestWinnerId < 8)
if (contestWinnerId < MUSEUM_CONTEST_WINNERS_START)
contestCategory = gContestPaintingWinner->contestCategory;
else
contestCategory = gContestPaintingWinner->contestCategory / 3;
contestCategory = gContestPaintingWinner->contestCategory / NUM_PAINTING_CAPTIONS;
switch (contestCategory)
{
@ -584,12 +589,12 @@ static void DoContestPaintingImageProcessing(u8 imageEffect)
LoadPalette(gContestPaintingMonPalette, 0x100, 0x200);
}
static void CreateContestPaintingPicture(u8 contestWinnerId, bool8 arg1)
static void CreateContestPaintingPicture(u8 contestWinnerId, bool8 isForArtist)
{
AllocPaintingResources();
InitContestMonPixels(gContestPaintingWinner->species, 0);
DoContestPaintingImageProcessing(GetImageEffectForContestWinner(contestWinnerId));
InitPaintingMonOamData(contestWinnerId);
LoadContestPaintingFrame(contestWinnerId, arg1);
LoadContestPaintingFrame(contestWinnerId, isForArtist);
}

View File

@ -44,7 +44,6 @@
#include "constants/game_stat.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/tv.h"
#include "contest.h"
enum {
@ -61,10 +60,29 @@ enum {
#define GET_CONTEST_WINNER_ID(i) { for ((i) = 0; (i) < CONTESTANT_COUNT && gContestFinalStandings[(i)] != 0; (i)++); }
// Gfx/pal tags for the text window sprites on the contest results screen.
// Both types of text windows are made up of 4 individual sprites
// These tags are used by the spritesheets, and implicitly in the loop in CreateResultsTextWindowSprites
#define TAG_TEXT_WINDOW_BASE 3009
enum {
TAG_RESULTS_TEXT_WINDOW_LEFT = TAG_TEXT_WINDOW_BASE,
TAG_RESULTS_TEXT_WINDOW_MIDLEFT,
TAG_RESULTS_TEXT_WINDOW_MIDRIGHT,
TAG_RESULTS_TEXT_WINDOW_RIGHT,
TAG_LINK_TEXT_WINDOW_LEFT,
TAG_LINK_TEXT_WINDOW_MIDLEFT,
TAG_LINK_TEXT_WINDOW_MIDRIGHT,
TAG_LINK_TEXT_WINDOW_RIGHT, // 3016
};
#define TAG_CONFETTI 3017
#define TAG_WIRELESS_INDICATOR_WINDOW 22222
#define MAX_BAR_LENGTH 87
// Starting x/y for the sliding results screen text box
#define TEXT_BOX_X (DISPLAY_WIDTH + 32)
#define TEXT_BOX_Y (DISPLAY_HEIGHT - 16)
struct ContestResultsInternal
{
u8 slidingTextBoxSpriteId;
@ -105,14 +123,14 @@ struct ContestResults
static EWRAM_DATA struct ContestResults *sContestResults = NULL;
static void LoadAllContestMonIconPalettes(void);
static void LoadContestResultsTilemaps(void);
static void LoadContestResultsTitleBarTilemaps(void);
static u8 GetNumPreliminaryPoints(u8, bool8);
static s8 GetNumRound2Points(u8, bool8);
static void AddContestTextPrinter(int, u8 *, int);
static void AllocContestResults(void);
static void FreeContestResults(void);
static void LoadAllContestMonIcons(u8, u8);
static void LoadContestResultSprites(void);
static void CreateResultsTextWindowSprites(void);
static void TryCreateWirelessSprites(void);
static void Task_StartShowContestResults(u8 taskId);
static void CB2_StartShowContestResults(void);
@ -166,11 +184,11 @@ static void SpriteCB_Confetti(struct Sprite *sprite);
static void Task_ShowContestEntryMonPic(u8 taskId);
static void Task_LinkContestWaitForConnection(u8 taskId);
static const u16 sUnknown_0858D6B0[] = INCBIN_U16("graphics/unknown/unknown_58D6B0.gbapal");
static const u8 sUnknown_0858D6D0[] = INCBIN_U8("graphics/unknown/unknown_58D6D0.4bpp");
static const u16 sResultsTextWindow_Pal[] = INCBIN_U16("graphics/contest/results_screen/text_window.gbapal");
static const u8 sResultsTextWindow_Gfx[] = INCBIN_U8("graphics/contest/results_screen/text_window.4bpp");
static const u16 sMiscBlank_Pal[] = INCBIN_U16("graphics/interface/blank.gbapal");
static const struct OamData sOamData_858D7F0 =
static const struct OamData sOamData_ResultsTextWindow =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@ -187,33 +205,33 @@ static const struct OamData sOamData_858D7F0 =
.affineParam = 0,
};
static const struct SpriteTemplate sSpriteTemplate_858D7F8 =
static const struct SpriteTemplate sSpriteTemplate_ResultsTextWindow =
{
.tileTag = 3009,
.paletteTag = 3009,
.oam = &sOamData_858D7F0,
.tileTag = TAG_TEXT_WINDOW_BASE,
.paletteTag = TAG_TEXT_WINDOW_BASE,
.oam = &sOamData_ResultsTextWindow,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteSheet sUnknown_0858D810[] =
static const struct SpriteSheet sSpriteSheets_ResultsTextWindow[] =
{
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3009 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3010 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3011 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3012 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3013 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3014 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3015 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3016 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_RESULTS_TEXT_WINDOW_LEFT },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_RESULTS_TEXT_WINDOW_MIDLEFT },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_RESULTS_TEXT_WINDOW_MIDRIGHT },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_RESULTS_TEXT_WINDOW_RIGHT },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_LINK_TEXT_WINDOW_LEFT },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_LINK_TEXT_WINDOW_MIDLEFT },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_LINK_TEXT_WINDOW_MIDRIGHT },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = TAG_LINK_TEXT_WINDOW_RIGHT },
};
static const struct SpritePalette sUnknown_0858D850 =
static const struct SpritePalette sSpritePalette_ResultsTextWindow =
{
.data = sMiscBlank_Pal,
.tag = 3009,
.tag = TAG_TEXT_WINDOW_BASE,
};
static const struct OamData sOamData_Confetti =
@ -339,7 +357,7 @@ static const struct WindowTemplate sWindowTemplates[] =
DUMMY_WIN_TEMPLATE,
};
static const struct OamData sUnknown_0858D8C0 =
static const struct OamData sOamData_WirelessIndicatorWindow =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@ -357,22 +375,22 @@ static const struct OamData sUnknown_0858D8C0 =
};
static const struct SpriteTemplate sSpriteTemplate_858D8C8 =
static const struct SpriteTemplate sSpriteTemplate_WirelessIndicatorWindow =
{
.tileTag = 22222,
.tileTag = TAG_WIRELESS_INDICATOR_WINDOW,
.paletteTag = 0,
.oam = &sUnknown_0858D8C0,
.oam = &sOamData_WirelessIndicatorWindow,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteSheet sUnknown_0858D8E0 =
static const struct SpriteSheet sSpriteSheet_WirelessIndicatorWindow =
{
.data = gMiscBlank_Gfx,
.size = 0x200,
.tag = 22222
.tag = TAG_WIRELESS_INDICATOR_WINDOW
};
static const u8 sContestLinkTextColors[4] = {TEXT_COLOR_WHITE, TEXT_DYNAMIC_COLOR_6, TEXT_DYNAMIC_COLOR_5};
@ -430,12 +448,12 @@ static void LoadContestResultsBgGfx(void)
u16 tile1, tile2;
LZDecompressVram(gContestResults_Gfx, (void *)BG_CHAR_ADDR(0));
CopyToBgTilemapBuffer(3, gUnknown_08C1A12C, 0, 0);
CopyToBgTilemapBuffer(2, gUnknown_08C1A000, 0, 0);
CopyToBgTilemapBuffer(0, gUnknown_08C19EEC, 0, 0);
LoadContestResultsTilemaps();
CopyToBgTilemapBuffer(3, gContestResults_Bg_Tilemap, 0, 0);
CopyToBgTilemapBuffer(2, gContestResults_Interface_Tilemap, 0, 0);
CopyToBgTilemapBuffer(0, gContestResults_WinnerBanner_Tilemap, 0, 0);
LoadContestResultsTitleBarTilemaps();
LoadCompressedPalette(gContestResults_Pal, 0, 0x200);
LoadPalette(sUnknown_0858D6B0, 0xF0, 0x20);
LoadPalette(sResultsTextWindow_Pal, 0xF0, sizeof(sResultsTextWindow_Pal));
for (i = 0; i < CONTESTANT_COUNT; i++)
{
@ -515,14 +533,14 @@ static void CB2_StartShowContestResults(void)
LoadAllContestMonNames();
memset(sContestResults->data, 0, sizeof(*sContestResults->data));
memset(sContestResults->monResults, 0, sizeof(*sContestResults->monResults));
LoadContestResultSprites();
CreateResultsTextWindowSprites();
TryCreateWirelessSprites();
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = FALSE;
sContestResults->data->showResultsTaskId = CreateTask(Task_ShowContestResults, 5);
SetMainCallback2(CB2_ShowContestResults);
gBattle_WIN1H = WIN_RANGE(0, DISPLAY_WIDTH);
gBattle_WIN1V = WIN_RANGE(128, DISPLAY_HEIGHT);
gBattle_WIN1V = WIN_RANGE(DISPLAY_HEIGHT - 32, DISPLAY_HEIGHT);
CreateTask(Task_SlideContestResultsBg, 20);
CalculateContestantsResultData();
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
@ -587,10 +605,10 @@ static void Task_ShowContestResults(u8 taskId)
}
TryGainNewFanFromCounter(FANCOUNTER_FINISHED_CONTEST);
sub_80DEDA8(gSpecialVar_ContestRank);
sub_80DEDA8(0xFE);
gUnknown_02039F5C = TRUE;
gUnknown_02039F5D = sub_80DEFA8(0xFE, 0);
SaveContestWinner(gSpecialVar_ContestRank); // Save for lobby painting
SaveContestWinner(CONTEST_SAVE_FOR_ARTIST);
gCurContestWinnerIsForArtist = TRUE;
gCurContestWinnerSaveIdx = GetContestWinnerSaveIdx(CONTEST_SAVE_FOR_ARTIST, FALSE);
var = VarGet(VAR_CONTEST_HALL_STATE);
VarSet(VAR_CONTEST_HALL_STATE, 0);
SetContinueGameWarpStatusToDynamicWarp();
@ -637,10 +655,10 @@ static void Task_ShowContestResults(u8 taskId)
if (gContestFinalStandings[gContestPlayerMonIndex] == 0)
IncrementGameStat(GAME_STAT_WON_CONTEST);
sub_80DEDA8(gSpecialVar_ContestRank);
sub_80DEDA8(0xFE);
gUnknown_02039F5C = TRUE;
gUnknown_02039F5D = sub_80DEFA8(0xFE, 0);
SaveContestWinner(gSpecialVar_ContestRank); // Save for lobby painting
SaveContestWinner(CONTEST_SAVE_FOR_ARTIST);
gCurContestWinnerIsForArtist = TRUE;
gCurContestWinnerSaveIdx = GetContestWinnerSaveIdx(CONTEST_SAVE_FOR_ARTIST, FALSE);
TryGainNewFanFromCounter(FANCOUNTER_FINISHED_CONTEST);
gTasks[taskId].func = Task_AnnouncePreliminaryResults;
}
@ -679,7 +697,7 @@ static void Task_AnnouncePreliminaryResults(u8 taskId)
{
CreateTask(Task_FlashStarsAndHearts, 20);
x = DrawResultsTextWindow(gText_AnnouncingResults, sContestResults->data->slidingTextBoxSpriteId);
StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, 120, 1088);
StartTextBoxSlideIn(x, TEXT_BOX_Y, 120, 1088);
gTasks[taskId].tState++;
}
else if (gTasks[taskId].tState == 1)
@ -702,7 +720,7 @@ static void Task_AnnouncePreliminaryResults(u8 taskId)
else if (gTasks[taskId].tState == 3)
{
x = DrawResultsTextWindow(gText_PreliminaryResults, sContestResults->data->slidingTextBoxSpriteId);
StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, -1, 1088);
StartTextBoxSlideIn(x, TEXT_BOX_Y, -1, 1088);
gTasks[taskId].tState++;
}
else if (gTasks[taskId].tState == 4)
@ -752,7 +770,7 @@ static void Task_AnnounceRound2Results(u8 taskId)
{
gTasks[taskId].tTimer = 0;
x = DrawResultsTextWindow(gText_Round2Results, sContestResults->data->slidingTextBoxSpriteId);
StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, -1, 1088);
StartTextBoxSlideIn(x, TEXT_BOX_Y, -1, 1088);
}
}
else if (sContestResults->data->slidingTextBoxState == SLIDING_TEXT_ARRIVED)
@ -837,11 +855,11 @@ static void Task_AnnounceWinner(u8 taskId)
gTasks[taskId].tTimer = 0;
GET_CONTEST_WINNER_ID(i);
StringCopy(gStringVar1, gContestMons[i].trainerName);
sub_81DB5AC(gStringVar1);
ConvertInternationalContestantName(gStringVar1);
StringCopy(gStringVar2, gContestMons[i].nickname);
StringExpandPlaceholders(winnerTextBuffer, gText_ContestantsMonWon);
x = DrawResultsTextWindow(winnerTextBuffer, sContestResults->data->slidingTextBoxSpriteId);
StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, -1, 1088);
StartTextBoxSlideIn(x, TEXT_BOX_Y, -1, 1088);
gTasks[taskId].tState++;
}
break;
@ -892,7 +910,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
LoadCompressedSpritePalette(pokePal);
SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.paletteTag = pokePal->tag;
spriteId = CreateSprite(&gMultiuseSpriteTemplate, DISPLAY_WIDTH + 32, 80, 10);
spriteId = CreateSprite(&gMultiuseSpriteTemplate, DISPLAY_WIDTH + 32, DISPLAY_HEIGHT / 2, 10);
gSprites[spriteId].data[1] = species;
gSprites[spriteId].oam.priority = 0;
gSprites[spriteId].callback = SpriteCB_WinnerMonSlideIn;
@ -1136,9 +1154,9 @@ static void TryCreateWirelessSprites(void)
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(8, 8);
gSprites[gWirelessStatusIndicatorSpriteId].subpriority = 1;
sheet = LoadSpriteSheet(&sUnknown_0858D8E0);
sheet = LoadSpriteSheet(&sSpriteSheet_WirelessIndicatorWindow);
RequestDma3Fill(0xFFFFFFFF, (void *)BG_CHAR_ADDR(4) + sheet * 0x20, 0x80, 1);
spriteId = CreateSprite(&sSpriteTemplate_858D8C8, 8, 8, 0);
spriteId = CreateSprite(&sSpriteTemplate_WirelessIndicatorWindow, 8, 8, 0);
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW;
}
}
@ -1150,14 +1168,13 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
int strWidth;
u8 *spriteTilePtrs[4];
u8 *dst;
{
struct WindowTemplate windowTemplate;
memset(&windowTemplate, 0, sizeof(windowTemplate));
windowTemplate.width = 30;
windowTemplate.height = 2;
windowId = AddWindow(&windowTemplate);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
}
struct WindowTemplate windowTemplate;
memset(&windowTemplate, 0, sizeof(windowTemplate));
windowTemplate.width = 30;
windowTemplate.height = 2;
windowId = AddWindow(&windowTemplate);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
origWidth = GetStringWidth(1, text, 0);
strWidth = (origWidth + 9) / 8;
@ -1169,16 +1186,16 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
s32 i;
struct Sprite *sprite;
const u8 *src, *windowTilesPtr;
windowTilesPtr = (u8 *)(GetWindowAttribute(windowId, WINDOW_TILE_DATA));
src = (u8 *)(sUnknown_0858D6D0);
windowTilesPtr = (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
src = (u8 *)sResultsTextWindow_Gfx;
sprite = &gSprites[spriteId];
spriteTilePtrs[0] = (u8 *)(sprite->oam.tileNum * 32 + OBJ_VRAM0);
for (i = 1; i < 4; i++)
for (i = 1; i < (int)ARRAY_COUNT(spriteTilePtrs); i++)
spriteTilePtrs[i] = (void*)(gSprites[sprite->data[i - 1]].oam.tileNum * 32 + OBJ_VRAM0);
for (i = 0; i < 4; i++)
for (i = 0; i < (int)ARRAY_COUNT(spriteTilePtrs); i++)
CpuFill32(0, spriteTilePtrs[i], 0x400);
dst = spriteTilePtrs[0];
@ -1208,27 +1225,31 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
return (DISPLAY_WIDTH - (strWidth + 2) * 8) / 2;
}
static void LoadContestResultSprites(void)
static void CreateResultsTextWindowSprites(void)
{
int i;
struct SpriteTemplate template;
u8 spriteIds[ARRAY_COUNT(sUnknown_0858D810)];
u8 spriteIds[ARRAY_COUNT(sSpriteSheets_ResultsTextWindow)];
template = sSpriteTemplate_858D7F8;
for (i = 0; i < (int)ARRAY_COUNT(sUnknown_0858D810); i++)
LoadSpriteSheet(&sUnknown_0858D810[i]);
template = sSpriteTemplate_ResultsTextWindow;
for (i = 0; i < (int)ARRAY_COUNT(sSpriteSheets_ResultsTextWindow); i++)
LoadSpriteSheet(&sSpriteSheets_ResultsTextWindow[i]);
LoadSpritePalette(&sUnknown_0858D850);
for (i = 0; i < (int)ARRAY_COUNT(sUnknown_0858D810); i++)
LoadSpritePalette(&sSpritePalette_ResultsTextWindow);
// Create sprites for the two window types, each made up of 4 sprites
for (i = 0; i < (int)ARRAY_COUNT(sSpriteSheets_ResultsTextWindow); i++)
{
spriteIds[i] = CreateSprite(&template, DISPLAY_WIDTH + 32, DISPLAY_HEIGHT - 16, 10);
spriteIds[i] = CreateSprite(&template, TEXT_BOX_X, TEXT_BOX_Y, 10);
template.tileTag++;
}
// Save sprite ids of the sliding text box onto its leftmost sprite
gSprites[spriteIds[0]].data[0] = spriteIds[1];
gSprites[spriteIds[0]].data[1] = spriteIds[2];
gSprites[spriteIds[0]].data[2] = spriteIds[3];
// Save sprite ids of the link text box onto its leftmost sprite
gSprites[spriteIds[4]].data[0] = spriteIds[5];
gSprites[spriteIds[4]].data[1] = spriteIds[6];
gSprites[spriteIds[4]].data[2] = spriteIds[7];
@ -1248,7 +1269,7 @@ static void LoadContestResultSprites(void)
static void StartTextBoxSlideIn(s16 x, u16 y, u16 slideOutTimer, u16 slideIncrement)
{
struct Sprite *sprite = &gSprites[sContestResults->data->slidingTextBoxSpriteId];
sprite->pos1.x = DISPLAY_WIDTH + 32;
sprite->pos1.x = TEXT_BOX_X;
sprite->pos1.y = y;
sprite->pos2.x = 0;
sprite->pos2.y = 0;
@ -1275,8 +1296,8 @@ static void StartTextBoxSlideOut(u16 slideIncrement)
static void EndTextBoxSlideOut(struct Sprite *sprite)
{
sprite->pos1.x = DISPLAY_WIDTH + 32;
sprite->pos1.y = DISPLAY_HEIGHT - 16;
sprite->pos1.x = TEXT_BOX_X;
sprite->pos1.y = TEXT_BOX_Y;
sprite->pos2.y = 0;
sprite->pos2.x = 0;
sprite->callback = SpriteCallbackDummy;
@ -1377,7 +1398,7 @@ static void HideLinkResultsTextBox(void)
| WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
}
static void LoadContestResultsTilemaps(void)
static void LoadContestResultsTitleBarTilemaps(void)
{
u8 palette;
int x, y;
@ -1386,58 +1407,58 @@ static void LoadContestResultsTilemaps(void)
y = 1;
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
CopyToBgTilemapBufferRect(2, gLinkContestResults_Tilemap, 5, 1, 5, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Link_Tilemap, 5, 1, 5, 2);
x = 10;
}
else if (gSpecialVar_ContestRank == CONTEST_RANK_NORMAL)
{
CopyToBgTilemapBufferRect(2, gNormalContestResults_Tilemap, 5, 1, 10, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Normal_Tilemap, 5, 1, 10, 2);
x = 15;
}
else if (gSpecialVar_ContestRank == CONTEST_RANK_SUPER)
{
CopyToBgTilemapBufferRect(2, gSuperContestResults_Tilemap, 5, 1, 10, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Super_Tilemap, 5, 1, 10, 2);
x = 15;
}
else if (gSpecialVar_ContestRank == CONTEST_RANK_HYPER)
{
CopyToBgTilemapBufferRect(2, gHyperContestResults_Tilemap, 5, 1, 10, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Hyper_Tilemap, 5, 1, 10, 2);
x = 15;
}
else // CONTEST_RANK_MASTER
{
CopyToBgTilemapBufferRect(2, gMasterContestResults_Tilemap, 5, 1, 10, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Master_Tilemap, 5, 1, 10, 2);
x = 15;
}
if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_COOL)
{
palette = 0;
CopyToBgTilemapBufferRect(2, gCoolContestResults_Tilemap, x, y, 5, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Cool_Tilemap, x, y, 5, 2);
}
else if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_BEAUTY)
{
palette = 1;
CopyToBgTilemapBufferRect(2, gBeautyContestResults_Tilemap, x, y, 5, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Beauty_Tilemap, x, y, 5, 2);
}
else if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_CUTE)
{
palette = 2;
CopyToBgTilemapBufferRect(2, gCuteContestResults_Tilemap, x, y, 5, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Cute_Tilemap, x, y, 5, 2);
}
else if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_SMART)
{
palette = 3;
CopyToBgTilemapBufferRect(2, gSmartContestResults_Tilemap, x, y, 5, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Smart_Tilemap, x, y, 5, 2);
}
else // CONTEST_CATEGORY_TOUGH
{
palette = 4;
CopyToBgTilemapBufferRect(2, gToughContestResults_Tilemap, x, y, 5, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Tough_Tilemap, x, y, 5, 2);
}
x += 5;
CopyToBgTilemapBufferRect(2, gContestResults_Tilemap, x, y, 6, 2);
CopyToBgTilemapBufferRect(2, gContestResultsTitle_Tilemap, x, y, 6, 2);
CopyToBgTilemapBufferRect_ChangePalette(2, sContestResults->tilemapBuffers[2], 0, 0, 32, 4, palette);
}
@ -1567,10 +1588,10 @@ static void SpriteCB_WinnerMonSlideIn(struct Sprite *sprite)
sprite->pos1.x -= delta >> 8;
sprite->data[1] += 0x600;
sprite->data[1] &= 0xFF;
if (sprite->pos1.x < 120)
sprite->pos1.x = 120;
if (sprite->pos1.x < DISPLAY_WIDTH / 2)
sprite->pos1.x = DISPLAY_WIDTH / 2;
if (sprite->pos1.x == 120)
if (sprite->pos1.x == DISPLAY_WIDTH / 2)
{
sprite->callback = SpriteCallbackDummy;
sprite->data[1] = 0;
@ -1628,7 +1649,7 @@ static void SpriteCB_Confetti(struct Sprite *sprite)
if (sContestResults->data->destroyConfetti)
sprite->invisible = TRUE;
if (sprite->pos1.x > 248 || sprite->pos1.y > 116)
if (sprite->pos1.x > DISPLAY_WIDTH + 8 || sprite->pos1.y > 116)
{
DestroySprite(sprite);
sContestResults->data->confettiCount--;
@ -2035,7 +2056,7 @@ void GiveMonContestRibbon(void)
void BufferContestantTrainerName(void)
{
StringCopy(gStringVar1, gContestMons[gSpecialVar_0x8006].trainerName);
sub_81DB5AC(gStringVar1);
ConvertInternationalContestantName(gStringVar1);
}
void BufferContestantMonNickname(void)
@ -2074,7 +2095,7 @@ void BufferContestWinnerTrainerName(void)
u8 i;
GET_CONTEST_WINNER_ID(i);
StringCopy(gStringVar3, gContestMons[i].trainerName);
sub_81DB5AC(gStringVar3);
ConvertInternationalContestantName(gStringVar3);
}
void BufferContestWinnerMonName(void)
@ -2257,6 +2278,10 @@ static void Task_LinkContest_WaitDisconnect(u8 taskId)
}
}
/*
A section of contest script functions starts here
*/
void SetContestTrainerGfxIds(void)
{
gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_0 - VARS_START] = gContestMons[0].trainerGfxId;
@ -2265,27 +2290,27 @@ void SetContestTrainerGfxIds(void)
}
// Unused
void sub_80F8814(void)
void GetNpcContestantLocalId(void)
{
u16 var1;
u8 var0 = gSpecialVar_0x8005;
switch (var0)
u16 localId;
u8 contestant = gSpecialVar_0x8005;
switch (contestant)
{
case 0:
var1 = 3;
localId = 3;
break;
case 1:
var1 = 4;
localId = 4;
break;
case 2:
var1 = 5;
localId = 5;
break;
default:
var1 = 100;
default: // Invalid
localId = 100;
break;
}
gSpecialVar_0x8004 = var1;
gSpecialVar_0x8004 = localId;
}
void BufferContestTrainerAndMonNames(void)
@ -2296,26 +2321,26 @@ void BufferContestTrainerAndMonNames(void)
}
// Unused
void DoesContestCategoryHaveWinner(void)
void DoesContestCategoryHaveMuseumPainting(void)
{
int contestWinner;
switch (gSpecialVar_ContestCategory)
{
case CONTEST_CATEGORY_COOL:
contestWinner = 8;
contestWinner = CONTEST_WINNER_MUSEUM_COOL - 1;
break;
case CONTEST_CATEGORY_BEAUTY:
contestWinner = 9;
contestWinner = CONTEST_WINNER_MUSEUM_BEAUTY - 1;
break;
case CONTEST_CATEGORY_CUTE:
contestWinner = 10;
contestWinner = CONTEST_WINNER_MUSEUM_CUTE - 1;
break;
case CONTEST_CATEGORY_SMART:
contestWinner = 11;
contestWinner = CONTEST_WINNER_MUSEUM_SMART - 1;
break;
case CONTEST_CATEGORY_TOUGH:
default:
contestWinner = 12;
contestWinner = CONTEST_WINNER_MUSEUM_TOUGH - 1;
break;
}
@ -2327,7 +2352,7 @@ void DoesContestCategoryHaveWinner(void)
void SaveMuseumContestPainting(void)
{
sub_80DEDA8(0xFF);
SaveContestWinner(CONTEST_SAVE_FOR_MUSEUM);
}
void ShouldReadyContestArtist(void)
@ -2344,14 +2369,14 @@ void ShouldReadyContestArtist(void)
}
}
u8 CountPlayerContestPaintings(void)
u8 CountPlayerMuseumPaintings(void)
{
int i;
u8 count = 0;
for (i = 0; i < 5; i++)
for (i = 0; i < NUM_CONTEST_WINNERS - MUSEUM_CONTEST_WINNERS_START; i++)
{
if (gSaveBlock1Ptr->contestWinners[8 + i].species)
if (gSaveBlock1Ptr->contestWinners[MUSEUM_CONTEST_WINNERS_START + i].species)
count++;
}
@ -2359,19 +2384,21 @@ u8 CountPlayerContestPaintings(void)
}
// Unused
void sub_80F8970(void)
void GetContestantNamesAtRank(void)
{
s16 conditions[CONTESTANT_COUNT];
int i, j;
s16 condition;
s8 var0;
u8 var2;
u8 r8;
u8 r7;
s8 numAtCondition;
u8 contestantOffset;
u8 tieRank;
u8 rank;
// Get round 1 points
for (i = 0; i < CONTESTANT_COUNT; i++)
conditions[i] = gContestMonRound1Points[i];
// Sort round 1 points
for (i = 0; i < CONTESTANT_COUNT - 1; i++)
{
for (j = CONTESTANT_COUNT - 1; j > i; j--)
@ -2384,58 +2411,65 @@ void sub_80F8970(void)
}
}
// Get round 1 points at specified rank
condition = conditions[gSpecialVar_0x8006];
var0 = 0;
r8 = 0;
// Count number of contestants with the same number of points
numAtCondition = 0;
tieRank = 0;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (conditions[i] == condition)
{
var0++;
numAtCondition++;
if (i == gSpecialVar_0x8006)
r8 = var0;
tieRank = numAtCondition;
}
}
// Get rank of first contestant with the same number of points
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (conditions[i] == condition)
break;
}
rank = i;
r7 = i;
var2 = r8;
// Get contestant id of player at rank (taking ties into account)
contestantOffset = tieRank;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (condition == gContestMonRound1Points[i])
{
if (var2 == 1)
if (contestantOffset == 1)
break;
var2--;
contestantOffset--;
}
}
// Use contestant id to get names
StringCopy(gStringVar1, gContestMons[i].nickname);
StringCopy(gStringVar2, gContestMons[i].trainerName);
sub_81DB5AC(gStringVar2);
ConvertInternationalContestantName(gStringVar2);
if (var0 == 1)
gSpecialVar_0x8006 = r7;
else if (r8 == var0)
gSpecialVar_0x8006 = r7;
// Return adjusted rank
if (numAtCondition == 1)
gSpecialVar_0x8006 = rank;
else if (tieRank == numAtCondition)
gSpecialVar_0x8006 = rank;
else
gSpecialVar_0x8006 = r7 + 4;
gSpecialVar_0x8006 = rank + CONTESTANT_COUNT;
}
static void ExitContestWinnerPainting(void)
static void ExitContestPainting(void)
{
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
}
void ShowContestWinnerPainting(void)
void ShowContestPainting(void)
{
SetMainCallback2(CB2_ContestPainting);
gMain.savedCallback = ExitContestWinnerPainting;
gMain.savedCallback = ExitContestPainting;
}
void SetLinkContestPlayerGfx(void)

View File

@ -124,172 +124,178 @@ static const union AnimCmd sAnim_GeneralFrame3[] =
ANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF548[] =
// Many of these affine anims seem to go unused, and
// instead SetSpriteRotScale is used to manipulate
// the battler sprites directly (for instance, in AnimTask_SwitchOutShrinkMon).
// Those with explicit indexes are referenced elsewhere.
static const union AffineAnimCmd sAffineAnim_Battler_Normal[] =
{
AFFINEANIMCMD_FRAME(0x0100, 0x0100, 0x00, 0x00),
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF558[] =
static const union AffineAnimCmd sAffineAnim_Battler_Flipped[] =
{
AFFINEANIMCMD_FRAME(0xff00, 0x0100, 0x00, 0x00),
AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF568[] =
static const union AffineAnimCmd sAffineAnim_Battler_Emerge[] =
{
AFFINEANIMCMD_FRAME(0x0028, 0x0028, 0x00, 0x00),
AFFINEANIMCMD_FRAME(0x0012, 0x0012, 0x00, 0x0c),
AFFINEANIMCMD_FRAME(0x28, 0x28, 0, 0),
AFFINEANIMCMD_FRAME(0x12, 0x12, 0, 12),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF580[] =
static const union AffineAnimCmd sAffineAnim_Battler_Return[] =
{
AFFINEANIMCMD_FRAME(0xfffe, 0xfffe, 0x00, 0x12),
AFFINEANIMCMD_FRAME(0xfff0, 0xfff0, 0x00, 0x0f),
AFFINEANIMCMD_FRAME( -0x2, -0x2, 0, 18),
AFFINEANIMCMD_FRAME(-0x10, -0x10, 0, 15),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF598[] =
static const union AffineAnimCmd sAffineAnim_Battler_HorizontalSquishLoop[] =
{
AFFINEANIMCMD_FRAME(0x00a0, 0x0100, 0x00, 0x00),
AFFINEANIMCMD_FRAME(0x0004, 0x0000, 0x00, 0x08),
AFFINEANIMCMD_FRAME(0xfffc, 0x0000, 0x00, 0x08),
AFFINEANIMCMD_FRAME(0xA0, 0x100, 0, 0),
AFFINEANIMCMD_FRAME( 0x4, 0x0, 0, 8),
AFFINEANIMCMD_FRAME(-0x4, 0x0, 0, 8),
AFFINEANIMCMD_JUMP(1),
};
static const union AffineAnimCmd gUnknown_082FF5B8[] =
static const union AffineAnimCmd sAffineAnim_Battler_Grow[] =
{
AFFINEANIMCMD_FRAME(0x0002, 0x0002, 0x00, 0x14),
AFFINEANIMCMD_FRAME(0x2, 0x2, 0, 20),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF5C8[] =
static const union AffineAnimCmd sAffineAnim_Battler_Shrink[] =
{
AFFINEANIMCMD_FRAME(0xfffe, 0xfffe, 0x00, 0x14),
AFFINEANIMCMD_FRAME(-0x2, -0x2, 0, 20),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF5D8[] =
static const union AffineAnimCmd sAffineAnim_Battler_BigToSmall[] =
{
AFFINEANIMCMD_FRAME(0x0100, 0x0100, 0x00, 0000),
AFFINEANIMCMD_FRAME(0xfff0, 0xfff0, 0x00, 0x09),
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
AFFINEANIMCMD_FRAME(-0x10, -0x10, 0, 9),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF5F0[] =
static const union AffineAnimCmd sAffineAnim_Battler_GrowLarge[] =
{
AFFINEANIMCMD_FRAME(0x0004, 0x0004, 0x00, 0x3f),
AFFINEANIMCMD_FRAME(0x4, 0x4, 0, 63),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF600[] =
static const union AffineAnimCmd sAffineAnim_Battler_TipRight[] =
{
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfd, 0x05),
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x03, 0x05),
AFFINEANIMCMD_FRAME(0x0, 0x0, -3, 5),
AFFINEANIMCMD_FRAME(0x0, 0x0, 3, 5),
AFFINEANIMCMD_END,
};
const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[] =
{
gUnknown_082FF548,
gUnknown_082FF568,
gUnknown_082FF580,
gUnknown_082FF598,
gUnknown_082FF5B8,
gUnknown_082FF5C8,
gUnknown_082FF5F0,
gUnknown_082FF600,
gUnknown_082FF5D8,
[BATTLER_AFFINE_NORMAL] = sAffineAnim_Battler_Normal,
[BATTLER_AFFINE_EMERGE] = sAffineAnim_Battler_Emerge,
[BATTLER_AFFINE_RETURN] = sAffineAnim_Battler_Return,
sAffineAnim_Battler_HorizontalSquishLoop,
sAffineAnim_Battler_Grow,
sAffineAnim_Battler_Shrink,
sAffineAnim_Battler_GrowLarge,
sAffineAnim_Battler_TipRight,
sAffineAnim_Battler_BigToSmall,
};
static const union AffineAnimCmd gUnknown_082FF63C[] =
static const union AffineAnimCmd sAffineAnim_Battler_SpinShrink[] =
{
AFFINEANIMCMD_FRAME(0xfffc, 0xfffc, 0x04, 0x3f),
AFFINEANIMCMD_FRAME(-0x4, -0x4, 4, 63),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF64C[] =
static const union AffineAnimCmd sAffineAnim_Battler_TipLeft[] =
{
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x03, 0x05),
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfd, 0x05),
AFFINEANIMCMD_FRAME(0x0, 0x0, 3, 5),
AFFINEANIMCMD_FRAME(0x0, 0x0, -3, 5),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF664[] =
static const union AffineAnimCmd sAffineAnim_Battler_RotateUpAndBack[] =
{
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfb, 0x14),
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x00, 0x14),
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x05, 0x14),
AFFINEANIMCMD_FRAME(0x0, 0x0, -5, 20),
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 20),
AFFINEANIMCMD_FRAME(0x0, 0x0, 5, 20),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_082FF684[] =
static const union AffineAnimCmd sAffineAnim_Battler_Spin[] =
{
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x09, 0x6e),
AFFINEANIMCMD_FRAME(0x0, 0x0, 9, 110),
AFFINEANIMCMD_END,
};
const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[] =
{
gUnknown_082FF548,
gUnknown_082FF568,
gUnknown_082FF580,
gUnknown_082FF598,
gUnknown_082FF5B8,
gUnknown_082FF5C8,
gUnknown_082FF63C,
gUnknown_082FF64C,
gUnknown_082FF664,
gUnknown_082FF5D8,
gUnknown_082FF684,
[BATTLER_AFFINE_NORMAL] = sAffineAnim_Battler_Normal,
[BATTLER_AFFINE_EMERGE] = sAffineAnim_Battler_Emerge,
[BATTLER_AFFINE_RETURN] = sAffineAnim_Battler_Return,
sAffineAnim_Battler_HorizontalSquishLoop,
sAffineAnim_Battler_Grow,
sAffineAnim_Battler_Shrink,
sAffineAnim_Battler_SpinShrink,
sAffineAnim_Battler_TipLeft,
sAffineAnim_Battler_RotateUpAndBack,
sAffineAnim_Battler_BigToSmall,
sAffineAnim_Battler_Spin,
};
const union AffineAnimCmd *const gUnknown_082FF6C0[] =
const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[] =
{
gUnknown_082FF558,
gUnknown_082FF568,
gUnknown_082FF580,
gUnknown_082FF598,
gUnknown_082FF5B8,
gUnknown_082FF5C8,
gUnknown_082FF63C,
gUnknown_082FF64C,
gUnknown_082FF664,
gUnknown_082FF5D8,
gUnknown_082FF684,
[BATTLER_AFFINE_NORMAL] = sAffineAnim_Battler_Flipped,
[BATTLER_AFFINE_EMERGE] = sAffineAnim_Battler_Emerge,
[BATTLER_AFFINE_RETURN] = sAffineAnim_Battler_Return,
sAffineAnim_Battler_HorizontalSquishLoop,
sAffineAnim_Battler_Grow,
sAffineAnim_Battler_Shrink,
sAffineAnim_Battler_SpinShrink,
sAffineAnim_Battler_TipLeft,
sAffineAnim_Battler_RotateUpAndBack,
sAffineAnim_Battler_BigToSmall,
sAffineAnim_Battler_Spin,
};
static const union AnimCmd gUnknown_082FF6EC[] =
static const union AnimCmd sAnim_MonPic_0[] =
{
ANIMCMD_FRAME(0, 0),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_082FF6F4[] =
static const union AnimCmd sAnim_MonPic_1[] =
{
ANIMCMD_FRAME(1, 0),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_082FF6FC[] =
static const union AnimCmd sAnim_MonPic_2[] =
{
ANIMCMD_FRAME(2, 0),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_082FF704[] =
static const union AnimCmd sAnim_MonPic_3[] =
{
ANIMCMD_FRAME(3, 0),
ANIMCMD_END,
};
const union AnimCmd *const gUnknown_082FF70C[] =
const union AnimCmd *const gAnims_MonPic[] =
{
gUnknown_082FF6EC,
gUnknown_082FF6F4,
gUnknown_082FF6FC,
gUnknown_082FF704,
sAnim_MonPic_0,
sAnim_MonPic_1,
sAnim_MonPic_2,
sAnim_MonPic_3,
};
#define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, MON_PIC_SIZE, SPECIES_##species}
@ -313,120 +319,7 @@ const union AnimCmd *const gUnknown_082FF70C[] =
#include "data/pokemon_graphics/enemy_mon_elevation.h"
#include "data/pokemon_graphics/front_pic_anims.h"
#include "data/pokemon_graphics/front_pic_table.h"
static const u32 sUnused[] =
{
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000088, 0x00000888, 0x00000888, 0x00000886,
0x00000888, 0x00000886, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000886, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000886, 0x00000886,
0x00000888, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000888, 0x00000886, 0x00000888,
0x00000888, 0x00000888, 0x00000886, 0x00000886,
0x00000888, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000886, 0x00000886, 0x00000088,
0x00000886, 0x00000886, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000886, 0x00000888, 0x00000088, 0x00000088,
0x00000888, 0x00000888, 0x00000888, 0x00000886,
0x00000888, 0x00000888, 0x00000888, 0x00000886,
0x00000886, 0x00000886, 0x00000886, 0x00000886,
0x00000886, 0x00000886, 0x00000888, 0x00000888,
0x00000886, 0x00000886, 0x00000886, 0x00000886,
0x00000886, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000886, 0x00000886, 0x00000888,
0x00000886, 0x00000886, 0x00000888, 0x00000888,
0x00000088, 0x00000088, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000886, 0x00000886, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000088, 0x00000886,
0x00000888, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000888, 0x00000886, 0x00000888,
0x00000088, 0x00000088, 0x00000886, 0x00000886,
0x00000088, 0x00000088, 0x00000888, 0x00000886,
0x00000886, 0x00000888, 0x00000888, 0x00000088,
0x00000888, 0x00000886, 0x00000886, 0x00000888,
0x00000886, 0x00000888, 0x00000888, 0x00000886,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000088, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000088, 0x00000888, 0x00000888, 0x00000886,
0x00000886, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000886,
0x00000888, 0x00000886, 0x00000088, 0x00000088,
0x00000088, 0x00000888, 0x00000088, 0x00000888,
0x00000888, 0x00000088, 0x00000088, 0x00000888,
0x00000886, 0x00000888, 0x00000886, 0x00000886,
0x00000886, 0x00000888, 0x00000888, 0x00000888,
0x00000088, 0x00000888, 0x00000888, 0x00000888,
0x00000088, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000088, 0x00000088,
0x00000886, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000088, 0x00000888,
0x00000886, 0x00000888, 0x00000088, 0x00000088,
0x00000888, 0x00000888, 0x00000088, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000088,
0x00000888, 0x00000888, 0x00000088, 0x00000088,
0x00000088, 0x00000888, 0x00000088, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000886, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000886, 0x00000886, 0x00000886,
0x00000088, 0x00000088, 0x00000088, 0x00000886,
0x00000088, 0x00000886, 0x00000886, 0x00000886,
0x00000088, 0x00000886, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000886,
0x00000886, 0x00000886, 0x00000888, 0x00000888,
0x00000886, 0x00000886, 0x00000886, 0x00000886,
0x00000088, 0x00000088, 0x00000886, 0x00000886,
0x00001882, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000886, 0x00000886, 0x00000886,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000886, 0x00000088, 0x00000886, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000886, 0x00000886,
0x00000088, 0x00000088, 0x00000088, 0x00000886,
0x00000886, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000886, 0x00000088,
0x00000088, 0x00000886, 0x00000886, 0x00000886,
0x00000886, 0x00000886, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000886,
0x00000886, 0x00000886, 0x00000886, 0x00000088,
0x00000886, 0x00000088, 0x00000886, 0x00000886,
0x00000886, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000886, 0x00000886,
0x00000886, 0x00000888, 0x00000886, 0x00000886,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000886, 0x00000886, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000088, 0x00000088, 0x00000088,
0x00000088, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
0x00000888, 0x00000888, 0x00000888, 0x00000888,
};
#include "data/pokemon_graphics/unknown_table.h"
#include "data/trainer_parties.h"
#include "data/text/trainer_class_names.h"

View File

@ -138,7 +138,7 @@
const struct ContestWinner gDefaultContestWinners[] =
{
{
[CONTEST_WINNER_HALL_1 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_ELECTRIKE,
@ -147,7 +147,7 @@ const struct ContestWinner gDefaultContestWinners[] =
.trainerName = _("EZRA"),
.contestRank = CONTEST_RANK_NORMAL
},
{
[CONTEST_WINNER_HALL_2 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_TROPIUS,
@ -156,7 +156,7 @@ const struct ContestWinner gDefaultContestWinners[] =
.trainerName = _("ALLAN"),
.contestRank = CONTEST_RANK_HYPER
},
{
[CONTEST_WINNER_HALL_3 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_XATU,
@ -165,7 +165,7 @@ const struct ContestWinner gDefaultContestWinners[] =
.trainerName = _("JULIET"),
.contestRank = CONTEST_RANK_NORMAL
},
{
[CONTEST_WINNER_HALL_4 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_PLUSLE,
@ -174,7 +174,7 @@ const struct ContestWinner gDefaultContestWinners[] =
.trainerName = _("BAILY"),
.contestRank = CONTEST_RANK_MASTER
},
{
[CONTEST_WINNER_HALL_5 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_SHUPPET,
@ -183,7 +183,7 @@ const struct ContestWinner gDefaultContestWinners[] =
.trainerName = _("MELANY"),
.contestRank = CONTEST_RANK_SUPER
},
{
[CONTEST_WINNER_HALL_6 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_ZANGOOSE,
@ -192,7 +192,7 @@ const struct ContestWinner gDefaultContestWinners[] =
.trainerName = _("HANA"),
.contestRank = CONTEST_RANK_HYPER
},
{
[CONTEST_WINNER_HALL_UNUSED_1 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_LOUDRED,
@ -201,7 +201,7 @@ const struct ContestWinner gDefaultContestWinners[] =
.trainerName = _("BRYANT"),
.contestRank = CONTEST_RANK_HYPER
},
{
[CONTEST_WINNER_HALL_UNUSED_2 - 1] = {
.personality = 0,
.trainerId = 0xFFFF,
.species = SPECIES_DELCATTY,

View File

@ -0,0 +1,444 @@
// Unknown and unused
static const u32 sUnused[] =
{
[SPECIES_NONE] = 0x888,
[SPECIES_BULBASAUR] = 0x888,
[SPECIES_IVYSAUR] = 0x888,
[SPECIES_VENUSAUR] = 0x888,
[SPECIES_CHARMANDER] = 0x88,
[SPECIES_CHARMELEON] = 0x888,
[SPECIES_CHARIZARD] = 0x888,
[SPECIES_SQUIRTLE] = 0x886,
[SPECIES_WARTORTLE] = 0x888,
[SPECIES_BLASTOISE] = 0x886,
[SPECIES_CATERPIE] = 0x888,
[SPECIES_METAPOD] = 0x888,
[SPECIES_BUTTERFREE] = 0x888,
[SPECIES_WEEDLE] = 0x888,
[SPECIES_KAKUNA] = 0x888,
[SPECIES_BEEDRILL] = 0x888,
[SPECIES_PIDGEY] = 0x886,
[SPECIES_PIDGEOTTO] = 0x888,
[SPECIES_PIDGEOT] = 0x888,
[SPECIES_RATTATA] = 0x888,
[SPECIES_RATICATE] = 0x888,
[SPECIES_SPEAROW] = 0x888,
[SPECIES_FEAROW] = 0x886,
[SPECIES_EKANS] = 0x886,
[SPECIES_ARBOK] = 0x888,
[SPECIES_PIKACHU] = 0x88,
[SPECIES_RAICHU] = 0x88,
[SPECIES_SANDSHREW] = 0x88,
[SPECIES_SANDSLASH] = 0x88,
[SPECIES_NIDORAN_F] = 0x888,
[SPECIES_NIDORINA] = 0x886,
[SPECIES_NIDOQUEEN] = 0x888,
[SPECIES_NIDORAN_M] = 0x888,
[SPECIES_NIDORINO] = 0x888,
[SPECIES_NIDOKING] = 0x886,
[SPECIES_CLEFAIRY] = 0x886,
[SPECIES_CLEFABLE] = 0x888,
[SPECIES_VULPIX] = 0x88,
[SPECIES_NINETALES] = 0x88,
[SPECIES_JIGGLYPUFF] = 0x88,
[SPECIES_WIGGLYTUFF] = 0x88,
[SPECIES_ZUBAT] = 0x886,
[SPECIES_GOLBAT] = 0x886,
[SPECIES_ODDISH] = 0x88,
[SPECIES_GLOOM] = 0x886,
[SPECIES_VILEPLUME] = 0x886,
[SPECIES_PARAS] = 0x888,
[SPECIES_PARASECT] = 0x888,
[SPECIES_VENONAT] = 0x888,
[SPECIES_VENOMOTH] = 0x888,
[SPECIES_DIGLETT] = 0x888,
[SPECIES_DUGTRIO] = 0x888,
[SPECIES_MEOWTH] = 0x886,
[SPECIES_PERSIAN] = 0x888,
[SPECIES_PSYDUCK] = 0x88,
[SPECIES_GOLDUCK] = 0x88,
[SPECIES_MANKEY] = 0x888,
[SPECIES_PRIMEAPE] = 0x888,
[SPECIES_GROWLITHE] = 0x888,
[SPECIES_ARCANINE] = 0x886,
[SPECIES_POLIWAG] = 0x888,
[SPECIES_POLIWHIRL] = 0x888,
[SPECIES_POLIWRATH] = 0x888,
[SPECIES_ABRA] = 0x886,
[SPECIES_KADABRA] = 0x886,
[SPECIES_ALAKAZAM] = 0x886,
[SPECIES_MACHOP] = 0x886,
[SPECIES_MACHOKE] = 0x886,
[SPECIES_MACHAMP] = 0x886,
[SPECIES_BELLSPROUT] = 0x886,
[SPECIES_WEEPINBELL] = 0x888,
[SPECIES_VICTREEBEL] = 0x888,
[SPECIES_TENTACOOL] = 0x886,
[SPECIES_TENTACRUEL] = 0x886,
[SPECIES_GEODUDE] = 0x886,
[SPECIES_GRAVELER] = 0x886,
[SPECIES_GOLEM] = 0x886,
[SPECIES_PONYTA] = 0x888,
[SPECIES_RAPIDASH] = 0x888,
[SPECIES_SLOWPOKE] = 0x888,
[SPECIES_SLOWBRO] = 0x888,
[SPECIES_MAGNEMITE] = 0x886,
[SPECIES_MAGNETON] = 0x886,
[SPECIES_FARFETCHD] = 0x888,
[SPECIES_DODUO] = 0x886,
[SPECIES_DODRIO] = 0x886,
[SPECIES_SEEL] = 0x888,
[SPECIES_DEWGONG] = 0x888,
[SPECIES_GRIMER] = 0x88,
[SPECIES_MUK] = 0x88,
[SPECIES_SHELLDER] = 0x888,
[SPECIES_CLOYSTER] = 0x888,
[SPECIES_GASTLY] = 0x888,
[SPECIES_HAUNTER] = 0x888,
[SPECIES_GENGAR] = 0x888,
[SPECIES_ONIX] = 0x888,
[SPECIES_DROWZEE] = 0x888,
[SPECIES_HYPNO] = 0x888,
[SPECIES_KRABBY] = 0x888,
[SPECIES_KINGLER] = 0x888,
[SPECIES_VOLTORB] = 0x886,
[SPECIES_ELECTRODE] = 0x886,
[SPECIES_EXEGGCUTE] = 0x888,
[SPECIES_EXEGGUTOR] = 0x888,
[SPECIES_CUBONE] = 0x888,
[SPECIES_MAROWAK] = 0x888,
[SPECIES_HITMONLEE] = 0x88,
[SPECIES_HITMONCHAN] = 0x886,
[SPECIES_LICKITUNG] = 0x888,
[SPECIES_KOFFING] = 0x88,
[SPECIES_WEEZING] = 0x88,
[SPECIES_RHYHORN] = 0x88,
[SPECIES_RHYDON] = 0x88,
[SPECIES_CHANSEY] = 0x888,
[SPECIES_TANGELA] = 0x886,
[SPECIES_KANGASKHAN] = 0x888,
[SPECIES_HORSEA] = 0x88,
[SPECIES_SEADRA] = 0x88,
[SPECIES_GOLDEEN] = 0x886,
[SPECIES_SEAKING] = 0x886,
[SPECIES_STARYU] = 0x88,
[SPECIES_STARMIE] = 0x88,
[SPECIES_MR_MIME] = 0x888,
[SPECIES_SCYTHER] = 0x886,
[SPECIES_JYNX] = 0x886,
[SPECIES_ELECTABUZZ] = 0x888,
[SPECIES_MAGMAR] = 0x888,
[SPECIES_PINSIR] = 0x88,
[SPECIES_TAUROS] = 0x888,
[SPECIES_MAGIKARP] = 0x886,
[SPECIES_GYARADOS] = 0x886,
[SPECIES_LAPRAS] = 0x888,
[SPECIES_DITTO] = 0x886,
[SPECIES_EEVEE] = 0x888,
[SPECIES_VAPOREON] = 0x888,
[SPECIES_JOLTEON] = 0x886,
[SPECIES_FLAREON] = 0x888,
[SPECIES_PORYGON] = 0x888,
[SPECIES_OMANYTE] = 0x888,
[SPECIES_OMASTAR] = 0x888,
[SPECIES_KABUTO] = 0x888,
[SPECIES_KABUTOPS] = 0x888,
[SPECIES_AERODACTYL] = 0x888,
[SPECIES_SNORLAX] = 0x888,
[SPECIES_ARTICUNO] = 0x888,
[SPECIES_ZAPDOS] = 0x888,
[SPECIES_MOLTRES] = 0x888,
[SPECIES_DRATINI] = 0x888,
[SPECIES_DRAGONAIR] = 0x888,
[SPECIES_DRAGONITE] = 0x888,
[SPECIES_MEWTWO] = 0x88,
[SPECIES_MEW] = 0x888,
[SPECIES_CHIKORITA] = 0x888,
[SPECIES_BAYLEEF] = 0x888,
[SPECIES_MEGANIUM] = 0x888,
[SPECIES_CYNDAQUIL] = 0x888,
[SPECIES_QUILAVA] = 0x88,
[SPECIES_TYPHLOSION] = 0x888,
[SPECIES_TOTODILE] = 0x888,
[SPECIES_CROCONAW] = 0x886,
[SPECIES_FERALIGATR] = 0x886,
[SPECIES_SENTRET] = 0x888,
[SPECIES_FURRET] = 0x888,
[SPECIES_HOOTHOOT] = 0x888,
[SPECIES_NOCTOWL] = 0x888,
[SPECIES_LEDYBA] = 0x888,
[SPECIES_LEDIAN] = 0x888,
[SPECIES_SPINARAK] = 0x886,
[SPECIES_ARIADOS] = 0x888,
[SPECIES_CROBAT] = 0x886,
[SPECIES_CHINCHOU] = 0x88,
[SPECIES_LANTURN] = 0x88,
[SPECIES_PICHU] = 0x88,
[SPECIES_CLEFFA] = 0x888,
[SPECIES_IGGLYBUFF] = 0x88,
[SPECIES_TOGEPI] = 0x888,
[SPECIES_TOGETIC] = 0x888,
[SPECIES_NATU] = 0x88,
[SPECIES_XATU] = 0x88,
[SPECIES_MAREEP] = 0x888,
[SPECIES_FLAAFFY] = 0x886,
[SPECIES_AMPHAROS] = 0x888,
[SPECIES_BELLOSSOM] = 0x886,
[SPECIES_MARILL] = 0x886,
[SPECIES_AZUMARILL] = 0x886,
[SPECIES_SUDOWOODO] = 0x888,
[SPECIES_POLITOED] = 0x888,
[SPECIES_HOPPIP] = 0x888,
[SPECIES_SKIPLOOM] = 0x88,
[SPECIES_JUMPLUFF] = 0x888,
[SPECIES_AIPOM] = 0x888,
[SPECIES_SUNKERN] = 0x888,
[SPECIES_SUNFLORA] = 0x88,
[SPECIES_YANMA] = 0x888,
[SPECIES_WOOPER] = 0x888,
[SPECIES_QUAGSIRE] = 0x888,
[SPECIES_ESPEON] = 0x888,
[SPECIES_UMBREON] = 0x888,
[SPECIES_MURKROW] = 0x888,
[SPECIES_SLOWKING] = 0x888,
[SPECIES_MISDREAVUS] = 0x888,
[SPECIES_UNOWN] = 0x888,
[SPECIES_WOBBUFFET] = 0x88,
[SPECIES_GIRAFARIG] = 0x88,
[SPECIES_PINECO] = 0x886,
[SPECIES_FORRETRESS] = 0x888,
[SPECIES_DUNSPARCE] = 0x888,
[SPECIES_GLIGAR] = 0x888,
[SPECIES_STEELIX] = 0x888,
[SPECIES_SNUBBULL] = 0x888,
[SPECIES_GRANBULL] = 0x888,
[SPECIES_QWILFISH] = 0x888,
[SPECIES_SCIZOR] = 0x888,
[SPECIES_SHUCKLE] = 0x888,
[SPECIES_HERACROSS] = 0x88,
[SPECIES_SNEASEL] = 0x888,
[SPECIES_TEDDIURSA] = 0x886,
[SPECIES_URSARING] = 0x888,
[SPECIES_SLUGMA] = 0x88,
[SPECIES_MAGCARGO] = 0x88,
[SPECIES_SWINUB] = 0x888,
[SPECIES_PILOSWINE] = 0x888,
[SPECIES_CORSOLA] = 0x88,
[SPECIES_REMORAID] = 0x888,
[SPECIES_OCTILLERY] = 0x888,
[SPECIES_DELIBIRD] = 0x888,
[SPECIES_MANTINE] = 0x888,
[SPECIES_SKARMORY] = 0x88,
[SPECIES_HOUNDOUR] = 0x888,
[SPECIES_HOUNDOOM] = 0x888,
[SPECIES_KINGDRA] = 0x88,
[SPECIES_PHANPY] = 0x88,
[SPECIES_DONPHAN] = 0x88,
[SPECIES_PORYGON2] = 0x888,
[SPECIES_STANTLER] = 0x88,
[SPECIES_SMEARGLE] = 0x888,
[SPECIES_TYROGUE] = 0x888,
[SPECIES_HITMONTOP] = 0x888,
[SPECIES_SMOOCHUM] = 0x888,
[SPECIES_ELEKID] = 0x888,
[SPECIES_MAGBY] = 0x888,
[SPECIES_MILTANK] = 0x888,
[SPECIES_BLISSEY] = 0x888,
[SPECIES_RAIKOU] = 0x888,
[SPECIES_ENTEI] = 0x888,
[SPECIES_SUICUNE] = 0x888,
[SPECIES_LARVITAR] = 0x888,
[SPECIES_PUPITAR] = 0x888,
[SPECIES_TYRANITAR] = 0x888,
[SPECIES_LUGIA] = 0x886,
[SPECIES_HO_OH] = 0x888,
[SPECIES_CELEBI] = 0x888,
[SPECIES_OLD_UNOWN_B] = 0x888,
[SPECIES_OLD_UNOWN_C] = 0x888,
[SPECIES_OLD_UNOWN_D] = 0x888,
[SPECIES_OLD_UNOWN_E] = 0x888,
[SPECIES_OLD_UNOWN_F] = 0x888,
[SPECIES_OLD_UNOWN_G] = 0x888,
[SPECIES_OLD_UNOWN_H] = 0x888,
[SPECIES_OLD_UNOWN_I] = 0x888,
[SPECIES_OLD_UNOWN_J] = 0x888,
[SPECIES_OLD_UNOWN_K] = 0x888,
[SPECIES_OLD_UNOWN_L] = 0x888,
[SPECIES_OLD_UNOWN_M] = 0x888,
[SPECIES_OLD_UNOWN_N] = 0x888,
[SPECIES_OLD_UNOWN_O] = 0x888,
[SPECIES_OLD_UNOWN_P] = 0x888,
[SPECIES_OLD_UNOWN_Q] = 0x888,
[SPECIES_OLD_UNOWN_R] = 0x888,
[SPECIES_OLD_UNOWN_S] = 0x888,
[SPECIES_OLD_UNOWN_T] = 0x888,
[SPECIES_OLD_UNOWN_U] = 0x888,
[SPECIES_OLD_UNOWN_V] = 0x888,
[SPECIES_OLD_UNOWN_W] = 0x888,
[SPECIES_OLD_UNOWN_X] = 0x888,
[SPECIES_OLD_UNOWN_Y] = 0x888,
[SPECIES_OLD_UNOWN_Z] = 0x888,
[SPECIES_TREECKO] = 0x886,
[SPECIES_GROVYLE] = 0x886,
[SPECIES_SCEPTILE] = 0x886,
[SPECIES_TORCHIC] = 0x88,
[SPECIES_COMBUSKEN] = 0x88,
[SPECIES_BLAZIKEN] = 0x88,
[SPECIES_MUDKIP] = 0x886,
[SPECIES_MARSHTOMP] = 0x88,
[SPECIES_SWAMPERT] = 0x886,
[SPECIES_POOCHYENA] = 0x886,
[SPECIES_MIGHTYENA] = 0x886,
[SPECIES_ZIGZAGOON] = 0x88,
[SPECIES_LINOONE] = 0x886,
[SPECIES_WURMPLE] = 0x88,
[SPECIES_SILCOON] = 0x88,
[SPECIES_BEAUTIFLY] = 0x88,
[SPECIES_CASCOON] = 0x88,
[SPECIES_DUSTOX] = 0x88,
[SPECIES_LOTAD] = 0x886,
[SPECIES_LOMBRE] = 0x886,
[SPECIES_LUDICOLO] = 0x886,
[SPECIES_SEEDOT] = 0x888,
[SPECIES_NUZLEAF] = 0x888,
[SPECIES_SHIFTRY] = 0x886,
[SPECIES_NINCADA] = 0x886,
[SPECIES_NINJASK] = 0x886,
[SPECIES_SHEDINJA] = 0x886,
[SPECIES_TAILLOW] = 0x88,
[SPECIES_SWELLOW] = 0x88,
[SPECIES_SHROOMISH] = 0x886,
[SPECIES_BRELOOM] = 0x886,
[SPECIES_SPINDA] = 0x1882,
[SPECIES_WINGULL] = 0x88,
[SPECIES_PELIPPER] = 0x88,
[SPECIES_SURSKIT] = 0x88,
[SPECIES_MASQUERAIN] = 0x88,
[SPECIES_WAILMER] = 0x886,
[SPECIES_WAILORD] = 0x886,
[SPECIES_SKITTY] = 0x886,
[SPECIES_DELCATTY] = 0x88,
[SPECIES_KECLEON] = 0x88,
[SPECIES_BALTOY] = 0x88,
[SPECIES_CLAYDOL] = 0x88,
[SPECIES_NOSEPASS] = 0x886,
[SPECIES_TORKOAL] = 0x88,
[SPECIES_SABLEYE] = 0x886,
[SPECIES_BARBOACH] = 0x88,
[SPECIES_WHISCASH] = 0x88,
[SPECIES_LUVDISC] = 0x88,
[SPECIES_CORPHISH] = 0x88,
[SPECIES_CRAWDAUNT] = 0x88,
[SPECIES_FEEBAS] = 0x88,
[SPECIES_MILOTIC] = 0x88,
[SPECIES_CARVANHA] = 0x886,
[SPECIES_SHARPEDO] = 0x886,
[SPECIES_TRAPINCH] = 0x88,
[SPECIES_VIBRAVA] = 0x88,
[SPECIES_FLYGON] = 0x88,
[SPECIES_MAKUHITA] = 0x886,
[SPECIES_HARIYAMA] = 0x886,
[SPECIES_ELECTRIKE] = 0x88,
[SPECIES_MANECTRIC] = 0x88,
[SPECIES_NUMEL] = 0x88,
[SPECIES_CAMERUPT] = 0x88,
[SPECIES_SPHEAL] = 0x88,
[SPECIES_SEALEO] = 0x88,
[SPECIES_WALREIN] = 0x88,
[SPECIES_CACNEA] = 0x88,
[SPECIES_CACTURNE] = 0x88,
[SPECIES_SNORUNT] = 0x88,
[SPECIES_GLALIE] = 0x88,
[SPECIES_LUNATONE] = 0x88,
[SPECIES_SOLROCK] = 0x88,
[SPECIES_AZURILL] = 0x886,
[SPECIES_SPOINK] = 0x88,
[SPECIES_GRUMPIG] = 0x88,
[SPECIES_PLUSLE] = 0x886,
[SPECIES_MINUN] = 0x886,
[SPECIES_MAWILE] = 0x886,
[SPECIES_MEDITITE] = 0x886,
[SPECIES_MEDICHAM] = 0x886,
[SPECIES_SWABLU] = 0x88,
[SPECIES_ALTARIA] = 0x88,
[SPECIES_WYNAUT] = 0x88,
[SPECIES_DUSKULL] = 0x88,
[SPECIES_DUSCLOPS] = 0x88,
[SPECIES_ROSELIA] = 0x886,
[SPECIES_SLAKOTH] = 0x886,
[SPECIES_VIGOROTH] = 0x886,
[SPECIES_SLAKING] = 0x886,
[SPECIES_GULPIN] = 0x88,
[SPECIES_SWALOT] = 0x886,
[SPECIES_TROPIUS] = 0x88,
[SPECIES_WHISMUR] = 0x886,
[SPECIES_LOUDRED] = 0x886,
[SPECIES_EXPLOUD] = 0x886,
[SPECIES_CLAMPERL] = 0x88,
[SPECIES_HUNTAIL] = 0x88,
[SPECIES_GOREBYSS] = 0x88,
[SPECIES_ABSOL] = 0x88,
[SPECIES_SHUPPET] = 0x88,
[SPECIES_BANETTE] = 0x88,
[SPECIES_SEVIPER] = 0x88,
[SPECIES_ZANGOOSE] = 0x88,
[SPECIES_RELICANTH] = 0x88,
[SPECIES_ARON] = 0x886,
[SPECIES_LAIRON] = 0x886,
[SPECIES_AGGRON] = 0x886,
[SPECIES_CASTFORM] = 0x888,
[SPECIES_VOLBEAT] = 0x886,
[SPECIES_ILLUMISE] = 0x886,
[SPECIES_LILEEP] = 0x88,
[SPECIES_CRADILY] = 0x88,
[SPECIES_ANORITH] = 0x88,
[SPECIES_ARMALDO] = 0x88,
[SPECIES_RALTS] = 0x886,
[SPECIES_KIRLIA] = 0x886,
[SPECIES_GARDEVOIR] = 0x88,
[SPECIES_BAGON] = 0x88,
[SPECIES_SHELGON] = 0x88,
[SPECIES_SALAMENCE] = 0x88,
[SPECIES_BELDUM] = 0x88,
[SPECIES_METANG] = 0x88,
[SPECIES_METAGROSS] = 0x88,
[SPECIES_REGIROCK] = 0x88,
[SPECIES_REGICE] = 0x88,
[SPECIES_REGISTEEL] = 0x88,
[SPECIES_KYOGRE] = 0x88,
[SPECIES_GROUDON] = 0x88,
[SPECIES_RAYQUAZA] = 0x88,
[SPECIES_LATIAS] = 0x88,
[SPECIES_LATIOS] = 0x88,
[SPECIES_JIRACHI] = 0x88,
[SPECIES_DEOXYS] = 0x88,
[SPECIES_CHIMECHO] = 0x88,
[SPECIES_EGG] = 0x88,
[SPECIES_UNOWN_B] = 0x888,
[SPECIES_UNOWN_C] = 0x888,
[SPECIES_UNOWN_D] = 0x888,
[SPECIES_UNOWN_E] = 0x888,
[SPECIES_UNOWN_F] = 0x888,
[SPECIES_UNOWN_G] = 0x888,
[SPECIES_UNOWN_H] = 0x888,
[SPECIES_UNOWN_I] = 0x888,
[SPECIES_UNOWN_J] = 0x888,
[SPECIES_UNOWN_K] = 0x888,
[SPECIES_UNOWN_L] = 0x888,
[SPECIES_UNOWN_M] = 0x888,
[SPECIES_UNOWN_N] = 0x888,
[SPECIES_UNOWN_O] = 0x888,
[SPECIES_UNOWN_P] = 0x888,
[SPECIES_UNOWN_Q] = 0x888,
[SPECIES_UNOWN_R] = 0x888,
[SPECIES_UNOWN_S] = 0x888,
[SPECIES_UNOWN_T] = 0x888,
[SPECIES_UNOWN_U] = 0x888,
[SPECIES_UNOWN_V] = 0x888,
[SPECIES_UNOWN_W] = 0x888,
[SPECIES_UNOWN_X] = 0x888,
[SPECIES_UNOWN_Y] = 0x888,
[SPECIES_UNOWN_Z] = 0x888,
[SPECIES_UNOWN_EMARK] = 0x888,
[SPECIES_UNOWN_QMARK] = 0x888,
};

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
static const u32 sUnusedStructSizes[] =
{
@ -25,7 +39,7 @@ static const u8 sText_Slash[] = _("/");
static const u8 sText_Lv[] = _("Lv. ");
static const u8 sText_ThreeDashes[] = _("---");
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_Cancel[] = _("CANCEL");
static const u8 sText_ChooseAPkmn[] = _("Choose a POKéMON.");
@ -48,107 +62,113 @@ static const struct OamData sTradeOamData_32x16 =
.priority = 1
};
static const struct OamData sTradeOamData_64x32 =
static const struct OamData sOamData_Cursor =
{
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
.priority = 1
};
static const union AnimCmd gSpriteAnim_832DC24[] =
static const union AnimCmd sAnim_Cursor_Normal[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_832DC2C[] =
static const union AnimCmd sAnim_Cursor_OnCancel[] =
{
ANIMCMD_FRAME(32, 5),
ANIMCMD_END
};
static const union AnimCmd *const gSpriteAnimTable_832DC34[] =
{
gSpriteAnim_832DC24,
gSpriteAnim_832DC2C
enum {
CURSOR_ANIM_NORMAL,
CURSOR_ANIM_ON_CANCEL,
};
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,
.tag = 300
.tag = GFXTAG_CURSOR
};
static const struct SpritePalette gUnknown_0832DC44 =
static const struct SpritePalette sCursor_SpritePalette =
{
.data = gUnknown_08DDB444,
.tag = 2345
.data = gTradeCursor_Pal,
.tag = PALTAG_CURSOR
};
static const union AnimCmd gSpriteAnim_832DC4C[] =
static const union AnimCmd sAnim_MenuText_0[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_832DC54[] =
static const union AnimCmd sAnim_MenuText_1[] =
{
ANIMCMD_FRAME(8, 5),
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_832DC5C[] =
static const union AnimCmd sAnim_MenuText_2[] =
{
ANIMCMD_FRAME(16, 5),
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_832DC64[] =
static const union AnimCmd sAnim_MenuText_3[] =
{
ANIMCMD_FRAME(24, 5),
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_832DC6C[] =
static const union AnimCmd sAnim_MenuText_4[] =
{
ANIMCMD_FRAME(32, 5),
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_832DC74[] =
static const union AnimCmd sAnim_MenuText_5[] =
{
ANIMCMD_FRAME(40, 5),
ANIMCMD_END
};
static const union AnimCmd *const gSpriteAnimTable_832DC7C[] =
// These anims are not used
static const union AnimCmd *const sAnims_MenuText[] =
{
gSpriteAnim_832DC4C,
gSpriteAnim_832DC54,
gSpriteAnim_832DC5C,
gSpriteAnim_832DC64,
gSpriteAnim_832DC6C,
gSpriteAnim_832DC74
sAnim_MenuText_0,
sAnim_MenuText_1,
sAnim_MenuText_2,
sAnim_MenuText_3,
sAnim_MenuText_4,
sAnim_MenuText_5
};
static const struct SpriteTemplate gSpriteTemplate_832DC94 =
static const struct SpriteTemplate sSpriteTemplate_Cursor =
{
.tileTag = 300,
.paletteTag = 2345,
.oam = &sTradeOamData_64x32,
.anims = gSpriteAnimTable_832DC34,
.tileTag = GFXTAG_CURSOR,
.paletteTag = PALTAG_CURSOR,
.oam = &sOamData_Cursor,
.anims = sAnims_Cursor,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
};
static const struct SpriteTemplate gSpriteTemplate_832DCAC =
static const struct SpriteTemplate sSpriteTemplate_MenuText =
{
.tileTag = 200,
.paletteTag = 4925,
.tileTag = GFXTAG_MENU_TEXT,
.paletteTag = PALTAG_MENU_TEXT,
.oam = &sTradeOamData_32x16,
.anims = gSpriteAnimTable_832DC7C,
.anims = sAnims_MenuText,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
@ -158,7 +178,7 @@ static const u16 TradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbap
static const struct SpritePalette gSpritePalette_TradeScreenText =
{
.data = TradeScreenTextPalette,
.tag = 4925
.tag = PALTAG_MENU_TEXT
};
// 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,
0x0f, 0x1d,
0x03, 0x05,
0x03, 0x07,
0x12, 0x05,
0x12, 0x07,
0x08, 0x07,
0x16, 0x0c,
0x08, 0x07,
0x16, 0x0c,
0x06, 0x07,
0x18, 0x0c,
0x06, 0x07,
0x18, 0x0c,
0x08, 0x07,
0x16, 0x0c,
0x07, 0x07,
0x17, 0x0c
{ 0, 14},
{15, 29},
{ 3, 5},
{ 3, 7},
{18, 5},
{18, 7},
{ 8, 7},
{22, 12},
{ 8, 7},
{22, 12},
{ 6, 7},
{24, 12},
{ 6, 7},
{24, 12},
{ 8, 7},
{22, 12},
{ 7, 7},
{23, 12}
};
static const u8 *const sTradeActionTexts[] =
@ -620,42 +640,42 @@ static const u8 sTradeMenuPartyMonBoxDimensions[3][2] =
[TRADE_PARTNER] = {19, 3}
};
static const u16 sTradePal_PokeBall[] = INCBIN_U16("graphics/trade/pokeball.gbapal");
static const u8 sTradeGfx_PokeBall[] = INCBIN_U8("graphics/trade/pokeball.4bpp");
static const u8 sTradeGfx_PokeBallSymbol[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp"); // unused?
static const u16 sTradeTilemap_Cable[] = INCBIN_U16("graphics/trade/cable_closeup_map.bin");
static const u16 sPokeball_Pal[] = INCBIN_U16("graphics/trade/pokeball.gbapal");
static const u8 sPokeball_Gfx[] = INCBIN_U8("graphics/trade/pokeball.4bpp");
static const u8 sPokeballSymbol_Gfx[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp"); // unused
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 sUnref_083308C0[] = INCBIN_U16("graphics/trade/unknown_3308C0.gbapal");
static const u16 sTradePal_Gba[] = INCBIN_U16("graphics/trade/gba.gbapal");
static const u16 sTradePal_ShadowUnused[] = INCBIN_U16("graphics/trade/shadow.gbapal");
static const u16 sTradePal_BlackUnused[] = INCBIN_U16("graphics/trade/black.gbapal");
static const u16 sTradePal_Misc[] = INCBIN_U16("graphics/trade/misc.gbapal");
static const u8 sTradeGfx_Glow1[] = INCBIN_U8("graphics/trade/glow1.4bpp");
static const u8 sTradeGfx_Glow2[] = INCBIN_U8("graphics/trade/glow2.4bpp");
static const u8 sTradeGfx_CableEnd[] = INCBIN_U8("graphics/trade/cable_end.4bpp");
static const u8 sTradeGfx_GbaScreen[] = INCBIN_U8("graphics/trade/gba_screen.4bpp");
const u16 gUnknown_08331F60[] = INCBIN_U16("graphics/trade/shadow_map.bin");
static const u8 sTradeAffine_Gba[] = INCBIN_U8("graphics/trade/gba_affine.8bpp");
static const u8 sFiller_08335760[64] = {};
static const u8 sTradeAffineMap_GbaCable[] = 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 u16 sTradeTilemap_GbaWireless[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin");
static const u16 sTradeTilemap_GbaCable[] = 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 u16 sTradePal_WirelessSignalSend[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal");
static const u16 sTradePal_WirelessSignalReceive[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal");
static const u16 sTradePal_Black[] = INCBIN_U16("graphics/trade/black.gbapal");
static const u32 sTradeGfx_WirelessSignal[] = INCBIN_U32("graphics/trade/wireless_signal.4bpp.lz");
static const u32 sTradeTilemap_WirelessSignal[] = INCBIN_U32("graphics/trade/wireless_signal.bin.lz");
static const u16 sUnusedPal1[] = INCBIN_U16("graphics/trade/unused1.gbapal");
static const u16 sGba_Pal[] = INCBIN_U16("graphics/trade/gba.gbapal");
static const u16 sUnusedPal2[] = INCBIN_U16("graphics/trade/unused2.gbapal");
static const u16 sWirelessSignalNone_Pal_Unused[] = INCBIN_U16("graphics/trade/wireless_signal_none.gbapal");
static const u16 sLinkMon_Pal[] = INCBIN_U16("graphics/trade/link_mon.gbapal");
static const u8 sLinkMonGlow_Gfx[] = INCBIN_U8("graphics/trade/link_mon_glow.4bpp");
static const u8 sLinkMonShadow_Gfx[] = INCBIN_U8("graphics/trade/link_mon_shadow.4bpp");
static const u8 sCableEnd_Gfx[] = INCBIN_U8("graphics/trade/cable_end.4bpp");
static const u8 sGbaScreen_Gfx[] = INCBIN_U8("graphics/trade/gba_screen.4bpp");
const u16 gTradePlatform_Tilemap[] = INCBIN_U16("graphics/trade/platform.bin");
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 sEmptyGfx[64] = {};
static const u8 sGbaCable_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_cable.bin");
static const u8 sGbaWireless_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_wireless.bin");
static const u16 sGbaWireless_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin");
static const u16 sGbaCable_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_cable.bin");
static const u32 sCrossingHighlightWireless_Tilemap[] = INCBIN_U32("graphics/trade/crossing_highlight_wireless.bin.lz");
static const u16 sWirelessSignalSend_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal");
static const u16 sWirelessSignalRecv_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal");
static const u16 sWirelessSignalNone_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_none.gbapal");
static const u32 sWirelessSignal_Gfx[] = INCBIN_U32("graphics/trade/wireless_signal.4bpp.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,
.shape = SPRITE_SHAPE(16x16),
.size = SPRITE_SIZE(16x16)
};
static const union AnimCmd gSpriteAnim_8338C4C[] =
static const union AnimCmd sAnim_Pokeball_SpinOnce[] =
{
ANIMCMD_FRAME( 0, 3),
ANIMCMD_FRAME( 4, 3),
@ -674,7 +694,7 @@ static const union AnimCmd gSpriteAnim_8338C4C[] =
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_8338C88[] =
static const union AnimCmd sAnim_Pokeball_SpinTwice[] =
{
ANIMCMD_FRAME( 0, 3),
ANIMCMD_FRAME( 4, 3),
@ -693,25 +713,25 @@ static const union AnimCmd gSpriteAnim_8338C88[] =
ANIMCMD_END
};
static const union AnimCmd *const gSpriteAnimTable_8338C88[] =
static const union AnimCmd *const sAnims_Pokeball[] =
{
gSpriteAnim_8338C4C,
gSpriteAnim_8338C88
sAnim_Pokeball_SpinOnce,
sAnim_Pokeball_SpinTwice
};
static const union AffineAnimCmd gSpriteAffineAnim_8338CCC[] =
static const union AffineAnimCmd sAffineAnim_Pokeball_Normal[] =
{
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_END
};
static const union AffineAnimCmd gSpriteAffineAnim_8338CDC[] =
static const union AffineAnimCmd sAffineAnim_Pokeball_Squish[] =
{
AFFINEANIMCMD_FRAME(-8, 0, 0, 20),
AFFINEANIMCMD_END
};
static const union AffineAnimCmd gSpriteAffineAnim_8338CEC[] =
static const union AffineAnimCmd sAffineAnim_Pokeball_Unsquish[] =
{
AFFINEANIMCMD_FRAME(0x60, 0x100, 0, 0),
AFFINEANIMCMD_FRAME( 0, 0, 0, 5),
@ -719,38 +739,38 @@ static const union AffineAnimCmd gSpriteAffineAnim_8338CEC[] =
AFFINEANIMCMD_END
};
static const union AffineAnimCmd *const gSpriteAffineAnimTable_8338D0C[] =
static const union AffineAnimCmd *const sAffineAnims_Pokeball[] =
{
gSpriteAffineAnim_8338CCC,
gSpriteAffineAnim_8338CDC,
gSpriteAffineAnim_8338CEC
sAffineAnim_Pokeball_Normal,
sAffineAnim_Pokeball_Squish,
sAffineAnim_Pokeball_Unsquish
};
static const struct SpriteSheet sPokeBallSpriteSheet =
{
.data = sTradeGfx_PokeBall,
.data = sPokeball_Gfx,
.size = 0x600,
.tag = 5557
.tag = GFXTAG_POKEBALL
};
static const struct SpritePalette sPokeBallSpritePalette =
{
.data = sTradePal_PokeBall,
.tag = 5558
.data = sPokeball_Pal,
.tag = PALTAG_POKEBALL
};
static const struct SpriteTemplate gSpriteTemplate_8338D28 =
static const struct SpriteTemplate sSpriteTemplate_Pokeball =
{
.tileTag = 5557,
.paletteTag = 5558,
.oam = &sTradeOamData_16x16,
.anims = gSpriteAnimTable_8338C88,
.tileTag = GFXTAG_POKEBALL,
.paletteTag = PALTAG_POKEBALL,
.oam = &sOamData_Pokeball,
.anims = sAnims_Pokeball,
.images = NULL,
.affineAnims = gSpriteAffineAnimTable_8338D0C,
.callback = sub_807E55C
.affineAnims = sAffineAnims_Pokeball,
.callback = SpriteCB_BouncingPokeball
};
static const struct OamData sTradeOamData_32x32 =
static const struct OamData sOamData_LinkMonGlow =
{
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
@ -759,146 +779,151 @@ static const struct OamData sTradeOamData_32x32 =
.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
};
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_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,
.tag = 5550
.tag = GFXTAG_LINK_MON_GLOW
};
static const struct SpritePalette sMiscTradeSpritePalette =
static const struct SpritePalette sSpritePalette_LinkMon =
{
.data = sTradePal_Misc,
.tag = 5551
.data = sLinkMon_Pal,
.tag = PALTAG_LINK_MON
};
static const struct SpritePalette sGbaSpritePalette =
static const struct SpritePalette sSpritePalette_Gba =
{
.data = sTradePal_Gba,
.tag = 5555
.data = sGba_Pal,
.tag = PALTAG_GBA
};
static const struct SpriteTemplate gUnknown_08338D88 =
static const struct SpriteTemplate sSpriteTemplate_LinkMonGlow =
{
.tileTag = 5550,
.paletteTag = 5551,
.oam = &sTradeOamData_32x32,
.anims = gSpriteAnimTable_8338D50,
.tileTag = GFXTAG_LINK_MON_GLOW,
.paletteTag = PALTAG_LINK_MON,
.oam = &sOamData_LinkMonGlow,
.anims = sAnims_LinkMonGlow,
.images = NULL,
.affineAnims = gSpriteAffineAnimTable_8338D6C,
.callback = sub_807AA28
.affineAnims = sAffineAnims_LinkMonGlow,
.callback = SpriteCB_LinkMonGlow
};
static const struct OamData sTradeOamData_16x32 =
static const struct OamData sOamData_LinkMonShadow =
{
.shape = SPRITE_SHAPE(16x32),
.size = SPRITE_SIZE(16x32),
.priority = 1
};
static const union AnimCmd gSpriteAnim_8338DA8[] =
static const union AnimCmd sAnim_LinkMonShadow_Big[] =
{
ANIMCMD_FRAME(0, 5, .vFlip = TRUE, .hFlip = TRUE),
ANIMCMD_END
};
static const union AnimCmd gSpriteAnim_8338DB0[] =
static const union AnimCmd sAnim_LinkMonShadow_Small[] =
{
ANIMCMD_FRAME(8, 5, .vFlip = TRUE, .hFlip = TRUE),
ANIMCMD_END
};
static const union AnimCmd *const gSpriteAnimTable_8338DB8[] =
{
gSpriteAnim_8338DA8,
gSpriteAnim_8338DB0
enum {
ANIM_LINKMON_BIG,
ANIM_LINKMON_SMALL,
};
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,
.tag = 5552
.tag = GFXTAG_LINK_MON_SHADOW
};
static const struct SpriteTemplate sGlowBallSpriteTemplate =
static const struct SpriteTemplate sSpriteTemplate_LinkMonShadow =
{
.tileTag = 5552,
.paletteTag = 5551,
.oam = &sTradeOamData_16x32,
.anims = gSpriteAnimTable_8338DB8,
.tileTag = GFXTAG_LINK_MON_SHADOW,
.paletteTag = PALTAG_LINK_MON,
.oam = &sOamData_LinkMonShadow,
.anims = sAnims_LinkMonShadow,
.images = NULL,
.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),
.size = SPRITE_SIZE(16x32),
.priority = 1
};
static const union AnimCmd gSpriteAnim_8338DE8[] =
static const union AnimCmd sAnim_CableEnd[] =
{
ANIMCMD_FRAME(0, 10),
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,
.tag = 5554
.tag = GFXTAG_CABLE_END
};
static const struct SpriteTemplate gSpriteTemplate_8338DFC =
static const struct SpriteTemplate sSpriteTemplate_CableEnd =
{
.tileTag = 5554,
.paletteTag = 5555,
.oam = &sTradeOamData_16x32_2,
.anims = gSpriteAnimTable_8338DF0,
.tileTag = GFXTAG_CABLE_END,
.paletteTag = PALTAG_GBA,
.oam = &sOamData_CableEnd,
.anims = sAnims_CableEnd,
.images = NULL,
.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),
.size = SPRITE_SIZE(64x32),
.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(32, 2, .vFlip = TRUE, .hFlip = TRUE),
@ -911,7 +936,7 @@ static const union AnimCmd gSpriteAnim_8338E1C[] =
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(32, 2, .vFlip = TRUE, .hFlip = TRUE),
@ -924,56 +949,56 @@ static const union AnimCmd gSpriteAnim_8338E40[] =
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,
.tag = 5556
.tag = GFXTAG_GBA_SCREEN
};
static const struct SpriteTemplate gSpriteTemplate_8338E74 =
static const struct SpriteTemplate sSpriteTemplate_GbaScreenFlash_Long =
{
.tileTag = 5556,
.paletteTag = 5555,
.oam = &sTradeOamData_64x32_2,
.anims = gSpriteAnimTable_8338E64,
.tileTag = GFXTAG_GBA_SCREEN,
.paletteTag = PALTAG_GBA,
.oam = &sOamData_GbaScreen,
.anims = sAnims_GbaScreen_Long,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_807AB04
.callback = SpriteCB_GbaScreen
};
static const struct SpriteTemplate gSpriteTemplate_8338E8C =
static const struct SpriteTemplate sSpriteTemplate_GbaScreenFlash_Short =
{
.tileTag = 5556,
.paletteTag = 5555,
.oam = &sTradeOamData_64x32_2,
.anims = gSpriteAnimTable_8338E68,
.tileTag = GFXTAG_GBA_SCREEN,
.paletteTag = PALTAG_GBA,
.oam = &sOamData_GbaScreen,
.anims = sAnims_GbaScreen_Short,
.images = NULL,
.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_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[] =
@ -1146,69 +1171,54 @@ static const struct BgTemplate sTradeSequenceBgTemplates[] =
static const s8 sTradeBallVerticalVelocityTable[] =
{
0, 0, 1, 0,
1, 0, 1, 1,
1, 1, 2, 2,
2, 2, 3, 3,
3, 3, 4, 4,
4, 4, -4, -4,
-4, -3, -3, -3,
-3, -2, -2, -2,
-2, -1, -1, -1,
-1, 0, -1, 0,
-1, 0, 0, 0,
0, 0, 1, 0,
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
0, 0, 1, 0, 1, 0, 1, 1, 1,
1, 2, 2, 2, 2, 3, 3, 3, 3,
4, 4, 4, 4, -4, -4, -4, -3, -3,
-3, -3, -2, -2, -2, -2, -1, -1, -1,
-1, 0, -1, 0, -1, 0, 0, 0, 0,
0, 1, 0, 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] =
{
{0, 1},
{1, 1},
{2, 1},
{3, 1},
{4, 1},
{5, 2},
{6, 2},
{7, 2},
{8, 2},
{9, 2},
{10, 3},
{11, 3},
{12, 3},
{13, 4},
{14, 5},
{15, 2},
{0, 1},
{1, 1},
{2, 1},
{3, 1},
{4, 1},
{5, 2},
{6, 2},
{7, 2},
{8, 2},
{9, 2},
{10, 3},
{11, 3},
{12, 3},
{13, 4},
{14, 5},
{16, 1},
{16, 255},
{0, 0}
{ 0, 1},
{ 1, 1},
{ 2, 1},
{ 3, 1},
{ 4, 1},
{ 5, 2},
{ 6, 2},
{ 7, 2},
{ 8, 2},
{ 9, 2},
{10, 3},
{11, 3},
{12, 3},
{13, 4},
{14, 5},
{15, 2},
{ 0, 1},
{ 1, 1},
{ 2, 1},
{ 3, 1},
{ 4, 1},
{ 5, 2},
{ 6, 2},
{ 7, 2},
{ 8, 2},
{ 9, 2},
{10, 3},
{11, 3},
{12, 3},
{13, 4},
{14, 5},
{16, 1},
{16, -1},
{}
};

View File

@ -25,7 +25,7 @@
#include "constants/region_map_sections.h"
// this file's functions
static void ClearDaycareMonMail(struct DayCareMail *mail);
static void ClearDaycareMonMail(struct DaycareMail *mail);
static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare);
static u8 GetDaycareCompatibilityScore(struct DayCare *daycare);
static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y);
@ -122,7 +122,7 @@ u8 CountPokemonInDaycare(struct DayCare *daycare)
return count;
}
void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail)
void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *daycareMail)
{
u8 i;
u8 numDaycareMons = 0;
@ -133,13 +133,9 @@ void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDay
{
numDaycareMons++;
if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_HELD_ITEM) == ITEM_NONE)
{
daycareMail->holdsItem[i] = FALSE;
}
else
{
daycareMail->holdsItem[i] = TRUE;
}
}
else
{
@ -156,7 +152,7 @@ static s8 Daycare_FindEmptySpot(struct DayCare *daycare)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES) == 0)
if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES) == SPECIES_NONE)
return i;
}
@ -351,7 +347,7 @@ u8 GetNumLevelsGainedFromDaycare(void)
return 0;
}
static void ClearDaycareMonMail(struct DayCareMail *mail)
static void ClearDaycareMonMail(struct DaycareMail *mail)
{
s32 i;

View File

@ -1652,7 +1652,7 @@ static void PlaceDecoration(u8 taskId)
gSprites[sDecor_CameraSpriteObjectIdx1].pos1.y += 2;
if (gMapHeader.regionMapSectionId == MAPSEC_SECRET_BASE)
TV_PutSecretBaseVisitOnTheAir();
TryPutSecretBaseVisitOnAir();
CancelDecorating_(taskId);
}
@ -2260,7 +2260,7 @@ static void Task_PutAwayDecoration(u8 taskId)
StringExpandPlaceholders(gStringVar4, gText_DecorationReturnedToPC);
DisplayItemMessageOnField(taskId, gStringVar4, ContinuePuttingAwayDecorationsPrompt);
if (gMapHeader.regionMapSectionId == MAPSEC_SECRET_BASE)
TV_PutSecretBaseVisitOnTheAir();
TryPutSecretBaseVisitOnAir();
}
break;
}

View File

@ -1474,8 +1474,8 @@ void ShowEasyChatScreen(void)
words = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words[gSpecialVar_0x8006];
displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE;
break;
case EASY_CHAT_TYPE_UNK_8:
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].unkShow04.words;
case EASY_CHAT_TYPE_DUMMY_SHOW:
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].dummy.words;
displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE;
break;
case EASY_CHAT_TYPE_TRENDY_PHRASE:

View File

@ -54,7 +54,7 @@ struct EggHatchData
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_NicknameHatchPrompt[];
@ -546,7 +546,7 @@ static void CB2_EggHatch_0(void)
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
LoadPalette(gTradeGba2_Pal, 0x10, 0xA0);
LoadBgTiles(1, gTradeGba_Gfx, 0x1420, 0);
CopyToBgTilemapBuffer(1, gUnknown_08331F60, 0x1000, 0);
CopyToBgTilemapBuffer(1, gTradePlatform_Tilemap, 0x1000, 0);
CopyBgTilemapBufferToVram(1);
gMain.state++;
break;
@ -811,7 +811,7 @@ static void SpriteCB_Egg_5(struct Sprite* sprite)
if (sprite->data[0] == 0)
{
gSprites[sEggHatchData->pokeSpriteID].invisible = FALSE;
StartSpriteAffineAnim(&gSprites[sEggHatchData->pokeSpriteID], 1);
StartSpriteAffineAnim(&gSprites[sEggHatchData->pokeSpriteID], BATTLER_AFFINE_EMERGE);
}
if (sprite->data[0] == 8)
BeginNormalPaletteFade(PALETTES_ALL, -1, 0x10, 0, RGB_WHITEALPHA);

View File

@ -14,34 +14,64 @@
#include "constants/trainers.h"
#include "constants/moves.h"
#include "constants/items.h"
#include "constants/trainer_hill.h"
struct Unknown030012C8
{
u8 unk0[8];
u32 *unk8;
int unkC;
int unk10;
int unk14;
enum {
EREADER_XFR_STATE_INIT = 0,
EREADER_XFR_STATE_HANDSHAKE,
EREADER_XFR_STATE_START,
EREADER_XFR_STATE_TRANSFER,
EREADER_XFR_STATE_TRANSFER_DONE,
EREADER_XFR_STATE_CHECKSUM,
EREADER_XFR_STATE_DONE
};
static void sub_81D4170(void);
static u16 sub_81D3EE8(u8);
static void sub_81D413C(void);
static void sub_81D414C(void);
static void sub_81D3F1C(u32, u32*, u32*);
static void sub_81D3F68(void);
#define EREADER_XFER_EXE 1
#define EREADER_XFER_CHK 2
#define EREADER_XFER_SHIFT 0
#define EREADER_XFER_MASK 3
static struct Unknown030012C8 gUnknown_030012C8;
static u16 gUnknown_030012E0;
static u16 gUnknown_030012E2;
static u16 gUnknown_030012E4;
static u16 gUnknown_030012E6;
static u32 gUnknown_030012E8;
static u16 gUnknown_030012EC;
static u16 gUnknown_030012EE;
static u16 gUnknown_030012F0;
static u16 gUnknown_030012F2;
static u16 gUnknown_030012F4;
#define EREADER_CANCEL_TIMEOUT 1
#define EREADER_CANCEL_KEY 2
#define EREADER_CANCEL_MASK 0xC
#define EREADER_CANCEL_SHIFT 2
#define EREADER_CHECKSUM_OK 1
#define EREADER_CHECKSUM_ERR 2
#define EREADER_CHECKSUM_MASK 0x30
#define EREADER_CHECKSUM_SHIFT 4
struct SendRecvMgr
{
bool8 isParent;
u8 state; // EREADER_XFR_STATE_*
u8 xferState; // EREADER_XFER_*
u8 checksumResult; // EREADER_CHECKSUM_*
u8 cancellationReason; // EREADER_CANCEL_*
u32 *data; // Payload source or destination
int cursor; // Index of the next word
int size; // Last word index
int checksum;
};
static void GetKeyInput(void);
static u16 DetermineSendRecvState(u8);
static void EnableSio(void);
static void DisableTm3(void);
static void SetUpTransferManager(size_t, const void *, void *);
static void StartTm3(void);
static struct SendRecvMgr sSendRecvMgr;
static u16 sJoyNewOrRepeated;
static u16 sJoyNew;
static u16 sSendRecvStatus;
static u16 sCounter1;
static u32 sCounter2;
static u16 sSavedIme;
static u16 sSavedIe;
static u16 sSavedTm3Cnt;
static u16 sSavedSioCnt;
static u16 sSavedRCnt;
static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = {
[0] = {
@ -390,217 +420,217 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = {
},
};
static u8 sub_81D38D4(void)
static u8 GetTrainerHillUnkVal(void)
{
return (gSaveBlock1Ptr->trainerHill.unused + 1) % 256;
}
static bool32 Struct_EReaderTrainerHillTrainer_ValidateChecksum(struct EReaderTrainerHillTrainer *arg0)
static bool32 ValidateTrainerChecksum(struct EReaderTrainerHillTrainer * hillTrainer)
{
int checksum = CalcByteArraySum((u8 *)arg0, 0x270);
if (checksum != arg0->checksum)
int checksum = CalcByteArraySum((u8 *)hillTrainer, offsetof(typeof(*hillTrainer), checksum));
if (checksum != hillTrainer->checksum)
return FALSE;
return TRUE;
}
bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer)
bool8 ValidateTrainerHillData(struct EReaderTrainerHillSet * hillSet)
{
u32 i;
u32 checksum;
int var0 = buffer->count;
if (var0 < 1 || var0 > 8)
int numTrainers = hillSet->numTrainers;
// Validate number of trainers
if (numTrainers < 1 || numTrainers > NUM_TRAINER_HILL_TRAINERS)
return FALSE;
for (i = 0; i < var0; i++)
// Validate trainers
for (i = 0; i < numTrainers; i++)
{
if (!Struct_EReaderTrainerHillTrainer_ValidateChecksum(&buffer->unk_8[i]))
if (!ValidateTrainerChecksum(&hillSet->trainers[i]))
return FALSE;
}
checksum = CalcByteArraySum((u8 *)buffer->unk_8, var0 * sizeof(struct EReaderTrainerHillTrainer));
if (checksum != buffer->checksum)
// Validate checksum
checksum = CalcByteArraySum((u8 *)hillSet->trainers, numTrainers * sizeof(struct EReaderTrainerHillTrainer));
if (checksum != hillSet->checksum)
return FALSE;
return TRUE;
}
static bool32 TrainerHill_VerifyChecksum(struct EReaderTrainerHillSet *buffer)
static bool32 ValidateTrainerHillChecksum(struct EReaderTrainerHillSet *hillSet)
{
u32 checksum;
int var0 = buffer->count;
if (var0 < 1 || var0 > 8)
int numTrainers = hillSet->numTrainers;
if (numTrainers < 1 || numTrainers > NUM_TRAINER_HILL_TRAINERS)
return FALSE;
checksum = CalcByteArraySum((u8 *)buffer->unk_8, sizeof(struct EReaderTrainerHillSet) - offsetof(struct EReaderTrainerHillSet, unk_8));
if (checksum != buffer->checksum)
checksum = CalcByteArraySum((u8 *)hillSet->trainers, sizeof(struct EReaderTrainerHillSet) - offsetof(struct EReaderTrainerHillSet, trainers));
if (checksum != hillSet->checksum)
return FALSE;
return TRUE;
}
static bool32 TryWriteTrainerHill_r(struct EReaderTrainerHillSet *ttdata, struct TrHillTag *buffer2)
static bool32 TryWriteTrainerHill_Internal(struct EReaderTrainerHillSet * hillSet, struct TrHillTag * hillTag)
{
int i;
AGB_ASSERT_EX(ttdata->dummy == 0, "cereader_tool.c", 450);
AGB_ASSERT_EX(ttdata->id == 0, "cereader_tool.c", 452);
AGB_ASSERT_EX(hillSet->dummy == 0, "cereader_tool.c", 450);
AGB_ASSERT_EX(hillSet->id == 0, "cereader_tool.c", 452);
memset(buffer2, 0, 0x1000);
buffer2->numTrainers = ttdata->count;
buffer2->unused1 = sub_81D38D4();
buffer2->numFloors = (ttdata->count + 1) / 2;
memset(hillTag, 0, SECTOR_SIZE);
hillTag->numTrainers = hillSet->numTrainers;
hillTag->unused1 = GetTrainerHillUnkVal();
hillTag->numFloors = (hillSet->numTrainers + 1) / TRAINER_HILL_TRAINERS_PER_FLOOR;
for (i = 0; i < ttdata->count; i++)
for (i = 0; i < hillSet->numTrainers; i++)
{
if (!(i & 1))
{
buffer2->floors[i / 2].trainerNum1 = ttdata->unk_8[i].unk0;
buffer2->floors[i / 2].display = ttdata->unk_8[i].unk14C;
buffer2->floors[i / 2].trainers[0] = ttdata->unk_8[i].unk4;
hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum1 = hillSet->trainers[i].trainerNum;
hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].display = hillSet->trainers[i].display;
hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[0] = hillSet->trainers[i].trainer;
}
else
{
buffer2->floors[i / 2].trainerNum2 = ttdata->unk_8[i].unk0;
buffer2->floors[i / 2].trainers[1] = ttdata->unk_8[i].unk4;
hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum2 = hillSet->trainers[i].trainerNum;
hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = hillSet->trainers[i].trainer;
}
}
if (i & 1)
{
buffer2->floors[i / 2].trainers[1] = sTrainerHillTrainerTemplates_JP[i / 2];
hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = sTrainerHillTrainerTemplates_JP[i / TRAINER_HILL_TRAINERS_PER_FLOOR];
}
buffer2->checksum = CalcByteArraySum((u8 *)buffer2->floors, 4 * sizeof(struct TrHillFloor));
if (TryWriteSpecialSaveSection(SECTOR_ID_TRAINER_HILL, (u8 *)buffer2) != SAVE_STATUS_OK)
hillTag->checksum = CalcByteArraySum((u8 *)hillTag->floors, NUM_TRAINER_HILL_FLOORS * sizeof(struct TrHillFloor));
if (TryWriteSpecialSaveSection(SECTOR_ID_TRAINER_HILL, (u8 *)hillTag) != SAVE_STATUS_OK)
return FALSE;
return TRUE;
}
bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0)
bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet * hillSet)
{
void *var0 = AllocZeroed(0x1000);
bool32 result = TryWriteTrainerHill_r(arg0, var0);
Free(var0);
void *buffer = AllocZeroed(SECTOR_SIZE);
bool32 result = TryWriteTrainerHill_Internal(hillSet, buffer);
Free(buffer);
return result;
}
static bool32 TryReadTrainerHill_r(struct EReaderTrainerHillSet *dst, u8 *buffer)
static bool32 TryReadTrainerHill_Internal(struct EReaderTrainerHillSet * dest, u8 * buffer)
{
if (TryReadSpecialSaveSection(SECTOR_ID_TRAINER_HILL, buffer) != SAVE_STATUS_OK)
return FALSE;
memcpy(dst, buffer, sizeof(struct EReaderTrainerHillSet));
if (!TrainerHill_VerifyChecksum(dst))
memcpy(dest, buffer, sizeof(struct EReaderTrainerHillSet));
if (!ValidateTrainerHillChecksum(dest))
return FALSE;
return TRUE;
}
static bool32 TryReadTrainerHill(struct EReaderTrainerHillSet *arg0)
static bool32 TryReadTrainerHill(struct EReaderTrainerHillSet * hillSet)
{
u8 *var0 = AllocZeroed(0x1000);
bool32 result = TryReadTrainerHill_r(arg0, var0);
Free(var0);
u8 *buffer = AllocZeroed(SECTOR_SIZE);
bool32 result = TryReadTrainerHill_Internal(hillSet, buffer);
Free(buffer);
return result;
}
bool32 ReadTrainerHillAndValidate(void)
{
struct EReaderTrainerHillSet *var0 = AllocZeroed(0x1000);
bool32 result = TryReadTrainerHill(var0);
Free(var0);
struct EReaderTrainerHillSet *hillSet = AllocZeroed(SECTOR_SIZE);
bool32 result = TryReadTrainerHill(hillSet);
Free(hillSet);
return result;
}
int EReader_Send(int arg0, u32 *arg1)
int EReader_Send(int size, const void * src)
{
int result;
u16 var0;
int var1;
int sendStatus;
EReaderHelper_SaveRegsState();
while (1)
{
sub_81D4170();
if (gUnknown_030012E2 & 2)
GetKeyInput();
if (sJoyNew & B_BUTTON)
gShouldAdvanceLinkState = 2;
var1 = EReaderHandleTransfer(1, arg0, arg1, NULL);
gUnknown_030012E4 = var1;
if ((gUnknown_030012E4 & 0x13) == 0x10)
sendStatus = EReaderHandleTransfer(1, size, src, NULL);
sSendRecvStatus = sendStatus;
if ((sSendRecvStatus & 0x13) == 0x10)
{
result = 0;
break;
}
if (gUnknown_030012E4 & 0x8)
else if (sSendRecvStatus & 0x8)
{
result = 1;
break;
}
var0 = gUnknown_030012E4 & 0x4;
if (var0)
else if (sSendRecvStatus & 0x4)
{
result = 2;
break;
}
gShouldAdvanceLinkState = var0;
VBlankIntrWait();
else
{
gShouldAdvanceLinkState = 0;
VBlankIntrWait();
}
}
CpuFill32(0, &gUnknown_030012C8, sizeof(struct Unknown030012C8));
CpuFill32(0, &sSendRecvMgr, sizeof(sSendRecvMgr));
EReaderHelper_RestoreRegsState();
return result;
}
int EReader_Recv(u32 *arg0)
int EReader_Recv(void * dest)
{
int result;
u16 var0;
int var1;
int recvStatus;
EReaderHelper_SaveRegsState();
while (1)
{
sub_81D4170();
if (gUnknown_030012E2 & 2)
GetKeyInput();
if (sJoyNew & B_BUTTON)
gShouldAdvanceLinkState = 2;
var1 = EReaderHandleTransfer(0, 0, NULL, arg0);
gUnknown_030012E4 = var1;
if ((gUnknown_030012E4 & 0x13) == 0x10)
recvStatus = EReaderHandleTransfer(0, 0, NULL, dest);
sSendRecvStatus = recvStatus;
if ((sSendRecvStatus & 0x13) == 0x10)
{
result = 0;
break;
}
if (gUnknown_030012E4 & 0x8)
else if (sSendRecvStatus & 0x8)
{
result = 1;
break;
}
var0 = gUnknown_030012E4 & 0x4;
if (var0)
else if (sSendRecvStatus & 0x4)
{
result = 2;
break;
}
gShouldAdvanceLinkState = var0;
VBlankIntrWait();
else
{
gShouldAdvanceLinkState = 0;
VBlankIntrWait();
}
}
CpuFill32(0, &gUnknown_030012C8, sizeof(struct Unknown030012C8));
CpuFill32(0, &sSendRecvMgr, sizeof(sSendRecvMgr));
EReaderHelper_RestoreRegsState();
return result;
}
static void sub_81D3C7C(void)
static void CloseSerial(void)
{
REG_IME = 0;
REG_IE &= ~(INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL);
@ -610,7 +640,7 @@ static void sub_81D3C7C(void)
REG_IF = INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL;
}
static void sub_81D3CBC(void)
static void OpenSerialMulti(void)
{
REG_IME = 0;
REG_IE &= ~(INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL);
@ -622,273 +652,271 @@ static void sub_81D3CBC(void)
REG_IE |= INTR_FLAG_SERIAL;
REG_IME = 1;
if (!gUnknown_030012C8.unk0[1])
CpuFill32(0, &gUnknown_030012C8, sizeof(struct Unknown030012C8));
if (sSendRecvMgr.state == 0)
CpuFill32(0, &sSendRecvMgr, sizeof(sSendRecvMgr));
}
static void sub_81D3D34(void)
static void OpenSerial32(void)
{
REG_RCNT = 0;
REG_SIOCNT = SIO_32BIT_MODE | SIO_INTR_ENABLE;
REG_SIOCNT |= SIO_MULTI_SD;
gShouldAdvanceLinkState = 0;
gUnknown_030012E6 = 0;
gUnknown_030012E8 = 0;
sCounter1 = 0;
sCounter2 = 0;
}
int EReaderHandleTransfer(u8 arg0, u32 arg1, u32 *arg2, u32 *arg3)
int EReaderHandleTransfer(u8 mode, size_t size, const void * data, void * recvBuffer)
{
switch (gUnknown_030012C8.unk0[1])
switch (sSendRecvMgr.state)
{
case 0:
sub_81D3CBC();
gUnknown_030012C8.unk0[2] = 1;
gUnknown_030012C8.unk0[1] = 1;
case EREADER_XFR_STATE_INIT:
OpenSerialMulti();
sSendRecvMgr.xferState = EREADER_XFER_EXE;
sSendRecvMgr.state = EREADER_XFR_STATE_HANDSHAKE;
break;
case 1:
if (sub_81D3EE8(arg0))
sub_81D413C();
case EREADER_XFR_STATE_HANDSHAKE:
if (DetermineSendRecvState(mode))
EnableSio();
if (gShouldAdvanceLinkState == 2)
{
gUnknown_030012C8.unk0[4] = 2;
gUnknown_030012C8.unk0[1] = 6;
sSendRecvMgr.cancellationReason = EREADER_CANCEL_KEY;
sSendRecvMgr.state = EREADER_XFR_STATE_DONE;
}
break;
case 2:
sub_81D3D34();
sub_81D3F1C(arg1, arg2, arg3);
gUnknown_030012C8.unk0[1] = 3;
case EREADER_XFR_STATE_START:
OpenSerial32();
SetUpTransferManager(size, data, recvBuffer);
sSendRecvMgr.state = EREADER_XFR_STATE_TRANSFER;
// fall through
case 3:
case EREADER_XFR_STATE_TRANSFER:
if (gShouldAdvanceLinkState == 2)
{
gUnknown_030012C8.unk0[4] = 2;
gUnknown_030012C8.unk0[1] = 6;
sSendRecvMgr.cancellationReason = EREADER_CANCEL_KEY;
sSendRecvMgr.state = EREADER_XFR_STATE_DONE;
}
else
{
gUnknown_030012E6++;
gUnknown_030012E8++;
if (!gUnknown_030012C8.unk0[0] && gUnknown_030012E8 > 60)
sCounter1++;
sCounter2++;
if (!sSendRecvMgr.isParent && sCounter2 > 60)
{
gUnknown_030012C8.unk0[4] = 1;
gUnknown_030012C8.unk0[1] = 6;
sSendRecvMgr.cancellationReason = EREADER_CANCEL_TIMEOUT;
sSendRecvMgr.state = EREADER_XFR_STATE_DONE;
}
if (gUnknown_030012C8.unk0[2] != 2)
if (sSendRecvMgr.xferState != EREADER_XFER_CHK)
{
if (gUnknown_030012C8.unk0[0] && gUnknown_030012E6 > 2)
if (sSendRecvMgr.isParent && sCounter1 > 2)
{
sub_81D413C();
gUnknown_030012C8.unk0[2] = 2;
EnableSio();
sSendRecvMgr.xferState = EREADER_XFER_CHK;
}
else
{
sub_81D413C();
gUnknown_030012C8.unk0[2] = 2;
EnableSio();
sSendRecvMgr.xferState = EREADER_XFER_CHK;
}
}
}
break;
case 4:
sub_81D3CBC();
gUnknown_030012C8.unk0[1] = 5;
case EREADER_XFR_STATE_TRANSFER_DONE:
OpenSerialMulti();
sSendRecvMgr.state = EREADER_XFR_STATE_CHECKSUM;
break;
case 5:
if (gUnknown_030012C8.unk0[0] == 1 && gUnknown_030012E6 > 2)
sub_81D413C();
case EREADER_XFR_STATE_CHECKSUM:
if (sSendRecvMgr.isParent == TRUE && sCounter1 > 2)
EnableSio();
if (++gUnknown_030012E6 > 60)
if (++sCounter1 > 60)
{
gUnknown_030012C8.unk0[4] = 1;
gUnknown_030012C8.unk0[1] = 6;
sSendRecvMgr.cancellationReason = EREADER_CANCEL_TIMEOUT;
sSendRecvMgr.state = EREADER_XFR_STATE_DONE;
}
break;
case 6:
if (gUnknown_030012C8.unk0[2])
case EREADER_XFR_STATE_DONE:
if (sSendRecvMgr.xferState)
{
sub_81D3C7C();
gUnknown_030012C8.unk0[2] = 0;
CloseSerial();
sSendRecvMgr.xferState = 0;
}
break;
}
return gUnknown_030012C8.unk0[2] | (gUnknown_030012C8.unk0[4] << 2) | (gUnknown_030012C8.unk0[3] << 4);
return (sSendRecvMgr.xferState << EREADER_XFER_SHIFT)
| (sSendRecvMgr.cancellationReason << EREADER_CANCEL_SHIFT)
| (sSendRecvMgr.checksumResult << EREADER_CHECKSUM_SHIFT);
}
static u16 sub_81D3EE8(u8 arg0)
static u16 DetermineSendRecvState(u8 mode)
{
u16 terminal = (*(vu32 *)REG_ADDR_SIOCNT) & (SIO_MULTI_SI | SIO_MULTI_SD);
if (terminal == SIO_MULTI_SD && arg0)
{
gUnknown_030012C8.unk0[0] = 1;
return 1;
}
bool16 resp;
if ((*(vu32 *)REG_ADDR_SIOCNT & (SIO_MULTI_SI | SIO_MULTI_SD)) == SIO_MULTI_SD && mode)
resp = sSendRecvMgr.isParent = TRUE;
else
{
gUnknown_030012C8.unk0[0] = 0;
return 0;
}
resp = sSendRecvMgr.isParent = FALSE;
return resp;
}
static void sub_81D3F1C(u32 arg0, u32 *arg1, u32 *arg2)
static void SetUpTransferManager(size_t size, const void * data, void * recvBuffer)
{
if (gUnknown_030012C8.unk0[0])
if (sSendRecvMgr.isParent)
{
REG_SIOCNT |= SIO_38400_BPS;
gUnknown_030012C8.unk8 = arg1;
REG_SIODATA32 = arg0;
gUnknown_030012C8.unk10 = arg0 / 4 + 1;
sub_81D3F68();
sSendRecvMgr.data = (void *)data;
REG_SIODATA32 = size;
sSendRecvMgr.size = size / 4 + 1;
StartTm3();
}
else
{
REG_SIOCNT = REG_SIOCNT;
gUnknown_030012C8.unk8 = arg2;
sSendRecvMgr.data = recvBuffer;
}
}
static void sub_81D3F68(void)
static void StartTm3(void)
{
REG_TM3CNT_L = 0xFDA7;
REG_TM3CNT_L = -601;
REG_TM3CNT_H = TIMER_INTR_ENABLE;
REG_IME = 0;
REG_IE |= INTR_FLAG_TIMER3;
REG_IME = 1;
}
void sub_81D3F9C(void)
void EReaderHelper_Timer3Callback(void)
{
sub_81D414C();
sub_81D413C();
DisableTm3();
EnableSio();
}
void sub_81D3FAC(void)
void EReaderHelper_SerialCallback(void)
{
u16 i, playerCount, k;
u32 value;
u16 var0;
u16 recvBuffer[4];
u16 i, cnt1, cnt2;
u32 recv32;
u16 recv[4];
switch (gUnknown_030012C8.unk0[1])
switch (sSendRecvMgr.state)
{
case 1:
case EREADER_XFR_STATE_HANDSHAKE:
REG_SIOMLT_SEND = 0xCCD0; // Handshake id
*(u64 *)recvBuffer = REG_SIOMLT_RECV;
for (i = 0, playerCount = 0, k = 0; i < 4; i++)
*(u64 *)recv = REG_SIOMLT_RECV;
for (i = 0, cnt1 = 0, cnt2 = 0; i < 4; i++)
{
if (recvBuffer[i] == 0xCCD0)
playerCount++;
else if (recvBuffer[i] != 0xFFFF)
k++;
if (recv[i] == 0xCCD0)
cnt1++;
else if (recv[i] != 0xFFFF)
cnt2++;
}
if (playerCount == 2 && k == 0)
gUnknown_030012C8.unk0[1] = 2;
if (cnt1 == 2 && cnt2 == 0)
sSendRecvMgr.state = 2;
break;
case 3:
value = REG_SIODATA32;
if (!gUnknown_030012C8.unkC && !gUnknown_030012C8.unk0[0])
gUnknown_030012C8.unk10 = value / 4 + 1;
case EREADER_XFR_STATE_TRANSFER:
recv32 = REG_SIODATA32;
// The first value sent by the EReader is the payload size
if (!sSendRecvMgr.cursor && !sSendRecvMgr.isParent)
sSendRecvMgr.size = recv32 / 4 + 1;
if (gUnknown_030012C8.unk0[0] == 1)
if (sSendRecvMgr.isParent == TRUE)
{
if (gUnknown_030012C8.unkC < gUnknown_030012C8.unk10)
// Send mode
if (sSendRecvMgr.cursor < sSendRecvMgr.size)
{
REG_SIODATA32 = gUnknown_030012C8.unk8[gUnknown_030012C8.unkC];
gUnknown_030012C8.unk14 += gUnknown_030012C8.unk8[gUnknown_030012C8.unkC];
REG_SIODATA32 = sSendRecvMgr.data[sSendRecvMgr.cursor];
sSendRecvMgr.checksum += sSendRecvMgr.data[sSendRecvMgr.cursor];
}
else
{
REG_SIODATA32 = gUnknown_030012C8.unk14;
REG_SIODATA32 = sSendRecvMgr.checksum;
}
}
else
{
if (gUnknown_030012C8.unkC > 0 && gUnknown_030012C8.unkC < gUnknown_030012C8.unk10 + 1)
// Receive mode
if (sSendRecvMgr.cursor > 0 && sSendRecvMgr.cursor < sSendRecvMgr.size + 1)
{
gUnknown_030012C8.unk8[gUnknown_030012C8.unkC - 1] = value;
gUnknown_030012C8.unk14 += value;
sSendRecvMgr.data[sSendRecvMgr.cursor - 1] = recv32;
sSendRecvMgr.checksum += recv32;
}
else if (gUnknown_030012C8.unkC)
else if (sSendRecvMgr.cursor)
{
if (gUnknown_030012C8.unk14 == value)
gUnknown_030012C8.unk0[3] = 1;
if (sSendRecvMgr.checksum == recv32)
sSendRecvMgr.checksumResult = EREADER_CHECKSUM_OK;
else
gUnknown_030012C8.unk0[3] = 2;
sSendRecvMgr.checksumResult = EREADER_CHECKSUM_ERR;
}
gUnknown_030012E8 = 0;
sCounter2 = 0;
}
if (++gUnknown_030012C8.unkC < gUnknown_030012C8.unk10 + 2)
if (++sSendRecvMgr.cursor < sSendRecvMgr.size + 2)
{
if (gUnknown_030012C8.unk0[0])
if (sSendRecvMgr.isParent)
REG_TM3CNT_H |= TIMER_ENABLE;
else
sub_81D413C();
EnableSio();
}
else
{
gUnknown_030012C8.unk0[1] = 4;
gUnknown_030012E6 = 0;
sSendRecvMgr.state = EREADER_XFR_STATE_TRANSFER_DONE;
sCounter1 = 0;
}
break;
case 5:
if (!gUnknown_030012C8.unk0[0])
REG_SIOMLT_SEND = gUnknown_030012C8.unk0[3];
case EREADER_XFR_STATE_CHECKSUM:
if (!sSendRecvMgr.isParent)
REG_SIOMLT_SEND = sSendRecvMgr.checksumResult;
*(u64 *)recvBuffer = REG_SIOMLT_RECV;
var0 = recvBuffer[1] - 1;
if (var0 < 2)
*(vu64 *)recv = REG_SIOMLT_RECV;
if (recv[1] == EREADER_CHECKSUM_OK || recv[1] == EREADER_CHECKSUM_ERR)
{
if (gUnknown_030012C8.unk0[0] == 1)
gUnknown_030012C8.unk0[3] = recvBuffer[1];
if (sSendRecvMgr.isParent == TRUE)
sSendRecvMgr.checksumResult = recv[1]; // EReader has (in)validated the payload
gUnknown_030012C8.unk0[1] = 6;
sSendRecvMgr.state = EREADER_XFR_STATE_DONE;
}
break;
}
}
static void sub_81D413C(void)
static void EnableSio(void)
{
REG_SIOCNT |= SIO_ENABLE;
}
static void sub_81D414C(void)
static void DisableTm3(void)
{
REG_TM3CNT_H &= ~TIMER_ENABLE;
REG_TM3CNT_L = 0xFDA7;
}
static void sub_81D4170(void)
static void GetKeyInput(void)
{
int keysMask = REG_KEYINPUT ^ KEYS_MASK;
gUnknown_030012E2 = keysMask & ~gUnknown_030012E0;
gUnknown_030012E0 = keysMask;
int rawKeys = REG_KEYINPUT ^ KEYS_MASK;
sJoyNew = rawKeys & ~sJoyNewOrRepeated;
sJoyNewOrRepeated = rawKeys;
}
void EReaderHelper_SaveRegsState(void)
{
gUnknown_030012EC = REG_IME;
gUnknown_030012EE = REG_IE;
gUnknown_030012F0 = REG_TM3CNT_H;
gUnknown_030012F2 = REG_SIOCNT;
gUnknown_030012F4 = REG_RCNT;
sSavedIme = REG_IME;
sSavedIe = REG_IE;
sSavedTm3Cnt = REG_TM3CNT_H;
sSavedSioCnt = REG_SIOCNT;
sSavedRCnt = REG_RCNT;
}
void EReaderHelper_RestoreRegsState(void)
{
REG_IME = gUnknown_030012EC;
REG_IE = gUnknown_030012EE;
REG_TM3CNT_H = gUnknown_030012F0;
REG_SIOCNT = gUnknown_030012F2;
REG_RCNT = gUnknown_030012F4;
REG_IME = sSavedIme;
REG_IE = sSavedIe;
REG_TM3CNT_H = sSavedTm3Cnt;
REG_SIOCNT = sSavedSioCnt;
REG_RCNT = sSavedRCnt;
}
void sub_81D4238(void)
void EReaderHelper_ClearSendRecvMgr(void)
{
CpuFill32(0, &gUnknown_030012C8, sizeof(struct Unknown030012C8));
CpuFill32(0, &sSendRecvMgr, sizeof(sSendRecvMgr));
}

View File

@ -47,10 +47,10 @@ static void sub_81D4D50(struct Unk03006370 *arg0, int arg1, u32 *arg2)
{
volatile u16 backupIME = REG_IME;
REG_IME = 0;
gIntrTable[1] = sub_81D3FAC;
gIntrTable[2] = sub_81D3F9C;
gIntrTable[1] = EReaderHelper_SerialCallback;
gIntrTable[2] = EReaderHelper_Timer3Callback;
EReaderHelper_SaveRegsState();
sub_81D4238();
EReaderHelper_ClearSendRecvMgr();
REG_IE |= INTR_FLAG_VCOUNT;
REG_IME = backupIME;
arg0->unk0 = 0;
@ -62,7 +62,7 @@ static void sub_81D4DB8(struct Unk03006370 *arg0)
{
volatile u16 backupIME = REG_IME;
REG_IME = 0;
sub_81D4238();
EReaderHelper_ClearSendRecvMgr();
EReaderHelper_RestoreRegsState();
RestoreSerialTimer3IntrHandlers();
REG_IME = backupIME;
@ -401,7 +401,7 @@ static void sub_81D5084(u8 taskId)
}
break;
case 15:
data->unkE = EReader_IsReceivedDataValid((struct EReaderTrainerHillSet *)gDecompressionBuffer);
data->unkE = ValidateTrainerHillData((struct EReaderTrainerHillSet *)gDecompressionBuffer);
SetCloseLinkCallbackAndType(data->unkE);
data->unk8 = 16;
break;

View File

@ -57,7 +57,6 @@
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/mevent.h"
#include "constants/tv.h"
#include "constants/script_menu.h"
#include "constants/slot_machine.h"
#include "constants/songs.h"
@ -1622,7 +1621,7 @@ void BufferLottoTicketNumber(void)
{
if (gSpecialVar_Result >= 10000)
{
TV_PrintIntToStringVar(0, gSpecialVar_Result);
ConvertIntToDecimalString(0, gSpecialVar_Result);
}
else if (gSpecialVar_Result >= 1000)
{

View File

@ -22,7 +22,6 @@
#include "constants/metatile_behaviors.h"
#include "constants/metatile_labels.h"
#include "constants/songs.h"
#include "constants/tv.h"
EWRAM_DATA struct MapPosition gPlayerFacingPosition = {0};

View File

@ -1552,16 +1552,16 @@ static void CheckPutFrontierTVShowOnAir(void)
switch (battleMode)
{
case FRONTIER_MODE_SINGLES:
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], 1);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_TOWER_SINGLES);
break;
case FRONTIER_MODE_DOUBLES:
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], 2);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_TOWER_DOUBLES);
break;
case FRONTIER_MODE_MULTIS:
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], 3);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_TOWER_MULTIS);
break;
case FRONTIER_MODE_LINK_MULTIS:
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], 4);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_TOWER_LINK_MULTIS);
break;
}
}
@ -1575,9 +1575,9 @@ static void CheckPutFrontierTVShowOnAir(void)
&& ShouldAirFrontierTVShow())
{
if (battleMode == FRONTIER_MODE_SINGLES)
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode], 5);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_DOME_SINGLES);
else
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode], 6);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_DOME_DOUBLES);
}
}
break;
@ -1589,9 +1589,9 @@ static void CheckPutFrontierTVShowOnAir(void)
&& ShouldAirFrontierTVShow())
{
if (battleMode == FRONTIER_MODE_SINGLES)
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode], 11);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_PALACE_SINGLES);
else
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode], 12);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_PALACE_DOUBLES);
}
}
break;
@ -1602,7 +1602,7 @@ static void CheckPutFrontierTVShowOnAir(void)
if (gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] > 1
&& ShouldAirFrontierTVShow())
{
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode], 10);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode], FRONTIER_SHOW_ARENA);
}
}
break;
@ -1615,9 +1615,9 @@ static void CheckPutFrontierTVShowOnAir(void)
&& ShouldAirFrontierTVShow())
{
if (battleMode == FRONTIER_MODE_SINGLES)
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode], 7);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_FACTORY_SINGLES);
else
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode], 8);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode], FRONTIER_SHOW_FACTORY_DOUBLES);
}
}
break;
@ -1628,7 +1628,7 @@ static void CheckPutFrontierTVShowOnAir(void)
if (gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] > 1
&& ShouldAirFrontierTVShow())
{
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode], 9);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode], FRONTIER_SHOW_PIKE);
}
}
break;
@ -1639,7 +1639,7 @@ static void CheckPutFrontierTVShowOnAir(void)
if (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] > 1
&& ShouldAirFrontierTVShow())
{
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode], 13);
TryPutFrontierTVShowOnAir(gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode], FRONTIER_SHOW_PYRAMID);
}
}
break;

View File

@ -471,11 +471,11 @@ const u8 gContestSliderHeart_Gfx[] = INCBIN_U8("graphics/contest/slider_heart.4b
const u32 gUnknownGfx_C19470[] = INCBIN_U32("graphics/unknown/unknown_C19470.4bpp.lz");
const u32 gUnknownPal_C19470[] = INCBIN_U32("graphics/unknown/unknown_C19470.gbapal.lz");
const u32 gContestResults_Gfx[] = INCBIN_U32("graphics/contest/results_screen.4bpp.lz");
const u32 gUnknown_08C19EEC[] = INCBIN_U32("graphics/contest/misc_2_tilemap_1.bin.lz");
const u32 gUnknown_08C1A000[] = INCBIN_U32("graphics/contest/misc_2_tilemap_2.bin.lz");
const u32 gUnknown_08C1A12C[] = INCBIN_U32("graphics/contest/misc_2_tilemap_3.bin.lz");
const u32 gContestResults_Pal[] = INCBIN_U32("graphics/contest/results_screen.gbapal.lz");
const u32 gContestResults_Gfx[] = INCBIN_U32("graphics/contest/results_screen/tiles.4bpp.lz");
const u32 gContestResults_WinnerBanner_Tilemap[] = INCBIN_U32("graphics/contest/results_screen/winner_banner.bin.lz");
const u32 gContestResults_Interface_Tilemap[] = INCBIN_U32("graphics/contest/results_screen/interface.bin.lz");
const u32 gContestResults_Bg_Tilemap[] = INCBIN_U32("graphics/contest/results_screen/bg.bin.lz");
const u32 gContestResults_Pal[] = INCBIN_U32("graphics/contest/results_screen/tiles.gbapal.lz");
const u32 gBattleAnimSpriteGfx_Impact[] = INCBIN_U32("graphics/battle_anims/sprites/impact.4bpp.lz");
const u32 gBattleAnimSpritePal_Impact[] = INCBIN_U32("graphics/battle_anims/sprites/impact.gbapal.lz");
@ -1296,17 +1296,17 @@ const u8 gBagMenuHMIcon_Gfx[] = INCBIN_U8("graphics/interface/hm.4bpp");
// contest results screen
const u16 gNormalContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_normal.bin");
const u16 gSuperContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_super.bin");
const u16 gHyperContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_hyper.bin");
const u16 gMasterContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_master.bin");
const u16 gLinkContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_link.bin");
const u16 gCoolContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_cool.bin");
const u16 gBeautyContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_beauty.bin");
const u16 gCuteContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_cute.bin");
const u16 gSmartContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_smart.bin");
const u16 gToughContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen_tough.bin");
const u16 gContestResults_Tilemap[] = INCBIN_U16("graphics/contest/results_screen.bin");
const u16 gContestResultsTitle_Normal_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_normal.bin");
const u16 gContestResultsTitle_Super_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_super.bin");
const u16 gContestResultsTitle_Hyper_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_hyper.bin");
const u16 gContestResultsTitle_Master_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_master.bin");
const u16 gContestResultsTitle_Link_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_link.bin");
const u16 gContestResultsTitle_Cool_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_cool.bin");
const u16 gContestResultsTitle_Beauty_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_beauty.bin");
const u16 gContestResultsTitle_Cute_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_cute.bin");
const u16 gContestResultsTitle_Smart_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_smart.bin");
const u16 gContestResultsTitle_Tough_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_tough.bin");
const u16 gContestResultsTitle_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title.bin");
// pokenav
@ -1474,9 +1474,9 @@ static const u16 sEmptyPal[16] = {0};
// Trade
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 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 gUnknown_08DDCF04[] = INCBIN_U16("graphics/trade/unknown_DDCF04.bin");
const u16 gTradeMenuMonBox_Tilemap[] = INCBIN_U16("graphics/trade/menu_mon_box.bin");

Some files were not shown because too many files have changed in this diff Show More