Search
lxdream.org :: lxdream/src/dreamcast.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.h
changeset 953:f4a156508ad1
prev922:8a8361264b1e
next1038:f220d18c0615
author nkeynes
date Tue Jan 13 11:56:28 2009 +0000 (13 years ago)
permissions -rw-r--r--
last change Merge lxdream-mem branch back to trunk
file annotate diff log raw
nkeynes@26
     1
/**
nkeynes@586
     2
 * $Id$
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@736
    22
#ifndef lxdream_dreamcast_H
nkeynes@736
    23
#define lxdream_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@922
    34
#define XLAT_NEW_CACHE_SIZE 40 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@689
    43
void dreamcast_set_run_time( unsigned int seconds, unsigned int nanosecs );
nkeynes@689
    44
void dreamcast_set_exit_on_stop( gboolean flag );
nkeynes@2
    45
void dreamcast_stop(void);
nkeynes@429
    46
void dreamcast_shutdown(void);
nkeynes@461
    47
void dreamcast_config_changed(void);
nkeynes@431
    48
gboolean dreamcast_is_running(void);
nkeynes@2
    49
nkeynes@543
    50
/**
nkeynes@543
    51
 * Return if it's possible to start the VM - currently this requires 
nkeynes@543
    52
 * a) A configured system
nkeynes@543
    53
 * b) Some code to run (either a user program or a ROM)
nkeynes@543
    54
 */
nkeynes@543
    55
gboolean dreamcast_can_run(void);
nkeynes@543
    56
nkeynes@544
    57
/**
nkeynes@544
    58
 * Notify the VM that a program (ELF or other binary) has been loaded.
nkeynes@544
    59
 * 
nkeynes@544
    60
 */
nkeynes@544
    61
void dreamcast_program_loaded( const gchar *name, sh4addr_t entry_point );
nkeynes@544
    62
nkeynes@295
    63
#define DREAMCAST_SAVE_MAGIC "%!-lxDream!Save\0"
nkeynes@953
    64
#define DREAMCAST_SAVE_VERSION 0x00010006
nkeynes@295
    65
nkeynes@18
    66
int dreamcast_save_state( const gchar *filename );
nkeynes@18
    67
int dreamcast_load_state( const gchar *filename );
nkeynes@18
    68
nkeynes@477
    69
/**
nkeynes@477
    70
 * Load the front-buffer image from the specified file.
nkeynes@477
    71
 * If the file is not a valid save state, returns NULL. Otherwise,
nkeynes@477
    72
 * returns a newly allocated frame_buffer that should be freed
nkeynes@477
    73
 * by the caller. (The data buffer is contained within the
nkeynes@477
    74
 * allocation and does not need to be freed separately)
nkeynes@477
    75
 */
nkeynes@477
    76
frame_buffer_t dreamcast_load_preview( const gchar *filename );
nkeynes@477
    77
nkeynes@295
    78
#define SCENE_SAVE_MAGIC "%!-lxDream!Scene"
nkeynes@295
    79
#define SCENE_SAVE_VERSION 0x00010000
nkeynes@295
    80
nkeynes@953
    81
extern unsigned char dc_main_ram[];
nkeynes@953
    82
extern unsigned char dc_boot_rom[];
nkeynes@953
    83
extern unsigned char dc_flash_ram[];
nkeynes@953
    84
nkeynes@15
    85
#ifdef __cplusplus
nkeynes@15
    86
}
nkeynes@15
    87
#endif
nkeynes@15
    88
nkeynes@736
    89
#endif /* !lxdream_dreamcast_H */
.