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: Mouse wheel as spinner in MAME?  (Read 10729 times)

0 Members and 1 Guest are viewing this topic.

NoBonus

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:January 07, 2007, 06:48:58 pm
  • "Now that's a fine example of California's Gold"
Mouse wheel as spinner in MAME?
« on: March 13, 2005, 01:50:18 am »
A two-fold question: can a mouse-wheel (the wheel between the two buttons) be used in MAME as a spinner? If so, can it be hacked into a spinner?

Thanks!

Andrew

sodapopinski

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 325
  • Last login:February 12, 2011, 11:13:41 am
  • if I only had normal friends
Re: Mouse wheel as spinner in MAME?
« Reply #1 on: March 13, 2005, 05:22:38 am »
well, you woluld like to hack the mouse and attach a spinner? If you need to buy a spinner, well...... or you want to buy a pot? or mount the mouse spinner itself? your best off buying an oscar spinner. You probably can't get the same control off the mouse.  but what do i know, i'm drunk.

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3165
  • Last login:June 17, 2025, 04:07:55 pm
  • Who the heck is that?
Re: Mouse wheel as spinner in MAME?
« Reply #2 on: March 13, 2005, 11:31:02 am »
My understanding is that the "scroll wheel", or Z-axis on a mouse has much lower resolution than the x & y axes, so I would think it would work poorly.  But I've never tried it, so maybe I should just shut up.

Mario

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 278
  • Last login:March 29, 2021, 08:55:12 pm
  • Mmmmm.....arcades!
    • Mario's Arcade Page
Re: Mouse wheel as spinner in MAME?
« Reply #3 on: March 13, 2005, 02:05:54 pm »
My guess would be "no" unless one writes custom mouse drivers. The mouse wheel is not recognized by Windows as mouse movements. Windows will intercept the wheel movements before the application can process them.

Mario

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3165
  • Last login:June 17, 2025, 04:07:55 pm
  • Who the heck is that?
Re: Mouse wheel as spinner in MAME?
« Reply #4 on: March 13, 2005, 10:08:54 pm »
My guess would be "no" unless one writes custom mouse drivers. The mouse wheel is not recognized by Windows as mouse movements. Windows will intercept the wheel movements before the application can process them.

Mario


MAME will allow input from the "Z-axis" now, so you could use it.  The problem is that the resolution on the scroll wheel is too low.

NoBonus

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:January 07, 2007, 06:48:58 pm
  • "Now that's a fine example of California's Gold"
Re: Mouse wheel as spinner in MAME?
« Reply #5 on: March 13, 2005, 11:13:50 pm »
Why would the resolution be any different than the X or Y axis?  Any would the resolution really be too bad for mame games?  If it can be used, a single mouse-hack could control the spinner and trackball... just a thought.

tmasman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:January 04, 2024, 03:50:44 pm
  • Hello...
    • My (no so up to date) Home
Re: Mouse wheel as spinner in MAME?
« Reply #6 on: March 13, 2005, 11:22:07 pm »
I'm currently in the process of hacking a mouse (MS Intellimouse) & was thinking the same thing...
The mouse wheel is just another optical sensor with a encoder wheel...

Of course it's got lower resolution... It's got fewer teeth on the wheel... Not a problem for a hack though.

I'll have to see what happens... (I don't have a spinner yet, so don't wait on me for anything...)

- tmasman
I'm not a freak!...
Oh wait...
Yes I am...

NoBonus

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:January 07, 2007, 06:48:58 pm
  • "Now that's a fine example of California's Gold"
Re: Mouse wheel as spinner in MAME?
« Reply #7 on: March 13, 2005, 11:38:40 pm »
I guess a simple test is in order.  Someone should use their wheel-mouse wheel in mame for the spinner function (but while still part of the mouse).  Seems like that simple test should tell us if it works or not... right?

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: Mouse wheel as spinner in MAME?
« Reply #8 on: March 14, 2005, 01:58:02 am »
I guess a simple test is in order.  Someone should use their wheel-mouse wheel in mame for the spinner function (but while still part of the mouse).  Seems like that simple test should tell us if it works or not... right?

Mame needs 4 lines added for the scroll wheel to work.  I just submitted diff to mameDev.

Attatched is a diff.  Add same as mame's u# diffs.
Robin
Knowledge is Power

elvis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1154
  • Last login:January 13, 2025, 08:48:40 am
  • penguin poker
    • StickFreaks
Re: Mouse wheel as spinner in MAME?
« Reply #9 on: March 14, 2005, 02:37:10 am »
Why would the resolution be any different than the X or Y axis?  Any would the resolution really be too bad for mame games?  If it can be used, a single mouse-hack could control the spinner and trackball... just a thought.

As I sit here and view this page, I scroll my mouse wheel back and forth.  The page does tend to "jump" rather than glide slowly up and down, but that could well be the physical wheel itself (there seems to be notches or points at which the wheel "clicks" into place) rather than the input resolution of the wheel.

Still, I'll be interested to see what comes of the above diff, and the experiments following.

tmasman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:January 04, 2024, 03:50:44 pm
  • Hello...
    • My (no so up to date) Home
Re: Mouse wheel as spinner in MAME?
« Reply #10 on: March 14, 2005, 09:18:55 am »
As I sit here and view this page, I scroll my mouse wheel back and forth.  The page does tend to "jump" rather than glide slowly up and down, but that could well be the physical wheel itself (there seems to be notches or points at which the wheel "clicks" into place) rather than the input resolution of the wheel.

This is also because the encoder wheel only has half the number of slots in it... The blades & cuts are much wider... So instead of maybe 20 "changes" per revolution, you're only getting 10.  The clicking feeling of the wheel is inconsequential to the functionality... It's just that way for the "feel". Some wheels do not have this feel, & actually work much smoother (on-screen).

I'm going to try & finish up my hack tonight... I'll see if I can use the "Z" axis for one of the trackball axis.

- tmasman
I'm not a freak!...
Oh wait...
Yes I am...

tmasman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:January 04, 2024, 03:50:44 pm
  • Hello...
    • My (no so up to date) Home
Re: Mouse wheel as spinner in MAME?
« Reply #11 on: March 14, 2005, 09:23:04 am »
Mame needs 4 lines added for the scroll wheel to work.  I just submitted diff to mameDev.

Attatched is a diff.  Add same as mame's u# diffs.

It sounds like you're saying that MAME won't support the "Z" axis out-of-the-box... Say it ain't so...

I'm not too keen on compiling C, or I'd try your diff...

Hm... Must     find    a    way...

This would solve a lot of peoples' problems with spinner & trackball not working together, or having 2 hacks, etc...
I'm not a freak!...
Oh wait...
Yes I am...

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: Mouse wheel as spinner in MAME?
« Reply #12 on: March 14, 2005, 02:09:48 pm »
As I sit here and view this page, I scroll my mouse wheel back and forth.  The page does tend to "jump" rather than glide slowly up and down, but that could well be the physical wheel itself (there seems to be notches or points at which the wheel "clicks" into place) rather than the input resolution of the wheel.

Not that simple.  The page jumping has to do with a mouse setting on wheel on number lines to jump.  (Specific name varies depending on driver.)

Usually, but not always, one wheel's step (click) = one blade & cut (notch) = number of lines jumped as set in mouse setting.  But as said, this isn't a set rule, and a few (far too few, IMO) don't click.  I scroll so much normally, the non-smooth wheel clicks tire my finger;  I very much prefer the smooth rolling wheels.

Also, some wheels are so one click > one notch, while others are the opposite (need multiple clicks for a notch to be sensed).

Then, some drivers are set so it takes multiple notches before it does one of the page scroll jumps.

So it could be the wheel's resolution, the resolution to click ratio, the driver setting, and/or the mouse scroll setting. ;D


It sounds like you're saying that MAME won't support the "Z" axis out-of-the-box... Say it ain't so...

Mame doesn't . . . yet.  Hopefully the changes will be included in the next version, and make it ain't so.  ;D If you can't get it working on your own by then, no problems.

And adding diffs and compiling is fairly easy.  (Hmm, was going to link, but the ones I know are a little out of date; anyone have an up to date one?)
Robin
Knowledge is Power

NoBonus

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:January 07, 2007, 06:48:58 pm
  • "Now that's a fine example of California's Gold"
Re: Mouse wheel as spinner in MAME?
« Reply #13 on: March 14, 2005, 02:42:32 pm »
I wonder if there are mice with higher resolution wheels? Hmm...

tmasman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:January 04, 2024, 03:50:44 pm
  • Hello...
    • My (no so up to date) Home
Re: Mouse wheel as spinner in MAME?
« Reply #14 on: March 14, 2005, 04:29:05 pm »
I wonder if there are mice with higher resolution wheels? Hmm...

Yes...
There are even mice with 2 scroll wheels... (Horiz & vert)

Wait a second..........
If you patched MAME you could probably even drive 2 trackballs with 1 mouse...
ooooooohhhhh....
I'm not a freak!...
Oh wait...
Yes I am...

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: Mouse wheel as spinner in MAME?
« Reply #15 on: March 14, 2005, 06:08:59 pm »
There are even mice with 2 scroll wheels... (Horiz & vert)

Wait a second..........
If you patched MAME you could probably even drive 2 trackballs with 1 mouse...

But directX directInput (which mame uses) still only has three axes. 

I have a cheap compaq optical mouse+trackball with four axes.  I don't know how the fourth (horizontal) axis is handled in normal windows datawise; I don't seem to be able to see it in directInput.
Robin
Knowledge is Power

tmasman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:January 04, 2024, 03:50:44 pm
  • Hello...
    • My (no so up to date) Home
Re: Mouse wheel as spinner in MAME?
« Reply #16 on: March 14, 2005, 09:20:35 pm »
But directX directInput (which mame uses) still only has three axes. 

I have a cheap compaq optical mouse+trackball with four axes.  I don't know how the fourth (horizontal) axis is handled in normal windows datawise; I don't seem to be able to see it in directInput.

Bummer...
That's what I get for thinking before thinking...
uh... Did that make any sense? ???
I'm not a freak!...
Oh wait...
Yes I am...

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3165
  • Last login:June 17, 2025, 04:07:55 pm
  • Who the heck is that?
Re: Mouse wheel as spinner in MAME?
« Reply #17 on: March 15, 2005, 01:09:02 am »
Mame doesn't . . . yet.  Hopefully the changes will be included in the next version, and make it ain't so.  ;D If you can't get it working on your own by then, no problems.

I thought for sure I had read somewhere that it was already useable- was it previously enabled in a custom MAME build or something?

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: Mouse wheel as spinner in MAME?
« Reply #18 on: March 15, 2005, 11:17:04 pm »
Mame doesn't . . . yet.  Hopefully the changes will be included in the next version, and make it ain't so.  ;D If you can't get it working on your own by then, no problems.

I thought for sure I had read somewhere that it was already useable- was it previously enabled in a custom MAME build or something?

I probably said something to the effect, "Mame added some mouse Z axis code, I think it should work" back around 0.84-0.85 when the inputs were changed.   :-X

Ah well, it's mote now, Z axis now works as of mame 0.94u3. (tested winXP)
Robin
Knowledge is Power

tmasman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:January 04, 2024, 03:50:44 pm
  • Hello...
    • My (no so up to date) Home
Re: Mouse wheel as spinner in MAME?
« Reply #19 on: March 16, 2005, 08:35:44 am »
I probably said something to the effect, "Mame added some mouse Z axis code, I think it should work" back around 0.84-0.85 when the inputs were changed.   :-X

Ah well, it's mote now, Z axis now works as of mame 0.94u3. (tested winXP)

Will the diff you attached above work with older versions of MAME?
I'm not a freak!...
Oh wait...
Yes I am...

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: Mouse wheel as spinner in MAME?
« Reply #20 on: March 16, 2005, 07:39:15 pm »
Will the diff you attached above work with older versions of MAME?

With zero testing, I'm going to guess back until ~0.86 it'll work. 
Anything before 0.84 I'm guessing is a no.

I'll test tonight after I get home.
Robin
Knowledge is Power

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: Mouse wheel as spinner in MAME?
« Reply #21 on: March 16, 2005, 07:53:41 pm »
I would really like to see the answer for this :)  BYO spinner, buy a trackball, only need one mouse :)  I also second that smooth mice are better to work with.  I had a logitech mouse and the first day I got it, I opened it up and removed the springs and metal crap from inside the wheel.  Now it's nice and smooth :D  That's gonna be my mouse to hack.  For the record, I have my mouse in Windows set so that one click of the wheel jumps three lines.

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: Mouse wheel as spinner in MAME?
« Reply #22 on: March 17, 2005, 02:07:54 am »
Okay, after some very quick tests, I'm not very pleased with the scroll wheel as an input.  However it looks like it might vary on the mouse and the mouse driver; even so, I think it'll be hard to find a good mouse.  An other possibility might include some ugly mame hacks. :-\


First off, I tested only three unhacked mice, with their default drivers, and used the "scroll wheel".  One wheel had a mechincal encoder, another has a optiomachincal wheel geared so one bump while turning the scroll wheel equaled one gap passing the sensor, the third was a "scroll trackball" with optiomachanical encoder wheels like normal TBs, with "two" scroll directions.  I set the mouse settings to scroll 1 line in windows (shouldn't make a difference for most drivers), mame's digital speed to 1, and left the accelleration at default.  I tested arkanoid.

On the two normal scroll wheels, the arkanoid paddle jumped quite a bit at each bump.  I believe this is due to a default step (or granularity) much greater than one (1) of the normal mouse axes.

The scroll TB was a little different.  First, both vertical and horizontal are seen as moving the Z axis in mame.  However, in windows I can't scroll diagonally: it's either scroll straight up-down or straight left-right, depending on which of the two the ball is roll the most.  So either the driver is splitting and filtering the HorScroll and the VertScroll from a mixed Z axis, or the chip in the mouse is filtering it first and somehow sending on the Z axis a different signal depending on which Vert or Hor it's getting the most of.  (I think it's the chip doing the V-H filtering, and the driver decoding.)

Now vertical scrolling the TB jumps just like the wheels.
However, horizontal scrolling acted differently.  It would jump forward about 1/2 as far as the other jumps, jump back past the original position, and then jump forward not as far as before, jump not as far, ect  for about 3-6 frames, ending about where it should be if it were a normal mouse axis turned as much.  IOW, if it didn't wiggle back and forth like it does, it would be perfect.  :P

That said, IIRC it might be possible to decrease the step the mice are sending with directInput inside mame, if the mouse and driver let it.  Again, this might vary from mouse to mouse and driver to driver.


tmasman,
As for applying the diff, I was able to do it to 0.85, and the code looks like ir should fit, but I don't have the old compile stuff set up anymore, so I wasn't able to compile (didn't get that far).  I hope someone else tries it and reports back, instead of me reinstalling the old stuff. Thanks :)
Robin
Knowledge is Power

tmasman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:January 04, 2024, 03:50:44 pm
  • Hello...
    • My (no so up to date) Home
Re: Mouse wheel as spinner in MAME?
« Reply #23 on: March 17, 2005, 08:39:40 am »
Not a problem u_rebel.
I appreciate your efforts.

I'll be playing aroung with my mouse hack when I get a chance... But I'm not holding my breath.

It was a nice thought... no? :-\
I'm still not giving up yet...
I'm not a freak!...
Oh wait...
Yes I am...

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: Mouse wheel as spinner in MAME?
« Reply #24 on: March 18, 2005, 03:07:10 pm »
Did a little more research, and the default is that one notch = 120 movement units on the X and Y axis.  "The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution wheels in the future, including perhaps a freely-rotating wheel with no notches." (msdn

So a quick hack could be to divide the z axis by 120 (or 60 or 40 etc).  But then the advanced mice with the finer-resolution scroll wheels will lose their finer resolution.

I'll look more into this.
Robin
Knowledge is Power