message("* qt/osd")
-SET(THIS_LIB_VERSION 9.1.0)
+SET(THIS_LIB_VERSION 9.2.0)
set(s_qt_osd_headers
osd_base.h
message("* qt/avio")
-SET(THIS_LIB_VERSION 7.5.3)
+SET(THIS_LIB_VERSION 7.5.4)
set(s_qt_avio_headers
csp_avio_basic.h
movie_saver.h
connect(this, SIGNAL(sig_open_binary_save(int, QString)), MainWindow, SLOT(_open_binary_save(int, QString)));
connect(this, SIGNAL(sig_open_cart(int, QString)), MainWindow, SLOT(_open_cart(int, QString)));
- connect(this, SIGNAL(sig_open_bubble(int, QString)), MainWindow, SLOT(_open_bubble(int, QString)));
- connect(this, SIGNAL(sig_open_b77_bubble(int, QString, int)), this, SLOT(do_open_bubble_casette(int, QString, int)));
+// connect(this, SIGNAL(sig_open_bubble(int, QString)), MainWindow, SLOT(_open_bubble(int, QString)));
+// connect(this, SIGNAL(sig_open_b77_bubble(int, QString, int)), this, SLOT(do_open_bubble_casette(int, QString, int)));
p_osd->setParent(this);
csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GENERAL,
"EmuThread : EXIT");
}
- emit sig_finished();
+ emit sig_draw_finished();
+ emit sig_emu_finished();
this->quit();
}
int drv = tmp.drive;
sub_close_cartridge_internal(drv);
}
-void EmuThreadClassBase::do_close_cartidge_ui(int drv)
+void EmuThreadClassBase::do_close_cartridge_ui(int drv)
{
sub_close_cartridge_internal(drv);
}
-void EmuThreadClassBase::sub_close_cartidge_internal(int drv)
+void EmuThreadClassBase::sub_close_cartridge_internal(int drv)
{
std::shared_ptr<USING_FLAGS> p = using_flags;
if(p.get() == nullptr) return;
}
}
-void EmuThreadClassBase::do_open_cart(int drv, QString path)
+void EmuThreadClassBase::do_open_cartridge(int drv, QString path)
{
std::shared_ptr<USING_FLAGS> p = using_flags;
if(p.get() == nullptr) return;
std::shared_ptr<USING_FLAGS> p = using_flags;
if(p.get() == nullptr) return;
- if(!((p->is_use_bubble()) && (p->get_max_dbubble() > drive))) return;
+ if(!((p->is_use_bubble()) && (p->get_max_bubble() > drive))) return;
int bank_num = p_emu->b77_file[drive].bank_num;
if(bank_num <= 0) return;
#ifdef USE_MOUSE
if(hRunEmu == nullptr) return;
EMU_TEMPLATE *p_emu = hRunEmu->get_emu();
- if(emu == nullptr) return;
+ if(p_emu == nullptr) return;
+ if(graphicsView == nullptr) return;
p_emu->lock_vm();
bool flag = p_emu->is_mouse_enabled();
connect(action_SetFixedCpu[i], SIGNAL(triggered()),
hRunEmu, SLOT(do_set_emu_thread_to_fixed_cpu_from_action()));
}
- //connect(hRunEmu, SIGNAL(sig_finished()), this, SLOT(delete_emu_thread()));
connect(this, SIGNAL(sig_vm_reset()), hRunEmu, SLOT(do_reset()));
for(int i = 0 ; i < using_flags->get_use_special_reset_num() ; i++) {
connect(p_osd, SIGNAL(sig_ui_compact_disc_eject(int)),
this, SLOT(do_ui_eject_compact_disc(int)),
Qt::QueuedConnection);
-
#endif
#if defined(USE_LASER_DISC)
for(int ii = 0; ii < USE_LASER_DISC; ii++) {
connect(this, SIGNAL(sig_save_binary(int, QString)), hRunEmu, SLOT(do_save_binary(int, QString)));
#endif
#if defined(USE_BUBBLE)
- connect(this, SIGNAL(sig_write_protect_bubble(int, bool)), hRunEmu, SLOT(do_write_protect_bubble_casette(int, bool)));
- connect(this, SIGNAL(sig_open_bubble(int, QString, int)), hRunEmu, SLOT(do_open_bubble_casette(int, QString, int)));
- connect(this, SIGNAL(sig_close_bubble(int)), hRunEmu, SLOT(do_close_bubble_casette(int)));
- connect(hRunEmu, SIGNAL(sig_update_recent_bubble(int)), this, SLOT(do_update_recent_bubble(int)));
- //connect(hRunEmu, SIGNAL(sig_change_osd_bubble(int, QString)), this, SLOT(do_change_osd_bubble(int, QString)));
- drvs = USE_BUBBLE;
- for(int ii = 0; ii < drvs; ii++) {
- connect(menu_bubbles[ii],
- SIGNAL(sig_update_inner_bubble(int ,QStringList , class Action_Control **, QStringList , int, bool)),
- this,
- SLOT(do_update_inner_bubble(int ,QStringList , class Action_Control **, QStringList , int, bool))
- );
+ for(int ii = 0; ii < USE_BUBBLE; ii++) {
+ if(ii >= USE_BUBBLE_TMP) break;
+ Menu_BubbleClass *mp = menu_bubbles[ii];
+ if(mp != nullptr) {
+ mp->connect_via_emu_thread(hRunEmu);
+ connect(mp, SIGNAL(sig_set_inner_slot(int, int)),
+ hRunEmu, SLOT(do_select_bubble_casette_b77(int, int)),
+ Qt::QueuedConnection);
+ }
}
+ connect(this, SIGNAL(sig_open_bubble(int, QString, int)),
+ hRunEmu, SLOT(do_open_bubble_casette(int, QString, int)),
+ Qt::QueuedConnection);
+ connect(this, SIGNAL(sig_close_bubble_ui(int)),
+ hRunEmu, SLOT(do_close_bubble_ui(int)),
+ Qt::QueuedConnection);
+
+ connect(p_osd, SIGNAL(sig_ui_bubble_insert_history(int, QString, quint64)),
+ this, SLOT(do_ui_bubble_casette_insert_history(int, QString, ouint64)),
+ Qt::QueuedConnection);
+ connect(p_osd, SIGNAL(sig_ui_bubble_write_protect(int, quint64)),
+ this, SLOT(do_ui_bubble_write_protect(int, quint64)),
+ Qt::QueuedConnection);
+ connect(p_osd, SIGNAL(sig_ui_bubble_closed(int)),
+ this, SLOT(do_ui_eject_bubble_casette(int)),
+ Qt::QueuedConnection);
+
#endif
- connect(this, SIGNAL(quit_emu_thread()), hRunEmu, SLOT(doExit()));
+ connect(this, SIGNAL(sig_quit_emu_thread()), hRunEmu, SLOT(doExit()), Qt::QueuedConnection);
connect(hRunEmu, SIGNAL(sig_mouse_enable(bool)),
- this, SLOT(do_set_mouse_enable(bool)));
+ this, SLOT(do_set_mouse_enable(bool)), Qt::QueuedConnection);
hRunEmu->set_tape_play(false);
connect(hRunEmu, SIGNAL(sig_send_data_led(quint32)), this, SLOT(do_recv_data_led(quint32)), Qt::QueuedConnection);
#endif
#ifdef USE_AUTO_KEY
- connect(this, SIGNAL(sig_start_auto_key(QString)), hRunEmu, SLOT(do_start_auto_key(QString)));
- connect(this, SIGNAL(sig_stop_auto_key()), hRunEmu, SLOT(do_stop_auto_key()));
- connect(this, SIGNAL(sig_set_roma_kana(bool)), hRunEmu, SLOT(set_romakana(bool)));
+ connect(this, SIGNAL(sig_start_auto_key(QString)), hRunEmu, SLOT(do_start_auto_key(QString)), Qt::QueuedConnection);
+ connect(this, SIGNAL(sig_stop_auto_key()), hRunEmu, SLOT(do_stop_auto_key()), Qt::QueuedConnection);
+ connect(this, SIGNAL(sig_set_roma_kana(bool)), hRunEmu, SLOT(set_romakana(bool)), Qt::QueuedConnection);
#endif
csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GENERAL, "EmuThread : Start.");
objNameStr = QString("EmuThreadClass");
hRunEmu->setObjectName(objNameStr);
-// hDrawEmu = new DrawThreadClass((OSD*)(p_osd()), csp_logger, this);
- hDrawEmu = new DrawThreadClass((OSD*)p_osd, csp_logger, nullptr);
+ hDrawEmu = new DrawThreadClass((OSD*)p_osd, csp_logger, this);
p_emu->set_parent_handler((EmuThreadClass*)hRunEmu, hDrawEmu);
#ifdef ONE_BOARD_MICRO_COMPUTER
connect(hRunEmu, SIGNAL(sig_set_draw_fps(double)), hDrawEmu, SLOT(do_set_frames_per_second(double)));
connect(hRunEmu, SIGNAL(sig_draw_one_turn(bool)), hDrawEmu, SLOT(do_draw_one_turn(bool)));
} else*/ {
- connect(hRunEmu, SIGNAL(sig_draw_thread(bool)), hDrawEmu, SLOT(doDraw(bool)), Qt::DirectConnection);
+ connect(hRunEmu, SIGNAL(sig_draw_thread(bool)), hDrawEmu, SLOT(doDraw(bool)));
connect(hRunEmu, SIGNAL(sig_set_draw_fps(double)), hDrawEmu, SLOT(do_set_frames_per_second(double)));
connect(hRunEmu, SIGNAL(sig_draw_one_turn(bool)), hDrawEmu, SLOT(do_draw_one_turn(bool)));
}
//connect(hRunEmu, SIGNAL(sig_draw_thread(bool)), (OSD*)p_osd, SLOT(do_draw(bool)));
//connect(hRunEmu, SIGNAL(quit_draw_thread()), hDrawEmu, SLOT(doExit()));
- connect(this, SIGNAL(quit_draw_thread()), hDrawEmu, SLOT(doExit()));
+ connect(this, SIGNAL(quit_draw_thread()), hDrawEmu, SLOT(doExit()), Qt::QueuedConnection);
connect(glv, SIGNAL(sig_notify_move_mouse(double, double, double, double)),
- hRunEmu, SLOT(moved_mouse(double, double, double, double)));
+ hRunEmu, SLOT(moved_mouse(double, double, double, double)), Qt::QueuedConnection);
connect(glv, SIGNAL(do_notify_button_pressed(Qt::MouseButton)),
- hRunEmu, SLOT(button_pressed_mouse(Qt::MouseButton)));
+ hRunEmu, SLOT(button_pressed_mouse(Qt::MouseButton)), Qt::QueuedConnection);
connect(glv, SIGNAL(do_notify_button_released(Qt::MouseButton)),
- hRunEmu, SLOT(button_released_mouse(Qt::MouseButton)));
+ hRunEmu, SLOT(button_released_mouse(Qt::MouseButton)), Qt::QueuedConnection);
#ifdef USE_MOUSE
connect(glv, SIGNAL(sig_toggle_mouse(void)),
- this, SLOT(do_toggle_mouse(void)));
- connect(glv, SIGNAL(sig_toggle_grab_mouse()), this, SLOT(do_toggle_mouse()));
+ this, SLOT(do_toggle_mouse(void)), Qt::QueuedConnection);
+ connect(glv, SIGNAL(sig_toggle_grab_mouse()), this, SLOT(do_toggle_mouse()), Qt::QueuedConnection);
#endif
connect(hRunEmu, SIGNAL(sig_resize_screen(int, int)),
glv, SLOT(resizeGL(int, int)), Qt::QueuedConnection);
connect((OSD*)p_osd, SIGNAL(sig_req_encueue_video(int, int, int)),
hDrawEmu, SLOT(do_req_encueue_video(int, int, int)));
- connect(hRunEmu, SIGNAL(sig_finished()), glv, SLOT(releaseKeyCode(void)));
- connect(hRunEmu, SIGNAL(sig_finished()), this, SLOT(delete_emu_thread()));
+
objNameStr = QString("EmuDrawThread");
hDrawEmu->setObjectName(objNameStr);
#endif
emit quit_draw_thread();
emit quit_joy_thread();
- emit quit_emu_thread();
+ emit sig_quit_emu_thread();
emit sig_quit_movie_thread();
emit sig_quit_widgets();
}
if(hRunEmu != nullptr) {
OnCloseDebugger();
- OSD* op = (OSD*)p_osd;
- if(op != nullptr) {
- op->setParent(this);
- op->moveToThread(this->thread());
+ if(hRunEmu->get_emu() != nullptr) {
+ OSD* op = (OSD*)(hRunEmu->get_emu()->get_osd());
+ if(op != nullptr) {
+ op->setParent(this);
+ op->moveToThread(this->thread());
+ }
}
hRunEmu->quit();
if(!(hRunEmu->wait(2000))) {
if(hRunEmu == nullptr) return;
EMU_TEMPLATE *p_emu = hRunEmu->get_emu();
if(p_emu == nullptr) return;
+ std::shared_ptr<USING_FLAGS> up = using_flags;
+ if(up.get() == nullptr) return;
if(use_d88_menus) {
for(int ii = 0; ii < up->get_max_d88_banks(); ii++) {
if(hRunEmu == nullptr) return;
EMU_TEMPLATE *p_emu = hRunEmu->get_emu();
if(p_emu == nullptr) return;
+ std::shared_ptr<USING_FLAGS> up = using_flags;
+ if(up.get() == nullptr) return;
if(use_d88_menus) {
for(int ii = 0; ii < up->get_max_b77_banks(); ii++) {
if(vm->get_cpu(no) != NULL && vm->get_cpu(no)->get_debugger() != NULL) {
QString windowName = QString::fromUtf8(vm->get_cpu(no)->get_device_name());
windowName = QString::fromUtf8("Debugger ") + windowName;
- p_emu->hDebugger.reset(new CSP_Debugger(emu, this));
+ p_emu->hDebugger.reset(new CSP_Debugger(p_emu, this));
if(p_emu->hDebugger.get() == nullptr) {
return;
}
QString Ui_MainWindow::get_system_version()
{
- if(hRunEmu == nullptr) return;
+ if(hRunEmu == nullptr) return QString::fromUtf8("");
EMU_TEMPLATE *p_emu = hRunEmu->get_emu();
QString guiver = get_gui_version();
}
-int Ui_MainWindow::set_recent_bubble(int drv, int num)
+int Ui_MainWindow::set_recent_bubble(int drv, int num)
{
QString s_path;
+ std::shared_ptr<USING_FLAGS> p = using_flags;
+ if(p.get() == nullptr) return -1;
+ if(p_config == nullptr) return -1;
+
+ if(p->get_max_bubble() <= drv) return -1;
+ if((num < 0) || (num >= MAX_HISTORY)) return -1;
+ s_path = QString::fromLocal8Bit(p_config->recent_bubble_casette_path[drv][num]);
+ if(!(s_path.isEmpty())) {
+ _open_bubble(drv, s_path);
+ return 0;
+ }
+ return -1;
+#if 0
+ QString s_path;
char path_shadow[PATH_MAX];
int i;
-
+
if((num < 0) || (num >= MAX_HISTORY)) return -1;
s_path = QString::fromLocal8Bit(p_config->recent_bubble_casette_path[drv][num]);
strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX - 1);
UPDATE_HISTORY(path_shadow, p_config->recent_bubble_casette_path[drv], listBubbles[drv]);
strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX - 1);
-
+
strcpy(p_config->initial_bubble_casette_dir, get_parent_dir((const _TCHAR *)path_shadow));
strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX - 1);
{
}
}
return 0;
+#endif
}
void Ui_MainWindow::_open_bubble(int drv, const QString fname)
}
}
-void Ui_MainWindow::eject_bubble(int drv)
+void Ui_MainWindow::eject_bubble(int drv)
{
int i;
emit sig_close_bubble(drv);
message("* qt/emuutils")
-SET(THIS_LIB_VERSION 7.10.0)
+SET(THIS_LIB_VERSION 7.11.0)
set(s_qt_emuutils_headers
../gui/csp_logger.h
message("* qt/gui")
-set(THIS_LIB_VERSION 8.5.0)
+set(THIS_LIB_VERSION 8.6.0)
set(s_qt_gui_headers
qt_dialogs.h
}
public slots:
void do_set_window_focus_type(bool flag);
-
+
signals:
- int quit_emu_thread(void);
+ int sig_quit_emu_thread(void);
int sig_set_dev_log_to_console(int, bool);
int sig_set_dev_log_to_syslog(int, bool);
int sig_set_window_focus_type(bool);
QT_END_NAMESPACE
#endif
-
-
-
#include "config.h"
-DrawThreadClass::DrawThreadClass(OSD_BASE *o, std::shared_ptr<CSP_Logger> logger,QObject *parent) : QThread(parent) {
+DrawThreadClass::DrawThreadClass(OSD_BASE *o, std::shared_ptr<CSP_Logger> logger,QObject *parent) : /*QThread(parent) */ QThread(nullptr) {
MainWindow = (Ui_MainWindowBase *)parent;
glv = MainWindow->getGraphicsView();
p_osd = o;
connect(screen, SIGNAL(refreshRateChanged(qreal)), this, SLOT(do_change_refresh_rate(qreal)));
connect(this, SIGNAL(sig_update_screen(void *, bool)), glv, SLOT(update_screen(void *, bool)), Qt::QueuedConnection);
-
+
connect(this, SIGNAL(sig_update_osd()), glv, SLOT(update_osd()), Qt::QueuedConnection);
connect(this, SIGNAL(sig_push_frames_to_avio(int, int, int)), glv->extfunc, SLOT(paintGL_OffScreen(int, int, int)));
-
+
//connect(this, SIGNAL(sig_call_draw_screen()), p_osd, SLOT(draw_screen()));
//connect(this, SIGNAL(sig_call_no_draw_screen()), p_osd, SLOT(no_draw_screen()));
use_separate_thread_draw = true;
if(ncount == 0) emit sig_update_osd();
}
ncount++;
- if(ncount >= 8) ncount = 0;
+ if(ncount >= 8) ncount = 0;
if(rec_frame_count > 0) {
emit sig_push_frames_to_avio(rec_frame_count,
rec_frame_width, rec_frame_height);
renderSemaphore = s;
}
do {
- double __fps = p_osd->vm_frame_rate(); // FPS;
+ double __fps = p_osd->vm_frame_rate(); // FPS;
vrate = 1.0e3 / __fps; // to Msec
_rate = (wait_refresh < emu_frame_rate) ? emu_frame_rate : wait_refresh;
- if((vrate * 2.0) > _rate) _rate = vrate * 2.0;
+ if((vrate * 2.0) > _rate) _rate = vrate * 2.0;
drate = (double)elapsed / 1.0e6; // nsec to msec
wait_factor = (int)nearbyint(_rate);
// if(_rate >= drate) {
rendered = true;
} else {
rendered = false;
- }
+ }
/*printf("RATE:%f VM_RATE:%f ELAPSED:%f WAIT_FACTOR:%d RENDER=%s\n", _rate, vrate, drate, wait_factor,
(rendered) ? "YES" : "NO");*/
if(!bRunThread) goto __exit;
void DrawThreadClass::do_change_refresh_rate(qreal rate)
{
- refresh_rate = rate;
+ refresh_rate = rate;
wait_refresh = 1000.0 / (refresh_rate * 2.0);
wait_count += (wait_refresh * 1.0);
}
bDrawReq = true;
mapped_drawn = is_mapped;
}
-
+
void DrawThreadClass::do_req_encueue_video(int count, int width, int height)
{
rec_frame_width = width;
if(glv->is_ready_to_map_vram_texture()) {
emit sig_unmap_texture();
textureMappingSemaphore->acquire();
-
+
//glv->do_unmap_vram_texture();
//mapping_status = false;
//mapping_pointer = NULL;
}
}
}
-
//#include "csp_logger.h"
#include "menu_flags.h"
-EmuThreadClassBase::EmuThreadClassBase(Ui_MainWindowBase *rootWindow, std::shared_ptr<USING_FLAGS> p, QObject *parent) : QThread(parent) {
+EmuThreadClassBase::EmuThreadClassBase(Ui_MainWindowBase *rootWindow, std::shared_ptr<USING_FLAGS> p, QObject *parent) : QThread(parent)
+{
MainWindow = rootWindow;
bBlockTask = true;
using_flags = p;
}
}
}
- QMutexLocker _n(&keyMutex);
+ connect(this, SIGNAL(sig_draw_finished()), glv, SLOT(releaseKeyCode(void)));
+ connect(this, SIGNAL(sig_emu_finished()), rootWindow->getGraphicsView(), SLOT(deleteLater()));
+ QMutexLocker _n(&keyMutex);
key_fifo = new FIFO(512 * 6);
key_fifo->clear();
+}
-
-};
-
-EmuThreadClassBase::~EmuThreadClassBase() {
+EmuThreadClassBase::~EmuThreadClassBase()
+{
delete drawCond;
bool EmuThreadClassBase::is_floppy_disk_protected(int drive)
{
- if(drive < 0) return QString::fromUtf8("");
- if(p_emu == nullptr) return QString::fromUtf8("");
+ if(drive < 0) return false;
+ if(p_emu == nullptr) return false;
std::shared_ptr<USING_FLAGS> p = using_flags;
- if(p.get() == nullptr) return QString::fromUtf8("");
- if(!(p->is_use_fd())) return QString::fromUtf8("");
+ if(p.get() == nullptr) return false;
+ if(!(p->is_use_fd())) return false;
// QMutexLocker _locker(&uiMutex);
bool _b = p_emu->is_floppy_disk_protected(drive);
if(p.get() == nullptr) return QString::fromUtf8("");
if(!(p->is_use_fd())) return QString::fromUtf8("");
- if(drive < up->get_max_drive()) {
+ if(drive < p->get_max_drive()) {
// QMutexLocker _locker(&uiMutex);
QString _n = QString::fromLocal8Bit((const char *)(&(p_emu->d88_file[drive].path)));
return _n;
if((drive < p->get_max_bubble()) && (banknum < get_b77_file_bank_num(drive))) {
// QMutexLocker _locker(&uiMutex);
- QString _n = QString::fromLocal8Bit((const char *)(&(p_emu->b77_file[drive].disk_name[banknum][0])));
+ QString _n = QString::fromLocal8Bit((const char *)(&(p_emu->b77_file[drive].bubble_name[banknum][0])));
return _n;
}
{
std::shared_ptr<USING_FLAGS> p = using_flags;
if(p.get() == nullptr) return;
- if(!(p->is_use_hd())) return;
+ if(!(p->is_use_hdd())) return;
QString tmpstr, alamp;
uint32_t access_drv = p_emu->is_hard_disk_accessed();
key_fifo->clear();
};
// Thread HOOK.
+ void sub_close_bubble_casette_internal(int drv);
+ void sub_close_cartridge_internal(int drv);
void sub_close_compact_disc_internal(int drv);
void sub_close_floppy_disk_internal(int drv);
void sub_close_hard_disk_internal(int drv);
int quit_draw_thread(void);
int sig_screen_aspect(int);
int sig_screen_size(int, int);
- int sig_finished(void);
+ int sig_emu_finished(void);
+ int sig_draw_finished(void);
int sig_mouse_enable(bool);
int sig_update_recent_hard_disk(int);
virtual void do_create_hard_disk(int drv, int sector_size, int sectors, int surfaces, int cylinders, QString name) { }
void do_update_d88_list(int drv, int bank);
- // Bubble Casette
- int write_protect_bubble(int drv, bool flag);
-
+ void do_update_bubble_history(int drive, QStringList lst);
+ void do_ui_bubble_insert_history(int drv, QString fname, quint64 bank);
+ void do_ui_eject_bubble_casette(int drv);
+ void do_ui_bubble_write_protect(int drv, quint64 flag);
virtual int set_b77_slot(int drive, int num) { return 0; }
virtual void do_update_recent_bubble(int drv) { }
virtual int set_recent_bubble(int drv, int num) { return 0; }
void do_start_draw_thread();
signals:
int message_changed(QString);
- int quit_emu_thread();
+ int sig_quit_emu_thread();
int call_joy_thread(EMU_TEMPLATE *);
int quit_joy_thread();
int quit_draw_thread();
int sig_write_protect_bubble(int, bool);
int sig_open_bubble(int, QString , int);
- int sig_close_bubble(int);
+ int sig_close_bubble_ui(int);
int sig_led_update(QRectF);
int sig_start_auto_key(QString);
#include "menu_disk.h"
#include "menu_bubble.h"
+#include "emu_thread_tmpl.h"
#include "qt_dialogs.h"
Menu_BubbleClass::Menu_BubbleClass(QMenuBar *root_entry, QString desc, std::shared_ptr<USING_FLAGS> p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
{
}
-void Menu_HDDClass::connect_via_emu_thread(EmuThreadClassBase *p)
+void Menu_BubbleClass::connect_via_emu_thread(EmuThreadClassBase *p)
{
if(p == nullptr) return;
connect(action_eject, SIGNAL(triggered()), p, SLOT(do_close_bubble_casette()), Qt::QueuedConnection);
public:
Menu_BubbleClass(QMenuBar *root_entry, QString desc, std::shared_ptr<USING_FLAGS> p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
~Menu_BubbleClass();
- void create_pulldown_menu_device_sub();
- void connect_menu_device_sub(void);
- void retranslate_pulldown_menu_device_sub(void);
+ void connect_via_emu_thread(EmuThreadClassBase *p) override;
+ void create_pulldown_menu_device_sub() override;
+ void connect_menu_device_sub(void) override;
+ void retranslate_pulldown_menu_device_sub(void) override;
};
QT_END_NAMESPACE
#include "menu_metaclass.h"
#include "menu_cart.h"
+#include "emu_thread_tmpl.h"
#include "qt_dialogs.h"
+
Menu_CartClass::Menu_CartClass(QMenuBar *root_entry, QString desc, std::shared_ptr<USING_FLAGS> p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
{
use_write_protect = false;
{
}
+void Menu_CartClass::connect_via_emu_thread(EmuThreadClassBase *p)
+{
+ if(p == nullptr) return;
+ connect(action_eject, SIGNAL(triggered()), p, SLOT(do_close_cartridge()), Qt::QueuedConnection);
+
+}
+
void Menu_CartClass::create_pulldown_menu_device_sub(void)
{
}
void Menu_CartClass::connect_menu_device_sub(void)
{
connect(this, SIGNAL(sig_open_media(int, QString)), p_wid, SLOT(_open_cart(int, QString)));
- connect(this, SIGNAL(sig_eject_media(int)), p_wid, SLOT(eject_cart(int)));
+// connect(this, SIGNAL(sig_eject_media(int)), p_wid, SLOT(eject_cart(int)));
connect(this, SIGNAL(sig_set_recent_media(int, int)), p_wid, SLOT(set_recent_cart(int, int)));
}
int drv = media_drive;
QString drive_name = (QApplication::translate("MenuMedia", "Cartridge ", 0));
drive_name += QString::number(drv);
-
+
if((drv < 0) || (drv >= 8)) return;
action_insert->setText(QApplication::translate("MenuMedia", "Insert", 0));
action_eject->setText(QApplication::translate("MenuMedia", "Eject", 0));
QT_BEGIN_NAMESPACE
+class EmuThreadClassBase;
class DLL_PREFIX Menu_CartClass: public Menu_MetaClass {
Q_OBJECT
protected:
public:
Menu_CartClass(QMenuBar *root_entry, QString desc, std::shared_ptr<USING_FLAGS> p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
~Menu_CartClass();
- void create_pulldown_menu_device_sub();
- void connect_menu_device_sub(void);
- void retranslate_pulldown_menu_device_sub(void);
+ void connect_via_emu_thread(EmuThreadClassBase *p) override;
+ void create_pulldown_menu_device_sub() override;
+ void connect_menu_device_sub(void) override;
+ void retranslate_pulldown_menu_device_sub(void) override;
};
QT_END_NAMESPACE
{
// May need delete items via QVector.
do_clear_sound_output_list();
-
+
graphicsView->releaseKeyboard();
if(ledUpdateTimer != NULL) delete ledUpdateTimer;
if(driveData != NULL) delete driveData;
QAction *cp = qobject_cast<QAction*>(QObject::sender());
if(cp == nullptr) return;
QString fname = cp->data().toString();
-
+
Dlg_BrowseText *dlg = new Dlg_BrowseText(fname, using_flags);
dlg->show();
}
} else {
action_DevLogToConsole[id]->setEnabled(false);
action_DevLogToConsole[id]->setVisible(false);
-
+
#if !defined(Q_OS_WIN)
action_DevLogToSyslog[id]->setEnabled(false);
action_DevLogToSyslog[id]->setVisible(false);
QAction *cp = qobject_cast<QAction*>(QObject::sender());
if(cp == nullptr) return;
int num = cp->data().value<int>();
-
+
csp_logger->set_device_node_log(num, 2, CSP_LOG_DEBUG, f);
p_config->dev_log_to_console[num][0] = f;
}
QAction *cp = qobject_cast<QAction*>(QObject::sender());
if(cp == nullptr) return;
int num = cp->data().value<int>();
-
+
if((num < 0) || (num > 2)) return;
p_config->cursor_as_ten_key = num;
emit sig_emu_update_config();
QAction *cp = qobject_cast<QAction*>(QObject::sender());
if(cp == nullptr) return;
int num = cp->data().value<int>();
-
+
csp_logger->set_device_node_log(num, 2, CSP_LOG_DEBUG, f);
p_config->dev_log_to_syslog[num][0] = f;
}
QAction *cp = qobject_cast<QAction*>(QObject::sender());
if(cp == nullptr) return;
int num = cp->data().value<int>();
-
+
int _major = 0;
int _minor = 0;
int _type = -1;
ConfigSoundMenu();
}
if(using_flags->is_use_binary_file()) {
- ConfigBinaryMenu();
+ ConfigBinaryMenu();
}
if(using_flags->is_use_qd()) {
ConfigQuickDiskMenu();
if(using_flags->is_use_bubble()) {
ConfigBubbleMenu();
}
- ConfigEmulatorMenu();
+ ConfigEmulatorMenu();
actionAbout = new Action_Control(this, using_flags);
actionAbout->setObjectName(QString::fromUtf8("actionAbout"));
// major == 3
if(p_config->render_minor_version < 0) p_config->render_minor_version = 0;
if(p_config->render_minor_version > 1) p_config->render_minor_version = 1;
- }
+ }
fmt.setVersion(p_config->render_major_version , p_config->render_minor_version ); // Requires >=Qt-4.8.0
csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Try to use OpenGL ES(v%d.%d).", p_config->render_major_version, p_config->render_minor_version);
- } else if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_CORE) {
+ } else if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_CORE) {
fmt.setProfile(QSurfaceFormat::CoreProfile); // Requires >=Qt-4.8.0
fmt.setVersion(4, 7); // Requires >=Qt-4.8.0
csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Try to use OpenGL CORE profile.");
connect(this, SIGNAL(sig_set_display_osd(bool)), graphicsView, SLOT(do_set_display_osd(bool)));
connect(this, SIGNAL(sig_set_led_width(int)), graphicsView, SLOT(do_set_led_width(int)));
}
-
+
bitmapImage = NULL;
driveData = new CSP_DockDisks(this, using_flags);
MainWindow->setDockOptions(QMainWindow::AnimatedDocks);
if(p_config->virtual_media_position > 0) {
driveData->setVisible(true);
- } else {
+ } else {
driveData->setVisible(false);
- }
+ }
pCentralWidget = new QWidget(this);
pCentralLayout = new QVBoxLayout(pCentralWidget);
}
pCentralWidget->setLayout(pCentralLayout);
MainWindow->setCentralWidget(pCentralWidget);
-
+
if(p_config->focus_with_click) {
graphicsView->setFocusPolicy(Qt::ClickFocus);
graphicsView->setFocus(Qt::MouseFocusReason);
graphicsView->setFocusPolicy(Qt::NoFocus);
graphicsView->setFocus(Qt::ActiveWindowFocusReason);
}
-
+
driveData->setOrientation(p_config->virtual_media_position);
connect(this, SIGNAL(sig_set_orientation_osd(int)), driveData, SLOT(setOrientation(int)));
connect(graphicsView, SIGNAL(sig_resize_osd(int)), driveData, SLOT(setScreenWidth(int)));
statusbar->setObjectName(QString::fromUtf8("statusbar"));
MainWindow->setStatusBar(statusbar);
initStatusBar();
-
+
menubar = new QMenuBar(this);
menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 1288, 27));
}
menuCpu_Speed = createMenuNode(menuControl, QString::fromUtf8("menuCpu_Speed"));
menuDebugger = createMenuNode(menuControl, QString::fromUtf8("menuDebugger"));
-
+
if(using_flags->is_use_fd()) {
int base_drv = using_flags->get_base_floppy_disk_num();
for(int i = 0; i < using_flags->get_max_drive(); i++) CreateFloppyMenu(i, base_drv + i);
//connect(this, SIGNAL(sig_update_screen(void)), graphicsView, SLOT(updateGL(void)));
menuMachine = createMenuNode(menubar, QString::fromUtf8("menuMachine"));
-
+
if(using_flags->is_use_mouse()) {
SET_ACTION_SINGLE_CONNECT(actionMouseEnable, true , true, false, SIGNAL(toggled(bool)), SLOT(do_set_mouse_enable(bool)));
// actionMouseEnable = new Action_Control(this, using_flags);
connect(action_RAMSize, SIGNAL(triggered()), this, SLOT(do_show_ram_size_dialog()));
menuMachine->addSeparator();
}
-
+
ConfigDeviceType();
ConfigMouseType();
ConfigSerialType();
ConfigMonitorType();
ConfigMachineFeatures();
-
+
if(!using_flags->is_without_sound()) {
menuSound = createMenuNode(menubar, QString::fromUtf8("menuSound"));
}
menuEmulator = createMenuNode(menubar, QString::fromUtf8("menuEmulator"));
menuHELP = createMenuNode(menubar, QString::fromUtf8("menuHelp"));
-
+
MainWindow->setMenuBar(menubar);
menubar->addAction(menuControl->menuAction());
CreateSoundMenu();
}
CreateEmulatorMenu();
-
+
menuHELP->addAction(actionAbout);
connect(actionAbout, SIGNAL(triggered()), this, SLOT(do_show_about()));
menuHELP->addSeparator();
-
+
actionHelp_AboutQt = new Action_Control(this, using_flags);
actionHelp_AboutQt->setObjectName(QString::fromUtf8("menuHelp_AboutQt"));
menuHELP->addAction(actionHelp_AboutQt);
SET_HELP_MENUENTRY(menuHelp_Histories, actionHelp_History_Relnote, "menuHelp_History_Relnote", "RELEASENOTE.txt");
SET_HELP_MENUENTRY(menuHelp_Histories, actionHelp_History_ChangeLog, "menuHelp_History_Changelog", "ChangeLog.txt");
SET_HELP_MENUENTRY(menuHelp_Histories, actionHelp_History_MR_TANAM, "menuHelp_History_MR_TANAM", "history_by_mr_tanam.txt");
-
+
SET_HELP_MENUENTRY(menuHELP, actionHelp_License, "menuHelp_License", "LICENSE.txt");
SET_HELP_MENUENTRY(menuHELP, actionHelp_License_JP, "menuHelp_License_JP", "LICENSE.ja.txt");
-
+
if(p_config->window_mode <= 0) p_config->window_mode = 0;
if(p_config->window_mode >= using_flags->get_screen_mode_num()) p_config->window_mode = using_flags->get_screen_mode_num() - 1;
w = using_flags->get_screen_width();
}
}
graphicsView->setFixedSize(w, h);
-
+
connect(this, SIGNAL(sig_screen_multiply(double)), graphicsView, SLOT(do_set_screen_multiply(double)), Qt::QueuedConnection);
connect(this, SIGNAL(sig_glv_set_fixed_size(int, int)), graphicsView, SLOT(do_set_fixed_size(int, int)), Qt::QueuedConnection);
-
+
set_screen_size(w, h);
set_screen_aspect(p_config->window_stretch_type);
if(actionScreenSize[p_config->window_mode] != nullptr) {
connect(action_SetupKeyboard, SIGNAL(triggered()), this, SLOT(rise_keyboard_dialog()));
#if !defined(Q_OS_WIN)
connect(action_LogToSyslog, SIGNAL(toggled(bool)), this, SLOT(do_set_syslog(bool)));
-#endif
+#endif
connect(action_LogToConsole, SIGNAL(toggled(bool)), this, SLOT(do_set_conslog(bool)));
csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GENERAL, "Menu OK");
-
+
QImageReader reader(":/default.ico");
QImage result = reader.read();
VolumeLowIcon = QIcon(":/icon_volume_low.png");
VolumeMidIcon = QIcon(":/icon_volume_mid.png");
VolumeHighIcon = QIcon(":/icon_volume_high.png");
-
+
ExitIcon = QIcon(":/icon_exit.png");
csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GENERAL, "setupUI() OK");
actionHelp_AboutQt->setText(QApplication::translate("MenuHelp", "About Qt", 0));
actionHelp_AboutQt->setToolTip(QApplication::translate("MenuHelp", "Display Qt version.", 0));
actionHelp_AboutQt->setIcon(QApplication::style()->standardIcon(QStyle::SP_TitleBarMenuButton));
-
+
actionAbout->setText(QApplication::translate("MenuHelp", "About...", 0));
actionAbout->setIcon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion));
actionAbout->setToolTip(QApplication::translate("MenuHelp", "About this emulator.", 0));
menuHelp_Readme->setTitle(QApplication::translate("MenuHelp", "READMEs", 0));
-
+
actionHelp_README->setText(QApplication::translate("MenuHelp", "General Document", 0));
actionHelp_README_QT->setText(QApplication::translate("MenuHelp", "About Qt ports", 0));
actionHelp_README_Artane->setText(QApplication::translate("MenuHelp", "About Qt ports (Japanese).", 0));
connect(this, SIGNAL(quit_emulator_all()), CoreApplication, SLOT(closeAllWindows()));
connect(actionHelp_AboutQt, SIGNAL(triggered()),
this->CoreApplication, SLOT(aboutQt()));
-
+
}
#include <string>
void Ui_MainWindowBase::StopEmuThread(void)
{
- emit quit_emu_thread();
+ emit sig_quit_emu_thread();
}
void Ui_MainWindowBase::delete_emu_thread(void)
{
//do_release_emu_resources();
emit sig_quit_all();
-}
+}
// Utility
#include <QActionGroup>
#include <QTextCodec>
}
tmps = tmps + QString::fromUtf8(")");
MainWindow->setWindowTitle(tmps);
-
+
}
void Ui_MainWindowBase::do_set_mouse_enable(bool flag)
* This is main for Qt.
*/
DLL_PREFIX std::shared_ptr<CSP_Logger> csp_logger;
-
#include "qt_dialogs.h"
//#include "csp_logger.h"
-int Ui_MainWindowBase::do_write_protect_bubble(int drv, bool flag)
-{
- if((drv < 0) || (drv >= using_flags->get_max_bubble())) return -1;
- emit sig_write_protect_bubble(drv, flag);
- return 0;
-}
-
-
// Common Routine
void Ui_MainWindowBase::CreateBubbleMenu(int drv, int drv_base)
ConfigBubbleMenuSub(i);
}
}
+
+void Ui_MainWindowBase::do_ui_bubble_closed(int drive)
+{
+}
+
+int Ui_MainWindowBase::set_recent_bubble(int drv, int num)
+{
+ QString s_path;
+ std::shared_ptr<USING_FLAGS> p = using_flags;
+ if(p.get() == nullptr) return -1;
+ if(p_config == nullptr) return -1;
+
+ if(p->get_max_bubble() <= drv) return -1;
+ if((num < 0) || (num >= MAX_HISTORY)) return -1;
+ s_path = QString::fromLocal8Bit(p_config->recent_bubble_casette_path[drv][num]);
+ if(!(s_path.isEmpty())) {
+ _open_bubble(drv, s_path);
+ return 0;
+ }
+ return -1;
+}
+
+
+void Ui_MainWindowBase::do_ui_bubble_insert_history(int drv, QString fname, quint64 bank)
+{
+ std::shared_ptr<USING_FLAGS>p = using_flags;
+ if(p.get() == nullptr) return;
+ if(fname.length() <= 0) return;
+ if(p->get_max_bubble() <= drv) return;
+ if(p_config == nullptr) return;
+
+ _TCHAR path_shadow[_MAX_PATH] = {0};
+
+ my_strncpy_s(path_shadow, _MAX_PATH, fname.toLocal8Bit().constData(), _TRUNCATE);
+ if(!(FILEIO::IsFileExisting(path_shadow))) return;
+
+ if((bank & EMU_MEDIA_TYPE::MULTIPLE_SLOT_DETECT_MASK) == 0) {
+ UPDATE_HISTORY(path_shadow, p_config->recent_bubble_casette_path[drv], listBubbles[drv]);
+ my_strncpy_s(p_config->initial_floppy_bubble_casette_dir,
+ sizeof(p_config->initial_bubble_casette_dir) / sizeof(_TCHAR),
+ get_parent_dir((const _TCHAR *)path_shadow),
+ _TRUNCATE);
+ // Update List
+ my_strncpy_s(path_shadow,
+ _MAX_PATH,
+ fname.toLocal8Bit().constData(),
+ _TRUNCATE);
+ menu_bubbles[drv]->do_set_initialize_directory(p_config->initial_bubble_casette_dir);
+ do_update_bubble_history(drv, listBubbles[drv]);
+ }
+ listB77[drv].clear();
+ QString int_name = fname;
+ if(check_file_extension(path_shadow, ".b77")) {
+ UPDATE_B77_LIST(drv, listB77[drv]);
+ unsigned int xbank = bank & EMU_MEDIA_TYPE::EMU_SLOT_MASK;
+ if(listB77[drv].size() > xbank) {
+ int_name = listB77[drv].at(xbank);
+ }
+ }
+ if(menu_bubbles[drv] != nullptr) {
+ menu_bubbles[drv]->do_update_inner_media(listB77[drv], bank & EMU_MEDIA_TYPE::EMU_SLOT_MASK);
+ }
+ // ToDO: Replace signal model.
+ if(driveData != nullptr) {
+ driveData->updateMediaFileName(CSP_DockDisks_Domain_Bubble, drv, int_name);
+ }
+
+}
+void Ui_MainWindowBase::do_ui_eject_bubble_casette(int drv)
+{
+ if(menu_bubbless[drv] != nullptr) {
+ menu_bubbless[drv]->do_clear_inner_media();
+ }
+ // ToDO: Replace signal model.
+ if(driveData != nullptr) {
+ driveData->updateMediaFileName(CSP_DockDisks_Domain_Bubble, drv, QString::fromUtf8(""));
+ }
+}
+void Ui_MainWindowBase::do_ui_bubble_write_protect(int drv, quint64 flag)
+{
+ if(drive < 0) return;
+
+ std::shared_ptr<USING_FLAGS>p = using_flags;
+ if(p.get() == nullptr) return;
+ if(!(p->is_use_bubble()) || (p->get_max_bubble() <= drive)) return;
+ if(menu_bubbless[drive] != nullptr) return;
+
+ if((flag & EMU_MESSAGE_TYPE::WRITE_PROTECT) != 0) {
+ menu_bubbles[drive]->do_set_write_protect(true);
+ } else {
+ menu_bubbles[drive]->do_set_write_protect(false);
+ }
+}
+
+void Ui_MainWindowBase::do_update_bubble_history(int drive, QStringList lst)
+{
+ std::shared_ptr<USING_FLAGS> p = using_flags;
+ if(p.get() == nullptr) return;
+
+ if((drive < 0) || (drive >= p->get_max_bubble())) return;
+ if(menu_bubbless[drive] != nullptr) {
+ menu_bubbless[drive]->do_update_histories(lst);
+ }
+}
void Ui_MainWindowBase::do_ui_floppy_insert_history(int drv, QString fname, quint64 bank)
{
+ std::shared_ptr<USING_FLAGS>p = using_flags;
+ if(p.get() == nullptr) return;
if(fname.length() <= 0) return;
- if(using_flags->get_max_drive() <= drv) return;
+ if(p->get_max_drive() <= drv) return;
_TCHAR path_shadow[_MAX_PATH] = {0};
emit sig_ui_binary_closed(drive);
break;
case EMU_MEDIA_TYPE::BUBBLE_CASETTE :
- emit sig_ui_binary_closed(drive);
+ emit sig_ui_bubble_closed(drive);
break;
case EMU_MEDIA_TYPE::CARTRIDGE :
emit sig_ui_cartridge_eject(drive);
message("* vm/common_vm")
-SET(THIS_LIB_VERSION 7.6.3)
+SET(THIS_LIB_VERSION 7.6.4)
#include(cotire)
set(s_vm_common_vm_srcs
cmake_minimum_required (VERSION 3.0)
message("* vm/fmgen")
-SET(THIS_LIB_VERSION 5.5.3)
+SET(THIS_LIB_VERSION 5.5.4)
add_definitions(-D__LIBFMGEN_VERSION=\"libCSPfmgen.${THIS_LIB_VERSION}\")
SET(s_vm_fmgen_srcs