• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revision989aa9f5e877b9cdb665c06b878cbb5e46e7be6f (tree)
Time2018-03-25 15:25:23
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[Qt][COMMAND_LINE] Fix not loading virtual floppy disks excepts D77/D88. Thanks to https://matsuri.5ch.net/test/read.cgi/i4004/1483504365/922 .
[Qt][COMMAND_LINE][FM8] Re-enable to loading bubble casette.
[Qt][COMMAND_LINE][PX7] Delay loading movie.Fix crash loading movie with command line.

Change Summary

Incremental Difference

--- a/source/src/qt/common/emu_thread.cpp
+++ b/source/src/qt/common/emu_thread.cpp
@@ -301,6 +301,7 @@ void EmuThreadClass::doWork(const QString &params)
301301 // LED
302302 uint32_t led_data = 0x00000000;
303303 uint32_t led_data_old = 0x00000000;
304+ int turn_count = 0;
304305 // Tape
305306 // DIG_RESOLUTION
306307 //
@@ -440,9 +441,24 @@ void EmuThreadClass::doWork(const QString &params)
440441 prevRecordReq = false;
441442 }
442443 }
443-
444-
445-
444+#if defined(USE_LASER_DISC) || defined(USE_MOVIE_PLAYER)
445+ if(turn_count < 128) {
446+ turn_count++;
447+ } else {
448+ if(vMovieQueue.size() >= 2) {
449+ for(int ii = 0; ii < vMovieQueue.size(); ii += 2) {
450+ QString _dom = vMovieQueue.at(ii);
451+ QString _path = vMovieQueue.at(ii + 1);
452+ bool _num_ok;
453+ int _dom_num = _dom.right(1).toInt(&_num_ok);
454+ if(!_num_ok) _dom_num = 0;
455+ emit sig_open_laser_disc(_dom_num, _path);
456+ }
457+ vMovieQueue.clear();
458+ //turn_count = 0;
459+ }
460+ }
461+#endif
446462 #if defined(USE_MOUSE) // Will fix
447463 emit sig_is_enable_mouse(p_emu->is_mouse_enabled());
448464 #endif
--- a/source/src/qt/common/emu_thread_slots.cpp
+++ b/source/src/qt/common/emu_thread_slots.cpp
@@ -725,7 +725,7 @@ void EmuThreadClass::do_open_bubble_casette(int drv, QString path, int bank)
725725 try {
726726 fio->Fseek(0, FILEIO_SEEK_END);
727727 int file_size = fio->Ftell(), file_offset = 0;
728- while(file_offset + 0x2b0 <= file_size && p_emu->d88_file[drv].bank_num < MAX_B77_BANKS) {
728+ while(file_offset + 0x2b0 <= file_size && p_emu->b77_file[drv].bank_num < MAX_B77_BANKS) {
729729 fio->Fseek(file_offset, FILEIO_SEEK_SET);
730730 char tmp[18];
731731 memset(tmp, 0x00, sizeof(tmp));
--- a/source/src/qt/common/qt_utils.cpp
+++ b/source/src/qt/common/qt_utils.cpp
@@ -877,9 +877,9 @@ void SetOptions(QCommandLineParser *cmdparser)
877877 //SetBinaryOptions(cmdparser); // Temporally disabled.
878878 SetCmtOptions(cmdparser);
879879 SetCartOptions(cmdparser);
880- //SetBubbleOptions(cmdparser); // Temporally disabled.
880+ SetBubbleOptions(cmdparser); // Temporally disabled.
881881 SetQuickDiskOptions(cmdparser);
882- //SetLDOptions(cmdparser); // Temporally disabled.
882+ SetLDOptions(cmdparser); // Temporally disabled.
883883 SetCDOptions(cmdparser);
884884
885885 }
--- a/source/src/qt/gui/emu_thread_tmpl.cpp
+++ b/source/src/qt/gui/emu_thread_tmpl.cpp
@@ -20,6 +20,8 @@
2020 #include "emu_thread_tmpl.h"
2121
2222 #include "qt_gldraw.h"
23+#include "common.h"
24+
2325 //#include "../../romakana.h"
2426
2527 //#include "csp_logger.h"
@@ -40,7 +42,8 @@ EmuThreadClassBase::EmuThreadClassBase(META_MainWindow *rootWindow, USING_FLAGS
4042 skip_frames = 0;
4143 calc_message = true;
4244 mouse_flag = false;
43-
45+ vMovieQueue.clear();
46+
4447 drawCond = new QWaitCondition();
4548 keyMutex = new QMutex(QMutex::Recursive);
4649 mouse_x = 0;
@@ -310,12 +313,17 @@ int EmuThreadClassBase::parse_command_queue(QStringList _l, int _begin)
310313 fileInfo = QFileInfo(_file);
311314 }
312315 if(fileInfo.isFile()) {
316+ _TCHAR *path_shadow = fileInfo.absoluteFilePath().toLocal8Bit().constData();
313317 if(_dom_type == QString::fromUtf8("vFloppyDisk")) {
314318 emit sig_open_fd(_dom_num, fileInfo.absoluteFilePath());
315- emit sig_set_d88_num(_dom_num, _slot);
319+ if(check_file_extension(path_shadow, ".d88") || check_file_extension(path_shadow, ".d77")) {
320+ emit sig_set_d88_num(_dom_num, _slot);
321+ }
316322 } else if(_dom_type == QString::fromUtf8("vBubble")) {
317323 emit sig_open_bubble(_dom_num, fileInfo.absoluteFilePath());
318- //emit sig_set_b77_num(_dom_num, _slot);
324+ if(check_file_extension(path_shadow, ".b77")) {
325+ emit sig_set_b77_num(_dom_num, _slot);
326+ }
319327 }
320328 }
321329 } else {
@@ -330,7 +338,9 @@ int EmuThreadClassBase::parse_command_queue(QStringList _l, int _begin)
330338 } else if(_dom_type == QString::fromUtf8("vCart")) {
331339 emit sig_open_cart(_dom_num, fileInfo.absoluteFilePath());
332340 } else if(_dom_type == QString::fromUtf8("vLD")) {
333- emit sig_open_laser_disc(_dom_num, fileInfo.absoluteFilePath());
341+ vMovieQueue.append(_dom);
342+ vMovieQueue.append(fileInfo.absoluteFilePath());
343+ //emit sig_open_laser_disc(_dom_num, fileInfo.absoluteFilePath());
334344 } else if(_dom_type == QString::fromUtf8("vCD")) {
335345 emit sig_open_cdrom(_dom_num, fileInfo.absoluteFilePath());
336346 }
--- a/source/src/qt/gui/emu_thread_tmpl.h
+++ b/source/src/qt/gui/emu_thread_tmpl.h
@@ -13,6 +13,7 @@
1313 #include <QThread>
1414 #include <QQueue>
1515 #include <QString>
16+#include <QStringList>
1617 #include <QElapsedTimer>
1718
1819 #include "fifo.h"
@@ -101,6 +102,7 @@ protected:
101102 QString laserdisc_text;
102103 QString bubble_text[16];
103104 QString clipBoardText;
105+ QStringList vMovieQueue;
104106
105107 void calc_volume_from_balance(int num, int balance);
106108 void calc_volume_from_level(int num, int level);
Show on old repository browser