aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-14 10:07:44 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-14 10:07:44 +0100
commit7341a3329994bf655f2490c4e9758929bd95c23f (patch)
tree670038fbbcd626ad5eba940561219e14d3fe16bd /qtmips_gui
parent4392124e26e699df38cf34dbbac6baeaa243271c (diff)
downloadqtmips-7341a3329994bf655f2490c4e9758929bd95c23f.tar.gz
qtmips-7341a3329994bf655f2490c4e9758929bd95c23f.tar.bz2
qtmips-7341a3329994bf655f2490c4e9758929bd95c23f.zip
Implement write syscall and signal written characters to terminal.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/mainwindow.cpp5
-rw-r--r--qtmips_gui/terminaldock.cpp6
-rw-r--r--qtmips_gui/terminaldock.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp
index 0482b11..5174949 100644
--- a/qtmips_gui/mainwindow.cpp
+++ b/qtmips_gui/mainwindow.cpp
@@ -148,8 +148,9 @@ void MainWindow::create_core(const machine::MachineConfig &config) {
set_speed(); // Update machine speed to current settings
#if 1
- machine->register_exception_handler(machine::EXCAUSE_SYSCALL,
- new osemu::OsSyscallExceptionHandler);
+ osemu::OsSyscallExceptionHandler *osemu_handler = new osemu::OsSyscallExceptionHandler;
+ machine->register_exception_handler(machine::EXCAUSE_SYSCALL, osemu_handler);
+ connect(osemu_handler, SIGNAL(char_written(int,uint)), terminal, SLOT(tx_byte(int,uint)));
#endif
// Connect machine signals and slots
diff --git a/qtmips_gui/terminaldock.cpp b/qtmips_gui/terminaldock.cpp
index 31e8c68..4b394a6 100644
--- a/qtmips_gui/terminaldock.cpp
+++ b/qtmips_gui/terminaldock.cpp
@@ -70,3 +70,9 @@ void TerminalDock::tx_byte(unsigned int data) {
else
append_cursor->insertText(QString(QChar(data)));
}
+
+void TerminalDock::tx_byte(int fd, unsigned int data)
+{
+ (void)fd;
+ tx_byte(data);
+}
diff --git a/qtmips_gui/terminaldock.h b/qtmips_gui/terminaldock.h
index b0c76cf..7154e81 100644
--- a/qtmips_gui/terminaldock.h
+++ b/qtmips_gui/terminaldock.h
@@ -53,6 +53,7 @@ public:
public slots:
void tx_byte(unsigned int data);
+ void tx_byte(int fd, unsigned int data);
private:
QVBoxLayout *layout_box;