Merge with master

This commit is contained in:
DizzyEggg 2019-04-13 13:42:44 +02:00
commit 2646f3b26a
81 changed files with 3216 additions and 5622 deletions

1
.gitignore vendored
View File

@ -28,3 +28,4 @@ build/
.DS_Store
*.ddump
porymap.project.cfg
.vscode/

View File

@ -377,7 +377,7 @@ _08024C5A:
ldrb r0, [r0]
cmp r0, 0
beq _08024D20
bl sub_800E0E8
bl LoadWirelessStatusIndicatorSpriteGfx
movs r0, 0
movs r1, 0
bl CreateWirelessStatusIndicatorSprite

File diff suppressed because it is too large Load Diff

View File

@ -61,6 +61,10 @@ UP_ARROW = 79
DOWN_ARROW = 7A
LEFT_ARROW = 7B
RIGHT_ARROW = 7C
SUPER_E = 84
'<' = 85
'>' = 86
SUPER_RE = A0
'0' = A1
'1' = A2
'2' = A3

View File

@ -11,39 +11,40 @@
enum MON_4
.align 2
gContestAIs:: @ 82DE350
.4byte AI_CheckForBadMove
.4byte AI_CheckForCombo
.4byte AI_CheckBoring
.4byte AI_CheckExcitement
.4byte AI_CheckOrder
.4byte AI_CheckForGoodMove
.4byte AI_Erratic
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
.4byte AI_Nothing
gContestAIChecks:: @ 82DE350
.4byte AI_CheckForBadMove // 0x00000001
.4byte AI_CheckForCombo // 0x00000002
.4byte AI_CheckBoring // 0x00000004
.4byte AI_CheckExcitement // 0x00000008
.4byte AI_CheckOrder // 0x00000010
.4byte AI_CheckForGoodMove // 0x00000020
.4byte AI_Erratic // 0x00000040
.4byte AI_Nothing // 0x00000080
.4byte AI_Nothing // 0x00000100
.4byte AI_Nothing // 0x00000200
.4byte AI_Nothing // 0x00000400
.4byte AI_Nothing // 0x00000800
.4byte AI_Nothing // 0x00001000
.4byte AI_Nothing // 0x00002000
.4byte AI_Nothing // 0x00004000
.4byte AI_Nothing // 0x00008000
.4byte AI_Nothing // 0x00010000
.4byte AI_Nothing // 0x00020000
.4byte AI_Nothing // 0x00040000
.4byte AI_Nothing // 0x00080000
.4byte AI_Nothing // 0x00100000
.4byte AI_Nothing // 0x00200000
.4byte AI_Nothing // 0x00400000
.4byte AI_Nothing // 0x00800000
.4byte AI_Nothing // 0x01000000
.4byte AI_Nothing // 0x02000000
.4byte AI_Nothing // 0x04000000
.4byte AI_Nothing // 0x08000000
.4byte AI_Nothing // 0x10000000
.4byte AI_Nothing // 0x20000000
.4byte AI_Nothing // 0x40000000
.4byte AI_Nothing // 0x80000000
@ Unreferenced AI routine to encourage moves that improve condition on the first
@ turn. Additionally, it checks the appeal order of the user and the effect

View File

@ -3460,7 +3460,7 @@ EventScript_GotoTrainerScript:: @ 82742F6
gUnknown_0827E8CE:: @ 827E8CE
.string "Missed turn$"
gUnknown_0827E8DA:: @ 827E8DA
gText_LinkStandby4:: @ 827E8DA
.string "Link standby!$"
gUnknown_0827E8E8:: @ 827E8E8

View File

@ -24,12 +24,14 @@ gUnknown_082FB65C:: @ 82FB65C
.byte 0xee, 0xef, 0xf1, 0xf3, 0xf5, 0xf8, 0xfa, 0xfc
.byte 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xfd, 0xfa, 0xf7, 0xf5, 0xf2, 0xf0, 0xee, 0xec
.byte 0xea, 0xe8, 0xe6, 0xe4, 0xe3, 0xe2, 0xe2, 0xe4
.byte 0xe6, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2, 0xf5
.byte 0xf7, 0xfa, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xfd, 0xfa, 0xf7, 0xf5, 0xf3, 0xf1, 0xef, 0xed
.byte 0xeb, 0xe9, 0xe7, 0xe5, 0xe4, 0xe3, 0xe2, 0xe2
.byte 0xe2, 0xe2, 0xe3, 0xe3, 0xe4, 0xe4, 0xe5, 0xe5

View File

@ -633,7 +633,7 @@ gText_0827E6C4:: @ 827E6C4
.string "{STR_VAR_1} was\n"
.string "unaffected.{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}$"
gText_0827E6E3:: @ 827E6E3
gText_RepeatedAppeal:: @ 827E6E3
.string "{STR_VAR_1} disappointed\n"
.string "by repeating an appeal.{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}$"

View File

@ -63,7 +63,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
bool8 IsContest(void);
s8 BattleAnimAdjustPanning(s8 pan);
s8 BattleAnimAdjustPanning2(s8 pan);
s16 KeepPanInRange(s16 a);
s16 KeepPanInRange(s16 a, int oldPan);
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
void sub_80A4720(u16 a, u16 *b, u32 c, u8 d);
void sub_80A477C(bool8);

View File

@ -1,6 +1,27 @@
#ifndef GUARD_CONTEST_H
#define GUARD_CONTEST_H
#include "palette.h"
#define CONTESTANT_COUNT 4
#define APPLAUSE_METER_SIZE 5
#define CONTEST_TURN_COUNT 5
enum
{
CONTEST_DEBUG_MODE_OFF,
// Prints the totalPoints value for each contestant.
CONTEST_DEBUG_MODE_PRINT_POINT_TOTAL,
// Prints the ContestResourcesField1C::unk_C value as a bitstring for each contestant.
CONTEST_DEBUG_MODE_PRINT_UNK_C,
// Prints the ContestResourcesField1C::unk_D value as a bitstring for each contestant.
CONTEST_DEBUG_MODE_PRINT_UNK_D
};
#define LINK_CONTEST_FLAG_IS_LINK (1 << 0)
#define LINK_CONTEST_FLAG_IS_WIRELESS (1 << 1)
#define LINK_CONTEST_FLAG_HAS_RS_PLAYER (1 << 2)
enum
{
CONTEST_CATEGORY_COOL,
@ -216,7 +237,7 @@ struct ContestPokemon
/*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x0D*/ u8 trainerName[PLAYER_NAME_LENGTH + 1];
/*0x15*/ u8 trainerGfxId;
/*0x18*/ u32 flags;
/*0x18*/ u32 aiChecks;
/*0x1C*/ u8 whichRank:2; // 0x1 0x2
u8 aiPool_Cool:1; // 0x4
u8 aiPool_Beauty:1; // 0x8
@ -235,14 +256,12 @@ struct ContestPokemon
/*0x3C*/ u32 otId; // otId
};
struct Shared18000
struct Shared1A004
{
/*0x18000*/ u8 unk18000;
/*0x18001*/ u8 filler18001[3];
/*0x18004*/ u16 unk18004[16][16];
/*0x18204*/ u16 unk18204[0x200];
/*0x18604*/ u16 unk18604[0x200];
/*0x18A04*/ u8 unk18A04[0x800];
u16 cachedWindowPalettes[16][16]; // Saved palette data before a move happens?
u16 unk18204[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferUnfaded
u16 unk18604[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferFaded
u8 savedJunk[0x800];
};
struct ContestStruct_field_18
@ -260,14 +279,14 @@ struct Contest
{
/*0x0*/ u8 playerMoveChoice;
/*0x1*/ u8 turnNumber;
/*0x2*/ u8 unk19206[4]; // seems to only be used by an unref function
/*0x2*/ u8 unused2[CONTESTANT_COUNT];
/*0x6*/ u16 unk1920A_0:1; // Task active flags?
u16 unk1920A_1:1;
u16 unk1920A_2:1;
u16 unk1920A_3:1;
u16 unk1920A_4:1;
u16 unk1920A_5:1;
u16 unk1920A_6:1;
u16 isShowingApplauseMeter:1;
u16 applauseMeterIsMoving:1;
u16 unk1920A_7:1;
/*0x7*/ u16 unk1920B_0:1;
u16 unk1920B_1:1;
@ -281,12 +300,12 @@ struct Contest
/*0x11*/ u8 unk19215;
/*0x12*/ u8 unk19216; // sprite ID
/*0x13*/ s8 applauseLevel;
/*0x19218*/ u8 unk19218[4];
/*0x19218*/ u8 prevTurnOrder[CONTESTANT_COUNT];
/*0x1921C*/ u32 unk1921C; // saved RNG value?
u16 unk19220[5][4]; // move history?
u8 unk19248[5][4]; // excitement history
u8 applauseMeterSpriteId; // sprite ID
/*0x1925D*/ u8 unk1925D;
u16 moveHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT];
u8 excitementHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT];
u8 applauseMeterSpriteId;
/*0x1925D*/ u8 contestSetupState;
/*0x1925E*/ u8 unk1925E;
};
@ -294,11 +313,11 @@ struct ContestantStatus
{
/*0x00*/ s16 appeal1; // move appeal?
/*0x02*/ s16 appeal2; // final appeal after end of turn, maybe?
/*0x04*/ s16 unk4;
/*0x04*/ s16 pointTotal;
/*0x06*/ u16 currMove;
/*0x08*/ u16 prevMove;
/*0x0A*/ u8 moveCategory;
/*0x0B*/ u8 unkB_0:2;
/*0x0B*/ u8 ranking:2;
u8 unkB_2:2;
u8 moveRepeatCount:3;
u8 noMoreTurns:1; // used a one-time move?
@ -341,24 +360,24 @@ struct ContestantStatus
struct UnknownContestStruct7
{
u8 turnOrder[4];
u8 turnOrder[CONTESTANT_COUNT];
s16 jam;
s16 jam2;
u8 jamQueue[5];
u8 unnervedPokes[4];
u8 unnervedPokes[CONTESTANT_COUNT];
u8 contestant;
};
struct ContestAIInfo
{
/*0x00*/ u8 aiState;
/*0x02*/ u16 unk2;
/*0x04*/ u8 unk4;
/*0x02*/ u16 nextMove;
/*0x04*/ u8 nextMoveIndex;
/*0x05*/ u8 unk5[4];
/*0x09*/ u8 aiAction;
/*0x0A*/ u8 fillerA[0x6]; // TODO: don't know what's here
/*0x10*/ u8 unk10;
/*0x14*/ u32 flags;
/*0x10*/ u8 currentAICheck;
/*0x14*/ u32 aiChecks;
/*0x18*/ s16 scriptResult;
/*0x1A*/ s16 scriptArr[3];
/*0x20*/ const u8 *stack[8];
@ -408,30 +427,31 @@ struct ContestResourcesField20
struct ContestResources
{
struct Contest *field_0;
struct ContestantStatus *field_4;
struct Contest *contest;
struct ContestantStatus *status;
struct UnknownContestStruct7 *field_8;
struct ContestAIInfo *field_C;
struct ContestAIInfo *aiData;
struct UnknownContestStruct5 *field_10;
struct UnknownContestStruct4 *field_14;
struct ContestStruct_field_18 *field_18;
struct ContestResourcesField1C * field_1c;
struct ContestResourcesField20 * field_20;
u8 * field_24[4];
u8 * contestBgTilemaps[CONTESTANT_COUNT];
void * field_34;
void * field_38;
void * field_3c;
};
#define sContest (*gContestResources->field_0)
#define sContestantStatus (gContestResources->field_4)
#define shared192D0 (*gContestResources->field_8)
#define eContestAI (gContestResources->field_C)
#define shared19328 (*gContestResources->field_10)
#define shared19338 (*gContestResources->field_14)
#define shared15800 (gHeap + 0x18000)
#define shared16800 (gHeap + 0x19000)
#define shared18000 (*(struct Shared18000 *)(gHeap + 0x1a000))
#define eContest (*gContestResources->contest)
#define eContestantStatus (gContestResources->status)
#define eContestResources8 (*gContestResources->field_8)
#define eContestAI (*gContestResources->aiData)
#define eContestResources10 (*gContestResources->field_10)
#define eContestResources14 (*gContestResources->field_14)
#define eUnzippedContestAudienceGfx (gHeap + 0x18000)
#define eUnknownHeap19000 (gHeap + 0x19000)
#define eContestDebugMode (gHeap[0x1a000])
#define eUnknownHeap1A004 (*(struct Shared1A004 *)(gHeap + 0x1a004))
extern struct ContestPokemon gContestMons[4];
extern s16 gContestMonConditions[4];
@ -441,8 +461,8 @@ extern s16 gUnknown_02039F18[4];
extern u8 gContestFinalStandings[4];
extern u8 gContestMonPartyIndex;
extern u8 gContestPlayerMonIndex;
extern u8 gUnknown_02039F26[4];
extern u8 gIsLinkContest;
extern u8 gContestantTurnOrder[4];
extern u8 gLinkContestFlags;
extern u8 gUnknown_02039F2B;
extern u16 gSpecialVar_ContestCategory;
extern u16 gSpecialVar_ContestRank;
@ -459,7 +479,7 @@ extern u32 gContestRngValue;
// contest.c
void ResetLinkContestBoolean(void);
void LoadContestBgAfterMoveAnim(void);
void sub_80D7B24(void);
void CB2_StartContest(void);
void sub_80DA8C8(u8 partyIndex);
void sub_80DAB8C(u8 contestType, u8 rank);
void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame);
@ -467,8 +487,8 @@ u8 sub_80DAE0C(struct Pokemon *pkmn);
void sub_80DB09C(u8 contestCategory);
bool8 IsSpeciesNotUnown(u16 species);
bool8 Contest_IsMonsTurnDisabled(u8 a);
void sub_80DBED4(void);
void sub_80DCE58(u8 a);
void SaveLinkContestResults(void);
void SortContestants(bool8 a);
void SetContestantEffectStringID(u8 a, u8 b);
void SetContestantEffectStringID2(u8 a, u8 b);
void SetStartledString(u8 contestant, u8 jam);

View File

@ -5032,8 +5032,8 @@ extern const u32 gContestAudienceGfx[];
extern const u8 gContestApplauseMeterGfx[];
extern const u8 gContestNextTurnNumbersGfx[];
extern const u8 gContestNextTurnRandomGfx[];
extern const u32 gUnknown_08C16FA8[];
extern const u32 gUnknown_08C16E90[];
extern const u32 gOldContestGfx[];
extern const u32 gOldContestPalette[];
extern const u32 gUnknown_08C17170[];
extern const u32 gUnknown_08C17980[];
extern const u32 gTiles_8C19450[];

View File

@ -235,7 +235,7 @@ void LinkVSync(void);
void Timer3Intr(void);
void SerialCB(void);
bool32 InUnionRoom(void);
void sub_800E0E8(void);
void LoadWirelessStatusIndicatorSpriteGfx(void);
bool8 IsLinkTaskFinished(void);
void CreateWirelessStatusIndicatorSprite(u8, u8);
void sub_800ADF8(void);

View File

@ -2,7 +2,9 @@
#define GUARD_NEW_GAME_H
extern bool8 gDifferentSaveFile;
extern bool8 gUnknown_020322D5; // The purpose of this variable is unknown as it's read only 3 times(2 times in contest.c and 1 time in berry_blender.c), never written to.
// Shortcuts some randomness in berry_blender.c, and enables debug printing
// in contest.c.
extern bool8 gEnableContestDebugging;
void SetTrainerId(u32 trainerId, u8 *dst);
u32 GetTrainerId(u8 *trainerId);

View File

@ -2956,7 +2956,7 @@ s8 BattleAnimAdjustPanning2(s8 pan)
return pan;
}
s16 KeepPanInRange(s16 panArg)
s16 KeepPanInRange(s16 panArg, int oldPan)
{
s16 pan = panArg;

View File

@ -1734,90 +1734,25 @@ void sub_8103FE8(struct Sprite *sprite)
sprite->callback = sub_8104018;
}
#ifdef NONMATCHING
static void sub_8104018(struct Sprite *sprite)
{
u16 r7;
u16 r5;
u16 id, val;
int i;
if (++sprite->data[1] == 2)
{
sprite->data[1] = 0;
r5 = sprite->data[0];
r7 = gPlttBufferFaded[8 + r5];
for (i = 0; i < 8; i++)
{
gPlttBufferFaded[i + r5 + 8] = gPlttBufferFaded[i + r5 + 9];
}
gPlttBufferFaded[r5 + 15] = r7;
id = sprite->data[0];
val = gPlttBufferFaded[8 + id];
for (i = 8; i < 16; i++)
gPlttBufferFaded[i + id] = gPlttBufferFaded[i + id + 1];
gPlttBufferFaded[id + 15] = val;
if (++sprite->data[2] == 24)
DestroyAnimSprite(sprite);
}
}
#else
NAKED
static void sub_8104018(struct Sprite *sprite)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
adds r4, r0, 0\n\
ldrh r0, [r4, 0x30]\n\
adds r0, 0x1\n\
strh r0, [r4, 0x30]\n\
lsls r0, 16\n\
asrs r0, 16\n\
cmp r0, 0x2\n\
bne _0810407C\n\
movs r0, 0\n\
strh r0, [r4, 0x30]\n\
ldrh r5, [r4, 0x2E]\n\
ldr r1, =gPlttBufferFaded\n\
adds r0, r5, 0\n\
adds r0, 0x8\n\
lsls r0, 1\n\
adds r0, r1 \n\
ldrh r7, [r0]\n\
adds r6, r1, 0\n\
adds r1, r5, 0\n\
adds r1, 0x9\n\
lsls r0, r5, 1\n\
adds r0, r6\n\
adds r2, r0, 0\n\
adds r2, 0x10\n\
movs r3, 0x7\n\
lsls r1, 1\n\
adds r1, r6\n\
_08104050:\n\
ldrh r0, [r1]\n\
strh r0, [r2]\n\
adds r1, 0x2\n\
adds r2, 0x2\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _08104050\n\
adds r0, r5, 0\n\
adds r0, 0xF\n\
lsls r0, 1\n\
adds r0, r6\n\
strh r7, [r0]\n\
ldrh r0, [r4, 0x32]\n\
adds r0, 0x1\n\
strh r0, [r4, 0x32]\n\
lsls r0, 16\n\
asrs r0, 16\n\
cmp r0, 0x18\n\
bne _0810407C\n\
adds r0, r4, 0\n\
bl DestroyAnimSprite\n\
_0810407C:\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
.syntax divided\n");
}
#endif
void sub_8104088(struct Sprite *sprite)
{

View File

@ -57,7 +57,7 @@ static void sub_8158B98(u8 taskId)
PlaySE12WithPanning(gTasks[taskId].data[0], pan);
}
pan += panIncrement;
gTasks[taskId].data[2] = KeepPanInRange(pan);
gTasks[taskId].data[2] = KeepPanInRange(pan, panIncrement);
}
}
@ -120,9 +120,12 @@ static void sub_8158D08(u8 taskId)
if (gTasks[taskId].data[10]++ == gTasks[taskId].data[5])
{
u16 dPan, oldPan;
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[11] += gTasks[taskId].data[3];
gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11]);
dPan = gTasks[taskId].data[3];
oldPan = gTasks[taskId].data[11] ;
gTasks[taskId].data[11] = dPan + oldPan;
gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11], oldPan);
}
}
// task end
@ -372,74 +375,23 @@ void sub_8159278(u8 taskId)
sub_8159308(taskId);
}
#ifdef NONMATCHING
void sub_8159308(u8 taskId)
{
s16 panIncrement = gTasks[taskId].data[3];
u16 panIncrement = gTasks[taskId].data[3];
if (gTasks[taskId].data[10]++ == gTasks[taskId].data[5])
{
u16 oldPan;
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[11] += panIncrement;
gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11]);
oldPan = gTasks[taskId].data[11];
gTasks[taskId].data[11] = panIncrement + oldPan;
gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11], oldPan);
}
gUnknown_02038440 = gTasks[taskId].data[11];
if (gTasks[taskId].data[11] == gTasks[taskId].data[2])
DestroyAnimVisualTask(taskId);
}
#else
NAKED
void sub_8159308(u8 taskId)
{
asm_unified(" push {r4,r5,lr}\n\
lsls r0, 24\n\
lsrs r0, 24\n\
adds r5, r0, 0\n\
ldr r1, =gTasks\n\
lsls r0, r5, 2\n\
adds r0, r5\n\
lsls r0, 3\n\
adds r4, r0, r1\n\
ldrh r2, [r4, 0xE]\n\
ldrh r0, [r4, 0x1C]\n\
adds r1, r0, 0x1\n\
strh r1, [r4, 0x1C]\n\
lsls r0, 16\n\
asrs r0, 16\n\
movs r3, 0x12\n\
ldrsh r1, [r4, r3]\n\
cmp r0, r1\n\
bne _08159342\n\
movs r0, 0\n\
strh r0, [r4, 0x1C]\n\
ldrh r1, [r4, 0x1E]\n\
adds r0, r2, r1\n\
strh r0, [r4, 0x1E]\n\
movs r2, 0x1E\n\
ldrsh r0, [r4, r2]\n\
bl KeepPanInRange\n\
strh r0, [r4, 0x1E]\n\
_08159342:\n\
ldr r1, =gUnknown_02038440\n\
ldrh r0, [r4, 0x1E]\n\
strb r0, [r1]\n\
movs r3, 0x1E\n\
ldrsh r1, [r4, r3]\n\
movs r2, 0xC\n\
ldrsh r0, [r4, r2]\n\
cmp r1, r0\n\
bne _0815935A\n\
adds r0, r5, 0\n\
bl DestroyAnimVisualTask\n\
_0815935A:\n\
pop {r4,r5}\n\
pop {r0}\n\
bx r0\n\
.pool");
}
#endif
#define tSongNum data[0]
#define tPan data[1]
@ -498,3 +450,4 @@ static void AnimTask_SeVolumeChange(u8 taskId)
m4aMPlayVolumeControl(&gMPlayInfo_SE1, 0xFFFF, gTasks[taskId].tCurrentVolume);
}
}

View File

@ -33,6 +33,7 @@
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/rgb.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
@ -2449,7 +2450,7 @@ static void PlayerHandleFaintAnimation(void)
static void PlayerHandlePaletteFade(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, RGB_BLACK);
PlayerBufferExecCompleted();
}
@ -2676,7 +2677,7 @@ static void PlayerHandleChooseItem(void)
{
s32 i;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenBagAndChooseItem;
gBattlerInMenuId = gActiveBattler;
@ -2703,7 +2704,7 @@ static void PlayerHandleChoosePokemon(void)
*(&gBattleStruct->battlerPreventingSwitchout) = gBattleResources->bufferA[gActiveBattler][1] >> 4;
*(&gBattleStruct->field_8B) = gBattleResources->bufferA[gActiveBattler][2];
*(&gBattleStruct->abilityPreventingSwitchout) = gBattleResources->bufferA[gActiveBattler][3];
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon;
gBattlerInMenuId = gActiveBattler;
}
@ -2712,7 +2713,7 @@ static void PlayerHandleChoosePokemon(void)
static void PlayerHandleCmd23(void)
{
BattleStopLowHpSound();
BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, RGB_BLACK);
PlayerBufferExecCompleted();
}

View File

@ -22,6 +22,7 @@
#include "window.h"
#include "constants/battle_anim.h"
#include "constants/songs.h"
#include "constants/rgb.h"
// this file's functions
static void SafariHandleGetMonData(void);
@ -473,7 +474,7 @@ static void SafariHandleChooseItem(void)
{
s32 i;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = SafariOpenPokeblockCase;
gBattlerInMenuId = gActiveBattler;
}

View File

@ -30,6 +30,7 @@
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/rgb.h"
// this file's functions
static void WallyHandleGetMonData(void);
@ -1244,7 +1245,7 @@ static void WallyHandleChooseMove(void)
static void WallyHandleChooseItem(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenBagAfterPaletteFade;
gBattlerInMenuId = gActiveBattler;
}

View File

@ -1166,7 +1166,7 @@ static void CB2_InitSelectScreen(void)
ShowBg(0);
ShowBg(1);
SetVBlankCallback(Select_VblankCb);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_OBJ_1D_MAP);
if (sFactorySelectScreen->fromSummaryScreen == TRUE)
{
@ -1405,7 +1405,7 @@ static void Task_FromSelectScreenToSummaryScreen(u8 taskId)
{
case 6:
gPlttBufferUnfaded[228] = gPlttBufferFaded[228];
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].data[0] = 7;
break;
case 7:
@ -1442,7 +1442,7 @@ static void Task_CloseSelectionScreen(u8 taskId)
switch (gTasks[taskId].data[0])
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].data[0]++;
break;
case 1:
@ -2274,7 +2274,7 @@ static void Task_FromSwapScreenToSummaryScreen(u8 taskId)
switch (gTasks[taskId].data[0])
{
case 6:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].data[0] = 7;
break;
case 7:
@ -2327,7 +2327,7 @@ static void Task_CloseSwapScreen(u8 taskId)
gTasks[taskId].data[0]++;
break;
case 2:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].data[0]++;
break;
case 3:
@ -3218,7 +3218,7 @@ static void CB2_InitSwapScreen(void)
gMain.state++;
break;
case 14:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
ShowBg(0);
ShowBg(1);

View File

@ -840,7 +840,7 @@ static void CB2_HandleStartBattle(void)
gBattleCommunication[MULTIUSE_STATE] = 1;
}
if (gWirelessCommType)
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
break;
case 1:
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
@ -1035,7 +1035,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
gBattleCommunication[MULTIUSE_STATE] = 1;
}
if (gWirelessCommType)
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
// fall through
case 1:
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
@ -1435,7 +1435,7 @@ static void CB2_HandleStartMultiBattle(void)
gBattleCommunication[MULTIUSE_STATE] = 1;
}
if (gWirelessCommType)
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
break;
case 1:
if (gBattleTypeFlags & BATTLE_TYPE_LINK)

View File

@ -22,6 +22,7 @@
#include "gpu_regs.h"
#include "constants/game_stat.h"
#include "trainer_hill.h"
#include "constants/rgb.h"
// this file's functions
static void Task_CloseTrainerHillRecordsOnButton(u8 taskId);
@ -364,7 +365,7 @@ static void Task_CloseTrainerHillRecordsOnButton(u8 taskId)
static void Task_BeginPaletteFade(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ExitTrainerHillRecords;
}
@ -511,7 +512,7 @@ static void CB2_ShowTrainerHillRecords(void)
gMain.state++;
break;
case 6:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
gMain.state++;
break;
case 7:

View File

@ -51,6 +51,7 @@
#include "pokemon_summary_screen.h"
#include "pokenav.h"
#include "menu_specialized.h"
#include "constants/rgb.h"
#include "data.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
@ -5422,7 +5423,7 @@ static void atk5A_yesnoboxlearnmove(void)
if (gBattleCommunication[1] == 0)
{
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattleScripting.learnMoveState++;
}
else
@ -11019,7 +11020,7 @@ static void atkF2_displaydexinfo(void)
switch (gBattleCommunication[0])
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattleCommunication[0]++;
break;
case 1:
@ -11050,7 +11051,7 @@ static void atkF2_displaydexinfo(void)
case 4:
if (!IsDma3ManagerBusyWithBgCopy())
{
BeginNormalPaletteFade(0xFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFF, 0, 0x10, 0, RGB_BLACK);
ShowBg(0);
ShowBg(3);
gBattleCommunication[0]++;

View File

@ -23,6 +23,7 @@
#include "constants/field_effects.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/rgb.h"
struct TransitionData
{
@ -1076,7 +1077,7 @@ static bool8 Phase2_Blur_Func2(struct Task *task)
{
task->tData1 = 4;
if (++task->tData2 == 10)
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK);
SetGpuReg(REG_OFFSET_MOSAIC, (task->tData2 & 15) * 17);
if (task->tData2 > 14)
task->tState++;
@ -1103,7 +1104,7 @@ static bool8 Phase2_Swirl_Func1(struct Task *task)
{
sub_8149F08();
ScanlineEffect_Clear();
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK);
sub_8149F98(gScanlineEffectRegBuffers[1], sTransitionStructPtr->field_14, 0, 2, 0, 160);
SetVBlankCallback(VBlankCB_Phase2_Swirl);
@ -1158,7 +1159,7 @@ static bool8 Phase2_Shuffle_Func1(struct Task *task)
sub_8149F08();
ScanlineEffect_Clear();
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK);
memset(gScanlineEffectRegBuffers[1], sTransitionStructPtr->field_16, 0x140);
SetVBlankCallback(VBlankCB_Phase2_Shuffle);
@ -1461,7 +1462,7 @@ static bool8 Phase2_Kyogre_Func5(struct Task *task)
static bool8 Phase2_WeatherDuo_Func6(struct Task *task)
{
BeginNormalPaletteFade(0xFFFF8000, 1, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFF8000, 1, 0, 0x10, RGB_BLACK);
task->tState++;
return FALSE;
}
@ -1546,7 +1547,7 @@ static bool8 Phase2_FramesCountdown(struct Task *task)
static bool8 Phase2_WeatherTrio_Func1(struct Task *task)
{
BeginNormalPaletteFade(0x0000FFFF, 1, 0, 0x10, 0);
BeginNormalPaletteFade(0x0000FFFF, 1, 0, 0x10, RGB_BLACK);
task->tState++;
return FALSE;
}
@ -1969,7 +1970,7 @@ static bool8 Phase2_Ripple_Func2(struct Task *task)
if (++task->tData3 == 81)
{
task->tData4++;
BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 0x10, RGB_BLACK);
}
if (task->tData4 != 0 && !gPaletteFade.active)
@ -3159,7 +3160,7 @@ static bool8 Phase2_Rayquaza_Func6(struct Task *task)
{
task->tState++;
task->tData1 = 0;
BeginNormalPaletteFade(0xFFFF8000, 2, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFF8000, 2, 0, 0x10, RGB_BLACK);
}
return FALSE;
@ -3978,7 +3979,7 @@ static bool8 Phase2_30_Func4(struct Task *task)
if (++task->tData3 == 101)
{
task->tData4++;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
}
if (task->tData4 != 0 && !gPaletteFade.active)

View File

@ -36,6 +36,7 @@
#include "new_game.h"
#include "save.h"
#include "link.h"
#include "constants/rgb.h"
#define BLENDER_SCORE_BEST 0
#define BLENDER_SCORE_GOOD 1
@ -996,7 +997,7 @@ static void sub_807FAC8(void)
}
if (gReceivedRemoteLinkPlayers != 0 && gWirelessCommType)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
SetVBlankCallback(VBlankCB0_BerryBlender);
@ -1004,7 +1005,7 @@ static void sub_807FAC8(void)
}
break;
case 2:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
sub_8082D28();
sBerryBlenderData->mainState++;
break;
@ -1018,7 +1019,7 @@ static void sub_807FAC8(void)
sBerryBlenderData->mainState++;
break;
case 5:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
sBerryBlenderData->mainState++;
break;
case 6:
@ -1202,13 +1203,13 @@ static void sub_8080018(void)
}
if (gReceivedRemoteLinkPlayers != 0 && gWirelessCommType)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
sBerryBlenderData->mainState++;
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
sBerryBlenderData->mainState++;
break;
case 4:
@ -1534,7 +1535,7 @@ static void sub_80808D4(void)
sBerryBlenderData->mainState++;
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
sBerryBlenderData->mainState++;
sBerryBlenderData->framesToWait = 0;
break;
@ -2037,7 +2038,7 @@ static void sub_8081744(void)
sBerryBlenderData->field_4C--;
sBerryBlenderData->field_72 = 0;
}
if (gUnknown_020322D5 && gMain.newKeys & L_BUTTON)
if (gEnableContestDebugging && gMain.newKeys & L_BUTTON)
sBerryBlenderData->field_123 ^= 1;
}
@ -2700,7 +2701,7 @@ static void CB2_HandlePlayerLinkPlayAgainChoice(void)
case 9:
if (IsLinkTaskFinished())
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
sBerryBlenderData->gameEndState++;
}
break;

View File

@ -337,7 +337,7 @@ void sub_8020FC4(struct BerryCrushGame *arg0)
for (i = 0; i < arg0->unk9; i++)
StringCopy(arg0->unk84.players[i].unk14, gLinkPlayers[i].name);
for (; i < 5; i++)
{
memset(arg0->unk84.players[i].unk14, 1, PLAYER_NAME_LENGTH);
@ -511,7 +511,7 @@ int sub_802104C(void)
CopyBgTilemapBufferToVram(3);
break;
case 8:
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
sub_8022730(var0);
SetGpuReg(REG_OFFSET_BG1VOFS, -gSpriteCoordOffsetY);

View File

@ -28,6 +28,7 @@
#include "item_menu_icons.h"
#include "decompress.h"
#include "international_string_util.h"
#include "constants/rgb.h"
// There are 4 windows used in berry tag screen.
enum
@ -279,7 +280,7 @@ static bool8 InitBerryTagScreen(void)
gMain.state++;
break;
case 15:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = 0;
gMain.state++;
break;
@ -513,7 +514,7 @@ static void DestroyFlavorCircleSprites(void)
static void PrepareToCloseBerryTagScreen(u8 taskId)
{
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_CloseBerryTagScreen;
}

View File

@ -163,7 +163,7 @@ static bool8 SetupClearSaveDataScreen(void)
ShowBg(3);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
InitClearSaveDataScreenWindows();
BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, 0xFFFF);
BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, RGB_WHITEALPHA);
EnableInterrupts(INTR_FLAG_VBLANK);
SetVBlankCallback(VBlankCB);
gMain.state = 1;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -121,7 +121,7 @@ static void sub_80F5F30(u8);
static void sub_80F5F74(u8);
static void sub_80F7144(void);
static void sub_80F68F0(u8);
s16 sub_80F6B78(const u8 *, u8);
s32 sub_80F6B78(const u8 *, u8);
static void sub_80F6E9C(s16, u16, u16, u16);
static void sub_80F6058(u8);
static void sub_80F7A80(u8, u8);
@ -309,7 +309,7 @@ void sub_80F5B00(void)
gBattle_WIN1V = 0x80A0;
CreateTask(sub_80F68B4, 20);
sub_80F7880();
if (gIsLinkContest & 0x2)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
gPaletteFade.bufferTransferDisabled = 1;
else
PlayBGM(MUS_CON_K);
@ -351,12 +351,12 @@ static void sub_80F5CE4(u8 taskId)
{
u16 var;
if (gIsLinkContest & 1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
switch (gTasks[taskId].data[0])
{
case 0:
sub_80DBED4();
SaveLinkContestResults();
if (gContestFinalStandings[gContestPlayerMonIndex] == 0)
{
IncrementGameStat(GAME_STAT_WON_LINK_CONTEST);
@ -381,7 +381,7 @@ static void sub_80F5CE4(u8 taskId)
break;
case 1:
gTasks[taskId].data[0]++;
if (!(gIsLinkContest & 0x2))
if (!(gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS))
gTasks[taskId].data[0] = 100;
break;
case 2:
@ -406,7 +406,7 @@ static void sub_80F5CE4(u8 taskId)
if (!gPaletteFade.active)
{
gTasks[taskId].data[0] = 0;
if (gIsLinkContest & 0x1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
sub_80F707C(gText_CommunicationStandby);
gTasks[taskId].func = sub_80F5ED8;
@ -742,7 +742,7 @@ static void sub_80F66B4(u8 taskId)
if (gMain.newKeys & A_BUTTON)
{
if (!(gIsLinkContest & 0x1))
if (!(gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK))
{
for (i = 0; i < 4; i++)
{
@ -758,7 +758,7 @@ static void sub_80F66B4(u8 taskId)
static void sub_80F671C(u8 taskId)
{
if (gIsLinkContest & 0x1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
if (!gTasks[taskId].data[10])
{
@ -777,7 +777,7 @@ static void sub_80F677C(u8 taskId)
{
if (!gReceivedRemoteLinkPlayers)
{
if (gIsLinkContest & 0x2)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
DestroyWirelessStatusIndicatorSprite();
sub_80F7144();
@ -787,7 +787,7 @@ static void sub_80F677C(u8 taskId)
static void sub_80F67C4(u8 taskId)
{
if (!(gIsLinkContest & 0x1))
if (!(gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK))
BravoTrainerPokemonProfile_BeforeInterview2(gContestFinalStandings[gContestPlayerMonIndex]);
BeginHardwarePaletteFade(0xFF, 0, 0, 16, 0);
@ -907,9 +907,9 @@ static void sub_80F6AE8(void)
u16 sheet;
u8 spriteId;
if (gIsLinkContest & 0x2)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(8, 8);
gSprites[gWirelessStatusIndicatorSpriteId].subpriority = 1;
sheet = LoadSpriteSheet(&gUnknown_0858D8E0);
@ -919,39 +919,76 @@ static void sub_80F6AE8(void)
}
}
// s16 sub_80F6B78(const u8 *text, u8 spriteId)
// {
// int i;
// int origWidth, strWidth;
// const u8 *r8;
// u8 sp10[0x10];
// struct WindowTemplate windowTemplate;
// int spC;
// u8 *windowTileData;
// u8 windowId;
// Functionally equivalent, the same except compiler generated variables from
// src are placed on different stack positions.
// memset(windowTemplate, 0, sizeof(*windowTemplate));
// windowTemplate.width = 30;
// windowTemplate.height = 2;
// windowId = AddWindow(&windowTemplate);
// FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
// origWidth = GetStringWidth(1, text, 0) + 9;
// strWidth = origWidth;
// if (strWidth < 0)
// strWidth += 7;
#ifdef NONMATCHING
s32 sub_80F6B78(const u8 *text, u8 spriteId)
{
u8 *windowTilesPtr;
u16 windowId;
int origWidth;
struct WindowTemplate windowTemplate;
int strWidth;
u8 *spriteTilePtrs[4];
u8 *dst;
int i;
struct Sprite *sprite;
const u8 *src; // The culprit.
// strWidth >>= 3;
// if (strWidth > 30)
// strWidth = 30;
memset(&windowTemplate, 0, sizeof(windowTemplate));
windowTemplate.width = 30;
windowTemplate.height = 2;
windowId = AddWindow(&windowTemplate);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
// AddTextPrinterParameterized3(windowId, 1, (strWidth * 8 - origWidth) / 2, 1, gUnknown_0858D8E8, -1, text);
// windowTileData = (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
// r8 = gUnknown_0858D6D0;
// // ....
// }
origWidth = GetStringWidth(1, text, 0);
strWidth = (origWidth + 9) / 8;
if (strWidth > 30)
strWidth = 30;
AddTextPrinterParameterized3(windowId, 1, (strWidth * 8 - origWidth) / 2, 1, gUnknown_0858D8E8, -1, text);
windowTilesPtr = (u8 *)(GetWindowAttribute(windowId, WINDOW_TILE_DATA));
src = (u8 *)(gUnknown_0858D6D0);
sprite = &gSprites[spriteId];
spriteTilePtrs[0] = (u8 *)(sprite->oam.tileNum * 32 + VRAM + 0x10000);
for (i = 1; i < 4; i++)
spriteTilePtrs[i] = (void*)(gSprites[sprite->data[i - 1]].oam.tileNum * 32 + VRAM + 0x10000);
for (i = 0; i < 4; i++)
CpuFill32(0, spriteTilePtrs[i], 0x400);
dst = spriteTilePtrs[0];
CpuCopy32(src, dst, 0x20);
CpuCopy32(src + 128, dst + 0x100, 0x20);
CpuCopy32(src + 128, dst + 0x200, 0x20);
CpuCopy32(src + 64, dst + 0x300, 0x20);
for (i = 0; i < strWidth; i++)
{
dst = &spriteTilePtrs[(i + 1) / 8][((i + 1) % 8) * 32];
CpuCopy32(src + 192, dst, 0x20);
CpuCopy32(windowTilesPtr, dst + 0x100, 0x20);
CpuCopy32(windowTilesPtr + 960, dst + 0x200, 0x20);
CpuCopy32(src + 224, dst + 0x300, 0x20);
windowTilesPtr += 0x20;
}
dst = &spriteTilePtrs[(i + 1) / 8][((i + 1) % 8) * 32];
CpuCopy32(src + 32, dst, 0x20);
CpuCopy32(src + 160, dst + 0x100, 0x20);
CpuCopy32(src + 160, dst + 0x200, 0x20);
CpuCopy32(src + 96, dst + 0x300, 0x20);
RemoveWindow(windowId);
return (240 - (strWidth + 2) * 8) / 2;
}
#else
NAKED
s16 sub_80F6B78(const u8 *text, u8 spriteId)
s32 sub_80F6B78(const u8 *text, u8 spriteId)
{
asm_unified("\n\
push {r4-r7,lr}\n\
@ -1224,6 +1261,7 @@ _080F6D3E:\n\
bx r1\n\
.pool");
}
#endif // NONMATCHING
static void sub_80F6DC0(void)
{
@ -1392,7 +1430,7 @@ static void sub_80F71C8(void)
x = 5;
y = 1;
if (gIsLinkContest & 0x1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
CopyToBgTilemapBufferRect(2, gUnknown_08DC6498, 5, 1, 5, 2);
x = 10;
@ -1630,7 +1668,7 @@ void sub_80F7768(struct Sprite *sprite)
sprite->pos1.y++;
if (gUnknown_0203A034->unk0->unk9)
sprite->invisible = 1;
if (sprite->pos1.x > 248 || sprite->pos1.y > 116)
{
DestroySprite(sprite);
@ -2091,7 +2129,7 @@ _080F7A70:\n\
// if (spC)
// PlaySE(SE_PIN);
// if (sp8)
// PlaySE(SE_BAN);
// }
@ -2358,38 +2396,32 @@ _080F7C96:\n\
bx r0");
}
#ifdef NONMATCHING
void sub_80F7CA8(u8 taskId)
{
register int r4 asm("r4");
int r9;
u8 r6;
s16 r7;
s16 r12;
int i;
u8 var0;
u16 tileNum;
bool32 r4 = FALSE;
bool32 endTask = FALSE;
u8 r6 = gTasks[taskId].data[0];
s16 r7 = gTasks[taskId].data[1];
s16 r12 = gTasks[taskId].data[2];
r4 = 0;
r9 = 0;
r6 = gTasks[taskId].data[0];
r7 = gTasks[taskId].data[1];
r12 = gTasks[taskId].data[2];
if (r12)
{
if (gUnknown_0203A034->unk0->unkC[r6] <= 0)
r4 = 1;
r4 = TRUE;
}
else
{
if (gUnknown_0203A034->unk0->unkC[r6] > 87)
r4 = 1;
r4 = TRUE;
}
if (gUnknown_0203A034->unk0->unkC[r6] == r7)
r9 = 1;
endTask = TRUE;
if (!r9)
if (!endTask)
{
if (r4)
gUnknown_0203A034->unk0->unkC[r6] = r7;
@ -2399,220 +2431,32 @@ void sub_80F7CA8(u8 taskId)
gUnknown_0203A034->unk0->unkC[r6] = gUnknown_0203A034->unk0->unkC[r6] + 1;
}
if (!r4 && !r9)
if (!r4 && !endTask)
{
for (i = 0; i < 11; i++)
{
if (gUnknown_0203A034->unk0->unkC[r6] >= (i + 1) * 8)
{
var0 = 8;
}
else if (gUnknown_0203A034->unk0->unkC[r6] >= i * 8)
{
int var2 = gUnknown_0203A034->unk0->unkC[r6];
int var1 = var2;
if (var1 < 0)
var1 += 7;
var0 = var2 - ((var1 >> 3) << 3);
}
var0 = gUnknown_0203A034->unk0->unkC[r6] % 8;
else
{
var0 = 0;
}
if (var0 < 4)
tileNum = 0x504C;
tileNum = 0x504C + var0;
else
tileNum = 0x5057;
tileNum = 0x5057 + var0;
FillBgTilemapBufferRect_Palette0(2, tileNum + var0, i + 7, r6 * 3 + 6, 1, 1);
FillBgTilemapBufferRect_Palette0(2, tileNum, i + 7, r6 * 3 + 6, 1, 1);
}
}
if (r9)
if (endTask)
{
gUnknown_0203A034->unk0->unk14--;
DestroyTask(taskId);
}
}
#else
NAKED
void sub_80F7CA8(u8 taskId)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r9\n\
mov r6, r8\n\
push {r6,r7}\n\
sub sp, 0x8\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
movs r4, 0\n\
mov r9, r4\n\
ldr r1, =gTasks\n\
lsls r0, 2\n\
add r0, r8\n\
lsls r0, 3\n\
adds r0, r1\n\
ldrb r6, [r0, 0x8]\n\
ldrh r7, [r0, 0xA]\n\
ldrh r1, [r0, 0xC]\n\
mov r12, r1\n\
movs r2, 0xC\n\
ldrsh r0, [r0, r2]\n\
cmp r0, 0\n\
beq _080F7CF8\n\
ldr r2, =gUnknown_0203A034\n\
ldr r0, [r2]\n\
ldr r0, [r0]\n\
lsls r1, r6, 1\n\
adds r0, 0xC\n\
adds r0, r1\n\
movs r3, 0\n\
ldrsh r0, [r0, r3]\n\
adds r5, r1, 0\n\
cmp r0, 0\n\
bgt _080F7D10\n\
b _080F7D0E\n\
.pool\n\
_080F7CF8:\n\
ldr r2, =gUnknown_0203A034\n\
ldr r0, [r2]\n\
ldr r0, [r0]\n\
lsls r1, r6, 1\n\
adds r0, 0xC\n\
adds r0, r1\n\
movs r3, 0\n\
ldrsh r0, [r0, r3]\n\
adds r5, r1, 0\n\
cmp r0, 0x57\n\
ble _080F7D10\n\
_080F7D0E:\n\
movs r4, 0x1\n\
_080F7D10:\n\
ldr r0, [r2]\n\
ldr r0, [r0]\n\
adds r0, 0xC\n\
adds r2, r0, r5\n\
ldrh r3, [r2]\n\
movs r0, 0\n\
ldrsh r1, [r2, r0]\n\
lsls r0, r7, 16\n\
asrs r0, 16\n\
cmp r1, r0\n\
bne _080F7D2A\n\
movs r1, 0x1\n\
mov r9, r1\n\
_080F7D2A:\n\
mov r0, r9\n\
cmp r0, 0\n\
bne _080F7D4A\n\
cmp r4, 0\n\
beq _080F7D3C\n\
strh r7, [r2]\n\
b _080F7D4A\n\
.pool\n\
_080F7D3C:\n\
mov r1, r12\n\
cmp r1, 0\n\
beq _080F7D46\n\
subs r0, r3, 0x1\n\
b _080F7D48\n\
_080F7D46:\n\
adds r0, r3, 0x1\n\
_080F7D48:\n\
strh r0, [r2]\n\
_080F7D4A:\n\
cmp r4, 0\n\
bne _080F7DC4\n\
mov r2, r9\n\
cmp r2, 0\n\
bne _080F7DCA\n\
movs r2, 0\n\
_080F7D56:\n\
ldr r0, =gUnknown_0203A034\n\
ldr r0, [r0]\n\
ldr r0, [r0]\n\
adds r0, 0xC\n\
adds r0, r5\n\
movs r1, 0\n\
ldrsh r3, [r0, r1]\n\
adds r0, r2, 0x1\n\
lsls r1, r0, 3\n\
adds r4, r0, 0\n\
cmp r3, r1\n\
blt _080F7D78\n\
movs r0, 0x8\n\
b _080F7D94\n\
.pool\n\
_080F7D78:\n\
lsls r0, r2, 3\n\
cmp r3, r0\n\
blt _080F7D92\n\
adds r0, r3, 0\n\
cmp r3, 0\n\
bge _080F7D86\n\
adds r0, r3, 0x7\n\
_080F7D86:\n\
asrs r0, 3\n\
lsls r0, 3\n\
subs r0, r3, r0\n\
lsls r0, 24\n\
lsrs r0, 24\n\
b _080F7D94\n\
_080F7D92:\n\
movs r0, 0\n\
_080F7D94:\n\
cmp r0, 0x3\n\
bhi _080F7DA0\n\
ldr r3, =0x0000504c\n\
b _080F7DA2\n\
.pool\n\
_080F7DA0:\n\
ldr r3, =0x00005057\n\
_080F7DA2:\n\
adds r1, r0, r3\n\
adds r2, 0x7\n\
lsls r2, 24\n\
lsrs r2, 24\n\
adds r3, r5, r6\n\
adds r3, 0x6\n\
lsls r3, 24\n\
movs r0, 0x1\n\
str r0, [sp]\n\
str r0, [sp, 0x4]\n\
movs r0, 0x2\n\
lsrs r3, 24\n\
bl FillBgTilemapBufferRect_Palette0\n\
adds r2, r4, 0\n\
cmp r2, 0xA\n\
ble _080F7D56\n\
_080F7DC4:\n\
mov r0, r9\n\
cmp r0, 0\n\
beq _080F7DDC\n\
_080F7DCA:\n\
ldr r0, =gUnknown_0203A034\n\
ldr r0, [r0]\n\
ldr r1, [r0]\n\
ldrb r0, [r1, 0x14]\n\
subs r0, 0x1\n\
strb r0, [r1, 0x14]\n\
mov r0, r8\n\
bl DestroyTask\n\
_080F7DDC:\n\
add sp, 0x8\n\
pop {r3,r4}\n\
mov r8, r3\n\
mov r9, r4\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool");
}
#endif // NONMATCHING
static void sub_80F7DF4(void)
{
@ -2830,7 +2674,7 @@ void sub_80F8390(void)
void sub_80F83D0(void)
{
SetMainCallback2(sub_80D7B24);
SetMainCallback2(CB2_StartContest);
}
static void sub_80F83E0(u8 taskId)
@ -2886,7 +2730,7 @@ void sub_80F84C4(u8 taskId)
static void sub_80F8508(u8 taskId)
{
if (gIsLinkContest & 0x4)
if (gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER)
{
sub_80DA8C8(gContestMonPartyIndex);
SetTaskFuncWithFollowupFunc(taskId, sub_80FC6BC, sub_80F8568);
@ -2913,10 +2757,9 @@ static void sub_80F85A0(u8 taskId)
SetTaskFuncWithFollowupFunc(taskId, sub_80FC894, sub_80F85BC);
}
#ifdef NONMATCHING
static void sub_80F85BC(u8 taskId)
{
u32 i;
u8 i;
u8 sp0[4];
u8 sp4[4];
@ -2926,9 +2769,10 @@ static void sub_80F85BC(u8 taskId)
for (i = 0; i < gNumLinkContestPlayers; i++)
sp0[i] = gTasks[taskId].data[i + 1];
for (i = 0; i < gNumLinkContestPlayers; i++)
for (i = 0; i < gNumLinkContestPlayers;)
{
if (sp0[0] != sp0[i + 1])
i++;
if (i >= gNumLinkContestPlayers || sp0[0] != sp0[i])
break;
}
@ -2939,137 +2783,15 @@ static void sub_80F85BC(u8 taskId)
for (i = 0; i < gNumLinkContestPlayers; i++)
sp4[i] = gTasks[taskId].data[i + 5];
gUnknown_02039F2B = sub_80F86E0(sp4);
sub_80DB09C(gSpecialVar_ContestCategory);
SetTaskFuncWithFollowupFunc(taskId, sub_80FCF40, sub_80F86B8);
}
#else
NAKED
static void sub_80F85BC(u8 taskId)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r9\n\
mov r6, r8\n\
push {r6,r7}\n\
sub sp, 0x8\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
movs r0, 0\n\
str r0, [sp]\n\
str r0, [sp, 0x4]\n\
movs r3, 0\n\
ldr r5, =gNumLinkContestPlayers\n\
mov r12, r5\n\
ldr r0, =gSpecialVar_0x8004\n\
mov r9, r0\n\
add r1, sp, 0x4\n\
mov r8, r1\n\
ldrb r0, [r5]\n\
cmp r3, r0\n\
bcs _080F8606\n\
lsls r0, r6, 2\n\
adds r0, r6\n\
lsls r4, r0, 3\n\
ldr r7, =gTasks + 0x8\n\
_080F85EC:\n\
mov r1, sp\n\
adds r2, r1, r3\n\
adds r1, r3, 0x1\n\
lsls r0, r1, 1\n\
adds r0, r4\n\
adds r0, r7\n\
ldrh r0, [r0]\n\
strb r0, [r2]\n\
lsls r1, 24\n\
lsrs r3, r1, 24\n\
ldrb r0, [r5]\n\
cmp r3, r0\n\
bcc _080F85EC\n\
_080F8606:\n\
movs r3, 0\n\
mov r1, r12\n\
ldrb r0, [r1]\n\
cmp r3, r0\n\
bcs _080F862A\n\
adds r4, r0, 0\n\
mov r2, sp\n\
_080F8614:\n\
adds r0, r3, 0x1\n\
lsls r0, 24\n\
lsrs r3, r0, 24\n\
cmp r3, r4\n\
bcs _080F862A\n\
mov r0, sp\n\
adds r1, r0, r3\n\
ldrb r0, [r2]\n\
ldrb r1, [r1]\n\
cmp r0, r1\n\
beq _080F8614\n\
_080F862A:\n\
mov r1, r12\n\
ldrb r1, [r1]\n\
cmp r3, r1\n\
bne _080F8644\n\
movs r0, 0\n\
b _080F8646\n\
.pool\n\
_080F8644:\n\
movs r0, 0x1\n\
_080F8646:\n\
mov r1, r9\n\
strh r0, [r1]\n\
movs r3, 0\n\
mov r4, r12\n\
ldrb r0, [r4]\n\
cmp r3, r0\n\
bcs _080F8678\n\
mov r5, r8\n\
lsls r0, r6, 2\n\
adds r0, r6\n\
lsls r2, r0, 3\n\
ldr r7, =gTasks + 0x8\n\
_080F865E:\n\
adds r1, r5, r3\n\
adds r0, r3, 0x5\n\
lsls r0, 1\n\
adds r0, r2\n\
adds r0, r7\n\
ldrh r0, [r0]\n\
strb r0, [r1]\n\
adds r0, r3, 0x1\n\
lsls r0, 24\n\
lsrs r3, r0, 24\n\
ldrb r1, [r4]\n\
cmp r3, r1\n\
bcc _080F865E\n\
_080F8678:\n\
mov r0, r8\n\
bl sub_80F86E0\n\
ldr r1, =gUnknown_02039F2B\n\
strb r0, [r1]\n\
ldr r0, =gSpecialVar_ContestCategory\n\
ldrb r0, [r0]\n\
bl sub_80DB09C\n\
ldr r1, =sub_80FCF40\n\
ldr r2, =sub_80F86B8\n\
adds r0, r6, 0\n\
bl SetTaskFuncWithFollowupFunc\n\
add sp, 0x8\n\
pop {r3,r4}\n\
mov r8, r3\n\
mov r9, r4\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool");
}
#endif // NONMATCHING
static void sub_80F86B8(u8 taskId)
{
sub_80DCE58(0);
SortContestants(FALSE);
SetTaskFuncWithFollowupFunc(taskId, sub_80FCFD0, sub_80F8714);
}

View File

@ -72,22 +72,22 @@ static void sub_80FC5DC(u8 taskId)
gContestPlayerMonIndex = GetMultiplayerId();
gNumLinkContestPlayers = GetLinkPlayerCount();
gIsLinkContest = 1;
gLinkContestFlags = LINK_CONTEST_FLAG_IS_LINK;
if (gWirelessCommType == 1)
gIsLinkContest = 3;
gLinkContestFlags = LINK_CONTEST_FLAG_IS_LINK | LINK_CONTEST_FLAG_IS_WIRELESS;
for (i = 0; i < gNumLinkContestPlayers && (u32)(gLinkPlayers[i].version & 0xFF) - 1 > VERSION_RUBY - 1; i++)
;
if (i < gNumLinkContestPlayers)
gIsLinkContest |= 0x4;
gLinkContestFlags |= LINK_CONTEST_FLAG_HAS_RS_PLAYER;
SwitchTaskToFollowupFunc(taskId);
}
bool32 sub_80FC670(s16 *arg0)
{
if (gIsLinkContest & 0x4)
if (gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER)
return TRUE;
switch (*arg0)
@ -269,7 +269,7 @@ void sub_80FC9F8(u8 taskId)
case 0:
if (IsLinkTaskFinished())
{
if (sub_80FC4F4(&gContestResources->field_4[gContestPlayerMonIndex].currMove, sizeof(gContestResources->field_4[gContestPlayerMonIndex].currMove)) == TRUE)
if (sub_80FC4F4(&eContestantStatus[gContestPlayerMonIndex].currMove, sizeof(eContestantStatus[gContestPlayerMonIndex].currMove)) == TRUE)
gTasks[taskId].data[0]++;
}
break;
@ -277,7 +277,7 @@ void sub_80FC9F8(u8 taskId)
if (sub_80FC55C())
{
for (i = 0; i < gNumLinkContestPlayers; i++)
gContestResources->field_4[i].currMove = gBlockRecvBuffer[i][0];
eContestantStatus[i].currMove = gBlockRecvBuffer[i][0];
gTasks[taskId].data[0]++;
}
@ -373,14 +373,14 @@ void sub_80FCC88(u8 taskId)
case 0:
if (IsLinkTaskFinished())
{
if (sub_80FC4F4(gContestResources->field_4, 4 * sizeof(struct ContestantStatus)) == 1)
if (sub_80FC4F4(eContestantStatus, 4 * sizeof(struct ContestantStatus)) == 1)
gTasks[taskId].data[0]++;
}
break;
case 1:
if (sub_80FC55C())
{
memcpy(gContestResources->field_4, gBlockRecvBuffer[gUnknown_02039F2B], 4 * sizeof(struct ContestantStatus));
memcpy(eContestantStatus, gBlockRecvBuffer[gUnknown_02039F2B], 4 * sizeof(struct ContestantStatus));
gTasks[taskId].data[0]++;
}
break;
@ -425,14 +425,14 @@ void sub_80FCC88(u8 taskId)
case 9:
if (IsLinkTaskFinished())
{
if (sub_80FC4F4(gUnknown_02039F26, sizeof(gUnknown_02039F26)) == 1)
if (sub_80FC4F4(gContestantTurnOrder, sizeof(gContestantTurnOrder)) == 1)
gTasks[taskId].data[0]++;
}
break;
case 10:
if (sub_80FC55C())
{
memcpy(gUnknown_02039F26, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gUnknown_02039F26));
memcpy(gContestantTurnOrder, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestantTurnOrder));
gTasks[taskId].data[0]++;
}
break;
@ -528,14 +528,14 @@ void sub_80FCFD0(u8 taskId)
case 0:
if (IsLinkTaskFinished())
{
if (sub_80FC4F4(gUnknown_02039F26, sizeof(gUnknown_02039F26)) == 1)
if (sub_80FC4F4(gContestantTurnOrder, sizeof(gContestantTurnOrder)) == 1)
gTasks[taskId].data[0]++;
}
break;
case 1:
if (sub_80FC55C())
{
memcpy(gUnknown_02039F26, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gUnknown_02039F26));
memcpy(gContestantTurnOrder, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestantTurnOrder));
gTasks[taskId].data[0]++;
}
break;

View File

@ -134,7 +134,7 @@ static void sub_81DA10C(u8 taskId)
static void sub_81DA138(u8 taskId)
{
sub_80DCE58(0);
SortContestants(FALSE);
SetTaskFuncWithFollowupFunc(taskId, sub_80FCFD0, sub_80F8714);
}

View File

@ -183,7 +183,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("POOCHY"),
.trainerName = _("JIMMY"),
.trainerGfxId = EVENT_OBJ_GFX_BOY_1,
.flags = 0xC000FFF,
.aiChecks = 0xC000FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -212,7 +212,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("MUSILLE"),
.trainerName = _("EDITH"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -241,7 +241,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DUSTER"),
.trainerName = _("EVAN"),
.trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
.flags = 0x21000FFF,
.aiChecks = 0x21000FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -270,7 +270,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DOTS"),
.trainerName = _("KELSEY"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
.flags = 0x20800FFF,
.aiChecks = 0x20800FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -299,7 +299,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("TATAY"),
.trainerName = _("MADISON"),
.trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
.flags = 0x80400FFF,
.aiChecks = 0x80400FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -328,7 +328,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("NINDA"),
.trainerName = _("RAYMOND"),
.trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
.flags = 0x10200FFF,
.aiChecks = 0x10200FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -357,7 +357,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SMISH"),
.trainerName = _("GRANT"),
.trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
.flags = 0x20100FFF,
.aiChecks = 0x20100FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -386,7 +386,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SLEAL"),
.trainerName = _("PAIGE"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
.flags = 0x8080FFF,
.aiChecks = 0x8080FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -415,7 +415,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SLOKTH"),
.trainerName = _("ALEC"),
.trainerGfxId = EVENT_OBJ_GFX_CAMPER,
.flags = 0x40040FFF,
.aiChecks = 0x40040FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -444,7 +444,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("WHIRIS"),
.trainerName = _("SYDNEY"),
.trainerGfxId = EVENT_OBJ_GFX_LASS,
.flags = 0x80020FFF,
.aiChecks = 0x80020FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -473,7 +473,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("MAHITA"),
.trainerName = _("MORRIS"),
.trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
.flags = 0x8010FFF,
.aiChecks = 0x8010FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -502,7 +502,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("RONAR"),
.trainerName = _("MARIAH"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
.flags = 0x8008FFF,
.aiChecks = 0x8008FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -531,7 +531,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BATRO"),
.trainerName = _("RUSSELL"),
.trainerGfxId = EVENT_OBJ_GFX_MAN_3,
.flags = 0x90004FFF,
.aiChecks = 0x90004FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -560,7 +560,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("GULIN"),
.trainerName = _("MELANIE"),
.trainerGfxId = EVENT_OBJ_GFX_TWIN,
.flags = 0x40002FFF,
.aiChecks = 0x40002FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -589,7 +589,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("RIKELEC"),
.trainerName = _("CHANCE"),
.trainerGfxId = EVENT_OBJ_GFX_RICH_BOY,
.flags = 0x80001FFF,
.aiChecks = 0x80001FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -618,7 +618,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BULBY"),
.trainerName = _("AGATHA"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_2,
.flags = 0xC000FFF,
.aiChecks = 0xC000FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -647,7 +647,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("FUTTERBE"),
.trainerName = _("BEAU"),
.trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -676,7 +676,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("PIDEOT"),
.trainerName = _("KAY"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_5,
.flags = 0x21000FFF,
.aiChecks = 0x21000FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -705,7 +705,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DIGLE"),
.trainerName = _("CALE"),
.trainerGfxId = EVENT_OBJ_GFX_HIKER,
.flags = 0x20800FFF,
.aiChecks = 0x20800FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -734,7 +734,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("WAGIL"),
.trainerName = _("CAITLIN"),
.trainerGfxId = EVENT_OBJ_GFX_TUBER_F,
.flags = 0x80400FFF,
.aiChecks = 0x80400FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -763,7 +763,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("TOTDIL"),
.trainerName = _("COLBY"),
.trainerGfxId = EVENT_OBJ_GFX_NINJA_BOY,
.flags = 0x10200FFF,
.aiChecks = 0x10200FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -792,7 +792,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BALEDY"),
.trainerName = _("KYLIE"),
.trainerGfxId = EVENT_OBJ_GFX_BEAUTY,
.flags = 0x20100FFF,
.aiChecks = 0x20100FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -821,7 +821,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BIRDLY"),
.trainerName = _("LIAM"),
.trainerGfxId = EVENT_OBJ_GFX_MAN_5,
.flags = 0x8080FFF,
.aiChecks = 0x8080FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -850,7 +850,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("TARVITAR"),
.trainerName = _("MILO"),
.trainerGfxId = EVENT_OBJ_GFX_MANIAC,
.flags = 0x40040FFF,
.aiChecks = 0x40040FFF,
.whichRank = CONTEST_RANK_NORMAL,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -879,7 +879,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("RELIA"),
.trainerName = _("KARINA"),
.trainerGfxId = EVENT_OBJ_GFX_PICNICKER,
.flags = 0x24000FFF,
.aiChecks = 0x24000FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -908,7 +908,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DUODO"),
.trainerName = _("BOBBY"),
.trainerGfxId = EVENT_OBJ_GFX_RUNNING_TRIATHLETE_M,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -937,7 +937,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("PINCHIN"),
.trainerName = _("CLAIRE"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
.flags = 0x81000FFF,
.aiChecks = 0x81000FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -966,7 +966,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("NACAC"),
.trainerName = _("WILLIE"),
.trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
.flags = 0x80800FFF,
.aiChecks = 0x80800FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -995,7 +995,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SHRAND"),
.trainerName = _("CASSIDY"),
.trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
.flags = 0x10400FFF,
.aiChecks = 0x10400FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -1024,7 +1024,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("TOYBAL"),
.trainerName = _("MORGAN"),
.trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
.flags = 0x8200FFF,
.aiChecks = 0x8200FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1053,7 +1053,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("CHAMCHAM"),
.trainerName = _("SUMMER"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
.flags = 0x10100FFF,
.aiChecks = 0x10100FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -1082,7 +1082,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SPININ"),
.trainerName = _("MILES"),
.trainerGfxId = EVENT_OBJ_GFX_CAMPER,
.flags = 0x80080FFF,
.aiChecks = 0x80080FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1111,7 +1111,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SWABY"),
.trainerName = _("AUDREY"),
.trainerGfxId = EVENT_OBJ_GFX_LASS,
.flags = 0xA0040FFF,
.aiChecks = 0xA0040FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1140,7 +1140,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("POINKER"),
.trainerName = _("AVERY"),
.trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
.flags = 0x80020FFF,
.aiChecks = 0x80020FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1169,7 +1169,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("KECON"),
.trainerName = _("ARIANA"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
.flags = 0x80010FFF,
.aiChecks = 0x80010FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1198,7 +1198,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("GOLDEN"),
.trainerName = _("ASHTON"),
.trainerGfxId = EVENT_OBJ_GFX_MAN_3,
.flags = 0x80008FFF,
.aiChecks = 0x80008FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -1227,7 +1227,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BOBOACH"),
.trainerName = _("SANDRA"),
.trainerGfxId = EVENT_OBJ_GFX_TWIN,
.flags = 0x80004FFF,
.aiChecks = 0x80004FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1256,7 +1256,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("CORPY"),
.trainerName = _("CARSON"),
.trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
.flags = 0x8002FFF,
.aiChecks = 0x8002FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -1285,7 +1285,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("TADO"),
.trainerName = _("KATRINA"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
.flags = 0x8001FFF,
.aiChecks = 0x8001FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1314,7 +1314,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BROWLO"),
.trainerName = _("LUKE"),
.trainerGfxId = EVENT_OBJ_GFX_FAT_MAN,
.flags = 0xC000FFF,
.aiChecks = 0xC000FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1343,7 +1343,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("FETCHIN"),
.trainerName = _("RAUL"),
.trainerGfxId = EVENT_OBJ_GFX_MAN_5,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -1372,7 +1372,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SEELEY"),
.trainerName = _("JADA"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_2,
.flags = 0x21000FFF,
.aiChecks = 0x21000FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1401,7 +1401,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DROWZIN"),
.trainerName = _("ZEEK"),
.trainerGfxId = EVENT_OBJ_GFX_PSYCHIC_M,
.flags = 0x20800FFF,
.aiChecks = 0x20800FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1430,7 +1430,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("HITEMON"),
.trainerName = _("DIEGO"),
.trainerGfxId = EVENT_OBJ_GFX_EXPERT_M,
.flags = 0x80400FFF,
.aiChecks = 0x80400FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -1459,7 +1459,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BLISS"),
.trainerName = _("ALIYAH"),
.trainerGfxId = EVENT_OBJ_GFX_TEALA,
.flags = 0x10200FFF,
.aiChecks = 0x10200FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1488,7 +1488,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("KIDLEK"),
.trainerName = _("NATALIA"),
.trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
.flags = 0x20100FFF,
.aiChecks = 0x20100FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -1517,7 +1517,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SNUBBINS"),
.trainerName = _("DEVIN"),
.trainerGfxId = EVENT_OBJ_GFX_GENTLEMAN,
.flags = 0x8080FFF,
.aiChecks = 0x8080FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1546,7 +1546,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DREAVIS"),
.trainerName = _("TYLOR"),
.trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC,
.flags = 0x40040FFF,
.aiChecks = 0x40040FFF,
.whichRank = CONTEST_RANK_SUPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1575,7 +1575,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("LAIRN"),
.trainerName = _("RONNIE"),
.trainerGfxId = EVENT_OBJ_GFX_HIKER,
.flags = 0x84000FFF,
.aiChecks = 0x84000FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1604,7 +1604,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SHIFTY"),
.trainerName = _("CLAUDIA"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -1633,7 +1633,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("NINAS"),
.trainerName = _("ELIAS"),
.trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
.flags = 0x81000FFF,
.aiChecks = 0x81000FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1662,7 +1662,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("WELOW"),
.trainerName = _("JADE"),
.trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
.flags = 0x80800FFF,
.aiChecks = 0x80800FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -1691,7 +1691,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("YENA"),
.trainerName = _("FRANCIS"),
.trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
.flags = 0x80400FFF,
.aiChecks = 0x80400FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1720,7 +1720,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("TIFLY"),
.trainerName = _("ALISHA"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
.flags = 0x80200FFF,
.aiChecks = 0x80200FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1749,7 +1749,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("KINGSEA"),
.trainerName = _("SAUL"),
.trainerGfxId = EVENT_OBJ_GFX_CAMPER,
.flags = 0x80100FFF,
.aiChecks = 0x80100FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -1778,7 +1778,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("CASTER"),
.trainerName = _("FELICIA"),
.trainerGfxId = EVENT_OBJ_GFX_LASS,
.flags = 0x80080FFF,
.aiChecks = 0x80080FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -1807,7 +1807,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("CHOKEM"),
.trainerName = _("EMILIO"),
.trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
.flags = 0x80040FFF,
.aiChecks = 0x80040FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -1836,7 +1836,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("LOMBE"),
.trainerName = _("KARLA"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
.flags = 0x80020FFF,
.aiChecks = 0x80020FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1865,7 +1865,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("VIPES"),
.trainerName = _("DARRYL"),
.trainerGfxId = EVENT_OBJ_GFX_MAN_3,
.flags = 0x80010FFF,
.aiChecks = 0x80010FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1894,7 +1894,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("MERAIL"),
.trainerName = _("SELENA"),
.trainerGfxId = EVENT_OBJ_GFX_EXPERT_F,
.flags = 0x80008FFF,
.aiChecks = 0x80008FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1923,7 +1923,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("KARPAG"),
.trainerName = _("NOEL"),
.trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
.flags = 0x80004FFF,
.aiChecks = 0x80004FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -1952,7 +1952,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("LUNONE"),
.trainerName = _("LACEY"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
.flags = 0x80002FFF,
.aiChecks = 0x80002FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -1981,7 +1981,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("ABSO"),
.trainerName = _("CORBIN"),
.trainerGfxId = EVENT_OBJ_GFX_MANIAC,
.flags = 0x80001FFF,
.aiChecks = 0x80001FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2010,7 +2010,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("EGGSOR"),
.trainerName = _("GRACIE"),
.trainerGfxId = EVENT_OBJ_GFX_PICNICKER,
.flags = 0xC000FFF,
.aiChecks = 0xC000FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2039,7 +2039,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("CUBIN"),
.trainerName = _("COLTIN"),
.trainerGfxId = EVENT_OBJ_GFX_MAN_4,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2068,7 +2068,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("HITMON"),
.trainerName = _("ELLIE"),
.trainerGfxId = EVENT_OBJ_GFX_EXPERT_F,
.flags = 0x21000FFF,
.aiChecks = 0x21000FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2097,7 +2097,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SURTLE"),
.trainerName = _("MARCUS"),
.trainerGfxId = EVENT_OBJ_GFX_SAILOR,
.flags = 0x20800FFF,
.aiChecks = 0x20800FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2126,7 +2126,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("KHANKAN"),
.trainerName = _("KIARA"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_3,
.flags = 0x80400FFF,
.aiChecks = 0x80400FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2155,7 +2155,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("PINOC"),
.trainerName = _("BRYCE"),
.trainerGfxId = EVENT_OBJ_GFX_BUG_CATCHER,
.flags = 0x10200FFF,
.aiChecks = 0x10200FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -2184,7 +2184,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DILTOT"),
.trainerName = _("JAMIE"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_5,
.flags = 0x20100FFF,
.aiChecks = 0x20100FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2213,7 +2213,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DOOMOND"),
.trainerName = _("JORGE"),
.trainerGfxId = EVENT_OBJ_GFX_GENTLEMAN,
.flags = 0x8080FFF,
.aiChecks = 0x8080FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2242,7 +2242,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("MILKAN"),
.trainerName = _("DEVON"),
.trainerGfxId = EVENT_OBJ_GFX_POKEFAN_M,
.flags = 0x40040FFF,
.aiChecks = 0x40040FFF,
.whichRank = CONTEST_RANK_HYPER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -2271,7 +2271,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("RADOS"),
.trainerName = _("JUSTINA"),
.trainerGfxId = EVENT_OBJ_GFX_PICNICKER,
.flags = 0x84000FFF,
.aiChecks = 0x84000FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2300,7 +2300,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("LOUDERD"),
.trainerName = _("RALPH"),
.trainerGfxId = EVENT_OBJ_GFX_EXPERT_M,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2329,7 +2329,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SITTY"),
.trainerName = _("ROSA"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
.flags = 0x81000FFF,
.aiChecks = 0x81000FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -2358,7 +2358,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SLING"),
.trainerName = _("KEATON"),
.trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
.flags = 0x80800FFF,
.aiChecks = 0x80800FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2387,7 +2387,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("TARIA"),
.trainerName = _("MAYRA"),
.trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
.flags = 0x80400FFF,
.aiChecks = 0x80400FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2416,7 +2416,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("LIRKI"),
.trainerName = _("LAMAR"),
.trainerGfxId = EVENT_OBJ_GFX_RICH_BOY,
.flags = 0x80200FFF,
.aiChecks = 0x80200FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2445,7 +2445,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("BLOSSOM"),
.trainerName = _("AUBREY"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
.flags = 0x80100FFF,
.aiChecks = 0x80100FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -2474,7 +2474,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("EYESAB"),
.trainerName = _("NIGEL"),
.trainerGfxId = EVENT_OBJ_GFX_CAMPER,
.flags = 0x80080FFF,
.aiChecks = 0x80080FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2503,7 +2503,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("UTAN"),
.trainerName = _("CAMILLE"),
.trainerGfxId = EVENT_OBJ_GFX_LASS,
.flags = 0x80040FFF,
.aiChecks = 0x80040FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2532,7 +2532,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("PEDOS"),
.trainerName = _("DEON"),
.trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
.flags = 0x80020FFF,
.aiChecks = 0x80020FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2561,7 +2561,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("LUVIS"),
.trainerName = _("JANELLE"),
.trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
.flags = 0x80010FFF,
.aiChecks = 0x80010FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2590,7 +2590,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("HEROSS"),
.trainerName = _("HEATH"),
.trainerGfxId = EVENT_OBJ_GFX_MAN_3,
.flags = 0x80008FFF,
.aiChecks = 0x80008FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2619,7 +2619,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("RODLECT"),
.trainerName = _("SASHA"),
.trainerGfxId = EVENT_OBJ_GFX_TWIN,
.flags = 0x80004FFF,
.aiChecks = 0x80004FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2648,7 +2648,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("CHUPY"),
.trainerName = _("FRANKIE"),
.trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
.flags = 0x80002FFF,
.aiChecks = 0x80002FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -2677,7 +2677,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("WOBET"),
.trainerName = _("HELEN"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
.flags = 0x80001FFF,
.aiChecks = 0x80001FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2706,7 +2706,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("GAREN"),
.trainerName = _("CAMILE"),
.trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC,
.flags = 0xC000FFF,
.aiChecks = 0xC000FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2735,7 +2735,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("GONPOR"),
.trainerName = _("MARTIN"),
.trainerGfxId = EVENT_OBJ_GFX_SCIENTIST_1,
.flags = 0x82000FFF,
.aiChecks = 0x82000FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2764,7 +2764,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("DRITE"),
.trainerName = _("SERGIO"),
.trainerGfxId = EVENT_OBJ_GFX_BOY_1,
.flags = 0x21000FFF,
.aiChecks = 0x21000FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,
@ -2793,7 +2793,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("MEOWY"),
.trainerName = _("KAILEY"),
.trainerGfxId = EVENT_OBJ_GFX_TWIN,
.flags = 0x20800FFF,
.aiChecks = 0x20800FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2822,7 +2822,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("NYX"),
.trainerName = _("PERLA"),
.trainerGfxId = EVENT_OBJ_GFX_BEAUTY,
.flags = 0x80400FFF,
.aiChecks = 0x80400FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = TRUE,
@ -2851,7 +2851,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("GEPITO"),
.trainerName = _("CLARA"),
.trainerGfxId = EVENT_OBJ_GFX_WOMAN_2,
.flags = 0x10200FFF,
.aiChecks = 0x10200FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2880,7 +2880,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SPEON"),
.trainerName = _("JAKOB"),
.trainerGfxId = EVENT_OBJ_GFX_PSYCHIC_M,
.flags = 0x20100FFF,
.aiChecks = 0x20100FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = TRUE,
@ -2909,7 +2909,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("SLOWGO"),
.trainerName = _("TREY"),
.trainerGfxId = EVENT_OBJ_GFX_SAILOR,
.flags = 0x8080FFF,
.aiChecks = 0x8080FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = FALSE,
.aiPool_Beauty = FALSE,
@ -2938,7 +2938,7 @@ const struct ContestPokemon gContestOpponents[] =
.nickname = _("URSING"),
.trainerName = _("LANE"),
.trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
.flags = 0x40040FFF,
.aiChecks = 0x40040FFF,
.whichRank = CONTEST_RANK_MASTER,
.aiPool_Cool = TRUE,
.aiPool_Beauty = FALSE,

View File

@ -14,6 +14,7 @@
#include "overworld.h"
#include "menu.h"
#include "pokedex.h"
#include "constants/rgb.h"
extern const u8 gText_DexNational[];
extern const u8 gText_DexHoenn[];
@ -83,7 +84,7 @@ void CB2_ShowDiploma(void)
CopyBgTilemapBufferToVram(1);
DisplayDiplomaText();
BlendPalettes(-1, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
EnableInterrupts(1);
SetVBlankCallback(VBlankCB);
SetMainCallback2(MainCB2);
@ -108,7 +109,7 @@ static void Task_DiplomaWaitForKeyPress(u8 taskId)
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_DiplomaFadeOut;
}
}

View File

@ -32,6 +32,7 @@
#include "constants/flags.h"
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/rgb.h"
#define EZCHAT_TASK_STATE 0
#define EZCHAT_TASK_TYPE 1
@ -1139,20 +1140,20 @@ static void sub_811A2FC(u8 taskId)
case 0:
SetVBlankCallback(VBlankCallback_EasyChatScreen);
BlendPalettes(0xFFFFFFFF, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK);
data[EZCHAT_TASK_STATE] = 5;
break;
case 1:
v0 = sub_811AAAC();
if (sub_811A88C(v0))
{
BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, RGB_BLACK);
data[EZCHAT_TASK_STATE] = 3;
data[EZCHAT_TASK_UNK06] = v0;
}
else if (v0 == 0x18)
{
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK);
data[EZCHAT_TASK_STATE] = 4;
}
else if (v0 != 0)

View File

@ -35,6 +35,7 @@
#include "field_screen_effect.h"
#include "data.h"
#include "battle.h" // to get rid of later
#include "constants/rgb.h"
struct EggHatchData
{
@ -596,7 +597,7 @@ static void CB2_EggHatch_1(void)
switch (sEggHatchData->CB2_state)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
sEggHatchData->eggSpriteID = CreateSprite(&sSpriteTemplate_EggHatch, 120, 75, 5);
ShowBg(0);
ShowBg(1);
@ -679,7 +680,7 @@ static void CB2_EggHatch_1(void)
}
break;
case 11:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
sEggHatchData->CB2_state++;
break;
case 12:
@ -789,7 +790,7 @@ static void SpriteCB_Egg_4(struct Sprite* sprite)
{
s16 i;
if (sprite->data[0] == 0)
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, 0xFFFF);
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_WHITEALPHA);
if (sprite->data[0] < 4u)
{
for (i = 0; i <= 3; i++)
@ -813,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, 0xFFFF);
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0x10, 0, RGB_WHITEALPHA);
if (sprite->data[0] <= 9)
gSprites[sEggHatchData->pokeSpriteID].pos1.y -= 1;
if (sprite->data[0] > 40)

View File

@ -8,6 +8,7 @@
#include "sound.h"
#include "constants/songs.h"
#include "palette.h"
#include "constants/rgb.h"
// this file's functions
static void EvoSparkle_DummySpriteCb(struct Sprite* sprite);
@ -268,7 +269,7 @@ static void EvoTask_BeginPreSet1_FadeAndPlaySE(u8 taskID)
{
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
BeginNormalPaletteFade(3 << gTasks[taskID].data[1], 0xA, 0, 0x10, 0x7FFF);
BeginNormalPaletteFade(3 << gTasks[taskID].data[1], 0xA, 0, 0x10, RGB_WHITE);
gTasks[taskID].func = EvoTask_CreatePreEvoSparkleSet1;
PlaySE(SE_W025);
}
@ -386,7 +387,7 @@ static void EvoTask_BeginPostSparklesSet2_AndFlash(u8 taskID)
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
CpuSet(&gPlttBufferFaded[0x20], &gPlttBufferUnfaded[0x20], 0x30);
BeginNormalPaletteFade(0xFFF9041C, 0, 0, 0x10, 0x7FFF); // was 0xFFF9001C in R/S
BeginNormalPaletteFade(0xFFF9041C, 0, 0, 0x10, RGB_WHITE); // was 0xFFF9001C in R/S
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet2_AndFlash;
PlaySE(SE_W080);
}
@ -407,7 +408,7 @@ static void EvoTask_CreatePostEvoSparklesSet2_AndFlash(u8 taskID)
CreatePostEvoSparkleSet2(i);
break;
case 32:
BeginNormalPaletteFade(0xFFFF041C, 0x10, 0x10, 0, 0x7FFF); // was 0xFFF9001C in R/S
BeginNormalPaletteFade(0xFFFF041C, 0x10, 0x10, 0, RGB_WHITE); // was 0xFFF9001C in R/S
break;
}
gTasks[taskID].tFrameCounter++;
@ -434,7 +435,7 @@ static void EvoTask_BeginPostSparklesSet2_AndFlash_Trade(u8 taskID)
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
CpuSet(&gPlttBufferFaded[0x20], &gPlttBufferUnfaded[0x20], 0x30);
BeginNormalPaletteFade(0xFFF90400, 0, 0, 0x10, 0x7FFF); // was 0xFFFF0001 in R/S
BeginNormalPaletteFade(0xFFF90400, 0, 0, 0x10, RGB_WHITE); // was 0xFFFF0001 in R/S
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet2_AndFlash_Trade;
PlaySE(SE_W080);
}
@ -455,7 +456,7 @@ static void EvoTask_CreatePostEvoSparklesSet2_AndFlash_Trade(u8 taskID)
CreatePostEvoSparkleSet2(i);
break;
case 32:
BeginNormalPaletteFade(0xFFFF0400, 0x10, 0x10, 0, 0x7FFF); // was 0xFFFF0001 in R/S
BeginNormalPaletteFade(0xFFFF0400, 0x10, 0x10, 0, RGB_WHITE); // was 0xFFFF0001 in R/S
break;
}
gTasks[taskID].tFrameCounter++;

View File

@ -32,6 +32,7 @@
#include "constants/battle_string_ids.h"
#include "constants/species.h"
#include "constants/songs.h"
#include "constants/rgb.h"
struct EvoInfo
{
@ -169,7 +170,7 @@ static void Task_BeginEvolutionScene(u8 taskID)
switch (gTasks[taskID].tState)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskID].tState++;
break;
case 1:
@ -366,7 +367,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
SetVBlankCallback(VBlankCB_EvolutionScene);
SetMainCallback2(CB2_EvolutionSceneUpdate);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
ShowBg(0);
ShowBg(1);
@ -443,14 +444,14 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
case 6:
if (gWirelessCommType)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
BlendPalettes(-1,0x10, 0);
gMain.state++;
break;
case 7:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
sub_807B140();
ShowBg(0);
ShowBg(1);
@ -603,7 +604,7 @@ static void Task_EvolutionScene(u8 taskID)
switch (gTasks[taskID].tState)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
gSprites[sEvoStructPtr->preEvoSpriteID].invisible = FALSE;
gTasks[taskID].tState++;
ShowBg(0);
@ -638,7 +639,7 @@ static void Task_EvolutionScene(u8 taskID)
{
PlayNewMapMusic(MUS_SHINKA);
gTasks[taskID].tState++;
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, 0);
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, RGB_BLACK);
}
break;
case 5: // launch moving bg task, preapre evo sparkles
@ -696,7 +697,7 @@ static void Task_EvolutionScene(u8 taskID)
m4aMPlayAllStop();
memcpy(&gPlttBufferUnfaded[0x20], sEvoStructPtr->savedPalette, 0x60);
sub_8140174();
BeginNormalPaletteFade(0x1C, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0x1C, 0, 0x10, 0, RGB_BLACK);
gTasks[taskID].tState++;
}
break;
@ -751,7 +752,7 @@ static void Task_EvolutionScene(u8 taskID)
}
else // no move to learn
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskID].tState++;
}
}
@ -779,7 +780,7 @@ static void Task_EvolutionScene(u8 taskID)
if (!gTasks[sEvoGraphicsTaskID].isActive)
{
m4aMPlayAllStop();
BeginNormalPaletteFade(0x6001C, 0, 0x10, 0, 0x7FFF);
BeginNormalPaletteFade(0x6001C, 0, 0x10, 0, RGB_WHITE);
gTasks[taskID].tState++;
}
break;
@ -885,7 +886,7 @@ static void Task_EvolutionScene(u8 taskID)
{
gTasks[taskID].tLearnMoveState = gTasks[taskID].tData7;
if (gTasks[taskID].tLearnMoveState == 5)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
}
}
if (gMain.newKeys & B_BUTTON)
@ -1007,7 +1008,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
{
PlayBGM(MUS_SHINKA);
gTasks[taskID].tState++;
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, 0);
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, RGB_BLACK);
}
break;
case 4:
@ -1128,7 +1129,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!gTasks[sEvoGraphicsTaskID].isActive)
{
m4aMPlayAllStop();
BeginNormalPaletteFade((1 << (gSprites[sEvoStructPtr->preEvoSpriteID].oam.paletteNum + 16)) | (0x4001C), 0, 0x10, 0, 0x7FFF);
BeginNormalPaletteFade((1 << (gSprites[sEvoStructPtr->preEvoSpriteID].oam.paletteNum + 16)) | (0x4001C), 0, 0x10, 0, RGB_WHITE);
gTasks[taskID].tState++;
}
break;
@ -1211,7 +1212,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState = gTasks[taskID].tData7;
if (gTasks[taskID].tLearnMoveState == 5)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
break;
case 1:
case -1:

View File

@ -11,6 +11,7 @@
#include "text.h"
#include "text_window.h"
#include "window.h"
#include "constants/rgb.h"
// Static type declarations
@ -145,7 +146,7 @@ static void FieldUpdateRegionMap(void)
schedule_bg_copy_tilemap_to_vram(0);
DrawStdFrameWithCustomTileAndPalette(0, 0, 0x27, 0xd);
PrintRegionMapSecName();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
sFieldRegionMapHandler->state++;
break;
case 2:
@ -173,7 +174,7 @@ static void FieldUpdateRegionMap(void)
}
break;
case 5:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
sFieldRegionMapHandler->state++;
break;
case 6:

View File

@ -458,8 +458,8 @@ const u32 gUnusedTilemap_OldContest[] = INCBIN_U32("graphics/unused/old_contest.
const u32 gUnknownTilemap_C15BC0[] = INCBIN_U32("graphics/unknown/unknown_C15BC0.bin.lz");
const u32 gUnusedGfx_OldContest2[] = INCBIN_U32("graphics/unused/old_contest_2.4bpp.lz");
const u32 gUnknown_08C16E90[] = INCBIN_U32("graphics/unused/old_contest_2.gbapal.lz");
const u32 gUnknown_08C16FA8[] = INCBIN_U32("graphics/unused/old_contest_2.bin.lz");
const u32 gOldContestPalette[] = INCBIN_U32("graphics/unused/old_contest_2.gbapal.lz");
const u32 gOldContestGfx[] = INCBIN_U32("graphics/unused/old_contest_2.bin.lz");
const u32 gUnknown_08C17170[] = INCBIN_U32("graphics/unknown/unknown_C17170.bin.lz");

View File

@ -6,6 +6,7 @@
#include "script.h"
#include "script_menu.h"
#include "task.h"
#include "constants/rgb.h"
static void ReshowPCMenuAfterHallOfFamePC(void);
static void Task_WaitForPaletteFade(u8);
@ -28,7 +29,7 @@ static void ReshowPCMenuAfterHallOfFamePC(void)
Overworld_PlaySpecialMapMusic();
ScrSpecial_CreatePCMenu();
ScriptMenu_DisplayPCStartupPrompt();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
CreateTask(Task_WaitForPaletteFade, 10);
}

508
src/ice.c
View File

@ -47,7 +47,7 @@ void AnimIceBallParticle(struct Sprite *);
void AnimTask_Haze2(u8);
void AnimTask_OverlayFogTiles(u8);
void AnimTask_Hail2(u8);
bool8 GenerateHailParticle(u8, u8, u8, u8);
bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c);
const union AnimCmd gUnknown_08595A48[] =
{
@ -522,37 +522,33 @@ const struct SpriteTemplate gUnknown_08595DFC =
.callback = InitIceBallParticle,
};
// probably unused
#ifdef NONMATCHING
static void sub_810B6C4(struct Sprite *sprite)
{
s16 targetX, targetY, attackerX, attackerY;
s16 i;
sprite->oam.tileNum += 7;
targetX = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
targetY = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
attackerY = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
attackerY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
sprite->data[0] = gBattleAnimArgs[4];
sprite->data[1] = gBattleAnimArgs[0] + attackerX;
sprite->data[2] = gBattleAnimArgs[2] + targetX;
sprite->data[3] = gBattleAnimArgs[1] + attackerY;
sprite->data[4] = gBattleAnimArgs[3] + targetY;
sub_80A64EC(sprite);
while ((targetX >= -32 && targetX <= 272) && (targetY >= -32 && targetY <= 192))
{
targetX += sprite->data[1];
targetY += sprite->data[2];
}
for (;(targetX >= -32 && targetX <= 272) && (targetY >= -32 && targetY <= 192);
targetX += sprite->data[1], targetY += sprite->data[2])
;
sprite->data[1] = -sprite->data[1];
sprite->data[2] = -sprite->data[2];
while ((attackerX >= -32 && attackerX <= 272) && (attackerY >= -32 && attackerY <= 192))
{
attackerX += sprite->data[1];
attackerY += sprite->data[2];
}
for (;(attackerX >= -32 && attackerX <= 272) && (attackerY >= -32 && attackerY <= 192);
attackerX += sprite->data[1], attackerY += sprite->data[2])
;
sprite->pos1.x = attackerX;
sprite->pos1.y = attackerY;
sprite->data[0] = gBattleAnimArgs[4];
@ -565,195 +561,6 @@ static void sub_810B6C4(struct Sprite *sprite)
sprite->data[4] = gBattleAnimArgs[6];
sprite->callback = sub_810B848;
}
#else
NAKED
static void sub_810B6C4(struct Sprite *sprite)
{
asm_unified("push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x4\n\
adds r5, r0, 0\n\
ldrh r2, [r5, 0x4]\n\
lsls r1, r2, 22\n\
lsrs r1, 22\n\
adds r1, 0x7\n\
ldr r3, =0x000003ff\n\
adds r0, r3, 0\n\
ands r1, r0\n\
ldr r0, =0xfffffc00\n\
ands r0, r2\n\
orrs r0, r1\n\
strh r0, [r5, 0x4]\n\
ldr r4, =gBattleAnimTarget\n\
ldrb r0, [r4]\n\
movs r1, 0x2\n\
bl GetBattlerSpriteCoord\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r9, r0\n\
ldrb r0, [r4]\n\
movs r1, 0x3\n\
bl GetBattlerSpriteCoord\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
ldr r4, =gBattleAnimAttacker\n\
ldrb r0, [r4]\n\
movs r1, 0x2\n\
bl GetBattlerSpriteCoord\n\
lsls r0, 24\n\
lsrs r3, r0, 24\n\
ldrb r0, [r4]\n\
movs r1, 0x3\n\
str r3, [sp]\n\
bl GetBattlerSpriteCoord\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
ldr r1, =gBattleAnimArgs\n\
ldrh r0, [r1, 0x8]\n\
strh r0, [r5, 0x2E]\n\
ldrh r0, [r1]\n\
ldr r3, [sp]\n\
adds r0, r3\n\
strh r0, [r5, 0x30]\n\
ldrh r0, [r1, 0x4]\n\
mov r4, r9\n\
adds r0, r4, r0\n\
strh r0, [r5, 0x32]\n\
ldrh r0, [r1, 0x2]\n\
adds r0, r6\n\
strh r0, [r5, 0x34]\n\
ldrh r0, [r1, 0x6]\n\
mov r7, r8\n\
adds r0, r7, r0\n\
strh r0, [r5, 0x36]\n\
adds r0, r5, 0\n\
bl sub_80A64EC\n\
adds r4, 0x20\n\
movs r0, 0x98\n\
lsls r0, 1\n\
mov r12, r0\n\
ldr r3, [sp]\n\
cmp r4, r12\n\
bhi _0810B79E\n\
adds r0, r7, 0\n\
adds r0, 0x20\n\
ldrh r1, [r5, 0x30]\n\
ldrh r2, [r5, 0x32]\n\
cmp r0, 0xE0\n\
bhi _0810B79E\n\
adds r4, r1, 0\n\
mov r10, r12\n\
_0810B76A:\n\
mov r7, r9\n\
lsls r1, r7, 16\n\
asrs r1, 16\n\
adds r1, r4\n\
lsls r1, 16\n\
mov r7, r8\n\
lsls r0, r7, 16\n\
asrs r0, 16\n\
adds r0, r2\n\
lsls r0, 16\n\
lsrs r0, 16\n\
mov r8, r0\n\
lsrs r0, r1, 16\n\
mov r9, r0\n\
movs r7, 0x80\n\
lsls r7, 14\n\
adds r1, r7\n\
lsrs r1, 16\n\
cmp r1, r10\n\
bhi _0810B79E\n\
mov r1, r8\n\
lsls r0, r1, 16\n\
adds r0, r7\n\
lsrs r0, 16\n\
cmp r0, 0xE0\n\
bls _0810B76A\n\
_0810B79E:\n\
ldrh r0, [r5, 0x30]\n\
negs r7, r0\n\
strh r7, [r5, 0x30]\n\
ldrh r0, [r5, 0x32]\n\
negs r4, r0\n\
strh r4, [r5, 0x32]\n\
lsls r0, r3, 16\n\
movs r1, 0x80\n\
lsls r1, 14\n\
adds r0, r1\n\
lsrs r0, 16\n\
movs r2, 0x98\n\
lsls r2, 1\n\
mov r12, r2\n\
ldr r1, =gBattleAnimArgs\n\
mov r10, r1\n\
cmp r0, r12\n\
bhi _0810B80A\n\
lsls r1, r6, 16\n\
movs r2, 0x80\n\
lsls r2, 14\n\
adds r0, r1, r2\n\
b _0810B802\n\
.pool\n\
_0810B7E0:\n\
lsls r1, r3, 16\n\
asrs r1, 16\n\
adds r1, r7\n\
lsls r1, 16\n\
asrs r0, r2, 16\n\
adds r0, r4\n\
lsls r0, 16\n\
lsrs r6, r0, 16\n\
lsrs r3, r1, 16\n\
movs r0, 0x80\n\
lsls r0, 14\n\
adds r1, r0\n\
lsrs r1, 16\n\
cmp r1, r12\n\
bhi _0810B80A\n\
lsls r1, r6, 16\n\
adds r0, r1, r0\n\
_0810B802:\n\
lsrs r0, 16\n\
adds r2, r1, 0\n\
cmp r0, 0xE0\n\
bls _0810B7E0\n\
_0810B80A:\n\
strh r3, [r5, 0x20]\n\
strh r6, [r5, 0x22]\n\
mov r1, r10\n\
ldrh r0, [r1, 0x8]\n\
strh r0, [r5, 0x2E]\n\
strh r3, [r5, 0x30]\n\
mov r2, r9\n\
strh r2, [r5, 0x32]\n\
strh r6, [r5, 0x34]\n\
mov r3, r8\n\
strh r3, [r5, 0x36]\n\
adds r0, r5, 0\n\
bl sub_80A64EC\n\
mov r7, r10\n\
ldrh r0, [r7, 0xA]\n\
strh r0, [r5, 0x34]\n\
ldrh r0, [r7, 0xC]\n\
strh r0, [r5, 0x36]\n\
ldr r0, =sub_810B848\n\
str r0, [r5, 0x1C]\n\
add sp, 0x4\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n");
}
#endif
void sub_810B848(struct Sprite *sprite)
{
@ -797,14 +604,14 @@ void AnimIcePunchSwirlingParticle(struct Sprite *sprite)
void AnimIceBeamParticle(struct Sprite *sprite)
{
InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
sprite->data[2] -= gBattleAnimArgs[2];
else
sprite->data[2] += gBattleAnimArgs[2];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3];
sprite->data[0] = gBattleAnimArgs[4];
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = StartAnimLinearTranslation;
@ -863,8 +670,8 @@ void AnimSwirlingSnowball_Step1(struct Sprite *sprite)
if (!gBattleAnimArgs[5])
{
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3];
}
else
{
@ -983,8 +790,8 @@ void AnimMoveParticleBeyondTarget(struct Sprite *sprite)
if (!gBattleAnimArgs[7])
{
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
}
else
{
@ -1274,8 +1081,8 @@ void AnimTask_Haze2(u8 taskId)
// arg 5: ??? unknown (seems to vibrate target mon somehow)
void AnimThrowMistBall(struct Sprite *sprite)
{
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
sprite->callback = TranslateAnimSpriteToTargetMonLocation;
}
@ -1380,7 +1187,7 @@ void InitPoisonGasCloudAnim(struct Sprite *sprite)
{
sprite->data[0] = gBattleAnimArgs[0];
if (GetBattlerSpriteCoord(gBattleAnimAttacker, 2) < GetBattlerSpriteCoord(gBattleAnimTarget, 2))
if (GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) < GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2))
sprite->data[7] = 0x8000;
if (!(gBattlerPositions[gBattleAnimTarget] & 1))
@ -1394,22 +1201,22 @@ void InitPoisonGasCloudAnim(struct Sprite *sprite)
sprite->data[6] = 1;
}
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
if (gBattleAnimArgs[7])
{
sprite->data[1] = sprite->pos1.x + gBattleAnimArgs[1];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[3];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[3];
sprite->data[3] = sprite->pos1.y + gBattleAnimArgs[2];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[4];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[4];
sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8;
}
else
{
sprite->data[1] = sprite->pos1.x + gBattleAnimArgs[1];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[3];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[3];
sprite->data[3] = sprite->pos1.y + gBattleAnimArgs[2];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[4];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[4];
sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8;
}
@ -1441,7 +1248,7 @@ void MovePoisonGasCloud(struct Sprite *sprite)
if (sprite->data[0] <= 0)
{
sprite->data[0] = 80;
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0);
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
sprite->data[1] = sprite->pos1.x;
sprite->data[2] = sprite->pos1.x;
sprite->pos1.y += sprite->pos2.y;
@ -1575,238 +1382,63 @@ void AnimTask_Hail2(u8 taskId)
}
}
#ifdef NONMATCHING
bool8 GenerateHailParticle(u8 a, u8 b, u8 taskId, u8 c)
bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c)
{
bool8 possibleBool = FALSE;
// s8 unk = gUnknown_08595CB4[a].unk3;
const struct HailStruct *hailData = &gUnknown_08595CB4[a];
s8 unk = hailData->unk3;
u8 battler;
u8 id;
s16 battlerX, battlerY;
u8 spriteId;
// struct Sprite *sprite;
s16 spriteX;
bool8 possibleBool = FALSE;
s8 unk = gUnknown_08595CB4[hailStructId].unk3;
if (unk != 2)
{
battler = GetBattlerAtPosition(hailData->unk2);
if (IsBattlerSpriteVisible(battler))
id = GetBattlerAtPosition(gUnknown_08595CB4[hailStructId].unk2);
if (IsBattlerSpriteVisible(id))
{
possibleBool = TRUE;
battlerX = GetBattlerSpriteCoord(battler, 2);
battlerY = GetBattlerSpriteCoord(battler, 3);
battlerX = GetBattlerSpriteCoord(id, BATTLER_COORD_X_2);
battlerY = GetBattlerSpriteCoord(id, BATTLER_COORD_Y_PIC_OFFSET);
switch (unk)
{
case 0:
battlerX -= GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_WIDTH) / 6;
battlerY -= GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_HEIGHT) / 6;
break;
case 1:
battlerX += GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_WIDTH) / 6;
battlerY += GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_HEIGHT) / 6;
break;
case 0:
battlerX -= GetBattlerSpriteCoordAttr(id, BATTLER_COORD_ATTR_WIDTH) / 6;
battlerY -= GetBattlerSpriteCoordAttr(id, BATTLER_COORD_ATTR_HEIGHT) / 6;
break;
case 1:
battlerX += GetBattlerSpriteCoordAttr(id, BATTLER_COORD_ATTR_WIDTH) / 6;
battlerY += GetBattlerSpriteCoordAttr(id, BATTLER_COORD_ATTR_HEIGHT) / 6;
break;
}
}
else
{
battlerX = (gUnknown_08595CB4[hailStructId].unk0);
battlerY = (gUnknown_08595CB4[hailStructId].unk1);
}
}
else
{
battlerX = (hailData->unk0);
battlerY = (hailData->unk1);
battlerX = (gUnknown_08595CB4[hailStructId].unk0);
battlerY = (gUnknown_08595CB4[hailStructId].unk1);
}
spriteX = battlerX - ((battlerY + 8) / 2);
spriteId = CreateSprite(&gUnknown_08595D2C, spriteX, -8, 18);
if (spriteId == MAX_SPRITES)
id = CreateSprite(&gUnknown_08595D2C, spriteX, -8, 18);
if (id == MAX_SPRITES)
{
return FALSE;
// sprite = &gSprites[spriteId];
StartSpriteAffineAnim(&gSprites[spriteId], b);
gSprites[spriteId].data[0] = possibleBool;
gSprites[spriteId].data[3] = battlerX;
gSprites[spriteId].data[4] = battlerY;
gSprites[spriteId].data[5] = b;
gSprites[spriteId].data[6] = taskId;
gSprites[spriteId].data[7] = c;
return TRUE;
}
else
{
StartSpriteAffineAnim(&gSprites[id], affineAnimNum);
gSprites[id].data[0] = possibleBool;
gSprites[id].data[3] = battlerX;
gSprites[id].data[4] = battlerY;
gSprites[id].data[5] = affineAnimNum;
gSprites[id].data[6] = taskId;
gSprites[id].data[7] = c;
return TRUE;
}
}
#else
NAKED
bool8 GenerateHailParticle(u8 a, u8 b, u8 taskId, u8 c)
{
asm_unified("push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x8\n\
lsls r0, 24\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r9, r1\n\
lsls r2, 24\n\
lsrs r2, 24\n\
str r2, [sp]\n\
lsls r3, 24\n\
lsrs r3, 24\n\
mov r10, r3\n\
movs r1, 0\n\
str r1, [sp, 0x4]\n\
ldr r1, =gUnknown_08595CB4\n\
lsrs r0, 22\n\
adds r4, r0, r1\n\
ldrb r0, [r4, 0x3]\n\
lsls r0, 24\n\
asrs r0, 28\n\
mov r8, r0\n\
cmp r0, 0x2\n\
beq _0810CAD0\n\
ldrh r0, [r4, 0x2]\n\
lsls r0, 20\n\
lsrs r0, 24\n\
bl GetBattlerAtPosition\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
adds r0, r5, 0\n\
bl IsBattlerSpriteVisible\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _0810CAD0\n\
movs r0, 0x1\n\
str r0, [sp, 0x4]\n\
adds r0, r5, 0\n\
movs r1, 0x2\n\
bl GetBattlerSpriteCoord\n\
lsls r0, 24\n\
lsrs r7, r0, 24\n\
adds r0, r5, 0\n\
movs r1, 0x3\n\
bl GetBattlerSpriteCoord\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
mov r1, r8\n\
cmp r1, 0\n\
beq _0810CA60\n\
cmp r1, 0x1\n\
beq _0810CA96\n\
b _0810CAE2\n\
.pool\n\
_0810CA60:\n\
adds r0, r5, 0\n\
movs r1, 0x1\n\
bl GetBattlerSpriteCoordAttr\n\
lsls r0, 16\n\
asrs r0, 16\n\
movs r1, 0x6\n\
bl __divsi3\n\
lsls r1, r7, 16\n\
asrs r1, 16\n\
subs r1, r0\n\
lsls r1, 16\n\
lsrs r7, r1, 16\n\
adds r0, r5, 0\n\
movs r1, 0\n\
bl GetBattlerSpriteCoordAttr\n\
lsls r0, 16\n\
asrs r0, 16\n\
movs r1, 0x6\n\
bl __divsi3\n\
lsls r1, r6, 16\n\
asrs r1, 16\n\
subs r1, r0\n\
b _0810CACA\n\
_0810CA96:\n\
adds r0, r5, 0\n\
movs r1, 0x1\n\
bl GetBattlerSpriteCoordAttr\n\
lsls r0, 16\n\
asrs r0, 16\n\
movs r1, 0x6\n\
bl __divsi3\n\
lsls r1, r7, 16\n\
asrs r1, 16\n\
adds r1, r0\n\
lsls r1, 16\n\
lsrs r7, r1, 16\n\
adds r0, r5, 0\n\
movs r1, 0\n\
bl GetBattlerSpriteCoordAttr\n\
lsls r0, 16\n\
asrs r0, 16\n\
movs r1, 0x6\n\
bl __divsi3\n\
lsls r1, r6, 16\n\
asrs r1, 16\n\
adds r1, r0\n\
_0810CACA:\n\
lsls r1, 16\n\
lsrs r6, r1, 16\n\
b _0810CAE2\n\
_0810CAD0:\n\
ldrh r0, [r4]\n\
lsls r0, 22\n\
asrs r0, 6\n\
lsrs r7, r0, 16\n\
ldr r0, [r4]\n\
lsls r0, 12\n\
asrs r0, 22\n\
lsls r0, 16\n\
lsrs r6, r0, 16\n\
_0810CAE2:\n\
lsls r0, r6, 16\n\
asrs r0, 16\n\
adds r0, 0x8\n\
lsrs r1, r0, 31\n\
adds r0, r1\n\
asrs r0, 1\n\
lsls r1, r7, 16\n\
asrs r1, 16\n\
subs r1, r0\n\
ldr r0, =gUnknown_08595D2C\n\
lsls r1, 16\n\
asrs r1, 16\n\
movs r2, 0x8\n\
negs r2, r2\n\
movs r3, 0x12\n\
bl CreateSprite\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
cmp r5, 0x40\n\
beq _0810CB44\n\
lsls r4, r5, 4\n\
adds r4, r5\n\
lsls r4, 2\n\
ldr r0, =gSprites\n\
adds r4, r0\n\
adds r0, r4, 0\n\
mov r1, r9\n\
bl StartSpriteAffineAnim\n\
mov r0, sp\n\
ldrh r0, [r0, 0x4]\n\
strh r0, [r4, 0x2E]\n\
strh r7, [r4, 0x34]\n\
strh r6, [r4, 0x36]\n\
mov r1, r9\n\
strh r1, [r4, 0x38]\n\
mov r0, sp\n\
ldrh r0, [r0]\n\
strh r0, [r4, 0x3A]\n\
mov r1, r10\n\
strh r1, [r4, 0x3C]\n\
movs r0, 0x1\n\
b _0810CB46\n\
.pool\n\
_0810CB44:\n\
movs r0, 0\n\
_0810CB46:\n\
add sp, 0x8\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r1}\n\
bx r1\n");
}
#endif
void AnimHailBegin(struct Sprite *sprite)
{
@ -1874,8 +1506,8 @@ void InitIceBallAnim(struct Sprite *sprite)
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3];
sprite->data[5] = gBattleAnimArgs[5];
InitAnimArcTranslation(sprite);

View File

@ -49,6 +49,7 @@
#include "window.h"
#include "apprentice.h"
#include "battle_pike.h"
#include "constants/rgb.h"
void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)());
void CB2_Bag(void);
@ -659,7 +660,7 @@ bool8 setup_bag_menu(void)
gMain.state++;
break;
case 20:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = FALSE;
gMain.state++;
break;
@ -942,7 +943,7 @@ void free_bag_item_list_buffers(void)
void unknown_ItemMenu_Confirm(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = task_close_bag_menu_2;
}

View File

@ -27,6 +27,7 @@
#include "battle.h"
#include "link.h"
#include "link_rfu.h"
#include "constants/rgb.h"
extern u16 gHeldKeyCodeToSend;
@ -444,7 +445,7 @@ static void LinkTestProcessKeyInput(void)
}
if (gMain.newKeys & L_BUTTON)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 2);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(2, 0, 0));
}
if (gMain.newKeys & START_BUTTON)
{

View File

@ -2263,7 +2263,7 @@ void DestroyWirelessStatusIndicatorSprite(void)
}
}
void sub_800E0E8(void)
void LoadWirelessStatusIndicatorSpriteGfx(void)
{
if (GetSpriteTileStartByTag(sWirelessStatusIndicatorSpriteSheet.tag) == 0xFFFF)
{

View File

@ -19,6 +19,7 @@
#include "constants/species.h"
#include "alloc.h"
#include "easy_chat.h"
#include "constants/rgb.h"
extern const u16 gMailPalette_Orange[];
extern const u16 gMailPalette_Harbor[];
@ -417,7 +418,7 @@ static bool8 MailReadBuildGraphics(void)
ShowBg(0);
ShowBg(1);
ShowBg(2);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = FALSE;
sMailRead->callback2 = CB2_WaitForPaletteExitOnKeyPress;
return TRUE;
@ -526,7 +527,7 @@ static void CB2_ExitOnKeyPress(void)
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
sMailRead->callback2 = CB2_ExitMailReadFreeVars;
}
}

View File

@ -584,9 +584,9 @@ static u32 InitMainMenu(bool8 returningFromOptionsMenu)
ResetSpriteData();
FreeAllSpritePalettes();
if (returningFromOptionsMenu)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0x0000); // fade to black
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); // fade to black
else
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0xFFFF); // fade to white
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sMainMenuBgTemplates, ARRAY_COUNT(sMainMenuBgTemplates));
ChangeBgX(0, 0, 0);
@ -1098,7 +1098,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, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
return;
}
FreeAllWindowBuffers();
@ -1287,7 +1287,7 @@ static void Task_NewGameBirchSpeech_Init(u8 taskId)
FreeAllSpritePalettes();
ResetAllPicSprites();
AddBirchSpeechObjects(taskId);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
gTasks[taskId].tBG1HOFS = 0;
gTasks[taskId].func = Task_NewGameBirchSpeech_WaitToShowBirch;
gTasks[taskId].tPlayerSpriteId = 0xFF;
@ -1846,7 +1846,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, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_WIN0H, 0);
SetGpuReg(REG_OFFSET_WIN0V, 0);
SetGpuReg(REG_OFFSET_WININ, 0);

View File

@ -14,6 +14,7 @@
#include "link_rfu.h"
#include "mevent.h"
#include "mystery_gift.h"
#include "constants/rgb.h"
struct UnkStruct_8467FB8
{
@ -186,7 +187,7 @@ s32 FadeToWonderCardMenu(void)
switch(sWonderCardData->unk_0174)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
break;
case 1:
if (UpdatePaletteFade())
@ -231,7 +232,7 @@ s32 FadeToWonderCardMenu(void)
ShowBg(2);
gPaletteFade.bufferTransferDisabled = FALSE;
sub_801C4C0();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
UpdatePaletteFade();
break;
default:
@ -251,7 +252,7 @@ s32 FadeOutFromWonderCard(bool32 flag)
switch (sWonderCardData->unk_0174)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
break;
case 1:
if (UpdatePaletteFade())
@ -279,7 +280,7 @@ s32 FadeOutFromWonderCard(bool32 flag)
case 5:
PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag);
CopyBgTilemapBufferToVram(0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
break;
default:
if (UpdatePaletteFade())
@ -575,7 +576,7 @@ s32 FadeToWonderNewsMenu(void)
switch (sWonderNewsData->unk_01C0_1)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
break;
case 1:
if (UpdatePaletteFade())
@ -629,7 +630,7 @@ s32 FadeToWonderNewsMenu(void)
ShowBg(3);
gPaletteFade.bufferTransferDisabled = FALSE;
sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
UpdatePaletteFade();
break;
default:
@ -650,7 +651,7 @@ s32 FadeOutFromWonderNews(bool32 flag)
switch (sWonderNewsData->unk_01C0_1)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
break;
case 1:
if (UpdatePaletteFade())
@ -692,7 +693,7 @@ s32 FadeOutFromWonderNews(bool32 flag)
MG_DrawCheckerboardPattern(3);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(3);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
break;
default:
if (UpdatePaletteFade())

View File

@ -18,6 +18,7 @@
#include "gpu_regs.h"
#include "text_window.h"
#include "decompress.h"
#include "constants/rgb.h"
// this file's functions
static void CB2_MysteryEventMenu(void);
@ -137,7 +138,7 @@ static void CB2_MysteryEventMenu(void)
PutWindowTilemap(0);
CopyWindowToVram(0, 3);
ShowBg(0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
gMain.state++;
break;
case 1:
@ -280,7 +281,7 @@ static void CB2_MysteryEventMenu(void)
}
break;
case 15:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gMain.state++;
break;
case 16:

View File

@ -27,6 +27,7 @@
#include "text_window.h"
#include "overworld.h"
#include "constants/event_objects.h"
#include "constants/rgb.h"
EWRAM_DATA static struct NamingScreenData *gNamingScreenData = NULL;
extern u16 gKeyRepeatStartDelay;
@ -463,7 +464,7 @@ static bool8 MainState_BeginFadeIn(void)
CopyBgTilemapBufferToVram(2);
CopyBgTilemapBufferToVram(3);
BlendPalettes(-1, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
gNamingScreenData->state++;
return FALSE;
}
@ -517,7 +518,7 @@ static bool8 MainState_6(void)
static bool8 MainState_BeginFadeInOut(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
gNamingScreenData->state++;
return FALSE;
}

View File

@ -56,7 +56,7 @@ static void ResetMiniGamesResults(void);
// EWRAM vars
EWRAM_DATA bool8 gDifferentSaveFile = FALSE;
EWRAM_DATA bool8 gUnknown_020322D5 = FALSE;
EWRAM_DATA bool8 gEnableContestDebugging = FALSE;
// const rom data
static const struct ContestWinner sContestWinnerPicDummy =

View File

@ -14,6 +14,7 @@
#include "international_string_util.h"
#include "strings.h"
#include "gba/m4a_internal.h"
#include "constants/rgb.h"
// Task data
enum
@ -250,7 +251,7 @@ void CB2_InitOptionMenu(void)
break;
}
case 11:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
SetVBlankCallback(VBlankCB);
SetMainCallback2(MainCB2);
return;
@ -359,7 +360,7 @@ static void Task_OptionMenuSave(u8 taskId)
gSaveBlock2Ptr->optionsButtonMode = gTasks[taskId].data[TD_BUTTONMODE];
gSaveBlock2Ptr->optionsWindowFrameType = gTasks[taskId].data[TD_FRAMETYPE];
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_OptionMenuFadeOut;
}

View File

@ -1874,7 +1874,7 @@ static bool32 map_loading_iteration_3(u8 *state)
case 11:
if (gWirelessCommType != 0)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
(*state)++;
@ -2046,7 +2046,7 @@ static bool32 map_loading_iteration_2_link(u8 *state)
case 11:
if (gWirelessCommType != 0)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
(*state)++;

View File

@ -32,6 +32,7 @@
#include "text_window.h"
#include "constants/items.h"
#include "constants/songs.h"
#include "constants/rgb.h"
#define POKEBLOCK_MAX_FEEL 99
#define FIELD_E75_COUNT 7
@ -585,7 +586,7 @@ static bool8 InitPokeblockMenu(void)
gMain.state++;
break;
case 18:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = 0;
gMain.state++;
break;
@ -948,7 +949,7 @@ static void sub_8136470(struct Sprite *sprite)
static void FadePaletteAndSetTaskToClosePokeblockCase(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_FreeDataAndExitPokeblockCase;
}

View File

@ -24,6 +24,7 @@
#include "text_window.h"
#include "trig.h"
#include "util.h"
#include "constants/rgb.h"
struct PokeblockFeedStruct
{
@ -590,7 +591,7 @@ static bool8 TransitionToPokeblockFeedScene(void)
gMain.state++;
break;
case 13:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
gPaletteFade.bufferTransferDisabled = 0;
gMain.state++;
break;
@ -804,7 +805,7 @@ static void Task_ReturnAfterPaletteFade(u8 taskId)
static void Task_PaletteFadeToReturn(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ReturnAfterPaletteFade;
}

View File

@ -205,7 +205,7 @@ void blockset_load_palette_to_gpu(u8);
void sub_80C01CC(struct Sprite *sprite);
void sub_80C020C(u32, u32, u32, u32);
void sub_80C0354(u16, u8, u8);
void sub_80C0460(u16, u8, u8);
void sub_80C0460(u16 weight, u8 left, u8 top);
void sub_80C09B0(u16);
u8 sub_80C0B44(u8, u16, u8, u8);
void sub_80C0D30(u8, u16);
@ -2969,7 +2969,7 @@ void sub_80BEA24(u8 taskId)
r3 = 0x14;
if (gTasks[taskId].data[1] != 0)
r3 |= (1 << (gSprites[gTasks[taskId].data[4]].oam.paletteNum + 16));
BeginNormalPaletteFade(~r3, 0, 16, 0, 0);
BeginNormalPaletteFade(~r3, 0, 16, 0, RGB_BLACK);
SetVBlankCallback(gUnknown_030060B4);
gMain.state++;
}
@ -3926,9 +3926,6 @@ void sub_80C020C(u32 num, u32 value, u32 c, u32 d)
sub_80BE8DC(text3, GetStringCenterAlignXOffset(1, text3, 0xF0), 0x5F);
}
#define CHAR_PRIME (0xB4)
#define CHAR_DOUBLE_PRIME (0xB2)
void sub_80C0354(u16 height, u8 left, u8 top)
{
u8 buffer[16];
@ -3954,10 +3951,10 @@ void sub_80C0354(u16 height, u8 left, u8 top)
buffer[i++] = feet / 10 + CHAR_0;
buffer[i++] = (feet % 10) + CHAR_0;
}
buffer[i++] = CHAR_PRIME;
buffer[i++] = CHAR_SGL_QUOT_RIGHT;
buffer[i++] = (inches / 10) + CHAR_0;
buffer[i++] = (inches % 10) + CHAR_0;
buffer[i++] = CHAR_DOUBLE_PRIME;
buffer[i++] = CHAR_DBL_QUOT_RIGHT;
buffer[i++] = EOS;
sub_80BE8DC(buffer, left, top);
}
@ -3968,12 +3965,11 @@ void sub_80C0354(u16 height, u8 left, u8 top)
void sub_80C0460(u16 weight, u8 left, u8 top)
{
u8 buffer[16];
u32 lbs;
u8 i = 0;
bool8 output;
u8 i = 0;
u32 lbs = (weight * 100000) / 4536;
lbs = (weight * 100000) / 4536;
if (lbs % 10 >= 5)
if (lbs % 10u >= 5)
lbs += 10;
output = FALSE;
@ -3988,9 +3984,9 @@ void sub_80C0460(u16 weight, u8 left, u8 top)
i++;
}
lbs = (lbs % 100000);
lbs %= 100000;
buffer[i] = (lbs / 10000) + CHAR_0;
if (buffer[i] == CHAR_0 && output == FALSE)
if (buffer[i] == CHAR_0 && !output)
{
buffer[i++] = 0x77;
}
@ -4000,9 +3996,9 @@ void sub_80C0460(u16 weight, u8 left, u8 top)
i++;
}
lbs = (lbs % 10000);
lbs %= 10000;
buffer[i] = (lbs / 1000) + CHAR_0;
if (buffer[i] == CHAR_0 && output == FALSE)
if (buffer[i] == CHAR_0 && !output)
{
buffer[i++] = 0x77;
}
@ -4010,9 +4006,10 @@ void sub_80C0460(u16 weight, u8 left, u8 top)
{
i++;
}
lbs = (lbs % 1000);
lbs %= 1000;
buffer[i++] = (lbs / 100) + CHAR_0;
lbs = (lbs % 100);
lbs %= 100;
buffer[i++] = CHAR_PERIOD;
buffer[i++] = (lbs / 10) + CHAR_0;
buffer[i++] = CHAR_SPACE;

View File

@ -2,6 +2,7 @@
#include "alloc.h"
#include "item.h"
#include "link.h"
#include "link_rfu.h"
#include "main.h"
#include "menu.h"
#include "palette.h"
@ -9,6 +10,7 @@
#include "save.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
#include "task.h"
#include "pokemon.h"
#include "pokemon_jump.h"
@ -34,7 +36,7 @@ struct PokemonJump1_82E4
u16 unk12;
int unk14;
int unk18;
u8 filler1C[0xC];
u8 unk1C[11];
};
struct PokemonJump1
@ -48,16 +50,16 @@ struct PokemonJump1
u16 unkA;
u16 unkC;
u16 unkE;
u8 filler10[0x4];
int unk14;
int unk18;
int unk10;
u32 unk14;
u32 unk18;
int unk1C;
u8 filler20[0x4];
int unk24;
u8 filler28[0x4];
u32 unk20;
u32 unk24;
u32 unk28;
int unk2C;
u32 unk30;
u8 filler34[0x2];
u16 unk34;
u16 unk36;
u8 filler38[0x2];
u16 unk3A;
@ -74,7 +76,10 @@ struct PokemonJump1
u16 unk4A;
u8 unk4C;
u8 unk4D;
u8 filler4E[0x6];
u16 unk4E;
u8 unk50;
u8 unk51;
u8 filler52[0x2];
int unk54;
int unk58;
int unk5C;
@ -86,16 +91,17 @@ struct PokemonJump1
u8 unk71;
u16 unk72;
u16 unk74;
int unk78;
u8 unk7C[5];
u8 filler81[0xA];
u8 unk8B[5];
u16 unk90[5];
u16 unk9A[5];
u32 unk78;
u8 unk7C[MAX_RFU_PLAYERS];
u8 unk81[MAX_RFU_PLAYERS];
u8 unk86[MAX_RFU_PLAYERS];
u8 unk8B[MAX_RFU_PLAYERS];
u16 unk90[MAX_RFU_PLAYERS];
u16 unk9A[MAX_RFU_PLAYERS];
void **unkA4;
u8 fillerA8[0x8200];
struct PokemonJump1_MonInfo unk82A8[5];
struct PokemonJump1_82E4 unk82E4[5];
struct PokemonJump1_MonInfo unk82A8[MAX_RFU_PLAYERS];
struct PokemonJump1_82E4 unk82E4[MAX_RFU_PLAYERS];
struct PokemonJump1_82E4 *unk83AC;
};
@ -150,28 +156,44 @@ static bool32 sub_802BA58(void);
static bool32 sub_802BB84(void);
static bool32 sub_802BC60(void);
static bool32 sub_802BD30(void);
void sub_802BD84(u8 taskId);
void sub_802BE60(TaskFunc func, u8 taskPriority);
void sub_802BE80(void);
void sub_802BEA0(void);
void sub_802BEE4(void);
void sub_802C0B8(void);
void sub_802C0E8(void);
void sub_802C114(void);
void sub_802C164(void);
void sub_802C1DC(void);
bool32 sub_802C130(u16);
void sub_802C260(void);
void sub_802C270(void);
void sub_802C43C(void);
void sub_802C808(u16, u16 *, u16 *);
bool32 sub_802C538(void);
bool32 sub_802C650(void);
bool32 sub_802C5DC(void);
bool32 sub_802C70C(void);
bool32 sub_802C7BC(void);
u16 sub_802C7E0(void);
static void sub_802BD84(u8 taskId);
static void sub_802BE60(TaskFunc func, u8 taskPriority);
static void sub_802BE80(void);
static void sub_802BEA0(void);
static void sub_802BEE4(void);
static int sub_802BF48(void);
static void sub_802BF7C(void);
static int sub_802C098(void);
static void sub_802C0B8(void);
static void sub_802C0E8(void);
static void sub_802C114(void);
static bool32 sub_802C130(u16);
static void sub_802C164(void);
static void sub_802C1DC(void);
static void sub_802C240(void);
static void sub_802C260(void);
static void sub_802C270(void);
static void sub_802C280(void);
static void sub_802C398(int);
static void sub_802C43C(void);
static bool32 sub_802C538(void);
static bool32 sub_802C5DC(void);
static bool32 sub_802C618(void);
static bool32 sub_802C650(void);
static void sub_802C688(int);
static int sub_802C6B0(void);
static bool32 sub_802C70C(void);
static int sub_802C73C(u8 *);
static void sub_802C780(void);
static int sub_802C790(int);
static void sub_802C7A0(u16);
static bool32 sub_802C7BC(void);
static u16 sub_802C7E0(void);
static void sub_802C808(u16, u16 *, u16 *);
static u16 sub_802C818(void);
u16 sub_802C838(void);
u16 sub_802C880(u16, u16);
void sub_802DC9C(u32);
void sub_802D074(void *);
void sub_802D0AC(void);
void sub_802D0C8(int);
@ -183,15 +205,21 @@ void sub_802D884(u16);
void sub_802D8FC(u16);
bool32 sub_802D974(void);
void sub_802DA14(void);
void sub_802DC80(int, s8);
void sub_802DD88(u8);
bool32 sub_802DA44(void);
void sub_802DD64(int);
s8 sub_802DA8C(void);
int sub_802DCCC(u8);
void sub_802DD74(u16);
void sub_802DDA0(u8);
int sub_802DDB8(int);
void sub_802DDCC(void);
void sub_802DDE0(void);
void sub_802DDF4(int);
int sub_802DE08(void);
void sub_802E0AC(struct PokemonJump1_MonInfo *);
bool32 sub_802E0D0(int, struct PokemonJump1_MonInfo *);
void sub_802E138(struct PokemonJump1_82E4 *, u8 *);
bool32 sub_802E1BC(struct PokemonJump1_82E4 *, struct Unk802B078 *);
void sub_802E234(struct PokemonJump1_82E4 *, u8 , u16);
@ -332,6 +360,14 @@ bool32 (* const gUnknown_082FB618[])(void) =
sub_802B720,
};
extern const u16 gUnknown_082FB63C[];
extern const u16 gUnknown_082FB64C[4];
extern const u16 gUnknown_082FB654[];
extern s8 gUnknown_082FB65C[][48];
extern int gUnknown_082FB6EC[];
extern int gUnknown_082FB714[];
extern u16 gUnknown_082FB704[8];
void sub_802A9A8(u16 partyIndex, MainCallback callback)
{
u8 taskId;
@ -371,7 +407,7 @@ static void sub_802AA60(struct PokemonJump1 *arg0)
arg0->unk72 = 0;
sub_802AB20();
sub_802AA94(arg0);
if (arg0->unk5 == 5)
if (arg0->unk5 == MAX_RFU_PLAYERS)
sub_802E3A8();
}
@ -408,20 +444,18 @@ void sub_802AA94(struct PokemonJump1 *arg0)
sub_802AB98();
sub_802C0E8();
for (i = 0; i < 5; i++)
for (i = 0; i < MAX_RFU_PLAYERS; i++)
{
arg0->unk7C[i] = 0;
arg0->unk9A[i] = 0;
}
}
#ifdef NONMATCHING
void sub_802AB20(void)
{
int i;
s16 index;
int i, index;
for (i = 0; i < 5; i++)
for (i = 0; i < MAX_RFU_PLAYERS; i++)
{
index = sub_802AC00(gUnknown_02022CFC->unk82A8[i].species);
gUnknown_02022CFC->unk82E4[i].unkC = gPkmnJumpSpecies[index].unk2;
@ -429,67 +463,12 @@ void sub_802AB20(void)
gUnknown_02022CFC->unk83AC = &gUnknown_02022CFC->unk82E4[gUnknown_02022CFC->unk6];
}
#else
NAKED
void sub_802AB20(void)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r8\n\
push {r7}\n\
ldr r7, =gUnknown_02022CFC\n\
movs r6, 0\n\
movs r5, 0\n\
ldr r0, =gPkmnJumpSpecies\n\
mov r8, r0\n\
movs r4, 0x4\n\
_0802AB32:\n\
ldr r0, [r7]\n\
adds r0, r5\n\
ldr r1, =0x000082a8\n\
adds r0, r1\n\
ldrh r0, [r0]\n\
bl sub_802AC00\n\
lsls r0, 16\n\
ldr r1, [r7]\n\
adds r1, r6\n\
asrs r0, 14\n\
add r0, r8\n\
ldrh r0, [r0, 0x2]\n\
ldr r2, =0x000082f0\n\
adds r1, r2\n\
strh r0, [r1]\n\
adds r6, 0x28\n\
adds r5, 0xC\n\
subs r4, 0x1\n\
cmp r4, 0\n\
bge _0802AB32\n\
ldr r0, =gUnknown_02022CFC\n\
ldr r1, [r0]\n\
ldr r0, =0x000083ac\n\
adds r3, r1, r0\n\
ldrb r2, [r1, 0x6]\n\
lsls r0, r2, 2\n\
adds r0, r2\n\
lsls r0, 3\n\
ldr r2, =0x000082e4\n\
adds r0, r2\n\
adds r1, r0\n\
str r1, [r3]\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool");
}
#endif // NONMATCHING
static void sub_802AB98(void)
{
int i;
for (i = 0; i < 5; i++)
for (i = 0; i < MAX_RFU_PLAYERS; i++)
{
gUnknown_02022CFC->unk82E4[i].unkE = 0;
gUnknown_02022CFC->unk82E4[i].unk10 = 0;
@ -557,7 +536,7 @@ static void sub_802ACA0(u8 taskId)
if (!FuncIsActiveTask(sub_802BD84))
{
sub_802D074(&gUnknown_02022CFC->unkA4);
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
gUnknown_02022CFC->unk8++;
}
@ -602,7 +581,7 @@ static void sub_802ACA0(u8 taskId)
}
}
void sub_802AE14(int arg0)
static void sub_802AE14(int arg0)
{
if (arg0 == 0)
{
@ -1464,3 +1443,582 @@ static bool32 sub_802BD30(void)
return TRUE;
}
static void sub_802BD84(u8 taskId)
{
int i;
s16 *taskData = gTasks[taskId].data;
struct PokemonJump1 *ptr = (struct PokemonJump1 *)GetWordTaskArg(taskId, 14);
switch (taskData[0])
{
case 0:
for (i = 0; i < MAX_RFU_PLAYERS; i++)
taskData[i + 2] = 0;
taskData[0]++;
// fall through
case 1:
sub_802E0AC(&ptr->unk82A8[ptr->unk6]);
for (i = 0; i < MAX_RFU_PLAYERS; i++)
{
if (!taskData[i + 2] && sub_802E0D0(i, &ptr->unk82A8[i]))
{
StringCopy(ptr->unk82E4[i].unk1C, gLinkPlayers[i].name);
taskData[i + 2] = 1;
taskData[1]++;
if (taskData[1] == ptr->unk5)
{
sub_802AB20();
DestroyTask(taskId);
break;
}
}
}
break;
}
}
static void sub_802BE60(TaskFunc func, u8 taskPriority)
{
u8 taskId = CreateTask(func, taskPriority);
SetWordTaskArg(taskId, 14, (u32)gUnknown_02022CFC);
}
static void sub_802BE80(void)
{
gUnknown_02022CFC->unk4A = 0;
gUnknown_02022CFC->unk14 = 6;
gUnknown_02022CFC->unk34 = 0;
gUnknown_02022CFC->unk1C = 0;
gUnknown_02022CFC->unk36 = 0;
gUnknown_02022CFC->unk10 = 0;
}
static void sub_802BEA0(void)
{
gUnknown_02022CFC->unk4A = 0;
gUnknown_02022CFC->unk34 = 0x6FF;
gUnknown_02022CFC->unk14 = 7;
gUnknown_02022CFC->unk36 = 0;
gUnknown_02022CFC->unk10 = 0;
gUnknown_02022CFC->unk51 = 0;
gUnknown_02022CFC->unk50 = 0;
gUnknown_02022CFC->unk20 = 0;
gUnknown_02022CFC->unk4E = 0;
gUnknown_02022CFC->unk6C = 0;
sub_802BF7C();
}
static void sub_802BEE4(void)
{
if (gUnknown_02022CFC->unk46)
{
gUnknown_02022CFC->unk4A++;
gUnknown_02022CFC->unk34 += sub_802BF48();
if (gUnknown_02022CFC->unk34 >= 0x9FF)
gUnknown_02022CFC->unk34 -= 0x9FF;
gUnknown_02022CFC->unk18 = gUnknown_02022CFC->unk14;
gUnknown_02022CFC->unk14 = gUnknown_02022CFC->unk34 >> 8;
if (gUnknown_02022CFC->unk14 > 6 && gUnknown_02022CFC->unk18 < 7)
{
gUnknown_02022CFC->unk36++;
sub_802BF7C();
}
}
}
static int sub_802BF48(void)
{
int result;
if (gUnknown_02022CFC->unk10)
return 0;
result = gUnknown_02022CFC->unk1C;
if (gUnknown_02022CFC->unk34 <= 0x5FF)
{
gUnknown_02022CFC->unk20 += 80;
result += gUnknown_02022CFC->unk20 >> 8;
}
return result;
}
static void sub_802BF7C(void)
{
int var0;
gUnknown_02022CFC->unk20 = 0;
if (gUnknown_02022CFC->unk4E)
{
gUnknown_02022CFC->unk4E--;
if (gUnknown_02022CFC->unk6C)
{
if (sub_802C098() % 4 != 0)
{
gUnknown_02022CFC->unk1C = gUnknown_02022CFC->unk28;
}
else
{
if (gUnknown_02022CFC->unk28 > 54)
gUnknown_02022CFC->unk1C = 30;
else
gUnknown_02022CFC->unk1C = 82;
}
}
}
else
{
if (!(gUnknown_02022CFC->unk50 & 8))
{
gUnknown_02022CFC->unk28 = gUnknown_082FB63C[gUnknown_02022CFC->unk50] + (gUnknown_02022CFC->unk51 * 7);
gUnknown_02022CFC->unk4E = gUnknown_082FB64C[sub_802C098() % ARRAY_COUNT(gUnknown_082FB64C)] + 2;
gUnknown_02022CFC->unk50++;
}
else
{
if (gUnknown_02022CFC->unk50 == 8)
{
if (gUnknown_02022CFC->unk51 < 3)
gUnknown_02022CFC->unk51++;
else
gUnknown_02022CFC->unk6C = 1;
}
var0 = gUnknown_082FB63C[15 - gUnknown_02022CFC->unk50];
gUnknown_02022CFC->unk28 = var0 + (gUnknown_02022CFC->unk51 * 7);
if (++gUnknown_02022CFC->unk50 > 15)
{
if (sub_802C098() % 4 == 0)
gUnknown_02022CFC->unk28 -= 5;
gUnknown_02022CFC->unk50 = 0;
}
}
gUnknown_02022CFC->unk1C = gUnknown_02022CFC->unk28;
}
}
static int sub_802C098(void)
{
// The number 1103515245 comes from the example implementation of rand and srand
gUnknown_02022CFC->unk24 = gUnknown_02022CFC->unk24 * 1103515245 + 24691;
return gUnknown_02022CFC->unk24 >> 16;
}
static void sub_802C0B8(void)
{
gUnknown_02022CFC->unk10 = 1;
gUnknown_02022CFC->unk14 = 6;
gUnknown_02022CFC->unk34 = 0x5FF;
sub_802C270();
}
static int sub_802C0DC(void)
{
return gUnknown_02022CFC->unk10;
}
static void sub_802C0E8(void)
{
int i;
for (i = 0; i < MAX_RFU_PLAYERS; i++)
gUnknown_02022CFC->unk82E4[i].unk14 = 0;
}
static void sub_802C114(void)
{
gUnknown_02022CFC->unk83AC->unk10 = 0;
gUnknown_02022CFC->unk83AC->unk12 = 0;
}
static bool32 sub_802C130(u16 arg0)
{
if (gUnknown_02022CFC->unk82E4[gUnknown_02022CFC->unk6].unk10 == arg0)
return TRUE;
else
return FALSE;
}
static void sub_802C164(void)
{
gUnknown_02022CFC->unk83AC->unkE = gUnknown_02022CFC->unk4A;
gUnknown_02022CFC->unk83AC->unk12 = gUnknown_02022CFC->unk83AC->unk10;
gUnknown_02022CFC->unk83AC->unk10 = 1;
}
static void sub_802C18C(void)
{
gUnknown_02022CFC->unk83AC->unk12 = gUnknown_02022CFC->unk83AC->unk10;
gUnknown_02022CFC->unk83AC->unk10 = 2;
gUnknown_02022CFC->unk83AC->unkE = gUnknown_02022CFC->unk4A;
gUnknown_02022CFC->unk83AC->unk14 = 2;
}
static void sub_802C1BC(void)
{
gUnknown_02022CFC->unk83AC->unk12 = gUnknown_02022CFC->unk83AC->unk10;
gUnknown_02022CFC->unk83AC->unk10 = 0;
}
static void sub_802C1DC(void)
{
if (gUnknown_02022CFC->unk5C)
{
sub_802DD64(gUnknown_02022CFC->unk78);
gUnknown_02022CFC->unk5C = 0;
if (gUnknown_02022CFC->unk4D)
{
int index = sub_802DCCC(gUnknown_02022CFC->unk71);
PlaySE(gUnknown_082FB654[index - 2]);
gUnknown_02022CFC->unk4D = 0;
}
}
sub_802DD74(gUnknown_02022CFC->unk74);
sub_802C280();
sub_802C240();
}
static void sub_802C240(void)
{
if (gUnknown_02022CFC->unk46)
sub_802DC9C(gUnknown_02022CFC->unk14);
}
static void sub_802C260(void)
{
gUnknown_02022CFC->unk46 = 0;
}
static void sub_802C270(void)
{
gUnknown_02022CFC->unk46 = 1;
}
static void sub_802C280(void)
{
int i;
int whichSound = 0;
int numLinkPlayers = gUnknown_02022CFC->unk5;
for (i = 0; i < numLinkPlayers; i++)
{
switch (gUnknown_02022CFC->unk82E4[i].unk10)
{
case 0:
sub_802DC80(i, 0);
break;
case 1:
if (gUnknown_02022CFC->unk82E4[i].unk12 != 1 || gUnknown_02022CFC->unk82E4[i].unkE != gUnknown_02022CFC->unk9A[i])
{
if (i == gUnknown_02022CFC->unk6)
gUnknown_02022CFC->unk82E4[i].unk12 = 1;
whichSound |= 0x1;
gUnknown_02022CFC->unk82E4[i].unk4 = 0x7FFFFFFF;
gUnknown_02022CFC->unk9A[i] = gUnknown_02022CFC->unk82E4[i].unkE;
}
sub_802C398(i);
break;
case 2:
if (gUnknown_02022CFC->unk82E4[i].unk12 != 2)
{
if (i == gUnknown_02022CFC->unk6)
gUnknown_02022CFC->unk82E4[i].unk12 = 2;
whichSound |= 0x2;
sub_802DD88(i);
}
break;
}
}
if (whichSound & 0x2)
PlaySE(SE_RG_NAWAMISS);
else if (whichSound & 0x1)
PlaySE(SE_DANSA);
}
static void sub_802C398(int multiplayerId)
{
int var0;
int var1;
struct PokemonJump1_82E4 *player;
if (gUnknown_02022CFC->unk68)
return;
player = &gUnknown_02022CFC->unk82E4[multiplayerId];
if (player->unk4 != 0x7FFFFFFF)
{
player->unk4++;
var0 = player->unk4;
}
else
{
var0 = gUnknown_02022CFC->unk4A - player->unkE;
if (var0 >= 65000)
{
var0 -= 65000;
var0 += gUnknown_02022CFC->unk4A;
}
player->unk4 = var0;
}
if (var0 < 4)
return;
var0 -= 4;
if (var0 < 48)
var1 = gUnknown_082FB65C[player->unkC][var0];
else
var1 = 0;
sub_802DC80(multiplayerId, var1);
if (!var1 && multiplayerId == gUnknown_02022CFC->unk6)
sub_802C1BC();
player->unk0 = var1;
}
static void sub_802C43C(void)
{
if (gUnknown_02022CFC->unk14 == 8 && gUnknown_02022CFC->unk18 == 7)
{
if (gUnknown_02022CFC->unk58 == 0)
{
sub_802C780();
gUnknown_02022CFC->unk54 = 0;
gUnknown_02022CFC->unk58 = 1;
gUnknown_02022CFC->unk71 = 0;
}
else
{
if (gUnknown_02022CFC->unk54 == 5)
{
gUnknown_02022CFC->unkC++;
sub_802C7A0(gUnknown_02022CFC->unkC);
}
else
{
gUnknown_02022CFC->unkC = 0;
}
if (gUnknown_02022CFC->unk54 > 1)
{
gUnknown_02022CFC->unk64 = 1;
memcpy(gUnknown_02022CFC->unk86, gUnknown_02022CFC->unk81, sizeof(u8) * MAX_RFU_PLAYERS);
}
sub_802C780();
gUnknown_02022CFC->unk54 = 0;
gUnknown_02022CFC->unk58 = 1;
gUnknown_02022CFC->unk71 = 0;
if (gUnknown_02022CFC->unk74 < 9999)
gUnknown_02022CFC->unk74++;
sub_802C688(10);
sub_802AE14(3);
}
}
if (gUnknown_02022CFC->unk64 && (sub_802C618() == TRUE || !gUnknown_02022CFC->unk14))
{
int var0 = sub_802C73C(gUnknown_02022CFC->unk86);
sub_802C688(sub_802C790(var0));
sub_802AE14(3);
gUnknown_02022CFC->unk64 = 0;
}
if (gUnknown_02022CFC->unk58)
{
int var1 = sub_802C6B0();
if (var1 > gUnknown_02022CFC->unk54)
{
gUnknown_02022CFC->unk54 = var1;
memcpy(gUnknown_02022CFC->unk81, gUnknown_02022CFC->unk7C, sizeof(u8) * MAX_RFU_PLAYERS);
}
}
}
static bool32 sub_802C538(void)
{
int i;
if (gUnknown_02022CFC->unk14 == 6 && !gUnknown_02022CFC->unk83AC->unk0)
{
if (gUnknown_02022CFC->unk83AC->unk12 == 1 && sub_802C0DC() == 1)
{
gUnknown_02022CFC->unk83AC->unk14 = 1;
}
else
{
sub_802C18C();
sub_802AE14(3);
}
}
if (gUnknown_02022CFC->unk14 == 7
&& gUnknown_02022CFC->unk18 == 6
&& gUnknown_02022CFC->unk83AC->unk10 != 2)
{
gUnknown_02022CFC->unk83AC->unk14 = 1;
sub_802AE14(3);
}
for (i = 0; i < gUnknown_02022CFC->unk5; i++)
{
if (gUnknown_02022CFC->unk82E4[i].unk10 == 2)
return FALSE;
}
return TRUE;
}
static bool32 sub_802C5DC(void)
{
int i;
int numPlayers = gUnknown_02022CFC->unk5;
int count = 0;
for (i = 0; i < numPlayers; i++)
{
if (gUnknown_02022CFC->unk82E4[i].unk14)
count++;
}
return count == numPlayers;
}
static bool32 sub_802C618(void)
{
int i;
for (i = 0; i < gUnknown_02022CFC->unk5; i++)
{
if (gUnknown_02022CFC->unk82E4[i].unk14 != 1)
return FALSE;
}
return TRUE;
}
static bool32 sub_802C650(void)
{
int i;
if (gUnknown_02022CFC->unk45 == 1)
return FALSE;
for (i = 1; i < gUnknown_02022CFC->unk5; i++)
{
if (gUnknown_02022CFC->unk90[i] == 1)
return FALSE;
}
return TRUE;
}
static void sub_802C688(int arg0)
{
gUnknown_02022CFC->unk78 += arg0;
gUnknown_02022CFC->unk5C = 1;
if (gUnknown_02022CFC->unk78 >= 99990)
gUnknown_02022CFC->unk78 = 99990;
}
static int sub_802C6B0(void)
{
int i;
int count = 0;
int numPlayers = gUnknown_02022CFC->unk5;
for (i = 0; i < numPlayers; i++)
{
if (gUnknown_02022CFC->unk82E4[i].unk0 == -30)
{
gUnknown_02022CFC->unk7C[i] = 1;
count++;
}
else
{
gUnknown_02022CFC->unk7C[i] = 0;
}
}
return count;
}
static bool32 sub_802C70C(void)
{
return !gUnknown_03005000.unk_124.unk_8c2 && !gUnknown_03005000.unk_9e8.unk_232;
}
static int sub_802C73C(u8 *arg0)
{
int i;
int flags;
int count;
for (i = 0, flags = 0, count = 0; i < MAX_RFU_PLAYERS; i++)
{
if (arg0[i])
{
flags |= 1 << i;
count++;
}
}
gUnknown_02022CFC->unk71 = flags;
if (flags)
gUnknown_02022CFC->unk4D = 1;
return count;
}
static void sub_802C780(void)
{
gUnknown_02022CFC->unk44 = 0;
}
static int sub_802C790(int arg0)
{
return gUnknown_082FB6EC[arg0];
}
static void sub_802C7A0(u16 arg0)
{
if (arg0 > gUnknown_02022CFC->unkE)
gUnknown_02022CFC->unkE = arg0;
}
static bool32 sub_802C7BC(void)
{
if (gUnknown_02022CFC->unk78 >= gUnknown_082FB714[0])
return TRUE;
else
return FALSE;
}
static u16 sub_802C7E0(void)
{
u16 lo = sub_802C818();
u16 hi = sub_802C838();
return (hi << 12) | (lo & 0xFFF);
}
static void sub_802C808(u16 arg0, u16 *arg1, u16 *arg2)
{
*arg2 = arg0 >> 12;
*arg1 = arg0 & 0xFFF;
}
static u16 sub_802C818(void)
{
u16 index = Random() % ARRAY_COUNT(gUnknown_082FB704);
return gUnknown_082FB704[index];
}

View File

@ -6,18 +6,6 @@
#include "field_weather.h"
#include "palette.h"
#include "pokemon_storage_system.h"
#include "sound.h"
#include "constants/songs.h"
#include "window.h"
#include "gpu_regs.h"
#include "bg.h"
#include "menu.h"
#include "graphics.h"
#include "dma3.h"
#include "gba/macro.h"
#include "decompress.h"
#include "strings.h"
#include "constants/rgb.h"
#include "pokenav.h"
enum

View File

@ -1563,7 +1563,7 @@ static void Task_DuoFightAnim(u8 taskId)
}
BlendPalettes(-1, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
SetVBlankCallback(VBlankCB_DuoFight);
PlaySE(SE_T_OOAME);
}
@ -1715,7 +1715,7 @@ static void sub_81D752C(u8 taskId)
static void DuoFightEnd(u8 taskId, s8 palDelay)
{
PlaySE(SE_T_OOAME_E);
BeginNormalPaletteFade(0xFFFFFFFF, palDelay, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, palDelay, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_DuoFightEnd;
}
@ -1971,7 +1971,7 @@ static void Task_HandleRayTakesFlight(u8 taskId)
case 0:
if (data[1] == 8)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
data[2] = 0;
data[3] = 30;
data[4] = 0;
@ -2012,7 +2012,7 @@ static void Task_HandleRayTakesFlight(u8 taskId)
if (data[1] > 295)
{
data[0]++;
BeginNormalPaletteFade(0xFFFFFFFF, 6, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 6, 0, 0x10, RGB_BLACK);
}
}
break;
@ -2174,7 +2174,7 @@ static void Task_HandleRayDescends(u8 taskId)
case 0:
if (data[1] == 8)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
data[1] = 0;
data[0]++;
}
@ -2219,7 +2219,7 @@ static void Task_HandleRayDescends(u8 taskId)
}
break;
case 4:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_RayDescendsEnd;
break;
}
@ -2366,7 +2366,7 @@ static void Task_HandleRayCharges(u8 taskId)
case 0:
if (data[1] == 8)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
data[1] = 0;
data[0]++;
}
@ -2399,7 +2399,7 @@ static void Task_HandleRayCharges(u8 taskId)
}
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_RayChargesEnd;
break;
}
@ -2532,7 +2532,7 @@ static void Task_HandleRayChasesAway(u8 taskId)
if (data[1] == 8)
{
sub_81D90A8(taskId);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
data[1] = 0;
data[0]++;
}
@ -2574,7 +2574,7 @@ static void Task_HandleRayChasesAway(u8 taskId)
}
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_RayChasesAwayEnd;
break;
}

View File

@ -17,6 +17,7 @@
#include "battle_setup.h"
#include "frontier_util.h"
#include "constants/trainers.h"
#include "constants/rgb.h"
#define BATTLER_RECORD_SIZE 664
#define ILLEGAL_BATTLE_TYPES ((BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_FIRST_BATTLE \
@ -220,7 +221,7 @@ u8 RecordedBattle_GetBattlerAction(u8 battlerId)
{
gSpecialVar_Result = gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED; // hah
ResetPaletteFadeControl();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
SetMainCallback2(CB2_QuitRecordedBattle);
return 0xFF;
}

View File

@ -26,6 +26,7 @@
#include "heal_location.h"
#include "constants/heal_locations.h"
#include "constants/map_types.h"
#include "constants/rgb.h"
#define MAP_WIDTH 28
#define MAP_HEIGHT 15
@ -1941,7 +1942,7 @@ static void sub_8124D14(void)
switch (sFlyMap->unk_004)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
sFlyMap->unk_004++;
break;
case 1:
@ -1988,7 +1989,7 @@ static void sub_8124E0C(void)
switch (sFlyMap->unk_004)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
sFlyMap->unk_004++;
break;
case 1:

View File

@ -17,6 +17,7 @@
#include "bg.h"
#include "window.h"
#include "gpu_regs.h"
#include "constants/rgb.h"
struct ResetRtcStruct
{
@ -552,7 +553,7 @@ static void Task_ResetRtcScreen(u8 taskId)
switch (data[0])
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 1, 0x10, 0, 0xFFFF);
BeginNormalPaletteFade(0xFFFFFFFF, 1, 0x10, 0, RGB_WHITEALPHA);
data[0] = 1;
break;
case 1:
@ -621,7 +622,7 @@ static void Task_ResetRtcScreen(u8 taskId)
case 5:
if (gMain.newKeys & A_BUTTON)
{
BeginNormalPaletteFade(0xFFFFFFFF, 1, 0, 0x10, 0xFFFF);
BeginNormalPaletteFade(0xFFFFFFFF, 1, 0, 0x10, RGB_WHITEALPHA);
data[0] = 6;
}
else

View File

@ -152,7 +152,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
if (gWirelessCommType != 0 && gReceivedRemoteLinkPlayers != 0)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
}

View File

@ -902,7 +902,7 @@ static void sub_8140470(void)
{
sub_815168C(&gUnknown_0203AB88->varB8, i, &gUnknown_085B6388[i]);
}
for (i = 0; i < PARTY_SIZE; i++)
{
switch (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2))
@ -953,7 +953,7 @@ static void sub_81405CC(void)
case 4:
if (free_temp_tile_data_buffers_if_possible())
return;
sub_8140470();
CopyToBgTilemapBuffer(2, gUnknown_085B5FA0, 0, 0);
break;
@ -1379,8 +1379,6 @@ static u8 sub_814118C(u16 r0, u16 r1)
}
}
// r7/r8 swap
#ifdef NONMATCHING
static void sub_8141344(u8 taskId)
{
u8 randf;
@ -1412,8 +1410,7 @@ static void sub_8141344(u8 taskId)
g = S16TOPOSFLOAT(g) / 5.0f;
gUnknown_0203AB88->var82 = g * 3;
gUnknown_0203AB88->var84 = g;
gUnknown_0203AB88->var86 = g;
gUnknown_0203AB88->var86 = gUnknown_0203AB88->var84 = g;
gUnknown_0203AB88->var88 = S16TOPOSFLOAT(angles[(rand & 1) + r5]);
gUnknown_0203AB88->var8C = S16TOPOSFLOAT(gUnknown_085B6348[gUnknown_0203AB88->var04_0].var18);
@ -1424,260 +1421,6 @@ static void sub_8141344(u8 taskId)
gUnknown_0203AB88->varA0 = 36.0f;
gTasks[taskId].func = sub_814155C;
}
#else
static const u16 gUnknown_085B6422[4] = {0, 180, 90, 270};
NAKED
static void sub_8141344(u8 taskId)
{
asm_unified(" push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x8\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r10, r0\n\
movs r4, 0\n\
ldr r1, =gUnknown_085B6422\n\
mov r0, sp\n\
movs r2, 0x8\n\
bl memcpy\n\
bl Random\n\
lsls r0, 16\n\
lsrs r7, r0, 16\n\
adds r0, r7, 0\n\
movs r1, 0x64\n\
bl __umodsi3\n\
lsls r0, 16\n\
lsrs r6, r0, 16\n\
ldr r3, =gUnknown_0203AB88\n\
ldr r0, [r3]\n\
ldr r2, =gTasks\n\
mov r5, r10\n\
lsls r1, r5, 2\n\
add r1, r10\n\
lsls r1, 3\n\
adds r1, r2\n\
ldrh r2, [r1, 0x14]\n\
adds r0, 0x7C\n\
strb r2, [r0]\n\
ldr r0, [r3]\n\
adds r2, r0, 0\n\
adds r2, 0x7F\n\
strb r4, [r2]\n\
subs r2, 0x1\n\
strb r4, [r2]\n\
adds r0, 0x7D\n\
strb r4, [r0]\n\
ldrh r0, [r1, 0x18]\n\
adds r1, r7, 0\n\
bl sub_814118C\n\
adds r4, r0, 0\n\
lsls r4, 24\n\
lsrs r1, r4, 24\n\
adds r0, r7, 0\n\
bl __modsi3\n\
lsrs r4, 25\n\
subs r0, r4\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
ldr r0, =gLocalTime\n\
ldrb r0, [r0, 0x2]\n\
lsls r0, 24\n\
asrs r0, 24\n\
movs r5, 0x1\n\
cmp r0, 0xC\n\
bgt _081413C8\n\
movs r5, 0\n\
_081413C8:\n\
cmp r6, 0x4F\n\
bhi _081413E0\n\
lsls r0, r5, 25\n\
b _081413EA\n\
.pool\n\
_081413E0:\n\
lsls r1, r5, 24\n\
asrs r1, 24\n\
movs r0, 0x1\n\
subs r0, r1\n\
lsls r0, 25\n\
_081413EA:\n\
lsrs r5, r0, 24\n\
ldr r0, _08141530 @ =gUnknown_0203AB88\n\
ldr r6, [r0]\n\
ldrb r0, [r6, 0x4]\n\
lsls r0, 30\n\
lsrs r0, 25\n\
ldr r1, _08141534 @ =gUnknown_085B6348\n\
adds r0, r1\n\
lsls r4, 24\n\
asrs r4, 24\n\
ldrh r0, [r0, 0x1A]\n\
adds r4, r0\n\
adds r0, r6, 0\n\
adds r0, 0x80\n\
strh r4, [r0]\n\
lsls r4, 16\n\
asrs r4, 16\n\
adds r0, r4, 0\n\
bl __floatsisf\n\
cmp r4, 0\n\
bge _0814141C\n\
ldr r1, _08141538 @ =0x47800000\n\
bl __addsf3\n\
_0814141C:\n\
ldr r1, _0814153C @ =0x40A00000\n\
bl __divsf3\n\
bl __fixunssfsi\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
lsls r0, r4, 1\n\
adds r0, r4\n\
movs r2, 0x82\n\
adds r2, r6\n\
mov r8, r2\n\
strh r0, [r2]\n\
adds r0, r6, 0\n\
adds r0, 0x84\n\
strh r4, [r0]\n\
adds r0, 0x2\n\
strh r4, [r0]\n\
movs r0, 0x88\n\
adds r0, r6\n\
mov r9, r0\n\
movs r0, 0x1\n\
ands r0, r7\n\
lsls r1, r5, 24\n\
asrs r1, 24\n\
adds r0, r1\n\
lsls r0, 1\n\
add r0, sp\n\
movs r1, 0\n\
ldrsh r4, [r0, r1]\n\
adds r0, r4, 0\n\
bl __floatsisf\n\
cmp r4, 0\n\
bge _08141468\n\
ldr r1, _08141538 @ =0x47800000\n\
bl __addsf3\n\
_08141468:\n\
mov r2, r9\n\
str r0, [r2]\n\
adds r7, r6, 0\n\
adds r7, 0x8C\n\
ldrb r0, [r6, 0x4]\n\
lsls r0, 30\n\
lsrs r0, 25\n\
ldr r5, _08141534 @ =gUnknown_085B6348\n\
adds r0, r5\n\
movs r1, 0x18\n\
ldrsh r4, [r0, r1]\n\
adds r0, r4, 0\n\
bl __floatsisf\n\
adds r5, r0, 0\n\
cmp r4, 0\n\
bge _08141492\n\
ldr r1, _08141538 @ =0x47800000\n\
bl __addsf3\n\
adds r5, r0, 0\n\
_08141492:\n\
str r5, [r7]\n\
adds r7, r6, 0\n\
adds r7, 0x90\n\
ldr r1, _08141540 @ =0x3F000000\n\
adds r0, r5, 0\n\
bl __mulsf3\n\
adds r1, r5, 0\n\
bl __subsf3\n\
adds r5, r0, 0\n\
mov r2, r8\n\
movs r0, 0\n\
ldrsh r4, [r2, r0]\n\
adds r0, r4, 0\n\
bl __floatsisf\n\
adds r2, r0, 0\n\
cmp r4, 0\n\
bge _081414C2\n\
ldr r1, _08141538 @ =0x47800000\n\
bl __addsf3\n\
adds r2, r0, 0\n\
_081414C2:\n\
adds r0, r5, 0\n\
adds r1, r2, 0\n\
bl __divsf3\n\
str r0, [r7]\n\
adds r1, r6, 0\n\
adds r1, 0x94\n\
ldr r0, _08141544 @ =0x42880000\n\
str r0, [r1]\n\
adds r1, 0x8\n\
ldr r0, _08141548 @ =0x00000000\n\
str r0, [r1]\n\
adds r5, r6, 0\n\
adds r5, 0x98\n\
mov r1, r8\n\
movs r2, 0\n\
ldrsh r4, [r1, r2]\n\
adds r0, r4, 0\n\
bl __floatsisf\n\
adds r2, r0, 0\n\
cmp r4, 0\n\
bge _081414F8\n\
ldr r1, _08141538 @ =0x47800000\n\
bl __addsf3\n\
adds r2, r0, 0\n\
_081414F8:\n\
ldr r0, _0814154C @ =0x41000000\n\
adds r1, r2, 0\n\
bl __divsf3\n\
bl __negsf2\n\
str r0, [r5]\n\
adds r1, r6, 0\n\
adds r1, 0xA0\n\
ldr r0, _08141550 @ =0x42100000\n\
str r0, [r1]\n\
ldr r1, _08141554 @ =gTasks\n\
mov r5, r10\n\
lsls r0, r5, 2\n\
add r0, r10\n\
lsls r0, 3\n\
adds r0, r1\n\
ldr r1, _08141558 @ =sub_814155C\n\
str r1, [r0]\n\
add sp, 0x8\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.align 2, 0\n\
_08141530:\n\
.4byte gUnknown_0203AB88\n\
_08141534:\n\
.4byte gUnknown_085B6348\n\
_08141538:\n\
.4byte 0x47800000\n\
_0814153C:\n\
.4byte 0x40A00000\n\
_08141540:\n\
.4byte 0x3F000000\n\
_08141544:\n\
.4byte 0x42880000\n\
_08141548:\n\
.4byte 0x00000000\n\
_0814154C:\n\
.4byte 0x41000000\n\
_08141550:\n\
.4byte 0x42100000\n\
_08141554:\n\
.4byte gTasks\n\
_08141558:\n\
.4byte sub_814155C");
}
#endif // NONMATCHING
static void sub_814155C(u8 taskId)
{
@ -4345,17 +4088,17 @@ static void sub_81448B8(struct Sprite *sprite)
gUnknown_0203AB88->var38 = sprite;
}
#ifdef NONMATCHING
static void sub_8144A24(struct Sprite *sprite)
{
u8 z;
u16 o;
u8 h = 0; // r10 (sp+0xc)
u8 j = 5; // r9 (r9)
u8 p = 0; // sp+0xc (sp+0x10)
u8 i;
u8 s[10] = {}; // sp+0 (sp+0)
u16 t = Random(); // sp+0x10 (r10)
u8 h = 0;
u8 j = 5;
u8 p = 0;
u8 i = 0;
u8 val;
u8 s[10] = {};
u16 rand = Random();
gUnknown_0203AB88->var7D = 1;
gUnknown_0203AB88->var03_5 = TRUE;
@ -4364,13 +4107,14 @@ static void sub_8144A24(struct Sprite *sprite)
gUnknown_0203AB88->var88 = sprite->data[3];
gUnknown_0203AB88->var98 = 0.0f;
gUnknown_0203AB88->var8C = gUnknown_085B6348[gUnknown_0203AB88->var04_0].var1C;
o = (gUnknown_0203AB88->var04_0 * 30 + 33) + (0x1 - gUnknown_0203AB88->var03_0) * 15;
for (i = 0; i < 4; i++)
{
if (o < sprite->data[3] && sprite->data[3] <= o + 90)
{
sprite->data[0] = i / 2;
gUnknown_0203AB88->var03_0 = i & 1;
gUnknown_0203AB88->var03_0 = i % 2;
break;
}
if (i == 3)
@ -4381,354 +4125,52 @@ static void sub_8144A24(struct Sprite *sprite)
}
o += 90;
}
if (gUnknown_0203AB88->var03_0)
{
if (sprite->data[0])
{
PlayCry1(SPECIES_TAILLOW, -63);
}
else
{
PlayCry1(SPECIES_TAILLOW, 63);
}
}
else
{
PlayCry1(SPECIES_SHROOMISH, -63);
}
i = 2;
val = 2;
z = (gUnknown_0203AB88->var7F + 2) % 12;
if (gUnknown_0203AB88->var03_0 == 1 && gUnknown_0203AB88->var04_0 == 1)
j += 6;
else
j += i;
for (; i < j; i++)
j += val;
for (i = val; i < j; i++)
{
if (!(gUnknown_0203AB88->var08 & gUnknown_085B62E4[z].var04))
{
s[h++] = i;
if (!p && (gUnknown_085B62E4[z].var04 & gUnknown_085B6154[gUnknown_0203AB88->var1B[gUnknown_0203AB88->var1A_0]].var00))
{
if (p == 0 && (gUnknown_085B62E4[z].var04 & gUnknown_085B6154[gUnknown_0203AB88->var1B[gUnknown_0203AB88->var1A_0]].var0C))
p = i;
}
}
z = (z + 1) % 0xC;
}
if ((gUnknown_0203AB88->var03_0 + 1) & gUnknown_0203AB88->var02)
{
if (p && (t & 0xFF) < 0xc0)
{
if (p && (rand & 0xFF) < 0xc0)
sprite->data[7] = p;
}
else
{
sprite->data[7] = s[t % h];
}
sprite->data[7] = s[rand % h];
}
else
{
sprite->data[7] = s[t % h];
sprite->data[7] = s[rand % h];
}
sprite->callback = sub_8144168;
}
#else
NAKED
static void sub_8144A24(struct Sprite *sprite)
{
asm_unified("push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x14\n\
adds r7, r0, 0\n\
movs r0, 0\n\
mov r9, r0\n\
movs r1, 0x5\n\
mov r8, r1\n\
str r0, [sp, 0xC]\n\
mov r0, sp\n\
movs r1, 0\n\
movs r2, 0xA\n\
bl memset\n\
bl Random\n\
lsls r0, 16\n\
lsrs r0, 16\n\
str r0, [sp, 0x10]\n\
ldr r3, _08144B10 @ =gUnknown_0203AB88\n\
ldr r0, [r3]\n\
adds r0, 0x7D\n\
movs r5, 0x1\n\
strb r5, [r0]\n\
ldr r2, [r3]\n\
ldrb r0, [r2, 0x3]\n\
movs r1, 0x20\n\
orrs r0, r1\n\
strb r0, [r2, 0x3]\n\
ldr r2, [r3]\n\
ldrb r1, [r2, 0x3]\n\
movs r0, 0x41\n\
negs r0, r0\n\
ands r0, r1\n\
strb r0, [r2, 0x3]\n\
ldr r0, [r3]\n\
adds r0, 0x7E\n\
movs r1, 0xFF\n\
strb r1, [r0]\n\
ldr r6, [r3]\n\
adds r4, r6, 0\n\
adds r4, 0x88\n\
movs r1, 0x34\n\
ldrsh r0, [r7, r1]\n\
bl __floatsisf\n\
str r0, [r4]\n\
adds r1, r6, 0\n\
adds r1, 0x98\n\
ldr r0, _08144B14 @ =0x00000000\n\
str r0, [r1]\n\
adds r2, r6, 0\n\
adds r2, 0x8C\n\
ldr r1, _08144B18 @ =gUnknown_085B6348\n\
ldrb r0, [r6, 0x4]\n\
lsls r0, 30\n\
lsrs r0, 25\n\
adds r1, 0x1C\n\
adds r0, r1\n\
ldr r0, [r0]\n\
str r0, [r2]\n\
ldrb r0, [r6, 0x4]\n\
lsls r0, 30\n\
lsrs r0, 30\n\
lsls r1, r0, 4\n\
subs r1, r0\n\
lsls r1, 1\n\
adds r1, 0x21\n\
ldrb r0, [r6, 0x3]\n\
lsls r0, 27\n\
lsrs r0, 27\n\
subs r5, r0\n\
lsls r0, r5, 4\n\
subs r0, r5\n\
adds r1, r0\n\
lsls r1, 16\n\
lsrs r1, 16\n\
mov r5, r9\n\
movs r0, 0x34\n\
ldrsh r2, [r7, r0]\n\
_08144ACA:\n\
cmp r1, r2\n\
bge _08144AD6\n\
adds r0, r1, 0\n\
adds r0, 0x5A\n\
cmp r2, r0\n\
ble _08144B38\n\
_08144AD6:\n\
cmp r5, 0x3\n\
beq _08144B1C\n\
adds r0, r1, 0\n\
adds r0, 0x5A\n\
lsls r0, 16\n\
lsrs r1, r0, 16\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
cmp r5, 0x3\n\
bls _08144ACA\n\
_08144AEC:\n\
ldr r0, _08144B10 @ =gUnknown_0203AB88\n\
ldr r0, [r0]\n\
ldrb r1, [r0, 0x3]\n\
movs r0, 0x1F\n\
ands r0, r1\n\
cmp r0, 0\n\
beq _08144B64\n\
movs r1, 0x2E\n\
ldrsh r0, [r7, r1]\n\
cmp r0, 0\n\
beq _08144B58\n\
movs r0, 0x98\n\
lsls r0, 1\n\
movs r1, 0x3F\n\
negs r1, r1\n\
bl PlayCry1\n\
b _08144B70\n\
.align 2, 0\n\
_08144B10:\n\
.4byte gUnknown_0203AB88\n\
_08144B14:\n\
.4byte 0x00000000\n\
_08144B18:\n\
.4byte gUnknown_085B6348\n\
_08144B1C:\n\
movs r0, 0x1\n\
strh r0, [r7, 0x2E]\n\
ldr r0, =gUnknown_0203AB88\n\
ldr r2, [r0]\n\
ldrb r1, [r2, 0x3]\n\
movs r0, 0x20\n\
negs r0, r0\n\
ands r0, r1\n\
movs r1, 0x1\n\
orrs r0, r1\n\
strb r0, [r2, 0x3]\n\
b _08144AEC\n\
.pool\n\
_08144B38:\n\
lsrs r0, r5, 1\n\
strh r0, [r7, 0x2E]\n\
ldr r0, =gUnknown_0203AB88\n\
ldr r3, [r0]\n\
movs r1, 0x1\n\
ands r1, r5\n\
ldrb r2, [r3, 0x3]\n\
movs r0, 0x20\n\
negs r0, r0\n\
ands r0, r2\n\
orrs r0, r1\n\
strb r0, [r3, 0x3]\n\
b _08144AEC\n\
.pool\n\
_08144B58:\n\
movs r0, 0x98\n\
lsls r0, 1\n\
movs r1, 0x3F\n\
bl PlayCry1\n\
b _08144B70\n\
_08144B64:\n\
movs r0, 0x99\n\
lsls r0, 1\n\
movs r1, 0x3F\n\
negs r1, r1\n\
bl PlayCry1\n\
_08144B70:\n\
movs r0, 0x2\n\
mov r10, r0\n\
ldr r4, =gUnknown_0203AB88\n\
ldr r5, [r4]\n\
adds r0, r5, 0\n\
adds r0, 0x7F\n\
ldrb r0, [r0]\n\
adds r0, 0x2\n\
movs r1, 0xC\n\
bl __modsi3\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
ldrb r1, [r5, 0x3]\n\
movs r0, 0x1F\n\
ands r0, r1\n\
cmp r0, 0x1\n\
bne _08144BA8\n\
ldrb r1, [r5, 0x4]\n\
movs r0, 0x3\n\
ands r0, r1\n\
cmp r0, 0x1\n\
bne _08144BA8\n\
mov r0, r8\n\
adds r0, 0x6\n\
b _08144BAC\n\
.pool\n\
_08144BA8:\n\
mov r0, r8\n\
add r0, r10\n\
_08144BAC:\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
mov r5, r10\n\
cmp r5, r8\n\
bcs _08144C18\n\
ldr r1, =gUnknown_085B6154+0xC\n\
mov r10, r1\n\
_08144BBC:\n\
ldr r3, [r4]\n\
lsls r0, r6, 3\n\
ldr r1, =gUnknown_085B62E4+0x4\n\
adds r0, r1\n\
ldr r1, [r3, 0x8]\n\
ldr r2, [r0]\n\
ands r1, r2\n\
cmp r1, 0\n\
bne _08144C02\n\
mov r0, r9\n\
adds r1, r0, 0x1\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r9, r1\n\
add r0, sp\n\
strb r5, [r0]\n\
ldr r0, [sp, 0xC]\n\
cmp r0, 0\n\
bne _08144C02\n\
ldrb r1, [r3, 0x1A]\n\
lsls r1, 28\n\
lsrs r1, 28\n\
adds r0, r3, 0\n\
adds r0, 0x1B\n\
adds r0, r1\n\
ldrb r1, [r0]\n\
lsls r0, r1, 2\n\
adds r0, r1\n\
lsls r0, 2\n\
add r0, r10\n\
ldr r0, [r0]\n\
ands r2, r0\n\
cmp r2, 0\n\
beq _08144C02\n\
str r5, [sp, 0xC]\n\
_08144C02:\n\
adds r0, r6, 0x1\n\
movs r1, 0xC\n\
bl __modsi3\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
cmp r5, r8\n\
bcc _08144BBC\n\
_08144C18:\n\
ldr r0, [r4]\n\
ldrb r1, [r0, 0x3]\n\
lsls r1, 27\n\
lsrs r1, 27\n\
adds r1, 0x1\n\
ldrb r0, [r0, 0x2]\n\
ands r1, r0\n\
cmp r1, 0\n\
beq _08144C48\n\
ldr r1, [sp, 0xC]\n\
cmp r1, 0\n\
beq _08144C48\n\
movs r0, 0xFF\n\
ldr r1, [sp, 0x10]\n\
ands r0, r1\n\
cmp r0, 0xBF\n\
bhi _08144C48\n\
mov r0, sp\n\
ldrh r0, [r0, 0xC]\n\
b _08144C54\n\
.pool\n\
_08144C48:\n\
ldr r0, [sp, 0x10]\n\
mov r1, r9\n\
bl __modsi3\n\
add r0, sp\n\
ldrb r0, [r0]\n\
_08144C54:\n\
strh r0, [r7, 0x3C]\n\
ldr r1, =sub_8144168\n\
str r1, [r7, 0x1C]\n\
add sp, 0x14\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool");
}
#endif // NONMATCHING
static const u16 gUnknown_085B7B1A[] = {
0x907,
@ -4955,7 +4397,7 @@ static void sub_81450D8(struct Sprite *sprite)
static void sub_8145218(struct Sprite *sprite)
{
s8 t[2] = {-1, 1};
if (sprite->data[1]-- >= 0)
{
sprite->pos1.x += t[gUnknown_0203AB88->var38->data[0]] * 2;

View File

@ -321,7 +321,7 @@ static void CB2_FadeAndReturnToTitleScreen(void)
if (gMain.newKeys & A_BUTTON)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
SetVBlankCallback(VBlankCB);
SetMainCallback2(CB2_ReturnToTitleScreen);
}

View File

@ -227,7 +227,7 @@ void sub_80F8AFC(void)
{
int i;
if (gIsLinkContest & 1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
for (i = 0; i < gNumLinkContestPlayers; i++)
{
@ -256,7 +256,7 @@ void sub_80F8B94(void)
struct Sprite *sprite;
gReservedSpritePaletteCount = 12;
if (gIsLinkContest & 1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
for (i = 0; i < gNumLinkContestPlayers; i++)
{
@ -339,9 +339,9 @@ void ShowContestEntryMonPic(void)
gMultiuseSpriteTemplate.paletteTag = palette->tag;
spriteId = CreateSprite(&gMultiuseSpriteTemplate, (left + 1) * 8 + 32, (top * 8) + 40, 0);
if (gIsLinkContest & 1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
if (!(gIsLinkContest & 4))
if (!(gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER))
DoMonFrontSpriteAnimation(&gSprites[spriteId], species, FALSE, 0);
}
else
@ -403,7 +403,7 @@ static void sub_80F8EE8(u8 taskId)
void ScriptGetMultiplayerId(void)
{
if ((gIsLinkContest & 1) && gNumLinkContestPlayers == 4 && !(gIsLinkContest & 2))
if ((gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) && gNumLinkContestPlayers == 4 && !(gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS))
gSpecialVar_Result = GetMultiplayerId();
else
gSpecialVar_Result = 4;
@ -414,7 +414,7 @@ void ScriptRandom(void)
u16 random;
u16 *scriptPtr;
if (gIsLinkContest & 1)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
{
gContestRngValue = 1103515245 * gContestRngValue + 24691;
random = gContestRngValue >> 16;
@ -436,7 +436,7 @@ u16 sub_80F903C(void)
u8 sub_80F905C(void)
{
if (gIsLinkContest & 2)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
{
CreateTask(sub_80F9088, 5);
return 1;
@ -473,11 +473,11 @@ static void sub_80F9088(u8 taskId)
void sub_80F90DC(void)
{
if (gIsLinkContest & 2)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
{
if (gReceivedRemoteLinkPlayers)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(8, 8);
}
}
@ -485,7 +485,7 @@ void sub_80F90DC(void)
void sub_80F910C(void)
{
if (gIsLinkContest & 2)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
{
if (gReceivedRemoteLinkPlayers)
DestroyWirelessStatusIndicatorSprite();
@ -494,7 +494,7 @@ void sub_80F910C(void)
u8 sub_80F9134(void)
{
if (gIsLinkContest & 4)
if (gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER)
return 1;
else
return 0;
@ -502,12 +502,12 @@ u8 sub_80F9134(void)
void sub_80F9154(void)
{
gIsLinkContest = 0;
gLinkContestFlags = 0;
}
u8 sub_80F9160(void)
{
if (gIsLinkContest & 2)
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
return 1;
else
return 0;

View File

@ -1154,7 +1154,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId)
static void ExitBuyMenu(u8 taskId)
{
gFieldCallback = MapPostLoadHook_ReturnToShopMenu;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_ExitBuyMenu;
}

View File

@ -658,7 +658,7 @@ static void Task_FadeToSlotMachine(u8 taskId)
switch (gTasks[taskId].tState)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tState++;
break;
case 1:
@ -718,7 +718,7 @@ static void CB2_SlotMachineSetup(void)
gMain.state++;
break;
case 7:
BeginNormalPaletteFade(-1, 0, 0x10, 0, 0);
BeginNormalPaletteFade(-1, 0, 0x10, 0, RGB_BLACK);
ShowBg(0);
ShowBg(1);
ShowBg(2);

View File

@ -45,6 +45,7 @@
#include "constants/songs.h"
#include "rom_8011DC0.h"
#include "union_room.h"
#include "constants/rgb.h"
// Menu actions
enum
@ -1237,7 +1238,7 @@ static void sub_80A0550(u8 taskId)
DrawTextBorderOuter(0, 8, 14);
PutWindowTilemap(0);
CopyWindowToVram(0, 3);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
if (gWirelessCommType != 0 && InUnionRoom())
{
@ -1270,7 +1271,7 @@ static void sub_80A0550(u8 taskId)
}
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
*step = 4;
break;
case 4:

View File

@ -22,6 +22,7 @@
#include "window.h"
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/rgb.h"
#define STARTER_MON_COUNT 3
@ -429,7 +430,7 @@ void CB2_ChooseStarter(void)
LoadCompressedSpriteSheet(&gUnknown_085B1ED8[0]);
LoadCompressedSpriteSheet(&gUnknown_085B1EE8[0]);
LoadSpritePalettes(gUnknown_085B1EF8);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
EnableInterrupts(DISPSTAT_VBLANK);
SetVBlankCallback(VblankCB_StarterChoose);

View File

@ -162,8 +162,8 @@ const u8 gText_DexSearchTypeNone[] = _("NONE");
const u8 gText_SelectorArrow[] = _("");
const u8 gUnknown_085E8B3C[] = _(" ");
const u8 gText_WelcomeToHOF[] = _("Welcome to the HALL OF FAME!");
const u8 gUnknown_085E8B5B[] = _("Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH's POKéDEX rating!\pPROF. BIRCH: Let's see…\p");
const u8 gUnknown_085E8BBA[] = _("SAVING…\nDON'T TURN OFF THE POWER.");
const u8 gText_HOFDexRating[] = _("Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH's POKéDEX rating!\pPROF. BIRCH: Let's see…\p");
const u8 gText_HOFDexSaving[] = _("SAVING…\nDON'T TURN OFF THE POWER.");
const u8 gText_HOFCorrupted[] = _("The HALL OF FAME data is corrupted.");
const u8 gText_HOFNumber[] = _("HALL OF FAME No. {STR_VAR_1}");
const u8 gText_LeagueChamp[] = _("LEAGUE CHAMPION!\nCONGRATULATIONS!");

View File

@ -575,7 +575,7 @@ void CB2_InitTitleScreen(void)
break;
}
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 1, 0x10, 0, 0xFFFF);
BeginNormalPaletteFade(0xFFFFFFFF, 1, 0x10, 0, RGB_WHITEALPHA);
SetVBlankCallback(VBlankCB);
gMain.state = 4;
break;
@ -725,7 +725,7 @@ static void Task_TitleScreenPhase3(u8 taskId)
if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & START_BUTTON))
{
FadeOutBGM(4);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0xFFFF);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA);
SetMainCallback2(CB2_GoToMainMenu);
}
else if ((gMain.heldKeys & CLEAR_SAVE_BUTTON_COMBO) == CLEAR_SAVE_BUTTON_COMBO)
@ -736,13 +736,13 @@ static void Task_TitleScreenPhase3(u8 taskId)
&& CanResetRTC() == TRUE)
{
FadeOutBGM(4);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
SetMainCallback2(CB2_GoToResetRtcScreen);
}
else if ((gMain.heldKeys & BERRY_UPDATE_BUTTON_COMBO) == BERRY_UPDATE_BUTTON_COMBO)
{
FadeOutBGM(4);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
SetMainCallback2(CB2_GoToBerryFixScreen);
}
else
@ -759,7 +759,7 @@ static void Task_TitleScreenPhase3(u8 taskId)
UpdateLegendaryMarkingColor(gTasks[taskId].tCounter);
if ((gMPlayInfo_BGM.status & 0xFFFF) == 0)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0xFFFF);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA);
SetMainCallback2(CB2_GoToCopyrightScreen);
}
}

View File

@ -1622,7 +1622,7 @@ static void sub_80773D0(void)
if (sub_8010500())
{
gMain.state++;
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
}
@ -1816,7 +1816,7 @@ static void sub_8077B74(void)
case 5:
if (gWirelessCommType)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
gMain.state++;
@ -4242,7 +4242,7 @@ void sub_807AE50(void)
{
if (gWirelessCommType)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
SetMainCallback2(sub_807EA2C);

View File

@ -30,6 +30,7 @@
#include "constants/flags.h"
#include "constants/game_stat.h"
#include "constants/battle_frontier.h"
#include "constants/rgb.h"
enum
{
@ -381,7 +382,7 @@ static void sub_80C2760(u8 taskId)
case 7:
if (gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE)
{
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(230, 150);
}
BlendPalettes(0xFFFFFFFF, 16, sData->var_52C);

View File

@ -1404,7 +1404,7 @@ void sub_8012780(u8 taskId)
switch (sub_80170B8(&data->textState, sub_801064C(ReadAsU16(data->field_0->arr[data->field_13].unk.field_0.unk_00.playerTrainerId), data->field_0->arr[data->field_13].unk.playerName)))
{
case 0:
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
data->field_19 = 5;
sub_8010688(5, ReadAsU16(data->field_0->arr[data->field_13].unk.field_0.unk_00.playerTrainerId), data->field_0->arr[data->field_13].unk.playerName);
@ -2130,7 +2130,7 @@ u32 sub_8013B8C(struct UnkStruct_Group *arg0, s32 id)
void sub_8013BD8(struct UnkStruct_Group *data, s32 id)
{
data->field_F = id;
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
RedrawListMenu(data->listTaskId);
sub_8018404(gStringVar1, &data->field_0->arr[data->field_F]);
@ -2782,7 +2782,7 @@ void sub_8014A40(u8 taskId)
switch (mevent_message_print_and_prompt_yes_no(&data->textState, &data->field_14, 0, gStringVar4))
{
case 0:
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
data->field_0->arr[data->field_13].field_1B = 0;
RedrawListMenu(data->listTaskId);
@ -2985,7 +2985,7 @@ void sub_8014F48(u8 taskId)
if (data->field_0->arr[id].field_1A_0 == 1 && !data->field_0->arr[id].unk.field_0.unk_0a_7)
{
data->field_F = id;
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
RedrawListMenu(data->listTaskId);
sub_8018404(gStringVar1, &data->field_0->arr[data->field_F]);
@ -3148,7 +3148,7 @@ void sub_80152F4(u8 taskId)
{
data->field_F = 0;
data->field_14 = 0;
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
sub_8011FC8(data->field_0->arr[0].unk.playerName, ReadAsU16(data->field_0->arr[0].unk.field_0.unk_00.playerTrainerId));
PlaySE(SE_PN_ON);
@ -3905,7 +3905,7 @@ void sub_80156E0(u8 taskId)
}
break;
case 53:
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
BeginNormalPaletteFade(-1, 0, 0, 0x10, RGB_BLACK);
data->state = 54;
break;
case 54:

View File

@ -610,7 +610,7 @@ static void c2_081284E0(void)
SetMainCallback2(sub_801DF38);
gUnknown_02022C84->unkE = CreateTask(sub_801DF54, 8);
gUnknown_02022C84->unkF = CreateTask(sub_801F2B4, 7);
sub_800E0E8();
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(232, 150);
}
break;

View File

@ -8,6 +8,7 @@
#include "trig.h"
#include "bg.h"
#include "gpu_regs.h"
#include "constants/rgb.h"
typedef bool8 (*TransitionStateFunc)(struct Task *task);
@ -361,7 +362,7 @@ static bool8 sub_81DAB4C(struct Task *task)
{
if (task->data[3] == 31)
{
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK);
task->tState++;
}
else

View File

@ -18,6 +18,7 @@
#include "trig.h"
#include "wallclock.h"
#include "window.h"
#include "constants/rgb.h"
#include "constants/songs.h"
// static declarations
@ -671,7 +672,7 @@ static void LoadWallClockGraphics(void)
static void WallClockInit(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
EnableInterrupts(INTR_FLAG_VBLANK);
SetVBlankCallback(WallClockVblankCallback);
SetMainCallback2(WallClockMainCallback);
@ -864,7 +865,7 @@ static void Task_SetClock4(u8 taskId)
static void Task_SetClock5(u8 taskId)
{
RtcInitLocalTimeOffset(gTasks[taskId].tHours, gTasks[taskId].tMinutes);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_SetClock6;
}
@ -896,7 +897,7 @@ static void Task_ViewClock2(u8 taskId)
static void Task_ViewClock3(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_ViewClock4;
}

View File

@ -1405,479 +1405,71 @@ void sub_8107CC4(u8 taskId)
}
}
#ifdef NONMATCHING
void sub_8107D58(u8 taskId)
{
s16 i;
struct ScanlineEffectParams params;
struct Task *task = &gTasks[taskId];
// u16 *scanlineBuffer;
switch (task->data[0])
{
case 0:
for (i = 0; i < task->data[4]; i++)
{
/* scanlineBuffer = &gScanlineEffectRegBuffers[0][i];
*(u16 *)(&gScanlineEffect) = task->data[2];
*scanlineBuffer = task->data[2] & -1; */
gScanlineEffectRegBuffers[1][i] = task->data[2];
gScanlineEffectRegBuffers[0][i] = (u16)((int)(task->data[2] & 0xFFFF));
}
for (i = task->data[4]; i < task->data[5]; i++)
{
gScanlineEffectRegBuffers[1][i] = task->data[1];
gScanlineEffectRegBuffers[0][i] = (u16)((int)(task->data[1] & 0xFFFF));
}
for (i = task->data[5]; i < 160; i++)
{
gScanlineEffectRegBuffers[1][i] = task->data[2];
gScanlineEffectRegBuffers[0][i] = (u16)((int)(task->data[2] & 0xFFFF));
}
if (task->data[4] == 0)
{
gScanlineEffectRegBuffers[1][i] = task->data[1];
gScanlineEffectRegBuffers[0][i] = task->data[1];
}
else
{
gScanlineEffectRegBuffers[1][i] = task->data[2];
gScanlineEffectRegBuffers[0][i] = task->data[2];
}
params.dmaDest = (vu16 *)REG_ADDR_BLDALPHA;
params.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT;
params.initState = 1;
params.unused9 = 0;
ScanlineEffect_SetParams(params);
task->data[0]++;
break;
case 1:
if (task->data[3] == 0)
{
if (--task->data[4] <= 0)
{
task->data[4] = 0;
task->data[0]++;
}
}
else if (++task->data[5] > 111)
case 0:
for (i = 0; i < task->data[4]; i++)
gScanlineEffectRegBuffers[0][i] = gScanlineEffectRegBuffers[1][i] = task->data[2];
for (i = task->data[4]; i < task->data[5]; i++)
gScanlineEffectRegBuffers[0][i] = gScanlineEffectRegBuffers[1][i] = task->data[1];
for (i = task->data[5]; i < 160; i++)
gScanlineEffectRegBuffers[0][i] = gScanlineEffectRegBuffers[1][i] = task->data[2];
if (task->data[4] == 0)
gScanlineEffectRegBuffers[0][i] = gScanlineEffectRegBuffers[1][i] = task->data[1];
else
gScanlineEffectRegBuffers[0][i] = gScanlineEffectRegBuffers[1][i] = task->data[2];
params.dmaDest = (vu16 *)REG_ADDR_BLDALPHA;
params.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT;
params.initState = 1;
params.unused9 = 0;
ScanlineEffect_SetParams(params);
task->data[0]++;
break;
case 1:
if (task->data[3] == 0)
{
if (--task->data[4] <= 0)
{
task->data[4] = 0;
task->data[0]++;
}
for (i = 0; i < task->data[4]; i++)
{
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
}
for (i = task->data[4]; i < task->data[5]; i++)
{
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[1];
}
for (i = task->data[5]; i < 160; i++)
{
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
}
break;
case 2:
for (i = 0; i < task->data[4]; i++)
{
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
}
for (i = task->data[4]; i < task->data[5]; i++)
{
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[1];
}
for (i = task->data[5]; i < 160; i++)
{
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
}
if (task->data[15] == -1)
{
ScanlineEffect_Stop();
DestroyTask(taskId);
}
break;
}
else if (++task->data[5] > 111)
{
task->data[0]++;
}
for (i = 0; i < task->data[4]; i++)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
for (i = task->data[4]; i < task->data[5]; i++)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[1];
for (i = task->data[5]; i < 160; i++)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
break;
case 2:
for (i = 0; i < task->data[4]; i++)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
for (i = task->data[4]; i < task->data[5]; i++)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[1];
for (i = task->data[5]; i < 160; i++)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2];
if (task->data[15] == -1)
{
ScanlineEffect_Stop();
DestroyTask(taskId);
}
break;
}
}
#else
NAKED
void sub_8107D58(u8 taskId)
{
asm_unified("push {r4-r7,lr}\n\
sub sp, 0xC\n\
lsls r0, 24\n\
lsrs r7, r0, 24\n\
lsls r0, r7, 2\n\
adds r0, r7\n\
lsls r0, 3\n\
ldr r1, =gTasks\n\
adds r4, r0, r1\n\
movs r1, 0x8\n\
ldrsh r0, [r4, r1]\n\
cmp r0, 0x1\n\
bne _08107D74\n\
b _08107EAC\n\
_08107D74:\n\
cmp r0, 0x1\n\
bgt _08107D84\n\
cmp r0, 0\n\
beq _08107D8C\n\
b _08108022\n\
.pool\n\
_08107D84:\n\
cmp r0, 0x2\n\
bne _08107D8A\n\
b _08107F78\n\
_08107D8A:\n\
b _08108022\n\
_08107D8C:\n\
movs r3, 0\n\
movs r2, 0x10\n\
ldrsh r0, [r4, r2]\n\
ldr r1, =gScanlineEffectRegBuffers\n\
mov r12, r1\n\
cmp r3, r0\n\
bge _08107DCA\n\
mov r7, r12\n\
movs r5, 0xF0\n\
lsls r5, 3\n\
add r5, r12\n\
ldr r6, =0x0000ffff\n\
_08107DA4:\n\
lsls r2, r3, 16\n\
asrs r2, 16\n\
lsls r1, r2, 1\n\
adds r3, r1, r7\n\
adds r1, r5\n\
ldrh r0, [r4, 0xC]\n\
strh r0, [r1]\n\
ldrh r1, [r4, 0xC]\n\
adds r0, r6, 0\n\
ands r0, r1\n\
strh r0, [r3]\n\
adds r2, 0x1\n\
lsls r2, 16\n\
lsrs r3, r2, 16\n\
asrs r2, 16\n\
movs r1, 0x10\n\
ldrsh r0, [r4, r1]\n\
cmp r2, r0\n\
blt _08107DA4\n\
_08107DCA:\n\
ldrh r3, [r4, 0x10]\n\
lsls r2, r3, 16\n\
asrs r1, r2, 16\n\
movs r3, 0x12\n\
ldrsh r0, [r4, r3]\n\
cmp r1, r0\n\
bge _08107E04\n\
ldr r5, =gScanlineEffectRegBuffers\n\
movs r0, 0xF0\n\
lsls r0, 3\n\
adds r6, r5, r0\n\
ldr r7, =0x0000ffff\n\
_08107DE2:\n\
asrs r2, 16\n\
lsls r1, r2, 1\n\
adds r3, r1, r5\n\
adds r1, r6\n\
ldrh r0, [r4, 0xA]\n\
strh r0, [r1]\n\
ldrh r1, [r4, 0xA]\n\
adds r0, r7, 0\n\
ands r0, r1\n\
strh r0, [r3]\n\
adds r2, 0x1\n\
lsls r2, 16\n\
asrs r1, r2, 16\n\
movs r3, 0x12\n\
ldrsh r0, [r4, r3]\n\
cmp r1, r0\n\
blt _08107DE2\n\
_08107E04:\n\
ldrh r3, [r4, 0x12]\n\
lsls r2, r3, 16\n\
asrs r0, r2, 16\n\
cmp r0, 0x9F\n\
bgt _08107E3A\n\
ldr r5, =gScanlineEffectRegBuffers\n\
movs r0, 0xF0\n\
lsls r0, 3\n\
adds r6, r5, r0\n\
ldr r7, =0x0000ffff\n\
_08107E18:\n\
asrs r2, 16\n\
lsls r1, r2, 1\n\
adds r3, r1, r5\n\
adds r1, r6\n\
ldrh r0, [r4, 0xC]\n\
strh r0, [r1]\n\
ldrh r1, [r4, 0xC]\n\
adds r0, r7, 0\n\
ands r0, r1\n\
strh r0, [r3]\n\
adds r2, 0x1\n\
lsls r2, 16\n\
lsrs r3, r2, 16\n\
lsls r2, r3, 16\n\
asrs r0, r2, 16\n\
cmp r0, 0x9F\n\
ble _08107E18\n\
_08107E3A:\n\
movs r1, 0x10\n\
ldrsh r0, [r4, r1]\n\
cmp r0, 0\n\
bne _08107E64\n\
lsls r0, r3, 16\n\
asrs r0, 15\n\
mov r3, r12\n\
adds r2, r0, r3\n\
movs r1, 0xF0\n\
lsls r1, 3\n\
add r1, r12\n\
adds r0, r1\n\
ldrh r1, [r4, 0xA]\n\
strh r1, [r0]\n\
ldrh r0, [r4, 0xA]\n\
b _08107E7A\n\
.pool\n\
_08107E64:\n\
lsls r0, r3, 16\n\
asrs r0, 15\n\
mov r1, r12\n\
adds r2, r0, r1\n\
movs r1, 0xF0\n\
lsls r1, 3\n\
add r1, r12\n\
adds r0, r1\n\
ldrh r1, [r4, 0xC]\n\
strh r1, [r0]\n\
ldrh r0, [r4, 0xC]\n\
_08107E7A:\n\
strh r0, [r2]\n\
ldr r0, =0x04000052\n\
str r0, [sp]\n\
ldr r0, =0xa2600001\n\
str r0, [sp, 0x4]\n\
mov r1, sp\n\
movs r2, 0\n\
movs r0, 0x1\n\
strb r0, [r1, 0x8]\n\
mov r0, sp\n\
strb r2, [r0, 0x9]\n\
ldr r0, [sp]\n\
ldr r1, [sp, 0x4]\n\
ldr r2, [sp, 0x8]\n\
bl ScanlineEffect_SetParams\n\
ldrh r0, [r4, 0x8]\n\
adds r0, 0x1\n\
strh r0, [r4, 0x8]\n\
b _08108022\n\
.pool\n\
_08107EAC:\n\
movs r2, 0xE\n\
ldrsh r1, [r4, r2]\n\
cmp r1, 0\n\
bne _08107EC4\n\
ldrh r0, [r4, 0x10]\n\
subs r0, 0x1\n\
strh r0, [r4, 0x10]\n\
lsls r0, 16\n\
cmp r0, 0\n\
bgt _08107ED8\n\
strh r1, [r4, 0x10]\n\
b _08107ED2\n\
_08107EC4:\n\
ldrh r0, [r4, 0x12]\n\
adds r0, 0x1\n\
strh r0, [r4, 0x12]\n\
lsls r0, 16\n\
asrs r0, 16\n\
cmp r0, 0x6F\n\
ble _08107ED8\n\
_08107ED2:\n\
ldrh r0, [r4, 0x8]\n\
adds r0, 0x1\n\
strh r0, [r4, 0x8]\n\
_08107ED8:\n\
movs r3, 0\n\
movs r1, 0x10\n\
ldrsh r0, [r4, r1]\n\
cmp r3, r0\n\
bge _08107F0C\n\
ldr r6, =gScanlineEffectRegBuffers\n\
ldr r5, =gScanlineEffect\n\
_08107EE6:\n\
lsls r1, r3, 16\n\
asrs r1, 16\n\
lsls r3, r1, 1\n\
ldrb r2, [r5, 0x14]\n\
lsls r0, r2, 4\n\
subs r0, r2\n\
lsls r0, 7\n\
adds r3, r0\n\
adds r3, r6\n\
ldrh r0, [r4, 0xC]\n\
strh r0, [r3]\n\
adds r1, 0x1\n\
lsls r1, 16\n\
lsrs r3, r1, 16\n\
asrs r1, 16\n\
movs r2, 0x10\n\
ldrsh r0, [r4, r2]\n\
cmp r1, r0\n\
blt _08107EE6\n\
_08107F0C:\n\
ldrh r3, [r4, 0x10]\n\
lsls r2, r3, 16\n\
asrs r1, r2, 16\n\
movs r3, 0x12\n\
ldrsh r0, [r4, r3]\n\
cmp r1, r0\n\
bge _08107F40\n\
ldr r6, =gScanlineEffectRegBuffers\n\
ldr r5, =gScanlineEffect\n\
_08107F1E:\n\
asrs r3, r2, 16\n\
lsls r2, r3, 1\n\
ldrb r1, [r5, 0x14]\n\
lsls r0, r1, 4\n\
subs r0, r1\n\
lsls r0, 7\n\
adds r2, r0\n\
adds r2, r6\n\
ldrh r0, [r4, 0xA]\n\
strh r0, [r2]\n\
adds r3, 0x1\n\
lsls r2, r3, 16\n\
asrs r1, r2, 16\n\
movs r3, 0x12\n\
ldrsh r0, [r4, r3]\n\
cmp r1, r0\n\
blt _08107F1E\n\
_08107F40:\n\
ldrh r3, [r4, 0x12]\n\
lsls r1, r3, 16\n\
asrs r0, r1, 16\n\
cmp r0, 0x9F\n\
bgt _08108022\n\
ldr r6, =gScanlineEffectRegBuffers\n\
ldr r5, =gScanlineEffect\n\
_08107F4E:\n\
asrs r3, r1, 16\n\
lsls r2, r3, 1\n\
ldrb r1, [r5, 0x14]\n\
lsls r0, r1, 4\n\
subs r0, r1\n\
lsls r0, 7\n\
adds r2, r0\n\
adds r2, r6\n\
ldrh r0, [r4, 0xC]\n\
strh r0, [r2]\n\
adds r3, 0x1\n\
lsls r1, r3, 16\n\
asrs r0, r1, 16\n\
cmp r0, 0x9F\n\
ble _08107F4E\n\
b _08108022\n\
.pool\n\
_08107F78:\n\
movs r3, 0\n\
movs r1, 0x10\n\
ldrsh r0, [r4, r1]\n\
cmp r3, r0\n\
bge _08107FAC\n\
ldr r6, =gScanlineEffectRegBuffers\n\
ldr r5, =gScanlineEffect\n\
_08107F86:\n\
lsls r1, r3, 16\n\
asrs r1, 16\n\
lsls r3, r1, 1\n\
ldrb r2, [r5, 0x14]\n\
lsls r0, r2, 4\n\
subs r0, r2\n\
lsls r0, 7\n\
adds r3, r0\n\
adds r3, r6\n\
ldrh r0, [r4, 0xC]\n\
strh r0, [r3]\n\
adds r1, 0x1\n\
lsls r1, 16\n\
lsrs r3, r1, 16\n\
asrs r1, 16\n\
movs r2, 0x10\n\
ldrsh r0, [r4, r2]\n\
cmp r1, r0\n\
blt _08107F86\n\
_08107FAC:\n\
ldrh r3, [r4, 0x10]\n\
lsls r2, r3, 16\n\
asrs r1, r2, 16\n\
movs r3, 0x12\n\
ldrsh r0, [r4, r3]\n\
cmp r1, r0\n\
bge _08107FE0\n\
ldr r6, =gScanlineEffectRegBuffers\n\
ldr r5, =gScanlineEffect\n\
_08107FBE:\n\
asrs r3, r2, 16\n\
lsls r2, r3, 1\n\
ldrb r1, [r5, 0x14]\n\
lsls r0, r1, 4\n\
subs r0, r1\n\
lsls r0, 7\n\
adds r2, r0\n\
adds r2, r6\n\
ldrh r0, [r4, 0xA]\n\
strh r0, [r2]\n\
adds r3, 0x1\n\
lsls r2, r3, 16\n\
asrs r1, r2, 16\n\
movs r3, 0x12\n\
ldrsh r0, [r4, r3]\n\
cmp r1, r0\n\
blt _08107FBE\n\
_08107FE0:\n\
ldrh r3, [r4, 0x12]\n\
lsls r1, r3, 16\n\
asrs r0, r1, 16\n\
cmp r0, 0x9F\n\
bgt _0810800C\n\
ldr r6, =gScanlineEffectRegBuffers\n\
ldr r5, =gScanlineEffect\n\
_08107FEE:\n\
asrs r3, r1, 16\n\
lsls r2, r3, 1\n\
ldrb r1, [r5, 0x14]\n\
lsls r0, r1, 4\n\
subs r0, r1\n\
lsls r0, 7\n\
adds r2, r0\n\
adds r2, r6\n\
ldrh r0, [r4, 0xC]\n\
strh r0, [r2]\n\
adds r3, 0x1\n\
lsls r1, r3, 16\n\
asrs r0, r1, 16\n\
cmp r0, 0x9F\n\
ble _08107FEE\n\
_0810800C:\n\
movs r0, 0x26\n\
ldrsh r1, [r4, r0]\n\
movs r0, 0x1\n\
negs r0, r0\n\
cmp r1, r0\n\
bne _08108022\n\
bl ScanlineEffect_Stop\n\
adds r0, r7, 0\n\
bl DestroyTask\n\
_08108022:\n\
add sp, 0xC\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n");
}
#endif
void sub_8108034(struct Sprite *sprite)
{
@ -1925,82 +1517,82 @@ void sub_8108140(u8 taskId)
switch (task->data[0])
{
case 0:
sub_80A805C(task, task->data[15], 0x100, 0x100, 224, 0x200, 32);
case 0:
sub_80A805C(task, task->data[15], 0x100, 0x100, 224, 0x200, 32);
task->data[0]++;
case 1:
if (++task->data[3] > 1)
{
task->data[3] = 0;
if (++task->data[4] & 1)
{
gSprites[task->data[15]].pos2.x = 3;
gSprites[task->data[15]].pos1.y++;
}
else
{
gSprites[task->data[15]].pos2.x = -3;
}
}
if (sub_80A80C8(task) == 0)
{
SetBattlerSpriteYOffsetFromYScale(task->data[15]);
gSprites[task->data[15]].pos2.x = 0;
task->data[3] = 0;
task->data[4] = 0;
task->data[0]++;
case 1:
if (++task->data[3] > 1)
{
task->data[3] = 0;
if (++task->data[4] & 1)
{
gSprites[task->data[15]].pos2.x = 3;
gSprites[task->data[15]].pos1.y++;
}
else
{
gSprites[task->data[15]].pos2.x = -3;
}
}
if (sub_80A80C8(task) == 0)
{
SetBattlerSpriteYOffsetFromYScale(task->data[15]);
gSprites[task->data[15]].pos2.x = 0;
task->data[3] = 0;
task->data[4] = 0;
task->data[0]++;
}
break;
case 2:
if (++task->data[3] > 4)
{
sub_80A805C(task, task->data[15], 224, 0x200, 384, 224, 8);
task->data[3] = 0;
task->data[0]++;
}
break;
case 3:
if (sub_80A80C8(task) == 0)
{
task->data[3] = 0;
task->data[4] = 0;
task->data[0]++;
}
break;
case 4:
sub_8108408(task, taskId);
}
break;
case 2:
if (++task->data[3] > 4)
{
sub_80A805C(task, task->data[15], 224, 0x200, 384, 224, 8);
task->data[3] = 0;
task->data[0]++;
case 5:
if (++task->data[3] > 1)
}
break;
case 3:
if (sub_80A80C8(task) == 0)
{
task->data[3] = 0;
task->data[4] = 0;
task->data[0]++;
}
break;
case 4:
sub_8108408(task, taskId);
task->data[0]++;
case 5:
if (++task->data[3] > 1)
{
task->data[3] = 0;
if (++task->data[4] & 1)
gSprites[task->data[15]].pos2.y += 2;
else
gSprites[task->data[15]].pos2.y -= 2;
if (task->data[4] == 10)
{
sub_80A805C(task, task->data[15], 384, 224, 0x100, 0x100, 8);
task->data[3] = 0;
if (++task->data[4] & 1)
gSprites[task->data[15]].pos2.y += 2;
else
gSprites[task->data[15]].pos2.y -= 2;
if (task->data[4] == 10)
{
sub_80A805C(task, task->data[15], 384, 224, 0x100, 0x100, 8);
task->data[3] = 0;
task->data[4] = 0;
task->data[0]++;
}
}
break;
case 6:
gSprites[task->data[15]].pos1.y--;
if (sub_80A80C8(task) == 0)
{
ResetSpriteRotScale(task->data[15]);
gSprites[task->data[15]].pos1.y = task->data[5];
task->data[4] = 0;
task->data[0]++;
}
break;
case 7:
if (task->data[2] == 0)
DestroyAnimVisualTask(taskId);
break;
}
break;
case 6:
gSprites[task->data[15]].pos1.y--;
if (sub_80A80C8(task) == 0)
{
ResetSpriteRotScale(task->data[15]);
gSprites[task->data[15]].pos1.y = task->data[5];
task->data[4] = 0;
task->data[0]++;
}
break;
case 7:
if (task->data[2] == 0)
DestroyAnimVisualTask(taskId);
break;
}
}
@ -2073,21 +1665,21 @@ void sub_810851C(struct Sprite *sprite)
{
switch (sprite->data[0])
{
case 0:
sprite->data[4] += (sprite->data[1] % 6) * 3;
sprite->data[5] += (sprite->data[1] % 3) * 3;
sprite->data[0]++;
case 1:
sprite->data[2] += sprite->data[4];
sprite->data[3] += sprite->data[5];
sprite->pos1.x = sprite->data[2] >> 4;
sprite->pos1.y = sprite->data[3] >> 4;
if (sprite->pos1.x < -8 || sprite->pos1.x > 248 || sprite->pos1.y < -8 || sprite->pos1.y > 120)
{
gTasks[sprite->data[6]].data[sprite->data[7]]--;
DestroySprite(sprite);
}
break;
case 0:
sprite->data[4] += (sprite->data[1] % 6) * 3;
sprite->data[5] += (sprite->data[1] % 3) * 3;
sprite->data[0]++;
case 1:
sprite->data[2] += sprite->data[4];
sprite->data[3] += sprite->data[5];
sprite->pos1.x = sprite->data[2] >> 4;
sprite->pos1.y = sprite->data[3] >> 4;
if (sprite->pos1.x < -8 || sprite->pos1.x > 248 || sprite->pos1.y < -8 || sprite->pos1.y > 120)
{
gTasks[sprite->data[6]].data[sprite->data[7]]--;
DestroySprite(sprite);
}
break;
}
}
@ -2119,39 +1711,39 @@ void sub_810862C(u8 taskId)
switch (task->data[0])
{
case 0:
if (++task->data[2] > 2)
case 0:
if (++task->data[2] > 2)
{
task->data[2] = 0;
sub_810871C(task, taskId);
}
if (task->data[10] != 0 && task->data[13] == 0)
{
gBattleAnimArgs[0] = 1;
gBattleAnimArgs[1] = 0;
gBattleAnimArgs[2] = 12;
taskId2 = CreateTask(sub_81152DC, 80);
if (taskId2 != 0xFF)
{
task->data[2] = 0;
sub_810871C(task, taskId);
gTasks[taskId2].func(taskId2);
gAnimVisualTaskCount++;
}
if (task->data[10] != 0 && task->data[13] == 0)
gBattleAnimArgs[0] = 3;
taskId2 = CreateTask(sub_81152DC, 80);
if (taskId2 != 0xFF)
{
gBattleAnimArgs[0] = 1;
gBattleAnimArgs[1] = 0;
gBattleAnimArgs[2] = 12;
taskId2 = CreateTask(sub_81152DC, 80);
if (taskId2 != 0xFF)
{
gTasks[taskId2].func(taskId2);
gAnimVisualTaskCount++;
}
gBattleAnimArgs[0] = 3;
taskId2 = CreateTask(sub_81152DC, 80);
if (taskId2 != 0xFF)
{
gTasks[taskId2].func(taskId2);
gAnimVisualTaskCount++;
}
task->data[13] = 1;
gTasks[taskId2].func(taskId2);
gAnimVisualTaskCount++;
}
if (task->data[11] >= task->data[12])
task->data[0]++;
break;
case 1:
if (task->data[9] == 0)
DestroyAnimVisualTask(taskId);
break;
task->data[13] = 1;
}
if (task->data[11] >= task->data[12])
task->data[0]++;
break;
case 1:
if (task->data[9] == 0)
DestroyAnimVisualTask(taskId);
break;
}
}
@ -2232,66 +1824,66 @@ void sub_8108978(u8 taskId)
switch (task->data[0])
{
case 0:
sub_8108AC0(task);
if (task->data[10] != 0)
task->data[0]++;
break;
case 1:
sub_8108AC0(task);
if (++task->data[1] > 16)
case 0:
sub_8108AC0(task);
if (task->data[10] != 0)
task->data[0]++;
break;
case 1:
sub_8108AC0(task);
if (++task->data[1] > 16)
{
task->data[1] = 0;
task->data[0]++;
}
break;
case 2:
sub_8108AC0(task);
task->data[5] += task->data[7] * 6;
if (!(task->data[5] >= -16 && task->data[5] <= 256))
{
if (++task->data[12] > 2)
{
task->data[13] = 1;
task->data[0] = 6;
task->data[1] = 0;
}
else
{
task->data[1] = 0;
task->data[0]++;
}
break;
case 2:
sub_8108AC0(task);
task->data[5] += task->data[7] * 6;
if (!(task->data[5] >= -16 && task->data[5] <= 256))
{
if (++task->data[12] > 2)
{
task->data[13] = 1;
task->data[0] = 6;
task->data[1] = 0;
}
else
{
task->data[1] = 0;
task->data[0]++;
}
}
break;
case 3:
sub_8108AC0(task);
task->data[6] -= task->data[7] * 2;
if (++task->data[1] > 7)
task->data[0]++;
break;
case 4:
sub_8108AC0(task);
task->data[5] -= task->data[7] * 6;
if (!(task->data[5] >= -16 && task->data[5] <= 256))
{
task->data[12]++;
task->data[1] = 0;
task->data[0]++;
}
break;
case 5:
sub_8108AC0(task);
task->data[6] -= task->data[7] * 2;
if (++task->data[1] > 7)
task->data[0] = 2;
break;
case 6:
if (task->data[8] == 0)
task->data[0]++;
break;
default:
DestroyAnimVisualTask(taskId);
break;
}
break;
case 3:
sub_8108AC0(task);
task->data[6] -= task->data[7] * 2;
if (++task->data[1] > 7)
task->data[0]++;
break;
case 4:
sub_8108AC0(task);
task->data[5] -= task->data[7] * 6;
if (!(task->data[5] >= -16 && task->data[5] <= 256))
{
task->data[12]++;
task->data[1] = 0;
task->data[0]++;
}
break;
case 5:
sub_8108AC0(task);
task->data[6] -= task->data[7] * 2;
if (++task->data[1] > 7)
task->data[0] = 2;
break;
case 6:
if (task->data[8] == 0)
task->data[0]++;
break;
default:
DestroyAnimVisualTask(taskId);
break;
}
}