Search
lxdream.org :: lxdream/src/modules.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/modules.h
changeset 15:5194dd0fdb60
next17:944f75eea496
author nkeynes
date Mon Dec 12 13:11:11 2005 +0000 (16 years ago)
permissions -rw-r--r--
last change Add dreamcast_module module structure
file annotate diff log raw
nkeynes@15
     1
nkeynes@15
     2
#ifndef dreamcast_modules_H
nkeynes@15
     3
#define dreamcast_modules_H 1
nkeynes@15
     4
nkeynes@15
     5
#include <stdlib.h>
nkeynes@15
     6
#include <stdio.h>
nkeynes@15
     7
nkeynes@15
     8
#ifdef __cplusplus
nkeynes@15
     9
extern "C" {
nkeynes@15
    10
#endif
nkeynes@15
    11
nkeynes@15
    12
/**
nkeynes@15
    13
 * Basic module structure defining the common operations across all
nkeynes@15
    14
 * modules, ie start, stop, reset, etc. Nothing here is time-sensitive.
nkeynes@15
    15
 */
nkeynes@15
    16
typedef struct dreamcast_module {
nkeynes@15
    17
    char *name;
nkeynes@15
    18
    /**
nkeynes@15
    19
     * Perform all initial module setup (ie register / allocate any
nkeynes@15
    20
     * memory required, etc). Only called once during DreamOn startup
nkeynes@15
    21
     */
nkeynes@15
    22
    void (*init)();
nkeynes@15
    23
    /**
nkeynes@15
    24
     * Reset the module into it's initial system boot state. Will be called
nkeynes@15
    25
     * once after init(), as well as whenever the user requests a reset.
nkeynes@15
    26
     */
nkeynes@15
    27
    void (*reset)();
nkeynes@15
    28
    /**
nkeynes@15
    29
     * Set the module into a running state (may be NULL)
nkeynes@15
    30
     */
nkeynes@15
    31
    void (*start)();
nkeynes@15
    32
    /**
nkeynes@15
    33
     * Set the module into a stopped state (may be NULL)
nkeynes@15
    34
     */
nkeynes@15
    35
    void (*stop)();
nkeynes@15
    36
    /**
nkeynes@15
    37
     * Save the module state to the FILE stream. May be NULL, in which case
nkeynes@15
    38
     * the module is considered to have no state.
nkeynes@15
    39
     */
nkeynes@15
    40
    void (*save)(FILE *);
nkeynes@15
    41
    /**
nkeynes@15
    42
     * Load the saved module state from the FILE stream. May be NULL, in which
nkeynes@15
    43
     * case reset() will be called instead.
nkeynes@15
    44
     */
nkeynes@15
    45
    void (*load)(FILE *);
nkeynes@15
    46
} *dreamcast_module_t;
nkeynes@15
    47
nkeynes@15
    48
void dreamcast_register_module( dreamcast_module_t );
nkeynes@15
    49
nkeynes@15
    50
extern struct dreamcast_module mem_module;
nkeynes@15
    51
extern struct dreamcast_module sh4_module;
nkeynes@15
    52
extern struct dreamcast_module asic_module;
nkeynes@15
    53
extern struct dreamcast_module pvr2_module;
nkeynes@15
    54
extern struct dreamcast_module aica_module;
nkeynes@15
    55
extern struct dreamcast_module ide_module;
nkeynes@15
    56
extern struct dreamcast_module maple_module;
nkeynes@15
    57
extern struct dreamcast_module pvr2_module;
nkeynes@15
    58
extern struct dreamcast_module gui_module;
nkeynes@15
    59
nkeynes@15
    60
#ifdef __cplusplus
nkeynes@15
    61
}
nkeynes@15
    62
#endif
nkeynes@15
    63
nkeynes@15
    64
#endif /* !dreamcast_modules_H */
.