Merge branch 'master' of https://github.com/pret/pokeemerald into synchronise
This commit is contained in:
+18
-18
@@ -1262,39 +1262,39 @@ s8 BattleAnimAdjustPanning(s8 pan)
|
||||
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gBattleAnimAttacker].statusAnimActive)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
else
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
}
|
||||
else if (IsContest())
|
||||
{
|
||||
if (gBattleAnimAttacker != gBattleAnimTarget || gBattleAnimAttacker != 2 || pan != PAN_SIDE_OPPONENT)
|
||||
if (gBattleAnimAttacker != gBattleAnimTarget || gBattleAnimAttacker != 2 || pan != SOUND_PAN_TARGET)
|
||||
pan *= -1;
|
||||
}
|
||||
else if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
if (pan == PAN_SIDE_OPPONENT)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
else if (pan != PAN_SIDE_PLAYER)
|
||||
if (pan == SOUND_PAN_TARGET)
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else if (pan != SOUND_PAN_ATTACKER)
|
||||
pan *= -1;
|
||||
}
|
||||
}
|
||||
else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT)
|
||||
{
|
||||
if (pan == PAN_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
if (pan == SOUND_PAN_ATTACKER)
|
||||
pan = SOUND_PAN_TARGET;
|
||||
}
|
||||
else
|
||||
{
|
||||
pan *= -1;
|
||||
}
|
||||
|
||||
if (pan > PAN_SIDE_OPPONENT)
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
else if (pan < PAN_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
if (pan > SOUND_PAN_TARGET)
|
||||
pan = SOUND_PAN_TARGET;
|
||||
else if (pan < SOUND_PAN_ATTACKER)
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
|
||||
return pan;
|
||||
}
|
||||
@@ -1304,9 +1304,9 @@ s8 BattleAnimAdjustPanning2(s8 pan)
|
||||
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gBattleAnimAttacker].statusAnimActive)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
else
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1320,10 +1320,10 @@ s16 KeepPanInRange(s16 panArg)
|
||||
{
|
||||
s16 pan = panArg;
|
||||
|
||||
if (pan > PAN_SIDE_OPPONENT)
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
else if (pan < PAN_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
if (pan > SOUND_PAN_TARGET)
|
||||
pan = SOUND_PAN_TARGET;
|
||||
else if (pan < SOUND_PAN_ATTACKER)
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
|
||||
return pan;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ void sub_8158B30(u8 taskId)
|
||||
gTasks[taskId].data[0] = gBattleAnimArgs[0];
|
||||
gTasks[taskId].data[1] = gBattleAnimArgs[1];
|
||||
|
||||
pan1 = BattleAnimAdjustPanning(PAN_SIDE_PLAYER);
|
||||
pan2 = BattleAnimAdjustPanning(PAN_SIDE_OPPONENT);
|
||||
pan1 = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
|
||||
pan2 = BattleAnimAdjustPanning(SOUND_PAN_TARGET);
|
||||
panIncrement = CalculatePanIncrement(pan1, pan2, 2);
|
||||
|
||||
gTasks[taskId].data[2] = pan1;
|
||||
@@ -64,7 +64,7 @@ static void sub_8158C04(u8 taskId)
|
||||
s8 pan;
|
||||
|
||||
gTasks[taskId].data[10] = 0;
|
||||
pan = BattleAnimAdjustPanning(PAN_SIDE_OPPONENT);
|
||||
pan = BattleAnimAdjustPanning(SOUND_PAN_TARGET);
|
||||
PlaySE12WithPanning(gTasks[taskId].data[1], pan);
|
||||
if (++gTasks[taskId].data[11] == 2)
|
||||
DestroyAnimSoundTask(taskId);
|
||||
@@ -127,7 +127,7 @@ static void sub_8158D08(u8 taskId)
|
||||
void sub_8158D8C(u8 taskId)
|
||||
{
|
||||
u16 species = 0;
|
||||
s8 pan = BattleAnimAdjustPanning(PAN_SIDE_PLAYER);
|
||||
s8 pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
|
||||
if (IsContest())
|
||||
{
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
@@ -173,7 +173,7 @@ void sub_8158D8C(u8 taskId)
|
||||
void sub_8158E9C(u8 taskId)
|
||||
{
|
||||
u16 species = 0;
|
||||
s8 pan = BattleAnimAdjustPanning(PAN_SIDE_PLAYER);
|
||||
s8 pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
|
||||
if (IsContest())
|
||||
{
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
@@ -278,7 +278,7 @@ void sub_81590B8(u8 taskId)
|
||||
s8 pan;
|
||||
|
||||
gTasks[taskId].data[10] = gBattleAnimArgs[0];
|
||||
pan = BattleAnimAdjustPanning(PAN_SIDE_PLAYER);
|
||||
pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
|
||||
|
||||
if (IsContest())
|
||||
species = gContestResources->field_18->unk0;
|
||||
|
||||
@@ -1364,7 +1364,7 @@ static void LinkOpponentHandleFaintAnimation(void)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_OPPONENT);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_TARGET);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8064C14;
|
||||
}
|
||||
@@ -1660,9 +1660,9 @@ static void LinkOpponentHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
|
||||
@@ -1187,7 +1187,7 @@ static void LinkPartnerHandleFaintAnimation(void)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_ATTACKER);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00;
|
||||
@@ -1485,9 +1485,9 @@ static void LinkPartnerHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
LinkPartnerBufferExecCompleted();
|
||||
|
||||
@@ -1402,7 +1402,7 @@ static void OpponentHandleFaintAnimation(void)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_OPPONENT);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_TARGET);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_805FAC4;
|
||||
}
|
||||
@@ -1810,9 +1810,9 @@ static void OpponentHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
OpponentBufferExecCompleted();
|
||||
|
||||
@@ -2407,7 +2407,7 @@ static void PlayerHandleFaintAnimation(void)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_ATTACKER);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00;
|
||||
@@ -2710,7 +2710,7 @@ static void PlayerHandleExpUpdate(void)
|
||||
{
|
||||
u8 monId = gBattleBufferA[gActiveBattler][1];
|
||||
|
||||
if (GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL) >= MAX_MON_LEVEL)
|
||||
if (GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL) >= MAX_LEVEL)
|
||||
{
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
@@ -2882,9 +2882,9 @@ static void PlayerHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
PlayerBufferExecCompleted();
|
||||
|
||||
@@ -1382,7 +1382,7 @@ static void PlayerPartnerHandleFaintAnimation(void)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_ATTACKER);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00;
|
||||
@@ -1597,7 +1597,7 @@ static void PlayerPartnerHandleExpUpdate(void)
|
||||
{
|
||||
u8 monId = gBattleBufferA[gActiveBattler][1];
|
||||
|
||||
if (GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL) >= MAX_MON_LEVEL)
|
||||
if (GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL) >= MAX_LEVEL)
|
||||
{
|
||||
PlayerPartnerBufferExecCompleted();
|
||||
}
|
||||
@@ -1739,9 +1739,9 @@ static void PlayerPartnerHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
PlayerPartnerBufferExecCompleted();
|
||||
|
||||
@@ -1295,7 +1295,7 @@ static void RecordedOpponentHandleFaintAnimation(void)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_OPPONENT);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_TARGET);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8186D58;
|
||||
}
|
||||
@@ -1603,9 +1603,9 @@ static void RecordedOpponentHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
RecordedOpponentBufferExecCompleted();
|
||||
|
||||
@@ -1624,9 +1624,9 @@ static void RecordedPlayerHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
|
||||
@@ -594,9 +594,9 @@ static void SafariHandlePlaySE(void)
|
||||
s8 pan;
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
else
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
||||
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
|
||||
SafariBufferExecCompleted();
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "international_string_util.h"
|
||||
#include "safari_zone.h"
|
||||
#include "battle_anim.h"
|
||||
#include "constants/battle_anim.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "data2.h"
|
||||
|
||||
@@ -1889,9 +1890,9 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite)
|
||||
|
||||
if (sprite->pos2.x == 0)
|
||||
{
|
||||
pan = PAN_SIDE_OPPONENT;
|
||||
pan = SOUND_PAN_TARGET;
|
||||
if (var1 != 0)
|
||||
pan = PAN_SIDE_PLAYER;
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
|
||||
if (sprite->data[7] != 0)
|
||||
PlaySE2WithPanning(SE_TB_KARA, pan);
|
||||
@@ -2341,7 +2342,7 @@ static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar)
|
||||
&gBattleSpritesDataPtr->battleBars[battlerId].currValue,
|
||||
array, B_EXPBAR_PIXELS / 8);
|
||||
level = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_LEVEL);
|
||||
if (level == MAX_MON_LEVEL)
|
||||
if (level == MAX_LEVEL)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
array[i] = 0;
|
||||
|
||||
@@ -3347,7 +3347,7 @@ static void atk23_getexp(void)
|
||||
gBattleScripting.atk23_state = 5;
|
||||
gBattleMoveDamage = 0; // used for exp
|
||||
}
|
||||
else if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) == MAX_MON_LEVEL)
|
||||
else if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) == MAX_LEVEL)
|
||||
{
|
||||
*(&gBattleStruct->sentInPokes) >>= 1;
|
||||
gBattleScripting.atk23_state = 5;
|
||||
@@ -3382,17 +3382,17 @@ static void atk23_getexp(void)
|
||||
// check if the pokemon doesn't belong to the player
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gBattleStruct->expGetterMonId >= 3)
|
||||
{
|
||||
i = 0x149;
|
||||
i = STRINGID_EMPTYSTRING4;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
|
||||
i = 0x14A;
|
||||
i = STRINGID_ABOOSTED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i = 0x149;
|
||||
i = STRINGID_EMPTYSTRING4;
|
||||
}
|
||||
|
||||
// get exp getter battlerId
|
||||
@@ -3430,7 +3430,7 @@ static void atk23_getexp(void)
|
||||
if (gBattleControllerExecFlags == 0)
|
||||
{
|
||||
gBattleBufferB[gBattleStruct->expGetterBattlerId][0] = 0;
|
||||
if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP) && GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) != MAX_MON_LEVEL)
|
||||
if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP) && GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) != MAX_LEVEL)
|
||||
{
|
||||
gBattleResources->statsBeforeLvlUp->hp = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MAX_HP);
|
||||
gBattleResources->statsBeforeLvlUp->atk = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_ATK);
|
||||
|
||||
+6
-6
@@ -56,8 +56,8 @@ extern bool8 InBattlePyramid(void);
|
||||
extern bool8 InBattlePike(void);
|
||||
extern bool32 InTrainerHill(void);
|
||||
extern bool32 FieldPoisonEffectIsRunning(void);
|
||||
extern void prev_quest_postbuffer_cursor_backup_reset(void);
|
||||
extern void ResetPoisonStepCounter(void);
|
||||
extern void RestartWildEncounterImmunitySteps(void);
|
||||
extern void ClearPoisonStepCounter(void);
|
||||
extern void sub_81BE72C(void);
|
||||
extern void sub_808BCF4(void);
|
||||
extern void sub_80EECC8(void);
|
||||
@@ -354,8 +354,8 @@ static void Task_BattleStart(u8 taskId)
|
||||
{
|
||||
overworld_free_bg_tilemaps();
|
||||
SetMainCallback2(CB2_InitBattle);
|
||||
prev_quest_postbuffer_cursor_backup_reset();
|
||||
ResetPoisonStepCounter();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
ClearPoisonStepCounter();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
break;
|
||||
@@ -921,8 +921,8 @@ static void CB2_StartFirstBattle(void)
|
||||
gMain.savedCallback = CB2_EndFirstBattle;
|
||||
FreeAllWindowBuffers();
|
||||
SetMainCallback2(CB2_InitBattle);
|
||||
prev_quest_postbuffer_cursor_backup_reset();
|
||||
ResetPoisonStepCounter();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
ClearPoisonStepCounter();
|
||||
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
|
||||
IncrementGameStat(GAME_STAT_WILD_BATTLES);
|
||||
sub_80EECC8();
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@
|
||||
extern u8 EventObjectGetBerryTreeId(u8 eventObjectId);
|
||||
extern void sub_8092EF0(u8 mapId, u8 mapNumber, u8 mapGroup);
|
||||
extern void CB2_ChooseBerry(void);
|
||||
extern const u8* GetEventObjectScriptPointerForComparison(void);
|
||||
extern const u8* GetEventObjectScriptPointerPlayerFacing(void);
|
||||
extern bool8 IsBerryTreeSparkling(u8, u8, u8);
|
||||
|
||||
extern u16 gSpecialVar_ItemId;
|
||||
@@ -943,7 +943,7 @@ bool32 EventObjectInteractionWaterBerryTree(void)
|
||||
|
||||
bool8 IsPlayerFacingPlantedBerryTree(void)
|
||||
{
|
||||
if (GetEventObjectScriptPointerForComparison() == BerryTreeScript
|
||||
if (GetEventObjectScriptPointerPlayerFacing() == BerryTreeScript
|
||||
&& GetStageByBerryTreeId(EventObjectGetBerryTreeId(gSelectedEventObject)) == 0)
|
||||
return TRUE;
|
||||
else
|
||||
@@ -952,7 +952,7 @@ bool8 IsPlayerFacingPlantedBerryTree(void)
|
||||
|
||||
bool8 TryToWaterBerryTree(void)
|
||||
{
|
||||
if (GetEventObjectScriptPointerForComparison() != BerryTreeScript)
|
||||
if (GetEventObjectScriptPointerPlayerFacing() != BerryTreeScript)
|
||||
return FALSE;
|
||||
else
|
||||
return EventObjectInteractionWaterBerryTree();
|
||||
|
||||
+2
-2
@@ -1124,7 +1124,7 @@ static void Blender_SetPlayerNamesLocal(u8 opponentsNum)
|
||||
sBerryBlenderData->playersNo = 2;
|
||||
StringCopy(gLinkPlayers[0].name, gSaveBlock2Ptr->playerName);
|
||||
|
||||
if (!FlagGet(FLAG_0x340))
|
||||
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_ONLOOKERS))
|
||||
StringCopy(gLinkPlayers[1].name, sBlenderOpponentsNames[BLENDER_MASTER]);
|
||||
else
|
||||
StringCopy(gLinkPlayers[1].name, sBlenderOpponentsNames[BLENDER_MISTER]);
|
||||
@@ -1647,7 +1647,7 @@ static void sub_80808D4(void)
|
||||
|
||||
if (gSpecialVar_0x8004 == 1)
|
||||
{
|
||||
if (!FlagGet(FLAG_0x340))
|
||||
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_ONLOOKERS))
|
||||
sBerryBlenderData->field_120[0] = CreateTask(sub_8081224, 10);
|
||||
else
|
||||
sBerryBlenderData->field_120[0] = CreateTask(sUnknown_083399EC[0], 10);
|
||||
|
||||
+3
-3
@@ -18,7 +18,7 @@ extern u8 sub_808B980(u8 direction);
|
||||
extern u8 sub_808B9BC(u8 direction);
|
||||
extern u8 sub_808B9A4(u8 direction);
|
||||
extern u8 sub_808C1B4(u8 direction);
|
||||
extern u8 npc_use_some_d2s(u8 direction);
|
||||
extern u8 sub_808B9D4(u8 direction);
|
||||
extern void Overworld_ClearSavedMusic(void);
|
||||
extern void Overworld_PlaySpecialMapMusic(void);
|
||||
|
||||
@@ -575,7 +575,7 @@ static void AcroBikeTransition_Moving(u8 direction)
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerGoSpeed3(direction);
|
||||
PlayerRideWaterCurrent(direction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,7 +768,7 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
|
||||
PlayerEndWheelie(direction);
|
||||
return;
|
||||
}
|
||||
npc_use_some_d2s(direction);
|
||||
sub_808B9D4(direction);
|
||||
}
|
||||
|
||||
void Bike_TryAcroBikeHistoryUpdate(u16 newKeys, u16 heldKeys)
|
||||
|
||||
@@ -431,9 +431,9 @@ bool8 ShouldDoBrailleRegicePuzzle(void)
|
||||
{
|
||||
if (FlagGet(FLAG_SYS_BRAILLE_WAIT) != FALSE)
|
||||
return FALSE;
|
||||
if (FlagGet(FLAG_0x002) == FALSE)
|
||||
if (FlagGet(FLAG_TEMP_2) == FALSE)
|
||||
return FALSE;
|
||||
if (FlagGet(FLAG_0x003) == TRUE)
|
||||
if (FlagGet(FLAG_TEMP_3) == TRUE)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < 36; i++)
|
||||
@@ -474,8 +474,8 @@ bool8 ShouldDoBrailleRegicePuzzle(void)
|
||||
}
|
||||
}
|
||||
|
||||
FlagSet(FLAG_0x003);
|
||||
FlagClear(FLAG_0x002);
|
||||
FlagSet(FLAG_TEMP_3);
|
||||
FlagClear(FLAG_TEMP_2);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
:(n <= 36) ? ((n + 14) * CUBE(n) / 50) \
|
||||
: (((n / 2) + 32) * CUBE(n) / 50)
|
||||
|
||||
const u32 gExperienceTables[][MAX_MON_LEVEL + 1] =
|
||||
const u32 gExperienceTables[][MAX_LEVEL + 1] =
|
||||
{
|
||||
{ // Medium Fast
|
||||
0, // 0
|
||||
|
||||
+3
-3
@@ -241,7 +241,7 @@ static void ApplyDaycareExperience(struct Pokemon *mon)
|
||||
bool8 firstMove;
|
||||
u16 learnedMove;
|
||||
|
||||
for (i = 0; i < MAX_MON_LEVEL; i++)
|
||||
for (i = 0; i < MAX_LEVEL; i++)
|
||||
{
|
||||
// Add the mon's gained daycare experience level by level until it can't level up anymore.
|
||||
if (TryIncrementMonLevel(mon))
|
||||
@@ -278,7 +278,7 @@ static u16 TakeSelectedPokemonFromDaycare(struct DaycareMon *daycareMon)
|
||||
species = GetBoxMonData(&daycareMon->mon, MON_DATA_SPECIES);
|
||||
BoxMonToMon(&daycareMon->mon, &pokemon);
|
||||
|
||||
if (GetMonData(&pokemon, MON_DATA_LEVEL) != MAX_MON_LEVEL)
|
||||
if (GetMonData(&pokemon, MON_DATA_LEVEL) != MAX_LEVEL)
|
||||
{
|
||||
experience = GetMonData(&pokemon, MON_DATA_EXP) + daycareMon->steps;
|
||||
SetMonData(&pokemon, MON_DATA_EXP, &experience);
|
||||
@@ -949,7 +949,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
|
||||
return FALSE; // no hatching
|
||||
}
|
||||
|
||||
bool8 DoEggActions_CheckHatch(void)
|
||||
bool8 ShouldEggHatch(void)
|
||||
{
|
||||
return _DoEggActions_CheckHatch(&gSaveBlock1Ptr->daycare);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "pokenav.h"
|
||||
#include "random.h"
|
||||
#include "rom_818CFC8.h"
|
||||
#include "rom_81BE66C.h"
|
||||
#include "sprite.h"
|
||||
#include "trainer_see.h"
|
||||
#include "util.h"
|
||||
@@ -2621,10 +2620,10 @@ void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat)
|
||||
switch (decorCat)
|
||||
{
|
||||
case DECORCAT_DOLL:
|
||||
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_2766A2);
|
||||
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_SecretPower1);
|
||||
break;
|
||||
case DECORCAT_CUSHION:
|
||||
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_2766A6);
|
||||
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_SecretPower2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "link.h"
|
||||
#include "util.h"
|
||||
#include "trig.h"
|
||||
#include "data2.h"
|
||||
|
||||
struct EvoInfo
|
||||
{
|
||||
@@ -48,8 +49,6 @@ extern u16 gBattle_BG2_X;
|
||||
extern u16 gBattle_BG2_Y;
|
||||
extern u16 gBattle_BG3_X;
|
||||
extern u16 gBattle_BG3_Y;
|
||||
extern bool8 gAffineAnimsDisabled;
|
||||
extern const u8 gSpeciesNames[][11];
|
||||
|
||||
#define sEvoCursorPos gBattleCommunication[1] // when learning a new move
|
||||
#define sEvoGraphicsTaskID gBattleCommunication[2]
|
||||
@@ -60,12 +59,9 @@ extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
||||
// strings
|
||||
extern const u8 gText_CommunicationStandby5[];
|
||||
|
||||
extern void sub_80356D0(void);
|
||||
extern void sub_807B154(void);
|
||||
extern void sub_807F19C(void);
|
||||
extern void sub_807B140(void);
|
||||
extern void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
|
||||
extern void Overworld_PlaySpecialMapMusic(void);
|
||||
extern void ShowSelectMovePokemonSummaryScreen(struct Pokemon *party, u8 monId, u8 partyCount, void *CB2_ptr, u16 move);
|
||||
extern u8 sub_81C1B94(void);
|
||||
extern void sub_807F1A8(u8 arg0, const u8 *arg1, u8 arg2);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1600
-128
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -112,7 +112,7 @@ void ExecuteWhiteOut(void)
|
||||
ScriptContext1_Stop();
|
||||
}
|
||||
|
||||
u32 DoPoisonFieldEffect(void)
|
||||
s32 DoPoisonFieldEffect(void)
|
||||
{
|
||||
int i;
|
||||
u32 hp;
|
||||
|
||||
@@ -1328,7 +1328,7 @@ u16 GetSlotMachineId(void)
|
||||
bool8 FoundAbandonedShipRoom1Key(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_1F;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_1_KEY;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
@@ -1340,7 +1340,7 @@ bool8 FoundAbandonedShipRoom1Key(void)
|
||||
bool8 FoundAbandonedShipRoom2Key(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_20;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_2_KEY;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
@@ -1352,7 +1352,7 @@ bool8 FoundAbandonedShipRoom2Key(void)
|
||||
bool8 FoundAbandonedShipRoom4Key(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_21;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_4_KEY;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
@@ -1364,7 +1364,7 @@ bool8 FoundAbandonedShipRoom4Key(void)
|
||||
bool8 FoundAbandonedShipRoom6Key(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_22;
|
||||
u16 flag = FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_6_KEY;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
@@ -1508,7 +1508,7 @@ static void sub_8139620(u8 taskId)
|
||||
|
||||
bool8 FoundBlackGlasses(void)
|
||||
{
|
||||
return FlagGet(FLAG_HIDDEN_ITEM_BLACK_GLASSES);
|
||||
return FlagGet(FLAG_HIDDEN_ITEM_ROUTE_116_BLACK_GLASSES);
|
||||
}
|
||||
|
||||
void SetRoute119Weather(void)
|
||||
@@ -3668,7 +3668,7 @@ bool32 sub_813B374(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_813B3B0(void)
|
||||
bool8 sub_813B3B0(void)
|
||||
{
|
||||
static const u8 gUnknown_085B3410[] = { 0x1d, 0x1d, 0x1e, 0x1e, 0x1f, 0x1f, 0x21, 0x21, 0x14, 0x14, 0x28, 0x28, 0x2a, 0x2a, 0x2c, 0x2c };
|
||||
|
||||
@@ -4081,7 +4081,7 @@ void sub_813BA60(void)
|
||||
FlagClear(FLAG_HIDE_FANCLUB_BOY);
|
||||
FlagClear(FLAG_HIDE_FANCLUB_LITTLE_BOY);
|
||||
FlagClear(FLAG_HIDE_FANCLUB_LADY);
|
||||
FlagClear(FLAG_0x2DA);
|
||||
FlagClear(FLAG_HIDE_LILYCOVE_FAN_CLUB_INTERVIEWER);
|
||||
VarSet(VAR_LILYCOVE_FAN_CLUB_STATE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
#include "global.h"
|
||||
#include "task.h"
|
||||
#include "fieldmap.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_player_avatar.h"
|
||||
|
||||
static EWRAM_DATA u8 sEscalatorAnim_TaskId = 0;
|
||||
|
||||
void sub_80E12E8(u8 taskId, const s16 *list, u16 c)
|
||||
{
|
||||
s16 r5 = gTasks[taskId].data[4] - 1;
|
||||
s16 r3 = gTasks[taskId].data[5] - 1;
|
||||
s16 r4 = gTasks[taskId].data[1];
|
||||
s16 y;
|
||||
s16 x;
|
||||
|
||||
if (gTasks[taskId].data[2] == 0)
|
||||
{
|
||||
for (y = 0; y < 3; y++)
|
||||
{
|
||||
for (x = 0; x < 3; x++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y);
|
||||
|
||||
if (list[r4] == metatileId)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, c | list[r4 + 1]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, c | list[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (y = 0; y < 3; y++)
|
||||
{
|
||||
for (x = 0; x < 3; x++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y);
|
||||
|
||||
if (list[2 - r4] == metatileId)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, c | list[1 - r4]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, c | list[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const u16 gUnknown_08589ABA[] = {0x284, 0x282, 0x280};
|
||||
static const u16 gUnknown_08589AC0[] = {0x285, 0x283, 0x281};
|
||||
static const u16 gUnknown_08589AC6[] = {0x28C, 0x28A, 0x288};
|
||||
static const u16 gUnknown_08589ACC[] = {0x28D, 0x28B, 0x289};
|
||||
static const u16 gUnknown_08589AD2[] = {0x2A0, 0x2A2, 0x2A4};
|
||||
static const u16 gUnknown_08589AD8[] = {0x2A1, 0x2A3, 0x2A5};
|
||||
static const u16 gUnknown_08589ADE[] = {0x2A8, 0x2AA, 0x2AC};
|
||||
|
||||
void sub_80E1444(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
data[3] = 1;
|
||||
|
||||
switch (data[0])
|
||||
{
|
||||
case 0:
|
||||
sub_80E12E8(taskId, gUnknown_08589ABA, 0);
|
||||
break;
|
||||
case 1:
|
||||
sub_80E12E8(taskId, gUnknown_08589AC0, 0);
|
||||
break;
|
||||
case 2:
|
||||
sub_80E12E8(taskId, gUnknown_08589AC6, 0xC00);
|
||||
break;
|
||||
case 3:
|
||||
sub_80E12E8(taskId, gUnknown_08589ACC, 0);
|
||||
break;
|
||||
case 4:
|
||||
sub_80E12E8(taskId, gUnknown_08589AD2, 0xC00);
|
||||
break;
|
||||
case 5:
|
||||
sub_80E12E8(taskId, gUnknown_08589AD8, 0);
|
||||
break;
|
||||
case 6:
|
||||
sub_80E12E8(taskId, gUnknown_08589ADE, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
data[0] = (data[0] + 1) & 7;
|
||||
if (!data[0])
|
||||
{
|
||||
DrawWholeMapView();
|
||||
data[1] = (data[1] + 1) % 3;
|
||||
data[3] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_80E150C(u16 var)
|
||||
{
|
||||
u8 taskId = CreateTask(sub_80E1444, 0);
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
PlayerGetDestCoords(&data[4], &data[5]);
|
||||
data[0] = 0;
|
||||
data[1] = 0;
|
||||
data[2] = var;
|
||||
sub_80E1444(taskId);
|
||||
return taskId;
|
||||
}
|
||||
|
||||
void sub_80E1558(u8 var)
|
||||
{
|
||||
sEscalatorAnim_TaskId = sub_80E150C(var);
|
||||
}
|
||||
|
||||
void sub_80E1570(void)
|
||||
{
|
||||
DestroyTask(sEscalatorAnim_TaskId);
|
||||
}
|
||||
|
||||
bool8 sub_80E1584(void)
|
||||
{
|
||||
if (gTasks[sEscalatorAnim_TaskId].data[3] == 0 && gTasks[sEscalatorAnim_TaskId].data[1] == 2)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
+4
-4
@@ -375,7 +375,7 @@ static const match_call_text_data_t sMayTextScripts[] = {
|
||||
{ gText_May_Pokenav_2B3AB3, 0xFFFF, 0xFFFF },
|
||||
{ gText_May_Pokenav_2B3B3F, FLAG_0x4F1, 0xFFFF },
|
||||
{ gText_May_Pokenav_2B3C13, FLAG_0x095, 0xFFFF },
|
||||
{ gText_May_Pokenav_2B3CF3, FLAG_0x324, 0xFFFF },
|
||||
{ gText_May_Pokenav_2B3CF3, FLAG_HIDE_MAUVILLE_CITY_WALLY, 0xFFFF },
|
||||
{ gText_May_Pokenav_2B3D4B, FLAG_0x06A, 0xFFFF },
|
||||
{ gText_May_Pokenav_2B3DD1, FLAG_0x4F3, 0xFFFF },
|
||||
{ gText_May_Pokenav_2B3E69, FLAG_0x4F4, 0xFFFF },
|
||||
@@ -396,7 +396,7 @@ static const match_call_text_data_t sBrendanTextScripts[] = {
|
||||
{ gText_Brendan_Pokenav_2B43EF, 0xFFFF, 0xFFFF },
|
||||
{ gText_Brendan_Pokenav_2B4486, FLAG_0x4F1, 0xFFFF },
|
||||
{ gText_Brendan_Pokenav_2B4560, FLAG_0x095, 0xFFFF },
|
||||
{ gText_Brendan_Pokenav_2B463F, FLAG_0x324, 0xFFFF },
|
||||
{ gText_Brendan_Pokenav_2B463F, FLAG_HIDE_MAUVILLE_CITY_WALLY, 0xFFFF },
|
||||
{ gText_Brendan_Pokenav_2B46B7, FLAG_0x06A, 0xFFFF },
|
||||
{ gText_Brendan_Pokenav_2B4761, FLAG_0x4F3, 0xFFFF },
|
||||
{ gText_Brendan_Pokenav_2B47F4, FLAG_0x4F4, 0xFFFF },
|
||||
@@ -425,9 +425,9 @@ static const match_call_text_data_t sWallyTextScripts[] = {
|
||||
};
|
||||
|
||||
const struct MatchCallSubstruct2 sWallyAdditionalData[] = {
|
||||
{ FLAG_0x324, 0x05 },
|
||||
{ FLAG_HIDE_MAUVILLE_CITY_WALLY, 0x05 },
|
||||
{ FLAG_0x06F, 0xD5 },
|
||||
{ FLAG_0x35A, 0x46 },
|
||||
{ FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY, 0x46 },
|
||||
{ 0xFFFF, 0xD5 }
|
||||
};
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@ bool8 MetatileBehavior_IsSecretBasePC(u8 metatileBehavior)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSecretBaseRegisterPC(u8 metatileBehavior)
|
||||
bool8 MetatileBehavior_IsRecordMixingSecretBasePC(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SECRET_BASE_REGISTER_PC)
|
||||
return TRUE;
|
||||
@@ -815,7 +815,7 @@ bool8 MetatileBehavior_IsSecretBaseSandOrnament(u8 metatileBehavior)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSecretBaseTvOrShield(u8 metatileBehavior)
|
||||
bool8 MetatileBehavior_IsSecretBaseShieldOrToyTV(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SECRET_BASE_TV_SHIELD)
|
||||
return TRUE;
|
||||
@@ -1164,7 +1164,7 @@ bool8 MetatileBehavior_IsRegionMap(u8 metatileBehavior)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsClosedSootopolisGymDoor(u8 metatileBehavior)
|
||||
bool8 MetatileBehavior_IsClosedSootopolisDoor(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_CLOSED_SOOTOPOLIS_DOOR)
|
||||
return TRUE;
|
||||
@@ -1365,7 +1365,7 @@ bool8 MetatileBehavior_IsCuttableGrass(u8 metatileBehavior)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsRunningShoesInstruction(u8 metatileBehavior)
|
||||
bool8 MetatileBehavior_IsRunningShoesManual(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_RUNNING_SHOES_INSTRUCTION)
|
||||
return TRUE;
|
||||
|
||||
+11
-11
@@ -107,7 +107,7 @@ extern void sub_80A0A2C(void);
|
||||
extern void not_trainer_hill_battle_pyramid(void);
|
||||
extern void apply_map_tileset2_palette(const struct MapLayout *);
|
||||
extern void copy_map_tileset2_to_vram_2(const struct MapLayout *);
|
||||
extern void prev_quest_postbuffer_cursor_backup_reset(void);
|
||||
extern void RestartWildEncounterImmunitySteps(void);
|
||||
extern void ShowMapNamePopup(void);
|
||||
extern bool32 InTrainerHill(void);
|
||||
extern bool32 sub_808651C(void);
|
||||
@@ -164,10 +164,10 @@ extern bool32 sub_8009F3C(void);
|
||||
extern void sub_8010198(void);
|
||||
extern u32 sub_800B4DC(void);
|
||||
extern bool32 sub_80B39D4(u8);
|
||||
extern const u8* sub_809C2C8(struct MapPosition *a1, u8, u8);
|
||||
extern u8 *sub_809D0F4(void*);
|
||||
extern u8 sub_808BD6C(u8);
|
||||
extern u8 sub_808BD7C(u8);
|
||||
extern const u8* GetInteractedLinkPlayerScript(struct MapPosition *a1, u8, u8);
|
||||
extern u8 *GetCoordEventScriptAtMapPosition(void*);
|
||||
extern u8 GetFRLGAvatarGraphicsIdByGender(u8);
|
||||
extern u8 GetRSAvatarGraphicsIdByGender(u8);
|
||||
extern void UpdateEventObjectSpriteVisibility(struct Sprite*, u8);
|
||||
|
||||
// this file's functions
|
||||
@@ -827,7 +827,7 @@ void mliX_load_map(u8 mapGroup, u8 mapNum)
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetCyclingRoadChallengeData();
|
||||
prev_quest_postbuffer_cursor_backup_reset();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
TryUpdateRandomTrainerRematches(mapGroup, mapNum);
|
||||
DoTimeBasedEvents();
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
@@ -876,7 +876,7 @@ static void mli0_load_map(u32 a1)
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetCyclingRoadChallengeData();
|
||||
prev_quest_postbuffer_cursor_backup_reset();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
TryUpdateRandomTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum);
|
||||
if (a1 != 1)
|
||||
DoTimeBasedEvents();
|
||||
@@ -2706,7 +2706,7 @@ static u8 *sub_8087370(struct UnkStruct_8054FF8 *a1)
|
||||
{
|
||||
if (a1->c != 2)
|
||||
return 0;
|
||||
return sub_809D0F4(&a1->sub);
|
||||
return GetCoordEventScriptAtMapPosition(&a1->sub);
|
||||
}
|
||||
|
||||
static bool32 sub_8087388(struct UnkStruct_8054FF8 *a1)
|
||||
@@ -2747,7 +2747,7 @@ static const u8 *sub_80873B4(struct UnkStruct_8054FF8 *a1)
|
||||
return EventScript_TradeRoom_ReadTrainerCard2;
|
||||
}
|
||||
|
||||
return sub_809C2C8(&unkStruct, a1->field_C, a1->d);
|
||||
return GetInteractedLinkPlayerScript(&unkStruct, a1->field_C, a1->d);
|
||||
}
|
||||
|
||||
static u16 sub_8087480(const u8 *script)
|
||||
@@ -3137,11 +3137,11 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion)
|
||||
{
|
||||
case VERSION_FIRE_RED:
|
||||
case VERSION_LEAF_GREEN:
|
||||
eventObj->spriteId = AddPseudoEventObject(sub_808BD6C(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
eventObj->spriteId = AddPseudoEventObject(GetFRLGAvatarGraphicsIdByGender(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
break;
|
||||
case VERSION_RUBY:
|
||||
case VERSION_SAPPHIRE:
|
||||
eventObj->spriteId = AddPseudoEventObject(sub_808BD7C(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
eventObj->spriteId = AddPseudoEventObject(GetRSAvatarGraphicsIdByGender(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
break;
|
||||
case VERSION_EMERALD:
|
||||
eventObj->spriteId = AddPseudoEventObject(GetRivalAvatarGraphicsIdByStateIdAndGender(0, eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
|
||||
+6
-6
@@ -3251,7 +3251,7 @@ u8 GetLevelFromMonExp(struct Pokemon *mon)
|
||||
u32 exp = GetMonData(mon, MON_DATA_EXP, NULL);
|
||||
s32 level = 1;
|
||||
|
||||
while (level <= MAX_MON_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
|
||||
while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
|
||||
level++;
|
||||
|
||||
return level - 1;
|
||||
@@ -3263,7 +3263,7 @@ u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon)
|
||||
u32 exp = GetBoxMonData(boxMon, MON_DATA_EXP, NULL);
|
||||
s32 level = 1;
|
||||
|
||||
while (level <= MAX_MON_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
|
||||
while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
|
||||
level++;
|
||||
|
||||
return level - 1;
|
||||
@@ -5145,7 +5145,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
retVal = FALSE;
|
||||
}
|
||||
if ((itemEffect[cmdIndex] & 0x40) // raise level
|
||||
&& GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_MON_LEVEL)
|
||||
&& GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_LEVEL)
|
||||
{
|
||||
dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1];
|
||||
SetMonData(mon, MON_DATA_EXP, &dataUnsigned);
|
||||
@@ -6430,12 +6430,12 @@ bool8 TryIncrementMonLevel(struct Pokemon *mon)
|
||||
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
|
||||
u8 nextLevel = GetMonData(mon, MON_DATA_LEVEL, 0) + 1;
|
||||
u32 expPoints = GetMonData(mon, MON_DATA_EXP, 0);
|
||||
if (expPoints > gExperienceTables[gBaseStats[species].growthRate][MAX_MON_LEVEL])
|
||||
if (expPoints > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL])
|
||||
{
|
||||
expPoints = gExperienceTables[gBaseStats[species].growthRate][MAX_MON_LEVEL];
|
||||
expPoints = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL];
|
||||
SetMonData(mon, MON_DATA_EXP, &expPoints);
|
||||
}
|
||||
if (nextLevel > MAX_MON_LEVEL || expPoints < gExperienceTables[gBaseStats[species].growthRate][nextLevel])
|
||||
if (nextLevel > MAX_LEVEL || expPoints < gExperienceTables[gBaseStats[species].growthRate][nextLevel])
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2533,7 +2533,7 @@ static void DrawExperienceProgressBar(struct Pokemon *unused)
|
||||
u16 *r9;
|
||||
u8 i;
|
||||
|
||||
if (summary->level < MAX_MON_LEVEL)
|
||||
if (summary->level < MAX_LEVEL)
|
||||
{
|
||||
u32 expBetweenLevels = gExperienceTables[gBaseStats[summary->species].growthRate][summary->level + 1] - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level];
|
||||
u32 expSinceLastLevel = summary->exp - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level];
|
||||
@@ -3349,7 +3349,7 @@ static void PrintExpPointsNextLevel(void)
|
||||
offset = GetStringRightAlignXOffset(1, gStringVar1, 42) + 2;
|
||||
SummaryScreen_PrintTextOnWindow(windowId, gStringVar1, offset, 1, 0, 0);
|
||||
|
||||
if (sum->level < MAX_MON_LEVEL)
|
||||
if (sum->level < MAX_LEVEL)
|
||||
expToNextLevel = gExperienceTables[gBaseStats[sum->species].growthRate][sum->level + 1] - sum->exp;
|
||||
else
|
||||
expToNextLevel = 0;
|
||||
|
||||
+1
-1
@@ -1646,7 +1646,7 @@ void sub_8014304(s8 mapGroup, s8 mapNum, s32 x, s32 y, u16 arg4)
|
||||
VarSet(VAR_0x4087, arg4);
|
||||
gFieldLinkPlayerCount = GetLinkPlayerCount();
|
||||
gUnknown_03005DB4 = GetMultiplayerId();
|
||||
sub_809D2BC();
|
||||
SetCableClubWarp();
|
||||
Overworld_SetWarpDestination(mapGroup, mapNum, -1, x, y);
|
||||
WarpIntoMap();
|
||||
}
|
||||
|
||||
+3
-3
@@ -52,7 +52,7 @@
|
||||
typedef u16 (*SpecialFunc)(void);
|
||||
typedef void (*NativeFunc)(void);
|
||||
|
||||
extern u32 gUnknown_020375C0;
|
||||
extern const u8 *gUnknown_020375C0;
|
||||
|
||||
static EWRAM_DATA u32 gUnknown_020375C4 = 0;
|
||||
static EWRAM_DATA u16 sPauseCounter = 0;
|
||||
@@ -284,7 +284,7 @@ bool8 ScrCmd_callstd_if(struct ScriptContext *ctx)
|
||||
|
||||
bool8 ScrCmd_gotoram(struct ScriptContext *ctx)
|
||||
{
|
||||
ScriptJump(ctx, (const u8 *)gUnknown_020375C0);
|
||||
ScriptJump(ctx, gUnknown_020375C0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2223,7 +2223,7 @@ bool8 ScrCmd_cmdCF(struct ScriptContext *ctx)
|
||||
|
||||
if (v1)
|
||||
{
|
||||
((u8*)gUnknown_020375C0) = ctx->scriptPtr;
|
||||
gUnknown_020375C0 = ctx->scriptPtr;
|
||||
ScriptJump(ctx, v1);
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@
|
||||
|
||||
#define RAM_SCRIPT_MAGIC 51
|
||||
|
||||
extern u8* gUnknown_020375C0;
|
||||
extern const u8* gUnknown_020375C0;
|
||||
|
||||
extern bool32 sub_801B27C(void);
|
||||
|
||||
@@ -344,7 +344,7 @@ void ClearRamScript(void)
|
||||
CpuFill32(0, &gSaveBlock1Ptr->ramScript, sizeof(struct RamScript));
|
||||
}
|
||||
|
||||
bool8 InitRamScript(u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objectId)
|
||||
bool8 InitRamScript(const u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objectId)
|
||||
{
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
|
||||
@@ -362,7 +362,7 @@ bool8 InitRamScript(u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objec
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u8 *GetRamScript(u8 objectId, u8 *script)
|
||||
const u8 *GetRamScript(u8 objectId, const u8 *script)
|
||||
{
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
gUnknown_020375C0 = NULL;
|
||||
|
||||
+4
-4
@@ -596,13 +596,13 @@ void sub_80E95D4(void)
|
||||
VarSet(VAR_OBJ_GFX_ID_F, gUnknown_0858D060[sub_80EA20C(VarGet(VAR_0x4054))]);
|
||||
}
|
||||
|
||||
void sub_80E9608(struct Coords16 *coords, struct MapEvents *events)
|
||||
void sub_80E9608(const struct MapPosition *position, const struct MapEvents *events)
|
||||
{
|
||||
s16 bgEventIdx;
|
||||
|
||||
for (bgEventIdx = 0; bgEventIdx < events->bgEventCount; bgEventIdx ++)
|
||||
{
|
||||
if (events->bgEvents[bgEventIdx].kind == BG_EVENT_SECRET_BASE && coords->x == events->bgEvents[bgEventIdx].x + 7 && coords->y == events->bgEvents[bgEventIdx].y + 7)
|
||||
if (events->bgEvents[bgEventIdx].kind == BG_EVENT_SECRET_BASE && position->x == events->bgEvents[bgEventIdx].x + 7 && position->y == events->bgEvents[bgEventIdx].y + 7)
|
||||
{
|
||||
sCurSecretBaseId = events->bgEvents[bgEventIdx].bgUnion.secretBaseId;
|
||||
break;
|
||||
@@ -610,9 +610,9 @@ void sub_80E9608(struct Coords16 *coords, struct MapEvents *events)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80E9668(struct Coords16 *coords, struct MapEvents *events)
|
||||
void sub_80E9668(const struct MapPosition *position, const struct MapEvents *events)
|
||||
{
|
||||
sub_80E9608(coords, events);
|
||||
sub_80E9608(position, events);
|
||||
sub_80E8B6C();
|
||||
ScriptContext1_SetupScript(EventScript_275BB7);
|
||||
}
|
||||
|
||||
+792
-239
File diff suppressed because it is too large
Load Diff
@@ -25,8 +25,6 @@
|
||||
#include "bg.h"
|
||||
#include "window.h"
|
||||
|
||||
extern u8 gOamLimit;
|
||||
|
||||
// Text
|
||||
extern const u8 gText_YouDontHaveThreeCoins[];
|
||||
extern const u8 gText_QuitTheGame[];
|
||||
|
||||
+50
-50
@@ -15,15 +15,15 @@
|
||||
|
||||
#define ALLOC_SPRITE_TILE(n) \
|
||||
{ \
|
||||
gSpriteTileAllocBitmap[(n) / 8] |= (1 << ((n) % 8)); \
|
||||
sSpriteTileAllocBitmap[(n) / 8] |= (1 << ((n) % 8)); \
|
||||
}
|
||||
|
||||
#define FREE_SPRITE_TILE(n) \
|
||||
{ \
|
||||
gSpriteTileAllocBitmap[(n) / 8] &= ~(1 << ((n) % 8)); \
|
||||
sSpriteTileAllocBitmap[(n) / 8] &= ~(1 << ((n) % 8)); \
|
||||
}
|
||||
|
||||
#define SPRITE_TILE_IS_ALLOCATED(n) ((gSpriteTileAllocBitmap[(n) / 8] >> ((n) % 8)) & 1)
|
||||
#define SPRITE_TILE_IS_ALLOCATED(n) ((sSpriteTileAllocBitmap[(n) / 8] >> ((n) % 8)) & 1)
|
||||
|
||||
|
||||
struct SpriteCopyRequest
|
||||
@@ -295,18 +295,18 @@ u32 gOamMatrixAllocBitmap;
|
||||
u8 gReservedSpritePaletteCount;
|
||||
|
||||
EWRAM_DATA struct Sprite gSprites[MAX_SPRITES + 1] = {0};
|
||||
EWRAM_DATA u16 gSpritePriorities[MAX_SPRITES] = {0};
|
||||
EWRAM_DATA u8 gSpriteOrder[MAX_SPRITES] = {0};
|
||||
EWRAM_DATA bool8 gShouldProcessSpriteCopyRequests = 0;
|
||||
EWRAM_DATA u8 gSpriteCopyRequestCount = 0;
|
||||
EWRAM_DATA struct SpriteCopyRequest gSpriteCopyRequests[MAX_SPRITES] = {0};
|
||||
EWRAM_DATA static u16 sSpritePriorities[MAX_SPRITES] = {0};
|
||||
EWRAM_DATA static u8 sSpriteOrder[MAX_SPRITES] = {0};
|
||||
EWRAM_DATA static bool8 sShouldProcessSpriteCopyRequests = 0;
|
||||
EWRAM_DATA static u8 sSpriteCopyRequestCount = 0;
|
||||
EWRAM_DATA static struct SpriteCopyRequest sSpriteCopyRequests[MAX_SPRITES] = {0};
|
||||
EWRAM_DATA u8 gOamLimit = 0;
|
||||
EWRAM_DATA u16 gReservedSpriteTileCount = 0;
|
||||
EWRAM_DATA u8 gSpriteTileAllocBitmap[128] = {0};
|
||||
EWRAM_DATA static u8 sSpriteTileAllocBitmap[128] = {0};
|
||||
EWRAM_DATA s16 gSpriteCoordOffsetX = 0;
|
||||
EWRAM_DATA s16 gSpriteCoordOffsetY = 0;
|
||||
EWRAM_DATA struct OamMatrix gOamMatrices[OAM_MATRIX_COUNT] = {0};
|
||||
EWRAM_DATA bool8 gAffineAnimsDisabled = 0;
|
||||
EWRAM_DATA bool8 gAffineAnimsDisabled = FALSE;
|
||||
|
||||
void ResetSpriteData(void)
|
||||
{
|
||||
@@ -350,7 +350,7 @@ void BuildOamBuffer(void)
|
||||
AddSpritesToOamBuffer();
|
||||
CopyMatricesToOamBuffer();
|
||||
gMain.oamLoadDisabled = temp;
|
||||
gShouldProcessSpriteCopyRequests = TRUE;
|
||||
sShouldProcessSpriteCopyRequests = TRUE;
|
||||
}
|
||||
|
||||
void UpdateOamCoords(void)
|
||||
@@ -382,7 +382,7 @@ void BuildSpritePriorities(void)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[i];
|
||||
u16 priority = sprite->subpriority | (sprite->oam.priority << 8);
|
||||
gSpritePriorities[i] = priority;
|
||||
sSpritePriorities[i] = priority;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,10 +392,10 @@ void SortSprites(void)
|
||||
for (i = 1; i < MAX_SPRITES; i++)
|
||||
{
|
||||
u8 j = i;
|
||||
struct Sprite *sprite1 = &gSprites[gSpriteOrder[i - 1]];
|
||||
struct Sprite *sprite2 = &gSprites[gSpriteOrder[i]];
|
||||
u16 sprite1Priority = gSpritePriorities[gSpriteOrder[i - 1]];
|
||||
u16 sprite2Priority = gSpritePriorities[gSpriteOrder[i]];
|
||||
struct Sprite *sprite1 = &gSprites[sSpriteOrder[i - 1]];
|
||||
struct Sprite *sprite2 = &gSprites[sSpriteOrder[i]];
|
||||
u16 sprite1Priority = sSpritePriorities[sSpriteOrder[i - 1]];
|
||||
u16 sprite2Priority = sSpritePriorities[sSpriteOrder[i]];
|
||||
s16 sprite1Y = sprite1->oam.y;
|
||||
s16 sprite2Y = sprite2->oam.y;
|
||||
|
||||
@@ -431,20 +431,20 @@ void SortSprites(void)
|
||||
&& ((sprite1Priority > sprite2Priority)
|
||||
|| (sprite1Priority == sprite2Priority && sprite1Y < sprite2Y)))
|
||||
{
|
||||
u8 temp = gSpriteOrder[j];
|
||||
gSpriteOrder[j] = gSpriteOrder[j - 1];
|
||||
gSpriteOrder[j - 1] = temp;
|
||||
u8 temp = sSpriteOrder[j];
|
||||
sSpriteOrder[j] = sSpriteOrder[j - 1];
|
||||
sSpriteOrder[j - 1] = temp;
|
||||
|
||||
// UB: If j equals 1, then j-- makes j equal 0.
|
||||
// Then, gSpriteOrder[-1] gets accessed below.
|
||||
// Then, sSpriteOrder[-1] gets accessed below.
|
||||
// Although this doesn't result in a bug in the ROM,
|
||||
// the behavior is undefined.
|
||||
j--;
|
||||
|
||||
sprite1 = &gSprites[gSpriteOrder[j - 1]];
|
||||
sprite2 = &gSprites[gSpriteOrder[j]];
|
||||
sprite1Priority = gSpritePriorities[gSpriteOrder[j - 1]];
|
||||
sprite2Priority = gSpritePriorities[gSpriteOrder[j]];
|
||||
sprite1 = &gSprites[sSpriteOrder[j - 1]];
|
||||
sprite2 = &gSprites[sSpriteOrder[j]];
|
||||
sprite1Priority = sSpritePriorities[sSpriteOrder[j - 1]];
|
||||
sprite2Priority = sSpritePriorities[sSpriteOrder[j]];
|
||||
sprite1Y = sprite1->oam.y;
|
||||
sprite2Y = sprite2->oam.y;
|
||||
|
||||
@@ -499,7 +499,7 @@ void AddSpritesToOamBuffer(void)
|
||||
|
||||
while (i < MAX_SPRITES)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[gSpriteOrder[i]];
|
||||
struct Sprite *sprite = &gSprites[sSpriteOrder[i]];
|
||||
if (sprite->inUse && !sprite->invisible && AddSpriteToOamBuffer(sprite, &oamIndex))
|
||||
return;
|
||||
i++;
|
||||
@@ -664,14 +664,14 @@ void ClearSpriteCopyRequests(void)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
gShouldProcessSpriteCopyRequests = FALSE;
|
||||
gSpriteCopyRequestCount = 0;
|
||||
sShouldProcessSpriteCopyRequests = FALSE;
|
||||
sSpriteCopyRequestCount = 0;
|
||||
|
||||
for (i = 0; i < MAX_SPRITE_COPY_REQUESTS; i++)
|
||||
{
|
||||
gSpriteCopyRequests[i].src = 0;
|
||||
gSpriteCopyRequests[i].dest = 0;
|
||||
gSpriteCopyRequests[i].size = 0;
|
||||
sSpriteCopyRequests[i].src = 0;
|
||||
sSpriteCopyRequests[i].dest = 0;
|
||||
sSpriteCopyRequests[i].size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -779,17 +779,17 @@ u8 SpriteTileAllocBitmapOp(u16 bit, u8 op)
|
||||
if (op == 0)
|
||||
{
|
||||
val = ~(1 << val);
|
||||
gSpriteTileAllocBitmap[index] &= val;
|
||||
sSpriteTileAllocBitmap[index] &= val;
|
||||
}
|
||||
else if (op == 1)
|
||||
{
|
||||
val = (1 << val);
|
||||
gSpriteTileAllocBitmap[index] |= val;
|
||||
sSpriteTileAllocBitmap[index] |= val;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = 1 << shift;
|
||||
retVal &= gSpriteTileAllocBitmap[index];
|
||||
retVal &= sSpriteTileAllocBitmap[index];
|
||||
}
|
||||
|
||||
return retVal;
|
||||
@@ -801,40 +801,40 @@ void SpriteCallbackDummy(struct Sprite *sprite)
|
||||
|
||||
void ProcessSpriteCopyRequests(void)
|
||||
{
|
||||
if (gShouldProcessSpriteCopyRequests)
|
||||
if (sShouldProcessSpriteCopyRequests)
|
||||
{
|
||||
u8 i = 0;
|
||||
|
||||
while (gSpriteCopyRequestCount > 0)
|
||||
while (sSpriteCopyRequestCount > 0)
|
||||
{
|
||||
CpuCopy16(gSpriteCopyRequests[i].src, gSpriteCopyRequests[i].dest, gSpriteCopyRequests[i].size);
|
||||
gSpriteCopyRequestCount--;
|
||||
CpuCopy16(sSpriteCopyRequests[i].src, sSpriteCopyRequests[i].dest, sSpriteCopyRequests[i].size);
|
||||
sSpriteCopyRequestCount--;
|
||||
i++;
|
||||
}
|
||||
|
||||
gShouldProcessSpriteCopyRequests = FALSE;
|
||||
sShouldProcessSpriteCopyRequests = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct SpriteFrameImage *images)
|
||||
{
|
||||
if (gSpriteCopyRequestCount < MAX_SPRITE_COPY_REQUESTS)
|
||||
if (sSpriteCopyRequestCount < MAX_SPRITE_COPY_REQUESTS)
|
||||
{
|
||||
gSpriteCopyRequests[gSpriteCopyRequestCount].src = images[index].data;
|
||||
gSpriteCopyRequests[gSpriteCopyRequestCount].dest = (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * tileNum;
|
||||
gSpriteCopyRequests[gSpriteCopyRequestCount].size = images[index].size;
|
||||
gSpriteCopyRequestCount++;
|
||||
sSpriteCopyRequests[sSpriteCopyRequestCount].src = images[index].data;
|
||||
sSpriteCopyRequests[sSpriteCopyRequestCount].dest = (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * tileNum;
|
||||
sSpriteCopyRequests[sSpriteCopyRequestCount].size = images[index].size;
|
||||
sSpriteCopyRequestCount++;
|
||||
}
|
||||
}
|
||||
|
||||
void RequestSpriteCopy(const u8 *src, u8 *dest, u16 size)
|
||||
{
|
||||
if (gSpriteCopyRequestCount < MAX_SPRITE_COPY_REQUESTS)
|
||||
if (sSpriteCopyRequestCount < MAX_SPRITE_COPY_REQUESTS)
|
||||
{
|
||||
gSpriteCopyRequests[gSpriteCopyRequestCount].src = src;
|
||||
gSpriteCopyRequests[gSpriteCopyRequestCount].dest = dest;
|
||||
gSpriteCopyRequests[gSpriteCopyRequestCount].size = size;
|
||||
gSpriteCopyRequestCount++;
|
||||
sSpriteCopyRequests[sSpriteCopyRequestCount].src = src;
|
||||
sSpriteCopyRequests[sSpriteCopyRequestCount].dest = dest;
|
||||
sSpriteCopyRequests[sSpriteCopyRequestCount].size = size;
|
||||
sSpriteCopyRequestCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ void ResetAllSprites(void)
|
||||
for (i = 0; i < MAX_SPRITES; i++)
|
||||
{
|
||||
ResetSprite(&gSprites[i]);
|
||||
gSpriteOrder[i] = i;
|
||||
sSpriteOrder[i] = i;
|
||||
}
|
||||
|
||||
ResetSprite(&gSprites[i]);
|
||||
@@ -1414,7 +1414,7 @@ void ResetAffineAnimData(void)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
gAffineAnimsDisabled = 0;
|
||||
gAffineAnimsDisabled = FALSE;
|
||||
gOamMatrixAllocBitmap = 0;
|
||||
|
||||
ResetOamMatrices();
|
||||
|
||||
+3
-3
@@ -349,9 +349,9 @@ const u8 gText_Var1ThrownAway[] = _("The {STR_VAR_1}\nwas thrown away.");
|
||||
const u8 gText_Var1AteTheVar2[] = _("{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gText_Var1HappilyAteVar2[] = _("{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gText_Var1DisdainfullyAteVar2[] = _("{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gUnknown_085E93C7[] = _("BUY");
|
||||
const u8 gUnknown_085E93CB[] = _("SELL");
|
||||
const u8 gUnknown_085E93D0[] = _("QUIT");
|
||||
const u8 gText_ShopBuy[] = _("BUY");
|
||||
const u8 gText_ShopSell[] = _("SELL");
|
||||
const u8 gText_ShopQuit[] = _("QUIT");
|
||||
const u8 gText_InBagVar1[] = _("IN BAG: {STR_VAR_1}");
|
||||
const u8 gText_QuitShopping[] = _("Quit shopping.");
|
||||
const u8 gText_Var1CertainlyHowMany[] = _("{STR_VAR_1}? Certainly.\nHow many would you like?");
|
||||
|
||||
+3
-5
@@ -9,11 +9,11 @@
|
||||
#include "window.h"
|
||||
#include "text.h"
|
||||
#include "blit.h"
|
||||
#include "dynamic_placeholder_text_util.h"
|
||||
|
||||
extern u8 GetKeypadIconWidth(u8 keypadIconId);
|
||||
extern u16 Font6Func(struct TextPrinter *textPrinter);
|
||||
extern u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese);
|
||||
extern u8* DynamicPlaceholderTextUtil_GetPlaceholderPtr(u8 a1);
|
||||
extern int sub_8197964();
|
||||
|
||||
EWRAM_DATA struct TextPrinter gTempTextPrinter = {0};
|
||||
@@ -24,8 +24,6 @@ static u16 gLastTextBgColor;
|
||||
static u16 gLastTextFgColor;
|
||||
static u16 gLastTextShadowColor;
|
||||
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
|
||||
const struct FontInfo *gFonts;
|
||||
u8 gUnknown_03002F84;
|
||||
u8 gUnknown_03002F90[0x20];
|
||||
@@ -3170,7 +3168,7 @@ u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32)
|
||||
return gGlyphWidthFuncs[i].func;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
||||
@@ -3181,7 +3179,7 @@ u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
||||
s32 result;
|
||||
int localLetterSpacing;
|
||||
u32 lineWidth;
|
||||
u8 *bufferPointer;
|
||||
const u8 *bufferPointer;
|
||||
int glyphWidth;
|
||||
u32 width;
|
||||
|
||||
|
||||
@@ -1580,7 +1580,7 @@ void SaveRecordedItemPurchasesForTVShow(void)
|
||||
if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_SMART_SHOPPER, FALSE) != TRUE)
|
||||
{
|
||||
TV_SortPurchasesByQuantity();
|
||||
if (gUnknown_02039F80[0].quantity >= 20)
|
||||
if (gMartPurchaseHistory[0].quantity >= 20)
|
||||
{
|
||||
show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot];
|
||||
show->smartshopperShow.kind = TVSHOW_SMART_SHOPPER;
|
||||
@@ -1588,8 +1588,8 @@ void SaveRecordedItemPurchasesForTVShow(void)
|
||||
show->smartshopperShow.shopLocation = gMapHeader.regionMapSectionId;
|
||||
for (i = 0; i < 3; i ++)
|
||||
{
|
||||
show->smartshopperShow.itemIds[i] = gUnknown_02039F80[i].itemId;
|
||||
show->smartshopperShow.itemAmounts[i] = gUnknown_02039F80[i].quantity;
|
||||
show->smartshopperShow.itemIds[i] = gMartPurchaseHistory[i].itemId;
|
||||
show->smartshopperShow.itemAmounts[i] = gMartPurchaseHistory[i].quantity;
|
||||
}
|
||||
show->smartshopperShow.priceReduced = GetPriceReduction(1);
|
||||
StringCopy(show->smartshopperShow.playerName, gSaveBlock2Ptr->playerName);
|
||||
@@ -2992,14 +2992,14 @@ void TV_SortPurchasesByQuantity(void)
|
||||
{
|
||||
for (j = i + 1; j < 3; j ++)
|
||||
{
|
||||
if (gUnknown_02039F80[i].quantity < gUnknown_02039F80[j].quantity)
|
||||
if (gMartPurchaseHistory[i].quantity < gMartPurchaseHistory[j].quantity)
|
||||
{
|
||||
tmpId = gUnknown_02039F80[i].itemId;
|
||||
tmpQn = gUnknown_02039F80[i].quantity;
|
||||
gUnknown_02039F80[i].itemId = gUnknown_02039F80[j].itemId;
|
||||
gUnknown_02039F80[i].quantity = gUnknown_02039F80[j].quantity;
|
||||
gUnknown_02039F80[j].itemId = tmpId;
|
||||
gUnknown_02039F80[j].quantity = tmpQn;
|
||||
tmpId = gMartPurchaseHistory[i].itemId;
|
||||
tmpQn = gMartPurchaseHistory[i].quantity;
|
||||
gMartPurchaseHistory[i].itemId = gMartPurchaseHistory[j].itemId;
|
||||
gMartPurchaseHistory[i].quantity = gMartPurchaseHistory[j].quantity;
|
||||
gMartPurchaseHistory[j].itemId = tmpId;
|
||||
gMartPurchaseHistory[j].quantity = tmpQn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ EWRAM_DATA static u16 sWindowSize = 0;
|
||||
static u8 GetNumActiveWindowsOnBg(u8 bgId);
|
||||
static u8 GetNumActiveWindowsOnBg8Bit(u8 bgId);
|
||||
|
||||
static const struct WindowTemplate sDummyWindowTemplate = {0xFF, 0, 0, 0, 0, 0, 0};
|
||||
static const struct WindowTemplate sDummyWindowTemplate = DUMMY_WIN_TEMPLATE;
|
||||
|
||||
static void nullsub_8(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user