Mame frontend possible in BlitzMax?

BlitzMax Forums/BlitzMax Programming/Mame frontend possible in BlitzMax?

Eck(Posted 2015) [#1]
So far I am able to run a full screen BlitzMax program that will allow users to select a game name and then it opens and plays that game in the MAME emulator.

But once the player quits MAME how can the original BlitzMax program be returned to (just goes to desktop currently) to allow the player to select another game?


degac(Posted 2015) [#2]
Hi

if you call an external process with CreateProcess() you should be able to check the 'output' of that program.
I presume (I can't check) there's a return code/string etc that indicates the 'end' of an emulation.


Chalky(Posted 2015) [#3]
Here's a snippet of code I have which does that (the .exe name and path is set/stored in string variable lProgram elsewhere):
Local lModule:TProcess=CreateProcess(Chr(34)+lProgram+Chr(34))
Local lError:String

HideGadget frmMain
Repeat
	lError=lModule.err.ReadLine()
	If lError <> "" Then
		Notify lError
	EndIf
	Delay 5
	If lModule.Status()=0 Then
		Exit
	EndIf
Forever
ShowGadget frmMain
It used a MaxGui window gadget as its main window - but you could hide any window using API calls to achieve the same result.


Eck(Posted 2015) [#4]
I usually make games in the various Blitz's so running external .exe is new for me.

Using either CreateProcess or Win32 to run MAME from within a Blitz Max full screen program works with either method (providing you change the current directly to that of MAME so the emulator can find its files) but once the emulator is closed by the player it exits to the desktop. Not sure if MAME maybe has a command line command that would tell it to return to a fronted on exit or if it would be best to have Blitz somehow return focus to my full screen Blitz program.

Off to tinker with it again, will read on the CreateProcess() return code and the above code too.


BlitzSupport(Posted 2015) [#5]
Think we'd probably need your source, or at least, pseudo-source, to be able to comment realistically.


Eck(Posted 2015) [#6]
Code that runs Robocop via mame. Works fine but when exiting mame it returns to the desktop.

Tried using windowed mode where game does exit back to blitz program. But I was unable to open a Blitz window that would cover the entire desktop.




TomToad(Posted 2015) [#7]
Try a MaxGUI window sized to the desktop with no borders.




grable(Posted 2015) [#8]
The easiest is to just re-create the graphics window, since you dont need or want the frontend to use resources while mame is running anyway.

I stuck this at the end of the RunApp function.
	EndGraphics()
	While proc.Status()
		Delay 10
	Wend
	Graphics 1600,900, 32

NOTE: I had to close the window either way, since my crappy gpu can only have 1 DX application running at a time.


Eck(Posted 2015) [#9]
Thanks for the support. I've reinstalled Max to latest 150 version with MaxGUI and now experimenting.

There was no forums I think when I started with Blitz back on Amiga and Blitz 2D PC! Thanks.


Eck(Posted 2015) [#10]


P.A.U.L.A - Park Arcade Unit List Array is a retro styled frontend game
selector for the MAME arcade emulator. A fast and simple menu for
your favourite arcade games.

http://www.parkproductions.co.uk