fixed ROM file selector

This commit is contained in:
ekeeke31 2010-05-18 07:35:29 +00:00
parent 61e4873c07
commit 0a83f8ccdd
4 changed files with 23 additions and 38 deletions

View File

@ -58,7 +58,6 @@ void ggenie_init(void)
#ifdef LSB_FIRST #ifdef LSB_FIRST
/* Byteswap ROM */ /* Byteswap ROM */
int i;
uint8 temp; uint8 temp;
for(i = 0; i < 0x8000; i += 2) for(i = 0; i < 0x8000; i += 2)
{ {

View File

@ -227,7 +227,7 @@ void DVD_ClearDirectory(void)
int DVD_UpdateDirectory(bool go_up, u64 offset, u32 length) int DVD_UpdateDirectory(bool go_up, u64 offset, u32 length)
{ {
/* root has no parent directory */ /* root has no parent directory */
if (go_up && (basedir == rootdir)) if ((basedir == rootdir) && (go_up || (offset == basedir)))
return 0; return 0;
/* simply update current root directory */ /* simply update current root directory */

View File

@ -48,7 +48,8 @@ void FAT_ClearDirectory(void)
/*************************************************************************** /***************************************************************************
* FAT_UpdateDirectory * FAT_UpdateDirectory
* *
* Update FAT current root directory * Update FAT current directory
* return zero if exiting root
***************************************************************************/ ***************************************************************************/
int FAT_UpdateDirectory(bool go_up, char *dirname) int FAT_UpdateDirectory(bool go_up, char *dirname)
{ {

View File

@ -484,12 +484,8 @@ int FileSelector(unsigned char *buffer, bool useFAT)
/* ensure we are in focus area */ /* ensure we are in focus area */
if (go_up || (m->selected < m->max_buttons)) if (go_up || (m->selected < m->max_buttons))
{ {
/*** This is directory ***/ if (go_up || filelist[selection].flags)
if (filelist[selection].flags)
{ {
/* force going up */
go_up = (selection == 0);
/* get new directory */ /* get new directory */
if (useFAT) if (useFAT)
ret = FAT_UpdateDirectory(go_up,filelist[selection].filename); ret = FAT_UpdateDirectory(go_up,filelist[selection].filename);
@ -528,41 +524,30 @@ int FileSelector(unsigned char *buffer, bool useFAT)
return 0; return 0;
} }
} }
/*** This is a file ***/
else else
{ {
/* root directory ? */ /* Load ROM file from device */
if (go_up) if (useFAT)
{ size = FAT_LoadFile(buffer,selection);
GUI_DeleteMenu(m);
return 0;
}
else else
size = DVD_LoadFile(buffer,selection);
/* Reload emulation */
if (size)
{ {
/* Load ROM file from device */ if (config.s_auto & 2)
if (useFAT) slot_autosave(config.s_default,config.s_device);
size = FAT_LoadFile(buffer,selection); reloadrom(size,filelist[selection].filename);
else if (config.s_auto & 1)
size = DVD_LoadFile(buffer,selection); slot_autoload(0,config.s_device);
if (config.s_auto & 2)
/* Reload emulation */ slot_autoload(config.s_default,config.s_device);
if (size)
{
if (config.s_auto & 2)
slot_autosave(config.s_default,config.s_device);
reloadrom(size,filelist[selection].filename);
if (config.s_auto & 1)
slot_autoload(0,config.s_device);
if (config.s_auto & 2)
slot_autoload(config.s_default,config.s_device);
}
/* Exit */
GUI_MsgBoxClose();
GUI_DeleteMenu(m);
return size;
} }
/* Exit */
GUI_MsgBoxClose();
GUI_DeleteMenu(m);
return size;
} }
} }
} }