HQ NETWORK:   XBOX ONE |  XBOX 360 |  AIDELUXE HQ Network: 2,062 | Guests: 855 | Members: 5 


   Current Location: Forums Unable to run Slayers/install evox   |   Free Game Engine to develop games for XBOX360   |   Best place for XBox ROMS?   |   XBOXONE-HQ.COM just hit 25K on Twitter!   |   PS2 games that aren't on xbox?   |   XBOX-HQ T-Shirts, Hoodies, Mugs & More (Available Now)   |   The best new free XBOX ONE and XBOX ONE X games of 2019   |   Homebrew Xenium Modchip   |   Xbox 360-hq youtube channel now posting daily   |   List of Xbox One X Enhanced Games   |   
  Home | Active Topics | CD/DVD Media | Downloads | Forums | Feedback | Games | HardDrives | Homebrew | My Profile | ModChips | Reviews | Search | SoftMods | Tutorials

Xbox Forums

Discuss all aspects of the original Xbox Console in our Interactive Xbox Forums..

Xbox-Hq.Com :: View topic - runxbe();
Xbox-Hq.Com Forum Index -> Learn to code Xbox
Post new topic Reply to topic    
 runxbe(); View previous topic :: View next topic  
 
 
 
 
forahobby
Administrator
Administrator


Joined: May 22, 2003
Posts: 23516
Location: NSW, Australia

Post Posted: Sat Dec 11, 2004 7:45 pm   
Post subject: runxbe();
Reply with quote
 
Hi guys,

I have a runxbe(); class.

All the app does is boot another .xbe at the moment.. Can anyone help getting this to work..

heres the launch.cpp:
Code:
#include "launch.h"

#include <stdio.h> // sprintf(..)
/*
Description: Launch another XBE by unmounting then remounting D:

Detail:
If you want to launch another XBE (say you have a menu program) - you
have to first map the D: drive to the location of the XBE you are launching
or else it won't be able to find its media files.

You have to first unmount the D: drive, then re-mount it to the correct
device and subdirectory. Then simply call your XBE.
*/
 

#ifdef _XBOX

// Hidden Kernal Functions
#define IN
typedef struct _UNICODE_STRING {unsigned short Length; unsigned short MaximumLength; PSTR Buffer;} UNICODE_STRING,*PUNICODE_STRING;
extern "C" XBOXAPI DWORD WINAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,IN PUNICODE_STRING DeviceName);
extern "C" XBOXAPI DWORD WINAPI IoDeleteSymbolicLink(IN PUNICODE_STRING SymbolicLinkName);
extern "C" XBOXAPI DWORD WINAPI XapiMapLetterToDirectory(IN LPCSTR pcDriveString,IN LPCSTR pcPathString,IN DWORD pcszTitleId,IN bool fCreateDirectory,IN LPCSTR pcszTitleName,IN bool fUpdateTimestamp);

// Unmount the old D: drive
static void UnmountD()
{
   char szDestinationDrive[16];
   strcpy(szDestinationDrive,"\\??\\D:");

   UNICODE_STRING LinkName = {
   strlen(szDestinationDrive),
   strlen(szDestinationDrive) + 1,
   szDestinationDrive};

   IoDeleteSymbolicLink(&LinkName);
}

// Mount the D: drive to a given device and directory
// szDevice = "Cdrom0" or "Harddisk0\Partition6"
// szDir = "" or "Game1"
static void MountD(char* szDevice, char* szDir)
{
   char szSourceDevice[256];
   char szDestinationDrive[16];

   strcpy(szDestinationDrive,"\\??\\D:");
   sprintf(szSourceDevice,"\\Device\\%s",szDevice);
   if (*szDir != 0x00 && *szDir != '\\')
   {
      strcat(szSourceDevice, "\\");
      strcat(szSourceDevice, szDir);
   }

   UNICODE_STRING LinkName = {
      strlen(szDestinationDrive),
      strlen(szDestinationDrive) + 1,
      szDestinationDrive
      };
   UNICODE_STRING DeviceName = {
      strlen(szSourceDevice),
      strlen(szSourceDevice) + 1,
      szSourceDevice
      };

   IoCreateSymbolicLink(&LinkName, &DeviceName);
}

// szDevice = the device where the XBE is "Cdrom0"
// szDir = the subdirectory where your xbe is "Games\Game1"
// szFile = the name of your XBE (without the path) - "Game1.xbe"
void RunXbe (char* szDevice, char* szDir, char* szFile)
{
   char szXbePath[64];
   wsprintf(szXbePath,"D:\\",szFile);

   UnmountD();
   MountD(szDevice, szDir);
   XLaunchNewImage(szXbePath, NULL );
}


#else

void RunXbe (char* szDevice, char* szDir, char* szFile)
{
   //Start a standard exe here for pc version :)
}

#endif //_XBOX


and heres the launch.h:
Code:
#pragma once



#ifdef _XBOX

#include <xtl.h>

#else

// Where using DirectX
#pragma comment(lib, "D3d8.lib") // DirectX 8
#pragma comment(lib, "D3dx8.lib")
#include <d3dx8.h>

#endif //_XBOX



// szDevice = the device where the XBE is "Cdrom0"
// szDir = the subdirectory where your xbe is "Games\Game1"
// szFile = the name of your XBE (without the path) - "Game1.xbe"
void RunXbe (char* szDevice, char* szDir, char* szFile);




Now i call the function no problems at all and can pass my variables accross but i get a error. .xbe could not be booted.. I know its something so small.. any whizzes around?? Im not that bad a coder on xbox but this ones got me stumped..

Heres how i call it:
Code:
RunXbe ("Cdrom0", "", "install.xbe"); // lets launch ourself
   
   // szDevice = "Cdrom0" or "Harddisk0\Partition6" (where xbe is)
// szDir = the subdirectory where your xbe is "Games\Game1"
// szFile = the name of your XBE (without the path) - "Game1.xbe"


Im just trying to call another xbe for a test.. Its really the same app at the moment!

anyway, thanks for any help guys,

l8r

forahobby
http://www.xbox-hq.com

_________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
 
 
 
forahobby
Administrator
Administrator


Joined: May 22, 2003
Posts: 23516
Location: NSW, Australia

Post Posted: Sun Dec 12, 2004 12:03 am   
Post subject:
Reply with quote
 
i got it working guys..
If anyone needs help just contact me..

Ill help no probs at all.

l8r

forahobby
http://www.xbox-hq.com

another all night mission eh?? well a couple of them.
Now we can get back onto business..

_________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
 
 
 
enigma516
V.I.P. Lifetime


Joined: Feb 07, 2005
Posts: 2741
Location: Florida

Post Posted: Fri Nov 18, 2005 9:46 pm   
Post subject:
Reply with quote
 
Sorry Hobbs, had to delete a realy idiotic post someone made here.
_________________


View user's profile Send private message Send e-mail Visit poster's website AIM Address
 
Display posts from previous:   
  Post new topic  
 
  Reply to topic  
|
 All times are GMT | Page 1 of 1
Jump to:  
 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
 

 Members Online (5) / Guests Online (855)
Members Browsing
JaiVonwill, DemetriaVi, WeleSlinarore, rez, muatac,

Legend
Administrator  Moderator  VIP Member  Registered User  Banned Users