diff --git a/README.md b/README.md index 44ad699a..5c95b42a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,20 @@ -GIMX +GIMX-evdev ==== [![Build Status](https://travis-ci.com/matlo/GIMX.svg?branch=master)](https://travis-ci.com/matlo/GIMX) GIMX is a free software that allows to use a computer as a hub for your gaming devices. It works on Windows® and GNU/Linux platforms. It is compatible with Playstation® and Xbox® gaming consoles. The connection between the computer and the gaming console is performed using a USB adapter – [get one on the GIMX shop!](https://blog.gimx.fr/product/gimx-adapter/) – or a Bluetooth® dongle (PS3/PS4 only). The capabilities depend on the platform, the connection method, and the gaming platform. +GIMX on Linux now has evdev support, which is more supported on modern Linux kernels. + +This is a fork of GIMX for Linux systems where evdev support has resulted in joydev neglect and degraded functionality. + +If you find you're using GIMX by matlo on a certain non-ubuntu distro and it just refuses to do something like, accept proper analog joystick or throttle inputs, it might be a critical kernel level difference in expected behaviour and your best bet is to either swithc to the OS distro he built the software on, or try out evdev. + +**WARNING** this version is not officially supported by matlo, and while you can download all the configs from their repository, they will NOT work! This is because evdev ID numbers are different and names of devices might be fetched differently. You won't be able to match any old configs. But you CAN still download them and use them as references for remapping, as many of them have nice advanced features and offer structure to work from. + +Please report any bugs with identifying your devices, and send your device and device ID found with `evdev-test` or `cat /proc/bus/input/devices` + Links: * [Documentation](https://wiki.gimx.fr) * [Source code](https://gimx.fr/source) diff --git a/core/config_reader.c b/core/config_reader.c index 451fc486..05d117dd 100644 --- a/core/config_reader.c +++ b/core/config_reader.c @@ -3,6 +3,7 @@ License: GPLv3 */ +#include #include #include "config_reader.h" #include @@ -17,6 +18,7 @@ #include "../directories.h" #include "macros.h" #include +#include /* * These variables are used to read the configuration. diff --git a/core/connectors/bluetooth/linux/bt_mgmt.c b/core/connectors/bluetooth/linux/bt_mgmt.c index 5d9e1a66..4e0952d9 100644 --- a/core/connectors/bluetooth/linux/bt_mgmt.c +++ b/core/connectors/bluetooth/linux/bt_mgmt.c @@ -322,7 +322,7 @@ static int read_link_keys(uint16_t index, uint16_t nb_keys, bdaddr_t bdaddrs[nb_ bdaddr_t ba; char dongle_bdaddr[18]; - if(bt_device_abs_get(bt_abs_value)->get_bdaddr(index, &ba) < 0) + if(bt_device_abs_get()->get_bdaddr(index, &ba) < 0) { fprintf(stderr, "can't read device bdaddr\n"); return -1; diff --git a/core/controller.h b/core/controller.h index b0db84bc..f0e5a212 100644 --- a/core/controller.h +++ b/core/controller.h @@ -82,7 +82,7 @@ typedef struct { int mperiod; } s_adapter; -int adapter_detect(); +e_gimx_status adapter_detect(); int adapter_start(); int adapter_send(); e_gimx_status adapter_clean(); diff --git a/core/display.c b/core/display.c index 575b29e9..f8fee3b8 100644 --- a/core/display.c +++ b/core/display.c @@ -8,7 +8,7 @@ #ifdef PDCURSES #include #else -#include +#include #endif #include "display.h" diff --git a/core/gimx.c b/core/gimx.c index 700cae94..55e3aafa 100755 --- a/core/gimx.c +++ b/core/gimx.c @@ -8,6 +8,7 @@ #include //to print errors #include //to print errors #include //PATH_MAX +#include #ifndef WIN32 #include //to disable/enable echo @@ -34,6 +35,7 @@ #include "../directories.h" #include #include +#include #include #include @@ -529,7 +531,7 @@ int main(int argc, char *argv[]) sprintf(file, "%s/gimx.status", tmp); } free(tmp); - if (file != NULL && file[0] != '\0') + if (file[0] != '\0') { FILE * fp = gfile_fopen(file, "w"); if (fp != NULL) diff --git a/shared/gimxcontroller/src/controller.c b/shared/gimxcontroller/src/controller.c index 8b270b5e..4718d040 100644 --- a/shared/gimxcontroller/src/controller.c +++ b/shared/gimxcontroller/src/controller.c @@ -358,7 +358,7 @@ int controller_get_axis_index(const char* name) int i; for(i=0; iaxes[i].name) + if(controllers[C_TYPE_SIXAXIS]->axes[i].name[0]) { if(!strcmp(controllers[C_TYPE_SIXAXIS]->axes[i].name, name)) { diff --git a/shared/gimxdownloader/Downloader.cpp b/shared/gimxdownloader/Downloader.cpp index 57e53795..e6c939f6 100644 --- a/shared/gimxdownloader/Downloader.cpp +++ b/shared/gimxdownloader/Downloader.cpp @@ -129,9 +129,9 @@ static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) { return written; } -static int progress_callback(void * clientp, double dltotal, double dlnow, double ultotal __attribute__((unused)), - double ulnow __attribute__((unused))) { - return ((Downloader *) clientp)->progress(dlnow, dltotal); +static int xferinfo_callback(void * clientp, curl_off_t dltotal, curl_off_t dlnow, + curl_off_t ultotal __attribute__((unused)), curl_off_t ulnow __attribute__((unused))) { + return ((Downloader *) clientp)->progress(static_cast(dlnow), static_cast(dltotal)); } int Downloader::progress(double dlnow, double dltotal) { @@ -209,8 +209,8 @@ Downloader::DownloaderStatus Downloader::download(const std::string& url, const curl_easy_setopt(m_curl_handle, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(m_curl_handle, CURLOPT_FILE, outfile); - curl_easy_setopt(m_curl_handle, CURLOPT_PROGRESSFUNCTION, progress_callback); - curl_easy_setopt(m_curl_handle, CURLOPT_PROGRESSDATA, this); + curl_easy_setopt(m_curl_handle, CURLOPT_XFERINFOFUNCTION, xferinfo_callback); + curl_easy_setopt(m_curl_handle, CURLOPT_XFERINFODATA, this); curl_easy_setopt(m_curl_handle, CURLOPT_NOPROGRESS, 0L); //curl_easy_setopt(m_curl_handle, CURLOPT_VERBOSE, 1L); diff --git a/shared/gimxhid b/shared/gimxhid index 36a98335..2dbc2639 160000 --- a/shared/gimxhid +++ b/shared/gimxhid @@ -1 +1 @@ -Subproject commit 36a98335345ca9d0366d5900300c4bdfab1335f2 +Subproject commit 2dbc26390aa29b8f4fa7b0829067dfe3d0ee1167 diff --git a/shared/gimxinput b/shared/gimxinput index 4d087a17..01350cf3 160000 --- a/shared/gimxinput +++ b/shared/gimxinput @@ -1 +1 @@ -Subproject commit 4d087a17244c5f55863658522705445e1c838deb +Subproject commit 01350cf3cb3171bc3e49230d94b635c5db1e8709 diff --git a/shared/gimxusb b/shared/gimxusb index 15d6988b..62600766 160000 --- a/shared/gimxusb +++ b/shared/gimxusb @@ -1 +1 @@ -Subproject commit 15d6988b3246daaf4abf9c748bd18a73e4da534f +Subproject commit 626007669e9d8a06725ccd9a51b6ff9100fc48db