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
/* Byteswap ROM */
int i;
uint8 temp;
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)
{
/* root has no parent directory */
if (go_up && (basedir == rootdir))
if ((basedir == rootdir) && (go_up || (offset == basedir)))
return 0;
/* simply update current root directory */

View File

@ -48,7 +48,8 @@ void FAT_ClearDirectory(void)
/***************************************************************************
* FAT_UpdateDirectory
*
* Update FAT current root directory
* Update FAT current directory
* return zero if exiting root
***************************************************************************/
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 */
if (go_up || (m->selected < m->max_buttons))
{
/*** This is directory ***/
if (filelist[selection].flags)
if (go_up || filelist[selection].flags)
{
/* force going up */
go_up = (selection == 0);
/* get new directory */
if (useFAT)
ret = FAT_UpdateDirectory(go_up,filelist[selection].filename);
@ -528,41 +524,30 @@ int FileSelector(unsigned char *buffer, bool useFAT)
return 0;
}
}
/*** This is a file ***/
else
{
/* root directory ? */
if (go_up)
{
GUI_DeleteMenu(m);
return 0;
}
/* Load ROM file from device */
if (useFAT)
size = FAT_LoadFile(buffer,selection);
else
size = DVD_LoadFile(buffer,selection);
/* Reload emulation */
if (size)
{
/* Load ROM file from device */
if (useFAT)
size = FAT_LoadFile(buffer,selection);
else
size = DVD_LoadFile(buffer,selection);
/* Reload emulation */
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;
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;
}
}
}