1.1 --- a/src/maple/maple.h Sun Dec 25 08:24:11 2005 +0000
1.2 +++ b/src/maple/maple.h Thu Jun 15 10:33:08 2006 +0000
1.5 - * $Id: maple.h,v 1.4 2005-12-25 08:24:11 nkeynes Exp $
1.6 + * $Id: maple.h,v 1.5 2006-05-15 08:28:52 nkeynes Exp $
1.8 * Maple bus definitions
1.11 #ifndef dream_maple_H
1.12 #define dream_maple_H 1
1.14 +#include "dreamcast.h"
1.16 #define MAPLE_CMD_INFO 1 /* Request device information */
1.17 #define MAPLE_CMD_EXT_INFO 2 /* Request extended information */
1.18 #define MAPLE_CMD_RESET 3 /* Reset device */
1.20 #define MAPLE_DEVICE_TAG 0x4D41504C
1.21 #define MAPLE_DEVICE(x) ((maple_device_t)x)
1.23 +typedef struct maple_device_class *maple_device_class_t;
1.24 +typedef struct maple_device *maple_device_t;
1.26 +struct maple_device_class {
1.28 + maple_device_t (*new_device)();
1.32 * Table of functions to be implemented by any maple device.
1.34 -typedef struct maple_device {
1.35 +struct maple_device {
1.37 + maple_device_class_t device_class;
1.38 unsigned char ident[112];
1.39 unsigned char version[80];
1.40 + dreamcast_config_entry_t (*get_config)(struct maple_device *dev);
1.41 + void (*attach)(struct maple_device *dev);
1.42 + void (*detach)(struct maple_device *dev);
1.43 + void (*destroy)(struct maple_device *dev);
1.45 int (*reset)(struct maple_device *dev);
1.46 int (*shutdown)(struct maple_device *dev);
1.47 int (*get_condition)(struct maple_device *dev,
1.49 int function, uint32_t block, unsigned char *outbuf, int *buflen);
1.50 int (*write_block)(struct maple_device *dev,
1.51 int function, uint32_t block, unsigned char *inbuf, int buflen);
1.52 - void (*attach)(struct maple_device *dev);
1.53 - void (*detach)(struct maple_device *dev);
1.57 -maple_device_t controller_new(void);
1.58 +extern struct maple_device_class controller_class;
1.60 +maple_device_t maple_new_device( const char *name );
1.61 +maple_device_t maple_get_device( unsigned int port, unsigned int periph );
1.62 +dreamcast_config_entry_t maple_get_device_config( maple_device_t dev );
1.64 void maple_handle_buffer( uint32_t buffer );
1.65 void maple_attach_device( maple_device_t dev, unsigned int port, unsigned int periph );
1.66 void maple_detach_device( unsigned int port, unsigned int periph );
1.67 +void maple_detach_all( );
1.68 +void maple_reattach_all( );
1.70 #endif /* !dream_maple_H */