diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/battle.h | 1 | ||||
-rw-r--r-- | include/config.h | 12 | ||||
-rw-r--r-- | include/field_specials.h | 2 | ||||
-rw-r--r-- | include/fieldmap.h | 6 | ||||
-rw-r--r-- | include/gba/defines.h | 6 | ||||
-rw-r--r-- | include/gba/isagbprint.h | 5 | ||||
-rw-r--r-- | include/global.h | 4 | ||||
-rw-r--r-- | include/item_pc.h | 4 | ||||
-rw-r--r-- | include/menu_helpers.h | 2 | ||||
-rw-r--r-- | include/overworld.h | 4 | ||||
-rw-r--r-- | include/task.h | 2 | ||||
-rw-r--r-- | include/util.h | 4 | ||||
-rw-r--r-- | include/vs_seeker.h | 2 |
13 files changed, 38 insertions, 16 deletions
diff --git a/include/battle.h b/include/battle.h index aac94da7b..43f4c5115 100644 --- a/include/battle.h +++ b/include/battle.h @@ -1,6 +1,7 @@ #ifndef GUARD_BATTLE_H #define GUARD_BATTLE_H +#include <limits.h> #include "global.h" #include "constants/battle.h" #include "battle_util.h" diff --git a/include/config.h b/include/config.h index 4577f1b60..bdad6bb28 100644 --- a/include/config.h +++ b/include/config.h @@ -18,14 +18,14 @@ #define GAME_VERSION VERSION_FIRE_RED #else // Default version seems to be LeafGreen #define GAME_VERSION VERSION_LEAF_GREEN -#endif +#endif // GAME_VERSION // rev1 renamed the source folder for reasons #if REVISION == 0 #define CODE_ROOT "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/" #else #define CODE_ROOT "C:/WORK/POKeFRLG/Src/pm_lgfr_ose/source/" -#endif +#endif // REVISION #define ABSPATH(x) (CODE_ROOT x) @@ -33,6 +33,12 @@ #define UNITS_IMPERIAL #else #define UNITS_METRIC -#endif +#endif // ENGLISH + +// Crashes may occur due to section reordering in the modern build, +// so we force BUGFIX here. +#if MODERN +#define BUGFIX +#endif // MODERN #endif // GUARD_CONFIG_H diff --git a/include/field_specials.h b/include/field_specials.h index 5beeba928..0a4ea7bce 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -13,7 +13,7 @@ enum HiddenItemAttr u8 GetLeadMonIndex(void); s32 CountDigits(s32 number); -void TV_PrintIntToStringVar(u8, int); +void TV_PrintIntToStringVar(u8 varidx, s32 number); u16 GetStarterSpecies(void); void StopPokemonLeagueLightingEffectTask(void); void nullsub_60(void); diff --git a/include/fieldmap.h b/include/fieldmap.h index 40aa1c916..c12dea340 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -14,11 +14,11 @@ extern struct BackupMapLayout VMap; extern const struct MapLayout Route1_Layout; -u32 MapGridGetMetatileIdAt(int, int); +u32 MapGridGetMetatileIdAt(s32, s32); u32 MapGridGetMetatileBehaviorAt(s16, s16); u8 MapGridGetMetatileLayerTypeAt(s16 x, s16 y); -void MapGridSetMetatileIdAt(int, int, u16); -void MapGridSetMetatileEntryAt(int, int, u16); +void MapGridSetMetatileIdAt(s32, s32, u16); +void MapGridSetMetatileEntryAt(s32, s32, u16); u8 MapGridGetZCoordAt(s32 x, s32 y); void GetCameraCoords(u16*, u16*); bool8 MapGridIsImpassableAt(s32, s32); diff --git a/include/gba/defines.h b/include/gba/defines.h index 9e822358a..28f804dff 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -14,6 +14,12 @@ #define EWRAM_DATA __attribute__((section("ewram_data"))) #endif +#if MODERN +#define NOINLINE __attribute__((noinline)) +#else +#define NOINLINE +#endif + #define ALIGNED(n) __attribute__((aligned(n))) #define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h index c5eb456c3..8a64b8223 100644 --- a/include/gba/isagbprint.h +++ b/include/gba/isagbprint.h @@ -35,6 +35,10 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP // for matching purposes +#if MODERN +#define AGB_ASSERT_EX(exp, file, line) AGB_ASSERT(exp) +#define AGB_WARNING_EX(exp, file, line) AGB_WARNING(exp) +#else #ifdef NDEBUG #define AGB_ASSERT_EX(exp, file, line) #else @@ -46,5 +50,6 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP #else #define AGB_WARNING_EX(exp, file, line) (exp) ? ((void*)0) : AGBAssert(file, line, #exp, 0); #endif +#endif #endif // GUARD_GBA_ISAGBPRINT_H diff --git a/include/global.h b/include/global.h index 67084f2ef..18645efd8 100644 --- a/include/global.h +++ b/include/global.h @@ -50,6 +50,10 @@ #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) +#if MODERN +#define abs(x) (((x) < 0) ? -(x) : (x)) +#endif + // There are many quirks in the source code which have overarching behavioral differences from // a number of other files. For example, diploma.c seems to declare rodata before each use while // other files declare out of order and must be at the beginning. There are also a number of diff --git a/include/item_pc.h b/include/item_pc.h index 2fecf69a8..9c0f6d21d 100644 --- a/include/item_pc.h +++ b/include/item_pc.h @@ -1,7 +1,7 @@ #ifndef GUARD_ITEM_PC_H #define GUARD_ITEM_PC_H -void ItemPc_Init(u8 a0, MainCallback callback); -void ItemPc_SetInitializedFlag(u8); +void ItemPc_Init(u8 kind, MainCallback callback); +void ItemPc_SetInitializedFlag(bool8 flag); #endif //GUARD_ITEM_PC_H diff --git a/include/menu_helpers.h b/include/menu_helpers.h index fda77d1b6..0c0623cc0 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -21,7 +21,7 @@ bool8 MenuHelpers_LinkSomething(void); void SetVBlankHBlankCallbacksToNull(void); void ResetAllBgsCoordinatesAndBgCntRegs(void); u8 GetDialogBoxFontId(void); -bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1); +bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity_p, u16 qmax); void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 tileNum, u8 paletteNum, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc); void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 fontId, u8 left, u8 top, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo); u8 GetLRKeysState(void); diff --git a/include/overworld.h b/include/overworld.h index 42451636f..0f07f7c7d 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -71,8 +71,8 @@ void Overworld_SetObjEventTemplateMovementType(u8, u8); void SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); -void SetDynamicWarp(int unused, s8 mapGroup, s8 mapNum, s8 warpId); -void SetDynamicWarpWithCoords(int unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); +void SetDynamicWarp(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId); +void SetDynamicWarpWithCoords(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetEscapeWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); diff --git a/include/task.h b/include/task.h index 0d605b04d..fd7f5a4e1 100644 --- a/include/task.h +++ b/include/task.h @@ -33,7 +33,7 @@ void SwitchTaskToFollowupFunc(u8 taskId); bool8 FuncIsActiveTask(TaskFunc func); u8 FindTaskIdByFunc(TaskFunc func); u8 GetTaskCount(void); -void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value); +void SetWordTaskArg(u8 taskId, u8 dataElem, unsigned long value); u32 GetWordTaskArg(u8 taskId, u8 dataElem); #endif // GUARD_TASK_H diff --git a/include/util.h b/include/util.h index ef1c15faa..8dc5e9bb6 100644 --- a/include/util.h +++ b/include/util.h @@ -9,8 +9,8 @@ extern const u8 gMiscBlank_Gfx[]; // unused in Emerald extern const u32 gBitTable[]; u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *)); -void StoreWordInTwoHalfwords(u16 *, u32); -void LoadWordFromTwoHalfwords(u16 *, u32 *); +void StoreWordInTwoHalfwords(u16 *, unsigned); +void LoadWordFromTwoHalfwords(u16 *, unsigned *); int CountTrailingZeroBits(u32 value); u16 CalcCRC16(const u8 *data, u32 length); u16 CalcCRC16WithTable(const u8 *data, u32 length); diff --git a/include/vs_seeker.h b/include/vs_seeker.h index 43796b215..a4b78cba0 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -6,7 +6,7 @@ void Task_VsSeeker_0(u8 taskId); void ClearRematchStateByTrainerId(void); void ClearRematchStateOfLastTalked(void); -int GetRematchTrainerId(u16 a0); +int GetRematchTrainerId(u16 trainerId); bool8 UpdateVsSeekerStepCounter(void); void MapResetTrainerRematches(u16 mapGroup, u16 mapNum); |