xboxscene.org forums

Author Topic: Command Line Args W/ Xbox Runtime (c++ Question)  (Read 394 times)

coreslump

  • Archived User
  • Newbie
  • *
  • Posts: 21
Command Line Args W/ Xbox Runtime (c++ Question)
« on: September 08, 2007, 01:45:00 AM »

I have two goals for the information I seek:

1) To add command line support to MAMEoX+VMM. I have already modified this source to skip the splash screen, select a ROM in the list, and auto start the ROM. The part I am missing is how to get the parameters from the command line.

2) I will develope a general purpose "launcher" XBE that takes Evox style command line arguments and executes another XBE using Xport style command line arguments. This will allow Evox menu items to support all the Xport emulators.

I would like to use Evox as my dashboard. Evox supports passing command line arguments (I believe) in the traditional C++ manner, eg main(int argc, char* argv[]). Apparently the argc and argv parameters are not populated on the Xbox. How then can I obtain the command line parameters used to start an XBE? I know it is possible because xSnes9x supports it -- I can start a rom using Evox's mechanism with xSnes9x.

I have tried this code from scummvmx...

CODE

char *x_argv[100];
int x_argc = 1;
if (g_launchDataType == LDT_FROM_DEBUGGER_CMDLINE) {
  x_argv[x_argc] = strtok(((PLD_FROM_DEBUGGER_CMDLINE)&g_launchData)->szCmdLine, " ");
  while (x_argv[x_argc] != NULL) {
    x_argc++;
    x_argv[x_argc] = strtok(NULL, " ");
  }
}


This does not seem to work (probably because the launch data type is not from the debugger cmdline?). Does you know how xSnes9x does it? The source is not available and I don't know how to contact Lantus.

I see the Xport emulators all use the same mechanism for starting with a specific ROM. Unfortunately, Evox does not seem to support this mechanism. I would like to use Evox and I know it is possible since xSnes9x works like I want. I just have not been able to figure it out yet. Any ideas?
Logged

coreslump

  • Archived User
  • Newbie
  • *
  • Posts: 21
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #1 on: September 08, 2007, 05:34:00 AM »

Nevermind, I was doing the right thing but my struct was getting reused (and thus corrupted) between the time it was created and the time I read it. Oops!  blink.gif I am now able to specify this in Evox...

Item "Super SF2", "F:\mame - MAMEoX_v0.84.b3_binary\default.xbe", ID_CMD, "ssf2"

And the rom will automatically load! Yay!!! If you want to try it you can get it here...

http://www.mediafire.com/?1gcg9lwibub

Next I'll try to implement the "launcher" that sits between Evox and Xport emulators.
Logged

shorty

  • Archived User
  • Full Member
  • *
  • Posts: 156
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #2 on: September 08, 2007, 03:14:00 PM »

Great News!

Does this mean that mame, using your patch, will autolaunch roms with the same mothod as the xport emu's?

Or does it use a (different?) evo-x method.

Reason i ask is that i use xport emu's and zsnexbox. With XBMC and it's retro-X script (Or individual shortcuts) i can launch roms directly... works beautifully.... this would be a sweet addition.

Also, out of interest... What advantages do you yourself get with using evo-x compared to XBMC?

Cheers,

 Shorty
Logged

coreslump

  • Archived User
  • Newbie
  • *
  • Posts: 21
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #3 on: September 08, 2007, 06:41:00 PM »

Xport uses a custom launch parameter object. This means C++ code has to be written to construct the custom launch parameter object and invoke the Xport emu. Not all dashboard (such as Evox) support this.

My patch uses a command line argument which is much simpler. The emulator is simply executed with the extra information. All dashboards should support this.

I plan on writing a tool that takes command line parameters and invokes another program using Xport custom launch parameters. Because I use Evox, right now I have no way of invoking an Xport emu with custom launch parameters. Once I have written this tool, I may update my patch to support both mechanisms.

As for why I use Evox, I have created my own background image and game launch image. I like how the menus are presented and configured, it is very clean and simple. I only use Evox for launching Xbox games and emulators and for FTP. The only other app I use is Boxplorer to rip game CDs. Granted this isn't the easiest way to rip, but I like that I can name the folder where the game is ripped to.

The only thing I don't like about Evox is that it is only 480p. I would like it to support 720p.

I have never seen XBMC, mostly because I just need a menu system for launching games, FTP, and ripping games. Can I do these things in XBMC? Is it easy to ignore the extra parts? Am I missing some killer features? I do not watch movies or play music through the Xbox. Does XBMC support 720p? Can I use my own background and game launch image? How are menus configured? I want full control over every menu item and the ability to create nested menus of any depth, eg...

CODE

Xbox
    [game list]
Snes [opens snes emulator]
Street Fighter 2
    Arcade
        SF2
        Super SF2
        SF2 Championship Edition
        SF2 Alpha
        SF2 Alpha 2
    SNES
        SF2
        Super SF2
        SF2 Alpha
Classics
    [game list]
(etc)
Logged

mtsaint

  • Archived User
  • Jr. Member
  • *
  • Posts: 98
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #4 on: September 08, 2007, 08:55:00 PM »

xbmc does support hi def i think(i dont have a hidef tv) and it has gobs of extra features and codecs that dont comes with evox and python script support  btw thanks for this ill be playing with your script later on 2nite
Logged

coreslump

  • Archived User
  • Newbie
  • *
  • Posts: 21
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #5 on: September 09, 2007, 03:33:00 PM »

Thanks mtsaint. Thing is, I don't really need all the extra stuff XBMC does. I may check it out anyway though.

I have found a bug with my patch. Directly launching a rom works fine, but if you start MAMEoX with no arguments then it displays an error message before taking you to the game list.
Logged

shorty

  • Archived User
  • Full Member
  • *
  • Posts: 156
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #6 on: September 09, 2007, 03:41:00 PM »

You've never seen XBMC!? Get it, get it now man!  blink.gif

I have never seen XBMC, mostly because I just need a menu system for launching games, FTP, and ripping games. Can I do these things in XBMC?
Sure, all these things can be done, rip games with the file manager (although i'd advise dvd2xbox over Evo-x/XBMC as it patches them and what not.)

Is it easy to ignore the extra parts? Am I missing some killer features? Does XBMC support 720p?
Ignore extras... easy.. (removing the media features from interface means editing an xml file or two, not too hard). You are missing a gazillion features, It does support 720p (and also 1080i to a degree)

I do not watch movies or play music through the Xbox.
Once you've seen XBMC in action, you probably will.

Can I use my own background and game launch image? How are menus configured? I want full control over every menu item and the ability to create nested menus of any depth, eg...
It's very customisable, especially if you get into editing the skins... not so sure about nested menus... but just give it a try and see

Have a look at the XBMC Wiki, also here are some nice Screenshots i just googled

Anyway, thanks for the patch.

Shorty

P.S - I like that for games/emualators, you can use box art in the interface.
P.P.S - Wow, i need to stop acting like an advert.  laugh.gif
Logged

coreslump

  • Archived User
  • Newbie
  • *
  • Posts: 21
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #7 on: September 10, 2007, 01:59:00 PM »

Ha. Thanks for the words of encouragement. I still find it difficult to find the motivation to try XBMC. I'd have to learn how to apply my background image to the skin, learn how to setup menus, and launch games. 720p would be really awesome though...

Here is an updated version of the MAMEoX patch for command line arg support...
http://www.mediafire.com/?2ku2d6fdbfc
This fixes the bug when launching without arguments.

I also finished my other other goal. I have created an XBE that takes command line arguments and executes another XBE using Xport's custom launch parameters. This allows you to launch any Xport emulators to a specific rom by using command line arguments rather than Xport's custom launch parameters. This is useful for dashboards that don't support Xport's method of launching parameters (eg, Evox). Here is the download...
http://www.mediafire.com/?15wdwhbewtc

Usage is...
XportLauncher.xbe <rom filename>;<emu dir>;<emu xbe>;<rom directory>

The "emu xbe" must be the full partition path, not a drive letter. Use something like boxplorer to find the partition number for a drive letter. Eg, for Evox (f: and partition 6 are the same on my Xbox)...

Item "f:\XportLauncher.xbe", ID_CMD, "Eternal Champions (!).zip;f:\neogenesis_v21\sgenroms;\Device\Harddisk0\Partition6\neogenesis_v21;default.xbe

That text may have wrapped in your browser, be sure it is all on one line in the evox.ini.

My next project is to look into the Surreal N64 emulator and try to add command line support. If that works out, I'll have command line support for all emulators I currently care about... NES, SNES, N64, Sega Genesis, MAME, PS1.
Logged

coreslump

  • Archived User
  • Newbie
  • *
  • Posts: 21
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #8 on: September 10, 2007, 02:57:00 PM »

That was a typo. It should be...
XportLauncher.xbe <rom filename>;<rom directory>;<emu dir>;<emu xbe>
Logged

shorty

  • Archived User
  • Full Member
  • *
  • Posts: 156
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #9 on: September 10, 2007, 08:27:00 PM »

Hi,

That's terriffic!
Two great tools/hacks in two days!

I'd love for surreal to be able to auto launch games, XPort style.

Regarding Surreal i believe it has some odd workings, (you probably know this but...) surreal launches games from a secondary .xbe file, where you intially use the 'launcher' app to choose your game.

It does this not with launch paramaters, but by writing an ini file and copying your chosen game to a a cache partition (X:, Y: and/or Z:) before launching one of several (around 6) 'emulator' xbe's which will then check said ini file. (As i understand)

Forum user Bomb_Bloke wrote a script for XBMC that performs these functions (I think it's more a proof of concept, i've not used it yet but understand it does work)

Perhaps you'd find it easier/quicker to write another launcher xbe that also takes paramaters, but rather than passing paramaters, it'd copy the rom and make the ini (as per the paramaters) before launching the app. Also if it'd help, Bomb_Blokes script, although in python, could give you a kind of guide.

The thread where i found most of this info, and the script, can be found here

And XBMC again...

Yes, it probably is overkill for your purposes.
But all the same i implore you, just have a quick blast for the sake of curiosty, run it as an app from Evo-X and have a tinker, if you want a great looking interface, this is it.

And to satisfy my curiosity...

Why don't you want to use music/video on the xbox... i'm guessing either..

1) You have a nuts PC based media center (I hear XBMC Linux is coming along fairly well)
or
2) You are installing your xbox in a MAME cabinet (Cool! pop.gif )

Cheers again,
 Shorty
Logged

coreslump

  • Archived User
  • Newbie
  • *
  • Posts: 21
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #10 on: September 11, 2007, 03:06:00 AM »

Thanks for the info on Surreal. I had already written my code before reading your post on the python script. Both approaches would accomplish the same goal. However, I think it is MUCH easier to modify the Surreal launcher to skip its menus than it is to duplicate in python how the launcher launches the other XBEs. Here is my patch for Surreal64xxx_beta4.95...
http://www.mediafire.com/?4ywzg29dbuw

It skips the rom list and jumps straight to the choose-the-emu and choose-the-video options, then launches the rom. I also made the preferred emu auto selected if it is not the first in the list. I hated that this version of Surreal did not do this!

Note that these mediafire.com hosting service downloads will expire in about 30 days. I would love to see my patches on xbins, but otherwise you may want to keep them around and/or make them available to others.

I am now successfully auto-launching ROMs from Evox for N64, Genesis, NES, MAME, and SNES.

I realize now that MAMEoX_v0.84.3b isn't the best MAME. It seems MAMEoX128_Plus_ver20060505 is much better. sad.gif The source is not available and this app does not have cmd line support. I have posted to HK$ on their forums, though it was difficult in Japanese (at least I assume it is Japanese? I don't have the font)...
http://www.DELETED.c...d.php?p=1558290
EDIT: I can't link to that site I guess. Hint: it ends in sky!

I promise to check out XBMC soon! I have a home theater with a projector and 114.5" screen. I have a full fledged gaming computer hooked up as well as the Xbox. smile.gif
Logged

shorty

  • Archived User
  • Full Member
  • *
  • Posts: 156
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #11 on: September 11, 2007, 03:53:00 AM »

Well, when you're on a roll.....

Thanks for that, surreal autolaunching pretty much means all systems can be used with this feature now, great!  biggrin.gif
Have not tried this yet, will as soon as i get my router back though... i'll get back to confirm it works with other dash's, just as an FYI for others.

 Shorty

P.S - Nice Screensize, compares favourably with my poxy 21"  laugh.gif
Logged

Mud409

  • Archived User
  • Newbie
  • *
  • Posts: 6
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #12 on: May 08, 2008, 06:40:00 AM »

was there ever a solution found for launching mame games directly from the dashboard? would anyone care to share their dashboards that are currently setup for launching games directly from the dashboard?

edit- doh! first post has info on mame...
Logged

mtsaint

  • Archived User
  • Jr. Member
  • *
  • Posts: 98
Command Line Args W/ Xbox Runtime (c++ Question)
« Reply #13 on: May 24, 2008, 09:00:00 PM »

if i were launching from xbmc center what would the command line line parameter's be. if its possible to use xbmc with your patch thatd be great sry for resurrecting a old topic
Logged