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/global.h | 4 | ||||
-rw-r--r-- | include/overworld.h | 4 | ||||
-rw-r--r-- | include/vs_seeker.h | 2 |
8 files changed, 27 insertions, 10 deletions
diff --git a/include/battle.h b/include/battle.h index c9534745d..5144ed38d 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/global.h b/include/global.h index aa60be994..4a636957b 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/overworld.h b/include/overworld.h index f5cb1987e..c2fb8db2c 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/vs_seeker.h b/include/vs_seeker.h index 6668cc6b4..d0f589866 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -6,7 +6,7 @@ void Task_VsSeeker_0(u8 taskId); void sub_810CB90(void); void sub_810CDE8(void); -int GetRematchTrainerId(u16 a0); +s32 GetRematchTrainerId(u16 a0); bool8 sub_810CF04(u8 a0); void sub_810D0D0(void); void sub_810CB90(void); |