Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-02-19 10:29:10 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-02-19 10:29:10 +0300
commit8d38a3b9d875322dd312c524b8b05edf80b44a4b (patch)
treea71ff1e04be0a2b7dd964421f73c1113f6b28abe /clovercon
parent25c1478bae39da56d7241f84c1a8cbd59495cb06 (diff)
Clovercon hack updated
Diffstat (limited to 'clovercon')
-rw-r--r--clovercon/clovercon.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/clovercon/clovercon.c b/clovercon/clovercon.c
index 4d0417f4..66ec4597 100644
--- a/clovercon/clovercon.c
+++ b/clovercon/clovercon.c
@@ -37,6 +37,7 @@
static unsigned short home_combination = 0xffff;
static char autofire = 0;
+static char autofire_xy = 0;
static unsigned char autofire_interval = 8;
static char fc_start = 0;
@@ -193,6 +194,8 @@ MODULE_PARM_DESC(home_combination, "Button combination to open menu "
"(0x001=A,0x002=B,0x004=Select,0x008=Start,0x010=Up,0x020=Down,0x040=Left,0x080=Right,0x100=X,0x200=Y,0x400=L,0x800=R");
module_param(autofire, byte, 0000);
MODULE_PARM_DESC(autofire, "Enable autofire (hold select+a / select+b for a second)");
+module_param(autofire_xy, byte, 0000);
+MODULE_PARM_DESC(autofire_xy, "Use X/Y on classic controller as autofire A/B");
module_param(autofire_interval, byte, 0000);
MODULE_PARM_DESC(autofire_interval, "Autofire interval (default is 8)");
module_param(fc_start, byte, 0000);
@@ -477,13 +480,12 @@ static void clovercon_poll(struct input_polled_dev *polled_dev) {
}
// Autofire
+ info->autofire_timer++;
+ if (info->autofire_timer >= autofire_interval*2)
+ info->autofire_timer = 0;
+ turbo = info->autofire_timer / autofire_interval;
if (autofire)
{
- info->autofire_timer++;
- if (info->autofire_timer >= autofire_interval*2)
- info->autofire_timer = 0;
- turbo = info->autofire_timer / autofire_interval;
-
if (a && select && !b && !start && !up && !down && !left && !right)
info->autofire_counter_a++;
else
@@ -501,6 +503,9 @@ static void clovercon_poll(struct input_polled_dev *polled_dev) {
if (info->autofire_a && !turbo) a = 0;
if (info->autofire_b && !turbo) b = 0;
+ }
+ if (autofire_xy)
+ {
// X and Y on classic controller now are autofire A and B
if (x && turbo) a = 1;
if (y && turbo) b = 1;