Search
lxdream.org :: lxdream/src/dreamcast.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.h
changeset 1067:d3c00ffccfcd
prev1065:bc1cc0c54917
prev934:3acd3b3ee6d1
next1072:d82e04e6d497
author nkeynes
date Sun Jul 05 13:54:48 2009 +1000 (10 years ago)
permissions -rw-r--r--
last change No-op merge lxdream-mem to tip to remove head (Long since merged in
actuality)
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@931
    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@1038
    69
/* Quick saves */
nkeynes@1038
    70
#define MAX_QUICK_STATE 9
nkeynes@1040
    71
#define QUICK_STATE_FILENAME "%s/quicksave%d.dst"
nkeynes@1038
    72
nkeynes@1038
    73
void dreamcast_quick_save();
nkeynes@1038
    74
void dreamcast_quick_load();
nkeynes@1038
    75
unsigned int dreamcast_get_quick_state();
nkeynes@1038
    76
void dreamcast_set_quick_state( unsigned int state );
nkeynes@1038
    77
gboolean dreamcast_has_quick_state( unsigned int state );
nkeynes@1038
    78
nkeynes@477
    79
/**
nkeynes@477
    80
 * Load the front-buffer image from the specified file.
nkeynes@477
    81
 * If the file is not a valid save state, returns NULL. Otherwise,
nkeynes@477
    82
 * returns a newly allocated frame_buffer that should be freed
nkeynes@477
    83
 * by the caller. (The data buffer is contained within the
nkeynes@477
    84
 * allocation and does not need to be freed separately)
nkeynes@477
    85
 */
nkeynes@477
    86
frame_buffer_t dreamcast_load_preview( const gchar *filename );
nkeynes@477
    87
nkeynes@295
    88
#define SCENE_SAVE_MAGIC "%!-lxDream!Scene"
nkeynes@295
    89
#define SCENE_SAVE_VERSION 0x00010000
nkeynes@295
    90
nkeynes@934
    91
extern unsigned char dc_main_ram[];
nkeynes@934
    92
extern unsigned char dc_boot_rom[];
nkeynes@934
    93
extern unsigned char dc_flash_ram[];
nkeynes@934
    94
nkeynes@15
    95
#ifdef __cplusplus
nkeynes@15
    96
}
nkeynes@15
    97
#endif
nkeynes@15
    98
nkeynes@736
    99
#endif /* !lxdream_dreamcast_H */
.