From 08c6bdaa361604a7f146a2750391926c97797912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 15 Apr 2018 14:15:45 +0200 Subject: Add 2x speed --- qtmips_gui/MainWindow.ui | 19 +++++++++++++++++++ qtmips_gui/mainwindow.cpp | 6 +++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'qtmips_gui') diff --git a/qtmips_gui/MainWindow.ui b/qtmips_gui/MainWindow.ui index 1c49fe3..b42b3c5 100644 --- a/qtmips_gui/MainWindow.ui +++ b/qtmips_gui/MainWindow.ui @@ -78,6 +78,7 @@ + @@ -113,6 +114,7 @@ + @@ -307,6 +309,23 @@ Ctrl+Shift+M + + + true + + + 2 instructions per second + + + 2x + + + Run CPU in speed of two instructions per second + + + Ctrl+2 + + diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index b61c0e5..b3a134b 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -28,6 +28,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { // Execution speed actions speed_group = new QActionGroup(this); speed_group->addAction(ui->ips1); + speed_group->addAction(ui->ips2); speed_group->addAction(ui->ips5); speed_group->addAction(ui->ips10); speed_group->addAction(ui->ipsUnlimited); @@ -43,6 +44,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { connect(ui->actionProgram_Cache, SIGNAL(triggered(bool)), this, SLOT(show_cache_program())); connect(ui->actionData_Cache, SIGNAL(triggered(bool)), this, SLOT(show_cache_data())); connect(ui->ips1, SIGNAL(toggled(bool)), this, SLOT(set_speed())); + connect(ui->ips2, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ips5, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ips10, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ipsUnlimited, SIGNAL(toggled(bool)), this, SLOT(set_speed())); @@ -161,8 +163,10 @@ void MainWindow::set_speed() { if (ui->ips1->isChecked()) machine->set_speed(1000); - else if (ui->ips5->isChecked()) + else if (ui->ips2->isChecked()) machine->set_speed(500); + else if (ui->ips5->isChecked()) + machine->set_speed(200); else if (ui->ips10->isChecked()) machine->set_speed(100); else -- cgit v1.2.3