mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-09-09 09:03:20 +02:00
![dimok789](/assets/img/avatar_default.png)
Released on 2012 05 12 ATTENTION: USB Loader GX Version 3.0 introduces a new auto-update mechanism which is not compatible with old versions. (The old host is offline) If you are still using an old version of USB Loader GX, you need to update manually. Download the latest version or use our easy installer for Windows available on our website. http://code.google.com/p/usbloader-gui/downloads/list You can also check how to install or update manually here: http://code.google.com/p/usbloader-gui/wiki/Installation We are sorry for the inconvenience. New: - Added a new Layout: Channel grid mode! Channel grid displays games as channels and plays banner animations like the real Wii System Menu. Channel grid mode and banner animation requires AHBPROT flags to load resource files directly from your Wii. If you use an old HBC you should use our latest forwarder or update the HBC otherwise you wont have that support. - Added Channel launching from Emulated NAND. (big thanks to TriiForce guys and Miigotu) - Added GameCube games launching from SD Card through Dios Mios Lite (DML). (thanks to G0dLiKe, crediar, all DML devs and FIX94) Check DML website here http://code.google.com/p/dios-mios-lite-source-project/ - Added direct install/uninstall of WAD files to the Emulated NAND Channel path in the features settings menu. - Added a new icon in the toolbar to select the origin of the titles: Wii games, Channels from Wii, Channels from EmuNand, GameCube games. - Added the possibility to boot USB Loader GX without an HDD connected (It will fall back to "Channel from Wii" title's origin). - Added an option to choose which Game Window mode to use between the old "Rotating Disc" or the new "Banner Animation". - Added the favorite level setting to the game settings since it is no longer displayed when using "Banner Animation" game window mode. - Added an option to adjust the screen size for overscan TVs (Use negative values to shrink the display). - Added display of game's size from Wii disc games on the game window prompt (Rotating disc mode only). - Added a button in the search window to switch between "Beginning" and "Content" search methods. - Added auto-complete function to the search window. - Added a new GUI numpad for entering numbers. - Added setting for tooltip delay time. - Added resize of widescreen screenshots to 768px width. - Added cover download for the currently inserted disc. - Added delete of full cover on art work uninstall and game uninstall. - Added a parental control option to block priiloader override on return to system menu. - Added a prompt asking for downloading new language files when trying to update and no language files exist yet. - Added translation parsing for rating descriptors and for genres from wiitdb.xml. Requires a one time update of wiitdb.xml for cache rebuild. - Added a new option to force reading the game's titles from disc header. - Added renaming of internal TitleID of all HBC versions to JODI for GameTDB to find it. - Added a cheat update button to re-download the cheat text file. - Added a cancel button to several progress bar windows: Game installation, NAND extraction, etc. - Added separate path and setting for Emulated NAND Saves and Emulated NAND Channels. - Added per game NAND emulation path setting. - Added Mii extractor and SYSCONF file extractor to Emulated NAND. It always overwrites old files. - Added automatic Mii extraction on save game extract if the Mii file does not exist yet on Emulated NAND. - Added keep of AHBPROT flag on IOS Reload. Homebrews booted now have AHBPROT. (thanks to davebaol) - Added a new feature to force aspect ratio on games/channels. (thanks to giantpune for help with disassembler) - Added Zelda Skyward Sword Alternative dol offset (PAL and NTSC-U) for automatic dol selection. - Added detection of enabled cheat codes from an already created .gct file. - Added support for 2 USB drives for d2x cIOS (Requires d2x v9+). Changes: - Removed buggy focus system completely and added support to control screen pointer with analog sticks from respective controllers if the wiimote is not pointing to the screen. Compatible with Nunchuk, Classic Controller and GameCube controller. A speed factor is available in the GUI settings. - Restructured game's settings for different types of games (Wii/GC/Channels). - Added auto position of progress window messages in vertical direction depending of how many are used at the same time. - If "Titles from GameTDB" is not enabled the title will be read from the folder name if possible or from the game disc header. Title caching can still be used and is recommended in that case. - Settings title, keyboard text and key color can be changed by themes now. - Added optional background image for list/carousel/grid layouts (unused by default theme). - Use of old built-in font for credits window because it doesn't look good with the system menu one. - Removed the need of a cIOS to launch the loader (if anyone uses it with IOS58 for whatever reason). - Improved detection of game partition when starting the loader without configs (fresh start). - Isfs is now initiated once and deinitiated when cleaning up only, instead of the whole init/deinit every single access. - Updated file system libraries. - Removed pngu which is not needed, changed screenshot function to use libgd instead - added init of network into background thread so it is cancelable and has a timeout - changed wifi gecko to UDP socket - Converted all ogg sounds from 44.1 khz to 48 khz. - Optimized use of memory: Sizes over 30kb go to mem2 now first till it runs out ; Avoid use of mem2 area used on IOS_Reload (first 2 mb) ; Change font character texture to I4 which uses half as much memory (less cache memory). - Changed update function to get the files from googlecode website, since old update host website isn't accessible anymore. Fixes: - Fixed small scrollbar bug when having only 1 item. - Fixed reloading of cover image on game list when only 1 item is left after a change (e.g. filtering). - Improved calculation of progress speed. Now it is always the last 15 secs average instead of overall progress speed. - Fixed "new" game showing even with a parental control setting. - Fixed removing of unused cached titles on wiitdb load. - Fixed ocarina codes when using more than 255 codes (brawl+) (untested). - Fixed bug where entering "-1" (Use global) for cIOS was not possible in game settings. - Fixed playback of some BNS banner sounds. - Fixed reloading into another IOS before launch of game. - Removed buggy lz77 implementation and use the one known working. - Fixed launching of dollz compressed dol files. (thanks FIX94) - Fixed reading game's titles from disc header on fat32/ntfs/ext. - Fixed crash on missing <app> tag on meta.xml files. - Forwarder: Fixed crash on drives with physical sector size > 512 bytes. - Forwarder: Fixed endless waiting for slow HDD. (thanks to FIX94) - Forwarder: Added missing ext2 unmount. (thanks to FIX94) - Supports new WiiMotion+ controllers by using latest libraries. - Lots of string handling improvements (thanks to gerbilsoft for his patch) New Channel Grid Mode specific features: - New settings section for all banner's settings. - Use of BNR (banner animation) cache setting to load banners and icon's animation faster. (Enabled by default. Takes ~35MB/100 Banners) Wii games/Channels also accept ID3.bnr for custom-made multi-region banners. - BNR cache path setting. - Pulsing "new" icon on banner grid layout for new games. - Centering and size setting for banner's animation resources. - Channel's zooming speed setting. - Page's scrolling speed setting. New GameCube specific features: - Supports Dios Mios Lite (DML) v1.2+ - Uses of a custom banner for GameCube games which loads the game's internal opening.bnr informations (big thanks to diddy from the wiithemeteam for creating the brlyt/brlan for the banner). - DML settings editable from the loader (global and per game settings). - Supported formats for gamecubes are ISO/GCM and GCRegEx. - Custom game paths. The following paths are accepted: 1. configpath/ID6/ 2. configpath/ID6_Title/ 3. configpath/Title [ID6]/ 4. configpath/gamepath/ (slow loading speed) Accepted game's filenames: title.iso, title.gcm, GAMEID6.iso, GAMEID6.gcm - DML cheats now work the same way as for other Wii games, gct goes to "GCT Cheatcode Path" as GAMEID.gct - GameCube games copy from USB to SD on demand with choice menu to delete SD games to make space, If you want to use this feature then set the "Main GC path" to USB and the "SD GameCube path" to SD card. If duplicated games are detected on SD and USB, the games on SD will be prioritized. - Added GameCube disc dump functionality with multi-disc menu game selection, compress and align support (thanks to FIX94 and Overjoy for their disc dump sources on which this is based). - Use of the BNR cache path to load ID6.bnr or ID3.bnr if available for custom-made banners. (Loading only) - Video mode option to force interlace mode on GameCube. - Fixed force prog mode on DML 1.4
200 lines
3.4 KiB
C++
200 lines
3.4 KiB
C++
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include "CSettings.h"
|
|
#include "settings/CGameStatistics.h"
|
|
#include "newtitles.h"
|
|
|
|
#define NEW_SECONDS (24 * 60 * 60)
|
|
#define GAMETITLES "GameTimestamps.txt"
|
|
|
|
NewTitles *NewTitles::instance = NULL;
|
|
|
|
NewTitles::NewTitles()
|
|
{
|
|
firstTitle = lastTitle = NULL;
|
|
isDirty = isNewFile = false;
|
|
Reload();
|
|
}
|
|
|
|
NewTitles::~NewTitles()
|
|
{
|
|
Save();
|
|
Clean();
|
|
}
|
|
|
|
void NewTitles::Clean(void)
|
|
{
|
|
Title *t = firstTitle;
|
|
while (t != NULL)
|
|
{
|
|
Title *temp = t->next;
|
|
delete t;
|
|
t = temp;
|
|
}
|
|
firstTitle = lastTitle = NULL;
|
|
isDirty = isNewFile = false;
|
|
}
|
|
|
|
void NewTitles::Reload(void)
|
|
{
|
|
Save();
|
|
Clean();
|
|
|
|
// Read the text file
|
|
char path[255];
|
|
snprintf(path, sizeof(path), "%s/%s", Settings.titlestxt_path, GAMETITLES);
|
|
|
|
char line[50];
|
|
FILE *fp = fopen(path, "rb");
|
|
if (!fp)
|
|
{
|
|
isNewFile = true;
|
|
return;
|
|
}
|
|
|
|
time_t currenttime = time(0);
|
|
|
|
while (fgets(line, sizeof(line), fp))
|
|
{
|
|
// This is one line
|
|
if (line[0] == '#' || line[0] == ';')
|
|
continue;
|
|
|
|
Title *title = new Title;
|
|
memset(title, 0, sizeof(Title));
|
|
|
|
char *delimeter = strchr(line, ':');
|
|
if(!delimeter || ((delimeter-line) > 6)) // check for valid delimiter
|
|
continue;
|
|
|
|
*delimeter = '\0';
|
|
|
|
snprintf(title->titleId, sizeof(title->titleId), "%s", line);
|
|
title->timestamp = strtoul(delimeter+1, 0, 10);
|
|
title->isNew = ((currenttime - title->timestamp) < NEW_SECONDS);
|
|
title->next = NULL;
|
|
|
|
if (firstTitle == NULL)
|
|
{
|
|
firstTitle = title;
|
|
lastTitle = title;
|
|
}
|
|
else
|
|
{
|
|
lastTitle->next = title;
|
|
lastTitle = title;
|
|
}
|
|
}
|
|
|
|
fclose(fp);
|
|
}
|
|
|
|
void NewTitles::CheckGame(const u8 *titleid)
|
|
{
|
|
if (titleid == NULL || strlen((char *) titleid) == 0)
|
|
return;
|
|
|
|
Title *t = firstTitle;
|
|
while (t != NULL)
|
|
{
|
|
// Loop all titles, search for the correct titleid
|
|
if (strncmp((char*)titleid, t->titleId, 6) == 0)
|
|
return; // Game found, which is excellent
|
|
|
|
t = t->next;
|
|
}
|
|
|
|
// Not found, add it
|
|
t = new Title;
|
|
memset(t, 0, sizeof(Title));
|
|
|
|
snprintf(t->titleId, sizeof(t->titleId), "%s", (char *) titleid);
|
|
t->timestamp = time(0);
|
|
t->next = NULL;
|
|
|
|
if (isNewFile)
|
|
{
|
|
t->isNew = false;
|
|
t->timestamp -= (NEW_SECONDS + 1); // Mark all games as not new if this is a new file
|
|
}
|
|
else
|
|
{
|
|
GameStatus *Status = GameStatistics.GetGameStatus(titleid);
|
|
t->isNew = (Status == NULL || Status->PlayCount == 0);
|
|
}
|
|
|
|
if (firstTitle == NULL)
|
|
{
|
|
firstTitle = t;
|
|
lastTitle = t;
|
|
}
|
|
else
|
|
{
|
|
lastTitle->next = t;
|
|
lastTitle = t;
|
|
}
|
|
isDirty = true;
|
|
}
|
|
|
|
bool NewTitles::IsNew(const u8 *titleid) const
|
|
{
|
|
if (!titleid) return false;
|
|
|
|
Title *t = firstTitle;
|
|
|
|
while(t != NULL)
|
|
{
|
|
// Loop all titles, search for the correct titleid
|
|
if (strncmp((char*)titleid, t->titleId, 6) == 0)
|
|
return t->isNew;
|
|
|
|
t = t->next;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void NewTitles::Remove(const u8 *titleid)
|
|
{
|
|
if (titleid == NULL) return;
|
|
|
|
Title *t = firstTitle, *prev = NULL;
|
|
while (t != NULL)
|
|
{
|
|
if (strncmp((char*)titleid, t->titleId, 6) == 0)
|
|
{
|
|
if (prev == NULL)
|
|
firstTitle = t->next;
|
|
else
|
|
prev->next = t->next;
|
|
|
|
delete t;
|
|
isDirty = true;
|
|
return;
|
|
}
|
|
prev = t;
|
|
t = t->next;
|
|
}
|
|
}
|
|
|
|
void NewTitles::Save(void)
|
|
{
|
|
if (!isDirty) return;
|
|
|
|
char path[255];
|
|
snprintf(path, sizeof(path), "%s/%s", Settings.titlestxt_path, GAMETITLES);
|
|
|
|
FILE *fp = fopen(path, "wb");
|
|
if (fp == NULL)
|
|
return;
|
|
|
|
Title *t = firstTitle;
|
|
while (t != NULL && strlen(t->titleId) > 0)
|
|
{
|
|
fprintf(fp, "%.6s:%lu\n", t->titleId, t->timestamp);
|
|
t = t->next;
|
|
}
|
|
fclose(fp);
|
|
}
|