Skip to content

Commit

Permalink
Various minor fixes
Browse files Browse the repository at this point in the history
Fix some of the example programs
 - recursive is still broken

Replace text with logo in the about widget
 - also added an 128x128 variant

Don't allow empty memory to be exported
  • Loading branch information
tatokis committed May 21, 2020
1 parent 076b33d commit 5cda01b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 16 deletions.
6 changes: 6 additions & 0 deletions aboutwindow.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#include "aboutwindow.h"
#include "ui_aboutwindow.h"
#include <QIcon>
#include <QPixmap>

AboutWindow::AboutWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutWindow)
{
ui->setupUi(this);
connect(ui->okButton, &QPushButton::clicked, this, &QWidget::close);
// Load the icon
QIcon ico(":/bettertrn.ico");
// Get the 128x128 size
ui->iconLabel->setPixmap(ico.pixmap(128, 128));
}

AboutWindow::~AboutWindow()
Expand Down
18 changes: 10 additions & 8 deletions aboutwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>16</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
<widget class="QLabel" name="iconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>BetterTRN</string>
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand Down
Binary file modified bettertrn.ico
Binary file not shown.
Binary file added bettertrn_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion examples/recursive.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ CPIA: STI TEMP
TEMP: RES 1
DATA: CON 2
DATA2: CON 32
RES 3
RES 3
END
4 changes: 2 additions & 2 deletions examples/test.asm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
NAM panos
ORG 8
LOC2 CON 2,4
LOC2: CON 2,4
ORG 0
FIR: LDA 8
LDX 9
STA 9
STX 8
HLT
END
END
10 changes: 5 additions & 5 deletions examples/test5.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INP
OUT
HLT

NAM loopback
INP
OUT
HLT
END
5 changes: 5 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ void MainWindow::emuThreadStopped()

void MainWindow::on_actionSave_Memory_Image_triggered()
{
if(pgmmem.isEmpty())
{
QMessageBox::warning(this, tr("Nothing in memory"), tr("There is nothing in memory. Please load a program first"));
return;
}
QString path = QFileDialog::getSaveFileName(this, tr("Save Memory Image"), QString(), tr("Memory Image (*.mif)"));
if(path.isEmpty())
return;
Expand Down

0 comments on commit 5cda01b

Please sign in to comment.