Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: Zzap on August 14, 2015, 02:28:38 am

Title: Daphne - alternate scoreboard output
Post by: Zzap on August 14, 2015, 02:28:38 am
I've been thinking about looking into making a modification to Daphne to allow scoreboard output in a more generic way than just the lpt port. I understand why only the LPT port is supported for compatibility with original hardware, but what about support for other devices, like perhaps an Arduino controlled LED digit display? Or even display on a second screen? Has anyone else looked into something like this?
Title: Re: Daphne - alternate scoreboard output
Post by: Howard_Casto on August 14, 2015, 02:34:55 am
It's open-source.  The code is fairly straight-forward.  I was going to do it but lost interest in daphne and never got back to it.  Probably the best way to do it would be to use the same system message method that mame uses.  Then it automatically works with mamehooker, ledblinky, ect. 
Title: Re: Daphne - alternate scoreboard output
Post by: Zzap on August 14, 2015, 03:56:08 am
Thanks Howard, I'll start with getting it to compile then :) Good idea on using the common messaging protocol, I may have a few questions down the track!
Title: Re: Daphne - alternate scoreboard output
Post by: matsadona on August 19, 2015, 04:33:44 am
Serial output (COM) -> Arduino -> MAX7219 -> LED segment, would be great for me  ;D
Title: Re: Daphne - alternate scoreboard output
Post by: Zzap on August 20, 2015, 08:47:53 pm
Serial output (COM) -> Arduino -> MAX7219 -> LED segment, would be great for me  ;D

I'm thinking of something very similar! There's some ridiculously cheap 8 digit modules with MAX7219 available on ebay.

Ok, got some progress, got things compiling, now understanding all the code structure, and gotten all of the output digits/characters going out to a file... Now to look at windows messaging. I think by adding the windows messaging it makes it a little more complicated, but as Howard mentioned, will be compatible with a wider range of output programs. So between MameHooker or LEDBlinky which would be easiest to hook up to an Arduino to then output to the MAX7219?
Title: Re: Daphne - alternate scoreboard output
Post by: welash on August 20, 2015, 09:48:38 pm
Doesn't the windows version of mame just write to a fifo at /tmp/sdlmame_out like the linux version? It just writes the pid and the action to the fifo, and other processes can read it.
Title: Re: Daphne - alternate scoreboard output
Post by: Zzap on August 20, 2015, 10:52:28 pm
Good to know... I'll have a look.

Also seems Daphne already includes serial IO, so I may end up just going down that more direct path if the SDL output isn't fruitful.
Title: Re: Daphne - alternate scoreboard output
Post by: welash on August 20, 2015, 11:39:23 pm
Looking at the source code, it appears that the windows version uses some other communication system for the output system. Maybe windows doesn't handle fifos in the same way that unix-like systems do. 

It might make sense for any system these days to use a udp socket for this sort of stuff, so that you could not only handle outputs on the machine running the emulator, but you could have a different machine handling the outputs.  That is probably overkill for most output events, but for what you are doing, I could see having a scoreboard mounted on a wall remote from the arcade cabinet.
Title: Re: Daphne - alternate scoreboard output
Post by: Howard_Casto on August 21, 2015, 02:47:03 am
There isn't really a truly universal solution I'm afraid.  That's why it's best to first make the signal generic and then send it to some sort of middleware app.  If you are just trying to hook something up for a very specific use though, just hacking the source is quicker.  The daphne scoreboard is serial and so are the 8 segment displays on ebay.  A simple modification would do. 
Title: Re: Daphne - alternate scoreboard output
Post by: yotsuya on August 21, 2015, 10:18:58 am
Actually, HudsonArcade on KLOV has been working on this:

http://forums.arcade-museum.com/showthread.php?t=344994&highlight=Daphne+USB (http://forums.arcade-museum.com/showthread.php?t=344994&highlight=Daphne+USB)
Title: Re: Daphne - alternate scoreboard output
Post by: Zzap on August 24, 2015, 10:56:23 am
Using the serial library already included for communicating with a laserdisc player, I've been able to hook up an Arduino with a 16x2 LCD display and get the score, lives and credits showing. Still waiting for the LED displays to arrive off ebay (most likely weeks away!). Generic interface is to open a serial com port and output signals of 'Digit Number' and 'Value' pairs which the Arduino reads in, and updates the appropriate display digit.

I'll clean up my code, and see if the main developer is interested in including this kind of serial scoreboard output in a future release. I'm currently just hacking it a bit using the 'Null' scoreboard type, making the program always create one of them and using that to open the serial port and output the digits. Once cleaned up this would be its own command line option, with serial port parameter etc.