Search
lxdream.org :: lxdream/src/dreamcast.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.h
changeset 144:7f0714e89aaa
prev30:89b30313d757
next167:71c0cc416a64
author nkeynes
date Mon May 15 08:28:52 2006 +0000 (13 years ago)
permissions -rw-r--r--
last change Rename video_driver to display_driver
Add input source to display
Implement configuration file support
Hook controllers up to configuration
file annotate diff log raw
nkeynes@26
     1
/**
nkeynes@144
     2
 * $Id: dreamcast.h,v 1.9 2006-05-15 08:28:48 nkeynes Exp $
nkeynes@26
     3
 *
nkeynes@26
     4
 * Public interface for dreamcast.c -
nkeynes@26
     5
 * Central switchboard for the system. This pulls all the individual modules
nkeynes@26
     6
 * together into some kind of coherent structure. This is also where you'd
nkeynes@26
     7
 * add Naomi support, if I ever get a board to play with...
nkeynes@26
     8
 *
nkeynes@26
     9
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@26
    10
 *
nkeynes@26
    11
 * This program is free software; you can redistribute it and/or modify
nkeynes@26
    12
 * it under the terms of the GNU General Public License as published by
nkeynes@26
    13
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@26
    14
 * (at your option) any later version.
nkeynes@26
    15
 *
nkeynes@26
    16
 * This program is distributed in the hope that it will be useful,
nkeynes@26
    17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@26
    18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@26
    19
 * GNU General Public License for more details.
nkeynes@26
    20
 */
nkeynes@2
    21
nkeynes@2
    22
#ifndef dreamcast_H
nkeynes@2
    23
#define dreamcast_H 1
nkeynes@2
    24
nkeynes@15
    25
#include <stdio.h>
nkeynes@18
    26
#include <glib/gtypes.h>
nkeynes@15
    27
nkeynes@15
    28
#ifdef __cplusplus
nkeynes@15
    29
extern "C" {
nkeynes@15
    30
#endif
nkeynes@15
    31
nkeynes@30
    32
#define DEFAULT_TIMESLICE_LENGTH 1000000 /* nanoseconds */
nkeynes@144
    33
#define CONFIG_TYPE_NONE 0
nkeynes@144
    34
#define CONFIG_TYPE_FILE 1
nkeynes@144
    35
#define CONFIG_TYPE_PATH 2
nkeynes@144
    36
#define CONFIG_TYPE_KEY 3
nkeynes@144
    37
nkeynes@144
    38
#define DEFAULT_CONFIG_FILENAME "dream.conf"
nkeynes@144
    39
nkeynes@144
    40
typedef struct dreamcast_config_entry {
nkeynes@144
    41
    const gchar *key;
nkeynes@144
    42
    const int type;
nkeynes@144
    43
    const gchar *default_value;
nkeynes@144
    44
    gchar *value;
nkeynes@144
    45
} *dreamcast_config_entry_t;
nkeynes@144
    46
nkeynes@144
    47
typedef struct dreamcast_config_group {
nkeynes@144
    48
    const gchar *key;
nkeynes@144
    49
    struct dreamcast_config_entry *params;
nkeynes@144
    50
} *dreamcast_config_group_t;
nkeynes@144
    51
nkeynes@23
    52
nkeynes@2
    53
void dreamcast_init(void);
nkeynes@2
    54
void dreamcast_reset(void);
nkeynes@23
    55
void dreamcast_run(void);
nkeynes@2
    56
void dreamcast_stop(void);
nkeynes@2
    57
nkeynes@144
    58
gboolean dreamcast_load_config( const gchar *filename );
nkeynes@144
    59
gboolean dreamcast_save_config( const gchar *filename );
nkeynes@30
    60
nkeynes@18
    61
int dreamcast_save_state( const gchar *filename );
nkeynes@18
    62
int dreamcast_load_state( const gchar *filename );
nkeynes@18
    63
nkeynes@144
    64
extern struct dreamcast_config_group dreamcast_config_root[];
nkeynes@144
    65
nkeynes@15
    66
#ifdef __cplusplus
nkeynes@15
    67
}
nkeynes@15
    68
#endif
nkeynes@15
    69
nkeynes@26
    70
#endif /* !dreamcast_H */
.