mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-01 00:15:14 +01:00
small bugfixes
This commit is contained in:
parent
565aafb30f
commit
84aaefd004
@ -227,14 +227,14 @@ bool MakeFilePath(char filepath[], int type, int method, char * filename, int fi
|
||||
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
||||
{
|
||||
filename[26] = 0; // truncate filename
|
||||
sprintf(file, "%s%i.%", filename, filenum, ext);
|
||||
sprintf(file, "%s%i.%s", filename, filenum, ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(filenum == 0)
|
||||
sprintf(file, "%s Auto.%", filename, ext);
|
||||
sprintf(file, "%s Auto.%s", filename, ext);
|
||||
else
|
||||
sprintf(file, "%s %i.%", filename, filenum, ext);
|
||||
sprintf(file, "%s %i.%s", filename, filenum, ext);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -453,7 +453,7 @@ LoadFile (char * rbuffer, char *filepath, u32 length, int method, bool silent)
|
||||
|
||||
// add device to filepath
|
||||
char fullpath[1024];
|
||||
sprintf(fullpath, "%s%s", rootdir, filepath);
|
||||
sprintf(fullpath, "%s/%s", rootdir, filepath);
|
||||
|
||||
file = fopen (fullpath, "rb");
|
||||
|
||||
@ -551,7 +551,7 @@ SaveFile (char * buffer, char *filepath, u32 datasize, int method, bool silent)
|
||||
|
||||
// add device to filepath
|
||||
char fullpath[1024];
|
||||
sprintf(fullpath, "%s%s", rootdir, filepath);
|
||||
sprintf(fullpath, "%s/%s", rootdir, filepath);
|
||||
|
||||
// open file for writing
|
||||
file = fopen (fullpath, "wb");
|
||||
|
@ -151,6 +151,7 @@ void GuiFileBrowser::SetFocus(int f)
|
||||
void GuiFileBrowser::ResetState()
|
||||
{
|
||||
state = STATE_DEFAULT;
|
||||
selectedItem = 0;
|
||||
|
||||
for(int i=0; i<PAGESIZE; i++)
|
||||
{
|
||||
@ -188,6 +189,9 @@ void GuiFileBrowser::Draw()
|
||||
|
||||
void GuiFileBrowser::Update(GuiTrigger * t)
|
||||
{
|
||||
if(state == STATE_DISABLED || !t)
|
||||
return;
|
||||
|
||||
// update the location of the scroll box based on the position in the file list
|
||||
int position = 136*(browser.pageIndex + selectedItem) / browser.numEntries;
|
||||
scrollbarBoxBtn->SetPosition(0,position+36);
|
||||
@ -205,7 +209,7 @@ void GuiFileBrowser::Update(GuiTrigger * t)
|
||||
|
||||
if(t->Right() || arrowDownBtn->GetState() == STATE_CLICKED)
|
||||
{
|
||||
if(browser.pageIndex < browser.numEntries)
|
||||
if(browser.pageIndex < browser.numEntries && browser.numEntries > PAGESIZE)
|
||||
{
|
||||
browser.pageIndex += PAGESIZE;
|
||||
if(browser.pageIndex+PAGESIZE >= browser.numEntries)
|
||||
|
@ -235,6 +235,9 @@ void GuiOptionBrowser::Draw()
|
||||
|
||||
void GuiOptionBrowser::Update(GuiTrigger * t)
|
||||
{
|
||||
if(state == STATE_DISABLED || !t)
|
||||
return;
|
||||
|
||||
int next, prev;
|
||||
|
||||
// update the location of the scroll box based on the position in the option list
|
||||
|
@ -219,6 +219,9 @@ void GuiSaveBrowser::Draw()
|
||||
|
||||
void GuiSaveBrowser::Update(GuiTrigger * t)
|
||||
{
|
||||
if(state == STATE_DISABLED || !t)
|
||||
return;
|
||||
|
||||
int i, len;
|
||||
char savetext[50];
|
||||
// update the location of the scroll box based on the position in the option list
|
||||
|
@ -916,8 +916,10 @@ static int MenuGameSelection()
|
||||
#ifdef HW_RVL
|
||||
ShutoffRumble();
|
||||
#endif
|
||||
mainWindow->SetState(STATE_DISABLED);
|
||||
if(BrowserLoadFile(GCSettings.LoadMethod))
|
||||
menu = MENU_EXIT;
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user