gtxjoe

Pin2Dmd - Pinball Logo Images (Ppm Format) And How To Load Them

40 posts in this topic

PIN2DMD supports uploading of PPM images (128 x 32) using the VC++ version of PIN2DMD.exe.  This would be useful for displaying logos for non-DMD tables. This feature has been mentioned in previous posts and details are in the tools folder here:   https://github.com/lucky01/pin2dmd

 

1451527104.jpg

 

Here are a bunch of PPM images I have created for this

1451526159.jpg

 

To test this, download the attached zip and unzip the files to the "PIN2DMD-master\tools\vc++\Binary" folder.  Open a dos command window and navigate to "PIN2DMD-master\tools\vc++\Binary" and type pin2dmd /i <<ppm filename>>

For example:   pin2dmd /i ballyred.ppm                or                   pin2dmd /i hyperpin.ppm

 

 

 

Here are details on how to load these images when starting a Visual Pinball table and exiting a table (based on Fren's "Pin2Dmd - Table Support" post) if you are comfortable modifying table scripts.  Assumes you have the PIN2DMD github files located in c:\

 

I am displaying the gottlieb logo for the Genie table and when exiting the table, I blank the PIN2DMD table.  At the top of the table script after 

Option Explicit
Randomize

Add this code

'************ BEGIN PIN2DMD PALETTE LOADING **************
'************ freneticamnesic, Rascal and gtxjoe *******
Const PIN2DMD = True
Const PIN2DMDDIR = "C:\PIN2DMD-master\tools\vc++\Binary"

Dim oShell
Dim WScript
Dim ORIGDIR
Set oShell = CreateObject("WScript.Shell")
ORIGDIR = oShell.CurrentDirectory
oShell.CurrentDirectory = PIN2DMDDIR
If PIN2DMD = True then oShell.run "pin2dmd.exe /i gottlieb.ppm",,TRUE
oShell.CurrentDirectory = ORIGDIR
Set oShell = Nothing

Dim DelayTime, StartTime
DelayTime = 0
StartTime = Timer
Do While DelayTime < 1
    DelayTime = Timer - StartTime
Loop
'************* END PIN2DMD PALETTE LOADING ***************

and replace the exit subroutine

Sub Gemini_Exit()
	savehs
	If B2SOn Then Controller.stop
End Sub

with this

'************ BEGIN PIN2DMD PALETTE RESET **************
'************ freneticamnesic, Rascal and gtxjoe *******
Sub ResetPalette
Dim rShell
Dim WScript
Set rShell = CreateObject("WScript.Shell")
rShell.CurrentDirectory = "C:\PIN2DMD-master\tools\vc++\Binary"
If PIN2DMD = True then rShell.run "pin2dmd.exe /i blank.ppm",,TRUE
Set rShell = Nothing
End Sub

Sub Gemini_Exit()
	savehs
	If B2SOn Then Controller.stop
	ResetPalette
End Sub

'************* END PIN2DMD PALETTE RESET ***************

Next step would be to create a batch file or autohotkey script that can be used by Hyperpin or Pinballx to load these based on the table that is launched, to eliminate the need to modify table scripts...

LOGO_PPM_files.zip

Share this post


Link to post
Share on other sites

Hello gtxjoe !!! Can you recommend me a PPM creator ? of course to create 128x32 files. For example I would like to create an image that says something like: "Happy New Year 2016". Thanks in advance! Andrew.

Share this post


Link to post
Share on other sites

I used Photoshop

Resize/crop a png or jpg image to 4 to 1 ratio. Adjust the image to your liking and then resize the canvas to 128x32 and save in PPM format

If you google search for png to ppm there are free online converters

Share this post


Link to post
Share on other sites

Thanks a lot !!! It was in "ascii" as deafult when saving, when I switch to "binary" the image appear with pin2dmd.exe /i xxx.ppm

Thanks !!!

Enviado desde mi SM-N910U mediante Tapatalk

Share this post


Link to post
Share on other sites

I've created a handful of PIN2DMD images for specific tables, and a few for some missing pinball manufacturers from gtxjoes list. I'm not sure if I'll continue this, my hope is pinballx will support it soon so we won't need to convert all to PPM but I guess we'll see.

https://www.dropbox.com/sh/2y3a8zgpi5yli0i/AACWUvNm38euZk7KGVJxt9-ea?dl=0

 

zvNZC6g.jpg

Otbmhvd.jpg

Share this post


Link to post
Share on other sites

So can PIN2DMD.EXE be run as a standalone, without the need for any other files or apps? 

 

I'm wanting to set it up in PinballX to reset the palette when exiting a table and it would be nice to not have to install the entire pin2dmd-master directory structure onto my cabinet PC.

Share this post


Link to post
Share on other sites

Maybe you need the dlls, but apart from that, nothing else is needed ;)

Pin2dmd can be reset to standard palette by entering

Pin2dmd.exe /c in cmd or embedded in a batch-file which is then called by pbx when exiting a table ;)

Greets,

Dom

Share this post


Link to post
Share on other sites

I just uploaded 9 or 10 variations of logos to the dropbox folder. The logos previously created were based on the wheel images so some scale funny and lose detail. The images I uploaded ended in "-dmd-logo.ppm" are based on the logo as it appears on the actual DMD of the game, so the detail is better at 128x32. I'm still working on good ways to do this. I probably won't do many of the colored DMD logos but I will for the handful of games I enjoy playing. It's easy enough (most of them...) so others can join in too.

Hopefully we get proper support in PinballX soon.

 

6KYDJGP.png

Share this post


Link to post
Share on other sites

Some examples on the PIN2DMD setup

 

PlkA9AB.png

 

mCtiTs7.png

 

8vEaY2z.png

 

I should probably focus a bit more time on the EM games though. Fast Draw turned out good. I think they're the ones that will get the most use since the DMD is not used for those games.

Share this post


Link to post
Share on other sites

Indeed. And those tables that have the numeric score in the backglass, but can be used in the dmd too. I always leave them in the BG, it looks better and more natural. The dots in numeric score looks a little off, so I choose not to run it. Those tables like for example BTTF. TMNT, etc will benefit of your dmd logos. And those spanish tables that don't have vpinmame support.

 

Nice example shots!

Share this post


Link to post
Share on other sites

Rather than editing table scripts, could this possibly be done as a global BAT or EXE file?

 

In PinballX we have the ability run programs before and after table loading and, in addition, parameters can be passed. One such parameter is [TABLENAME] so if someone can figure out how to parse the table name to our BAT file then it may be a simple matter of putting the PPM files into a common folder from which they can be called.

 

I'd have a stab at it but I'm not very good with coding from scratch - I can adapt code, I just can't write it!

Share this post


Link to post
Share on other sites

Rather than editing table scripts, could this possibly be done as a global BAT or EXE file?

In PinballX we have the ability run programs before and after table loading and, in addition, parameters can be passed. One such parameter is [TABLENAME] so if someone can figure out how to parse the table name to our BAT file then it may be a simple matter of putting the PPM files into a common folder from which they can be called.

I'd have a stab at it but I'm not very good with coding from scratch - I can adapt code, I just can't write it!

I can create a bat file to launch this with the table launch just fine I think actually... That wasn't my initial goal. Originally I wanted these to pop up in the launcher and go from there but now that you mention it that way would solve the script editing at least for now. Right now I've done it using one bat per ppm - if someone wanted to write a better script to load the ppm automatically that would be better. I'll try it shortly and share an example

Share this post


Link to post
Share on other sites

I don't seem to be able to gain control of the PIN2DMD from PBX. If I try to write to it using CMD I get a PIN2DMD not found error. I don't seem to be able to disable PBX from using the DMD either, even if I delete all videos, it still has control of it and I see no settings to turn it off. Right now I'm stuck, I could probably hack something together in the short term that would work if I could access like I need to but it just doesn't work with PBX currently.

Share this post


Link to post
Share on other sites

That is because pbx claims the USB device as soon as it finds a pindmd device, no matter if you play a video or not.

I modified the XDMDNative.dll by searching for the USB VID/PID in the source (search for hex 57 E4) and modified

it to something else (eg E7 E5). This prevents pinballx from finding the pin2dmd and you can control it with pin2dmd.exe.

I attached my modified DLL.

 

XDMDNative.zip

Share this post


Link to post
Share on other sites

The quickest thing we can do right now is launch these files to display on the DMD when we are playing a pre-1987 SS game or an EM game, the kind of tables that have scores on the backglass instead of between the speaker area. If you use the modified .dll that lucky1 uploaded, and you have 2.1 or higher PinballX, and the newest PIN2DMD fw, you can do this for your system settings in PBX:

 

1T4DjHn.jpg?1

 

Obviously, the location of your pin2dmd.exe will be slightly different... What I did was put all the .ppm files in the same folder as the pin2dmd.exe, you can put them in a subfolder, and just account for that in the launch parameters. I name the ppm files the same as the VP table. If you have an older version of PBX you can use [TABLEFILE] but you'll have to add the extension (.vpt, .vpx) before the .ppm extension on your files. This is probably as far as I'll go until PBX supports pin2dmd natively.The toughest part of all this is re-naming your ppm files to match the table names. Then of course a lot of people have preview DMD video that won't work with the modified dll - so of course this is mostly for naught right now.

Share this post


Link to post
Share on other sites

Really nice work.

 

Pity about the lack of support in PBX currently - it's like shooting yourself in one foot, then before it heals properly you shoot yourself in the other foot!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now