mirror of
https://github.com/JorjBauer/aiie.git
synced 2025-04-12 09:37:43 +00:00
abstracting directory filename filter
This commit is contained in:
parent
d001f6cc41
commit
673caef862
6
bios.cpp
6
bios.cpp
@ -708,7 +708,7 @@ void BIOS::stripDirectory()
|
||||
|
||||
void BIOS::DrawDiskNames(uint8_t page, int8_t selection)
|
||||
{
|
||||
uint8_t fileCount = GatherFilenames(page);
|
||||
uint8_t fileCount = GatherFilenames(page, "dsk,.po,nib,img");
|
||||
g_display->clrScr();
|
||||
g_display->drawString(M_NORMAL, 0, 12, "BIOS Configuration - pick disk");
|
||||
|
||||
@ -739,14 +739,14 @@ void BIOS::DrawDiskNames(uint8_t page, int8_t selection)
|
||||
}
|
||||
|
||||
|
||||
uint8_t BIOS::GatherFilenames(uint8_t pageOffset)
|
||||
uint8_t BIOS::GatherFilenames(uint8_t pageOffset, const char *filter)
|
||||
{
|
||||
uint8_t startNum = 10 * pageOffset;
|
||||
uint8_t count = 0; // number we're including in our listing
|
||||
|
||||
while (1) {
|
||||
char fn[BIOS_MAXPATH];
|
||||
int8_t idx = g_filemanager->readDir(rootPath, "dsk,.po,nib,img", fn, startNum + count, BIOS_MAXPATH);
|
||||
int8_t idx = g_filemanager->readDir(rootPath, filter, fn, startNum + count, BIOS_MAXPATH);
|
||||
|
||||
if (idx == -1) {
|
||||
return count;
|
||||
|
2
bios.h
2
bios.h
@ -37,7 +37,7 @@ class BIOS {
|
||||
|
||||
bool SelectDiskImage();
|
||||
void DrawDiskNames(uint8_t page, int8_t selection);
|
||||
uint8_t GatherFilenames(uint8_t pageOffset);
|
||||
uint8_t GatherFilenames(uint8_t pageOffset, const char *filter);
|
||||
|
||||
void stripDirectory();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user