merged
This commit is contained in:
parent
18a14d204c
commit
717568b6d0
30 changed files with 4093 additions and 209 deletions
85
simulator_SIC_XE/gui/qt/mainwindow.h
Normal file
85
simulator_SIC_XE/gui/qt/mainwindow.h
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <memory>
|
||||
|
||||
class MachineController;
|
||||
class Machine;
|
||||
class QLineEdit;
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
std::shared_ptr<Machine> machine() const { return m_machine; }
|
||||
MachineController* controller() const { return m_controller.get(); }
|
||||
|
||||
void startExecution();
|
||||
void stopExecution();
|
||||
void stepExecution();
|
||||
|
||||
void setTestRegisterValues();
|
||||
|
||||
private slots:
|
||||
void updateRegisterDisplays();
|
||||
void updateMemoryDisplay();
|
||||
void updateDisassemblyDisplay();
|
||||
void onRegisterFieldChanged();
|
||||
void onMemoryInc256();
|
||||
void onMemoryInc4096();
|
||||
void onMemoryInc65536();
|
||||
void onMemoryDec256();
|
||||
void onMemoryDec4096();
|
||||
void onMemoryDec65536();
|
||||
void onMemoryGoToStart();
|
||||
void onMemoryGoToEnd();
|
||||
void onDisassemblyInc();
|
||||
void onDisassemblyInc16();
|
||||
void onDisassemblyInc256();
|
||||
void onDisassemblyDec();
|
||||
void onDisassemblyDec16();
|
||||
void onDisassemblyDec256();
|
||||
void onDisassemblyGoToStart();
|
||||
void onDisassemblyGoToEnd();
|
||||
void loadObjectFile();
|
||||
void showAboutDialog();
|
||||
void showFrequencyDialog();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
std::shared_ptr<Machine> m_machine;
|
||||
std::unique_ptr<MachineController> m_controller;
|
||||
int m_memoryOffset = 0;
|
||||
int m_disassemblyOffset = 0;
|
||||
|
||||
void connectRegisterFields();
|
||||
void updateSingleRegisterDisplay(const QString& fieldName, int value);
|
||||
void updateAllFormatsForRegister(const QString& regPrefix, int value);
|
||||
void updateFloatRegisterFormats(const QString& regPrefix, double value);
|
||||
void handleFloatRegisterFieldChanged(QLineEdit* field, const QString& objectName);
|
||||
void loadDemoProgram();
|
||||
void setupMemoryDisplay();
|
||||
void setupDisassemblyDisplay();
|
||||
|
||||
struct DisassembledInstruction {
|
||||
int address;
|
||||
int size;
|
||||
QString mnemonic;
|
||||
QString operand;
|
||||
int effectiveAddr;
|
||||
bool isImmediate;
|
||||
bool isIndirect;
|
||||
};
|
||||
DisassembledInstruction disassembleAt(int address);
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue