2 #ifndef dreamcast_modules_H
3 #define dreamcast_modules_H 1
13 * Basic module structure defining the common operations across all
14 * modules, ie start, stop, reset, etc. Nothing here is time-sensitive.
16 typedef struct dreamcast_module {
19 * Perform all initial module setup (ie register / allocate any
20 * memory required, etc). Only called once during DreamOn startup
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.
29 * Set the module into a running state (may be NULL)
33 * Execute one time-slice worth of operations, for the given number of
36 int (*run_time_slice)( int microsecs );
38 * Set the module into a stopped state (may be NULL)
42 * Save the module state to the FILE stream. May be NULL, in which case
43 * the module is considered to have no state.
47 * Load the saved module state from the FILE stream. May be NULL, in which
48 * case reset() will be called instead.
49 * @return 0 on success, nonzero on failure.
52 } *dreamcast_module_t;
54 void dreamcast_register_module( dreamcast_module_t );
56 extern struct dreamcast_module mem_module;
57 extern struct dreamcast_module sh4_module;
58 extern struct dreamcast_module asic_module;
59 extern struct dreamcast_module pvr2_module;
60 extern struct dreamcast_module aica_module;
61 extern struct dreamcast_module ide_module;
62 extern struct dreamcast_module maple_module;
63 extern struct dreamcast_module pvr2_module;
64 extern struct dreamcast_module gui_module;
66 void fwrite_string( char *s, FILE *f );
67 int fread_string( char *s, int maxlen, FILE *f );
73 #endif /* !dreamcast_modules_H */
.