mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-29 04:31:49 +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
|
#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)
|
||||||
{
|
{
|
||||||
|
@ -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 */
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user