summaryrefslogtreecommitdiffstats
path: root/src/citra_qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt')
-rw-r--r--src/citra_qt/debugger/graphics_vertex_shader.cpp4
-rw-r--r--src/citra_qt/main.cpp65
-rw-r--r--src/citra_qt/main.h2
3 files changed, 62 insertions, 9 deletions
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp
index a11c61667..4b676f1b1 100644
--- a/src/citra_qt/debugger/graphics_vertex_shader.cpp
+++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp
@@ -498,8 +498,8 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d
// Reload widget state
for (int attr = 0; attr < num_attributes; ++attr) {
unsigned source_attr = shader_config.input_register_map.GetRegisterForAttribute(attr);
- input_data_mapping[source_attr]->setText(QString("-> v%1").arg(attr));
- input_data_container[source_attr]->setVisible(true);
+ input_data_mapping[attr]->setText(QString("-> v%1").arg(source_attr));
+ input_data_container[attr]->setVisible(true);
}
// Only show input attributes which are used as input to the shader
for (unsigned int attr = num_attributes; attr < 16; ++attr) {
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 1854f442a..57adbc136 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -249,22 +249,73 @@ void GMainWindow::OnDisplayTitleBars(bool show)
}
}
-void GMainWindow::BootGame(const std::string& filename) {
- LOG_INFO(Frontend, "Citra starting...");
-
+bool GMainWindow::InitializeSystem() {
// Shutdown previous session if the emu thread is still active...
if (emu_thread != nullptr)
ShutdownGame();
// Initialize the core emulation
- System::Init(render_window);
+ System::Result system_result = System::Init(render_window);
+ if (System::Result::Success != system_result) {
+ switch (system_result) {
+ case System::Result::ErrorInitVideoCore:
+ QMessageBox::critical(this, tr("Error while starting Citra!"),
+ tr("Failed to initialize the video core!\n\n"
+ "Please ensure that your GPU supports OpenGL 3.3 and that you have the latest graphics driver."));
+ break;
+
+ default:
+ QMessageBox::critical(this, tr("Error while starting Citra!"),
+ tr("Unknown error (please check the log)!"));
+ break;
+ }
+ return false;
+ }
+ return true;
+}
- // Load the game
- if (Loader::ResultStatus::Success != Loader::LoadFile(filename)) {
+bool GMainWindow::LoadROM(const std::string& filename) {
+ Loader::ResultStatus result = Loader::LoadFile(filename);
+ if (Loader::ResultStatus::Success != result) {
LOG_CRITICAL(Frontend, "Failed to load ROM!");
System::Shutdown();
- return;
+
+ switch (result) {
+ case Loader::ResultStatus::ErrorEncrypted: {
+ // Build the MessageBox ourselves to have clickable link
+ QMessageBox popup_error;
+ popup_error.setTextFormat(Qt::RichText);
+ popup_error.setWindowTitle(tr("Error while loading ROM!"));
+ popup_error.setText(tr("The game that you are trying to load must be decrypted before being used with Citra.<br/><br/>"
+ "For more information on dumping and decrypting games, please see: <a href='https://citra-emu.org/wiki/Dumping-Game-Cartridges'>https://citra-emu.org/wiki/Dumping-Game-Cartridges</a>"));
+ popup_error.setIcon(QMessageBox::Critical);
+ popup_error.exec();
+ break;
+ }
+ case Loader::ResultStatus::ErrorInvalidFormat:
+ QMessageBox::critical(this, tr("Error while loading ROM!"),
+ tr("The ROM format is not supported."));
+ break;
+ case Loader::ResultStatus::Error:
+
+ default:
+ QMessageBox::critical(this, tr("Error while loading ROM!"),
+ tr("Unknown error!"));
+ break;
+ }
+ return false;
}
+ return true;
+}
+
+void GMainWindow::BootGame(const std::string& filename) {
+ LOG_INFO(Frontend, "Citra starting...");
+
+ if (!InitializeSystem())
+ return;
+
+ if (!LoadROM(filename))
+ return;
// Create and start the emulation thread
emu_thread = Common::make_unique<EmuThread>(render_window);
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 8c195f816..945aea0cd 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -59,6 +59,8 @@ signals:
void EmulationStopping();
private:
+ bool InitializeSystem();
+ bool LoadROM(const std::string& filename);
void BootGame(const std::string& filename);
void ShutdownGame();