Merge pull request #1344 from GriffinRichards/doc-ec

Document easy chat and mail, script.c cleanup, add/use some general constants
This commit is contained in:
GriffinR 2021-02-28 10:26:49 -05:00 committed by GitHub
commit ea748ff7f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
152 changed files with 4272 additions and 3732 deletions

View File

@ -3,7 +3,6 @@
.include "asm/macros/movement.inc"
.include "asm/macros/window.inc"
.include "asm/macros/pokemon_data.inc"
.include "asm/macros/ec.inc"
.include "asm/macros/map.inc"
.include "asm/macros/field_effect_script.inc"
.include "asm/macros/trainer_hill.inc"

View File

@ -1,19 +0,0 @@
.macro ec_word word
.2byte EC_WORD_\word
.endm
.macro ec_move1 name
.2byte (EC_GROUP_MOVE_1 << 9) | MOVE_\name
.endm
.macro ec_move2 name
.2byte (EC_GROUP_MOVE_2 << 9) | MOVE_\name
.endm
.macro ec_pokemon1 name
.2byte (EC_GROUP_POKEMON << 9) | SPECIES_\name
.endm
.macro ec_pokemon2 name
.2byte (EC_GROUP_POKEMON2 << 9) | SPECIES_\name
.endm

View File

@ -624,15 +624,15 @@ DewfordTown_EventScript_RejectTrendyPhrase:: @ 81E9952
call Common_ShowEasyChatScreen
lock
faceplayer
compare VAR_RESULT, 1
compare VAR_RESULT, TRUE
goto_if_eq DewfordTown_EventScript_GiveNewTrendyPhrase
compare VAR_RESULT, 0
compare VAR_RESULT, FALSE
goto_if_eq DewfordTown_EventScript_CancelNewTrendyPhrase
end
DewfordTown_EventScript_GiveNewTrendyPhrase:: @ 81E997D
incrementgamestat GAME_STAT_STARTED_TRENDS
compare VAR_0x8004, 0
compare VAR_0x8004, FALSE
goto_if_eq DewfordTown_EventScript_PhraseNotTrendyEnough
msgbox DewfordTown_Text_OfCourseIKnowAboutThat, MSGBOX_DEFAULT
release

View File

@ -33,6 +33,12 @@ struct SpriteCopyRequest
u16 size;
};
struct OamDimensions32
{
s32 width;
s32 height;
};
struct OamDimensions
{
s8 width;
@ -240,25 +246,28 @@ static const AffineAnimCmdFunc sAffineAnimCmdFuncs[] =
AffineAnimCmd_frame,
};
static const s32 sUnknown_082EC6F4[3][4][2] =
static const struct OamDimensions32 sOamDimensions32[3][4] =
{
[ST_OAM_SQUARE] =
{
{8, 8},
{0x10, 0x10},
{0x20, 0x20},
{0x40, 0x40},
[SPRITE_SIZE(8x8)] = { 8, 8 },
[SPRITE_SIZE(16x16)] = { 16, 16 },
[SPRITE_SIZE(32x32)] = { 32, 32 },
[SPRITE_SIZE(64x64)] = { 64, 64 },
},
[ST_OAM_H_RECTANGLE] =
{
{0x10, 8},
{0x20, 8},
{0x20, 0x10},
{0x40, 0x20},
[SPRITE_SIZE(16x8)] = { 16, 8 },
[SPRITE_SIZE(32x8)] = { 32, 8 },
[SPRITE_SIZE(32x16)] = { 32, 16 },
[SPRITE_SIZE(64x32)] = { 64, 32 },
},
[ST_OAM_V_RECTANGLE] =
{
{8, 0x10},
{8, 0x20},
{0x10, 0x20},
{0x20, 0x40},
[SPRITE_SIZE(8x16)] = { 8, 16 },
[SPRITE_SIZE(8x32)] = { 8, 32 },
[SPRITE_SIZE(16x32)] = { 16, 32 },
[SPRITE_SIZE(32x64)] = { 32, 64 },
},
};
@ -1233,14 +1242,14 @@ void obj_update_pos2(struct Sprite *sprite, s32 a1, s32 a2)
u32 matrixNum = sprite->oam.matrixNum;
if (a1 != 0x800)
{
var0 = sUnknown_082EC6F4[sprite->oam.shape][sprite->oam.size][0];
var0 = sOamDimensions32[sprite->oam.shape][sprite->oam.size].width;
var1 = var0 << 8;
var2 = (var0 << 16) / gOamMatrices[matrixNum].a;
sprite->pos2.x = sub_8007E28(var1, var2, a1);
}
if (a2 != 0x800)
{
var0 = sUnknown_082EC6F4[sprite->oam.shape][sprite->oam.size][1];
var0 = sOamDimensions32[sprite->oam.shape][sprite->oam.size].height;
var1 = var0 << 8;
var2 = (var0 << 16) / gOamMatrices[matrixNum].d;
sprite->pos2.y = sub_8007E28(var1, var2, a2);

View File

@ -2,6 +2,7 @@
#define GUARD_SPRITE_H
#define MAX_SPRITES 64
#define SPRITE_NONE 0xFF
#define SPRITE_INVALID_TAG 0xFFFF
struct SpriteSheet

View File

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 419 B

View File

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 199 B

View File

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

View File

@ -28,29 +28,29 @@
#define EASY_CHAT_PERSON_BOY 2
#define EASY_CHAT_PERSON_DISPLAY_NONE 3
#define EC_GROUP_POKEMON 0x0
#define EC_GROUP_TRAINER 0x1
#define EC_GROUP_STATUS 0x2
#define EC_GROUP_BATTLE 0x3
#define EC_GROUP_GREETINGS 0x4
#define EC_GROUP_PEOPLE 0x5
#define EC_GROUP_VOICES 0x6
#define EC_GROUP_SPEECH 0x7
#define EC_GROUP_ENDINGS 0x8
#define EC_GROUP_FEELINGS 0x9
#define EC_GROUP_CONDITIONS 0xa
#define EC_GROUP_ACTIONS 0xb
#define EC_GROUP_LIFESTYLE 0xc
#define EC_GROUP_HOBBIES 0xd
#define EC_GROUP_TIME 0xe
#define EC_GROUP_MISC 0xf
#define EC_GROUP_ADJECTIVES 0x10
#define EC_GROUP_EVENTS 0x11
#define EC_GROUP_MOVE_1 0x12
#define EC_GROUP_MOVE_2 0x13
#define EC_GROUP_TRENDY_SAYING 0x14
#define EC_GROUP_POKEMON_2 0x15
#define EC_NUM_GROUPS 0x16
#define EC_GROUP_POKEMON 0
#define EC_GROUP_TRAINER 1
#define EC_GROUP_STATUS 2
#define EC_GROUP_BATTLE 3
#define EC_GROUP_GREETINGS 4
#define EC_GROUP_PEOPLE 5
#define EC_GROUP_VOICES 6
#define EC_GROUP_SPEECH 7
#define EC_GROUP_ENDINGS 8
#define EC_GROUP_FEELINGS 9
#define EC_GROUP_CONDITIONS 10
#define EC_GROUP_ACTIONS 11
#define EC_GROUP_LIFESTYLE 12
#define EC_GROUP_HOBBIES 13
#define EC_GROUP_TIME 14
#define EC_GROUP_MISC 15
#define EC_GROUP_ADJECTIVES 16
#define EC_GROUP_EVENTS 17
#define EC_GROUP_MOVE_1 18
#define EC_GROUP_MOVE_2 19
#define EC_GROUP_TRENDY_SAYING 20
#define EC_GROUP_POKEMON_NATIONAL 21
#define EC_NUM_GROUPS 22
// TRAINER
#define EC_WORD_I_CHOOSE_YOU (EC_GROUP_TRAINER << 9) | 0x0
@ -1105,13 +1105,22 @@
#define PHRASE_COOL_LATIOS 4
#define PHRASE_SUPER_HUSTLE 5
#define EC_NUM_ALPHABET_GROUPS 27 // 26 (1 for each letter) + 1 (Others)
#define EC_MAX_WORDS_IN_GROUP 270 // The closest is words by letter S, at 262
#define EC_MASK_GROUP 0x7F
#define EC_MASK_INDEX 0x1FF
#define EC_POKEMON(mon) ((EC_GROUP_POKEMON << 9) | SPECIES_##mon)
#define EC_POKEMON2(mon) ((EC_GROUP_POKEMON_2 << 9) | SPECIES_##mon)
#define EC_POKEMON_NATIONAL(mon) ((EC_GROUP_POKEMON_NATIONAL << 9) | SPECIES_##mon)
#define EC_MOVE(move) ((EC_GROUP_MOVE_1 << 9) | MOVE_##move)
#define EC_MOVE2(move) ((EC_GROUP_MOVE_2 << 9) | MOVE_##move)
#define EC_GROUP(word) ((word) >> 9)
#define EC_INDEX(word) ((word) & 0x1FF)
#define EC_WORD(group, index) ((((group) & 0x7F) << 9) | ((index) & 0x1FF))
#define EC_INDEX(word) ((word) & EC_MASK_INDEX)
#define EC_WORD(group, index) ((((group) & EC_MASK_GROUP) << 9) | ((index) & EC_MASK_INDEX))
#define EC_EMPTY_WORD 0xFFFF
#endif // GUARD_CONSTANTS_EASY_CHAT_H

View File

@ -84,6 +84,7 @@
#define MAIL_WORDS_COUNT 9
#define EASY_CHAT_BATTLE_WORDS_COUNT 6
#define MOVE_NAME_LENGTH 12
#define NUM_QUESTIONNAIRE_WORDS 4
#define MALE 0
#define FEMALE 1

View File

@ -495,7 +495,9 @@
#define NUM_ROUTE_114_MAN_BERRIES (LAST_ROUTE_114_MAN_BERRY - FIRST_ROUTE_114_MAN_BERRY + 1)
#define NUM_ROUTE_114_MAN_BERRIES_SKIPPED (FIRST_ROUTE_114_MAN_BERRY - FIRST_BERRY_INDEX)
#define ITEM_TO_BERRY(itemId)(((itemId - FIRST_BERRY_INDEX) + 1))
#define ITEM_TO_BERRY(itemId)(((itemId) - FIRST_BERRY_INDEX) + 1)
#define ITEM_TO_MAIL(itemId)((itemId) - FIRST_MAIL_INDEX)
#define MAIL_NONE 0xFF
#define NUM_TECHNICAL_MACHINES 50
#define NUM_HIDDEN_MACHINES 8

View File

@ -288,8 +288,6 @@
#define MAX_TOTAL_EVS 510
#define EV_ITEM_RAISE_LIMIT 100
#define UNOWN_FORM_COUNT 28
// Battle move flags
#define FLAG_MAKES_CONTACT (1 << 0)
#define FLAG_PROTECT_AFFECTED (1 << 1)

View File

@ -4,7 +4,7 @@
void InitDewfordTrend(void);
void UpdateDewfordTrendPerDay(u16);
void UpdateDewfordTrendPerDay(u16 days);
bool8 sub_81226D8(u16 *a);
bool8 IsPhraseTrendy(u16 *a);
void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused);

View File

@ -24,55 +24,55 @@ struct EasyChatScreen
/*0x01*/ u8 templateId;
/*0x02*/ u8 numColumns;
/*0x03*/ u8 numRows;
/*0x04*/ u8 state;
/*0x04*/ u8 inputState;
/*0x05*/ s8 mainCursorColumn;
/*0x06*/ s8 mainCursorRow;
/*0x07*/ u8 unk_07;
/*0x08*/ u8 stateBackup;
/*0x09*/ u8 unk_09;
/*0x0A*/ s8 unk_0a;
/*0x0B*/ s8 unk_0b;
/*0x0C*/ u8 unk_0c;
/*0x0D*/ u8 unk_0d;
/*0x0E*/ u8 unk_0e;
/*0x0F*/ u8 unk_0f;
/*0x10*/ s8 unk_10;
/*0x11*/ s8 unk_11;
/*0x07*/ u8 maxWords;
/*0x08*/ u8 inputStateBackup;
/*0x09*/ bool8 inAlphabetMode;
/*0x0A*/ s8 keyboardColumn;
/*0x0B*/ s8 keyboardRow;
/*0x0C*/ u8 keyboardScrollOffset;
/*0x0D*/ u8 keyboardLastRow;
/*0x0E*/ u8 wordSelectScrollOffset;
/*0x0F*/ u8 wordSelectLastRow;
/*0x10*/ s8 wordSelectColumn;
/*0x11*/ s8 wordSelectRow;
/*0x12*/ u8 displayedPersonType;
/*0x13*/ u8 unk_13;
/*0x14*/ u8 unk_14[0x20];
/*0x13*/ u8 unused; // Set to 0, never read
/*0x14*/ u8 quizTitle[32];
/*0x34*/ const u8 *titleText;
/*0x38*/ u16 *words;
/*0x3C*/ u16 ecWordBuffer[9];
/*0x38*/ u16 *savedPhrase;
/*0x3C*/ u16 currentPhrase[9];
};
struct Unk203A11C
struct EasyChatScreenControl
{
u16 unk0;
u16 funcState;
u16 windowId;
u16 unk4;
u8 unk6;
u8 unk7;
s8 unk8;
u8 unk9;
u8 unkA;
u8 unkB[0xC1];
u8 unkCC[0x202];
u16 unk2CE;
int unk2D0;
int unk2D4;
struct Sprite *unk2D8;
struct Sprite *unk2DC;
struct Sprite *unk2E0;
struct Sprite *unk2E4;
struct Sprite *unk2E8;
struct Sprite *unk2EC;
struct Sprite *unk2F0;
struct Sprite *unk2F4;
struct Sprite *unk2F8;
struct Sprite *unk2FC;
u16 unk300[BG_SCREEN_SIZE / 2];
u16 unkB00[BG_SCREEN_SIZE / 2];
u16 currentFuncId;
u8 curWindowAnimState;
u8 destWindowAnimState;
s8 windowAnimStateDir;
u8 modeWindowState;
bool8 fourFooterOptions; // Never read (template is used directly instead)
u8 phrasePrintBuffer[193];
u8 wordSelectPrintBuffer[514];
u16 scrollOffset;
int scrollDest;
int scrollSpeed;
struct Sprite *mainCursorSprite;
struct Sprite *rectangleCursorSpriteRight;
struct Sprite *rectangleCursorSpriteLeft;
struct Sprite *wordSelectCursorSprite;
struct Sprite *buttonWindowSprite;
struct Sprite *modeWindowSprite;
struct Sprite *scrollIndicatorUpSprite;
struct Sprite *scrollIndicatorDownSprite;
struct Sprite *startButtonSprite;
struct Sprite *selectButtonSprite;
u16 bg1TilemapBuffer[BG_SCREEN_SIZE / 2];
u16 bg3TilemapBuffer[BG_SCREEN_SIZE / 2];
};
struct EasyChatPhraseFrameDimensions
@ -104,15 +104,15 @@ struct EasyChatGroup
u16 numEnabledWords;
};
struct Unk203A120
struct EasyChatScreenWordData
{
u16 unk0;
u16 unk2[EC_NUM_GROUPS];
u16 unk2E[27];
u16 unk64[27][270];
u8 filler3958[0x2C];
u16 unk3984[0x10E];
u16 unk3BA0;
u16 numUnlockedGroups;
u16 unlockedGroupIds[EC_NUM_GROUPS];
u16 numUnlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS];
u16 unlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS][EC_MAX_WORDS_IN_GROUP];
u8 unused[44];
u16 selectedGroupWords[EC_MAX_WORDS_IN_GROUP];
u16 numSelectedGroupWords;
}; /*size = 0x3BA4*/
struct EasyChatWordsByLetter
@ -124,7 +124,7 @@ struct EasyChatWordsByLetter
void InitEasyChatPhrases(void);
void ShowEasyChatScreen(void);
u8 * CopyEasyChatWord(u8 *dest, u16 word);
bool32 sub_811F8D8(int word);
bool32 IsEasyChatAnswerUnlocked(int word);
void InitializeEasyChatWordArray(u16 *words, u16 length);
u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows);
bool8 IsBardWordInvalid(u16 word);
@ -133,7 +133,7 @@ u16 GetNewHipsterPhraseToTeach(void);
u16 EasyChat_GetNumWordsInGroup(u8);
u16 GetRandomEasyChatWordFromUnlockedGroup(u16);
void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType);
void sub_811F8BC(void);
void InitQuestionnaireWords(void);
void UnlockAdditionalPhrase(u8 additionalPhraseId);
#endif // GUARD_EASYCHAT_H

View File

@ -893,7 +893,7 @@ struct MysteryEventStruct
/*0x000 0x322C*/ struct WonderNewsSaveStruct wonderNews;
/*0x1c0 0x33EC*/ struct WonderCardSaveStruct wonderCard;
/*0x310 0x353C*/ struct MEventBuffer_3430 buffer_310;
/*0x338 0x3564*/ u16 unk_338[4];
/*0x338 0x3564*/ u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS];
/*0x340 0x356C*/ struct MysteryEventStruct unk_340;
/*0x344 0x3570*/ u32 unk_344[2][5];
}; // 0x36C 0x3598

View File

@ -4977,10 +4977,10 @@ extern const u32 gEasyChatWindow_Gfx[];
extern const u32 gEasyChatWindow_Tilemap[];
extern const u32 gEasyChatMode_Gfx[];
extern const u16 gEasyChatMode_Pal[];
extern const u32 gEasyChatCursor_Gfx[];
extern const u16 gEasyChatCursor_Pal[];
extern const u32 gEasyChatRightWindow_Gfx[];
extern const u16 gEasyChatRightWindow_Pal[];
extern const u32 gEasyChatRectangleCursor_Gfx[];
extern const u16 gEasyChatRectangleCursor_Pal[];
extern const u32 gEasyChatButtonWindow_Gfx[];
extern const u16 gEasyChatButtonWindow_Pal[];
// Use Pokeblock
extern const u32 gUsePokeblockCondition_Gfx[];
@ -5025,4 +5025,42 @@ extern const u16 gObjectEventPal_May[];
extern const u16 gObjectEventPal_RubySapphireBrendan[];
extern const u16 gObjectEventPal_RubySapphireMay[];
// Mail
extern const u16 gMailPalette_Orange[];
extern const u16 gMailPalette_Harbor[];
extern const u16 gMailPalette_Glitter[];
extern const u16 gMailPalette_Mech[];
extern const u16 gMailPalette_Wood[];
extern const u16 gMailPalette_Wave[];
extern const u16 gMailPalette_Bead[];
extern const u16 gMailPalette_Shadow[];
extern const u16 gMailPalette_Tropic[];
extern const u16 gMailPalette_Dream[];
extern const u16 gMailPalette_Fab[];
extern const u16 gMailPalette_Retro[];
extern const u8 gMailTiles_Orange[];
extern const u8 gMailTilemap_Orange[];
extern const u8 gMailTiles_Harbor[];
extern const u8 gMailTilemap_Harbor[];
extern const u8 gMailTiles_Glitter[];
extern const u8 gMailTilemap_Glitter[];
extern const u8 gMailTiles_Mech[];
extern const u8 gMailTilemap_Mech[];
extern const u8 gMailTiles_Wood[];
extern const u8 gMailTilemap_Wood[];
extern const u8 gMailTiles_Wave[];
extern const u8 gMailTilemap_Wave[];
extern const u8 gMailTiles_Bead[];
extern const u8 gMailTilemap_Bead[];
extern const u8 gMailTiles_Shadow[];
extern const u8 gMailTilemap_Shadow[];
extern const u8 gMailTiles_Tropic[];
extern const u8 gMailTilemap_Tropic[];
extern const u8 gMailTiles_Dream[];
extern const u8 gMailTilemap_Dream[];
extern const u8 gMailTiles_Fab[];
extern const u8 gMailTilemap_Fab[];
extern const u8 gMailTiles_Retro[];
extern const u8 gMailTilemap_Retro[];
#endif //GUARD_GRAPHICS_H

View File

@ -4,7 +4,7 @@
#include "menu.h"
#include "list_menu.h"
void sub_81DB52C(u8 *src);
void ConvertInternationalPlayerName(u8 *src);
void TVShowConvertInternationalString(u8 *dest, const u8 *src, int language);
int GetStringCenterAlignXOffset(int fontId, const u8 *str, int totalWidth);
int GetStringRightAlignXOffset(int fontId, const u8 *str, int totalWidth);
@ -16,7 +16,7 @@ int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu);
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 sub_81DB554(u8 *, u8);
void ConvertInternationalPlayerNameStripChar(u8 *, u8);
void sub_81DB5AC(u8 *);
int sub_81DB604(u8 *);
void sub_81DB620(int windowId, int columnStart, int rowStart, int numFillTiles, int numRows);

View File

@ -21,7 +21,7 @@ struct MEventStruct_Unk1442CC
u16 unk_0C;
u32 unk_10;
u16 unk_14;
u16 unk_16[4];
u16 unk_16[NUM_QUESTIONNAIRE_WORDS];
struct MEventBuffer_3430_Sub unk_20;
u8 unk_44;
u8 unk_45[7];
@ -36,7 +36,7 @@ struct WonderNews *GetSavedWonderNews(void);
struct WonderCard *GetSavedWonderCard(void);
struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void);
struct MysteryEventStruct *sub_801B044(void);
u16 *sub_801B058(void);
u16 *GetQuestionnaireWordsPtr(void);
void DestroyWonderNews(void);
bool32 sub_801B078(const struct WonderNews *src);
bool32 ValidateReceivedWonderNews(void);

View File

@ -14,6 +14,10 @@
#define PALETTE_FADE_STATUS_DONE 0
#define PALETTE_FADE_STATUS_LOADING 0xFF
#define PALETTES_BG 0x0000FFFF
#define PALETTES_OBJECTS 0xFFFF0000
#define PALETTES_ALL (PALETTES_BG | PALETTES_OBJECTS)
enum
{
FAST_FADE_IN_FROM_WHITE,

View File

@ -73,7 +73,7 @@ struct PlayerPCItemPageStruct
u8 pageItems;
u8 count;
u8 filler[3];
u8 scrollIndicatorId;
u8 scrollIndicatorTaskId;
};
// Exported type declarations

View File

@ -10,14 +10,14 @@ const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo);
const u16 *GetValidMonIconPalettePtr(u16 speciesId);
u16 GetIconSpecies(u16 species, u32 personality);
u16 GetUnownLetterByPersonality(u32 personality);
u16 sub_80D2E84(u16 speciesId);
u16 GetIconSpeciesNoPersonality(u16 speciesId);
void LoadMonIconPalettes(void);
void LoadMonIconPalette(u16 species);
void FreeMonIconPalettes(void);
u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 extra);
u8 CreateMonIconNoPersonality(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 handleDeoxys);
void FreeMonIconPalette(u16 species);
void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 extra);
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 handleDeoxys);
u8 UpdateMonIconFrame(struct Sprite *sprite);
void LoadMonIconPalette(u16 species);
void sub_80D328C(struct Sprite *sprite);

View File

@ -26,8 +26,6 @@ u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr);
void SetupNativeScript(struct ScriptContext *ctx, bool8 (*ptr)(void));
void StopScript(struct ScriptContext *ctx);
bool8 RunScriptCommand(struct ScriptContext *ctx);
u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr);
const u8 *ScriptPop(struct ScriptContext *ctx);
void ScriptJump(struct ScriptContext *ctx, const u8 *ptr);
void ScriptCall(struct ScriptContext *ctx, const u8 *ptr);
void ScriptReturn(struct ScriptContext *ctx);

View File

@ -3,6 +3,7 @@
#define HEAD_SENTINEL 0xFE
#define TAIL_SENTINEL 0xFF
#define TASK_NONE TAIL_SENTINEL
#define NUM_TASKS 16
#define NUM_TASK_DATA 16

View File

@ -144,7 +144,7 @@ void ResetApprenticeStruct(struct Apprentice *apprentice)
u8 i;
for (i = 0; i < ARRAY_COUNT(apprentice->speechWon); i++)
apprentice->speechWon[i] = 0xFFFF;
apprentice->speechWon[i] = EC_EMPTY_WORD;
apprentice->playerName[0] = EOS;
apprentice->id = NUM_APPRENTICES;
@ -158,7 +158,7 @@ void ResetAllApprenticeData(void)
for (i = 0; i < APPRENTICE_COUNT; i++)
{
for (j = 0; j < ARRAY_COUNT(gSaveBlock2Ptr->apprentices[i].speechWon); j++)
gSaveBlock2Ptr->apprentices[i].speechWon[j] = 0xFFFF;
gSaveBlock2Ptr->apprentices[i].speechWon[j] = EC_EMPTY_WORD;
gSaveBlock2Ptr->apprentices[i].id = NUM_APPRENTICES;
gSaveBlock2Ptr->apprentices[i].playerName[0] = EOS;
gSaveBlock2Ptr->apprentices[i].lvlMode = 0;

View File

@ -28,7 +28,7 @@ const struct BardSound *GetWordSounds(u16 word)
switch (category)
{
case EC_GROUP_POKEMON:
case EC_GROUP_POKEMON_2:
case EC_GROUP_POKEMON_NATIONAL:
ptr = gBardSounds_Pokemon;
break;
case EC_GROUP_MOVE_1:

View File

@ -1814,8 +1814,8 @@ void ClearBattleAnimationVars(void)
for (i = 0; i < ANIM_ARGS_COUNT; i++)
gBattleAnimArgs[i] = 0;
sMonAnimTaskIdArray[0] = 0xFF;
sMonAnimTaskIdArray[1] = 0xFF;
sMonAnimTaskIdArray[0] = TASK_NONE;
sMonAnimTaskIdArray[1] = TASK_NONE;
gAnimMoveTurn = 0;
sAnimBackgroundFadeState = 0;
sAnimMoveIndex = 0;
@ -1861,8 +1861,8 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
for (i = 0; i < ANIM_ARGS_COUNT; i++)
gBattleAnimArgs[i] = 0;
sMonAnimTaskIdArray[0] = 0xFF;
sMonAnimTaskIdArray[1] = 0xFF;
sMonAnimTaskIdArray[0] = TASK_NONE;
sMonAnimTaskIdArray[1] = TASK_NONE;
sBattleAnimScriptPtr = animsTable[tableId];
gAnimScriptActive = TRUE;
gAnimFramesToWait = 0;
@ -2106,7 +2106,7 @@ static void ScriptCmd_end(void)
// Keep waiting as long as there are animations to be done.
if (gAnimVisualTaskCount != 0 || gAnimSoundTaskCount != 0
|| sMonAnimTaskIdArray[0] != 0xFF || sMonAnimTaskIdArray[1] != 0xFF)
|| sMonAnimTaskIdArray[0] != TASK_NONE || sMonAnimTaskIdArray[1] != TASK_NONE)
{
sSoundAnimFramesToWait = 0;
gAnimFramesToWait = 1;
@ -2482,9 +2482,9 @@ static void ScriptCmd_clearmonbg(void)
else
battlerId = gBattleAnimTarget;
if (sMonAnimTaskIdArray[0] != 0xFF)
if (sMonAnimTaskIdArray[0] != TASK_NONE)
gSprites[gBattlerSpriteIds[battlerId]].invisible = FALSE;
if (animBattlerId > 1 && sMonAnimTaskIdArray[1] != 0xFF)
if (animBattlerId > 1 && sMonAnimTaskIdArray[1] != TASK_NONE)
gSprites[gBattlerSpriteIds[battlerId ^ BIT_FLANK]].invisible = FALSE;
else
animBattlerId = 0;
@ -2508,17 +2508,17 @@ static void sub_80A4980(u8 taskId)
else
to_BG2 = TRUE;
if (sMonAnimTaskIdArray[0] != 0xFF)
if (sMonAnimTaskIdArray[0] != TASK_NONE)
{
sub_80A477C(to_BG2);
DestroyTask(sMonAnimTaskIdArray[0]);
sMonAnimTaskIdArray[0] = 0xFF;
sMonAnimTaskIdArray[0] = TASK_NONE;
}
if (gTasks[taskId].data[0] > 1)
{
sub_80A477C(to_BG2 ^ 1);
DestroyTask(sMonAnimTaskIdArray[1]);
sMonAnimTaskIdArray[1] = 0xFF;
sMonAnimTaskIdArray[1] = TASK_NONE;
}
DestroyTask(taskId);
}
@ -3362,7 +3362,7 @@ static void ScriptCmd_invisible(void)
u8 spriteId;
spriteId = GetAnimBattlerSpriteId(sBattleAnimScriptPtr[1]);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
gSprites[spriteId].invisible = TRUE;
sBattleAnimScriptPtr += 2;
@ -3373,7 +3373,7 @@ static void ScriptCmd_visible(void)
u8 spriteId;
spriteId = GetAnimBattlerSpriteId(sBattleAnimScriptPtr[1]);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
gSprites[spriteId].invisible = FALSE;
sBattleAnimScriptPtr += 2;
@ -3400,7 +3400,7 @@ static void ScriptCmd_doublebattle_2D(void)
r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget);
spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
}
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
{
gSprites[spriteId].invisible = FALSE;
if (r4 == 2)
@ -3436,7 +3436,7 @@ static void ScriptCmd_doublebattle_2E(void)
spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
}
if (spriteId != 0xFF && r4 == 2)
if (spriteId != SPRITE_NONE && r4 == 2)
gSprites[spriteId].oam.priority = 2;
}
}

View File

@ -764,7 +764,7 @@ static void sub_8114374(u8 priority)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
u8 spriteId = GetAnimBattlerSpriteId(i);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
gSprites[spriteId].oam.priority = priority;
}
}
@ -960,7 +960,7 @@ void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId)
calcSpriteId = TRUE;
break;
default:
spriteId = 0xFF;
spriteId = SPRITE_NONE;
break;
}
@ -970,10 +970,10 @@ void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId)
if (IsBattlerSpriteVisible(battler))
spriteId = gBattlerSpriteIds[battler];
else
spriteId = 0xFF;
spriteId = SPRITE_NONE;
}
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, gBattleAnimArgs[1]);
DestroyAnimVisualTask(taskId);

View File

@ -603,7 +603,7 @@ void AnimTask_HorizontalShake(u8 taskId)
break;
default: // Shake specific battler
task->tbattlerSpriteIds(0) = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
if (task->tbattlerSpriteIds(0) == 0xFF)
if (task->tbattlerSpriteIds(0) == SPRITE_NONE)
{
DestroyAnimVisualTask(taskId);
}

View File

@ -94,7 +94,7 @@ void AnimTask_ShakeMon(u8 taskId)
{
u8 spriteId;
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
if (spriteId == 0xff)
if (spriteId == SPRITE_NONE)
{
DestroyAnimVisualTask(taskId);
return;
@ -162,7 +162,7 @@ void AnimTask_ShakeMon2(u8 taskId)
if (gBattleAnimArgs[0] < MAX_BATTLERS_COUNT)
{
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
if (spriteId == 0xff)
if (spriteId == SPRITE_NONE)
{
DestroyAnimVisualTask(taskId);
return;
@ -255,7 +255,7 @@ static void AnimTask_ShakeMon2_Step(u8 taskId)
void AnimTask_ShakeMonInPlace(u8 taskId)
{
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
if (spriteId == 0xff)
if (spriteId == SPRITE_NONE)
{
DestroyAnimVisualTask(taskId);
return;

View File

@ -1569,7 +1569,7 @@ s16 CloneBattlerSpriteWithBlend(u8 animBattler)
u16 i;
u8 spriteId = GetAnimBattlerSpriteId(animBattler);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
{
for (i = 0; i < MAX_SPRITES; i++)
{
@ -1655,7 +1655,7 @@ static void AnimTask_AlphaFadeIn_Step(u8 taskId)
void AnimTask_BlendMonInAndOut(u8 task)
{
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
if (spriteId == 0xff)
if (spriteId == SPRITE_NONE)
{
DestroyAnimVisualTask(task);
return;

View File

@ -731,7 +731,7 @@ static void AnimRolloutParticle(struct Sprite *sprite)
if (TranslateAnimHorizontalArc(sprite))
{
u8 taskId = FindTaskIdByFunc(AnimTask_Rollout_Step);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
gTasks[taskId].data[11]--;
DestroySprite(sprite);

View File

@ -1260,14 +1260,14 @@ static void AnimTask_WaterSpoutRain_Step(u8 taskId)
gBattleAnimArgs[1] = 0;
gBattleAnimArgs[2] = 12;
taskId2 = CreateTask(AnimTask_HorizontalShake, 80);
if (taskId2 != 0xFF)
if (taskId2 != TASK_NONE)
{
gTasks[taskId2].func(taskId2);
gAnimVisualTaskCount++;
}
gBattleAnimArgs[0] = ANIM_DEF_PARTNER;
taskId2 = CreateTask(AnimTask_HorizontalShake, 80);
if (taskId2 != 0xFF)
if (taskId2 != TASK_NONE)
{
gTasks[taskId2].func(taskId2);
gAnimVisualTaskCount++;

View File

@ -2434,7 +2434,7 @@ static void PlayerHandleFaintAnimation(void)
static void PlayerHandlePaletteFade(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 2, 0, 16, RGB_BLACK);
PlayerBufferExecCompleted();
}
@ -2655,7 +2655,7 @@ static void PlayerHandleChooseItem(void)
{
s32 i;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenBagAndChooseItem;
gBattlerInMenuId = gActiveBattler;
@ -2682,7 +2682,7 @@ static void PlayerHandleChoosePokemon(void)
*(&gBattleStruct->battlerPreventingSwitchout) = gBattleBufferA[gActiveBattler][1] >> 4;
*(&gBattleStruct->prevSelectedPartySlot) = gBattleBufferA[gActiveBattler][2];
*(&gBattleStruct->abilityPreventingSwitchout) = gBattleBufferA[gActiveBattler][3];
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon;
gBattlerInMenuId = gActiveBattler;
}
@ -2691,7 +2691,7 @@ static void PlayerHandleChoosePokemon(void)
static void PlayerHandleCmd23(void)
{
BattleStopLowHpSound();
BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 2, 0, 16, RGB_BLACK);
PlayerBufferExecCompleted();
}

View File

@ -474,7 +474,7 @@ static void SafariHandleChooseMove(void)
static void SafariHandleChooseItem(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = SafariOpenPokeblockCase;
gBattlerInMenuId = gActiveBattler;
}

View File

@ -1250,7 +1250,7 @@ static void WallyHandleChooseMove(void)
static void WallyHandleChooseItem(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenBagAfterPaletteFade;
gBattlerInMenuId = gActiveBattler;
}

View File

@ -3040,7 +3040,7 @@ static void Task_ShowTourneyInfoCard(u8 taskId)
SetVBlankCallback(VblankCb_TourneyInfoCard);
sInfoCard = AllocZeroed(sizeof(*sInfoCard));
for (i = 0; i < NUM_INFOCARD_SPRITES; i++)
sInfoCard->spriteIds[i] = 0xFF;
sInfoCard->spriteIds[i] = SPRITE_NONE;
LoadMonIconPalettes();
i = CreateTask(Task_HandleInfoCardInput, 0);
gTasks[i].data[0] = 0;
@ -3105,7 +3105,7 @@ static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
{
if (sprite->pos1.y >= 192)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyTrainerPicSprite(sprite->data[3]);
}
}
@ -3125,7 +3125,7 @@ static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
{
if (sprite->pos1.y <= -32)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyTrainerPicSprite(sprite->data[3]);
}
}
@ -3145,7 +3145,7 @@ static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
{
if (sprite->pos1.x >= 272)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyTrainerPicSprite(sprite->data[3]);
}
}
@ -3165,7 +3165,7 @@ static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
{
if (sprite->pos1.x <= -32)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyTrainerPicSprite(sprite->data[3]);
}
}
@ -3195,7 +3195,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
{
if (sprite->pos1.y >= 176)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyMonIconSprite(sprite);
}
}
@ -3217,7 +3217,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
{
if (sprite->pos1.y <= -16)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyMonIconSprite(sprite);
}
}
@ -3239,7 +3239,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
{
if (sprite->pos1.x >= 256)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyMonIconSprite(sprite);
}
}
@ -3261,7 +3261,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
{
if (sprite->pos1.x <= -16)
{
sInfoCard->spriteIds[sprite->data[2]] = 0xFF;
sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE;
FreeAndDestroyMonIconSprite(sprite);
}
}
@ -3393,7 +3393,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
case STATE_FADE_IN:
if (!gPaletteFade.active)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gTasks[taskId].tState = STATE_WAIT_FADE;
}
break;
@ -3406,7 +3406,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
switch (i)
{
case INFOCARD_INPUT_AB:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState = STATE_CLOSE_CARD;
break;
case TRAINERCARD_INPUT_UP ... TRAINERCARD_INPUT_RIGHT:
@ -3500,7 +3500,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 2)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3511,7 +3511,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3524,7 +3524,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 10)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3535,7 +3535,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3616,7 +3616,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 2)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3627,7 +3627,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3640,7 +3640,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 10)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3651,7 +3651,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3699,7 +3699,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 2)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3710,7 +3710,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3723,7 +3723,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 10)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3734,7 +3734,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3782,7 +3782,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 2)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3793,7 +3793,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3806,7 +3806,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 10)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3817,7 +3817,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3863,7 +3863,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 2)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3874,7 +3874,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3887,7 +3887,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 10)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3898,7 +3898,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3946,7 +3946,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 2)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3957,7 +3957,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
@ -3970,7 +3970,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 10)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -3981,7 +3981,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
@ -4051,12 +4051,12 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 2)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
FreeAndDestroyTrainerPicSprite(sInfoCard->spriteIds[i]);
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
FreeAndDestroyMonIconSprite(&gSprites[sInfoCard->spriteIds[i]]);
}
}
@ -4064,12 +4064,12 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (i < 10)
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
FreeAndDestroyTrainerPicSprite(sInfoCard->spriteIds[i]);
}
else
{
if (sInfoCard->spriteIds[i] != 0xFF)
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
FreeAndDestroyMonIconSprite(&gSprites[sInfoCard->spriteIds[i]]);
}
}
@ -4946,7 +4946,7 @@ static void Task_HandleTourneyTreeInput(u8 taskId)
case STATE_FADE_IN:
if (!gPaletteFade.active)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gTasks[taskId].tState = STATE_WAIT_FADE;
StartSpriteAnim(&gSprites[spriteId], 1);
}
@ -4960,17 +4960,17 @@ static void Task_HandleTourneyTreeInput(u8 taskId)
{
case TOURNEY_TREE_SELECTED_CLOSE:
default:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState = STATE_CLOSE_TOURNEY_TREE;
break;
case TOURNEY_TREE_NO_SELECTION:
break;
case TOURNEY_TREE_SELECTED_TRAINER:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState = STATE_SHOW_INFOCARD_TRAINER;
break;
case TOURNEY_TREE_SELECTED_MATCH:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState = STATE_SHOW_INFOCARD_MATCH;
break;
}
@ -5509,7 +5509,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId)
switch (gTasks[taskId].tState)
{
case STATE_FADE_IN:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gTasks[taskId].tState = STATE_SHOW_RESULTS;
break;
case STATE_SHOW_RESULTS:
@ -5559,7 +5559,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId)
case STATE_WAIT_FOR_INPUT:
if (JOY_NEW(A_BUTTON | B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState = STATE_CLOSE_TOURNEY_TREE;
}
break;

View File

@ -1203,7 +1203,7 @@ static void CB2_InitSelectScreen(void)
ShowBg(0);
ShowBg(1);
SetVBlankCallback(VBlankCB_SelectScreen);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_OBJ_1D_MAP);
#ifdef UBFIX
if (sFactorySelectScreen && sFactorySelectScreen->fromSummaryScreen)
@ -1451,7 +1451,7 @@ static void Select_Task_OpenSummaryScreen(u8 taskId)
{
case STATE_SUMMARY_FADE:
gPlttBufferUnfaded[228] = gPlttBufferFaded[228];
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].tState = STATE_SUMMARY_CLEAN;
break;
case STATE_SUMMARY_CLEAN:
@ -1489,7 +1489,7 @@ static void Select_Task_Exit(u8 taskId)
switch (gTasks[taskId].tState)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].tState++;
break;
case 1:
@ -2369,7 +2369,7 @@ static void Swap_Task_OpenSummaryScreen(u8 taskId)
switch (gTasks[taskId].tState)
{
case STATE_SUMMARY_FADE:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].tState = STATE_SUMMARY_CLEAN;
break;
case STATE_SUMMARY_CLEAN:
@ -2425,7 +2425,7 @@ static void Swap_Task_Exit(u8 taskId)
gTasks[taskId].tState++;
break;
case 2:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].tState++;
break;
case 3:
@ -3381,7 +3381,7 @@ static void CB2_InitSwapScreen(void)
gMain.state++;
break;
case 14:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
ShowBg(0);
ShowBg(1);

View File

@ -1841,7 +1841,7 @@ void BattleMainCB2(void)
{
gSpecialVar_Result = gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED;
ResetPaletteFadeControl();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
SetMainCallback2(CB2_QuitRecordedBattle);
}
}
@ -2242,7 +2242,7 @@ static void EndLinkBattleInSteps(void)
case 1:
if (--gBattleCommunication[1] == 0)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
@ -2299,7 +2299,7 @@ static void EndLinkBattleInSteps(void)
for (i = 0; i < 2; i++)
LoadChosenBattleElement(i);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gBattleCommunication[MULTIUSE_STATE]++;
break;
case 4:
@ -2404,7 +2404,7 @@ static void sub_80392A8(void)
gReservedSpritePaletteCount = 4;
SetVBlankCallback(VBlankCB_Battle);
SetMainCallback2(sub_803937C);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gBattleCommunication[MULTIUSE_STATE] = 0;
}
@ -2564,7 +2564,7 @@ static void sub_803939C(void)
{
if (IsLinkTaskFinished() == TRUE)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattleCommunication[1] = 0x20;
gBattleCommunication[MULTIUSE_STATE] = 8;
}
@ -2572,7 +2572,7 @@ static void sub_803939C(void)
}
else
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattleCommunication[1] = 0x20;
gBattleCommunication[MULTIUSE_STATE] = 8;
}

View File

@ -428,32 +428,32 @@ static const u16 sNPCSpeeches[][EASY_CHAT_BATTLE_WORDS_COUNT] =
{EC_WORD_DID, EC_WORD_YOU, EC_WORD_MAKE, EC_WORD_A, EC_WORD_MISTAKE, EC_WORD_QUES},
{EC_WORD_IT_S, EC_WORD_MEAN, EC_WORD_AND, EC_WORD_AWFUL, EC_WORD_IN, EC_WORD_HERE},
{EC_WORD_I_AM, EC_WORD_SO, EC_WORD_TIRED, EC_WORD_OF, EC_WORD_THIS, EC_WORD_PLACE},
{EC_WORD_I, EC_WORD_QUITE, EC_WORD_ENJOY, EC_WORD_THIS, EC_WORD_CHALLENGE, 0xFFFF},
{EC_WORD_I, EC_WORD_QUITE, EC_WORD_ENJOY, EC_WORD_THIS, EC_WORD_CHALLENGE, EC_EMPTY_WORD},
{EC_WORD_LOOK, EC_WORD_AT, EC_WORD_HOW, EC_WORD_I, EC_MOVE2(TACKLE), EC_WORD_THIS},
{EC_WORD_READY, EC_WORD_TO, EC_WORD_GIVE_UP, EC_WORD_YET, EC_WORD_QUES, 0xFFFF},
{EC_WORD_READY, EC_WORD_TO, EC_WORD_GIVE_UP, EC_WORD_YET, EC_WORD_QUES, EC_EMPTY_WORD},
{EC_WORD_OH, EC_WORD_NO, EC_WORD_WHO, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_QUES},
{EC_WORD_I_VE, EC_WORD_BEEN, EC_WORD_WANDERING, EC_WORD_ABOUT, EC_WORD_FOREVER, EC_WORD_ELLIPSIS},
{EC_WORD_I, EC_WORD_THINK, EC_WORD_I, EC_WORD_WILL, EC_WORD_GIVE_UP, 0xFFFF},
{EC_WORD_I, EC_WORD_THINK, EC_WORD_I, EC_WORD_WILL, EC_WORD_GIVE_UP, EC_EMPTY_WORD},
{EC_WORD_WHAT, EC_WORD_SHOULD, EC_WORD_I, EC_WORD_DO, EC_WORD_NEXT, EC_WORD_QUES},
{EC_WORD_I, EC_WORD_CAN_WIN, EC_WORD_WITH, EC_WORD_MY, EC_MOVE(SHEER_COLD), EC_WORD_GENIUS},
{EC_WORD_WON_T, EC_WORD_SOMEONE, EC_WORD_COOL, EC_WORD_SHOW, EC_WORD_UP, EC_WORD_QUES},
{EC_WORD_BATTLE, EC_WORD_GAME, EC_WORD_IS, EC_WORD_AWESOME, EC_WORD_EXCL, 0xFFFF},
{EC_WORD_BATTLE, EC_WORD_GAME, EC_WORD_IS, EC_WORD_AWESOME, EC_WORD_EXCL, EC_EMPTY_WORD},
{EC_WORD_I, EC_WORD_CAN_T, EC_WORD_TAKE, EC_WORD_THIS, EC_WORD_ANY, EC_WORD_MORE},
{EC_WORD_I, EC_WORD_DON_T, EC_WORD_KNOW, EC_WORD_IF, EC_WORD_IT_S, EC_WORD_OKAY},
{EC_WORD_OH, EC_WORD_NO, EC_WORD_EXCL, EC_WORD_NOT, EC_WORD_ANOTHER, EC_WORD_TRAINER},
{EC_WORD_IT, EC_WORD_HAS, EC_WORD_TO, EC_WORD_BE, EC_WORD_LEFT, EC_WORD_NEXT},
{EC_WORD_IT, EC_WORD_MUST_BE, EC_WORD_OVER, EC_WORD_SOON, EC_WORD_RIGHT, EC_WORD_QUES},
{EC_WORD_THIS, EC_WORD_IS, EC_WORD_TOTALLY, EC_WORD_EASY, EC_WORD_ISN_T_IT_QUES, 0xFFFF},
{EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_TO, EC_WORD_POWER, EC_WORD_ON, 0xFFFF},
{EC_WORD_THIS, EC_WORD_IS, EC_WORD_TOTALLY, EC_WORD_EASY, EC_WORD_ISN_T_IT_QUES, EC_EMPTY_WORD},
{EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_TO, EC_WORD_POWER, EC_WORD_ON, EC_EMPTY_WORD},
{EC_WORD_THERE, EC_WORD_IS, EC_WORD_NO, EC_WORD_GIVE_UP, EC_WORD_IN, EC_WORD_ME},
{EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_GOING, EC_WORD_TO, EC_WORD_MAKE, EC_WORD_IT},
{EC_WORD_GO, EC_WORD_ON, EC_WORD_I, EC_WORD_CAN_T, EC_WORD_ANY, EC_WORD_MORE},
{EC_WORD_A, EC_WORD_TRAINER, EC_WORD_AFTER, EC_WORD_ANOTHER, EC_WORD_ELLIPSIS, 0xFFFF},
{EC_WORD_A, EC_WORD_TRAINER, EC_WORD_AFTER, EC_WORD_ANOTHER, EC_WORD_ELLIPSIS, EC_EMPTY_WORD},
{EC_WORD_DO, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_STEEL, EC_WORD_POKEMON, EC_WORD_QUES},
{EC_WORD_EVERY, EC_WORD_TRAINER, EC_WORD_HERE, EC_WORD_IS, EC_WORD_TOO_WEAK, 0xFFFF},
{EC_WORD_EVERY, EC_WORD_TRAINER, EC_WORD_HERE, EC_WORD_IS, EC_WORD_TOO_WEAK, EC_EMPTY_WORD},
{EC_WORD_YOU, EC_WORD_THINK, EC_WORD_THIS, EC_WORD_IS, EC_WORD_EASY, EC_WORD_QUES},
{EC_WORD_WHAT, EC_WORD_WILL, EC_WORD_COME, EC_WORD_AFTER, EC_WORD_THIS, EC_WORD_QUES},
{EC_WORD_I_AM, EC_WORD_JUST, EC_WORD_SO, EC_WORD_CONFUSED, EC_WORD_EXCL, 0xFFFF},
{EC_WORD_I_AM, EC_WORD_JUST, EC_WORD_SO, EC_WORD_CONFUSED, EC_WORD_EXCL, EC_EMPTY_WORD},
{EC_WORD_I, EC_WORD_JUST, EC_WORD_WANT, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_ELLIPSIS},
{EC_WORD_YEEHAW_EXCL, EC_WORD_THIS, EC_WORD_PLACE, EC_WORD_IS, EC_WORD_A, EC_WORD_PUSHOVER},
{EC_WORD_I, EC_WORD_HAVEN_T, EC_WORD_BEEN, EC_WORD_IN, EC_WORD_A, EC_WORD_BATTLE},
@ -1184,7 +1184,7 @@ static bool8 StatusInflictionFadeOut(struct Task *task)
task->data[7] += task->data[4];
if (task->data[7] > 16)
task->data[7] = 16;
BlendPalettes(0xFFFFFFFF, task->data[7], RGB(11, 11, 11));
BlendPalettes(PALETTES_ALL, task->data[7], RGB(11, 11, 11));
}
if (task->data[7] >= 16)
@ -1203,7 +1203,7 @@ static bool8 StatusInflictionFadeIn(struct Task *task)
task->data[7] -= task->data[5];
if (task->data[7] < 0)
task->data[7] = 0;
BlendPalettes(0xFFFFFFFF, task->data[7], RGB(11, 11, 11));
BlendPalettes(PALETTES_ALL, task->data[7], RGB(11, 11, 11));
}
if (task->data[7] == 0)
@ -1235,7 +1235,7 @@ static void StartStatusInflictionScreenFlash(s16 fadeOutDelay, s16 fadeInDelay,
static bool8 IsStatusInflictionScreenFlashTaskFinished(void)
{
if (FindTaskIdByFunc(DoStatusInflictionScreenFlash) == 0xFF)
if (FindTaskIdByFunc(DoStatusInflictionScreenFlash) == TASK_NONE)
return TRUE;
else
return FALSE;

View File

@ -389,10 +389,10 @@ void GoToBattlePyramidBagMenu(u8 a0, void (*callback)(void))
gPyramidBagResources->callback2 = NULL;
gPyramidBagResources->unk814 = 0xFF;
gPyramidBagResources->scrollIndicatorsTaskId = 0xFF;
gPyramidBagResources->scrollIndicatorsTaskId = TASK_NONE;
memset(gPyramidBagResources->itemsSpriteIds, 0xFF, sizeof(gPyramidBagResources->itemsSpriteIds));
memset(gPyramidBagResources->windowIds, 0xFF, sizeof(gPyramidBagResources->windowIds));
memset(gPyramidBagResources->windowIds, WINDOW_NONE, sizeof(gPyramidBagResources->windowIds));
SetMainCallback2(sub_81C504C);
}
@ -493,11 +493,11 @@ static bool8 sub_81C5078(void)
gMain.state++;
break;
case 15:
BlendPalettes(0xFFFFFFFF, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, 0);
gMain.state++;
break;
case 16:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = FALSE;
gMain.state++;
break;
@ -657,16 +657,16 @@ static void PrintItemDescription(s32 listMenuId)
static void AddScrollArrow(void)
{
if (gPyramidBagResources->scrollIndicatorsTaskId == 0xFF)
if (gPyramidBagResources->scrollIndicatorsTaskId == TASK_NONE)
gPyramidBagResources->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized(2, 172, 12, 148, gPyramidBagResources->listMenuCount - gPyramidBagResources->listMenuMaxShown, 0xB5E, 0xB5E, &gPyramidBagCursorData.scrollPosition);
}
static void RemoveScrollArrow(void)
{
if (gPyramidBagResources->scrollIndicatorsTaskId != 0xFF)
if (gPyramidBagResources->scrollIndicatorsTaskId != TASK_NONE)
{
RemoveScrollIndicatorArrowPair(gPyramidBagResources->scrollIndicatorsTaskId);
gPyramidBagResources->scrollIndicatorsTaskId = 0xFF;
gPyramidBagResources->scrollIndicatorsTaskId = TASK_NONE;
}
}
@ -811,7 +811,7 @@ static void sub_81C5AB8(u8 y, u8 arg1)
void CloseBattlePyramidBagAndSetCallback(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = sub_81C5B4C;
}
@ -1428,7 +1428,7 @@ static u8 sub_81C6D08(u8 windowArrayId)
static u8 sub_81C6D24(u8 windowArrayId)
{
u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId];
if (*windowId == 0xFF)
if (*windowId == WINDOW_NONE)
{
*windowId = AddWindow(&gUnknown_0861F350[windowArrayId]);
DrawStdFrameWithCustomTileAndPalette(*windowId, FALSE, 1, 0xE);
@ -1440,13 +1440,13 @@ static u8 sub_81C6D24(u8 windowArrayId)
static void sub_81C6D6C(u8 windowArrayId)
{
u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId];
if (*windowId != 0xFF)
if (*windowId != WINDOW_NONE)
{
ClearStdWindowAndFrameToTransparent(*windowId, FALSE);
ClearWindowTilemap(*windowId);
RemoveWindow(*windowId);
ScheduleBgCopyTilemapToVram(1);
*windowId = 0xFF;
*windowId = WINDOW_NONE;
}
}
@ -1475,13 +1475,13 @@ static void CloseBattlePyramidBagTextWindow(void)
static void sub_81C6E38(u8 itemSpriteArrayId)
{
u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId];
if (*spriteId != 0xFF)
if (*spriteId != SPRITE_NONE)
{
FreeSpriteTilesByTag(ITEM_IMAGE_TAG + itemSpriteArrayId);
FreeSpritePaletteByTag(ITEM_IMAGE_TAG + itemSpriteArrayId);
FreeSpriteOamMatrix(&gSprites[*spriteId]);
DestroySprite(&gSprites[*spriteId]);
*spriteId = 0xFF;
*spriteId = SPRITE_NONE;
}
}
@ -1526,7 +1526,7 @@ static void ShowItemImage(u16 itemId, u8 itemSpriteArrayId)
{
u8 itemSpriteId;
u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId + 1];
if (*spriteId == 0xFF)
if (*spriteId == SPRITE_NONE)
{
FreeSpriteTilesByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId);
FreeSpritePaletteByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId);

View File

@ -365,7 +365,7 @@ static void Task_CloseTrainerHillRecordsOnButton(u8 taskId)
static void Task_BeginPaletteFade(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ExitTrainerHillRecords;
}
@ -512,7 +512,7 @@ static void CB2_ShowTrainerHillRecords(void)
gMain.state++;
break;
case 6:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gMain.state++;
break;
case 7:

View File

@ -5374,7 +5374,7 @@ static void Cmd_yesnoboxlearnmove(void)
if (gBattleCommunication[1] == 0)
{
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattleScripting.learnMoveState++;
}
else
@ -9942,7 +9942,7 @@ static void Cmd_displaydexinfo(void)
switch (gBattleCommunication[0])
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattleCommunication[0]++;
break;
case 1:
@ -9973,7 +9973,7 @@ static void Cmd_displaydexinfo(void)
case 4:
if (!IsDma3ManagerBusyWithBgCopy())
{
BeginNormalPaletteFade(0xFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_BG, 0, 0x10, 0, RGB_BLACK);
ShowBg(0);
ShowBg(3);
gBattleCommunication[0]++;

View File

@ -991,7 +991,7 @@ static bool8 Transition_Phase1(struct Task *task)
static bool8 Transition_WaitForPhase1(struct Task *task)
{
if (FindTaskIdByFunc(sPhase1_Tasks[task->tTransitionId]) == 0xFF)
if (FindTaskIdByFunc(sPhase1_Tasks[task->tTransitionId]) == TASK_NONE)
{
task->tState++;
return TRUE;
@ -1012,7 +1012,7 @@ static bool8 Transition_Phase2(struct Task *task)
static bool8 Transition_WaitForPhase2(struct Task *task)
{
task->tTransitionDone = FALSE;
if (FindTaskIdByFunc(sPhase2_Tasks[task->tTransitionId]) == 0xFF)
if (FindTaskIdByFunc(sPhase2_Tasks[task->tTransitionId]) == TASK_NONE)
task->tTransitionDone = TRUE;
return FALSE;
}
@ -1071,7 +1071,7 @@ static bool8 Phase2_Blur_Func2(struct Task *task)
{
task->tData1 = 4;
if (++task->tData2 == 10)
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 0x10, RGB_BLACK);
SetGpuReg(REG_OFFSET_MOSAIC, (task->tData2 & 15) * 17);
if (task->tData2 > 14)
task->tState++;
@ -1098,7 +1098,7 @@ static bool8 Phase2_Swirl_Func1(struct Task *task)
{
InitTransitionStructVars();
ScanlineEffect_Clear();
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 4, 0, 0x10, RGB_BLACK);
sub_8149F98(gScanlineEffectRegBuffers[1], sTransitionStructPtr->field_14, 0, 2, 0, 160);
SetVBlankCallback(VBlankCB_Phase2_Swirl);
@ -1153,7 +1153,7 @@ static bool8 Phase2_Shuffle_Func1(struct Task *task)
InitTransitionStructVars();
ScanlineEffect_Clear();
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 4, 0, 0x10, RGB_BLACK);
memset(gScanlineEffectRegBuffers[1], sTransitionStructPtr->field_16, 0x140);
SetVBlankCallback(VBlankCB_Phase2_Shuffle);
@ -1456,7 +1456,7 @@ static bool8 Phase2_Kyogre_Func5(struct Task *task)
static bool8 Phase2_WeatherDuo_Func6(struct Task *task)
{
BeginNormalPaletteFade(0xFFFF8000, 1, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_OBJECTS | 0x8000, 1, 0, 0x10, RGB_BLACK);
task->tState++;
return FALSE;
}
@ -1541,7 +1541,7 @@ static bool8 Phase2_FramesCountdown(struct Task *task)
static bool8 Phase2_WeatherTrio_Func1(struct Task *task)
{
BeginNormalPaletteFade(0x0000FFFF, 1, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_BG, 1, 0, 0x10, RGB_BLACK);
task->tState++;
return FALSE;
}
@ -1962,7 +1962,7 @@ static bool8 Phase2_Ripple_Func2(struct Task *task)
if (++task->tData3 == 81)
{
task->tData4++;
BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 0x10, RGB_BLACK);
}
if (task->tData4 != 0 && !gPaletteFade.active)
@ -2308,7 +2308,7 @@ static bool8 Phase2_Mugshot_Func7(struct Task *task)
static bool8 Phase2_Mugshot_Func8(struct Task *task)
{
sTransitionStructPtr->VBlank_DMA = FALSE;
BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE);
BlendPalettes(PALETTES_ALL, 0x10, RGB_WHITE);
sTransitionStructPtr->BLDCNT = 0xFF;
task->tData3 = 0;
@ -3168,7 +3168,7 @@ static bool8 Phase2_Rayquaza_Func6(struct Task *task)
{
task->tState++;
task->tData1 = 0;
BeginNormalPaletteFade(0xFFFF8000, 2, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_OBJECTS | 0x8000, 2, 0, 0x10, RGB_BLACK);
}
return FALSE;
@ -3187,8 +3187,8 @@ static bool8 Phase2_Rayquaza_Func7(struct Task *task)
static bool8 Phase2_Rayquaza_Func8(struct Task *task)
{
BlendPalettes(0x00007FFF, 8, 0);
BlendPalettes(0xFFFF8000, 0, 0);
BlendPalettes(PALETTES_BG & ~(0x8000), 8, 0);
BlendPalettes(PALETTES_OBJECTS | 0x8000, 0, 0);
task->tState++;
return FALSE;
@ -3300,7 +3300,7 @@ static bool8 Phase2_WhiteFade_Func3(struct Task *task)
sTransitionStructPtr->VBlank_DMA = 0;
if (sTransitionStructPtr->field_20 > 7)
{
BlendPalettes(-1, 0x10, 0x7FFF);
BlendPalettes(PALETTES_ALL, 0x10, 0x7FFF);
task->tState++;
}
return FALSE;
@ -3612,7 +3612,7 @@ static void CreatePhase1Task(s16 a0, s16 a1, s16 a2, s16 a3, s16 a4)
static bool8 IsPhase1Done(void)
{
if (FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == 0xFF)
if (FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == TASK_NONE)
return TRUE;
else
return FALSE;
@ -3631,7 +3631,7 @@ static bool8 Phase1_TransitionAll_Func1(struct Task *task)
task->tData7 += task->tData4;
if (task->tData7 > 16)
task->tData7 = 16;
BlendPalettes(-1, task->tData7, 0x2D6B);
BlendPalettes(PALETTES_ALL, task->tData7, 0x2D6B);
}
if (task->tData7 > 15)
{
@ -3649,7 +3649,7 @@ static bool8 Phase1_TransitionAll_Func2(struct Task *task)
task->tData7 -= task->tData5;
if (task->tData7 < 0)
task->tData7 = 0;
BlendPalettes(-1, task->tData7, 0x2D6B);
BlendPalettes(PALETTES_ALL, task->tData7, 0x2D6B);
}
if (task->tData7 == 0)
{
@ -3706,7 +3706,7 @@ void GetBg0TilesDst(u16 **tilemap, u16 **tileset)
static void FadeScreenBlack(void)
{
BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK);
BlendPalettes(PALETTES_ALL, 16, RGB_BLACK);
}
static void sub_8149F98(s16 *array, s16 sinAdd, s16 index, s16 indexIncrementer, s16 amplitude, s16 arrSize)
@ -3977,7 +3977,7 @@ static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task)
if (++task->tData3 == 101)
{
task->tData4++;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
}
if (task->tData4 != 0 && !gPaletteFade.active)
@ -4077,7 +4077,7 @@ static bool8 Phase2_FrontierSquares_Func3(struct Task *task)
}
break;
case 1:
BlendPalettes(0xFFFF7FFF, 0x10, 0);
BlendPalettes(PALETTES_ALL & ~(0x8000), 0x10, 0);
LZ77UnCompVram(sFrontierSquares_EmptyBg_Tileset, tileset);
break;
case 2:
@ -4138,7 +4138,7 @@ static bool8 Phase2_FrontierSquaresSpiral_Func2(struct Task *task)
static bool8 Phase2_FrontierSquaresSpiral_Func3(struct Task *task)
{
BlendPalette(0xE0, 0x10, 3, 0);
BlendPalettes(0xFFFF3FFF, 0x10, 0);
BlendPalettes(PALETTES_ALL & ~(0x8000 | 0x4000), 0x10, 0);
task->tData2 = 0;
task->tData3 = 0;
@ -4194,7 +4194,7 @@ static bool8 Phase2_FrontierSquares_End(struct Task *task)
{
FillBgTilemapBufferRect_Palette0(0, 1, 0, 0, 0x20, 0x20);
CopyBgTilemapBufferToVram(0);
BlendPalettes(0xFFFFFFFF, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, 0);
DestroyTask(FindTaskIdByFunc(task->func));
return FALSE;
}
@ -4286,7 +4286,7 @@ static bool8 Phase2_FrontierSquaresScroll_Func2(struct Task *task)
static bool8 Phase2_FrontierSquaresScroll_Func3(struct Task *task)
{
BlendPalettes(0xFFFF7FFF, 0x10, 0);
BlendPalettes(PALETTES_ALL & ~(0x8000), 0x10, 0);
task->tData2 = 0;
@ -4325,7 +4325,7 @@ static bool8 Phase2_FrontierSquaresScroll_Func5(struct Task *task)
FillBgTilemapBufferRect_Palette0(0, 1, 0, 0, 0x20, 0x20);
CopyBgTilemapBufferToVram(0);
BlendPalettes(0xFFFFFFFF, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, 0);
DestroyTask(FindTaskIdByFunc(task->func));
task->tState++; // UB: changing value of a destroyed task

View File

@ -373,7 +373,7 @@ static bool8 FadeInCenterLogoCircle(struct Task *task)
{
if (task->data[3] == 31)
{
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 0x10, RGB_BLACK);
task->tState++;
}
else

View File

@ -1097,7 +1097,7 @@ static void CB2_LoadBerryBlender(void)
}
break;
case 2:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
UpdateBlenderCenter();
sBerryBlender->mainState++;
break;
@ -1111,7 +1111,7 @@ static void CB2_LoadBerryBlender(void)
sBerryBlender->mainState++;
break;
case 5:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
sBerryBlender->mainState++;
break;
case 6:
@ -1326,7 +1326,7 @@ static void CB2_StartBlenderLink(void)
sBerryBlender->mainState++;
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
sBerryBlender->mainState++;
break;
case 4:
@ -1664,7 +1664,7 @@ static void CB2_StartBlenderLocal(void)
sBerryBlender->mainState++;
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
sBerryBlender->mainState++;
sBerryBlender->framesToWait = 0;
break;
@ -2895,7 +2895,7 @@ static void CB2_CheckPlayAgainLink(void)
case 9:
if (IsLinkTaskFinished())
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
sBerryBlender->gameEndState++;
}
break;

View File

@ -1089,7 +1089,7 @@ s32 InitBerryCrushDisplay(void)
break;
case 9:
gPaletteFade.bufferTransferDisabled = FALSE;
BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK);
BlendPalettes(PALETTES_ALL, 16, RGB_BLACK);
ShowBg(0);
ShowBg(1);
ShowBg(2);
@ -1121,7 +1121,7 @@ int sub_802130C(void)
// fall through. The original author forgot to use "break" here
// because this will call BeginNormalPaletteFade() twice.
case 2:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
UpdatePaletteFade();
break;
case 3:
@ -2635,13 +2635,13 @@ static u32 sub_8023A30(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r1
case 0:
r4->unk12 = 8;
PlaySE(SE_M_STRENGTH);
BlendPalettes(0xFFFFFFFF, 8, RGB(31, 31, 0));
BlendPalettes(PALETTES_ALL, 8, RGB(31, 31, 0));
r4->unk138.unk0 = 2;
break;
case 1:
if (--r4->unk138.unk0 != 255)
return 0;
BlendPalettes(0xFFFFFFFF, 0, RGB(31, 31, 0));
BlendPalettes(PALETTES_ALL, 0, RGB(31, 31, 0));
r4->unk138.unk1 = 4;
r4->unk138.unk0 = 0;
r4->unk138.unk2 = gUnknown_082F326C[r4->unk138.unk1][0];
@ -2692,13 +2692,13 @@ static u32 sub_8023BC0(struct BerryCrushGame *r5, u8 *r6)
case 0:
r5->unk12 = 9;
PlaySE(SE_FAILURE);
BlendPalettes(0xFFFFFFFF, 8, RGB(31, 0, 0));
BlendPalettes(PALETTES_ALL, 8, RGB(31, 0, 0));
r5->unk138.unk0 = 4;
break;
case 1:
if (--r5->unk138.unk0 != 255)
return 0;
BlendPalettes(0xFFFFFFFF, 0, RGB(31, 0, 0));
BlendPalettes(PALETTES_ALL, 0, RGB(31, 0, 0));
r5->unk138.unk0 = 0;
break;
case 2:
@ -3057,7 +3057,7 @@ static u32 sub_80243BC(struct BerryCrushGame *r5, __attribute__((unused)) u8 *r1
switch (r5->unkC)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 1, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 1, 0, 0x10, RGB_BLACK);
UpdatePaletteFade();
break;
case 1:
@ -3067,7 +3067,7 @@ static u32 sub_80243BC(struct BerryCrushGame *r5, __attribute__((unused)) u8 *r1
case 2:
ClearDialogWindowAndFrame(0, 1);
sub_8021488(r5);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
UpdatePaletteFade();
break;
case 3:

View File

@ -276,11 +276,11 @@ static bool8 InitBerryTagScreen(void)
gMain.state++;
break;
case 14:
BlendPalettes(-1, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, 0);
gMain.state++;
break;
case 15:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = 0;
gMain.state++;
break;
@ -514,7 +514,7 @@ static void DestroyFlavorCircleSprites(void)
static void PrepareToCloseBerryTagScreen(u8 taskId)
{
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_CloseBerryTagScreen;
}

View File

@ -246,7 +246,7 @@ void CableCar(void)
{
ScriptContext2_Enable();
CreateTask(Task_LoadCableCar, 1);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0));
}
static void CB2_LoadCableCar(void)
@ -350,7 +350,7 @@ static void CB2_LoadCableCar(void)
gMain.state++;
break;
case 8:
BeginNormalPaletteFade(0xFFFFFFFF, 3, 16, 0, RGB(0, 0, 0));
BeginNormalPaletteFade(PALETTES_ALL, 3, 16, 0, RGB(0, 0, 0));
FadeInNewBGM(MUS_CABLE_CAR, 1);
SetBgRegs(TRUE);
gMain.state++;
@ -468,7 +468,7 @@ static void Task_CableCar(u8 taskId)
if (sCableCar->timer == 570)
{
sCableCar->state = 3;
BeginNormalPaletteFade(0xFFFFFFFF, 3, 0, 16, RGB(0, 0, 0));
BeginNormalPaletteFade(PALETTES_ALL, 3, 0, 16, RGB(0, 0, 0));
FadeOutBGM(4);
}
break;

View File

@ -82,7 +82,7 @@ static void Task_ReestablishLinkAwaitConfirmation(u8 taskId);
static void CreateLinkupTask(u8 minPlayers, u8 maxPlayers)
{
if (FindTaskIdByFunc(Task_LinkupStart) == 0xFF)
if (FindTaskIdByFunc(Task_LinkupStart) == TASK_NONE)
{
u8 taskId1;
@ -627,7 +627,7 @@ void ValidateMixingGameLanguage(void)
{
u32 taskId = FindTaskIdByFunc(Task_ValidateMixingGameLanguage);
if (taskId == 0xFF)
if (taskId == TASK_NONE)
{
taskId = CreateTask(Task_ValidateMixingGameLanguage, 80);
gTasks[taskId].tState = 0;

View File

@ -163,7 +163,7 @@ static bool8 SetupClearSaveDataScreen(void)
ShowBg(3);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
InitClearSaveDataScreenWindows();
BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_BG, 0, 0x10, 0, RGB_WHITEALPHA);
EnableInterrupts(INTR_FLAG_VBLANK);
SetVBlankCallback(VBlankCB);
gMain.state = 1;
@ -185,7 +185,7 @@ static void CB2_FadeAndDoReset(void)
{
case 0:
default:
BeginNormalPaletteFade(0x0000FFFF, 0, 0, 0x10, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_BG, 0, 0, 0x10, RGB_WHITEALPHA);
gMain.state = 1;
break;
case 1:

View File

@ -2711,7 +2711,7 @@ static void Task_TryCommunicateFinalStandings(u8 taskId)
}
else
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_ContestReturnToField;
}
}
@ -2730,7 +2730,7 @@ static void Task_CommunicateFinalStandings(u8 taskId)
static void Task_EndCommunicateFinalStandings(u8 taskId)
{
DestroyTask(taskId);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[eContest.mainTaskId].func = Task_ContestReturnToField;
}

View File

@ -250,7 +250,7 @@ static void HoldContestPainting(void)
if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))
{
gContestPaintingState++;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0));
}
if (gUnknown_030011F6)

View File

@ -517,7 +517,7 @@ static void CB2_StartShowContestResults(void)
memset(sContestResults->monResults, 0, sizeof(*sContestResults->monResults));
LoadContestResultSprites();
TryCreateWirelessSprites();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = FALSE;
sContestResults->data->showResultsTaskId = CreateTask(Task_ShowContestResults, 5);
SetMainCallback2(CB2_ShowContestResults);
@ -1018,12 +1018,12 @@ static void Task_EndShowContestResults(u8 taskId)
if (gTasks[taskId].tTimer == 0)
{
DestroyTask(sContestResults->data->highlightWinnerTaskId);
BlendPalettes(0x0000FFFF, 16, RGB_BLACK);
BlendPalettes(PALETTES_BG, 16, RGB_BLACK);
gTasks[taskId].tTimer++;
}
else if (gTasks[taskId].tTimer == 1)
{
BlendPalettes(0xFFFF0000, 16, RGB_BLACK);
BlendPalettes(PALETTES_OBJECTS, 16, RGB_BLACK);
gTasks[taskId].tTimer++;
}
else
@ -2102,7 +2102,7 @@ void StartContest(void)
{
ScriptContext2_Enable();
CreateTask(Task_StartContest, 10);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
}
void BufferContestantMonSpecies(void)
@ -2123,7 +2123,7 @@ void ShowContestResults(void)
{
ScriptContext2_Enable();
CreateTask(Task_StartShowContestResults, 10);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
}
void GetContestPlayerId(void)
@ -2535,7 +2535,7 @@ void ShowContestEntryMonPic(void)
u8 taskId;
u8 left, top;
if (FindTaskIdByFunc(Task_ShowContestEntryMonPic) == 0xFF)
if (FindTaskIdByFunc(Task_ShowContestEntryMonPic) == TASK_NONE)
{
AllocateMonSpritesGfx();
left = 10;
@ -2578,7 +2578,7 @@ void ShowContestEntryMonPic(void)
void HideContestEntryMonPic(void)
{
u8 taskId = FindTaskIdByFunc(Task_ShowContestEntryMonPic);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
{
gTasks[taskId].data[0]++;
FreeMonSpritesGfx();

View File

@ -1235,7 +1235,7 @@ void CB2_StartCreditsSequence(void)
gTasks[taskIdB].data[TDB_TASK_A_ID] = taskIdA;
gTasks[taskIdA].data[TDA_TASK_B_ID] = taskIdB;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
EnableInterrupts(INTR_FLAG_VBLANK);
SetVBlankCallback(CreditsVBlankCallback);
m4aSongNumStart(MUS_CREDITS);
@ -1281,14 +1281,14 @@ static void Task_ProgressCreditTasks(u8 taskIdA)
{
gTasks[taskIdA].data[TDA_13] = data1;
gTasks[taskIdA].data[TDA_11] = 0;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskIdA].func = sub_8175808;
}
else if (gTasks[taskIdA].data[TDA_11] == 2)
{
gTasks[taskIdA].data[TDA_13] = data1;
gTasks[taskIdA].data[TDA_11] = 0;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskIdA].func = sub_81758A4;
}
}
@ -1309,7 +1309,7 @@ static void c2_080C9BFC(u8 taskIdA)
if (sub_8176AB0(gTasks[taskIdA].data[TDA_7], taskIdA))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
EnableInterrupts(INTR_FLAG_VBLANK);
SetVBlankCallback(CreditsVBlankCallback);
gTasks[taskIdA].func = Task_WaitPaletteFade;
@ -1369,7 +1369,7 @@ static void Task_CreditsLoadGrassScene(u8 taskIdA)
gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_TASK_A_ID] = taskIdA;
gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_2] = gTasks[taskIdA].data[TDA_7];
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_BG3HOFS, 0);
SetGpuReg(REG_OFFSET_BG3VOFS, 32);
SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3)
@ -1398,7 +1398,7 @@ static void Task_CreditsTheEnd1(u8 taskIdA)
return;
}
BeginNormalPaletteFade(0xFFFFFFFF, 12, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 12, 0, 16, RGB_BLACK);
gTasks[taskIdA].func = Task_CreditsTheEnd2;
}
@ -1418,7 +1418,7 @@ static void Task_CreditsTheEnd3(u8 taskIdA)
LoadTheEndScreen(0, 0x3800, 0);
ResetSpriteData();
FreeAllSpritePalettes();
BeginNormalPaletteFade(0xFFFFFFFF, 8, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 8, 16, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0)
| BGCNT_CHARBASE(0)
@ -1442,7 +1442,7 @@ static void Task_CreditsTheEnd4(u8 taskIdA)
return;
}
BeginNormalPaletteFade(0xFFFFFFFF, 6, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 6, 0, 16, RGB_BLACK);
gTasks[taskIdA].func = Task_CreditsTheEnd5;
}
@ -1452,7 +1452,7 @@ static void Task_CreditsTheEnd5(u8 taskIdA)
{
sub_8176E40(0x3800, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0, RGB_BLACK);
gTasks[taskIdA].data[TDA_0] = 7200;
gTasks[taskIdA].func = Task_CreditsTheEnd6;
}
@ -1465,7 +1465,7 @@ static void Task_CreditsTheEnd6(u8 taskIdA)
if (gTasks[taskIdA].data[TDA_0] == 0 || gMain.newKeys)
{
FadeOutBGM(4);
BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 16, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 16, RGB_WHITEALPHA);
gTasks[taskIdA].func = Task_CreditsSoftReset;
return;
}

View File

@ -25,28 +25,28 @@
#include "trendysaying.h"
const struct BardSound (*const gBardSoundsTable[EC_NUM_GROUPS])[6] = {
[EC_GROUP_POKEMON] = NULL, // Handled by gBardSounds_Pokemon
[EC_GROUP_TRAINER] = gBardSounds_Trainer,
[EC_GROUP_STATUS] = gBardSounds_Status,
[EC_GROUP_BATTLE] = gBardSounds_Battle,
[EC_GROUP_GREETINGS] = gBardSounds_Greetings,
[EC_GROUP_PEOPLE] = gBardSounds_People,
[EC_GROUP_VOICES] = gBardSounds_Voices,
[EC_GROUP_SPEECH] = gBardSounds_Speech,
[EC_GROUP_ENDINGS] = gBardSounds_Endings,
[EC_GROUP_FEELINGS] = gBardSounds_Feelings,
[EC_GROUP_CONDITIONS] = gBardSounds_Conditions,
[EC_GROUP_ACTIONS] = gBardSounds_Actions,
[EC_GROUP_LIFESTYLE] = gBardSounds_Lifestyle,
[EC_GROUP_HOBBIES] = gBardSounds_Hobbies,
[EC_GROUP_TIME] = gBardSounds_Time,
[EC_GROUP_MISC] = gBardSounds_Misc,
[EC_GROUP_ADJECTIVES] = gBardSounds_Adjectives,
[EC_GROUP_EVENTS] = gBardSounds_Events,
[EC_GROUP_MOVE_1] = NULL, // Handled by gBardSounds_Moves
[EC_GROUP_MOVE_2] = NULL, // Handled by gBardSounds_Moves
[EC_GROUP_TRENDY_SAYING] = gBardSounds_TrendySaying,
[EC_GROUP_POKEMON_2] = NULL // Handled by gBardSounds_Pokemon
[EC_GROUP_POKEMON] = NULL, // Handled by gBardSounds_Pokemon
[EC_GROUP_TRAINER] = gBardSounds_Trainer,
[EC_GROUP_STATUS] = gBardSounds_Status,
[EC_GROUP_BATTLE] = gBardSounds_Battle,
[EC_GROUP_GREETINGS] = gBardSounds_Greetings,
[EC_GROUP_PEOPLE] = gBardSounds_People,
[EC_GROUP_VOICES] = gBardSounds_Voices,
[EC_GROUP_SPEECH] = gBardSounds_Speech,
[EC_GROUP_ENDINGS] = gBardSounds_Endings,
[EC_GROUP_FEELINGS] = gBardSounds_Feelings,
[EC_GROUP_CONDITIONS] = gBardSounds_Conditions,
[EC_GROUP_ACTIONS] = gBardSounds_Actions,
[EC_GROUP_LIFESTYLE] = gBardSounds_Lifestyle,
[EC_GROUP_HOBBIES] = gBardSounds_Hobbies,
[EC_GROUP_TIME] = gBardSounds_Time,
[EC_GROUP_MISC] = gBardSounds_Misc,
[EC_GROUP_ADJECTIVES] = gBardSounds_Adjectives,
[EC_GROUP_EVENTS] = gBardSounds_Events,
[EC_GROUP_MOVE_1] = NULL, // Handled by gBardSounds_Moves
[EC_GROUP_MOVE_2] = NULL, // Handled by gBardSounds_Moves
[EC_GROUP_TRENDY_SAYING] = gBardSounds_TrendySaying,
[EC_GROUP_POKEMON_NATIONAL] = NULL // Handled by gBardSounds_Pokemon
};
#endif //GUARD_BARD_SOUNDS_TABLE_H

View File

@ -326,7 +326,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] =
.facilityClass = FACILITY_CLASS_LASS,
.species = {SPECIES_SWALOT, SPECIES_XATU, SPECIES_ALTARIA, SPECIES_GOLDUCK, SPECIES_FLYGON, SPECIES_ALAKAZAM, SPECIES_GARDEVOIR, SPECIES_WAILORD, SPECIES_GRUMPIG, SPECIES_MIGHTYENA},
.id = 3,
.speechLost = {EC_WORD_IS, EC_WORD_THIS, EC_WORD_TOO, EC_WORD_MUCH, EC_WORD_QUES, 0xFFFF},
.speechLost = {EC_WORD_IS, EC_WORD_THIS, EC_WORD_TOO, EC_WORD_MUCH, EC_WORD_QUES, EC_EMPTY_WORD},
},
{
.name = {_("ヨウカ"), _("MACY"), _("AMELIE"), _("CLEO"), _("MARIA"), _("ELISA")},
@ -358,7 +358,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] =
.facilityClass = FACILITY_CLASS_BEAUTY,
.species = {SPECIES_NINETALES, SPECIES_ALAKAZAM, SPECIES_SCEPTILE, SPECIES_SALAMENCE, SPECIES_GOLDUCK, SPECIES_MAWILE, SPECIES_WEEZING, SPECIES_LANTURN, SPECIES_GARDEVOIR, SPECIES_MILOTIC},
.id = 7,
.speechLost = {EC_WORD_YOU_RE, EC_WORD_STRONG, EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_QUES, 0xFFFF},
.speechLost = {EC_WORD_YOU_RE, EC_WORD_STRONG, EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_QUES, EC_EMPTY_WORD},
},
{
.name = {_("スミレ"), _("ANNIE"), _("ANNIE"), _("IMELDA"), _("INES"), _("ROSA")},
@ -374,7 +374,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] =
.facilityClass = FACILITY_CLASS_HIKER,
.species = {SPECIES_SKARMORY, SPECIES_GOLEM, SPECIES_BLAZIKEN, SPECIES_CAMERUPT, SPECIES_DONPHAN, SPECIES_MUK, SPECIES_SALAMENCE, SPECIES_TROPIUS, SPECIES_SOLROCK, SPECIES_RHYDON},
.id = 9,
.speechLost = {EC_WORD_WE, EC_WORD_WERE, EC_WORD_JUST, EC_WORD_SHREDDED, EC_WORD_ELLIPSIS, 0xFFFF},
.speechLost = {EC_WORD_WE, EC_WORD_WERE, EC_WORD_JUST, EC_WORD_SHREDDED, EC_WORD_ELLIPSIS, EC_EMPTY_WORD},
},
{
.name = {_("トウゾウ"), _("DALLAS"), _("BRUNO"), _("LEARCO"), _("ANSGAR"), _("MANOLO")},
@ -382,7 +382,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] =
.facilityClass = FACILITY_CLASS_FISHERMAN,
.species = {SPECIES_SEAKING, SPECIES_STARMIE, SPECIES_GOLDUCK, SPECIES_TENTACRUEL, SPECIES_OCTILLERY, SPECIES_GOREBYSS, SPECIES_GLALIE, SPECIES_WAILORD, SPECIES_SHARPEDO, SPECIES_KINGDRA},
.id = 10,
.speechLost = {EC_WORD_YOUR, EC_WORD_WIN, EC_WORD_ANGERS, EC_WORD_ME, EC_WORD_EXCL, 0xFFFF},
.speechLost = {EC_WORD_YOUR, EC_WORD_WIN, EC_WORD_ANGERS, EC_WORD_ME, EC_WORD_EXCL, EC_EMPTY_WORD},
},
{
.name = {_("セイヤ"), _("FRANK"), _("FRANK"), _("OLINDO"), _("FRANK"), _("MAURO")},

File diff suppressed because it is too large Load Diff

View File

@ -616,9 +616,9 @@ const struct BattleFrontierTrainer gSlateportBattleTentTrainers[NUM_BATTLE_TENT_
[SLATEPORT_TENT_TRAINER_MAGGIE] = {
.facilityClass = FACILITY_CLASS_SCHOOL_KID_F,
.trainerName = _("MAGGIE"),
.speechBefore = {EC_POKEMON(VULPIX), EC_POKEMON(XATU), EC_POKEMON2(UMBREON), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_WORD_ELLIPSIS},
.speechBefore = {EC_POKEMON(VULPIX), EC_POKEMON(XATU), EC_POKEMON_NATIONAL(UMBREON), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_WORD_ELLIPSIS},
.speechWin = {EC_POKEMON(NOSEPASS), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_POKEMON(SEVIPER), EC_WORD_EXCL, -1},
.speechLose = {EC_POKEMON(NOSEPASS), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_POKEMON2(SNORLAX), EC_WORD_ELLIPSIS, EC_WORD_UH_OH},
.speechLose = {EC_POKEMON(NOSEPASS), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_POKEMON_NATIONAL(SNORLAX), EC_WORD_ELLIPSIS, EC_WORD_UH_OH},
.monSet = gSlateportBattleTentTrainerMons_Maggie
},
[SLATEPORT_TENT_TRAINER_STEPHON] = {

View File

@ -314,7 +314,7 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = {
.speechBefore = { EC_WORD_SISTER, EC_WORD_ALTHOUGH, EC_WORD_KIND, EC_WORD_MATCH, EC_WORD_PLEASE, EC_WORD_WITHOUT },
.speechWin = { EC_WORD_KIND, EC_WORD_ELLIPSIS, EC_WORD_INSTEAD, EC_WORD_DEEP, EC_WORD_WEAK, EC_WORD_QUES },
.speechLose = { EC_WORD_AWFUL, EC_WORD_GWAH, EC_WORD_HOPELESS, EC_WORD_CAN_T_WIN, EC_WORD_IS, EC_WORD_NONE },
.speechAfter = { EC_WORD_AWW, 0xFFFF, 0xFFFF, EC_WORD_ALMOST, EC_WORD_GOOD, EC_WORD_ANYWHERE },
.speechAfter = { EC_WORD_AWW, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_ALMOST, EC_WORD_GOOD, EC_WORD_ANYWHERE },
.mons = {
[0] = NULL_BATTLE_TOWER_POKEMON,
[1] = NULL_BATTLE_TOWER_POKEMON,
@ -444,7 +444,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
.unused = 0,
.speechBefore = {EC_WORD_YOU, EC_WORD_CAN, EC_WORD_CHOOSE, EC_WORD_NOT, EC_WORD_TO, EC_WORD_BELIEVE},
.speechWin = {EC_WORD_A, EC_WORD_SUPER, EC_WORD_NATURAL, EC_WORD_POWER, EC_WORD_HAS, EC_WORD_COME},
.speechLose = {EC_WORD_THIS, EC_WORD_MUST_BE, EC_WORD_A, EC_MOVE(NIGHTMARE), EC_WORD_EXCL, 0xFFFF},
.speechLose = {EC_WORD_THIS, EC_WORD_MUST_BE, EC_WORD_A, EC_MOVE(NIGHTMARE), EC_WORD_EXCL, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_I, EC_WORD_WILL, EC_WORD_DISAPPEAR, EC_WORD_IN, EC_WORD_THE, EC_WORD_DARK},
.mons =
{
@ -589,7 +589,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
.name = _("ALFONSO"),
.facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M,
.unused = 0,
.speechBefore = {EC_WORD_I, EC_WORD_NEVER, EC_WORD_TAKE, EC_WORD_A, EC_WORD_TRAIN, 0xFFFF},
.speechBefore = {EC_WORD_I, EC_WORD_NEVER, EC_WORD_TAKE, EC_WORD_A, EC_WORD_TRAIN, EC_EMPTY_WORD},
.speechWin = {EC_WORD_I_AM, EC_WORD_FEELING, EC_MOVE2(SUPERSONIC), EC_WORD_ON, EC_WORD_MY, EC_WORD_BIKE},
.speechLose = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_EXCL, EC_WORD_YOU_VE, EC_WORD_DESTROYED, EC_WORD_IT},
.speechAfter = {EC_WORD_A, EC_WORD_BIKE, EC_WORD_OVER, EC_WORD_ANY, EC_WORD_TRAIN, EC_WORD_EXCL},
@ -907,8 +907,8 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
.facilityClass = FACILITY_CLASS_PKMN_BREEDER_F,
.unused = 0,
.speechBefore = {EC_WORD_SOME, EC_WORD_THINGS, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_DO, EC_WORD_ALONE},
.speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, 0xFFFF},
.speechLose = {EC_WORD_WE, EC_WORD_COULDN_T, EC_WORD_WIN, EC_WORD_TOGETHER, EC_WORD_QUES, 0xFFFF},
.speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, EC_EMPTY_WORD},
.speechLose = {EC_WORD_WE, EC_WORD_COULDN_T, EC_WORD_WIN, EC_WORD_TOGETHER, EC_WORD_QUES, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_MAYBE, EC_WORD_I, EC_WORD_NEED, EC_WORD_A, EC_WORD_BOY, EC_WORD_FRIEND},
.mons =
{
@ -1086,7 +1086,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
.speechBefore = {EC_WORD_LET_S, EC_MOVE2(WRAP), EC_WORD_THINGS, EC_WORD_UP, EC_WORD_HERE, EC_WORD_HEY_QUES},
.speechWin = {EC_WORD_WOULD, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_QUES},
.speechLose = {EC_WORD_I, EC_WORD_WILL, EC_WORD_MAKE, EC_WORD_YOU, EC_WORD_SORRY, EC_WORD_FRIEND},
.speechAfter = {EC_WORD_HAVEN_T, EC_WORD_YOU, EC_WORD_DONE, EC_WORD_ENOUGH, EC_WORD_QUES, 0xFFFF},
.speechAfter = {EC_WORD_HAVEN_T, EC_WORD_YOU, EC_WORD_DONE, EC_WORD_ENOUGH, EC_WORD_QUES, EC_EMPTY_WORD},
.mons =
{
[0] =
@ -1229,7 +1229,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
.facilityClass = FACILITY_CLASS_PKMN_BREEDER_F,
.unused = 0,
.speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_STRONG, EC_WORD_BEAUTY, EC_WORD_AROUND, EC_WORD_HERE},
.speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, 0xFFFF},
.speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, EC_EMPTY_WORD},
.speechLose = {EC_WORD_I_AM, EC_WORD_TIRED, EC_WORD_TODAY, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL},
.speechAfter = {EC_WORD_WHY, EC_WORD_YES, EC_WORD_I_AM, EC_WORD_ANGRY, EC_WORD_THANK_YOU, EC_WORD_EXCL},
.mons =
@ -1404,8 +1404,8 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
.name = _("KEENAN"),
.facilityClass = FACILITY_CLASS_PSYCHIC_M,
.unused = 0,
.speechBefore = {EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_HURRIED, 0xFFFF, 0xFFFF},
.speechWin = {EC_WORD_TOO, EC_WORD_BAD, 0xFFFF, EC_WORD_TIME, EC_WORD_IS, EC_WORD_UP},
.speechBefore = {EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_HURRIED, EC_EMPTY_WORD, EC_EMPTY_WORD},
.speechWin = {EC_WORD_TOO, EC_WORD_BAD, EC_EMPTY_WORD, EC_WORD_TIME, EC_WORD_IS, EC_WORD_UP},
.speechLose = {EC_WORD_DOES, EC_WORD_THE, EC_WORD_TIME, EC_WORD_WORRY, EC_WORD_YOU, EC_WORD_QUES},
.speechAfter = {EC_WORD_YOU, EC_WORD_DON_T, EC_WORD_HAVE, EC_WORD_TIME, EC_WORD_TO, EC_WORD_CHAT},
.mons =
@ -1547,7 +1547,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
.unused = 0,
.speechBefore = {EC_WORD_IT_S, EC_WORD_HOT, EC_WORD_ELLIPSIS, EC_WORD_WHAT, EC_WORD_A, EC_WORD_STENCH},
.speechWin = {EC_WORD_I, EC_WORD_REALLY, EC_WORD_LIKE, EC_WORD_AN, EC_WORD_OFFENSIVE, EC_WORD_STENCH},
.speechLose = {EC_WORD_I, EC_MOVE2(COVET), EC_WORD_ANY, EC_WORD_STRONG, EC_WORD_STENCH, 0xFFFF},
.speechLose = {EC_WORD_I, EC_MOVE2(COVET), EC_WORD_ANY, EC_WORD_STRONG, EC_WORD_STENCH, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_MY, EC_WORD_SENSE, EC_WORD_OF, EC_WORD_SMELL, EC_WORD_ISN_T, EC_WORD_NORMAL},
.mons =
{
@ -1731,8 +1731,8 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
.unused = 0,
.speechBefore = {EC_WORD_GOOD, EC_WORD_CHILDREN, EC_WORD_WILL, EC_WORD_GET, EC_WORD_A, EC_MOVE2(PRESENT)},
.speechWin = {EC_WORD_THANK_YOU, EC_WORD_MY, EC_WORD_VICTORY, EC_WORD_IS, EC_WORD_YOUR, EC_MOVE2(PRESENT)},
.speechLose = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_MOVE2(PRESENT), EC_WORD_TO, EC_WORD_YOU, 0xFFFF},
.speechAfter = {EC_WORD_WELL_THEN, EC_WORD_CONGRATS, EC_WORD_MY, EC_WORD_FRIEND, 0xFFFF, 0xFFFF},
.speechLose = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_MOVE2(PRESENT), EC_WORD_TO, EC_WORD_YOU, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_WELL_THEN, EC_WORD_CONGRATS, EC_WORD_MY, EC_WORD_FRIEND, EC_EMPTY_WORD, EC_EMPTY_WORD},
.mons =
{
[0] =
@ -1870,7 +1870,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
.unused = 0,
.speechBefore = {EC_WORD_CAN, EC_WORD_YOU, EC_WORD_SENSE, EC_WORD_ME, EC_MOVE(FOCUS_ENERGY), EC_WORD_QUES},
.speechWin = {EC_WORD_THAT_S, EC_WORD_ABOUT, EC_WORD_RIGHT, EC_WORD_I, EC_WORD_WOULD, EC_WORD_THINK},
.speechLose = {EC_WORD_THINGS, EC_WORD_DON_T, EC_WORD_ALWAYS, EC_WORD_WORK, EC_WORD_OUT, 0xFFFF},
.speechLose = {EC_WORD_THINGS, EC_WORD_DON_T, EC_WORD_ALWAYS, EC_WORD_WORK, EC_WORD_OUT, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_I_AM, EC_WORD_FEELING, EC_WORD_LONESOME, EC_WORD_AND, EC_WORD_SAD, EC_WORD_NOW},
.mons =
{
@ -2040,7 +2040,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
.facilityClass = FACILITY_CLASS_PARASOL_LADY,
.unused = 0,
.speechBefore = {EC_WORD_HI, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_UPBEAT, EC_WORD_QUES},
.speechWin = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_WELL, EC_WORD_QUES, 0xFFFF},
.speechWin = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_WELL, EC_WORD_QUES, EC_EMPTY_WORD},
.speechLose = {EC_WORD_I, EC_WORD_CAN, EC_WORD_SEE, EC_WORD_YOU_RE, EC_WORD_FEELING, EC_WORD_GREAT},
.speechAfter = {EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_LOOK, EC_WORD_READY, EC_WORD_TO, EC_WORD_HUSTLE},
.mons =
@ -2380,8 +2380,8 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
.facilityClass = FACILITY_CLASS_RICH_BOY,
.unused = 0,
.speechBefore = {EC_WORD_GET, EC_WORD_READY, EC_WORD_FOR, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_TIME},
.speechWin = {EC_WORD_HEY, EC_WORD_HEY, EC_WORD_EXCL, EC_WORD_WHAT_S_UP_QUES, 0xFFFF, 0xFFFF},
.speechLose = {EC_WORD_AWW, EC_WORD_COULDN_T, EC_WORD_YOU, EC_WORD_LET_ME_WIN, EC_WORD_QUES, 0xFFFF},
.speechWin = {EC_WORD_HEY, EC_WORD_HEY, EC_WORD_EXCL, EC_WORD_WHAT_S_UP_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD},
.speechLose = {EC_WORD_AWW, EC_WORD_COULDN_T, EC_WORD_YOU, EC_WORD_LET_ME_WIN, EC_WORD_QUES, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_MY, EC_WORD_SKILL, EC_WORD_QUES},
.mons =
{
@ -2840,10 +2840,10 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
.name = _("FRANCISCO"),
.facilityClass = FACILITY_CLASS_POKEFAN_M,
.unused = 0,
.speechBefore = {EC_WORD_I, EC_WORD_STUDY, EC_WORD_EVERY, EC_WORD_DAY, EC_WORD_TOO, 0xFFFF},
.speechWin = {EC_WORD_SO, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_LOSE, 0xFFFF},
.speechBefore = {EC_WORD_I, EC_WORD_STUDY, EC_WORD_EVERY, EC_WORD_DAY, EC_WORD_TOO, EC_EMPTY_WORD},
.speechWin = {EC_WORD_SO, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_LOSE, EC_EMPTY_WORD},
.speechLose = {EC_WORD_NO, EC_WORD_WONDER, EC_WORD_I, EC_WORD_COULDN_T, EC_WORD_BEAT, EC_WORD_YOU},
.speechAfter = {EC_WORD_YES, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_THANK_YOU, 0xFFFF, 0xFFFF},
.speechAfter = {EC_WORD_YES, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_THANK_YOU, EC_EMPTY_WORD, EC_EMPTY_WORD},
.mons =
{
[0] =
@ -3023,10 +3023,10 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = {
.name = _("MEREDITH"),
.facilityClass = FACILITY_CLASS_PKMN_RANGER_F,
.unused = 0,
.speechBefore = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I, EC_WORD_ELLIPSIS, 0xFFFF},
.speechWin = {EC_WORD_OH, EC_WORD_EXCL, 0xFFFF, EC_WORD_UM, EC_WORD_ELLIPSIS, EC_WORD_YAY},
.speechLose = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_WAAAH, EC_WORD_ELLIPSIS, 0xFFFF},
.speechAfter = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_ELLIPSIS},
.speechBefore = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_ELLIPSIS, EC_EMPTY_WORD},
.speechWin = {EC_WORD_OH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_UM, EC_WORD_ELLIPSIS, EC_WORD_YAY},
.speechLose = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_WAAAH, EC_WORD_ELLIPSIS, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_ELLIPSIS},
.mons =
{
[0] =
@ -4948,8 +4948,8 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
.unused = 0,
.speechBefore = {EC_WORD_OH_DEAR, EC_WORD_THIS, EC_WORD_MATCH, EC_WORD_IS, EC_WORD_FOR, EC_WORD_YOU},
.speechWin = {EC_WORD_OH_DEAR, EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES},
.speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SORRY, 0xFFFF, 0xFFFF},
.speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDMOTHER, EC_WORD_STRONG, EC_WORD_QUES, 0xFFFF},
.speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SORRY, EC_EMPTY_WORD, EC_EMPTY_WORD},
.speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDMOTHER, EC_WORD_STRONG, EC_WORD_QUES, EC_EMPTY_WORD},
.mons =
{
[0] =
@ -5094,7 +5094,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
.speechBefore = {EC_WORD_OH_DEAR, EC_WORD_I, EC_WORD_WILL, EC_WORD_WIN, EC_WORD_FOR, EC_WORD_YOU},
.speechWin = {EC_WORD_OH_DEAR, EC_WORD_WE, EC_WORD_HAVE, EC_WORD_A, EC_WORD_PARTY, EC_WORD_LATER},
.speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_TO, EC_WORD_DISAPPOINT, EC_WORD_YOU},
.speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDFATHER, EC_WORD_COOL, EC_WORD_QUES, 0xFFFF},
.speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDFATHER, EC_WORD_COOL, EC_WORD_QUES, EC_EMPTY_WORD},
.mons =
{
[0] =
@ -5271,7 +5271,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
.speechBefore = {EC_WORD_WAAAH, EC_WORD_THIS, EC_WORD_IS, EC_WORD_SO, EC_WORD_EXCITING, EC_WORD_EXCL},
.speechWin = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_HAPPY, EC_WORD_I, EC_WORD_WON},
.speechLose = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SAD, EC_WORD_I, EC_WORD_LOST},
.speechAfter = {EC_WORD_WAAAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_GO, EC_WORD_AWAY, EC_WORD_EXCL},
.speechAfter = {EC_WORD_WAAAH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_GO, EC_WORD_AWAY, EC_WORD_EXCL},
.mons =
{
[0] =
@ -5410,7 +5410,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
.facilityClass = FACILITY_CLASS_PKMN_RANGER_M,
.unused = 0,
.speechBefore = {EC_WORD_WAHAHAHA, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_STOP, EC_WORD_ME, EC_WORD_EXCL},
.speechWin = {EC_WORD_WOWEE, EC_WORD_EXCL, 0xFFFF, EC_WORD_I_AM, EC_WORD_AWESOME, EC_WORD_COOL},
.speechWin = {EC_WORD_WOWEE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_AWESOME, EC_WORD_COOL},
.speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_COOL, EC_WORD_AT, EC_WORD_ALL, EC_WORD_EXCL},
.speechAfter = {EC_WORD_HEHEHE, EC_WORD_THAT_WAS, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_BATTLE, EC_WORD_EXCL},
.mons =

File diff suppressed because it is too large Load Diff

View File

@ -1479,7 +1479,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_ORANGE_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_ORANGE_MAIL),
},
[ITEM_HARBOR_MAIL] =
@ -1491,7 +1491,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_HARBOR_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_HARBOR_MAIL),
},
[ITEM_GLITTER_MAIL] =
@ -1503,7 +1503,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_GLITTER_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_GLITTER_MAIL),
},
[ITEM_MECH_MAIL] =
@ -1515,7 +1515,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_MECH_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_MECH_MAIL),
},
[ITEM_WOOD_MAIL] =
@ -1527,7 +1527,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_WOOD_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_WOOD_MAIL),
},
[ITEM_WAVE_MAIL] =
@ -1539,7 +1539,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_WAVE_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_WAVE_MAIL),
},
[ITEM_BEAD_MAIL] =
@ -1551,7 +1551,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_BEAD_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_BEAD_MAIL),
},
[ITEM_SHADOW_MAIL] =
@ -1563,7 +1563,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_SHADOW_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_SHADOW_MAIL),
},
[ITEM_TROPIC_MAIL] =
@ -1575,7 +1575,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_TROPIC_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_TROPIC_MAIL),
},
[ITEM_DREAM_MAIL] =
@ -1587,7 +1587,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_DREAM_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_DREAM_MAIL),
},
[ITEM_FAB_MAIL] =
@ -1599,7 +1599,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_FAB_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_FAB_MAIL),
},
[ITEM_RETRO_MAIL] =
@ -1611,7 +1611,7 @@ const struct Item gItems[] =
.pocket = POCKET_ITEMS,
.type = ITEM_USE_MAIL,
.fieldUseFunc = ItemUseOutOfBattle_Mail,
.secondaryId = ITEM_RETRO_MAIL - FIRST_MAIL_INDEX,
.secondaryId = ITEM_TO_MAIL(ITEM_RETRO_MAIL),
},
// Berries

View File

@ -53,7 +53,7 @@ static const u16 sQuizLadyQuestion3[] =
EC_WORD_POKEMON,
EC_WORD_EVOLVE,
EC_WORD_QUES,
0xFFFF,
EC_EMPTY_WORD,
EC_WORD_LEVEL,
EC_WORD_INSOMNIA,
EC_WORD_CUTE_CHARM
@ -92,7 +92,7 @@ static const u16 sQuizLadyQuestion6[] =
EC_WORD_STOP,
EC_MOVE2(CONFUSION),
EC_WORD_QUES,
0xFFFF,
EC_EMPTY_WORD,
EC_WORD_ILLUMINATE,
EC_WORD_OWN_TEMPO,
EC_WORD_SWIFT_SWIM
@ -118,7 +118,7 @@ static const u16 sQuizLadyQuestion8[] =
EC_MOVE2(BLOCK),
EC_WORD_ESCAPE,
EC_WORD_QUES,
0xFFFF,
EC_EMPTY_WORD,
EC_WORD_RUN_AWAY,
EC_WORD_SHADOW_TAG,
EC_WORD_WONDER_GUARD
@ -131,7 +131,7 @@ static const u16 sQuizLadyQuestion9[] =
EC_WORD_STOP,
EC_WORD_POISON,
EC_WORD_QUES,
0xFFFF,
EC_EMPTY_WORD,
EC_WORD_GUTS,
EC_WORD_IMMUNITY,
EC_WORD_SHED_SKIN
@ -144,7 +144,7 @@ static const u16 sQuizLadyQuestion10[] =
EC_WORD_WITH,
EC_WORD_CENTER,
EC_WORD_QUES,
0xFFFF,
EC_EMPTY_WORD,
EC_WORD_POKEDEX,
EC_WORD_POKEMON,
EC_WORD_POKENAV
@ -157,7 +157,7 @@ static const u16 sQuizLadyQuestion11[] =
EC_WORD_YOUR,
EC_WORD_POKEMON,
EC_WORD_QUES,
0xFFFF,
EC_EMPTY_WORD,
EC_WORD_PC,
EC_WORD_DEPT_STORE,
EC_WORD_TELEVISION
@ -199,7 +199,7 @@ static const u16 sQuizLadyQuestion14[] =
EC_WORD_QUES,
EC_WORD_ICE,
EC_WORD_GROUND,
0xFFFF
EC_EMPTY_WORD
};
static const u16 sQuizLadyQuestion15[] =
@ -212,7 +212,7 @@ static const u16 sQuizLadyQuestion15[] =
EC_WORD_QUES,
EC_WORD_PSYCHIC,
EC_WORD_FIGHTING,
0xFFFF
EC_EMPTY_WORD
};
static const u16 sQuizLadyQuestion16[] =
@ -225,7 +225,7 @@ static const u16 sQuizLadyQuestion16[] =
EC_WORD_QUES,
EC_WORD_NORMAL,
EC_WORD_DARK,
0xFFFF
EC_EMPTY_WORD
};
static const u16 *const sQuizLadyQuizQuestions[] =

View File

@ -1070,7 +1070,7 @@ static const u16 sIngameTradeMail[][MAIL_WORDS_COUNT + 1] =
EC_WORD_THANK_YOU,
EC_WORD_FOR,
EC_POKEMON(SKITTY),
EC_POKEMON2(MEOWTH),
EC_POKEMON_NATIONAL(MEOWTH),
EC_WORD_CRIES,
EC_WORD_IN,
EC_WORD_A,

View File

@ -925,7 +925,7 @@ static void DecorationItemsMenu_PrintDecorationInUse(u8 windowId, s32 itemIndex,
static void AddDecorationItemsScrollIndicators(void)
{
if (sDecorationItemsMenu->scrollIndicatorsTaskId == 0xFF)
if (sDecorationItemsMenu->scrollIndicatorsTaskId == TASK_NONE)
{
sDecorationItemsMenu->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized(
SCROLL_ARROW_UP,
@ -941,10 +941,10 @@ static void AddDecorationItemsScrollIndicators(void)
static void RemoveDecorationItemsScrollIndicators(void)
{
if (sDecorationItemsMenu->scrollIndicatorsTaskId != 0xFF)
if (sDecorationItemsMenu->scrollIndicatorsTaskId != TASK_NONE)
{
RemoveScrollIndicatorArrowPair(sDecorationItemsMenu->scrollIndicatorsTaskId);
sDecorationItemsMenu->scrollIndicatorsTaskId = 0xFF;
sDecorationItemsMenu->scrollIndicatorsTaskId = TASK_NONE;
}
}
@ -960,7 +960,7 @@ static void InitDecorationItemsWindow(u8 taskId)
AddDecorationWindow(WINDOW_DECORATION_CATEGORY_ITEMS);
ShowDecorationCategorySummaryWindow(sCurDecorationCategory);
sDecorationItemsMenu = AllocZeroed(sizeof(*sDecorationItemsMenu));
sDecorationItemsMenu->scrollIndicatorsTaskId = 0xFF;
sDecorationItemsMenu->scrollIndicatorsTaskId = TASK_NONE;
InitDecorationItemsMenuLimits();
InitDecorationItemsMenuScrollAndCursor();
InitDecorationItemsMenuScrollAndCursor2();

View File

@ -90,7 +90,7 @@ void UpdateDewfordTrendPerDay(u16 a)
}
bool8 sub_81226D8(u16 *a)
bool8 IsPhraseTrendy(u16 *a)
{
struct EasyChatPair s = {0};
u16 i;

View File

@ -84,7 +84,7 @@ void CB2_ShowDiploma(void)
CopyBgTilemapBufferToVram(1);
DisplayDiplomaText();
BlendPalettes(-1, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
EnableInterrupts(1);
SetVBlankCallback(VBlankCB);
SetMainCallback2(MainCB2);
@ -109,7 +109,7 @@ static void Task_DiplomaWaitForKeyPress(u8 taskId)
{
if (JOY_NEW(A_BUTTON | B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_DiplomaFadeOut;
}
}

View File

@ -590,8 +590,8 @@ static void sub_8024BC8(u8 taskId)
gUnknown_02022C98->unk0C++;
break;
case 6:
BlendPalettes(0xFFFFFFFF, 0x10, 0x00);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BlendPalettes(PALETTES_ALL, 0x10, 0x00);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, 0);
SetVBlankCallback(sub_80261E4);
gUnknown_02022C98->unk0C++;
break;
@ -1110,7 +1110,7 @@ static void sub_80256AC(void)
switch (gUnknown_02022C98->unk10)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, 0);
gUnknown_02022C98->unk10++;
break;
case 1:
@ -1147,7 +1147,7 @@ static void sub_8025758(void)
{
case 0:
sub_80292E0(9);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, 0);
gUnknown_02022C98->unk10++;
break;
case 1:
@ -1178,8 +1178,8 @@ static void sub_8025758(void)
gUnknown_02022C98->unk10++;
break;
case 5:
BlendPalettes(0xFFFFFFFF, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BlendPalettes(PALETTES_ALL, 16, 0);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, 0);
gUnknown_02022C98->unk10++;
break;
case 6:

File diff suppressed because it is too large Load Diff

View File

@ -597,7 +597,7 @@ static void CB2_EggHatch_1(void)
switch (sEggHatchData->CB2_state)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
sEggHatchData->eggSpriteID = CreateSprite(&sSpriteTemplate_EggHatch, 120, 75, 5);
ShowBg(0);
ShowBg(1);
@ -680,7 +680,7 @@ static void CB2_EggHatch_1(void)
}
break;
case 11:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
sEggHatchData->CB2_state++;
break;
case 12:
@ -790,7 +790,7 @@ static void SpriteCB_Egg_4(struct Sprite* sprite)
{
s16 i;
if (sprite->data[0] == 0)
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 0x10, RGB_WHITEALPHA);
if (sprite->data[0] < 4u)
{
for (i = 0; i <= 3; i++)
@ -814,7 +814,7 @@ static void SpriteCB_Egg_5(struct Sprite* sprite)
StartSpriteAffineAnim(&gSprites[sEggHatchData->pokeSpriteID], 1);
}
if (sprite->data[0] == 8)
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0x10, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, -1, 0x10, 0, RGB_WHITEALPHA);
if (sprite->data[0] <= 9)
gSprites[sEggHatchData->pokeSpriteID].pos1.y -= 1;
if (sprite->data[0] > 40)

View File

@ -134,10 +134,10 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = {
.name = __("ハルヒト$$$$ "),
.facilityClass = FACILITY_CLASS_CAMPER,
.unused = 0x1,
.speechBefore = { EC_MOVE2(BOUNCE), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_STRONG, EC_WORD_EXCL },
.speechWin = { EC_MOVE(FLY), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_HAPPY, EC_WORD_EXCL },
.speechLose = { EC_MOVE2(MINIMIZE), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_SAD, EC_WORD_EXCL },
.speechAfter = { EC_MOVE(BITE), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_ANGRY, EC_WORD_EXCL },
.speechBefore = { EC_MOVE2(BOUNCE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_STRONG, EC_WORD_EXCL },
.speechWin = { EC_MOVE(FLY), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_HAPPY, EC_WORD_EXCL },
.speechLose = { EC_MOVE2(MINIMIZE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_SAD, EC_WORD_EXCL },
.speechAfter = { EC_MOVE(BITE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_ANGRY, EC_WORD_EXCL },
.mons = {
[0] = NULL_BATTLE_TOWER_POKEMON,
[1] = NULL_BATTLE_TOWER_POKEMON,
@ -223,7 +223,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = {
.speechBefore = { EC_WORD_SHINE, EC_WORD_POKEMON, EC_WORD_RELEASE, EC_WORD_WAS, EC_MOVE2(FRUSTRATION), EC_WORD_WITHOUT },
.speechWin = { EC_WORD_SHINE, EC_WORD_POKEMON, EC_WORD_TO_HER, EC_MOVE2(PRESENT), EC_WORD_KNOWS, EC_WORD_WITHOUT },
.speechLose = { EC_WORD_THAT, EC_WORD_ABOVE, EC_WORD_LOST, EC_WORD_STORES, EC_WORD_JOKING, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS },
.speechAfter = { EC_WORD_ENTERTAINING, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_ALMOST, EC_WORD_EXCL, 0xFFFF },
.speechAfter = { EC_WORD_ENTERTAINING, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_ALMOST, EC_WORD_EXCL, EC_EMPTY_WORD },
.mons = {
[0] = NULL_BATTLE_TOWER_POKEMON,
[1] = NULL_BATTLE_TOWER_POKEMON,
@ -307,7 +307,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = {
.facilityClass = FACILITY_CLASS_GENTLEMAN,
.unused = 0x1,
.speechBefore = { EC_WORD_SHE_WAS, EC_WORD_NO_1, EC_WORD_STRONG, EC_WORD_UNCLE, EC_WORD_THERE, EC_WORD_EXCL },
.speechWin = { EC_WORD_HAHAHA, EC_WORD_TEACHER, EC_WORD_BECOMES, EC_WORD_GIVE, EC_WORD_IS_IT_QUES, 0xFFFF },
.speechWin = { EC_WORD_HAHAHA, EC_WORD_TEACHER, EC_WORD_BECOMES, EC_WORD_GIVE, EC_WORD_IS_IT_QUES, EC_EMPTY_WORD },
.speechLose = { EC_WORD_OUTSIDE, EC_WORD_UNCLE, EC_WORD_SURPRISE, EC_WORD_THESE, EC_WORD_HEY_QUES, EC_WORD_ELLIPSIS_EXCL },
.speechAfter = { EC_WORD_HE_S, EC_WORD_NO_1, EC_WORD_STRONG, EC_WORD_CHILDREN, EC_WORD_CAN_T, EC_WORD_EXCL_EXCL },
.mons = {

View File

@ -32,6 +32,7 @@
#include "constants/battle_string_ids.h"
#include "constants/songs.h"
#include "constants/rgb.h"
#include "constants/items.h"
struct EvoInfo
{
@ -171,7 +172,7 @@ static void Task_BeginEvolutionScene(u8 taskId)
switch (gTasks[taskId].tState)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState++;
break;
case 1:
@ -368,7 +369,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
SetVBlankCallback(VBlankCB_EvolutionScene);
SetMainCallback2(CB2_EvolutionSceneUpdate);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
ShowBg(0);
ShowBg(1);
@ -448,11 +449,11 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
BlendPalettes(-1,0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, 0);
gMain.state++;
break;
case 7:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
InitTradeSequenceBgGpuRegs();
ShowBg(0);
ShowBg(1);
@ -565,7 +566,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data);
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_STATUS, &data);
data = 0xFF;
data = MAIL_NONE;
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MAIL, &data);
CalculateMonStats(&gPlayerParty[gPlayerPartyCount]);
@ -652,7 +653,7 @@ static void Task_EvolutionScene(u8 taskId)
switch (gTasks[taskId].tState)
{
case EVOSTATE_FADE_IN:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gSprites[sEvoStructPtr->preEvoSpriteId].invisible = FALSE;
gTasks[taskId].tState++;
ShowBg(0);
@ -801,7 +802,7 @@ static void Task_EvolutionScene(u8 taskId)
}
else // no move to learn, or evolution was canceled
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState++;
}
}
@ -945,7 +946,7 @@ static void Task_EvolutionScene(u8 taskId)
// YES
gTasks[taskId].tLearnMoveState = gTasks[taskId].tLearnMoveYesState;
if (gTasks[taskId].tLearnMoveState == MVSTATE_SHOW_MOVE_SELECT)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
}
}
if (JOY_NEW(B_BUTTON))
@ -1322,7 +1323,7 @@ static void Task_TradeEvolutionScene(u8 taskId)
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskId].tLearnMoveState = gTasks[taskId].tLearnMoveYesState;
if (gTasks[taskId].tLearnMoveState == T_MVSTATE_SHOW_MOVE_SELECT)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
break;
case 1: // NO
case MENU_B_PRESSED:
@ -1646,7 +1647,7 @@ static void PauseBgPaletteAnim(void)
{
u8 taskId = FindTaskIdByFunc(Task_UpdateBgPalette);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
gTasks[taskId].tPaused = TRUE;
FillPalette(0, 0xA0, 0x20);
@ -1658,9 +1659,9 @@ static void StopBgAnimation(void)
{
u8 taskId;
if ((taskId = FindTaskIdByFunc(Task_UpdateBgPalette)) != 0xFF)
if ((taskId = FindTaskIdByFunc(Task_UpdateBgPalette)) != TASK_NONE)
DestroyTask(taskId);
if ((taskId = FindTaskIdByFunc(Task_AnimateBg)) != 0xFF)
if ((taskId = FindTaskIdByFunc(Task_AnimateBg)) != TASK_NONE)
DestroyTask(taskId);
FillPalette(0, 0xA0, 0x20);

View File

@ -3703,8 +3703,8 @@ static void DestroyDeoxysRockEffect_RockFragments(s16* data, u8 taskId)
{
struct Sprite *sprite = &gSprites[gObjectEvents[tObjectEventId].spriteId];
gObjectEvents[tObjectEventId].invisible = TRUE;
BlendPalettes(0x0000FFFF, 0x10, RGB_WHITE);
BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, RGB_WHITE);
BlendPalettes(PALETTES_BG, 0x10, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_BG, 0, 0x10, 0, RGB_WHITE);
CreateDeoxysRockFragments(sprite);
PlaySE(SE_THUNDER);
StartEndingDeoxysRockCameraShake(tCameraTaskId);

View File

@ -55,7 +55,7 @@ static void CreateTask_DrawFieldMessage(void)
static void DestroyTask_DrawFieldMessage(void)
{
u8 taskId = FindTaskIdByFunc(Task_DrawFieldMessage);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
DestroyTask(taskId);
}

View File

@ -156,7 +156,7 @@ static void FieldUpdateRegionMap(void)
ScheduleBgCopyTilemapToVram(0);
DrawStdFrameWithCustomTileAndPalette(0, 0, 0x27, 0xd);
PrintRegionMapSecName();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
sFieldRegionMapHandler->state++;
break;
case 2:
@ -184,7 +184,7 @@ static void FieldUpdateRegionMap(void)
}
break;
case 5:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
sFieldRegionMapHandler->state++;
break;
case 6:

View File

@ -2667,7 +2667,7 @@ static void ScrollableMultichoice_MoveCursor(s32 itemIndex, bool8 onInit, struct
u8 taskId;
PlaySE(SE_SELECT);
taskId = FindTaskIdByFunc(ScrollableMultichoice_ProcessInput);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
{
u16 selection;
struct Task *task = &gTasks[taskId];
@ -2753,7 +2753,7 @@ static void sub_813A600(u8 taskId)
void sub_813A630(void)
{
u8 taskId = FindTaskIdByFunc(sub_813A600);
if (taskId == 0xFF)
if (taskId == TASK_NONE)
{
EnableBothScriptContexts();
}
@ -3262,7 +3262,7 @@ void sub_813ADD4(void)
u16 scrollOffset, selectedRow;
u8 i;
u8 taskId = FindTaskIdByFunc(sub_813A600);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
{
struct Task *task = &gTasks[taskId];
ListMenuGetScrollAndRow(task->tListTaskId, &scrollOffset, &selectedRow);
@ -3321,7 +3321,7 @@ void GetBattleFrontierTutorMoveIndex(void)
void sub_813AF48(void)
{
u8 taskId = FindTaskIdByFunc(sub_813A600);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
{
struct Task *task = &gTasks[taskId];
DestroyListMenuTask(task->tListTaskId, NULL, NULL);

View File

@ -174,7 +174,7 @@ void SetUpFieldTasks(void)
void ActivatePerStepCallback(u8 callbackId)
{
u8 taskId = FindTaskIdByFunc(Task_RunPerStepCallback);
if (taskId != 0xff)
if (taskId != TASK_NONE)
{
s32 i;
s16 *data = gTasks[taskId].data;
@ -199,12 +199,12 @@ void ResetFieldTasksArgs(void)
s16 *data;
taskId = FindTaskIdByFunc(Task_RunPerStepCallback);
if (taskId != 0xff)
if (taskId != TASK_NONE)
{
data = gTasks[taskId].data;
}
taskId = FindTaskIdByFunc(Task_RunTimeBasedEvents);
if (taskId != 0xff)
if (taskId != TASK_NONE)
{
data = gTasks[taskId].data;
data[1] = 0;

View File

@ -782,7 +782,7 @@ void FadeScreen(u8 mode, s8 delay)
if (useWeatherPal)
CpuFastCopy(gPlttBufferFaded, gPlttBufferUnfaded, 0x400);
BeginNormalPaletteFade(0xFFFFFFFF, delay, 0, 16, fadeColor);
BeginNormalPaletteFade(PALETTES_ALL, delay, 0, 16, fadeColor);
gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_OUT;
}
else
@ -791,7 +791,7 @@ void FadeScreen(u8 mode, s8 delay)
if (useWeatherPal)
gWeatherPtr->fadeScreenCounter = 0;
else
BeginNormalPaletteFade(0xFFFFFFFF, delay, 16, 0, fadeColor);
BeginNormalPaletteFade(PALETTES_ALL, delay, 16, 0, fadeColor);
gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_IN;
gWeatherPtr->unknown_6CA = 1;

View File

@ -387,7 +387,7 @@ static void Task_ComputerScreenOpenEffect(u8 taskId)
task->tWinRight = DISPLAY_WIDTH;
SetGpuReg(REG_OFFSET_BLDY, 0);
SetGpuReg(REG_OFFSET_BLDCNT, task->tBlendCnt);
BlendPalettes(0xFFFFFFFF, 0, 0);
BlendPalettes(PALETTES_ALL, 0, 0);
gPlttBufferFaded[0] = 0;
}
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWinLeft, task->tWinRight));
@ -463,7 +463,7 @@ static void Task_ComputerScreenCloseEffect(u8 taskId)
{
task->tWinLeft = DISPLAY_WIDTH / 2;
task->tWinRight = DISPLAY_WIDTH / 2;
BlendPalettes(-1, 16, 0);
BlendPalettes(PALETTES_ALL, 16, 0);
gPlttBufferFaded[0] = 0;
}
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWinLeft, task->tWinRight));

View File

@ -751,8 +751,8 @@ static bool32 InitFrontierPass(void)
ShowBg(2);
LoadCursorAndSymbolSprites();
SetVBlankCallback(VblankCb_FrontierPass);
BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
break;
case 10:
AnimateSprites();
@ -775,7 +775,7 @@ static bool32 HideFrontierPass(void)
case 0:
if (sPassData->unkE != 1 && sPassData->unkE != 2)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
}
else
{
@ -1023,7 +1023,7 @@ static void Task_DoFadeEffect(u8 taskId)
data[2] = Q_8_8(1);
data[3] = 0x15;
data[4] = 0x15;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITE);
}
else
{
@ -1037,8 +1037,8 @@ static void Task_DoFadeEffect(u8 taskId)
ShowBg(2);
LoadCursorAndSymbolSprites();
SetVBlankCallback(VblankCb_FrontierPass);
BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE);
BlendPalettes(PALETTES_ALL, 0x10, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITE);
}
sPassGfx->setAffine = TRUE;
sPassGfx->unk2E = MathUtil_Inv16(data[1]);
@ -1366,8 +1366,8 @@ static bool32 InitFrontierMap(void)
ShowBg(2);
InitFrontierMapSprites();
SetVBlankCallback(VblankCb_FrontierPass);
BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE);
BlendPalettes(PALETTES_ALL, 0x10, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITE);
break;
case 7:
if (UpdatePaletteFade())
@ -1385,7 +1385,7 @@ static bool32 ExitFrontierMap(void)
switch (sPassData->state)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITE);
break;
case 1:
if (UpdatePaletteFade())

View File

@ -1361,11 +1361,11 @@ static const u8 sEmpty1[0x200] = {0};
const u8 gBerryBlenderPlayerArrow_Gfx[] = INCBIN_U8("graphics/berry_blender/arrow.4bpp");
static const u8 sEmpty2[0x2C0] = {0};
const u16 gEasyChatCursor_Pal[] = INCBIN_U16("graphics/easy_chat/cursor.gbapal");
const u32 gEasyChatCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/cursor.4bpp.lz");
const u16 gEasyChatRectangleCursor_Pal[] = INCBIN_U16("graphics/easy_chat/rectangle_cursor.gbapal");
const u32 gEasyChatRectangleCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/rectangle_cursor.4bpp.lz");
const u16 gEasyChatRightWindow_Pal[] = INCBIN_U16("graphics/easy_chat/rwindow.gbapal");
const u32 gEasyChatRightWindow_Gfx[] = INCBIN_U32("graphics/easy_chat/rwindow.4bpp.lz");
const u16 gEasyChatButtonWindow_Pal[] = INCBIN_U16("graphics/easy_chat/button_window.gbapal");
const u32 gEasyChatButtonWindow_Gfx[] = INCBIN_U32("graphics/easy_chat/button_window.4bpp.lz");
const u32 gEasyChatMode_Gfx[] = INCBIN_U32("graphics/easy_chat/mode.4bpp.lz");
const u16 gEasyChatMode_Pal[] = INCBIN_U16("graphics/easy_chat/mode.gbapal");

View File

@ -386,7 +386,7 @@ static bool8 InitHallOfFameScreen(void)
if (!sub_8175024())
{
SetVBlankCallback(VBlankCB_HallOfFame);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gMain.state++;
}
break;
@ -464,11 +464,11 @@ static void Task_Hof_InitMonData(u8 taskId)
sHofFadePalettes = 0;
gTasks[taskId].tDisplayedMonId = 0;
gTasks[taskId].tPlayerSpriteID = 0xFF;
gTasks[taskId].tPlayerSpriteID = SPRITE_NONE;
for (i = 0; i < PARTY_SIZE; i++)
{
gTasks[taskId].tMonSpriteId(i) = 0xFF;
gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE;
}
if (gTasks[taskId].tDontSaveData)
@ -639,10 +639,10 @@ static void Task_Hof_PaletteFadeAndPrintWelcomeText(u8 taskId)
{
u16 i;
BeginNormalPaletteFade(0xFFFF0000, 0, 0, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_OBJECTS, 0, 0, 0, RGB_BLACK);
for (i = 0; i < PARTY_SIZE; i++)
{
if (gTasks[taskId].tMonSpriteId(i) != 0xFF)
if (gTasks[taskId].tMonSpriteId(i) != SPRITE_NONE)
gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 0;
}
@ -668,7 +668,7 @@ static void Task_Hof_DoConfetti(u8 taskId)
u16 i;
for (i = 0; i < PARTY_SIZE; i++)
{
if (gTasks[taskId].tMonSpriteId(i) != 0xFF)
if (gTasks[taskId].tMonSpriteId(i) != SPRITE_NONE)
gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 1;
}
BeginNormalPaletteFade(sHofFadePalettes, 0, 12, 12, RGB(16, 29, 24));
@ -739,7 +739,7 @@ static void Task_Hof_ExitOnKeyPressed(u8 taskId)
static void Task_Hof_HandlePaletteOnExit(u8 taskId)
{
CpuCopy16(gPlttBufferFaded, gPlttBufferUnfaded, 0x400);
BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_Hof_HandleExit;
}
@ -752,7 +752,7 @@ static void Task_Hof_HandleExit(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
u8 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
{
FreeOamMatrix(gSprites[spriteId].oam.matrixNum);
FreeAndDestroyMonPicSprite(spriteId);
@ -847,7 +847,7 @@ void CB2_DoHallOfFamePC(void)
for (i = 0; i < PARTY_SIZE; i++)
{
gTasks[taskId].tMonSpriteId(i) = 0xFF;
gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE;
}
sHofMonPtr = AllocZeroed(0x2000);
@ -937,11 +937,11 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId)
}
else
{
gTasks[taskId].tMonSpriteId(i) = 0xFF;
gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE;
}
}
BlendPalettes(0xFFFF0000, 0xC, RGB(16, 29, 24));
BlendPalettes(PALETTES_OBJECTS, 0xC, RGB(16, 29, 24));
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tCurrPageNo, STR_CONV_MODE_RIGHT_ALIGN, 3);
StringExpandPlaceholders(gStringVar4, gText_HOFNumber);
@ -967,7 +967,7 @@ static void Task_HofPC_PrintMonInfo(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
u16 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
gSprites[spriteId].oam.priority = 1;
}
@ -999,10 +999,10 @@ static void Task_HofPC_HandleInput(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
u8 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
{
FreeAndDestroyMonPicSprite(spriteId);
gTasks[taskId].tMonSpriteId(i) = 0xFF;
gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE;
}
}
if (gTasks[taskId].tCurrPageNo != 0)
@ -1060,10 +1060,10 @@ static void Task_HofPC_HandleExit(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
u16 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != 0xFF)
if (spriteId != SPRITE_NONE)
{
FreeAndDestroyMonPicSprite(spriteId);
gTasks[taskId].tMonSpriteId(i) = 0xFF;
gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE;
}
}
@ -1433,7 +1433,7 @@ void DoDomeConfetti(void)
gSpecialVar_0x8004 = 180;
taskId = CreateTask(Task_DoDomeConfetti, 0);
if (taskId != 0xFF)
if (taskId != TASK_NONE)
{
gTasks[taskId].tTimer = gSpecialVar_0x8004;
gSpecialVar_0x8005 = taskId;
@ -1444,7 +1444,7 @@ static void StopDomeConfetti(void)
{
u8 taskId;
if ((taskId = FindTaskIdByFunc(Task_DoDomeConfetti)) != 0xFF)
if ((taskId = FindTaskIdByFunc(Task_DoDomeConfetti)) != TASK_NONE)
DestroyTask(taskId);
ConfettiUtil_Free();

View File

@ -29,7 +29,7 @@ static void ReshowPCMenuAfterHallOfFamePC(void)
Overworld_PlaySpecialMapMusic();
ScriptMenu_CreatePCMultichoice();
ScriptMenu_DisplayPCStartupPrompt();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
CreateTask(Task_WaitForPaletteFade, 10);
}

View File

@ -152,7 +152,7 @@ void PadNameString(u8 *dest, u8 padChar)
dest[length] = EOS;
}
void sub_81DB52C(u8 *str)
void ConvertInternationalPlayerName(u8 *str)
{
if (StringLength(str) < PLAYER_NAME_LENGTH - 1)
ConvertInternationalString(str, LANGUAGE_JAPANESE);
@ -160,14 +160,14 @@ void sub_81DB52C(u8 *str)
StripExtCtrlCodes(str);
}
void sub_81DB554(u8 *str, u8 arg1)
void ConvertInternationalPlayerNameStripChar(u8 *str, u8 removeChar)
{
u8 *buffer;
if (StringLength(str) < PLAYER_NAME_LENGTH - 1)
{
ConvertInternationalString(str, LANGUAGE_JAPANESE);
}
else if (arg1 == EXT_CTRL_CODE_BEGIN)
else if (removeChar == EXT_CTRL_CODE_BEGIN)
{
StripExtCtrlCodes(str);
}
@ -177,7 +177,7 @@ void sub_81DB554(u8 *str, u8 arg1)
while (buffer[1] != EOS)
buffer++;
while (buffer >= str && buffer[0] == arg1)
while (buffer >= str && buffer[0] == removeChar)
{
buffer[0] = EOS;
buffer--;

View File

@ -1006,7 +1006,7 @@ static u8 SetUpCopyrightScreen(void)
ResetTasks();
ResetSpriteData();
FreeAllSpritePalettes();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA);
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0)
| BGCNT_CHARBASE(0)
| BGCNT_SCREENBASE(7)
@ -1026,7 +1026,7 @@ static u8 SetUpCopyrightScreen(void)
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
if (gMultibootProgramStruct.gcmb_field_2 != 1)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gMain.state++;
}
break;
@ -1121,7 +1121,7 @@ static void Task_IntroLoadPart1Graphics(u8 taskId)
static void Task_IntroFadeIn(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
SetVBlankCallback(VBlankCB_Intro);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON);
gTasks[taskId].func = Task_IntroWaterDrops;
@ -1232,7 +1232,7 @@ static void Task_IntroScrollDownAndShowFlygon(u8 taskId)
//fade to white
if (gIntroFrameCounter > 1007)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITEALPHA);
gTasks[taskId].func = Task_IntroWaitToSetupPart2;
}
}
@ -1291,7 +1291,7 @@ static void Task_IntroStartBikeRide(u8 taskId)
spriteId = intro_create_flygon_sprite(-0x40, 0x3C);
gSprites[spriteId].callback = SpriteCB_IntroGraphicsFlygon;
gTasks[taskId].data[2] = spriteId;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA);
SetVBlankCallback(VBlankCB_Intro);
gTasks[taskId].data[0] = CreateBicycleAnimationTask(1, 0x4000, 0x400, 0x10);
sub_817B150(1);
@ -1310,7 +1310,7 @@ static void Task_IntroHandleBikeAndFlygonMovement(u8 taskId)
}
if (gIntroFrameCounter > 1946)
{
BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 16, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 16, RGB_WHITEALPHA);
gTasks[taskId].func = Task_IntroWaitToSetupPart3;
}
if (gIntroFrameCounter == 1109)
@ -1554,7 +1554,7 @@ static void Task_IntroLoadPart3Graphics(u8 taskId)
PanFadeAndZoomScreen(0x78, 0x50, 0, 0);
ResetSpriteData();
FreeAllSpritePalettes();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA);
SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(8) | BGCNT_256COLOR | BGCNT_AFF256x256);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON);
gTasks[taskId].func = Task_IntroSpinAndZoomPokeball;
@ -1579,7 +1579,7 @@ static void Task_IntroSpinAndZoomPokeball(u8 taskId)
PanFadeAndZoomScreen(0x78, 0x50, 0x10000 / gTasks[taskId].data[1], gTasks[taskId].data[0]);
if (gIntroFrameCounter == 28)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA);
}
static void Task_IntroWaitToSetupPart3LegendsFight(u8 taskId)
@ -1630,7 +1630,7 @@ static void Task_IntroLoadPart3Graphics1(u8 taskId)
| DISPCNT_BG2_ON
| DISPCNT_OBJ_ON
| DISPCNT_WIN0_ON);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA);
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = 0xFFA0;
gTasks[taskId].data[2] = 0xFF51;
@ -1749,7 +1749,7 @@ static void Task_IntroGroudonScene(u8 taskId)
data[3] = Sin((data[6] & 0xFF00) >> 8, 0x40) + 0x100;
if (data[1] == 0x78)
{
BeginNormalPaletteFade(0xFFFFFFFE, 3, 0, 16, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_ALL & ~1, 3, 0, 16, RGB_WHITE);
data[3] = 0x100;
data[4] = 0;
data[0]++;
@ -1824,7 +1824,7 @@ static void Task_IntroLoadKyogreScene(u8 taskId)
LZDecompressVram(gIntro3KyogreBgTilemap, (void *)(BG_SCREEN_ADDR(28)));
LoadCompressedSpriteSheet(gUnknown_085E4C88);
LoadSpritePalette(gUnknown_085E4C98);
BeginNormalPaletteFade(0xFFFFFFFE, 0, 0x10, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL & ~1, 0, 0x10, 0, RGB_WHITEALPHA);
gTasks[taskId].func = Task_IntroKyogreScene;
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = 0x150;
@ -1958,7 +1958,7 @@ static void Task_IntroKyogreScene(u8 taskId)
gTasks[taskId].data[1] = Sin(data[6], 0x3C) + 0x58;
if (data[6] == 0x40)
{
BeginNormalPaletteFade(0xFFFFFFFE, 3, 0, 16, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_ALL & ~1, 3, 0, 16, RGB_WHITE);
data[0]++;
}
break;
@ -2117,14 +2117,14 @@ static void Task_IntroCloudScene(u8 taskId)
case 0:
if (--data[6] == 0)
{
BeginNormalPaletteFade(0xFFFFFFFE, 0, 16, 0, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL & ~1, 0, 16, 0, RGB_WHITEALPHA);
data[6] = 0x5000;
data[0]++;
}
break;
case 1:
if (data[6] == 0x2800)
BeginNormalPaletteFade(0x0000FFFE, 3, 0, 16, RGB(9, 10, 10));
BeginNormalPaletteFade(PALETTES_BG & ~1, 3, 0, 16, RGB(9, 10, 10));
if (data[6] != 0)
data[6] -= 0x80;
@ -2236,7 +2236,7 @@ static void Task_IntroLoadRayquazaGlowScene(u8 taskId)
| DISPCNT_OBJ_ON
| DISPCNT_WIN0_ON);
gTasks[taskId].func = Task_IntroRayquazaGlowScene_0;
BeginNormalPaletteFade(0x0000FFDE, 0, 16, 0, RGB(9, 10, 10));
BeginNormalPaletteFade(PALETTES_BG & ~(0x21), 0, 16, 0, RGB(9, 10, 10));
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = 0xA8;
gTasks[taskId].data[2] = -0x10;
@ -2383,7 +2383,7 @@ static void Task_IntroRayquazaGlowScene_1(u8 taskId)
case 4:
if (--data[3] == 0)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_WHITE);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITE);
data[0]++;
}
break;

View File

@ -594,8 +594,8 @@ void GoToBagMenu(u8 location, u8 pocket, void ( *postExitMenuMainCallback2)())
gBagMenu->pocketSwitchDisabled = TRUE;
gBagMenu->exitCallback = NULL;
gBagMenu->itemOriginalLocation = 0xFF;
gBagMenu->pocketScrollArrowsTask = 0xFF;
gBagMenu->pocketSwitchArrowsTask = 0xFF;
gBagMenu->pocketScrollArrowsTask = TASK_NONE;
gBagMenu->pocketSwitchArrowsTask = TASK_NONE;
memset(gBagMenu->spriteId, 0xFF, sizeof(gBagMenu->spriteId));
memset(gBagMenu->windowPointers, 0xFF, 10);
SetMainCallback2(CB2_Bag);
@ -720,11 +720,11 @@ bool8 SetupBagMenu(void)
gMain.state++;
break;
case 19:
BlendPalettes(0xFFFFFFFF, 16, 0);
BlendPalettes(PALETTES_ALL, 16, 0);
gMain.state++;
break;
case 20:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = FALSE;
gMain.state++;
break;
@ -971,7 +971,7 @@ void BagMenu_PrintCursor(u8 y, u8 colorIndex)
void CreatePocketScrollArrowPair(void)
{
if (gBagMenu->pocketScrollArrowsTask == 0xFF)
if (gBagMenu->pocketScrollArrowsTask == TASK_NONE)
gBagMenu->pocketScrollArrowsTask = AddScrollIndicatorArrowPairParameterized(
SCROLL_ARROW_UP,
172,
@ -985,26 +985,26 @@ void CreatePocketScrollArrowPair(void)
void BagDestroyPocketScrollArrowPair(void)
{
if (gBagMenu->pocketScrollArrowsTask != 0xFF)
if (gBagMenu->pocketScrollArrowsTask != TASK_NONE)
{
RemoveScrollIndicatorArrowPair(gBagMenu->pocketScrollArrowsTask);
gBagMenu->pocketScrollArrowsTask = 0xFF;
gBagMenu->pocketScrollArrowsTask = TASK_NONE;
}
BagDestroyPocketSwitchArrowPair();
}
void CreatePocketSwitchArrowPair(void)
{
if (gBagMenu->pocketSwitchDisabled != TRUE && gBagMenu->pocketSwitchArrowsTask == 0xFF)
if (gBagMenu->pocketSwitchDisabled != TRUE && gBagMenu->pocketSwitchArrowsTask == TASK_NONE)
gBagMenu->pocketSwitchArrowsTask = AddScrollIndicatorArrowPair(&sBagScrollArrowsTemplate, &gBagPositionStruct.unk6);
}
void BagDestroyPocketSwitchArrowPair(void)
{
if (gBagMenu->pocketSwitchArrowsTask != 0xFF)
if (gBagMenu->pocketSwitchArrowsTask != TASK_NONE)
{
RemoveScrollIndicatorArrowPair(gBagMenu->pocketSwitchArrowsTask);
gBagMenu->pocketSwitchArrowsTask = 0xFF;
gBagMenu->pocketSwitchArrowsTask = TASK_NONE;
}
}
@ -1018,7 +1018,7 @@ void FreeBagItemListBuffers(void)
void Task_FadeAndCloseBagMenu(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = TaskCloseBagMenu_2;
}
@ -2390,7 +2390,7 @@ u8 sub_81AE124(u8 which)
u8 BagMenu_AddWindow(u8 which)
{
u8 *ptr = &gBagMenu->windowPointers[which];
if (*ptr == 0xFF)
if (*ptr == WINDOW_NONE)
{
*ptr = AddWindow(&sContextMenuWindowTemplates[which]);
DrawStdFrameWithCustomTileAndPalette(*ptr, 0, 1, 14);
@ -2402,20 +2402,20 @@ u8 BagMenu_AddWindow(u8 which)
void BagMenu_RemoveWindow(u8 which)
{
u8 *ptr = &gBagMenu->windowPointers[which];
if (*ptr != 0xFF)
if (*ptr != WINDOW_NONE)
{
ClearStdWindowAndFrameToTransparent(*ptr, FALSE);
ClearWindowTilemap(*ptr);
RemoveWindow(*ptr);
ScheduleBgCopyTilemapToVram(1);
*ptr = 0xFF;
*ptr = WINDOW_NONE;
}
}
u8 AddItemMessageWindow(u8 which)
{
u8 *ptr = &gBagMenu->windowPointers[which];
if (*ptr == 0xFF)
if (*ptr == WINDOW_NONE)
*ptr = AddWindow(&sContextMenuWindowTemplates[which]);
return *ptr;
}
@ -2423,14 +2423,14 @@ u8 AddItemMessageWindow(u8 which)
void BagMenu_RemoveBagItemMessageWindow(u8 which)
{
u8 *ptr = &gBagMenu->windowPointers[which];
if (*ptr != 0xFF)
if (*ptr != WINDOW_NONE)
{
ClearDialogWindowAndFrameToTransparent(*ptr, FALSE);
// This ClearWindowTilemap call is redundant, since ClearDialogWindowAndFrameToTransparent already calls it.
ClearWindowTilemap(*ptr);
RemoveWindow(*ptr);
ScheduleBgCopyTilemapToVram(1);
*ptr = 0xFF;
*ptr = WINDOW_NONE;
}
}

View File

@ -410,13 +410,13 @@ static const struct SpriteTemplate gBerryCheckCircleSpriteTemplate =
void RemoveBagSprite(u8 id)
{
u8 *spriteId = &gBagMenu->spriteId[id];
if (*spriteId != 0xFF)
if (*spriteId != SPRITE_NONE)
{
FreeSpriteTilesByTag(id + 100);
FreeSpritePaletteByTag(id + 100);
FreeSpriteOamMatrix(&gSprites[*spriteId]);
DestroySprite(&gSprites[*spriteId]);
*spriteId = 0xFF;
*spriteId = SPRITE_NONE;
}
}
@ -516,7 +516,7 @@ static void SpriteCB_SwitchPocketRotatingBallContinue(struct Sprite *sprite)
void AddBagItemIconSprite(u16 itemId, u8 id)
{
u8 *spriteId = &gBagMenu->spriteId[id + 2];
if (*spriteId == 0xFF)
if (*spriteId == SPRITE_NONE)
{
u8 iconSpriteId;

View File

@ -379,7 +379,7 @@ u8 GetQuizAuthor(void)
struct LilycoveLadyQuiz *quiz;
quiz = &gSaveBlock1Ptr->lilycoveLady.quiz;
if (sub_811F8D8(quiz->correctAnswer) == 0)
if (IsEasyChatAnswerUnlocked(quiz->correctAnswer) == FALSE)
{
i = quiz->questionId;
do
@ -388,7 +388,7 @@ u8 GetQuizAuthor(void)
{
i = 0;
}
} while (sub_811F8D8(sQuizLadyQuizAnswers[i]) == 0);
} while (IsEasyChatAnswerUnlocked(sQuizLadyQuizAnswers[i]) == FALSE);
for (j = 0; j < QUIZ_QUESTION_LEN; j ++)
{
quiz->question[j] = sQuizLadyQuizQuestions[i][j];

View File

@ -455,7 +455,7 @@ static void LinkTestProcessKeyInput(void)
}
if (JOY_NEW(L_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(2, 0, 0));
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB(2, 0, 0));
}
if (JOY_NEW(START_BUTTON))
{

View File

@ -2643,7 +2643,7 @@ static void sub_8011E2C(u8 taskId)
static void sub_8011E94(u32 a0, u32 a1)
{
u8 taskId = FindTaskIdByFunc(sub_8011E2C);
if (taskId == 0xFF)
if (taskId == TASK_NONE)
{
taskId = CreateTask(sub_8011E2C, 5);
gTasks[taskId].data[0] = a0;
@ -2792,12 +2792,12 @@ void sub_8012188(const u8 *name, struct GFtgtGname *structPtr, u8 activity)
taskId2 = FindTaskIdByFunc(Task_LinkRfu_UnionRoomListen);
if (activity == (ACTIVITY_CHAT | IN_UNION_ROOM))
{
if (taskId2 != 0xFF)
if (taskId2 != TASK_NONE)
gTasks[taskId2].data[7] = 1;
}
else
{
if (taskId2 != 0xFF)
if (taskId2 != TASK_NONE)
gTasks[taskId2].data[7] = 0;
}
}

View File

@ -792,7 +792,7 @@ void LoadWirelessStatusIndicatorSpriteGfx(void)
LoadCompressedSpriteSheet(&sWirelessStatusIndicatorSpriteSheet);
}
LoadSpritePalette(&sWirelessStatusIndicatorSpritePalette);
gWirelessStatusIndicatorSpriteId = 0xFF;
gWirelessStatusIndicatorSpriteId = SPRITE_NONE;
}
static u8 GetParentSignalStrength(void)
@ -822,7 +822,7 @@ static void SetWirelessStatusIndicatorAnim(struct Sprite *sprite, s32 animNum)
void UpdateWirelessStatusIndicatorSprite(void)
{
if (gWirelessStatusIndicatorSpriteId != 0xFF && gSprites[gWirelessStatusIndicatorSpriteId].sValidator == STATUS_INDICATOR_ACTIVE)
if (gWirelessStatusIndicatorSpriteId != SPRITE_NONE && gSprites[gWirelessStatusIndicatorSpriteId].sValidator == STATUS_INDICATOR_ACTIVE)
{
struct Sprite *sprite = &gSprites[gWirelessStatusIndicatorSpriteId];
u8 signalStrength = RFU_LINK_ICON_LEVEL4_MAX;

View File

@ -467,8 +467,6 @@ s32 ListMenu_ProcessInput(u8 listTaskId)
}
}
#define TASK_NONE 0xFF
void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow)
{
struct ListMenu *list = (void*) gTasks[listTaskId].data;

View File

@ -18,62 +18,31 @@
#include "pokemon_icon.h"
#include "malloc.h"
#include "easy_chat.h"
#include "graphics.h"
#include "constants/rgb.h"
extern const u16 gMailPalette_Orange[];
extern const u16 gMailPalette_Harbor[];
extern const u16 gMailPalette_Glitter[];
extern const u16 gMailPalette_Mech[];
extern const u16 gMailPalette_Wood[];
extern const u16 gMailPalette_Wave[];
extern const u16 gMailPalette_Bead[];
extern const u16 gMailPalette_Shadow[];
extern const u16 gMailPalette_Tropic[];
extern const u16 gMailPalette_Dream[];
extern const u16 gMailPalette_Fab[];
extern const u16 gMailPalette_Retro[];
extern const u8 gMailTiles_Orange[];
extern const u8 gMailTilemap_Orange[];
extern const u8 gMailTiles_Harbor[];
extern const u8 gMailTilemap_Harbor[];
extern const u8 gMailTiles_Glitter[];
extern const u8 gMailTilemap_Glitter[];
extern const u8 gMailTiles_Mech[];
extern const u8 gMailTilemap_Mech[];
extern const u8 gMailTiles_Wood[];
extern const u8 gMailTilemap_Wood[];
extern const u8 gMailTiles_Wave[];
extern const u8 gMailTilemap_Wave[];
extern const u8 gMailTiles_Bead[];
extern const u8 gMailTilemap_Bead[];
extern const u8 gMailTiles_Shadow[];
extern const u8 gMailTilemap_Shadow[];
extern const u8 gMailTiles_Tropic[];
extern const u8 gMailTilemap_Tropic[];
extern const u8 gMailTiles_Dream[];
extern const u8 gMailTilemap_Dream[];
extern const u8 gMailTiles_Fab[];
extern const u8 gMailTilemap_Fab[];
extern const u8 gMailTiles_Retro[];
extern const u8 gMailTilemap_Retro[];
// Bead and Dream mail feature an icon of the Pokémon holding it.
enum {
ICON_TYPE_NONE,
ICON_TYPE_BEAD,
ICON_TYPE_DREAM,
};
// Static type declarations
struct UnkMailStruct
struct MailLineLayout
{
u32 numEasyChatWords:2;
u32 xOffset:6;
u32 lineHeight:8;
u8 numEasyChatWords:2;
u8 xOffset:6;
u8 height;
};
struct MailLayout
{
u8 numSubStructs;
u8 numLines;
u8 signatureYPos;
u8 signatureWidth;
u8 wordsXPos;
u8 wordsYPos;
const struct UnkMailStruct *var8;
u8 wordsXPos;
const struct MailLineLayout *lines;
};
struct MailGraphics
@ -81,26 +50,25 @@ struct MailGraphics
const u16 *palette;
const u8 *tiles;
const u8 *tileMap;
u16 var0C;
u16 var0E;
u16 color10;
u16 color12;
u32 unused;
u16 textColor;
u16 textShadow;
};
struct MailRead
{
/*0x0000*/ u8 strbuf[8][64];
/*0x0000*/ u8 message[8][64];
/*0x0200*/ u8 playerName[12];
/*0x020C*/ MainCallback callback;
/*0x0210*/ MainCallback callback2;
/*0x020C*/ MainCallback exitCallback;
/*0x0210*/ MainCallback callback;
/*0x0214*/ struct MailStruct *mail;
/*0x0218*/ bool8 flag;
/*0x0218*/ bool8 hasText;
/*0x0219*/ u8 signatureWidth;
/*0x021a*/ u8 mailType;
/*0x021b*/ u8 animsActive;
/*0x021c*/ u8 monIconSprite;
/*0x021b*/ u8 iconType;
/*0x021c*/ u8 monIconSpriteId;
/*0x021d*/ u8 language;
/*0x021e*/ bool8 playerIsSender;
/*0x021e*/ bool8 international;
/*0x0220*/ u8 * (*parserSingle)(u8 *dest, u16 word);
/*0x0224*/ u8 * (*parserMultiple)(u8 *dest, const u16 *src, u16 length1, u16 length2);
/*0x0228*/ const struct MailLayout *layout;
@ -108,23 +76,17 @@ struct MailRead
/*0x122c*/ u8 bg2TilemapBuffer[0x1000];
};
// Static RAM declarations
static EWRAM_DATA struct MailRead *sMailRead = NULL;
// Static ROM declarations
static void CB2_InitMailRead(void);
static void sub_8121A1C(void);
static void sub_8121B1C(void);
static void BufferMailText(void);
static void PrintMailText(void);
static void VBlankCB_MailRead(void);
static void CB2_MailRead(void);
static void CB2_WaitForPaletteExitOnKeyPress(void);
static void CB2_ExitOnKeyPress(void);
static void CB2_ExitMailReadFreeVars(void);
// .rodata
static const struct BgTemplate sBgTemplates[] = {
{
.bg = 0,
@ -144,7 +106,7 @@ static const struct BgTemplate sBgTemplates[] = {
}
};
static const struct WindowTemplate sUnknown_0859F29C[] = {
static const struct WindowTemplate sWindowTemplates[] = {
{
.bg = 0,
.tilemapLeft = 2,
@ -163,137 +125,377 @@ static const u8 sTextColors[] = {
TEXT_DYNAMIC_COLOR_2
};
static const u16 sUnknown_0859F2B0[][2] = {
{ 0x6ACD, 0x51A5 },
{ 0x45FC, 0x38D4 }
// Background is alternating bars of a dark/light color.
// Either blue or red depending on player's gender
static const u16 sBgColors[GENDER_COUNT][2] = {
[MALE] = { RGB(13, 22, 26), RGB(5, 13, 20) },
[FEMALE] = { RGB(28, 15, 17), RGB(20, 6, 14) }
};
static const struct MailGraphics sUnknown_0859F2B8[] = {
{
gMailPalette_Orange, gMailTiles_Orange, gMailTilemap_Orange, 0x02c0, 0, 0x294a, 0x6739
}, {
gMailPalette_Harbor, gMailTiles_Harbor, gMailTilemap_Harbor, 0x02e0, 0, 0x7fff, 0x4631
}, {
gMailPalette_Glitter, gMailTiles_Glitter, gMailTilemap_Glitter, 0x0400, 0, 0x294a, 0x6739
}, {
gMailPalette_Mech, gMailTiles_Mech, gMailTilemap_Mech, 0x01e0, 0, 0x7fff, 0x4631
}, {
gMailPalette_Wood, gMailTiles_Wood, gMailTilemap_Wood, 0x02e0, 0, 0x7fff, 0x4631
}, {
gMailPalette_Wave, gMailTiles_Wave, gMailTilemap_Wave, 0x0300, 0, 0x294a, 0x6739
}, {
gMailPalette_Bead, gMailTiles_Bead, gMailTilemap_Bead, 0x0140, 0, 0x7fff, 0x4631
}, {
gMailPalette_Shadow, gMailTiles_Shadow, gMailTilemap_Shadow, 0x0300, 0, 0x7fff, 0x4631
}, {
gMailPalette_Tropic, gMailTiles_Tropic, gMailTilemap_Tropic, 0x0220, 0, 0x294a, 0x6739
}, {
gMailPalette_Dream, gMailTiles_Dream, gMailTilemap_Dream, 0x0340, 0, 0x294a, 0x6739
}, {
gMailPalette_Fab, gMailTiles_Fab, gMailTilemap_Fab, 0x02a0, 0, 0x294a, 0x6739
}, {
gMailPalette_Retro, gMailTiles_Retro, gMailTilemap_Retro, 0x0520, 0, 0x294a, 0x6739
static const struct MailGraphics sMailGraphics[] = {
[ITEM_TO_MAIL(ITEM_ORANGE_MAIL)] = {
.palette = gMailPalette_Orange,
.tiles = gMailTiles_Orange,
.tileMap = gMailTilemap_Orange,
.unused = 0x2C0,
.textColor = RGB(10, 10, 10),
.textShadow = RGB(25, 25, 25),
},
[ITEM_TO_MAIL(ITEM_HARBOR_MAIL)] = {
.palette = gMailPalette_Harbor,
.tiles = gMailTiles_Harbor,
.tileMap = gMailTilemap_Harbor,
.unused = 0x2E0,
.textColor = RGB_WHITE,
.textShadow = RGB(17, 17, 17),
},
[ITEM_TO_MAIL(ITEM_GLITTER_MAIL)] = {
.palette = gMailPalette_Glitter,
.tiles = gMailTiles_Glitter,
.tileMap = gMailTilemap_Glitter,
.unused = 0x400,
.textColor = RGB(10, 10, 10),
.textShadow = RGB(25, 25, 25),
},
[ITEM_TO_MAIL(ITEM_MECH_MAIL)] = {
.palette = gMailPalette_Mech,
.tiles = gMailTiles_Mech,
.tileMap = gMailTilemap_Mech,
.unused = 0x1E0,
.textColor = RGB_WHITE,
.textShadow = RGB(17, 17, 17),
},
[ITEM_TO_MAIL(ITEM_WOOD_MAIL)] = {
.palette = gMailPalette_Wood,
.tiles = gMailTiles_Wood,
.tileMap = gMailTilemap_Wood,
.unused = 0x2E0,
.textColor = RGB_WHITE,
.textShadow = RGB(17, 17, 17),
},
[ITEM_TO_MAIL(ITEM_WAVE_MAIL)] = {
.palette = gMailPalette_Wave,
.tiles = gMailTiles_Wave,
.tileMap = gMailTilemap_Wave,
.unused = 0x300,
.textColor = RGB(10, 10, 10),
.textShadow = RGB(25, 25, 25),
},
[ITEM_TO_MAIL(ITEM_BEAD_MAIL)] = {
.palette = gMailPalette_Bead,
.tiles = gMailTiles_Bead,
.tileMap = gMailTilemap_Bead,
.unused = 0x140,
.textColor = RGB_WHITE,
.textShadow = RGB(17, 17, 17),
},
[ITEM_TO_MAIL(ITEM_SHADOW_MAIL)] = {
.palette = gMailPalette_Shadow,
.tiles = gMailTiles_Shadow,
.tileMap = gMailTilemap_Shadow,
.unused = 0x300,
.textColor = RGB_WHITE,
.textShadow = RGB(17, 17, 17),
},
[ITEM_TO_MAIL(ITEM_TROPIC_MAIL)] = {
.palette = gMailPalette_Tropic,
.tiles = gMailTiles_Tropic,
.tileMap = gMailTilemap_Tropic,
.unused = 0x220,
.textColor = RGB(10, 10, 10),
.textShadow = RGB(25, 25, 25),
},
[ITEM_TO_MAIL(ITEM_DREAM_MAIL)] = {
.palette = gMailPalette_Dream,
.tiles = gMailTiles_Dream,
.tileMap = gMailTilemap_Dream,
.unused = 0x340,
.textColor = RGB(10, 10, 10),
.textShadow = RGB(25, 25, 25),
},
[ITEM_TO_MAIL(ITEM_FAB_MAIL)] = {
.palette = gMailPalette_Fab,
.tiles = gMailTiles_Fab,
.tileMap = gMailTilemap_Fab,
.unused = 0x2a0,
.textColor = RGB(10, 10, 10),
.textShadow = RGB(25, 25, 25),
},
[ITEM_TO_MAIL(ITEM_RETRO_MAIL)] = {
.palette = gMailPalette_Retro,
.tiles = gMailTiles_Retro,
.tileMap = gMailTilemap_Retro,
.unused = 0x520,
.textColor = RGB(10, 10, 10),
.textShadow = RGB(25, 25, 25),
}
};
static const struct UnkMailStruct Unknown_0859F3A8[] = {
{ .numEasyChatWords = 3, .lineHeight = 16 },
{ .numEasyChatWords = 3, .lineHeight = 16 },
{ .numEasyChatWords = 3, .lineHeight = 16 }
static const struct MailLineLayout sLineLayouts_Wide[] = {
{ .numEasyChatWords = 3, .xOffset = 0, .height = 16 },
{ .numEasyChatWords = 3, .xOffset = 0, .height = 16 },
{ .numEasyChatWords = 3, .xOffset = 0, .height = 16 }
};
static const struct MailLayout sUnknown_0859F3B4[] = {
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x08, 0x00, 0x02, 0x04, Unknown_0859F3A8 },
{ 0x03, 0x00, 0x00, 0x02, 0x00, Unknown_0859F3A8 }
static const struct MailLayout sMailLayouts_Wide[] = {
[ITEM_TO_MAIL(ITEM_ORANGE_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_HARBOR_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_GLITTER_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_MECH_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_WOOD_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_WAVE_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_BEAD_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_SHADOW_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_TROPIC_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_DREAM_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_FAB_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 8,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 4,
.lines = sLineLayouts_Wide,
},
[ITEM_TO_MAIL(ITEM_RETRO_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Wide),
.signatureYPos = 0,
.signatureWidth = 0,
.wordsYPos = 2,
.wordsXPos = 0,
.lines = sLineLayouts_Wide,
},
};
static const struct UnkMailStruct Unknown_0859F444[] = {
{ .numEasyChatWords = 2, .lineHeight = 16 },
{ .numEasyChatWords = 2, .lineHeight = 16 },
{ .numEasyChatWords = 2, .lineHeight = 16 },
{ .numEasyChatWords = 2, .lineHeight = 16 },
{ .numEasyChatWords = 1, .lineHeight = 16 }
static const struct MailLineLayout sLineLayouts_Tall[] = {
{ .numEasyChatWords = 2, .xOffset = 0, .height = 16 },
{ .numEasyChatWords = 2, .xOffset = 0, .height = 16 },
{ .numEasyChatWords = 2, .xOffset = 0, .height = 16 },
{ .numEasyChatWords = 2, .xOffset = 0, .height = 16 },
{ .numEasyChatWords = 1, .xOffset = 0, .height = 16 }
};
static const struct MailLayout sUnknown_0859F458[] = {
{ 0x05, 0x07, 0x58, 0x0b, 0x1e, Unknown_0859F444 },
{ 0x05, 0x0a, 0x60, 0x09, 0x1e, Unknown_0859F444 },
{ 0x05, 0x0c, 0x68, 0x05, 0x1e, Unknown_0859F444 },
{ 0x05, 0x05, 0x60, 0x08, 0x1e, Unknown_0859F444 },
{ 0x05, 0x0a, 0x60, 0x09, 0x1e, Unknown_0859F444 },
{ 0x05, 0x09, 0x70, 0x05, 0x1e, Unknown_0859F444 },
{ 0x05, 0x0c, 0x68, 0x09, 0x1e, Unknown_0859F444 },
{ 0x05, 0x0d, 0x68, 0x0d, 0x1e, Unknown_0859F444 },
{ 0x05, 0x09, 0x60, 0x09, 0x1e, Unknown_0859F444 },
{ 0x05, 0x09, 0x60, 0x09, 0x1e, Unknown_0859F444 },
{ 0x05, 0x11, 0x68, 0x0f, 0x1e, Unknown_0859F444 },
{ 0x05, 0x09, 0x60, 0x05, 0x1e, Unknown_0859F444 }
static const struct MailLayout sMailLayouts_Tall[] = {
[ITEM_TO_MAIL(ITEM_ORANGE_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 7,
.signatureWidth = 88,
.wordsYPos = 11,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_HARBOR_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 10,
.signatureWidth = 96,
.wordsYPos = 9,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_GLITTER_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 12,
.signatureWidth = 104,
.wordsYPos = 5,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_MECH_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 5,
.signatureWidth = 96,
.wordsYPos = 8,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_WOOD_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 10,
.signatureWidth = 96,
.wordsYPos = 9,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_WAVE_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 9,
.signatureWidth = 112,
.wordsYPos = 5,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_BEAD_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 12,
.signatureWidth = 104,
.wordsYPos = 9,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_SHADOW_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 13,
.signatureWidth = 104,
.wordsYPos = 13,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_TROPIC_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 9,
.signatureWidth = 96,
.wordsYPos = 9,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_DREAM_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 9,
.signatureWidth = 96,
.wordsYPos = 9,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_FAB_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 17,
.signatureWidth = 104,
.wordsYPos = 15,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
[ITEM_TO_MAIL(ITEM_RETRO_MAIL)] = {
.numLines = ARRAY_COUNT(sLineLayouts_Tall),
.signatureYPos = 9,
.signatureWidth = 96,
.wordsYPos = 5,
.wordsXPos = 30,
.lines = sLineLayouts_Tall,
},
};
// .text
void ReadMail(struct MailStruct *mail, void (*callback)(void), bool8 flag)
void ReadMail(struct MailStruct *mail, void (*exitCallback)(void), bool8 hasText)
{
u16 buffer[2];
u16 species;
sMailRead = calloc(1, sizeof(*sMailRead));
sMailRead->language = GAME_LANGUAGE;
sMailRead->playerIsSender = TRUE;
sMailRead->international = TRUE;
sMailRead->parserSingle = CopyEasyChatWord;
sMailRead->parserMultiple = ConvertEasyChatWordsToString;
if (IS_ITEM_MAIL(mail->itemId))
{
sMailRead->mailType = mail->itemId - FIRST_MAIL_INDEX;
sMailRead->mailType = ITEM_TO_MAIL(mail->itemId);
}
else
{
sMailRead->mailType = 0;
flag = FALSE;
sMailRead->mailType = ITEM_TO_MAIL(FIRST_MAIL_INDEX);
hasText = FALSE;
}
switch (sMailRead->playerIsSender)
switch (sMailRead->international)
{
case FALSE:
default:
sMailRead->layout = &sUnknown_0859F3B4[sMailRead->mailType];
break;
case TRUE:
sMailRead->layout = &sUnknown_0859F458[sMailRead->mailType];
break;
case FALSE:
default:
// Never reached. JP only?
sMailRead->layout = &sMailLayouts_Wide[sMailRead->mailType];
break;
case TRUE:
sMailRead->layout = &sMailLayouts_Tall[sMailRead->mailType];
break;
}
species = MailSpeciesToSpecies(mail->species, buffer);
if (species >= SPECIES_BULBASAUR && species < NUM_SPECIES)
if (species > SPECIES_NONE && species < NUM_SPECIES)
{
switch (sMailRead->mailType)
{
default:
sMailRead->animsActive = 0;
break;
case ITEM_BEAD_MAIL - FIRST_MAIL_INDEX:
sMailRead->animsActive = 1;
break;
case ITEM_DREAM_MAIL - FIRST_MAIL_INDEX:
sMailRead->animsActive = 2;
break;
default:
sMailRead->iconType = ICON_TYPE_NONE;
break;
case ITEM_TO_MAIL(ITEM_BEAD_MAIL):
sMailRead->iconType = ICON_TYPE_BEAD;
break;
case ITEM_TO_MAIL(ITEM_DREAM_MAIL):
sMailRead->iconType = ICON_TYPE_DREAM;
break;
}
}
else
{
sMailRead->animsActive = 0;
sMailRead->iconType = ICON_TYPE_NONE;
}
sMailRead->mail = mail;
sMailRead->callback = callback;
sMailRead->flag = flag;
sMailRead->exitCallback = exitCallback;
sMailRead->hasText = hasText;
SetMainCallback2(CB2_InitMailRead);
}
@ -341,11 +543,11 @@ static bool8 MailReadBuildGraphics(void)
SetBgTilemapBuffer(2, sMailRead->bg2TilemapBuffer);
break;
case 7:
InitWindows(sUnknown_0859F29C);
InitWindows(sWindowTemplates);
DeactivateAllTextPrinters();
break;
case 8:
DecompressAndCopyTileDataToVram(1, sUnknown_0859F2B8[sMailRead->mailType].tiles, 0, 0, 0);
DecompressAndCopyTileDataToVram(1, sMailGraphics[sMailRead->mailType].tiles, 0, 0, 0);
break;
case 9:
if (FreeTempTileDataBuffersIfPossible())
@ -356,7 +558,7 @@ static bool8 MailReadBuildGraphics(void)
case 10:
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 1, 0, 0, 30, 20);
CopyToBgTilemapBuffer(1, sUnknown_0859F2B8[sMailRead->mailType].tileMap, 0, 0);
CopyToBgTilemapBuffer(1, sMailGraphics[sMailRead->mailType].tileMap, 0, 0);
break;
case 11:
CopyBgTilemapBufferToVram(0);
@ -365,26 +567,28 @@ static bool8 MailReadBuildGraphics(void)
break;
case 12:
LoadPalette(GetOverworldTextboxPalettePtr(), 240, 32);
gPlttBufferUnfaded[250] = sUnknown_0859F2B8[sMailRead->mailType].color10;
gPlttBufferFaded[250] = sUnknown_0859F2B8[sMailRead->mailType].color10;
gPlttBufferUnfaded[251] = sUnknown_0859F2B8[sMailRead->mailType].color12;
gPlttBufferFaded[251] = sUnknown_0859F2B8[sMailRead->mailType].color12;
LoadPalette(sUnknown_0859F2B8[sMailRead->mailType].palette, 0, 32);
gPlttBufferUnfaded[10] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][0];
gPlttBufferFaded[10] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][0];
gPlttBufferUnfaded[11] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][1];
gPlttBufferFaded[11] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][1];
gPlttBufferUnfaded[250] = sMailGraphics[sMailRead->mailType].textColor;
gPlttBufferFaded[250] = sMailGraphics[sMailRead->mailType].textColor;
gPlttBufferUnfaded[251] = sMailGraphics[sMailRead->mailType].textShadow;
gPlttBufferFaded[251] = sMailGraphics[sMailRead->mailType].textShadow;
LoadPalette(sMailGraphics[sMailRead->mailType].palette, 0, 32);
gPlttBufferUnfaded[10] = sBgColors[gSaveBlock2Ptr->playerGender][0];
gPlttBufferFaded[10] = sBgColors[gSaveBlock2Ptr->playerGender][0];
gPlttBufferUnfaded[11] = sBgColors[gSaveBlock2Ptr->playerGender][1];
gPlttBufferFaded[11] = sBgColors[gSaveBlock2Ptr->playerGender][1];
break;
case 13:
if (sMailRead->flag)
if (sMailRead->hasText)
{
sub_8121A1C();
BufferMailText();
}
break;
case 14:
if (sMailRead->flag)
if (sMailRead->hasText)
{
sub_8121B1C();
PrintMailText();
RunTextPrinters();
}
break;
@ -399,17 +603,17 @@ static bool8 MailReadBuildGraphics(void)
gPaletteFade.bufferTransferDisabled = TRUE;
break;
case 17:
icon = sub_80D2E84(sMailRead->mail->species);
switch (sMailRead->animsActive)
icon = GetIconSpeciesNoPersonality(sMailRead->mail->species);
switch (sMailRead->iconType)
{
case 1:
LoadMonIconPalette(icon);
sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x60, 0x80, 0, 0);
break;
case 2:
LoadMonIconPalette(icon);
sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x28, 0x80, 0, 0);
break;
case ICON_TYPE_BEAD:
LoadMonIconPalette(icon);
sMailRead->monIconSpriteId = CreateMonIconNoPersonality(icon, SpriteCallbackDummy, 96, 128, 0, FALSE);
break;
case ICON_TYPE_DREAM:
LoadMonIconPalette(icon);
sMailRead->monIconSpriteId = CreateMonIconNoPersonality(icon, SpriteCallbackDummy, 40, 128, 0, FALSE);
break;
}
break;
case 18:
@ -417,9 +621,9 @@ static bool8 MailReadBuildGraphics(void)
ShowBg(0);
ShowBg(1);
ShowBg(2);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = FALSE;
sMailRead->callback2 = CB2_WaitForPaletteExitOnKeyPress;
sMailRead->callback = CB2_WaitForPaletteExitOnKeyPress;
return TRUE;
default:
return FALSE;
@ -440,35 +644,39 @@ static void CB2_InitMailRead(void)
} while (MenuHelpers_LinkSomething() != TRUE);
}
static void sub_8121A1C(void)
static void BufferMailText(void)
{
u16 i;
u8 total;
u8 numWords;
u8 *ptr;
total = 0;
for (i = 0; i < sMailRead->layout->numSubStructs; i ++)
// Convert the easy chat words to strings line by line and buffer them to message
numWords = 0;
for (i = 0; i < sMailRead->layout->numLines; i ++)
{
ConvertEasyChatWordsToString(sMailRead->strbuf[i], &sMailRead->mail->words[total], sMailRead->layout->var8[i].numEasyChatWords, 1);
total += sMailRead->layout->var8[i].numEasyChatWords;
ConvertEasyChatWordsToString(sMailRead->message[i], &sMailRead->mail->words[numWords], sMailRead->layout->lines[i].numEasyChatWords, 1);
numWords += sMailRead->layout->lines[i].numEasyChatWords;
}
// Buffer the signature
ptr = StringCopy(sMailRead->playerName, sMailRead->mail->playerName);
if (!sMailRead->playerIsSender)
if (!sMailRead->international)
{
StringCopy(ptr, gText_FromSpace);
sMailRead->signatureWidth = sMailRead->layout->signatureWidth - (StringLength(sMailRead->playerName) * 8 - 0x60);
// Never reached
StringCopy(ptr, gText_FromSpace); // Odd, "From" text is already printed in PrintMailText
sMailRead->signatureWidth = sMailRead->layout->signatureWidth - (StringLength(sMailRead->playerName) * 8 - 96);
}
else
{
sub_81DB52C(sMailRead->playerName);
ConvertInternationalPlayerName(sMailRead->playerName);
sMailRead->signatureWidth = sMailRead->layout->signatureWidth;
}
}
static void sub_8121B1C(void)
static void PrintMailText(void)
{
u16 i;
u8 strbuf[0x20];
u8 signature[32];
u8 y;
u8 *bufptr;
s32 box_x;
@ -479,20 +687,19 @@ static void sub_8121B1C(void)
PutWindowTilemap(1);
FillWindowPixelBuffer(0, PIXEL_FILL(0));
FillWindowPixelBuffer(1, PIXEL_FILL(0));
for (i = 0; i < sMailRead->layout->numSubStructs; i ++)
for (i = 0; i < sMailRead->layout->numLines; i ++)
{
if (sMailRead->strbuf[i][0] == EOS || sMailRead->strbuf[i][0] == CHAR_SPACE)
{
if (sMailRead->message[i][0] == EOS || sMailRead->message[i][0] == CHAR_SPACE)
continue;
}
AddTextPrinterParameterized3(0, 1, sMailRead->layout->var8[i].xOffset + sMailRead->layout->wordsYPos, y + sMailRead->layout->wordsXPos, sTextColors, 0, sMailRead->strbuf[i]);
y += sMailRead->layout->var8[i].lineHeight;
AddTextPrinterParameterized3(0, 1, sMailRead->layout->lines[i].xOffset + sMailRead->layout->wordsXPos, y + sMailRead->layout->wordsYPos, sTextColors, 0, sMailRead->message[i]);
y += sMailRead->layout->lines[i].height;
}
bufptr = StringCopy(strbuf, gText_FromSpace);
bufptr = StringCopy(signature, gText_FromSpace);
StringCopy(bufptr, sMailRead->playerName);
box_x = GetStringCenterAlignXOffset(1, strbuf, sMailRead->signatureWidth) + 0x68;
box_y = sMailRead->layout->signatureYPos + 0x58;
AddTextPrinterParameterized3(0, 1, box_x, box_y, sTextColors, 0, strbuf);
box_x = GetStringCenterAlignXOffset(1, signature, sMailRead->signatureWidth) + 104;
box_y = sMailRead->layout->signatureYPos + 88;
AddTextPrinterParameterized3(0, 1, box_x, box_y, sTextColors, 0, signature);
CopyWindowToVram(0, 3);
CopyWindowToVram(1, 3);
}
@ -506,19 +713,19 @@ static void VBlankCB_MailRead(void)
static void CB2_MailRead(void)
{
if (sMailRead->animsActive != 0)
if (sMailRead->iconType != ICON_TYPE_NONE)
{
AnimateSprites();
BuildOamBuffer();
}
sMailRead->callback2();
sMailRead->callback();
}
static void CB2_WaitForPaletteExitOnKeyPress(void)
{
if (!UpdatePaletteFade())
{
sMailRead->callback2 = CB2_ExitOnKeyPress;
sMailRead->callback = CB2_ExitOnKeyPress;
}
}
@ -526,8 +733,8 @@ static void CB2_ExitOnKeyPress(void)
{
if (JOY_NEW(A_BUTTON | B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
sMailRead->callback2 = CB2_ExitMailReadFreeVars;
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
sMailRead->callback = CB2_ExitMailReadFreeVars;
}
}
@ -535,13 +742,13 @@ static void CB2_ExitMailReadFreeVars(void)
{
if (!UpdatePaletteFade())
{
SetMainCallback2(sMailRead->callback);
switch (sMailRead->animsActive)
SetMainCallback2(sMailRead->exitCallback);
switch (sMailRead->iconType)
{
case 1:
case 2:
FreeMonIconPalette(sub_80D2E84(sMailRead->mail->species));
FreeAndDestroyMonIconSprite(&gSprites[sMailRead->monIconSprite]);
case ICON_TYPE_BEAD:
case ICON_TYPE_DREAM:
FreeMonIconPalette(GetIconSpeciesNoPersonality(sMailRead->mail->species));
FreeAndDestroyMonIconSprite(&gSprites[sMailRead->monIconSpriteId]);
}
memset(sMailRead, 0, sizeof(*sMailRead));
ResetPaletteFade();

View File

@ -5,6 +5,7 @@
#include "pokemon_icon.h"
#include "text.h"
#include "international_string_util.h"
#include "constants/easy_chat.h"
void ClearMailData(void)
{
@ -19,12 +20,12 @@ void ClearMailStruct(struct MailStruct *mail)
s32 i;
for (i = 0; i < MAIL_WORDS_COUNT; i++)
mail->words[i] = 0xFFFF;
mail->words[i] = EC_EMPTY_WORD;
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++)
mail->playerName[i] = EOS;
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
mail->trainerId[i] = 0;
mail->species = SPECIES_BULBASAUR;
@ -34,7 +35,7 @@ void ClearMailStruct(struct MailStruct *mail)
bool8 MonHasMail(struct Pokemon *mon)
{
u16 heldItem = GetMonData(mon, MON_DATA_HELD_ITEM);
if (ItemIsMail(heldItem) && GetMonData(mon, MON_DATA_MAIL) != 0xFF)
if (ItemIsMail(heldItem) && GetMonData(mon, MON_DATA_MAIL) != MAIL_NONE)
return TRUE;
else
return FALSE;
@ -52,12 +53,12 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId)
for (id = 0; id < PARTY_SIZE; id++)
{
if (gSaveBlock1Ptr->mail[id].itemId == 0)
if (gSaveBlock1Ptr->mail[id].itemId == ITEM_NONE)
{
for (i = 0; i < MAIL_WORDS_COUNT; i++)
gSaveBlock1Ptr->mail[id].words[i] = 0xFFFF;
gSaveBlock1Ptr->mail[id].words[i] = EC_EMPTY_WORD;
for (i = 0; i < PLAYER_NAME_LENGTH + 1 - 1; i++)
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
gSaveBlock1Ptr->mail[id].playerName[i] = gSaveBlock2Ptr->playerName[i];
gSaveBlock1Ptr->mail[id].playerName[i] = EOS;
PadNameString(gSaveBlock1Ptr->mail[id].playerName, CHAR_SPACE);
@ -75,7 +76,7 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId)
}
}
return 0xFF;
return MAIL_NONE;
}
u16 SpeciesToMailSpecies(u16 species, u32 personality)
@ -93,7 +94,7 @@ u16 MailSpeciesToSpecies(u16 mailSpecies, u16 *buffer)
{
u16 result;
if (mailSpecies >= 30000 && mailSpecies < (30000 + UNOWN_FORM_COUNT))
if (mailSpecies >= 30000 && mailSpecies < (30000 + NUM_UNOWN_FORMS))
{
result = SPECIES_UNOWN;
*buffer = mailSpecies - 30000;
@ -112,8 +113,8 @@ u8 GiveMailToMon2(struct Pokemon *mon, struct MailStruct *mail)
u16 itemId = mail->itemId;
u8 mailId = GiveMailToMon(mon, itemId);
if (mailId == 0xFF)
return 0xFF;
if (mailId == MAIL_NONE)
return MAIL_NONE;
gSaveBlock1Ptr->mail[mailId] = *mail;
@ -141,7 +142,7 @@ void TakeMailFromMon(struct Pokemon *mon)
{
mailId = GetMonData(mon, MON_DATA_MAIL);
gSaveBlock1Ptr->mail[mailId].itemId = ITEM_NONE;
mailId = 0xFF;
mailId = MAIL_NONE;
heldItem[0] = ITEM_NONE;
heldItem[1] = ITEM_NONE << 8;
SetMonData(mon, MON_DATA_MAIL, &mailId);
@ -162,7 +163,7 @@ u8 TakeMailFromMon2(struct Pokemon *mon)
newHeldItem[0] = ITEM_NONE;
newHeldItem[1] = ITEM_NONE << 8;
newMailId = 0xFF;
newMailId = MAIL_NONE;
for (i = PARTY_SIZE; i < MAIL_COUNT; i++)
{
@ -176,7 +177,7 @@ u8 TakeMailFromMon2(struct Pokemon *mon)
}
}
return 0xFF;
return MAIL_NONE;
}
bool8 ItemIsMail(u16 itemId)

View File

@ -581,9 +581,9 @@ static u32 InitMainMenu(bool8 returningFromOptionsMenu)
ResetSpriteData();
FreeAllSpritePalettes();
if (returningFromOptionsMenu)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); // fade to black
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); // fade to black
else
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sMainMenuBgTemplates, ARRAY_COUNT(sMainMenuBgTemplates));
ChangeBgX(0, 0, 0);
@ -889,13 +889,13 @@ static bool8 HandleMainMenuInput(u8 taskId)
{
PlaySE(SE_SELECT);
IsWirelessAdapterConnected(); // why bother calling this here? debug? Task_HandleMainMenuAPressed will check too
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_HandleMainMenuAPressed;
}
else if (JOY_NEW(B_BUTTON))
{
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA);
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, 240));
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(0, 160));
gTasks[taskId].func = Task_HandleMainMenuBPressed;
@ -1095,7 +1095,7 @@ static void Task_HandleMainMenuAPressed(u8 taskId)
SetGpuReg(REG_OFFSET_BG1VOFS, 0);
SetGpuReg(REG_OFFSET_BG0HOFS, 0);
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
return;
}
FreeAllWindowBuffers();
@ -1152,7 +1152,7 @@ static void Task_DisplayMainMenuInvalidActionError(u8 taskId)
if (JOY_NEW(A_BUTTON | B_BUTTON))
{
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_HandleMainMenuBPressed;
}
}
@ -1284,10 +1284,10 @@ static void Task_NewGameBirchSpeech_Init(u8 taskId)
FreeAllSpritePalettes();
ResetAllPicSprites();
AddBirchSpeechObjects(taskId);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
gTasks[taskId].tBG1HOFS = 0;
gTasks[taskId].func = Task_NewGameBirchSpeech_WaitToShowBirch;
gTasks[taskId].tPlayerSpriteId = 0xFF;
gTasks[taskId].tPlayerSpriteId = SPRITE_NONE;
gTasks[taskId].data[3] = 0xFF;
gTasks[taskId].tTimer = 0xD8;
PlayBGM(MUS_ROUTE122);
@ -1594,7 +1594,7 @@ static void Task_NewGameBirchSpeech_WaitPressBeforeNameChoice(u8 taskId)
{
if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_NewGameBirchSpeech_StartNamingScreen;
}
}
@ -1749,7 +1749,7 @@ static void Task_NewGameBirchSpeech_ShrinkPlayer(u8 taskId)
InitSpriteAffineAnim(&gSprites[spriteId]);
StartSpriteAffineAnim(&gSprites[spriteId], 0);
gSprites[spriteId].callback = SpriteCB_MovePlayerDownWhileShrinking;
BeginNormalPaletteFade(0x0000FFFF, 0, 0, 16, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_BG, 0, 0, 16, RGB_BLACK);
FadeOutBGM(4);
gTasks[taskId].func = Task_NewGameBirchSpeech_WaitForPlayerShrink;
}
@ -1773,7 +1773,7 @@ static void Task_NewGameBirchSpeech_FadePlayerToWhite(u8 taskId)
spriteId = gTasks[taskId].tPlayerSpriteId;
gSprites[spriteId].callback = SpriteCB_Null;
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
BeginNormalPaletteFade(0xFFFF0000, 0, 0, 16, RGB_WHITEALPHA);
BeginNormalPaletteFade(PALETTES_OBJECTS, 0, 0, 16, RGB_WHITEALPHA);
gTasks[taskId].func = Task_NewGameBirchSpeech_Cleanup;
}
}
@ -1843,7 +1843,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void)
gSprites[spriteId].invisible = FALSE;
gTasks[taskId].tPlayerSpriteId = spriteId;
SetGpuReg(REG_OFFSET_BG1HOFS, -60);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_WIN0H, 0);
SetGpuReg(REG_OFFSET_WIN0V, 0);
SetGpuReg(REG_OFFSET_WININ, 0);
@ -2117,9 +2117,9 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
name = gMalePresetNames[nameId];
else
name = gFemalePresetNames[nameId];
for (i = 0; i < 7; i++)
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
gSaveBlock2Ptr->playerName[i] = name[i];
gSaveBlock2Ptr->playerName[7] = 0xFF;
gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS;
}
static void CreateMainMenuErrorWindow(const u8* str)

View File

@ -1168,7 +1168,7 @@ static bool32 LoadMatchCallWindowGfx(u8 taskId)
{
s16 *taskData = gTasks[taskId].data;
taskData[2] = AddWindow(&sMatchCallTextWindow);
if (taskData[2] == 0xFF)
if (taskData[2] == WINDOW_NONE)
{
DestroyTask(taskId);
return FALSE;

View File

@ -250,7 +250,7 @@ void ScrSpecial_HipsterTeachWord(void)
{
u16 phrase = GetNewHipsterPhraseToTeach();
if (phrase == 0xFFFF)
if (phrase == EC_EMPTY_WORD)
{
gSpecialVar_Result = FALSE;
}
@ -283,7 +283,7 @@ void ScrSpecial_GenerateGiddyLine(void)
if (giddy->taleCounter == 0)
InitGiddyTaleList();
if (giddy->randomWords[giddy->taleCounter] != 0xFFFF) // is not the last element of the array?
if (giddy->randomWords[giddy->taleCounter] != EC_EMPTY_WORD)
{
u8 *stringPtr;
u32 adjective = Random();
@ -316,7 +316,7 @@ static void InitGiddyTaleList(void)
{EC_GROUP_HOBBIES, 0},
{EC_GROUP_MOVE_1, 0},
{EC_GROUP_MOVE_2, 0},
{EC_GROUP_POKEMON_2, 0}
{EC_GROUP_POKEMON_NATIONAL, 0}
};
u16 i;
u16 r10;
@ -348,7 +348,7 @@ static void InitGiddyTaleList(void)
r1 = Random() % 10;
if (r1 < 3 && r7 < 8)
{
giddy->randomWords[i] = 0xFFFF;
giddy->randomWords[i] = EC_EMPTY_WORD;
r7++;
}
else

View File

@ -144,8 +144,8 @@ void task_free_buf_after_copying_tile_data_to_vram(u8 taskId);
void InitStandardTextBoxWindows(void)
{
InitWindows(sStandardTextBox_WindowTemplates);
sStartMenuWindowId = 0xFF;
sMapNamePopupWindowId = 0xFF;
sStartMenuWindowId = WINDOW_NONE;
sMapNamePopupWindowId = WINDOW_NONE;
}
void FreeAllOverworldWindowBuffers(void)
@ -490,7 +490,7 @@ u8 GetPlayerTextSpeedDelay(void)
u8 sub_81979C4(u8 a1)
{
if (sStartMenuWindowId == 0xFF)
if (sStartMenuWindowId == WINDOW_NONE)
sStartMenuWindowId = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
return sStartMenuWindowId;
}
@ -502,10 +502,10 @@ u8 GetStartMenuWindowId(void)
void RemoveStartMenuWindow(void)
{
if (sStartMenuWindowId != 0xFF)
if (sStartMenuWindowId != WINDOW_NONE)
{
RemoveWindow(sStartMenuWindowId);
sStartMenuWindowId = 0xFF;
sStartMenuWindowId = WINDOW_NONE;
}
}
@ -521,7 +521,7 @@ u16 sub_8197A38(void)
u8 AddMapNamePopUpWindow(void)
{
if (sMapNamePopupWindowId == 0xFF)
if (sMapNamePopupWindowId == WINDOW_NONE)
sMapNamePopupWindowId = sub_8198AA4(0, 1, 1, 10, 3, 14, 0x107);
return sMapNamePopupWindowId;
}
@ -533,10 +533,10 @@ u8 GetMapNamePopUpWindowId(void)
void RemoveMapNamePopUpWindow(void)
{
if (sMapNamePopupWindowId != 0xFF)
if (sMapNamePopupWindowId != WINDOW_NONE)
{
RemoveWindow(sMapNamePopupWindowId);
sMapNamePopupWindowId = 0xFF;
sMapNamePopupWindowId = WINDOW_NONE;
}
}
@ -815,7 +815,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram)
{
u16 width = 0;
if (sWindowId != 0xFF)
if (sWindowId != WINDOW_NONE)
{
PutWindowTilemap(sWindowId);
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15));
@ -837,7 +837,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo
u8 color[3];
u16 width = 0;
if (sWindowId != 0xFF)
if (sWindowId != WINDOW_NONE)
{
if (a3 != 0)
{
@ -872,13 +872,13 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo
void sub_81982D8(void)
{
if (sWindowId != 0xFF)
if (sWindowId != WINDOW_NONE)
CopyWindowToVram(sWindowId, 3);
}
void sub_81982F0(void)
{
if (sWindowId != 0xFF)
if (sWindowId != WINDOW_NONE)
{
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15));
CopyWindowToVram(sWindowId, 3);
@ -887,13 +887,13 @@ void sub_81982F0(void)
void sub_8198314(void)
{
if (sWindowId != 0xFF)
if (sWindowId != WINDOW_NONE)
{
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0));
ClearWindowTilemap(sWindowId);
CopyWindowToVram(sWindowId, 3);
RemoveWindow(sWindowId);
sWindowId = 0xFF;
sWindowId = WINDOW_NONE;
}
}

View File

@ -216,14 +216,14 @@ bool8 sub_81D1C44(u8 count)
return FALSE;
for (i = 0; i < ARRAY_COUNT(sUnknown_0203CF48); i++)
sUnknown_0203CF48[i] = 0xFF;
sUnknown_0203CF48[i] = WINDOW_NONE;
return TRUE;
}
u8 sub_81D1C84(u8 a0)
{
if (sUnknown_0203CF48[a0] == 0xFF)
if (sUnknown_0203CF48[a0] == WINDOW_NONE)
{
if (a0 == 2)
{
@ -245,7 +245,7 @@ void sub_81D1D04(u8 a0)
ClearStdWindowAndFrameToTransparent(sUnknown_0203CF48[a0], 0);
ClearWindowTilemap(sUnknown_0203CF48[a0]);
RemoveWindow(sUnknown_0203CF48[a0]);
sUnknown_0203CF48[a0] = 0xFF;
sUnknown_0203CF48[a0] = WINDOW_NONE;
}
static u8 sub_81D1D34(u8 a0)
@ -261,10 +261,10 @@ static void sub_81D1D44(u8 windowId, s32 itemId, u8 y)
if (itemId == LIST_CANCEL)
return;
StringCopy(buffer, gSaveBlock1Ptr->mail[6 + itemId].playerName);
sub_81DB52C(buffer);
StringCopy(buffer, gSaveBlock1Ptr->mail[PARTY_SIZE + itemId].playerName);
ConvertInternationalPlayerName(buffer);
length = StringLength(buffer);
if (length <= 5)
if (length < PLAYER_NAME_LENGTH - 1)
ConvertInternationalString(buffer, LANGUAGE_JAPANESE);
AddTextPrinterParameterized4(windowId, 1, 8, y, 0, 0, sPlayerNameTextColors, -1, buffer);
}
@ -310,7 +310,7 @@ static void sub_81D1E7C(s32 itemIndex, bool8 onInit, struct ListMenu *list)
void sub_81D1E90(struct PlayerPCItemPageStruct *page)
{
page->scrollIndicatorId = AddScrollIndicatorArrowPairParameterized(2, 0xC8, 12, 0x94, page->count - page->pageItems + 1, 0x6E, 0x6E, &page->itemsAbove);
page->scrollIndicatorTaskId = AddScrollIndicatorArrowPairParameterized(2, 0xC8, 12, 0x94, page->count - page->pageItems + 1, 0x6E, 0x6E, &page->itemsAbove);
}
void sub_81D1EC0(void)

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