fixed stupid bug introduced in previous revision [crash when loading from history]

This commit is contained in:
ekeeke31 2010-05-09 01:15:40 +00:00
parent 81054b0420
commit 11e600e933
2 changed files with 9 additions and 4 deletions

View File

@ -139,9 +139,6 @@ int FAT_LoadFile(u8 *buffer, u32 selection)
/* Loading from history */ /* Loading from history */
if(fatType == TYPE_RECENT) if(fatType == TYPE_RECENT)
{ {
/* file browser should be reinitialized */
fatType = -1;
/* full filename */ /* full filename */
sprintf(fname,"%s%s",history.entries[selection].filepath,filelist[selection].filename); sprintf(fname,"%s%s",history.entries[selection].filepath,filelist[selection].filename);
@ -175,6 +172,10 @@ int FAT_LoadFile(u8 *buffer, u32 selection)
else else
history_add_file(fatdir, filelist[selection].filename); history_add_file(fatdir, filelist[selection].filename);
/* file browser should be reinitialized */
if(fatType == TYPE_RECENT)
fatType = -1;
/* Read first data chunk */ /* Read first data chunk */
unsigned char temp[FATCHUNK]; unsigned char temp[FATCHUNK];
fread(temp, FATCHUNK, 1, sdfile); fread(temp, FATCHUNK, 1, sdfile);

View File

@ -2310,10 +2310,14 @@ static int savemenu(void)
/* SRAM disabled */ /* SRAM disabled */
if (sram.on) if (sram.on)
{
m->buttons[0].state |= BUTTON_ACTIVE; m->buttons[0].state |= BUTTON_ACTIVE;
m->buttons[1].shift[0] = 1;
}
else else
{ {
m->buttons[0].state &= ~BUTTON_ACTIVE; m->buttons[0].state &= ~BUTTON_ACTIVE;
m->buttons[1].shift[0] = 0;
if (m->selected == 0) if (m->selected == 0)
m->selected = 1; m->selected = 1;
} }
@ -2468,7 +2472,7 @@ static int savemenu(void)
m->buttons[7].state &= ~BUTTON_ACTIVE; m->buttons[7].state &= ~BUTTON_ACTIVE;
m->buttons[6].shift[0] = 0; m->buttons[6].shift[0] = 0;
m->buttons[6].shift[1] = 2; m->buttons[6].shift[1] = 2;
m->buttons[8].shift[0] = 2; m->buttons[8].shift[0] = (slot > 0) ? 2 : 0;
m->selected = 8; m->selected = 8;
} }