aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-04-15 14:15:45 +0200
committerKarel Kočí <cynerd@email.cz>2018-04-15 14:15:45 +0200
commit08c6bdaa361604a7f146a2750391926c97797912 (patch)
tree8913e8a1544605db1d961f893c814c8afe00f530 /qtmips_gui
parent116fe3c67b31558f04a40c321eff85208612b4e3 (diff)
downloadqtmips-08c6bdaa361604a7f146a2750391926c97797912.tar.gz
qtmips-08c6bdaa361604a7f146a2750391926c97797912.tar.bz2
qtmips-08c6bdaa361604a7f146a2750391926c97797912.zip
Add 2x speed
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/MainWindow.ui19
-rw-r--r--qtmips_gui/mainwindow.cpp6
2 files changed, 24 insertions, 1 deletions
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 @@
<addaction name="actionStep"/>
<addaction name="separator"/>
<addaction name="ips1"/>
+ <addaction name="ips2"/>
<addaction name="ips5"/>
<addaction name="ips10"/>
<addaction name="ipsUnlimited"/>
@@ -113,6 +114,7 @@
<addaction name="actionStep"/>
<addaction name="separator"/>
<addaction name="ips1"/>
+ <addaction name="ips2"/>
<addaction name="ips5"/>
<addaction name="ips10"/>
</widget>
@@ -307,6 +309,23 @@
<string>Ctrl+Shift+M</string>
</property>
</action>
+ <action name="ips2">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>2 instructions per second</string>
+ </property>
+ <property name="iconText">
+ <string>2x</string>
+ </property>
+ <property name="toolTip">
+ <string>Run CPU in speed of two instructions per second</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+2</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
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