Build Your Own Arcade Controls Forum
Main => Main Forum => Topic started by: tscottn on February 18, 2019, 03:26:09 pm
-
Well let me see if I can explain this correctly so maybe a expert here can point me in the direction of a solution...
my mame cab is running windows 7 using attract mode as the FE.
I would like the system to launch Galaga on startup and then when I exit out of the game I would like it to start the FE. I have it all running fine using a batch file that looks kind of like this..
pushd d:\blah blah
call "d:\blah blah\mame.exe" galaga
pushd d:\blah blah
call "d:\blah blah\attract.exe"
(obviously substitute the "blah" for my actual directories)
this all works fine and dandy except!!!! when the batch file calls the first program ( in this case its mame.exe running the galaga rom) the game goes to a minimized state because the CMD window is still open in front of mame waiting for the exit of mame in order to call attract mode.
I have tried using the minimize option for the batch file but it seems that as long as the CMD is still open it will always minimize mame behind it.. I hope this makes sense and maybe someone has a solution.. Thanks..
Unfortunately there is no option to run a specific rom directly on startup of Attract mode that I can see. I think there is a option for random or last game played but thats it.. no specific rom on start..
thanks again
-
Not familiar with pushd or why you're using call. Anyway, have you tried simply:
d:
cd "blah\mame"
mame.exe galaga
cd "blah\attract mode"
attract.exe
-
hi, yes tried the simplest method and it seems that doing it the way you suggest causes a few issues.. first is that mame is then set in the background behind the FE.. so the FE takes over the screen.. also I can actually use a pause command in the batch file however then when the FE does load in the back behind mame/galaga you can hear all the video sounds from the FE because its not in a suspended mode.. which is what would happen in you ran a rom from within the FE
I hope that makes sense.. I was hoping some others have already accomplished this but it looks like I may be on my own here.. I may just go back to the original setup and load the FE only.. oh well.. )) thanks for the response..
-
I'm confused. I thought you wanted MAME to run Galaga, and then when you quit MAME, load the FE? So, not sure why you're talking about the FE running behind MAME, etc. I just tried the batch file above, and it seems to work fine for me.
-
.....is Galaga that special a game to go to such lengths?
-
tscottn:
How about one better? NO BATCH FILE!
I can write one small program that will start your whole arcade for you.
* No black box to ugly things up.
* No overlapping FE. Batch file is not waiting for mame to exit.
* Fade-in splash screen, optional. Startup sound, optional.
* Source code, in case you want to make changes.
What i need:
Correct paths. No more blah, blah, blah.
List of all items and events you want to make your arcade run.
Optional:
Logo.
Wallpaper, for splash background.
Name of startup sound.
Desktop resolution. 1920x1080, 1366x768, 1024x768, 800x600, or vert 1080x1920, 768x1366, 768x1024, 600x800.
Cocktail Table? No problem. Head 2 head, side by side, or 2-up splash screen.
Let me know if this would meet your needs.
And hell, IT'S FREE! :applaud:
- David
-
.....is Galaga that special a game to go to such lengths?
Prob cabinet theme. It's special to tscottn, and that's all that matters. I'm sure each of us have
features in our arcades to make them unique and express our own individual style.
Every time i help someone else with their arcade project, i get twice as many new ideas for my
next build. :cheers:
-
.....is Galaga that special a game to go to such lengths?
Prob cabinet theme. It's special to tscottn, and that's all that matters. I'm sure each of us have
features in our arcades to make them unique and express our own individual style.
Every time i help someone else with their arcade project, i get twice as many new ideas for my
next build. :cheers:
well said sir. My arcade is actually Galaga themed and it is my fav game from back in the day, so yes it is pretty special to m,me, hence why I would like to have it run the game from the start.
-
tscottn:
How about one better? NO BATCH FILE!
I can write one small program that will start your whole arcade for you.
* No black box to ugly things up.
* No overlapping FE. Batch file is not waiting for mame to exit.
* Fade-in splash screen, optional. Startup sound, optional.
* Source code, in case you want to make changes.
What i need:
Correct paths. No more blah, blah, blah.
List of all items and events you want to make your arcade run.
Optional:
Logo.
Wallpaper, for splash background.
Name of startup sound.
Desktop resolution. 1920x1080, 1366x768, 1024x768, 800x600, or vert 1080x1920, 768x1366, 768x1024, 600x800.
Cocktail Table? No problem. Head 2 head, side by side, or 2-up splash screen.
Let me know if this would meet your needs.
And hell, IT'S FREE! :applaud:
- David
Well, im not sure how I can pass this offer up. Thanks a lot killallhumans. I will send you a PM with the details you requested. Cant wait to try it out!
-
Holy cow! Look at what I found.
Now we have to do a splash screen.
Don't worry about black background. I can clean that out to show your wallpaper.
-
For anyone else keeping tabs on this thread, I wouldn't want to leave you out.
#NoTrayIcon
#include <File.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
Dim $_GuiDelete
Local $sTestPath = _PathFull('splash.png')
If Not FileExists ('splash.png') Then FileInstall ('splash.png', $sTestPath)
Local $sSoundPath = _PathFull('splash.wav')
If Not FileExists ('splash.wav') Then FileInstall ('splash.wav', $sSoundPath)
$sPng = 'splash.png'
_GDIPlus_Startup ()
$hImage = _GDIPlus_ImageLoadFromFile ($sPng)
$_Gui = GUICreate ('gui', 768, 1366, 0, 0, -1, BitOR ($WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
For $iFadeIn = 1 To 255 Step 10
$hImage = _ImageResize ($sPng, 768, 1366)
_SetBitMap ($_Gui, $hImage, 768, 1366, $iFadeIn)
GUISetState (@SW_SHOW)
Next
$sSnd = 'splash.wav'
SoundPlay($sSnd, 1)
Sleep (500)
For $iFadeOut = 255 To 1 Step -10
$hImage = _ImageResize ($sPng, 768, 1366)
_SetBitMap ($_Gui, $hImage, 768, 1366, $iFadeOut)
GUISetState (@SW_SHOW)
Next
_GDIPlus_GraphicsDispose ($hImage)
_GDIPlus_Shutdown ()
While Not $_GuiDelete
$_GuiDelete = Not GUIDelete (WinGetHandle ('gui'))
WEnd
Exit
Func _SetBitmap ($hGUI, $hImage, $n_width, $n_height, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC (0)
$hMemDC = _WinAPI_CreateCompatibleDC ($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap ($hImage)
$hOld = _WinAPI_SelectObject ($hMemDC, $hBitmap)
$tSize = DllStructCreate ($tagSIZE)
$pSize = DllStructGetPtr ($tSize)
DllStructSetData ($tSize, 'X', $n_width)
DllStructSetData ($tSize, 'Y', $n_height)
$tSource = DllStructCreate ($tagPOINT)
$pSource = DllStructGetPtr ($tSource)
$tBlend = DllStructCreate ($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr ($tBlend)
DllStructSetData ($tBlend, 'Alpha', $iOpacity)
DllStructSetData ($tBlend, 'Format', 1)
_WinAPI_UpdateLayeredWindow ($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC (0, $hScrDC)
_WinAPI_SelectObject ($hMemDC, $hOld)
_WinAPI_DeleteObject ($hBitmap)
_WinAPI_DeleteDC ($hMemDC)
EndFunc ;==> _SetBitmap ()
Func _ImageResize ($sInImage, $newW, $newH, $sOutImage = '')
Local $oldImage, $GC, $newBmp, $newGC
If $sOutImage = '' Then _GDIPlus_Startup ()
$oldImage = _GDIPlus_ImageLoadFromFile ($sInImage)
$GC = _GDIPlus_ImageGetGraphicsContext ($oldImage)
$newBmp = _GDIPlus_BitmapCreateFromGraphics ($newW, $newH, $GC)
$newGC = _GDIPlus_ImageGetGraphicsContext ($newBmp)
_GDIPlus_GraphicsDrawImageRect ($newGC, $oldImage, 0, 0, $newW, $newH)
_GDIPlus_GraphicsDispose ($GC)
_GDIPlus_GraphicsDispose ($newGC)
_GDIPlus_ImageDispose ($oldImage)
If $sOutImage = '' Then
Return $newBmp
Else
_GDIPlus_ImageSaveToFile ($newBmp, $sOutImage)
_GDIPlus_BitmapDispose ($newBmp)
_GDIPlus_Shutdown ()
Return 1
EndIf
EndFunc ;==> _ImageResize ()
-
Autoit script, right? The right choice ;)
-
Yes, Sir.
Look for 768x1366. Change them to 1920x1080, or whatever your desktop is.
Also look for 0, 0, just before it, if you want to move it, and other setting will
be your image size. Sleep sets delay. Step sets frames and speed.
You'll need one 32-bit png named splash.png, and one wave file named splash.wav
They must be located in same folder, unless you edit path in script. Tinker any way
your heart desires. I hope you enjoy, and find a good use for it.
- David
ps
For two screens, moving 0, 0 off your desktop, will place it on your other screen.
Anyone for a breathing marquee? :lol