* Fixed NTFSLib's Mem2 Allocation (Thanks Dimok)

* Fixed missing parent folder ".." when browsing a NTFS partition.
* DML: Updated DM(L) detection up to version 2.9
* DEVO: Added F-ZeroAX and TimerFix settings 
       (requires Devolution r196 or newer)
This commit is contained in:
Cyan 2013-04-14 21:02:09 +00:00
parent 19b426b5a7
commit ff4b075fbb
14 changed files with 145 additions and 30 deletions

View File

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

View File

@ -20,13 +20,15 @@
#define LAUNCH_DEVO() ((void(*)(void))loader_bin)()
#define DEVO_SIG 0x3EF9DB23
#define DEVO_CONFIG_VERSION 0x0110
#define DEVO_CONFIG_VERSION 0x0111
enum DEVOConfig
{
DEVO_CFG_WIFILOG = (1<<0), // added in Devo config version 0x0110
DEVO_CFG_WIFILOG = (1<<0), // added in Devo r100, config version 0x0110
DEVO_CFG_WIDE = (1<<1), // added in Devo r142
DEVO_CFG_NOLED = (1<<2)
DEVO_CFG_NOLED = (1<<2),
DEVO_CFG_FZERO_AX = (1<<3), // added in Devo r196, config version x0111
DEVO_CFG_TIMER_FIX = (1<<4)
};
typedef struct _DEVO_CFG

Binary file not shown.

View File

@ -71,8 +71,10 @@ static const char * DMLVersions[] =
"v2.6.1", // DM 2.6 update 1
"v2.7", // DM 2.7
"v2.7", // DML 2.7
"v2.8+", // DM 2.8
"v2.8+", // DML 2.8
"v2.8", // DML 2.8
"v2.8", // DM 2.8
"v2.9+", // DML 2.9
"v2.9+", // DM 2.9
};

View File

@ -249,6 +249,19 @@ int ParseDirectory(const char* Path, int Flags, FILTERCASCADE *Filter)
struct dirent *dirent = NULL;
// Adds parent directory ".." manually if in a subdirectory to fix NTFS folder browsing.
if (strcmp(fulldir, browser->rootdir) != 0)
{
snprintf(filename, sizeof(filename), "..");
BROWSERENTRY newEntry;
memset(&newEntry, 0, sizeof(BROWSERENTRY)); // clear the new entry
strlcpy(newEntry.filename, filename, sizeof(newEntry.filename));
strlcpy(newEntry.displayname, filename, sizeof(newEntry.displayname));
newEntry.isdir = 1; // flag this as a dir
if (ParseFilter(Filter, &newEntry)) browser->browserList.push_back(newEntry);
}
while ((dirent = readdir(dir)) != 0)
{
snprintf(filename, sizeof(filename), "%s/%s", fulldir, dirent->d_name);
@ -257,7 +270,7 @@ int ParseDirectory(const char* Path, int Flags, FILTERCASCADE *Filter)
snprintf(filename, sizeof(filename), dirent->d_name);
if (strcmp(filename, ".") != 0)
if (strcmp(filename, ".") != 0 && strcmp(filename, "..") != 0)
{
BROWSERENTRY newEntry;
memset(&newEntry, 0, sizeof(BROWSERENTRY)); // clear the new entry

View File

@ -219,6 +219,8 @@ bool CGameSettings::Save()
fprintf(f, "DEVOMCEmulation:%d; ", GameList[i].DEVOMCEmulation);
fprintf(f, "DEVOWidescreen:%d; ", GameList[i].DEVOWidescreen);
fprintf(f, "DEVOActivityLED:%d; ", GameList[i].DEVOActivityLED);
fprintf(f, "DEVOFZeroAX:%d; ", GameList[i].DEVOFZeroAX);
fprintf(f, "DEVOTimerFix:%d; ", GameList[i].DEVOTimerFix);
fprintf(f, "Locked:%d;\n", GameList[i].Locked);
}
fprintf(f, "# END\n");
@ -399,6 +401,16 @@ bool CGameSettings::SetSetting(GameCFG & game, const char *name, const char *val
game.DEVOActivityLED = atoi(value);
return true;
}
else if(strcmp(name, "DEVOFZeroAX") == 0)
{
game.DEVOFZeroAX = atoi(value);
return true;
}
else if(strcmp(name, "DEVOTimerFix") == 0)
{
game.DEVOTimerFix = atoi(value);
return true;
}
return false;
}
@ -533,5 +545,7 @@ void CGameSettings::SetDefault(GameCFG &game)
game.DEVOMCEmulation = INHERIT;
game.DEVOWidescreen = INHERIT;
game.DEVOActivityLED = INHERIT;
game.DEVOFZeroAX = INHERIT;
game.DEVOTimerFix = INHERIT;
game.Locked = OFF;
}

View File

@ -43,6 +43,8 @@ typedef struct _GameCFG
short DEVOMCEmulation;
short DEVOWidescreen;
short DEVOActivityLED;
short DEVOFZeroAX;
short DEVOTimerFix;
short Locked;
void operator=(const struct _GameCFG &game)
@ -81,6 +83,8 @@ typedef struct _GameCFG
this->DEVOMCEmulation = game.DEVOMCEmulation;
this->DEVOWidescreen = game.DEVOWidescreen;
this->DEVOActivityLED = game.DEVOActivityLED;
this->DEVOFZeroAX = game.DEVOFZeroAX;
this->DEVOTimerFix = game.DEVOTimerFix;
this->Locked = game.Locked;
}
} GameCFG;

View File

@ -183,6 +183,8 @@ void CSettings::SetDefault()
DEVOMCEmulation = OFF;
DEVOWidescreen = OFF;
DEVOActivityLED = ON;
DEVOFZeroAX = OFF;
DEVOTimerFix = OFF;
GCInstallCompressed = OFF;
GCInstallAligned = OFF;
}
@ -413,6 +415,8 @@ bool CSettings::Save()
fprintf(file, "DEVOMCEmulation = %d\n", DEVOMCEmulation);
fprintf(file, "DEVOWidescreen = %d\n", DEVOWidescreen);
fprintf(file, "DEVOActivityLED = %d\n", DEVOActivityLED);
fprintf(file, "DEVOFZeroAX = %d\n", DEVOFZeroAX);
fprintf(file, "DEVOTimerFix = %d\n", DEVOTimerFix);
fprintf(file, "DEVOLoaderPath = %s\n", DEVOLoaderPath);
fprintf(file, "GCInstallCompressed = %d\n", GCInstallCompressed);
fprintf(file, "GCInstallAligned = %d\n", GCInstallAligned);
@ -878,6 +882,16 @@ bool CSettings::SetSetting(char *name, char *value)
DEVOActivityLED = atoi(value);
return true;
}
else if (strcmp(name, "DEVOFZeroAX") == 0)
{
DEVOFZeroAX = atoi(value);
return true;
}
else if (strcmp(name, "DEVOTimerFix") == 0)
{
DEVOTimerFix = atoi(value);
return true;
}
else if (strcmp(name, "DEVOLoaderPath") == 0)
{
strlcpy(DEVOLoaderPath, value, sizeof(DEVOLoaderPath));

View File

@ -185,6 +185,8 @@ class CSettings
short DEVOMCEmulation;
short DEVOWidescreen;
short DEVOActivityLED;
short DEVOFZeroAX;
short DEVOTimerFix;
short GCInstallCompressed;
short GCInstallAligned;

View File

@ -179,6 +179,8 @@ void GCGameLoadSM::SetOptionNames()
Options->SetName(Idx++, "%s", tr( "DEVO MemCard Emulation" ));
Options->SetName(Idx++, "%s", tr( "DEVO Force Widescreen" ));
Options->SetName(Idx++, "%s", tr( "DEVO LED Activity" ));
Options->SetName(Idx++, "%s", tr( "DEVO F-Zero AX" ));
Options->SetName(Idx++, "%s", tr( "DEVO Timer Fix" ));
}
void GCGameLoadSM::SetOptionValues()
@ -307,6 +309,18 @@ void GCGameLoadSM::SetOptionValues()
else
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.DEVOActivityLED]));
//! Settings: DEVO F-Zero AX unlock patch
if(GameConfig.DEVOFZeroAX == INHERIT)
Options->SetValue(Idx++, tr("Use global"));
else
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.DEVOFZeroAX]));
//! Settings: DEVO Timer Fix
if(GameConfig.DEVOTimerFix == INHERIT)
Options->SetValue(Idx++, tr("Use global"));
else
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.DEVOTimerFix]));
}
int GCGameLoadSM::GetMenuInternal()
@ -454,6 +468,18 @@ int GCGameLoadSM::GetMenuInternal()
if (++GameConfig.DEVOActivityLED >= MAX_ON_OFF) GameConfig.DEVOActivityLED = INHERIT;
}
//! Settings: DEVO F-Zero AX unlock patch
else if (ret == ++Idx)
{
if (++GameConfig.DEVOFZeroAX >= MAX_ON_OFF) GameConfig.DEVOFZeroAX = INHERIT;
}
//! Settings: DEVO Timer Fix
else if (ret == ++Idx)
{
if (++GameConfig.DEVOTimerFix >= MAX_ON_OFF) GameConfig.DEVOTimerFix = INHERIT;
}
SetOptionValues();
return MENU_NONE;

View File

@ -190,6 +190,8 @@ LoaderSettings::LoaderSettings()
Options->SetName(Idx++, "%s", tr( "DEVO MemCard Emulation" ));
Options->SetName(Idx++, "%s", tr( "DEVO Force Widescreen" ));
Options->SetName(Idx++, "%s", tr( "DEVO LED Activity" ));
Options->SetName(Idx++, "%s", tr( "DEVO F-Zero AX" ));
Options->SetName(Idx++, "%s", tr( "DEVO Timer Fix" ));
SetOptionValues();
@ -328,6 +330,12 @@ void LoaderSettings::SetOptionValues()
//! Settings: DEVO Activity LED
Options->SetValue(Idx++, "%s", tr(OnOffText[Settings.DEVOActivityLED]));
//! Settings: DEVO F-Zero AX unlock patch
Options->SetValue(Idx++, "%s", tr(OnOffText[Settings.DEVOFZeroAX]));
//! Settings: DEVO Timer Fix
Options->SetValue(Idx++, "%s", tr(OnOffText[Settings.DEVOTimerFix]));
}
int LoaderSettings::GetMenuInternal()
@ -565,6 +573,18 @@ int LoaderSettings::GetMenuInternal()
if (++Settings.DEVOActivityLED >= MAX_ON_OFF) Settings.DEVOActivityLED = 0;
}
//! Settings: DEVO F-Zero AX unlock patch
else if (ret == ++Idx)
{
if (++Settings.DEVOFZeroAX >= MAX_ON_OFF) Settings.DEVOFZeroAX = 0;
}
//! Settings: DEVO Activity LED
else if (ret == ++Idx)
{
if (++Settings.DEVOTimerFix >= MAX_ON_OFF) Settings.DEVOTimerFix = 0;
}
SetOptionValues();
return MENU_NONE;

View File

@ -361,13 +361,21 @@ u8 IosLoader::GetDMLVersion(char* releaseDate)
strptime("Feb 21 2013 03:13:49", "%b %d %Y %H:%M:%S", &time);
const time_t dml_2_7_time = mktime(&time);
// Timestamp of DML 2.8
strptime("Feb 24 2013 13:30:29", "%b %d %Y %H:%M:%S", &time);
const time_t dml_2_8_time = mktime(&time);
// Timestamp of DM 2.8
strptime("Feb 24 2013 14:17:03", "%b %d %Y %H:%M:%S", &time);
const time_t dm_2_8_time = mktime(&time);
// Timestamp of DML 2.8
strptime("Feb 24 2013 13:30:29", "%b %d %Y %H:%M:%S", &time);
const time_t dml_2_8_time = mktime(&time);
// Timestamp of DML 2.9
strptime("Apr 5 2013 18:20:33", "%b %d %Y %H:%M:%S", &time);
const time_t dml_2_9_time = mktime(&time);
// Timestamp of DM 2.9
strptime("Apr 5 2013 18:29:35", "%b %d %Y %H:%M:%S", &time);
const time_t dm_2_9_time = mktime(&time);
// Current installed version
@ -378,7 +386,8 @@ u8 IosLoader::GetDMLVersion(char* releaseDate)
if(currentMIOS == DIOS_MIOS)
{
if(difftime(unixTime, dm_2_8_time) >= 0) currentDMLVersion = DML_VERSION_DM_2_8;
if(difftime(unixTime, dm_2_9_time) >= 0) currentDMLVersion = DML_VERSION_DM_2_9;
else if(difftime(unixTime, dm_2_8_time) >= 0) currentDMLVersion = DML_VERSION_DM_2_8;
else if(difftime(unixTime, dm_2_7_time) >= 0) currentDMLVersion = DML_VERSION_DM_2_7;
else if(difftime(unixTime, dm_2_6_1_time) >= 0) currentDMLVersion = DML_VERSION_DM_2_6_1;
else if(difftime(unixTime, dm_2_6_0_time) >= 0) currentDMLVersion = DML_VERSION_DM_2_6_0;
@ -392,7 +401,8 @@ u8 IosLoader::GetDMLVersion(char* releaseDate)
}
else if(currentMIOS == DIOS_MIOS_LITE)
{
if(difftime(unixTime, dml_2_8_time) >= 0) currentDMLVersion = DML_VERSION_DML_2_8;
if(difftime(unixTime, dml_2_9_time) >= 0) currentDMLVersion = DML_VERSION_DML_2_9;
else if(difftime(unixTime, dml_2_8_time) >= 0) currentDMLVersion = DML_VERSION_DML_2_8;
else if(difftime(unixTime, dml_2_7_time) >= 0) currentDMLVersion = DML_VERSION_DML_2_7;
else if(difftime(unixTime, dml_2_6_time) >= 0) currentDMLVersion = DML_VERSION_DML_2_6;
else if(difftime(unixTime, dml_2_5_time) >= 0) currentDMLVersion = DML_VERSION_DML_2_5;

View File

@ -55,8 +55,10 @@ enum DMLVersions
DML_VERSION_DM_2_6_1, // Dec 1 2012 16:42:34
DML_VERSION_DM_2_7, // Feb 20 2013 14:54:33
DML_VERSION_DML_2_7, // Feb 21 2013 03:13:49
DML_VERSION_DM_2_8, // Feb 24 2013 14:17:03
DML_VERSION_DML_2_8, // Feb 24 2013 13:30:29
DML_VERSION_DM_2_8, // Feb 24 2013 14:17:03
DML_VERSION_DML_2_9, // Apr 5 2013 18:20:33
DML_VERSION_DM_2_9, // Apr 5 2013 18:29:35
DML_VERSION_MAX_VERSION,
};

View File

@ -720,6 +720,8 @@ int GameBooter::BootDevolution(struct discHdr *gameHdr)
u8 devoMCEmulation = game_cfg->DEVOMCEmulation == INHERIT ? Settings.DEVOMCEmulation : game_cfg->DEVOMCEmulation;
u8 devoActivityLEDChoice = game_cfg->DEVOActivityLED == INHERIT ? Settings.DEVOActivityLED : game_cfg->DEVOActivityLED;
u8 devoWidescreenChoice = game_cfg->DEVOWidescreen == INHERIT ? Settings.DEVOWidescreen : game_cfg->DEVOWidescreen;
u8 devoFZeroAXChoice = game_cfg->DEVOFZeroAX == INHERIT ? Settings.DEVOFZeroAX : game_cfg->DEVOFZeroAX;
u8 devoTimerFixChoice = game_cfg->DEVOTimerFix == INHERIT ? Settings.DEVOTimerFix : game_cfg->DEVOTimerFix;
if(gameHdr->type == TYPE_GAME_GC_DISC)
@ -828,6 +830,10 @@ int GameBooter::BootDevolution(struct discHdr *gameHdr)
devo_config->options |= DEVO_CFG_WIDE;
if(!devoActivityLEDChoice && DEVO_version >= 142)
devo_config->options |= DEVO_CFG_NOLED; // ON by default
if(devoFZeroAXChoice && DEVO_version >= 196)
devo_config->options |= DEVO_CFG_FZERO_AX;
if(devoTimerFixChoice && DEVO_version >= 196)
devo_config->options |= DEVO_CFG_TIMER_FIX;
// check memory card
if(devoMCEmulation == DEVO_MC_OFF)