diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-07-24 22:33:24 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-07-24 22:33:24 +0200 |
| commit | 011e7b092a9d17f534ca2963dc25a25a1f145fe5 (patch) | |
| tree | 4823e3470254e1525c28a7931f39864d9181f30e /qpsxserial.cpp | |
| parent | 453da65223ee4fcda2e8247f41b7950ed50be6ea (diff) | |
* Header data was being sent too quickly to PSX. Some sleep instructions have been placed to avoid this.
+ Provisional "stdout" dialog, still TODO.
Diffstat (limited to 'qpsxserial.cpp')
| -rw-r--r-- | qpsxserial.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/qpsxserial.cpp b/qpsxserial.cpp index 6bc0a5a..e9ace2f 100644 --- a/qpsxserial.cpp +++ b/qpsxserial.cpp @@ -12,7 +12,7 @@ QPSXSerial::QPSXSerial(QWidget *parent) : lost_packet_timer = new QTimer(); connect(lost_packet_timer, SIGNAL(timeout()), this, SLOT(onPacketLost())); - + connect(ui->stdout_Button, SIGNAL(released()), this, SLOT(onStdOutButtonReleased())); connect(ui->loadFile_Btn, SIGNAL(released()), this, SLOT(onLoadFileBtnReleased())); connect(ui->updatePorts_Btn, SIGNAL(released()), this, SLOT(onUpdatePortsBtnReleased())); connect(ui->send_Btn, SIGNAL(released()), this, SLOT(onSendBtnReleased())); @@ -43,6 +43,13 @@ QPSXSerial::~QPSXSerial() delete ui; } +void QPSXSerial::onStdOutButtonReleased(void) +{ + QDialog* dialog_ui = new QDialog(); + + dialog_ui->show(); +} + void QPSXSerial::onLoadFileBtnReleased(void) { selectedFolder = QFileDialog::getExistingDirectory( this, @@ -116,8 +123,6 @@ void QPSXSerial::onUpdatePortsBtnReleased(void) void QPSXSerial::onSendBtnReleased(void) { - qDebug() << serial.isOpen(); - if(serial.isOpen() == false) { if(selectedPort.isEmpty() == true) @@ -262,6 +267,8 @@ void QPSXSerial::onReadyRead(void) qDebug() << "sendData for file..."; sendData(file_data, filePath); + + f.close(); } else { @@ -326,12 +333,14 @@ bool QPSXSerial::sendExe(void) QByteArray data = f.read(2048 /* PSX-EXE header */); qDebug () << "Sending PSX-EXE header..."; - for(int i = 0; i < 32; i++) + for(int i = 0; i < 32; i+=8) { QByteArray send; write_ready = false; - send.append(data[i]); + QThread::msleep(100); + + send.append(data.mid(i, 8)); serial.write(send); |
