Search
lxdream.org :: lxdream/src/maple/maple.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/maple/maple.h
changeset 2:42349f6ea216
prev1:eea311cfd33e
next15:5194dd0fdb60
author nkeynes
date Sat Aug 21 06:15:49 2004 +0000 (17 years ago)
permissions -rw-r--r--
last change Commit changes into cvs
file annotate diff log raw
1.1 --- a/src/maple/maple.h Sat Mar 13 00:03:32 2004 +0000
1.2 +++ b/src/maple/maple.h Sat Aug 21 06:15:49 2004 +0000
1.3 @@ -10,8 +10,8 @@
1.4 #define MAPLE_CMD_SHUTDOWN 4 /* Shutdown device */
1.5 #define MAPLE_CMD_GET_COND 9 /* Get condition */
1.6 #define MAPLE_CMD_MEM_INFO 10 /* Get memory information */
1.7 -#define MAPLE_CMD_BLOCK_READ 11 /* Block read */
1.8 -#define MAPLE_CMD_BLOCK_WRITE 12 /* Block write */
1.9 +#define MAPLE_CMD_READ_BLOCK 11 /* Block read */
1.10 +#define MAPLE_CMD_WRITE_BLOCK 12 /* Block write */
1.11 #define MAPLE_CMD_SET_COND 14 /* Set condition */
1.12 #define MAPLE_RESP_INFO 5 /* Device information response */
1.13 #define MAPLE_RESP_EXT_INFO 6 /* Extended device information response */
1.14 @@ -23,24 +23,42 @@
1.15 #define MAPLE_ERR_RETRY -4 /* Retry command */
1.16 #define MAPLE_ERR_FILE -5 /* File error? */
1.17
1.18 -#define MAPLE_FUNC_CONTROLLER 0x001
1.19 -#define MAPLE_FUNC_MEMORY 0x002
1.20 -#define MAPLE_FUNC_LCD 0x004
1.21 -#define MAPLE_FUNC_CLOCK 0x008
1.22 -#define MAPLE_FUNC_MICROPHONE 0x010
1.23 -#define MAPLE_FUNC_AR_GUN 0x020
1.24 -#define MAPLE_FUNC_KEYBOARD 0x040
1.25 -#define MAPLE_FUNC_LIGHT_GUN 0x080
1.26 -#define MAPLE_FUNC_PURU_PURU 0x100
1.27 -#define MAPLE_FUNC_MOUSE 0x200
1.28 +#define MAPLE_FUNC_CONTROLLER 0x01000000
1.29 +#define MAPLE_FUNC_MEMORY 0x02000000
1.30 +#define MAPLE_FUNC_LCD 0x04000000
1.31 +#define MAPLE_FUNC_CLOCK 0x08000000
1.32 +#define MAPLE_FUNC_MICROPHONE 0x10000000
1.33 +#define MAPLE_FUNC_AR_GUN 0x20000000
1.34 +#define MAPLE_FUNC_KEYBOARD 0x40000000
1.35 +#define MAPLE_FUNC_LIGHT_GUN 0x80000000
1.36 +#define MAPLE_FUNC_PURU_PURU 0x00010000
1.37 +#define MAPLE_FUNC_MOUSE 0x00020000
1.38 +
1.39 +#define MAPLE_DEVICE_TAG 0x4D41504C
1.40 +#define MAPLE_DEVICE(x) ((maple_device_t)x)
1.41 +
1.42 +typedef struct maple_device {
1.43 + uint32_t _tag;
1.44 + unsigned char ident[112];
1.45 + unsigned char version[80];
1.46 + int (*reset)(struct maple_device *dev);
1.47 + int (*shutdown)(struct maple_device *dev);
1.48 + int (*get_condition)(struct maple_device *dev,
1.49 + int function, char *outbuf, int *buflen);
1.50 + int (*set_condition)(struct maple_device *dev,
1.51 + int function, char *inbuf, int buflen);
1.52 + int (*read_block)(struct maple_device *dev,
1.53 + int function, uint32_t block, char *outbuf, int *buflen);
1.54 + int (*write_block)(struct maple_device *dev,
1.55 + int function, uint32_t block, char *inbuf, int buflen);
1.56 + void (*attach)(struct maple_device *dev);
1.57 + void (*detach)(struct maple_device *dev);
1.58 +} *maple_device_t;
1.59 +
1.60 +maple_device_t controller_new(void);
1.61
1.62 void maple_handle_buffer( uint32_t buffer );
1.63 -
1.64 -
1.65 -struct maple_device_t {
1.66 -
1.67 -
1.68 -};
1.69 -
1.70 +void maple_attach_device( maple_device_t dev, unsigned int port, unsigned int periph );
1.71 +void maple_detach_device( unsigned int port, unsigned int periph );
1.72
1.73 #endif /* !dream_maple_H */
.