From 49b5a5f3297d5b2ba4ebb2e425aad0197414e3d1 Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Sun, 28 Nov 2010 20:04:29 +0000 Subject: [PATCH] *Fixed IOS reload before game start into game specific ios *Changed gecko output to use unsafe usb_sendbuffer --- source/GameBootProcess.cpp | 8 +++++--- source/gecko.c | 2 +- source/menu/MountGamePartition.cpp | 8 +++++++- source/sys.cpp | 6 +++--- source/system/IosLoader.cpp | 5 ++++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/source/GameBootProcess.cpp b/source/GameBootProcess.cpp index 92590dbc..8ef7ba51 100644 --- a/source/GameBootProcess.cpp +++ b/source/GameBootProcess.cpp @@ -97,15 +97,17 @@ int BootGame(const char * gameID) gameList.LoadUnfiltered(); - struct discHdr *header = gameList.GetDiscHeader(gameID); - if(!header) + if(!gameList.GetDiscHeader(gameID)) { gprintf("Game was not found: %s\n", gameID); return -1; } + struct discHdr gameHeader; + memcpy(&gameHeader, gameList.GetDiscHeader(gameID), sizeof(struct discHdr)); + int ret = 0; - header = (mountMethod ? dvdheader : header); + struct discHdr * header = (mountMethod ? dvdheader : &gameHeader); u8 videoChoice = Settings.videomode; u8 languageChoice = Settings.language; diff --git a/source/gecko.c b/source/gecko.c index ea0e38e3..2310cd44 100644 --- a/source/gecko.c +++ b/source/gecko.c @@ -35,7 +35,7 @@ bool InitGecko() if (geckoattached) { usb_flush(EXI_CHANNEL_1); - CON_EnableGecko(1, true); + CON_EnableGecko(1, false); geckoinit = true; return true; } diff --git a/source/menu/MountGamePartition.cpp b/source/menu/MountGamePartition.cpp index fa906388..756bc2d4 100644 --- a/source/menu/MountGamePartition.cpp +++ b/source/menu/MountGamePartition.cpp @@ -109,7 +109,7 @@ static int PartitionChoice() ***************************************************************************/ int MountGamePartition(bool ShowGUI) { - gprintf("MenuCheck()\n"); + gprintf("MountGamePartition()\n"); s32 wbfsinit = MountWBFS(ShowGUI); if (wbfsinit < 0) @@ -122,6 +122,7 @@ int MountGamePartition(bool ShowGUI) memset(game_partition, 0, 6); load_from_fs = -1; + gprintf("\tPartition_GetList\n"); // Added for slow HDD for (int retries = 10; retries > 0; retries--) { @@ -131,6 +132,7 @@ int MountGamePartition(bool ShowGUI) 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) { PartInfo pinfo = partitions.pinfo[Settings.partition]; @@ -151,6 +153,7 @@ int MountGamePartition(bool ShowGUI) if(ret < 0) Sys_LoadMenu(); + gprintf("\tDisc_Init\n"); ret = Disc_Init(); if (ret < 0) { @@ -159,9 +162,12 @@ int MountGamePartition(bool ShowGUI) Sys_LoadMenu(); } + gprintf("\tOpenXMLDatabase\n"); // open database if needed, load titles if needed if (CheckFile(Settings.titlestxt_path)) OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride, true); + gprintf("MountGamePartition() return: %i\n", ret); + return ret; } diff --git a/source/sys.cpp b/source/sys.cpp index 2bb16912..8f4922b0 100644 --- a/source/sys.cpp +++ b/source/sys.cpp @@ -171,14 +171,14 @@ void ScreenShot() { time_t rawtime; struct tm * timeinfo; - char buffer[80]; - char buffer2[80]; + char buffer[150]; + char buffer2[300]; time(&rawtime); timeinfo = localtime(&rawtime); //USBLoader_GX_ScreenShot-Month_Day_Hour_Minute_Second_Year.png 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); } diff --git a/source/system/IosLoader.cpp b/source/system/IosLoader.cpp index 7c435424..045b0f66 100644 --- a/source/system/IosLoader.cpp +++ b/source/system/IosLoader.cpp @@ -4,6 +4,7 @@ #include "../fatmounter.h" #include "../usbloader/usbstorage2.h" #include "../usbloader/disc.h" +#include "../usbloader/wbfs.h" #include "../usbloader/wdvd.h" #include "../wad/nandtitle.h" #include "../mload/mload_modules.h" @@ -92,15 +93,17 @@ s32 IosLoader::LoadGameCios(s32 ios) s32 ret = -1; // Unmount fat before reloading IOS. + WBFS_Close(); + WDVD_Close(); SDCard_deInit(); USBDevice_deInit(); - WDVD_Close(); ret = ReloadIosSafe(ios); // Remount devices after reloading IOS. SDCard_Init(); USBDevice_Init(); + Disc_Init(); return ret; }