* Prevent downloading file if HTTP response code > 400

Nintendont :
* Removed 32k/cluster limitation.
* Fixed video mode setting "Auto".
* Fixed loading cheats from the second device.
This commit is contained in:
Cyan 2014-04-29 16:08:42 +00:00
parent 18edba07a0
commit 6d9f213091
6 changed files with 33 additions and 32 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>3.0 r1219</version>
<release_date>20140425130603</release_date>
<version>3.0 r1221</version>
<release_date>20140429130640</release_date>
<!-- // remove this line to enable arguments
<arguments>
<arg>--ios=250</arg>

View File

@ -62,9 +62,10 @@ enum ninvideomode
NIN_VID_FORCE_PAL60 = (1<<1),
NIN_VID_FORCE_NTSC = (1<<2),
NIN_VID_FORCE_MPAL = (1<<3),
NIN_VID_PROG = (1<<4),
NIN_VID_FORCE_MASK = NIN_VID_FORCE_PAL50|NIN_VID_FORCE_PAL60|NIN_VID_FORCE_NTSC|NIN_VID_FORCE_MPAL,
NIN_VID_PROG = (1<<4),
};
enum ninlanguage

View File

@ -106,6 +106,7 @@ static int RunAppbooter()
s32 ret = IosLoader::ReloadIosSafe(58);
if(ret < 0 && Settings.EntryIOS != IOS_GetVersion())
IosLoader::ReloadIosKeepingRights(Settings.EntryIOS);
gprintf("Reloaded to IOS%d\n", IOS_GetVersion());
struct __argv args;
SetupARGV(&args);
@ -140,6 +141,8 @@ static int RunAppbooter()
}
}
gprintf("Exiting USBLoaderGX...\n\n");
SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);
_CPU_ISR_Disable( cpu_isr );
__exception_closeall();

View File

@ -200,9 +200,6 @@ struct block downloadfile(const char *url)
}
//check if a cookie is set for this host and load it.
//strcpy(cookie, "Cookie: __cfduid=d8e517c1a10af75d01699adaa9c3d9ffd1398187687536\r\n");
//Form a nice request header to send to the webserver
char* headerformat = "GET %s HTTP/1.0\r\nHost: %s\r\nReferer: %s\r\n%sUser-Agent: USBLoaderGX r%s\r\n\r\n";
char header[strlen(headerformat) + strlen(path) + strlen(domain)*2 + 100];
@ -268,8 +265,8 @@ struct block downloadfile(const char *url)
if (code >=400) // Not found
{
//gprintf("HTTP ERROR: %s\n", htstat);
//free(response.data);
//return emptyblock;
free(response.data);
return emptyblock;
}
}
}

View File

@ -1008,13 +1008,6 @@ int GameBooter::BootNintendont(struct discHdr *gameHdr)
WindowPrompt(tr("Error:"), fmt(tr("To run GameCube games with %s you need to set your 'Main GameCube Path' on a primary partition."),LoaderName), tr("OK"));
return 0;
}
// Check cluster size
if(usbHandle->GetPartitionClusterSize(usbHandle->GetLBAStart(portPart)) > 32768)
{
WindowPrompt(tr("Error:"), fmt(tr("To run GameCube games with %s you need to use a partition with 32k bytes/cluster or less."),LoaderName), tr("OK"));
return 0;
}
}
@ -1253,7 +1246,7 @@ int GameBooter::BootNintendont(struct discHdr *gameHdr)
}
else
{
snprintf(nin_config->CheatPath, sizeof(nin_config->CheatPath), "NINTemp.gct");
snprintf(nin_config->CheatPath, sizeof(nin_config->CheatPath), "/NINTemp.gct");
}
nin_config->Config |= NIN_CFG_CHEATS | NIN_CFG_CHEAT_PATH;
@ -1269,7 +1262,10 @@ int GameBooter::BootNintendont(struct discHdr *gameHdr)
if(ninWidescreenChoice)
nin_config->Config |= NIN_CFG_FORCE_WIDE;
if(ninProgressivePatch)
{
nin_config->Config |= NIN_CFG_FORCE_PROG;
nin_config->VideoMode |= NIN_VID_PROG;
}
if(ninAutobootChoice)
nin_config->Config |= NIN_CFG_AUTO_BOOT;
if(ninUSBHIDChoice)
@ -1280,15 +1276,16 @@ int GameBooter::BootNintendont(struct discHdr *gameHdr)
nin_config->Config |= NIN_CFG_USB; // r40+
gprintf("NIN: config 0x%08x\n", nin_config->Config);
// Max Pads - Make a proper setting later
nin_config->MaxPads = 4; // NIN_CFG_VERSION 2 r42
// GameID for MCEmu
memcpy(&nin_config->GameID, gameHdr->id, 4); // NIN_CFG_VERSION 2 r83
// GameID for Video mode DiscDefault
memcpy((u8 *)Disc_ID, gameHdr->id, 6);
DCFlushRange((u8 *)Disc_ID, 6);
// Setup Video Mode
if(ninVideoChoice == DML_VIDEO_NONE) // No video mode
{
@ -1298,8 +1295,8 @@ int GameBooter::BootNintendont(struct discHdr *gameHdr)
{
if(ninVideoChoice == DML_VIDEO_AUTO) // Auto select video mode
{
nin_config->VideoMode = NIN_VID_AUTO;
Disc_SelectVMode(VIDEO_MODE_DISCDEFAULT, false, NULL, NULL);
Disc_SelectVMode(VIDEO_MODE_DISCDEFAULT, false, NULL, &nin_config->VideoMode);
nin_config->VideoMode |= NIN_VID_AUTO;
}
else // Force user choice
{
@ -1307,15 +1304,16 @@ int GameBooter::BootNintendont(struct discHdr *gameHdr)
if(!(nin_config->VideoMode & NIN_VID_AUTO))
nin_config->VideoMode |= NIN_VID_FORCE;
if(nin_config->VideoMode & NIN_CFG_FORCE_PROG)
{
nin_config->VideoMode &= ~NIN_CFG_FORCE_PROG; // clear Force_PROG bit in VideoMode
if(nin_config->VideoMode & NIN_VID_PROG)
nin_config->Config |= NIN_CFG_FORCE_PROG; // Set Force_PROG bit in Config
}
}
Disc_SetVMode();
}
gprintf("NIN: config 0x%08x\n", nin_config->Config);
gprintf("NIN: Video mode 0x%08x\n", nin_config->VideoMode);
// Set game language setting
if(languageChoice >= GC_ENGLISH && languageChoice <= GC_DUTCH)
{

View File

@ -90,18 +90,20 @@ void Disc_SelectVMode(u8 videoselected, bool devolution, u32 *dml_VideoMode, u32
rmode_reg = PAL60 ? VI_EURGB60 : VI_PAL;
rmode = progressive ? &TVEurgb60Hz480Prog : (PAL60 ? &TVEurgb60Hz480IntDf : &TVPal528IntDf);
if(dml_VideoMode) *dml_VideoMode = progressive ? DML_VID_FORCE_PROG : (PAL60 ? DML_VID_FORCE_PAL60 : DML_VID_FORCE_PAL50);
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_CFG_FORCE_PROG : (PAL60 ? NIN_VID_FORCE_PAL60 : NIN_VID_FORCE_PAL50);
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_VID_FORCE_PAL60 | NIN_VID_PROG : (PAL60 ? NIN_VID_FORCE_PAL60 : NIN_VID_FORCE_PAL50);
break;
case CONF_VIDEO_MPAL:
rmode_reg = VI_MPAL;
rmode = progressive ? &TVEurgb60Hz480Prog : &TVMpal480IntDf;
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_VID_FORCE_MPAL | NIN_VID_PROG : NIN_VID_FORCE_MPAL;
break;
case CONF_VIDEO_NTSC:
rmode_reg = VI_NTSC;
rmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf;
if(dml_VideoMode) *dml_VideoMode = progressive ? DML_VID_FORCE_PROG : DML_VID_FORCE_NTSC;
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_CFG_FORCE_PROG : NIN_VID_FORCE_NTSC;
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_VID_FORCE_NTSC | NIN_VID_PROG : NIN_VID_FORCE_NTSC;
break;
}
@ -121,7 +123,7 @@ void Disc_SelectVMode(u8 videoselected, bool devolution, u32 *dml_VideoMode, u32
rmode_reg = PAL60 ? VI_EURGB60 : VI_PAL;
rmode = progressive ? &TVEurgb60Hz480Prog : (PAL60 ? &TVEurgb60Hz480IntDf : &TVPal528IntDf);
if(dml_VideoMode) *dml_VideoMode = progressive ? DML_VID_FORCE_PROG : (PAL60 ? DML_VID_FORCE_PAL60 : DML_VID_FORCE_PAL50);
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_CFG_FORCE_PROG : (PAL60 ? NIN_VID_FORCE_PAL60 : NIN_VID_FORCE_PAL50);
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_VID_FORCE_PAL60 | NIN_VID_PROG : (PAL60 ? NIN_VID_FORCE_PAL60 : NIN_VID_FORCE_PAL50);
break;
// NTSC
case 'E':
@ -129,7 +131,7 @@ void Disc_SelectVMode(u8 videoselected, bool devolution, u32 *dml_VideoMode, u32
rmode_reg = VI_NTSC;
rmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf;
if(dml_VideoMode) *dml_VideoMode = progressive ? DML_VID_FORCE_PROG : DML_VID_FORCE_NTSC;
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_CFG_FORCE_PROG : NIN_VID_FORCE_NTSC;
if(nin_VideoMode) *nin_VideoMode = progressive ? NIN_VID_FORCE_NTSC | NIN_VID_PROG : NIN_VID_FORCE_NTSC;
break;
default:
if(dml_VideoMode) *dml_VideoMode = DML_VID_DML_AUTO;
@ -159,13 +161,13 @@ void Disc_SelectVMode(u8 videoselected, bool devolution, u32 *dml_VideoMode, u32
rmode = &TVEurgb60Hz480Prog;
rmode_reg = VI_EURGB60;
if(dml_VideoMode) *dml_VideoMode = DML_VID_FORCE_PROG | DML_VID_PROG_PATCH;
if(nin_VideoMode) *nin_VideoMode = NIN_CFG_FORCE_PROG | NIN_VID_FORCE_PAL60;
if(nin_VideoMode) *nin_VideoMode = NIN_VID_FORCE_PAL60 | NIN_VID_PROG;
break;
case VIDEO_MODE_NTSC480P:
rmode = &TVNtsc480Prog;
rmode_reg = VI_NTSC;
if(dml_VideoMode) *dml_VideoMode = DML_VID_FORCE_PROG | DML_VID_PROG_PATCH;
if(nin_VideoMode) *nin_VideoMode = NIN_CFG_FORCE_PROG | NIN_VID_FORCE_NTSC;
if(nin_VideoMode) *nin_VideoMode = NIN_VID_FORCE_NTSC | NIN_VID_PROG;
break;
case VIDEO_MODE_SYSDEFAULT: // AUTO PATCH TO SYSTEM
break;