Exemple #1
0
DRV_STATUS_CODE DRV_SD_MountDevice(
	mcdev_enum id,
	unsigned int flags
	)
{
	SDC_CMD_STATUS status = NO_ERROR;
	status = MountDevice(GetMsdcHandle(id), 0, 0, flags);
	if (512 != status)
		return DRV_MOUNT_DEV_FAILURE;

	return DRV_SUCCESS;
}
Exemple #2
0
//
// MountPartitions
//
// Some of these partitions are automatically mounted but just 
// to be on the safe side the mount will be attempted anyway
//
// Some of these partitions are only found on some modded consoles.
// These partitions will only successfully mount on consoles where
// the modder has created these partitions.
//
// F is likely to be found on systems that shipped with stock hdd's
// that were 10GB in size. Since the Xbox hdd was advertised as 8GB,
// 2GB were left unpartitioned on these and that extra space will
// typically be partitioned into F: during modding and games or apps
// will be installed there (like this one.) F: will also be found
// on non-stock hdd's of any size where any space above 8GB and below
// 137GB will be partitioned into F:
//
// G is likely to be found on non-stock hdd's that are larger than 137GB
// due to the partition size limitation. Anything above 137GB is partitioned
// into G: and it is used, typically, for the same purposes as F.
//
void Xbox::MountPartitions()
{
	MountDevice(DriveD, CdRom);   // DVD-ROM or start path - automounted
	MountDevice(DriveE, DeviceE); // Standard save partition
	MountDevice(DriveF, DeviceF); // Non-stock partition - modded consoles only
	MountDevice(DriveG, DeviceG); // Non-stock partition - modded consoles only
	MountDevice(DriveT, DeviceT); // AG-Odalaunch's unique TDATA - peristent save data (configs, etc.) - automounted
	MountDevice(DriveZ, DeviceZ); // Cache partition - appropriate place for temporary files - automounted
}
int GameBrowser() {
	if( MountDevice(Settings.device) == BROWSER_FILE_NOT_FOUND ) \
		return BROWSER_FILE_NOT_FOUND;
	
	int ret = 0;

	file_browser_st game_filename;
	strcpy(game_filename.title, "Select game image");
	game_filename.filter = 1;

        DIR *dp = NULL;

	if(Settings.filename) {
		strcpy(game_filename.path, Settings.filename);
		browse_back(game_filename.path);	// delete game filename
                dp = opendir(game_filename.path);
	}

	if(dp) {
                closedir(dp);
	}
	else {
		sprintf(game_filename.path, "%s/%s", device[Settings.device], "pcsx-r/games");
                dp = opendir(game_filename.path);
		if(dp) 
                        closedir(dp);
		else 
			sprintf(game_filename.path, "%s", device[Settings.device]);
	}

	ret = textFileBrowser(&game_filename);

	while(ret == BROWSER_CHANGE_FOLDER)
	{
		ret = textFileBrowser(&game_filename);
	}
	if (ret == BROWSER_FILE_SELECTED) {
		strcpy(Settings.filename, game_filename.path);
	}
	return ret;
}
char *StateBrowser( )
{
	if( MountDevice(Settings.device) == BROWSER_FILE_NOT_FOUND )
		return NULL;

	int ret = 0;
	char *statename;

	file_browser_st state_filename;
	strcpy(state_filename.title, "Select SaveState to load");
	state_filename.filter = 0;
	sprintf(state_filename.path, "%s%s", device[Settings.device], "pcsx-r/sstates");

	if(ret = textFileBrowser(&state_filename) == BROWSER_FILE_NOT_FOUND)
	{
		sprintf(state_filename.path, "%s", device[Settings.device]);
		ret = textFileBrowser(&state_filename);
	}
	if(ret == BROWSER_FILE_NOT_FOUND || ret == BROWSER_CANCELED) 
		return NULL;
	statename = state_filename.path;
	return statename;
}