Core: Report disc read errors to the user.

At least when we can detect this, better not to keep silent about it.
This commit is contained in:
Unknown W. Brackets
2018-09-29 00:45:50 -07:00
parent 41a27be10e
commit ce6cb7e7c9
3 changed files with 44 additions and 18 deletions
+3
View File
@@ -204,6 +204,7 @@ void ISOFileSystem::ReadDirectory(TreeEntry *root) {
for (u32 secnum = root->startsector, endsector = root->startsector + (root->dirsize + 2047) / 2048; secnum < endsector; ++secnum) {
u8 theSector[2048];
if (!blockDevice->ReadBlock(secnum, theSector)) {
blockDevice->NotifyReadError();
ERROR_LOG(FILESYS, "Error reading block for directory %s - skipping", root->name.c_str());
root->valid = true; // Prevents re-reading
return;
@@ -220,6 +221,7 @@ void ISOFileSystem::ReadDirectory(TreeEntry *root) {
const int IDENTIFIER_OFFSET = 33;
if (offset + IDENTIFIER_OFFSET + dir.identifierLength > 2048) {
blockDevice->NotifyReadError();
ERROR_LOG(FILESYS, "Directory entry crosses sectors, corrupt iso?");
return;
}
@@ -254,6 +256,7 @@ void ISOFileSystem::ReadDirectory(TreeEntry *root) {
if (entry->isDirectory && !relative) {
if (entry->startsector == root->startsector) {
blockDevice->NotifyReadError();
ERROR_LOG(FILESYS, "WARNING: Appear to have a recursive file system, breaking recursion. Probably corrupt ISO.");
}
}