Standarized use of star in pointer types
This commit is contained in:
@@ -222,7 +222,7 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId);
|
|||||||
void BtlController_EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
|
void BtlController_EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
|
||||||
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
|
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
|
||||||
void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1);
|
void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1);
|
||||||
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4);
|
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8 *arg4);
|
||||||
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
|
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
|
||||||
void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints);
|
void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints);
|
||||||
void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
|
void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
|
||||||
|
|||||||
@@ -208,12 +208,12 @@ struct BattleMsgData
|
|||||||
};
|
};
|
||||||
|
|
||||||
void BufferStringBattle(u16 stringID);
|
void BufferStringBattle(u16 stringID);
|
||||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src);
|
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src);
|
||||||
u32 BattleStringExpandPlaceholders(const u8* src, u8* dst);
|
u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst);
|
||||||
void BattleHandleAddTextPrinter(const u8* text, u8 arg1);
|
void BattleHandleAddTextPrinter(const u8 *text, u8 arg1);
|
||||||
void SetPpNumbersPaletteInMoveSelection(void);
|
void SetPpNumbersPaletteInMoveSelection(void);
|
||||||
u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp);
|
u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp);
|
||||||
void BattlePutTextOnWindow(const u8* text, u8 windowId_flags);
|
void BattlePutTextOnWindow(const u8 *text, u8 windowId_flags);
|
||||||
bool8 BattleStringShouldBeColored(u16);
|
bool8 BattleStringShouldBeColored(u16);
|
||||||
|
|
||||||
extern struct BattleMsgData *gBattleMsgDataPtr;
|
extern struct BattleMsgData *gBattleMsgDataPtr;
|
||||||
@@ -225,11 +225,11 @@ extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT];
|
|||||||
extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
|
extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
|
||||||
extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT];
|
extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT];
|
||||||
|
|
||||||
extern const u8* const gBattleStringsTable[];
|
extern const u8 *const gBattleStringsTable[];
|
||||||
extern const u8* const gStatNamesTable[];
|
extern const u8 *const gStatNamesTable[];
|
||||||
extern const u8* const gPokeblockWasTooXStringTable[];
|
extern const u8 *const gPokeblockWasTooXStringTable[];
|
||||||
extern const u8* const gRefereeStringsTable[];
|
extern const u8 *const gRefereeStringsTable[];
|
||||||
extern const u8* const gStatNamesTable2[];
|
extern const u8 *const gStatNamesTable2[];
|
||||||
|
|
||||||
extern const u16 gMissStringIds[];
|
extern const u16 gMissStringIds[];
|
||||||
extern const u16 gTrappingMoves[];
|
extern const u16 gTrappingMoves[];
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ u8 MapGridGetMetatileLayerTypeAt(s16 x, s16 y);
|
|||||||
void MapGridSetMetatileIdAt(s32, s32, u16);
|
void MapGridSetMetatileIdAt(s32, s32, u16);
|
||||||
void MapGridSetMetatileEntryAt(s32, s32, u16);
|
void MapGridSetMetatileEntryAt(s32, s32, u16);
|
||||||
u8 MapGridGetZCoordAt(s32 x, s32 y);
|
u8 MapGridGetZCoordAt(s32 x, s32 y);
|
||||||
void GetCameraCoords(u16*, u16*);
|
void GetCameraCoords(u16 *, u16 *);
|
||||||
bool8 MapGridIsImpassableAt(s32, s32);
|
bool8 MapGridIsImpassableAt(s32, s32);
|
||||||
s32 GetMapBorderIdAt(s32, s32);
|
s32 GetMapBorderIdAt(s32, s32);
|
||||||
bool32 CanCameraMoveInDirection(s32);
|
bool32 CanCameraMoveInDirection(s32);
|
||||||
|
|||||||
+1
-1
@@ -100,7 +100,7 @@
|
|||||||
#define T1_READ_8(ptr) ((ptr)[0])
|
#define T1_READ_8(ptr) ((ptr)[0])
|
||||||
#define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8))
|
#define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8))
|
||||||
#define T1_READ_32(ptr) ((ptr)[0] | ((ptr)[1] << 8) | ((ptr)[2] << 16) | ((ptr)[3] << 24))
|
#define T1_READ_32(ptr) ((ptr)[0] | ((ptr)[1] << 8) | ((ptr)[2] << 16) | ((ptr)[3] << 24))
|
||||||
#define T1_READ_PTR(ptr) (u8*) T1_READ_32(ptr)
|
#define T1_READ_PTR(ptr) (u8 *) T1_READ_32(ptr)
|
||||||
|
|
||||||
// T2_READ_8 is a duplicate to remain consistent with each group.
|
// T2_READ_8 is a duplicate to remain consistent with each group.
|
||||||
#define T2_READ_8(ptr) ((ptr)[0])
|
#define T2_READ_8(ptr) ((ptr)[0])
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ struct BagPocket
|
|||||||
extern const struct Item gItems[];
|
extern const struct Item gItems[];
|
||||||
extern struct BagPocket gBagPockets[];
|
extern struct BagPocket gBagPockets[];
|
||||||
|
|
||||||
void GetBerryCountString(u8* dst, const u8* berryName, u32 quantity);
|
void GetBerryCountString(u8 *dst, const u8 *berryName, u32 quantity);
|
||||||
void CopyItemName(u16 itemId, u8 *string);
|
void CopyItemName(u16 itemId, u8 *string);
|
||||||
void CopyItemNameHandlePlural(u16 itemId, u8 *string, u32 quantity);
|
void CopyItemNameHandlePlural(u16 itemId, u8 *string, u32 quantity);
|
||||||
bool8 IsBagPocketNonEmpty(u8 pocket);
|
bool8 IsBagPocketNonEmpty(u8 pocket);
|
||||||
|
|||||||
+5
-5
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
u32 GetMoney(u32* moneyPtr);
|
u32 GetMoney(u32 *moneyPtr);
|
||||||
void SetMoney(u32* moneyPtr, u32 newValue);
|
void SetMoney(u32 *moneyPtr, u32 newValue);
|
||||||
bool8 IsEnoughMoney(u32* moneyPtr, u32 cost);
|
bool8 IsEnoughMoney(u32 *moneyPtr, u32 cost);
|
||||||
void AddMoney(u32* moneyPtr, u32 toAdd);
|
void AddMoney(u32 *moneyPtr, u32 toAdd);
|
||||||
void RemoveMoney(u32* moneyPtr, u32 toSub);
|
void RemoveMoney(u32 *moneyPtr, u32 toSub);
|
||||||
bool8 IsEnoughForCostInVar0x8005(void);
|
bool8 IsEnoughForCostInVar0x8005(void);
|
||||||
void SubtractMoneyFromVar0x8005(void);
|
void SubtractMoneyFromVar0x8005(void);
|
||||||
void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, u8 speed);
|
void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, u8 speed);
|
||||||
|
|||||||
+2
-2
@@ -112,8 +112,8 @@ u8 sub_80DA434(void);
|
|||||||
u8 sub_80DA45C(void);
|
u8 sub_80DA45C(void);
|
||||||
bool8 sub_80DA4A0(void);
|
bool8 sub_80DA4A0(void);
|
||||||
u8 Save_LoadGameData(u8 saveType);
|
u8 Save_LoadGameData(u8 saveType);
|
||||||
u32 TryCopySpecialSaveSection(u8 sector, u8* dst);
|
u32 TryCopySpecialSaveSection(u8 sector, u8 *dst);
|
||||||
u32 TryWriteSpecialSaveSection(u8 sector, u8* src);
|
u32 TryWriteSpecialSaveSection(u8 sector, u8 *src);
|
||||||
void Task_LinkSave(u8 taskId);
|
void Task_LinkSave(u8 taskId);
|
||||||
|
|
||||||
#endif // GUARD_SAVE_H
|
#endif // GUARD_SAVE_H
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
void AppendToList(u8* list, u8* pos, u8 newEntry);
|
void AppendToList(u8 *list, u8 *pos, u8 newEntry);
|
||||||
void Task_StartMenuHandleInput(u8 taskId);
|
void Task_StartMenuHandleInput(u8 taskId);
|
||||||
void SetUpReturnToStartMenu(void);
|
void SetUpReturnToStartMenu(void);
|
||||||
void ShowStartMenu(void);
|
void ShowStartMenu(void);
|
||||||
|
|||||||
+1
-1
@@ -195,7 +195,7 @@ struct TextPrinterSubStruct
|
|||||||
|
|
||||||
struct TextPrinterTemplate // TODO: Better name
|
struct TextPrinterTemplate // TODO: Better name
|
||||||
{
|
{
|
||||||
const u8* currentChar;
|
const u8 *currentChar;
|
||||||
u8 windowId;
|
u8 windowId;
|
||||||
u8 fontId;
|
u8 fontId;
|
||||||
u8 x;
|
u8 x;
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
|
|
||||||
struct TilesPal
|
struct TilesPal
|
||||||
{
|
{
|
||||||
u32* tiles;
|
u32 *tiles;
|
||||||
u16* pal;
|
u16 *pal;
|
||||||
};
|
};
|
||||||
|
|
||||||
void rbox_fill_rectangle(u8 windowId);
|
void rbox_fill_rectangle(u8 windowId);
|
||||||
const u16* stdpal_get(u8 id);
|
const u16 *stdpal_get(u8 id);
|
||||||
const u16* GetOverworldTextboxPalettePtr(void);
|
const u16 *GetOverworldTextboxPalettePtr(void);
|
||||||
void TextWindow_LoadResourcesStdFrame0(u8 windowId, u16 tileStart, u8 palette);
|
void TextWindow_LoadResourcesStdFrame0(u8 windowId, u16 tileStart, u8 palette);
|
||||||
void TextWindow_SetStdFrame0_WithPal(u8 windowId, u16 tileStart, u8 palette);
|
void TextWindow_SetStdFrame0_WithPal(u8 windowId, u16 tileStart, u8 palette);
|
||||||
void TextWindow_SetUserSelectedFrame(u8 windowId, u16 tileStart, u8 palette);
|
void TextWindow_SetUserSelectedFrame(u8 windowId, u16 tileStart, u8 palette);
|
||||||
|
|||||||
@@ -5294,7 +5294,7 @@ void AnimWavyMusicNotes(struct Sprite* sprite)
|
|||||||
sprite->callback = AnimWavyMusicNotesStep;
|
sprite->callback = AnimWavyMusicNotesStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AnimWavyMusicNotesGetNextPos(s16 a, s16 b, s16* c, s16* d, s8 e)
|
static void AnimWavyMusicNotesGetNextPos(s16 a, s16 b, s16 *c, s16 *d, s8 e)
|
||||||
{
|
{
|
||||||
int f;
|
int f;
|
||||||
int g;
|
int g;
|
||||||
|
|||||||
@@ -1780,7 +1780,7 @@ static void AnimBulletSeed_Step1(struct Sprite *sprite)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
u16 rand;
|
u16 rand;
|
||||||
s16* ptr;
|
s16 *ptr;
|
||||||
|
|
||||||
PlaySE12WithPanning(SE_M_HORN_ATTACK, BattleAnimAdjustPanning(SOUND_PAN_TARGET));
|
PlaySE12WithPanning(SE_M_HORN_ATTACK, BattleAnimAdjustPanning(SOUND_PAN_TARGET));
|
||||||
sprite->x += sprite->x2;
|
sprite->x += sprite->x2;
|
||||||
|
|||||||
@@ -2148,7 +2148,7 @@ static const struct WindowTemplate sHealthboxWindowTemplate = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 *windowId)
|
static u8 *AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 *windowId)
|
||||||
{
|
{
|
||||||
u16 winId;
|
u16 winId;
|
||||||
u8 color[3];
|
u8 color[3];
|
||||||
@@ -2164,7 +2164,7 @@ static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y,
|
|||||||
AddTextPrinterParameterized4(winId, 0, x, y, 0, 0, color, -1, str);
|
AddTextPrinterParameterized4(winId, 0, x, y, 0, 0, color, -1, str);
|
||||||
|
|
||||||
*windowId = winId;
|
*windowId = winId;
|
||||||
return (u8*)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
|
return (u8 *)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RemoveWindowOnHealthbox(u32 windowId)
|
static void RemoveWindowOnHealthbox(u32 windowId)
|
||||||
|
|||||||
@@ -1717,17 +1717,17 @@ void BufferStringBattle(u16 stringId)
|
|||||||
BattleStringExpandPlaceholdersToDisplayedString(stringPtr);
|
BattleStringExpandPlaceholdersToDisplayedString(stringPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src)
|
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src)
|
||||||
{
|
{
|
||||||
BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u8* TryGetStatusString(u8 *src)
|
static const u8 *TryGetStatusString(u8 *src)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
u8 status[] = _("$$$$$$$");
|
u8 status[] = _("$$$$$$$");
|
||||||
u32 chars1, chars2;
|
u32 chars1, chars2;
|
||||||
u8* statusPtr;
|
u8 *statusPtr;
|
||||||
|
|
||||||
statusPtr = status;
|
statusPtr = status;
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
@@ -1739,13 +1739,13 @@ static const u8* TryGetStatusString(u8 *src)
|
|||||||
statusPtr++;
|
statusPtr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
chars1 = *(u32*)(&status[0]);
|
chars1 = *(u32 *)(&status[0]);
|
||||||
chars2 = *(u32*)(&status[4]);
|
chars2 = *(u32 *)(&status[4]);
|
||||||
|
|
||||||
for (i = 0; i < NELEMS(gStatusConditionStringsTable); i++)
|
for (i = 0; i < NELEMS(gStatusConditionStringsTable); i++)
|
||||||
{
|
{
|
||||||
if (chars1 == *(u32*)(&gStatusConditionStringsTable[i][0][0])
|
if (chars1 == *(u32 *)(&gStatusConditionStringsTable[i][0][0])
|
||||||
&& chars2 == *(u32*)(&gStatusConditionStringsTable[i][0][4]))
|
&& chars2 == *(u32 *)(&gStatusConditionStringsTable[i][0][4]))
|
||||||
return gStatusConditionStringsTable[i][1];
|
return gStatusConditionStringsTable[i][1];
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -2274,7 +2274,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
|||||||
// unused, since the value loaded into the buffer is not read; it loaded one of
|
// unused, since the value loaded into the buffer is not read; it loaded one of
|
||||||
// two particles (either "は" or "の") which works in tandem with ChooseTypeOfMoveUsedString
|
// two particles (either "は" or "の") which works in tandem with ChooseTypeOfMoveUsedString
|
||||||
// below to effect changes in the meaning of the line.
|
// below to effect changes in the meaning of the line.
|
||||||
static void ChooseMoveUsedParticle(u8* textBuff)
|
static void ChooseMoveUsedParticle(u8 *textBuff)
|
||||||
{
|
{
|
||||||
s32 counter = 0;
|
s32 counter = 0;
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
@@ -2314,7 +2314,7 @@ static void ChooseMoveUsedParticle(u8* textBuff)
|
|||||||
//
|
//
|
||||||
// sText_ExclamationMark5 was " こうげき!" This resulted in a translation of
|
// sText_ExclamationMark5 was " こうげき!" This resulted in a translation of
|
||||||
// "<NAME>'s <ATTACK> attack!".
|
// "<NAME>'s <ATTACK> attack!".
|
||||||
static void ChooseTypeOfMoveUsedString(u8* dst)
|
static void ChooseTypeOfMoveUsedString(u8 *dst)
|
||||||
{
|
{
|
||||||
s32 counter = 0;
|
s32 counter = 0;
|
||||||
s32 i = 0;
|
s32 i = 0;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#include "constants/pokemon.h"
|
#include "constants/pokemon.h"
|
||||||
#include "constants/maps.h"
|
#include "constants/maps.h"
|
||||||
|
|
||||||
extern const u8* const gBattleScriptsForMoveEffects[];
|
extern const u8 *const gBattleScriptsForMoveEffects[];
|
||||||
|
|
||||||
#define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED))
|
#define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED))
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ static bool8 IsTwoTurnsMove(u16 move);
|
|||||||
static void TrySetDestinyBondToHappen(void);
|
static void TrySetDestinyBondToHappen(void);
|
||||||
static u8 AttacksThisTurn(u8 battlerId, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2.
|
static u8 AttacksThisTurn(u8 battlerId, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2.
|
||||||
static void CheckWonderGuardAndLevitate(void);
|
static void CheckWonderGuardAndLevitate(void);
|
||||||
static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8, const u8* BS_ptr);
|
static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8, const u8 *BS_ptr);
|
||||||
static void InitLevelUpBanner(void);
|
static void InitLevelUpBanner(void);
|
||||||
static bool8 SlideInLevelUpBanner(void);
|
static bool8 SlideInLevelUpBanner(void);
|
||||||
static bool8 SlideOutLevelUpBanner(void);
|
static bool8 SlideOutLevelUpBanner(void);
|
||||||
@@ -607,7 +607,7 @@ static const u32 sStatusFlagsForMoveEffects[NUM_MOVE_EFFECTS] =
|
|||||||
[MOVE_EFFECT_THRASH] = STATUS2_LOCK_CONFUSE,
|
[MOVE_EFFECT_THRASH] = STATUS2_LOCK_CONFUSE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8* const sMoveEffectBS_Ptrs[] =
|
static const u8 *const sMoveEffectBS_Ptrs[] =
|
||||||
{
|
{
|
||||||
[0] = BattleScript_MoveEffectSleep,
|
[0] = BattleScript_MoveEffectSleep,
|
||||||
[MOVE_EFFECT_SLEEP] = BattleScript_MoveEffectSleep,
|
[MOVE_EFFECT_SLEEP] = BattleScript_MoveEffectSleep,
|
||||||
@@ -1418,7 +1418,7 @@ static void CheckWonderGuardAndLevitate(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ModulateDmgByType2(u8 multiplier, u16 move, u8* flags) // same as ModulateDmgByType except different arguments
|
static void ModulateDmgByType2(u8 multiplier, u16 move, u8 *flags) // same as ModulateDmgByType except different arguments
|
||||||
{
|
{
|
||||||
gBattleMoveDamage = gBattleMoveDamage * multiplier / 10;
|
gBattleMoveDamage = gBattleMoveDamage * multiplier / 10;
|
||||||
if (gBattleMoveDamage == 0 && multiplier != 0)
|
if (gBattleMoveDamage == 0 && multiplier != 0)
|
||||||
@@ -2062,7 +2062,7 @@ static void Cmd_printfromtable(void)
|
|||||||
{
|
{
|
||||||
if (gBattleControllerExecFlags == 0)
|
if (gBattleControllerExecFlags == 0)
|
||||||
{
|
{
|
||||||
const u16* ptr = (const u16*) T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
|
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
|
||||||
|
|
||||||
PrepareStringBattle(*ptr, gBattlerAttacker);
|
PrepareStringBattle(*ptr, gBattlerAttacker);
|
||||||
@@ -2076,7 +2076,7 @@ static void Cmd_printselectionstringfromtable(void)
|
|||||||
{
|
{
|
||||||
if (gBattleControllerExecFlags == 0)
|
if (gBattleControllerExecFlags == 0)
|
||||||
{
|
{
|
||||||
const u16* ptr = (const u16*) T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
|
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
|
||||||
|
|
||||||
gActiveBattler = gBattlerAttacker;
|
gActiveBattler = gBattlerAttacker;
|
||||||
@@ -2379,7 +2379,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
|| gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_PARALYSIS
|
|| gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_PARALYSIS
|
||||||
|| gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_BURN)
|
|| gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_BURN)
|
||||||
{
|
{
|
||||||
u8* synchronizeEffect = &gBattleStruct->synchronizeMoveEffect;
|
u8 *synchronizeEffect = &gBattleStruct->synchronizeMoveEffect;
|
||||||
*synchronizeEffect = gBattleCommunication[MOVE_EFFECT_BYTE];
|
*synchronizeEffect = gBattleCommunication[MOVE_EFFECT_BYTE];
|
||||||
gHitMarker |= HITMARKER_SYNCHRONISE_EFFECT;
|
gHitMarker |= HITMARKER_SYNCHRONISE_EFFECT;
|
||||||
}
|
}
|
||||||
@@ -2649,7 +2649,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
u16* changedItem = &gBattleStruct->changedItems[gBattlerAttacker];
|
u16 *changedItem = &gBattleStruct->changedItems[gBattlerAttacker];
|
||||||
gLastUsedItem = *changedItem = gBattleMons[gBattlerTarget].item;
|
gLastUsedItem = *changedItem = gBattleMons[gBattlerTarget].item;
|
||||||
gBattleMons[gBattlerTarget].item = ITEM_NONE;
|
gBattleMons[gBattlerTarget].item = ITEM_NONE;
|
||||||
|
|
||||||
@@ -2664,8 +2664,8 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||||
gBattlescriptCurrInstr = BattleScript_ItemSteal;
|
gBattlescriptCurrInstr = BattleScript_ItemSteal;
|
||||||
|
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2753,8 +2753,8 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||||
gBattlescriptCurrInstr = BattleScript_KnockedOff;
|
gBattlescriptCurrInstr = BattleScript_KnockedOff;
|
||||||
|
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gEffectBattler]) + 0) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 0) = 0;
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gEffectBattler]) + 1) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 1) = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2945,7 +2945,7 @@ static void Cmd_jumpifstatus(void)
|
|||||||
{
|
{
|
||||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2);
|
u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2);
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6);
|
||||||
|
|
||||||
if (gBattleMons[battlerId].status1 & flags && gBattleMons[battlerId].hp != 0)
|
if (gBattleMons[battlerId].status1 & flags && gBattleMons[battlerId].hp != 0)
|
||||||
gBattlescriptCurrInstr = jumpPtr;
|
gBattlescriptCurrInstr = jumpPtr;
|
||||||
@@ -2957,7 +2957,7 @@ static void Cmd_jumpifstatus2(void)
|
|||||||
{
|
{
|
||||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2);
|
u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2);
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6);
|
||||||
|
|
||||||
if (gBattleMons[battlerId].status2 & flags && gBattleMons[battlerId].hp != 0)
|
if (gBattleMons[battlerId].status2 & flags && gBattleMons[battlerId].hp != 0)
|
||||||
gBattlescriptCurrInstr = jumpPtr;
|
gBattlescriptCurrInstr = jumpPtr;
|
||||||
@@ -2969,7 +2969,7 @@ static void Cmd_jumpifability(void)
|
|||||||
{
|
{
|
||||||
u8 battlerId;
|
u8 battlerId;
|
||||||
u8 ability = gBattlescriptCurrInstr[2];
|
u8 ability = gBattlescriptCurrInstr[2];
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||||
|
|
||||||
if (gBattlescriptCurrInstr[1] == BS_ATTACKER_SIDE)
|
if (gBattlescriptCurrInstr[1] == BS_ATTACKER_SIDE)
|
||||||
{
|
{
|
||||||
@@ -3016,7 +3016,7 @@ static void Cmd_jumpifsideaffecting(void)
|
|||||||
{
|
{
|
||||||
u8 side;
|
u8 side;
|
||||||
u16 flags;
|
u16 flags;
|
||||||
const u8* jumpPtr;
|
const u8 *jumpPtr;
|
||||||
|
|
||||||
if (gBattlescriptCurrInstr[1] == BS_ATTACKER)
|
if (gBattlescriptCurrInstr[1] == BS_ATTACKER)
|
||||||
side = GET_BATTLER_SIDE(gBattlerAttacker);
|
side = GET_BATTLER_SIDE(gBattlerAttacker);
|
||||||
@@ -3101,7 +3101,7 @@ static void Cmd_jumpiftype(void)
|
|||||||
{
|
{
|
||||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
u8 type = gBattlescriptCurrInstr[2];
|
u8 type = gBattlescriptCurrInstr[2];
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||||
|
|
||||||
if (IS_BATTLER_OF_TYPE(battlerId, type))
|
if (IS_BATTLER_OF_TYPE(battlerId, type))
|
||||||
gBattlescriptCurrInstr = jumpPtr;
|
gBattlescriptCurrInstr = jumpPtr;
|
||||||
@@ -3506,9 +3506,9 @@ static void Cmd_goto(void)
|
|||||||
static void Cmd_jumpifbyte(void)
|
static void Cmd_jumpifbyte(void)
|
||||||
{
|
{
|
||||||
u8 caseID = gBattlescriptCurrInstr[1];
|
u8 caseID = gBattlescriptCurrInstr[1];
|
||||||
const u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
const u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||||
u8 value = gBattlescriptCurrInstr[6];
|
u8 value = gBattlescriptCurrInstr[6];
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7);
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 11;
|
gBattlescriptCurrInstr += 11;
|
||||||
|
|
||||||
@@ -3544,9 +3544,9 @@ static void Cmd_jumpifbyte(void)
|
|||||||
static void Cmd_jumpifhalfword(void)
|
static void Cmd_jumpifhalfword(void)
|
||||||
{
|
{
|
||||||
u8 caseID = gBattlescriptCurrInstr[1];
|
u8 caseID = gBattlescriptCurrInstr[1];
|
||||||
const u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
const u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||||
u16 value = T2_READ_16(gBattlescriptCurrInstr + 6);
|
u16 value = T2_READ_16(gBattlescriptCurrInstr + 6);
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8);
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 12;
|
gBattlescriptCurrInstr += 12;
|
||||||
|
|
||||||
@@ -3582,9 +3582,9 @@ static void Cmd_jumpifhalfword(void)
|
|||||||
static void Cmd_jumpifword(void)
|
static void Cmd_jumpifword(void)
|
||||||
{
|
{
|
||||||
u8 caseID = gBattlescriptCurrInstr[1];
|
u8 caseID = gBattlescriptCurrInstr[1];
|
||||||
const u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
const u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||||
u32 value = T1_READ_32(gBattlescriptCurrInstr + 6);
|
u32 value = T1_READ_32(gBattlescriptCurrInstr + 6);
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 14;
|
gBattlescriptCurrInstr += 14;
|
||||||
|
|
||||||
@@ -3619,10 +3619,10 @@ static void Cmd_jumpifword(void)
|
|||||||
|
|
||||||
static void Cmd_jumpifarrayequal(void)
|
static void Cmd_jumpifarrayequal(void)
|
||||||
{
|
{
|
||||||
const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
const u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||||
u32 size = gBattlescriptCurrInstr[9];
|
u32 size = gBattlescriptCurrInstr[9];
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||||
|
|
||||||
u8 i;
|
u8 i;
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
@@ -3642,10 +3642,10 @@ static void Cmd_jumpifarrayequal(void)
|
|||||||
static void Cmd_jumpifarraynotequal(void)
|
static void Cmd_jumpifarraynotequal(void)
|
||||||
{
|
{
|
||||||
u8 equalBytes = 0;
|
u8 equalBytes = 0;
|
||||||
const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
const u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||||
u32 size = gBattlescriptCurrInstr[9];
|
u32 size = gBattlescriptCurrInstr[9];
|
||||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||||
|
|
||||||
u8 i;
|
u8 i;
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
@@ -3663,7 +3663,7 @@ static void Cmd_jumpifarraynotequal(void)
|
|||||||
|
|
||||||
static void Cmd_setbyte(void)
|
static void Cmd_setbyte(void)
|
||||||
{
|
{
|
||||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
*memByte = gBattlescriptCurrInstr[5];
|
*memByte = gBattlescriptCurrInstr[5];
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 6;
|
gBattlescriptCurrInstr += 6;
|
||||||
@@ -3671,22 +3671,22 @@ static void Cmd_setbyte(void)
|
|||||||
|
|
||||||
static void Cmd_addbyte(void)
|
static void Cmd_addbyte(void)
|
||||||
{
|
{
|
||||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
*memByte += gBattlescriptCurrInstr[5];
|
*memByte += gBattlescriptCurrInstr[5];
|
||||||
gBattlescriptCurrInstr += 6;
|
gBattlescriptCurrInstr += 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Cmd_subbyte(void)
|
static void Cmd_subbyte(void)
|
||||||
{
|
{
|
||||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
*memByte -= gBattlescriptCurrInstr[5];
|
*memByte -= gBattlescriptCurrInstr[5];
|
||||||
gBattlescriptCurrInstr += 6;
|
gBattlescriptCurrInstr += 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Cmd_copyarray(void)
|
static void Cmd_copyarray(void)
|
||||||
{
|
{
|
||||||
u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||||
s32 size = gBattlescriptCurrInstr[9];
|
s32 size = gBattlescriptCurrInstr[9];
|
||||||
|
|
||||||
s32 i;
|
s32 i;
|
||||||
@@ -3698,9 +3698,9 @@ static void Cmd_copyarray(void)
|
|||||||
|
|
||||||
static void Cmd_copyarraywithindex(void)
|
static void Cmd_copyarraywithindex(void)
|
||||||
{
|
{
|
||||||
u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||||
const u8* index = T2_READ_PTR(gBattlescriptCurrInstr + 9);
|
const u8 *index = T2_READ_PTR(gBattlescriptCurrInstr + 9);
|
||||||
s32 size = gBattlescriptCurrInstr[13];
|
s32 size = gBattlescriptCurrInstr[13];
|
||||||
|
|
||||||
s32 i;
|
s32 i;
|
||||||
@@ -3712,14 +3712,14 @@ static void Cmd_copyarraywithindex(void)
|
|||||||
|
|
||||||
static void Cmd_orbyte(void)
|
static void Cmd_orbyte(void)
|
||||||
{
|
{
|
||||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
*memByte |= gBattlescriptCurrInstr[5];
|
*memByte |= gBattlescriptCurrInstr[5];
|
||||||
gBattlescriptCurrInstr += 6;
|
gBattlescriptCurrInstr += 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Cmd_orhalfword(void)
|
static void Cmd_orhalfword(void)
|
||||||
{
|
{
|
||||||
u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
u16 val = T2_READ_16(gBattlescriptCurrInstr + 5);
|
u16 val = T2_READ_16(gBattlescriptCurrInstr + 5);
|
||||||
|
|
||||||
*memHword |= val;
|
*memHword |= val;
|
||||||
@@ -3728,7 +3728,7 @@ static void Cmd_orhalfword(void)
|
|||||||
|
|
||||||
static void Cmd_orword(void)
|
static void Cmd_orword(void)
|
||||||
{
|
{
|
||||||
u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
u32 val = T2_READ_32(gBattlescriptCurrInstr + 5);
|
u32 val = T2_READ_32(gBattlescriptCurrInstr + 5);
|
||||||
|
|
||||||
*memWord |= val;
|
*memWord |= val;
|
||||||
@@ -3737,14 +3737,14 @@ static void Cmd_orword(void)
|
|||||||
|
|
||||||
static void Cmd_bicbyte(void)
|
static void Cmd_bicbyte(void)
|
||||||
{
|
{
|
||||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
*memByte &= ~(gBattlescriptCurrInstr[5]);
|
*memByte &= ~(gBattlescriptCurrInstr[5]);
|
||||||
gBattlescriptCurrInstr += 6;
|
gBattlescriptCurrInstr += 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Cmd_bichalfword(void)
|
static void Cmd_bichalfword(void)
|
||||||
{
|
{
|
||||||
u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
u16 val = T2_READ_16(gBattlescriptCurrInstr + 5);
|
u16 val = T2_READ_16(gBattlescriptCurrInstr + 5);
|
||||||
|
|
||||||
*memHword &= ~val;
|
*memHword &= ~val;
|
||||||
@@ -3753,7 +3753,7 @@ static void Cmd_bichalfword(void)
|
|||||||
|
|
||||||
static void Cmd_bicword(void)
|
static void Cmd_bicword(void)
|
||||||
{
|
{
|
||||||
u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
u32 val = T2_READ_32(gBattlescriptCurrInstr + 5);
|
u32 val = T2_READ_32(gBattlescriptCurrInstr + 5);
|
||||||
|
|
||||||
*memWord &= ~val;
|
*memWord &= ~val;
|
||||||
@@ -3848,7 +3848,7 @@ static void Cmd_endselectionscript(void)
|
|||||||
|
|
||||||
static void Cmd_playanimation(void)
|
static void Cmd_playanimation(void)
|
||||||
{
|
{
|
||||||
const u16* argumentPtr;
|
const u16 *argumentPtr;
|
||||||
|
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||||
@@ -3891,8 +3891,8 @@ static void Cmd_playanimation(void)
|
|||||||
// Same as playanimation, except it takes a pointer to some animation id, instead of taking the value directly
|
// Same as playanimation, except it takes a pointer to some animation id, instead of taking the value directly
|
||||||
static void Cmd_playanimation_var(void)
|
static void Cmd_playanimation_var(void)
|
||||||
{
|
{
|
||||||
const u16* argumentPtr;
|
const u16 *argumentPtr;
|
||||||
const u8* animationIdPtr;
|
const u8 *animationIdPtr;
|
||||||
|
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
animationIdPtr = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
animationIdPtr = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||||
@@ -4164,7 +4164,7 @@ static void Cmd_moveend(void)
|
|||||||
case MOVEEND_CHANGED_ITEMS: // changed held items
|
case MOVEEND_CHANGED_ITEMS: // changed held items
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
u16* changedItem = &gBattleStruct->changedItems[i];
|
u16 *changedItem = &gBattleStruct->changedItems[i];
|
||||||
if (*changedItem != ITEM_NONE)
|
if (*changedItem != ITEM_NONE)
|
||||||
{
|
{
|
||||||
gBattleMons[i].item = *changedItem;
|
gBattleMons[i].item = *changedItem;
|
||||||
@@ -4297,11 +4297,11 @@ static void Cmd_moveend(void)
|
|||||||
|
|
||||||
target = gBattlerTarget;
|
target = gBattlerTarget;
|
||||||
attacker = gBattlerAttacker;
|
attacker = gBattlerAttacker;
|
||||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove;
|
*(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove;
|
||||||
|
|
||||||
target = gBattlerTarget;
|
target = gBattlerTarget;
|
||||||
attacker = gBattlerAttacker;
|
attacker = gBattlerAttacker;
|
||||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8;
|
*(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8;
|
||||||
}
|
}
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
break;
|
break;
|
||||||
@@ -4475,7 +4475,7 @@ static void Cmd_switchindataupdate(void)
|
|||||||
|
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
oldData = gBattleMons[gActiveBattler];
|
oldData = gBattleMons[gActiveBattler];
|
||||||
monData = (u8*)(&gBattleMons[gActiveBattler]);
|
monData = (u8 *)(&gBattleMons[gActiveBattler]);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
||||||
monData[i] = gBattleBufferB[gActiveBattler][4 + i];
|
monData[i] = gBattleBufferB[gActiveBattler][4 + i];
|
||||||
@@ -4937,9 +4937,9 @@ static void Cmd_switchhandleorder(void)
|
|||||||
|
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||||
{
|
{
|
||||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
|
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
|
||||||
|
|
||||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0);
|
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0);
|
||||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
||||||
@@ -5019,7 +5019,7 @@ static void Cmd_switchineffects(void)
|
|||||||
|
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
u16* hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(i)];
|
u16 *hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(i)];
|
||||||
*hpOnSwitchout = gBattleMons[i].hp;
|
*hpOnSwitchout = gBattleMons[i].hp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5640,7 +5640,7 @@ static void Cmd_adjustsetdamage(void) // The same as adjustnormaldamage, except
|
|||||||
|
|
||||||
static void Cmd_removeitem(void)
|
static void Cmd_removeitem(void)
|
||||||
{
|
{
|
||||||
u16* usedHeldItem;
|
u16 *usedHeldItem;
|
||||||
|
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
|
|
||||||
@@ -5888,14 +5888,14 @@ static bool8 SlideOutLevelUpBanner(void)
|
|||||||
static void PutMonIconOnLvlUpBanner(void)
|
static void PutMonIconOnLvlUpBanner(void)
|
||||||
{
|
{
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
const u16* iconPal;
|
const u16 *iconPal;
|
||||||
struct SpriteSheet iconSheet;
|
struct SpriteSheet iconSheet;
|
||||||
struct SpritePalette iconPalSheet;
|
struct SpritePalette iconPalSheet;
|
||||||
|
|
||||||
u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES);
|
u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES);
|
||||||
u32 personality = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_PERSONALITY);
|
u32 personality = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_PERSONALITY);
|
||||||
|
|
||||||
const u8* iconPtr = GetMonIconPtr(species, personality, 1);
|
const u8 *iconPtr = GetMonIconPtr(species, personality, 1);
|
||||||
iconSheet.data = iconPtr;
|
iconSheet.data = iconPtr;
|
||||||
iconSheet.size = 0x200;
|
iconSheet.size = 0x200;
|
||||||
iconSheet.tag = TAG_LVLUP_BANNER_MON_ICON;
|
iconSheet.tag = TAG_LVLUP_BANNER_MON_ICON;
|
||||||
@@ -6329,7 +6329,7 @@ static void Cmd_jumpifnexttargetvalid(void)
|
|||||||
|
|
||||||
static void Cmd_tryhealhalfhealth(void)
|
static void Cmd_tryhealhalfhealth(void)
|
||||||
{
|
{
|
||||||
const u8* failPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u8 *failPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
|
|
||||||
if (gBattlescriptCurrInstr[5] == BS_ATTACKER)
|
if (gBattlescriptCurrInstr[5] == BS_ATTACKER)
|
||||||
gBattlerTarget = gBattlerAttacker;
|
gBattlerTarget = gBattlerAttacker;
|
||||||
@@ -6501,7 +6501,7 @@ static void Cmd_trysetrest(void)
|
|||||||
|
|
||||||
static void Cmd_jumpifnotfirstturn(void)
|
static void Cmd_jumpifnotfirstturn(void)
|
||||||
{
|
{
|
||||||
const u8* failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u8 *failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
|
|
||||||
if (gDisableStructs[gBattlerAttacker].isFirstTurn)
|
if (gDisableStructs[gBattlerAttacker].isFirstTurn)
|
||||||
gBattlescriptCurrInstr += 5;
|
gBattlescriptCurrInstr += 5;
|
||||||
@@ -6583,7 +6583,7 @@ static void Cmd_stockpile(void)
|
|||||||
|
|
||||||
static void Cmd_stockpiletobasedamage(void)
|
static void Cmd_stockpiletobasedamage(void)
|
||||||
{
|
{
|
||||||
const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0)
|
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = jumpPtr;
|
gBattlescriptCurrInstr = jumpPtr;
|
||||||
@@ -6609,7 +6609,7 @@ static void Cmd_stockpiletobasedamage(void)
|
|||||||
|
|
||||||
static void Cmd_stockpiletohpheal(void)
|
static void Cmd_stockpiletohpheal(void)
|
||||||
{
|
{
|
||||||
const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
|
|
||||||
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0)
|
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0)
|
||||||
{
|
{
|
||||||
@@ -6821,7 +6821,7 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
|
|||||||
|
|
||||||
static void Cmd_statbuffchange(void)
|
static void Cmd_statbuffchange(void)
|
||||||
{
|
{
|
||||||
const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
|
const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||||
if (ChangeStatBuffs(gBattleScripting.statChanger & 0xF0, GET_STAT_BUFF_ID(gBattleScripting.statChanger), gBattlescriptCurrInstr[1], jumpPtr) == STAT_CHANGE_WORKED)
|
if (ChangeStatBuffs(gBattleScripting.statChanger & 0xF0, GET_STAT_BUFF_ID(gBattleScripting.statChanger), gBattlescriptCurrInstr[1], jumpPtr) == STAT_CHANGE_WORKED)
|
||||||
gBattlescriptCurrInstr += 6;
|
gBattlescriptCurrInstr += 6;
|
||||||
}
|
}
|
||||||
@@ -7417,8 +7417,8 @@ static void Cmd_transformdataexecution(void)
|
|||||||
|
|
||||||
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].species)
|
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].species)
|
||||||
|
|
||||||
battleMonAttacker = (u8*)(&gBattleMons[gBattlerAttacker]);
|
battleMonAttacker = (u8 *)(&gBattleMons[gBattlerAttacker]);
|
||||||
battleMonTarget = (u8*)(&gBattleMons[gBattlerTarget]);
|
battleMonTarget = (u8 *)(&gBattleMons[gBattlerTarget]);
|
||||||
|
|
||||||
for (i = 0; i < offsetof(struct BattlePokemon, pp); i++)
|
for (i = 0; i < offsetof(struct BattlePokemon, pp); i++)
|
||||||
battleMonAttacker[i] = battleMonTarget[i];
|
battleMonAttacker[i] = battleMonTarget[i];
|
||||||
@@ -7675,7 +7675,7 @@ static void Cmd_painsplitdmgcalc(void)
|
|||||||
{
|
{
|
||||||
s32 hpDiff = (gBattleMons[gBattlerAttacker].hp + gBattleMons[gBattlerTarget].hp) / 2;
|
s32 hpDiff = (gBattleMons[gBattlerAttacker].hp + gBattleMons[gBattlerTarget].hp) / 2;
|
||||||
s32 painSplitHp = gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - hpDiff;
|
s32 painSplitHp = gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - hpDiff;
|
||||||
u8* storeLoc = (void*)(&gBattleScripting.painSplitHp);
|
u8 *storeLoc = (void*)(&gBattleScripting.painSplitHp);
|
||||||
|
|
||||||
storeLoc[0] = (painSplitHp);
|
storeLoc[0] = (painSplitHp);
|
||||||
storeLoc[1] = (painSplitHp & 0x0000FF00) >> 8;
|
storeLoc[1] = (painSplitHp & 0x0000FF00) >> 8;
|
||||||
@@ -8849,11 +8849,11 @@ static void Cmd_tryswapitems(void) // trick
|
|||||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item);
|
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item);
|
||||||
MarkBattlerForControllerExec(gBattlerTarget);
|
MarkBattlerForControllerExec(gBattlerTarget);
|
||||||
|
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
||||||
|
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 0) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 0) = 0;
|
||||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 1) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 1) = 0;
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 5;
|
gBattlescriptCurrInstr += 5;
|
||||||
|
|
||||||
@@ -9080,7 +9080,7 @@ static void Cmd_assistattackselect(void)
|
|||||||
s32 chooseableMovesNo = 0;
|
s32 chooseableMovesNo = 0;
|
||||||
struct Pokemon* party;
|
struct Pokemon* party;
|
||||||
s32 monId, moveId;
|
s32 monId, moveId;
|
||||||
u16* validMoves = gBattleStruct->assistPossibleMoves;
|
u16 *validMoves = gBattleStruct->assistPossibleMoves;
|
||||||
|
|
||||||
if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER)
|
if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER)
|
||||||
party = gEnemyParty;
|
party = gEnemyParty;
|
||||||
|
|||||||
@@ -883,7 +883,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
|
|||||||
{
|
{
|
||||||
for (destX16 = destX; destX16 < (destX + width); destX16++)
|
for (destX16 = destX; destX16 < (destX + width); destX16++)
|
||||||
{
|
{
|
||||||
((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *(srcCopy)++;
|
((u16 *)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *(srcCopy)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -896,7 +896,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
|
|||||||
{
|
{
|
||||||
for (destX16 = destX; destX16 < (destX + width); destX16++)
|
for (destX16 = destX; destX16 < (destX + width); destX16++)
|
||||||
{
|
{
|
||||||
((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *(srcCopy)++;
|
((u8 *)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *(srcCopy)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -944,7 +944,7 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
|
|||||||
{
|
{
|
||||||
for (j = destX; j < (destX + rectWidth); j++)
|
for (j = destX; j < (destX + rectWidth); j++)
|
||||||
{
|
{
|
||||||
*(u8*)(sGpuBgConfigs2[bg].tilemap + ((var * i) + j)) = *(u8*)(srcPtr) + tileOffset;
|
*(u8 *)(sGpuBgConfigs2[bg].tilemap + ((var * i) + j)) = *(u8 *)(srcPtr) + tileOffset;
|
||||||
srcPtr++;
|
srcPtr++;
|
||||||
}
|
}
|
||||||
srcPtr += (srcWidth - rectWidth);
|
srcPtr += (srcWidth - rectWidth);
|
||||||
@@ -969,7 +969,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
|
|||||||
{
|
{
|
||||||
for (x16 = x; x16 < (x + width); x16++)
|
for (x16 = x; x16 < (x + width); x16++)
|
||||||
{
|
{
|
||||||
((u16*)sGpuBgConfigs2[bg].tilemap)[((y16 * 0x20) + x16)] = tileNum;
|
((u16 *)sGpuBgConfigs2[bg].tilemap)[((y16 * 0x20) + x16)] = tileNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -979,7 +979,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
|
|||||||
{
|
{
|
||||||
for (x16 = x; x16 < (x + width); x16++)
|
for (x16 = x; x16 < (x + width); x16++)
|
||||||
{
|
{
|
||||||
((u8*)sGpuBgConfigs2[bg].tilemap)[((y16 * mode) + x16)] = tileNum;
|
((u8 *)sGpuBgConfigs2[bg].tilemap)[((y16 * mode) + x16)] = tileNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1014,7 +1014,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
|||||||
{
|
{
|
||||||
for (x16 = x; x16 < (x + width); x16++)
|
for (x16 = x; x16 < (x + width); x16++)
|
||||||
{
|
{
|
||||||
CopyTileMapEntry(&firstTileNum, &((u16*)sGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0);
|
CopyTileMapEntry(&firstTileNum, &((u16 *)sGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0);
|
||||||
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF);
|
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1025,7 +1025,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
|||||||
{
|
{
|
||||||
for (x16 = x; x16 < (x + width); x16++)
|
for (x16 = x; x16 < (x + width); x16++)
|
||||||
{
|
{
|
||||||
((u8*)sGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum;
|
((u8 *)sGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum;
|
||||||
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF);
|
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -67,7 +67,7 @@ static void SpriteCB_Egg_3(struct Sprite* sprite);
|
|||||||
static void SpriteCB_Egg_4(struct Sprite* sprite);
|
static void SpriteCB_Egg_4(struct Sprite* sprite);
|
||||||
static void SpriteCB_Egg_5(struct Sprite* sprite);
|
static void SpriteCB_Egg_5(struct Sprite* sprite);
|
||||||
static void SpriteCB_EggShard(struct Sprite* sprite);
|
static void SpriteCB_EggShard(struct Sprite* sprite);
|
||||||
static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed);
|
static void EggHatchPrintMessage(u8 windowId, u8 *string, u8 x, u8 y, u8 speed);
|
||||||
static void CreateRandomEggShardSprite(void);
|
static void CreateRandomEggShardSprite(void);
|
||||||
static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 spriteAnimIndex);
|
static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 spriteAnimIndex);
|
||||||
|
|
||||||
@@ -1710,7 +1710,7 @@ bool8 DaycareMonReceivedMail(void)
|
|||||||
|
|
||||||
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
||||||
|
|
||||||
static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc)
|
static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16 *speciesLoc)
|
||||||
{
|
{
|
||||||
u8 r4 = 0;
|
u8 r4 = 0;
|
||||||
u8 spriteID = 0; // r7
|
u8 spriteID = 0; // r7
|
||||||
@@ -2153,7 +2153,7 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8
|
|||||||
StartSpriteAnim(&gSprites[spriteID], spriteAnimIndex);
|
StartSpriteAnim(&gSprites[spriteID], spriteAnimIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed)
|
static void EggHatchPrintMessage(u8 windowId, u8 *string, u8 x, u8 y, u8 speed)
|
||||||
{
|
{
|
||||||
FillWindowPixelBuffer(windowId, 0xFF);
|
FillWindowPixelBuffer(windowId, 0xFF);
|
||||||
sEggHatchData->textColor[0] = 0;
|
sEggHatchData->textColor[0] = 0;
|
||||||
|
|||||||
+2
-2
@@ -265,7 +265,7 @@ bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src
|
|||||||
struct SpriteSheet dest;
|
struct SpriteSheet dest;
|
||||||
void* buffer;
|
void* buffer;
|
||||||
|
|
||||||
buffer = AllocZeroed(*((u32*)src->data) >> 8);
|
buffer = AllocZeroed(*((u32 *)src->data) >> 8);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
LZ77UnCompWram(src->data, buffer);
|
LZ77UnCompWram(src->data, buffer);
|
||||||
@@ -282,7 +282,7 @@ bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette
|
|||||||
struct SpritePalette dest;
|
struct SpritePalette dest;
|
||||||
void* buffer;
|
void* buffer;
|
||||||
|
|
||||||
buffer = AllocZeroed(*((u32*)src->data) >> 8);
|
buffer = AllocZeroed(*((u32 *)src->data) >> 8);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
LZ77UnCompWram(src->data, buffer);
|
LZ77UnCompWram(src->data, buffer);
|
||||||
|
|||||||
+17
-17
@@ -33,20 +33,20 @@ static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *, s16, s16);
|
|||||||
static void CalcWhetherObjectIsOffscreen(struct ObjectEvent *, struct Sprite *);
|
static void CalcWhetherObjectIsOffscreen(struct ObjectEvent *, struct Sprite *);
|
||||||
static void UpdateObjEventSpriteVisibility(struct ObjectEvent *, struct Sprite *);
|
static void UpdateObjEventSpriteVisibility(struct ObjectEvent *, struct Sprite *);
|
||||||
static void ObjectEventUpdateMetatileBehaviors(struct ObjectEvent*);
|
static void ObjectEventUpdateMetatileBehaviors(struct ObjectEvent*);
|
||||||
static void GetGroundEffectFlags_Reflection(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_Reflection(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_TallGrassOnSpawn(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_TallGrassOnSpawn(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_LongGrassOnSpawn(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_LongGrassOnSpawn(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_SandHeap(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_SandHeap(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_ShallowFlowingWater(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_ShallowFlowingWater(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_ShortGrass(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_ShortGrass(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_HotSprings(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_HotSprings(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_TallGrassOnBeginStep(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_TallGrassOnBeginStep(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_Tracks(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_Tracks(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_Puddle(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_Puddle(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_Ripple(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_Ripple(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_Seaweed(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_Seaweed(struct ObjectEvent*, u32 *);
|
||||||
static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent*, u32 *);
|
||||||
static u8 ObjectEventCheckForReflectiveSurface(struct ObjectEvent*);
|
static u8 ObjectEventCheckForReflectiveSurface(struct ObjectEvent*);
|
||||||
static u8 GetReflectionTypeByMetatileBehavior(u32);
|
static u8 GetReflectionTypeByMetatileBehavior(u32);
|
||||||
static void InitObjectPriorityByZCoord(struct Sprite *sprite, u8 z);
|
static void InitObjectPriorityByZCoord(struct Sprite *sprite, u8 z);
|
||||||
@@ -2081,9 +2081,9 @@ void ShowOrHideObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 stat
|
|||||||
|
|
||||||
void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup)
|
void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup)
|
||||||
{
|
{
|
||||||
*(u8*)(localId) = objectEvent->localId;
|
*(u8 *)(localId) = objectEvent->localId;
|
||||||
*(u8*)(mapNum) = objectEvent->mapNum;
|
*(u8 *)(mapNum) = objectEvent->mapNum;
|
||||||
*(u8*)(mapGroup) = objectEvent->mapGroup;
|
*(u8 *)(mapGroup) = objectEvent->mapGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnableObjectGroundEffectsByXY(s16 x, s16 y)
|
void EnableObjectGroundEffectsByXY(s16 x, s16 y)
|
||||||
|
|||||||
+1
-1
@@ -2605,7 +2605,7 @@ static void ShowMonEffect_Outdoors_1(struct Task * task)
|
|||||||
{
|
{
|
||||||
task->data[11] = GetGpuReg(REG_OFFSET_WININ);
|
task->data[11] = GetGpuReg(REG_OFFSET_WININ);
|
||||||
task->data[12] = GetGpuReg(REG_OFFSET_WINOUT);
|
task->data[12] = GetGpuReg(REG_OFFSET_WINOUT);
|
||||||
StoreWordInTwoHalfwords((u16*)&task->data[13], (u32)gMain.vblankCallback);
|
StoreWordInTwoHalfwords((u16 *)&task->data[13], (u32)gMain.vblankCallback);
|
||||||
task->data[1] = WIN_RANGE(0xF0, 0xF1);
|
task->data[1] = WIN_RANGE(0xF0, 0xF1);
|
||||||
task->data[2] = WIN_RANGE(0x50, 0x51);
|
task->data[2] = WIN_RANGE(0x50, 0x51);
|
||||||
task->data[3] = WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR;
|
task->data[3] = WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR;
|
||||||
|
|||||||
+3
-3
@@ -889,17 +889,17 @@ static void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u1
|
|||||||
if (tileset->isSecondary == FALSE)
|
if (tileset->isSecondary == FALSE)
|
||||||
{
|
{
|
||||||
LoadPalette(&black, destOffset, 2);
|
LoadPalette(&black, destOffset, 2);
|
||||||
LoadPalette(((u16*)tileset->palettes) + 1, destOffset + 1, size - 2);
|
LoadPalette(((u16 *)tileset->palettes) + 1, destOffset + 1, size - 2);
|
||||||
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset + 1, (size - 2) >> 1);
|
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset + 1, (size - 2) >> 1);
|
||||||
}
|
}
|
||||||
else if (tileset->isSecondary == TRUE)
|
else if (tileset->isSecondary == TRUE)
|
||||||
{
|
{
|
||||||
LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size);
|
LoadPalette(((u16 *)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size);
|
||||||
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LoadCompressedPalette((u32*)tileset->palettes, destOffset, size);
|
LoadCompressedPalette((u32 *)tileset->palettes, destOffset, size);
|
||||||
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -49,8 +49,8 @@ void DestroyHelpMessageWindow(u8 a0)
|
|||||||
|
|
||||||
void sub_8112F18(u8 windowId)
|
void sub_8112F18(u8 windowId)
|
||||||
{
|
{
|
||||||
const u8* ptr = gUnknown_84566A8;
|
const u8 *ptr = gUnknown_84566A8;
|
||||||
u8* buffer;
|
u8 *buffer;
|
||||||
u8 i, j;
|
u8 i, j;
|
||||||
u8 width, height;
|
u8 width, height;
|
||||||
u8 k;
|
u8 k;
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ static void ApplyImageEffect_PersonalityColor(u8);
|
|||||||
static void ApplyImageEffect_RedChannelGrayscale(u8);
|
static void ApplyImageEffect_RedChannelGrayscale(u8);
|
||||||
static void ApplyImageEffect_RedChannelGrayscaleHighlight(u8);
|
static void ApplyImageEffect_RedChannelGrayscaleHighlight(u8);
|
||||||
static void AddPointillismPoints(u16);
|
static void AddPointillismPoints(u16);
|
||||||
static u16 ConvertColorToGrayscale(u16*);
|
static u16 ConvertColorToGrayscale(u16 *);
|
||||||
static u16 QuantizePixel_Blur(u16*, u16*, u16*);
|
static u16 QuantizePixel_Blur(u16 *, u16 *, u16 *);
|
||||||
static u16 QuantizePixel_PersonalityColor(u16*, u8);
|
static u16 QuantizePixel_PersonalityColor(u16 *, u8);
|
||||||
static u16 QuantizePixel_BlackAndWhite(u16*);
|
static u16 QuantizePixel_BlackAndWhite(u16 *);
|
||||||
static u16 QuantizePixel_BlackOutline(u16*, u16*);
|
static u16 QuantizePixel_BlackOutline(u16 *, u16 *);
|
||||||
static u16 QuantizePixel_Invert(u16*);
|
static u16 QuantizePixel_Invert(u16 *);
|
||||||
static u16 QuantizePixel_BlurHard(u16*, u16*, u16*);
|
static u16 QuantizePixel_BlurHard(u16 *, u16 *, u16 *);
|
||||||
static u16 QuantizePixel_MotionBlur(u16*, u16*);
|
static u16 QuantizePixel_MotionBlur(u16 *, u16 *);
|
||||||
static u16 GetColorFromPersonality(u8);
|
static u16 GetColorFromPersonality(u8);
|
||||||
static void QuantizePalette_Standard(bool8);
|
static void QuantizePalette_Standard(bool8);
|
||||||
static void SetPresetPalette_PrimaryColors(void);
|
static void SetPresetPalette_PrimaryColors(void);
|
||||||
@@ -44,10 +44,10 @@ static void SetPresetPalette_GrayscaleSmall(void);
|
|||||||
static void QuantizePalette_GrayscaleSmall(void);
|
static void QuantizePalette_GrayscaleSmall(void);
|
||||||
static void SetPresetPalette_BlackAndWhite(void);
|
static void SetPresetPalette_BlackAndWhite(void);
|
||||||
static void QuantizePalette_BlackAndWhite(void);
|
static void QuantizePalette_BlackAndWhite(void);
|
||||||
static u16 QuantizePixel_Standard(u16*);
|
static u16 QuantizePixel_Standard(u16 *);
|
||||||
static u16 QuantizePixel_GrayscaleSmall(u16*);
|
static u16 QuantizePixel_GrayscaleSmall(u16 *);
|
||||||
static u16 QuantizePixel_Grayscale(u16*);
|
static u16 QuantizePixel_Grayscale(u16 *);
|
||||||
static u16 QuantizePixel_PrimaryColors(u16*);
|
static u16 QuantizePixel_PrimaryColors(u16 *);
|
||||||
|
|
||||||
static const u8 sPointillismPoints[][3] = {
|
static const u8 sPointillismPoints[][3] = {
|
||||||
{0x00, 0x1d, 0x1c},
|
{0x00, 0x1d, 0x1c},
|
||||||
@@ -4288,7 +4288,7 @@ static u16 QuantizePixel_Standard(u16 *pixel)
|
|||||||
return RGB2(red, green, blue);
|
return RGB2(red, green, blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 QuantizePixel_PrimaryColors(u16* color)
|
static u16 QuantizePixel_PrimaryColors(u16 *color)
|
||||||
{
|
{
|
||||||
u16 red = *color & 0x1F;
|
u16 red = *color & 0x1F;
|
||||||
u16 green = (*color >> 5) & 0x1F;
|
u16 green = (*color >> 5) & 0x1F;
|
||||||
|
|||||||
+1
-1
@@ -160,7 +160,7 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP
|
|||||||
/*
|
/*
|
||||||
void NoCashGBAPrint(const char *pBuf)
|
void NoCashGBAPrint(const char *pBuf)
|
||||||
{
|
{
|
||||||
*(volatile u32*)NOCASHGBAPRINTADDR2 = (u32)pBuf;
|
*(volatile u32 *)NOCASHGBAPRINTADDR2 = (u32)pBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoCashGBAPrintf(const char *pBuf, ...)
|
void NoCashGBAPrintf(const char *pBuf, ...)
|
||||||
|
|||||||
+16
-16
@@ -40,7 +40,7 @@ static void sio32intr_clock_master(void)
|
|||||||
{
|
{
|
||||||
if (gSTWIStatus->reqNext <= gSTWIStatus->reqLength)
|
if (gSTWIStatus->reqNext <= gSTWIStatus->reqLength)
|
||||||
{
|
{
|
||||||
REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket->rfuPacket8.data)[gSTWIStatus->reqNext];
|
REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket->rfuPacket8.data)[gSTWIStatus->reqNext];
|
||||||
gSTWIStatus->reqNext++;
|
gSTWIStatus->reqNext++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -61,7 +61,7 @@ static void sio32intr_clock_master(void)
|
|||||||
if ((regSIODATA32 & 0xFFFF0000) == 0x99660000)
|
if ((regSIODATA32 & 0xFFFF0000) == 0x99660000)
|
||||||
{
|
{
|
||||||
gSTWIStatus->ackNext = 0;
|
gSTWIStatus->ackNext = 0;
|
||||||
((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
||||||
gSTWIStatus->ackNext++;
|
gSTWIStatus->ackNext++;
|
||||||
gSTWIStatus->ackActiveCommand = regSIODATA32;
|
gSTWIStatus->ackActiveCommand = regSIODATA32;
|
||||||
gSTWIStatus->ackLength = ackLen = regSIODATA32 >> 8;
|
gSTWIStatus->ackLength = ackLen = regSIODATA32 >> 8;
|
||||||
@@ -84,7 +84,7 @@ static void sio32intr_clock_master(void)
|
|||||||
}
|
}
|
||||||
else if (gSTWIStatus->state == 2) // master receive ack
|
else if (gSTWIStatus->state == 2) // master receive ack
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
||||||
gSTWIStatus->ackNext++;
|
gSTWIStatus->ackNext++;
|
||||||
if (gSTWIStatus->ackLength < gSTWIStatus->ackNext)
|
if (gSTWIStatus->ackLength < gSTWIStatus->ackNext)
|
||||||
gSTWIStatus->state = 3; // master done ack
|
gSTWIStatus->state = 3; // master done ack
|
||||||
@@ -157,7 +157,7 @@ static void sio32intr_clock_slave(void)
|
|||||||
regSIODATA32 = REG_SIODATA32;
|
regSIODATA32 = REG_SIODATA32;
|
||||||
if (gSTWIStatus->state == 5) // slave receive req init
|
if (gSTWIStatus->state == 5) // slave receive req init
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->rxPacket)[0] = regSIODATA32;
|
((u32 *)gSTWIStatus->rxPacket)[0] = regSIODATA32;
|
||||||
gSTWIStatus->reqNext = 1;
|
gSTWIStatus->reqNext = 1;
|
||||||
r0 = 0x99660000;
|
r0 = 0x99660000;
|
||||||
// variable reuse required
|
// variable reuse required
|
||||||
@@ -178,24 +178,24 @@ static void sio32intr_clock_slave(void)
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80;
|
gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80;
|
||||||
((u32*)gSTWIStatus->txPacket)[0] = 0x99660000 + gSTWIStatus->ackActiveCommand;
|
((u32 *)gSTWIStatus->txPacket)[0] = 0x99660000 + gSTWIStatus->ackActiveCommand;
|
||||||
gSTWIStatus->ackLength = 0;
|
gSTWIStatus->ackLength = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
((u32 *)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
||||||
if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D)
|
if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D)
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->txPacket)[1] = 1;
|
((u32 *)gSTWIStatus->txPacket)[1] = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->txPacket)[1] = 2;
|
((u32 *)gSTWIStatus->txPacket)[1] = 2;
|
||||||
}
|
}
|
||||||
gSTWIStatus->ackLength = 1;
|
gSTWIStatus->ackLength = 1;
|
||||||
gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION;
|
gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION;
|
||||||
}
|
}
|
||||||
REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[0];
|
REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[0];
|
||||||
gSTWIStatus->ackNext = 1;
|
gSTWIStatus->ackNext = 1;
|
||||||
gSTWIStatus->state = 7; // slave send ack
|
gSTWIStatus->state = 7; // slave send ack
|
||||||
}
|
}
|
||||||
@@ -215,7 +215,7 @@ static void sio32intr_clock_slave(void)
|
|||||||
}
|
}
|
||||||
else if (gSTWIStatus->state == 6) // slave receive req
|
else if (gSTWIStatus->state == 6) // slave receive req
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->reqNext] = regSIODATA32;
|
((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->reqNext] = regSIODATA32;
|
||||||
gSTWIStatus->reqNext++;
|
gSTWIStatus->reqNext++;
|
||||||
if (gSTWIStatus->reqLength < gSTWIStatus->reqNext)
|
if (gSTWIStatus->reqLength < gSTWIStatus->reqNext)
|
||||||
{
|
{
|
||||||
@@ -226,24 +226,24 @@ static void sio32intr_clock_slave(void)
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80;
|
gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80;
|
||||||
((u32*)gSTWIStatus->txPacket)[0] = 0x99660000 | gSTWIStatus->ackActiveCommand;
|
((u32 *)gSTWIStatus->txPacket)[0] = 0x99660000 | gSTWIStatus->ackActiveCommand;
|
||||||
gSTWIStatus->ackLength = 0;
|
gSTWIStatus->ackLength = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
((u32 *)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
||||||
if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D)
|
if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D)
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->txPacket)[1] = 1;
|
((u32 *)gSTWIStatus->txPacket)[1] = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
((u32*)gSTWIStatus->txPacket)[1] = 2;
|
((u32 *)gSTWIStatus->txPacket)[1] = 2;
|
||||||
}
|
}
|
||||||
gSTWIStatus->ackLength = 1;
|
gSTWIStatus->ackLength = 1;
|
||||||
gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION;
|
gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION;
|
||||||
}
|
}
|
||||||
REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[0];
|
REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[0];
|
||||||
gSTWIStatus->ackNext = 1;
|
gSTWIStatus->ackNext = 1;
|
||||||
gSTWIStatus->state = 7; // slave send ack
|
gSTWIStatus->state = 7; // slave send ack
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ static void sio32intr_clock_slave(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[gSTWIStatus->ackNext];
|
REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[gSTWIStatus->ackNext];
|
||||||
gSTWIStatus->ackNext++;
|
gSTWIStatus->ackNext++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -235,7 +235,7 @@ void STWI_send_SystemConfigREQ(u16 availSlotFlag, u8 maxMFrame, u8 mcTimer)
|
|||||||
packetBytes += sizeof(u32);
|
packetBytes += sizeof(u32);
|
||||||
*packetBytes++ = mcTimer;
|
*packetBytes++ = mcTimer;
|
||||||
*packetBytes++ = maxMFrame;
|
*packetBytes++ = maxMFrame;
|
||||||
*(u16*)packetBytes = availSlotFlag;
|
*(u16 *)packetBytes = availSlotFlag;
|
||||||
STWI_start_Command();
|
STWI_start_Command();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -280,7 +280,7 @@ static void Task_LinkLeaderSearchForChildren(u8 taskId)
|
|||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
rfu_LMAN_establishConnection(Rfu.parent_child, 0, 240, (u16*)sAcceptedSerialNos);
|
rfu_LMAN_establishConnection(Rfu.parent_child, 0, 240, (u16 *)sAcceptedSerialNos);
|
||||||
Rfu.state = 3;
|
Rfu.state = 3;
|
||||||
gTasks[taskId].data[1] = 6;
|
gTasks[taskId].data[1] = 6;
|
||||||
break;
|
break;
|
||||||
@@ -371,7 +371,7 @@ static void Task_JoinGroupSearchForParent(u8 taskId)
|
|||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
rfu_LMAN_establishConnection(Rfu.parent_child, 0, 240, (u16*)sAcceptedSerialNos);
|
rfu_LMAN_establishConnection(Rfu.parent_child, 0, 240, (u16 *)sAcceptedSerialNos);
|
||||||
Rfu.state = 7;
|
Rfu.state = 7;
|
||||||
gTasks[taskId].data[1] = 7;
|
gTasks[taskId].data[1] = 7;
|
||||||
break;
|
break;
|
||||||
@@ -456,7 +456,7 @@ static void Task_LinkRfu_UnionRoomListen(u8 taskId)
|
|||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
rfu_LMAN_establishConnection(MODE_P_C_SWITCH, 0, 240, (u16*)sAcceptedSerialNos);
|
rfu_LMAN_establishConnection(MODE_P_C_SWITCH, 0, 240, (u16 *)sAcceptedSerialNos);
|
||||||
rfu_LMAN_setMSCCallback(MscCallback_Child);
|
rfu_LMAN_setMSCCallback(MscCallback_Child);
|
||||||
Rfu.state = 18;
|
Rfu.state = 18;
|
||||||
break;
|
break;
|
||||||
@@ -501,7 +501,7 @@ static void Task_LinkRfu_UnionRoomListen(u8 taskId)
|
|||||||
|
|
||||||
void LinkRfu_CreateConnectionAsParent(void)
|
void LinkRfu_CreateConnectionAsParent(void)
|
||||||
{
|
{
|
||||||
rfu_LMAN_establishConnection(MODE_PARENT, 0, 240, (u16*)sAcceptedSerialNos);
|
rfu_LMAN_establishConnection(MODE_PARENT, 0, 240, (u16 *)sAcceptedSerialNos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinkRfu_StopManagerBeforeEnteringChat(void)
|
void LinkRfu_StopManagerBeforeEnteringChat(void)
|
||||||
@@ -2647,7 +2647,7 @@ static void Task_RfuReconnectWithParent(u8 taskId)
|
|||||||
|
|
||||||
if (ContactedByParentAttemptingToReconnect())
|
if (ContactedByParentAttemptingToReconnect())
|
||||||
{
|
{
|
||||||
u8 id = GetPartnerIndexByNameAndTrainerID((u8*)data, ReadU16(&data[8]));
|
u8 id = GetPartnerIndexByNameAndTrainerID((u8 *)data, ReadU16(&data[8]));
|
||||||
if (id != 0xFF)
|
if (id != 0xFF)
|
||||||
{
|
{
|
||||||
if (gRfuLinkStatus->partner[id].slot != 0xFF)
|
if (gRfuLinkStatus->partner[id].slot != 0xFF)
|
||||||
@@ -2692,7 +2692,7 @@ void CreateTask_RfuReconnectWithParent(const u8 *trainerName, u16 trainerId)
|
|||||||
Rfu.status = RFU_STATUS_OK;
|
Rfu.status = RFU_STATUS_OK;
|
||||||
taskId = CreateTask(Task_RfuReconnectWithParent, 3);
|
taskId = CreateTask(Task_RfuReconnectWithParent, 3);
|
||||||
data = gTasks[taskId].data;
|
data = gTasks[taskId].data;
|
||||||
StringCopy((u8*)(data), trainerName);
|
StringCopy((u8 *)(data), trainerName);
|
||||||
data[8] = trainerId;
|
data[8] = trainerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1178,7 +1178,7 @@ void CgbSound(void)
|
|||||||
*nrx3ptr = channels->frequency;
|
*nrx3ptr = channels->frequency;
|
||||||
else
|
else
|
||||||
*nrx3ptr = (*nrx3ptr & 0x08) | channels->frequency;
|
*nrx3ptr = (*nrx3ptr & 0x08) | channels->frequency;
|
||||||
channels->n4 = (channels->n4 & 0xC0) + (*((u8*)(&channels->frequency) + 1));
|
channels->n4 = (channels->n4 & 0xC0) + (*((u8 *)(&channels->frequency) + 1));
|
||||||
*nrx4ptr = (s8)(channels->n4 & mask);
|
*nrx4ptr = (s8)(channels->n4 & mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -9,17 +9,17 @@
|
|||||||
|
|
||||||
EWRAM_DATA static u8 sMoneyBoxWindowId = 0;
|
EWRAM_DATA static u8 sMoneyBoxWindowId = 0;
|
||||||
|
|
||||||
u32 GetMoney(u32* moneyPtr)
|
u32 GetMoney(u32 *moneyPtr)
|
||||||
{
|
{
|
||||||
return *moneyPtr ^ gSaveBlock2Ptr->encryptionKey;
|
return *moneyPtr ^ gSaveBlock2Ptr->encryptionKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetMoney(u32* moneyPtr, u32 newValue)
|
void SetMoney(u32 *moneyPtr, u32 newValue)
|
||||||
{
|
{
|
||||||
*moneyPtr = gSaveBlock2Ptr->encryptionKey ^ newValue;
|
*moneyPtr = gSaveBlock2Ptr->encryptionKey ^ newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 IsEnoughMoney(u32* moneyPtr, u32 cost)
|
bool8 IsEnoughMoney(u32 *moneyPtr, u32 cost)
|
||||||
{
|
{
|
||||||
if (GetMoney(moneyPtr) >= cost)
|
if (GetMoney(moneyPtr) >= cost)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -27,7 +27,7 @@ bool8 IsEnoughMoney(u32* moneyPtr, u32 cost)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddMoney(u32* moneyPtr, u32 toAdd)
|
void AddMoney(u32 *moneyPtr, u32 toAdd)
|
||||||
{
|
{
|
||||||
u32 toSet = GetMoney(moneyPtr);
|
u32 toSet = GetMoney(moneyPtr);
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ void AddMoney(u32* moneyPtr, u32 toAdd)
|
|||||||
SetMoney(moneyPtr, toSet);
|
SetMoney(moneyPtr, toSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveMoney(u32* moneyPtr, u32 toSub)
|
void RemoveMoney(u32 *moneyPtr, u32 toSub)
|
||||||
{
|
{
|
||||||
u32 toSet = GetMoney(moneyPtr);
|
u32 toSet = GetMoney(moneyPtr);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -411,7 +411,7 @@ static void Task_OptionMenu(u8 taskId)
|
|||||||
static u8 OptionMenu_ProcessInput(void)
|
static u8 OptionMenu_ProcessInput(void)
|
||||||
{
|
{
|
||||||
u16 current;
|
u16 current;
|
||||||
u16* curr;
|
u16 *curr;
|
||||||
if (JOY_REPT(DPAD_RIGHT))
|
if (JOY_REPT(DPAD_RIGHT))
|
||||||
{
|
{
|
||||||
current = sOptionMenuPtr->option[(sOptionMenuPtr->cursorPos)];
|
current = sOptionMenuPtr->option[(sOptionMenuPtr->cursorPos)];
|
||||||
|
|||||||
+1
-1
@@ -3261,7 +3261,7 @@ static void ZeroObjectEvent(struct ObjectEvent *objEvent)
|
|||||||
// conflict with the usual Event Object struct, thus the definitions.
|
// conflict with the usual Event Object struct, thus the definitions.
|
||||||
#define linkGender(obj) obj->singleMovementActive
|
#define linkGender(obj) obj->singleMovementActive
|
||||||
// not even one can reference *byte* aligned bitfield members...
|
// not even one can reference *byte* aligned bitfield members...
|
||||||
#define linkDirection(obj) ((u8*)obj)[offsetof(typeof(*obj), fieldEffectSpriteId) - 1] // -> rangeX
|
#define linkDirection(obj) ((u8 *)obj)[offsetof(typeof(*obj), fieldEffectSpriteId) - 1] // -> rangeX
|
||||||
|
|
||||||
static void SpawnLinkPlayerObjectEvent(u8 linkPlayerId, s16 x, s16 y, u8 gender)
|
static void SpawnLinkPlayerObjectEvent(u8 linkPlayerId, s16 x, s16 y, u8 gender)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -885,10 +885,10 @@ void DexScreen_LoadResources(void)
|
|||||||
ScanlineEffect_Stop();
|
ScanlineEffect_Stop();
|
||||||
ResetBgsAndClearDma3BusyFlags(TRUE);
|
ResetBgsAndClearDma3BusyFlags(TRUE);
|
||||||
InitBgsFromTemplates(0, sBgTemplates, NELEMS(sBgTemplates));
|
InitBgsFromTemplates(0, sBgTemplates, NELEMS(sBgTemplates));
|
||||||
SetBgTilemapBuffer(3, (u16*)Alloc(BG_SCREEN_SIZE));
|
SetBgTilemapBuffer(3, (u16 *)Alloc(BG_SCREEN_SIZE));
|
||||||
SetBgTilemapBuffer(2, (u16*)Alloc(BG_SCREEN_SIZE));
|
SetBgTilemapBuffer(2, (u16 *)Alloc(BG_SCREEN_SIZE));
|
||||||
SetBgTilemapBuffer(1, (u16*)Alloc(BG_SCREEN_SIZE));
|
SetBgTilemapBuffer(1, (u16 *)Alloc(BG_SCREEN_SIZE));
|
||||||
SetBgTilemapBuffer(0, (u16*)Alloc(BG_SCREEN_SIZE));
|
SetBgTilemapBuffer(0, (u16 *)Alloc(BG_SCREEN_SIZE));
|
||||||
if (natDex)
|
if (natDex)
|
||||||
DecompressAndLoadBgGfxUsingHeap(3, (void*)sNatDexTiles, BG_SCREEN_SIZE, 0, 0);
|
DecompressAndLoadBgGfxUsingHeap(3, (void*)sNatDexTiles, BG_SCREEN_SIZE, 0, 0);
|
||||||
else
|
else
|
||||||
|
|||||||
+2
-2
@@ -2869,7 +2869,7 @@ static union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 perso
|
|||||||
return substruct;
|
return substruct;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 GetMonData(struct Pokemon *mon, s32 field, u8* data)
|
u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data)
|
||||||
{
|
{
|
||||||
u32 ret;
|
u32 ret;
|
||||||
|
|
||||||
@@ -3873,7 +3873,7 @@ void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex)
|
|||||||
|
|
||||||
static void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
|
static void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
|
||||||
{
|
{
|
||||||
u16* hpSwitchout;
|
u16 *hpSwitchout;
|
||||||
s32 i;
|
s32 i;
|
||||||
u8 nickname[POKEMON_NAME_LENGTH * 2]; // Why is the nickname array here longer in FR/LG?
|
u8 nickname[POKEMON_NAME_LENGTH * 2]; // Why is the nickname array here longer in FR/LG?
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero
|
|||||||
winTemplate.height = 2;
|
winTemplate.height = 2;
|
||||||
windowId = AddWindow(&winTemplate);
|
windowId = AddWindow(&winTemplate);
|
||||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(zero2));
|
FillWindowPixelBuffer(windowId, PIXEL_FILL(zero2));
|
||||||
tileData1 = (u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
tileData1 = (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||||
tileData2 = (winTemplate.width * 32) + tileData1;
|
tileData2 = (winTemplate.width * 32) + tileData1;
|
||||||
|
|
||||||
if (!zero1)
|
if (!zero1)
|
||||||
@@ -106,7 +106,7 @@ static void PrintStringToBufferCopyNow(const u8 *string, void *dst, u16 rise, u8
|
|||||||
var = winTemplate.width * 32;
|
var = winTemplate.width * 32;
|
||||||
windowId = AddWindow(&winTemplate);
|
windowId = AddWindow(&winTemplate);
|
||||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(bgClr));
|
FillWindowPixelBuffer(windowId, PIXEL_FILL(bgClr));
|
||||||
tileData1 = (u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
tileData1 = (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||||
tileData2 = (winTemplate.width * 32) + tileData1;
|
tileData2 = (winTemplate.width * 32) + tileData1;
|
||||||
txtColor[0] = bgClr;
|
txtColor[0] = bgClr;
|
||||||
txtColor[1] = fgClr;
|
txtColor[1] = fgClr;
|
||||||
|
|||||||
@@ -750,7 +750,7 @@ void InitCanReleaseMonVars(void)
|
|||||||
gPSSData->field_2176[0] = MOVE_SURF;
|
gPSSData->field_2176[0] = MOVE_SURF;
|
||||||
gPSSData->field_2176[1] = MOVE_DIVE;
|
gPSSData->field_2176[1] = MOVE_DIVE;
|
||||||
gPSSData->field_2176[2] = MOVES_COUNT;
|
gPSSData->field_2176[2] = MOVES_COUNT;
|
||||||
knownIdx = GetMonData(&gPSSData->field_2108, MON_DATA_KNOWN_MOVES, (u8*)gPSSData->field_2176);
|
knownIdx = GetMonData(&gPSSData->field_2108, MON_DATA_KNOWN_MOVES, (u8 *)gPSSData->field_2176);
|
||||||
gPSSData->isSurfMon = knownIdx & 1;
|
gPSSData->isSurfMon = knownIdx & 1;
|
||||||
gPSSData->isDiveMon = (knownIdx >> 1) & 1;
|
gPSSData->isDiveMon = (knownIdx >> 1) & 1;
|
||||||
if (gPSSData->isSurfMon || gPSSData->isDiveMon)
|
if (gPSSData->isSurfMon || gPSSData->isDiveMon)
|
||||||
@@ -781,7 +781,7 @@ s8 RunCanReleaseMon(void)
|
|||||||
{
|
{
|
||||||
if (gPSSData->field_2170 != TOTAL_BOXES_COUNT || gPSSData->field_2171 != i)
|
if (gPSSData->field_2170 != TOTAL_BOXES_COUNT || gPSSData->field_2171 != i)
|
||||||
{
|
{
|
||||||
knownMoves = GetMonData(gPlayerParty + i, MON_DATA_KNOWN_MOVES, (u8*)gPSSData->field_2176);
|
knownMoves = GetMonData(gPlayerParty + i, MON_DATA_KNOWN_MOVES, (u8 *)gPSSData->field_2176);
|
||||||
if (knownMoves & 1)
|
if (knownMoves & 1)
|
||||||
gPSSData->isSurfMon = FALSE;
|
gPSSData->isSurfMon = FALSE;
|
||||||
if (knownMoves & 2)
|
if (knownMoves & 2)
|
||||||
@@ -803,7 +803,7 @@ s8 RunCanReleaseMon(void)
|
|||||||
case 1:
|
case 1:
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
knownMoves = GetAndCopyBoxMonDataAt(gPSSData->field_216E, gPSSData->field_216F, MON_DATA_KNOWN_MOVES, (u8*)gPSSData->field_2176);
|
knownMoves = GetAndCopyBoxMonDataAt(gPSSData->field_216E, gPSSData->field_216F, MON_DATA_KNOWN_MOVES, (u8 *)gPSSData->field_2176);
|
||||||
if (knownMoves != 0
|
if (knownMoves != 0
|
||||||
&& !(gPSSData->field_2170 == gPSSData->field_216E && gPSSData->field_2171 == gPSSData->field_216F))
|
&& !(gPSSData->field_2170 == gPSSData->field_216E && gPSSData->field_2171 == gPSSData->field_216F))
|
||||||
{
|
{
|
||||||
|
|||||||
+6
-6
@@ -801,16 +801,16 @@ u8 Save_LoadGameData(u8 saveType)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
|
u32 TryCopySpecialSaveSection(u8 sector, u8 *dst)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
s32 size;
|
s32 size;
|
||||||
u8* savData;
|
u8 *savData;
|
||||||
|
|
||||||
if (sector != SECTOR_TTOWER(0) && sector != SECTOR_TTOWER(1))
|
if (sector != SECTOR_TTOWER(0) && sector != SECTOR_TTOWER(1))
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, sizeof(struct SaveSection));
|
ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, sizeof(struct SaveSection));
|
||||||
if (*(u32*)(&gSaveDataBuffer.data[0]) != 0xB39D)
|
if (*(u32 *)(&gSaveDataBuffer.data[0]) != 0xB39D)
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
// copies whole save section except u32 counter
|
// copies whole save section except u32 counter
|
||||||
i = 0;
|
i = 0;
|
||||||
@@ -821,18 +821,18 @@ u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 TryWriteSpecialSaveSection(u8 sector, u8* src)
|
u32 TryWriteSpecialSaveSection(u8 sector, u8 *src)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
s32 size;
|
s32 size;
|
||||||
u8* savData;
|
u8 *savData;
|
||||||
void* savDataBuffer;
|
void* savDataBuffer;
|
||||||
|
|
||||||
if (sector != SECTOR_TTOWER(0) && sector != SECTOR_TTOWER(1))
|
if (sector != SECTOR_TTOWER(0) && sector != SECTOR_TTOWER(1))
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
|
|
||||||
savDataBuffer = &gSaveDataBuffer;
|
savDataBuffer = &gSaveDataBuffer;
|
||||||
*(u32*)(savDataBuffer) = 0xB39D;
|
*(u32 *)(savDataBuffer) = 0xB39D;
|
||||||
|
|
||||||
// copies whole save section except u32 counter
|
// copies whole save section except u32 counter
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|||||||
+1
-1
@@ -457,7 +457,7 @@ void TryRunOnWarpIntoMapScript(void)
|
|||||||
|
|
||||||
u32 CalculateRamScriptChecksum(void)
|
u32 CalculateRamScriptChecksum(void)
|
||||||
{
|
{
|
||||||
return CalcCRC16WithTable((u8*)(&gSaveBlock1Ptr->ramScript.data), sizeof(gSaveBlock1Ptr->ramScript.data));
|
return CalcCRC16WithTable((u8 *)(&gSaveBlock1Ptr->ramScript.data), sizeof(gSaveBlock1Ptr->ramScript.data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearRamScript(void)
|
void ClearRamScript(void)
|
||||||
|
|||||||
+4
-4
@@ -115,7 +115,7 @@ static void BuyMenuDecompressBgGraphics(void);
|
|||||||
static void RecolorItemDescriptionBox(bool32 a0);
|
static void RecolorItemDescriptionBox(bool32 a0);
|
||||||
static void BuyMenuDrawGraphics(void);
|
static void BuyMenuDrawGraphics(void);
|
||||||
static bool8 BuyMenuBuildListMenuTemplate(void);
|
static bool8 BuyMenuBuildListMenuTemplate(void);
|
||||||
static void PokeMartWriteNameAndIdAt(struct ListMenuItem *list, u16 index, u8* dst);
|
static void PokeMartWriteNameAndIdAt(struct ListMenuItem *list, u16 index, u8 *dst);
|
||||||
static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, struct ListMenu *list);
|
static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, struct ListMenu *list);
|
||||||
static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y);
|
static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y);
|
||||||
static void LoadTmHmNameInMart(s32 item);
|
static void LoadTmHmNameInMart(s32 item);
|
||||||
@@ -568,7 +568,7 @@ bool8 BuyMenuBuildListMenuTemplate(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PokeMartWriteNameAndIdAt(struct ListMenuItem *list, u16 index, u8* dst)
|
static void PokeMartWriteNameAndIdAt(struct ListMenuItem *list, u16 index, u8 *dst)
|
||||||
{
|
{
|
||||||
CopyItemName(index, dst);
|
CopyItemName(index, dst);
|
||||||
list->label = dst;
|
list->label = dst;
|
||||||
@@ -752,11 +752,11 @@ static void BuyMenuDrawMapBg(void)
|
|||||||
|
|
||||||
if (metatile < NUM_METATILES_IN_PRIMARY)
|
if (metatile < NUM_METATILES_IN_PRIMARY)
|
||||||
{
|
{
|
||||||
BuyMenuDrawMapMetatile(i, j, (u16*)mapLayout->primaryTileset->metatiles + metatile * 8, metatileLayerType);
|
BuyMenuDrawMapMetatile(i, j, (u16 *)mapLayout->primaryTileset->metatiles + metatile * 8, metatileLayerType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BuyMenuDrawMapMetatile(i, j, (u16*)mapLayout->secondaryTileset->metatiles + ((metatile - NUM_METATILES_IN_PRIMARY) * 8), metatileLayerType);
|
BuyMenuDrawMapMetatile(i, j, (u16 *)mapLayout->secondaryTileset->metatiles + ((metatile - NUM_METATILES_IN_PRIMARY) * 8), metatileLayerType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1292,7 +1292,7 @@ static void TeachyTvLoadMapTilesetToBuffer(struct Tileset *ts, u8 *dstBuffer, u1
|
|||||||
|
|
||||||
static void TeachyTvPushBackNewMapPalIndexArrayEntry(const struct MapLayout *mStruct, u16 *buf1, u8 *palIndexArray, u16 mapEntry, u16 offset)
|
static void TeachyTvPushBackNewMapPalIndexArrayEntry(const struct MapLayout *mStruct, u16 *buf1, u8 *palIndexArray, u16 mapEntry, u16 offset)
|
||||||
{
|
{
|
||||||
u16 * metaTileEntryAddr = mapEntry < 0x280 ? &((u16*)(mStruct->primaryTileset->metatiles))[8 * mapEntry] : &((u16*)(mStruct->secondaryTileset->metatiles))[8 * (mapEntry - 0x280)];
|
u16 * metaTileEntryAddr = mapEntry < 0x280 ? &((u16 *)(mStruct->primaryTileset->metatiles))[8 * mapEntry] : &((u16 *)(mStruct->secondaryTileset->metatiles))[8 * (mapEntry - 0x280)];
|
||||||
buf1[0] = (TeachyTvComputePalIndexArrayEntryByMetaTile(palIndexArray, metaTileEntryAddr[0]) << 12) + 4 * offset;
|
buf1[0] = (TeachyTvComputePalIndexArrayEntryByMetaTile(palIndexArray, metaTileEntryAddr[0]) << 12) + 4 * offset;
|
||||||
buf1[1] = (TeachyTvComputePalIndexArrayEntryByMetaTile(palIndexArray, metaTileEntryAddr[1]) << 12) + 4 * offset + 1;
|
buf1[1] = (TeachyTvComputePalIndexArrayEntryByMetaTile(palIndexArray, metaTileEntryAddr[1]) << 12) + 4 * offset + 1;
|
||||||
buf1[32] = (TeachyTvComputePalIndexArrayEntryByMetaTile(palIndexArray, metaTileEntryAddr[2]) << 12) + 4 * offset + 2;
|
buf1[32] = (TeachyTvComputePalIndexArrayEntryByMetaTile(palIndexArray, metaTileEntryAddr[2]) << 12) + 4 * offset + 2;
|
||||||
|
|||||||
+9
-9
@@ -461,7 +461,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
|
|||||||
{
|
{
|
||||||
if (subStruct->downArrowDelay != 0)
|
if (subStruct->downArrowDelay != 0)
|
||||||
{
|
{
|
||||||
subStruct->downArrowDelay = ((*(u32*)&textPrinter->subUnion.sub) << 19 >> 27) - 1; // convoluted way of getting field_1, necessary to match
|
subStruct->downArrowDelay = ((*(u32 *)&textPrinter->subUnion.sub) << 19 >> 27) - 1; // convoluted way of getting field_1, necessary to match
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -498,7 +498,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
|
|||||||
CopyWindowToVram(textPrinter->printerTemplate.windowId, 0x2);
|
CopyWindowToVram(textPrinter->printerTemplate.windowId, 0x2);
|
||||||
|
|
||||||
subStruct->downArrowDelay = 0x8;
|
subStruct->downArrowDelay = 0x8;
|
||||||
subStruct->downArrowYPosIdx = (*(u32*)subStruct << 17 >> 30) + 1;
|
subStruct->downArrowYPosIdx = (*(u32 *)subStruct << 17 >> 30) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1345,7 +1345,7 @@ u8 GetKeypadIconHeight(u8 keypadIconId)
|
|||||||
|
|
||||||
void DecompressGlyphFont0(u16 glyphId, bool32 isJapanese)
|
void DecompressGlyphFont0(u16 glyphId, bool32 isJapanese)
|
||||||
{
|
{
|
||||||
const u16* glyphs;
|
const u16 *glyphs;
|
||||||
|
|
||||||
if (isJapanese == 1)
|
if (isJapanese == 1)
|
||||||
{
|
{
|
||||||
@@ -1375,7 +1375,7 @@ s32 GetGlyphWidthFont0(u16 glyphId, bool32 isJapanese)
|
|||||||
|
|
||||||
void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese)
|
void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese)
|
||||||
{
|
{
|
||||||
const u16* glyphs;
|
const u16 *glyphs;
|
||||||
|
|
||||||
if (isJapanese == TRUE)
|
if (isJapanese == TRUE)
|
||||||
{
|
{
|
||||||
@@ -1408,7 +1408,7 @@ s32 GetGlyphWidthFont1(u16 glyphId, bool32 isJapanese)
|
|||||||
|
|
||||||
void DecompressGlyphFont2(u16 glyphId, bool32 isJapanese)
|
void DecompressGlyphFont2(u16 glyphId, bool32 isJapanese)
|
||||||
{
|
{
|
||||||
const u16* glyphs;
|
const u16 *glyphs;
|
||||||
int i;
|
int i;
|
||||||
u8 lastColor;
|
u8 lastColor;
|
||||||
|
|
||||||
@@ -1481,7 +1481,7 @@ s32 GetGlyphWidthFont2(u16 glyphId, bool32 isJapanese)
|
|||||||
|
|
||||||
static void DecompressGlyphFont3(u16 glyphId, bool32 isJapanese)
|
static void DecompressGlyphFont3(u16 glyphId, bool32 isJapanese)
|
||||||
{
|
{
|
||||||
const u16* glyphs;
|
const u16 *glyphs;
|
||||||
int i;
|
int i;
|
||||||
u8 lastColor;
|
u8 lastColor;
|
||||||
|
|
||||||
@@ -1524,7 +1524,7 @@ s32 GetGlyphWidthFont3(u16 glyphId, bool32 isJapanese)
|
|||||||
|
|
||||||
static void DecompressGlyphFont4(u16 glyphId, bool32 isJapanese)
|
static void DecompressGlyphFont4(u16 glyphId, bool32 isJapanese)
|
||||||
{
|
{
|
||||||
const u16* glyphs;
|
const u16 *glyphs;
|
||||||
int i;
|
int i;
|
||||||
u8 lastColor;
|
u8 lastColor;
|
||||||
|
|
||||||
@@ -1595,7 +1595,7 @@ s32 GetGlyphWidthFont4(u16 glyphId, bool32 isJapanese)
|
|||||||
|
|
||||||
void DecompressGlyphFont5(u16 glyphId, bool32 isJapanese)
|
void DecompressGlyphFont5(u16 glyphId, bool32 isJapanese)
|
||||||
{
|
{
|
||||||
const u16* glyphs;
|
const u16 *glyphs;
|
||||||
int i;
|
int i;
|
||||||
u8 lastColor;
|
u8 lastColor;
|
||||||
|
|
||||||
@@ -1666,7 +1666,7 @@ s32 GetGlyphWidthFont5(u16 glyphId, bool32 isJapanese)
|
|||||||
|
|
||||||
void DecompressGlyphFont9(u16 glyphId)
|
void DecompressGlyphFont9(u16 glyphId)
|
||||||
{
|
{
|
||||||
const u16* glyphs = sFont9JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & 0xF));
|
const u16 *glyphs = sFont9JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & 0xF));
|
||||||
DecompressGlyphTile(glyphs, (u16 *)gGlyphInfo.pixels);
|
DecompressGlyphTile(glyphs, (u16 *)gGlyphInfo.pixels);
|
||||||
DecompressGlyphTile(glyphs + 0x80, (u16 *)(gGlyphInfo.pixels + 0x40));
|
DecompressGlyphTile(glyphs + 0x80, (u16 *)(gGlyphInfo.pixels + 0x40));
|
||||||
gGlyphInfo.width = 8;
|
gGlyphInfo.width = 8;
|
||||||
|
|||||||
+8
-8
@@ -133,8 +133,8 @@ static void PrintStickersOnCard(void);
|
|||||||
static void LoadStickerGfx(void);
|
static void LoadStickerGfx(void);
|
||||||
static void DrawTrainerCardWindow(u8 windowId);
|
static void DrawTrainerCardWindow(u8 windowId);
|
||||||
static bool8 SetTrainerCardBgsAndPals(void);
|
static bool8 SetTrainerCardBgsAndPals(void);
|
||||||
static void DrawCardScreenBackground(const u16* ptr);
|
static void DrawCardScreenBackground(const u16 *ptr);
|
||||||
static void DrawCardFrontOrBack(const u16* ptr);
|
static void DrawCardFrontOrBack(const u16 *ptr);
|
||||||
static void DrawStarsAndBadgesOnCard(void);
|
static void DrawStarsAndBadgesOnCard(void);
|
||||||
static void DrawCardBackStats(void);
|
static void DrawCardBackStats(void);
|
||||||
static void BlinkTimeColon(void);
|
static void BlinkTimeColon(void);
|
||||||
@@ -1122,7 +1122,7 @@ static void BufferTextForCardBack(void)
|
|||||||
static void PrintNameOnCardFront(void)
|
static void PrintNameOnCardFront(void)
|
||||||
{
|
{
|
||||||
u8 buffer[2][32];
|
u8 buffer[2][32];
|
||||||
u8* txtPtr;
|
u8 *txtPtr;
|
||||||
|
|
||||||
txtPtr = StringCopy(buffer[0], gText_TrainerCardName);
|
txtPtr = StringCopy(buffer[0], gText_TrainerCardName);
|
||||||
txtPtr = buffer[1];
|
txtPtr = buffer[1];
|
||||||
@@ -1135,7 +1135,7 @@ static void PrintNameOnCardFront(void)
|
|||||||
static void PrintIdOnCard(void)
|
static void PrintIdOnCard(void)
|
||||||
{
|
{
|
||||||
u8 buffer[32];
|
u8 buffer[32];
|
||||||
u8* txtPtr;
|
u8 *txtPtr;
|
||||||
|
|
||||||
txtPtr = StringCopy(buffer, gText_TrainerCardIDNo);
|
txtPtr = StringCopy(buffer, gText_TrainerCardIDNo);
|
||||||
ConvertIntToDecimalStringN(txtPtr, sTrainerCardDataPtr->trainerCard.rse.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5);
|
ConvertIntToDecimalStringN(txtPtr, sTrainerCardDataPtr->trainerCard.rse.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5);
|
||||||
@@ -1145,7 +1145,7 @@ static void PrintIdOnCard(void)
|
|||||||
static void PrintMoneyOnCard(void)
|
static void PrintMoneyOnCard(void)
|
||||||
{
|
{
|
||||||
u8 buffer[10];
|
u8 buffer[10];
|
||||||
u8* txtPtr;
|
u8 *txtPtr;
|
||||||
u8 x;
|
u8 x;
|
||||||
|
|
||||||
txtPtr = StringCopy(buffer, gText_TrainerCardYen);
|
txtPtr = StringCopy(buffer, gText_TrainerCardYen);
|
||||||
@@ -1282,7 +1282,7 @@ static void PrintNameOnCardBack(void)
|
|||||||
static void BufferHofDebutTime(void)
|
static void BufferHofDebutTime(void)
|
||||||
{
|
{
|
||||||
u8 buffer[10];
|
u8 buffer[10];
|
||||||
u8* txtPtr;
|
u8 *txtPtr;
|
||||||
|
|
||||||
if (sTrainerCardDataPtr->hasHofResult)
|
if (sTrainerCardDataPtr->hasHofResult)
|
||||||
{
|
{
|
||||||
@@ -1513,7 +1513,7 @@ static bool8 SetTrainerCardBgsAndPals(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DrawCardScreenBackground(const u16* ptr)
|
static void DrawCardScreenBackground(const u16 *ptr)
|
||||||
{
|
{
|
||||||
s16 i, j;
|
s16 i, j;
|
||||||
u16 *dst = sTrainerCardDataPtr->bgTilemapBuffer;
|
u16 *dst = sTrainerCardDataPtr->bgTilemapBuffer;
|
||||||
@@ -1532,7 +1532,7 @@ static void DrawCardScreenBackground(const u16* ptr)
|
|||||||
CopyBgTilemapBufferToVram(2);
|
CopyBgTilemapBufferToVram(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DrawCardFrontOrBack(const u16* ptr)
|
static void DrawCardFrontOrBack(const u16 *ptr)
|
||||||
{
|
{
|
||||||
s16 i, j;
|
s16 i, j;
|
||||||
u16 *dst = sTrainerCardDataPtr->cardTilemapBuffer;
|
u16 *dst = sTrainerCardDataPtr->cardTilemapBuffer;
|
||||||
|
|||||||
+1
-1
@@ -2009,7 +2009,7 @@ static void Task_StartActivity(u8 taskId)
|
|||||||
static void Task_RunScriptAndFadeToActivity(u8 taskId)
|
static void Task_RunScriptAndFadeToActivity(u8 taskId)
|
||||||
{
|
{
|
||||||
s16 *data = gTasks[taskId].data;
|
s16 *data = gTasks[taskId].data;
|
||||||
u16 *sendBuff = (u16*)(gBlockSendBuffer);
|
u16 *sendBuff = (u16 *)(gBlockSendBuffer);
|
||||||
|
|
||||||
switch (data[0])
|
switch (data[0])
|
||||||
{
|
{
|
||||||
|
|||||||
+7
-7
@@ -22,7 +22,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
|||||||
int j;
|
int j;
|
||||||
u8 bgLayer;
|
u8 bgLayer;
|
||||||
u16 bgSize;
|
u16 bgSize;
|
||||||
u8* allocatedTilemapBuffer;
|
u8 *allocatedTilemapBuffer;
|
||||||
int allocatedBaseBlock;
|
int allocatedBaseBlock;
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
@@ -323,7 +323,7 @@ void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u
|
|||||||
struct Bitmap sourceRect;
|
struct Bitmap sourceRect;
|
||||||
struct Bitmap destRect;
|
struct Bitmap destRect;
|
||||||
|
|
||||||
sourceRect.pixels = (u8*)pixels;
|
sourceRect.pixels = (u8 *)pixels;
|
||||||
sourceRect.width = srcWidth;
|
sourceRect.width = srcWidth;
|
||||||
sourceRect.height = srcHeight;
|
sourceRect.height = srcHeight;
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ void BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX,
|
|||||||
struct Bitmap sourceRect;
|
struct Bitmap sourceRect;
|
||||||
struct Bitmap destRect;
|
struct Bitmap destRect;
|
||||||
|
|
||||||
sourceRect.pixels = (u8*)pixels;
|
sourceRect.pixels = (u8 *)pixels;
|
||||||
sourceRect.width = srcWidth;
|
sourceRect.width = srcWidth;
|
||||||
sourceRect.height = srcHeight;
|
sourceRect.height = srcHeight;
|
||||||
|
|
||||||
@@ -380,9 +380,9 @@ void FillWindowPixelBuffer(u8 windowId, u8 fillValue)
|
|||||||
destOffset = i + (a); \
|
destOffset = i + (a); \
|
||||||
srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \
|
srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \
|
||||||
if (srcOffset < size) \
|
if (srcOffset < size) \
|
||||||
*(u32*)(tileData + destOffset) = *(u32*)(tileData + srcOffset); \
|
*(u32 *)(tileData + destOffset) = *(u32 *)(tileData + srcOffset); \
|
||||||
else \
|
else \
|
||||||
*(u32*)(tileData + destOffset) = fillValue32; \
|
*(u32 *)(tileData + destOffset) = fillValue32; \
|
||||||
distanceLoop++; \
|
distanceLoop++; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,9 +391,9 @@ void FillWindowPixelBuffer(u8 windowId, u8 fillValue)
|
|||||||
destOffset = i + (a); \
|
destOffset = i + (a); \
|
||||||
srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \
|
srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \
|
||||||
if (srcOffset < size) \
|
if (srcOffset < size) \
|
||||||
*(u32*)(tileData - destOffset) = *(u32*)(tileData - srcOffset); \
|
*(u32 *)(tileData - destOffset) = *(u32 *)(tileData - srcOffset); \
|
||||||
else \
|
else \
|
||||||
*(u32*)(tileData - destOffset) = fillValue32; \
|
*(u32 *)(tileData - destOffset) = fillValue32; \
|
||||||
distanceLoop++; \
|
distanceLoop++; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -13,7 +13,7 @@ static void nullsub_9(void)
|
|||||||
u16 AddWindow8Bit(const struct WindowTemplate *template)
|
u16 AddWindow8Bit(const struct WindowTemplate *template)
|
||||||
{
|
{
|
||||||
u16 windowId;
|
u16 windowId;
|
||||||
u8* memAddress;
|
u8 *memAddress;
|
||||||
u8 bgLayer;
|
u8 bgLayer;
|
||||||
|
|
||||||
for (windowId = 0; windowId < WINDOWS_MAX; windowId++)
|
for (windowId = 0; windowId < WINDOWS_MAX; windowId++)
|
||||||
@@ -83,7 +83,7 @@ void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u
|
|||||||
struct Bitmap sourceRect;
|
struct Bitmap sourceRect;
|
||||||
struct Bitmap destRect;
|
struct Bitmap destRect;
|
||||||
|
|
||||||
sourceRect.pixels = (u8*)pixels;
|
sourceRect.pixels = (u8 *)pixels;
|
||||||
sourceRect.width = srcWidth;
|
sourceRect.width = srcWidth;
|
||||||
sourceRect.height = srcHeight;
|
sourceRect.height = srcHeight;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user