xboxscene.org forums

Author Topic: Question About Xport's Custom Launch Params  (Read 368 times)

Ez0n3

  • Archived User
  • Jr. Member
  • *
  • Posts: 64
Question About Xport's Custom Launch Params
« on: March 03, 2009, 06:15:00 PM »

Sup,

I'm trying to get Surreal64xxx to launch roms the way xport does. A fellow going by "NATEDOGG" released a modified default.xbe that works with Evox style command lines, but it doesn't seem to work with XBMC shortcuts.

Patch for Surreal64xxx_beta4.95
http://forums.xbox-scene.com/index.php?sho...p;#entry4105838

From what I can tell, he only modified the "Launcher.cpp" file, just above "return S_OK;" in "CXBoxSample::Initialize()":

CODE
// NATEDOGG
  DWORD launchDataType;
  LAUNCH_DATA launchData;
  if (XGetLaunchInfo(&launchDataType, &launchData) == ERROR_SUCCESS) {
    if (launchDataType == LDT_FROM_DEBUGGER_CMDLINE) {
      const char* szCmdLine = ((PLD_FROM_DEBUGGER_CMDLINE)(&launchData))->szCmdLine;
      if (szCmdLine && strlen(szCmdLine)) {
        for (int ii = 0, n = g_romList.GetRomListSize() - 1; ii < n; ii++) {
          Rom* rom = g_romList.GetRomAt(ii);

              char zipname[120];
              sprintf(zipname,rom->GetFileName().c_str());
              /* remove rom path */
              int counterbackslash;
              // find last backslash
              for (int i=0;i<120;i++){
                  if (zipname=='\\')  counterbackslash=i;
                  if (zipname == '\0') break;
              }
              // remove it
              for (int i=0;i<120;i++){
                  for (int j= counterbackslash+1;j<120;j++){
                      zipname=zipname[j];
                      i++;
                  if (zipname[j] == '\0') break;
                  }
                  zipname[i+1] = '\0';
                  break;
              }
          if (strcmp(zipname, szCmdLine) == 0) {
            actualrom = ii;
            LaunchMenu();
            for (int i=0, n=rom->GetIniEntry()->iPreferredEmulator; i < n; i++) {
              XLMenu_Routine(MENU_NEXTITEM);
              Sleep(100);
            }
          }
        }
      }
    }
  }


It seems to me that this is what needs to be changed in order for it to work with XBMC cut files?:
CODE
    if (launchDataType == LDT_FROM_DEBUGGER_CMDLINE) {
      const char* szCmdLine = ((PLD_FROM_DEBUGGER_CMDLINE)(&launchData))->szCmdLine;


In the xport releases and in XBMC, they use "LDT_TITLE" rather than "LDT_FROM_DEBUGGER_CMDLINE"?

So I think my question is, what would I have to replace this with:
CODE
const char* szCmdLine = ((PLD_FROM_DEBUGGER_CMDLINE)(&launchData))->szCmdLine;


In order for "szCmdLine" to equal the rom filename passed from an XBMC shortcut?

CODE

    F:\Emulators\N64\default.xbe
    
    F:\Emulators\N64\Images\Super Mario 64.jpg
    
        Super Mario 64 (U) [!].zip
    



It looks as if "Super Mario 64 (U) [!].zip" needs to end up in "szCmdLine" so that when it goes through the list of rom and finds a match, it will automatically load that rom.

I've tried just about every thinkable combination of shortcut paramters to no avail, I'm convinced XBMC isn't passing what's in the custom game tag using "LDT_FROM_DEBUGGER_CMDLINE". Or I'm entirely confused, which is completely possible  (IMG:style_emoticons/default/wacko.gif) .
Logged

Ez0n3

  • Archived User
  • Jr. Member
  • *
  • Posts: 64
Question About Xport's Custom Launch Params
« Reply #1 on: March 07, 2009, 07:49:00 PM »

Got busy all of a sudden at work.

QUOTE
An example for how to use the LDT_TITLE method can be found in the custom_launch_params.cpp/h files included with all of my recent releases.


I saw the .cpp file, but I was missing the .h file which had variables defined in it. I found it in the source of one of your releases (IMG:style_emoticons/default/smile.gif).

It's launching roms just fine, I wouldn't have figured it out if it wasn't for your code. (IMG:style_emoticons/default/biggrin.gif)

The only problem now is that it only works once, then I have to clean out the ini's and it will work again. So it's a surreal issue or it's how I adapted your code to natedogg's. The second time I try, it just loads into a blank black screen.

It's almost there though (IMG:style_emoticons/default/biggrin.gif).

Thanks, I greatly appreciate your help (and the ports).
Logged

Tweakster

  • Archived User
  • Newbie
  • *
  • Posts: 38
Question About Xport's Custom Launch Params
« Reply #2 on: March 08, 2009, 03:41:00 PM »

QUOTE(Ez0n3 @ Mar 7 2009, 09:25 PM) *

Got busy all of a sudden at work.
I saw the .cpp file, but I was missing the .h file which had variables defined in it. I found it in the source of one of your releases (IMG:style_emoticons/default/smile.gif).

It's launching roms just fine, I wouldn't have figured it out if it wasn't for your code. (IMG:style_emoticons/default/biggrin.gif)

The only problem now is that it only works once, then I have to clean out the ini's and it will work again. So it's a surreal issue or it's how I adapted your code to natedogg's. The second time I try, it just loads into a blank black screen.

It's almost there though (IMG:style_emoticons/default/biggrin.gif).

Thanks, I greatly appreciate your help (and the ports).


hey Ez0n3 if you get the shortcuts for surreal to work via xbmc please post here on how you did it
I know alot of people including me would like to use .cut files in xbmc for surreal (IMG:style_emoticons/default/biggrin.gif)
Logged