Search
lxdream.org :: lxdream/src/modules.h :: diff
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
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/modules.h Mon Dec 12 13:11:11 2005 +0000
1.3 @@ -0,0 +1,64 @@
1.4 +
1.5 +#ifndef dreamcast_modules_H
1.6 +#define dreamcast_modules_H 1
1.7 +
1.8 +#include <stdlib.h>
1.9 +#include <stdio.h>
1.10 +
1.11 +#ifdef __cplusplus
1.12 +extern "C" {
1.13 +#endif
1.14 +
1.15 +/**
1.16 + * Basic module structure defining the common operations across all
1.17 + * modules, ie start, stop, reset, etc. Nothing here is time-sensitive.
1.18 + */
1.19 +typedef struct dreamcast_module {
1.20 + char *name;
1.21 + /**
1.22 + * Perform all initial module setup (ie register / allocate any
1.23 + * memory required, etc). Only called once during DreamOn startup
1.24 + */
1.25 + void (*init)();
1.26 + /**
1.27 + * Reset the module into it's initial system boot state. Will be called
1.28 + * once after init(), as well as whenever the user requests a reset.
1.29 + */
1.30 + void (*reset)();
1.31 + /**
1.32 + * Set the module into a running state (may be NULL)
1.33 + */
1.34 + void (*start)();
1.35 + /**
1.36 + * Set the module into a stopped state (may be NULL)
1.37 + */
1.38 + void (*stop)();
1.39 + /**
1.40 + * Save the module state to the FILE stream. May be NULL, in which case
1.41 + * the module is considered to have no state.
1.42 + */
1.43 + void (*save)(FILE *);
1.44 + /**
1.45 + * Load the saved module state from the FILE stream. May be NULL, in which
1.46 + * case reset() will be called instead.
1.47 + */
1.48 + void (*load)(FILE *);
1.49 +} *dreamcast_module_t;
1.50 +
1.51 +void dreamcast_register_module( dreamcast_module_t );
1.52 +
1.53 +extern struct dreamcast_module mem_module;
1.54 +extern struct dreamcast_module sh4_module;
1.55 +extern struct dreamcast_module asic_module;
1.56 +extern struct dreamcast_module pvr2_module;
1.57 +extern struct dreamcast_module aica_module;
1.58 +extern struct dreamcast_module ide_module;
1.59 +extern struct dreamcast_module maple_module;
1.60 +extern struct dreamcast_module pvr2_module;
1.61 +extern struct dreamcast_module gui_module;
1.62 +
1.63 +#ifdef __cplusplus
1.64 +}
1.65 +#endif
1.66 +
1.67 +#endif /* !dreamcast_modules_H */
.