Jump to content

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


gtxjoe

Recommended Posts

  • Content Provider

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

Link to comment
Share on other sites

  • Content Provider

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

Link to comment
Share on other sites

  • 2 weeks later...
  • Content Provider

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

Link to comment
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.

Link to comment
Share on other sites

  • Content Provider

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

Link to comment
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!

Link to comment
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!

Link to comment
Share on other sites

  • Content Provider

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
Link to comment
Share on other sites

  • Content Provider

What is being discussed shares some similarities with my project where I am displaying custom instruction cards on per table basis. Can certainly take script elements to make it work for this:

 

http://www.gameex.info/forums/topic/16462-update-visual-pinball-mini-dmdb2s-screen-for-apron-now-with-instruction-card-splash-viewer/

Link to comment
Share on other sites

  • Content Provider

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.

Link to comment
Share on other sites

  • Content Provider

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

Link to comment
Share on other sites

  • Content Provider

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...