Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tut needed for EMS Top Gun on Retropie #1

Open
SirMcFrosty opened this issue Jul 16, 2018 · 10 comments
Open

Tut needed for EMS Top Gun on Retropie #1

SirMcFrosty opened this issue Jul 16, 2018 · 10 comments

Comments

@SirMcFrosty
Copy link

Hi Ansa89

I know it is a long time ago you made this driver. But it would be great if you could help me to install this driver on my Retropie. I could create a .ko file out of it, but now i am lost as i am not a linux expert. a make install didnt work and any other way do go further this problem i dont know.

Please help

Thanks in advance

@Ansa89
Copy link
Owner

Ansa89 commented May 8, 2019

Hi @SirMcFrosty,
I'm very sorry for the late reply, but in the last years I had been very busy (and even now I don't have spare time for my hobbies).

Anyway, I would be very happy to assist you if this issue is still relevant for you (if it doesn't just tell me so I can close it).
Apparently you compiled the kernel module without errors, so you can just copy/paste it in some location inside kernel modules directory and run depmod:

mkdir -p /lib/modules/`uname -r`/misc
cp /path/to/lcdtopgun.ko /lib/modules/`uname -r`/misc
depmod -a

To check if Retropie sees the new module you can try to load it:

modprobe lcdtopgun

Please note that all actions should be run as root.

@SirMcFrosty
Copy link
Author

SirMcFrosty commented May 8, 2019 via email

@Ansa89
Copy link
Owner

Ansa89 commented May 9, 2019

Ok, no problem, take your time.

@OrionTheGod
Copy link

Are there any instruction available for building the kernel module? I'm having issues on groovyarcade( based on arch linux).

@pitprowler
Copy link

Are there any instruction available for building the kernel module? I'm having issues on groovyarcade( based on arch linux).

I got this working in Ubuntu yesterday after a lot of trouble. The problem was with the Makefile. For any Linux kernel higher than 5.3, the SUBDIRS keyword is deprecated and you need to change it to M. Then make and make install should work.

I am planning to try to get it to act as a mouse for use by emulators by following this tutorial: https://askubuntu.com/questions/114895/how-can-a-gamepad-control-the-mouse

@sonik-br
Copy link

sonik-br commented Mar 5, 2021

@pitprowler have you managed to make it work as a mouse?
I compiled it and it does get mapped at /dev/input/event*
But linux detects it as a joystick
"(II) event5 - EMS LCD TopGun 0b9a:016a: is tagged by udev as: Joystick"

@pitprowler
Copy link

I did get it to work as a mouse using the antimicro program mentioned at the bottom of the thread I linked above. I would like to just edit the driver itself if I had the time.

@sonik-br
Copy link

Thanks. I tried to edit and map it to a mouse with no luck.

@pitprowler
Copy link

I remembered something I read a while ago and managed to get the gun recognized as a mouse without much effort.
Go to the section in lcdtopgun.c where it defines which buttons the gun will report. Then just add BTN_LEFT to the list (See below). Linux sees that a left mouse button click is reported and adds it as a mouse device as well.as a joystick.

static const signed short topgun_btn[] = {
BTN_TRIGGER, BTN_A, BTN_B, BTN_C, /* Main buttons /
BTN_START, BTN_SELECT, /
Start, Select /
BTN_LEFT,
-1 /
Terminating entry */
};

@sonik-br
Copy link

That's really interesting!
I will try it out. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants