mirror of
https://github.com/Oibaf66/uae-wii.git
synced 2024-11-14 23:05:08 +01:00
Optimization for install on usb device, case insensitive file order
This commit is contained in:
parent
2b2f7577bc
commit
f3dfae985d
@ -2495,7 +2495,7 @@ void default_prefs (struct uae_prefs *p, int type)
|
||||
strcpy (p->SmbPwd, "Password");
|
||||
strcpy (p->SmbShare, "Share");
|
||||
strcpy (p->SmbIp, "192.168.0.1");
|
||||
p->Port= PORT_SD;
|
||||
p->Port= PORT_DEFAULT;
|
||||
p->rumble= 0;
|
||||
p->gfx_correct_ratio = 100;
|
||||
#endif
|
||||
|
@ -32,7 +32,7 @@
|
||||
#define DEBUG_LOG(...) do ; while(0)
|
||||
#endif
|
||||
|
||||
extern int usbismount, smbismount;
|
||||
extern int usbismount, smbismount, sdismount;
|
||||
|
||||
extern const char *strdup_path_expand (const char *src);
|
||||
|
||||
@ -156,7 +156,7 @@ static const char *graphic_messages[] = {
|
||||
/*06*/ "Floppy sound",
|
||||
/*07*/ "^|on|off",
|
||||
/*08*/ "Port",
|
||||
/*09*/ "^|SD|USB|SMB",
|
||||
/*09*/ "^|DEFAULT|SD|USB|SMB",
|
||||
/*10*/ "Rumble",
|
||||
/*11*/ "^|on|off",
|
||||
NULL
|
||||
@ -488,11 +488,19 @@ static void set_Port(int which)
|
||||
{
|
||||
switch (which)
|
||||
{
|
||||
case PORT_SD:
|
||||
case PORT_DEFAULT:
|
||||
prefs_set_attr ("floppy_path", strdup_path_expand (TARGET_FLOPPY_PATH));
|
||||
changed_prefs.Port = which;
|
||||
currprefs.Port = changed_prefs.Port;
|
||||
break;
|
||||
case PORT_SD:
|
||||
if (sdismount) {
|
||||
prefs_set_attr ("floppy_path", strdup_path_expand (TARGET_SD_PATH));
|
||||
changed_prefs.Port = which;
|
||||
currprefs.Port = changed_prefs.Port;}
|
||||
else
|
||||
msgInfo("SD is not mounted",3000,NULL);
|
||||
break;
|
||||
case PORT_USB:
|
||||
if (usbismount) {
|
||||
prefs_set_attr ("floppy_path", strdup_path_expand (TARGET_USB_PATH));
|
||||
|
@ -229,7 +229,7 @@ static int cmpstringp(const void *p1, const void *p2)
|
||||
return -1;
|
||||
if (*p1_s != '[' && *p2_s == '[')
|
||||
return 1;
|
||||
return strcmp(* (char * const *) p1, * (char * const *) p2);
|
||||
return strcasecmp(* (char * const *) p1, * (char * const *) p2);
|
||||
}
|
||||
|
||||
/* Return true if name ends with ext (for filenames) */
|
||||
|
@ -19,6 +19,7 @@ struct strlist {
|
||||
|
||||
// Device Port
|
||||
enum Porttype {
|
||||
PORT_DEFAULT, // Load from device of dol file
|
||||
PORT_SD, // Load from SD card
|
||||
PORT_USB, // Load from USB port
|
||||
PORT_SMB //Load from network
|
||||
|
23
src/main.c
23
src/main.c
@ -78,6 +78,7 @@ struct gui_info gui_data;
|
||||
bool usbismount = false;
|
||||
bool networkisinit = false;
|
||||
bool smbismount = false;
|
||||
bool sdismount = false;
|
||||
|
||||
#if defined(GEKKO)
|
||||
|
||||
@ -1092,14 +1093,26 @@ int main (int argc, char **argv)
|
||||
printf("\x1b[2;0H");
|
||||
|
||||
//initialize libfat library
|
||||
if (!fatInitDefault())
|
||||
{
|
||||
printf("Couldn't initialize SD fat subsytem\n");
|
||||
if (fatInitDefault())
|
||||
printf("FAT subsytem initialized\n\n");
|
||||
else
|
||||
{
|
||||
printf("Couldn't initialize FAT subsytem\n\n");
|
||||
sleep(3);
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
DIR *dp;
|
||||
|
||||
dp = opendir ("sd:/");
|
||||
if (dp) sdismount = 1; else sdismount = 0;
|
||||
|
||||
if (sdismount)
|
||||
printf("SD FAT subsytem initialized\n\n");
|
||||
else
|
||||
printf("Couldn't initialize SD fat subsytem\n\n");
|
||||
|
||||
if (sdismount) closedir (dp);
|
||||
|
||||
usbismount = InitUSB();
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define TARGET_FLOPPY_PATH "/uae/floppies"
|
||||
#define TARGET_HARDFILE_PATH "/uae/harddisks"
|
||||
#define TARGET_SAVESTATE_PATH "/uae/saves"
|
||||
#define TARGET_SD_PATH "sd:/"
|
||||
#define TARGET_USB_PATH "usb:/"
|
||||
#define TARGET_SMB_PATH "smb:/"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user