tonc_types.h File Reference

Data Structures

struct  BLOCK
 8-word type for fast struct-copies More...
struct  TILE
 4bpp tile type, for easy indexing and copying of 4-bit tiles More...
struct  TILE8
 8bpp tile type, for easy indexing and 8-bit tiles More...
struct  ObjAffineSource
 Simple scale-rotation source struct. More...
struct  BgAffineSource
 Extended scale-rotate source struct. More...
struct  ObjAffineDest
 Simple scale-rotation destination struct, BG version. More...
struct  BgAffineDest
 Extended scale-rotate destination struct. More...
struct  BG_POINT
 Regular bg points; range: :0010 - :001F. More...
struct  DMA_REC
 DMA struct; range: 0400:00B0 - 0400:00DF. More...
struct  TMR_REC
 Timer struct, range: 0400:0100 - 0400:010F. More...
struct  OBJ_ATTR
 Object attributes. More...
struct  OBJ_AFFINE
 Object affine parameters. More...


#define IWRAM_DATA   __attribute__((section(".iwram")))
 Put variable in IWRAM (default).
#define EWRAM_DATA   __attribute__((section(".ewram")))
 Put variable in EWRAM.
#define EWRAM_BSS   __attribute__((section(".sbss")))
 Put non-initialized variable in EWRAM.
#define IWRAM_CODE   __attribute__((section(".iwram"), long_call))
 Put function in IWRAM.
#define EWRAM_CODE   __attribute__((section(".ewram"), long_call))
 Put function in EWRAM.
#define ALIGN(n)   __attribute__((aligned(n)))
 Force a variable to an n-byte boundary.
#define ALIGN4   __attribute__((aligned(4)))
 Force word alignment.
#define PACKED   __attribute__((packed))
 Pack aggregate members.
#define DEPRECATED   __attribute__((deprecated))
 Deprecated notice.
#define INLINE   static inline
 Inline function declarator.
#define TRUE   1
#define FALSE   0
#define NULL   (void*)0


typedef const char *const CSTR
 Type for consting a string as well as the pointer than points to it.
typedef s32 FIXED
 Fixed point type.
typedef u16 COLOR
 Type for colors.
typedef u16 SCR_ENTRY
typedef u16 SE
 Type for screen entries.
typedef u8 SCR_AFF_ENTRY
typedef u8 SAE
 Type for affine screen entries.
typedef struct TILE TILE4
typedef u8 BOOL
typedef void(* fnptr )(void)
 void foo() function pointer
typedef void(* fn_v_i )(int)
 void foo(int x) function pointer
typedef int(* fn_i_i )(int)
 int foo(int x) function pointer
Base types
Basic signed and unsigned types for 8, 16, 32 and 64-bit integers.
  • s# : signed #-bit integer.
  • u#/u{type} : unsigned #-bit integer.
  • e{type} : enum'ed #-bit integer.

typedef unsigned char u8
typedef unsigned char byte
typedef unsigned char uchar
typedef unsigned char echar
typedef unsigned short u16
typedef unsigned short hword
typedef unsigned short ushort
typedef unsigned short eshort
typedef unsigned int u32
typedef unsigned int word
typedef unsigned int uint
typedef unsigned int eint
typedef unsigned
long long 
typedef signed char s8
typedef signed short s16
typedef signed int s32
typedef signed long long s64
Volatile types
Volatile types for registers

typedef volatile u8 vu8
typedef volatile u16 vu16
typedef volatile u32 vu32
typedef volatile u64 vu64
typedef volatile s8 vs8
typedef volatile s16 vs16
typedef volatile s32 vs32
typedef volatile s64 vs64
Const types
Const types for const function aprameters

typedef const u8 cu8
typedef const u16 cu16
typedef const u32 cu32
typedef const u64 cu64
typedef const s8 cs8
typedef const s16 cs16
typedef const s32 cs32
typedef const s64 cs64
IO register types
typedef struct AFF_DST_EX BG_AFFINE
 Affine parameters for backgrounds; range : 0400:0020 - 0400:003F.
PAL types
typedef COLOR PALBANK [16]
 Palette bank type, for 16-color palette banks.
VRAM array types
These types allow VRAM access as arrays or matrices in their most natural types.

typedef SCR_ENTRY SCREENMAT [32][32]
typedef COLOR M3LINE [240]
typedef u8 M4LINE [240]
typedef COLOR M5LINE [160]
typedef TILE CHARBLOCK [512]
typedef TILE8 CHARBLOCK8 [256]


enum  bool { false, true }
 Boolean type.

Detailed Description

J Vijn
20060508 - 20080111

Generated on Mon Aug 25 17:03:56 2008 for libtonc by  doxygen 1.5.3