Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: MAME direct input & GlovePIE  (Read 5109 times)

0 Members and 1 Guest are viewing this topic.

zatarra76

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:February 22, 2022, 10:47:05 am
  • I want to build my own arcade controls!
MAME direct input & GlovePIE
« on: December 28, 2020, 10:00:23 am »
Hello!
This is my first topic, please be kind  :notworthy:

I'm using a Wiimote as a lightgun and with GlovePIE I wrote a script to map all buttons as keyboard keys and IR pointer as mouse.
(About this, I don't know why all people keep using in their scripts PPJoy to do that, Windows 10 must be always in test mode and calibrating is so difficult...)
However, my script works perfectly with an old NONAG - DIRECT INPUT version of MAME 0.174 but fails to work on a new version like MAMEARCADE64 0.224.

In the new version I modified the ini file of the game with:

keyboard provider     dinput
mouse provider         dinput

The first one works (Wiimote buttons are correctly translated into keyboard keys and MAME maps them).
The second doesn't work (I can see the GlovePIE script is working because I see the mouse pointer/arrow moving, but the crosshair cursor is not following it).
The crosshair only follow the mouse if I use the real mouse, with the Wiimote only the arrow moves (I'm not an expert but it seems like MAME is not detecting the mouse direct input).
Is there a way to force direct input to new versions of MAME? I read somewhere that with old versions there was some tool to make a personal build of MAME forcing NO NAG and Direct input, I'm wondering if there is something similar for new versions.
I believed that new versions don't need this hack but maybe I'm wrong.
In the worst case I will set my Hyperspin to launch only shooting games with an old MAME build, but I wish I could do everything with the same emulator/version.

Just to give you all information, the Wiimote is connected to the PC with a Dolphin bar in mode 4.

Thanks in advance for your help!  :)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 21, 2024, 11:59:54 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME direct input & GlovePIE
« Reply #1 on: December 28, 2020, 02:29:36 pm »
You can't simulate the cursor within mame.... simulate a joystick instead

zatarra76

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:February 22, 2022, 10:47:05 am
  • I want to build my own arcade controls!
Re: MAME direct input & GlovePIE
« Reply #2 on: December 29, 2020, 10:09:52 am »
Thanks for the reply.

I don't want to contradict you, but not only it is possible, I've already done it in an old Direct Input forced build of MAME (MAMEUIFX64 NoNag Direct input 0.174), I'm only asking if I can do it also in a newer version.

To simulate a joystick as you suggest I have to use PPJoy and to use it Windows 10 must be always in test mode.
Over than that I tried many scripts I found on the internet that uses joystick simulation and no one seems to be line of sight accurate, if I want something so imprecise I can use the Dolphin bar in mode 2 and software like Touchmote (I already tried it and the result is quite a mess).

With the script I wrote using some basic math and the cursor coordinates I can hit the small leaf falling in Point Blank  8)

An alternative solution could be working with Mouse.DirectInput, but translating from simple coordinates to increasing/decreasing mikeys will be kind of tricky.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:April 11, 2024, 04:05:15 am
  • I want to build my own arcade controls!
Re: MAME direct input & GlovePIE
« Reply #3 on: December 29, 2020, 10:40:28 am »
Try changing lightgun provider instead of mouse, to either dinput or win32.

zatarra76

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:February 22, 2022, 10:47:05 am
  • I want to build my own arcade controls!
Re: MAME direct input & GlovePIE
« Reply #4 on: December 29, 2020, 11:09:00 am »
I have never tried win32 as a value for providers  :dunno
I think I should try it for mouse provider first and then with lightgun if it doesn't work.

In the meanwhile I was searching on the internet a simple way to convert pixels to mouse mickeys, but it's not that simple  :banghead:

I hope I will find a solution using cursor  8)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 21, 2024, 11:59:54 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME direct input & GlovePIE
« Reply #5 on: December 29, 2020, 10:05:44 pm »
Sorry but you are wrong.  Early versions of mame and unofficial builds of mame can handle mouse simulation because they don't support multi-mouse (which reads the raw mouse data) once that was added it's joystick only.  Next time don't argue with me and try what I said to do before you reply.  I kind of know what I'm doing with this stuff.... you must be new.  ;)

zatarra76

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:February 22, 2022, 10:47:05 am
  • I want to build my own arcade controls!
Re: MAME direct input & GlovePIE
« Reply #6 on: December 30, 2020, 08:08:21 am »
Yes, I'm new, I wrote it in the first sentence of this post  :dunno

I'm sorry if my answer sounded like an argue, it was not my intention, I really appreciate all the support all of you give us for free.

That said, if we really want to be picky I'm not wrong  8)
The exact words you used are: "You can't simulate the cursor within mame" and that's not correct :)
You should have said: "You can't simulate the cursor within NEWER or CURRENT versions of mame"
When I said "I don't want to contradict you" (instead of "you're wrong") I meant that it's possible with an older version (and that's sure) and I was wondering if the newer versions could (now, thanks to you I know that they can't).

Over than that, yesterday evening while I was cooking the dinner I briefly tried to set mouse provider to win32 as Foxhole suggested with a quite recent standard version of mame (0.224) and, even if not as it should, the thing sorted some kind of result. The cursor doesn't follow the Wiimote pointing in a linear way, but rather exponentially. However, I don't think it's worth going down this path, I will launch the old mame build with Hyperspin for the shooting games only, it will be easier.

Please, don't get it wrong, it's really not my intention to argue with you and I really appraciate all your support  :notworthy:

Regarding you precious support, can I ask you if you know a good GlovePIE script for Wiimote that is line of sight accurate?
Joystick emulation is fine for me, but is there an alternative to PPJoy that prevents me to run always windows 10 in test mode?

Thanks again  :notworthy:

Vocalitus

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 400
  • Last login:October 25, 2021, 06:16:58 pm
  • I want to build my own arcade controls!
Re: MAME direct input & GlovePIE
« Reply #7 on: December 30, 2020, 11:47:06 am »
I'm just glad you posted your question and possible work around.

I have never heard of GlovePIE and I can find several uses in my current cabinet controls situation, so thank you for mentioning it.  I have something new to tinker with.

Even now I agonize over my posts to word it correctly, so I do not step on any toes, but your post makes perfect sense as I use the same MAME version for a certain light gun game and my Wiimote.

Howard's work over the years is legendary with MAME, and has provided the arcade community with plenty of valuable tools.  He is a trusted resource.

I'm interested in learning more about an improved solution.   :applaud:

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 21, 2024, 11:59:54 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME direct input & GlovePIE
« Reply #8 on: December 30, 2020, 04:55:01 pm »
Yes, I'm new, I wrote it in the first sentence of this post  :dunno

I'm sorry if my answer sounded like an argue, it was not my intention, I really appreciate all the support all of you give us for free.

That said, if we really want to be picky I'm not wrong  8)
The exact words you used are: "You can't simulate the cursor within mame" and that's not correct :)
You should have said: "You can't simulate the cursor within NEWER or CURRENT versions of mame"
When I said "I don't want to contradict you" (instead of "you're wrong") I meant that it's possible with an older version (and that's sure) and I was wondering if the newer versions could (now, thanks to you I know that they can't).

Over than that, yesterday evening while I was cooking the dinner I briefly tried to set mouse provider to win32 as Foxhole suggested with a quite recent standard version of mame (0.224) and, even if not as it should, the thing sorted some kind of result. The cursor doesn't follow the Wiimote pointing in a linear way, but rather exponentially. However, I don't think it's worth going down this path, I will launch the old mame build with Hyperspin for the shooting games only, it will be easier.

Please, don't get it wrong, it's really not my intention to argue with you and I really appraciate all your support  :notworthy:

Regarding you precious support, can I ask you if you know a good GlovePIE script for Wiimote that is line of sight accurate?
Joystick emulation is fine for me, but is there an alternative to PPJoy that prevents me to run always windows 10 in test mode?

Thanks again  :notworthy:

No, I said all I needed to say.  When someone posts a question about mame, unless otherwise noted we assume they have sense enough to be running the latest version of the official mame build so we are all on the same page.  Mame is constantly being rebuilt and improved, so things that used to work can't be assumed to work now.

I was going to stay out of it, but the glovepie scripts are a dead end.  Glovepie is essentially a dead program as the author is kind of an odd duck and his site got hacked or whatever so there will never be needed improvements added to his stock cursor management or additional support for newer hardware.  I released several glovepie scripts for mame in the past on this site.  They are decent, but no they aren't 1 to 1 nor will they ever be.  Also as you've noted ppjoy is kind of difficult to get running on the newer builds of windows.  I mean if you are just wanting to fool around with them have at it, but they'll never be as good as the sinden or some of the homebrew gun solutions on this site. 

zatarra76

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:February 22, 2022, 10:47:05 am
  • I want to build my own arcade controls!
Re: MAME direct input & GlovePIE
« Reply #9 on: January 04, 2021, 05:29:08 am »
Thanks again Howard, as I said I'm quite new to all this (I mean the forum and how it works), I perfectly understand what you said and your point of view.

That said, I think that in the future Sinden gun is probably the best one and I will consider buying one of them but it's quite expensive at the moment.
My girlfriend (now wife) bought me a Wii for my birthday more than 10 years ago so I spent no money for the wiimote. I found a wonderful gun (with a button on the bottom of the butt of the gun, perfect as the action button in Time Crisis) for like $ 18, shipping included, and I had an ebay coupon of $ 12, so I spent like $ 6 for the gun. I also bought the Dolphin bar on Amazon for less than $ 25 (it was a special offer).
So, all my Wiimote/gun/sensor costed me like $ 30, a Sinden gun was about $ 110 last time I checked.

I know that Glovepie is an old and dead program, but it's simple and do what I need.
With the script I wrote the line of sight accuracy is almost perfect, the real problem possibly is the latency, but I don't think it's caused by Glovepie, probably it's a wiimote/dolphinbar/windows drivers issue or a limit of sensor bars technology, but it's not so bad during gaming.
I also added to the script an autofire toggle button and I can play games as Point Blank or Time Crisis without a visible crosshair, thing that I never managed to do with all other script I tried.
The good thing with working with the mouse cursor is that there is no need to adjust any setting. You don't need to mess with MAME in game calibration. I tried the script also with PSX emulators, unfortunately only the old PSXfin works perfectly, but I have very few shooting games on PSX (at the moment only Time Crisis - Poject Titan) so I will not spend time on make it work in other emulators (I briefly tried the nuvee plugin for PCSXR, but it's not that easy and it's too much effort for a single game).

In my script you just have to set a few parameters and you are ready to go:
- Distance of the 2 light dots of the sensor bar in cm (dolphin bar is about 19 cm)
- Width and height of the monitor in cm
- Distance between sensor bar and the actual top of the image frame (I wrote it positioning the sensor bar on top of my monitor)

I wrote the script in like 10 minutes so, at the moment, I just consider the gun in standard vertical position (no gangsta side grip  :laugh2: or tilt allowed) and you can change the distance from the screen without problems. I also consider only the bar at the top of the monitor. With a few more math it's probably easy to add this modifications.
Now I'm in my office but I soon as I have the opportunity I'll attach here the script for anyone who wants to try and possibly improve it.

Thanks again to all  :notworthy: