Files
ph/include/global.h
T
Aetias 573b696ff8 Bump dsd to v0.10.1; UnkStruct_027e05f8_2 OK (#121)
* Unique delink file names

* Fix build

* Revert back to single link

* UnkStruct_027e05f8_2 OK

* `dsd fix ctor-symbols`

* Fix symbols spanning over two delink files

* `dsd fix ctor-symbols` again

* Add missing function `func_02050a20`

* Name `.p__sinit` symbols in USA after their EUR counterparts

* Apply dsd signatures

* Bump dsd to 0.10.0; Fix dsd not updating automatically

* Rename overlay functions

* Fix auto-download wibo

* Fix generating objdiff report
2025-07-17 12:21:10 +02:00

34 lines
1.2 KiB
C

#ifndef PH_GLOBAL_H
#define PH_GLOBAL_H
#define GET_FLAG(arr, pos) (((1 << ((pos) & 0x1f)) & (arr)[((u32) (pos)) >> 5]) != 0)
#define SET_FLAG(arr, pos) ((arr)[((u32) (pos)) >> 5] |= 1 << ((pos) & 0x1f))
#define RESET_FLAG(arr, pos) ((arr)[((u32) (pos)) >> 5] &= ~(1 << ((pos) & 0x1f)))
#define ARRAY_LEN_U(arr) (u32)((sizeof(arr) / sizeof(*arr)))
#define ARRAY_LEN(arr) (s32)(sizeof(arr) / sizeof(*arr))
// Prevent the IDE from reporting errors that the compiler/linker won't report
#ifdef __INTELLISENSE__
#endif
#define ARM _Pragma("thumb off")
#define THUMB _Pragma("thumb on")
// `override` was added in C++11 before the DS, so we only use the keyword to indicate overriden functions
#define override
// Puts variables in the DTCM module by using #pragma section dtcm begin|end
#pragma define_section dtcm ".dtcm" \
".dtcm"
// Define .sbss variables by using #pragma section sbss begin|end
#pragma define_section sbss ".data" \
".sbss"
// Force variables to be in .data by using #pragma section force_data begin|end
#pragma define_section force_data ".data" \
".data"
#endif