Search
lxdream.org :: lxdream/src/modules.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/modules.h
changeset 17:944f75eea496
prev15:5194dd0fdb60
next23:1ec3acd0594d
author nkeynes
date Thu Dec 22 07:38:12 2005 +0000 (16 years ago)
permissions -rw-r--r--
last change Implement 95% of the SCIF serial interface
Implement basic load_bin_file function to try to load demos directly
Update TMU to run all 3 timers, start on general timing
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      * @return 0 on success, nonzero on failure.
    45      */
    46     int (*load)(FILE *);
    47 } *dreamcast_module_t;
    49 void dreamcast_register_module( dreamcast_module_t );
    51 extern struct dreamcast_module mem_module;
    52 extern struct dreamcast_module sh4_module;
    53 extern struct dreamcast_module asic_module;
    54 extern struct dreamcast_module pvr2_module;
    55 extern struct dreamcast_module aica_module;
    56 extern struct dreamcast_module ide_module;
    57 extern struct dreamcast_module maple_module;
    58 extern struct dreamcast_module pvr2_module;
    59 extern struct dreamcast_module gui_module;
    61 void fwrite_string( char *s, FILE *f );
    62 int fread_string( char *s, int maxlen, FILE *f );
    64 #ifdef __cplusplus
    65 }
    66 #endif
    68 #endif /* !dreamcast_modules_H */
.