Jump to content



Photo
- - - - -

FP and Pinmame - theoretically possible


  • Please log in to reply
192 replies to this topic

#81 settingsons

settingsons

    Pinball Fan

  • VIP
  • 959 posts
  • Location:Switzerland

  • Flag: Switzerland

  • Favorite Pinball: Terminator 2 and many EM machines



Posted 15 January 2011 - 12:30 AM

Highrise - first class work! You have come up with a very impressive system and so pleased you have followed it through. Looking forward to seeing the end result!

#82 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 15 January 2011 - 01:04 AM

hah thanks man, I don't know if it will work but the theory seems reasonably sound. I also think it should be possible to tell the system to store the all the light values it has, and not bother sending data that is telling it to do something it doesn't need to (i.e don't tell it to switch a light on which is on).

I think I have come up with 64 keys which can be used to send the data in base 64, which is 10-bit. It's a bit odd but it's the maximum the keyboard will allow I think. Now I have to build some translation arrays which will convert the data from switch data into key press, and then back into switch data again. However I'm off to visit some friends tomorrow so I won't work on it for a few days.

#83 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 15 January 2011 - 05:01 PM

I had a little bit of time so I did some work on the script. It was very fiddly, but basically I had the Mata Hari ROM sending out light data, and auto it converts it into key data that FP will definitely be able to received.

However, the compression system I thought would work well is actually not that great because a lot of the time the table is switching on only four or five lights, with large gaps between them.

So that is going to need more thought.

But even so, its progress I suppose!

#84 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,338 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 15 January 2011 - 05:23 PM

You could probably have it send 5 keys at a time, and use that for everything.
key #1 would be a single digit indicating the type of command - light/switch/solenoid - so a 0, 1, 2
key #2 would be a single digit indicating the first digit of the number 0-9
key #3 would be the same for the second digit of the number 0-9
Key #4 would be the same for the third digit of the number 0-9
Key #5 would be an on/off/enabled/disabled/closed/open - value of 0 or 1

Why 3 keys for digits? because some games have over 100 lights.

I can see such a system for keypresses working for a cabinet, but for a desktop pc it'd get all screwed up if the person at the keyboard starting the keys manually.
It's just a thought - by sending only the events that change, that might work ok.

Build a fire, vipers love the heat.


#85 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 16 January 2011 - 09:21 PM

unfortunately something like this would be too slow - five keys per instruction is already a lot slower than what I have currently, which, for 0-63 switches at least, can be only 2 keys - this is because you can send {instruction}{data}. You don't need to have an 'end' key because you can tell the system the 'end' of the instruction by it either timing out or beginning a new instruction.

If you look at my original script you will see I initially started out using a hex system, which could send numbers 0 to 255 in only two keys. However I have since moved up to using a base 64 system which would allow 4096 combinations in only two keys.

However, my aim is to get to under two keypresses per instruction, using data compression and sending the same instruction when it applies to more than one light. What I am looking at now is seeing if I can use 'up' keys as well as down, since this would then allow me to send either 'on' or 'off' values.

The key to making it as compact as possible is using binary, I am sure of that. And if the binary can be compressed, then even better. The transfer of key presses is the only slow part of the whole equation - the compression mathematics and so on will be super quick.

I should have a demo up later tonight I think

Edited by highrise, 16 January 2011 - 10:32 PM.


#86 Manofwar

Manofwar

    Hobbyist

  • VP Dev Team
  • PipPip
  • 49 posts

  • Flag: Spain

  • Favorite Pinball: Attack from Mars

Posted 17 January 2011 - 02:37 AM

Try this Highrise. Throw the table in debug mode and run pinmame.vbs (2 clicks)

http://www.megaupload.com/?d=74SFNMYN

Regards

Edited by Manofwar, 17 January 2011 - 02:38 AM.


#87 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 17 January 2011 - 03:21 AM

ok cool, will give it a go.

So anyway, the news is I have had lights in FP being controlled by pinmame. It just needs to be speeded up a bit.

One thing which does confuse me however is that the splash screen for pinmame is different WHEN FP is running - seems odd to me. Maybe there is an innocent explanation. See attached - on the left is when FP is running, and on the right when it isn't.



manofwar - I haven't run what you sent me because I can't see what it is meant to be doing? The table seems to be looking for a script called 'in.txt' but this wasn't in the zip?

Attached Files



#88 Manofwar

Manofwar

    Hobbyist

  • VP Dev Team
  • PipPip
  • 49 posts

  • Flag: Spain

  • Favorite Pinball: Attack from Mars

Posted 17 January 2011 - 03:24 AM

How to run VPinmame? From FP?

#89 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 17 January 2011 - 03:42 AM

I'm not sure that will work.

Anyway, here is the first video of a real rom (Mata Hari) controlling the lights in a FP table. It's not a fake, honest! It is double-compress (RAR) because I could not get it under the file size limit for uploads.

At this point I am going to take a break I think! If someone else wants to carry on I will happily send them all my data / scripts.



Attached Files



#90 Manofwar

Manofwar

    Hobbyist

  • VP Dev Team
  • PipPip
  • 49 posts

  • Flag: Spain

  • Favorite Pinball: Attack from Mars

Posted 17 January 2011 - 03:44 AM

Sorry, I was wrong to send file. Rename out.txt to in.txt

#91 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 17 January 2011 - 03:51 AM

ah, yes now I understand. That's very clever, I like it. This could be a much quicker way of sending the data perhaps, without the keyboard issues. Excellent suggestion.

Now, does anyone have any ideas about getting FP to speak to the outside world?





#92 Manofwar

Manofwar

    Hobbyist

  • VP Dev Team
  • PipPip
  • 49 posts

  • Flag: Spain

  • Favorite Pinball: Attack from Mars

Posted 17 January 2011 - 03:53 AM

Error, thought it could use LogDebugTextToDisk () to write to a file and read from outside FP. sad.gif

Edited by Manofwar, 17 January 2011 - 04:06 AM.


#93 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,338 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 17 January 2011 - 05:15 AM

QUOTE (highrise @ Jan 16 2011, 08:21 PM) <{POST_SNAPBACK}>
One thing which does confuse me however is that the splash screen for pinmame is different WHEN FP is running - seems odd to me. Maybe there is an innocent explanation. See attached - on the left is when FP is running, and on the right when it isn't.


There are three or four different splash screens included in vpm. It's 'randomly selected' as to which one to display.

Build a fire, vipers love the heat.


#94 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 17 January 2011 - 01:02 PM

yes, having run it lots more times now I see that is the case.

I think manofwar's idea to write to get pinmame to write data to a text file for sending data to FP is really good - I will play about with that later, maybe see if I can control the LED as well as the lights.

As for the output, well, my idea is to maybe use a small LED 'strip' which can be screen read. But I don't really know enough about coding to make that work. It would be great if someone else could look at this. If anyone has any other ideas about this do feel free to post.

#95 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 17 January 2011 - 01:43 PM

ok, so now I am looking at a hybrid system which combines what I did with the keypresses and what manofwar suggested with a text file. What I am going to do is create a text file which FP can execute, and have it triggered by a single keypress, such as something on the numeric keypad, out of the way. This way FP will run whatever PM tells it to when it gets that keypress.

#96 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 17 January 2011 - 04:31 PM

this new method is much faster - in fact I think it is fast enough to control most roms, even DMD ones. I think it is also possible to send data for the LEDs.

But I don't have any more time to work on it for now so I will leave you with a couple of vids. Firstly, Elvira and the Party Monsters. Note that this video has a low frame rate. In reality the lights are moving and blinking as quickly as the do in the VP version.

I am going to try and get a higher quality video and try it with a DMD ROM.



and here is scared stiff, running the DMD and the lights. Again, the frame rate is low, the actual table seems to run fine and smooth.

getting the lights to match up with an existing table using this system is very simple. All you have to do is put your lights in an array called 'lightarray', in the same order as the lights are numbered in the real table, and it will work.

Attached Files



#97 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 17 January 2011 - 04:35 PM

Wow, pretty nifty man! Nice work!



 


#98 BarryS

BarryS

    Enthusiast

  • Silver Supporter
  • 304 posts

  • Flag: ---------

  • Favorite Pinball: LOTR

Posted 17 January 2011 - 05:47 PM

Nice work!!

#99 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 17 January 2011 - 06:44 PM

thanks - if anyone would like me to demo this on a pre-built FP table then just send me a PM. As I said, what you will have to do is put all the lights into an array for me, and I will then be able to point pinmame at it.


#100 rehab

rehab

    Enthusiast

  • Members
  • PipPipPip
  • 381 posts
  • Location:Amsterdam

  • Flag: Netherlands

  • Favorite Pinball: funhouse,AFM,MM

Posted 17 January 2011 - 06:54 PM

Very impressive!

Congrats Highrise!