Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Advmame & Marble Madness trackball @45 degrees



  • You can also just keep those controllers to play Q*bert :)
    Kidding, it's the only other game I know with controllers mounted 45°
    Wondering how it could render with trackballs...



  • I think you would replace p1_stickx and p1_sticky with the appropriate control, like p1_trackballx and such.

    If I was at home, I think I could get this figured out in about 10 minutes of testing.



  • @shrunkenmaster Ok, so I proved the concept with the following lines in my advmame.rc file:

    marble/input_map[p1_trackballx] mouse[0,x] mouse[0,y]
    marble/input_map[p1_trackbally] mouse[0,x] -mouse[0,y]
    

    This effectively rotated my trackball control 45 degrees for Marble Madness. Let's break it down:

    First, both lines start with a rom prefix marble/. Why did I do this? Well, on my cabinet, I don't want every game to play this way--I am only testing this with one ROM, so I added the prefix which allows me to keep my existing trackball input lines as-is while I test these additional lines that will override for this ROM only.

    Next, we are configuring the controls for [p1_trackballx] and [p1_trackbally], each on their own line. For the original post, I would expect you would need another pair of inputs for [p2_trackballx] and [p2_trackbally] (player 2).

    Next, the mouse values are the references to the actual mouse sending the raw inputs. In my example, it is mouse[0,x] and mouse[0,y] which is basically the X,Y axes of my trackball. You will need to figure this out for your setup by following all of the configuration details in the wiki first. Assuming you know what mouse represents each trackball, you can assign the appropriate index to
    player 1 and 2.

    Finally, and this is the subtle part that looks like a typo but isn't--the inputs combine both the X and Y on each line, but on one of them, one of the mouse axes are inverted with the - (minus sign) in front. This mixing of inputs is effectively defining the mouse inputs such that, to move in one cardinal direction, you need BOTH axes to be changing. To move in the opposite direction, it is the inverse of one of them.

    Now, here's the catch: it was trivially easier for me to rotate my trackball inputs arbitrarily this way than it would be to specifically rotate them in a direction of my choosing. It will require a little trial and error for you to UN-ROTATE your trackballs. The key will be where you place the minus sign. Do you put it on trackballx? trackbally? Do you put it on the mouse X, or mouse Y? I don't know, but you have 4 choices, so you can figure that out easily I should think.

    So, there you go. I think with just two input lines per trackball, you can rotate your input (or rather, UN-rotate) 45 degrees, provided you already have the inputs configured properly. And if you want to play other games with your rotated trackballs (two player Rampart!), just make these lines your default trackball inputs by removing any others in the config file, and leave off the ROM prefix.



  • @caver01 Thanks for the update, will give it a go after work today and post the results.



  • Well, all I can say is THANK YOU - I now have both trackballs rolling correctly! Here's what worked for me:

    marble/input_map[p1_trackballx] mouse[1,x] -mouse[1,y]
    marble/input_map[p1_trackbally] mouse[1,x] mouse[1,y]
    marble/input_map[p2_trackballx] mouse[0,x] -mouse[0,y]
    marble/input_map[p2_trackbally] mouse[0,x] mouse[0,y]
    

    Now I can crack on with finishing the cab :)



  • @shrunkenmaster That's awesome!

    @AlexMurphy Sometimes a software solution is better than a hardware one. ;-)


  • Banned

    @caver01 True! If anyone could sort this I knew it was you. I was going to tag you but I knew you would see it and help anyway in your own time. Well done.



  • @AlexMurphy Thanks. Well, it wasn't my first thought, I must admit. The recompile would have been a PITA. This is much better. Still, even though I primarily focus on lr-mame2003 as a default (even for trackball/spinner games now) I am continuously impressed with the matrix input capabilities of AdvanceMAME. It may be the only version we have that would allow two-player dual trackballs. Not only that, but you can mix the inputs like we have here?! The input control is pretty amazing. I only wish it could leverage retroarch shaders!



  • @shrunkenmaster

    I have the exact same problem, I'm curious can this fix of rotating 45° the trackballs via software be handled when using MAME 2003 / Libretro ?! If not worst case I guess I'll need to use Advance MAME but prefer to use MAME 2003.



  • How do I do this in advmame ? I'm confused as to where to input this text:

    marble/input_map[p1_trackballx] mouse[1,x] -mouse[1,y]
    marble/input_map[p1_trackbally] mouse[1,x] mouse[1,y]
    marble/input_map[p2_trackballx] mouse[0,x] -mouse[0,y]
    marble/input_map[p2_trackbally] mouse[0,x] mouse[0,y]

    "advmame.rc" where is this file so I can locate and modify it using notepad++ and WinSCP ?!



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.