DGen/SDL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Functions | Variables
rc.h File Reference
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  rc_field
struct  rc_binding
struct  rc_keysym

Macros

#define NUM_CTV   5
#define NUM_SCALING   3
#define CTV_OFF   0
#define CTV_BLUR   1
#define CTV_SCANLINE   2
#define CTV_INTERLACE   3
#define CTV_SWAB   4
#define KEYSYM_MOD_ALT   0x40000000
#define KEYSYM_MOD_SHIFT   0x20000000
#define KEYSYM_MOD_CTRL   0x10000000
#define KEYSYM_MOD_META   0x08000000
#define KEYSYM_MOD_MASK   0x78000000
#define JS_AXIS_NEGATIVE   0x00
#define JS_AXIS_BETWEEN   0x80
#define JS_AXIS_POSITIVE   0xff
#define JS_HAT_CENTERED   0
#define JS_HAT_UP   1
#define JS_HAT_RIGHT_UP   2
#define JS_HAT_RIGHT   3
#define JS_HAT_RIGHT_DOWN   4
#define JS_HAT_DOWN   5
#define JS_HAT_LEFT_DOWN   6
#define JS_HAT_LEFT   7
#define JS_HAT_LEFT_UP   8
#define JS_TYPE_BUTTON   0x01
#define JS_TYPE_AXIS   0x02
#define JS_TYPE_HAT   0x03
#define JS_MAKE_IDENTIFIER(i)   (((i) & 0xff) << 16)
#define JS_MAKE_BUTTON(b)   ((JS_TYPE_BUTTON << 24) | ((b) & 0xff))
#define JS_MAKE_AXIS(a, d)   ((JS_TYPE_AXIS << 24) | (((a) & 0xff) << 8) | ((d) & 0xff))
#define JS_MAKE_HAT(h, d)   ((JS_TYPE_HAT << 24) | (((h) & 0xff) << 8) | ((d) & 0xff))
#define JS_GET_IDENTIFIER(v)   (((v) >> 16) & 0xff)
#define JS_IS_BUTTON(v)   ((((v) >> 24) & 0xff) == JS_TYPE_BUTTON)
#define JS_IS_AXIS(v)   ((((v) >> 24) & 0xff) == JS_TYPE_AXIS)
#define JS_IS_HAT(v)   ((((v) >> 24) & 0xff) == JS_TYPE_HAT)
#define JS_GET_BUTTON(v)   ((v) & 0xff)
#define JS_GET_AXIS(v)   (((v) >> 8) & 0xff)
#define JS_GET_AXIS_DIR(v)   JS_GET_BUTTON(v)
#define JS_GET_HAT(v)   JS_GET_AXIS(v)
#define JS_GET_HAT_DIR(v)   JS_GET_BUTTON(v)
#define JS_BUTTON(id, button)
#define JS_AXIS(id, axis, direction)
#define JS_HAT(id, hat, direction)
#define RC_BIND_PREFIX   "bind_"
#define RC_FIELDS_SIZE   1024

Functions

void parse_rc (FILE *file, const char *name)
char * dump_keysym (intptr_t k)
char * dump_joypad (intptr_t k)
void dump_rc (FILE *file)
intptr_t rc_number (const char *value, intptr_t *)
intptr_t rc_keysym (const char *code, intptr_t *)
intptr_t rc_boolean (const char *value, intptr_t *)
intptr_t rc_joypad (const char *desc, intptr_t *)
intptr_t rc_ctv (const char *value, intptr_t *)
intptr_t rc_scaling (const char *value, intptr_t *)
intptr_t rc_emu_z80 (const char *value, intptr_t *)
intptr_t rc_emu_m68k (const char *value, intptr_t *)
intptr_t rc_region (const char *value, intptr_t *)
intptr_t rc_string (const char *value, intptr_t *)
intptr_t rc_rom_path (const char *value, intptr_t *)
intptr_t rc_bind (const char *value, intptr_t *variable)
void rc_str_cleanup (void)
struct rc_fieldrc_binding_add (const char *rc, const char *to)
void rc_binding_del (struct rc_field *rcf)

Variables

const char * ctv_names []
const char * scaling_names []
const char * emu_z80_names []
const char * emu_m68k_names []
struct rc_strrc_str_list
struct rc_field rc_fields [RC_FIELDS_SIZE]
struct rc_binding rc_binding_head
struct rc_keysym rc_keysyms []

Macro Definition Documentation

#define CTV_BLUR   1
#define CTV_INTERLACE   3
#define CTV_OFF   0
#define CTV_SCANLINE   2
#define CTV_SWAB   4
#define JS_AXIS (   id,
  axis,
  direction 
)
Value:
JS_MAKE_AXIS((axis), (direction)))
#define JS_AXIS_BETWEEN   0x80
#define JS_AXIS_NEGATIVE   0x00
#define JS_AXIS_POSITIVE   0xff
#define JS_BUTTON (   id,
  button 
)
Value:
JS_MAKE_BUTTON(button))
#define JS_GET_AXIS (   v)    (((v) >> 8) & 0xff)
#define JS_GET_AXIS_DIR (   v)    JS_GET_BUTTON(v)
#define JS_GET_BUTTON (   v)    ((v) & 0xff)
#define JS_GET_HAT (   v)    JS_GET_AXIS(v)
#define JS_GET_HAT_DIR (   v)    JS_GET_BUTTON(v)
#define JS_GET_IDENTIFIER (   v)    (((v) >> 16) & 0xff)
#define JS_HAT (   id,
  hat,
  direction 
)
Value:
JS_MAKE_HAT((hat), (direction)))
#define JS_HAT_CENTERED   0
#define JS_HAT_DOWN   5
#define JS_HAT_LEFT   7
#define JS_HAT_LEFT_DOWN   6
#define JS_HAT_LEFT_UP   8
#define JS_HAT_RIGHT   3
#define JS_HAT_RIGHT_DOWN   4
#define JS_HAT_RIGHT_UP   2
#define JS_HAT_UP   1
#define JS_IS_AXIS (   v)    ((((v) >> 24) & 0xff) == JS_TYPE_AXIS)
#define JS_IS_BUTTON (   v)    ((((v) >> 24) & 0xff) == JS_TYPE_BUTTON)
#define JS_IS_HAT (   v)    ((((v) >> 24) & 0xff) == JS_TYPE_HAT)
#define JS_MAKE_AXIS (   a,
 
)    ((JS_TYPE_AXIS << 24) | (((a) & 0xff) << 8) | ((d) & 0xff))
#define JS_MAKE_BUTTON (   b)    ((JS_TYPE_BUTTON << 24) | ((b) & 0xff))
#define JS_MAKE_HAT (   h,
 
)    ((JS_TYPE_HAT << 24) | (((h) & 0xff) << 8) | ((d) & 0xff))
#define JS_MAKE_IDENTIFIER (   i)    (((i) & 0xff) << 16)
#define JS_TYPE_AXIS   0x02
#define JS_TYPE_BUTTON   0x01
#define JS_TYPE_HAT   0x03
#define KEYSYM_MOD_ALT   0x40000000
#define KEYSYM_MOD_CTRL   0x10000000
#define KEYSYM_MOD_MASK   0x78000000
#define KEYSYM_MOD_META   0x08000000
#define KEYSYM_MOD_SHIFT   0x20000000
#define NUM_CTV   5
#define NUM_SCALING   3
#define RC_BIND_PREFIX   "bind_"
#define RC_FIELDS_SIZE   1024

Function Documentation

char* dump_joypad ( intptr_t  k)
char* dump_keysym ( intptr_t  k)
void dump_rc ( FILE *  file)
void parse_rc ( FILE *  file,
const char *  name 
)
intptr_t rc_bind ( const char *  value,
intptr_t *  variable 
)
struct rc_field* rc_binding_add ( const char *  rc,
const char *  to 
)
read
void rc_binding_del ( struct rc_field rcf)
intptr_t rc_boolean ( const char *  value,
intptr_t *   
)
intptr_t rc_ctv ( const char *  value,
intptr_t *   
)
intptr_t rc_emu_m68k ( const char *  value,
intptr_t *   
)
intptr_t rc_emu_z80 ( const char *  value,
intptr_t *   
)
intptr_t rc_joypad ( const char *  desc,
intptr_t *   
)
intptr_t rc_keysym ( const char *  code,
intptr_t *   
)
intptr_t rc_number ( const char *  value,
intptr_t *   
)
intptr_t rc_region ( const char *  value,
intptr_t *   
)
intptr_t rc_rom_path ( const char *  value,
intptr_t *   
)
intptr_t rc_scaling ( const char *  value,
intptr_t *   
)
void rc_str_cleanup ( void  )
intptr_t rc_string ( const char *  value,
intptr_t *   
)

Variable Documentation

const char* ctv_names[]
const char* emu_m68k_names[]
const char* emu_z80_names[]
struct rc_binding rc_binding_head
struct rc_field rc_fields[RC_FIELDS_SIZE]
struct rc_keysym rc_keysyms[]
struct rc_str* rc_str_list
const char* scaling_names[]