Search
lxdream.org :: lxdream/src/maple/controller.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/maple/controller.c
changeset 460:a0c865b74c63
prev451:50622730f226
next502:c4ecae2b1b5e
author nkeynes
date Tue Oct 23 10:47:17 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Make controller config actually work
file annotate diff log raw
1.1 --- a/src/maple/controller.c Sun Oct 21 05:15:56 2007 +0000
1.2 +++ b/src/maple/controller.c Tue Oct 23 10:47:17 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: controller.c,v 1.8 2007-10-21 05:15:56 nkeynes Exp $
1.6 + * $Id: controller.c,v 1.9 2007-10-23 10:47:17 nkeynes Exp $
1.7 *
1.8 * Implements the standard dreamcast controller
1.9 *
1.10 @@ -28,6 +28,7 @@
1.11 void controller_attach( maple_device_t dev );
1.12 void controller_detach( maple_device_t dev );
1.13 void controller_destroy( maple_device_t dev );
1.14 +maple_device_t controller_clone( maple_device_t dev );
1.15 maple_device_t controller_new();
1.16 lxdream_config_entry_t controller_get_config( maple_device_t dev );
1.17 int controller_get_cond( maple_device_t dev, int function, unsigned char *outbuf,
1.18 @@ -44,7 +45,7 @@
1.19 static struct controller_device base_controller = {
1.20 { MAPLE_DEVICE_TAG, &controller_class, CONTROLLER_IDENT, CONTROLLER_VERSION,
1.21 controller_get_config, controller_attach, controller_detach, controller_destroy,
1.22 - NULL, NULL, controller_get_cond, NULL, NULL, NULL },
1.23 + controller_clone, NULL, NULL, controller_get_cond, NULL, NULL, NULL },
1.24 {0x0000FFFF, 0x80808080},
1.25 {{ "dpad left", CONFIG_TYPE_KEY },
1.26 { "dpad right", CONFIG_TYPE_KEY },
1.27 @@ -72,6 +73,15 @@
1.28 return MAPLE_DEVICE(dev);
1.29 }
1.30
1.31 +maple_device_t controller_clone( maple_device_t srcdevice )
1.32 +{
1.33 + controller_device_t src = (controller_device_t)srcdevice;
1.34 + controller_device_t dev = (controller_device_t)controller_new();
1.35 + lxdream_copy_config_list( dev->config, src->config );
1.36 + memcpy( dev->condition, src->condition, sizeof(src->condition) );
1.37 + return MAPLE_DEVICE(dev);
1.38 +}
1.39 +
1.40 /**
1.41 * Input callback
1.42 */
.