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: How to select controllers based on orientation?  (Read 1406 times)

0 Members and 1 Guest are viewing this topic.

Sam66

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:August 29, 2003, 05:10:55 am
  • I'm a llama!
How to select controllers based on orientation?
« on: December 30, 2003, 05:34:27 am »
I've built a cocktail with controllers for 2 players on the vertical side and 2 on the horizontal side.

I'm running mame32 (0.77) and XP and I've set up the auto rotation which works great.

Is there any way to automatically select controls based on orientation or do I really have to go through all the horizontal games and reconfigure them?

J_K_M_A_N

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 983
  • Last login:July 08, 2025, 08:22:37 am
Re:How to select controllers based on orientation?
« Reply #1 on: December 30, 2003, 11:16:02 am »
Why don't you just wire both player 1's and player 2's to the same inputs on the encoder? I know it involves risk of someone messing up your game by pressing the joystick on the side you aren't using but... Otherwise you could hook up a switch to break the gound for one side or the other. That way only one side would work at a time. Good luck.

J_K_M_A_N

Sam66

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:August 29, 2003, 05:10:55 am
  • I'm a llama!
Re:How to select controllers based on orientation?
« Reply #2 on: December 30, 2003, 11:28:56 am »
I did think about that, but if I can do it with software then I will still be able to play 3 and 4 player games.

I'm sure I've seen someone's set up the same as mine (but actually working) but I can't remember who's it was.

Guess I'll have to trawl through the examples.

J_K_M_A_N

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 983
  • Last login:July 08, 2025, 08:22:37 am
Re:How to select controllers based on orientation?
« Reply #3 on: December 30, 2003, 11:44:32 am »
If that is the case, you could change Input (All Games) and set player 1 and 2 controls to both sets of controls and then go in and change Input (This Game) for 3 and 4 player games. I would guess there would be a lot less of those to change. Good luck.

J_K_M_A_N

Sam66

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:August 29, 2003, 05:10:55 am
  • I'm a llama!
Re:How to select controllers based on orientation?
« Reply #4 on: December 30, 2003, 11:53:48 am »
Now why didn't I think of that ?

Thanks for your help J_K_M_A_N

Rocky

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 562
  • Last login:December 30, 2009, 12:38:41 pm
  • I want to finish my cab before I retire!!
Re:How to select controllers based on orientation?
« Reply #5 on: December 30, 2003, 05:52:51 pm »
Sam66,

Check out Smack's web site.  I think he's the one you're thinking about.


Rocky

Sam66

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:August 29, 2003, 05:10:55 am
  • I'm a llama!
Re:How to select controllers based on orientation?
« Reply #6 on: December 31, 2003, 06:07:21 am »
That's the one I was thinking of.

Here's the link for anyone interested:

http://www.smacksville.com/

But, basically he did what J_K_M_A_N suggested; so that looks like the way to go.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How to select controllers based on orientation?
« Reply #7 on: January 01, 2004, 10:19:48 am »
Use crtrl files with NoNameMame or my ctrlr file hacks.  I have a horizont.ini and vertical.ini ctrlr files.

Sam66

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:August 29, 2003, 05:10:55 am
  • I'm a llama!
Re:How to select controllers based on orientation?
« Reply #8 on: January 02, 2004, 06:19:33 am »
SirPoonga can you explain how I would go about using your ctrl file hacks ?

I tried setting up as J_K_M_A_N suggested but it doesn't entirely work.  I'm using a 4 player ipac set to 'mame' and it seems that when configureing the controls, mame itself can't recognise some of the special control characters used on players 3 and 4.  I could move the jumper on the ipac and reprogram the inputs but I'm trying to get things done as easily as possible : )  My ipac is not the easiest thing to get to as it's crammed in a little gap next to the monitor and under a speaker.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How to select controllers based on orientation?
« Reply #9 on: January 02, 2004, 10:57:13 am »
Ok, lets assume and simplify the issue by saying you have 2 buttons per player.
First, grab NoNameMame.  He incorporated my hacks.  If you don't want to use that you are going to have to compile your own mame.

ok, in thi diagram players are labelled, from left to right, player 1, player 3, player 4, player 2.
P1J would be the player 1joystick, P1B1 is player 1 button 1.


      |----------------------------|
 P1J  |                            | P2B2
      |                            |
 P1B1 |                            | P2B1
      |                            |
 P1B2 |                            | P2J
      |----------------------------|
       P3J P3B1 P3B2  P4J P4B1 P4B2


Now let's assume the buttons are assigned to these keys:
P1B1    KEYCODE_A
P1B2    KEYCODE_S
P2B1    KEYCODE_Z
P2B2    KEYCODE_X
P3B1    KEYCODE_D
P3B2    KEYCODE_F
P4B1    KEYCODE_C
P4B2    KEYCODE_V

Note these are the phyisical representations on how they are hooked up.  Not how we will be using them in mame.  you actually gotta think of the buttons on your cabinet by their keycode, not by which is player 1 button 1.


If you don't know how to use ctrlr files is the quick and dirty way of doing this.  To learn more about ctrlr files read the doc folder in mame.

Since you will be using my hack (or NoNameMame which has my hack) you will do this:
1) in the ctrlr folder of mame make a folder called cabinet
2) in the mame.ini file edit these two lines
ctrlr                   cabinet
ctrlr_directory         ctrlr   (make sure this is pointing to the mame/ctrlr folder)
3) in the cabinet folder you just made create a horizont.ini and vertical.ini.  (actually you could create a default.ini which will be the default vertical setup and a horizont.ini also)
4) vertical.ini will look like this (at least for the buttons, put in joysticks simularly)


P1_BUTTON1              "KEYCODE_A"
P1_BUTTON2              "KEYCODE_S"
P2_BUTTON1              "KEYCODE_Z"
P2_BUTTON2              "KEYCODE_X"
P3_BUTTON1              "KEYCODE_D"
P3_BUTTON2              "KEYCODE_F"
P4_BUTTON1              "KEYCODE_C"
P4_BUTTON2              "KEYCODE_V"


4) horizont.ini will look like this (at least for the buttons, put in joysticks simularly)


P1_BUTTON1              "KEYCODE_D"
P1_BUTTON2              "KEYCODE_F"
P2_BUTTON1              "KEYCODE_C"
P2_BUTTON2              "KEYCODE_V"


I assume we don't need to list player 3 and 4 here as they probably won't be used in this orientation.


Now, whenever you play a horizontal game the horizontal side will be mapped to player 1 and player 2.  When you play vertical the vertical sides will be player 1 and player 2 while the horizonal side will be player 3 and player 4.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How to select controllers based on orientation?
« Reply #10 on: January 02, 2004, 10:59:19 am »
I tried setting up as J_K_M_A_N suggested but it doesn't entirely work.  I'm using a 4 player ipac set to 'mame' and it seems that when configureing the controls, mame itself can't recognise some of the special control characters used on players 3 and 4.  I could move the jumper on the ipac and reprogram the inputs but I'm trying to get things done as easily as possible : )  My ipac is not the easiest thing to get to as it's crammed in a little gap next to the monitor and under a speaker.

I believe the ipac only has defaults setup for player 1 and 2.  I don;t think there are defaults setup for player 3 and 4.  You will need to program your ipac.  BTW, I highly suggest you program the ipac anyway.  There are button combos that could be pushed that will screw up your games.  Especially since alt and ctrl are mapped.

Sam66

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:August 29, 2003, 05:10:55 am
  • I'm a llama!
Re:How to select controllers based on orientation?
« Reply #11 on: January 02, 2004, 11:15:48 am »
Thanks for typing all that out : )  I've printed it and will read it through carefully later.

Like you say, I think I should reprogram the ipac keys.