mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-04 18:45:05 +01:00
*Fixed IOS reload before game start into game specific ios
*Changed gecko output to use unsafe usb_sendbuffer
This commit is contained in:
parent
bd7ce32a8b
commit
49b5a5f329
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user