summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar N00byKing2018-04-06 17:06:32 +0200
committerGravatar bunnei2018-04-06 11:06:32 -0400
commit358050cfc6cb88b5bfd3997f1e3f1e135ae808e6 (patch)
tree08887b0c7c7db8277494f9b4b18b9e92b8259283 /src
parentMerge pull request #312 from jroweboy/update-fmtlib (diff)
downloadyuzu-358050cfc6cb88b5bfd3997f1e3f1e135ae808e6.tar.gz
yuzu-358050cfc6cb88b5bfd3997f1e3f1e135ae808e6.tar.xz
yuzu-358050cfc6cb88b5bfd3997f1e3f1e135ae808e6.zip
core, main.h: Abort on 32Bit ROMs (#309)
* core, main.h: Abort on 32Bit ROMs * main.cpp: Fix Grammar
Diffstat (limited to 'src')
-rw-r--r--src/core/core.cpp4
-rw-r--r--src/core/core.h1
-rw-r--r--src/core/loader/deconstructed_rom_directory.cpp5
-rw-r--r--src/core/loader/loader.h1
-rw-r--r--src/yuzu/main.cpp7
5 files changed, 17 insertions, 1 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 11654d4da..9f5507a65 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -92,6 +92,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
92 return ResultStatus::ErrorLoader_ErrorEncrypted; 92 return ResultStatus::ErrorLoader_ErrorEncrypted;
93 case Loader::ResultStatus::ErrorInvalidFormat: 93 case Loader::ResultStatus::ErrorInvalidFormat:
94 return ResultStatus::ErrorLoader_ErrorInvalidFormat; 94 return ResultStatus::ErrorLoader_ErrorInvalidFormat;
95 case Loader::ResultStatus::ErrorUnsupportedArch:
96 return ResultStatus::ErrorUnsupportedArch;
95 default: 97 default:
96 return ResultStatus::ErrorSystemMode; 98 return ResultStatus::ErrorSystemMode;
97 } 99 }
@@ -115,6 +117,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
115 return ResultStatus::ErrorLoader_ErrorEncrypted; 117 return ResultStatus::ErrorLoader_ErrorEncrypted;
116 case Loader::ResultStatus::ErrorInvalidFormat: 118 case Loader::ResultStatus::ErrorInvalidFormat:
117 return ResultStatus::ErrorLoader_ErrorInvalidFormat; 119 return ResultStatus::ErrorLoader_ErrorInvalidFormat;
120 case Loader::ResultStatus::ErrorUnsupportedArch:
121 return ResultStatus::ErrorUnsupportedArch;
118 default: 122 default:
119 return ResultStatus::ErrorLoader; 123 return ResultStatus::ErrorLoader;
120 } 124 }
diff --git a/src/core/core.h b/src/core/core.h
index ade456cfc..f497dc022 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -44,6 +44,7 @@ public:
44 ErrorSystemFiles, ///< Error in finding system files 44 ErrorSystemFiles, ///< Error in finding system files
45 ErrorSharedFont, ///< Error in finding shared font 45 ErrorSharedFont, ///< Error in finding shared font
46 ErrorVideoCore, ///< Error in the video core 46 ErrorVideoCore, ///< Error in the video core
47 ErrorUnsupportedArch, ///< Unsupported Architecture (32-Bit ROMs)
47 ErrorUnknown ///< Any other error 48 ErrorUnknown ///< Any other error
48 }; 49 };
49 50
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp
index 8b4ee970f..8696c28bd 100644
--- a/src/core/loader/deconstructed_rom_directory.cpp
+++ b/src/core/loader/deconstructed_rom_directory.cpp
@@ -119,6 +119,11 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load(
119 } 119 }
120 metadata.Print(); 120 metadata.Print();
121 121
122 const FileSys::ProgramAddressSpaceType arch_bits{metadata.GetAddressSpaceType()};
123 if (arch_bits == FileSys::ProgramAddressSpaceType::Is32Bit) {
124 return ResultStatus::ErrorUnsupportedArch;
125 }
126
122 // Load NSO modules 127 // Load NSO modules
123 VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; 128 VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR};
124 for (const auto& module : {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", "subsdk3", 129 for (const auto& module : {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", "subsdk3",
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index dd44ee9a6..b1aabb1cb 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -72,6 +72,7 @@ enum class ResultStatus {
72 ErrorAlreadyLoaded, 72 ErrorAlreadyLoaded,
73 ErrorMemoryAllocationFailed, 73 ErrorMemoryAllocationFailed,
74 ErrorEncrypted, 74 ErrorEncrypted,
75 ErrorUnsupportedArch,
75}; 76};
76 77
77/// Interface for loading an application 78/// Interface for loading an application
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 793d9d739..936a2759b 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -357,7 +357,12 @@ bool GMainWindow::LoadROM(const QString& filename) {
357 QMessageBox::critical(this, tr("Error while loading ROM!"), 357 QMessageBox::critical(this, tr("Error while loading ROM!"),
358 tr("The ROM format is not supported.")); 358 tr("The ROM format is not supported."));
359 break; 359 break;
360 360 case Core::System::ResultStatus::ErrorUnsupportedArch:
361 LOG_CRITICAL(Frontend, "Unsupported architecture detected!",
362 filename.toStdString().c_str());
363 QMessageBox::critical(this, tr("Error while loading ROM!"),
364 tr("The ROM uses currently unusable 32-bit architecture"));
365 break;
361 case Core::System::ResultStatus::ErrorSystemMode: 366 case Core::System::ResultStatus::ErrorSystemMode:
362 LOG_CRITICAL(Frontend, "Failed to load ROM!"); 367 LOG_CRITICAL(Frontend, "Failed to load ROM!");
363 QMessageBox::critical(this, tr("Error while loading ROM!"), 368 QMessageBox::critical(this, tr("Error while loading ROM!"),