Search
lxdream.org :: lxdream :: r846:32ab6b592a8a
lxdream 0.9.1
released Jun 29
Download Now
changeset846:32ab6b592a8a
parent845:d6131bbe2219
child847:2089244671d2
authornkeynes
dateSat Sep 06 08:16:39 2008 +0000 (15 years ago)
Merge controller.h into controller.c for consistency with the other maple devices
src/maple/controller.c
src/maple/controller.h
1.1 --- a/src/maple/controller.c Sat Sep 06 08:10:55 2008 +0000
1.2 +++ b/src/maple/controller.c Sat Sep 06 08:16:39 2008 +0000
1.3 @@ -22,7 +22,54 @@
1.4 #include "dreamcast.h"
1.5 #include "display.h"
1.6 #include "maple.h"
1.7 -#include "maple/controller.h"
1.8 +
1.9 +/* First word of controller condition */
1.10 +#define BUTTON_C 0x00000001 /* not on standard controller */
1.11 +#define BUTTON_B 0x00000002
1.12 +#define BUTTON_A 0x00000004
1.13 +#define BUTTON_START 0x00000008
1.14 +#define BUTTON_DPAD_UP 0x00000010
1.15 +#define BUTTON_DPAD_DOWN 0x00000020
1.16 +#define BUTTON_DPAD_LEFT 0x00000040
1.17 +#define BUTTON_DPAD_RIGHT 0x00000080
1.18 +#define BUTTON_Z 0x00000100 /* not on standard controller */
1.19 +#define BUTTON_Y 0x00000200
1.20 +#define BUTTON_X 0x00000400
1.21 +#define BUTTON_D 0x00000800 /* not on standard controller */
1.22 +#define BUTTON_LEFT_TRIGGER 0xFF000000 /* Bitmask */
1.23 +#define BUTTON_RIGHT_TRIGGER 0x00FF0000 /* Bitmask */
1.24 +
1.25 +/* Second word of controller condition (bitmasks) */
1.26 +#define JOY_X_AXIS 0x000000FF
1.27 +#define JOY_Y_AXIS 0x0000FF00
1.28 +#define JOY_X_AXIS_CENTER 0x00000080
1.29 +#define JOY_Y_AXIS_CENTER 0x00008000
1.30 +#define JOY2_X_AXIS 0x00FF0000 /* not on standard controller */
1.31 +#define JOY2_Y_AXIS 0xFF000000 /* not on standard controller */
1.32 +
1.33 +/* The following bits are used by the emulator for flags but don't actually
1.34 + * appear in the hardware
1.35 + */
1.36 +#define JOY_LEFT 0x80000001
1.37 +#define JOY_RIGHT 0x80000002
1.38 +#define JOY_UP 0x80000004
1.39 +#define JOY_DOWN 0x80000008
1.40 +
1.41 +/* Standard controller ID */
1.42 +#define CONTROLLER_IDENT {0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, \
1.43 + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x63, 0x61, 0x73, 0x74, 0x20, \
1.44 + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
1.45 + 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x42, 0x79, 0x20, \
1.46 + 0x6f, 0x72, 0x20, 0x55, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, \
1.47 + 0x20, 0x46, 0x72, 0x6f, 0x6d, 0x20, 0x53, 0x45, 0x47, 0x41, 0x20, 0x45, 0x4e, 0x54, 0x45, 0x52, \
1.48 + 0x50, 0x52, 0x49, 0x53, 0x45, 0x53, 0x2c, 0x4c, 0x54, 0x44, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, \
1.49 + 0xae, 0x01, 0xf4, 0x01}
1.50 +#define CONTROLLER_VERSION {0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0x31, \
1.51 + 0x30, 0x2c, 0x31, 0x39, 0x39, 0x38, 0x2f, 0x30, 0x39, 0x2f, 0x32, 0x38, 0x2c, 0x33, 0x31, 0x35, \
1.52 + 0x2d, 0x36, 0x32, 0x31, 0x31, 0x2d, 0x41, 0x42, 0x20, 0x20, 0x20, 0x2c, 0x41, 0x6e, 0x61, 0x6c, \
1.53 + 0x6f, 0x67, 0x20, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x3a, 0x20, 0x54, 0x68, 0x65, 0x20, \
1.54 + 0x34, 0x74, 0x68, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x35, 0x2f, 0x38, 0x20, \
1.55 + 0x20, 0x2b, 0x44, 0x46 }
1.56
1.57 #define CONTROLLER_CONFIG_ENTRIES 15
1.58
2.1 --- a/src/maple/controller.h Sat Sep 06 08:10:55 2008 +0000
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,70 +0,0 @@
2.4 -/**
2.5 - * $Id$
2.6 - *
2.7 - * Definitions for the standard controller device
2.8 - *
2.9 - * Copyright (c) 2005 Nathan Keynes.
2.10 - *
2.11 - * This program is free software; you can redistribute it and/or modify
2.12 - * it under the terms of the GNU General Public License as published by
2.13 - * the Free Software Foundation; either version 2 of the License, or
2.14 - * (at your option) any later version.
2.15 - *
2.16 - * This program is distributed in the hope that it will be useful,
2.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
2.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.19 - * GNU General Public License for more details.
2.20 - */
2.21 -
2.22 -#ifndef lxdream_controller_H
2.23 -#define lxdream_controller_H 1
2.24 -
2.25 -/* First word of controller condition */
2.26 -#define BUTTON_C 0x00000001 /* not on standard controller */
2.27 -#define BUTTON_B 0x00000002
2.28 -#define BUTTON_A 0x00000004
2.29 -#define BUTTON_START 0x00000008
2.30 -#define BUTTON_DPAD_UP 0x00000010
2.31 -#define BUTTON_DPAD_DOWN 0x00000020
2.32 -#define BUTTON_DPAD_LEFT 0x00000040
2.33 -#define BUTTON_DPAD_RIGHT 0x00000080
2.34 -#define BUTTON_Z 0x00000100 /* not on standard controller */
2.35 -#define BUTTON_Y 0x00000200
2.36 -#define BUTTON_X 0x00000400
2.37 -#define BUTTON_D 0x00000800 /* not on standard controller */
2.38 -#define BUTTON_LEFT_TRIGGER 0xFF000000 /* Bitmask */
2.39 -#define BUTTON_RIGHT_TRIGGER 0x00FF0000 /* Bitmask */
2.40 -
2.41 -/* Second word of controller condition (bitmasks) */
2.42 -#define JOY_X_AXIS 0x000000FF
2.43 -#define JOY_Y_AXIS 0x0000FF00
2.44 -#define JOY_X_AXIS_CENTER 0x00000080
2.45 -#define JOY_Y_AXIS_CENTER 0x00008000
2.46 -#define JOY2_X_AXIS 0x00FF0000 /* not on standard controller */
2.47 -#define JOY2_Y_AXIS 0xFF000000 /* not on standard controller */
2.48 -
2.49 -/* The following bits are used by the emulator for flags but don't actually
2.50 - * appear in the hardware
2.51 - */
2.52 -#define JOY_LEFT 0x80000001
2.53 -#define JOY_RIGHT 0x80000002
2.54 -#define JOY_UP 0x80000004
2.55 -#define JOY_DOWN 0x80000008
2.56 -
2.57 -/* Standard controller ID */
2.58 -#define CONTROLLER_IDENT {0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, \
2.59 - 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x63, 0x61, 0x73, 0x74, 0x20, \
2.60 - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
2.61 - 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x42, 0x79, 0x20, \
2.62 - 0x6f, 0x72, 0x20, 0x55, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, \
2.63 - 0x20, 0x46, 0x72, 0x6f, 0x6d, 0x20, 0x53, 0x45, 0x47, 0x41, 0x20, 0x45, 0x4e, 0x54, 0x45, 0x52, \
2.64 - 0x50, 0x52, 0x49, 0x53, 0x45, 0x53, 0x2c, 0x4c, 0x54, 0x44, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, \
2.65 - 0xae, 0x01, 0xf4, 0x01}
2.66 -#define CONTROLLER_VERSION {0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0x31, \
2.67 - 0x30, 0x2c, 0x31, 0x39, 0x39, 0x38, 0x2f, 0x30, 0x39, 0x2f, 0x32, 0x38, 0x2c, 0x33, 0x31, 0x35, \
2.68 - 0x2d, 0x36, 0x32, 0x31, 0x31, 0x2d, 0x41, 0x42, 0x20, 0x20, 0x20, 0x2c, 0x41, 0x6e, 0x61, 0x6c, \
2.69 - 0x6f, 0x67, 0x20, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x3a, 0x20, 0x54, 0x68, 0x65, 0x20, \
2.70 - 0x34, 0x74, 0x68, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x35, 0x2f, 0x38, 0x20, \
2.71 - 0x20, 0x2b, 0x44, 0x46 }
2.72 -
2.73 -#endif /* !lxdream_controller_H */
.