MCPcopy Create free account
hub / github.com/dborth/fceugx / FindAndSelectLastLoadedFile

Function FindAndSelectLastLoadedFile

source/fileop.cpp:551–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551void FindAndSelectLastLoadedFile ()
552{
553 int indexFound = -1;
554
555 for(int j=1; j < browser.numEntries; j++)
556 {
557 if(strcmp(browserList[j].filename, GCSettings.LastFileLoaded) == 0)
558 {
559 indexFound = j;
560 break;
561 }
562 }
563
564 // move to this file
565 if(indexFound > 0)
566 {
567 if(indexFound >= FILE_PAGESIZE)
568 {
569 int newIndex = (floor(indexFound/(float)FILE_PAGESIZE)) * FILE_PAGESIZE;
570
571 if(newIndex + FILE_PAGESIZE > browser.numEntries)
572 newIndex = browser.numEntries - FILE_PAGESIZE;
573
574 if(newIndex < 0)
575 newIndex = 0;
576
577 browser.pageIndex = newIndex;
578 }
579 browser.selIndex = indexFound;
580 }
581
582 selectLoadedFile = 2; // selecting done
583}
584
585static bool ParseDirEntries()
586{

Callers 1

BrowserChangeFolderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected