mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-15 16:05:10 +01:00
1618b4b1e0
New: - Added game categories and filter games list by categories (Can be imported from WiiTDB). - Wiinertag support. - Supporting arguments from meta.xml on boot (--ios=xxx and --usbport=x) (Requires Homebrew Channel 1.0.7+ or UNEO Forwarder v3.0). - New ehci modules by Rodries with better drive compatibility. - Added two new video modes to force progressive video mode, 'FORCE PAL480p' and 'FORCE NTSC480p'. - Added Sneek Video Patch mode. - Added new 'Inherit' setting for game settings named "Use global". If that option is set then the main loader setting is used. - Full d2x cIOS support with it's new features (Block IOS Reload, Return To, Sector Sizes > 512). - Support for sector sizes > 512B with FAT32/NTFS (Requires d2x v6+) - Real support for simultanious use of both USB ports without switching the 2nd drive temporary off. (Requires Hermes cIOS or Rodries MOD of the Hermes cIOS (recommended)) - Added two new settings menus - Added saving of game browser position when returning to USB Loader GX Changes: - Improved several GUI controls/navigations - Changed settings menu layout and sorted the items to their correct place (HDD menu, features menu) - Set games settings to use the global setting by default, set to "use global" to use the main loader settings. - Use TinyXML instead of MXML (better XML support) - Updated to new libs (libogc, libfat, libext2fs, libntfs) Fix: - "Return to" option now work for all games, even problematic games like Prince of Persia. (Requires d2x v4+) - Xflip setting fixed. - Fix the parental lock of Individual game settings (Thanks to NJ7) - Fix Theme downloader - Fixed reset of the loader when loading game with IOS reload and disabled WiiTDB titles - Fixed timeout timer on startup to count correctly. - Fixed reversed disc image download when Custom/Original option is selected - Fixed reload of game list after a game rename - Fixed horizontal text scrolling - Fixed booting games by arguments (headless id feature) - Fixed We Dare game boot (thx oggzee) R1099 Change Log: *Added IOS225 from Rodries cIOS Installer MOD to Hermes IOS types New Forwarder V3.0 Changes: *added support for ext partitions *added support for arguments from xml *clean up of source
73 lines
1.0 KiB
C
73 lines
1.0 KiB
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
#include <ctype.h>
|
|
#include <ogcsys.h>
|
|
|
|
static char *trimcopy(char *src, char *dest, int size)
|
|
{
|
|
int i = 0;
|
|
while (*src == ' ') src++;
|
|
|
|
while (*src != 0 && *src != '\n' && *src != '\r' && i < size-1)
|
|
{
|
|
dest[i] = *src;
|
|
i++;
|
|
src++;
|
|
}
|
|
dest[i] = 0;
|
|
i--;
|
|
|
|
while(i > 0 && dest[i] == ' ')
|
|
{
|
|
dest[i] = 0;
|
|
i--;
|
|
}
|
|
|
|
return dest;
|
|
}
|
|
|
|
static char *cfg_parseline(char *line)
|
|
{
|
|
char tmp[300], name[200];
|
|
snprintf(tmp, sizeof(tmp), line);
|
|
char *eq = strchr(tmp, '=');
|
|
if (!eq)
|
|
return NULL;
|
|
|
|
*eq = 0;
|
|
|
|
trimcopy(tmp, name, sizeof(name));
|
|
|
|
if(strcmp(name, "update_path") == 0)
|
|
return eq+1;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
bool cfg_parsefile(char *fname, int size)
|
|
{
|
|
FILE *f = fopen(fname, "r");
|
|
if (!f)
|
|
return false;
|
|
|
|
char line[300];
|
|
|
|
while (fgets(line, sizeof(line), f))
|
|
{
|
|
if (line[0] == '#') continue;
|
|
|
|
char * value = cfg_parseline(line);
|
|
if(value)
|
|
{
|
|
trimcopy(value, fname, size);
|
|
break;
|
|
}
|
|
}
|
|
fclose(f);
|
|
return true;
|
|
}
|
|
|