Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: Lecithin on October 28, 2010, 09:37:11 am

Title: 1 Coin 2 Credits... ideas?
Post by: Lecithin on October 28, 2010, 09:37:11 am
Hello,
My high school students build a MAME cabinet as an engineering projects. They designed and built it from scratch (they even build the computer!) and now it's to the point where it's working in all it's glory (well almost). We're putting the finishing touches on.

Here's my problem, I want to use the machine as a reward system, let the kids use it in their free time, and as a basis for lectures (electrical, design, etc). One of the things I want to do is make 1 coin give two credits in all games (for the reward system). This allows me to have some control over the system w/out being force to babysit the keyboard (and I can keep the back closed up!).

For some games I can simply adjust the dip switches (38 games done like that thus far) but some games don't have dip switches in MAME, some do but don't have the option to manipulate credits, etc etc. I also can't simply register all games as 1 coin 2 credits because games like NBA Jam need more credits then say a game like Pac-Man. Well, I want to make it so that ALL games give you approximately the same play time with 1 coin.

How can I do this? I've tried dip switching as many games as I can and I don't mind going game by game (as there will only be approx 125 games) but I need the know how/software. Any thoughts?

Thanks for the help, the students and I are incredibly grateful!
Title: Re: 1 Coin 2 Credits... ideas?
Post by: headkaze on October 28, 2010, 09:43:01 am
You can write an AutoIt or AutoHotkey script to insert another coin by sending the coin key (probably after a delay). The problem is newer versions of MAME use RawInput and you can't easily send keystrokes to it. The easiest way around this is to compile MAME with the following #define set in src\osd\windows\input.c to force it to use DirectInput.

Code: [Select]
#define FORCE_DIRECTINPUT    1
Title: Re: 1 Coin 2 Credits... ideas?
Post by: wxforecaster on October 28, 2010, 10:23:04 am
You can write an AutoIt or AutoHotkey script to insert another coin by sending the coin key (probably after a delay). The problem is newer versions of MAME use RawInput and you can't easily send keystrokes to it. The easiest way around this is to compile MAME with the following #define set in src\osd\windows\input.c to force it to use DirectInput.

Code: [Select]
#define FORCE_DIRECTINPUT    1

headkaze,

I would consider myself a pretty advanced programmer (and thus AHK scripter), but a MAME noob. I am in the planning/design stages of my cab, and would like to be able to use AHK extensively --- case in point the script I wrote in a recent thread to utilize a single button as pause/exit based on press vs. hold. With that said, I have read here as well as on the HyperSpin forums (which utilizes AHK) that forcing Direct Input will somehow break MAME's capability to interpret multiple inputs (mice, keyboards, guns, etc...). I have not wrapped my head around to what extent this would impact CP design and future planning, and was hoping you could provide some ley-term specifics as to what the truth/reality is.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lecithin on October 28, 2010, 10:45:11 am
erm... this is a bit over my head, I'll study it to the best of my ability but I'm not sure I'm it's in my capabilities.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: headkaze on October 28, 2010, 11:11:20 am
You're right, without RawInput MAME cannot use multiple mouse or keyboards. This is only a problem if you plan on using 2 keyboards or mice at the same time.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: HaRuMaN on October 28, 2010, 11:15:37 am
Why not just give the kids 2 coins?  :P
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lecithin on October 28, 2010, 11:24:41 am
Why not just give the kids 2 coins?  :P

Because if they select NBA Jam (example) or something I've gotta hand them quite a bit m ore than a game like pac man
Title: Re: 1 Coin 2 Credits... ideas?
Post by: ptinolv on October 28, 2010, 04:32:31 pm
I don't know if this works, but you could map a single physical slot to both player 1 and 2 coins in Mame. Like that when you put a coin it will credit twice (most games share the credits but it would only work for 2 players game).
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Donkbaca on October 28, 2010, 07:29:03 pm
I figured it out!  google, or look for "usb timer control board" on ebay.

here is a link:
http://cgi.ebay.com/USB-Time-timer-Control-Board-Power-Supply-kiosk-cafe-/250656126583?pt=LH_DefaultDomain_0&hash=item3a5c44f677 (http://cgi.ebay.com/USB-Time-timer-Control-Board-Power-Supply-kiosk-cafe-/250656126583?pt=LH_DefaultDomain_0&hash=item3a5c44f677)

its a timer that you can hook up to your coin mech.  You can set the time for whatever you want it to be.  Then you can maybe mount the little display on the CP that counts down the time.  You can set it up so that each coin gives you, say, 5 minutes or something like that.  After that time, from what I gather, it will disable whatever you have plugged into it.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Thenasty on October 28, 2010, 10:11:08 pm
if the games are in v.106 and Working, give ADVMAME a try. There is a script you can put in the RCC file (CFG/INI) that you can tell for what you want (insert a coin and give XXX credits) globably.

You can even set games in FREE PLAY all done in the config file (globaly).

It's been a while since I played with the RCC file cause my CAB is been done long ago and no need for me to fiddle with it.

I dunno of any Frontends that will do what you want.

You can however do something in MAME settings.

Goto the Global setting and change the:

Input 5 (coin 1) to Input 5 & 6
Input 6 (coin 2) to Input 5 & 6

so when you insert a coin in either slot, it will give 2 credits per coin inserted

Title: Re: 1 Coin 2 Credits... ideas?
Post by: Haze on October 30, 2010, 08:26:42 am
if the games are in v.106 and Working, give ADVMAME a try. There is a script you can put in the RCC file (CFG/INI) that you can tell for what you want (insert a coin and give XXX credits) globably.

You can even set games in FREE PLAY all done in the config file (globaly).

and some games will break because they're badly programmed, seriously.  I can think of two semicom games off the top of my head that will glitch badly if you put them into freeplay (Cookie & Bibi 3, Puzzle Break) this happens on the real hardware.

Anyway I have nothing more on the subject, I just wanted to point out that it wasn't a good suggestion.  The developers in general don't encourage / support anybody trying to use actual coin mechs with MAME for obvious reasons.

It's been a while since I played with the RCC file cause my CAB is been done long ago and no need for me to fiddle with it.

I dunno of any Frontends that will do what you want.

You can however do something in MAME settings.

Goto the Global setting and change the:

Input 5 (coin 1) to Input 5 & 6
Input 6 (coin 2) to Input 5 & 6

so when you insert a coin in either slot, it will give 2 credits per coin inserted
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lecithin on November 01, 2010, 11:13:32 am
Setting MAME to register 2 credits per "coin" globaly sounds like a pretty easy solution. I wouldn't want it to give one to each player though, rather, two to one player. I guess I'll mess with this and see what happens. I'm sure it's not as easy as registering the keypress "5" twice in MAME. Perhaps as Kaze said and coding something.... now to brush up on my software and coding haha.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Malenko on November 02, 2010, 04:01:10 pm
well NBA Jam has dips and a CMOS you can change =)

Id just see which games they wanna play that need the dip changed and change as you go. Odds are they are only gonna play a handful of games most of which can be changed. Once they figured out what they are actually gonna play, youre done.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lecithin on November 09, 2010, 11:28:18 am
We've already generated a list of games (approximately 100) and there's a good deal of them (40 or so) that lack dips or the dips they have don't allow us to change them how we'd like.

We tried wiring up the coin the two buttons (coin 1 = 5 & 7) and switched it so that 5 & 7 are both set to coin one. The idea here was that if you put a coin it in would register 5 & 7 which would then give you a 1 coin for each press. Problem is since there's no delay it only registers one coin (but it does actually register both keys, we tested in notepad)
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Donkbaca on November 09, 2010, 11:37:13 am
I am still not clear on why registering two credits with one coin is any better/easier than just giving two coins...
Title: Re: 1 Coin 2 Credits... ideas?
Post by: HaRuMaN on November 09, 2010, 11:46:09 am
Why not wire a second coin switch below the first one, and tie them both to the same input (5).  As the coin drops, it would hit the first switch, sending '5', then hit the second switch, and send '5' again.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Malenko on November 09, 2010, 12:41:18 pm
"change it how we'd like"

could you set all games to require 2 coins? then just give them two?
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lecithin on November 09, 2010, 01:28:03 pm
Why not wire a second coin switch below the first one, and tie them both to the same input (5).  As the coin drops, it would hit the first switch, sending '5', then hit the second switch, and send '5' again.

That was a thought but I thought it would be a more refined approach to change it within the software.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lecithin on November 09, 2010, 01:29:04 pm
"change it how we'd like"

could you set all games to require 2 coins? then just give them two?

That seems like I'd eventually get the same problem but with the opposite effect.

I've got it set to register two 2 keys but without a delay it ignores the second.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Malenko on November 09, 2010, 01:31:13 pm
"what game do you wanna play?"

if game is on list A give them 1 coin

if game is on list B give them 2 coins


am I over thinking this?
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Thenasty on November 09, 2010, 01:43:43 pm
if you really want and the CAB is a 2-player cab.

Why not wire up 5 and 7 (p1-p3 coin) to one switch
                           6 and 8 (p2-p4 coin) to the other switch.

Now go into MAME and configure P1 (coin1) as 5 and 7
                                                     P2 (coin2) as 6 and 8
remove the p3 and p4 coin.

BINGO you get 2 credits for each slot for the correct player side.

Hope that made sense  :dizzy:
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Donkbaca on November 09, 2010, 01:50:56 pm
I am a bit confused, I am with Malenko, I think your best suited by just regulating the number of coins.  So are you worried that one credit on NBA Jam won't last as long as one credit in Pacman?  If that is the case, having one coin register as two credits doesn't solve your problem.  Lets say one credit is good for 5 minutes of gameplay in NBA JAM, and a decent pacman player can play lets say for 10 minutes on one credit.  So, if you start registering 2 credits per coin , then the player on NBA JAM now gets 10 minutes of play, but the Pacman player now gets 20 minutes of play.  You still have that disparity.  Not sure how changing the number of credits that registers is going to solve the time per credit issue.  Seems a better solution is to set up a timer where one credit equals x number of minutes or just allocate coins based on a list of games like Malenko suggested.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Thenasty on November 09, 2010, 03:05:57 pm
by then again

how is "let the kids use it in their free time" they suppose to have anyway (all night) ?

If they are limited in TIME, then a CREDIT BUTTON will be the easiest.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lilwolf on November 09, 2010, 05:46:40 pm
I think a wireless keyboard that you have in your desk should do the trick... instead of giving them 2 coins, they come over and you hit 5 twice...  This way you have a bit more control... and you don't have to play any games.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Donkbaca on November 09, 2010, 06:12:12 pm
+1 to the wireless keyboard idea
Title: Re: 1 Coin 2 Credits... ideas?
Post by: notroubleclubber on November 10, 2010, 03:27:56 am
All i do is map (using an ipac or minipac) the coin switch button to 5 and 6. When they put in 1 coin it gives 2 credits. Its handy then so if you want to play 1 player most games will give you 2 credits for 1Player. However it will only give 1 credit each for 2 players.
Title: Re: 1 Coin 2 Credits... ideas?
Post by: Lecithin on November 10, 2010, 08:03:20 am
All i do is map (using an ipac or minipac) the coin switch button to 5 and 6. When they put in 1 coin it gives 2 credits. Its handy then so if you want to play 1 player most games will give you 2 credits for 1Player. However it will only give 1 credit each for 2 players.


I tried that (and it worked) but I wanted to try the same w/5 & 7 as a pair (and then I set 5 & 7 as credit 1). It registers both key presses but without a delay MAME actually only registers one coin. I also thought of trying the 2 coin switch (one under the other) idea but I thought that it wasn't as elequent as other solutions might be.

As for the reason why I care so much, it's a student built and maintained project. I want them to problem solve how to do it. I'm on here posting because I haven't problem solved it either so when it becomes time for me to guide them I'm able to do so.