Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 2 additions & 0 deletions core/config_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
License: GPLv3
*/

#include <stdlib.h>
#include <string.h>
#include "config_reader.h"
#include <xml_defs.h>
Expand All @@ -17,6 +18,7 @@
#include "../directories.h"
#include "macros.h"
#include <errno.h>
#include <stdlib.h>

/*
* These variables are used to read the configuration.
Expand Down
2 changes: 1 addition & 1 deletion core/connectors/bluetooth/linux/bt_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion core/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifdef PDCURSES
#include <cursesw.h>
#else
#include <ncursesw/ncurses.h>
#include <ncurses.h>
#endif

#include "display.h"
Expand Down
4 changes: 3 additions & 1 deletion core/gimx.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <errno.h> //to print errors
#include <string.h> //to print errors
#include <limits.h> //PATH_MAX
#include <stdlib.h>

#ifndef WIN32
#include <termios.h> //to disable/enable echo
Expand All @@ -34,6 +35,7 @@
#include "../directories.h"
#include <gimxprio/include/gprio.h>
#include <gimxusb/include/gusb.h>
#include <stdlib.h>
#include <gimxlog/include/glog.h>
#include <gimxfile/include/gfile.h>

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion shared/gimxcontroller/src/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ int controller_get_axis_index(const char* name)
int i;
for(i=0; i<AXIS_MAX; ++i)
{
if(controllers[C_TYPE_SIXAXIS]->axes[i].name)
if(controllers[C_TYPE_SIXAXIS]->axes[i].name[0])
{
if(!strcmp(controllers[C_TYPE_SIXAXIS]->axes[i].name, name))
{
Expand Down
10 changes: 5 additions & 5 deletions shared/gimxdownloader/Downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>(dlnow), static_cast<double>(dltotal));
}

int Downloader::progress(double dlnow, double dltotal) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion shared/gimxhid
2 changes: 1 addition & 1 deletion shared/gimxinput
2 changes: 1 addition & 1 deletion shared/gimxusb