core, main.h: Abort on 32Bit ROMs (#309)
* core, main.h: Abort on 32Bit ROMs * main.cpp: Fix Grammar
This commit is contained in:
parent
68183e7b5a
commit
358050cfc6
|
@ -92,6 +92,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
|
||||||
return ResultStatus::ErrorLoader_ErrorEncrypted;
|
return ResultStatus::ErrorLoader_ErrorEncrypted;
|
||||||
case Loader::ResultStatus::ErrorInvalidFormat:
|
case Loader::ResultStatus::ErrorInvalidFormat:
|
||||||
return ResultStatus::ErrorLoader_ErrorInvalidFormat;
|
return ResultStatus::ErrorLoader_ErrorInvalidFormat;
|
||||||
|
case Loader::ResultStatus::ErrorUnsupportedArch:
|
||||||
|
return ResultStatus::ErrorUnsupportedArch;
|
||||||
default:
|
default:
|
||||||
return ResultStatus::ErrorSystemMode;
|
return ResultStatus::ErrorSystemMode;
|
||||||
}
|
}
|
||||||
|
@ -115,6 +117,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
|
||||||
return ResultStatus::ErrorLoader_ErrorEncrypted;
|
return ResultStatus::ErrorLoader_ErrorEncrypted;
|
||||||
case Loader::ResultStatus::ErrorInvalidFormat:
|
case Loader::ResultStatus::ErrorInvalidFormat:
|
||||||
return ResultStatus::ErrorLoader_ErrorInvalidFormat;
|
return ResultStatus::ErrorLoader_ErrorInvalidFormat;
|
||||||
|
case Loader::ResultStatus::ErrorUnsupportedArch:
|
||||||
|
return ResultStatus::ErrorUnsupportedArch;
|
||||||
default:
|
default:
|
||||||
return ResultStatus::ErrorLoader;
|
return ResultStatus::ErrorLoader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ public:
|
||||||
ErrorSystemFiles, ///< Error in finding system files
|
ErrorSystemFiles, ///< Error in finding system files
|
||||||
ErrorSharedFont, ///< Error in finding shared font
|
ErrorSharedFont, ///< Error in finding shared font
|
||||||
ErrorVideoCore, ///< Error in the video core
|
ErrorVideoCore, ///< Error in the video core
|
||||||
|
ErrorUnsupportedArch, ///< Unsupported Architecture (32-Bit ROMs)
|
||||||
ErrorUnknown ///< Any other error
|
ErrorUnknown ///< Any other error
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,11 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load(
|
||||||
}
|
}
|
||||||
metadata.Print();
|
metadata.Print();
|
||||||
|
|
||||||
|
const FileSys::ProgramAddressSpaceType arch_bits{metadata.GetAddressSpaceType()};
|
||||||
|
if (arch_bits == FileSys::ProgramAddressSpaceType::Is32Bit) {
|
||||||
|
return ResultStatus::ErrorUnsupportedArch;
|
||||||
|
}
|
||||||
|
|
||||||
// Load NSO modules
|
// Load NSO modules
|
||||||
VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR};
|
VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR};
|
||||||
for (const auto& module : {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", "subsdk3",
|
for (const auto& module : {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", "subsdk3",
|
||||||
|
|
|
@ -72,6 +72,7 @@ enum class ResultStatus {
|
||||||
ErrorAlreadyLoaded,
|
ErrorAlreadyLoaded,
|
||||||
ErrorMemoryAllocationFailed,
|
ErrorMemoryAllocationFailed,
|
||||||
ErrorEncrypted,
|
ErrorEncrypted,
|
||||||
|
ErrorUnsupportedArch,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Interface for loading an application
|
/// Interface for loading an application
|
||||||
|
|
|
@ -357,7 +357,12 @@ bool GMainWindow::LoadROM(const QString& filename) {
|
||||||
QMessageBox::critical(this, tr("Error while loading ROM!"),
|
QMessageBox::critical(this, tr("Error while loading ROM!"),
|
||||||
tr("The ROM format is not supported."));
|
tr("The ROM format is not supported."));
|
||||||
break;
|
break;
|
||||||
|
case Core::System::ResultStatus::ErrorUnsupportedArch:
|
||||||
|
LOG_CRITICAL(Frontend, "Unsupported architecture detected!",
|
||||||
|
filename.toStdString().c_str());
|
||||||
|
QMessageBox::critical(this, tr("Error while loading ROM!"),
|
||||||
|
tr("The ROM uses currently unusable 32-bit architecture"));
|
||||||
|
break;
|
||||||
case Core::System::ResultStatus::ErrorSystemMode:
|
case Core::System::ResultStatus::ErrorSystemMode:
|
||||||
LOG_CRITICAL(Frontend, "Failed to load ROM!");
|
LOG_CRITICAL(Frontend, "Failed to load ROM!");
|
||||||
QMessageBox::critical(this, tr("Error while loading ROM!"),
|
QMessageBox::critical(this, tr("Error while loading ROM!"),
|
||||||
|
|
Reference in New Issue