*Fixed IOS reload before game start into game specific ios

*Changed gecko output to use unsafe usb_sendbuffer
This commit is contained in:
dimok321 2010-11-28 20:04:29 +00:00
parent bd7ce32a8b
commit 49b5a5f329
5 changed files with 20 additions and 9 deletions

View File

@ -97,15 +97,17 @@ int BootGame(const char * gameID)
gameList.LoadUnfiltered(); gameList.LoadUnfiltered();
struct discHdr *header = gameList.GetDiscHeader(gameID); if(!gameList.GetDiscHeader(gameID))
if(!header)
{ {
gprintf("Game was not found: %s\n", gameID); gprintf("Game was not found: %s\n", gameID);
return -1; return -1;
} }
struct discHdr gameHeader;
memcpy(&gameHeader, gameList.GetDiscHeader(gameID), sizeof(struct discHdr));
int ret = 0; int ret = 0;
header = (mountMethod ? dvdheader : header); struct discHdr * header = (mountMethod ? dvdheader : &gameHeader);
u8 videoChoice = Settings.videomode; u8 videoChoice = Settings.videomode;
u8 languageChoice = Settings.language; u8 languageChoice = Settings.language;

View File

@ -35,7 +35,7 @@ bool InitGecko()
if (geckoattached) if (geckoattached)
{ {
usb_flush(EXI_CHANNEL_1); usb_flush(EXI_CHANNEL_1);
CON_EnableGecko(1, true); CON_EnableGecko(1, false);
geckoinit = true; geckoinit = true;
return true; return true;
} }

View File

@ -109,7 +109,7 @@ static int PartitionChoice()
***************************************************************************/ ***************************************************************************/
int MountGamePartition(bool ShowGUI) int MountGamePartition(bool ShowGUI)
{ {
gprintf("MenuCheck()\n"); gprintf("MountGamePartition()\n");
s32 wbfsinit = MountWBFS(ShowGUI); s32 wbfsinit = MountWBFS(ShowGUI);
if (wbfsinit < 0) if (wbfsinit < 0)
@ -122,6 +122,7 @@ int MountGamePartition(bool ShowGUI)
memset(game_partition, 0, 6); memset(game_partition, 0, 6);
load_from_fs = -1; load_from_fs = -1;
gprintf("\tPartition_GetList\n");
// Added for slow HDD // Added for slow HDD
for (int retries = 10; retries > 0; retries--) for (int retries = 10; retries > 0; retries--)
{ {
@ -131,6 +132,7 @@ int MountGamePartition(bool ShowGUI)
sleep(1); sleep(1);
} }
gprintf("\tWBFS_OpenPart: start sector %u, sector count: %u\n", partitions.pentry[Settings.partition].sector, partitions.pentry[Settings.partition].size);
if (Settings.partition != -1 && partitions.num > Settings.partition) if (Settings.partition != -1 && partitions.num > Settings.partition)
{ {
PartInfo pinfo = partitions.pinfo[Settings.partition]; PartInfo pinfo = partitions.pinfo[Settings.partition];
@ -151,6 +153,7 @@ int MountGamePartition(bool ShowGUI)
if(ret < 0) if(ret < 0)
Sys_LoadMenu(); Sys_LoadMenu();
gprintf("\tDisc_Init\n");
ret = Disc_Init(); ret = Disc_Init();
if (ret < 0) if (ret < 0)
{ {
@ -159,9 +162,12 @@ int MountGamePartition(bool ShowGUI)
Sys_LoadMenu(); Sys_LoadMenu();
} }
gprintf("\tOpenXMLDatabase\n");
// open database if needed, load titles if needed // open database if needed, load titles if needed
if (CheckFile(Settings.titlestxt_path)) if (CheckFile(Settings.titlestxt_path))
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride, true); OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride, true);
gprintf("MountGamePartition() return: %i\n", ret);
return ret; return ret;
} }

View File

@ -171,14 +171,14 @@ void ScreenShot()
{ {
time_t rawtime; time_t rawtime;
struct tm * timeinfo; struct tm * timeinfo;
char buffer[80]; char buffer[150];
char buffer2[80]; char buffer2[300];
time(&rawtime); time(&rawtime);
timeinfo = localtime(&rawtime); timeinfo = localtime(&rawtime);
//USBLoader_GX_ScreenShot-Month_Day_Hour_Minute_Second_Year.png //USBLoader_GX_ScreenShot-Month_Day_Hour_Minute_Second_Year.png
strftime(buffer, 80, "USBLoader_GX_ScreenShot-%b%d%H%M%S%y.png", timeinfo); strftime(buffer, 80, "USBLoader_GX_ScreenShot-%b%d%H%M%S%y.png", timeinfo);
sprintf(buffer2, "%s/config/%s", Settings.BootDevice, buffer); sprintf(buffer2, "%s%s", Settings.ConfigPath, buffer);
TakeScreenshot(buffer2); TakeScreenshot(buffer2);
} }

View File

@ -4,6 +4,7 @@
#include "../fatmounter.h" #include "../fatmounter.h"
#include "../usbloader/usbstorage2.h" #include "../usbloader/usbstorage2.h"
#include "../usbloader/disc.h" #include "../usbloader/disc.h"
#include "../usbloader/wbfs.h"
#include "../usbloader/wdvd.h" #include "../usbloader/wdvd.h"
#include "../wad/nandtitle.h" #include "../wad/nandtitle.h"
#include "../mload/mload_modules.h" #include "../mload/mload_modules.h"
@ -92,15 +93,17 @@ s32 IosLoader::LoadGameCios(s32 ios)
s32 ret = -1; s32 ret = -1;
// Unmount fat before reloading IOS. // Unmount fat before reloading IOS.
WBFS_Close();
WDVD_Close();
SDCard_deInit(); SDCard_deInit();
USBDevice_deInit(); USBDevice_deInit();
WDVD_Close();
ret = ReloadIosSafe(ios); ret = ReloadIosSafe(ios);
// Remount devices after reloading IOS. // Remount devices after reloading IOS.
SDCard_Init(); SDCard_Init();
USBDevice_Init(); USBDevice_Init();
Disc_Init();
return ret; return ret;
} }