Skip to content

Commit

Permalink
PFBA: match all uppercase filenames, useful for FAT
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Jan 12, 2018
1 parent 61c694b commit 4a6bb8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pfba/gui/romlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RomList::RomList(Io *io, std::vector<Hardware> *hwList, const std::vector<std::s
}

char path[MAX_PATH];
char pathUppercase[MAX_PATH]; // sometimes on FAT32 short files appear as all uppercase
// TODO: fix sorting speed so we don't skip first 24 roms
for (UINT32 i = 24; i < nBurnDrvCount; i++) {

Expand Down Expand Up @@ -63,7 +64,11 @@ RomList::RomList(Io *io, std::vector<Hardware> *hwList, const std::vector<std::s
continue;
}
sprintf(path, "%s.zip", rom.zip);
if (std::find(files[j].begin(), files[j].end(), path) != files[j].end()) {
for (int k=0; k<MAX_PATH; k++) {
pathUppercase[k] = toupper(path[k]);
}
if (std::find(files[j].begin(), files[j].end(), path) != files[j].end() ||
std::find(files[j].begin(), files[j].end(), pathUppercase) != files[j].end()) {
rom.state = BurnDrvIsWorking() ? RomState::WORKING : RomState::NOT_WORKING;
hardwareList->at(0).available_count++;
if (rom.parent) {
Expand Down

0 comments on commit 4a6bb8f

Please sign in to comment.