OSDN Git Service

[Qt][UI] Re-Factoring: Available to build.Still only for emufm7.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 30 Jun 2022 18:43:51 +0000 (03:43 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 30 Jun 2022 18:43:51 +0000 (03:43 +0900)
39 files changed:
source/src/qt/CMakeLists.txt
source/src/qt/avio/movie_loader.cpp
source/src/qt/avio/movie_loader.h
source/src/qt/avio/movie_saver.h
source/src/qt/avio/movie_saver_fileio.cpp
source/src/qt/avio/sound_loader.cpp
source/src/qt/avio/sound_loader.h
source/src/qt/common/qt_utils.cpp
source/src/qt/common/util_main.cpp
source/src/qt/gui/commonclasses.h
source/src/qt/gui/csp_logger.cpp
source/src/qt/gui/csp_logger.h
source/src/qt/gui/emu_thread_tmpl.cpp
source/src/qt/gui/emu_thread_tmpl.h
source/src/qt/gui/gl/qt_glutil_gl_tmpl.h
source/src/qt/gui/mainwidget_base.h
source/src/qt/gui/mainwindow_utils.cpp
source/src/qt/gui/menu_binary.cpp
source/src/qt/gui/menu_control.cpp
source/src/qt/gui/menu_disk.cpp
source/src/qt/gui/menu_disk.h
source/src/qt/gui/menu_main.cpp
source/src/qt/gui/menu_metaclass.cpp
source/src/qt/gui/menu_metaclass.h
source/src/qt/gui/menu_screen.cpp
source/src/qt/gui/menu_sound.cpp
source/src/qt/gui/qt_dialogs.cpp
source/src/qt/gui/qt_dialogs.h
source/src/qt/gui/qt_gldraw.h
source/src/qt/gui/qt_glevents.cpp
source/src/qt/gui/util_binary.cpp
source/src/qt/gui/util_bubble.cpp
source/src/qt/gui/util_cart.cpp
source/src/qt/gui/util_fd.cpp
source/src/qt/gui/util_ld.cpp
source/src/qt/gui/util_qd.cpp
source/src/qt/machines/fm7/MainWindow.cpp
source/src/qt/machines/fm7/menuclasses.h
source/src/qt/osd_base.h

index e23cbdf..cac5006 100644 (file)
@@ -1,5 +1,5 @@
 message("* qt/osd")
-SET(THIS_LIB_VERSION 3.9.4)
+SET(THIS_LIB_VERSION 4.0.0)
 
 set(s_qt_osd_headers
        osd_base.h
index 46d57bb..fc5c00d 100644 (file)
@@ -342,7 +342,7 @@ int MOVIE_LOADER::open_codec_context(int *stream_idx,
                dec_ctx = st->codec;
                __dec = avcodec_find_decoder(dec_ctx->codec_id);
 #else
-               __dec = avcodec_find_decoder(st->codecpar->codec_id);
+               __dec = (AVCodec *)avcodec_find_decoder(st->codecpar->codec_id);
                if (!__dec) {
                        //avcodec_free_context(&dec_ctx);
             out_debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_MOVIE_LOADER, "Failed to find %s codec\n",
index 7751485..81716df 100644 (file)
@@ -19,6 +19,7 @@ extern "C" {
        #include "libavformat/avformat.h"
        #include "libswscale/swscale.h"
        #include "libswresample/swresample.h"
+       #include "libavcodec/avcodec.h"
 }
 #endif
 
index 31d5757..393f1a9 100644 (file)
@@ -26,6 +26,7 @@ extern "C" {
        #include "libavformat/avformat.h"
        #include "libswscale/swscale.h"
        #include "libswresample/swresample.h"
+       #include "libavcodec/avcodec.h"
 }
 #endif
 // Copy from FFMPEG-3.0.2; doc/example/muxing.c .
index cdcc262..4ae4837 100644 (file)
@@ -64,7 +64,7 @@ bool MOVIE_SAVER::add_stream(void *_ost, void *_oc,
        AVCodec **codec = (AVCodec **)_codec;
        enum AVCodecID codec_id = (enum AVCodecID)_codec_id;
        /* find the encoder */
-       *codec = avcodec_find_encoder(codec_id);
+       *codec = (AVCodec *)avcodec_find_encoder(codec_id);
        if (!(*codec)) {
                out_debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_MOVIE_SAVER, "Could not find encoder for '%s'\n",
                                (const char *)avcodec_get_name(codec_id));
@@ -291,7 +291,7 @@ bool MOVIE_SAVER::do_open_main()
        if (!oc)
                return false;
 
-       fmt = oc->oformat;
+       fmt = (AVOutputFormat *)(oc->oformat);
        switch(p_config->video_codec_type) {
        case VIDEO_CODEC_MPEG4:
                fmt->video_codec = AV_CODEC_ID_MPEG4;
@@ -389,7 +389,7 @@ void MOVIE_SAVER::do_close_main()
 #if defined(USE_LIBAV)
        if(output_context != NULL) {
                AVFormatContext *oc = output_context;
-               AVOutputFormat *fmt = oc->oformat;
+               AVOutputFormat *fmt = (AVOutputFormat *)(oc->oformat);
                //AVPacket pkt = {0};
                //AVCodecContext *c = video_st.st->codec;
                bool a_f, v_f;
index a2867bf..d02014b 100644 (file)
@@ -305,7 +305,7 @@ int SOUND_LOADER::open_codec_context(int *stream_idx,
 
         /* find decoder for the stream */
 #if LIBAVCODEC_VERSION_MAJOR > 56
-               dec = avcodec_find_decoder(st->codecpar->codec_id);
+               dec = (AVCodec *)avcodec_find_decoder(st->codecpar->codec_id);
         if (!dec) {
             out_debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_SOUND_LOADER, "Failed to find %s codec\n",
                     av_get_media_type_string(type));
index 775a291..123bc7f 100644 (file)
@@ -21,6 +21,7 @@ extern "C" {
        #include "libavformat/avformat.h"
        #include "libswscale/swscale.h"
        #include "libswresample/swresample.h"
+       #include "libavcodec/avcodec.h"
 }
 #endif
 
index 04a2390..92348df 100644 (file)
@@ -129,8 +129,8 @@ void Ui_MainWindow::LaunchEmuThread(EmuThreadClassBase *m)
        int drvs;
        
        hRunEmu = m;
-       connect(hRunEmu, SIGNAL(message_changed(QString)), this, SLOT(message_status_bar(QString)));
-       connect(hRunEmu, SIGNAL(sig_is_enable_mouse(bool)), glv, SLOT(do_set_mouse_enabled(bool)));
+       connect(hRunEmu, SIGNAL(message_changed(QString)), this, SLOT(message_status_bar(QString)), Qt::QueuedConnection);
+       connect(hRunEmu, SIGNAL(sig_is_enable_mouse(bool)), this, SLOT(do_set_mouse_enable(bool)));
        connect(glv, SIGNAL(sig_key_down(uint32_t, uint32_t, bool)), hRunEmu, SLOT(do_key_down(uint32_t, uint32_t, bool)));
        connect(glv, SIGNAL(sig_key_up(uint32_t, uint32_t)),hRunEmu, SLOT(do_key_up(uint32_t, uint32_t)));
        connect(this, SIGNAL(sig_quit_widgets()), glv, SLOT(do_stop_run_vm()));
@@ -236,7 +236,8 @@ void Ui_MainWindow::LaunchEmuThread(EmuThreadClassBase *m)
                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)));
+                               SLOT(do_update_inner_bubble(int ,QStringList , class Action_Control **, QStringList , int, bool))
+                       );
        }
 #endif
        
@@ -247,7 +248,7 @@ void Ui_MainWindow::LaunchEmuThread(EmuThreadClassBase *m)
        
        hRunEmu->set_tape_play(false);
 #if defined(USE_KEY_LOCKED) || defined(USE_LED_DEVICE)
-       connect(hRunEmu, SIGNAL(sig_send_data_led(quint32)), this, SLOT(do_recv_data_led(quint32)));
+       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)));
@@ -273,21 +274,21 @@ void Ui_MainWindow::LaunchEmuThread(EmuThreadClassBase *m)
        emu->get_osd()->set_buttons();
 #endif
        csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GENERAL, "DrawThread : Start.");
-       connect(hDrawEmu, SIGNAL(sig_draw_frames(int)), hRunEmu, SLOT(print_framerate(int)));
+       connect(hDrawEmu, SIGNAL(sig_draw_frames(int)), hRunEmu, SLOT(print_framerate(int)), Qt::DirectConnection);
        //connect((OSD*)(emu->get_osd()), SIGNAL(sig_draw_frames(int)), hRunEmu, SLOT(print_framerate(int)));
-       connect(hRunEmu, SIGNAL(window_title_changed(QString)), this, SLOT(do_set_window_title(QString)));
+       connect(hRunEmu, SIGNAL(window_title_changed(QString)), this, SLOT(do_set_window_title(QString)), Qt::QueuedConnection);
        connect(hDrawEmu, SIGNAL(message_changed(QString)), this, SLOT(message_status_bar(QString)));
        connect(actionCapture_Screen, SIGNAL(triggered()), glv, SLOT(do_save_frame_screen()));
        connect(this, SIGNAL(sig_emu_launched()), glv, SLOT(set_emu_launched()));
 
        /*if(config.use_separate_thread_draw) {
-               connect(hRunEmu, SIGNAL(sig_draw_thread(bool)), hDrawEmu, SLOT(doDraw(bool)), Qt::QueuedConnection);
-               connect(hRunEmu, SIGNAL(sig_set_draw_fps(double)), hDrawEmu, SLOT(do_set_frames_per_second(double)), Qt::QueuedConnection);
-               connect(hRunEmu, SIGNAL(sig_draw_one_turn(bool)), hDrawEmu, SLOT(do_draw_one_turn(bool)), Qt::QueuedConnection);
-               } else*/ {
                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)));
+               } else*/ {
+               connect(hRunEmu, SIGNAL(sig_draw_thread(bool)), hDrawEmu, SLOT(doDraw(bool)), Qt::DirectConnection);
+               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*)(emu->get_osd()), SLOT(do_draw(bool)));
        //connect(hRunEmu, SIGNAL(quit_draw_thread()), hDrawEmu, SLOT(doExit()));
@@ -302,16 +303,17 @@ void Ui_MainWindow::LaunchEmuThread(EmuThreadClassBase *m)
 #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()));
 #endif
        connect(hRunEmu, SIGNAL(sig_resize_screen(int, int)),
-                       glv, SLOT(resizeGL(int, int)));
-       connect(hRunEmu, SIGNAL(sig_resize_osd(int)), driveData, SLOT(setScreenWidth(int)));
-       connect(hRunEmu, SIGNAL(sig_change_osd(int, int, QString)), driveData, SLOT(updateMessage(int, int, QString)));
+                       glv, SLOT(resizeGL(int, int)), Qt::QueuedConnection);
+       connect(hRunEmu, SIGNAL(sig_resize_osd(int)), driveData, SLOT(setScreenWidth(int)), Qt::QueuedConnection);
+       connect(hRunEmu, SIGNAL(sig_change_osd(int, int, QString)), driveData, SLOT(updateMessage(int, int, QString)), Qt::QueuedConnection);
        
        connect(glv, SIGNAL(sig_resize_uibar(int, int)),
-                       this, SLOT(resize_statusbar(int, int)));
+                       this, SLOT(resize_statusbar(int, int)), Qt::QueuedConnection);
        connect(hRunEmu, SIGNAL(sig_resize_uibar(int, int)),
-                       this, SLOT(resize_statusbar(int, int)));
+                       this, SLOT(resize_statusbar(int, int)), Qt::QueuedConnection);
 
        connect((OSD*)(emu->get_osd()), SIGNAL(sig_req_encueue_video(int, int, int)),
                        hDrawEmu, SLOT(do_req_encueue_video(int, int, int)));
@@ -357,9 +359,9 @@ void Ui_MainWindow::LaunchEmuThread(EmuThreadClassBase *m)
        csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GENERAL, "MovieThread : Launch done.");
 
        connect(action_SetupMovie, SIGNAL(triggered()), this, SLOT(rise_movie_dialog()));
-       connect(hRunEmu, SIGNAL(sig_change_access_lamp(int, int, QString)), driveData, SLOT(updateLabel(int, int, QString)));
-       connect(hRunEmu, SIGNAL(sig_set_access_lamp(int, bool)), graphicsView, SLOT(do_display_osd_leds(int, bool)));
-       connect(hRunEmu, SIGNAL(sig_change_virtual_media(int, int, QString)), driveData, SLOT(updateMediaFileName(int, int, QString)));
+       connect(hRunEmu, SIGNAL(sig_change_access_lamp(int, int, QString)), driveData, SLOT(updateLabel(int, int, QString)), Qt::QueuedConnection);
+       connect(hRunEmu, SIGNAL(sig_set_access_lamp(int, bool)), graphicsView, SLOT(do_display_osd_leds(int, bool)), Qt::QueuedConnection);
+       connect(hRunEmu, SIGNAL(sig_change_virtual_media(int, int, QString)), driveData, SLOT(updateMediaFileName(int, int, QString)), Qt::QueuedConnection);
        connect((OSD*)(emu->get_osd()), SIGNAL(sig_change_virtual_media(int, int, QString)), driveData, SLOT(updateMediaFileName(int, int, QString)));
        connect((OSD*)(emu->get_osd()), SIGNAL(sig_enable_mouse()), glv, SLOT(do_enable_mouse()));
        connect((OSD*)(emu->get_osd()), SIGNAL(sig_disable_mouse()), glv, SLOT(do_disable_mouse()));
@@ -1457,7 +1459,7 @@ void Ui_MainWindow::OnOpenDebugger()
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int no = cp->data.value<int>();
+       int no = cp->data().value<int>();
 
        if((no < 0) || (no > 7)) return;
        //emu->open_debugger(no);
index 877919e..c4d473e 100644 (file)
@@ -74,7 +74,7 @@ void Ui_MainWindow::set_window(int mode)
                        width = desktop_width;
                        height = desktop_height;
                } else {
-                       double nd = actionScreenSize[mode]->binds->getDoubleValue();
+                       double nd = actionScreenSize[mode]->data().value<double>();
                        width = (int)(nd * (double)using_flags->get_screen_width());
                        height = (int)(nd * (double)using_flags->get_screen_height());
 
index 7561bf6..1325a31 100644 (file)
 #include "menu_flags.h"
 
 QT_BEGIN_NAMESPACE
-typedef class DLL_PREFIX Object_Menu_Control: public QObject {
+class DLL_PREFIX Action_Control: public QAction {
        Q_OBJECT
-public:
-       USING_FLAGS *using_flags;
-Object_Menu_Control(QObject *parent, USING_FLAGS *p) : QObject(parent){
-               bindValue = 0;
-               drive = 0;
-               s_num = 0;
-               double_val = 0.0;
-               using_flags = p;
-               p_config = p->get_config_ptr();
-               play = true; // Read
-               write_protect = false; // Enable to write
-               _str.clear();
-       }
-       ~Object_Menu_Control() {}
 protected:
-       int bindValue;
-       int drive;
-       int s_num;
-       bool play;
-       bool write_protect;
-       double double_val;
-       QString _str;
-       config_t *p_config;
- public:
-       void setValue1(int v) {bindValue = v;}
-       int getValue1(void) {return bindValue;}
-       void setDrive(int num) { drive = num;}
-       int getDrive(void) { return drive;}
-       void setNumber(int num) { s_num = num;}
-       int getNumber(void) { return s_num;}
-       void setDoubleValue(double n) {double_val = n;}
-       double getDoubleValue(void) {return double_val;}
-       QString getStringValue(void) {return _str; }
-       void setStringValue(QString s) { _str = s; }
-       bool isPlay(void) { return play; }
-       void setPlay(bool b) { play = b; }
-   
-       bool isWriteProtect(void) { return write_protect; }
-       void setWriteProtect(bool b) {write_protect = b;}
-
-public slots:
-       void on_set_host_sound_device(void);
-       void set_boot_mode(void);
-       void set_cpu_type(void);
-       void set_cpupower(void);
-       void open_debugger(void);
-       void insert_fd(void);
-       void eject_fd(void);
-       void on_d88_slot(void);
-       void on_recent_disk(void);
-       void write_protect_fd(void);
-       void no_write_protect_fd(void);
-       void do_set_ignore_crc_error(bool flag);
-       void do_set_correct_disk_timing(bool flag);
-       void do_set_disk_count_immediate(bool flag);
-       void do_special_reset(void);
-       // Bubble
-       void insert_bubble(void);
-       void eject_bubble(void);
-       void on_b77_slot(void);
-       void on_recent_bubble(void);
-       void write_protect_bubble(void);
-       void no_write_protect_bubble(void);
-
-       void set_screen_aspect(void);
-       void set_screen_size(void);
-       void do_set_screen_rotate(void);
-       void do_set_device_type(void);
-       void do_set_keyboard_type(void);
-       void do_set_joystick_type(void);
-       void do_set_mouse_type(void);
-       void do_set_drive_type(void);
-       void do_set_sound_device(void);
-       void do_set_printer_device(void);
-       
-       void insert_Qd(void);
-       void eject_Qd(void);
-       void on_recent_quick_disk(void);
-       void write_protect_Qd(void);
-       void no_write_protect_Qd(void);
-       
-       void on_recent_binary_load(void);
-       void on_recent_binary_save(void);
-       void _open_binary(QString s);
-       void insert_binary_load(void);
-       void insert_binary_save(void);
-       
-       void insert_laserdisc(void);
-       void eject_laserdisc(void);
-       void on_recent_laserdisc();
-       
-       void on_set_freq(void);
-       void on_set_latency(void);
-
-       void insert_cart(void);
-       void eject_cart(void);
-       void on_recent_cart(void);
-       void do_save_as_movie(void);
-       void do_stop_saving_movie(void);
-       void do_set_monitor_type();
-       void do_select_fixed_cpu(void);
-
-       void do_select_machine_feature_single(void);
-       
-signals:
-       int on_boot_mode(int);   
-       int on_cpu_type(int);   
-       int on_cpu_power(int); 
-       int on_open_debugger(int);
-       int sig_specialreset(int);      
-       int sig_insert_fd(int);
-       int sig_eject_fd(int);
-       int set_d88_slot(int, int);
-       int set_recent_disk(int, int);
-       int sig_write_protect_fd(int, bool);
-       int sig_device_type(int);
-       int sig_keyboard_type(int);
-       int sig_joystick_type(int);
-       int sig_mouse_type(int);
-       int sig_sound_device(int);
-       int sig_printer_device(int);
-       int sig_drive_type(int);
-       int sig_emu_update_config(void);
-       int sig_set_machine_feature(int, uint32_t);
-       
-       int set_recent_quick_disk(int, int);
-       int sig_write_protect_Qd(int, bool);
-       int sig_eject_Qd(int);
-       int sig_insert_Qd(int);
-       
-       int sig_recent_cdrom(int);
-               
-       int sig_insert_laserdisc(bool);
-       int sig_eject_laserdisc(void);
-       int sig_recent_laserdisc(int);
-       
-       int sig_insert_cart(int);
-       int sig_eject_cart(int);
-       int set_recent_cart(int, int);
-
-       int sig_open_binary_file(int, QString, bool);
-       int sig_open_binary(int, bool);
-       int set_recent_binary_load(int, int);
-       int set_recent_binary_save(int, int);
-
-       // bubble
-       int sig_insert_bubble(int);
-       int sig_eject_bubble(int);
-       int set_b77_slot(int, int);
-       int set_recent_bubble(int, int);
-       int sig_write_protect_bubble(int, bool);
-       
-       int sig_freq(int);
-       int sig_latency(int);
-       int sig_sounddevice(int);
-       int sig_set_host_sound_device(int);
-       int sig_set_dipsw(int, bool);
-       int sig_screen_aspect(int);
-       int sig_screen_size(int, int);
-       int sig_screen_multiply(float);
-       int sig_screen_rotate(int);
-
-       int sig_monitor_type(int);
-       int sig_set_fixed_cpu(int);
-       
-signals:
-       int sig_stop_record_movie();
-       int sig_start_record_movie(int);
-} Object_Menu_Control ;
-
-
-
-typedef class DLL_PREFIX Action_Control: public QAction {
-       Q_OBJECT
-  protected:
        //    virtual void addedTo ( QWidget * actionWidget, QWidget * container ){}
        //   virtual void addedTo ( int index, QPopupMenu * menu ){}
        QString bindString;
- public:
+public:
        //Object_Menu_Control *binds;
        Action_Control (QObject *parent, USING_FLAGS *p) : QAction(parent) {
                //binds = new Object_Menu_Control(parent, p);
@@ -210,26 +36,14 @@ typedef class DLL_PREFIX Action_Control: public QAction {
                //delete binds;
        }
 public slots:
-       void do_check_grab_mouse(bool);
-       void do_send_string(void);
-       void do_set_string(QString);
-       void do_set_dev_log_to_console(bool f);
-       void do_set_dev_log_to_syslog(bool f);
-       void do_select_render_platform(void);
-       void do_save_state(void);
-       void do_load_state(void);
        void do_set_window_focus_type(bool flag);
-       void do_set_emulate_cursor_as(void);
        
 signals:
        int quit_emu_thread(void);
-       int sig_send_string(QString);
        int sig_set_dev_log_to_console(int, bool);
        int sig_set_dev_log_to_syslog(int, bool);
-       int sig_select_render_platform(int);
        int sig_set_window_focus_type(bool);
-       int sig_set_emulate_cursor_as(int);
-} ActionControl;
+};
 QT_END_NAMESPACE
 
 #endif
index 7f79548..107dec9 100644 (file)
@@ -539,6 +539,8 @@ void CSP_Logger::set_device_name(int num, char *devname)
        QString tmps;
        if(num < 0) return;
        if(num > (CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0)) return;
+       
+       QMutexLocker locker(lock_mutex);
        if(devname == NULL) {
                QString s;
                s.setNum(num);
@@ -556,6 +558,8 @@ void CSP_Logger::set_cpu_name(int num, char *devname)
        if(num < 0) return;
        if(num > (CSP_LOG_TYPE_VM_CPU7 - CSP_LOG_TYPE_VM_CPU0)) return;
        if(devname == NULL) return;
+       QMutexLocker locker(lock_mutex);
+       
        QString tmps = QString::fromUtf8(devname);
        device_names.replace(num, tmps);
        if(max_cpus <= num) max_cpus = num + 1;
@@ -565,6 +569,7 @@ void CSP_Logger::set_state_log(int to_output, bool flag)
 {
        if(to_output < 0) return;
        if(to_output > 2) return;
+       QMutexLocker locker(lock_mutex);
        switch(to_output)
        {
        case 0:
@@ -587,6 +592,7 @@ void CSP_Logger::set_device_node_log(int device_id, int to_output, int type, boo
        if(to_output < 0) return;
        if(to_output > 2) return;
        if(device_id > (CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0)) return;
+       QMutexLocker locker(lock_mutex);
        if(device_id < 0) { // Flush all device
                for(int i = 0; i < (CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1); i++) {
                        // 0 = record, 1 = syslog, 2 = console;
index 670844b..8c082de 100644 (file)
@@ -201,9 +201,6 @@ public:
        void set_emu_vm_name(const char *devname);
        void set_device_name(int num, char *devname);
        void set_cpu_name(int num, char *devname);
-       void set_device_node_log(int device_id, int to_output, int type, bool flag);
-       void set_device_node_log(int to_output, int type, bool* flags, int start, int devices);
-       void set_device_node_log(int to_output, int type, int *flags, int start, int devices);
 
        void set_state_log(int to_output, bool flag);
 
@@ -215,6 +212,10 @@ public:
        void *get_raw_data(bool forget = false, int64_t start = 0, int64_t *end_line = NULL);
 public slots:
        void do_debug_log(int level, int domain_num, QString mes);
+       void set_device_node_log(int device_id, int to_output, int type, bool flag);
+       void set_device_node_log(int to_output, int type, bool* flags, int start, int devices);
+       void set_device_node_log(int to_output, int type, int *flags, int start, int devices);
+       
 signals:
        int sig_console_message(QString, QString);
        int sig_console_quit();
index d785b30..393d055 100644 (file)
@@ -283,7 +283,7 @@ void EmuThreadClassBase::do_special_reset(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int num = cp->data().value<int>();
        
        if(num < 0) return;
        if(num >= using_flags->get_use_special_reset_num()) return;
@@ -295,7 +295,7 @@ void EmuThreadClassBase::do_load_state(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       QString s = cp->data.toString();
+       QString s = cp->data().toString();
        
        lStateFile = s;
        bLoadStateReq = true;
@@ -305,7 +305,7 @@ void EmuThreadClassBase::do_save_state(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       QString s = cp->data.toString();
+       QString s = cp->data().toString();
        
        sStateFile = s;
        bSaveStateReq = true;
@@ -568,7 +568,7 @@ void EmuThreadClassBase::do_set_emu_thread_to_fixed_cpu_from_action(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int cpunum = cp->data.value<int>();
+       int cpunum = cp->data().value<int>();
        set_emu_thread_to_fixed_cpu(cpunum);
 }
 
index 7fa92f3..dfb9862 100644 (file)
@@ -242,13 +242,13 @@ public slots:
        void doExit(void);
        
        void do_reset();
-       void do_special_reset(int num);
-       void do_load_state(QString name);
-       void do_save_state(QString name);
+       void do_special_reset(void);
+       void do_load_state();
+       void do_save_state();
        void do_update_config();
        void do_start_record_sound();
        void do_stop_record_sound();
-       void do_start_record_video(int fps);
+       void do_start_record_video();
        void do_stop_record_video();
        void do_update_volume_level(int num, int level);
        void do_update_volume_balance(int num, int level);
@@ -262,7 +262,7 @@ public slots:
        void do_block();
        void do_unblock();
        void do_start_emu_thread();
-
+       void do_set_emu_thread_to_fixed_cpu_from_action();
        // From emu_thread_slots.cpp .
        void do_set_display_size(int w, int h, int ww, int wh);
        void moved_mouse(double x, double y, double globalx, double globaly);
@@ -309,7 +309,6 @@ signals:
        int sig_screen_size(int, int);
        int sig_finished(void);
        int call_emu_thread(EMU *);
-       int sig_check_grab_mouse(bool);
        int sig_mouse_enable(bool);
        int sig_update_recent_disk(int);
        int sig_update_recent_hard_disk(int);
index 4c76136..dd7c078 100644 (file)
@@ -457,8 +457,6 @@ public slots:
        virtual void do_set_led_width(int bitwidth) { }
        virtual bool is_mapped_buffer(void) { return false; }
        virtual GLuint get_mapped_buffer_num(int region) { return (GLuint)0; }
-       virtual void do_set_fixed_size(int w, int h) { setFixedSize(w, h); }
-
 signals:
        int sig_push_image_to_movie(int, int, int, QImage *);
 };
index a6a1d6e..ac38049 100644 (file)
@@ -7,15 +7,15 @@
 #ifndef _CSP_QT_MAINWIDGET_BASE_H
 #define _CSP_QT_MAINWIDGET_BASE_H
 
-//#include <QVariant>
-//#include <QObject>
-//#include <QApplication>
+#include <QVariant>
+#include <QObject>
+#include <QApplication>
 #include <QMainWindow>
 #include <QIcon>
 #include <QString>
 #include <QStringList>
 #include <QMap>
-//#include <QMenu>
+#include <QAction>
 //#include <QMenuBar>
 
 #include "common.h"
@@ -125,7 +125,6 @@ QT_BEGIN_NAMESPACE
 
 class OSD;
 class QVariant;
-class QAction;
 class QActionGroup;
 class QButtonGroup;
 class QGraphicsView;
@@ -608,6 +607,9 @@ public:
        virtual QString get_system_version();
        virtual QString get_build_date();
        QString get_gui_version();
+       void set_screen_size(int w, int h);
+       void set_screen_aspect(int num);
+       void update_screen_size(int num);
 
        // Basic slots
 public slots:
@@ -621,15 +623,14 @@ public slots:
        void do_recv_data_led(quint32 d);
 
        void do_update_volume(int level);
-       void set_screen_aspect(int num);
-       void set_screen_size(int w, int h);
-       void do_set_screen_rotate(int type);
+       void do_set_screen_aspect(void);
+       void do_set_screen_size(void);
+       void do_set_screen_rotate(void);
        void OnReset(void);
-       void do_special_reset(int);     
 
        virtual void do_set_mouse_enable(bool flag);
        virtual void do_toggle_mouse(void);
-       void do_set_sound_device(int);
+       void do_set_sound_device(void);
        void do_emu_update_volume_balance(int num, int level);
        void do_emu_update_volume_level(int num, int level);
        void rise_log_viewer(void);
@@ -639,8 +640,6 @@ public slots:
        void rise_joykey_dialog(void);
        void rise_keyboard_dialog(void);
        virtual void rise_movie_dialog(void);
-       void do_stop_saving_movie(void);
-       void do_start_saving_movie(void);
        void do_set_state_saving_movie(bool state);
        void set_osd_virtual_media(bool f);
        
@@ -648,11 +647,11 @@ public slots:
        virtual void OnCloseDebugger(void);
        void doBeforeCloseMainWindow(void);     
        void set_gl_crt_filter(bool);
-       void set_cpu_power(void)
+       void do_set_cpu_power(void)
        {
                QAction *cp = qobject_cast<QAction*>(QObject::sender());
                if(cp == nullptr) return;
-               int pw = cp->data.value<int>();
+               int pw = cp->data().value<int>();
                
                OnCpuPower(pw);
        }
@@ -675,8 +674,8 @@ public slots:
        void CreateBinaryMenu(int drv, int drv_base);
        void CreateBinaryPulldownMenu(int drv);
        void ConfigBinaryMenuSub(int drv);
-       int set_recent_binary_load(int drv, int num);
-       int set_recent_binary_save(int drv, int num);
+       int set_recent_binary_load(void);
+       int set_recent_binary_save(void);
        void _open_binary_load(int drive, const QString fname);
        void _open_binary_save(int drive, const QString fname);
 
@@ -689,8 +688,8 @@ public slots:
        void _open_cart(int drv, const QString fname);
        void eject_cmt(int drv);
        
-       void do_change_boot_mode(int mode);
-       void do_change_cpu_type(int mode);
+       void do_change_boot_mode();
+       void do_change_cpu_type();
        
        void do_write_protect_cmt(int drv, bool flag);
        int  set_recent_cmt(int drv, int num);
@@ -733,28 +732,27 @@ public slots:
        int set_recent_hard_disk(int, int);
 
        void start_record_sound(bool rec);
-       void set_freq(int);
-       void set_latency(int);
-       void set_sound_device(int);
+       void do_set_freq(void);
+       void do_set_latency(void);
        void do_set_sound_strict_rendering(bool f);
        void do_set_sound_tape_signal(bool f);
        void do_set_sound_tape_voice(bool f);
-       void do_set_host_sound_device(int num);
+       void do_set_host_sound_device(void);
        void do_set_host_sound_name(int num, QString sname);    
        void set_monitor_type(void);
        void message_status_bar(QString);
        void resize_statusbar(int w, int h);
        virtual void do_release_emu_resources(void);
        virtual void set_window_title();
-       void set_device_type(int);
-       void set_mouse_type(int);
-       void set_keyboard_type(int);
-       void set_joystick_type(int);
-       void set_drive_type(int);
+       void set_device_type(void);
+       void set_mouse_type(void);
+       void set_keyboard_type(void);
+       void set_joystick_type(void);
+       void set_drive_type();
        void set_scan_line(bool);
        void set_gl_scan_line_vert(bool);
        void set_gl_scan_line_horiz(bool);
-       void set_printer_device(int);
+       void set_printer_device();
        void do_show_about(void);
        void do_browse_document(void);
        void set_dipsw(int num, bool flag);
@@ -765,13 +763,13 @@ public slots:
        void do_set_conslog(bool);
        void do_set_syslog(bool);
        void do_update_device_node_name(int id, const _TCHAR *name);    
-       void do_set_dev_log_to_console(int id, bool f);
-       void do_set_dev_log_to_syslog(int id, bool f);
+       void do_set_dev_log_to_console(bool f);
+       void do_set_dev_log_to_syslog(bool f);
        void do_set_roma_kana(bool f);
        void do_set_numpad_enter_as_fullkey(bool f);
        void do_set_render_mode_std(void);
        void do_set_render_mode_tv(void);
-       void do_select_render_platform(int num);
+       void do_select_render_platform(void);
        void do_set_window_focus_type(bool flag);
 
        void do_set_visible_virtual_media_none();
@@ -780,7 +778,7 @@ public slots:
        void do_set_visible_virtual_media_left();
        void do_set_visible_virtual_media_right();
 
-       void do_set_emulate_cursor_as(int num);
+       void do_set_emulate_cursor_as(void);
        void do_set_logging_fdc(bool onoff);    
        void do_set_separate_thread_draw(bool f);
        void do_set_print_cpu_statistics(bool flag);
@@ -798,6 +796,8 @@ public slots:
 
        void do_set_machine_feature(int devnum, uint32_t value);
 
+       void do_set_single_dipswitch(bool f);
+       
        void do_start_emu_thread();
        void do_start_draw_thread();
 signals:
@@ -812,17 +812,15 @@ signals:
        int sig_start_saving_movie(void);
        int on_boot_mode(int);
        int on_cpu_type(int);
-       int on_cpu_power(int);
        int on_open_debugger(int);
        int on_insert_fd(int);
        int on_eject_fd(int);
-       int do_open_disk(int, QString);
+       int sig_open_disk(int, QString);
        
        int closed(void);
        int sig_quit_all(void);
        int sig_vm_reset(void);
        int sig_vm_specialreset(int);
-       int sig_check_grab_mouse(bool);
        int sig_resize_uibar(int, int);
        int sig_resize_screen(int, int);
        int sig_update_screen(void);
@@ -834,6 +832,7 @@ signals:
        int sig_emu_update_volume_balance(int, int);
 
        int sig_resize_osd(int);
+       int sig_screen_multiply(double);
        
        int sig_write_protect_disk(int drv, bool flag);
        int sig_open_disk(int, QString, int);
@@ -882,6 +881,11 @@ signals:
        int sig_start_emu_thread(void);
        int sig_start_draw_thread(void);
        int sig_emu_launched(void);
+       int sig_glv_set_fixed_size(int, int);
+       
+       int sig_set_device_node_log(int, int, int, bool);
+       int sig_set_device_node_log(int, int, bool*, int, int);
+       int sig_set_device_node_log(int, int, int*, int, int);
 };
 
 QT_END_NAMESPACE
index 680430c..761592c 100644 (file)
 #include "qt_dialogs.h"
 //#include "csp_logger.h"
 
+
+void Ui_MainWindowBase::do_set_single_dipswitch(bool f)
+{
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       uint32_t nval = cp->data().value<uint32_t>();
+
+       if(p_config == nullptr) return;
+       if(f) { // ON
+               p_config->dipswitch |= nval;
+       } else { // OFF
+               p_config->dipswitch &= (~nval); 
+       }
+       emit sig_emu_update_config();
+}
+
 void Ui_MainWindowBase::do_block_task(void)
 {
        emit sig_block_task();
@@ -41,7 +57,7 @@ void Ui_MainWindowBase::do_start_draw_thread(void)
        emit sig_start_draw_thread();
 }
 
-void Ui_MainWindowBase::set_latency(void)
+void Ui_MainWindowBase::do_set_latency(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
@@ -52,7 +68,7 @@ void Ui_MainWindowBase::set_latency(void)
        emit sig_emu_update_config();
 }
 
-void Ui_MainWindowBase::set_freq(void)
+void Ui_MainWindowBase::do_set_freq(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
@@ -64,7 +80,7 @@ void Ui_MainWindowBase::set_freq(void)
        emit sig_emu_update_config();
 }
 
-void Ui_MainWindowBase::set_sound_device(void)
+void Ui_MainWindowBase::do_set_sound_device(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
@@ -75,8 +91,6 @@ void Ui_MainWindowBase::set_sound_device(void)
        emit sig_emu_update_config();
 }
 
-
-
 void Ui_MainWindowBase::start_record_sound(bool start)
 {
        if(start) {
@@ -137,7 +151,7 @@ void Ui_MainWindowBase::update_screen_size(int num)
        float xzoom = using_flags->get_screen_x_zoom();
        float yzoom = using_flags->get_screen_y_zoom();
        nd = getScreenMultiply(num);
-       if(nd <= 0.0f) retrun;
+       if(nd <= 0.0f) return;
        
        ww = (float)using_flags->get_screen_width();
        hh = (float)using_flags->get_screen_height();
@@ -171,8 +185,7 @@ void Ui_MainWindowBase::update_screen_size(int num)
        w = (int)ww;
        h = (int)hh;
        set_screen_size(w, h);
-       emit sig_screen_multiply(nd);
-       
+       emit sig_screen_multiply((double)nd);
 }
 
 void Ui_MainWindowBase::set_gl_crt_filter(bool flag)
@@ -201,7 +214,7 @@ void Ui_MainWindowBase::set_device_type(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int num = cp->data().value<int>();
        
        if((num >= using_flags->get_use_device_type()) && (num < 0)) return;
        p_config->device_type = num;
@@ -213,7 +226,7 @@ void Ui_MainWindowBase::set_keyboard_type(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int num = cp->data().value<int>();
        
        if((num >= using_flags->get_use_keyboard_type()) && (num < 0)) return;
        p_config->keyboard_type = num;
@@ -224,7 +237,7 @@ void Ui_MainWindowBase::set_joystick_type(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int num = cp->data().value<int>();
        
        if((num >= using_flags->get_use_joystick_type()) && (num < 0)) return;
        p_config->joystick_type = num;
@@ -235,7 +248,7 @@ void Ui_MainWindowBase::set_drive_type(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int num = cp->data().value<int>();
        
        if((num >= using_flags->get_use_drive_type()) && (num < 0)) return;
        p_config->drive_type = num;
@@ -257,18 +270,13 @@ void Ui_MainWindowBase::set_screen_size(int w, int h)
        MainWindow->adjustSize();
 }
 
-void Ui_MainWindowBase::set_screen_aspect(void)
+void Ui_MainWindowBase::set_screen_aspect(int num)
 {
-       QAction *cp = qobject_cast<QAction*>(QObject::sender());
-       if(cp == nullptr) return;
-       int num = cp->data.value<int>();
-       
        if((num < 0) || (num >= 4)) return;
        // 0 = DOT
        // 1 = ASPECT(Scale X)
        // 2 = ASPECT(SCale Y)
        // 3 = ASPECT(Scale X,Y)
-       
        p_config->window_stretch_type = num;
        
        if(using_flags->get_emu()) {
@@ -316,6 +324,14 @@ void Ui_MainWindowBase::set_screen_aspect(void)
        }
 }
 
+void Ui_MainWindowBase::do_set_screen_aspect(void)
+{
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       int num = cp->data().value<int>();
+       set_screen_aspect(num);
+}
+
 
 void Ui_MainWindowBase::ConfigDeviceType(void)
 {
@@ -479,7 +495,7 @@ void Ui_MainWindowBase::ConfigSoundDeviceType(void)
                        menuSoundDevice->addAction(actionSoundDevice[i]);
                        actionGroup_SoundDevice->addAction(actionSoundDevice[i]);
                        connect(actionSoundDevice[i], SIGNAL(triggered()),
-                                       this, SLOT(set_sound_device()));
+                                       this, SLOT(do_set_sound_device()));
                }
        }
 }
@@ -503,7 +519,7 @@ void Ui_MainWindowBase::ConfigPrinterType(void)
                for(i = 0; i < ilim; i++) {
                        actionPrintDevice[i] = new Action_Control(this, using_flags);
                        actionPrintDevice[i]->setCheckable(true);
-                       actionPrintDevice[i]->setData(QVariant(ii));
+                       actionPrintDevice[i]->setData(QVariant(i));
                        if(i == p_config->printer_type) actionPrintDevice[i]->setChecked(true); // Need to write configure
                        tmps = QString::fromUtf8("actionPrintDevice_");
                        actionPrintDevice[i]->setObjectName(tmps + QString::number(i));
@@ -519,7 +535,7 @@ void Ui_MainWindowBase::set_printer_device(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int p_type = cp->data.value<int>();
+       int p_type = cp->data().value<int>();
        
        // 0 = PRNFILE
        if(p_type < 0) p_type = 0; // OK?
index 106b4e8..275270e 100644 (file)
@@ -46,7 +46,9 @@ void Menu_BinaryClass::create_pulldown_menu_device_sub(void)
                        struct CSP_Ui_Menu::DriveIndexPair tmp;
                        tmp.drive = media_drive;
                        tmp.index = ii;
-                       action_recent_save_list[ii]->setData(QVariant(tmp));
+                       QVariant _tmpv;
+                       _tmpv.setValue(tmp);
+                       action_recent_save_list[ii]->setData(_tmpv);
                        
                        action_recent_save_list[ii]->setText(tmps);
                        action_group_save_recent->addAction(action_recent_save_list[ii]);
@@ -100,7 +102,7 @@ void Menu_BinaryClass::connect_menu_device_sub(void)
        action_eject->setVisible(false);
        for(ii = 0; ii < MAX_HISTORY; ii++) {
                connect(action_recent_save_list[ii], SIGNAL(triggered()),
-                               p_wid, SLOT(set_recent_binary_save());
+                               p_wid, SLOT(set_recent_binary_save()));
        }
        connect(action_saving, SIGNAL(triggered()),     this, SLOT(do_open_save_dialog()));
 
@@ -132,7 +134,7 @@ void Menu_BinaryClass::do_open_save_dialog()
 
        QObject::connect(&dlg, SIGNAL(fileSelected(QString)),
                                         dlg.param, SLOT(_open_disk(QString))); 
-       QObject::connect(dlg.param, SIGNAL(do_open_disk(int, QString)),
+       QObject::connect(dlg.param, SIGNAL(sig_open_disk(int, QString)),
                                         this, SLOT(do_open_media_save(int, QString)));
        dlg.show();
        dlg.exec();
index 522d187..02d4b1d 100644 (file)
 #include "mainwidget_base.h"
 #include "menu_flags.h"
 
-//extern USING_FLAGS *using_flags;
-void Object_Menu_Control::do_select_fixed_cpu(void)
-{
-       emit sig_set_fixed_cpu(getValue1());
-}
-
-// ToDo: Call dialogs.
-void Object_Menu_Control::do_select_machine_feature_single(void)
-{
-       int devnum = getNumber();
-       uint32_t value = (uint32_t)getValue1();
-       emit sig_set_machine_feature(devnum, value);
-       // Not NEED to call sig_emu_update_config()
-}
-
-void Object_Menu_Control::do_set_monitor_type()
-{
-       emit sig_monitor_type(getValue1());
-}
-
-void Object_Menu_Control::do_special_reset(void)
-{
-//     csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GUI, _T("Special reset #%d"), getValue1());
-       emit sig_specialreset(getValue1());
-}
-
-void Object_Menu_Control::set_boot_mode(void) {
-       emit on_boot_mode(bindValue);
-}
-   
-void Object_Menu_Control::set_cpu_type(void) {
-       emit on_cpu_type(bindValue);
-}
-void Object_Menu_Control::set_cpupower(void) {
-       emit on_cpu_power(bindValue);
-}
-void Object_Menu_Control::open_debugger(void) {
-       emit on_open_debugger(bindValue);
-}
-void Object_Menu_Control::do_set_device_type(void){
-       emit sig_device_type(this->getValue1());
-}
-void Object_Menu_Control::do_set_joystick_type(void){
-       emit sig_joystick_type(this->getValue1());
-}
-void Object_Menu_Control::do_set_keyboard_type(void){
-       emit sig_keyboard_type(this->getValue1());
-}
-void Object_Menu_Control::do_set_mouse_type(void){
-       emit sig_mouse_type(this->getValue1());
-}
-void Object_Menu_Control::do_set_printer_device(void){
-       emit sig_printer_device(this->getValue1());
-}
-void Object_Menu_Control::do_set_sound_device(void){
-       emit sig_sound_device(this->getValue1());
-}
-void Object_Menu_Control::do_set_drive_type(void)
-{
-       emit sig_drive_type(getValue1());
-}
-
 
 
 void Ui_MainWindowBase::ConfigCpuSpeed(void)
@@ -147,7 +85,7 @@ void Ui_MainWindowBase::do_change_boot_mode(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int mode = cp->data.value<int>();
+       int mode = cp->data().value<int>();
        
        if((mode < 0) || (mode >= 8)) return;
        p_config->boot_mode = mode;
@@ -187,7 +125,7 @@ void Ui_MainWindowBase::do_change_cpu_type(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int mode = cp->data().value<int>();
        
        if((mode < 0) || (mode >= 8)) return;
        p_config->cpu_type = mode;
@@ -236,8 +174,6 @@ void Ui_MainWindowBase::ConfigControlMenu(void)
                        actionSpecial_Reset[i] = new Action_Control(this, using_flags);
                        actionSpecial_Reset[i]->setObjectName(tmps);
                        actionSpecial_Reset[i]->setData(QVariant(i));
-                       connect(actionSpecial_Reset[i], SIGNAL(triggered()),
-                                       this, SLOT(do_special_reset())); // OK?
                        if(i >= 15) break;
                }
        }
@@ -437,9 +373,3 @@ void Ui_MainWindowBase::retranslateControlMenu(const char *SpecialResetTitle,  b
        }
 }
 
-void Ui_MainWindowBase::do_set_sound_device(int num)
-{
-       if((num < 0) || (num >= using_flags->get_use_sound_device_type())) return;
-       p_config->sound_type = num;
-       emit sig_emu_update_config();
-}
index f24667e..5b1106c 100644 (file)
@@ -98,24 +98,67 @@ void Menu_FDClass::do_create_media(quint8 media_type, QString name)
        emit sig_create_d88_media((int)media_drive, media_type, name);
 }
 
+void Menu_FDClass::do_set_correct_disk_timing(bool flag)
+{
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       int drive = cp->data().value<int>();
+       if(p_config == nullptr) return;
+       
+       p_config->correct_disk_timing[drive] = flag;
+       emit sig_emu_update_config();
+}
+
+void Menu_FDClass::do_set_disk_count_immediate(bool flag)
+{
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       int drive = cp->data().value<int>();
+       if(p_config == nullptr) return;
+       
+       p_config->disk_count_immediate[drive] = flag;
+       emit sig_emu_update_config();
+}
+
+void Menu_FDClass::do_set_ignore_crc_error(bool flag)
+{
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       int drive = cp->data().value<int>();
+       
+       if(p_config == nullptr) return;
+       p_config->ignore_disk_crc[drive] = flag;
+       emit sig_emu_update_config();
+}
 
 void Menu_FDClass::create_pulldown_menu_device_sub(void)
 {
        config_t *p;
+       struct CSP_Ui_Menu::DriveIndexPair tmp;
+       
        action_ignore_crc_error = new Action_Control(p_wid, using_flags);
        action_ignore_crc_error->setVisible(true);
        action_ignore_crc_error->setCheckable(true);
-       action_ignore_crc_error->binds->setDrive(media_drive);
+       tmp.drive = media_drive;
+       tmp.index = 0;
+       QVariant _tmp_ic;
+       _tmp_ic.setValue(tmp);
+       action_ignore_crc_error->setData(_tmp_ic);
+       
        
        action_correct_timing = new Action_Control(p_wid, using_flags);
        action_correct_timing->setVisible(true);
        action_correct_timing->setCheckable(true);
-       action_correct_timing->binds->setDrive(media_drive);
+       QVariant _tmp_ct;
+       _tmp_ct.setValue(tmp);
+       action_correct_timing->setData(_tmp_ct);
 
        action_count_immediate = new Action_Control(p_wid, using_flags);
        action_count_immediate->setVisible(true);
        action_count_immediate->setCheckable(true);
-       action_count_immediate->binds->setDrive(media_drive);
+       QVariant _tmp_ci;
+       _tmp_ci.setValue(tmp);
+       action_count_immediate->setData(_tmp_ci);
        
        action_create_fd = new Action_Control(p_wid, using_flags);
        action_create_fd->setVisible(true);
@@ -140,18 +183,19 @@ void Menu_FDClass::connect_menu_device_sub(void)
        this->addAction(action_count_immediate);
        
        connect(action_ignore_crc_error, SIGNAL(toggled(bool)),
-                       action_ignore_crc_error->binds, SLOT(do_set_ignore_crc_error(bool)));
+                       this, SLOT(do_set_ignore_crc_error(bool)));
        
        connect(action_correct_timing, SIGNAL(toggled(bool)),
-                       action_correct_timing->binds, SLOT(do_set_correct_disk_timing(bool)));
+                       this, SLOT(do_set_correct_disk_timing(bool)));
        
        connect(action_count_immediate, SIGNAL(toggled(bool)),
-                       action_count_immediate->binds, SLOT(do_set_disk_count_immediate(bool)));
+                       this, SLOT(do_set_disk_count_immediate(bool)));
 
        connect(action_create_fd, SIGNAL(triggered()), this, SLOT(do_open_dialog_create_fd()));
        
        connect(this, SIGNAL(sig_open_media(int, QString)), p_wid, SLOT(_open_disk(int, QString)));
        connect(this, SIGNAL(sig_eject_media(int)), p_wid, SLOT(eject_fd(int)));
+       
        connect(this, SIGNAL(sig_write_protect_media(int, bool)), p_wid, SLOT(write_protect_fd(int, bool)));    
        connect(this, SIGNAL(sig_set_recent_media(int, int)), p_wid, SLOT(set_recent_disk(int, int)));
        connect(this, SIGNAL(sig_set_inner_slot(int, int)), p_wid, SLOT(set_d88_slot(int, int)));
@@ -176,3 +220,4 @@ void Menu_FDClass::retranslate_pulldown_menu_device_sub(void)
 }
 
 
+
index c3175d0..69d49a2 100644 (file)
@@ -30,9 +30,15 @@ public:
        void retranslate_pulldown_menu_device_sub(void);
 
 public slots:
+       void do_set_create_mask(quint8 type, bool flag);
+       
        void do_open_dialog_create_fd();
        void do_create_media(quint8 media_type, QString name);
-       void do_set_create_mask(quint8 type, bool flag);
+       
+       void do_set_disk_count_immediate(bool flag);
+       void do_set_ignore_crc_error(bool flag);
+       void do_set_correct_disk_timing(bool flag);
+       
 signals:
        int sig_create_d88_media(int, quint8, QString);
 };
index c8a52e7..9c55137 100644 (file)
@@ -79,7 +79,15 @@ Ui_MainWindowBase::Ui_MainWindowBase(USING_FLAGS *p, CSP_Logger *logger, QWidget
        phys_key_name_map.clear();
        hRunJoy = NULL;
        about_to_close = false;
-
+       if(csp_logger != nullptr) {
+               connect(this, SIGNAL(sig_set_device_node_log(int, int, int, bool)),
+                               csp_logger, SLOT(set_device_node_log(int, int, int, bool)), Qt::QueuedConnection);
+               connect(this, SIGNAL(sig_set_device_node_log(int, int, bool*, int, int)),
+                               csp_logger, SLOT(set_device_node_log(int, int, bool*, int, int)), Qt::QueuedConnection);
+               connect(this, SIGNAL(sig_set_device_node_log(int, int, int*, int, int)),
+                               csp_logger, SLOT(set_device_node_log(int, int, int*, int, int)), Qt::QueuedConnection);
+               
+       }
 }
 
 Ui_MainWindowBase::~Ui_MainWindowBase()
@@ -116,28 +124,13 @@ QString Ui_MainWindowBase::get_gui_version()
        return retval;
 }
 
-void Action_Control::do_check_grab_mouse(bool flag)
-{
-       this->toggle();
-}
-
 
-void Action_Control::do_select_render_platform(void)
-{
-       int num = this->binds->getValue1();
-       emit sig_select_render_platform(num);
-}
 
 void Action_Control::do_set_window_focus_type(bool f)
 {
        emit sig_set_window_focus_type(f);
 }
 
-void Action_Control::do_set_emulate_cursor_as(void)
-{
-       int num = this->binds->getValue1();
-       emit sig_set_emulate_cursor_as(num);
-}
 
 
 
@@ -172,13 +165,11 @@ void Ui_MainWindowBase::do_show_about(void)
        dlg->show();
 }
 
-, __action, SLOT(do_send_string())); \
-       connect(__action, SIGNAL(sig_send_string(QString)),
 void Ui_MainWindowBase::do_browse_document()
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       QString fname = cp->data.toString();
+       QString fname = cp->data().toString();
        
        Dlg_BrowseText *dlg = new Dlg_BrowseText(fname, using_flags);
        dlg->show();
@@ -250,11 +241,11 @@ void Ui_MainWindowBase::do_set_logging_fdc(bool f)
        emit sig_emu_update_config();
 }
 
-void Ui_MainWindowBase::do_set_dev_log_to_console(int num, bool f)
+void Ui_MainWindowBase::do_set_dev_log_to_console(bool f)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       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;
@@ -284,7 +275,7 @@ void Ui_MainWindowBase::do_set_emulate_cursor_as(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int num = cp->data().value<int>();
        
        if((num < 0) || (num > 2)) return;
        p_config->cursor_as_ten_key = num;
@@ -295,7 +286,7 @@ void Ui_MainWindowBase::do_set_dev_log_to_syslog(bool f)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       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;
@@ -305,7 +296,7 @@ void Ui_MainWindowBase::do_select_render_platform(void)
 {
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
        if(cp == nullptr) return;
-       int num = cp->data.value<int>();
+       int num = cp->data().value<int>();
        
        int _major = 0;
        int _minor = 0;
@@ -614,8 +605,6 @@ void Ui_MainWindowBase::setupUi(void)
 //             actionMouseEnable->setChecked(false);
 //             connect(actionMouseEnable, SIGNAL(toggled(bool)),
 //                             this, SLOT(do_set_mouse_enable(bool)));
-               connect(graphicsView, SIGNAL(sig_check_grab_mouse(bool)),
-                               actionMouseEnable, SLOT(do_check_grab_mouse(bool)));
                menuMachine->addAction(actionMouseEnable);
        }
        if(using_flags->is_use_ram_size()) {
@@ -768,8 +757,8 @@ void Ui_MainWindowBase::setupUi(void)
        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();
        h = using_flags->get_screen_height();
-       if(actionScreenSize[p_config->window_mode] != NULL) {
-               double nd = actionScreenSize[p_config->window_mode]->binds->getDoubleValue();
+       if(actionScreenSize[p_config->window_mode] != nullptr) {
+               double nd = getScreenMultiply(p_config->window_mode);
                w = (int)(nd * (double)w);
                h = (int)(nd * (double)h);
                switch(p_config->rotate_type) {
@@ -799,13 +788,13 @@ void Ui_MainWindowBase::setupUi(void)
                }
        }
        graphicsView->setFixedSize(w, h);
-       connect(this, SIGNAL(sig_screen_multiply(float)), graphicsView, SLOT(do_set_screen_multiply(float)), Qt::QueuedConnection);
+       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);
        {
-               float nd = getScreenMultiply(p_config->window_mode);
+               double nd = getScreenMultiply(p_config->window_mode);
                if(nd > 0.0f) {
                        graphicsView->do_set_screen_multiply(nd);
                }
index 55000bb..b611d10 100644 (file)
@@ -59,6 +59,8 @@ Menu_MetaClass::Menu_MetaClass(QMenuBar *root_entry, QString desc, USING_FLAGS *
        icon_write_enabled = QIcon();
        setToolTipsVisible(true);
 
+       connect(this, SIGNAL(sig_emu_update_config()), p_wid, SLOT(do_emu_update_config()));
+       
        tmps = QString::fromUtf8("%1").arg(drv + base_drv);
        tmps = desc + tmps;
        setTitle(tmps);
@@ -91,29 +93,45 @@ void Menu_MetaClass::do_set_initialize_directory(const char *s)
        initial_dir = QString::fromLocal8Bit(s);
 }
 
-void Menu_MetaClass::do_open_media(int drv, QString name) {
+void Menu_MetaClass::do_open_media(int drv, QString name)
+{
        //write_protect = false; // Right? On D88, May be writing entry  exists. 
        emit sig_open_media(drv, name);
 }
 
-void Menu_MetaClass::do_insert_media(void) {
+void Menu_MetaClass::do_insert_media(void)
+{
        //write_protect = false; // Right? On D88, May be writing entry  exists. 
        emit sig_insert_media(media_drive);
 }
-void Menu_MetaClass::do_eject_media(void) {
+
+void Menu_MetaClass::do_eject_media(void)
+{
        write_protect = false;
        emit sig_eject_media(media_drive);
 }
 
-void Menu_MetaClass::do_open_inner_media(int drv, int s_num) {
-       emit sig_set_inner_slot(media_drive, s_num);
+void Menu_MetaClass::do_open_inner_media(void)
+{
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       struct CSP_Ui_Menu::DriveIndexPair tmp = cp->data().value<CSP_Ui_Menu::DriveIndexPair>();
+       
+       emit sig_set_inner_slot(tmp.drive, tmp.index);
 }
 
-void Menu_MetaClass::do_open_recent_media(int drv, int s_num){
+void Menu_MetaClass::do_open_recent_media(void)
+{
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       struct CSP_Ui_Menu::DriveIndexPair tmp = cp->data().value<CSP_Ui_Menu::DriveIndexPair>();
+       
   //   write_protect = false; // Right? On D88, May be writing entry  exists. 
-       emit sig_set_recent_media(media_drive, s_num);
+       emit sig_set_recent_media(tmp.drive, tmp.index);
 }
-void Menu_MetaClass::do_write_protect_media(void) {
+
+void Menu_MetaClass::do_write_protect_media(void)
+{
        write_protect = true;
        {
                if(use_write_protect) {
@@ -198,7 +216,7 @@ void Menu_MetaClass::do_open_dialog()
        dlg.setWindowTitle(tmps);
        
        QObject::connect(&dlg, SIGNAL(fileSelected(QString)), dlg.param, SLOT(_open_disk(QString))); 
-       QObject::connect(dlg.param, SIGNAL(do_open_disk(int, QString)), this, SLOT(do_open_media(int, QString)));
+       QObject::connect(dlg.param, SIGNAL(sig_open_disk(int, QString)), this, SLOT(do_open_media(int, QString)));
 
        dlg.show();
        dlg.exec();
@@ -257,13 +275,27 @@ void Menu_MetaClass::create_pulldown_menu_sub(void)
 {
        action_insert = new Action_Control(p_wid, using_flags);
        action_insert->setObjectName(QString::fromUtf8("action_insert_") + object_desc);
-       action_insert->binds->setDrive(media_drive);
+       
+       struct CSP_Ui_Menu::DriveIndexPair tmp;
+       QVariant _tmp_ins;
+       
+       tmp.drive = media_drive;
+       tmp.index = 0;
+       _tmp_ins.setValue(tmp);
+       action_insert->setData(_tmp_ins);
+       
        connect(action_insert, SIGNAL(triggered()), this, SLOT(do_open_dialog()));
        action_insert->setIcon(icon_insert);
        
        action_eject = new Action_Control(p_wid, using_flags);
        action_eject->setObjectName(QString::fromUtf8("action_eject_") + object_desc);
-       action_eject->binds->setDrive(media_drive);
+
+       QVariant _tmp_eject;
+       tmp.drive = media_drive;
+       tmp.index = 0;
+       _tmp_eject.setValue(tmp);
+       action_eject->setData(_tmp_eject);
+
        connect(action_eject, SIGNAL(triggered()), this, SLOT(do_eject_media()));
        action_eject->setIcon(icon_eject);
 
@@ -277,10 +309,13 @@ void Menu_MetaClass::create_pulldown_menu_sub(void)
                for(ii = 0; ii < MAX_HISTORY; ii++) {
                        tmps = history.value(ii, "");
                        action_recent_list[ii] = new Action_Control(p_wid, using_flags);
-                       struct CSP_Ui_Menu::DriveIndexPair tmp;
-                       tmp.drive = media_drive;
-                       tmp.index = ii;
-                       action_recent_list[ii]->setData(QVariant(tmp));
+                       struct CSP_Ui_Menu::DriveIndexPair tmp2;
+                       tmp2.drive = media_drive;
+                       tmp2.index = ii;
+                       QVariant _tmp2v;
+                       _tmp2v.setValue(tmp2);
+                       
+                       action_recent_list[ii]->setData(_tmp2v);
                        action_recent_list[ii]->setText(tmps);
                        
                        action_group_recent->addAction(action_recent_list[ii]);
@@ -300,10 +335,12 @@ void Menu_MetaClass::create_pulldown_menu_sub(void)
                for(ii = 0; ii < using_flags->get_max_d88_banks(); ii++) {
                        tmps = history.value(ii, "");
                        action_select_media_list[ii] = new Action_Control(p_wid, using_flags);
-                       struct CSP_Ui_Menu::DriveIndexPair tmp;
-                       tmp.drive = media_drive;
-                       tmp.index = ii;
-                       action_select_media_list[ii]->setData(tmp);
+                       struct CSP_Ui_Menu::DriveIndexPair tmp2;
+                       tmp2.drive = media_drive;
+                       tmp2.index = ii;
+                       QVariant _tmp2v;
+                       _tmp2v.setValue(tmp2);
+                       action_select_media_list[ii]->setData(_tmp2v);
                        
                        action_select_media_list[ii]->setText(tmps);
                        action_select_media_list[ii]->setCheckable(true);
@@ -410,16 +447,12 @@ void Menu_MetaClass::create_pulldown_menu(void)
        
        for(ii = 0; ii < MAX_HISTORY; ii++) {
                connect(action_recent_list[ii], SIGNAL(triggered()),
-                               action_recent_list[ii]->binds, SLOT(on_recent_disk()));
-               connect(action_recent_list[ii]->binds, SIGNAL(set_recent_disk(int, int)),
-                               this, SLOT(do_open_recent_media(int, int)));
+                               this, SLOT(do_open_recent_media()));
        }
        if(use_d88_menus) {
                for(ii = 0; ii < using_flags->get_max_d88_banks(); ii++) {
                        connect(action_select_media_list[ii], SIGNAL(triggered()),
-                                       action_select_media_list[ii]->binds, SLOT(on_d88_slot()));
-                       connect(action_select_media_list[ii]->binds, SIGNAL(set_d88_slot(int, int)),
-                                       this, SLOT(do_open_inner_media(int, int)));
+                                       this, SLOT(do_open_inner_media()));
                }
        }
 }
index 9caf754..bf14e79 100644 (file)
@@ -12,6 +12,7 @@
 #include <QStringList>
 #include <QMenu>
 #include <QIcon>
+#include <QVariant>
 
 #include "common.h"
 #include "config.h"
@@ -27,13 +28,13 @@ class USING_FLAGS;
 class Action_Control;
 
 namespace CSP_Ui_Menu {
-       struct DriveIndex_pair {
+       struct DriveIndexPair {
                int drive;
                int index;
        };
 }
 
-Q_DECLARE_METATYPE(CSP_Ui_Menu::DriveIndex_pair)
+Q_DECLARE_METATYPE(CSP_Ui_Menu::DriveIndexPair)
 
 class DLL_PREFIX Menu_MetaClass : public QMenu {
        Q_OBJECT
@@ -108,8 +109,8 @@ public slots:
        void do_open_media(int drv, QString name);
        void do_insert_media(void);
        void do_eject_media(void);
-       void do_open_inner_media(int drv, int s_num);
-       void do_open_recent_media(int drv, int s_num);
+       void do_open_inner_media(void);
+       void do_open_recent_media(void);
        void do_write_protect_media(void);
        void do_write_unprotect_media(void);
        void do_add_media_extension(QString ext, QString description);
@@ -132,6 +133,7 @@ signals:
                                                        QStringList lst, int num, bool use_d88_menus);
        int sig_update_inner_bubble(int drv, QStringList base, class Action_Control **action_select_media_list,
                                                                QStringList lst, int num, bool use_d88_menus);
+       int sig_emu_update_config();
 
 };
 QT_END_NAMESPACE
index 419269a..49cbeb7 100644 (file)
 #include "qt_gldraw.h"
 #include "menu_flags.h"
 
-//extern USING_FLAGS *using_flags;
-// WIP: Move another header.
-void Object_Menu_Control::set_screen_aspect(void) {
-       int num = getValue1();
-       emit sig_screen_aspect(num);
-}
-
-void Object_Menu_Control::do_set_screen_rotate(void) {
-       int num = getValue1();
-       emit sig_screen_rotate(num);
-}
+void Ui_MainWindowBase::do_set_screen_size(void)
+{
 
-void Object_Menu_Control::set_screen_size(void) {
+       if(using_flags == nullptr) return;
+       if(p_config == nullptr) return;
+       
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       int __n = cp->data().value<int>();
+       
        int w, h;
-       float nd, ww, hh;
-       float xzoom = using_flags->get_screen_x_zoom();
-       float yzoom = using_flags->get_screen_y_zoom();
-       p_config->window_mode = getNumber();
-       nd = getDoubleValue();
-       ww = (float)using_flags->get_screen_width();
-       hh = (float)using_flags->get_screen_height();
+       double ww, hh;
+       double xzoom = using_flags->get_screen_x_zoom();
+       double yzoom = using_flags->get_screen_y_zoom();
+       p_config->window_mode = __n;
+       double nd = getScreenMultiply(__n);
+       
+       ww = (double)using_flags->get_screen_width();
+       hh = (double)using_flags->get_screen_height();
        if((using_flags->get_screen_height_aspect() != using_flags->get_screen_height()) ||
           (using_flags->get_screen_width_aspect() != using_flags->get_screen_width())) {
-               float par_w = (float)using_flags->get_screen_width_aspect() / ww;
-               float par_h = (float)using_flags->get_screen_height_aspect() / hh;
+               double par_w = (double)using_flags->get_screen_width_aspect() / ww;
+               double par_h = (double)using_flags->get_screen_height_aspect() / hh;
                //float par = par_h / par_w;
                switch(p_config->window_stretch_type) {
                case 0: // refer to X and Y.
@@ -68,7 +66,7 @@ void Object_Menu_Control::set_screen_size(void) {
        }
        w = (int)ww;
        h = (int)hh;
-       emit sig_screen_size(w, h);
+       set_screen_size(w, h);
        emit sig_screen_multiply(nd);
 }
 
@@ -113,7 +111,10 @@ void Ui_MainWindowBase::ConfigScreenMenu_List(void)
 {
        int w, h;
        QString tmps;
-       int i;
+       
+       for(int i = 0; i < (sizeof(actionScreenSize) / sizeof(Action_Control *)); i++) {
+               actionScreenSize[i] = nullptr;
+       }
        
        actionGroup_ScreenSize = new QActionGroup(this);
        actionGroup_ScreenSize->setExclusive(true);
@@ -122,7 +123,7 @@ void Ui_MainWindowBase::ConfigScreenMenu_List(void)
        double _iimul = 1.0;
        double _zmul = using_flags->get_custom_screen_zoom_factor();
        double _mul = getScreenMultiply(ix);
-       for(i = 0; i < using_flags->get_screen_mode_num();i++) {
+       for(int i = 0; i < using_flags->get_screen_mode_num();i++) {
                double _ymul = _zmul * _iimul;
                _ymul = _zmul *  _iimul;
                if((_mul == 0.5) && (i > 0) && (_zmul > 0.0)) {
@@ -157,21 +158,13 @@ void Ui_MainWindowBase::ConfigScreenMenu_List(void)
                actionScreenSize[i] = new Action_Control(this, using_flags);
                actionScreenSize[i]->setObjectName(QString::fromUtf8("actionScreenSize", -1) + tmps);
                actionScreenSize[i]->setCheckable(true);
-               actionScreenSize[i]->binds->setNumber(i);
 
                if(i == p_config->window_mode)  actionScreenSize[i]->setChecked(true);  // OK?
 
                actionGroup_ScreenSize->addAction(actionScreenSize[i]);
-               actionScreenSize[i]->binds->setDoubleValue(_mul);
+               actionScreenSize[i]->setData(QVariant(i));
                
-               connect(actionScreenSize[i], SIGNAL(triggered()),
-                       actionScreenSize[i]->binds, SLOT(set_screen_size()));
-
-               connect(actionScreenSize[i]->binds, SIGNAL(sig_screen_size(int, int)),
-                       this, SLOT(set_screen_size(int, int)));
-       }
-       for(; i < using_flags->get_screen_mode_num(); i++) {
-               actionScreenSize[i] = NULL;
+               connect(actionScreenSize[i], SIGNAL(triggered()), this, SLOT(do_set_screen_size()));
        }
 }
 void Ui_MainWindowBase::ConfigScreenMenu(void)
@@ -230,11 +223,10 @@ void Ui_MainWindowBase::ConfigScreenMenu(void)
                actionRotate[i] = new Action_Control(this, using_flags);
                actionRotate[i]->setObjectName(QString::fromUtf8("actionRotate") + QString("%1").arg(i));
                actionRotate[i]->setCheckable(true);
-               actionRotate[i]->binds->setValue1(i);
+               actionRotate[i]->setData(QVariant(i));
                actionGroup_RotateType->addAction(actionRotate[i]);
                if(p_config->rotate_type == i) actionRotate[i]->setChecked(true);
-               connect(actionRotate[i], SIGNAL(triggered()), actionRotate[i]->binds, SLOT(do_set_screen_rotate()));
-               connect(actionRotate[i]->binds, SIGNAL(sig_screen_rotate(int)), this, SLOT(do_set_screen_rotate(int)));
+               connect(actionRotate[i], SIGNAL(triggered()), this, SLOT(do_set_screen_rotate()));
        }
 
        actionOpenGL_Filter = new Action_Control(this, using_flags);
@@ -250,24 +242,24 @@ void Ui_MainWindowBase::ConfigScreenMenu(void)
                actionDot_by_Dot->setObjectName(QString::fromUtf8("actionDot_by_Dot"));
                actionDot_by_Dot->setCheckable(true);
                if(p_config->window_stretch_type == 0) actionDot_by_Dot->setChecked(true);
-               actionDot_by_Dot->binds->setValue1(0);
+               actionDot_by_Dot->setData(QVariant((int)0));
                
                actionReferToX_Display = new Action_Control(this, using_flags);
                actionReferToX_Display->setObjectName(QString::fromUtf8("actionReferToX_Display"));
                actionReferToX_Display->setCheckable(true);
-               actionReferToX_Display->binds->setValue1(1);
+               actionReferToX_Display->setData(QVariant((int)1));
                if(p_config->window_stretch_type == 1) actionReferToX_Display->setChecked(true);
                
                actionReferToY_Display = new Action_Control(this, using_flags);
                actionReferToY_Display->setObjectName(QString::fromUtf8("actionReferToY_Display"));
                actionReferToY_Display->setCheckable(true);
-               actionReferToY_Display->binds->setValue1(2);
+               actionReferToY_Display->setData(QVariant((int)2));
                if(p_config->window_stretch_type == 2) actionReferToY_Display->setChecked(true);
        
                actionFill_Display = new Action_Control(this, using_flags);
                actionFill_Display->setObjectName(QString::fromUtf8("actionFill_Display"));
                actionFill_Display->setCheckable(true);
-               actionFill_Display->binds->setValue1(3);
+               actionFill_Display->setData(QVariant((int)3));
                if(p_config->window_stretch_type == 3) actionFill_Display->setChecked(true);
        
                actionGroup_Stretch = new QActionGroup(this);
@@ -276,17 +268,10 @@ void Ui_MainWindowBase::ConfigScreenMenu(void)
                actionGroup_Stretch->addAction(actionReferToX_Display);
                actionGroup_Stretch->addAction(actionReferToY_Display);
                actionGroup_Stretch->addAction(actionFill_Display);
-               connect(actionDot_by_Dot,   SIGNAL(triggered()), actionDot_by_Dot->binds,   SLOT(set_screen_aspect()));
-               connect(actionDot_by_Dot->binds,   SIGNAL(sig_screen_aspect(int)), this,    SLOT(set_screen_aspect(int)));
-               
-               connect(actionReferToX_Display,  SIGNAL(triggered()), actionReferToX_Display->binds,  SLOT(set_screen_aspect()));
-               connect(actionReferToX_Display->binds,  SIGNAL(sig_screen_aspect(int)), this,    SLOT(set_screen_aspect(int)));
-               
-               connect(actionReferToY_Display,  SIGNAL(triggered()), actionReferToY_Display->binds,  SLOT(set_screen_aspect()));
-               connect(actionReferToY_Display->binds,  SIGNAL(sig_screen_aspect(int)), this,    SLOT(set_screen_aspect(int)));
-               
-               connect(actionFill_Display, SIGNAL(triggered()), actionFill_Display->binds, SLOT(set_screen_aspect()));
-               connect(actionFill_Display->binds, SIGNAL(sig_screen_aspect(int)), this, SLOT(set_screen_aspect(int)));
+               connect(actionDot_by_Dot,   SIGNAL(triggered()), this, SLOT(do_set_screen_aspect()));
+               connect(actionReferToX_Display,  SIGNAL(triggered()), this, SLOT(do_set_screen_aspect()));
+               connect(actionReferToY_Display,  SIGNAL(triggered()), this, SLOT(do_set_screen_aspect()));
+               connect(actionFill_Display, SIGNAL(triggered()), this, SLOT(do_set_screen_aspect()));
        }
        actionCapture_Screen = new Action_Control(this, using_flags);
        actionCapture_Screen->setObjectName(QString::fromUtf8("actionCapture_Screen"));
@@ -313,7 +298,7 @@ void Ui_MainWindowBase::ConfigScreenMenu(void)
                        action_SetRenderMode[i]->setCheckable(true);
                        action_SetRenderMode[i]->setEnabled(false);
                        action_SetRenderMode[i]->setVisible(false);
-                       action_SetRenderMode[i]->binds->setValue1(i);
+                       action_SetRenderMode[i]->setData(QVariant(i));
                        
                        if(i == p_config->rendering_type) action_SetRenderMode[i]->setChecked(true);
                        if(i == CONFIG_RENDER_TYPE_STD) {
@@ -475,9 +460,9 @@ void Ui_MainWindowBase::retranslateScreenMenu(void)
        double s_mul;
        for(i = 0; i < using_flags->get_screen_mode_num(); i++) {
                if(actionScreenSize[i] == NULL) continue;
-               s_mul = actionScreenSize[i]->binds->getDoubleValue();
-;
-               if(s_mul <= 0) break;
+               s_mul = getScreenMultiply(actionScreenSize[i]->data().value<int>());
+               if(s_mul <= 0.0f) break;
+               
                tmps = QString::number(s_mul);
                tmps = QString::fromUtf8("x", -1) + tmps;
                actionScreenSize[i]->setText(tmps);
index 3ee658b..944ec0f 100644 (file)
 const double s_late_table[5] = {0.05, 0.1, 0.2, 0.3, 0.4};
 extern USING_FLAGS *using_flags;
 
-void Object_Menu_Control::on_set_freq(void) {
-   emit sig_freq(s_num);
-}
-
-void Object_Menu_Control::on_set_latency(void) {
-   emit sig_latency(s_num);
-}
-
-void Object_Menu_Control::on_set_host_sound_device(void) {
-   emit sig_set_host_sound_device(s_num);
-}
 
-void Ui_MainWindowBase::do_set_host_sound_device(int num)
+void Ui_MainWindowBase::do_set_host_sound_device(void)
 {
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       int num = cp->data().value<int>();
+       
        if(p_config != NULL) {
                p_config->sound_device_num = num;
        }
@@ -137,9 +130,7 @@ void Ui_MainWindowBase::CreateSoundMenu(void)
                if(action_HostSoundDevice[i] != NULL) {
                        menuSound_HostDevices->addAction(action_HostSoundDevice[i]);
                        connect(action_HostSoundDevice[i], SIGNAL(triggered()),
-                                       action_HostSoundDevice[i]->binds, SLOT(on_set_host_sound_device()));
-                       connect(action_HostSoundDevice[i]->binds, SIGNAL(sig_set_host_sound_device(int)),
-                                       this, SLOT(do_set_host_sound_device(int)));
+                                       this, SLOT(do_set_host_sound_device()));
                }
        }
        
@@ -151,9 +142,7 @@ void Ui_MainWindowBase::CreateSoundMenu(void)
        for(i = 0; i < 8; i++) {
                menuOutput_Frequency->addAction(action_Freq[i]);
                connect(action_Freq[i], SIGNAL(triggered()),
-                       action_Freq[i]->binds, SLOT(on_set_freq()));
-               connect(action_Freq[i]->binds, SIGNAL(sig_freq(int)),
-                       this, SLOT(set_freq(int)));
+                       this, SLOT(do_set_freq()));
        }
        menuSound_Latency = new QMenu(menuSound);
        menuSound_Latency->setObjectName(QString::fromUtf8("menuSound_Latency"));
@@ -161,9 +150,7 @@ void Ui_MainWindowBase::CreateSoundMenu(void)
        for(i = 0; i < 5; i++) {
                menuSound_Latency->addAction(action_Latency[i]);
                connect(action_Latency[i], SIGNAL(triggered()),
-                       action_Latency[i]->binds, SLOT(on_set_latency()));
-               connect(action_Latency[i]->binds, SIGNAL(sig_latency(int)),
-                       this, SLOT(set_latency(int)));
+                       this, SLOT(do_set_latency()));
        }
 
        menuSound->addSeparator();
@@ -197,7 +184,7 @@ void Ui_MainWindowBase::ConfigSoundMenu(void)
           
                action_HostSoundDevice[i]->setObjectName(tmps);
                action_HostSoundDevice[i]->setCheckable(true);
-               action_HostSoundDevice[i]->binds->setNumber(i);
+               action_HostSoundDevice[i]->setData(QVariant(i));
                if(i == p_config->sound_device_num) {
                        action_HostSoundDevice[i]->setChecked(true);
                        //freq = using_flags->get_s_freq_table(i);
@@ -209,11 +196,12 @@ void Ui_MainWindowBase::ConfigSoundMenu(void)
        actionGroup_Sound_Freq->setExclusive(true);
        for(i = 0; i < 8; i++) {
                action_Freq[i] = new Action_Control(this, using_flags);
-               tmps.setNum(using_flags->get_s_freq_table(i));
+               int _freq = using_flags->get_s_freq_table(i);
+               tmps.setNum(_freq);
                tmps = QString::fromUtf8("action") + tmps + QString::fromUtf8("Hz");
                action_Freq[i]->setObjectName(tmps);
                action_Freq[i]->setCheckable(true);
-               action_Freq[i]->binds->setNumber(i);
+               action_Freq[i]->setData(QVariant(i));
                if(i == p_config->sound_frequency) {
                        action_Freq[i]->setChecked(true);
                        //freq = using_flags->get_s_freq_table(i);
@@ -227,11 +215,11 @@ void Ui_MainWindowBase::ConfigSoundMenu(void)
                action_Latency[i] = new Action_Control(this, using_flags);
                dval = s_late_table[i];
                dval = dval * 1000.0;
-               tmps.setNum((int)dval);
+               tmps.setNum(dval);
                tmps = QString::fromUtf8("action") + tmps + QString::fromUtf8("ms");
                action_Latency[i]->setObjectName(tmps);
                action_Latency[i]->setCheckable(true);
-               action_Latency[i]->binds->setNumber(i);
+               action_Latency[i]->setData(QVariant(i));
                if(i == p_config->sound_latency) action_Latency[i]->setChecked(true);
                actionGroup_Sound_Latency->addAction(action_Latency[i]);
        }
index b8867f9..8fb105b 100644 (file)
@@ -24,7 +24,7 @@ void CSP_DiskParams::_open_disk(QString s)
        int d = getDrive();
        //int n = d + CSP_LOG_TYPE_VFILE_FLOPPY;
        //csp_logger->debug_log(CSP_LOG_INFO, n, "Try to open media image: %s", s.toLocal8Bit().constData());
-       emit do_open_disk(d, s);
+       emit sig_open_disk(d, s);
 }
 
 void CSP_DiskParams::_open_cart(QString s)
@@ -34,13 +34,20 @@ void CSP_DiskParams::_open_cart(QString s)
 }
 void CSP_DiskParams::_open_cmt(QString s)
 {
-       emit do_open_cmt(play, s);
+       emit sig_open_cmt(play, s);
 }
 
 void CSP_DiskParams::_open_binary(QString s) {
        emit sig_open_binary_file(drive, s, play);
 }
 
+void CSP_DiskParams::_open_quick_disk(QString s)
+{
+       int d = getDrive();
+       //int n = d + CSP_LOG_TYPE_VFILE_FLOPPY;
+       //csp_logger->debug_log(CSP_LOG_INFO, n, "Try to open media image: %s", s.toLocal8Bit().constData());
+       emit sig_open_quick_disk(d, s);
+}
 
 CSP_CreateDiskDialog::CSP_CreateDiskDialog(bool *masks, QWidget *parent) : QWidget(parent)
 {
index f4099b5..cc45d71 100644 (file)
@@ -42,15 +42,15 @@ public:
                return 0;
        }
 signals:
-       int do_open_disk(int, QString);
-       int do_close_disk(int);
+       int sig_open_disk(int, QString);
+       int sig_close_disk(int);
        int sig_open_cart(int, QString);
-       int do_close_cart(int);
-       int do_open_cmt(bool, QString);
-       int do_close_cmt();
+       int sig_close_cart(int);
+       int sig_open_cmt(bool, QString);
+       int sig_close_cmt();
        int sig_open_binary_file(int, QString, bool);
-       int do_open_quick_disk(int, QString);
-       public slots:
+       int sig_open_quick_disk(int, QString);
+public slots:
        void _open_disk(const QString fname);
        void _open_cart(const QString fname);
        void _open_cmt(const QString fname);
index 990a22d..8d3ad00 100644 (file)
@@ -145,6 +145,7 @@ public slots:
        void do_set_horiz_lines(int lines);
        
        void do_set_screen_multiply(float mul);
+       void do_set_screen_multiply(double mul);
        void do_update_keyboard_scan_code(uint32_t vk, uint32_t scan);
        void do_set_mouse_enabled(bool flag);
        void do_stop_run_vm();
@@ -156,7 +157,7 @@ public slots:
        void do_set_led_width(int bitwidth);
        void do_update_icon(int icon_type,  int localnum, QPixmap *p);
        void do_update_icon(int icon_type, int localnum, QString message, QColor bg, QColor fg, QColor fg2, QColor fg3, QColor lg, QColor tg, float pt);
-
+       virtual void do_set_fixed_size(int w, int h) { setFixedSize(w, h); }
 signals:
        void update_screenChanged(int tick);
        void sig_notify_move_mouse(double x, double y, double globalx, double globaly);
@@ -164,7 +165,7 @@ signals:
        void sig_toggle_mouse(void);
        void do_notify_button_pressed(Qt::MouseButton button);
        void do_notify_button_released(Qt::MouseButton button);
-       void sig_check_grab_mouse(bool);
+       void sig_toggle_grab_mouse();
        void sig_resize_uibar(int, int);
        void sig_draw_timing(void);
        int sig_finished(void);
index 5423580..5215b3a 100644 (file)
@@ -133,7 +133,7 @@ void GLDrawClass::mousePressEvent(QMouseEvent *event)
 {
        if(using_flags->is_use_one_board_computer() || using_flags->is_use_mouse() || (using_flags->get_max_button() > 0)) {
                if(event->button() == Qt::MiddleButton) {
-                       emit sig_check_grab_mouse(true);
+                       emit sig_toggle_grab_mouse();
                        return;
                }
                if(!enable_mouse) return;
@@ -188,6 +188,11 @@ void GLDrawClass::do_set_screen_multiply(float mul)
        if(extfunc != NULL) extfunc->do_set_screen_multiply(mul);
 }
 
+void GLDrawClass::do_set_screen_multiply(double mul)
+{
+       if(extfunc != NULL) extfunc->do_set_screen_multiply((float)mul);
+}
+
 void GLDrawClass::do_set_texture_size(QImage *p, int w, int h)
 {
        vram_width = w;
index 6c72c77..8abfcdf 100644 (file)
 #include "mainwidget_base.h"
 #include "commonclasses.h"
 #include "qt_dialogs.h"
+
 //#include "csp_logger.h"
 
 #include "menu_binary.h"
 
-void Object_Menu_Control::on_recent_binary_load(void){
-       //   write_protect = false; // Right? On D88, May be writing entry  exists. 
-       emit set_recent_binary_load(drive, s_num);
-}
-void Object_Menu_Control::on_recent_binary_save(void){
-       //   write_protect = false; // Right? On D88, May be writing entry  exists. 
-       emit set_recent_binary_save(drive, s_num);
-}
-
-void Object_Menu_Control::_open_binary(QString s){
-       bool load = this->isPlay();
-       int d = this->getDrive();
-       emit sig_open_binary_file(d, s, load);
-}
-void Object_Menu_Control::insert_binary_load(void) {
-       emit sig_open_binary(getDrive(), true);
-}
-void Object_Menu_Control::insert_binary_save(void) {
-       emit sig_open_binary(getDrive(), false);
-}
-
 int Ui_MainWindowBase::set_recent_binary_load(void) 
 {
 
@@ -45,10 +25,10 @@ int Ui_MainWindowBase::set_recent_binary_load(void)
        char path_shadow[PATH_MAX];
        
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
-       if(cp == nullptr) return;
-       struct CSP_Ui_Menu::DriveIndexPair tmp = cp->value<CSP_Ui_Menu::DriveIndexPair>();
-       drv = tmp.drive;
-       num = tmp.index;
+       if(cp == nullptr) return -1;
+       struct CSP_Ui_Menu::DriveIndexPair tmp = cp->data().value<CSP_Ui_Menu::DriveIndexPair>();
+       int drv = tmp.drive;
+       int num = tmp.index;
        
        if((num < 0) || (num >= MAX_HISTORY)) return -1;
        
@@ -72,10 +52,10 @@ int Ui_MainWindowBase::set_recent_binary_save(void)
        char path_shadow[PATH_MAX];
        
        QAction *cp = qobject_cast<QAction*>(QObject::sender());
-       if(cp == nullptr) return;
-       struct CSP_Ui_Menu::DriveIndexPair tmp = cp->value<CSP_Ui_Menu::DriveIndexPair>();
-       drv = tmp.drive;
-       num = tmp.index;
+       if(cp == nullptr) return -1;
+       struct CSP_Ui_Menu::DriveIndexPair tmp = cp->data().value<CSP_Ui_Menu::DriveIndexPair>();
+       int drv = tmp.drive;
+       int num = tmp.index;
        
        if((num < 0) || (num >= MAX_HISTORY)) return -1;
        
index 699abe8..4160a81 100644 (file)
 #include "qt_dialogs.h"
 //#include "csp_logger.h"
 
-void Object_Menu_Control::insert_bubble(void) {
-       emit sig_insert_bubble(getDrive());
-}
-void Object_Menu_Control::eject_bubble(void) {
-       write_protect = false;
-       emit sig_eject_bubble(getDrive());
-}
-void Object_Menu_Control::on_b77_slot(void) {
-       emit set_b77_slot(drive, s_num);
-}
-void Object_Menu_Control::on_recent_bubble(void){
-       emit set_recent_bubble(drive, s_num);
-}
-void Object_Menu_Control::write_protect_bubble(void) {
-       write_protect = true;
-       emit sig_write_protect_bubble(drive, write_protect);
-}
-void Object_Menu_Control::no_write_protect_bubble(void) {
-       write_protect = false;
-       emit sig_write_protect_bubble(drive, write_protect);
-}
-
-
-
 int Ui_MainWindowBase::write_protect_bubble(int drv, bool flag)
 {
        if((drv < 0) || (drv >= using_flags->get_max_bubble())) return -1;
index 87ae247..3a98cf4 100644 (file)
 #include "qt_dialogs.h"
 //#include "csp_logger.h"
 
-void Object_Menu_Control::insert_cart(void) {
-       emit sig_insert_cart(getDrive());
-}
-void Object_Menu_Control::eject_cart(void) {
-       write_protect = false;
-       emit sig_eject_cart(getDrive());
-}
-void Object_Menu_Control::on_recent_cart(void){
-       emit set_recent_cart(drive, s_num);
-}
-
 void Ui_MainWindowBase::_open_cart(int drv, const QString fname)
 {
        char path_shadow[PATH_MAX];
index e767769..2744530 100644 (file)
 //extern USING_FLAGS *using_flags;
 //extern class EMU *emu;
 
-void Object_Menu_Control::insert_fd(void) {
-       emit sig_insert_fd(getDrive());
-}
-void Object_Menu_Control::eject_fd(void) {
-       write_protect = false;
-       emit sig_eject_fd(getDrive());
-}
-void Object_Menu_Control::on_d88_slot(void) {
-       emit set_d88_slot(drive, s_num);
-}
-void Object_Menu_Control::on_recent_disk(void){
-  //   write_protect = false; // Right? On D88, May be writing entry  exists. 
-       emit set_recent_disk(drive, s_num);
-}
-void Object_Menu_Control::write_protect_fd(void) {
-       write_protect = true;
-       emit sig_write_protect_fd(drive, write_protect);
-}
-void Object_Menu_Control::no_write_protect_fd(void) {
-       write_protect = false;
-       emit sig_write_protect_fd(drive, write_protect);
-}
-
-void Object_Menu_Control::do_set_ignore_crc_error(bool flag)
-{
-       p_config->ignore_disk_crc[drive] = flag;
-       emit sig_emu_update_config();
-}
-
-void Object_Menu_Control::do_set_correct_disk_timing(bool flag)
-{
-       p_config->correct_disk_timing[drive] = flag;
-       emit sig_emu_update_config();
-}
-
-void Object_Menu_Control::do_set_disk_count_immediate(bool flag)
-{
-       p_config->disk_count_immediate[drive] = flag;
-       emit sig_emu_update_config();
-}
-
 
 int Ui_MainWindowBase::write_protect_fd(int drv, bool flag)
 {
index f1e2bc7..29ccbe4 100644 (file)
 #include "menu_laserdisc.h"
 
 
-void Object_Menu_Control::insert_laserdisc(void) {
-       //AGAR_DebugLog(AGAR_LOG_DEBUG, "%d", play);
-       emit sig_insert_laserdisc(play);
-}
-void Object_Menu_Control::eject_laserdisc(void) {
-       emit sig_eject_laserdisc();
-}
-void Object_Menu_Control::on_recent_laserdisc(){
-       emit sig_recent_laserdisc(s_num);
-}
-
 void Ui_MainWindowBase::CreateLaserdiscMenu(int drv, int drv_base)
 {
        QString ext_play, desc_play;
index 83b9e83..8fbba80 100644 (file)
 #include "csp_logger.h"
 #include "menu_quickdisk.h"
 
-void Object_Menu_Control::insert_Qd(void) {
-       //write_protect = false; // Right? On D88, May be writing entry  exists. 
-       emit sig_insert_Qd(drive);
-}
-void Object_Menu_Control::eject_Qd(void) {
-       write_protect = false;
-       emit sig_eject_Qd(drive);
-}
-void Object_Menu_Control::on_recent_quick_disk(void){
-       //   write_protect = false; // Right? On D88, May be writing entry  exists. 
-       emit set_recent_quick_disk(drive, s_num);
-}
-
-void CSP_FileParams::_open_quick_disk(QString s){
-       //   write_protect = false; // Right? On D88, May be writing entry  exists. 
-       emit do_open_quick_disk(getDrive(), s);
-}
-void Object_Menu_Control::write_protect_Qd(void) {
-       write_protect = true;
-       emit sig_write_protect_Qd(drive, write_protect);
-}
-void Object_Menu_Control::no_write_protect_Qd(void) {
-       write_protect = false;
-       emit sig_write_protect_Qd(drive, write_protect);
-}
 
 void Ui_MainWindowBase::CreateQuickDiskPulldownMenu(int drv)
 {
index 76c33c4..223f3e5 100644 (file)
 #include "menu_disk.h"
 //QT_BEGIN_NAMESPACE
 
-extern config_t config;
-
-Object_Menu_Control_7::Object_Menu_Control_7(QObject *parent, USING_FLAGS *p) : Object_Menu_Control(parent, p)
-{
-}
-
-Object_Menu_Control_7::~Object_Menu_Control_7()
-{
-}
-
-void Object_Menu_Control_7::do_set_z80card_on(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_Z80CARD_ON;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_Z80CARD_ON;
-       }
-}
-
-void Object_Menu_Control_7::do_set_z80_irq(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_Z80_IRQ_ON;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_Z80_IRQ_ON;
-       }
-       emit sig_emu_update_config();
-}
-
-void Object_Menu_Control_7::do_set_z80_firq(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_Z80_FIRQ_ON;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_Z80_FIRQ_ON;
-       }
-       emit sig_emu_update_config();
-}
-
-void Object_Menu_Control_7::do_set_z80_nmi(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_Z80_NMI_ON;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_Z80_NMI_ON;
-       }
-       emit sig_emu_update_config();
-}
-
-void Object_Menu_Control_7::do_set_uart(bool flag)
-{
-       uint32_t nval;
-       int num = getValue1();
-       switch(num) {
-       case 0:
-               nval = FM7_DIPSW_RS232C_ON;
-               break;
-       case 1:
-               nval = FM7_DIPSW_MODEM_ON;
-               break;
-       case 2:
-               nval = FM7_DIPSW_MIDI_ON;
-               break;
-       default:
-               return;
-               break;
-       }
-       if(flag) {
-               config.dipswitch = config.dipswitch | nval;
-       } else {
-               nval = (uint32_t)(~nval);
-               config.dipswitch = config.dipswitch & nval;
-       }
-}
-
-void Object_Menu_Control_7::do_set_jcommcard(bool flag)
+void META_MainWindow::do_set_autokey_5_8(void)
 {
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_JSUBCARD_ON;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_JSUBCARD_ON;
-       }
-}
-
-void Object_Menu_Control_7::do_set_kanji_rom(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_CONNECT_KANJIROM;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_CONNECT_KANJIROM;
-       }
-}
-
-void Object_Menu_Control_7::do_set_320kFloppy(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_CONNECT_320KFDC;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_CONNECT_320KFDC;
-       }
-}
-
-void Object_Menu_Control_7::do_set_1MFloppy(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_CONNECT_1MFDC;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_CONNECT_1MFDC;
-       }
-}
-
-
-void Object_Menu_Control_7::do_set_autokey_5_8(void)
-{
-       int val = getValue1();
+       if(p_config == nullptr) return;
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       int val = cp->data().value<int>();
+       
        switch(val) {
        case 0: // Not Auto Key:
-               config.dipswitch = config.dipswitch & ~(FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
+               p_config->dipswitch = p_config->dipswitch & ~(FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
                break;
        case 1: // Auto 5
-               config.dipswitch = config.dipswitch | (FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
+               p_config->dipswitch = p_config->dipswitch | (FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
                break;
        case 2: // Auto 8
-               config.dipswitch = (config.dipswitch | FM7_DIPSW_AUTO_5_OR_8KEY) & ~FM7_DIPSW_SELECT_5_OR_8KEY;
+               p_config->dipswitch = (p_config->dipswitch | FM7_DIPSW_AUTO_5_OR_8KEY) & ~FM7_DIPSW_SELECT_5_OR_8KEY;
                break;
        default:// Not Auto Key:
-               config.dipswitch = config.dipswitch & ~(FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
+               p_config->dipswitch = p_config->dipswitch & ~(FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
                break;
        }
 }
 
-void Object_Menu_Control_7::do_set_protect_ram(bool flag)
+void META_MainWindow::do_set_frameskip()
 {
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_FM8_PROTECT_FD0F;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_FM8_PROTECT_FD0F;
-       }
-       emit sig_emu_update_config();
-}
-
-void Object_Menu_Control_7::do_set_cyclesteal(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_CYCLESTEAL;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_CYCLESTEAL;
-       }
-       emit sig_emu_update_config();
-}
-
-void Object_Menu_Control_7::do_set_hsync(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_SYNC_TO_HSYNC;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_SYNC_TO_HSYNC;
-       }
-}
-
-void Action_Control_7::do_set_frameskip()
-{
-       config.dipswitch &= 0xcfffffff;
-       config.dipswitch |= ((fm7_binds->getValue1() & 3) << 28);
-}
+       QAction *cp = qobject_cast<QAction*>(QObject::sender());
+       if(cp == nullptr) return;
+       uint32_t nval = cp->data().value<uint32_t>();
 
-Action_Control_7::Action_Control_7(QObject *parent, USING_FLAGS *p) : Action_Control(parent, p)
-{
-       fm7_binds = new Object_Menu_Control_7(parent, p);
-       fm7_binds->setValue1(0);
-}
-
-Action_Control_7::~Action_Control_7()
-{
-       delete fm7_binds;
-}
-
-
-
-void META_MainWindow::do_set_extram(bool flag)
-{
-# if defined(_FM77AV40) || defined(_FM77AV40SX) || defined(_FM77AV40EX) || defined(_FM77AV20) || defined(_FM77_VARIANTS)
-       if(flag) {      
-               config.dipswitch |= FM7_DIPSW_EXTRAM;
-       } else {
-               config.dipswitch &= ~FM7_DIPSW_EXTRAM;
-       }
-#elif defined(_FM77AV_VARIANTS)
-       if(flag) {      
-               config.dipswitch |= FM7_DIPSW_EXTRAM_AV;
-       } else {
-               config.dipswitch &= ~FM7_DIPSW_EXTRAM_AV;
-       }
-#endif
+       if(p_config == nullptr) return;
+       p_config->dipswitch &= 0xcfffffff;
+       p_config->dipswitch |= (nval & 0x30000000);
 }
 
-#if defined(CAPABLE_DICTROM) && !defined(_FM77AV40EX) && !defined(_FM77AV40SX)
-void META_MainWindow::do_set_use_dictcard(bool flag)
-{
-       if(flag) {
-               config.dipswitch = config.dipswitch | FM7_DIPSW_DICTROM_AV;
-       } else {
-               config.dipswitch = config.dipswitch & ~FM7_DIPSW_DICTROM_AV;
-       }
-}
-#endif
-
 void META_MainWindow::retranslateVolumeLabels(Ui_SoundDialog *p)
 {
 }
@@ -294,9 +121,9 @@ void META_MainWindow::retranslateUi(void)
        actionDebugger[0]->setVisible(true);
        actionDebugger[1]->setVisible(true);
 # ifdef WITH_Z80
-       if((config.dipswitch & FM7_DIPSW_Z80CARD_ON) != 0) z80num = 2;
+       if((p_config->dipswitch & FM7_DIPSW_Z80CARD_ON) != 0) z80num = 2;
 #  ifdef CAPABLE_JCOMMCARD
-       if((config.dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) {
+       if((p_config->dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) {
                if(z80num < 0) {
                        jcommnum = 2;
                } else {
@@ -306,7 +133,7 @@ void META_MainWindow::retranslateUi(void)
 #  endif
 # else
 #  ifdef CAPABLE_JCOMMCARD
-       if((config.dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) {
+       if((p_config->dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) {
                jcommnum = 2;
        }
 #  endif
@@ -357,38 +184,39 @@ void META_MainWindow::retranslateUi(void)
 #if defined(_FM77_VARIANTS)
        actionBootMode[0]->setText(QString::fromUtf8("BASIC + S1 (BANK0)"));
        actionBootMode[0]->setToolTip(QApplication::translate("Machine", "BASIC boot mode with S1 has turned ON.\nThis is FM-77 feature and I don't know about this.", 0));
-       actionBootMode[0]->binds->setValue1(2);
+       actionBootMode[0]->setValue(QVariant((int)2));
        
        actionBootMode[4]->setText(QApplication::translate("Machine", "BASIC (BANK4)", 0));
        actionBootMode[4]->setToolTip(QApplication::translate("Machine", "Boot with F-BASIC.", 0));
-       actionBootMode[4]->binds->setValue1(0);
+       actionBootMode[4]->setValue(QVariant((int)0));
        
        actionBootMode[5]->setText(QApplication::translate("Machine", "DOS 320K(BOOT2 / BANK5)", 0));   
        actionBootMode[5]->setToolTip(QApplication::translate("Machine", "DOS boot mode.\nUse for CP/M, FLEX, OS-9, R-DOS and some OSs.", 0));
-       actionBootMode[5]->binds->setValue1(1);
+       actionBootMode[5]->setValue(QVariant((int)1));
        
        actionBootMode[6]->setText(QString::fromUtf8("1MB FD (BOOT1 / BANK6)"));
        actionBootMode[6]->setToolTip(QApplication::translate("Machine", "Boot from 1MB FD for FM-77.\n", 0));
-       actionBootMode[6]->binds->setValue1(3);
+       actionBootMode[6]->setValue(QVariant((int)3));
        
        actionBootMode[1]->setText(QString::fromUtf8("BUBBLE 128K (BOOT2 + S1 / BANK1)"));
        actionBootMode[1]->setToolTip(QApplication::translate("Machine", "Boot from 128K Bubble casette.\nThis is FM-77 feature and I don't know about this.", 0));
-       actionBootMode[1]->binds->setValue1(5);
+       actionBootMode[1]->setValue(QVariant((int)5));
        
        actionBootMode[2]->setText(QString::fromUtf8("BUBBLE 32K (BOOT1 + S1 / BANK2)"));
        actionBootMode[2]->setToolTip(QApplication::translate("Machine", "Boot from 32K Bubble casette.\nThis is FM-77 feature and I don't know about this.", 0));
-       actionBootMode[2]->binds->setValue1(6);
+       actionBootMode[2]->setValue(QVariant((int)6));
        
        actionBootMode[3]->setText(QString::fromUtf8("RESERVE 1 (BANK3)"));
        actionBootMode[3]->setToolTip(QApplication::translate("Machine", "RESERVE AREA 1\nThis is FM-77 feature and I don't know about this.", 0));
-       actionBootMode[3]->binds->setValue1(3);
+       actionBootMode[3]->setValue(QVariant((int)3));
        
        actionBootMode[7]->setText(QString::fromUtf8("RESERVE 2 (BANK7)"));
        actionBootMode[7]->setToolTip(QApplication::translate("Machine", "RESERVED AREA 2\nThis is FM-77 feature and I don't know about this.", 0));
-       actionBootMode[7]->binds->setValue1(4);
+       actionBootMode[7]->setValue(QVariant((int)4));
        
        for(int i = 0; i < 7; i++) {
-               if(actionBootMode[i]->binds->getValue1() == config.boot_mode) actionBootMode[i]->setChecked(true);
+               int _n = actionBootMode[i]->data().value<int>(); 
+               if(_n == p_config->boot_mode) actionBootMode[i]->setChecked(true);
        }
        for(int i = 0; i < 8; i++) {
                actionBootMode[i]->setVisible(true);
@@ -396,60 +224,67 @@ void META_MainWindow::retranslateUi(void)
        }
 #elif defined(_FM8)
        actionBootMode[0]->setText(QApplication::translate("Machine", "BASIC  (SM11-14 BANK0)", 0));
-       actionBootMode[0]->binds->setValue1(0);
+       actionBootMode[0]->setValue(QVariant((int)0));
+
        actionBootMode[2]->setText(QApplication::translate("Machine", "DOS    (SM11-14 BANK2)", 0));    
-       actionBootMode[2]->binds->setValue1(1);
+       actionBootMode[2]->setValue(QVariant((int)1));
+
        actionBootMode[2]->setToolTip(QApplication::translate("Machine", "DOS boot mode.\nUse for CP/M, FLEX, OS-9, R-DOS and some OSs.", 0));
        
        actionBootMode[1]->setText(QApplication::translate("Machine", "BUBBLE  (SM11-14 BANK1)", 0));
        actionBootMode[1]->setToolTip(QApplication::translate("Machine", "Boot for bubble casette.\nYou must install boot rom for this.", 0));
-       actionBootMode[1]->binds->setValue1(2);
+       actionBootMode[1]->setValue(QVariant((int)2));
        
        actionBootMode[7]->setText(QApplication::translate("Machine", "8Inch FD (SM11-15 BANK3)", 0));
        actionBootMode[7]->setToolTip(QApplication::translate("Machine", "Boot for 8inch floppy disk.\nYou must install boot rom for this.", 0));
-       actionBootMode[1]->binds->setValue1(7);
+       actionBootMode[7]->setValue(QVariant((int)7));
        
        actionBootMode[4]->setText(QApplication::translate("Machine", "BASIC    (SM11-15 BANK0)", 0));
-       actionBootMode[4]->binds->setValue1(4);
+       actionBootMode[4]->setValue(QVariant((int)4));
+
        actionBootMode[6]->setText(QApplication::translate("Machine", "DOS      (SM11-15 BANK2)", 0));
-       actionBootMode[6]->binds->setValue1(5);
+       actionBootMode[6]->setValue(QVariant((int)5));
+
        actionBootMode[4]->setToolTip(QApplication::translate("Machine", "Boot with F-BASIC.", 0));
        actionBootMode[6]->setToolTip(QApplication::translate("Machine", "DOS boot mode.\nUse for CP/M, FLEX, OS-9, R-DOS and some OSs.", 0));
        
        actionBootMode[5]->setText(QApplication::translate("Machine", "BUBBLE   (SM11-15 BANK1)", 0));
        actionBootMode[5]->setToolTip(QApplication::translate("Machine", "Boot for bubble casette.\nYou must install boot rom for this.", 0));
-       actionBootMode[5]->binds->setValue1(6);
+       actionBootMode[5]->setValue(QVariant((int)6));
+
        
        actionBootMode[3]->setText(QApplication::translate("Machine", "DEBUG    (SM11-14 BANK3)", 0));
        actionBootMode[3]->setToolTip(QApplication::translate("Machine", "Boot for DEBUG.\nThis is SM11-14's feature and I don't know about this.", 0));
-       actionBootMode[3]->binds->setValue1(3);
+       actionBootMode[3]->setValue(QVariant((int)3));
        
        for(int i = 0; i < 8; i++) {
                actionBootMode[i]->setVisible(true);
                actionBootMode[i]->setEnabled(true);
-               if(actionBootMode[i]->binds->getValue1() == config.boot_mode) actionBootMode[i]->setChecked(true);
+               int _n = actionBootMode[i]->data().value<int>(); 
+               if(_n == p_config->boot_mode) actionBootMode[i]->setChecked(true);
        }
 #elif defined(_FM7) || defined(_FMNEW7)        
        actionBootMode[0]->setText(QApplication::translate("Machine", "BASIC (BANK0)", 0));
        actionBootMode[0]->setToolTip(QApplication::translate("Machine", "Boot with F-BASIC.", 0));
-       actionBootMode[0]->binds->setValue1(0);
+       actionBootMode[0]->setData(QVariant((int)0));
        
        actionBootMode[2]->setText(QApplication::translate("Machine", "DOS (BANK2)", 0));       
        actionBootMode[2]->setToolTip(QApplication::translate("Machine", "DOS boot mode.\nUse for CP/M, FLEX, OS-9, R-DOS and some OSs.", 0));
-       actionBootMode[2]->binds->setValue1(1);
+       actionBootMode[2]->setData(QVariant((int)1));
        
        actionBootMode[1]->setText(QApplication::translate("Machine", "Bubble Casette (BANK1)", 0));
        actionBootMode[1]->setToolTip(QApplication::translate("Machine", "Boot for bubble casette.\nYou must install boot rom for this.", 0));
-       actionBootMode[1]->binds->setValue1(2);
+       actionBootMode[1]->setData(QVariant((int)2));
        
        actionBootMode[3]->setText(QApplication::translate("Machine", "Reserve (BANK3)", 0));
        actionBootMode[3]->setToolTip(QApplication::translate("Machine", "This is reserved area.\nI don't know about this.", 0));
-       actionBootMode[3]->binds->setValue1(3);
+       actionBootMode[3]->setData(QVariant((int)3));
        
        actionBootMode[2]->setVisible(true);
        actionBootMode[3]->setVisible(true);
        for(int i = 0; i < 4; i++) {
-               if(actionBootMode[i]->binds->getValue1() == config.boot_mode) actionBootMode[i]->setChecked(true);
+               int _n = actionBootMode[i]->data().value<int>(); 
+               if(_n == p_config->boot_mode) actionBootMode[i]->setChecked(true);
        }
        for(int i = 4; i < 8; i++) {
                actionBootMode[i]->setVisible(false);
@@ -462,7 +297,8 @@ void META_MainWindow::retranslateUi(void)
        
        actionBootMode[2]->setVisible(true);
        for(int i = 0; i < 2; i++) {
-               if(actionBootMode[i]->binds->getValue1() == config.boot_mode) actionBootMode[i]->setChecked(true);
+               int _n = actionBootMode[i]->data().value<int>(); 
+               if(_n == p_config->boot_mode) actionBootMode[i]->setChecked(true);
        }
        for(int i = 3; i < 8; i++) {
                actionBootMode[i]->setVisible(false);
@@ -600,7 +436,7 @@ void META_MainWindow::retranslateUi(void)
        actionUART[0]->setEnabled(false);
 #endif
 #if defined(CAPABLE_JCOMMCARD)
-       if((config.dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) {
+       if((p_config->dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) {
                actionUART[0]->setText(QApplication::translate("Machine", "Turn ON RS-232C (need restart).", 0));
                actionUART[0]->setToolTip(QApplication::translate("Machine", "Turn ON RS-232C feature for Japanese communication board.\nNeed to restart this emulator if changed.", 0));
        }
@@ -621,167 +457,201 @@ void META_MainWindow::retranslateUi(void)
 
 void META_MainWindow::setupUI_Emu(void)
 {
-       int i;
+       uint32_t i;
        uint32_t skip;
+       uint32_t _val;
+       
        menuFrameSkip = new QMenu(menuMachine);
        menuFrameSkip->setObjectName(QString::fromUtf8("menuControl_FrameSkip"));
        actionGroup_FrameSkip = new QActionGroup(this);
        actionGroup_FrameSkip->setExclusive(true);
-       skip = (config.dipswitch >> 28) & 3;
+       skip = (p_config->dipswitch >> 28) & 3;
        for(i = 0; i < 4; i++) {
-               actionFrameSkip[i] = new Action_Control_7(this, using_flags);
+               actionFrameSkip[i] = new Action_Control(this, using_flags);
                actionFrameSkip[i]->setCheckable(true);
                actionFrameSkip[i]->setVisible(true);
-               actionFrameSkip[i]->fm7_binds->setValue1(i);
+               _val = i << 28;
+               actionFrameSkip[i]->setData(QVariant(_val));
+               
                actionGroup_FrameSkip->addAction(actionFrameSkip[i]);
                menuFrameSkip->addAction(actionFrameSkip[i]);
-               if((uint32_t)i == skip) actionFrameSkip[i]->setChecked(true);
-               connect(actionFrameSkip[i], SIGNAL(triggered()), actionFrameSkip[i], SLOT(do_set_frameskip()));
+               if(i == skip) actionFrameSkip[i]->setChecked(true);
+               connect(actionFrameSkip[i], SIGNAL(triggered()),  this, SLOT(do_set_frameskip()));
        }
        menuMachine->addAction(menuFrameSkip->menuAction());
        
        ConfigCPUTypes(2);
        ConfigCPUBootMode(USE_BOOT_MODE);
 #if defined(_FM8) || defined(_FM7) || defined(_FMNEW7)
-       actionKanjiRom = new Action_Control_7(this, using_flags);
+       actionKanjiRom = new Action_Control(this, using_flags);
        menuMachine->addAction(actionKanjiRom);
        actionKanjiRom->setCheckable(true);
        actionKanjiRom->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_CONNECT_KANJIROM) != 0) actionKanjiRom->setChecked(true);
-       connect(actionKanjiRom, SIGNAL(toggled(bool)),
-                actionKanjiRom->fm7_binds, SLOT(do_set_kanji_rom(bool)));
+       _val = FM7_DIPSW_CONNECT_KANJIROM;
+       actionKanjiRom->setData(QVariant(_val));
+       if((p_config->dipswitch & FM7_DIPSW_CONNECT_KANJIROM) != 0) actionKanjiRom->setChecked(true);
+       connect(actionKanjiRom, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 #endif
 
 #if defined(WITH_Z80)
        menuMachine->addSeparator();
-       actionZ80CARD_ON = new Action_Control_7(this, using_flags);
+       actionZ80CARD_ON = new Action_Control(this, using_flags);
        menuMachine->addAction(actionZ80CARD_ON);
        actionZ80CARD_ON->setCheckable(true);
        actionZ80CARD_ON->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_Z80CARD_ON) != 0) actionZ80CARD_ON->setChecked(true);
-       connect(actionZ80CARD_ON, SIGNAL(toggled(bool)), actionZ80CARD_ON->fm7_binds, SLOT(do_set_z80card_on(bool)));
+       _val = FM7_DIPSW_Z80CARD_ON;
+       actionZ80CARD_ON->setData(QVariant(_val));
+       if((p_config->dipswitch & FM7_DIPSW_Z80CARD_ON) != 0) actionZ80CARD_ON->setChecked(true);
+       connect(actionZ80CARD_ON, SIGNAL(toggled(bool)),  this, SLOT(do_set_single_dipswitch(bool)));
                
-       actionZ80_IRQ = new Action_Control_7(this, using_flags);
+       actionZ80_IRQ = new Action_Control(this, using_flags);
        menuMachine->addAction(actionZ80_IRQ);
        actionZ80_IRQ->setCheckable(true);
        actionZ80_IRQ->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_Z80_IRQ_ON) != 0) actionZ80_IRQ->setChecked(true);
-       connect(actionZ80_IRQ, SIGNAL(toggled(bool)), actionZ80_IRQ->fm7_binds, SLOT(do_set_z80_irq(bool)));
-       connect(actionZ80_IRQ->fm7_binds, SIGNAL(sig_emu_update_config()), this, SLOT(do_emu_update_config()));
+       _val = FM7_DIPSW_Z80_IRQ_ON; 
+       actionZ80_IRQ->setData(QVariant(_val));
+       if((p_config->dipswitch & FM7_DIPSW_Z80_IRQ_ON) != 0) actionZ80_IRQ->setChecked(true);
+       connect(actionZ80_IRQ, SIGNAL(toggled(bool)),  this, SLOT(do_set_single_dipswitch(bool)));
 
-       actionZ80_FIRQ = new Action_Control_7(this, using_flags);
+       actionZ80_FIRQ = new Action_Control(this, using_flags);
        menuMachine->addAction(actionZ80_FIRQ);
        actionZ80_FIRQ->setCheckable(true);
        actionZ80_FIRQ->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_Z80_FIRQ_ON) != 0) actionZ80_FIRQ->setChecked(true);
-       connect(actionZ80_FIRQ, SIGNAL(toggled(bool)), actionZ80_FIRQ->fm7_binds, SLOT(do_set_z80_firq(bool)));
-       connect(actionZ80_FIRQ->fm7_binds, SIGNAL(sig_emu_update_config()), this, SLOT(do_emu_update_config()));
+       _val = FM7_DIPSW_Z80_FIRQ_ON; 
+       actionZ80_FIRQ->setData(QVariant(_val));
+       if((p_config->dipswitch & FM7_DIPSW_Z80_FIRQ_ON) != 0) actionZ80_FIRQ->setChecked(true);
+       connect(actionZ80_FIRQ, SIGNAL(toggled(bool)),  this, SLOT(do_set_single_dipswitch(bool)));
 
-       actionZ80_NMI = new Action_Control_7(this, using_flags);
+       actionZ80_NMI = new Action_Control(this, using_flags);
        menuMachine->addAction(actionZ80_NMI);
        actionZ80_NMI->setCheckable(true);
        actionZ80_NMI->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_Z80_NMI_ON) != 0) actionZ80_NMI->setChecked(true);
-       connect(actionZ80_NMI, SIGNAL(toggled(bool)), actionZ80_NMI->fm7_binds, SLOT(do_set_z80_nmi(bool)));
-       connect(actionZ80_NMI->fm7_binds, SIGNAL(sig_emu_update_config()), this, SLOT(do_emu_update_config()));
-       if((config.dipswitch & FM7_DIPSW_Z80CARD_ON) == 0) {
+       _val = FM7_DIPSW_Z80_NMI_ON; 
+       actionZ80_NMI->setData(QVariant(_val));
+       if((p_config->dipswitch & FM7_DIPSW_Z80_NMI_ON) != 0) actionZ80_NMI->setChecked(true);
+       connect(actionZ80_NMI, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
+       
+       if((p_config->dipswitch & FM7_DIPSW_Z80CARD_ON) == 0) {
                actionZ80_IRQ->setVisible(false);
                actionZ80_FIRQ->setVisible(false);
                actionZ80_NMI->setVisible(false);
        }
 #endif
        menuMachine->addSeparator();
+
        for(i = 0; i < 3; i++) {
-               actionUART[i] = new Action_Control_7(this, using_flags);
+               const uint32_t uart_list[] = {
+                       FM7_DIPSW_RS232C_ON,
+                       FM7_DIPSW_MODEM_ON,
+                       FM7_DIPSW_MIDI_ON,
+               };
+               
+               actionUART[i] = new Action_Control(this, using_flags);
                actionUART[i]->setCheckable(true);
                actionUART[i]->setVisible(true);
-               actionUART[i]->fm7_binds->setValue1(i);
+               actionUART[i]->setData(QVariant(uart_list[i]));
                menuMachine->addAction(actionUART[i]);
-               connect(actionUART[i], SIGNAL(toggled(bool)), actionUART[i]->fm7_binds, SLOT(do_set_uart(bool)));
+               connect(actionUART[i], SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
        }
-       if((config.dipswitch & FM7_DIPSW_RS232C_ON) != 0) actionUART[0]->setChecked(true);
-       if((config.dipswitch & FM7_DIPSW_MODEM_ON) != 0) actionUART[1]->setChecked(true);
-       if((config.dipswitch & FM7_DIPSW_MIDI_ON) != 0) actionUART[2]->setChecked(true);
+       if((p_config->dipswitch & FM7_DIPSW_RS232C_ON) != 0) actionUART[0]->setChecked(true);
+       if((p_config->dipswitch & FM7_DIPSW_MODEM_ON) != 0) actionUART[1]->setChecked(true);
+       if((p_config->dipswitch & FM7_DIPSW_MIDI_ON) != 0) actionUART[2]->setChecked(true);
        
        
 #if defined(CAPABLE_JCOMMCARD)
-       actionJCOMMCARD = new Action_Control_7(this, using_flags);
+       actionJCOMMCARD = new Action_Control(this, using_flags);
        menuMachine->addAction(actionJCOMMCARD);
        actionJCOMMCARD->setCheckable(true);
        actionJCOMMCARD->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) actionJCOMMCARD->setChecked(true);
-       connect(actionJCOMMCARD, SIGNAL(toggled(bool)), actionJCOMMCARD->fm7_binds, SLOT(do_set_jcommcard(bool)));
+       _val = FM7_DIPSW_JSUBCARD_ON; 
+       actionJCOMMCARD->setData(QVariant(_val));
+       if((p_config->dipswitch & FM7_DIPSW_JSUBCARD_ON) != 0) actionJCOMMCARD->setChecked(true);
+       connect(actionJCOMMCARD, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 #endif
 
 #if defined(_FM8)
-       actionRamProtect = new Action_Control_7(this, using_flags);
+       actionRamProtect = new Action_Control(this, using_flags);
        menuMachine->addAction(actionRamProtect);
        actionRamProtect->setCheckable(true);
        actionRamProtect->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_FM8_PROTECT_FD0F) != 0) actionRamProtect->setChecked(true);
-       connect(actionRamProtect, SIGNAL(toggled(bool)),
-                       actionRamProtect->fm7_binds, SLOT(do_set_protect_ram(bool)));
-       connect(actionRamProtect->fm7_binds, SIGNAL(sig_emu_update_config()),
-                       this, SLOT(do_emu_update_config()));
+       _val = FM7_DIPSW_FM8_PROTECT_FD0F; 
+       actionRamProtect->setData(QVariant(_val));
+       if((p_config->dipswitch & FM7_DIPSW_FM8_PROTECT_FD0F) != 0) actionRamProtect->setChecked(true);
+       connect(actionRamProtect, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 #else  
-       actionCycleSteal = new Action_Control_7(this, using_flags);
+       actionCycleSteal = new Action_Control(this, using_flags);
        menuMachine->addAction(actionCycleSteal);
        actionCycleSteal->setCheckable(true);
        actionCycleSteal->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_CYCLESTEAL) != 0) actionCycleSteal->setChecked(true);
-       connect(actionCycleSteal, SIGNAL(toggled(bool)),
-                actionCycleSteal->fm7_binds, SLOT(do_set_cyclesteal(bool)));
-       connect(actionCycleSteal->fm7_binds, SIGNAL(sig_emu_update_config()),
-                       this, SLOT(do_emu_update_config()));
+       _val = FM7_DIPSW_CYCLESTEAL; 
+       actionCycleSteal->setData(QVariant(_val));
+       
+       if((p_config->dipswitch & FM7_DIPSW_CYCLESTEAL) != 0) actionCycleSteal->setChecked(true);
+       connect(actionCycleSteal, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 #endif 
-       actionSyncToHsync = new Action_Control_7(this, using_flags);    
+       actionSyncToHsync = new Action_Control(this, using_flags);      
        menuMachine->addAction(actionSyncToHsync);
        actionSyncToHsync->setCheckable(true);
        actionSyncToHsync->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_SYNC_TO_HSYNC) != 0) actionSyncToHsync->setChecked(true);
-       connect(actionSyncToHsync, SIGNAL(toggled(bool)),
-                       actionSyncToHsync->fm7_binds, SLOT(do_set_hsync(bool)));
+       _val = FM7_DIPSW_SYNC_TO_HSYNC; 
+       actionSyncToHsync->setData(QVariant(_val));
+       
+       if((p_config->dipswitch & FM7_DIPSW_SYNC_TO_HSYNC) != 0) actionSyncToHsync->setChecked(true);
+       connect(actionSyncToHsync, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 
 #if defined(CAPABLE_DICTROM) && !defined(_FM77AV40EX) && !defined(_FM77AV40SX)
-       actionDictCard = new Action_Control_7(this, using_flags);
+       actionDictCard = new Action_Control(this, using_flags);
        menuMachine->addAction(actionDictCard);
        actionDictCard->setCheckable(true);
        actionDictCard->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_DICTROM_AV) != 0) actionDictCard->setChecked(true);
-       connect(actionDictCard, SIGNAL(toggled(bool)), this, SLOT(do_set_use_dictcard(bool)));
+       _val = FM7_DIPSW_DICTROM_AV; 
+       actionDictCard->setData(QVariant(_val));
+       
+       if((p_config->dipswitch & FM7_DIPSW_DICTROM_AV) != 0) actionDictCard->setChecked(true);
+       connect(actionDictCard, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 #endif
 #if defined(_FM77_VARIANTS) || defined(_FM77AV_VARIANTS)
-       actionExtRam = new Action_Control_7(this, using_flags);
+       actionExtRam = new Action_Control(this, using_flags);
        menuMachine->addAction(actionExtRam);
        actionExtRam->setCheckable(true);
        actionExtRam->setVisible(true);
+       
 # if defined(_FM77AV40) || defined(_FM77AV40SX) || defined(_FM77AV40EX) || defined(_FM77_VARIANTS)
-       if((config.dipswitch & FM7_DIPSW_EXTRAM) != 0) actionExtRam->setChecked(true);
+       if((p_config->dipswitch & FM7_DIPSW_EXTRAM) != 0) actionExtRam->setChecked(true);
+       _val = FM7_DIPSW_EXTRAM; 
+       actionExtRam->setData(QVariant(_val));
+       
 # elif defined(_FM77AV_VARIANTS)
-       if((config.dipswitch & FM7_DIPSW_EXTRAM_AV) != 0) actionExtRam->setChecked(true);
+       if((p_config->dipswitch & FM7_DIPSW_EXTRAM_AV) != 0) actionExtRam->setChecked(true);
+       _val = FM7_DIPSW_EXTRAM_AV; 
+       actionExtRam->setData(QVariant(_val));
+       
 # endif   
-       connect(actionExtRam, SIGNAL(toggled(bool)),
-                       this, SLOT(do_set_extram(bool)));
+       connect(actionExtRam, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 #endif
 # if defined(_FM8) || defined(_FM7) || defined(_FMNEW7)
-       action_320kFloppy = new Action_Control_7(this, using_flags);    
+       action_320kFloppy = new Action_Control(this, using_flags);      
        menuMachine->addAction(action_320kFloppy);
        action_320kFloppy->setCheckable(true);
        action_320kFloppy->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_CONNECT_320KFDC) != 0) action_320kFloppy->setChecked(true);
-       connect(action_320kFloppy, SIGNAL(toggled(bool)),
-                       action_320kFloppy->fm7_binds, SLOT(do_set_320kFloppy(bool)));
+       _val = FM7_DIPSW_CONNECT_320KFDC; 
+       action_320kFloppy->setData(QVariant(_val));
+       
+       if((p_config->dipswitch & FM7_DIPSW_CONNECT_320KFDC) != 0) action_320kFloppy->setChecked(true);
+       connect(action_320kFloppy, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 # endif        
 # if defined(HAS_2HD)
-       action_1MFloppy = new Action_Control_7(this, using_flags);      
+       action_1MFloppy = new Action_Control(this, using_flags);        
        menuMachine->addAction(action_1MFloppy);
        action_1MFloppy->setCheckable(true);
        action_1MFloppy->setVisible(true);
-       if((config.dipswitch & FM7_DIPSW_CONNECT_1MFDC) != 0) action_1MFloppy->setChecked(true);
-       connect(action_1MFloppy, SIGNAL(toggled(bool)),
-                       action_1MFloppy->fm7_binds, SLOT(do_set_1MFloppy(bool)));
+       _val = FM7_DIPSW_CONNECT_1MFDC; 
+       action_1MFloppy->setData(QVariant(_val));
+       
+       if((p_config->dipswitch & FM7_DIPSW_CONNECT_1MFDC) != 0) action_1MFloppy->setChecked(true);
+       connect(action_1MFloppy, SIGNAL(toggled(bool)), this, SLOT(do_set_single_dipswitch(bool)));
 # endif
-       uint32_t tmpv = config.dipswitch & (FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
+       uint32_t tmpv = p_config->dipswitch & (FM7_DIPSW_SELECT_5_OR_8KEY | FM7_DIPSW_AUTO_5_OR_8KEY);
        
        menuAuto5_8Key = new QMenu(menuMachine);
        menuAuto5_8Key->setObjectName(QString::fromUtf8("menuControl_Auto5_8Key"));
@@ -790,20 +660,19 @@ void META_MainWindow::setupUI_Emu(void)
        actionGroup_Auto_5_8key = new QActionGroup(this);
        actionGroup_Auto_5_8key->setExclusive(true);
        
-       action_Neither_5_or_8key = new Action_Control_7(this, using_flags);
+       action_Neither_5_or_8key = new Action_Control(this, using_flags);
        action_Neither_5_or_8key->setCheckable(true);
        action_Neither_5_or_8key->setVisible(true);
-       action_Neither_5_or_8key->fm7_binds->setValue1(0);
+       action_Neither_5_or_8key->setData(QVariant((int)0));
        actionGroup_Auto_5_8key->addAction(action_Neither_5_or_8key);
        menuAuto5_8Key->addAction(action_Neither_5_or_8key);
        if((tmpv &  FM7_DIPSW_AUTO_5_OR_8KEY) == 0) action_Neither_5_or_8key->setChecked(true);
-       connect(action_Neither_5_or_8key, SIGNAL(triggered()),
-                       action_Neither_5_or_8key->fm7_binds, SLOT(do_set_autokey_5_8()));
+       connect(action_Neither_5_or_8key, SIGNAL(triggered()), this, SLOT(do_set_autokey_5_8()));
        
-       action_Auto_5key = new Action_Control_7(this, using_flags);
+       action_Auto_5key = new Action_Control(this, using_flags);
        action_Auto_5key->setCheckable(true);
        action_Auto_5key->setVisible(true);
-       action_Auto_5key->fm7_binds->setValue1(1);
+       action_Auto_5key->setData(QVariant((int)1));
        actionGroup_Auto_5_8key->addAction(action_Auto_5key);
        menuAuto5_8Key->addAction(action_Auto_5key);
        if((tmpv &  FM7_DIPSW_AUTO_5_OR_8KEY) != 0) {
@@ -811,13 +680,12 @@ void META_MainWindow::setupUI_Emu(void)
                        action_Auto_5key->setChecked(true);
                }
        }
-       connect(action_Auto_5key, SIGNAL(triggered()),
-                       action_Auto_5key->fm7_binds, SLOT(do_set_autokey_5_8()));
+       connect(action_Auto_5key, SIGNAL(triggered()), this, SLOT(do_set_autokey_5_8()));
 
-       action_Auto_8key = new Action_Control_7(this, using_flags);
+       action_Auto_8key = new Action_Control(this, using_flags);
        action_Auto_8key->setCheckable(true);
        action_Auto_8key->setVisible(true);
-       action_Auto_8key->fm7_binds->setValue1(2);
+       action_Auto_8key->setData(QVariant((int)2));
        actionGroup_Auto_5_8key->addAction(action_Auto_8key);
        menuAuto5_8Key->addAction(action_Auto_8key);
        if((tmpv &  FM7_DIPSW_AUTO_5_OR_8KEY) != 0) {
@@ -825,8 +693,7 @@ void META_MainWindow::setupUI_Emu(void)
                        action_Auto_8key->setChecked(true);
                }
        }
-       connect(action_Auto_8key, SIGNAL(triggered()),
-                       action_Auto_8key->fm7_binds, SLOT(do_set_autokey_5_8()));
+       connect(action_Auto_8key, SIGNAL(triggered()), this, SLOT(do_set_autokey_5_8()));
 }
 
 
index e00134e..91bfad7 100644 (file)
@@ -2,7 +2,6 @@
 #ifndef _CSP_QT_MENUCLASSES_H
 #define _CSP_QT_MENUCLASSES_H
 
-#include "commonclasses.h"
 #include "mainwidget.h"
 #include "vm.h"
 // This extends class CSP_MainWindow as Ui_MainWindow.
@@ -10,48 +9,6 @@
 QT_BEGIN_NAMESPACE
 class Ui_SoundDialog;
 class USING_FLAGS;
-
-class Object_Menu_Control_7: public Object_Menu_Control
-{
-       Q_OBJECT
-public:
-       Object_Menu_Control_7(QObject *parent, USING_FLAGS *p);
-       ~Object_Menu_Control_7();
-signals:
-       //  int sig_sound_device(int);
-       int sig_emu_update_config(void);
-public slots:
-
-       void do_set_z80card_on(bool flag);
-       void do_set_z80_irq(bool flag);
-       void do_set_z80_firq(bool flag);
-       void do_set_z80_nmi(bool flag);
-       void do_set_hsync(bool flag);
-
-       void do_set_kanji_rom(bool flag);
-       void do_set_320kFloppy(bool flag);
-       
-       void do_set_1MFloppy(bool flag);
-       void do_set_protect_ram(bool flag);
-
-       void do_set_cyclesteal(bool flag);
-       void do_set_jcommcard(bool flag);
-
-       void do_set_uart(bool flag);
-       void do_set_autokey_5_8(void);
-};
-
-class Action_Control_7 : public Action_Control
-{
-       Q_OBJECT
-public:
-       Object_Menu_Control_7 *fm7_binds;
-       Action_Control_7(QObject *parent, USING_FLAGS *p);
-       ~Action_Control_7();
-public slots:
-       void do_set_frameskip();
-};
-
 class CSP_Logger;
 class Ui_MainWindow;
 //  wrote of Specific menu.
@@ -60,46 +17,46 @@ class META_MainWindow : public Ui_MainWindow {
 protected:
        QMenu *menuFrameSkip;
        QActionGroup *actionGroup_FrameSkip;
-       class Action_Control_7 *actionFrameSkip[4];
+       class Action_Control *actionFrameSkip[4];
 # if defined(_FM77AV_VARIANTS) || defined(_FM77_VARIANTS)
-       class Action_Control_7 *actionExtRam;
+       class Action_Control *actionExtRam;
 # endif
 # if defined(_FM8) || defined(_FM7) || defined(_FMNEW7)
-       class Action_Control_7 *actionKanjiRom;
+       class Action_Control *actionKanjiRom;
 # endif
 # if defined(CAPABLE_JCOMMCARD)
-       class Action_Control_7 *actionJCOMMCARD;
+       class Action_Control *actionJCOMMCARD;
 # endif
        
 # if defined(_FM8)
-       class Action_Control_7 *actionRamProtect;
+       class Action_Control *actionRamProtect;
 # else 
-       class Action_Control_7 *actionCycleSteal;
+       class Action_Control *actionCycleSteal;
 # endif  
 
-       class Action_Control_7 *actionSyncToHsync;
+       class Action_Control *actionSyncToHsync;
 
 #if defined(CAPABLE_DICTROM) && !defined(_FM77AV40EX) && !defined(_FM77AV40SX)
-       class Action_Control_7 *actionDictCard;
+       class Action_Control *actionDictCard;
 #endif
        QActionGroup *actionGroup_Auto_5_8key;
        QMenu *menuAuto5_8Key;
-       class Action_Control_7 *action_Neither_5_or_8key;
-       class Action_Control_7 *action_Auto_5key;
-       class Action_Control_7 *action_Auto_8key;
+       class Action_Control *action_Neither_5_or_8key;
+       class Action_Control *action_Auto_5key;
+       class Action_Control *action_Auto_8key;
 # if defined(_FM8) || defined(_FM7) || defined(_FMNEW7)
-       class Action_Control_7 *action_320kFloppy;
+       class Action_Control *action_320kFloppy;
 # endif  
 # if defined(HAS_2HD)
-       class Action_Control_7 *action_1MFloppy;
+       class Action_Control *action_1MFloppy;
 # endif  
 # if defined(WITH_Z80)
-       class Action_Control_7 *actionZ80CARD_ON;
-       class Action_Control_7 *actionZ80_IRQ;
-       class Action_Control_7 *actionZ80_FIRQ;
-       class Action_Control_7 *actionZ80_NMI;
+       class Action_Control *actionZ80CARD_ON;
+       class Action_Control *actionZ80_IRQ;
+       class Action_Control *actionZ80_FIRQ;
+       class Action_Control *actionZ80_NMI;
 #endif
-       class Action_Control_7 *actionUART[3];
+       class Action_Control *actionUART[3];
        
        void setupUI_Emu(void);
        void retranslateUi(void);
@@ -108,10 +65,9 @@ public:
        META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent = 0);
        ~META_MainWindow();
 public slots:
-       void do_set_extram(bool flag);
-#if defined(CAPABLE_DICTROM) && !defined(_FM77AV40EX) && !defined(_FM77AV40SX)
-       void do_set_use_dictcard(bool flag);
-#endif
+       void do_set_frameskip();
+       void do_set_autokey_5_8(void);
+       
 };
 
 QT_END_NAMESPACE
index 2b93bfc..965d30a 100644 (file)
@@ -467,9 +467,6 @@ public:
        uint16_t GetAsyncKeyState(uint32_t vk);  // Win32 GetAsyncKeyState() wrappeer.
 # endif
        void key_modifiers(uint32_t mod);
-       void enable_mouse();
-       void disable_mouse();
-       void toggle_mouse();
        bool is_mouse_enabled();
        //QImage *getPseudoVramClass(void) { return pPseudoVram;}
        void set_mouse_pointer(double x, double y);
@@ -685,20 +682,29 @@ public:
        void process_waiting_in_debugger();
 
 public slots:
+       void enable_mouse();
+       void disable_mouse();
+       void toggle_mouse();
+       
+       void upload_bitmap(QImage *p);
+       void set_buttons();
+       
+       int no_draw_screen();
+
        void do_write_inputdata(QString s);
        void do_set_input_string(QString s);
+       
        void close_debugger_console();
        void do_close_debugger_thread();
+       
        void do_assign_js_setting(int jsnum, int axis_idx, int assigned_value);
-       void upload_bitmap(QImage *p);
-       void set_buttons();
        void do_start_record_video();
        virtual void do_decode_movie(int frames);
        void do_video_movie_end(bool flag);
        void do_video_decoding_error(int num);
        virtual void do_run_movie_audio_callback(uint8_t *data, long len);
        virtual int draw_screen();
-       int no_draw_screen();
+
        void do_draw(bool flag);
        
        void set_dbg_completion_list(std::list<std::string> *p);