Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

I purchased SlamIt Pinball: Big Score for like a dollar or two in the last Steam Summer Sale. It's a pretty decent game once you do the work of getting the game updated and configured. Steam sells the v1.0 release which is apparently pretty buggy. You must manually apply the patches and updates yourself. Follow the guide:

http://steamcommunity.com/app/12430/guides/

The patch can be downloaded here:

http://games.softpedia.com/get/Patch/SlamIt-Pinball-Big-Score-Patch.shtml

Support was added to versions of FPLaunch/HP but I have not seen anything yet for PinballX. It is pretty straightforward though.

LaunchSlamIt.ahk and SlamIt.xml

#NoEnv  #SingleInstance forceRegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPathRun, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevelProcess, wait, BigScore.exeprocess, WaitClose, BigScore.exeExitApp
<?xml version="1.0" standalone="yes"?><menu>	<game name="BigScore">		<description>BigScore (SlamIt)</description>		<manufacturer>Technetium Games</manufacturer>		<year>2009</year>		<type>SS</type>		<hidedmd>True</hidedmd>		<hidebackglass>False</hidebackglass>		<enabled>True</enabled>		<rating>0</rating>	</game></menu>

[system_4]
Name=SlamIt
WorkingPath=C:\PinballX\Scripts
TablePath=
Executable=LaunchSlamIt.exe
Enabled=True
Parameters=
LaunchBeforeWorkingPath=
LaunchBeforeExecutable=
LaunchBeforeParameters=
Media pack from BigBoss includes backglass image and wheel image
I uploaded a company logo for the developer, Technetium Games, on the FTP
I also uploaded a flyer image based on box art - BigScore (SlamIt)
and a table video that I got off of youtube and then rotated using Avidemux
I had an issue with my test build where I could start a game but ball 1 would not come out. Tilting would at least get ball 2 out where I could launch it into play. I had no issues at all with playing in my cabinet, however. So far, it has worked great every time but I have not yet had any long sessions with the table.
  • Like 2
Posted
#IfWinActive ahk_class SlamIt Pinball - Big Score;Left::LShift;Right::RShiftp::EscapeUp::f::  ;Send {q}  Send {w}  Send {a}returnDown::i::  Send {i}  Send {o}  ;Send {l}returne::!f4Enter::down5::11::  Send {s}  Send {Enter}return#IfWinActive

Here is what I have for key bindings. Just copy it at the end of your script, behind ExitApp

Replace Up:: with your Magnasave left key and Down:: with Magnasave right.

Then you should have:

Start button for selecting play at the game's menu

Coin button for coin

Start button for starting the game

p for pause

Launch button for plunger

Magnasave left and right for nudging (sends two button presses at once)

  • Like 1
  • 1 month later...
Posted

Update:

Copying the DMD to a second or third monitor

Done via screen capture and streaming via localhost loopback

There is a fraction of a second of latency in the streaming. It's not much but it is noticeable. It's very playable, but granted I haven't played enough of the table to know if there are video modes where the lag will make it awkward.

NOTE - I can make this work inside and outside of PinballX on my laptop-based test bed, but sadly I can't make it work on the cab. Tried on both backglass and DMD screen. Everything else was the same as far as software except that my laptop runs W7 x64 Ultimate and the cab has W7 x64 Home Edition. I wouldn't expect that to make a difference. The CPU is different: the laptop has an Intel Core i7, Q840 and the cab has an i5 3570k. The GPU is different: the laptop has an NVidia Quadro FX 880M and the cab is running a NVidia GTX660 and GT610. Consequently there are different drivers. And maybe that's the difference, but at least it may be possible for someone to make use of it.

Configuration requires the following

Windows mmpeg (static build) - http://ffmpeg.zeranoe.com/builds/

Quick installation guide - http://www.wikihow.c...mpeg-on-Windows

Screen Capturer Recorder - http://sourceforge.n...capturer/files/

Screen Capturer Recorder has some helper tools that require Java. You don't have to keep Java installed but it is helpful to have a Run Time Environment for configuring the capture setup with these helper tools

I'll use my setup as an example:

As I run the game in arcade mode, you can't see the game DMD located on the backbox. I have to place the game DMD somewhere on the playfield screen. I use bottom left and size - 2 pixel. The idea is that we'll capture just this part of the screen and then scale it up on the playback window. We can move the playback window anywhere on a backglass or DMD monitor.

Run the Screen Capturer Recorder helper tool "configure by resizing a transparent window". The idea is that you will move this window over the DMD and and drag the borders so that you will capture the entire DMD image. Once you start SlamIt, Alt-Tab to the Screen Capturer Recorder transparent window and drag it over the DMD. When you save, the tool will auto configure the size and location of the capture window. It is a little funky because the game is in portrait mode but the transparent window will remain landscape. So the "height" of the window will cover for the "width" of the DMD.

You will not be able to drag the window small enough to precisely cover the "height" of the DMD. Using the "configure by setting specific screen capture numbers" helper tool will help you get the rest of the way.

My test bed uses a 1280 x 1024 resolution, the settings wound up being

capture_height=254

capture_width=63

start_x=1203

start_y=758

My cab uses a 1920 x 1080 resolution, the settings wound up being

capture_height=254

capture_width=63

start_x=1837

start_y=814

I've been testing with default_max_fps=30 (which is the default for Screen Capturer Recorder)

As I am already using Screen Capturer Recorder for Pinball FX2 and the settings are stored in the registry. I copy my usual settings and store them temporarily and overwrite with the settings needed for SlamIt.

I'm running a p2k-style cabinet so the ffmpeg rotates and does a vflip on the image before streaming (-vf "transpose=3"). Assuming most people don't need to vflip then you will just need to rotate the image (change to -vf "transpose=1").

The ffplay client window will have a title called "udp://localhost:1234?listen". The WinMove line allows for precisely locating the client window on the second or third monitor by x and y coordinates. In my case, x=3842 and y=197.

My DMD screen uses a custom resolution of 768 x 432. As the capture width is 254, I scale the image by a factor of 3 and that fits nearly perfectly edge to edge on my monitor (-vf scale=iw*3:-1). Here, iw means "image width" and the -1 instructs ffplay to retain the aspect ratio. In other words, you do not have to define an image height

An ahk WinSet trick to hide the title bar and borders does not work on the ffplay client window. I use ahk GUI to draw a black border to hide the title bar and borders.

"WinSet, Region, 0-0 768-0 768-220 0-220 0-0 3-21 762-21 762-210 3-210 3-21" - the first set of five coordinates draws the outer border of a rectangle. The second set of five coordinates draws the inner border of the rectangle. The hole in the middle will be transparent.

"Gui, Show, W768 H220 X3840 Y198 NoActivate" - moves the border I just drew precisely over the ffplay title bar and borders.
After quitting SlamIt, the registry is overwritten again with the values that were stored at the beginning of the program
I've attached my config files in case that helps

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode 2
DetectHiddenWindows On
; Default values for Pinball FX2 - read and store capture values from registry
RegRead, fx2height, HKCU, Software\screen-capture-recorder, capture_height
RegRead, fx2width , HKCU, Software\screen-capture-recorder, capture_width
RegRead, fx2maxfps, HKCU, Software\screen-capture-recorder, default_max_fps
RegRead, fx2x , HKCU, Software\screen-capture-recorder, start_x
RegRead, fx2y , HKCU, Software\screen-capture-recorder, start_y
; Values for SlamIt - write to registry
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_height, 254
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_width, 63
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, default_max_fps, 30
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_x, 1837
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_y, 814
; Mirror and flip DMD for P2k
run, ffmpeg -rtbufsize 1500M -f dshow -framerate 30 -r 30 -i video="screen-capture-recorder" -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -vf scale=iw*3:-1 -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel
checkprocessagain:
Process, wait, ffplay.exe, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, wait, %NewPID%
Sleep, 8000
IfWinExist udp://localhost:1234?listen
{
WinMove, , , 3842, 197
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 768-0 768-220 0-220 0-0 3-21 762-21 762-210 3-210 3-21
Gui, Show, W768 H220 X3840 Y198 NoActivate
; cover an artifact
;Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
;Gui, 2:Color, 000000
;WinSet, Region, 0-0 W15 H40
;Gui, 2:Show, W15 H40 X3840 Y190 NoActivate
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevel
Process, wait, BigScore.exe
process, WaitClose, BigScore.exe
Run, taskkill /IM ffplay.exe,,UseErrorLevel
Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel
; Default values for Pinball FX2 - write to registry
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_height, %fx2height%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_width, %fx2width%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, default_max_fps, %fx2maxfps%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_x, %fx2x%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_y, %fx2y%
ExitApp

LaunchSlamIt.zip

Posted

Update:

Got this working for my cab:

Big Score writes game settings, high scores, etc. to files in the current user Documents folder.

Edit the file, settings_user_custom.cfg

In the first section, $video - change the setting of "fullscreen" from 1 to 0. There is no item on the in-game menu that allows you to change this setting, so you have to edit the file directly.

The game will play in a windowed mode that allows for streaming the DMD image where I couldn't make it happen while the game was in fullscreen mode.

The following script strips the game's Windows borders and maximizes so that it appears to be in fullscreen windowed mode.

It also launches the simulation from the in-game menu.

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode 2
DetectHiddenWindows On
; Default values for Pinball FX2 - read and store capture values from registry
RegRead, fx2height, HKCU, Software\screen-capture-recorder, capture_height
RegRead, fx2width , HKCU, Software\screen-capture-recorder, capture_width
RegRead, fx2maxfps, HKCU, Software\screen-capture-recorder, default_max_fps
RegRead, fx2x , HKCU, Software\screen-capture-recorder, start_x
RegRead, fx2y , HKCU, Software\screen-capture-recorder, start_y
; Values for SlamIt - write to registry
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_height, 254
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_width, 63
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, default_max_fps, 120
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_x, 1837
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_y, 814
; Mirror and flip DMD for P2k
run, ffmpeg -rtbufsize 1500M -f dshow -framerate 60 -r 60 -i video="screen-capture-recorder" -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -vf scale=iw*3:-1 -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel
checkprocessagain:
Process, wait, ffplay.exe, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, wait, %NewPID%
Sleep, 8000
IfWinExist udp://localhost:1234?listen
{
WinMove, , , 3842, 197
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 768-0 768-220 0-220 0-0 6-23 765-23 765-210 6-210 6-23
Gui, Show, W768 H220 X3840 Y197 NoActivate
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevel
Process, wait, BigScore.exe
Sleep 10000
; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5 Thanks
IfWinExist, ahk_class SlamIt Pinball - Big Score
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinMaximize, ahk_class SlamIt Pinball - Big Score
Send {Enter Down}, Send {Enter Up}
process, WaitClose, BigScore.exe
Run, taskkill /IM ffplay.exe,,UseErrorLevel
Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel
; Default values for Pinball FX2 - write to registry
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_height, %fx2height%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, capture_width, %fx2width%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, default_max_fps, %fx2maxfps%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_x, %fx2x%
RegWrite, REG_DWORD, HKCU, Software\screen-capture-recorder, start_y, %fx2y%
ExitApp

Again, the script flips the image for p2k-style cabinets. If you don't need to flip the image then the ffmpeg -vf filter parameter should be "transpose=1".
I've fine-tuned the border that I draw to perfectly hide the ffplay window, at least for my setup.
Here are the DMD videos to place in the media folder, one is flipped and the other is not flipped.
I will also upload these to the FTP.
Posted

Forgot to mention. It's possible to set up a 3D profile in the Nvidia Control Panel and really crank up AA and Anisotropic filtering, set Max pre-rendered frames to 1. Post-processing works well.

It's a surprisingly nice table given the reputation. A really fun theme and totally underrated. It's too bad that development fell apart on this one, leaving a lot work up to users to get it playable. But it is worth the effort.

Posted

Update:



Swapped out the separate screen-capture-recorder device for ffmpeg's built-in gdigrab device. Performs as well as screen-capture-recorder for what I need desktop capture for. Now one distribution does it all. No need for Java or for registry entries, so it is a simpler solution.



This means that the instructions to exchange registry keys goes away.





#NoEnv

#SingleInstance force

#WinActivateForce

SetTitleMatchMode 2

DetectHiddenWindows On


; Mirror and flip DMD for P2k

run, ffmpeg -rtbufsize 1500M -f gdigrab -framerate 120 -offset_x 1837 -offset_y 814 -video_size 63x254 -i desktop -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel

Sleep, 1000

run, ffplay -an -sn -vf scale=iw*3:-1 -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel

checkprocessagain:

Process, wait, ffplay.exe, 5.5

NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.

if NewPID = 0

goto checkprocessagain


Process, wait, %NewPID%

Sleep, 8000

IfWinExist udp://localhost:1234?listen

{

WinMove, , , 3842, 197

}

; draw a black border to hide the window borders for the mirror

Gui +LastFound +AlwaysOnTop -Caption +ToolWindow

Gui, Color, 000000

WinSet, Region, 0-0 768-0 768-220 0-220 0-0 6-23 765-23 765-210 6-210 6-23

Gui, Show, W768 H220 X3840 Y197 NoActivate


RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath

Run, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevel

Process, wait, BigScore.exe

Sleep 10000


; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5 Thanks

IfWinExist, ahk_class SlamIt Pinball - Big Score

{

WinSet, Style, -0xC00000 ; hide title bar

WinSet, Style, -0x800000 ; hide thin-line border

WinSet, Style, -0x400000 ; hide dialog frame

WinSet, Style, -0x40000 ; hide thickframe/sizebox

}

WinMaximize, ahk_class SlamIt Pinball - Big Score

Send {Enter Down}, Send {Enter Up}


process, WaitClose, BigScore.exe

Run, taskkill /IM ffplay.exe,,UseErrorLevel

Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel


ExitApp




Again, the script flips the image for p2k-style cabinets. If you don't need to flip the image then the ffmpeg -vf filter parameter should be "transpose=1".

  • 2 months later...
Posted

Update:

Added controls for my VirtuaPin Digital Plunger Kit v1. The controller emulates a joypad. The in-game menu has an option to configure the game for joystick inputs, and it even correctly recognizes each button when you configure, but then the controls simply do not respond during play. So, I added code to the launch script to map joypad to key presses.

I'm using a documented method using timers to enable auto-repeating keystrokes so that the flippers and plunger behave as if you were using a keyboard. A simple map sends a single keystroke. A flipper would just kick and go right back to rest. With the timers, you can hold the flipper button and the flipper will stay up. You can trap the ball, do passes to the other flipper, precisely control the plunger, etc.

From Sir Cheddar's script earlier in this thread, I borrowed the idea of simultaneous multiple key presses for the 2nd flipper buttons (MagnaSave). This gives a hard nudge that is definitely visible in the game. Thanks.

The exit button automatically scrolls through the game menu and exits the game normally. Not an Alt-F4. I don't think killing the game works too well with shutting down the DMD mirroring.

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode 2
DetectHiddenWindows On
; Mirror and flip DMD for P2k
run, ffmpeg -rtbufsize 1500M -f gdigrab -framerate 120 -offset_x 1837 -offset_y 814 -video_size 63x254 -i desktop -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -vf scale=iw*3:-1 -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel
checkprocessagain:
Process, wait, ffplay.exe, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, wait, %NewPID%
Sleep, 8000
IfWinExist udp://localhost:1234?listen
{
WinMove, , , 3842, 197
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 768-0 768-220 0-220 0-0 6-23 765-23 765-210 6-210 6-23
Gui, Show, W768 H220 X3840 Y197 NoActivate
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevel
Process, wait, BigScore.exe
Sleep 10000
; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5Thanks
IfWinExist, ahk_class SlamIt Pinball - Big Score
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinMaximize, ahk_class SlamIt Pinball - Big Score
Send {Enter Down}, Send {Enter Up}
process, WaitClose, BigScore.exe
Run, taskkill /IM ffplay.exe,,UseErrorLevel
Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel
ExitApp
#IfWinActive ahk_class SlamIt Pinball - Big Score
; Digital Plunger
Joy1::
Send {Down down}
SetTimer, WaitForJoy1, 10
return
WaitForJoy1:
if not GetKeyState("Joy1")
{
Send {Down up}
SetTimer, WaitForJoy1, off
return
}
Send {Down down}
return
; Right Flipper
Joy2::
Send {RShift down}
SetTimer, WaitForJoy2, 10
return
WaitForJoy2:
if not GetKeyState("Joy2")
{
Send {RShift up}
SetTimer, WaitForJoy2, off
return
}
Send {RShift down}
return
; Right 2nd Flipper
Joy3::
i::
Send {i}
Send {o}
;Send {l}
return
; Exit Table
Joy8::
Send {Esc}
Sleep, 10
loop, 7
{
Send {Down}
Sleep, 10
}
Send {Enter}
Sleep, 10
Send {Enter}
return
; Start Game
Joy9::
Send {s}
Send {Enter}
return
; Left Flipper
Joy10::
Send {LShift down}
SetTimer, WaitForJoy10, 10
return
WaitForJoy10:
if not GetKeyState("Joy10")
{
Send {LShift up}
SetTimer, WaitForJoy10, off
return
}
Send {LShift down}
return
; Left 2nd Flipper
Joy11::
f::
;Send {q}
Send {w}
Send {a}
return
; Insert Coin 1
Joy12::Send {1}
#IfWinActive

  • 1 month later...
Posted

Update:

For jollies, I added a feature to change the color of the DMD mirrored image. The script allows for a choice among red, green, blue, and orange along with the default yellow/amber.

Requires a text file called SlamItDMDColor.txt that resides in the same folder as the script and that has one word - red, or green, or blue, or orange. Anything else and the script will apply no processing and the DMD will be the default color.

#NoEnv  #SingleInstance force#WinActivateForceSetTitleMatchMode 2DetectHiddenWindows OnFileReadLine, dmd_color, %A_WorkingDir%\SlamItDMDColor.txt, 1Color="scale=iw*3:-1"if dmd_color=red	Color="scale=iw*3:-1,hue=h=300:s=1.5:b=-5"else if dmd_color=green	Color="scale=iw*3:-1,hue=h=100:s=2:b=-1"else if dmd_color=blue	Color="scale=iw*3:-1,hue=h=345:s=-1.5:b=-2"else if dmd_color=orange	Color="scale=iw*3:-1,hue=h=330:s=1.5:b=-1"; Mirror and flip DMD for P2krun, ffmpeg -rtbufsize 1500M -f gdigrab -framerate 120 -offset_x 1837 -offset_y 814 -video_size 63x254 -i desktop  -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevelSleep, 1000run, ffplay -an -sn -vf %Color% -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevelcheckprocessagain:	Process, wait, ffplay.exe, 5.5	NewPID = %ErrorLevel%  ; Save the value immediately since ErrorLevel is often changed.	if NewPID = 0		goto checkprocessagainProcess, wait, %NewPID%Sleep, 8000IfWinExist udp://localhost:1234?listen    {		WinMove, , , 3842, 197    } ; draw a black border to hide the window borders for the mirror Gui +LastFound +AlwaysOnTop -Caption +ToolWindowGui, Color, 000000WinSet, Region, 0-0 768-0 768-220 0-220 0-0 6-23 765-23 765-210 6-210 6-23Gui, Show, W768 H220 X3840 Y197 NoActivateRegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPathRun, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevelProcess, wait, BigScore.exeSleep 10000; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5 Thanks		IfWinExist, ahk_class SlamIt Pinball - Big Score    {		WinSet, Style, -0xC00000 ; hide title bar		WinSet, Style, -0x800000 ; hide thin-line border		WinSet, Style, -0x400000 ; hide dialog frame		WinSet, Style, -0x40000 ; hide thickframe/sizebox    } WinMaximize, ahk_class SlamIt Pinball - Big ScoreSend {Enter Down}, Send {Enter Up}process, WaitClose, BigScore.exeRun, taskkill /IM ffplay.exe,,UseErrorLevelRun, taskkill /IM ffmpeg.exe /F,,UseErrorLevelExitApp#IfWinActive ahk_class SlamIt Pinball - Big Score; Digital Plunger	Joy1::		Send {Down down}		SetTimer, WaitForJoy1, 10	return	WaitForJoy1:		if not GetKeyState("Joy1")			{				Send {Down up}				SetTimer, WaitForJoy1, off				return			}		Send {Down down}	return ; Right Flipper	Joy2::		Send {RShift down}		SetTimer, WaitForJoy2, 10	return	WaitForJoy2:		if not GetKeyState("Joy2")			{				Send {RShift up}				SetTimer, WaitForJoy2, off				return			}		Send {RShift down}	return ; Right 2nd Flipper	Joy3::		i::			Send {i}			Send {o}			;Send {l}	return; Exit Table	Joy8::		Send {Esc}		Sleep, 10		loop, 7			{				Send {Down}				Sleep, 10			}		Send {Enter}		Sleep, 10		Send {Enter}	return; Start Game	Joy9::		Send {s}		Send {Enter}	return; Left Flipper	Joy10::		Send {LShift down}		SetTimer, WaitForJoy10, 10	return	WaitForJoy10:		if not GetKeyState("Joy10")			{				Send {LShift up}				SetTimer, WaitForJoy10, off				return			}		Send {LShift down}	return ; Left 2nd Flipper	Joy11::		f::			;Send {q}			Send {w}			Send {a}	return; Insert Coin 1	Joy12::Send {1}#IfWinActive

Basically, any color can be reproduced. The inputs are based on the Hue, Saturation, Brightness color model. In the ffmpeg implementation Hue takes on values from 0 to 360 deg while Saturation and Brightness take on values from -10 to 10. However, you can't simply find a color picker and use the values there. The tricky part is that the adjustment is made in reference to the default yellow/amber color rather than 0 deg, pure red. I found some decent values by trial and error using VLC and some other freeware tools that allowed me to do some real time (or at least close to real time) previews as I made adjustments.

In theory, the technique could be applied on FX2 although you would have to figure out the values to apply multiple times as the default color varies by table. It may not be practical. And for multi-player hotseat games it probably would not be satisfactory at all. Each player typically has a different DMD color that switches as a player's turn comes up. But the potential is there to do some further customization for single player games.

  • Like 1
Posted

Damn! Forgot about adding the other cool effects.

Especially LSD, rotates hue and makes the saturation swing between 0 and 2 over a period of 1 second. It's a trip.

#NoEnv

#SingleInstance force

#WinActivateForce
SetTitleMatchMode 2
DetectHiddenWindows On
FileReadLine, dmd_color, %A_WorkingDir%\SlamItDMDColor.txt, 1
Color="scale=iw*3:-1"
if dmd_color=red
Color="scale=iw*3:-1,hue=h=300:s=1.5:b=-5"
else if dmd_color=green
Color="scale=iw*3:-1,hue=h=100:s=2:b=-1"
else if dmd_color=blue
Color="scale=iw*3:-1,hue=h=345:s=-1.5:b=-2"
else if dmd_color=orange
Color="scale=iw*3:-1,hue=h=330:s=1.5:b=-1"
else if dmd_color=white
Color="scale=iw*3:-1,format=pix_fmts=gray"
else if dmd_color=LSD
Color="scale=iw*3:-1,hue='H=2*PI*t: s=sin(2*PI*t)+1'"
else if dmd_color=dream
Color="scale=iw*3:-1,noise=alls=20:allf=t+u, curves=master='0.0627/0 0.1/0.15 0.9215/1'"
else if dmd_color=thermo
Color="scale=iw*3:-1,curves=r='0.4/0 0.6/1':g='0.25/1 0.75/0.5 0.9/0 1/1':b='0/1 0.25/0 0.75/0 1/1'"
; Mirror and flip DMD for P2k
run, ffmpeg -rtbufsize 1500M -f gdigrab -framerate 120 -offset_x 1837 -offset_y 814 -video_size 63x254 -i desktop -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -vf %Color% -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel
checkprocessagain:
Process, wait, ffplay.exe, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, wait, %NewPID%
Sleep, 8000
IfWinExist udp://localhost:1234?listen
{
WinMove, , , 3842, 197
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 768-0 768-220 0-220 0-0 6-23 765-23 765-210 6-210 6-23
Gui, Show, W768 H220 X3840 Y197 NoActivate
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevel
Process, wait, BigScore.exe
Sleep 10000
; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5Thanks
IfWinExist, ahk_class SlamIt Pinball - Big Score
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinMaximize, ahk_class SlamIt Pinball - Big Score
Send {Enter Down}, Send {Enter Up}
process, WaitClose, BigScore.exe
Run, taskkill /IM ffplay.exe,,UseErrorLevel
Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel
ExitApp
#IfWinActive ahk_class SlamIt Pinball - Big Score
; Digital Plunger
Joy1::
Send {Down down}
SetTimer, WaitForJoy1, 10
return
WaitForJoy1:
if not GetKeyState("Joy1")
{
Send {Down up}
SetTimer, WaitForJoy1, off
return
}
Send {Down down}
return
; Right Flipper
Joy2::
Send {RShift down}
SetTimer, WaitForJoy2, 10
return
WaitForJoy2:
if not GetKeyState("Joy2")
{
Send {RShift up}
SetTimer, WaitForJoy2, off
return
}
Send {RShift down}
return
; Right 2nd Flipper
Joy3::
i::
Send {i}
Send {o}
;Send {l}
return
; Exit Table
Joy8::
Send {Esc}
Sleep, 10
loop, 7
{
Send {Down}
Sleep, 10
}
Send {Enter}
Sleep, 10
Send {Enter}
return
; Start Game
Joy9::
Send {s}
Send {Enter}
return
; Left Flipper
Joy10::
Send {LShift down}
SetTimer, WaitForJoy10, 10
return
WaitForJoy10:
if not GetKeyState("Joy10")
{
Send {LShift up}
SetTimer, WaitForJoy10, off
return
}
Send {LShift down}
return
; Left 2nd Flipper
Joy11::
f::
;Send {q}
Send {w}
Send {a}
return
; Insert Coin 1
Joy12::Send {1}
#IfWinActive

So the potential is there to pull off all kinds of ideas for real time image processing.

  • Like 1
Posted

Update:

For several months now, I maintained a custom resolution for my third display because of VPM. The rendering of a DMD in VPM's native resolution is limited to a max of 768 x 192 for the standard DMD 4:1 aspect ratio. Try to go any higher and VPM just draws black bars around the image. So, I simply kept my third screen at 768 px width all the time. Sadly, you maintain such a low resolution for generating "pixel perfect" reproductions with the side effect of diminished contrast and brightness of the image. It's tolerable, but you do it for VPM and all other systems also suffer for it.

Now, I use the Display Changer 2 utility and scripts to change the monitor resolution as I launch VP. I use my monitor's native resolution of 1600 x 900 for PinballX and all other systems. FutureDMD at the higher resolution is a revelation. So much brighter!

This leads to the an update/upgrade for SlamIt. Basically, the script just scales by a factor of 6.25 to fit edge-to-edge on a 1600 px width screen. It is pretty easy to change that number to fit any kind of screen.

In the course of fine tuning, I found that I was cutting off a column of pixels on the left of the DMD. I changed the capture area from 63x255 to 63x256 to bring it back. I would think that the perfect capture area would be 64x256 as it corresponds to a 4:1 aspect ratio. I tried adjusting the offset but I was still capturing a noticeable piece of the background around the DMD at 64 px. It has to be 63 px, trust me.

At any rate, in the course of updating/upgrading systems I've at least determined the dimensions needed to hide the ffplay playback window. As a reminder, the tactic of using WinSet to remove titles and borders from the playback window do not work. Ffplay will just redraw them. So, I just hide them behind a black frame that I draw. I've determined that the dimensions of the window correspond exactly to the capture area defined by the video_size parameter that ffmpeg uses to capture and stream. FFplay then draws a border 4 px wide on the left, right, and bottom. The top also has the title bar. It is 23 px wide.

So, if I am playing back an image 1600 px wide and 394 px high. I'd draw the outer rectangle at 1608 x 421. The inner rectangle which is transparent, starts at X pos 4 and runs to X pos 1604 and starts at Y pos 23 and runs to Y pos 417.

Move both the playback window and the black border to the same X and Y position on the desktop. Could be third screen or second screen or wherever.

Note that this is with Aero off. I don't know that it will be the same for Aero on. Probably not. It is pretty simple to add some lines of script to turn Aero off and then back on when the app closes. I just have Aero off all the time.

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode 2
DetectHiddenWindows On
FileReadLine, dmd_color, %A_WorkingDir%\SlamItDMDColor.txt, 1
Color="scale=iw*6.25:-1"
if dmd_color=red
Color="scale=iw*6.25:-1,hue=h=300:s=1.5:b=-5"
else if dmd_color=green
Color="scale=iw*6.25:-1,hue=h=100:s=2:b=-1"
else if dmd_color=blue
Color="scale=iw*6.25:-1,hue=h=345:s=-1.5:b=-2"
else if dmd_color=orange
Color="scale=iw*6.25:-1,hue=h=330:s=1.5:b=-1"
else if dmd_color=white
Color="scale=iw*6.25:-1,format=pix_fmts=gray"
else if dmd_color=LSD
Color="scale=iw*6.25:-1,hue='H=2*PI*t: s=sin(2*PI*t)+1'"
else if dmd_color=dream
Color="scale=iw*6.25:-1,noise=alls=20:allf=t+u, curves=master='0.0627/0 0.1/0.15 0.9215/1'"
else if dmd_color=thermo
Color="scale=iw*6.25:-1,curves=r='0.4/0 0.6/1':g='0.25/1 0.75/0.5 0.9/0 1/1':b='0/1 0.25/0 0.75/0 1/1'"
; Mirror and flip DMD for P2k
run, ffmpeg -rtbufsize 1500M -f gdigrab -framerate 120 -offset_x 1837 -offset_y 813 -video_size 63x256 -i desktop -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -vf %Color% -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel
checkprocessagain:
Process, wait, ffplay.exe, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, wait, %NewPID%
Sleep, 8000
IfWinExist udp://localhost:1234?listen
{
WinMove, , , 3840, 400
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 1608-0 1608-421 0-421 0-0 4-23 1604-23 1604-417 4-417 4-23
Gui, Show, W1608 H421 X3840 Y400 NoActivate
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevel
Process, wait, BigScore.exe
Sleep 10000
; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5Thanks
IfWinExist, ahk_class SlamIt Pinball - Big Score
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinMaximize, ahk_class SlamIt Pinball - Big Score
Send {Enter Down}, Send {Enter Up}
process, WaitClose, BigScore.exe
Run, taskkill /IM ffplay.exe,,UseErrorLevel
Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel
ExitApp
#IfWinActive ahk_class SlamIt Pinball - Big Score
; Digital Plunger
Joy1::
Send {Down down}
SetTimer, WaitForJoy1, 10
return
WaitForJoy1:
if not GetKeyState("Joy1")
{
Send {Down up}
SetTimer, WaitForJoy1, off
return
}
Send {Down down}
return
; Right Flipper
Joy2::
Send {RShift down}
SetTimer, WaitForJoy2, 10
return
WaitForJoy2:
if not GetKeyState("Joy2")
{
Send {RShift up}
SetTimer, WaitForJoy2, off
return
}
Send {RShift down}
return
; Right 2nd Flipper
Joy3::
i::
Send {i}
Send {o}
;Send {l}
return
; Exit Table
Joy8::
Send {Esc}
Sleep, 10
loop, 7
{
Send {Down}
Sleep, 10
}
Send {Enter}
Sleep, 10
Send {Enter}
return
; Start Game
Joy9::
Send {s}
Send {Enter}
return
; Left Flipper
Joy10::
Send {LShift down}
SetTimer, WaitForJoy10, 10
return
WaitForJoy10:
if not GetKeyState("Joy10")
{
Send {LShift up}
SetTimer, WaitForJoy10, off
return
}
Send {LShift down}
return
; Left 2nd Flipper
Joy11::
f::
;Send {q}
Send {w}
Send {a}
return
; Insert Coin 1
Joy12::Send {1}
#IfWinActive

I guess the next step will be to see if I can do anything to get an analog plunger working with the game. They claim to support a game controller, and you can even map joystick buttons in the menu, but they don't work in the game.
Posted

That's not the way ffmpeg documents the video_size parameter. A preset for video_size is vga which they have the same as 640x480 and not 639x479. I'm guessing that it is just how SlamIt works. There are three sizes of DMD, I just picked the middle one as it is big enough to see when I am playing and not too large to obscure the playfield. (I'm one of those weirdos who thinks the display should be on the apron. That's where your eyes are at most of the time.) Perhaps one of those other sizes is exactly 4:1.

  • Like 1
Posted

Update:

I've adopted NVidia's DSR feature as described here:

http://pinballarcadefans.com/showthread.php/9055-Pinball-Arcade-in-4K-Resolution-with-new-nvidia-driver

This also works very well for SlamIt. Brings out a lot of detail. Basically, the game renders at 4K and is downsampled to 1080p. If you have a 500 series card or later, you can enable DSR in the 3D Global Settings and select 4.0X downsampling. This allows a 4K resolution option to be exposed and it is selectable in the in-game menu. The DMD is not redrawn to scale. To avoid the need for further increasing the upscaling of the DMD when I capture and mirror it, I've selected the largest DMD size in the in-game menu, 3 pixel, and then changed the capture parameters in my script. Conceptually, everything else is pretty much the same.

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode 2
DetectHiddenWindows On
FileReadLine, dmd_color, %A_WorkingDir%\SlamItDMDColor.txt, 1
Color="scale=iw*(1600/384):-1"
if dmd_color=red
Color="scale=iw*(1600/384):-1,hue=h=300:s=1.5:b=-5"
else if dmd_color=green
Color="scale=iw*(1600/384):-1,hue=h=100:s=2:b=-1"
else if dmd_color=blue
Color="scale=iw*(1600/384):-1,hue=h=345:s=-1.5:b=-2"
else if dmd_color=orange
Color="scale=iw*(1600/384):-1,hue=h=330:s=1.5:b=-1"
else if dmd_color=white
Color="scale=iw*(1600/384):-1,format=pix_fmts=gray"
else if dmd_color=LSD
Color="scale=iw*(1600/384):-1,hue='H=2*PI*t: s=sin(2*PI*t)+1'"
else if dmd_color=dream
Color="scale=iw*(1600/384):-1,noise=alls=20:allf=t+u, curves=master='0.0627/0 0.1/0.15 0.9215/1'"
else if dmd_color=thermo
Color="scale=iw*(1600/384):-1,curves=r='0.4/0 0.6/1':g='0.25/1 0.75/0.5 0.9/0 1/1':b='0/1 0.25/0 0.75/0 1/1'"
; Mirror and flip DMD for P2k
run, ffmpeg -rtbufsize 1500M -f gdigrab -framerate 120 -offset_x 3706 -offset_y 1754 -video_size 95x384 -i desktop -vf "transpose=3" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -vf %Color% -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel
checkprocessagain:
Process, wait, ffplay.exe, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, wait, %NewPID%
Sleep, 8000
IfWinExist udp://localhost:1234?listen
{
WinMove, , , 5760, 400
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 1608-0 1608-423 0-423 0-0 4-23 1604-23 1604-419 4-419 4-23
Gui, Show, W1608 H423 X5760 Y400 NoActivate
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevel
Process, wait, BigScore.exe
Sleep 10000
; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5Thanks
IfWinExist, ahk_class SlamIt Pinball - Big Score
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinMaximize, ahk_class SlamIt Pinball - Big Score
Send {Enter Down}, Send {Enter Up}
process, WaitClose, BigScore.exe
Run, taskkill /IM ffplay.exe,,UseErrorLevel
Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel
ExitApp
#IfWinActive ahk_class SlamIt Pinball - Big Score
; Digital Plunger
Joy1::
Send {Down down}
SetTimer, WaitForJoy1, 10
return
WaitForJoy1:
if not GetKeyState("Joy1")
{
Send {Down up}
SetTimer, WaitForJoy1, off
return
}
Send {Down down}
return
; Right Flipper
Joy2::
Send {RShift down}
SetTimer, WaitForJoy2, 10
return
WaitForJoy2:
if not GetKeyState("Joy2")
{
Send {RShift up}
SetTimer, WaitForJoy2, off
return
}
Send {RShift down}
return
; Right 2nd Flipper
Joy3::
i::
Send {i}
Send {o}
;Send {l}
return
; Exit Table
Joy8::
Send {Esc}
Sleep, 10
loop, 7
{
Send {Down}
Sleep, 10
}
Send {Enter}
Sleep, 10
Send {Enter}
return
; Start Game
Joy9::
Send {s}
Send {Enter}
return
; Left Flipper
Joy10::
Send {LShift down}
SetTimer, WaitForJoy10, 10
return
WaitForJoy10:
if not GetKeyState("Joy10")
{
Send {LShift up}
SetTimer, WaitForJoy10, off
return
}
Send {LShift down}
return
; Left 2nd Flipper
Joy11::
f::
;Send {q}
Send {w}
Send {a}
return
; Insert Coin 1
Joy12::Send {1}
#IfWinActive

  • Like 1
  • 4 weeks later...
Posted

Update:

A couple of fairly minor tweaks:

1. I've switched the filters so that ffmpeg, the streamer, now does the scaling and ffplay, the player, now just does the rotation. ffplay has the reputation of producing artifacts when it is scaling, so in theory this should produce better quality. I've found having ffmpeg do the scaling does slightly affect the size of the playback window. I've had to make an adjustment to the border that I draw and lay on top of the playback window.

2. Made the script a little more portable. Enter the path to ffmpeg at the top of the script

3. I'm now running a loop that checks for the ffplay window prior to moving it rather than having ahk wait a hard coded period of time. I've started using this subroutine in all my scripts where I am mirroring the DMD. The user no longer has to set their own delays and it works great with the latest versions of the ffmpeg static build rather than being forced to use an older build. Can just grab the latest build at the zeranoe front page.

4. Cleaned up code a little for readability

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode, 2
DetectHiddenWindows, On
; User inputs
FFMPEG_Path=c:\FFMPEG\bin
FileReadLine, dmd_color, %A_WorkingDir%\SlamItDMDColor.txt, 1
Color="scale=iw*(1600/384):-1"
If dmd_color=red
Color="scale=iw*(1600/384):-1,hue=h=300:s=1.5:b=-5"
Else If dmd_color=green
Color="scale=iw*(1600/384):-1,hue=h=100:s=2:b=-1"
Else If dmd_color=blue
Color="scale=iw*(1600/384):-1,hue=h=345:s=-1.5:b=-2"
Else If dmd_color=orange
Color="scale=iw*(1600/384):-1,hue=h=330:s=1.5:b=-1"
Else If dmd_color=white
Color="scale=iw*(1600/384):-1,format=pix_fmts=gray"
Else If dmd_color=LSD
Color="scale=iw*(1600/384):-1,hue='H=2*PI*t: s=sin(2*PI*t)+1'"
Else If dmd_color=dream
Color="scale=iw*(1600/384):-1,noise=alls=20:allf=t+u, curves=master='0.0627/0 0.1/0.15 0.9215/1'"
Else If dmd_color=thermo
Color="scale=iw*(1600/384):-1,curves=r='0.4/0 0.6/1':g='0.25/1 0.75/0.5 0.9/0 1/1':b='0/1 0.25/0 0.75/0 1/1'"
; Mirror and flip DMD for P2k
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 120 -offset_x 3706 -offset_y 1754 -video_size 95x384 -i desktop -vf %Color% -c:v mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,, Hide
Sleep, 1000
Run, %FFMPEG_Path%\ffplay -an -sn -vf "transpose=3" -i -fflags nobuffer udp://localhost:1234?listen,, Hide
checkwindowagain:
IfWinExist udp://localhost:1234?listen
{
WinMove, udp://localhost:1234?listen,,5760,400
}
Else
Goto checkwindowagain
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 1608-0 1608-423 0-423 0-0 4-23 1604-23 1604-417 4-417 4-23
Gui, Show, W1608 H423 X5760 Y400 NoActivate
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430
Process, Wait, BigScore.exe
Sleep, 10000
; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5Thanks
IfWinExist, ahk_class SlamIt Pinball - Big Score
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinMaximize, ahk_class SlamIt Pinball - Big Score
Send {Enter Down}, Send {Enter Up}
Process, WaitClose, BigScore.exe
Run, taskkill /IM ffplay.exe
Run, taskkill /IM ffmpeg.exe /F
ExitApp
#IfWinActive ahk_class SlamIt Pinball - Big Score
; Digital Plunger
Joy1::
Send {Down down}
SetTimer, WaitForJoy1, 10
Return
WaitForJoy1:
If not GetKeyState("Joy1")
{
Send {Down up}
SetTimer, WaitForJoy1, off
Return
}
Send {Down down}
Return
; Right Flipper
Joy2::
Send {RShift down}
SetTimer, WaitForJoy2, 10
Return
WaitForJoy2:
If not GetKeyState("Joy2")
{
Send {RShift up}
SetTimer, WaitForJoy2, off
Return
}
Send {RShift down}
Return
; Right 2nd Flipper
Joy3::
i::
Send {i}
Send {o}
;Send {l}
Return
; Exit Table
Joy8::
Send {Esc}
Sleep, 10
Loop, 7
{
Send {Down}
Sleep, 10
}
Send {Enter}
Sleep, 10
Send {Enter}
Return
; Start Game
Joy9::
Send {s}
Send {Enter}
Return
; Left Flipper
Joy10::
Send {LShift down}
SetTimer, WaitForJoy10, 10
Return
WaitForJoy10:
If not GetKeyState("Joy10")
{
Send {LShift up}
SetTimer, WaitForJoy10, off
Return
}
Send {LShift down}
Return
; Left 2nd Flipper
Joy11::
f::
;Send {q}
Send {w}
Send {a}
Return
; Insert Coin 1
Joy12::Send {1}
#IfWinActive

Note: I'm currently experiencing sporadic crashes with the game which I believe is caused by the latest NVidia drivers. It crashes with the old script and the new. Older versions of ffmpeg and newer versions. I'm using 347.52. I didn't experience any issues with the previous public version. Hopefully the next update will work better. Or else I'll have to try using a different resolution.

  • Like 1
  • 6 months later...
Posted

I purchased SlamIt Pinball: Big Score for like a dollar or two in the last Steam Summer Sale. It's a pretty decent game once you do the work of getting the game updated and configured. Steam sells the v1.0 release which is apparently pretty buggy. You must manually apply the patches and updates yourself. Follow the guide:

http://steamcommunity.com/app/12430/guides/

The patch can be downloaded here:

http://games.softpedia.com/get/Patch/SlamIt-Pinball-Big-Score-Patch.shtml

Support was added to versions of FPLaunch/HP but I have not seen anything yet for PinballX. It is pretty straightforward though.

LaunchSlamIt.ahk and SlamIt.xml

#NoEnv  #SingleInstance forceRegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPathRun, "%SteamDirPath%\Steam.exe" -applaunch 12430,,UseErrorLevelProcess, wait, BigScore.exeprocess, WaitClose, BigScore.exeExitApp
<?xml version="1.0" standalone="yes"?><menu>	<game name="BigScore">		<description>BigScore (SlamIt)</description>		<manufacturer>Technetium Games</manufacturer>		<year>2009</year>		<type>SS</type>		<hidedmd>True</hidedmd>		<hidebackglass>False</hidebackglass>		<enabled>True</enabled>		<rating>0</rating>	</game></menu>

[system_4]
Name=SlamIt
WorkingPath=C:\PinballX\Scripts
TablePath=
Executable=LaunchSlamIt.exe
Enabled=True
Parameters=
LaunchBeforeWorkingPath=
LaunchBeforeExecutable=
LaunchBeforeParameters=
Media pack from BigBoss includes backglass image and wheel image
I uploaded a company logo for the developer, Technetium Games, on the FTP
I also uploaded a flyer image based on box art - BigScore (SlamIt)
and a table video that I got off of youtube and then rotated using Avidemux
I had an issue with my test build where I could start a game but ball 1 would not come out. Tilting would at least get ball 2 out where I could launch it into play. I had no issues at all with playing in my cabinet, however. So far, it has worked great every time but I have not yet had any long sessions with the table.

Picked this game up and figured I might try to get it to work in the cab. Thanks CP, as I followed what you did here and it worked!

It was more of a challenge to learn how to get it to work in the cab then actually playing the game for me. Anyway .. thanks again :D

Posted

Thanks, I will have look :D

  • 2 months later...
Posted

Tweaked for Windows 10. Window borders and title bar underwent a redesign from Win 7. No more aero and the basic Windows theme that I had been using and carried over from Win 7 now has thicker borders.

I now use the default Windows 10 theme. It virtually has no borders, so I just need to draw a little strip to mask the mirror playback title bar (ffplay). The default height of the title bar is 31 px. The width remains the same. Now, it is a little bit easier to draw a single rectangle than it was to draw a box within a box where the inner box was transparent to allow seeing the playback window. Tested with ffmpeg static build 12/17.

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode, 2
DetectHiddenWindows, On
; User inputs
antimicro_Path=c:\antimicro
FFMPEG_Path=c:\ffmpeg\bin
FileReadLine, dmd_color, %A_WorkingDir%\SlamItDMDColor.txt, 1
Color="scale=iw*(1600/384):-1"
If dmd_color=red
Color="scale=iw*(1600/384):-1,hue=h=300:s=1.5:b=-5"
Else If dmd_color=green
Color="scale=iw*(1600/384):-1,hue=h=100:s=2:b=-1"
Else If dmd_color=blue
Color="scale=iw*(1600/384):-1,hue=h=345:s=-1.5:b=-2"
Else If dmd_color=orange
Color="scale=iw*(1600/384):-1,hue=h=330:s=1.5:b=-1"
Else If dmd_color=white
Color="scale=iw*(1600/384):-1,format=pix_fmts=gray"
Else If dmd_color=LSD
Color="scale=iw*(1600/384):-1,hue='H=2*PI*t: s=sin(2*PI*t)+1'"
Else If dmd_color=dream
Color="scale=iw*(1600/384):-1,noise=alls=20:allf=t+u, curves=master='0.0627/0 0.1/0.15 0.9215/1'"
Else If dmd_color=thermo
Color="scale=iw*(1600/384):-1,curves=r='0.4/0 0.6/1':g='0.25/1 0.75/0.5 0.9/0 1/1':b='0/1 0.25/0 0.75/0 1/1'"
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, %antimicro_Path%\antimicro --no-tray --hidden --profile "%antimicro_Path%\profiles\SlamIt.joystick.amgp"
; Mirror and flip DMD for P2k
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 120 -offset_x 3706 -offset_y 1754 -video_size 95x384 -i desktop -vf %Color% -c:v mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,, Hide
Sleep, 1000
Run, %FFMPEG_Path%\ffplay -an -sn -vf "transpose=3" -i -fflags nobuffer udp://localhost:1234?listen,, Hide
Loop, 2
{
checkwindowagain:
IfWinExist, udp://localhost:1234?listen
WinMove, udp://localhost:1234?listen,, 5760, 400
Else
Goto, checkwindowagain
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 W1608 H31
Gui, Show, W1608 H31 X5760 Y400 NoActivate
Run, "%SteamDirPath%\Steam.exe" -applaunch 12430
WinWait, ahk_class SlamIt Pinball - Big Score
Sleep, 10000
; remove borders from BigScore adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5 Thanks
IfWinExist, ahk_class SlamIt Pinball - Big Score
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinMaximize, ahk_class SlamIt Pinball - Big Score
Send {Enter Down}, Send {Enter Up}
Process, WaitClose, BigScore.exe
Run, taskkill /im antimicro.exe /f,, Hide
Run, taskkill /im ffplay.exe,, Hide
Run, taskkill /im ffmpeg.exe /f,, Hide
Gui, Destroy
ExitApp
#IfWinActive ahk_class SlamIt Pinball - Big Score
; Digital Plunger
Joy1::
Send {Down down}
SetTimer, WaitForJoy1, 10
Return
WaitForJoy1:
If not GetKeyState("Joy1")
{
Send {Down up}
SetTimer, WaitForJoy1, off
Return
}
Send {Down down}
Return
; Right Flipper
Joy2::
Send {RShift down}
SetTimer, WaitForJoy2, 10
Return
WaitForJoy2:
If not GetKeyState("Joy2")
{
Send {RShift up}
SetTimer, WaitForJoy2, off
Return
}
Send {RShift down}
Return
; Right 2nd Flipper
Joy3::
i::
Send {i}
Send {o}
;Send {l}
Return
; Exit Table
e::
Send {Esc}
Sleep, 10
Loop, 7
{
Send {Down}
Sleep, 10
}
Send {Enter}
Sleep, 10
Send {Enter}
Return
; Start Game
Joy9::
Send {s}
Send {Enter}
Return
; Left Flipper
Joy10::
Send {LShift down}
SetTimer, WaitForJoy10, 10
Return
WaitForJoy10:
If not GetKeyState("Joy10")
{
Send {LShift up}
SetTimer, WaitForJoy10, off
Return
}
Send {LShift down}
Return
; Left 2nd Flipper
Joy11::
f::
;Send {q}
Send {w}
Send {a}
Return
; Insert Coin 1
Joy12::Send {1}
#IfWinActive

  • Like 1
  • 11 months later...
Posted

As mentioned in the first post I created some media pack images to be used with Big Score and PinballX. Just to spell it out:

All sources are trademarks/copyrights of their respective owners. My work is free to use by the community without attribution and is to be privately used in PinballX or for other non-commercial (or at least non-profit) pinball-related applications. I hold no responsibility for their misuse. 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...