diff options
Diffstat (limited to 'src/citra_qt')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 25 | ||||
| -rw-r--r-- | src/citra_qt/bootmanager.hxx | 16 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 17 | ||||
| -rw-r--r-- | src/citra_qt/config.h | 3 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.hxx | 2 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 13 | ||||
| -rw-r--r-- | src/citra_qt/main.hxx | 2 | 
7 files changed, 49 insertions, 29 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 0430aa1ed..20824692d 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -33,19 +33,16 @@ void EmuThread::run()      stop_run = false;      while (!stop_run)      { -        for (int tight_loop = 0; tight_loop < 10000; ++tight_loop) +        if (cpu_running)          { -            if (cpu_running || exec_cpu_step) -            { -                if (exec_cpu_step) -                    exec_cpu_step = false; - -                Core::SingleStep(); -                if (!cpu_running) { -                    emit CPUStepped(); -                    yieldCurrentThread(); -                } -            } +            Core::RunLoop(); +        }  +        else if (exec_cpu_step) +        { +            exec_cpu_step = false; +            Core::SingleStep(); +            emit CPUStepped(); +            yieldCurrentThread();          }      }      render_window->moveContext(); @@ -90,10 +87,10 @@ public:          parent_ = parent;      } -    void paintEvent(QPaintEvent* ev) +    void paintEvent(QPaintEvent* ev) override      {      } -    void resizeEvent(QResizeEvent* ev) { +    void resizeEvent(QResizeEvent* ev) override {          parent_->SetClientAreaWidth(size().width());          parent_->SetClientAreaHeight(size().height());      } diff --git a/src/citra_qt/bootmanager.hxx b/src/citra_qt/bootmanager.hxx index 816ffed2e..f8afc403e 100644 --- a/src/citra_qt/bootmanager.hxx +++ b/src/citra_qt/bootmanager.hxx @@ -25,7 +25,7 @@ public:       *       * @warning Only call when not running!       */ -    void run(); +    void run() override;      /**       * Allow the CPU to process a single instruction (if cpu is not running) @@ -89,13 +89,13 @@ public:      GRenderWindow(QWidget* parent = NULL);      ~GRenderWindow(); -    void closeEvent(QCloseEvent*); +    void closeEvent(QCloseEvent*) override;      // EmuWindow implementation -    void SwapBuffers(); -    void MakeCurrent(); -    void DoneCurrent(); -    void PollEvents(); +    void SwapBuffers() override; +    void MakeCurrent() override; +    void DoneCurrent() override; +    void PollEvents() override;      void BackupGeometry();      void RestoreGeometry(); @@ -104,8 +104,8 @@ public:      EmuThread& GetEmuThread(); -    void keyPressEvent(QKeyEvent* event); -    void keyReleaseEvent(QKeyEvent* event); +    void keyPressEvent(QKeyEvent* event) override; +    void keyReleaseEvent(QKeyEvent* event) override;      void ReloadSetKeymaps() override; diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 0ebc15f13..09fce4d6f 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -6,6 +6,7 @@  #include <QStringList>  #include "core/settings.h" +#include "core/core.h"  #include "common/file_util.h"  #include "config.h" @@ -64,6 +65,20 @@ void Config::SaveControls() {      qt_config->endGroup();  } +void Config::ReadCore() { +    qt_config->beginGroup("Core"); +    Settings::values.cpu_core = qt_config->value("cpu_core", Core::CPU_Interpreter).toInt(); +    Settings::values.gpu_refresh_rate = qt_config->value("gpu_refresh_rate", 60).toInt(); +    qt_config->endGroup(); +} + +void Config::SaveCore() { +    qt_config->beginGroup("Core"); +    qt_config->setValue("cpu_core", Settings::values.cpu_core); +    qt_config->setValue("gpu_refresh_rate", Settings::values.gpu_refresh_rate); +    qt_config->endGroup(); +} +  void Config::ReadData() {      qt_config->beginGroup("Data Storage");      Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool(); @@ -90,12 +105,14 @@ void Config::SaveMiscellaneous() {  void Config::Reload() {      ReadControls(); +    ReadCore();      ReadData();      ReadMiscellaneous();  }  void Config::Save() {      SaveControls(); +    SaveCore();      SaveData();      SaveMiscellaneous();  } diff --git a/src/citra_qt/config.h b/src/citra_qt/config.h index 979902467..8c6568cb2 100644 --- a/src/citra_qt/config.h +++ b/src/citra_qt/config.h @@ -14,7 +14,8 @@ class Config {      void ReadControls();      void SaveControls(); - +    void ReadCore(); +    void SaveCore();      void ReadData();      void SaveData(); diff --git a/src/citra_qt/debugger/graphics_cmdlists.hxx b/src/citra_qt/debugger/graphics_cmdlists.hxx index 479ef0326..1523e724f 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.hxx +++ b/src/citra_qt/debugger/graphics_cmdlists.hxx @@ -17,7 +17,7 @@ class GPUCommandListModel : public QAbstractListModel  public:      GPUCommandListModel(QObject* parent); -    int columnCount(const QModelIndex& parent = QModelIndex()) const; +    int columnCount(const QModelIndex& parent = QModelIndex()) const override;      int rowCount(const QModelIndex& parent = QModelIndex()) const override;      QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index c99f92835..9a4e36adf 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -121,7 +121,10 @@ GMainWindow::GMainWindow()      show(); -    System::Init(render_window); +    QStringList args = QApplication::arguments(); +    if (args.length() >= 2) { +        BootGame(args[1].toStdString()); +    }  }  GMainWindow::~GMainWindow() @@ -133,10 +136,11 @@ GMainWindow::~GMainWindow()  void GMainWindow::BootGame(std::string filename)  { -    NOTICE_LOG(MASTER_LOG, "citra starting...\n"); +    NOTICE_LOG(MASTER_LOG, "Citra starting...\n"); +    System::Init(render_window);      if (Core::Init()) { -        ERROR_LOG(MASTER_LOG, "core initialization failed, exiting..."); +        ERROR_LOG(MASTER_LOG, "Core initialization failed, exiting...");          Core::Stop();          exit(1);      } @@ -154,6 +158,7 @@ void GMainWindow::BootGame(std::string filename)      render_window->GetEmuThread().start();      render_window->show(); +    OnStartGame();  }  void GMainWindow::OnMenuLoadFile() @@ -190,6 +195,7 @@ void GMainWindow::OnPauseGame()  void GMainWindow::OnStopGame()  {      render_window->GetEmuThread().SetCpuRunning(false); +    // TODO: Shutdown core      ui.action_Start->setEnabled(true);      ui.action_Pause->setEnabled(false); @@ -251,7 +257,6 @@ int __cdecl main(int argc, char* argv[])      QApplication::setAttribute(Qt::AA_X11InitThreads);      QApplication app(argc, argv);      GMainWindow main_window; -      main_window.show();      return app.exec();  } diff --git a/src/citra_qt/main.hxx b/src/citra_qt/main.hxx index a0b41f5f4..b1b40df46 100644 --- a/src/citra_qt/main.hxx +++ b/src/citra_qt/main.hxx @@ -32,7 +32,7 @@ public:  private:      void BootGame(std::string filename); -    void closeEvent(QCloseEvent* event); +    void closeEvent(QCloseEvent* event) override;  private slots:      void OnStartGame();  | 
