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: real virtual mouse or mame joystick absolute mode?  (Read 7217 times)

0 Members and 1 Guest are viewing this topic.

ulao

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:April 23, 2025, 09:02:14 am
real virtual mouse or mame joystick absolute mode?
« on: January 04, 2009, 02:26:05 pm »
Does anyone know of a real virtual mouse driver that is reads joystick moment , not a tool that just moves the mouse. Moving the mouse wont help in mame, I need an actual mouse driver that use a joystick to control it.

or does anyone know how to make mame use a joy stick in absolute mode.


FYI: if needed..

absolute mode: The cursor will appear in relation to the device. ( i.e like a mouse ). There are lots of tool out there that do this but they only move the mouse cursor and mame is looking at a mouse not the cursor

Hope that made sense....   

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: real virtual mouse or mame joystick absolute mode?
« Reply #1 on: January 05, 2009, 12:42:00 pm »
Do you mean a joystick in relative analog?  Analog joysticks usually are absolute, and mice usually relative, and so mame treats them as such, respectively.

Absolute joystick moving cursor: centered joystick = cursor in center of screen, move stick all left = cursor moves all to the left, return stick to center = mouse returns to center.

Relative joystick moving cursor: center joystick means  cursor doesn't move, the farther left the stick moved left makes the cursor move left faster (until it hits the edge of screen, but it's still receiving go left info), re-centered stick stops cursor wherever it got to.


edit: Also, what do you want this for?  There might be different ways around the issue.
« Last Edit: January 05, 2009, 12:43:56 pm by u_rebelscum »
Robin
Knowledge is Power

ulao

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:April 23, 2025, 09:02:14 am
Re: real virtual mouse or mame joystick absolute mode?
« Reply #2 on: January 05, 2009, 05:19:51 pm »
Quote
Do you mean a joystick in relative analog?  Analog joysticks usually are absolute, and mice usually relative, and so mame treats them as such, respectively.
Well so far all of my source said the opposite. Either way I need to do the reverse from the norm..

Quote
Absolute joystick moving cursor: centered joystick = cursor in center of screen, move stick all left = cursor moves all to the left, return stick to center = mouse returns to center.

Relative joystick moving cursor: center joystick means  cursor doesn't move, the farther left the stick moved left makes the cursor move left faster (until it hits the edge of screen, but it's still receiving go left info), re-centered stick stops cursor wherever it got to.
Ok, we are on the same level...

but if you in a game and your "marrio" lets say pushing right goes right, he never returns to the center. Now in the case of arkanoid I would want the paddle back to the center but it acts like mario. Pushing left just makes it go left, I want it to appear in relational to the stick.  I found an app that did this for the mouse cursor and had to set it to absolute to get it right, but MAME reads the mouse, not the cursor so it didnt work.


Quote
edit: Also, what do you want this for?  There might be different ways around the issue.
So there you have it, how do I get absolute mode to work..?

Again for clarification as this is complicated to explain  it seems:  In the game arkonoid if you play with the mouse its 100% perfect. But IMO the mouse is not for gaming. So playing with a joystick its wrong in the sense that I move the joystick right the paddle starts to move WRONG!!! that is not how you play arkonoid LOL.. The paddle on the screen needs to match the position of the joystick location. In my case my joystsick is a dial so it make more sense to me that way.. Just like the NES version of the game that came with a dial.. I can not get mame to see the joystick as a dial to save my life. it only looks at the mouse.

Code: [Select]
joystick    mouse
left           left
right         right
center      center
25% left   25% left
etc...

u_rebelscum , you the first person to understand my problem do you think it can be resolved, thx for you help..

ulao

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:April 23, 2025, 09:02:14 am
Re: real virtual mouse or mame joystick absolute mode?
« Reply #3 on: January 06, 2009, 01:38:14 pm »
OK here is the best I can do to explain.

http://spawnlinux.dyndns.org/tmp/joystick.swf


Can any one do that in mame with a joystick?


« Last Edit: January 06, 2009, 01:40:18 pm by ulao »

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: real virtual mouse or mame joystick absolute mode?
« Reply #4 on: January 06, 2009, 03:25:05 pm »
Alright, that makes total sense, and I know how you're feeling.  This is a mame/ROM issue, on how mame translates an (joystick's) absolute analog data to a game's relative analog data.

Just for background (even though it sounds like you know already, but just in case), the original ROM is programmed to use relative analog input (spinner), and the joystick is absolute analog.  Besides reprogramming the original game (not something approved by mameDev), here are three ways to translate absolute to relative: translate absolute analog to digital left/right and use mame's digitalspeed setting to simulate (fixed speed) relative analog, treat the absolute data as relative (probably scaled down by 10 to 16), or take current absolute value and subtract the prior absolute value to get the true relative change (plus maybe some scaling).

Mame used to only the the first way, but has been able to the second on and off, depending on version number and input mapping.  The third is what you want, and has some big reasons why official mame doesn't do it. 
*The original game isn't coded to use absolute inputs, so there is no way to "center" or "index" the game's location with the joystick's location.  For example, a paddle might not start in the center at the start of the game, or might always start in the middle no matter how the joystick is possitioned.
*The original game isn't coded to use absolute inputs, so scaling probably will be needed so joystick all left = game all left and same with right.
*The original game isn't coded to use absolute inputs, so there's no way to keep the joystick and game calibrated to each other.  This can be effected (both hidder and help) if mouse or left/right key are pressed in the middle of use.
*Some games originally controlled with relative inputs don't work with this method.  For example, Super Sprint or Super Offroad have tracks that turn more left than right and vice versa, so you couldn't complete these tracks with an analog stick translated this way.
*Some people aren't like us and live in a relative world, and don't like this method for any games.  For other not as fixed in relative, either way works okay for them.


I'm not saying it can't be done.  But it will take one of two methods.  Hack mame to translate as you want, or find a deviant of mame that does this; just know that I don't think this will ever make it into official mame.  The other way isn't easier: get a driver so the joystick absolute analog outputs can be seen as relative mouse movements, translated as you described.  For example, the stick moves from center (call it 128,128 assuming 0 to 256 range) to 10% left (call it 115,128), mame sees mouse -13,0 movement, through RawInput API.  The "easiest" way AFAIK is have the joystick treated as a lightgun mouse, which still works in absolute movements, but windows automatically translates to also relative mouse info since 99% of apps assume mouse data is always relative.  Either way, I don't know of any deviant or driver that does either, and you'd need to set mame's sensitivity value for each game you want to play to the correct value, and do any calibration and (ongoing) recalibration as needed.


FWIW, I tried to hack mame with above years ago, but never finished nor got it working even close to my satisfaction, and mame's inputs have changed so much since then that my edits don't fit anymore.
Robin
Knowledge is Power

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: real virtual mouse or mame joystick absolute mode?
« Reply #5 on: January 06, 2009, 03:30:10 pm »
OK here is the best I can do to explain.

http://spawnlinux.dyndns.org/tmp/joystick.swf

Heh, cool flash. :cheers:  I knew what you were talking about from the prior post, but the moving pic will help others understand I hope.
Robin
Knowledge is Power

Xiaou2

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4135
  • Last login:August 01, 2025, 11:49:43 pm
  • NOM NOM NOM
Re: real virtual mouse or mame joystick absolute mode?
« Reply #6 on: January 06, 2009, 04:53:49 pm »
Quote
But IMO the mouse is not for gaming

 Use a "Spinner"  or a  "Trackball"  for arcade control.   A Joystick,
no matter how well you could hack the controls to match... will not
have enough resolution to be very controllable.

 Meaning.. it will be like you have had 1 too many beers when trying to
play.   Or like trying to pick a splinter out of your finger with a backhoe instead
of a set of tweezers.  You just wont have enough control.

 (that... and it wouldnt be very fun/challenging if it did work)

ulao

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:April 23, 2025, 09:02:14 am
Re: real virtual mouse or mame joystick absolute mode?
« Reply #7 on: January 06, 2009, 05:09:16 pm »
 Use a "Spinner"  or a  "Trackball"  for arcade control.   A Joystick,
Quote
no matter how well you could hack the controls to match... will not
have enough resolution to be very controllable.

 Meaning.. it will be like you have had 1 too many beers when trying to
play.   Or like trying to pick a splinter out of your finger with a backhoe instead
of a set of tweezers.  You just wont have enough control.

 (that... and it wouldn't be very fun/challenging if it did work)
- Yes I know that a dial works but I'm not using a joystick. I'm using this..


Regardless of the resolution it work well with other emulators.


So what I gather is it cant be done?

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: real virtual mouse or mame joystick absolute mode?
« Reply #8 on: January 06, 2009, 06:38:14 pm »
A Joystick,
no matter how well you could hack the controls to match... will not
have enough resolution to be very controllable.

They have 10 bit (1024 values) and higher res joysticks.  Rare, most often home built or hacked, yes, but high enough for hitting every position even in arkanoid.  For example, the u-hid is 12 bit (4096) capable, and mame can handle this res. (Most arcade games don't, but mame scales down just fine.)

Of course you need high quality POTs or Hall Effect sensors, or the encoder is higher res than the signal it's getting, but these exist too.  I don't follow this area much, but any flightsim BYO control forum should have lots of info on these stuff.



I'm not using a joystick. I'm using this..


What is that?  A paddle?  Does it have only left/right twist, or up/down too?  (If so, how?)  I'm assuming it's seen as a joystick with once axis?  Is it USB, or is it going through an adapter?

If the product is still on the market and is USB, I'd try talking to the manufacturer and see if they can make a driver they makes windows see it as an absolute mouse that a fully turned left puts the cursor on the left edge of screen, centered paddle = cursor in center. and full right puts cursor on right edge of screen as we've discussed.

So what I gather is it cant be done?

I didn't say that, I said hard to do, and hard to keep calibrated to game.  If you know someone who's good with writing mouse drivers, they might be able to do it pretty easily (if it's native USB); it's beyond my ability, though.
Robin
Knowledge is Power

ulao

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:April 23, 2025, 09:02:14 am
Re: real virtual mouse or mame joystick absolute mode?
« Reply #9 on: January 06, 2009, 08:06:39 pm »
dup.
« Last Edit: January 06, 2009, 08:14:36 pm by ulao »

ulao

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:April 23, 2025, 09:02:14 am
Re: real virtual mouse or mame joystick absolute mode?
« Reply #10 on: January 06, 2009, 08:07:12 pm »
Quote
What is that?  A paddle?  Does it have only left/right twist, or up/down too?  (If so, how?)  I'm assuming it's seen as a joystick with once axis?  Is it USB, or is it going through an adapter?
It is an n64 joystick. and I'm uning a n64 adapter I built to allow n64 to usb. It has 5000 levels negative and positive in the x and y axis. I belive it was made for racing style games and I will admit it works well there.

It allows the x_axis with the dial and underneath it has a y_axis throttle.  All of the buttons on the 64 are on it. this is seen as a HID.

but in short its just a joystick.

I remember back in the 80s when I first plaid arkanoid on the nes. It cam with a dial in the box. This is the same thing just a bit bigger. So the first thing I though of was hmmm I wonder if I can make mame use this like the nes did... This is the only reason I want to do such a thing..


Quote
If the product is still on the market and is USB, I'd try talking to the manufacturer and see if they can make a driver they makes windows see it as an absolute mouse that a fully turned left puts the cursor on the left edge of screen, centered paddle = cursor in center. and full right puts cursor on right edge of screen as we've discussed.
I dont have that option as it was ment for the 64. This is why I asked if a joystick would work in absolute mode on mame.

I appreciate your feed back but I'm not interested in an alternative game pad, nor changing the joystick it's self. All I want is to find a way to get mame to do what I can do with a joy2mouse app.

Quote
I didn't say that, I said hard to do, and hard to keep calibrated to game.  If you know someone who's good with writing mouse drivers, they might be able to do it pretty easily (if it's native USB); it's beyond my ability, though.
- Sounds interesting but I was referring to MAME.

"So what I gather is it cant be done?" - In other words there is no way to get mame to treat a joystick in absolute. Or there is no way to get mame to think my joystick is a mouse. or as you responded to.. there are no virtual drivers that show up as a mouse and allow movement via joystick that anyone knows of.
« Last Edit: January 06, 2009, 10:52:32 pm by ulao »

Popcorrin

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:March 06, 2022, 11:11:43 am
Re: real virtual mouse or mame joystick absolute mode?
« Reply #11 on: January 07, 2009, 12:07:35 am »
U_rebelscum's knowledge of analog inputs and the mame's input system is scary.  :o

A while back I had the same idea ulao had but kind of forgot about it.   
I remember some old laptops used to have a stick on them for the mouse, but I can't remember if the cursor just moved the direction you moved the stick or if the cursor position represented the stick position? 

ulao

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:April 23, 2025, 09:02:14 am
Re: real virtual mouse or mame joystick absolute mode?
« Reply #12 on: January 07, 2009, 11:00:56 am »
Your thinking of the IBM style mouse IBM Trackpoint  control. Funny you say that I was just thinking about that the other day. It is the opposite of what I'm trying to do. It basically was a joystick.