summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gba/defines.h11
-rw-r--r--include/gba/macro.h25
-rw-r--r--include/global.h4
-rw-r--r--include/graphics.h3
-rw-r--r--include/player_pc.h2
-rw-r--r--include/strings.h1
6 files changed, 42 insertions, 4 deletions
diff --git a/include/gba/defines.h b/include/gba/defines.h
index b68a2ad1e..b95946b15 100644
--- a/include/gba/defines.h
+++ b/include/gba/defines.h
@@ -6,9 +6,20 @@
#define TRUE 1
#define FALSE 0
+#define BSS_DATA __attribute__((section(".bss")))
+#if MODERN
+#define IWRAM_DATA
+#else
#define IWRAM_DATA __attribute__((section("iwram_data")))
+#endif
#define EWRAM_DATA __attribute__((section("ewram_data")))
+#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/macro.h b/include/gba/macro.h
index 3b35a1946..197febede 100644
--- a/include/gba/macro.h
+++ b/include/gba/macro.h
@@ -192,4 +192,29 @@
REG_IME = imeTemp; \
} \
+#if MODERN
+#define FLOAT_UNS(x, bit) ({ \
+ s##bit sx = x; \
+ float fx = (float)sx; \
+ if (sx < 0) fx += (1 << (bit - 1)) * 2.0f; \
+ fx; \
+})
+#define DOUBLE_UNS(x, bit) ({ \
+ s##bit sx = x; \
+ double dx = (double)sx; \
+ if (sx < 0) dx += (1 << (bit - 1)) * 2.0; \
+ dx; \
+})
+#else
+#define FLOAT_UNS(x, bit) ((float)(x))
+#define DOUBLE_UNS(x, bit) ((double)(x))
+#endif //MODERN
+
+#define FLOAT_U8(x) FLOAT_UNS(x, 8)
+#define FLOAT_U16(x) FLOAT_UNS(x, 16)
+#define FLOAT_U32(x) FLOAT_UNS(x, 32)
+#define DOUBLE_U8(x) DOUBLE_UNS(x, 8)
+#define DOUBLE_U16(x) DOUBLE_UNS(x, 16)
+#define DOUBLE_U32(x) DOUBLE_UNS(x, 32)
+
#endif // GUARD_GBA_MACRO_H
diff --git a/include/global.h b/include/global.h
index 969680dd7..712a40866 100644
--- a/include/global.h
+++ b/include/global.h
@@ -62,6 +62,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
+
// Extracts the upper 16 bits of a 32-bit number
#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
diff --git a/include/graphics.h b/include/graphics.h
index 43b014a9f..50bb5774e 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -4005,9 +4005,6 @@ extern const u32 gBerryPalette_Starf[];
extern const u32 gBerryPic_Enigma[];
extern const u32 gBerryPalette_Enigma[];
-//credits
-extern const u32 gCreditsCopyrightEnd_Gfx[];
-
//pokenav
extern const u8 gPokenavConditionMarker_Gfx[];
extern const u16 gPokenavConditionMarker_Pal[];
diff --git a/include/player_pc.h b/include/player_pc.h
index 53bb25c6b..219c11440 100644
--- a/include/player_pc.h
+++ b/include/player_pc.h
@@ -1,6 +1,8 @@
#ifndef GUARD_PLAYER_PC_H
#define GUARD_PLAYER_PC_H
+#include "menu.h"
+
// local task defines
#define PAGE_INDEX data[0]
#define ITEMS_ABOVE_TOP data[1]
diff --git a/include/strings.h b/include/strings.h
index f30e82321..36a92281e 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -485,7 +485,6 @@ extern const u8 gText_CryOf[];
extern const u8 gText_SizeComparedTo[];
extern const u8 gText_PokedexRegistration[];
extern const u8 gText_UnkCtrlF908Clear01[];
-extern const u8 sText_TenDashes2[];
extern const u8 gText_5MarksPokemon[];
extern const u8 gText_UnkHeight[];
extern const u8 gText_UnkWeight[];