Who Stuck the Pinball on my Backbox?
For many creating a virtual pinball machine is one part woodworking, two parts electronics and wiring, and three parts installing/configuring/ troubleshooting software from several different contributors. One of the core components you’ll want in your setup is the Visual Pinball application. I’ve had great luck with the software, except for one issue with it knowing which monitor to use for which “part” of the “virtual” pinball machine. A common question I saw posted online is: “Why is my Visual Pinball playfield on the backglass or DMD monitor?” or “Why is my backglass not on the monitor I specified?” I noticed it was common because I did a lot of searching for the solution. I’ve attempted to detail some of the options I tried below. If you’ve tried everything with no luck, make sure to read the “Fix the Backglass” and “My Display Fix Script” sections below, as I think they will do the trick!
Fix the Backglass – The Easy Part
Many people aren’t aware that the backglass position problem is pretty easy to fix now. The latest backglass software version lets you put in a pixel position. So, if you have a 4K playfield, simply put the value @3840 to line 5 of your screenres.txt and you’ll never have to deal with that again! Since you put your monitors in a specific order, the coordinate system is much better than using a “display id” that will probably change.
What’s in a Display Number?
Visual Pinball determines a display “number” that’s not the same as the number you see in the control panel settings. If the number it finds for your display changes, VP still uses that number even though the proper monitor to use is now a different number after reboot. The tricks are all about trying to get Visual Pinball to use proper display or getting the number to not change.
Clean up the Registry
One option to try is to delete all the registry keys for your displays. Many people, when building a pinball cabinet, “try out” a few monitors, or upgrade video cards, etc. along the way. This leaves a lot of garbage in the registry. Heck, I had almost 30 entries but only 3 displays (multiple video cards and monitor trials gave me the mess). You can clean it up by deleting all the keys below (backup first, make sure you know how to use regedit). If this is the cause of your trouble, it might fix it, but it didn’t for me.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Connectivity HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\ScaleFactors
Turn on your Monitors in Specific Order
Oh, who wants to do this? Nobody, but if it will make it “just work” you might be happy with this approach. The idea is to make sure all your displays are on BEFORE the PC is turned on. This makes a lot of sense if you’ve seen a fast PC boot it might be at the login process before all your monitors are ready for a signal. I’m pretty sure every time a boot up the login screen starts on a different monitor before settling on my primary display. Some people swear by this method, but it didn’t work for me. I didn’t really want it to work, I’m using a smart power strip and just want one magic on button!
Use NailBuster utility to set Display at startup
Another trick is a utility that looks at what display is currently setup at coordinates 1,1 and set the registry entry used by Virtual Pinball to match. This was the first solution that seemed to work, but not 100% of the time. You can give it a try and see if works 100% for you.
https://www.nailbuster.com/wikipinup/doku.php?id=vp_display_issues&s#pupwinidfixexe
Use the “primary” flag at the startup of Visual Pinball (try this!)
I initially saw a flag browsing the repo for monitor setup and then, after trying it as “/primary”, found a post on Facebook from Nailbuster on the feature being part of 10.7 and to use “-Primary”. I changed the registry for vpx to use the “wrong” monitor and it worked. Even with vpx settings pointing to my DMD, it uses my main primary monitor properly! However, there are some caveats: this requires 10.7 and only works for Visual Pinball. Further testing with reboots showed sometimes even with vpx working with “right” monitor using this flag at startup actually forced my playfield to the wrong display. I think it’s worth a try to see if it helps (especially given the person who created it).
What works 100% of the time for me?
We could title this section “Your mileage may vary”. I took a brief look at the github repo (emphasis on brief – my observations are just a guess). It seems to be using Win32 calls to GetMonitorInfo and MonitorFromWindow to create a list, and using the display number according to the order of that list. It doesn’t check that information (and update it) at runtime, so if the ordering of items changes, it uses the same display number despite the change. When this happens, if you look at video preferences in VPX, you’ll see it puts an asterisk in the UI next to the “right” one.
Since my problem occurred every dozen or so starts, I tried a few scripts to list the displays to see if I could find one that always matched the ordering (and numbers) that matched the order Virtual Pinball used. What I found was that if you used the output from the Direct X Diagnostic tool, it always gave me the same order.
My Display Fix Script
I created a batch script that uses command line options to output the Direct X diagnostic tool, find the display listings, pick a display based on a unique resolution or display frequency, and update the registry entry Visual Pinball uses to match. Since most cabinet builds have a 4K display or a high refresh rate display, that can be used to identify which screen should be the “playfield”. This script could also be updated for use with Future Pinball (have some lines still testing in script). If all your displays are the same I’ve added support for that too, just read the readme in the zip file.
I created a zip file with a few scripts to pick from. I know a lot of builders aren’t PC experts, so I created some variations of the script with specific parameters so you can just drag and drop without setting command line parameters. You figured out that slot cutter on the router for that fancy t-molding. Let’s make this easy. Just copy the one you want (pick4kdisplay.bat for most) to your startup folder and reboot. You should see a command window pop-up after reboot pause for 5 seconds, then update the right settings. You don’t want to launch other things until this is done so if you have a delay in PinballY or Popper bump it up by several seconds (but you may not need this if takes you several seconds to pick a game!). Click here to download my zip of the batch scripts.