mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Standarized use of star in pointer types
This commit is contained in:
parent
9caca17064
commit
7b3401ee27
14
gflib/bg.c
14
gflib/bg.c
@ -923,7 +923,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
|
||||
{
|
||||
for (destX16 = destX; destX16 < (destX + width); destX16++)
|
||||
{
|
||||
((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *srcCopy++;
|
||||
((u16 *)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *srcCopy++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -936,7 +936,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
|
||||
{
|
||||
for (destX16 = destX; destX16 < (destX + width); destX16++)
|
||||
{
|
||||
((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *srcCopy++;
|
||||
((u8 *)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *srcCopy++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -984,7 +984,7 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
|
||||
{
|
||||
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 += (srcWidth - rectWidth);
|
||||
@ -1009,7 +1009,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
|
||||
{
|
||||
for (x16 = x; x16 < (x + width); x16++)
|
||||
{
|
||||
((u16*)sGpuBgConfigs2[bg].tilemap)[((y16 * 0x20) + x16)] = tileNum;
|
||||
((u16 *)sGpuBgConfigs2[bg].tilemap)[((y16 * 0x20) + x16)] = tileNum;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1019,7 +1019,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
|
||||
{
|
||||
for (x16 = x; x16 < (x + width); x16++)
|
||||
{
|
||||
((u8*)sGpuBgConfigs2[bg].tilemap)[((y16 * mode) + x16)] = tileNum;
|
||||
((u8 *)sGpuBgConfigs2[bg].tilemap)[((y16 * mode) + x16)] = tileNum;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1052,7 +1052,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
||||
{
|
||||
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 & (MAPGRID_COLLISION_MASK | MAPGRID_ELEVATION_MASK)) + ((firstTileNum + tileNumDelta) & MAPGRID_METATILE_ID_MASK);
|
||||
}
|
||||
}
|
||||
@ -1063,7 +1063,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
||||
{
|
||||
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 & (MAPGRID_COLLISION_MASK | MAPGRID_ELEVATION_MASK)) + ((firstTileNum + tileNumDelta) & MAPGRID_METATILE_ID_MASK);
|
||||
}
|
||||
}
|
||||
|
14
gflib/text.c
14
gflib/text.c
@ -652,7 +652,7 @@ void ClearTextSpan(struct TextPrinter *textPrinter, u32 width)
|
||||
struct Window *window;
|
||||
struct Bitmap pixels_data;
|
||||
struct TextGlyph *glyph;
|
||||
u8* glyphHeight;
|
||||
u8 *glyphHeight;
|
||||
|
||||
if (sLastTextBgColor != TEXT_COLOR_TRANSPARENT)
|
||||
{
|
||||
@ -1684,7 +1684,7 @@ u8 GetMenuCursorDimensionByFont(u8 fontId, u8 whichDimension)
|
||||
|
||||
static void DecompressGlyph_Small(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16* glyphs;
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == 1)
|
||||
{
|
||||
@ -1726,7 +1726,7 @@ static u32 GetGlyphWidth_Small(u16 glyphId, bool32 isJapanese)
|
||||
|
||||
static void DecompressGlyph_Narrow(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16* glyphs;
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
@ -1768,7 +1768,7 @@ static u32 GetGlyphWidth_Narrow(u16 glyphId, bool32 isJapanese)
|
||||
|
||||
static void DecompressGlyph_SmallNarrow(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16* glyphs;
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
@ -1810,7 +1810,7 @@ static u32 GetGlyphWidth_SmallNarrow(u16 glyphId, bool32 isJapanese)
|
||||
|
||||
static void DecompressGlyph_Short(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16* glyphs;
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
@ -1854,7 +1854,7 @@ static u32 GetGlyphWidth_Short(u16 glyphId, bool32 isJapanese)
|
||||
|
||||
static void DecompressGlyph_Normal(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16* glyphs;
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
@ -1896,7 +1896,7 @@ static u32 GetGlyphWidth_Normal(u16 glyphId, bool32 isJapanese)
|
||||
|
||||
static void DecompressGlyph_Bold(u16 glyphId)
|
||||
{
|
||||
const u16* glyphs;
|
||||
const u16 *glyphs;
|
||||
|
||||
glyphs = sFontBoldJapaneseGlyphs + (0x100 * (glyphId >> 4)) + (0x8 * (glyphId & 0xF));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
|
@ -65,7 +65,7 @@ struct TextPrinterSubStruct
|
||||
|
||||
struct TextPrinterTemplate
|
||||
{
|
||||
const u8* currentChar;
|
||||
const u8 *currentChar;
|
||||
u8 windowId;
|
||||
u8 fontId;
|
||||
u8 x;
|
||||
|
@ -35,7 +35,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
||||
int j;
|
||||
u8 bgLayer;
|
||||
u16 attrib;
|
||||
u8* allocatedTilemapBuffer;
|
||||
u8 *allocatedTilemapBuffer;
|
||||
int allocatedBaseBlock;
|
||||
|
||||
for (i = 0; i < NUM_BACKGROUNDS; ++i)
|
||||
@ -405,7 +405,7 @@ void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
|
||||
sourceRect.pixels = (u8*)pixels;
|
||||
sourceRect.pixels = (u8 *)pixels;
|
||||
sourceRect.width = srcWidth;
|
||||
sourceRect.height = srcHeight;
|
||||
|
||||
@ -421,7 +421,7 @@ static void BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u1
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
|
||||
sourceRect.pixels = (u8*)pixels;
|
||||
sourceRect.pixels = (u8 *)pixels;
|
||||
sourceRect.width = srcWidth;
|
||||
sourceRect.height = srcHeight;
|
||||
|
||||
@ -463,9 +463,9 @@ void FillWindowPixelBuffer(u8 windowId, u8 fillValue)
|
||||
destOffset = i + (a); \
|
||||
srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \
|
||||
if (srcOffset < size) \
|
||||
*(u32*)(tileData + destOffset) = *(u32*)(tileData + srcOffset); \
|
||||
*(u32 *)(tileData + destOffset) = *(u32 *)(tileData + srcOffset); \
|
||||
else \
|
||||
*(u32*)(tileData + destOffset) = fillValue32; \
|
||||
*(u32 *)(tileData + destOffset) = fillValue32; \
|
||||
distanceLoop++; \
|
||||
}
|
||||
|
||||
@ -474,9 +474,9 @@ void FillWindowPixelBuffer(u8 windowId, u8 fillValue)
|
||||
destOffset = i + (a); \
|
||||
srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \
|
||||
if (srcOffset < size) \
|
||||
*(u32*)(tileData - destOffset) = *(u32*)(tileData - srcOffset); \
|
||||
*(u32 *)(tileData - destOffset) = *(u32 *)(tileData - srcOffset); \
|
||||
else \
|
||||
*(u32*)(tileData - destOffset) = fillValue32; \
|
||||
*(u32 *)(tileData - destOffset) = fillValue32; \
|
||||
distanceLoop++; \
|
||||
}
|
||||
|
||||
@ -550,7 +550,7 @@ bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value)
|
||||
gWindows[windowId].window.baseBlock = value;
|
||||
return FALSE;
|
||||
case WINDOW_TILE_DATA:
|
||||
gWindows[windowId].tileData = (u8*)(value);
|
||||
gWindows[windowId].tileData = (u8 *)(value);
|
||||
return TRUE;
|
||||
case WINDOW_BG:
|
||||
case WINDOW_WIDTH:
|
||||
@ -605,7 +605,7 @@ static void DummyWindowBgTilemap8Bit(void)
|
||||
u16 AddWindow8Bit(const struct WindowTemplate *template)
|
||||
{
|
||||
u16 windowId;
|
||||
u8* memAddress;
|
||||
u8 *memAddress;
|
||||
u8 bgLayer;
|
||||
|
||||
for (windowId = 0; windowId < WINDOWS_MAX; windowId++)
|
||||
@ -675,7 +675,7 @@ void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
|
||||
sourceRect.pixels = (u8*) pixels;
|
||||
sourceRect.pixels = (u8 *) pixels;
|
||||
sourceRect.width = srcWidth;
|
||||
sourceRect.height = srcHeight;
|
||||
|
||||
|
@ -591,7 +591,7 @@ struct MonSpritesGfx
|
||||
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
|
||||
union {
|
||||
void* ptr[MAX_BATTLERS_COUNT];
|
||||
u8* byte[MAX_BATTLERS_COUNT];
|
||||
u8 *byte[MAX_BATTLERS_COUNT];
|
||||
} sprites;
|
||||
struct SpriteTemplate templates[MAX_BATTLERS_COUNT];
|
||||
struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][4];
|
||||
|
@ -125,7 +125,7 @@ s16 CloneBattlerSpriteWithBlend(u8);
|
||||
void DestroySpriteWithActiveSheet(struct Sprite*);
|
||||
u8 CreateInvisibleSpriteCopy(int, u8, int);
|
||||
void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, bool32);
|
||||
void AnimLoadCompressedBgGfx(u32, const u32*, u32);
|
||||
void AnimLoadCompressedBgGfx(u32, const u32 *, u32);
|
||||
void UpdateAnimBg3ScreenSize(bool8);
|
||||
void TranslateSpriteInGrowingCircle(struct Sprite *);
|
||||
void SetBattlerSpriteYOffsetFromYScale(u8 spriteId);
|
||||
|
@ -222,8 +222,8 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId);
|
||||
void BtlController_EmitChooseAction(u8 bufferId, u8 action, u16 itemId);
|
||||
void BtlController_EmitYesNoBox(u8 bufferId);
|
||||
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
|
||||
void BtlController_EmitChooseItem(u8 bufferId, u8* battlePartyOrder);
|
||||
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8* data);
|
||||
void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder);
|
||||
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8 *data);
|
||||
void BtlController_EmitCmd23(u8 bufferId); // unused
|
||||
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
|
||||
void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints);
|
||||
|
@ -211,18 +211,18 @@ struct BattleMsgData
|
||||
};
|
||||
|
||||
void BufferStringBattle(u16 stringID);
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src);
|
||||
u32 BattleStringExpandPlaceholders(const u8* src, u8* dst);
|
||||
void BattlePutTextOnWindow(const u8* text, u8 windowId);
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src);
|
||||
u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst);
|
||||
void BattlePutTextOnWindow(const u8 *text, u8 windowId);
|
||||
void SetPpNumbersPaletteInMoveSelection(void);
|
||||
u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp);
|
||||
|
||||
extern struct BattleMsgData *gBattleMsgDataPtr;
|
||||
|
||||
extern const u8* const gBattleStringsTable[];
|
||||
extern const u8* const gStatNamesTable[];
|
||||
extern const u8* const gPokeblockWasTooXStringTable[];
|
||||
extern const u8* const gRefereeStringsTable[];
|
||||
extern const u8 *const gBattleStringsTable[];
|
||||
extern const u8 *const gStatNamesTable[];
|
||||
extern const u8 *const gPokeblockWasTooXStringTable[];
|
||||
extern const u8 *const gRefereeStringsTable[];
|
||||
extern const u8 *const gRoundsStringTable[];
|
||||
|
||||
extern const u8 gText_PkmnIsEvolving[];
|
||||
|
@ -73,7 +73,7 @@ void PrepareStringBattle(u16 stringId, u8 battlerId);
|
||||
void ResetSentPokesToOpponentValue(void);
|
||||
void OpponentSwitchInResetSentPokesToOpponentValue(u8 battlerId);
|
||||
void UpdateSentPokesToOpponentValue(u8 battlerId);
|
||||
void BattleScriptPush(const u8* bsPtr);
|
||||
void BattleScriptPush(const u8 *bsPtr);
|
||||
void BattleScriptPushCursor(void);
|
||||
void BattleScriptPop(void);
|
||||
u8 TrySetCantSelectMoveBattleScript(void);
|
||||
@ -89,8 +89,8 @@ u8 AtkCanceller_UnableToUseMove(void);
|
||||
bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2);
|
||||
u8 CastformDataTypeChange(u8 battlerId);
|
||||
u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u8 ability, u8 special, u16 moveArg);
|
||||
void BattleScriptExecute(const u8* BS_ptr);
|
||||
void BattleScriptPushCursorAndCallback(const u8* BS_ptr);
|
||||
void BattleScriptExecute(const u8 *BS_ptr);
|
||||
void BattleScriptPushCursorAndCallback(const u8 *BS_ptr);
|
||||
u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn);
|
||||
void ClearFuryCutterDestinyBondGrudge(u8 battlerId);
|
||||
void HandleAction_RunBattleScript(void);
|
||||
|
@ -25,7 +25,7 @@ u32 MapGridGetMetatileIdAt(int, int);
|
||||
u32 MapGridGetMetatileBehaviorAt(int, int);
|
||||
void MapGridSetMetatileIdAt(int, int, u16);
|
||||
void MapGridSetMetatileEntryAt(int, int, u16);
|
||||
void GetCameraCoords(u16*, u16*);
|
||||
void GetCameraCoords(u16 *, u16 *);
|
||||
bool8 MapGridIsImpassableAt(int, int);
|
||||
int GetMapBorderIdAt(int x, int y);
|
||||
bool32 CanCameraMoveInDirection(int direction);
|
||||
|
@ -102,7 +102,7 @@
|
||||
#define T1_READ_8(ptr) ((ptr)[0])
|
||||
#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_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.
|
||||
#define T2_READ_8(ptr) ((ptr)[0])
|
||||
|
@ -11,7 +11,7 @@ int GetStringRightAlignXOffset(int fontId, const u8 *str, int totalWidth);
|
||||
int GetStringCenterAlignXOffsetWithLetterSpacing(int fontId, const u8 *str, int totalWidth, int letterSpacing);
|
||||
int GetStringWidthDifference(int fontId, const u8 *str, int totalWidth, int letterSpacing);
|
||||
int GetMaxWidthInMenuTable(const struct MenuAction *actions, int numActions);
|
||||
int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8* actionIds, int numActions);
|
||||
int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8 *actionIds, int numActions);
|
||||
int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu);
|
||||
void CopyMonCategoryText(int dexNum, u8 *dest);
|
||||
u8 *GetStringClearToWidth(u8 *dest, int fontId, const u8 *str, int totalStringWidth);
|
||||
|
@ -71,7 +71,7 @@ struct BagMenu
|
||||
u8 unused1[2];
|
||||
u8 pocketScrollArrowsTask;
|
||||
u8 pocketSwitchArrowsTask;
|
||||
const u8* contextMenuItemsPtr;
|
||||
const u8 *contextMenuItemsPtr;
|
||||
u8 contextMenuItemsBuffer[4];
|
||||
u8 contextMenuNumItems;
|
||||
u8 numItemStacks[POCKETS_COUNT];
|
||||
|
@ -50,7 +50,7 @@ void LoadMessageBoxAndBorderGfx(void);
|
||||
void DrawDialogueFrame(u8 windowId, bool8 copyToVram);
|
||||
void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram);
|
||||
u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor);
|
||||
void PrintPlayerNameOnWindow(u8, const u8*, u16, u16);
|
||||
void PrintPlayerNameOnWindow(u8, const u8 *, u16, u16);
|
||||
void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram);
|
||||
void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram);
|
||||
void DisplayYesNoMenuDefaultYes(void);
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef GUARD_MONEY_H
|
||||
#define GUARD_MONEY_H
|
||||
|
||||
u32 GetMoney(u32* moneyPtr);
|
||||
void SetMoney(u32* moneyPtr, u32 newValue);
|
||||
bool8 IsEnoughMoney(u32* moneyPtr, u32 cost);
|
||||
void AddMoney(u32* moneyPtr, u32 toAdd);
|
||||
void RemoveMoney(u32* moneyPtr, u32 toSub);
|
||||
u32 GetMoney(u32 *moneyPtr);
|
||||
void SetMoney(u32 *moneyPtr, u32 newValue);
|
||||
bool8 IsEnoughMoney(u32 *moneyPtr, u32 cost);
|
||||
void AddMoney(u32 *moneyPtr, u32 toAdd);
|
||||
void RemoveMoney(u32 *moneyPtr, u32 toSub);
|
||||
bool8 IsEnoughForCostInVar0x8005(void);
|
||||
void SubtractMoneyFromVar0x8005(void);
|
||||
void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, u8 speed);
|
||||
|
@ -36,8 +36,8 @@ bool8 IsMultiBattle(void);
|
||||
u8 GetCursorSelectionMonId(void);
|
||||
u8 GetPartyMenuType(void);
|
||||
void Task_HandleChooseMonInput(u8 taskId);
|
||||
u8* GetMonNickname(struct Pokemon *mon, u8 *dest);
|
||||
u8 DisplayPartyMenuMessage(const u8* str, bool8 keepOpen);
|
||||
u8 *GetMonNickname(struct Pokemon *mon, u8 *dest);
|
||||
u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen);
|
||||
bool8 IsPartyMenuTextPrinterActive(void);
|
||||
void PartyMenuModifyHP(u8 taskId, u8 slot, s8 hpIncrement, s16 HPDifference, TaskFunc task);
|
||||
u8 GetAilmentFromStatus(u32 status);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef GUARD_POKEDEX_AREA_SCREEN_H
|
||||
#define GUARD_POKEDEX_AREA_SCREEN_H
|
||||
|
||||
void ShowPokedexAreaScreen(u16, u8*);
|
||||
void ShowPokedexAreaScreen(u16, u8 *);
|
||||
|
||||
#endif // GUARD_POKEDEX_AREA_SCREEN_H
|
||||
|
@ -104,8 +104,8 @@ bool8 WriteSaveBlock2(void);
|
||||
bool8 WriteSaveBlock1Sector(void);
|
||||
u8 LoadGameSave(u8 saveType);
|
||||
u16 GetSaveBlocksPointersBaseOffset(void);
|
||||
u32 TryReadSpecialSaveSector(u8 sector, u8* dst);
|
||||
u32 TryWriteSpecialSaveSector(u8 sector, u8* src);
|
||||
u32 TryReadSpecialSaveSector(u8 sector, u8 *dst);
|
||||
u32 TryWriteSpecialSaveSector(u8 sector, u8 *src);
|
||||
void Task_LinkFullSave(u8 taskId);
|
||||
|
||||
// save_failed_screen.c
|
||||
|
@ -12,7 +12,7 @@ bool8 (*ScriptMenu_HidePokemonPic(void))(void);
|
||||
int ConvertPixelWidthToTileWidth(int width);
|
||||
u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height);
|
||||
void ClearToTransparentAndRemoveWindow(u8 windowId);
|
||||
int DisplayTextAndGetWidth(const u8* str, int width);
|
||||
int DisplayTextAndGetWidth(const u8 *str, int width);
|
||||
int ScriptMenu_AdjustLeftCoordFromWidth(int left, int width);
|
||||
bool16 ScriptMenu_CreatePCMultichoice(void);
|
||||
void ScriptMenu_DisplayPCStartupPrompt(void);
|
||||
|
@ -11,6 +11,6 @@ void SaveGame(void);
|
||||
void CB2_SetUpSaveAfterLinkBattle(void);
|
||||
void SaveForBattleTowerLink(void);
|
||||
void HideStartMenu(void);
|
||||
void AppendToList(u8* list, u8* pos, u8 newEntry);
|
||||
void AppendToList(u8 *list, u8 *pos, u8 newEntry);
|
||||
|
||||
#endif // GUARD_START_MENU_H
|
||||
|
@ -12,7 +12,7 @@ void LoadWordFromTwoHalfwords(u16 *, u32 *);
|
||||
int CountTrailingZeroBits(u32 value);
|
||||
u16 CalcCRC16(const u8 *data, s32 length);
|
||||
u16 CalcCRC16WithTable(const u8 *data, u32 length);
|
||||
u32 CalcByteArraySum(const u8* data, u32 length);
|
||||
u32 CalcByteArraySum(const u8 *data, u32 length);
|
||||
void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor);
|
||||
void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha);
|
||||
void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output);
|
||||
|
@ -5317,7 +5317,7 @@ static void AnimWavyMusicNotes(struct Sprite* sprite)
|
||||
sprite->callback = AnimWavyMusicNotes_Step;
|
||||
}
|
||||
|
||||
static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16* velocX, s16* velocY, s8 xSpeedFactor)
|
||||
static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16 *velocX, s16 *velocY, s8 xSpeedFactor)
|
||||
{
|
||||
int x2;
|
||||
int time;
|
||||
|
@ -1838,7 +1838,7 @@ static void AnimBulletSeed_Step1(struct Sprite *sprite)
|
||||
{
|
||||
int i;
|
||||
u16 rand;
|
||||
s16* ptr;
|
||||
s16 *ptr;
|
||||
PlaySE12WithPanning(SE_M_HORN_ATTACK, BattleAnimAdjustPanning(63));
|
||||
sprite->x += sprite->x2;
|
||||
sprite->y += sprite->y2;
|
||||
|
@ -595,7 +595,7 @@ static void AnimFallingFeather(struct Sprite *sprite)
|
||||
data->unkA = (gBattleAnimArgs[2] >> 8) & 0xFF;
|
||||
data->unk4 = gBattleAnimArgs[3];
|
||||
data->unk6 = gBattleAnimArgs[4];
|
||||
*(u16*)(data->unkC) = gBattleAnimArgs[5];
|
||||
*(u16 *)(data->unkC) = gBattleAnimArgs[5];
|
||||
|
||||
if (data->unk2 >= 64 && data->unk2 <= 191)
|
||||
{
|
||||
|
@ -627,7 +627,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -1466,7 +1466,7 @@ static void LinkOpponentHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
@ -514,7 +514,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -1298,7 +1298,7 @@ static void LinkPartnerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
@ -627,7 +627,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -1519,7 +1519,7 @@ static void OpponentHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
@ -1672,7 +1672,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -2546,7 +2546,7 @@ static void PlayerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
|
||||
@ -2797,7 +2797,7 @@ static void PlayerHandleDMA3Transfer(void)
|
||||
u16 sizeArg = gBattleBufferA[gActiveBattler][5] | (gBattleBufferA[gActiveBattler][6] << 8);
|
||||
|
||||
const u8 *src = &gBattleBufferA[gActiveBattler][7];
|
||||
u8 *dst = (u8*)(dstArg);
|
||||
u8 *dst = (u8 *)(dstArg);
|
||||
u32 size = sizeArg;
|
||||
|
||||
while (1)
|
||||
|
@ -698,7 +698,7 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -1488,7 +1488,7 @@ static void PlayerPartnerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
|
||||
|
@ -610,7 +610,7 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -1393,7 +1393,7 @@ static void RecordedOpponentHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
@ -589,7 +589,7 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -1399,7 +1399,7 @@ static void RecordedPlayerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
@ -422,7 +422,7 @@ static void SafariHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
@ -516,7 +516,7 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@ -1176,7 +1176,7 @@ static void WallyHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
@ -99,10 +99,10 @@ void InitBattleControllers(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(gBattleStruct->tvMovePoints); i++)
|
||||
*((u8*)(&gBattleStruct->tvMovePoints) + i) = 0;
|
||||
*((u8 *)(&gBattleStruct->tvMovePoints) + i) = 0;
|
||||
|
||||
for (i = 0; i < sizeof(gBattleStruct->tv); i++)
|
||||
*((u8*)(&gBattleStruct->tv) + i) = 0;
|
||||
*((u8 *)(&gBattleStruct->tv) + i) = 0;
|
||||
}
|
||||
|
||||
static void InitSinglePlayerBtlControllers(void)
|
||||
@ -930,7 +930,7 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
|
||||
sBattleBuffersTransferData[1] = requestId;
|
||||
sBattleBuffersTransferData[2] = monToCheck;
|
||||
for (i = 0; i < bytes; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes);
|
||||
}
|
||||
|
||||
@ -942,7 +942,7 @@ void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data
|
||||
sBattleBuffersTransferData[1] = monId;
|
||||
sBattleBuffersTransferData[2] = bytes;
|
||||
for (i = 0; i < bytes; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, bytes + 3);
|
||||
}
|
||||
|
||||
@ -1039,7 +1039,7 @@ void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_PAUSE;
|
||||
sBattleBuffersTransferData[1] = toWait;
|
||||
for (i = 0; i < toWait * 3; i++)
|
||||
sBattleBuffersTransferData[2 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[2 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, toWait * 3 + 2);
|
||||
}
|
||||
|
||||
@ -1164,7 +1164,7 @@ void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpN
|
||||
sBattleBuffersTransferData[2] = NoPpNumber;
|
||||
sBattleBuffersTransferData[3] = 0;
|
||||
for (i = 0; i < sizeof(*movePpData); i++)
|
||||
sBattleBuffersTransferData[4 + i] = *((u8*)(movePpData) + i);
|
||||
sBattleBuffersTransferData[4 + i] = *((u8 *)(movePpData) + i);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(*movePpData) + 4);
|
||||
}
|
||||
|
||||
@ -1261,7 +1261,7 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data)
|
||||
sBattleBuffersTransferData[2] = size;
|
||||
sBattleBuffersTransferData[3] = (size & 0xFF00) >> 8;
|
||||
for (i = 0; i < size; i++)
|
||||
sBattleBuffersTransferData[4 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[4 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4);
|
||||
}
|
||||
|
||||
@ -1277,7 +1277,7 @@ void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data
|
||||
sBattleBuffersTransferData[5] = size;
|
||||
sBattleBuffersTransferData[6] = (size & 0xFF00) >> 8;
|
||||
for (i = 0; i < size; i++)
|
||||
sBattleBuffersTransferData[7 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[7 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7);
|
||||
}
|
||||
|
||||
@ -1293,7 +1293,7 @@ void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
// Nonsense loop using songId as a size
|
||||
// Would go out of bounds for any song id after SE_RG_BAG_POCKET (253)
|
||||
for (i = 0; i < songId; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3);
|
||||
}
|
||||
|
||||
@ -1305,7 +1305,7 @@ void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
sBattleBuffersTransferData[1] = size;
|
||||
sBattleBuffersTransferData[2] = (size & 0xFF00) >> 8;
|
||||
for (i = 0; i < size; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 3);
|
||||
}
|
||||
|
||||
@ -1451,7 +1451,7 @@ void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* h
|
||||
sBattleBuffersTransferData[2] = (flags & PARTY_SUMM_SKIP_DRAW_DELAY) >> 7; // If true, skip delay after drawing. True during intro
|
||||
sBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
|
||||
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); i++)
|
||||
sBattleBuffersTransferData[4 + i] = *(i + (u8*)(hpAndStatus));
|
||||
sBattleBuffersTransferData[4 + i] = *(i + (u8 *)(hpAndStatus));
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(struct HpAndStatus) * PARTY_SIZE + 4);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ static void CB2_TourneyTree(void);
|
||||
static void VblankCb_TourneyInfoCard(void);
|
||||
static void DisplayMatchInfoOnCard(u8, u8);
|
||||
static void DisplayTrainerInfoOnCard(u8, u8);
|
||||
static int BufferDomeWinString(u8, u8*);
|
||||
static int BufferDomeWinString(u8, u8 *);
|
||||
static u8 GetDomeBrainTrainerPicId(void);
|
||||
static u8 GetDomeBrainTrainerClass(void);
|
||||
static void CopyDomeBrainTrainerName(u8 *);
|
||||
|
@ -1219,7 +1219,7 @@ void HideBattlerShadowSprite(u8 battlerId)
|
||||
// Color the background tiles surrounding the action selection and move windows
|
||||
void FillAroundBattleWindows(void)
|
||||
{
|
||||
u16 *vramPtr = (u16*)(VRAM + 0x240);
|
||||
u16 *vramPtr = (u16 *)(VRAM + 0x240);
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
|
@ -159,7 +159,7 @@ enum
|
||||
};
|
||||
|
||||
static const u8 *GetHealthboxElementGfxPtr(u8);
|
||||
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *);
|
||||
static u8 *AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *);
|
||||
|
||||
static void RemoveWindowOnHealthbox(u32 windowId);
|
||||
static void UpdateHpTextInHealthboxInDoubles(u8, s16, u8);
|
||||
@ -2522,7 +2522,7 @@ u8 GetHPBarLevel(s16 hp, s16 maxhp)
|
||||
return result;
|
||||
}
|
||||
|
||||
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId)
|
||||
static u8 *AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId)
|
||||
{
|
||||
u16 winId;
|
||||
u8 color[3];
|
||||
@ -2538,7 +2538,7 @@ static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y,
|
||||
AddTextPrinterParameterized4(winId, FONT_SMALL, x, y, 0, 0, color, TEXT_SKIP_DRAW, str);
|
||||
|
||||
*windowId = winId;
|
||||
return (u8*)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
|
||||
return (u8 *)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
|
||||
}
|
||||
|
||||
static void RemoveWindowOnHealthbox(u32 windowId)
|
||||
|
@ -1805,7 +1805,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
case 8:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
u32* ptr = gBattleStruct->multiBuffer.battleVideo;
|
||||
u32 *ptr = gBattleStruct->multiBuffer.battleVideo;
|
||||
ptr[0] = gBattleTypeFlags;
|
||||
ptr[1] = gRecordedBattleRngSeed; // UB: overwrites berry data
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), ptr, sizeof(gBattleStruct->multiBuffer.battleVideo));
|
||||
@ -1899,7 +1899,7 @@ static void SpriteCB_UnusedBattleInit(struct Sprite* sprite)
|
||||
|
||||
static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite)
|
||||
{
|
||||
u16 *arr = (u16*)gDecompressionBuffer;
|
||||
u16 *arr = (u16 *)gDecompressionBuffer;
|
||||
|
||||
switch (sprite->sState)
|
||||
{
|
||||
@ -2787,7 +2787,7 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
|
||||
}
|
||||
else // Erase bottom part of the sprite to create a smooth illusion of mon falling down.
|
||||
{
|
||||
u8* dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8);
|
||||
u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8);
|
||||
|
||||
for (i = 0; i < 0x100; i++)
|
||||
*(dst++) = 0;
|
||||
@ -3109,10 +3109,10 @@ static void BattleStartClearSetData(void)
|
||||
*((u8 *)gBattleStruct->usedHeldItems + i) = 0;
|
||||
*((u8 *)gBattleStruct->choicedMove + i) = 0;
|
||||
*((u8 *)gBattleStruct->changedItems + i) = 0;
|
||||
*(i + 0 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 1 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 2 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 3 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 3 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
@ -3214,14 +3214,14 @@ void SwitchInClearSetData(void)
|
||||
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
|
||||
gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]);
|
||||
|
||||
@ -3232,12 +3232,12 @@ void SwitchInClearSetData(void)
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
}
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
|
||||
gBattleResources->flags->flags[gActiveBattler] = 0;
|
||||
gCurrentMove = 0;
|
||||
@ -3304,19 +3304,19 @@ void FaintClearSetData(void)
|
||||
gLastPrintedMoves[gActiveBattler] = 0;
|
||||
gLastHitBy[gActiveBattler] = 0xFF;
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
|
||||
gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]);
|
||||
|
||||
@ -3327,8 +3327,8 @@ void FaintClearSetData(void)
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
}
|
||||
|
||||
gBattleResources->flags->flags[gActiveBattler] = 0;
|
||||
@ -3395,7 +3395,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
u16* hpOnSwitchout;
|
||||
u16 *hpOnSwitchout;
|
||||
|
||||
ptr = (u8 *)&gBattleMons[gActiveBattler];
|
||||
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
||||
@ -4055,7 +4055,7 @@ void SwitchPartyOrder(u8 battler)
|
||||
u8 partyId2;
|
||||
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders));
|
||||
gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders));
|
||||
|
||||
partyId1 = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]);
|
||||
partyId2 = GetPartyIdFromBattlePartyId(*(gBattleStruct->monToSwitchIntoId + battler));
|
||||
@ -4065,15 +4065,15 @@ void SwitchPartyOrder(u8 battler)
|
||||
{
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
{
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(BATTLE_PARTNER(battler) * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(BATTLE_PARTNER(battler) * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
{
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4543,13 +4543,13 @@ static void UpdateBattlerPartyOrdersOnSwitch(void)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
|
||||
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(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) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
*((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) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
}
|
||||
}
|
||||
|
||||
@ -4831,7 +4831,7 @@ static void TurnValuesCleanUp(bool8 var0)
|
||||
}
|
||||
else
|
||||
{
|
||||
dataPtr = (u8*)(&gProtectStructs[gActiveBattler]);
|
||||
dataPtr = (u8 *)(&gProtectStructs[gActiveBattler]);
|
||||
for (i = 0; i < sizeof(struct ProtectStruct); i++)
|
||||
dataPtr[i] = 0;
|
||||
|
||||
@ -4859,7 +4859,7 @@ void SpecialStatusesClear(void)
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
s32 i;
|
||||
u8 *dataPtr = (u8*)(&gSpecialStatuses[gActiveBattler]);
|
||||
u8 *dataPtr = (u8 *)(&gSpecialStatuses[gActiveBattler]);
|
||||
|
||||
for (i = 0; i < sizeof(struct SpecialStatus); i++)
|
||||
dataPtr[i] = 0;
|
||||
|
@ -2346,17 +2346,17 @@ void BufferStringBattle(u16 stringID)
|
||||
BattleStringExpandPlaceholdersToDisplayedString(stringPtr);
|
||||
}
|
||||
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src)
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src)
|
||||
{
|
||||
BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
||||
}
|
||||
|
||||
static const u8* TryGetStatusString(u8 *src)
|
||||
static const u8 *TryGetStatusString(u8 *src)
|
||||
{
|
||||
u32 i;
|
||||
u8 status[8];
|
||||
u32 chars1, chars2;
|
||||
u8* statusPtr;
|
||||
u8 *statusPtr;
|
||||
|
||||
memcpy(status, sDummyWeirdStatusString, 8);
|
||||
|
||||
@ -2369,13 +2369,13 @@ static const u8* TryGetStatusString(u8 *src)
|
||||
statusPtr++;
|
||||
}
|
||||
|
||||
chars1 = *(u32*)(&status[0]);
|
||||
chars2 = *(u32*)(&status[4]);
|
||||
chars1 = *(u32 *)(&status[0]);
|
||||
chars2 = *(u32 *)(&status[4]);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gStatusConditionStringsTable); i++)
|
||||
{
|
||||
if (chars1 == *(u32*)(&gStatusConditionStringsTable[i][0][0])
|
||||
&& chars2 == *(u32*)(&gStatusConditionStringsTable[i][0][4]))
|
||||
if (chars1 == *(u32 *)(&gStatusConditionStringsTable[i][0][0])
|
||||
&& chars2 == *(u32 *)(&gStatusConditionStringsTable[i][0][4]))
|
||||
return gStatusConditionStringsTable[i][1];
|
||||
}
|
||||
return NULL;
|
||||
@ -2966,7 +2966,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
||||
// 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
|
||||
// below to effect changes in the meaning of the line.
|
||||
static void ChooseMoveUsedParticle(u8* textBuff)
|
||||
static void ChooseMoveUsedParticle(u8 *textBuff)
|
||||
{
|
||||
s32 counter = 0;
|
||||
u32 i = 0;
|
||||
@ -3006,7 +3006,7 @@ static void ChooseMoveUsedParticle(u8* textBuff)
|
||||
//
|
||||
// sText_ExclamationMark5 was " こうげき!" This resulted in a translation of
|
||||
// "<NAME>'s <ATTACK> attack!".
|
||||
static void ChooseTypeOfMoveUsedString(u8* dst)
|
||||
static void ChooseTypeOfMoveUsedString(u8 *dst)
|
||||
{
|
||||
s32 counter = 0;
|
||||
s32 i = 0;
|
||||
|
@ -52,7 +52,7 @@
|
||||
#include "constants/songs.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern const u8* const gBattleScriptsForMoveEffects[];
|
||||
extern const u8 *const gBattleScriptsForMoveEffects[];
|
||||
|
||||
#define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED))
|
||||
|
||||
@ -65,7 +65,7 @@ static bool8 IsTwoTurnsMove(u16 move);
|
||||
static void TrySetDestinyBondToHappen(void);
|
||||
static u8 AttacksThisTurn(u8 battlerId, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2.
|
||||
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 bool32 IsMonGettingExpSentOut(void);
|
||||
static void InitLevelUpBanner(void);
|
||||
static bool8 SlideInLevelUpBanner(void);
|
||||
@ -624,7 +624,7 @@ static const u32 sStatusFlagsForMoveEffects[NUM_MOVE_EFFECTS] =
|
||||
[MOVE_EFFECT_THRASH] = STATUS2_LOCK_CONFUSE,
|
||||
};
|
||||
|
||||
static const u8* const sMoveEffectBS_Ptrs[] =
|
||||
static const u8 *const sMoveEffectBS_Ptrs[] =
|
||||
{
|
||||
[0] = BattleScript_MoveEffectSleep,
|
||||
[MOVE_EFFECT_SLEEP] = BattleScript_MoveEffectSleep,
|
||||
@ -1498,7 +1498,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;
|
||||
if (gBattleMoveDamage == 0 && multiplier != 0)
|
||||
@ -2156,7 +2156,7 @@ static void Cmd_printfromtable(void)
|
||||
{
|
||||
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];
|
||||
|
||||
PrepareStringBattle(*ptr, gBattlerAttacker);
|
||||
@ -2170,7 +2170,7 @@ static void Cmd_printselectionstringfromtable(void)
|
||||
{
|
||||
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];
|
||||
|
||||
gActiveBattler = gBattlerAttacker;
|
||||
@ -2476,7 +2476,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
|| gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_PARALYSIS
|
||||
|| gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_BURN)
|
||||
{
|
||||
u8* synchronizeEffect = &gBattleStruct->synchronizeMoveEffect;
|
||||
u8 *synchronizeEffect = &gBattleStruct->synchronizeMoveEffect;
|
||||
*synchronizeEffect = gBattleCommunication[MOVE_EFFECT_BYTE];
|
||||
gHitMarker |= HITMARKER_SYNCHRONISE_EFFECT;
|
||||
}
|
||||
@ -2753,7 +2753,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
}
|
||||
else
|
||||
{
|
||||
u16* changedItem = &gBattleStruct->changedItems[gBattlerAttacker];
|
||||
u16 *changedItem = &gBattleStruct->changedItems[gBattlerAttacker];
|
||||
gLastUsedItem = *changedItem = gBattleMons[gBattlerTarget].item;
|
||||
gBattleMons[gBattlerTarget].item = ITEM_NONE;
|
||||
|
||||
@ -2768,8 +2768,8 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_ItemSteal;
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -2857,8 +2857,8 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_KnockedOff;
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gEffectBattler]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gEffectBattler]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 1) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3053,7 +3053,7 @@ static void Cmd_jumpifstatus(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
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)
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
@ -3065,7 +3065,7 @@ static void Cmd_jumpifstatus2(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
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)
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
@ -3077,7 +3077,7 @@ static void Cmd_jumpifability(void)
|
||||
{
|
||||
u8 battlerId;
|
||||
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)
|
||||
{
|
||||
@ -3124,7 +3124,7 @@ static void Cmd_jumpifsideaffecting(void)
|
||||
{
|
||||
u8 side;
|
||||
u16 flags;
|
||||
const u8* jumpPtr;
|
||||
const u8 *jumpPtr;
|
||||
|
||||
if (gBattlescriptCurrInstr[1] == BS_ATTACKER)
|
||||
side = GET_BATTLER_SIDE(gBattlerAttacker);
|
||||
@ -3209,7 +3209,7 @@ static void Cmd_jumpiftype(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
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))
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
@ -3627,9 +3627,9 @@ static void Cmd_goto(void)
|
||||
static void Cmd_jumpifbyte(void)
|
||||
{
|
||||
u8 caseID = gBattlescriptCurrInstr[1];
|
||||
const u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||
const u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||
u8 value = gBattlescriptCurrInstr[6];
|
||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7);
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7);
|
||||
|
||||
gBattlescriptCurrInstr += 11;
|
||||
|
||||
@ -3665,9 +3665,9 @@ static void Cmd_jumpifbyte(void)
|
||||
static void Cmd_jumpifhalfword(void)
|
||||
{
|
||||
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);
|
||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8);
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8);
|
||||
|
||||
gBattlescriptCurrInstr += 12;
|
||||
|
||||
@ -3703,9 +3703,9 @@ static void Cmd_jumpifhalfword(void)
|
||||
static void Cmd_jumpifword(void)
|
||||
{
|
||||
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);
|
||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||
|
||||
gBattlescriptCurrInstr += 14;
|
||||
|
||||
@ -3740,10 +3740,10 @@ static void Cmd_jumpifword(void)
|
||||
|
||||
static void Cmd_jumpifarrayequal(void)
|
||||
{
|
||||
const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
u32 size = gBattlescriptCurrInstr[9];
|
||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||
|
||||
u8 i;
|
||||
for (i = 0; i < size; i++)
|
||||
@ -3763,10 +3763,10 @@ static void Cmd_jumpifarrayequal(void)
|
||||
static void Cmd_jumpifarraynotequal(void)
|
||||
{
|
||||
u8 equalBytes = 0;
|
||||
const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
u32 size = gBattlescriptCurrInstr[9];
|
||||
const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10);
|
||||
|
||||
u8 i;
|
||||
for (i = 0; i < size; i++)
|
||||
@ -3784,7 +3784,7 @@ static void Cmd_jumpifarraynotequal(void)
|
||||
|
||||
static void Cmd_setbyte(void)
|
||||
{
|
||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
*memByte = gBattlescriptCurrInstr[5];
|
||||
|
||||
gBattlescriptCurrInstr += 6;
|
||||
@ -3792,22 +3792,22 @@ static void Cmd_setbyte(void)
|
||||
|
||||
static void Cmd_addbyte(void)
|
||||
{
|
||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
*memByte += gBattlescriptCurrInstr[5];
|
||||
gBattlescriptCurrInstr += 6;
|
||||
}
|
||||
|
||||
static void Cmd_subbyte(void)
|
||||
{
|
||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
*memByte -= gBattlescriptCurrInstr[5];
|
||||
gBattlescriptCurrInstr += 6;
|
||||
}
|
||||
|
||||
static void Cmd_copyarray(void)
|
||||
{
|
||||
u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
s32 size = gBattlescriptCurrInstr[9];
|
||||
|
||||
s32 i;
|
||||
@ -3819,9 +3819,9 @@ static void Cmd_copyarray(void)
|
||||
|
||||
static void Cmd_copyarraywithindex(void)
|
||||
{
|
||||
u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
const u8* index = T2_READ_PTR(gBattlescriptCurrInstr + 9);
|
||||
u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
const u8 *index = T2_READ_PTR(gBattlescriptCurrInstr + 9);
|
||||
s32 size = gBattlescriptCurrInstr[13];
|
||||
|
||||
s32 i;
|
||||
@ -3833,14 +3833,14 @@ static void Cmd_copyarraywithindex(void)
|
||||
|
||||
static void Cmd_orbyte(void)
|
||||
{
|
||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
*memByte |= gBattlescriptCurrInstr[5];
|
||||
gBattlescriptCurrInstr += 6;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
*memHword |= val;
|
||||
@ -3849,7 +3849,7 @@ static void Cmd_orhalfword(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);
|
||||
|
||||
*memWord |= val;
|
||||
@ -3858,14 +3858,14 @@ static void Cmd_orword(void)
|
||||
|
||||
static void Cmd_bicbyte(void)
|
||||
{
|
||||
u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
*memByte &= ~(gBattlescriptCurrInstr[5]);
|
||||
gBattlescriptCurrInstr += 6;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
*memHword &= ~val;
|
||||
@ -3874,7 +3874,7 @@ static void Cmd_bichalfword(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);
|
||||
|
||||
*memWord &= ~val;
|
||||
@ -3972,7 +3972,7 @@ static void Cmd_endselectionscript(void)
|
||||
|
||||
static void Cmd_playanimation(void)
|
||||
{
|
||||
const u16* argumentPtr;
|
||||
const u16 *argumentPtr;
|
||||
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
@ -4014,8 +4014,8 @@ static void Cmd_playanimation(void)
|
||||
// Same as playanimation, except it takes a pointer to some animation id, instead of taking the value directly
|
||||
static void Cmd_playanimation_var(void)
|
||||
{
|
||||
const u16* argumentPtr;
|
||||
const u8* animationIdPtr;
|
||||
const u16 *argumentPtr;
|
||||
const u8 *animationIdPtr;
|
||||
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
animationIdPtr = T2_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||
@ -4287,7 +4287,7 @@ static void Cmd_moveend(void)
|
||||
case MOVEEND_CHANGED_ITEMS: // changed held items
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
u16* changedItem = &gBattleStruct->changedItems[i];
|
||||
u16 *changedItem = &gBattleStruct->changedItems[i];
|
||||
if (*changedItem != ITEM_NONE)
|
||||
{
|
||||
gBattleMons[i].item = *changedItem;
|
||||
@ -4420,11 +4420,11 @@ static void Cmd_moveend(void)
|
||||
|
||||
target = gBattlerTarget;
|
||||
attacker = gBattlerAttacker;
|
||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove;
|
||||
*(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove;
|
||||
|
||||
target = gBattlerTarget;
|
||||
attacker = gBattlerAttacker;
|
||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8;
|
||||
*(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8;
|
||||
}
|
||||
gBattleScripting.moveendState++;
|
||||
break;
|
||||
@ -4598,7 +4598,7 @@ static void Cmd_switchindataupdate(void)
|
||||
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
oldData = gBattleMons[gActiveBattler];
|
||||
monData = (u8*)(&gBattleMons[gActiveBattler]);
|
||||
monData = (u8 *)(&gBattleMons[gActiveBattler]);
|
||||
|
||||
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
||||
monData[i] = gBattleBufferB[gActiveBattler][4 + i];
|
||||
@ -5159,13 +5159,13 @@ static void Cmd_switchhandleorder(void)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
|
||||
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(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) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
*((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) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
|
||||
{
|
||||
@ -5244,7 +5244,7 @@ static void Cmd_switchineffects(void)
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
u16* hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(i)];
|
||||
u16 *hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(i)];
|
||||
*hpOnSwitchout = gBattleMons[i].hp;
|
||||
}
|
||||
|
||||
@ -5868,7 +5868,7 @@ static void Cmd_adjustsetdamage(void) // The same as adjustnormaldamage, except
|
||||
|
||||
static void Cmd_removeitem(void)
|
||||
{
|
||||
u16* usedHeldItem;
|
||||
u16 *usedHeldItem;
|
||||
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
|
||||
@ -6117,14 +6117,14 @@ static bool8 SlideOutLevelUpBanner(void)
|
||||
static void PutMonIconOnLvlUpBanner(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
const u16* iconPal;
|
||||
const u16 *iconPal;
|
||||
struct SpriteSheet iconSheet;
|
||||
struct SpritePalette iconPalSheet;
|
||||
|
||||
u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES);
|
||||
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.size = 0x200;
|
||||
iconSheet.tag = TAG_LVLUP_BANNER_MON_ICON;
|
||||
@ -6578,7 +6578,7 @@ static void Cmd_jumpifnexttargetvalid(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)
|
||||
gBattlerTarget = gBattlerAttacker;
|
||||
@ -6749,7 +6749,7 @@ static void Cmd_trysetrest(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)
|
||||
gBattlescriptCurrInstr += 5;
|
||||
@ -6831,7 +6831,7 @@ static void Cmd_stockpile(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)
|
||||
{
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
@ -6857,7 +6857,7 @@ static void Cmd_stockpiletobasedamage(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)
|
||||
{
|
||||
@ -7069,7 +7069,7 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
|
||||
|
||||
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)
|
||||
gBattlescriptCurrInstr += 6;
|
||||
}
|
||||
@ -7705,8 +7705,8 @@ static void Cmd_transformdataexecution(void)
|
||||
|
||||
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].species)
|
||||
|
||||
battleMonAttacker = (u8*)(&gBattleMons[gBattlerAttacker]);
|
||||
battleMonTarget = (u8*)(&gBattleMons[gBattlerTarget]);
|
||||
battleMonAttacker = (u8 *)(&gBattleMons[gBattlerAttacker]);
|
||||
battleMonTarget = (u8 *)(&gBattleMons[gBattlerTarget]);
|
||||
|
||||
for (i = 0; i < offsetof(struct BattlePokemon, pp); i++)
|
||||
battleMonAttacker[i] = battleMonTarget[i];
|
||||
@ -7963,7 +7963,7 @@ static void Cmd_painsplitdmgcalc(void)
|
||||
{
|
||||
s32 hpDiff = (gBattleMons[gBattlerAttacker].hp + gBattleMons[gBattlerTarget].hp) / 2;
|
||||
s32 painSplitHp = gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - hpDiff;
|
||||
u8* storeLoc = (void*)(&gBattleScripting.painSplitHp);
|
||||
u8 *storeLoc = (void*)(&gBattleScripting.painSplitHp);
|
||||
|
||||
storeLoc[0] = (painSplitHp);
|
||||
storeLoc[1] = (painSplitHp & 0x0000FF00) >> 8;
|
||||
@ -9139,11 +9139,11 @@ static void Cmd_tryswapitems(void) // trick
|
||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item);
|
||||
MarkBattlerForControllerExec(gBattlerTarget);
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0;
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 1) = 0;
|
||||
|
||||
gBattlescriptCurrInstr += 5;
|
||||
|
||||
@ -9370,7 +9370,7 @@ static void Cmd_assistattackselect(void)
|
||||
s32 chooseableMovesNo = 0;
|
||||
struct Pokemon* party;
|
||||
s32 monId, moveId;
|
||||
u16* validMoves = gBattleStruct->assistPossibleMoves;
|
||||
u16 *validMoves = gBattleStruct->assistPossibleMoves;
|
||||
|
||||
if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER)
|
||||
party = gEnemyParty;
|
||||
|
@ -1037,17 +1037,17 @@ static void InitTrainerBattleVariables(void)
|
||||
|
||||
static inline void SetU8(void *ptr, u8 value)
|
||||
{
|
||||
*(u8*)(ptr) = value;
|
||||
*(u8 *)(ptr) = value;
|
||||
}
|
||||
|
||||
static inline void SetU16(void *ptr, u16 value)
|
||||
{
|
||||
*(u16*)(ptr) = value;
|
||||
*(u16 *)(ptr) = value;
|
||||
}
|
||||
|
||||
static inline void SetU32(void *ptr, u32 value)
|
||||
{
|
||||
*(u32*)(ptr) = value;
|
||||
*(u32 *)(ptr) = value;
|
||||
}
|
||||
|
||||
static inline void SetPtr(const void *ptr, const void* value)
|
||||
|
@ -996,7 +996,7 @@ static bool8 ChooseSpecialBattleTowerTrainer(void)
|
||||
winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode);
|
||||
for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++)
|
||||
{
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 recordHasData = 0;
|
||||
u32 checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
@ -2374,7 +2374,7 @@ static void LoadMultiPartnerCandidatesData(void)
|
||||
r10 = 0;
|
||||
for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++)
|
||||
{
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 recordHasData = 0;
|
||||
u32 checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
@ -2690,7 +2690,7 @@ static void SetTowerInterviewData(void)
|
||||
static void ValidateBattleTowerRecordChecksums(void)
|
||||
{
|
||||
s32 i, j;
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerPlayer);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerPlayer);
|
||||
u32 checksum = 0;
|
||||
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
@ -2702,7 +2702,7 @@ static void ValidateBattleTowerRecordChecksums(void)
|
||||
|
||||
for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++)
|
||||
{
|
||||
record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
{
|
||||
@ -3195,7 +3195,7 @@ static void ValidateApprenticesChecksums(void)
|
||||
|
||||
for (i = 0; i < APPRENTICE_COUNT; i++)
|
||||
{
|
||||
u32 *data = (u32*) &gSaveBlock2Ptr->apprentices[i];
|
||||
u32 *data = (u32 *) &gSaveBlock2Ptr->apprentices[i];
|
||||
u32 checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct Apprentice) - 4) / 4; j++)
|
||||
checksum += data[j];
|
||||
@ -3504,7 +3504,7 @@ u8 FacilityClassToGraphicsId(u8 facilityClass)
|
||||
bool32 ValidateBattleTowerRecord(u8 recordId) // unused
|
||||
{
|
||||
s32 i;
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[recordId]);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[recordId]);
|
||||
u32 checksum = 0;
|
||||
u32 hasData = 0;
|
||||
for (i = 0; i < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; i++) // - 4, because of the last fjeld bejng the checksum jtself.
|
||||
|
@ -2186,7 +2186,7 @@ static bool8 Wave_Init(struct Task *task)
|
||||
static bool8 Wave_Main(struct Task *task)
|
||||
{
|
||||
u8 i, sinIndex;
|
||||
u16* toStore;
|
||||
u16 *toStore;
|
||||
bool8 finished;
|
||||
|
||||
sTransitionData->VBlank_DMA = FALSE;
|
||||
@ -2347,7 +2347,7 @@ static bool8 Mugshot_SetGfx(struct Task *task)
|
||||
static bool8 Mugshot_ShowBanner(struct Task *task)
|
||||
{
|
||||
u8 i, sinIndex;
|
||||
u16* toStore;
|
||||
u16 *toStore;
|
||||
s16 x;
|
||||
s32 mergedValue;
|
||||
|
||||
@ -2388,7 +2388,7 @@ static bool8 Mugshot_ShowBanner(struct Task *task)
|
||||
if (task->tBottomBannerX < 0)
|
||||
task->tBottomBannerX = 0;
|
||||
|
||||
mergedValue = *(s32*)(&task->tTopBannerX);
|
||||
mergedValue = *(s32 *)(&task->tTopBannerX);
|
||||
if (mergedValue == DISPLAY_WIDTH)
|
||||
task->tState++;
|
||||
|
||||
@ -2401,7 +2401,7 @@ static bool8 Mugshot_ShowBanner(struct Task *task)
|
||||
static bool8 Mugshot_StartOpponentSlide(struct Task *task)
|
||||
{
|
||||
u8 i;
|
||||
u16* toStore;
|
||||
u16 *toStore;
|
||||
|
||||
sTransitionData->VBlank_DMA = FALSE;
|
||||
|
||||
@ -3716,8 +3716,8 @@ static void SpriteCB_WhiteBarFade(struct Sprite *sprite)
|
||||
else
|
||||
{
|
||||
u16 i;
|
||||
u16* ptr1 = &gScanlineEffectRegBuffers[0][sprite->y];
|
||||
u16* ptr2 = &gScanlineEffectRegBuffers[0][sprite->y + DISPLAY_HEIGHT];
|
||||
u16 *ptr1 = &gScanlineEffectRegBuffers[0][sprite->y];
|
||||
u16 *ptr2 = &gScanlineEffectRegBuffers[0][sprite->y + DISPLAY_HEIGHT];
|
||||
for (i = 0; i < DISPLAY_HEIGHT / NUM_WHITE_BARS; i++)
|
||||
{
|
||||
ptr1[i] = sprite->sFade >> 8;
|
||||
@ -3783,7 +3783,7 @@ static bool8 GridSquares_Init(struct Task *task)
|
||||
|
||||
static bool8 GridSquares_Main(struct Task *task)
|
||||
{
|
||||
u16* tileset;
|
||||
u16 *tileset;
|
||||
|
||||
if (task->tDelay == 0)
|
||||
{
|
||||
@ -4061,7 +4061,7 @@ static void GetBg0TilemapDst(u16 **tileset)
|
||||
{
|
||||
u16 charBase = REG_BG0CNT >> 2;
|
||||
charBase <<= 14;
|
||||
*tileset = (u16*)(BG_VRAM + charBase);
|
||||
*tileset = (u16 *)(BG_VRAM + charBase);
|
||||
}
|
||||
|
||||
void GetBg0TilesDst(u16 **tilemap, u16 **tileset)
|
||||
@ -4072,8 +4072,8 @@ void GetBg0TilesDst(u16 **tilemap, u16 **tileset)
|
||||
screenBase <<= 11;
|
||||
charBase <<= 14;
|
||||
|
||||
*tilemap = (u16*)(BG_VRAM + screenBase);
|
||||
*tileset = (u16*)(BG_VRAM + charBase);
|
||||
*tilemap = (u16 *)(BG_VRAM + screenBase);
|
||||
*tileset = (u16 *)(BG_VRAM + charBase);
|
||||
}
|
||||
|
||||
static void FadeScreenBlack(void)
|
||||
|
@ -961,7 +961,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
u8 limitations = 0;
|
||||
u16 move = gBattleMons[gActiveBattler].moves[gBattleBufferB[gActiveBattler][2]];
|
||||
u8 holdEffect;
|
||||
u16* choicedMove = &gBattleStruct->choicedMove[gActiveBattler];
|
||||
u16 *choicedMove = &gBattleStruct->choicedMove[gActiveBattler];
|
||||
|
||||
if (gDisableStructs[gActiveBattler].disabledMove == move && move != MOVE_NONE)
|
||||
{
|
||||
@ -1199,7 +1199,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
|
||||
// It's stupid, but won't match without it
|
||||
{
|
||||
u8* var = &gBattleStruct->turnCountersTracker;
|
||||
u8 *var = &gBattleStruct->turnCountersTracker;
|
||||
(*var)++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
}
|
||||
|
@ -109,12 +109,12 @@ void SwitchPartyOrderInGameMulti(u8 battlerId, u8 arg1)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders));
|
||||
gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders));
|
||||
|
||||
SwitchPartyMonSlots(GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battlerId]), GetPartyIdFromBattlePartyId(arg1));
|
||||
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
*(0 * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -946,7 +946,7 @@ void ClearEnigmaBerries(void)
|
||||
void SetEnigmaBerry(u8 *src)
|
||||
{
|
||||
u32 i;
|
||||
u8 *dest = (u8*)&gSaveBlock1Ptr->enigmaBerry;
|
||||
u8 *dest = (u8 *)&gSaveBlock1Ptr->enigmaBerry;
|
||||
|
||||
for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry); i++)
|
||||
dest[i] = src[i];
|
||||
@ -958,7 +958,7 @@ static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry)
|
||||
u32 checksum;
|
||||
u8 *dest;
|
||||
|
||||
dest = (u8*)enigmaBerry;
|
||||
dest = (u8 *)enigmaBerry;
|
||||
checksum = 0;
|
||||
for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry) - sizeof(gSaveBlock1Ptr->enigmaBerry.checksum); i++)
|
||||
checksum += dest[i];
|
||||
@ -1172,7 +1172,7 @@ void GetBerryNameByBerryType(u8 berry, u8 *string)
|
||||
string[BERRY_NAME_LENGTH] = EOS;
|
||||
}
|
||||
|
||||
void GetBerryCountStringByBerryType(u8 berry, u8* dest, u32 berryCount)
|
||||
void GetBerryCountStringByBerryType(u8 berry, u8 *dest, u32 berryCount)
|
||||
{
|
||||
GetBerryCountString(dest, GetBerryInfo(berry)->name, berryCount);
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ static void SetPlayerBerryData(u8, u16);
|
||||
static void Blender_AddTextPrinter(u8, const u8 *, u8, u8, s32, s32);
|
||||
static void ResetLinkCmds(void);
|
||||
static void CreateParticleSprites(void);
|
||||
static void ShakeBgCoordForHit(s16*, u16);
|
||||
static void ShakeBgCoordForHit(s16 *, u16);
|
||||
static void TryUpdateProgressBar(u16, u16);
|
||||
static void UpdateRPM(u16);
|
||||
static void RestoreBgCoords(void);
|
||||
@ -265,7 +265,7 @@ static const u8 sText_Master[] = _("MASTER");
|
||||
static const u8 sText_Dude[] = _("DUDE");
|
||||
static const u8 sText_Miss[] = _("MISS");
|
||||
|
||||
static const u8* const sBlenderOpponentsNames[] =
|
||||
static const u8 *const sBlenderOpponentsNames[] =
|
||||
{
|
||||
[BLENDER_MISTER] = sText_Mister,
|
||||
[BLENDER_LADDIE] = sText_Laddie,
|
||||
@ -2260,7 +2260,7 @@ static bool8 AreBlenderBerriesSame(struct BlenderBerry* berries, u8 a, u8 b)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16* _flavors, u8 numPlayers, u8 negativeFlavors)
|
||||
static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16 *_flavors, u8 numPlayers, u8 negativeFlavors)
|
||||
{
|
||||
s16 flavors[FLAVOR_COUNT + 1];
|
||||
s32 i, j;
|
||||
@ -2494,7 +2494,7 @@ static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *p
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8* flavors, u16 maxRPM)
|
||||
static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
|
||||
{
|
||||
CalculatePokeblock(berries, pokeblock, numPlayers, flavors, maxRPM);
|
||||
}
|
||||
@ -3318,7 +3318,7 @@ static void UpdateProgressBar(u16 value, u16 limit)
|
||||
s32 amountFilled, maxFilledSegment, subSegmentsFilled, i;
|
||||
u16 *vram;
|
||||
|
||||
vram = (u16*)(BG_SCREEN_ADDR(12));
|
||||
vram = (u16 *)(BG_SCREEN_ADDR(12));
|
||||
amountFilled = (value * 64) / limit;
|
||||
maxFilledSegment = amountFilled / 8;
|
||||
|
||||
@ -3368,22 +3368,22 @@ static void UpdateRPM(u16 speed)
|
||||
digits[i] = currentRPM % 10;
|
||||
currentRPM /= 10;
|
||||
}
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x458)) = digits[4] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x45A)) = digits[3] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x45C)) = digits[2] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x460)) = digits[1] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x462)) = digits[0] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x458)) = digits[4] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x45A)) = digits[3] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x45C)) = digits[2] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x460)) = digits[1] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x462)) = digits[0] + RPM_DIGIT;
|
||||
}
|
||||
|
||||
// Passed a pointer to the bg x/y
|
||||
// Used when hitting a Best at high RPM
|
||||
static void ShakeBgCoordForHit(s16* coord, u16 speed)
|
||||
static void ShakeBgCoordForHit(s16 *coord, u16 speed)
|
||||
{
|
||||
if (*coord == 0)
|
||||
*coord = (Random() % speed) - (speed / 2);
|
||||
}
|
||||
|
||||
static void RestoreBgCoord(s16* coord)
|
||||
static void RestoreBgCoord(s16 *coord)
|
||||
{
|
||||
if (*coord < 0)
|
||||
(*coord)++;
|
||||
@ -3398,7 +3398,7 @@ static void RestoreBgCoords(void)
|
||||
RestoreBgCoord(&sBerryBlender->bg_Y);
|
||||
}
|
||||
|
||||
static void BlenderLandShakeBgCoord(s16* coord, u16 timer)
|
||||
static void BlenderLandShakeBgCoord(s16 *coord, u16 timer)
|
||||
{
|
||||
s32 strength;
|
||||
|
||||
|
@ -879,7 +879,7 @@ static void Task_StartWiredCableClubBattle(u8 taskId)
|
||||
static void Task_StartWirelessCableClubBattle(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
switch (tState)
|
||||
{
|
||||
|
@ -859,19 +859,19 @@ static const struct CompressedSpriteSheet sSpriteSheets_ContestantsTurnBlinkEffe
|
||||
static const struct SpritePalette sSpritePalettes_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] =
|
||||
{
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0A4),
|
||||
.data = (u16 *)(gHeap + 0x1A0A4),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT0
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0C4),
|
||||
.data = (u16 *)(gHeap + 0x1A0C4),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT1
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0E4),
|
||||
.data = (u16 *)(gHeap + 0x1A0E4),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT2
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A104),
|
||||
.data = (u16 *)(gHeap + 0x1A104),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT3
|
||||
}
|
||||
};
|
||||
@ -1396,7 +1396,7 @@ static void Task_RaiseCurtainAtStart(u8 taskId)
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
*(s16*)&gBattle_BG1_Y += 7;
|
||||
*(s16 *)&gBattle_BG1_Y += 7;
|
||||
if ((s16)gBattle_BG1_Y <= DISPLAY_HEIGHT)
|
||||
break;
|
||||
gTasks[taskId].data[0]++;
|
||||
|
@ -268,7 +268,7 @@ bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src
|
||||
struct SpriteSheet dest;
|
||||
void* buffer;
|
||||
|
||||
buffer = AllocZeroed(*((u32*)(&src->data[0])) >> 8);
|
||||
buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8);
|
||||
LZ77UnCompWram(src->data, buffer);
|
||||
|
||||
dest.data = buffer;
|
||||
@ -285,7 +285,7 @@ bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette
|
||||
struct SpritePalette dest;
|
||||
void* buffer;
|
||||
|
||||
buffer = AllocZeroed(*((u32*)(&src->data[0])) >> 8);
|
||||
buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8);
|
||||
LZ77UnCompWram(src->data, buffer);
|
||||
dest.data = buffer;
|
||||
dest.tag = src->tag;
|
||||
|
@ -323,7 +323,7 @@ static bool32 TryPickBerry(u8, u8, u8);
|
||||
static void UpdateFallingBerries(void);
|
||||
static void UpdateGame_Leader(void);
|
||||
static void UpdateGame_Member(void);
|
||||
static void GetActiveBerryColumns(u8, u8*, u8*);
|
||||
static void GetActiveBerryColumns(u8, u8 *, u8 *);
|
||||
static bool32 AllPlayersReadyToStart(void);
|
||||
static void ResetReadyToStart(void);
|
||||
static bool32 ReadyToEndGame_Leader(void);
|
||||
|
@ -76,7 +76,7 @@ static void SpriteCB_Egg_WaitHatch(struct Sprite*);
|
||||
static void SpriteCB_Egg_Hatch(struct Sprite*);
|
||||
static void SpriteCB_Egg_Reveal(struct Sprite*);
|
||||
static void SpriteCB_EggShard(struct Sprite*);
|
||||
static void EggHatchPrintMessage(u8, u8*, u8, u8, u8);
|
||||
static void EggHatchPrintMessage(u8, u8 *, u8, u8, u8);
|
||||
static void CreateRandomEggShardSprite(void);
|
||||
static void CreateEggShardSprite(u8, u8, s16, s16, s16, u8);
|
||||
|
||||
@ -420,7 +420,7 @@ bool8 CheckDaycareMonReceivedMail(void)
|
||||
return _CheckDaycareMonReceivedMail(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004);
|
||||
}
|
||||
|
||||
static u8 EggHatchCreateMonSprite(u8 useAlt, u8 state, u8 partyId, u16* speciesLoc)
|
||||
static u8 EggHatchCreateMonSprite(u8 useAlt, u8 state, u8 partyId, u16 *speciesLoc)
|
||||
{
|
||||
u8 position = 0;
|
||||
u8 spriteId = 0;
|
||||
@ -914,7 +914,7 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 velocityX, s16 velocityY, s16 a
|
||||
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, PIXEL_FILL(15));
|
||||
sEggHatchData->textColor[0] = 0;
|
||||
|
@ -397,8 +397,8 @@ static void Task_EReader(u8 taskId)
|
||||
break;
|
||||
case ER_STATE_CONNECTING:
|
||||
AddTextPrinterToWindow1(gJPText_Connecting);
|
||||
// XXX: This (u32*) cast is discarding the const qualifier from gMultiBootProgram_EReader_Start
|
||||
EReader_Load(&gEReaderData, gMultiBootProgram_EReader_End - gMultiBootProgram_EReader_Start, (u32*)gMultiBootProgram_EReader_Start);
|
||||
// XXX: This (u32 *) cast is discarding the const qualifier from gMultiBootProgram_EReader_Start
|
||||
EReader_Load(&gEReaderData, gMultiBootProgram_EReader_End - gMultiBootProgram_EReader_Start, (u32 *)gMultiBootProgram_EReader_Start);
|
||||
data->state = ER_STATE_TRANSFER;
|
||||
break;
|
||||
case ER_STATE_TRANSFER:
|
||||
|
@ -94,20 +94,20 @@ static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *, s16, s16);
|
||||
static void UpdateObjectEventOffscreen(struct ObjectEvent *, struct Sprite *);
|
||||
static void UpdateObjectEventSpriteVisibility(struct ObjectEvent *, struct Sprite *);
|
||||
static void ObjectEventUpdateMetatileBehaviors(struct ObjectEvent*);
|
||||
static void GetGroundEffectFlags_Reflection(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_TallGrassOnSpawn(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_LongGrassOnSpawn(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_SandHeap(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_ShallowFlowingWater(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_ShortGrass(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_HotSprings(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_TallGrassOnBeginStep(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_Tracks(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_Puddle(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_Ripple(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_Seaweed(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent*, u32*);
|
||||
static void GetGroundEffectFlags_Reflection(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_TallGrassOnSpawn(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_LongGrassOnSpawn(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_SandHeap(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_ShallowFlowingWater(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_ShortGrass(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_HotSprings(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_TallGrassOnBeginStep(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_Tracks(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_Puddle(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_Ripple(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_Seaweed(struct ObjectEvent*, u32 *);
|
||||
static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent*, u32 *);
|
||||
static u8 ObjectEventGetNearbyReflectionType(struct ObjectEvent*);
|
||||
static u8 GetReflectionTypeByMetatileBehavior(u32);
|
||||
static void InitObjectPriorityByElevation(struct Sprite *, u8);
|
||||
@ -1911,9 +1911,9 @@ void SetObjectInvisibility(u8 localId, u8 mapNum, u8 mapGroup, bool8 invisible)
|
||||
|
||||
void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup)
|
||||
{
|
||||
*(u8*)(localId) = objectEvent->localId;
|
||||
*(u8*)(mapNum) = objectEvent->mapNum;
|
||||
*(u8*)(mapGroup) = objectEvent->mapGroup;
|
||||
*(u8 *)(localId) = objectEvent->localId;
|
||||
*(u8 *)(mapNum) = objectEvent->mapNum;
|
||||
*(u8 *)(mapGroup) = objectEvent->mapGroup;
|
||||
}
|
||||
|
||||
void AllowObjectAtPosTriggerGroundEffects(s16 x, s16 y)
|
||||
|
@ -223,9 +223,9 @@ static void FlyInFieldEffect_WaitBirdReturn(struct Task *);
|
||||
static void FlyInFieldEffect_End(struct Task *);
|
||||
|
||||
static void Task_DestroyDeoxysRock(u8 taskId);
|
||||
static void DestroyDeoxysRockEffect_CameraShake(s16*, u8);
|
||||
static void DestroyDeoxysRockEffect_RockFragments(s16*, u8);
|
||||
static void DestroyDeoxysRockEffect_WaitAndEnd(s16*, u8);
|
||||
static void DestroyDeoxysRockEffect_CameraShake(s16 *, u8);
|
||||
static void DestroyDeoxysRockEffect_RockFragments(s16 *, u8);
|
||||
static void DestroyDeoxysRockEffect_WaitAndEnd(s16 *, u8);
|
||||
static void CreateDeoxysRockFragments(struct Sprite*);
|
||||
static void SpriteCB_DeoxysRockFragment(struct Sprite* sprite);
|
||||
|
||||
@ -3088,15 +3088,15 @@ u8 FldEff_RayquazaSpotlight(void)
|
||||
{
|
||||
for (j = 12; j < 18; j++)
|
||||
{
|
||||
((u16*)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1;
|
||||
((u16 *)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1;
|
||||
}
|
||||
}
|
||||
for (k = 0; k < 90; k++)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
*(u16*)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4) = (sSpotlight_Gfx[k * 32 + i * 4 + 1] << 8) + sSpotlight_Gfx[k * 32 + i * 4];
|
||||
*(u16*)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4 + 2) = (sSpotlight_Gfx[k * 32 + i * 4 + 3] << 8) + sSpotlight_Gfx[k * 32 + i * 4 + 2];
|
||||
*(u16 *)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4) = (sSpotlight_Gfx[k * 32 + i * 4 + 1] << 8) + sSpotlight_Gfx[k * 32 + i * 4];
|
||||
*(u16 *)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4 + 2) = (sSpotlight_Gfx[k * 32 + i * 4 + 3] << 8) + sSpotlight_Gfx[k * 32 + i * 4 + 2];
|
||||
}
|
||||
}
|
||||
return spriteId;
|
||||
@ -3675,7 +3675,7 @@ static void StartEndingDeoxysRockCameraShake(u8 taskId)
|
||||
#undef tEndDelay
|
||||
#undef tEnding
|
||||
|
||||
static void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = {
|
||||
static void (*const sDestroyDeoxysRockEffectFuncs[])(s16 *, u8) = {
|
||||
DestroyDeoxysRockEffect_CameraShake,
|
||||
DestroyDeoxysRockEffect_RockFragments,
|
||||
DestroyDeoxysRockEffect_WaitAndEnd,
|
||||
@ -3689,7 +3689,7 @@ static void Task_DestroyDeoxysRock(u8 taskId)
|
||||
sDestroyDeoxysRockEffectFuncs[tState](data, taskId);
|
||||
}
|
||||
|
||||
static void DestroyDeoxysRockEffect_CameraShake(s16* data, u8 taskId)
|
||||
static void DestroyDeoxysRockEffect_CameraShake(s16 *data, u8 taskId)
|
||||
{
|
||||
u8 newTaskId = CreateTask(Task_DeoxysRockCameraShake, 90);
|
||||
PlaySE(SE_THUNDER2);
|
||||
@ -3697,7 +3697,7 @@ static void DestroyDeoxysRockEffect_CameraShake(s16* data, u8 taskId)
|
||||
tState++;
|
||||
}
|
||||
|
||||
static void DestroyDeoxysRockEffect_RockFragments(s16* data, u8 taskId)
|
||||
static void DestroyDeoxysRockEffect_RockFragments(s16 *data, u8 taskId)
|
||||
{
|
||||
if (++tTimer > 120)
|
||||
{
|
||||
@ -3713,7 +3713,7 @@ static void DestroyDeoxysRockEffect_RockFragments(s16* data, u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void DestroyDeoxysRockEffect_WaitAndEnd(s16* data, u8 taskId)
|
||||
static void DestroyDeoxysRockEffect_WaitAndEnd(s16 *data, u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active && !FuncIsActiveTask(Task_DeoxysRockCameraShake))
|
||||
{
|
||||
|
@ -1525,7 +1525,7 @@ void UpdateRayquazaSpotlightEffect(struct Sprite *sprite)
|
||||
{
|
||||
for (j = 12; j < 18; j++)
|
||||
{
|
||||
((u16*)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1;
|
||||
((u16 *)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1611,7 +1611,7 @@ void UpdateRayquazaSpotlightEffect(struct Sprite *sprite)
|
||||
{
|
||||
for (j = 12; j < 18; j++)
|
||||
{
|
||||
((u16*)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0;
|
||||
((u16 *)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0;
|
||||
}
|
||||
}
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
static EWRAM_DATA u8 sFieldMessageBoxMode = 0;
|
||||
|
||||
static void ExpandStringAndStartDrawFieldMessage(const u8*, bool32);
|
||||
static void ExpandStringAndStartDrawFieldMessage(const u8 *, bool32);
|
||||
static void StartDrawFieldMessage(void);
|
||||
|
||||
void InitFieldMessageBox(void)
|
||||
@ -116,7 +116,7 @@ bool8 ShowFieldMessageFromBuffer(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void ExpandStringAndStartDrawFieldMessage(const u8* str, bool32 allowSkippingDelayWithButtonPress)
|
||||
static void ExpandStringAndStartDrawFieldMessage(const u8 *str, bool32 allowSkippingDelayWithButtonPress)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, str);
|
||||
AddTextPrinterForMessage(allowSkippingDelayWithButtonPress);
|
||||
|
@ -43,7 +43,7 @@ static void FillWestConnection(struct MapHeader const *mapHeader, struct MapHead
|
||||
static void FillEastConnection(struct MapHeader const *mapHeader, struct MapHeader const *connectedMapHeader, s32 offset);
|
||||
static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader);
|
||||
static void LoadSavedMapView(void);
|
||||
static bool8 SkipCopyingMetatileFromSavedMap(u16* mapBlock, u16 mapWidth, u8 yMode);
|
||||
static bool8 SkipCopyingMetatileFromSavedMap(u16 *mapBlock, u16 mapWidth, u8 yMode);
|
||||
static struct MapConnection *GetIncomingConnection(u8 direction, int x, int y);
|
||||
static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, struct MapConnection *connection);
|
||||
static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset);
|
||||
@ -823,7 +823,7 @@ void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable)
|
||||
}
|
||||
}
|
||||
|
||||
static bool8 SkipCopyingMetatileFromSavedMap(u16* mapBlock, u16 mapWidth, u8 yMode)
|
||||
static bool8 SkipCopyingMetatileFromSavedMap(u16 *mapBlock, u16 mapWidth, u8 yMode)
|
||||
{
|
||||
if (yMode == 0xFF)
|
||||
return FALSE;
|
||||
@ -879,17 +879,17 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size)
|
||||
if (tileset->isSecondary == FALSE)
|
||||
{
|
||||
LoadPalette(&black, destOffset, 2);
|
||||
LoadPalette(((u16*)tileset->palettes) + 1, destOffset + 1, size - 2);
|
||||
LoadPalette(((u16 *)tileset->palettes) + 1, destOffset + 1, size - 2);
|
||||
FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1);
|
||||
}
|
||||
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);
|
||||
FieldmapPaletteDummy(destOffset, size >> 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadCompressedPalette((u32*)tileset->palettes, destOffset, size);
|
||||
LoadCompressedPalette((u32 *)tileset->palettes, destOffset, size);
|
||||
FieldmapPaletteDummy(destOffset, size >> 1);
|
||||
}
|
||||
}
|
||||
|
@ -28,14 +28,14 @@ static void ApplyImageEffect_PersonalityColor(u8);
|
||||
static void ApplyImageEffect_RedChannelGrayscale(u8);
|
||||
static void ApplyImageEffect_RedChannelGrayscaleHighlight(u8);
|
||||
static void AddPointillismPoints(u16);
|
||||
static u16 ConvertColorToGrayscale(u16*);
|
||||
static u16 QuantizePixel_Blur(u16*, u16*, u16*);
|
||||
static u16 QuantizePixel_PersonalityColor(u16*, u8);
|
||||
static u16 QuantizePixel_BlackAndWhite(u16*);
|
||||
static u16 QuantizePixel_BlackOutline(u16*, u16*);
|
||||
static u16 QuantizePixel_Invert(u16*);
|
||||
static u16 QuantizePixel_BlurHard(u16*, u16*, u16*);
|
||||
static u16 QuantizePixel_MotionBlur(u16*, u16*);
|
||||
static u16 ConvertColorToGrayscale(u16 *);
|
||||
static u16 QuantizePixel_Blur(u16 *, u16 *, u16 *);
|
||||
static u16 QuantizePixel_PersonalityColor(u16 *, u8);
|
||||
static u16 QuantizePixel_BlackAndWhite(u16 *);
|
||||
static u16 QuantizePixel_BlackOutline(u16 *, u16 *);
|
||||
static u16 QuantizePixel_Invert(u16 *);
|
||||
static u16 QuantizePixel_BlurHard(u16 *, u16 *, u16 *);
|
||||
static u16 QuantizePixel_MotionBlur(u16 *, u16 *);
|
||||
static u16 GetColorFromPersonality(u8);
|
||||
static void QuantizePalette_Standard(bool8);
|
||||
static void SetPresetPalette_PrimaryColors(void);
|
||||
@ -46,10 +46,10 @@ static void SetPresetPalette_GrayscaleSmall(void);
|
||||
static void QuantizePalette_GrayscaleSmall(void);
|
||||
static void SetPresetPalette_BlackAndWhite(void);
|
||||
static void QuantizePalette_BlackAndWhite(void);
|
||||
static u16 QuantizePixel_Standard(u16*);
|
||||
static u16 QuantizePixel_GrayscaleSmall(u16*);
|
||||
static u16 QuantizePixel_Grayscale(u16*);
|
||||
static u16 QuantizePixel_PrimaryColors(u16*);
|
||||
static u16 QuantizePixel_Standard(u16 *);
|
||||
static u16 QuantizePixel_GrayscaleSmall(u16 *);
|
||||
static u16 QuantizePixel_Grayscale(u16 *);
|
||||
static u16 QuantizePixel_PrimaryColors(u16 *);
|
||||
|
||||
#define MAX_DIMENSION 64
|
||||
|
||||
@ -1091,7 +1091,7 @@ static u16 QuantizePixel_Standard(u16 *pixel)
|
||||
return RGB2(red, green, blue);
|
||||
}
|
||||
|
||||
static u16 QuantizePixel_PrimaryColors(u16* color)
|
||||
static u16 QuantizePixel_PrimaryColors(u16 *color)
|
||||
{
|
||||
u16 red = GET_R(*color);
|
||||
u16 green = GET_G(*color);
|
||||
|
@ -48,7 +48,7 @@ int GetMaxWidthInMenuTable(const struct MenuAction *actions, int numActions)
|
||||
return ConvertPixelWidthToTileWidth(maxWidth);
|
||||
}
|
||||
|
||||
int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8* actionIds, int numActions)
|
||||
int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8 *actionIds, int numActions)
|
||||
{
|
||||
int i, maxWidth;
|
||||
|
||||
|
102
src/item_menu.c
102
src/item_menu.c
@ -128,7 +128,7 @@ static bool8 LoadBagMenu_Graphics(void);
|
||||
static void LoadBagMenuTextWindows(void);
|
||||
static void AllocateBagItemListBuffers(void);
|
||||
static void LoadBagItemListBuffers(u8);
|
||||
static void PrintPocketNames(const u8*, const u8*);
|
||||
static void PrintPocketNames(const u8 *, const u8 *);
|
||||
static void CopyPocketNameToWindow(u32);
|
||||
static void DrawPocketIndicatorSquare(u8, bool8);
|
||||
static void CreatePocketScrollArrowPair(void);
|
||||
@ -138,10 +138,10 @@ static void PrepareTMHMMoveWindow(void);
|
||||
static bool8 IsWallysBag(void);
|
||||
static void Task_WallyTutorialBagMenu(u8);
|
||||
static void Task_BagMenu_HandleInput(u8);
|
||||
static void GetItemName(s8*, u16);
|
||||
static void GetItemName(s8 *, u16);
|
||||
static void PrintItemDescription(int);
|
||||
static void BagMenu_PrintCursorAtPos(u8, u8);
|
||||
static void BagMenu_Print(u8, u8, const u8*, u8, u8, u8, u8, u8, u8);
|
||||
static void BagMenu_Print(u8, u8, const u8 *, u8, u8, u8, u8, u8, u8);
|
||||
static void Task_CloseBagMenu(u8);
|
||||
static u8 AddItemMessageWindow(u8);
|
||||
static void RemoveItemMessageWindow(u8);
|
||||
@ -1080,7 +1080,7 @@ void Task_FadeAndCloseBagMenu(u8 taskId)
|
||||
|
||||
static void Task_CloseBagMenu(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyListMenuTask(tListTaskId, &gBagPosition.scrollPosition[gBagPosition.pocket], &gBagPosition.cursorPosition[gBagPosition.pocket]);
|
||||
@ -1162,7 +1162,7 @@ u8 GetItemListPosition(u8 pocketId)
|
||||
|
||||
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 taskId))
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
tMsgWindowId = AddItemMessageWindow(ITEMWIN_MESSAGE);
|
||||
FillWindowPixelBuffer(tMsgWindowId, PIXEL_FILL(1));
|
||||
@ -1172,9 +1172,9 @@ void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8
|
||||
|
||||
void CloseItemMessage(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
RemoveItemMessageWindow(ITEMWIN_MESSAGE);
|
||||
DestroyListMenuTask(tListTaskId, scrollPos, cursorPos);
|
||||
UpdatePocketItemList(gBagPosition.pocket);
|
||||
@ -1210,9 +1210,9 @@ static void PrintItemSoldAmount(int windowId, int numSold, int moneyEarned)
|
||||
|
||||
static void Task_BagMenu_HandleInput(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s32 listPosition;
|
||||
|
||||
if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE && !gPaletteFade.active)
|
||||
@ -1313,7 +1313,7 @@ static void ChangeBagPocketId(u8 *bagPocketId, s8 deltaBagPocketId)
|
||||
|
||||
static void SwitchBagPocket(u8 taskId, s16 deltaBagPocketId, bool16 skipEraseList)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u8 newPocket;
|
||||
|
||||
tPocketSwitchState = 0;
|
||||
@ -1352,7 +1352,7 @@ static void SwitchBagPocket(u8 taskId, s16 deltaBagPocketId, bool16 skipEraseLis
|
||||
|
||||
static void Task_SwitchBagPocket(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (!MenuHelpers_IsLinkActive() && !IsWallysBag())
|
||||
{
|
||||
@ -1430,7 +1430,7 @@ static bool8 CanSwapItems(void)
|
||||
|
||||
static void StartItemSwap(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
ListMenuSetUnkIndicatorsStructField(tListTaskId, 16, 1);
|
||||
tListPosition = gBagPosition.scrollPosition[gBagPosition.pocket] + gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
@ -1447,7 +1447,7 @@ static void StartItemSwap(u8 taskId)
|
||||
|
||||
static void Task_HandleSwappingItemsInput(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE)
|
||||
{
|
||||
@ -1485,9 +1485,9 @@ static void Task_HandleSwappingItemsInput(u8 taskId)
|
||||
|
||||
static void DoItemSwap(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
u16 realPos = (*scrollPos + *cursorPos);
|
||||
|
||||
if (tListPosition == realPos || tListPosition == realPos - 1)
|
||||
@ -1512,9 +1512,9 @@ static void DoItemSwap(u8 taskId)
|
||||
|
||||
static void CancelItemSwap(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
|
||||
gBagMenu->toSwapPos = NOT_SWAPPING;
|
||||
DestroyListMenuTask(tListTaskId, scrollPos, cursorPos);
|
||||
@ -1806,7 +1806,7 @@ static void ItemMenu_UseOutOfBattle(u8 taskId)
|
||||
|
||||
static void ItemMenu_Toss(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
RemoveContextWindow();
|
||||
tItemCount = 1;
|
||||
@ -1827,7 +1827,7 @@ static void ItemMenu_Toss(u8 taskId)
|
||||
|
||||
static void AskTossItems(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
CopyItemName(gSpecialVar_ItemId, gStringVar1);
|
||||
ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS);
|
||||
@ -1839,7 +1839,7 @@ static void AskTossItems(u8 taskId)
|
||||
|
||||
static void CancelToss(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
PrintItemDescription(tListPosition);
|
||||
BagMenu_PrintCursor(tListTaskId, COLORID_NORMAL);
|
||||
@ -1848,7 +1848,7 @@ static void CancelToss(u8 taskId)
|
||||
|
||||
static void Task_ChooseHowManyToToss(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (AdjustQuantityAccordingToDPadInput(&tItemCount, tQuantity) == TRUE)
|
||||
{
|
||||
@ -1870,7 +1870,7 @@ static void Task_ChooseHowManyToToss(u8 taskId)
|
||||
|
||||
static void ConfirmToss(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
CopyItemName(gSpecialVar_ItemId, gStringVar1);
|
||||
ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS);
|
||||
@ -1884,9 +1884,9 @@ static void ConfirmToss(u8 taskId)
|
||||
// For when items are tossed or deposited
|
||||
static void Task_RemoveItemFromBag(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
@ -1904,9 +1904,9 @@ static void Task_RemoveItemFromBag(u8 taskId)
|
||||
|
||||
static void ItemMenu_Register(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
|
||||
if (gSaveBlock1Ptr->registeredItem == gSpecialVar_ItemId)
|
||||
gSaveBlock1Ptr->registeredItem = 0;
|
||||
@ -1973,7 +1973,7 @@ static void ItemMenu_CheckTag(u8 taskId)
|
||||
|
||||
static void ItemMenu_Cancel(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
RemoveContextWindow();
|
||||
PrintItemDescription(tListPosition);
|
||||
@ -2066,7 +2066,7 @@ bool8 UseRegisteredKeyItemOnField(void)
|
||||
|
||||
static void Task_ItemContext_Sell(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (ItemId_GetPrice(gSpecialVar_ItemId) == 0)
|
||||
{
|
||||
@ -2093,7 +2093,7 @@ static void Task_ItemContext_Sell(u8 taskId)
|
||||
|
||||
static void DisplaySellItemPriceAndConfirm(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6);
|
||||
StringExpandPlaceholders(gStringVar4, gText_ICanPayVar1);
|
||||
@ -2107,7 +2107,7 @@ static void AskSellItems(u8 taskId)
|
||||
|
||||
static void CancelSell(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
RemoveMoneyWindow();
|
||||
RemoveItemMessageWindow(ITEMWIN_MESSAGE);
|
||||
@ -2117,7 +2117,7 @@ static void CancelSell(u8 taskId)
|
||||
|
||||
static void InitSellHowManyInput(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u8 windowId = BagMenu_AddWindow(ITEMWIN_QUANTITY_WIDE);
|
||||
|
||||
PrintItemSoldAmount(windowId, 1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount);
|
||||
@ -2127,7 +2127,7 @@ static void InitSellHowManyInput(u8 taskId)
|
||||
|
||||
static void Task_ChooseHowManyToSell(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (AdjustQuantityAccordingToDPadInput(&tItemCount, tQuantity) == TRUE)
|
||||
{
|
||||
@ -2152,7 +2152,7 @@ static void Task_ChooseHowManyToSell(u8 taskId)
|
||||
|
||||
static void ConfirmSell(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
CopyItemName(gSpecialVar_ItemId, gStringVar2);
|
||||
ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6);
|
||||
@ -2162,9 +2162,9 @@ static void ConfirmSell(u8 taskId)
|
||||
|
||||
static void SellItem(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket];
|
||||
u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket];
|
||||
|
||||
PlaySE(SE_SHOP);
|
||||
RemoveBagItem(gSpecialVar_ItemId, tItemCount);
|
||||
@ -2191,7 +2191,7 @@ static void WaitAfterItemSell(u8 taskId)
|
||||
|
||||
static void Task_ItemContext_Deposit(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
tItemCount = 1;
|
||||
if (tQuantity == 1)
|
||||
@ -2211,7 +2211,7 @@ static void Task_ItemContext_Deposit(u8 taskId)
|
||||
|
||||
static void Task_ChooseHowManyToDeposit(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (AdjustQuantityAccordingToDPadInput(&tItemCount, tQuantity) == TRUE)
|
||||
{
|
||||
@ -2235,7 +2235,7 @@ static void Task_ChooseHowManyToDeposit(u8 taskId)
|
||||
|
||||
static void TryDepositItem(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
FillWindowPixelBuffer(WIN_DESCRIPTION, PIXEL_FILL(0));
|
||||
if (ItemId_GetImportance(gSpecialVar_ItemId))
|
||||
@ -2263,7 +2263,7 @@ static void TryDepositItem(u8 taskId)
|
||||
|
||||
static void WaitDepositErrorMessage(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
@ -2327,7 +2327,7 @@ void DoWallyTutorialBagMenu(void)
|
||||
|
||||
static void Task_WallyTutorialBagMenu(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
@ -2423,19 +2423,19 @@ static void PrintPocketNames(const u8 *pocketName1, const u8 *pocketName2)
|
||||
offset = GetStringCenterAlignXOffset(FONT_NORMAL, pocketName2, 0x40);
|
||||
BagMenu_Print(windowId, FONT_NORMAL, pocketName2, offset + 0x40, 1, 0, 0, TEXT_SKIP_DRAW, COLORID_POCKET_NAME);
|
||||
}
|
||||
CpuCopy32((u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA), gBagMenu->pocketNameBuffer, sizeof(gBagMenu->pocketNameBuffer));
|
||||
CpuCopy32((u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA), gBagMenu->pocketNameBuffer, sizeof(gBagMenu->pocketNameBuffer));
|
||||
RemoveWindow(windowId);
|
||||
}
|
||||
|
||||
static void CopyPocketNameToWindow(u32 a)
|
||||
{
|
||||
u8 (* tileDataBuffer)[32][32];
|
||||
u8* windowTileData;
|
||||
u8 *windowTileData;
|
||||
int b;
|
||||
if (a > 8)
|
||||
a = 8;
|
||||
tileDataBuffer = &gBagMenu->pocketNameBuffer;
|
||||
windowTileData = (u8*)GetWindowAttribute(2, WINDOW_TILE_DATA);
|
||||
windowTileData = (u8 *)GetWindowAttribute(2, WINDOW_TILE_DATA);
|
||||
CpuCopy32(tileDataBuffer[0][a], windowTileData, 0x100); // Top half of pocket name
|
||||
b = a + 16;
|
||||
CpuCopy32(tileDataBuffer[0][b], windowTileData + 0x100, 0x100); // Bottom half of pocket name
|
||||
@ -2551,7 +2551,7 @@ static void PrintTMHMMoveData(u16 itemId)
|
||||
{
|
||||
u8 i;
|
||||
u16 moveId;
|
||||
const u8* text;
|
||||
const u8 *text;
|
||||
|
||||
FillWindowPixelBuffer(WIN_TMHM_INFO, PIXEL_FILL(0));
|
||||
if (itemId == ITEM_NONE)
|
||||
|
@ -195,7 +195,7 @@ void ItemUseOutOfBattle_Mail(u8 taskId)
|
||||
|
||||
void ItemUseOutOfBattle_Bike(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
s16 coordsY;
|
||||
s16 coordsX;
|
||||
u8 behavior;
|
||||
@ -301,7 +301,7 @@ static void Task_UseItemfinder(u8 taskId)
|
||||
u8 playerDir;
|
||||
u8 playerDirToItem;
|
||||
u8 i;
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
if (tCounter == 0)
|
||||
{
|
||||
if (tItemfinderBeeps == 4)
|
||||
@ -843,7 +843,7 @@ void ItemUseOutOfBattle_Repel(u8 taskId)
|
||||
|
||||
static void Task_StartUseRepel(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (++data[8] > 7)
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP
|
||||
/*
|
||||
void NoCashGBAPrint(const char *pBuf)
|
||||
{
|
||||
*(volatile u32*)NOCASHGBAPRINTADDR2 = (u32)pBuf;
|
||||
*(volatile u32 *)NOCASHGBAPRINTADDR2 = (u32)pBuf;
|
||||
}
|
||||
|
||||
void NoCashGBAPrintf(const char *pBuf, ...)
|
||||
|
@ -41,7 +41,7 @@ static void sio32intr_clock_master(void)
|
||||
{
|
||||
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++;
|
||||
}
|
||||
else
|
||||
@ -62,7 +62,7 @@ static void sio32intr_clock_master(void)
|
||||
if ((regSIODATA32 & 0xFFFF0000) == 0x99660000)
|
||||
{
|
||||
gSTWIStatus->ackNext = 0;
|
||||
((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
||||
((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
||||
gSTWIStatus->ackNext++;
|
||||
gSTWIStatus->ackActiveCommand = regSIODATA32;
|
||||
gSTWIStatus->ackLength = ackLen = regSIODATA32 >> 8;
|
||||
@ -85,7 +85,7 @@ static void sio32intr_clock_master(void)
|
||||
}
|
||||
else if (gSTWIStatus->state == 2) // master receive ack
|
||||
{
|
||||
((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
||||
((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32;
|
||||
gSTWIStatus->ackNext++;
|
||||
if (gSTWIStatus->ackLength < gSTWIStatus->ackNext)
|
||||
gSTWIStatus->state = 3; // master done ack
|
||||
@ -158,7 +158,7 @@ static void sio32intr_clock_slave(void)
|
||||
regSIODATA32 = REG_SIODATA32;
|
||||
if (gSTWIStatus->state == 5) // slave receive req init
|
||||
{
|
||||
((u32*)gSTWIStatus->rxPacket)[0] = regSIODATA32;
|
||||
((u32 *)gSTWIStatus->rxPacket)[0] = regSIODATA32;
|
||||
gSTWIStatus->reqNext = 1;
|
||||
r0 = 0x99660000;
|
||||
// variable reuse required
|
||||
@ -179,24 +179,24 @@ static void sio32intr_clock_slave(void)
|
||||
)
|
||||
{
|
||||
gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80;
|
||||
((u32*)gSTWIStatus->txPacket)[0] = 0x99660000 + gSTWIStatus->ackActiveCommand;
|
||||
((u32 *)gSTWIStatus->txPacket)[0] = 0x99660000 + gSTWIStatus->ackActiveCommand;
|
||||
gSTWIStatus->ackLength = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
((u32*)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
||||
((u32 *)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
||||
if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D)
|
||||
{
|
||||
((u32*)gSTWIStatus->txPacket)[1] = 1;
|
||||
((u32 *)gSTWIStatus->txPacket)[1] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
((u32*)gSTWIStatus->txPacket)[1] = 2;
|
||||
((u32 *)gSTWIStatus->txPacket)[1] = 2;
|
||||
}
|
||||
gSTWIStatus->ackLength = 1;
|
||||
gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION;
|
||||
}
|
||||
REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[0];
|
||||
REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[0];
|
||||
gSTWIStatus->ackNext = 1;
|
||||
gSTWIStatus->state = 7; // slave send ack
|
||||
}
|
||||
@ -216,7 +216,7 @@ static void sio32intr_clock_slave(void)
|
||||
}
|
||||
else if (gSTWIStatus->state == 6) // slave receive req
|
||||
{
|
||||
((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->reqNext] = regSIODATA32;
|
||||
((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->reqNext] = regSIODATA32;
|
||||
gSTWIStatus->reqNext++;
|
||||
if (gSTWIStatus->reqLength < gSTWIStatus->reqNext)
|
||||
{
|
||||
@ -227,24 +227,24 @@ static void sio32intr_clock_slave(void)
|
||||
)
|
||||
{
|
||||
gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80;
|
||||
((u32*)gSTWIStatus->txPacket)[0] = 0x99660000 | gSTWIStatus->ackActiveCommand;
|
||||
((u32 *)gSTWIStatus->txPacket)[0] = 0x99660000 | gSTWIStatus->ackActiveCommand;
|
||||
gSTWIStatus->ackLength = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
((u32*)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
||||
((u32 *)gSTWIStatus->txPacket)[0] = 0x996601EE;
|
||||
if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D)
|
||||
{
|
||||
((u32*)gSTWIStatus->txPacket)[1] = 1;
|
||||
((u32 *)gSTWIStatus->txPacket)[1] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
((u32*)gSTWIStatus->txPacket)[1] = 2;
|
||||
((u32 *)gSTWIStatus->txPacket)[1] = 2;
|
||||
}
|
||||
gSTWIStatus->ackLength = 1;
|
||||
gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION;
|
||||
}
|
||||
REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[0];
|
||||
REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[0];
|
||||
gSTWIStatus->ackNext = 1;
|
||||
gSTWIStatus->state = 7; // slave send ack
|
||||
}
|
||||
@ -263,7 +263,7 @@ static void sio32intr_clock_slave(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[gSTWIStatus->ackNext];
|
||||
REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[gSTWIStatus->ackNext];
|
||||
gSTWIStatus->ackNext++;
|
||||
}
|
||||
}
|
||||
@ -336,8 +336,8 @@ static u16 handshake_wait(u16 slot)
|
||||
|
||||
static void STWI_set_timer_in_RAM(u8 count)
|
||||
{
|
||||
vu16* regTMCNTL = ®_TMCNT_L(gSTWIStatus->timerSelect);
|
||||
vu16* regTMCNTH = ®_TMCNT_H(gSTWIStatus->timerSelect);
|
||||
vu16 *regTMCNTL = ®_TMCNT_L(gSTWIStatus->timerSelect);
|
||||
vu16 *regTMCNTH = ®_TMCNT_H(gSTWIStatus->timerSelect);
|
||||
REG_IME = 0;
|
||||
switch (count)
|
||||
{
|
||||
|
@ -235,7 +235,7 @@ void STWI_send_SystemConfigREQ(u16 availSlotFlag, u8 maxMFrame, u8 mcTimer)
|
||||
packetBytes += sizeof(u32);
|
||||
*packetBytes++ = mcTimer;
|
||||
*packetBytes++ = maxMFrame;
|
||||
*(u16*)packetBytes = availSlotFlag;
|
||||
*(u16 *)packetBytes = availSlotFlag;
|
||||
STWI_start_Command();
|
||||
}
|
||||
}
|
||||
|
@ -2747,7 +2747,7 @@ static void Task_RfuReconnectWithParent(u8 taskId)
|
||||
|
||||
if (CanTryReconnectParent())
|
||||
{
|
||||
u8 id = GetPartnerIndexByNameAndTrainerID((u8*)data, ReadU16(&data[8]));
|
||||
u8 id = GetPartnerIndexByNameAndTrainerID((u8 *)data, ReadU16(&data[8]));
|
||||
if (id != 0xFF)
|
||||
{
|
||||
if (gRfuLinkStatus->partner[id].slot != 0xFF)
|
||||
@ -2797,7 +2797,7 @@ void CreateTask_RfuReconnectWithParent(const u8 *name, u16 trainerId)
|
||||
gRfu.status = RFU_STATUS_OK;
|
||||
taskId = CreateTask(Task_RfuReconnectWithParent, 3);
|
||||
data = gTasks[taskId].data;
|
||||
StringCopy((u8*)(data), name);
|
||||
StringCopy((u8 *)(data), name);
|
||||
data[8] = trainerId;
|
||||
}
|
||||
|
||||
|
@ -1178,7 +1178,7 @@ void CgbSound(void)
|
||||
*nrx3ptr = channels->frequency;
|
||||
else
|
||||
*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);
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ static u32 InitMainMenu(bool8);
|
||||
static void Task_MainMenuCheckSaveFile(u8);
|
||||
static void Task_MainMenuCheckBattery(u8);
|
||||
static void Task_WaitForSaveFileErrorWindow(u8);
|
||||
static void CreateMainMenuErrorWindow(const u8*);
|
||||
static void CreateMainMenuErrorWindow(const u8 *);
|
||||
static void ClearMainMenuWindowTilemap(const struct WindowTemplate*);
|
||||
static void Task_DisplayMainMenu(u8);
|
||||
static void Task_WaitForBatteryDryErrorWindow(u8);
|
||||
@ -621,7 +621,7 @@ static u32 InitMainMenu(bool8 returningFromOptionsMenu)
|
||||
|
||||
static void Task_MainMenuCheckSaveFile(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
@ -736,7 +736,7 @@ static void Task_WaitForBatteryDryErrorWindow(u8 taskId)
|
||||
|
||||
static void Task_DisplayMainMenu(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 palette;
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
@ -880,7 +880,7 @@ static void Task_HighlightSelectedMainMenuItem(u8 taskId)
|
||||
|
||||
static bool8 HandleMainMenuInput(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
@ -1807,8 +1807,8 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void)
|
||||
DmaFill32(3, 0, OAM, OAM_SIZE);
|
||||
DmaFill16(3, 0, PLTT, PLTT_SIZE);
|
||||
ResetPaletteFade();
|
||||
LZ77UnCompVram(sBirchSpeechShadowGfx, (u8*)VRAM);
|
||||
LZ77UnCompVram(sBirchSpeechBgMap, (u8*)(BG_SCREEN_ADDR(7)));
|
||||
LZ77UnCompVram(sBirchSpeechShadowGfx, (u8 *)VRAM);
|
||||
LZ77UnCompVram(sBirchSpeechBgMap, (u8 *)(BG_SCREEN_ADDR(7)));
|
||||
LoadPalette(sBirchSpeechBgPals, 0, 64);
|
||||
LoadPalette(&sBirchSpeechBgGradientPal[1], 1, 16);
|
||||
ResetTasks();
|
||||
@ -2102,7 +2102,7 @@ static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void)
|
||||
|
||||
static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
|
||||
{
|
||||
const u8* name;
|
||||
const u8 *name;
|
||||
u8 i;
|
||||
|
||||
if (gSaveBlock2Ptr->playerGender == MALE)
|
||||
@ -2114,7 +2114,7 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
|
||||
gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS;
|
||||
}
|
||||
|
||||
static void CreateMainMenuErrorWindow(const u8* str)
|
||||
static void CreateMainMenuErrorWindow(const u8 *str)
|
||||
{
|
||||
FillWindowPixelBuffer(7, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized(7, FONT_NORMAL, str, 0, 1, 2, 0);
|
||||
@ -2143,7 +2143,7 @@ static void MainMenu_FormatSavegamePlayer(void)
|
||||
static void MainMenu_FormatSavegameTime(void)
|
||||
{
|
||||
u8 str[0x20];
|
||||
u8* ptr;
|
||||
u8 *ptr;
|
||||
|
||||
StringExpandPlaceholders(gStringVar4, gText_ContinueMenuTime);
|
||||
AddTextPrinterParameterized3(2, FONT_NORMAL, 0x6C, 17, sTextColor_MenuInfo, TEXT_SKIP_DRAW, gStringVar4);
|
||||
|
@ -303,7 +303,7 @@ static void ShowMapNamePopUpWindow(void)
|
||||
u8 mapDisplayHeader[24];
|
||||
u8 *withoutPrefixPtr;
|
||||
u8 x;
|
||||
const u8* mapDisplayHeaderSource;
|
||||
const u8 *mapDisplayHeaderSource;
|
||||
|
||||
if (InBattlePyramid())
|
||||
{
|
||||
|
10
src/menu.c
10
src/menu.c
@ -2038,7 +2038,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u
|
||||
pixelsDst--;
|
||||
if (loopDstX & 1)
|
||||
{
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr = *(vu16 *)pixelsDst;
|
||||
toOrr &= 0x0fff;
|
||||
if (loopSrcX & 1)
|
||||
toOrr |= ((*pixelsSrc & 0xf0) << 8);
|
||||
@ -2047,7 +2047,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u
|
||||
}
|
||||
else
|
||||
{
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr = *(vu16 *)pixelsDst;
|
||||
toOrr &= 0xf0ff;
|
||||
if (loopSrcX & 1)
|
||||
toOrr |= ((*pixelsSrc & 0xf0) << 4);
|
||||
@ -2059,7 +2059,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u
|
||||
{
|
||||
if (loopDstX & 1)
|
||||
{
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr = *(vu16 *)pixelsDst;
|
||||
toOrr &= 0xff0f;
|
||||
if (loopSrcX & 1)
|
||||
toOrr |= ((*pixelsSrc & 0xf0) << 0);
|
||||
@ -2068,7 +2068,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u
|
||||
}
|
||||
else
|
||||
{
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr = *(vu16 *)pixelsDst;
|
||||
toOrr &= 0xfff0;
|
||||
if (loopSrcX & 1)
|
||||
toOrr |= ((*pixelsSrc & 0xf0) >> 4);
|
||||
@ -2076,7 +2076,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u
|
||||
toOrr |= ((*pixelsSrc & 0x0f) >> 0);
|
||||
}
|
||||
}
|
||||
*(vu16*)pixelsDst = toOrr;
|
||||
*(vu16 *)pixelsDst = toOrr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ static void DoMirageTowerDisintegration(u8);
|
||||
static void InitMirageTowerShake(u8);
|
||||
static void Task_FossilFallAndSink(u8);
|
||||
static void SpriteCB_FallingFossil(struct Sprite *);
|
||||
static void UpdateDisintegrationEffect(u8*, u16, u8, u8, u8);
|
||||
static void UpdateDisintegrationEffect(u8 *, u16, u8, u8, u8);
|
||||
|
||||
static const u8 sBlankTile_Gfx[32] = {0};
|
||||
static const u8 sMirageTower_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower.4bpp");
|
||||
@ -249,8 +249,8 @@ static const struct SpriteTemplate sSpriteTemplate_CeilingCrumbleLarge = {
|
||||
.callback = SpriteCB_CeilingCrumble
|
||||
};
|
||||
|
||||
EWRAM_DATA static u8* sMirageTowerGfxBuffer = NULL;
|
||||
EWRAM_DATA static u8* sMirageTowerTilemapBuffer = NULL;
|
||||
EWRAM_DATA static u8 *sMirageTowerGfxBuffer = NULL;
|
||||
EWRAM_DATA static u8 *sMirageTowerTilemapBuffer = NULL;
|
||||
EWRAM_DATA static struct FallAnim_Fossil *sFallingFossil = NULL;
|
||||
EWRAM_DATA static struct FallAnim_Tower *sFallingTower = NULL;
|
||||
EWRAM_DATA static struct BgRegOffsets *sBgShakeOffsets = NULL;
|
||||
@ -748,7 +748,7 @@ static void SpriteCB_FallingFossil(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateDisintegrationEffect(u8* tiles, u16 randId, u8 c, u8 size, u8 offset)
|
||||
static void UpdateDisintegrationEffect(u8 *tiles, u16 randId, u8 c, u8 size, u8 offset)
|
||||
{
|
||||
u8 heightTiles, height, widthTiles, width;
|
||||
u16 var, baseOffset;
|
||||
|
10
src/money.c
10
src/money.c
@ -69,17 +69,17 @@ static const struct CompressedSpritePalette sSpritePalette_MoneyLabel =
|
||||
.tag = MONEY_LABEL_TAG
|
||||
};
|
||||
|
||||
u32 GetMoney(u32* moneyPtr)
|
||||
u32 GetMoney(u32 *moneyPtr)
|
||||
{
|
||||
return *moneyPtr ^ gSaveBlock2Ptr->encryptionKey;
|
||||
}
|
||||
|
||||
void SetMoney(u32* moneyPtr, u32 newValue)
|
||||
void SetMoney(u32 *moneyPtr, u32 newValue)
|
||||
{
|
||||
*moneyPtr = gSaveBlock2Ptr->encryptionKey ^ newValue;
|
||||
}
|
||||
|
||||
bool8 IsEnoughMoney(u32* moneyPtr, u32 cost)
|
||||
bool8 IsEnoughMoney(u32 *moneyPtr, u32 cost)
|
||||
{
|
||||
if (GetMoney(moneyPtr) >= cost)
|
||||
return TRUE;
|
||||
@ -87,7 +87,7 @@ bool8 IsEnoughMoney(u32* moneyPtr, u32 cost)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void AddMoney(u32* moneyPtr, u32 toAdd)
|
||||
void AddMoney(u32 *moneyPtr, u32 toAdd)
|
||||
{
|
||||
u32 toSet = GetMoney(moneyPtr);
|
||||
|
||||
@ -107,7 +107,7 @@ void AddMoney(u32* moneyPtr, u32 toAdd)
|
||||
SetMoney(moneyPtr, toSet);
|
||||
}
|
||||
|
||||
void RemoveMoney(u32* moneyPtr, u32 toSub)
|
||||
void RemoveMoney(u32 *moneyPtr, u32 toSub)
|
||||
{
|
||||
u32 toSet = GetMoney(moneyPtr);
|
||||
|
||||
|
@ -104,7 +104,7 @@ static int CalcRecordMixingGiftChecksum(void)
|
||||
{
|
||||
unsigned int i;
|
||||
int sum = 0;
|
||||
u8 *data = (u8*)(&gSaveBlock1Ptr->recordMixingGift.data);
|
||||
u8 *data = (u8 *)(&gSaveBlock1Ptr->recordMixingGift.data);
|
||||
|
||||
for (i = 0; i < sizeof(gSaveBlock1Ptr->recordMixingGift.data); i++)
|
||||
sum += data[i];
|
||||
|
@ -333,7 +333,7 @@ static const struct SpriteTemplate sSpriteTemplate_Cursor;
|
||||
static const struct SpriteTemplate sSpriteTemplate_InputArrow;
|
||||
static const struct SpriteTemplate sSpriteTemplate_Underscore;
|
||||
static const struct SpriteTemplate sSpriteTemplate_PCIcon;
|
||||
static const u8* const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT];
|
||||
static const u8 *const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT];
|
||||
static const struct SpriteSheet sSpriteSheets[];
|
||||
static const struct SpritePalette sSpritePalettes[];
|
||||
|
||||
@ -2520,7 +2520,7 @@ static const struct SpriteTemplate sSpriteTemplate_PCIcon =
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
static const u8* const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT] =
|
||||
static const u8 *const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT] =
|
||||
{
|
||||
[KEYBOARD_LETTERS_LOWER] =
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ static void CreateLinkPlayerSprites(void);
|
||||
static void ClearAllPlayerKeys(void);
|
||||
static void ResetAllPlayerLinkStates(void);
|
||||
static void UpdateHeldKeyCode(u16);
|
||||
static void UpdateAllLinkPlayers(u16*, s32);
|
||||
static void UpdateAllLinkPlayers(u16 *, s32);
|
||||
static u8 FlipVerticalAndClearForced(u8, u8);
|
||||
static u8 LinkPlayerDetectCollision(u8, u8, s16, s16);
|
||||
static void CreateLinkPlayerSprite(u8, u8);
|
||||
@ -2923,7 +2923,7 @@ static void ZeroObjectEvent(struct ObjectEvent *objEvent)
|
||||
// conflict with the usual Event Object struct, thus the definitions.
|
||||
#define linkGender(obj) obj->singleMovementActive
|
||||
// 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)
|
||||
{
|
||||
|
@ -193,9 +193,9 @@ static void DisplayPartyPokemonDescriptionText(u8, struct PartyMenuBox *, u8);
|
||||
static bool8 IsMonAllowedInMinigame(u8);
|
||||
static void DisplayPartyPokemonDataToTeachMove(u8, u16, u8);
|
||||
static u8 CanMonLearnTMTutor(struct Pokemon *, u16, u8);
|
||||
static void DisplayPartyPokemonBarDetail(u8, const u8*, u8, const u8*);
|
||||
static void DisplayPartyPokemonBarDetail(u8, const u8 *, u8, const u8 *);
|
||||
static void DisplayPartyPokemonLevel(u8, struct PartyMenuBox *);
|
||||
static void DisplayPartyPokemonGender(u8, u16, u8*, struct PartyMenuBox *);
|
||||
static void DisplayPartyPokemonGender(u8, u16, u8 *, struct PartyMenuBox *);
|
||||
static void DisplayPartyPokemonHP(u16, struct PartyMenuBox *);
|
||||
static void DisplayPartyPokemonMaxHP(u16, struct PartyMenuBox *);
|
||||
static void DisplayPartyPokemonHPBar(u16, u16, struct PartyMenuBox *);
|
||||
@ -220,12 +220,12 @@ static u8 GetPartyIdFromBattleSlot(u8);
|
||||
static void Task_ClosePartyMenuAndSetCB2(u8);
|
||||
static void UpdatePartyToFieldOrder(void);
|
||||
static void MoveCursorToConfirm(void);
|
||||
static void HandleChooseMonCancel(u8, s8*);
|
||||
static void HandleChooseMonSelection(u8, s8*);
|
||||
static u16 PartyMenuButtonHandler(s8*);
|
||||
static s8* GetCurrentPartySlotPtr(void);
|
||||
static bool8 IsSelectedMonNotEgg(u8*);
|
||||
static void PartyMenuRemoveWindow(u8*);
|
||||
static void HandleChooseMonCancel(u8, s8 *);
|
||||
static void HandleChooseMonSelection(u8, s8 *);
|
||||
static u16 PartyMenuButtonHandler(s8 *);
|
||||
static s8 *GetCurrentPartySlotPtr(void);
|
||||
static bool8 IsSelectedMonNotEgg(u8 *);
|
||||
static void PartyMenuRemoveWindow(u8 *);
|
||||
static void CB2_SetUpExitToBattleScreen(void);
|
||||
static void Task_ClosePartyMenuAfterText(u8);
|
||||
static void TryTutorSelectedMon(u8);
|
||||
@ -237,16 +237,16 @@ static void Task_TryCreateSelectionWindow(u8);
|
||||
static void FinishTwoMonAction(u8);
|
||||
static void CancelParticipationPrompt(u8);
|
||||
static bool8 DisplayCancelChooseMonYesNo(u8);
|
||||
static const u8* GetFacilityCancelString(void);
|
||||
static const u8 *GetFacilityCancelString(void);
|
||||
static void Task_CancelChooseMonYesNo(u8);
|
||||
static void PartyMenuDisplayYesNoMenu(void);
|
||||
static void Task_HandleCancelChooseMonYesNoInput(u8);
|
||||
static void Task_ReturnToChooseMonAfterText(u8);
|
||||
static void UpdateCurrentPartySelection(s8*, s8);
|
||||
static void UpdatePartySelectionSingleLayout(s8*, s8);
|
||||
static void UpdatePartySelectionDoubleLayout(s8*, s8);
|
||||
static void UpdateCurrentPartySelection(s8 *, s8);
|
||||
static void UpdatePartySelectionSingleLayout(s8 *, s8);
|
||||
static void UpdatePartySelectionDoubleLayout(s8 *, s8);
|
||||
static s8 GetNewSlotDoubleLayout(s8, s8);
|
||||
static void PartyMenuPrintText(const u8*);
|
||||
static void PartyMenuPrintText(const u8 *);
|
||||
static void Task_PrintAndWaitForText(u8);
|
||||
static bool16 IsMonAllowedInPokemonJump(struct Pokemon*);
|
||||
static bool16 IsMonAllowedInDodrioBerryPicking(struct Pokemon*);
|
||||
@ -311,7 +311,7 @@ static void Task_SetSacredAshCB(u8);
|
||||
static void CB2_ReturnToBagMenu(void);
|
||||
static void Task_DisplayHPRestoredMessage(u8);
|
||||
static u16 ItemEffectToMonEv(struct Pokemon*, u8);
|
||||
static void ItemEffectToStatString(u8, u8*);
|
||||
static void ItemEffectToStatString(u8, u8 *);
|
||||
static void ReturnToUseOnWhichMon(u8);
|
||||
static void SetSelectedMoveForPPItem(u8);
|
||||
static void TryUsePPItem(u8);
|
||||
@ -331,7 +331,7 @@ static void Task_PartyMenuReplaceMove(u8);
|
||||
static void Task_StopLearningMoveYesNo(u8);
|
||||
static void Task_HandleStopLearningMoveYesNoInput(u8);
|
||||
static void Task_TryLearningNextMoveAfterText(u8);
|
||||
static void BufferMonStatsToTaskData(struct Pokemon*, s16*);
|
||||
static void BufferMonStatsToTaskData(struct Pokemon*, s16 *);
|
||||
static void UpdateMonDisplayInfoAfterRareCandy(u8, struct Pokemon*);
|
||||
static void Task_DisplayLevelUpStatsPg1(u8);
|
||||
static void DisplayLevelUpStatsPg1(u8);
|
||||
@ -362,8 +362,8 @@ static u8 GetBattleEntryLevelCap(void);
|
||||
static u8 GetMaxBattleEntries(void);
|
||||
static u8 GetMinBattleEntries(void);
|
||||
static void Task_ContinueChoosingHalfParty(u8);
|
||||
static void BufferBattlePartyOrder(u8*, bool8);
|
||||
static void BufferBattlePartyOrderBySide(u8*, u8, u8);
|
||||
static void BufferBattlePartyOrder(u8 *, bool8);
|
||||
static void BufferBattlePartyOrderBySide(u8 *, u8, u8);
|
||||
static void Task_InitMultiPartnerPartySlideIn(u8);
|
||||
static void Task_MultiPartnerPartySlideIn(u8);
|
||||
static void SlideMultiPartyMenuBoxSpritesOneStep(u8);
|
||||
@ -972,7 +972,7 @@ static bool8 RenderPartyMenuBoxes(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u8* GetPartyMenuBgTile(u16 tileId)
|
||||
static u8 *GetPartyMenuBgTile(u16 tileId)
|
||||
{
|
||||
return &sPartyBgGfxTilemap[tileId << 5];
|
||||
}
|
||||
@ -1203,7 +1203,7 @@ void Task_HandleChooseMonInput(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static s8* GetCurrentPartySlotPtr(void)
|
||||
static s8 *GetCurrentPartySlotPtr(void)
|
||||
{
|
||||
if (gPartyMenu.action == PARTY_ACTION_SWITCH || gPartyMenu.action == PARTY_ACTION_SOFTBOILED)
|
||||
return &gPartyMenu.slotId2;
|
||||
@ -1222,14 +1222,14 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
||||
switch (gPartyMenu.action)
|
||||
{
|
||||
case PARTY_ACTION_SOFTBOILED:
|
||||
if (IsSelectedMonNotEgg((u8*)slotPtr))
|
||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||
{
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
Task_TryUseSoftboiledOnPartyMon(taskId);
|
||||
}
|
||||
break;
|
||||
case PARTY_ACTION_USE_ITEM:
|
||||
if (IsSelectedMonNotEgg((u8*)slotPtr))
|
||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||
{
|
||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE)
|
||||
sPartyMenuInternal->exitCallback = CB2_SetUpExitToBattleScreen;
|
||||
@ -1239,7 +1239,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
||||
}
|
||||
break;
|
||||
case PARTY_ACTION_MOVE_TUTOR:
|
||||
if (IsSelectedMonNotEgg((u8*)slotPtr))
|
||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
@ -1247,7 +1247,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
||||
}
|
||||
break;
|
||||
case PARTY_ACTION_GIVE_MAILBOX_MAIL:
|
||||
if (IsSelectedMonNotEgg((u8*)slotPtr))
|
||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
@ -1256,7 +1256,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
||||
break;
|
||||
case PARTY_ACTION_GIVE_ITEM:
|
||||
case PARTY_ACTION_GIVE_PC_ITEM:
|
||||
if (IsSelectedMonNotEgg((u8*)slotPtr))
|
||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
@ -1272,7 +1272,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
||||
Task_ClosePartyMenu(taskId);
|
||||
break;
|
||||
case PARTY_ACTION_MINIGAME:
|
||||
if (IsSelectedMonNotEgg((u8*)slotPtr))
|
||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||
{
|
||||
TryEnterMonForMinigame(taskId, (u8)*slotPtr);
|
||||
}
|
||||
@ -1329,7 +1329,7 @@ static void HandleChooseMonCancel(u8 taskId, s8 *slotPtr)
|
||||
|
||||
static bool8 DisplayCancelChooseMonYesNo(u8 taskId)
|
||||
{
|
||||
const u8* stringPtr = NULL;
|
||||
const u8 *stringPtr = NULL;
|
||||
|
||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_CONTEST)
|
||||
stringPtr = gText_CancelParticipation;
|
||||
@ -1617,7 +1617,7 @@ static s8 GetNewSlotDoubleLayout(s8 slotId, s8 movementDir)
|
||||
}
|
||||
}
|
||||
|
||||
u8* GetMonNickname(struct Pokemon *mon, u8 *dest)
|
||||
u8 *GetMonNickname(struct Pokemon *mon, u8 *dest)
|
||||
{
|
||||
GetMonData(mon, MON_DATA_NICKNAME, dest);
|
||||
return StringGet_Nickname(dest);
|
||||
@ -1625,7 +1625,7 @@ u8* GetMonNickname(struct Pokemon *mon, u8 *dest)
|
||||
|
||||
#define tKeepOpen data[0]
|
||||
|
||||
u8 DisplayPartyMenuMessage(const u8* str, bool8 keepOpen)
|
||||
u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
@ -2064,7 +2064,7 @@ static void CreateCancelConfirmWindows(bool8 chooseHalf)
|
||||
}
|
||||
}
|
||||
|
||||
static u16* GetPartyMenuPalBufferPtr(u8 paletteId)
|
||||
static u16 *GetPartyMenuPalBufferPtr(u8 paletteId)
|
||||
{
|
||||
return &sPartyMenuInternal->palBuffer[paletteId];
|
||||
}
|
||||
@ -5655,7 +5655,7 @@ static u8 GetBattleEntryLevelCap(void)
|
||||
}
|
||||
}
|
||||
|
||||
static const u8* GetFacilityCancelString(void)
|
||||
static const u8 *GetFacilityCancelString(void)
|
||||
{
|
||||
u8 facilityNum = VarGet(VAR_FRONTIER_FACILITY);
|
||||
|
||||
|
@ -161,7 +161,7 @@ static void ItemStorage_HandleRemoveItem(u8);
|
||||
static void ItemStorage_HandleErrorMessageInput(u8);
|
||||
static void ItemStorage_ReturnToListInput(u8);
|
||||
|
||||
static const u8* ItemStorage_GetMessage(u16);
|
||||
static const u8 *ItemStorage_GetMessage(u16);
|
||||
static void CopyItemName_PlayerPC(u8 *, u16);
|
||||
|
||||
static void ItemStorage_Init(void);
|
||||
@ -1039,7 +1039,7 @@ static void ItemStorage_PrintMenuItem(u8 windowId, u32 id, u8 yOffset)
|
||||
|
||||
static void ItemStorage_PrintDescription(s32 id)
|
||||
{
|
||||
const u8* description;
|
||||
const u8 *description;
|
||||
u8 windowId = sItemStorageMenu->windowIds[ITEMPC_WIN_MESSAGE];
|
||||
|
||||
// Get item description (or Cancel text)
|
||||
@ -1088,7 +1088,7 @@ static void ItemStorage_DrawSwapArrow(u8 y, u8 b, u8 speed)
|
||||
static void ItemStorage_DrawItemIcon(u16 itemId)
|
||||
{
|
||||
u8 spriteId;
|
||||
u8* spriteIdLoc = &sItemStorageMenu->spriteId;
|
||||
u8 *spriteIdLoc = &sItemStorageMenu->spriteId;
|
||||
|
||||
if (*spriteIdLoc == SPRITE_NONE)
|
||||
{
|
||||
@ -1107,7 +1107,7 @@ static void ItemStorage_DrawItemIcon(u16 itemId)
|
||||
|
||||
static void ItemStorage_EraseItemIcon(void)
|
||||
{
|
||||
u8* spriteIdLoc = &sItemStorageMenu->spriteId;
|
||||
u8 *spriteIdLoc = &sItemStorageMenu->spriteId;
|
||||
if (*spriteIdLoc != SPRITE_NONE)
|
||||
{
|
||||
FreeSpriteTilesByTag(TAG_ITEM_ICON);
|
||||
@ -1133,7 +1133,7 @@ static void ItemStorage_CreateListMenu(u8 taskId)
|
||||
s16 *data;
|
||||
bool32 toss;
|
||||
u32 i, x;
|
||||
const u8* text;
|
||||
const u8 *text;
|
||||
|
||||
data = gTasks[taskId].data;
|
||||
for (i = 0; i <= ITEMPC_WIN_LIST_END; i++)
|
||||
@ -1154,7 +1154,7 @@ static void ItemStorage_CreateListMenu(u8 taskId)
|
||||
gTasks[taskId].func = ItemStorage_ProcessInput;
|
||||
}
|
||||
|
||||
static const u8* ItemStorage_GetMessage(u16 itemId)
|
||||
static const u8 *ItemStorage_GetMessage(u16 itemId)
|
||||
{
|
||||
const u8 *string;
|
||||
|
||||
|
@ -466,7 +466,7 @@ static const struct WindowTemplate sWindowTemplates[] =
|
||||
};
|
||||
|
||||
// - 1 excludes PBLOCK_CLR_NONE
|
||||
static const u32* const sPokeblocksPals[] =
|
||||
static const u32 *const sPokeblocksPals[] =
|
||||
{
|
||||
[PBLOCK_CLR_RED - 1] = gPokeblockRed_Pal,
|
||||
[PBLOCK_CLR_BLUE - 1] = gPokeblockBlue_Pal,
|
||||
|
@ -294,10 +294,10 @@ static void PrintSearchParameterText(u8);
|
||||
static u8 GetSearchModeSelection(u8 taskId, u8 option);
|
||||
static void SetDefaultSearchModeAndOrder(u8);
|
||||
static void CreateSearchParameterScrollArrows(u8);
|
||||
static void EraseAndPrintSearchTextBox(const u8*);
|
||||
static void EraseAndPrintSearchTextBox(const u8 *);
|
||||
static void EraseSelectorArrow(u32);
|
||||
static void PrintSelectorArrow(u32);
|
||||
static void PrintSearchParameterTitle(u32, const u8*);
|
||||
static void PrintSearchParameterTitle(u32, const u8 *);
|
||||
static void ClearSearchParameterBoxText(void);
|
||||
|
||||
// const rom data
|
||||
@ -2317,7 +2317,7 @@ static void CreatePokedexList(u8 dexMode, u8 order)
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintMonDexNumAndName(u8 windowId, u8 fontId, const u8* str, u8 left, u8 top)
|
||||
static void PrintMonDexNumAndName(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top)
|
||||
{
|
||||
u8 color[3];
|
||||
|
||||
@ -2440,7 +2440,7 @@ static void CreateCaughtBall(bool16 owned, u8 x, u8 y, u16 unused)
|
||||
|
||||
static u8 CreateMonName(u16 num, u8 left, u8 top)
|
||||
{
|
||||
const u8* str;
|
||||
const u8 *str;
|
||||
|
||||
num = NationalPokedexNumToSpecies(num);
|
||||
if (num)
|
||||
@ -3160,7 +3160,7 @@ static void SpriteCB_DexListStartMenuCursor(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintInfoScreenText(const u8* str, u8 left, u8 top)
|
||||
static void PrintInfoScreenText(const u8 *str, u8 left, u8 top)
|
||||
{
|
||||
u8 color[3];
|
||||
color[0] = TEXT_COLOR_TRANSPARENT;
|
||||
@ -3872,7 +3872,7 @@ static void HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
u16* ptr = GetBgTilemapBuffer(1);
|
||||
u16 *ptr = GetBgTilemapBuffer(1);
|
||||
|
||||
for (i = 0; i < SCREEN_COUNT; i++)
|
||||
{
|
||||
@ -3899,7 +3899,7 @@ static void HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
u16* ptr = GetBgTilemapBuffer(1);
|
||||
u16 *ptr = GetBgTilemapBuffer(1);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
@ -4511,7 +4511,7 @@ static u8 PrintCryScreenSpeciesName(u8 windowId, u16 num, u8 left, u8 top)
|
||||
return i;
|
||||
}
|
||||
|
||||
static void UnusedPrintMonName(u8 windowId, const u8* name, u8 left, u8 top)
|
||||
static void UnusedPrintMonName(u8 windowId, const u8 *name, u8 left, u8 top)
|
||||
{
|
||||
u8 str[POKEMON_NAME_LENGTH + 1];
|
||||
u8 i;
|
||||
@ -5419,7 +5419,7 @@ static void DrawOrEraseSearchParameterBox(bool8 erase)
|
||||
{
|
||||
u16 i;
|
||||
u16 j;
|
||||
u16* ptr = GetBgTilemapBuffer(3);
|
||||
u16 *ptr = GetBgTilemapBuffer(3);
|
||||
|
||||
if (!erase)
|
||||
{
|
||||
@ -5612,7 +5612,7 @@ static void CreateSearchParameterScrollArrows(u8 taskId)
|
||||
#undef sTaskId
|
||||
#undef sIsDownArrow
|
||||
|
||||
static void EraseAndPrintSearchTextBox(const u8* str)
|
||||
static void EraseAndPrintSearchTextBox(const u8 *str)
|
||||
{
|
||||
ClearSearchMenuRect(8, 120, 224, 32);
|
||||
PrintSearchText(str, 8, 121);
|
||||
@ -5628,7 +5628,7 @@ static void PrintSelectorArrow(u32 y)
|
||||
PrintSearchText(gText_SelectorArrow, 144, y * 16 + 9);
|
||||
}
|
||||
|
||||
static void PrintSearchParameterTitle(u32 y, const u8* str)
|
||||
static void PrintSearchParameterTitle(u32 y, const u8 *str)
|
||||
{
|
||||
PrintSearchText(str, 152, y * 16 + 9);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ bool8 LoadCryWaveformWindow(struct CryScreenWindow *window, u8 windowId)
|
||||
if (!sDexCryScreen)
|
||||
{
|
||||
sDexCryScreen = AllocZeroed(sizeof(*sDexCryScreen));
|
||||
sCryWaveformWindowTiledata = (u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
sCryWaveformWindowTiledata = (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
}
|
||||
|
||||
sDexCryScreen->unk = window->unk0;
|
||||
|
@ -3620,7 +3620,7 @@ static union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 perso
|
||||
return substruct;
|
||||
}
|
||||
|
||||
u32 GetMonData(struct Pokemon *mon, s32 field, u8* data)
|
||||
u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data)
|
||||
{
|
||||
u32 ret;
|
||||
|
||||
@ -4613,7 +4613,7 @@ void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex)
|
||||
|
||||
void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
|
||||
{
|
||||
u16* hpSwitchout;
|
||||
u16 *hpSwitchout;
|
||||
s32 i;
|
||||
u8 nickname[POKEMON_NAME_LENGTH * 2];
|
||||
|
||||
|
@ -1186,12 +1186,12 @@ void SpriteCB_MonIcon(struct Sprite *sprite)
|
||||
UpdateMonIconFrame(sprite);
|
||||
}
|
||||
|
||||
const u8* GetMonIconTiles(u16 species, bool32 handleDeoxys)
|
||||
const u8 *GetMonIconTiles(u16 species, bool32 handleDeoxys)
|
||||
{
|
||||
const u8* iconSprite = gMonIconTable[species];
|
||||
const u8 *iconSprite = gMonIconTable[species];
|
||||
if (species == SPECIES_DEOXYS && handleDeoxys == TRUE)
|
||||
{
|
||||
iconSprite = (const u8*)(0x400 + (u32)iconSprite); // use the specific Deoxys form icon (Speed in this case)
|
||||
iconSprite = (const u8 *)(0x400 + (u32)iconSprite); // use the specific Deoxys form icon (Speed in this case)
|
||||
}
|
||||
return iconSprite;
|
||||
}
|
||||
@ -1225,7 +1225,7 @@ u8 GetMonIconPaletteIndexFromSpecies(u16 species)
|
||||
return gMonIconPaletteIndices[species];
|
||||
}
|
||||
|
||||
const u16* GetValidMonIconPalettePtr(u16 species)
|
||||
const u16 *GetValidMonIconPalettePtr(u16 species)
|
||||
{
|
||||
if (species > NUM_SPECIES)
|
||||
species = INVALID_ICON_SPECIES;
|
||||
|
@ -1337,7 +1337,7 @@ void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero
|
||||
winTemplate.height = 2;
|
||||
windowId = AddWindow(&winTemplate);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(zero2));
|
||||
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData1 = (u8 *) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData2 = (winTemplate.width * TILE_SIZE_4BPP) + tileData1;
|
||||
|
||||
if (!zero1)
|
||||
@ -1385,7 +1385,7 @@ static void UnusedDrawTextWindow(const u8 *string, void *dst, u16 offset, u8 bgC
|
||||
tilesSize = winTemplate.width * TILE_SIZE_4BPP;
|
||||
windowId = AddWindow(&winTemplate);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(bgColor));
|
||||
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData1 = (u8 *) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData2 = (winTemplate.width * TILE_SIZE_4BPP) + tileData1;
|
||||
txtColor[0] = bgColor;
|
||||
txtColor[1] = fgColor;
|
||||
@ -6555,7 +6555,7 @@ static void InitCanReleaseMonVars(void)
|
||||
}
|
||||
|
||||
GetRestrictedReleaseMoves(sStorage->restrictedMoveList);
|
||||
sStorage->restrictedReleaseMonMoves = GetMonData(&sStorage->tempMon, MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList);
|
||||
sStorage->restrictedReleaseMonMoves = GetMonData(&sStorage->tempMon, MON_DATA_KNOWN_MOVES, (u8 *)sStorage->restrictedMoveList);
|
||||
if (sStorage->restrictedReleaseMonMoves != 0)
|
||||
{
|
||||
// Pokémon knows at least one restricted release move
|
||||
@ -6621,7 +6621,7 @@ static s8 RunCanReleaseMon(void)
|
||||
// Make sure party Pokémon isn't the one we're releasing first
|
||||
if (sStorage->releaseBoxId != TOTAL_BOXES_COUNT || sStorage->releaseBoxPos != i)
|
||||
{
|
||||
knownMoves = GetMonData(&gPlayerParty[i], MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList);
|
||||
knownMoves = GetMonData(&gPlayerParty[i], MON_DATA_KNOWN_MOVES, (u8 *)sStorage->restrictedMoveList);
|
||||
sStorage->restrictedReleaseMonMoves &= ~(knownMoves);
|
||||
}
|
||||
}
|
||||
@ -6646,7 +6646,7 @@ static s8 RunCanReleaseMon(void)
|
||||
// moves the release Pokémon knows
|
||||
for (i = 0; i < IN_BOX_COUNT; i++)
|
||||
{
|
||||
knownMoves = GetAndCopyBoxMonDataAt(sStorage->releaseCheckBoxId, sStorage->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList);
|
||||
knownMoves = GetAndCopyBoxMonDataAt(sStorage->releaseCheckBoxId, sStorage->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8 *)sStorage->restrictedMoveList);
|
||||
if (knownMoves != 0 && !(sStorage->releaseBoxId == sStorage->releaseCheckBoxId
|
||||
&& sStorage->releaseBoxPos == sStorage->releaseCheckBoxPos))
|
||||
{
|
||||
@ -9648,7 +9648,7 @@ bool32 AnyStorageMonWithMove(u16 moveId)
|
||||
{
|
||||
if (GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_HAS_SPECIES)
|
||||
&& !GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_IS_EGG)
|
||||
&& GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_KNOWN_MOVES, (u8*)moves))
|
||||
&& GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_KNOWN_MOVES, (u8 *)moves))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -2027,7 +2027,7 @@ static void SwitchToMovePositionSwitchMode(u8 taskId)
|
||||
|
||||
static void Task_HandleInput_MovePositionSwitch(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE)
|
||||
{
|
||||
@ -2168,7 +2168,7 @@ static void Task_SetHandleReplaceMoveInput(u8 taskId)
|
||||
|
||||
static void Task_HandleReplaceMoveInput(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE)
|
||||
{
|
||||
@ -2244,7 +2244,7 @@ static void ShowCantForgetHMsWindow(u8 taskId)
|
||||
// This redraws the power/accuracy window when the player scrolls out of the "HM Moves can't be forgotten" message
|
||||
static void Task_HandleInputCantForgetHMsMoves(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 move;
|
||||
if (FuncIsActiveTask(Task_ShowPowerAccWindow) != 1)
|
||||
{
|
||||
|
@ -665,7 +665,7 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state)
|
||||
|
||||
static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 offset, s32 entries)
|
||||
{
|
||||
u8 *tileData = (u8*)GetWindowAttribute(listWindow->windowId, WINDOW_TILE_DATA);
|
||||
u8 *tileData = (u8 *)GetWindowAttribute(listWindow->windowId, WINDOW_TILE_DATA);
|
||||
u32 width = listWindow->width * 64;
|
||||
|
||||
offset = (listWindow->unkA + offset) & 0xF;
|
||||
@ -694,7 +694,7 @@ static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 offset,
|
||||
static void SetListMarginTile(struct PokenavListMenuWindow *listWindow, bool32 draw)
|
||||
{
|
||||
u16 var;
|
||||
u16 *tilemapBuffer = (u16*)GetBgTilemapBuffer(GetWindowAttribute(listWindow->windowId, WINDOW_BG));
|
||||
u16 *tilemapBuffer = (u16 *)GetBgTilemapBuffer(GetWindowAttribute(listWindow->windowId, WINDOW_BG));
|
||||
tilemapBuffer += (listWindow->unkA << 6) + listWindow->x - 1;
|
||||
|
||||
if (draw)
|
||||
|
14
src/save.c
14
src/save.c
@ -924,17 +924,17 @@ u16 GetSaveBlocksPointersBaseOffset(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 TryReadSpecialSaveSector(u8 sector, u8* dst)
|
||||
u32 TryReadSpecialSaveSector(u8 sector, u8 *dst)
|
||||
{
|
||||
s32 i;
|
||||
s32 size;
|
||||
u8* savData;
|
||||
u8 *savData;
|
||||
|
||||
if (sector != SECTOR_ID_TRAINER_HILL && sector != SECTOR_ID_RECORDED_BATTLE)
|
||||
return SAVE_STATUS_ERROR;
|
||||
|
||||
ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, SECTOR_SIZE);
|
||||
if (*(u32*)(&gSaveDataBuffer.data[0]) != SPECIAL_SECTOR_SENTINEL)
|
||||
if (*(u32 *)(&gSaveDataBuffer.data[0]) != SPECIAL_SECTOR_SENTINEL)
|
||||
return SAVE_STATUS_ERROR;
|
||||
|
||||
// Copies whole save sector except u32 counter
|
||||
@ -946,18 +946,18 @@ u32 TryReadSpecialSaveSector(u8 sector, u8* dst)
|
||||
return SAVE_STATUS_OK;
|
||||
}
|
||||
|
||||
u32 TryWriteSpecialSaveSector(u8 sector, u8* src)
|
||||
u32 TryWriteSpecialSaveSector(u8 sector, u8 *src)
|
||||
{
|
||||
s32 i;
|
||||
s32 size;
|
||||
u8* savData;
|
||||
u8 *savData;
|
||||
void* savDataBuffer;
|
||||
|
||||
if (sector != SECTOR_ID_TRAINER_HILL && sector != SECTOR_ID_RECORDED_BATTLE)
|
||||
return SAVE_STATUS_ERROR;
|
||||
|
||||
savDataBuffer = &gSaveDataBuffer;
|
||||
*(u32*)(savDataBuffer) = SPECIAL_SECTOR_SENTINEL;
|
||||
*(u32 *)(savDataBuffer) = SPECIAL_SECTOR_SENTINEL;
|
||||
|
||||
// Copies whole save sector except u32 counter
|
||||
i = 0;
|
||||
@ -978,7 +978,7 @@ u32 TryWriteSpecialSaveSector(u8 sector, u8* src)
|
||||
// Most notably it does save the PC data.
|
||||
void Task_LinkFullSave(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
switch (tState)
|
||||
{
|
||||
|
@ -2229,7 +2229,7 @@ bool8 ScrCmd_checkmoneventlegal(struct ScriptContext *ctx)
|
||||
|
||||
bool8 ScrCmd_trywondercardscript(struct ScriptContext *ctx)
|
||||
{
|
||||
const u8* script = GetSavedRamScriptIfValid();
|
||||
const u8 *script = GetSavedRamScriptIfValid();
|
||||
|
||||
if (script)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ enum {
|
||||
SCRIPT_MODE_NATIVE,
|
||||
};
|
||||
|
||||
extern const u8* gRamScriptRetAddr;
|
||||
extern const u8 *gRamScriptRetAddr;
|
||||
|
||||
static u8 sScriptContext1Status;
|
||||
static struct ScriptContext sScriptContext1;
|
||||
@ -349,7 +349,7 @@ void TryRunOnWarpIntoMapScript(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)
|
||||
|
@ -63,7 +63,7 @@ static void BuyMenuBuildListMenuTemplate(void);
|
||||
static void BuyMenuInitBgs(void);
|
||||
static void BuyMenuInitWindows(void);
|
||||
static void BuyMenuDecompressBgGraphics(void);
|
||||
static void BuyMenuSetListEntry(struct ListMenuItem*, u16, u8*);
|
||||
static void BuyMenuSetListEntry(struct ListMenuItem*, u16, u8 *);
|
||||
static void BuyMenuAddItemIcon(u16, u8);
|
||||
static void BuyMenuRemoveItemIcon(u16, u8);
|
||||
static void BuyMenuPrint(u8 windowId, const u8 *text, u8 x, u8 y, s8 speed, u8 colorSet);
|
||||
@ -73,7 +73,7 @@ static void BuyMenuCollectObjectEventData(void);
|
||||
static void BuyMenuDrawObjectEvents(void);
|
||||
static void BuyMenuDrawMapBg(void);
|
||||
static bool8 BuyMenuCheckForOverlapWithMenuBg(int, int);
|
||||
static void BuyMenuDrawMapMetatile(s16, s16, const u16*, u8);
|
||||
static void BuyMenuDrawMapMetatile(s16, s16, const u16 *, u8);
|
||||
static void BuyMenuDrawMapMetatileLayer(u16 *dest, s16 offset1, s16 offset2, const u16 *src);
|
||||
static bool8 BuyMenuCheckIfObjectEventOverlapsMenuBg(s16 *);
|
||||
static void ExitBuyMenu(u8 taskId);
|
||||
@ -747,11 +747,11 @@ static void BuyMenuDrawMapBg(void)
|
||||
|
||||
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
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ static bool8 FieldCB_ReturnToFieldStartMenu(void);
|
||||
|
||||
static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8};
|
||||
|
||||
static const u8* const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] =
|
||||
static const u8 *const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] =
|
||||
{
|
||||
gText_Floor1,
|
||||
gText_Floor2,
|
||||
|
@ -97,8 +97,8 @@ static void CloseTrainerCard(u8 task);
|
||||
static bool8 PrintAllOnCardFront(void);
|
||||
static void DrawTrainerCardWindow(u8);
|
||||
static void CreateTrainerCardTrainerPic(void);
|
||||
static void DrawCardScreenBackground(u16*);
|
||||
static void DrawCardFrontOrBack(u16*);
|
||||
static void DrawCardScreenBackground(u16 *);
|
||||
static void DrawCardFrontOrBack(u16 *);
|
||||
static void DrawStarsAndBadgesOnCard(void);
|
||||
static void PrintTimeOnCard(void);
|
||||
static void FlipTrainerCard(void);
|
||||
@ -147,7 +147,7 @@ static void BufferUnionRoomStats(void);
|
||||
static void BufferLinkPokeblocksNum(void);
|
||||
static void BufferLinkContestNum(void);
|
||||
static void BufferBattleFacilityStats(void);
|
||||
static void PrintStatOnBackOfCard(u8 top, const u8* str1, u8* str2, const u8* color);
|
||||
static void PrintStatOnBackOfCard(u8 top, const u8 *str1, u8 *str2, const u8 *color);
|
||||
static void LoadStickerGfx(void);
|
||||
static u8 SetCardBgsAndPals(void);
|
||||
static void DrawCardBackStats(void);
|
||||
@ -772,7 +772,7 @@ void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *trainerCard)
|
||||
trainerCard->version = GAME_VERSION;
|
||||
SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD);
|
||||
trainerCard->linkHasAllFrontierSymbols = HasAllFrontierSymbols();
|
||||
*((u16*)&trainerCard->linkPoints.frontier) = gSaveBlock2Ptr->frontier.cardBattlePoints;
|
||||
*((u16 *)&trainerCard->linkPoints.frontier) = gSaveBlock2Ptr->frontier.cardBattlePoints;
|
||||
if (trainerCard->linkHasAllFrontierSymbols)
|
||||
trainerCard->stars++;
|
||||
|
||||
@ -799,7 +799,7 @@ void CopyTrainerCardData(struct TrainerCard *dst, struct TrainerCard *src, u8 ga
|
||||
memcpy(dst, src, 0x60);
|
||||
dst->linkPoints.frontier = 0;
|
||||
dst->hasAllFrontierSymbols = src->linkHasAllFrontierSymbols;
|
||||
dst->frontierBP = *((u16*)&src->linkPoints.frontier);
|
||||
dst->frontierBP = *((u16 *)&src->linkPoints.frontier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -996,7 +996,7 @@ static void BufferTextsVarsForCardPage2(void)
|
||||
static void PrintNameOnCardFront(void)
|
||||
{
|
||||
u8 buffer[32];
|
||||
u8* txtPtr;
|
||||
u8 *txtPtr;
|
||||
txtPtr = StringCopy(buffer, gText_TrainerCardName);
|
||||
StringCopy(txtPtr, sData->trainerCard.playerName);
|
||||
ConvertInternationalString(txtPtr, sData->language);
|
||||
@ -1009,7 +1009,7 @@ static void PrintNameOnCardFront(void)
|
||||
static void PrintIdOnCard(void)
|
||||
{
|
||||
u8 buffer[32];
|
||||
u8* txtPtr;
|
||||
u8 *txtPtr;
|
||||
s32 xPos;
|
||||
u32 top;
|
||||
txtPtr = StringCopy(buffer, gText_TrainerCardIDNo);
|
||||
@ -1186,7 +1186,7 @@ static void BufferHofDebutTime(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintStatOnBackOfCard(u8 top, const u8* statName, u8* stat, const u8* color)
|
||||
static void PrintStatOnBackOfCard(u8 top, const u8 *statName, u8 *stat, const u8 *color)
|
||||
{
|
||||
static const u8 xOffsets[] = {8, 16};
|
||||
static const u8 widths[] = {216, 216};
|
||||
@ -1471,7 +1471,7 @@ static void DrawCardScreenBackground(u16 *ptr)
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
}
|
||||
|
||||
static void DrawCardFrontOrBack(u16* ptr)
|
||||
static void DrawCardFrontOrBack(u16 *ptr)
|
||||
{
|
||||
s16 i, j;
|
||||
u16 *dst = sData->cardTilemapBuffer;
|
||||
|
@ -1750,7 +1750,7 @@ static void Task_StartActivity(u8 taskId)
|
||||
static void Task_RunScriptAndFadeToActivity(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *sendBuff = (u16*)(gBlockSendBuffer);
|
||||
u16 *sendBuff = (u16 *)(gBlockSendBuffer);
|
||||
|
||||
switch (data[0])
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ u16 CalcCRC16WithTable(const u8 *data, u32 length)
|
||||
return ~crc;
|
||||
}
|
||||
|
||||
u32 CalcByteArraySum(const u8* data, u32 length)
|
||||
u32 CalcByteArraySum(const u8 *data, u32 length)
|
||||
{
|
||||
u32 sum, i;
|
||||
for (sum = 0, i = 0; i < length; i++)
|
||||
|
@ -140,7 +140,7 @@ static u8 GetLetterTableId(u8 letter)
|
||||
#define KEY data[8]
|
||||
#define NUM_WALLPAPER_DATA_BYTES 9
|
||||
#define TO_BIT_OFFSET(i) (3 + (8 * (i))) // Convert a position in the phrase to a bit number into the wallpaper data array
|
||||
static bool32 TryCalculateWallpaper(u16* backgroundClr, u16 *foregroundClr, u8 *iconId, u8 *patternId, u16 trainerId, u8 *phrase)
|
||||
static bool32 TryCalculateWallpaper(u16 *backgroundClr, u16 *foregroundClr, u8 *iconId, u8 *patternId, u16 trainerId, u8 *phrase)
|
||||
{
|
||||
s32 i;
|
||||
ALIGNED(2) u8 data[NUM_WALLPAPER_DATA_BYTES];
|
||||
@ -186,10 +186,10 @@ static bool32 TryCalculateWallpaper(u16* backgroundClr, u16 *foregroundClr, u8 *
|
||||
return FALSE;
|
||||
|
||||
// Successful phrase, save resulting wallpaper
|
||||
ptr = (u16*) &BG_COLOR_LO;
|
||||
ptr = (u16 *) &BG_COLOR_LO;
|
||||
*backgroundClr = *ptr;
|
||||
|
||||
ptr = (u16*) &FG_COLOR_LO;
|
||||
ptr = (u16 *) &FG_COLOR_LO;
|
||||
*foregroundClr = *ptr;
|
||||
|
||||
*iconId = ICON_ID;
|
||||
|
Loading…
Reference in New Issue
Block a user