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 do I recompile Mame for Shifter support?  (Read 3791 times)

0 Members and 1 Guest are viewing this topic.

Zeppo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 165
  • Last login:February 14, 2024, 10:26:44 am
  • Greetings Program!
How do I recompile Mame for Shifter support?
« on: May 02, 2007, 01:46:00 pm »
I bought a happ hi/low shifter for a driving cab I am making.
I have read something about how mame doesn't like these shifters since it's a single button that is either open or held closed.
Also, I read it was fairly simple to recompile, but I must be missing the thread that tells me what I need to change.
Does this still need to be done in .114, and if so, what do I need to do?

Thanks!
« Last Edit: May 03, 2007, 10:08:05 am by Zeppo »
Z

Angry_Radish

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 521
  • Last login:October 24, 2020, 06:36:17 pm
Re: Recompile Mame for Shifter support.
« Reply #1 on: May 02, 2007, 02:51:14 pm »
Try wiring it up using all 3 terminals on the switch, that way depending on the position, one of the two will be closed.

Zeppo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 165
  • Last login:February 14, 2024, 10:26:44 am
  • Greetings Program!
Re: Recompile Mame for Shifter support.
« Reply #2 on: May 02, 2007, 03:40:23 pm »
Ok, maybe I was thinking about this wrong.
Digging through the Pole Position driver, I see a line that says:

- Change POLEPOS_TOGGLE to 0 if you are using the original gearshift.

Ok, so I do a search for POLEPOS_TOGGLE and find a few instances that look like:

PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */

I was thinking I would find a line that said something like POLEPOS_TOGGLE = 1 and then I could change the 1 to a 0.
Butis it telling me I should remove the part where it says POLEPOS_TOGGLE and replace it with a 0 so it would look like:

PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) 0 /* Gear */


?

I'm so confused, and probably making much more difficult than it needs to be.

Thanks.
Z

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: Recompile Mame for Shifter support.
« Reply #3 on: May 03, 2007, 12:21:04 pm »
Ok, maybe I was thinking about this wrong.
Digging through the Pole Position driver, I see a line that says:

- Change POLEPOS_TOGGLE to 0 if you are using the original gearshift....

I was thinking I would find a line that said something like POLEPOS_TOGGLE = 1 and then I could change the 1 to a 0.

I'd change:
#define POLEPOS_TOGGLE   PORT_TOGGLE

to:
#define POLEPOS_TOGGLE   

but the note means change the same to:
#define POLEPOS_TOGGLE   0

FWIW, "#define"s are used so you can make one edit in one place, and all the places that use that macro get the edit when compiled.
Robin
Knowledge is Power

Zeppo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 165
  • Last login:February 14, 2024, 10:26:44 am
  • Greetings Program!
Re: How do I recompile Mame for Shifter support?
« Reply #4 on: May 03, 2007, 06:42:58 pm »
Oh, I see.
I was thinking the # was like a REM

Thanks, I'll give it a try.
Z

Zeppo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 165
  • Last login:February 14, 2024, 10:26:44 am
  • Greetings Program!
Re: How do I recompile Mame for Shifter support?
« Reply #5 on: May 04, 2007, 02:44:03 pm »
Well, I tried compiling it changing the line to read:
#define POLEPOS_TOGGLE   0

It errors out.

Tried it without the 0:
#define POLEPOS_TOGGLE

and it compiles, but doesn't seem to work correctly.
I am testing it with my keyboard, so maybe after I hook up the shifter it will be work correctly?
I test it by holding down the space bar, and while it will shift to HI when I press the space bar, it does not shift back to LOW when I let off.

Thanks!
Z

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: How do I recompile Mame for Shifter support?
« Reply #6 on: May 07, 2007, 04:43:40 pm »
... I tried compiling it ...:
#define POLEPOS_TOGGLE

and it compiles, but doesn't seem to work correctly.
I am testing it with my keyboard, so maybe after I hook up the shifter it will be work correctly?
I test it by holding down the space bar, and while it will shift to HI when I press the space bar, it does not shift back to LOW when I let off.[/quote]

I tried it with this and it works.  IE: in high gear only when space bar is pressed, low only when it's not.  :dunno
Robin
Knowledge is Power

Zeppo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 165
  • Last login:February 14, 2024, 10:26:44 am
  • Greetings Program!
Re: How do I recompile Mame for Shifter support?
« Reply #7 on: May 07, 2007, 09:25:47 pm »
Hmm.. Maybe I didn't save after I changed the polepos driver and recompiled.

I double check tomorrow.

Thanks!
Z

Zeppo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 165
  • Last login:February 14, 2024, 10:26:44 am
  • Greetings Program!
Re: How do I recompile Mame for Shifter support?
« Reply #8 on: May 08, 2007, 12:19:38 pm »
Ok, I recompiled it, and tested it again.
Still not working.
Bashed my brain a few times.

That's when the brilliance struck.

I needed to move the new compiled mame.exe and other files to my mame directory.
 :banghead:

Ok, moved them over.
Then I started getting the error that the rom was missing 54xx.bin
I tried polepos.zip  polepos1.zip and polepos2.zip  and they all said the same thing.
Did a google on the problem, and was told I needed the parent rom.
Well, I thought I had the parent rom.
Hmmm.
Kept looking, and found the 54xx.bin file, moved it to the polepos1.zip and now it works.

 :cheers:
Thanks!
Z

Space Fractal

  • Wiki Master
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1888
  • Last login:September 26, 2023, 11:32:13 am
  • Space Fractal
    • Space Fractal
Re: How do I recompile Mame for Shifter support?
« Reply #9 on: May 09, 2007, 09:43:20 am »
I dosent have the shifther myself, but is it not possible to trick mame to work with these shifter with a utility like AutoHotKey, or are Im completly wrong?
Decade Old Work: MultiFE, ArcadeMusicBox
Today Works: Various Spectrum Next games from Rusty Pixels and html5 games.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 22, 2025, 10:27:17 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: How do I recompile Mame for Shifter support?
« Reply #10 on: May 10, 2007, 12:35:38 am »
I dosent have the shifther myself, but is it not possible to trick mame to work with these shifter with a utility like AutoHotKey, or are Im completly wrong?

Yeah ahk should be able to fix this issue real easily. Basically you'd wire the microswitch to an input other than the shifter default (lets say 'A') and have a varible setup to store it's last state (either on or off) when the current state becomes different than the last state, press the space key once.  So long as the user remembers to put the shifter in the "low" position before launch it'd be fine. 


Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: How do I recompile Mame for Shifter support?
« Reply #11 on: October 26, 2007, 07:35:30 pm »
It seems like some games use one key to control high/low shifting so that when the key is held it's in one gear and when released in another.

Can AHK be used so that a momentary press of a gamepad button will effectively hold a key down?
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: How do I recompile Mame for Shifter support?
« Reply #12 on: June 02, 2008, 02:03:57 pm »
I tried it with this and it works.  IE: in high gear only when space bar is pressed, low only when it's not.  :dunno

I got this working ok last week. But now I am thinking for the sake of consistency it would be nice to have gear input = lo gear, for all games.

However I've been looking aimlessly at source code for a while and I haven't a clue to be honest. Can anyone point me in the right direction??

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: How do I recompile Mame for Shifter support?
« Reply #13 on: June 02, 2008, 05:37:56 pm »
I tried it with this and it works.  IE: in high gear only when space bar is pressed, low only when it's not.  :dunno

I got this working ok last week. But now I am thinking for the sake of consistency it would be nice to have gear input = lo gear, for all games.

However I've been looking aimlessly at source code for a while and I haven't a clue to be honest. Can anyone point me in the right direction??

Are you looking for which games are button down = hi vs = lo?  Or where to switch it?  Or something else?

I have no idea which games at hi when closed, or lo when closed.

If you're wondering where to switch, the easiest, but most hackish is to change the PORT type definition between IP_ACTIVE_HIGH and IP_ACTIVE_LOW.  This should work for almost all games.  But... that would not make it into official mame, and there is a way that probably would.  Much more work: complete the POSITIONAL type code as it was designed to be, and use that type.
Robin
Knowledge is Power

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: How do I recompile Mame for Shifter support?
« Reply #14 on: June 03, 2008, 09:01:25 am »
Are you looking for which games are button down = hi vs = lo?  Or where to switch it?  Or something else?

Yes, just wanted to make them all the same, for the sake of consistency. Some of them in standard mame are gear=lo, and some are gear=lo. I have converted the toggle type, and again, it turns out there are some games lo, some hi.

Quote
I have no idea which games at hi when closed, or lo when closed.

I need to double check this as I realised I had some old cfg files, but I think the following use the gear input as hi:

grchamp
konamigt
polepos/2
stocker

Quote
If you're wondering where to switch, the easiest, but most hackish is to change the PORT type definition between IP_ACTIVE_HIGH and IP_ACTIVE_LOW.  This should work for almost all games.  But... that would not make it into official mame, and there is a way that probably would.  Much more work: complete the POSITIONAL type code as it was designed to be, and use that type.

Changing to positional type, in all honesty is probably beyond my level of knowledge, and I do not expect my changes to get into official Mame.

Thanks for the 'easy' method :) I kindof got this to work by chance another way, by adding 'value="0"' to the gear input section of cfg files for some of these games (polepos & stocker) - I guess this is doing a similar thing.  I will make this change for these games, but it does not work for grchamp & konamigt unfortunately - they are already set to IP_ACTIVE_HIGH, and changing to _LOW doesn't seem to do anything. Any ideas how I might be able to alter these ones?

Thanks again!