Search
lxdream.org :: lxdream/src/dreamcast.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.h
changeset 1100:50e702af9373
prev1072:d82e04e6d497
author nkeynes
date Tue Nov 29 16:15:38 2011 +1000 (12 years ago)
permissions -rw-r--r--
last change Fix out-of-tree builds of the mac keymaps
view annotate diff log raw
     1 /**
     2  * $Id$
     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 lxdream_dreamcast_H
    23 #define lxdream_dreamcast_H 1
    25 #include <stdio.h>
    26 #include "lxdream.h"
    28 #ifdef __cplusplus
    29 extern "C" {
    30 #endif
    32 #define DEFAULT_TIMESLICE_LENGTH 1000000 /* nanoseconds */
    34 #define XLAT_NEW_CACHE_SIZE 40 MB
    35 #define XLAT_TEMP_CACHE_SIZE 2 MB
    36 #define XLAT_OLD_CACHE_SIZE 8 MB
    38 struct lxdream_config_group; // Forward declaration
    40 void dreamcast_configure(gboolean use_bootrom);
    41 void dreamcast_configure_aica_only(void);
    42 void dreamcast_init(gboolean use_bootrom);
    43 void dreamcast_reset(void);
    44 void dreamcast_run(void);
    45 void dreamcast_set_run_time( unsigned int seconds, unsigned int nanosecs );
    46 void dreamcast_set_exit_on_stop( gboolean flag );
    47 void dreamcast_stop(void);
    48 void dreamcast_shutdown(void);
    49 gboolean dreamcast_is_running(void);
    50 gboolean dreamcast_config_changed(void *data, struct lxdream_config_group *group, unsigned item,
    51                                        const gchar *oldval, const gchar *newval);
    52 /**
    53  * Return if it's possible to start the VM - currently this requires 
    54  * a) A configured system
    55  * b) Some code to run (either a user program or a ROM)
    56  */
    57 gboolean dreamcast_can_run(void);
    59 /**
    60  * Notify the VM that a program (ELF or other binary) has been loaded.
    61  * 
    62  */
    63 void dreamcast_program_loaded( const gchar *name, sh4addr_t entry_point );
    65 #define DREAMCAST_SAVE_MAGIC "%!-lxDream!Save\0"
    66 #define DREAMCAST_SAVE_VERSION 0x00010006
    68 int dreamcast_save_state( const gchar *filename );
    69 int dreamcast_load_state( const gchar *filename );
    71 /* Quick saves */
    72 #define MAX_QUICK_STATE 9
    73 #define QUICK_STATE_FILENAME "%s/quicksave%d.dst"
    75 void dreamcast_quick_save();
    76 void dreamcast_quick_load();
    77 unsigned int dreamcast_get_quick_state();
    78 void dreamcast_set_quick_state( unsigned int state );
    79 gboolean dreamcast_has_quick_state( unsigned int state );
    81 /**
    82  * Load the front-buffer image from the specified file.
    83  * If the file is not a valid save state, returns NULL. Otherwise,
    84  * returns a newly allocated frame_buffer that should be freed
    85  * by the caller. (The data buffer is contained within the
    86  * allocation and does not need to be freed separately)
    87  */
    88 frame_buffer_t dreamcast_load_preview( const gchar *filename );
    89 gboolean dreamcast_load_fakebios();
    91 #define SCENE_SAVE_MAGIC "%!-lxDream!Scene"
    92 #define SCENE_SAVE_VERSION 0x00010000
    94 extern unsigned char dc_main_ram[];
    95 extern unsigned char dc_boot_rom[];
    96 extern unsigned char dc_flash_ram[];
    98 #ifdef __cplusplus
    99 }
   100 #endif
   102 #endif /* !lxdream_dreamcast_H */
.