summaryrefslogtreecommitdiff
path: root/qpsxserial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qpsxserial.cpp')
-rw-r--r--qpsxserial.cpp19
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);