Skip to content

Commit

Permalink
Various fixes testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
erichelgeson committed Oct 12, 2023
1 parent e8f7dc1 commit de182e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/BlueSCSI_Toolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ static void doCountFiles(const char * dir_name)
file.close();
break;
}
file.getName(name, 32 + 1);
file.getName(name, MAX_MAC_PATH + 1);
file.close();
// only count valid files.
if(!scsiDiskFilenameValid(name))
if(scsiDiskFilenameValid(name))
{
file_count = file_count + 1;
if(file_count > 100) {
Expand Down Expand Up @@ -124,7 +124,10 @@ File get_file_from_index(uint8_t index, const char * dir_name)
file_test.getName(name, MAX_MAC_PATH + 1);

if(!scsiDiskFilenameValid(name))
continue;
{
file_test.close();
continue;
}
if (count == index)
{
dir.close();
Expand All @@ -147,17 +150,16 @@ void onListDevices()
for (int i = 0; i < NUM_SCSIID; i++)
{
const S2S_TargetCfg* cfg = s2s_getConfigById(i);
// id, type
if (cfg && (cfg->scsiId & S2S_CFG_TARGET_ENABLED))
{
scsiDev.data[i] = (int)cfg->deviceType; // 2 == cd
}
else
{
scsiDev.data[i] = 255; // not enabled target.
scsiDev.data[i] = 0xFF; // not enabled target.
}
}
scsiDev.dataLen = 16;
scsiDev.dataLen = NUM_SCSIID;
}

void onSetNextCD()
Expand All @@ -166,7 +168,6 @@ void onSetNextCD()
char full_path[MAX_FILE_PATH * 2];

uint8_t file_index = scsiDev.cdb[1];
uint8_t cd_scsi_id = scsiDev.cdb[2];

image_config_t &img = *(image_config_t*)scsiDev.target->cfg;
File next_cd = get_file_from_index(file_index, CD_IMG_DIR);
Expand Down
2 changes: 1 addition & 1 deletion src/BlueSCSI_disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ bool scsiDiskFilenameValid(const char* name)
{
if (strcasecmp(extension, ignore_exts[i]) == 0)
{
debuglog("-- Ignoring compressed file ", name);
debuglog("-- Ignoring file ", name);
return false;
}
}
Expand Down

0 comments on commit de182e2

Please sign in to comment.