2 * (C) GraÅžvydas "notaz" Ignotas, 2011
4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
13 unsigned char CurPad, CurByte, CurCmd, CmdLen;
15 /* since this is not a proper plugin, so we'll hook emu internals in a hackish way like this */
16 extern void *PAD1_startPoll, *PAD1_poll;
17 extern void *PAD2_startPoll, *PAD2_poll;
18 extern unsigned char CALLBACK PAD1__startPoll(int pad);
19 extern unsigned char CALLBACK PAD2__startPoll(int pad);
20 extern unsigned char CALLBACK PAD1__poll(unsigned char value);
21 extern unsigned char CALLBACK PAD2__poll(unsigned char value);
25 static int old_controller_type1 = -1, old_controller_type2 = -1;
27 #define select_pad(n) \
28 if (pad.controllerType != old_controller_type##n) \
30 switch (pad.controllerType) \
32 case PSE_PAD_TYPE_ANALOGPAD: \
33 PAD##n##_startPoll = PADstartPoll_pad; \
34 PAD##n##_poll = PADpoll_pad; \
37 case PSE_PAD_TYPE_GUNCON: \
38 PAD##n##_startPoll = PADstartPoll_guncon; \
39 PAD##n##_poll = PADpoll_guncon; \
42 case PSE_PAD_TYPE_NEGCON: \
43 case PSE_PAD_TYPE_GUN: \
45 PAD##n##_startPoll = PAD##n##__startPoll; \
46 PAD##n##_poll = PAD##n##__poll; \
51 void dfinput_activate(void)
55 pad.portMultitap = -1;
56 pad.requestPadIndex = 0;
60 pad.requestPadIndex = 1;
65 #else // use libretro's libpcsxcore/plugins.c code
67 void dfinput_activate(void)