Search
lxdream.org :: lxdream/src/dreamcast.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.h
changeset 543:361ec0a70cf2
prev493:c8183f888b14
next544:3c3a4bd77178
author nkeynes
date Thu Nov 22 11:10:15 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Re-add "Load Binary" menu item (misplaced in GUI rewrite)
Prevent running with no code loaded
file annotate diff log raw
nkeynes@26
     1
/**
nkeynes@493
     2
 * $Id: dreamcast.h,v 1.22 2007-11-06 08:35:33 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@477
    26
#include "lxdream.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@422
    34
#define XLAT_NEW_CACHE_SIZE 32 MB
nkeynes@359
    35
#define XLAT_TEMP_CACHE_SIZE 2 MB
nkeynes@359
    36
#define XLAT_OLD_CACHE_SIZE 8 MB
nkeynes@359
    37
nkeynes@422
    38
void dreamcast_configure(void);
nkeynes@422
    39
void dreamcast_configure_aica_only(void);
nkeynes@2
    40
void dreamcast_init(void);
nkeynes@2
    41
void dreamcast_reset(void);
nkeynes@23
    42
void dreamcast_run(void);
nkeynes@372
    43
void dreamcast_run_for( unsigned int seconds, unsigned int nanosecs );
nkeynes@2
    44
void dreamcast_stop(void);
nkeynes@429
    45
void dreamcast_shutdown(void);
nkeynes@461
    46
void dreamcast_config_changed(void);
nkeynes@431
    47
gboolean dreamcast_is_running(void);
nkeynes@2
    48
nkeynes@543
    49
/**
nkeynes@543
    50
 * Return if it's possible to start the VM - currently this requires 
nkeynes@543
    51
 * a) A configured system
nkeynes@543
    52
 * b) Some code to run (either a user program or a ROM)
nkeynes@543
    53
 */
nkeynes@543
    54
gboolean dreamcast_can_run(void);
nkeynes@543
    55
nkeynes@295
    56
#define DREAMCAST_SAVE_MAGIC "%!-lxDream!Save\0"
nkeynes@493
    57
#define DREAMCAST_SAVE_VERSION 0x00010002
nkeynes@295
    58
nkeynes@18
    59
int dreamcast_save_state( const gchar *filename );
nkeynes@18
    60
int dreamcast_load_state( const gchar *filename );
nkeynes@18
    61
nkeynes@477
    62
/**
nkeynes@477
    63
 * Load the front-buffer image from the specified file.
nkeynes@477
    64
 * If the file is not a valid save state, returns NULL. Otherwise,
nkeynes@477
    65
 * returns a newly allocated frame_buffer that should be freed
nkeynes@477
    66
 * by the caller. (The data buffer is contained within the
nkeynes@477
    67
 * allocation and does not need to be freed separately)
nkeynes@477
    68
 */
nkeynes@477
    69
frame_buffer_t dreamcast_load_preview( const gchar *filename );
nkeynes@477
    70
nkeynes@295
    71
#define SCENE_SAVE_MAGIC "%!-lxDream!Scene"
nkeynes@295
    72
#define SCENE_SAVE_VERSION 0x00010000
nkeynes@295
    73
nkeynes@15
    74
#ifdef __cplusplus
nkeynes@15
    75
}
nkeynes@15
    76
#endif
nkeynes@15
    77
nkeynes@26
    78
#endif /* !dreamcast_H */
.