Idea for Blueprint - Wah!Launcher

A nice (keyboard based) front end for Arcade / Console game emulators.

Moderator: battlecat

Idea for Blueprint - Wah!Launcher

Postby codefenix » Mon Jan 30, 2012 4:02 pm

This idea is inspired somewhat by HyperSpin's HyperLaunch. The Wah!Launcher would call the emulator and run in the background while playing a game. Then, when you press a special hotkey, like say, ESC, the Wah!Launcher would pause the game and display menu, giving you an option to return to Wah!Cade. This hotkey would be global across all platforms, therefore giving you a way to exit no matter what emulator you're running. It would be handy for emulators like Yabause, DOSBox, vintage computers on MESS (to avoid having to press scroll-lock), and any others that don't give you an easy way out. Another possibility is letting you see the control panel viewer or history while playing the game.

The effect would be very similar to playing Midway's Arcade Treasures on XBOX, wherein you press a dedicated top-level button that gives you a list of options, and upon exiting returns you to the main menu.
User avatar
codefenix
 
Posts: 219
Joined: Fri Sep 25, 2009 3:45 pm
Location: USA

Re: Idea for Blueprint - Wah!Launcher

Postby Zombie » Mon Jan 30, 2012 5:45 pm

That may be beyond the scope of wahCade's abilities. The PS3 and XBox 360 OSes tend to run on secondary CPUs. When WahCade lunches a game, it's process is suspended. If it doesn't suspend the process, or controlling terminal returns to the OS, the music produced by WahCade will resume. Most emulators won't let you ALT+TAB out of them.

But this brings up something important:

My Mame Cabinet is more of a Console than a Cabinet. It uses after-market PS3 controllers called Street Fighter 4 Fight Pads...

Image Like this

Image Or this.

And, I use a home button to exit the emulator, not escape. So whatever we do, we should allow this to be user settable. I don't use qjoypad or joy2key.
User avatar
Zombie
 
Posts: 791
Joined: Mon Oct 06, 2008 2:52 pm

Re: Idea for Blueprint - Wah!Launcher

Postby codefenix » Mon Jan 30, 2012 5:53 pm

I did start to think it seemed a tad ambitious as I typed the idea out. Oh well, I can dream. Maybe if Wah!Cade evolves beyond Python...

And yes, the hotkey would, of course, be user definable, like all of Wah's functions.
User avatar
codefenix
 
Posts: 219
Joined: Fri Sep 25, 2009 3:45 pm
Location: USA

Re: Idea for Blueprint - Wah!Launcher

Postby Zombie » Mon Jan 30, 2012 7:00 pm

WahCade can be Alt-tabbed out of, I just don't think the emulator can be. There are a couple of ways I could see this working. Keep in mind that, the cooperation of the Emulator is 90% of this. Not all the Emulators comply with this.

One is a way for the emulator to receive a suspend signal (Control+Z) When "Home" is held down. This would require the emulators to be modified to have a "Suspend" button. All of them. It's not so much something WahCade can do as much as it is something the Windows Manager (OpenBox) and the Emulator do. Maybe you could get a Suspend function written into SDL? Not sure. Either way it is a great deal of effort to go through.

A more feasible solution if you ask me is Save stating and controller profiling. Keep in mind, not everyone uses a jPac. or an iPac. I don't, and the only keyboard to Joypad mapping I don't. But what we are missing from this Cocktail that would make it much easier, is two things. One, on exit, if the emulator supports save states, maybe it should save the state. This again, would require patches to the emulator, just not serious ones. But then when the game is resumed, the option can be presented to resume the last known state. That would get you somewhere close to what you want.

The other solution I for see is to do controller profiling where Wahcade detects the controllers (If not a JPac) in the machine, and adjusts the configuration of the emulators for that specific emulator. Because often, I have to re-map everything when a new pad is added.
User avatar
Zombie
 
Posts: 791
Joined: Mon Oct 06, 2008 2:52 pm

Re: Idea for Blueprint - Wah!Launcher

Postby codefenix » Mon Jan 30, 2012 8:16 pm

Zombie wrote:A more feasible solution if you ask me is Save stating and controller profiling. Keep in mind, not everyone uses a jPac. or an iPac. I don't, and the only keyboard to Joypad mapping I don't. But what we are missing from this Cocktail that would make it much easier, is two things. One, on exit, if the emulator supports save states, maybe it should save the state. This again, would require patches to the emulator, just not serious ones. But then when the game is resumed, the option can be presented to resume the last known state. That would get you somewhere close to what you want.


The pausing and resuming of the emulator is not as important to me as the ability to exit easily. So even if the theoretical Wah!Launcher ran in the background to accept the keystroke to terminate the emulator, that would satisfy the main requirement. The other things I mentioned like pausing and displaying a menu were just other neat ideas that would be nice to see.
User avatar
codefenix
 
Posts: 219
Joined: Fri Sep 25, 2009 3:45 pm
Location: USA

Re: Idea for Blueprint - Wah!Launcher

Postby sairuk » Mon Jan 30, 2012 10:19 pm

Interesting,

I like the in-game menu idea and its something i've been toying with for a while but personally (at this point) have no idea how to do it. Also how useful it would be other than showing history/game info and controller layouts I don't know if it would be worth the effort. For me as probably for Zombie the biggest advantage is displaying controller layouts based on the connected controller. I'd also like to halt the game launch based on connected controller eventually requesting the correct controller for the launched game. I may try and integrate it into the frontend of the script mentioned below when I get around to trying to write it. The script below is only a plugin/pygame test.

ezLauncher <--- working title!

Over the last couple of days i've been playing with an older python script i wrote which I had initially called ezLauncher. It was written to detect the maximum resolution of the attached screen and execute ezQuake with command line args adjusting the size on the fly depending on the machine. This is useful as I have ezQuake for windows/linux on my phone (Galaxy S2 i use as usbkey) which I take to work/LANs etc.

The modifications I have made over the last 2-3days have added support for game configurations, drm systems and engine plugins. So while initially only supporting ezQuake, it currently has plugins for the quakeworld, idtech3 and ue3 engines also a number of games which run on these engines. I'm still working through the code cleaning and fixing some things but the intent was to test a plugin system which may eventually be built into Mah!Cade or replace W[M]ah!Cade with a more modular code base able to support multiple frontend configuration engines.

For example:

configs/ezq1.cfg
Code: Select all
[config]
MY_NAME= ezQuake
MY_CMD_LINE = -fullscreen -autostretch 
MY_BASE = id1
MY_EXEC = ezquake-gl
MY_PATH = \games\PortableApps\nQuake\
MY_ENG = quakeworld
DRM = 0
[DRM]
APPID = 0


engines/quakeworld.py
Code: Select all
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os

def __init__():
  # Constants
  MY_ENGINE="QuakeWorld Engine"
  return MY_ENGINE

def prepare_game(myNative, my_cfg):
  # Nothing to do for Quakeworld
  pass

def launch_game(myExecutable, myNative, my_cfg):
  if os.path.exists(APP_PATH):
    os.chdir(APP_PATH)
    os.system(myExecutable + " " + my_cfg[6] + " -width " + str(myNative[0][0]) + " -height " + str(myNative[0][1]))
  else:
    return "Error locating directory as specified in cfg file for " + my_cfg[1]


configs/q3a_steam.cfg
Code: Select all
[config]
MY_NAME=Quake III Arena
MY_CMD_LINE=+exec
MY_BASE=baseq3
MY_EXEC=quake3
MY_PATH=\Steam\steamapps\common\quake 3 arena\
MY_ENG=idtech3
DRM = steam
[DRM]
APPID = 2200


engines/idtech3.py
Code: Select all
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os

def __init__():
  MY_ENGINE="ID Tech 3 Engine"
  return MY_ENGINE

def prepare_game(myNative, my_cfg):
  # WriteExec File
  if os.path.exists(os.path.join(my_cfg[6], my_cfg[3])):
    fcfg = open(os.path.join(my_cfg[6], my_cfg[3], my_cfg[8] + ".cfg"), "w")
    fcfg.write('seta r_customheight "' + str(myNative[0][1]) + '"\n')
    fcfg.write('seta r_customwidth "' + str(myNative[0][0]) + '"\n')
    fcfg.write('seta r_mode "-1"\n')
    fcfg.write('vid_restart\n')
    fcfg.close()
    return fcfg
  else:
    return "Error locating directory as specified in cfg file for " + my_cfg[1]

def launch_game(myExecutable, myNative, my_cfg):
  if os.path.exists(my_cfg[6]):
    os.chdir(my_cfg[6])
    os.system('"' + myExecutable +  '"' + " " + my_cfg[2] + " " + my_cfg[8] + ".cfg")
  else:
    return "Error locating directory as specified in cfg file for " + my_cfg[1]


The q3a_steam example runs the steam version of the game which cannot directly parse standard id command line arguments if the executable is launched directly. The system looks up information onto how to handle the drm system from drm/

drm/steam.drm
Code: Select all
[config]
MY_NAME= Steam
MY_CMD_LINE = -applaunch 
MY_BASE = steamapps
MY_EXEC = steam
MY_PATH = d:\Steam\
MY_ENG= steam


so far i'm happy with the way this has worked out; this single launcher appears as though it will handle almost every game I can throw at it and it doesn't have to be limited to FPS engines (although that was the original intent)
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Re: Idea for Blueprint - Wah!Launcher

Postby Zombie » Mon Jan 30, 2012 11:08 pm

That's an incredible idea. Very ingenious of you Sariuk.
User avatar
Zombie
 
Posts: 791
Joined: Mon Oct 06, 2008 2:52 pm

Re: Idea for Blueprint - Wah!Launcher

Postby sairuk » Wed Feb 08, 2012 1:02 pm

I have uploaded the current codebase for ezLauncher finally. Nothing special and is easily crashed at this point in time. Still it works perfectly fine for me once setup properly, only tested on windows thus far as you will be able to tell by the configs. Added support recently for dosbox (as a drm system) pretty easily and GOG dosbox games also.
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am


Return to Wah!Cade

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron