Jump to content


Photo
* * * * * 2 votes

Arduino as pac-drive alternative?

Arduino pac-drive mamehooker

  • Please log in to reply
185 replies to this topic

#1 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 27 March 2018 - 09:11 PM

In my last post I mentioned about software called Mamehooker. This piece of software catches output signals from MAME emulator and uses them to drive  devices like Ledwiz, Pac-drive etc. Interresting thing is that this software, can send signals to parallel or serial port (even to keyboard leds). I found that this can be used by Arduino.

 

I set Arduino to listen to COM signals, which were translated to exact actions of microcontroller. Arduino was responsible for LEDs blinking. Mostly used in video poker games to light buttons. Worked like a charm :).

 

My question is.

Is it possible to add feature to MFME emulator, to be able to sent signals to serial port? Now it is only able to drive Ultimarc devices, which are not cheap, let's be honest. Such solution would let us use cheap arduino device for controlling blinking leds in cabinets. The idea works great on Mamehooker, so I belive this could be used within the emulator, but I'm not a coder, so for me it is a black magic.

I have no video or photos of my machine, but I can share source code for Arduino, to be implemented with Mamehooker & MAME emulator if someone is interrested to try.

 

take care

 


Logopit_1542465375366.png


#2 ritdav

ritdav

    Junior Member

  • Regulars
  • 389 posts

Posted 28 March 2018 - 06:42 PM

the pacdrive isn't that expensive and a doddle to set up for each machine as mfme is geared for it.You can save money on the i-pac by getting arcade buttons with usb encoders and a software program such as xpadder to configure the buttons rather than the i-pac.Thats what i did anyhow.



#3 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 30 March 2018 - 05:53 AM

My idea is to operate on outputs, not inputs with Arduino. You mentioned about inputs, but that is not a problem. You can achieve it by using any usb keyboard to modify it for MFME controlling. I'm saying about driving leds which blink according to game rom setting. So, the idea is still open. I agree, that spending some amount of money on Pac-drive, when you are working on some idea isn't that painful, but I'm just thinking about a way to do it even cheaper. I belive it can be done, but might not be that easy.


Logopit_1542465375366.png


#4 Reg

Reg

    DONE AND FINISHED

  • Layout Creator
  • PipPip
  • 697 posts

Donator

Posted 30 March 2018 - 09:54 AM

My idea is to operate on outputs, not inputs with Arduino. You mentioned about inputs, but that is not a problem. You can achieve it by using any usb keyboard to modify it for MFME controlling. I'm saying about driving leds which blink according to game rom setting. So, the idea is still open. I agree, that spending some amount of money on Pac-drive, when you are working on some idea isn't that painful, but I'm just thinking about a way to do it even cheaper. I belive it can be done, but might not be that easy.

 

The idea is only open if Wizard wants it to be open.  MFME is not a public piece of software.

 

My idea is to operate on outputs, not inputs with Arduino. You mentioned about inputs, but that is not a problem. You can achieve it by using any usb keyboard to modify it for MFME controlling. I'm saying about driving leds which blink according to game rom setting. So, the idea is still open. I agree, that spending some amount of money on Pac-drive, when you are working on some idea isn't that painful, but I'm just thinking about a way to do it even cheaper. I belive it can be done, but might not be that easy.

 

Note that MFME currently does do everything a real machine can do with the PAC-Drive.  You speak about driving LED's as per game rom settings, this is it happening with a PAC-Drive, note the LED's in the buttons here for point of reference.  The button LED's are blinking as per game setting, via the PAC-Drive.

 

 

 

My idea is to operate on outputs, not inputs with Arduino. You mentioned about inputs, but that is not a problem. You can achieve it by using any usb keyboard to modify it for MFME controlling. I'm saying about driving leds which blink according to game rom setting. So, the idea is still open. I agree, that spending some amount of money on Pac-drive, when you are working on some idea isn't that painful, but I'm just thinking about a way to do it even cheaper. I belive it can be done, but might not be that easy.

 

You are potentially wrong here and leading people down the wrong path.  On the mahine shown above, an I-PAC us used for the inputs.  If you are building a full size cabinet and want to put the hoppers in place, they share a common ground between the PAC-Drive and I-PAC for the funtionality as wiring goes to both.  If you use a USB keyboard method that may / may not work depending on the build and you may end up having to go back to an I-PAC.

 

Unless you have setup a cabinet with hoppers, please do not post mis-leading information.  It's all too easy for people to buy the wrong stuff and burn cash which this may lead to.


Edited by Reg, 30 March 2018 - 09:55 AM.


#5 Reg

Reg

    DONE AND FINISHED

  • Layout Creator
  • PipPip
  • 697 posts

Donator

Posted 30 March 2018 - 10:41 AM

Unless you have setup a cabinet with hoppers, please do not post mis-leading information.  It's all too easy for people to buy the wrong stuff and burn cash which this may lead to.

 

Quoting myself here, madness !

 

As I can't edit that and it comes across as rude, what I mean is unless you've a cabinet setup already, then post the details.  Don't post assumptions where others may follow the leads and end up buying something that is not fit for purpose.

 

Have you explored all the options with the PAC-Drive to see how powerful MFME actually is with it and what it can already do ?


Edited by Reg, 30 March 2018 - 10:41 AM.


#6 ritdav

ritdav

    Junior Member

  • Regulars
  • 389 posts

Posted 30 March 2018 - 11:00 AM

just to clarify i am talking about a console that plugs in and out of a computer done because of lack of space for a whole cabinet, .Of course as Reg says a fully fledged cabinet is different.I can't stress enough what Wizard has done on mfme to make this work so easily is absolutely fantastic. 



#7 Reg

Reg

    DONE AND FINISHED

  • Layout Creator
  • PipPip
  • 697 posts

Donator

Posted 30 March 2018 - 11:44 AM

just to clarify i am talking about a console that plugs in and out of a computer done because of lack of space for a whole cabinet, .Of course as Reg says a fully fledged cabinet is different.I can't stress enough what Wizard has done on mfme to make this work so easily is absolutely fantastic. 

 

The sad thing is, I built a console as well before the cabinet.  I just cannot get rid of "Mr Orac", even tho he sits in the loft.

 

Attached File  Keyboard.jpg   160.1KB   7 downloads

 

I echo exactly what you say tho, the work Wizard has done on the interface has been amazing here - we would never have dreamed of this all those years ago.



#8 eric

eric

    Member

  • Regulars
  • 68 posts

Posted 30 March 2018 - 07:04 PM

If you whant use a arduino with Mame and mame hooker for control the leds the source code is :
 
 
void setup() {
  Serial.begin(9600);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
  while (Serial.available() > 0) {
    int pin = Serial.parseInt();
    int value = Serial.parseInt();
  if (Serial.read() == 'x') {
    digitalWrite(pin, value);
    Serial.println();
    }
  }
}


#9 eric

eric

    Member

  • Regulars
  • 68 posts

Posted 30 March 2018 - 07:13 PM

after you must creat the folder .init in mame hooker for each game like this :

 

[General]
MameStart=cmo 4 baud=9600_parity=N_data=8_stop=1
MameStop=cmc 4
StateChange=
OnRotate=
OnPause=
[KeyStates]
RefreshTime=
[Output]
lamp1=cmw 4 2., cmw 4 %s%, cmw 4 x
lamp2=cmw 4 3., cmw 4 %s%, cmw 4 x
lamp3=cmw 4 4., cmw 4 %s%, cmw 4 x
lamp4=cmw 4 5., cmw 4 %s%, cmw 4 x
lamp5=cmw 4 6., cmw 4 %s%, cmw 4 x
lamp8=cmw 4 9., cmw 4 %s%, cmw 4 x
lamp6=cmw 4 7., cmw 4 %s%, cmw 4 x
lamp0=
lamp9=cmw 4 10., cmw 4 %s%, cmw 4 x
lamp12=cmw 4 13., cmw 4 %s%, cmw 4 x
lamp7=cmw 4 8., cmw 4 %s%, cmw 4 x
lamp10=cmw 4 11., cmw 4 %s%, cmw 4 x
lamp11=cmw 4 12., cmw 4 %s%, cmw 4 x
lamp13=cmw 4 13., cmw 4 %s%, cmw 4 x


#10 shaun2097

shaun2097

    Senior Member

  • Regulars
  • 993 posts

Posted 30 March 2018 - 07:21 PM

 

The sad thing is, I built a console as well before the cabinet.  I just cannot get rid of "Mr Orac", even tho he sits in the loft.

 

attachicon.gifKeyboard.jpg

 

I echo exactly what you say tho, the work Wizard has done on the interface has been amazing here - we would never have dreamed of this all those years ago.

 

"Mr ORAC"   

 

great BLAKES 7 reference there for all you young ones. :)


Former Fruit Machine Engineer.<br /><br /> 1988-2004.

#11 Reg

Reg

    DONE AND FINISHED

  • Layout Creator
  • PipPip
  • 697 posts

Donator

Posted 30 March 2018 - 07:28 PM

 

If you whant use a arduino with Mame and mame hooker for control the leds the source code is :
 
 
void setup() {
  Serial.begin(9600);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
  while (Serial.available() > 0) {
    int pin = Serial.parseInt();
    int value = Serial.parseInt();
  if (Serial.read() == 'x') {
    digitalWrite(pin, value);
    Serial.println();
    }
  }
}

 

 

 

after you must creat the folder .init in mame hooker for each game like this :

 

[General]
MameStart=cmo 4 baud=9600_parity=N_data=8_stop=1
MameStop=cmc 4
StateChange=
OnRotate=
OnPause=
[KeyStates]
RefreshTime=
[Output]
lamp1=cmw 4 2., cmw 4 %s%, cmw 4 x
lamp2=cmw 4 3., cmw 4 %s%, cmw 4 x
lamp3=cmw 4 4., cmw 4 %s%, cmw 4 x
lamp4=cmw 4 5., cmw 4 %s%, cmw 4 x
lamp5=cmw 4 6., cmw 4 %s%, cmw 4 x
lamp8=cmw 4 9., cmw 4 %s%, cmw 4 x
lamp6=cmw 4 7., cmw 4 %s%, cmw 4 x
lamp0=
lamp9=cmw 4 10., cmw 4 %s%, cmw 4 x
lamp12=cmw 4 13., cmw 4 %s%, cmw 4 x
lamp7=cmw 4 8., cmw 4 %s%, cmw 4 x
lamp10=cmw 4 11., cmw 4 %s%, cmw 4 x
lamp11=cmw 4 12., cmw 4 %s%, cmw 4 x
lamp13=cmw 4 13., cmw 4 %s%, cmw 4 x

 

 

How is any of this easier then using this...

 

Attached File  PACDrive.png   21.75KB   7 downloads

 

...then you use the default config and voila, every game is setup perfectly.



#12 eric

eric

    Member

  • Regulars
  • 68 posts

Posted 31 March 2018 - 12:28 PM

The configuration for a pac drive or arduino are the same in mame hooker.

 

for my mfme cabinet use 2 pac drive like you   its very simply to use the for  led but the pac drive is more expensive than a arduino.

eric



#13 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 29 April 2018 - 07:35 PM

pac drive is more expensive than a arduino.

eric

 

And this is all about. It can be done. I work on it.

I can see Eric, that you've posted codes for Arduino. Can I ask where did you get that (corobitata?)? It looks just like my code from the past.


Logopit_1542465375366.png


#14 eric

eric

    Member

  • Regulars
  • 68 posts

Posted 05 May 2018 - 09:19 PM

Yes, this is correct, and i have use this code With mame igrosoft fruit machine and american poker for control the led and hopper output it's a very cheap solution.



#15 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 06 May 2018 - 09:20 PM

I'm pleased to see that someone used my code to implement to MAME games. I recognized the code by ... doesn't matter. :) Cool that you've found it! My blog is totally unofficial. This is more like my personal notepad for codes, methods, or memories...

As for the Arduino and MFME. The good thing is, that I'm working on Arduino implementation for it & it is advanced. The bad thing is, I'm long way from success. It will be C++ implementation. I know every step to be done in details, but I have to code it, and there are few things which I have to learn. After i catch it, the code will be created. Arduino as Pac Drive alternative will be available to use for everyone.

 

Take care!

Konrad


Logopit_1542465375366.png


#16 eric

eric

    Member

  • Regulars
  • 68 posts

Posted 07 May 2018 - 12:58 PM

Hello Konrad,

Your blog is very good, and there are lots of interesting things. I am very interested in your future work with arduino and Mfme. (I'll add you as a friend if you do not mind). if you want to connect a hopper to the fruit machine in mame, I can  help you  if you want it.
thank you for everything 

 

Eric



#17 Wizard

Wizard

    MFME Creator

  • Regulars
  • 719 posts

Posted 07 May 2018 - 01:50 PM

I'm pleased to see that someone used my code to implement to MAME games. I recognized the code by ... doesn't matter. :) Cool that you've found it! My blog is totally unofficial. This is more like my personal notepad for codes, methods, or memories...

As for the Arduino and MFME. The good thing is, that I'm working on Arduino implementation for it & it is advanced. The bad thing is, I'm long way from success. It will be C++ implementation. I know every step to be done in details, but I have to code it, and there are few things which I have to learn. After i catch it, the code will be created. Arduino as Pac Drive alternative will be available to use for everyone.

 

Take care!

Konrad

 

Are you emulating a PACDrive with your Arduino?


Warning: This post is mostly my own opinions and may contain irony, if you are obsessed with PAST history you may want to ignore it.


#18 eric

eric

    Member

  • Regulars
  • 68 posts

Posted 07 May 2018 - 04:31 PM

Hello Wizard,

 

yes

 

Eric



#19 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 07 May 2018 - 07:15 PM

Hi Wizard, Hi Eric,

 

Are you emulating a PACDrive with your Arduino?

 

Not quite an emulation. This is more like I'm making Arduino to do the same job as PACDrive. Well.. and it does in MAME. No success with MFME yet.

Mechanics is very simple. Software keeps tracking for byte values responsible for lamp control and sends those values to serial port. Arduino tracks all the COM signals and interpret it as commands. Each command sends number of pin and it's state to be set. Interresting thing in Arduino is that it can operate on 1/0 state but also on PWM for fading lights - some ROMs have this feature.

I've already found memory area where all lamp numbers and states are stored. I have slight problem with that, because in almost every game it changes it's location, so to be 100% accurate every time it would have to be based on memory singature scanning to set base address and offsets. Signature to scan would be set on lamp 622 which is almost never used so it makes signature constant. But this is less matter at this point.

 

Im also interrested on reels controll. Yes Wizard, I remember what you've said about timing problems with that :). Well.. I would try anyway. I've found area of bytes responsible for direction of spinning, spinning on & off, and most important value to be shown on the reel (mostly 96 steps, each spot on the reel is moved by 3 steps, single steps are used to shake the reels). This is all what I've found - thanx uptown47 for showing me the Cheat Engine! [Arduino is very efficient in stepper motor controll]

 

As for hopper connection and payout I see no problem with arduino, so I don't even mention that - uptown47 managed to do that and it works. It can be implemented to Arduino controller.

 

So those are my thoughts. Now I'm working on my C++ coding - reading, learning. I would appreciate some help :).

 

Take care!

konrad


Logopit_1542465375366.png


#20 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 10 June 2018 - 09:19 PM

https://youtu.be/92sCrdQM8pY

Work in progress.


Edited by majoris, 10 June 2018 - 09:20 PM.

Logopit_1542465375366.png






Also tagged with one or more of these keywords: Arduino, pac-drive, mamehooker

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users