sgdk
Loading...
Searching...
No Matches
types.h File Reference

Types definition. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Box
 Simple Box structure. More...
 
struct  Circle
 Simple Circle structure. More...
 

Macros

#define FALSE   0
 FALSE define (equivalent to 0).
 
#define TRUE   1
 TRUE define (equivalent to 1).
 
#define NULL   0
 NULL define (equivalent to 0).
 
#define MIN_U8   0x00
 
#define MAX_U8   0xFF
 
#define MIN_S8   -0x80
 
#define MAX_S8   0x7F
 
#define MIN_U16   0x0000
 
#define MAX_U16   0xFFFF
 
#define MIN_S16   -0x8000
 
#define MAX_S16   0x7FFF
 
#define MIN_U32   0x0000
 
#define MAX_U32   0xFFFFFFFF
 
#define MIN_S32   -0x80000000
 
#define MAX_S32   0x7FFFFFFF
 
#define uint8_t   u8
 
#define int8_t   s8
 
#define uint16_t   u16
 
#define int16_t   s16
 
#define uint32_t   u32
 
#define int32_t   s32
 
#define FASTCALL
 

Typedefs

typedef char s8
 
typedef short s16
 
typedef long s32
 
typedef unsigned char u8
 
typedef unsigned short u16
 
typedef unsigned long u32
 
typedef u8 bool
 
typedef volatile s8 vs8
 
typedef volatile s16 vs16
 
typedef volatile s32 vs32
 
typedef volatile u8 vu8
 
typedef volatile u16 vu16
 
typedef volatile u32 vu32
 
typedef vu8 vbool
 
typedef s16 p16
 
typedef s16 fix16
 
typedef s32 fix32
 
typedef s16 f16
 
typedef s32 f32
 
typedef s16 fastfix16
 
typedef s32 fastfix32
 
typedef s16 ff16
 
typedef s32 ff32
 
typedef vs16 vfix16
 
typedef vs32 vfix32
 
typedef vs16 vf16
 
typedef vs32 vf32
 
typedef void VoidCallback(void)
 

Functions

u8 getZeroU8 (void)
 
u16 getZeroU16 (void)
 
u32 getZeroU32 (void)
 
u8 rol8 (u8 value, u16 number)
 ROL instruction for byte (8 bit) value.
 
u16 rol16 (u16 value, u16 number)
 ROL instruction for short (16 bit) value.
 
u32 rol32 (u32 value, u16 number)
 ROL instruction for long (32 bit) value.
 
u8 ror8 (u8 value, u16 number)
 ROR instruction for byte (8 bit) value.
 
u16 ror16 (u16 value, u16 number)
 ROR instruction for short (16 bit) value.
 
u32 ror32 (u32 value, u16 number)
 ROR instruction for long (32 bit) value.
 

Detailed Description

Types definition.

Author
Stephane Dallongeville
Date
08/2011

SGDK Types definition.

Typedef Documentation

◆ bool

boolean type, to be used with TRUE and FALSE constant. (internally set as unsigned char)

◆ f16

f16

16 bits fixed point (10.6) type - short version

◆ f32

f32

32 bits fixed point (22.10) type - short version

◆ fastfix16

"fast" 16 bits fixed point (8.8) type

◆ fastfix32

"fast" 32 bits fixed point (16.16) type

◆ ff16

"fast" 16 bits fixed point (8.8) type - short version

◆ ff32

"fast" 32 bits fixed point (16.16) type - short version

◆ fix16

16 bits fixed point (10.6) type

◆ fix32

32 bits fixed point (22.10) type

◆ p16

p16

short pointer for fast 16 bit addressing (GCC does correctly cast that to pointer). Limited to 0xFFFF8000-0x00007FFF memory region (first 32KB bank of ROM, and last 32KB of RAM)

◆ s16

s16

16 bits signed integer (equivalent to short).

◆ s32

s32

32 bits signed integer (equivalent to long).

◆ s8

s8

8 bits signed integer (equivalent to char).

◆ u16

u16

16 bits unsigned integer (equivalent to unsigned short).

◆ u32

u32

32 bits unsigned integer (equivalent to unsigned long).

◆ u8

u8

8 bits unsigned integer (equivalent to unsigned char).

◆ vbool

volatile boolean type. (internally set as volatile unsigned char)

◆ vf16

volatile 16 bits fixed point (10.6) type - short version

◆ vf32

volatile 32 bits fixed point (22.10) type - short version

◆ vfix16

volatile 16 bits fixed point (10.6) type.

◆ vfix32

volatile 32 bits fixed point (22.10) type.

◆ vs16

volatile 16 bits signed integer.

◆ vs32

volatile 32 bits signed integer.

◆ vs8

vs8

volatile 8 bits signed integer.

◆ vu16

volatile 16 bits unsigned integer.

◆ vu32

volatile 32 bits unsigned integer.

◆ vu8

vu8

volatile 8 bits unsigned integer.

Function Documentation

◆ rol16()

u16 rol16 ( u16  value,
u16  number 
)

ROL instruction for short (16 bit) value.

Parameters
valuevalue to apply bit rotation
numbernumber of bit rotation

◆ rol32()

u32 rol32 ( u32  value,
u16  number 
)

ROL instruction for long (32 bit) value.

Parameters
valuevalue to apply bit rotation
numbernumber of bit rotation

◆ rol8()

u8 rol8 ( u8  value,
u16  number 
)

ROL instruction for byte (8 bit) value.

Parameters
valuevalue to apply bit rotation
numbernumber of bit rotation

◆ ror16()

u16 ror16 ( u16  value,
u16  number 
)

ROR instruction for short (16 bit) value.

Parameters
valuevalue to apply bit rotation
numbernumber of bit rotation

◆ ror32()

u32 ror32 ( u32  value,
u16  number 
)

ROR instruction for long (32 bit) value.

Parameters
valuevalue to apply bit rotation
numbernumber of bit rotation

◆ ror8()

u8 ror8 ( u8  value,
u16  number 
)

ROR instruction for byte (8 bit) value.

Parameters
valuevalue to apply bit rotation
numbernumber of bit rotation