Search
lxdream.org :: lxdream/src/dreamcast.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.h
changeset 431:248dd77a9e44
prev429:e581b90c3fb3
next450:207461e79f21
author nkeynes
date Tue Oct 09 08:12:29 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
view annotate diff log raw
     1 /**
     2  * $Id: dreamcast.h,v 1.17 2007-10-09 08:12:29 nkeynes Exp $
     3  *
     4  * Public interface for dreamcast.c -
     5  * Central switchboard for the system. This pulls all the individual modules
     6  * together into some kind of coherent structure. This is also where you'd
     7  * add Naomi support, if I ever get a board to play with...
     8  *
     9  * Copyright (c) 2005 Nathan Keynes.
    10  *
    11  * This program is free software; you can redistribute it and/or modify
    12  * it under the terms of the GNU General Public License as published by
    13  * the Free Software Foundation; either version 2 of the License, or
    14  * (at your option) any later version.
    15  *
    16  * This program is distributed in the hope that it will be useful,
    17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19  * GNU General Public License for more details.
    20  */
    22 #ifndef dreamcast_H
    23 #define dreamcast_H 1
    25 #include <stdio.h>
    26 #include <glib/gtypes.h>
    28 #ifdef __cplusplus
    29 extern "C" {
    30 #endif
    32 #define DEFAULT_TIMESLICE_LENGTH 1000000 /* nanoseconds */
    34 #define MB *1024*1024
    35 #define KB *1024
    37 #define XLAT_NEW_CACHE_SIZE 32 MB
    38 #define XLAT_TEMP_CACHE_SIZE 2 MB
    39 #define XLAT_OLD_CACHE_SIZE 8 MB
    41 #define CONFIG_TYPE_NONE 0
    42 #define CONFIG_TYPE_FILE 1
    43 #define CONFIG_TYPE_PATH 2
    44 #define CONFIG_TYPE_KEY 3
    46 #define DEFAULT_CONFIG_FILENAME "lxdream.rc"
    48 typedef struct dreamcast_config_entry {
    49     const gchar *key;
    50     const int type;
    51     const gchar *default_value;
    52     gchar *value;
    53 } *dreamcast_config_entry_t;
    55 typedef struct dreamcast_config_group {
    56     const gchar *key;
    57     struct dreamcast_config_entry *params;
    58 } *dreamcast_config_group_t;
    60 void dreamcast_configure(void);
    61 void dreamcast_configure_aica_only(void);
    62 void dreamcast_init(void);
    63 void dreamcast_reset(void);
    64 void dreamcast_run(void);
    65 void dreamcast_run_for( unsigned int seconds, unsigned int nanosecs );
    66 void dreamcast_stop(void);
    67 void dreamcast_shutdown(void);
    68 gboolean dreamcast_is_running(void);
    70 gboolean dreamcast_load_config( const gchar *filename );
    71 gboolean dreamcast_save_config( const gchar *filename );
    72 gboolean dreamcast_load_config_stream( FILE *f );
    73 gboolean dreamcast_save_config_stream( FILE *f );
    75 #define DREAMCAST_SAVE_MAGIC "%!-lxDream!Save\0"
    76 #define DREAMCAST_SAVE_VERSION 0x00010000
    78 int dreamcast_save_state( const gchar *filename );
    79 int dreamcast_load_state( const gchar *filename );
    81 #define SCENE_SAVE_MAGIC "%!-lxDream!Scene"
    82 #define SCENE_SAVE_VERSION 0x00010000
    84 extern struct dreamcast_config_group dreamcast_config_root[];
    86 /* Global config values */
    87 const gchar *dreamcast_get_config_value( int key );
    88 #define CONFIG_BIOS_PATH 0
    89 #define CONFIG_FLASH_PATH 1
    90 #define CONFIG_DEFAULT_PATH 2
    91 #define CONFIG_SAVE_PATH 3
    92 #define CONFIG_BOOTSTRAP 4
    94 #ifdef __cplusplus
    95 }
    96 #endif
    98 #endif /* !dreamcast_H */
.