diff options
-rw-r--r-- | include/battle_records.h | 2 | ||||
-rw-r--r-- | include/global.h | 8 | ||||
-rw-r--r-- | include/new_game.h | 3 | ||||
-rw-r--r-- | include/union_room_chat.h | 2 | ||||
-rw-r--r-- | src/new_game.c | 99 |
5 files changed, 53 insertions, 61 deletions
diff --git a/include/battle_records.h b/include/battle_records.h index 55e969b50..5ddb11472 100644 --- a/include/battle_records.h +++ b/include/battle_records.h @@ -10,4 +10,4 @@ void ShowLinkBattleRecords(void); void RemoveRecordsWindow(void); void ShowTrainerHillRecords(void); -#endif // GUARD_BATTLE_RECORDS_H
\ No newline at end of file +#endif // GUARD_BATTLE_RECORDS_H diff --git a/include/global.h b/include/global.h index 2af9bbc94..c206cf5f1 100644 --- a/include/global.h +++ b/include/global.h @@ -230,8 +230,8 @@ struct SaveBlock2 /*0x0AC*/ u8 field_AC; /*0x0AD*/ u8 field_AD; /*0x0AE*/ u8 filler_AE[0x2]; - /*0x0B0*/ u8 field_B0; - /*0x0B1*/ u8 filler_B1[0x3EF]; + /*0x0B0*/ u8 field_B0; + /*0x0B1*/ u8 filler_B1[0x3EF]; /*0x4A0*/ u32 unk_4A0[0x2F]; /*0x55c*/ struct UnkSaveBlock2Substruct_55C unk_55C; /*0x574*/ u8 filler_574[0x324]; @@ -239,8 +239,8 @@ struct SaveBlock2 /*0xA98*/ struct LinkBattleRecords linkBattleRecords; /*0xAF0*/ struct BerryCrush berryCrush; /*0xB00*/ struct PokemonJumpResults pokeJump; - /*0xB10*/ struct BerryPickingResults berryPick; - /*0xB20*/ u8 filler_B20[0x400]; + /*0xB10*/ struct BerryPickingResults berryPick; + /*0xB20*/ u8 filler_B20[0x400]; /*0xF20*/ u32 encryptionKey; }; diff --git a/include/new_game.h b/include/new_game.h index 346e7aff3..eedaea724 100644 --- a/include/new_game.h +++ b/include/new_game.h @@ -2,12 +2,9 @@ #define GUARD_NEW_GAME_H void SetTrainerId(u32 trainerId, u8 *dst); -u32 ReadUnalignedWord(u8* dataPtr); void CopyTrainerId(u8 *dst, u8 *src); void NewGameInitData(void); void ResetMenuAndMonGlobals(void); void Sav2_ClearSetDefault(void); -void ResetMiniGamesResults(void); -void sub_808447C(void); #endif // GUARD_NEW_GAME_H diff --git a/include/union_room_chat.h b/include/union_room_chat.h index 027a2e20c..17e482525 100644 --- a/include/union_room_chat.h +++ b/include/union_room_chat.h @@ -4,4 +4,4 @@ void sub_801DD98(void); void copy_strings_to_sav1(void); -#endif // GUARD_UNION_ROOM_CHAT_H
\ No newline at end of file +#endif // GUARD_UNION_ROOM_CHAT_H diff --git a/src/new_game.c b/src/new_game.c index d3463f80b..72780c810 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -33,7 +33,7 @@ extern const u8 EventScript_ResetAllMapFlags[]; // this file's functions -void ResetMiniGamesResults(void); +static void ResetMiniGamesResults(void); // EWRAM vars EWRAM_DATA bool8 gDifferentSaveFile = FALSE; @@ -53,13 +53,13 @@ void CopyTrainerId(u8 *dst, u8 *src) dst[i] = src[i]; } -/*static*/ void InitPlayerTrainerId(void) +static void InitPlayerTrainerId(void) { u32 trainerId = (Random() << 0x10) | GetGeneratedTrainerIdLower(); SetTrainerId(trainerId, gSaveBlock2Ptr->playerTrainerId); } -/*static*/ void SetDefaultOptions(void) +static void SetDefaultOptions(void) { gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_MID; gSaveBlock2Ptr->optionsWindowFrameType = 0; @@ -67,21 +67,21 @@ void CopyTrainerId(u8 *dst, u8 *src) gSaveBlock2Ptr->optionsBattleStyle = OPTIONS_BATTLE_STYLE_SHIFT; gSaveBlock2Ptr->optionsBattleSceneOff = FALSE; gSaveBlock2Ptr->regionMapZoom = FALSE; - gSaveBlock2Ptr->optionsButtonMode = OPTIONS_BUTTON_MODE_NORMAL; + gSaveBlock2Ptr->optionsButtonMode = OPTIONS_BUTTON_MODE_NORMAL; } -/*static*/ void ClearPokedexFlags(void) +static void ClearPokedexFlags(void) { memset(&gSaveBlock2Ptr->pokedex.owned, 0, sizeof(gSaveBlock2Ptr->pokedex.owned)); memset(&gSaveBlock2Ptr->pokedex.seen, 0, sizeof(gSaveBlock2Ptr->pokedex.seen)); } -/*static*/ void sub_80549D4(void) +static void sub_80549D4(void) { CpuFill32(0, &gSaveBlock2Ptr->field_B0, (u32) &gSaveBlock2Ptr->mapView - (u32) &gSaveBlock2Ptr->field_B0); } -/*static*/ void WarpToPlayersRoom(void) +static void WarpToPlayersRoom(void) { SetWarpDestination(MAP_GROUP(PALLET_TOWN_PLAYERS_HOUSE_2F), MAP_NUM(PALLET_TOWN_PLAYERS_HOUSE_2F), -1, 6, 6); WarpIntoMap(); @@ -96,73 +96,68 @@ void Sav2_ClearSetDefault(void) void ResetMenuAndMonGlobals(void) { gDifferentSaveFile = 0; - ZeroPlayerPartyMons(); + ZeroPlayerPartyMons(); ZeroEnemyPartyMons(); - sub_81089BC(); + sub_81089BC(); ResetTMCaseCursorPos(); BerryPouch_CursorResetToTop(); sub_811089C(); sub_8083214(Random()); - sub_806E6FC(); + sub_806E6FC(); } void NewGameInitData(void) { - u8 rivalName[PLAYER_NAME_LENGTH]; - StringCopy(rivalName, gSaveBlock1Ptr->rivalName); - gDifferentSaveFile = 1; - gSaveBlock2Ptr->encryptionKey = 0; - ZeroPlayerPartyMons(); + u8 rivalName[PLAYER_NAME_LENGTH]; + + StringCopy(rivalName, gSaveBlock1Ptr->rivalName); + gDifferentSaveFile = 1; + gSaveBlock2Ptr->encryptionKey = 0; + ZeroPlayerPartyMons(); ZeroEnemyPartyMons(); sub_80549D4(); ClearSav1(); ClearMailData(); - gSaveBlock2Ptr->specialSaveWarpFlags = 0; + gSaveBlock2Ptr->specialSaveWarpFlags = 0; gSaveBlock2Ptr->field_A8 = 0; - gSaveBlock2Ptr->field_AC = 1; - gSaveBlock2Ptr->field_AD = 0; - InitPlayerTrainerId(); + gSaveBlock2Ptr->field_AC = 1; + gSaveBlock2Ptr->field_AD = 0; + InitPlayerTrainerId(); PlayTimeCounter_Reset(); ClearPokedexFlags(); - sub_806E0D0(); - ResetFameChecker(); - SetMoney(&gSaveBlock1Ptr->money, 3000); - sub_8054E68(); - InitLinkBattleRecords(); - sub_80A0904(); - sub_80A0958(); - sub_806E190(); - gPlayerPartyCount = 0; + sub_806E0D0(); + ResetFameChecker(); + SetMoney(&gSaveBlock1Ptr->money, 3000); + sub_8054E68(); + InitLinkBattleRecords(); + sub_80A0904(); + sub_80A0958(); + sub_806E190(); + gPlayerPartyCount = 0; ZeroPlayerPartyMons(); - sub_808C7E0(); - ClearRoamerData(); - gSaveBlock1Ptr->registeredItem = 0; - ClearItemSlotsInAllBagPockets(); - sub_80EB658(); - sub_809C794(); - sub_80BDD34(); - sub_8113044(); - copy_strings_to_sav1(); - ResetMiniGamesResults(); - sub_8143D24(); - sub_815D838(); - WarpToPlayersRoom(); - ScriptContext2_RunNewScript(EventScript_ResetAllMapFlags); - StringCopy(gSaveBlock1Ptr->rivalName, rivalName); - sub_815EE0C(); + sub_808C7E0(); + ClearRoamerData(); + gSaveBlock1Ptr->registeredItem = 0; + ClearItemSlotsInAllBagPockets(); + sub_80EB658(); + sub_809C794(); + sub_80BDD34(); + sub_8113044(); + copy_strings_to_sav1(); + ResetMiniGamesResults(); + sub_8143D24(); + sub_815D838(); + WarpToPlayersRoom(); + ScriptContext2_RunNewScript(EventScript_ResetAllMapFlags); + StringCopy(gSaveBlock1Ptr->rivalName, rivalName); + sub_815EE0C(); } -/*static*/ void ResetMiniGamesResults(void) +static void ResetMiniGamesResults(void) { CpuFill16(0, &gSaveBlock2Ptr->berryCrush, sizeof(struct BerryCrush)); SetBerryPowder(&gSaveBlock2Ptr->berryCrush.berryPowderAmount, 0); ResetPokeJumpResults(); CpuFill16(0, &gSaveBlock2Ptr->berryPick, sizeof(struct BerryPickingResults)); } - - - - - - -
\ No newline at end of file +
\ No newline at end of file |