OpenSNES Standard Types. More...
Go to the source code of this file.
Macros | |
| #define | ARRAY_SIZE(arr) |
| Get number of elements in array. | |
| #define | BIT(n) |
| Create a bit mask. | |
| #define | CLAMP(x, lo, hi) |
| Clamp value to range. | |
| #define | FALSE 0 |
| #define | false 0 |
| #define | FAR /* host compilers (the clang syntax lint) have no address spaces */ |
| Place a global in bank $7E WRAM, outside the 8 KB bank-0 band. | |
| #define | HI_BYTE(x) |
| Get high byte of 16-bit value. | |
| #define | LO_BYTE(x) |
| Get low byte of 16-bit value. | |
| #define | MAKE_WORD(lo, hi) |
| Combine two bytes into 16-bit value. | |
| #define | MAX(a, b) |
| Get maximum of two values. | |
| #define | MIN(a, b) |
| Get minimum of two values. | |
| #define | NULL ((void*)0) |
| Null pointer constant. | |
| #define | OPENSNES_DEPRECATED(msg) |
| Mark a public function as deprecated, with its replacement. | |
| #define | RAM_CODE /* host compilers (the clang syntax lint) */ |
| Run a function from WRAM instead of ROM. | |
| #define | TRUE 1 |
| #define | true 1 |
Typedefs | |
| typedef unsigned char | bool |
| typedef signed short | s16 |
| 16-bit signed integer (-32768 to 32767) | |
| typedef signed int | s32 |
| 32-bit signed integer (-2147483648 to 2147483647) | |
| typedef signed char | s8 |
| 8-bit signed integer (-128 to 127) | |
| typedef unsigned short | u16 |
| 16-bit unsigned integer (0 to 65535) | |
| typedef unsigned int | u32 |
| 32-bit unsigned integer (0 to 4294967295) | |
| typedef unsigned char | u8 |
| 8-bit unsigned integer (0 to 255) | |
| typedef void(* | VoidFn) (void) |
| Void function taking no arguments (the generic name; a header that wants to say what the function is for declares its own, like VBlankCallback in interrupt.h — the same type). | |
| typedef volatile s16 | vs16 |
| typedef volatile s32 | vs32 |
| typedef volatile s8 | vs8 |
| typedef volatile u16 | vu16 |
| typedef volatile u32 | vu32 |
| typedef volatile u8 | vu8 |
OpenSNES Standard Types.
Provides fixed-width integer types and common macros for SNES development.
Originally from: PVSnesLib (https://github.com/alekmaul/pvsneslib) Author: Alekmaul License: zlib (compatible with MIT) Modifications:
| #define OPENSNES_DEPRECATED | ( | msg | ) |
Mark a public function as deprecated, with its replacement.
cproc accepts and ignores the attribute; the clang pre-pass that every C file goes through (make/common.mk) reports each use as a WARNING — the build system passes -Wno-error=deprecated-declarations, so deprecated code keeps building. Deprecated functions are removed at the next major version.
A deprecated CONSTANT is a macro, which no attribute can mark: its header names it in a #pragma clang deprecated(NAME, "use ...") under #ifdef __clang__. The same pre-pass reports each use (-Wno-error=deprecated-pragma), and cproc never sees the pragma.