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