mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-28 12:11:50 +01:00
fixed ROM file selector
This commit is contained in:
parent
61e4873c07
commit
0a83f8ccdd
@ -58,7 +58,6 @@ void ggenie_init(void)
|
||||
|
||||
#ifdef LSB_FIRST
|
||||
/* Byteswap ROM */
|
||||
int i;
|
||||
uint8 temp;
|
||||
for(i = 0; i < 0x8000; i += 2)
|
||||
{
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user