Search
lxdream.org :: lxdream/src/dreamcast.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.h
changeset 422:61a0598e07ff
prev372:86aa060ddcec
next429:e581b90c3fb3
author nkeynes
date Sat Oct 06 09:03:24 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
nkeynes@26
     1
/**
nkeynes@422
     2
 * $Id: dreamcast.h,v 1.15 2007-10-06 08:59:42 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@359
    33
nkeynes@359
    34
#define MB *1024*1024
nkeynes@422
    35
#define KB *1024
nkeynes@359
    36
nkeynes@422
    37
#define XLAT_NEW_CACHE_SIZE 32 MB
nkeynes@359
    38
#define XLAT_TEMP_CACHE_SIZE 2 MB
nkeynes@359
    39
#define XLAT_OLD_CACHE_SIZE 8 MB
nkeynes@359
    40
nkeynes@144
    41
#define CONFIG_TYPE_NONE 0
nkeynes@144
    42
#define CONFIG_TYPE_FILE 1
nkeynes@144
    43
#define CONFIG_TYPE_PATH 2
nkeynes@144
    44
#define CONFIG_TYPE_KEY 3
nkeynes@144
    45
nkeynes@180
    46
#define DEFAULT_CONFIG_FILENAME "lxdream.rc"
nkeynes@144
    47
nkeynes@144
    48
typedef struct dreamcast_config_entry {
nkeynes@144
    49
    const gchar *key;
nkeynes@144
    50
    const int type;
nkeynes@144
    51
    const gchar *default_value;
nkeynes@144
    52
    gchar *value;
nkeynes@144
    53
} *dreamcast_config_entry_t;
nkeynes@144
    54
nkeynes@144
    55
typedef struct dreamcast_config_group {
nkeynes@144
    56
    const gchar *key;
nkeynes@144
    57
    struct dreamcast_config_entry *params;
nkeynes@144
    58
} *dreamcast_config_group_t;
nkeynes@144
    59
nkeynes@422
    60
void dreamcast_configure(void);
nkeynes@422
    61
void dreamcast_configure_aica_only(void);
nkeynes@2
    62
void dreamcast_init(void);
nkeynes@2
    63
void dreamcast_reset(void);
nkeynes@23
    64
void dreamcast_run(void);
nkeynes@372
    65
void dreamcast_run_for( unsigned int seconds, unsigned int nanosecs );
nkeynes@2
    66
void dreamcast_stop(void);
nkeynes@2
    67
nkeynes@144
    68
gboolean dreamcast_load_config( const gchar *filename );
nkeynes@144
    69
gboolean dreamcast_save_config( const gchar *filename );
nkeynes@422
    70
gboolean dreamcast_load_config_stream( FILE *f );
nkeynes@422
    71
gboolean dreamcast_save_config_stream( FILE *f );
nkeynes@30
    72
nkeynes@295
    73
#define DREAMCAST_SAVE_MAGIC "%!-lxDream!Save\0"
nkeynes@295
    74
#define DREAMCAST_SAVE_VERSION 0x00010000
nkeynes@295
    75
nkeynes@18
    76
int dreamcast_save_state( const gchar *filename );
nkeynes@18
    77
int dreamcast_load_state( const gchar *filename );
nkeynes@18
    78
nkeynes@295
    79
#define SCENE_SAVE_MAGIC "%!-lxDream!Scene"
nkeynes@295
    80
#define SCENE_SAVE_VERSION 0x00010000
nkeynes@295
    81
nkeynes@144
    82
extern struct dreamcast_config_group dreamcast_config_root[];
nkeynes@144
    83
nkeynes@167
    84
/* Global config values */
nkeynes@167
    85
const gchar *dreamcast_get_config_value( int key );
nkeynes@167
    86
#define CONFIG_BIOS_PATH 0
nkeynes@167
    87
#define CONFIG_FLASH_PATH 1
nkeynes@167
    88
#define CONFIG_DEFAULT_PATH 2
nkeynes@167
    89
#define CONFIG_SAVE_PATH 3
nkeynes@167
    90
#define CONFIG_BOOTSTRAP 4
nkeynes@167
    91
nkeynes@15
    92
#ifdef __cplusplus
nkeynes@15
    93
}
nkeynes@15
    94
#endif
nkeynes@15
    95
nkeynes@26
    96
#endif /* !dreamcast_H */
.