Move pokemon and easy chat constants to global, misc clean-up

This commit is contained in:
GriffinR 2021-12-28 18:07:41 -05:00
parent aba5264260
commit aadab8b016
26 changed files with 21 additions and 42 deletions

View File

@ -1,7 +1,6 @@
#ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H #ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H
#define GUARD_BATTLE_SCRIPT_COMMANDS_H #define GUARD_BATTLE_SCRIPT_COMMANDS_H
#include "constants/pokemon.h"
#include "constants/battle_script_commands.h" #include "constants/battle_script_commands.h"
// Arguments for 'flags' in HandleBattleWindow // Arguments for 'flags' in HandleBattleWindow

View File

@ -29,11 +29,20 @@
#define GAME_VERSION (VERSION_EMERALD) #define GAME_VERSION (VERSION_EMERALD)
#define GAME_LANGUAGE (LANGUAGE_ENGLISH) #define GAME_LANGUAGE (LANGUAGE_ENGLISH)
// party sizes
#define PARTY_SIZE 6
#define MULTI_PARTY_SIZE (PARTY_SIZE / 2)
#define FRONTIER_PARTY_SIZE 3
#define FRONTIER_DOUBLES_PARTY_SIZE 4
#define FRONTIER_MULTI_PARTY_SIZE 2
#define MAX_FRONTIER_PARTY_SIZE FRONTIER_DOUBLES_PARTY_SIZE
#define UNION_ROOM_PARTY_SIZE 2
// capacities of various saveblock objects // capacities of various saveblock objects
#define DAYCARE_MON_COUNT 2 #define DAYCARE_MON_COUNT 2
#define POKEBLOCKS_COUNT 40 #define POKEBLOCKS_COUNT 40
#define OBJECT_EVENTS_COUNT 16 #define OBJECT_EVENTS_COUNT 16
#define MAIL_COUNT 16 #define MAIL_COUNT (10 + PARTY_SIZE)
#define SECRET_BASES_COUNT 20 #define SECRET_BASES_COUNT 20
#define TV_SHOWS_COUNT 25 #define TV_SHOWS_COUNT 25
#define POKE_NEWS_COUNT 16 #define POKE_NEWS_COUNT 16
@ -70,7 +79,6 @@
#define TRAINER_ID_LENGTH 4 #define TRAINER_ID_LENGTH 4
#define MAX_MON_MOVES 4 #define MAX_MON_MOVES 4
#define NUM_STATS 6
#define CONTESTANT_COUNT 4 #define CONTESTANT_COUNT 4
#define CONTEST_CATEGORY_COOL 0 #define CONTEST_CATEGORY_COOL 0
@ -80,15 +88,6 @@
#define CONTEST_CATEGORY_TOUGH 4 #define CONTEST_CATEGORY_TOUGH 4
#define CONTEST_CATEGORIES_COUNT 5 #define CONTEST_CATEGORIES_COUNT 5
// party sizes
#define PARTY_SIZE 6
#define MULTI_PARTY_SIZE (PARTY_SIZE / 2)
#define FRONTIER_PARTY_SIZE 3
#define FRONTIER_DOUBLES_PARTY_SIZE 4
#define FRONTIER_MULTI_PARTY_SIZE 2
#define MAX_FRONTIER_PARTY_SIZE FRONTIER_DOUBLES_PARTY_SIZE
#define UNION_ROOM_PARTY_SIZE 2
// string lengths // string lengths
#define ITEM_NAME_LENGTH 14 #define ITEM_NAME_LENGTH 14
#define POKEMON_NAME_LENGTH 10 #define POKEMON_NAME_LENGTH 10

View File

@ -78,11 +78,13 @@
#define STAT_SPEED 3 #define STAT_SPEED 3
#define STAT_SPATK 4 #define STAT_SPATK 4
#define STAT_SPDEF 5 #define STAT_SPDEF 5
#define NUM_STATS 6
#define STAT_ACC 6 // Only in battles. #define STAT_ACC 6 // Only in battles.
#define STAT_EVASION 7 // Only in battles. #define STAT_EVASION 7 // Only in battles.
#define NUM_NATURE_STATS NUM_STATS - 1 // excludes HP #define NUM_NATURE_STATS (NUM_STATS - 1) // excludes HP
#define NUM_BATTLE_STATS NUM_STATS + 2 // includes Accuracy and Evasion #define NUM_BATTLE_STATS (NUM_STATS + 2) // includes Accuracy and Evasion
#define MIN_STAT_STAGE 0 #define MIN_STAT_STAGE 0
#define DEFAULT_STAT_STAGE 6 #define DEFAULT_STAT_STAGE 6

View File

@ -2,7 +2,6 @@
#define GUARD_EASYCHAT_H #define GUARD_EASYCHAT_H
#include "main.h" #include "main.h"
#include "constants/easy_chat.h"
struct EasyChatScreenTemplate struct EasyChatScreenTemplate
{ {

View File

@ -11,6 +11,8 @@
#include "constants/species.h" #include "constants/species.h"
#include "constants/berry.h" #include "constants/berry.h"
#include "constants/maps.h" #include "constants/maps.h"
#include "constants/pokemon.h"
#include "constants/easy_chat.h"
// Prevent cross-jump optimization. // Prevent cross-jump optimization.
#define BLOCK_CROSS_JUMP asm(""); #define BLOCK_CROSS_JUMP asm("");
@ -127,6 +129,7 @@
#define DEX_FLAGS_NO ROUND_BITS_TO_BYTES(NUM_SPECIES) #define DEX_FLAGS_NO ROUND_BITS_TO_BYTES(NUM_SPECIES)
#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT) #define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
#define NUM_ADDITIONAL_PHRASE_BYTES ROUND_BITS_TO_BYTES(NUM_ADDITIONAL_PHRASES)
struct Coords8 struct Coords8
{ {
@ -984,7 +987,7 @@ struct SaveBlock1
/*0x2BC8*/ u16 easyChatBattleWon[EASY_CHAT_BATTLE_WORDS_COUNT]; /*0x2BC8*/ u16 easyChatBattleWon[EASY_CHAT_BATTLE_WORDS_COUNT];
/*0x2BD4*/ u16 easyChatBattleLost[EASY_CHAT_BATTLE_WORDS_COUNT]; /*0x2BD4*/ u16 easyChatBattleLost[EASY_CHAT_BATTLE_WORDS_COUNT];
/*0x2BE0*/ struct Mail mail[MAIL_COUNT]; /*0x2BE0*/ struct Mail mail[MAIL_COUNT];
/*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system /*0x2E20*/ u8 additionalPhrases[NUM_ADDITIONAL_PHRASE_BYTES]; // bitfield for 33 additional phrases in easy chat system
/*0x2E28*/ OldMan oldMan; /*0x2E28*/ OldMan oldMan;
/*0x2e64*/ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT]; /*0x2e64*/ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT];
/*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_*

View File

@ -4,7 +4,6 @@
#include "task.h" #include "task.h"
#include "text.h" #include "text.h"
#include "window.h" #include "window.h"
#include "constants/pokemon.h"
#define MENU_NOTHING_CHOSEN -2 #define MENU_NOTHING_CHOSEN -2
#define MENU_B_PRESSED -1 #define MENU_B_PRESSED -1

View File

@ -1,9 +1,6 @@
#ifndef GUARD_POKEBLOCK_H #ifndef GUARD_POKEBLOCK_H
#define GUARD_POKEBLOCK_H #define GUARD_POKEBLOCK_H
#include "constants/berry.h"
#include "constants/pokemon.h"
#define TAG_POKEBLOCK 14818 #define TAG_POKEBLOCK 14818
enum enum

View File

@ -1,7 +1,6 @@
#ifndef GUARD_POKEMON_H #ifndef GUARD_POKEMON_H
#define GUARD_POKEMON_H #define GUARD_POKEMON_H
#include "constants/pokemon.h"
#include "sprite.h" #include "sprite.h"
struct PokemonSubstruct0 struct PokemonSubstruct0

View File

@ -52,8 +52,7 @@ enum
{ {
SAVE_NORMAL, SAVE_NORMAL,
SAVE_LINK, // Link / Battle Frontier SAVE_LINK, // Link / Battle Frontier
//EREADER_SAVE, // deprecated in Emerald SAVE_EREADER, // deprecated in Emerald
SAVE_LINK2, // unknown 2nd link save
SAVE_HALL_OF_FAME, SAVE_HALL_OF_FAME,
SAVE_OVERWRITE_DIFFERENT_FILE, SAVE_OVERWRITE_DIFFERENT_FILE,
SAVE_HALL_OF_FAME_ERASE_BEFORE // unused SAVE_HALL_OF_FAME_ERASE_BEFORE // unused

View File

@ -23,9 +23,7 @@
#include "task.h" #include "task.h"
#include "text.h" #include "text.h"
#include "constants/battle_frontier.h" #include "constants/battle_frontier.h"
#include "constants/easy_chat.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/pokemon.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
#include "constants/moves.h" #include "constants/moves.h"

View File

@ -1,6 +1,5 @@
#include "global.h" #include "global.h"
#include "bard_music.h" #include "bard_music.h"
#include "constants/easy_chat.h"
#include "easy_chat.h" #include "easy_chat.h"
#include "data/bard_music/bard_sounds.h" #include "data/bard_music/bard_sounds.h"

View File

@ -5,7 +5,6 @@
#include "graphics.h" #include "graphics.h"
#include "sprite.h" #include "sprite.h"
#include "util.h" #include "util.h"
#include "constants/pokemon.h"
#include "constants/battle_palace.h" #include "constants/battle_palace.h"
static void SmokescreenImpact_Callback(struct Sprite *); static void SmokescreenImpact_Callback(struct Sprite *);

View File

@ -34,7 +34,6 @@
#include "constants/battle_dome.h" #include "constants/battle_dome.h"
#include "constants/frontier_util.h" #include "constants/frontier_util.h"
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/pokemon.h"
#include "constants/trainers.h" #include "constants/trainers.h"
#include "constants/abilities.h" #include "constants/abilities.h"
#include "constants/songs.h" #include "constants/songs.h"

View File

@ -17,7 +17,6 @@
#include "constants/battle_frontier.h" #include "constants/battle_frontier.h"
#include "constants/frontier_util.h" #include "constants/frontier_util.h"
#include "constants/abilities.h" #include "constants/abilities.h"
#include "constants/easy_chat.h"
#include "constants/layouts.h" #include "constants/layouts.h"
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/trainers.h" #include "constants/trainers.h"

View File

@ -35,7 +35,6 @@
#include "constants/trainers.h" #include "constants/trainers.h"
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/easy_chat.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

@ -1,5 +1,4 @@
#include "easy_chat.h" #include "easy_chat.h"
#include "constants/easy_chat.h"
#define DOUBLE_SPECIES_NAME EC_EMPTY_WORD, 2, #define DOUBLE_SPECIES_NAME EC_EMPTY_WORD, 2,

View File

@ -1,4 +1,3 @@
#include "constants/easy_chat.h"
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/moves.h" #include "constants/moves.h"

View File

@ -8,7 +8,6 @@
#include "text.h" #include "text.h"
#include "tv.h" #include "tv.h"
#include "string_util.h" #include "string_util.h"
#include "constants/easy_chat.h"
/* /*
## Overview ## ## Overview ##

View File

@ -27,7 +27,6 @@
#include "task.h" #include "task.h"
#include "text_window.h" #include "text_window.h"
#include "window.h" #include "window.h"
#include "constants/easy_chat.h"
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "constants/lilycove_lady.h" #include "constants/lilycove_lady.h"
#include "constants/mauville_old_man.h" #include "constants/mauville_old_man.h"

View File

@ -10,7 +10,6 @@
#include "task.h" #include "task.h"
#include "util.h" #include "util.h"
#include "trainer_hill.h" #include "trainer_hill.h"
#include "constants/easy_chat.h"
#include "constants/trainers.h" #include "constants/trainers.h"
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/items.h" #include "constants/items.h"

View File

@ -5,7 +5,6 @@
#include "pokemon_icon.h" #include "pokemon_icon.h"
#include "text.h" #include "text.h"
#include "international_string_util.h" #include "international_string_util.h"
#include "constants/easy_chat.h"
#define UNOWN_OFFSET 30000 #define UNOWN_OFFSET 30000

View File

@ -1,7 +1,6 @@
#include "global.h" #include "global.h"
#include "main.h" #include "main.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/easy_chat.h"
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "mauville_old_man.h" #include "mauville_old_man.h"
#include "event_data.h" #include "event_data.h"

View File

@ -65,7 +65,6 @@
#include "window.h" #include "window.h"
#include "constants/battle.h" #include "constants/battle.h"
#include "constants/battle_frontier.h" #include "constants/battle_frontier.h"
#include "constants/easy_chat.h"
#include "constants/field_effects.h" #include "constants/field_effects.h"
#include "constants/item_effects.h" #include "constants/item_effects.h"
#include "constants/items.h" #include "constants/items.h"

View File

@ -428,7 +428,7 @@ static u8 CopySectorSecurityByte(u16 sectorId, const struct SaveSectorLocation *
} }
else else
{ {
// Succeded // Succeeded
SetDamagedSectorBits(DISABLE, sector); SetDamagedSectorBits(DISABLE, sector);
return SAVE_STATUS_OK; return SAVE_STATUS_OK;
} }
@ -734,7 +734,7 @@ u8 HandleSavingData(u8 saveType)
WriteSaveSectorOrSlot(FULL_SAVE_SLOT, gRamSaveSectorLocations); WriteSaveSectorOrSlot(FULL_SAVE_SLOT, gRamSaveSectorLocations);
break; break;
case SAVE_LINK: case SAVE_LINK:
case SAVE_LINK2: case SAVE_EREADER: // Dummied, now duplicate of SAVE_LINK
// Used by link / Battle Frontier // Used by link / Battle Frontier
// Write only SaveBlocks 1 and 2 (skips the PC) // Write only SaveBlocks 1 and 2 (skips the PC)
CopyPartyAndObjectsToSave(); CopyPartyAndObjectsToSave();

View File

@ -44,7 +44,6 @@
#include "util.h" #include "util.h"
#include "window.h" #include "window.h"
#include "constants/contest.h" #include "constants/contest.h"
#include "constants/easy_chat.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/region_map_sections.h" #include "constants/region_map_sections.h"

View File

@ -29,7 +29,6 @@
#include "constants/layouts.h" #include "constants/layouts.h"
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/trainers.h" #include "constants/trainers.h"
#include "constants/easy_chat.h"
#include "constants/trainer_hill.h" #include "constants/trainer_hill.h"
#include "constants/trainer_types.h" #include "constants/trainer_types.h"