Merge pull request #1421 from GriffinRichards/doc-tvrecordmix

Document TV
This commit is contained in:
GriffinR 2021-04-29 00:25:01 -04:00 committed by GitHub
commit f7a699c686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 3028 additions and 3417 deletions

View File

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

View File

@ -1,6 +1,6 @@
@ Gabby and Ty always move to the same spots for the first 5 battles @ 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 @ 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 GabbyAndTy_EventScript_UpdateLocation:: @ 828CCC7
cleartrainerflag TRAINER_GABBY_AND_TY_6 cleartrainerflag TRAINER_GABBY_AND_TY_6
specialvar VAR_RESULT, GabbyAndTyGetBattleNum specialvar VAR_RESULT, GabbyAndTyGetBattleNum
@ -198,7 +198,7 @@ GabbyAndTy_EventScript_TyBattle6:: @ 828CF36
GabbyAndTy_EventScript_FirstInterview:: @ 828CF56 GabbyAndTy_EventScript_FirstInterview:: @ 828CF56
special GabbyAndTyBeforeInterview special GabbyAndTyBeforeInterview
special GabbyAndTySetScriptVarsToObjectEventLocalIds special GetGabbyAndTyLocalIds
compare VAR_FACING, DIR_NORTH compare VAR_FACING, DIR_NORTH
call_if_eq GabbyAndTy_EventScript_FacePlayerNorth call_if_eq GabbyAndTy_EventScript_FacePlayerNorth
compare VAR_FACING, DIR_SOUTH compare VAR_FACING, DIR_SOUTH
@ -229,7 +229,7 @@ GabbyAndTy_EventScript_FacePlayerEast:: @ 828CFB1
GabbyAndTy_EventScript_RequestInterview:: @ 828CFC3 GabbyAndTy_EventScript_RequestInterview:: @ 828CFC3
special GabbyAndTyBeforeInterview special GabbyAndTyBeforeInterview
special GabbyAndTySetScriptVarsToObjectEventLocalIds special GetGabbyAndTyLocalIds
compare VAR_FACING, DIR_NORTH compare VAR_FACING, DIR_NORTH
call_if_eq GabbyAndTy_EventScript_FacePlayerNorth call_if_eq GabbyAndTy_EventScript_FacePlayerNorth
compare VAR_FACING, DIR_SOUTH compare VAR_FACING, DIR_SOUTH

View File

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

View File

@ -83,8 +83,8 @@ gSpecials:: @ 81DBA64
def_special IsLeadMonNicknamedOrNotEnglish def_special IsLeadMonNicknamedOrNotEnglish
def_special SetContestCategoryStringVarForInterview def_special SetContestCategoryStringVarForInterview
def_special GetNextActiveShowIfMassOutbreak def_special GetNextActiveShowIfMassOutbreak
def_special TV_IsScriptShowKindAlreadyInQueue def_special IsTVShowAlreadyInQueue
def_special CheckForBigMovieOrEmergencyNewsOnTV def_special CheckForPlayersHouseNews
def_special GetMomOrDadStringForTVMessage def_special GetMomOrDadStringForTVMessage
def_special ResetTVShowState def_special ResetTVShowState
def_special GetContestWinnerId def_special GetContestWinnerId
@ -187,10 +187,10 @@ gSpecials:: @ 81DBA64
def_special GabbyAndTyAfterInterview def_special GabbyAndTyAfterInterview
def_special GabbyAndTyBeforeInterview def_special GabbyAndTyBeforeInterview
def_special DoTVShowInSearchOfTrainers def_special DoTVShowInSearchOfTrainers
def_special IsTVShowInSearchOfTrainersAiring def_special IsGabbyAndTyShowOnTheAir
def_special GabbyAndTyGetLastQuote def_special GabbyAndTyGetLastQuote
def_special GabbyAndTyGetLastBattleTrivia def_special GabbyAndTyGetLastBattleTrivia
def_special GabbyAndTySetScriptVarsToObjectEventLocalIds def_special GetGabbyAndTyLocalIds
def_special GetBattleOutcome def_special GetBattleOutcome
def_special GetDaycareMonNicknames def_special GetDaycareMonNicknames
def_special GetDaycareState def_special GetDaycareState
@ -354,7 +354,7 @@ gSpecials:: @ 81DBA64
def_special SetChampionSaveWarp def_special SetChampionSaveWarp
def_special TryPutTreasureInvestigatorsOnAir def_special TryPutTreasureInvestigatorsOnAir
def_special TryPutLotteryWinnerReportOnAir def_special TryPutLotteryWinnerReportOnAir
def_special TrySetUpTrainerFanClubSpecial def_special TryPutTrainerFanClubOnAir
def_special ShouldHideFanClubInterviewer def_special ShouldHideFanClubInterviewer
def_special ShowGlassWorkshopMenu def_special ShowGlassWorkshopMenu
def_special PutFanClubSpecialOnTheAir def_special PutFanClubSpecialOnTheAir

View File

@ -78,6 +78,21 @@
#define FRONTIER_MANIAC_MESSAGE_COUNT 3 #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 // Frontier Gambler
#define FRONTIER_GAMBLER_WAITING 0 #define FRONTIER_GAMBLER_WAITING 0
#define FRONTIER_GAMBLER_PLACED_BET 1 #define FRONTIER_GAMBLER_PLACED_BET 1

View File

@ -9,7 +9,7 @@
#define EASY_CHAT_TYPE_INTERVIEW 5 #define EASY_CHAT_TYPE_INTERVIEW 5
#define EASY_CHAT_TYPE_BARD_SONG 6 #define EASY_CHAT_TYPE_BARD_SONG 6
#define EASY_CHAT_TYPE_FAN_CLUB 7 #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_TRENDY_PHRASE 9
#define EASY_CHAT_TYPE_GABBY_AND_TY 10 #define EASY_CHAT_TYPE_GABBY_AND_TY 10
#define EASY_CHAT_TYPE_CONTEST_INTERVIEW 11 #define EASY_CHAT_TYPE_CONTEST_INTERVIEW 11

View File

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

View File

@ -6,12 +6,22 @@
#define POKENEWS_GAME_CORNER 2 #define POKENEWS_GAME_CORNER 2
#define POKENEWS_LILYCOVE 3 #define POKENEWS_LILYCOVE 3
#define POKENEWS_BLENDMASTER 4 #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 #define TVSHOW_OFF_AIR 0
// TVGROUP_NORMAL
#define TVGROUP_NORMAL_START 1
#define TVSHOW_FAN_CLUB_LETTER 1 #define TVSHOW_FAN_CLUB_LETTER 1
#define TVSHOW_RECENT_HAPPENINGS 2 #define TVSHOW_RECENT_HAPPENINGS 2
#define TVSHOW_PKMN_FAN_CLUB_OPINIONS 3 #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_NAME_RATER_SHOW 5
#define TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE 6 #define TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE 6
#define TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE 7 #define TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE 7
@ -20,7 +30,11 @@
#define TVSHOW_BATTLE_UPDATE 10 #define TVSHOW_BATTLE_UPDATE 10
#define TVSHOW_FAN_CLUB_SPECIAL 11 #define TVSHOW_FAN_CLUB_SPECIAL 11
#define TVSHOW_LILYCOVE_CONTEST_LADY 12 #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_POKEMON_TODAY_CAUGHT 21
#define TVSHOW_SMART_SHOPPER 22 #define TVSHOW_SMART_SHOPPER 22
#define TVSHOW_POKEMON_TODAY_FAILED 23 #define TVSHOW_POKEMON_TODAY_FAILED 23
@ -40,8 +54,22 @@
#define TVSHOW_NUMBER_ONE 37 #define TVSHOW_NUMBER_ONE 37
#define TVSHOW_SECRET_BASE_SECRETS 38 #define TVSHOW_SECRET_BASE_SECRETS 38
#define TVSHOW_SAFARI_FAN_CLUB 39 #define TVSHOW_SAFARI_FAN_CLUB 39
// // #define TVGROUP_RECORD_MIX_END 40
// TVGROUP_OUTBREAK
#define TVGROUP_OUTBREAK_START 41
#define TVSHOW_MASS_OUTBREAK 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 // Number of ribbons to put Spot the Cuties on air
#define NUM_CUTIES_RIBBONS 4 #define NUM_CUTIES_RIBBONS 4
@ -221,4 +249,6 @@
#define CONTESTLADYLIVE_STATE_LOST 2 #define CONTESTLADYLIVE_STATE_LOST 2
#define CONTESTLADYLIVE_STATE_LOST_BADLY 3 #define CONTESTLADYLIVE_STATE_LOST_BADLY 3
#define SMARTSHOPPER_NUM_ITEMS 3
#endif //GUARD_CONSTANTS_TV_H #endif //GUARD_CONSTANTS_TV_H

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,6 @@
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/easy_chat.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_MaxieTrainer[];
extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_TabithaTrainer[]; extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_TabithaTrainer[];

View File

@ -42,7 +42,6 @@
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/tv.h"
// This file's functions. // This file's functions.
static void LoadContestPalettes(void); static void LoadContestPalettes(void);

View File

@ -44,7 +44,6 @@
#include "constants/game_stat.h" #include "constants/game_stat.h"
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/tv.h"
#include "contest.h" #include "contest.h"
enum { enum {

View File

@ -24,7 +24,7 @@
#include "constants/region_map_sections.h" #include "constants/region_map_sections.h"
// this file's functions // 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 void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare);
static u8 GetDaycareCompatibilityScore(struct DayCare *daycare); static u8 GetDaycareCompatibilityScore(struct DayCare *daycare);
static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y); static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y);
@ -120,7 +120,7 @@ u8 CountPokemonInDaycare(struct DayCare *daycare)
return count; return count;
} }
void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail) void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *daycareMail)
{ {
u8 i; u8 i;
u8 numDaycareMons = 0; u8 numDaycareMons = 0;
@ -131,13 +131,9 @@ void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDay
{ {
numDaycareMons++; numDaycareMons++;
if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_HELD_ITEM) == ITEM_NONE) if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_HELD_ITEM) == ITEM_NONE)
{
daycareMail->holdsItem[i] = FALSE; daycareMail->holdsItem[i] = FALSE;
}
else else
{
daycareMail->holdsItem[i] = TRUE; daycareMail->holdsItem[i] = TRUE;
}
} }
else else
{ {
@ -154,7 +150,7 @@ static s8 Daycare_FindEmptySpot(struct DayCare *daycare)
for (i = 0; i < DAYCARE_MON_COUNT; i++) 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; return i;
} }
@ -349,7 +345,7 @@ u8 GetNumLevelsGainedFromDaycare(void)
return 0; return 0;
} }
static void ClearDaycareMonMail(struct DayCareMail *mail) static void ClearDaycareMonMail(struct DaycareMail *mail)
{ {
s32 i; s32 i;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,6 @@
#include "battle_pyramid_bag.h" #include "battle_pyramid_bag.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/hold_effects.h" #include "constants/hold_effects.h"
#include "constants/tv.h"
extern u16 gUnknown_0203CF30[]; extern u16 gUnknown_0203CF30[];

View File

@ -680,45 +680,43 @@ void ScrSpecial_SetMauvilleOldManObjEventGfx(void)
// Language fixers? // Language fixers?
void sub_8120B70(union OldMan * oldMan) void SanitizeMauvilleOldManForRuby(union OldMan * oldMan)
{ {
s32 i; s32 i;
u8 playerName[PLAYER_NAME_LENGTH + 1]; u8 playerName[PLAYER_NAME_LENGTH + 1];
switch (oldMan->common.id) switch (oldMan->common.id)
{ {
case MAUVILLE_MAN_TRADER: case MAUVILLE_MAN_TRADER:
{
struct MauvilleOldManTrader * trader = &oldMan->trader;
for (i = 0; i < NUM_TRADER_ITEMS; i++)
{ {
struct MauvilleOldManTrader * trader = &oldMan->trader; if (trader->language[i] == LANGUAGE_JAPANESE)
for (i = 0; i < NUM_TRADER_ITEMS; i++) ConvertInternationalString(trader->playerNames[i], LANGUAGE_JAPANESE);
}
break;
}
case MAUVILLE_MAN_STORYTELLER:
{
struct MauvilleManStoryteller * storyteller = &oldMan->storyteller;
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
if (storyteller->gameStatIDs[i] != 0)
{ {
if (trader->language[i] == LANGUAGE_JAPANESE) memcpy(playerName, storyteller->trainerNames[i], PLAYER_NAME_LENGTH);
playerName[PLAYER_NAME_LENGTH] = EOS;
if (IsStringJapanese(playerName))
{ {
ConvertInternationalString(trader->playerNames[i], LANGUAGE_JAPANESE); memset(playerName, CHAR_SPACE, PLAYER_NAME_LENGTH + 1);
StringCopy(playerName, gText_Friend);
memcpy(storyteller->trainerNames[i], playerName, PLAYER_NAME_LENGTH);
storyteller->language[i] = GAME_LANGUAGE;
} }
} }
} }
break; break;
case MAUVILLE_MAN_STORYTELLER: }
{
struct MauvilleManStoryteller * storyteller = &oldMan->storyteller;
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
if (storyteller->gameStatIDs[i] != 0)
{
memcpy(playerName, storyteller->trainerNames[i], PLAYER_NAME_LENGTH);
playerName[PLAYER_NAME_LENGTH] = EOS;
if (IsStringJapanese(playerName))
{
memset(playerName, CHAR_SPACE, PLAYER_NAME_LENGTH + 1);
StringCopy(playerName, gText_Friend);
memcpy(storyteller->trainerNames[i], playerName, PLAYER_NAME_LENGTH);
storyteller->language[i] = GAME_LANGUAGE;
}
}
}
}
break;
} }
} }

View File

@ -509,12 +509,14 @@ void RemoveStartMenuWindow(void)
} }
} }
u16 sub_8197A30(void) // Unused
static u16 GetDialogFrameBaseTileNum(void)
{ {
return DLG_WINDOW_BASE_TILE_NUM; return DLG_WINDOW_BASE_TILE_NUM;
} }
u16 sub_8197A38(void) // Unused
static u16 GetStandardFrameBaseTileNum(void)
{ {
return STD_WINDOW_BASE_TILE_NUM; return STD_WINDOW_BASE_TILE_NUM;
} }

View File

@ -8,7 +8,6 @@
#include "script_pokemon_util.h" #include "script_pokemon_util.h"
#include "tv.h" #include "tv.h"
#include "constants/heal_locations.h" #include "constants/heal_locations.h"
#include "constants/tv.h"
int GameClear(void) int GameClear(void)
{ {

View File

@ -51,7 +51,7 @@ struct PlayerRecordsRS
PokeNews pokeNews[POKE_NEWS_COUNT]; PokeNews pokeNews[POKE_NEWS_COUNT];
OldMan oldMan; OldMan oldMan;
struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT]; struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT];
struct RecordMixingDayCareMail dayCareMail; struct RecordMixingDaycareMail daycareMail;
struct RSBattleTowerRecord battleTowerRecord; struct RSBattleTowerRecord battleTowerRecord;
u16 giftItem; u16 giftItem;
u16 filler11C8[0x32]; u16 filler11C8[0x32];
@ -64,7 +64,7 @@ struct PlayerRecordsEmerald
/* 0x1004 */ PokeNews pokeNews[POKE_NEWS_COUNT]; /* 0x1004 */ PokeNews pokeNews[POKE_NEWS_COUNT];
/* 0x1044 */ OldMan oldMan; /* 0x1044 */ OldMan oldMan;
/* 0x1084 */ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT]; /* 0x1084 */ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT];
/* 0x10ac */ struct RecordMixingDayCareMail dayCareMail; /* 0x10ac */ struct RecordMixingDaycareMail daycareMail;
/* 0x1124 */ struct EmeraldBattleTowerRecord battleTowerRecord; /* 0x1124 */ struct EmeraldBattleTowerRecord battleTowerRecord;
/* 0x1210 */ u16 giftItem; /* 0x1210 */ u16 giftItem;
/* 0x1214 */ LilycoveLady lilycoveLady; /* 0x1214 */ LilycoveLady lilycoveLady;
@ -87,7 +87,7 @@ static TVShow *sTvShowsSave;
static PokeNews *sPokeNewsSave; static PokeNews *sPokeNewsSave;
static OldMan *sOldManSave; static OldMan *sOldManSave;
static struct DewfordTrend *sDewfordTrendsSave; static struct DewfordTrend *sDewfordTrendsSave;
static struct RecordMixingDayCareMail *gUnknown_03001148; static struct RecordMixingDaycareMail *sDaycareMailSave;
static void *sBattleTowerSave; static void *sBattleTowerSave;
static LilycoveLady *sLilycoveLadySave; static LilycoveLady *sLilycoveLadySave;
static void *sApprenticesSave; static void *sApprenticesSave;
@ -96,7 +96,7 @@ static u32 sRecordStructSize;
static u8 gUnknown_03001160; static u8 gUnknown_03001160;
static struct PlayerHallRecords *gUnknown_03001168[3]; static struct PlayerHallRecords *gUnknown_03001168[3];
static EWRAM_DATA struct RecordMixingDayCareMail gUnknown_02039F9C = {0}; static EWRAM_DATA struct RecordMixingDaycareMail sDaycareMail = {0};
static EWRAM_DATA union PlayerRecords *sReceivedRecords = NULL; static EWRAM_DATA union PlayerRecords *sReceivedRecords = NULL;
static EWRAM_DATA union PlayerRecords *sSentRecord = NULL; static EWRAM_DATA union PlayerRecords *sSentRecord = NULL;
@ -115,14 +115,14 @@ static void ReceiveOldManData(OldMan *, size_t, u8);
static void ReceiveBattleTowerData(void *battleTowerRecord, size_t, u8); static void ReceiveBattleTowerData(void *battleTowerRecord, size_t, u8);
static void ReceiveLilycoveLadyData(LilycoveLady *, size_t, u8); static void ReceiveLilycoveLadyData(LilycoveLady *, size_t, u8);
static void sub_80E7B2C(const u8 *); static void sub_80E7B2C(const u8 *);
static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *, size_t, u8, TVShow *); static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *, size_t, u8, TVShow *);
static void ReceiveGiftItem(u16 *item, u8 which); static void ReceiveGiftItem(u16 *item, u8 which);
static void Task_DoRecordMixing(u8 taskId); static void Task_DoRecordMixing(u8 taskId);
static void GetSavedApprentices(struct Apprentice *dst, struct Apprentice *src); static void GetSavedApprentices(struct Apprentice *dst, struct Apprentice *src);
static void ReceiveApprenticeData(struct Apprentice *mixApprentice, size_t recordSize, u32 multiplayerId); static void ReceiveApprenticeData(struct Apprentice *mixApprentice, size_t recordSize, u32 multiplayerId);
static void ReceiveRankingHallRecords(struct PlayerHallRecords *hallRecords, size_t arg1, u32 arg2); static void ReceiveRankingHallRecords(struct PlayerHallRecords *hallRecords, size_t arg1, u32 arg2);
static void sub_80E89F8(struct RecordMixingDayCareMail *dst); static void GetRecordMixingDaycareMail(struct RecordMixingDaycareMail *dst);
static void SanitizeDayCareMailForRuby(struct RecordMixingDayCareMail *src); static void SanitizeDaycareMailForRuby(struct RecordMixingDaycareMail *src);
static void SanitizeEmeraldBattleTowerRecord(struct EmeraldBattleTowerRecord *arg0); static void SanitizeEmeraldBattleTowerRecord(struct EmeraldBattleTowerRecord *arg0);
static void SanitizeRubyBattleTowerRecord(struct RSBattleTowerRecord *src); static void SanitizeRubyBattleTowerRecord(struct RSBattleTowerRecord *src);
@ -180,7 +180,7 @@ static void SetSrcLookupPointers(void)
sPokeNewsSave = gSaveBlock1Ptr->pokeNews; sPokeNewsSave = gSaveBlock1Ptr->pokeNews;
sOldManSave = &gSaveBlock1Ptr->oldMan; sOldManSave = &gSaveBlock1Ptr->oldMan;
sDewfordTrendsSave = gSaveBlock1Ptr->dewfordTrends; sDewfordTrendsSave = gSaveBlock1Ptr->dewfordTrends;
gUnknown_03001148 = &gUnknown_02039F9C; sDaycareMailSave = &sDaycareMail;
sBattleTowerSave = &gSaveBlock2Ptr->frontier.towerPlayer; sBattleTowerSave = &gSaveBlock2Ptr->frontier.towerPlayer;
sLilycoveLadySave = &gSaveBlock1Ptr->lilycoveLady; sLilycoveLadySave = &gSaveBlock1Ptr->lilycoveLady;
sApprenticesSave = gSaveBlock2Ptr->apprentices; sApprenticesSave = gSaveBlock2Ptr->apprentices;
@ -191,11 +191,11 @@ static void PrepareUnknownExchangePacket(struct PlayerRecordsRS *dest)
{ {
memcpy(dest->secretBases, sSecretBasesSave, sizeof(dest->secretBases)); memcpy(dest->secretBases, sSecretBasesSave, sizeof(dest->secretBases));
memcpy(dest->tvShows, sTvShowsSave, sizeof(dest->tvShows)); memcpy(dest->tvShows, sTvShowsSave, sizeof(dest->tvShows));
sub_80F14F8(dest->tvShows); SanitizeTVShowLocationsForRuby(dest->tvShows);
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews)); memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan)); memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan));
memcpy(dest->dewfordTrends, sDewfordTrendsSave, sizeof(dest->dewfordTrends)); memcpy(dest->dewfordTrends, sDewfordTrendsSave, sizeof(dest->dewfordTrends));
sub_80E89F8(&dest->dayCareMail); GetRecordMixingDaycareMail(&dest->daycareMail);
EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord); EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord);
if (GetMultiplayerId() == 0) if (GetMultiplayerId() == 0)
@ -207,13 +207,13 @@ static void PrepareExchangePacketForRubySapphire(struct PlayerRecordsRS *dest)
memcpy(dest->secretBases, sSecretBasesSave, sizeof(dest->secretBases)); memcpy(dest->secretBases, sSecretBasesSave, sizeof(dest->secretBases));
ClearJapaneseSecretBases(dest->secretBases); ClearJapaneseSecretBases(dest->secretBases);
memcpy(dest->tvShows, sTvShowsSave, sizeof(dest->tvShows)); memcpy(dest->tvShows, sTvShowsSave, sizeof(dest->tvShows));
sub_80F1208(dest->tvShows); SanitizeTVShowsForRuby(dest->tvShows);
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews)); memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan)); memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan));
sub_8120B70(&dest->oldMan); SanitizeMauvilleOldManForRuby(&dest->oldMan);
memcpy(dest->dewfordTrends, sDewfordTrendsSave, sizeof(dest->dewfordTrends)); memcpy(dest->dewfordTrends, sDewfordTrendsSave, sizeof(dest->dewfordTrends));
sub_80E89F8(&dest->dayCareMail); GetRecordMixingDaycareMail(&dest->daycareMail);
SanitizeDayCareMailForRuby(&dest->dayCareMail); SanitizeDaycareMailForRuby(&dest->daycareMail);
EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord); EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord);
SanitizeRubyBattleTowerRecord(&dest->battleTowerRecord); SanitizeRubyBattleTowerRecord(&dest->battleTowerRecord);
@ -224,7 +224,7 @@ static void PrepareExchangePacketForRubySapphire(struct PlayerRecordsRS *dest)
static void PrepareExchangePacket(void) static void PrepareExchangePacket(void)
{ {
SetPlayerSecretBaseParty(); SetPlayerSecretBaseParty();
sub_80F0BB8(); DeactivateAllNormalTVShows();
SetSrcLookupPointers(); SetSrcLookupPointers();
if (Link_AnyPartnersPlayingRubyOrSapphire()) if (Link_AnyPartnersPlayingRubyOrSapphire())
@ -242,7 +242,7 @@ static void PrepareExchangePacket(void)
memcpy(&sSentRecord->emerald.oldMan, sOldManSave, sizeof(sSentRecord->emerald.oldMan)); memcpy(&sSentRecord->emerald.oldMan, sOldManSave, sizeof(sSentRecord->emerald.oldMan));
memcpy(&sSentRecord->emerald.lilycoveLady, sLilycoveLadySave, sizeof(sSentRecord->emerald.lilycoveLady)); memcpy(&sSentRecord->emerald.lilycoveLady, sLilycoveLadySave, sizeof(sSentRecord->emerald.lilycoveLady));
memcpy(sSentRecord->emerald.dewfordTrends, sDewfordTrendsSave, sizeof(sSentRecord->emerald.dewfordTrends)); memcpy(sSentRecord->emerald.dewfordTrends, sDewfordTrendsSave, sizeof(sSentRecord->emerald.dewfordTrends));
sub_80E89F8(&sSentRecord->emerald.dayCareMail); GetRecordMixingDaycareMail(&sSentRecord->emerald.daycareMail);
memcpy(&sSentRecord->emerald.battleTowerRecord, sBattleTowerSave, sizeof(sSentRecord->emerald.battleTowerRecord)); memcpy(&sSentRecord->emerald.battleTowerRecord, sBattleTowerSave, sizeof(sSentRecord->emerald.battleTowerRecord));
SanitizeEmeraldBattleTowerRecord(&sSentRecord->emerald.battleTowerRecord); SanitizeEmeraldBattleTowerRecord(&sSentRecord->emerald.battleTowerRecord);
@ -261,7 +261,7 @@ static void ReceiveExchangePacket(u32 which)
// Ruby/Sapphire // Ruby/Sapphire
sub_80E7B2C((void *)sReceivedRecords->ruby.tvShows); sub_80E7B2C((void *)sReceivedRecords->ruby.tvShows);
ReceiveSecretBasesData(sReceivedRecords->ruby.secretBases, sizeof(struct PlayerRecordsRS), which); ReceiveSecretBasesData(sReceivedRecords->ruby.secretBases, sizeof(struct PlayerRecordsRS), which);
ReceiveDaycareMailData(&sReceivedRecords->ruby.dayCareMail, sizeof(struct PlayerRecordsRS), which, sReceivedRecords->ruby.tvShows); ReceiveDaycareMailData(&sReceivedRecords->ruby.daycareMail, sizeof(struct PlayerRecordsRS), which, sReceivedRecords->ruby.tvShows);
ReceiveBattleTowerData(&sReceivedRecords->ruby.battleTowerRecord, sizeof(struct PlayerRecordsRS), which); ReceiveBattleTowerData(&sReceivedRecords->ruby.battleTowerRecord, sizeof(struct PlayerRecordsRS), which);
ReceiveTvShowsData(sReceivedRecords->ruby.tvShows, sizeof(struct PlayerRecordsRS), which); ReceiveTvShowsData(sReceivedRecords->ruby.tvShows, sizeof(struct PlayerRecordsRS), which);
ReceivePokeNewsData(sReceivedRecords->ruby.pokeNews, sizeof(struct PlayerRecordsRS), which); ReceivePokeNewsData(sReceivedRecords->ruby.pokeNews, sizeof(struct PlayerRecordsRS), which);
@ -278,7 +278,7 @@ static void ReceiveExchangePacket(u32 which)
ReceivePokeNewsData(sReceivedRecords->emerald.pokeNews, sizeof(struct PlayerRecordsEmerald), which); ReceivePokeNewsData(sReceivedRecords->emerald.pokeNews, sizeof(struct PlayerRecordsEmerald), which);
ReceiveOldManData(&sReceivedRecords->emerald.oldMan, sizeof(struct PlayerRecordsEmerald), which); ReceiveOldManData(&sReceivedRecords->emerald.oldMan, sizeof(struct PlayerRecordsEmerald), which);
ReceiveDewfordTrendData(sReceivedRecords->emerald.dewfordTrends, sizeof(struct PlayerRecordsEmerald), which); ReceiveDewfordTrendData(sReceivedRecords->emerald.dewfordTrends, sizeof(struct PlayerRecordsEmerald), which);
ReceiveDaycareMailData(&sReceivedRecords->emerald.dayCareMail, sizeof(struct PlayerRecordsEmerald), which, sReceivedRecords->emerald.tvShows); ReceiveDaycareMailData(&sReceivedRecords->emerald.daycareMail, sizeof(struct PlayerRecordsEmerald), which, sReceivedRecords->emerald.tvShows);
ReceiveBattleTowerData(&sReceivedRecords->emerald.battleTowerRecord, sizeof(struct PlayerRecordsEmerald), which); ReceiveBattleTowerData(&sReceivedRecords->emerald.battleTowerRecord, sizeof(struct PlayerRecordsEmerald), which);
ReceiveGiftItem(&sReceivedRecords->emerald.giftItem, which); ReceiveGiftItem(&sReceivedRecords->emerald.giftItem, which);
ReceiveLilycoveLadyData(&sReceivedRecords->emerald.lilycoveLady, sizeof(struct PlayerRecordsEmerald), which); ReceiveLilycoveLadyData(&sReceivedRecords->emerald.lilycoveLady, sizeof(struct PlayerRecordsEmerald), which);
@ -319,7 +319,7 @@ static void Task_RecordMixing_Main(u8 taskId)
{ {
case 0: // init case 0: // init
sSentRecord = malloc(sizeof(union PlayerRecords)); sSentRecord = malloc(sizeof(union PlayerRecords));
sReceivedRecords = malloc(sizeof(union PlayerRecords) * 4); sReceivedRecords = malloc(sizeof(union PlayerRecords) * MAX_LINK_PLAYERS);
SetLocalLinkPlayerId(gSpecialVar_0x8005); SetLocalLinkPlayerId(gSpecialVar_0x8005);
VarSet(VAR_TEMP_0, 1); VarSet(VAR_TEMP_0, 1);
gUnknown_03001130 = FALSE; gUnknown_03001130 = FALSE;
@ -665,7 +665,7 @@ static void ReceiveBattleTowerData(void *battleTowerRecord, size_t recordSize, u
{ {
memcpy((void *)battleTowerRecord + recordSize * which, (void *)battleTowerRecord + recordSize * mixIndices[which], sizeof(struct EmeraldBattleTowerRecord)); memcpy((void *)battleTowerRecord + recordSize * which, (void *)battleTowerRecord + recordSize * mixIndices[which], sizeof(struct EmeraldBattleTowerRecord));
dest = (void *)battleTowerRecord + recordSize * which; dest = (void *)battleTowerRecord + recordSize * which;
for (i = 0; i < 4; i ++) for (i = 0; i < MAX_FRONTIER_PARTY_SIZE; i++)
{ {
btPokemon = &dest->party[i]; btPokemon = &dest->party[i];
if (btPokemon->species != SPECIES_NONE && IsStringJapanese(btPokemon->nickname)) if (btPokemon->species != SPECIES_NONE && IsStringJapanese(btPokemon->nickname))
@ -706,22 +706,22 @@ static void ReceiveLilycoveLadyData(LilycoveLady *lilycoveLady, size_t recordSiz
} }
} }
static u8 sub_80E7A9C(struct DayCareMail *rmMail) static u8 sub_80E7A9C(struct DaycareMail *rmMail)
{ {
return rmMail->message.itemId; return rmMail->message.itemId;
} }
static void sub_80E7AA4(struct RecordMixingDayCareMail *src, size_t recordSize, u8 (*idxs)[2], u8 which0, u8 which1) static void sub_80E7AA4(struct RecordMixingDaycareMail *src, size_t recordSize, u8 (*idxs)[2], u8 which0, u8 which1)
{ {
struct DayCareMail buffer; struct DaycareMail buffer;
struct RecordMixingDayCareMail *mail1; struct RecordMixingDaycareMail *mail1;
struct RecordMixingDayCareMail *mail2; struct RecordMixingDaycareMail *mail2;
mail1 = (void *)src + recordSize * idxs[which0][0]; mail1 = (void *)src + recordSize * idxs[which0][0];
memcpy(&buffer, &mail1->mail[idxs[which0][1]], sizeof(struct DayCareMail)); memcpy(&buffer, &mail1->mail[idxs[which0][1]], sizeof(struct DaycareMail));
mail2 = (void *)src + recordSize * idxs[which1][0]; mail2 = (void *)src + recordSize * idxs[which1][0];
memcpy(&mail1->mail[idxs[which0][1]], &mail2->mail[idxs[which1][1]], sizeof(struct DayCareMail)); memcpy(&mail1->mail[idxs[which0][1]], &mail2->mail[idxs[which1][1]], sizeof(struct DaycareMail));
memcpy(&mail2->mail[idxs[which1][1]], &buffer, sizeof(struct DayCareMail)); memcpy(&mail2->mail[idxs[which1][1]], &buffer, sizeof(struct DaycareMail));
} }
static void sub_80E7B2C(const u8 *src) static void sub_80E7B2C(const u8 *src)
@ -730,7 +730,7 @@ static void sub_80E7B2C(const u8 *src)
s32 i; s32 i;
sum = 0; sum = 0;
for (i = 0; i < 256; i ++) for (i = 0; i < 256; i++)
sum += src[i]; sum += src[i];
gUnknown_03001160 = sum; gUnknown_03001160 = sum;
@ -741,17 +741,17 @@ static u8 sub_80E7B54(void)
return gUnknown_03001160; return gUnknown_03001160;
} }
static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *src, size_t recordSize, u8 which, TVShow *shows) static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *src, size_t recordSize, u8 which, TVShow *shows)
{ {
u16 i, j; u16 i, j;
u8 linkPlayerCount; u8 linkPlayerCount;
u8 tableId; u8 tableId;
struct RecordMixingDayCareMail *_src; struct RecordMixingDaycareMail *_src;
u8 which0, which1; u8 which0, which1;
void *ptr; void *ptr;
u8 sp04[4]; u8 sp04[4];
u8 sp08[4]; u8 sp08[4];
struct RecordMixingDayCareMail *sp0c[4]; struct RecordMixingDaycareMail *sp0c[4];
u8 sp1c[4][2]; u8 sp1c[4][2];
u8 sp24[4][2]; u8 sp24[4][2];
u8 sp34; u8 sp34;
@ -777,10 +777,10 @@ static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *src, size_t r
_src = (void *)src + i * recordSize; _src = (void *)src + i * recordSize;
language = gLinkPlayers[i].language; language = gLinkPlayers[i].language;
version = gLinkPlayers[i].version & 0xFF; version = gLinkPlayers[i].version & 0xFF;
for (j = 0; j < _src->numDaycareMons; j ++) for (j = 0; j < _src->numDaycareMons; j++)
{ {
u16 otNameLanguage, nicknameLanguage; u16 otNameLanguage, nicknameLanguage;
struct DayCareMail *recordMixingMail = &_src->mail[j]; struct DaycareMail *recordMixingMail = &_src->mail[j];
if (!recordMixingMail->message.itemId) if (!recordMixingMail->message.itemId)
continue; continue;
@ -835,7 +835,7 @@ static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *src, size_t r
if (_src->numDaycareMons == 0) if (_src->numDaycareMons == 0)
continue; continue;
for (j = 0; j < _src->numDaycareMons; j ++) for (j = 0; j < _src->numDaycareMons; j++)
{ {
if (!_src->holdsItem[j]) if (!_src->holdsItem[j])
sp1c[i][j] = 1; sp1c[i][j] = 1;
@ -913,8 +913,8 @@ static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *src, size_t r
} }
_src = (void *)src + which * recordSize; _src = (void *)src + which * recordSize;
memcpy(&gSaveBlock1Ptr->daycare.mons[0].mail, &_src->mail[0], sizeof(struct DayCareMail)); memcpy(&gSaveBlock1Ptr->daycare.mons[0].mail, &_src->mail[0], sizeof(struct DaycareMail));
memcpy(&gSaveBlock1Ptr->daycare.mons[1].mail, &_src->mail[1], sizeof(struct DayCareMail)); memcpy(&gSaveBlock1Ptr->daycare.mons[1].mail, &_src->mail[1], sizeof(struct DaycareMail));
SeedRng(oldSeed); SeedRng(oldSeed);
} }
@ -957,7 +957,7 @@ static void Task_DoRecordMixing(u8 taskId)
case 2: case 2:
SetContinueGameWarpStatusToDynamicWarp(); SetContinueGameWarpStatusToDynamicWarp();
FullSaveGame(); FullSaveGame();
task->data[0] ++; task->data[0]++;
break; break;
case 3: case 3:
if (CheckSaveFile()) if (CheckSaveFile())
@ -971,7 +971,7 @@ static void Task_DoRecordMixing(u8 taskId)
if (++task->data[1] > 10) if (++task->data[1] > 10)
{ {
SetCloseLinkCallback(); SetCloseLinkCallback();
task->data[0] ++; task->data[0]++;
} }
break; break;
case 5: case 5:
@ -984,7 +984,7 @@ static void Task_DoRecordMixing(u8 taskId)
if (!sub_801048C(FALSE)) if (!sub_801048C(FALSE))
{ {
CreateTask(Task_LinkSave, 5); CreateTask(Task_LinkSave, 5);
task->data[0] ++; task->data[0]++;
} }
break; break;
case 7: // wait for Task_LinkSave to finish. case 7: // wait for Task_LinkSave to finish.
@ -1003,7 +1003,7 @@ static void Task_DoRecordMixing(u8 taskId)
break; break;
case 8: case 8:
SetLinkStandbyCallback(); SetLinkStandbyCallback();
task->data[0] ++; task->data[0]++;
break; break;
case 9: case 9:
if (IsLinkTaskFinished()) if (IsLinkTaskFinished())
@ -1061,13 +1061,9 @@ static void GetSavedApprentices(struct Apprentice *dst, struct Apprentice *src)
break; break;
case 2: case 2:
if (Random2() > 0x3333) if (Random2() > 0x3333)
{
dst[1] = src[gSaveBlock2Ptr->playerApprentice.saveId + 1]; dst[1] = src[gSaveBlock2Ptr->playerApprentice.saveId + 1];
}
else else
{
dst[1] = src[((gSaveBlock2Ptr->playerApprentice.saveId + 1) % (APPRENTICE_COUNT - 1) + 1)]; dst[1] = src[((gSaveBlock2Ptr->playerApprentice.saveId + 1) % (APPRENTICE_COUNT - 1) + 1)];
}
break; break;
} }
} }
@ -1221,7 +1217,7 @@ static void sub_80E8578(struct RecordMixingHallRecords *dst, void *hallRecords,
for (l = 0; l < 3; l++) for (l = 0; l < 3; l++)
{ {
if (GetTrainerId(dst->hallRecords2P[j][l].id1) == GetTrainerId(gUnknown_03001168[k]->twoPlayers[j].id1) if (GetTrainerId(dst->hallRecords2P[j][l].id1) == GetTrainerId(gUnknown_03001168[k]->twoPlayers[j].id1)
&& GetTrainerId(dst->hallRecords2P[j][l].id2) == GetTrainerId(gUnknown_03001168[k]->twoPlayers[j].id2)) && GetTrainerId(dst->hallRecords2P[j][l].id2) == GetTrainerId(gUnknown_03001168[k]->twoPlayers[j].id2))
{ {
var_68++; var_68++;
if (dst->hallRecords2P[j][l].winStreak < gUnknown_03001168[k]->twoPlayers[j].winStreak) if (dst->hallRecords2P[j][l].winStreak < gUnknown_03001168[k]->twoPlayers[j].winStreak)
@ -1308,21 +1304,21 @@ static void ReceiveRankingHallRecords(struct PlayerHallRecords *hallRecords, siz
Free(largeStructPtr); Free(largeStructPtr);
} }
static void sub_80E89F8(struct RecordMixingDayCareMail *dst) static void GetRecordMixingDaycareMail(struct RecordMixingDaycareMail *dst)
{ {
gUnknown_02039F9C.mail[0] = gSaveBlock1Ptr->daycare.mons[0].mail; sDaycareMail.mail[0] = gSaveBlock1Ptr->daycare.mons[0].mail;
gUnknown_02039F9C.mail[1] = gSaveBlock1Ptr->daycare.mons[1].mail; sDaycareMail.mail[1] = gSaveBlock1Ptr->daycare.mons[1].mail;
InitDaycareMailRecordMixing(&gSaveBlock1Ptr->daycare, &gUnknown_02039F9C); InitDaycareMailRecordMixing(&gSaveBlock1Ptr->daycare, &sDaycareMail);
*dst = *gUnknown_03001148; *dst = *sDaycareMailSave;
} }
static void SanitizeDayCareMailForRuby(struct RecordMixingDayCareMail *src) static void SanitizeDaycareMailForRuby(struct RecordMixingDaycareMail *src)
{ {
s32 i; s32 i;
for (i = 0; i < src->numDaycareMons; i++) for (i = 0; i < src->numDaycareMons; i++)
{ {
struct DayCareMail *mail = &src->mail[i]; struct DaycareMail *mail = &src->mail[i];
if (mail->message.itemId != 0) if (mail->message.itemId != 0)
{ {
if (mail->gameLanguage != LANGUAGE_JAPANESE) if (mail->gameLanguage != LANGUAGE_JAPANESE)
@ -1342,10 +1338,10 @@ static void SanitizeEmeraldBattleTowerRecord(struct EmeraldBattleTowerRecord *ds
{ {
s32 i; s32 i;
for (i = 0; i < 4; i++) for (i = 0; i < MAX_FRONTIER_PARTY_SIZE; i++)
{ {
struct BattleTowerPokemon *towerMon = &dst->party[i]; struct BattleTowerPokemon *towerMon = &dst->party[i];
if (towerMon->species != 0) if (towerMon->species != SPECIES_NONE)
StripExtCtrlCodes(towerMon->nickname); StripExtCtrlCodes(towerMon->nickname);
} }

View File

@ -1968,7 +1968,7 @@ static void ExitRoulette(u8 taskId)
gSpecialVar_0x8004 = TRUE; gSpecialVar_0x8004 = TRUE;
else else
gSpecialVar_0x8004 = FALSE; gSpecialVar_0x8004 = FALSE;
AlertTVOfNewCoinTotal(GetCoins()); TryPutFindThatGamerOnAir(GetCoins());
BeginHardwarePaletteFade(0xFF, 0, 0, 16, 0); BeginHardwarePaletteFade(0xFF, 0, 0, 16, 0);
gTasks[taskId].func = Task_ExitRoulette; gTasks[taskId].func = Task_ExitRoulette;
} }

View File

@ -65,7 +65,7 @@ void EnterSafariMode(void)
void ExitSafariMode(void) void ExitSafariMode(void)
{ {
sub_80EE44C(sSafariZoneCaughtMons, sSafariZonePkblkUses); TryPutSafariFanClubOnAir(sSafariZoneCaughtMons, sSafariZonePkblkUses);
ResetSafariZoneFlag(); ResetSafariZoneFlag();
ClearAllPokeblockFeeders(); ClearAllPokeblockFeeders();
gNumSafariBalls = 0; gNumSafariBalls = 0;

View File

@ -22,7 +22,6 @@
#include "string_util.h" #include "string_util.h"
#include "tv.h" #include "tv.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/tv.h"
#include "constants/battle_frontier.h" #include "constants/battle_frontier.h"
static void CB2_ReturnFromChooseHalfParty(void); static void CB2_ReturnFromChooseHalfParty(void);

View File

@ -47,7 +47,6 @@
#include "constants/secret_bases.h" #include "constants/secret_bases.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
#include "constants/tv.h"
// Values for registryStatus // Values for registryStatus
enum { enum {

View File

@ -38,7 +38,6 @@
#include "constants/metatile_behaviors.h" #include "constants/metatile_behaviors.h"
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/tv.h"
#define TAG_SCROLL_ARROW 2100 #define TAG_SCROLL_ARROW 2100
#define TAG_ITEM_ICON_BASE 2110 #define TAG_ITEM_ICON_BASE 2110
@ -48,7 +47,7 @@ static EWRAM_DATA struct ShopData *sShopData = NULL;
static EWRAM_DATA struct ListMenuItem *sListMenuItems = NULL; static EWRAM_DATA struct ListMenuItem *sListMenuItems = NULL;
static EWRAM_DATA u8 (*sItemNames)[16] = {0}; static EWRAM_DATA u8 (*sItemNames)[16] = {0};
static EWRAM_DATA u8 sPurchaseHistoryId = 0; static EWRAM_DATA u8 sPurchaseHistoryId = 0;
EWRAM_DATA struct ItemSlot gMartPurchaseHistory[3] = {0}; EWRAM_DATA struct ItemSlot gMartPurchaseHistory[SMARTSHOPPER_NUM_ITEMS] = {0};
static void Task_ShopMenu(u8 taskId); static void Task_ShopMenu(u8 taskId);
static void Task_HandleShopMenuQuit(u8 taskId); static void Task_HandleShopMenuQuit(u8 taskId);
@ -373,7 +372,7 @@ static void Task_HandleShopMenuQuit(u8 taskId)
{ {
ClearStdWindowAndFrameToTransparent(sMartInfo.windowId, 2); ClearStdWindowAndFrameToTransparent(sMartInfo.windowId, 2);
RemoveWindow(sMartInfo.windowId); RemoveWindow(sMartInfo.windowId);
SaveRecordedItemPurchasesForTVShow(); TryPutSmartShopperOnAir();
ScriptContext2_Disable(); ScriptContext2_Disable();
DestroyTask(taskId); DestroyTask(taskId);

View File

@ -1592,7 +1592,7 @@ static bool8 SlotAction_WaitMsg_NoMoreCoins(struct Task *task)
static bool8 SlotAction_EndGame(struct Task *task) static bool8 SlotAction_EndGame(struct Task *task)
{ {
SetCoins(sSlotMachine->coins); SetCoins(sSlotMachine->coins);
AlertTVOfNewCoinTotal(GetCoins()); TryPutFindThatGamerOnAir(GetCoins());
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0)); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0));
sSlotMachine->state++; // SLOT_ACTION_FREE sSlotMachine->state++; // SLOT_ACTION_FREE
return FALSE; return FALSE;

6062
src/tv.c

File diff suppressed because it is too large Load Diff