diff --git a/source/ngc/filebrowser.cpp b/source/ngc/filebrowser.cpp index 96413b8..b67fc36 100644 --- a/source/ngc/filebrowser.cpp +++ b/source/ngc/filebrowser.cpp @@ -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 diff --git a/source/ngc/fileop.cpp b/source/ngc/fileop.cpp index 7b6b79d..52edd51 100644 --- a/source/ngc/fileop.cpp +++ b/source/ngc/fileop.cpp @@ -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"); diff --git a/source/ngc/gui/gui_filebrowser.cpp b/source/ngc/gui/gui_filebrowser.cpp index 683ed24..7fc3c3b 100644 --- a/source/ngc/gui/gui_filebrowser.cpp +++ b/source/ngc/gui/gui_filebrowser.cpp @@ -151,6 +151,7 @@ void GuiFileBrowser::SetFocus(int f) void GuiFileBrowser::ResetState() { state = STATE_DEFAULT; + selectedItem = 0; for(int i=0; iSetPosition(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) diff --git a/source/ngc/gui/gui_optionbrowser.cpp b/source/ngc/gui/gui_optionbrowser.cpp index 309f4ac..e31747e 100644 --- a/source/ngc/gui/gui_optionbrowser.cpp +++ b/source/ngc/gui/gui_optionbrowser.cpp @@ -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 diff --git a/source/ngc/gui/gui_savebrowser.cpp b/source/ngc/gui/gui_savebrowser.cpp index e611678..0ee7b3d 100644 --- a/source/ngc/gui/gui_savebrowser.cpp +++ b/source/ngc/gui/gui_savebrowser.cpp @@ -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 diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 3f44ea9..f6bd166 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -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); } } }