OSDN Git Service

[VM][General][Qt] Fix FTBFSs, at least emufm77av40ex, this was working excepts some...
authorK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 24 Feb 2016 19:12:05 +0000 (04:12 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 24 Feb 2016 19:12:05 +0000 (04:12 +0900)
24 files changed:
source/src/common.h
source/src/debugger.cpp
source/src/emu.h
source/src/qt/common/emu_thread.cpp
source/src/qt/common/emuevents_control.cpp
source/src/qt/common/joy_thread.cpp
source/src/qt/common/qrc/commontexts.qrc
source/src/qt/common/qt_glevents.cpp
source/src/qt/common/qt_glutil_gl3_0.cpp
source/src/qt/common/qt_main.cpp
source/src/qt/gui/mainwindow_utils.cpp
source/src/qt/gui/menu_main.cpp
source/src/qt/gui/menu_screen.cpp
source/src/qt/gui/sound_dialog.cpp
source/src/qt/gui/util_fd.cpp
source/src/qt/osd.cpp
source/src/qt/osd.h
source/src/qt/osd_input.cpp
source/src/qt/osd_screen.cpp
source/src/qt/osd_sound.cpp
source/src/vm/device.h
source/src/vm/fm7/display.cpp
source/src/vm/fm7/fm7_mainio.cpp
source/src/win32/osd_screen.cpp

index b764cf7..f2de130 100644 (file)
@@ -549,8 +549,9 @@ const _TCHAR *create_date_file_path(const _TCHAR *extension);
 void create_date_file_path(_TCHAR *file_path, int length, const _TCHAR *extension);
 bool check_file_extension(const _TCHAR* file_path, const _TCHAR* ext);
 const _TCHAR *get_file_path_without_extensiton(const _TCHAR* file_path);
+const _TCHAR *create_string(const _TCHAR* format, ...);
 
-uint32 getcrc32(uint8 data[], int size);
+uint32 get_crc32(uint8 data[], int size);
 uint16 jis_to_sjis(uint16 jis);
 
 
index ccd003c..187cabc 100644 (file)
@@ -809,8 +809,8 @@ int debugger_thread(void *lpx)
                p->osd->sleep(10);
        }
        
-       uint32 prog_addr_mask = cpu->get_debug_prog_addr_mask();
-       uint32 data_addr_mask = cpu->get_debug_data_addr_mask();
+       uint32 prog_addr_mask = cpu->debug_prog_addr_mask();
+       uint32 data_addr_mask = cpu->debug_data_addr_mask();
        uint32 dump_addr = 0;
        uint32 dasm_addr = cpu->get_next_pc();
        
@@ -820,7 +820,7 @@ int debugger_thread(void *lpx)
        
        p->osd->open_console(create_string(_T("Debugger - %s"), _T(DEVICE_NAME)));
        p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
-       cpu->get_debug_regs_info(buffer, 1024);
+       cpu->debug_regs_info(buffer, 1024);
        my_printf(p->osd, _T("%s\n"), buffer);
        
        p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_INTENSITY);
@@ -966,7 +966,7 @@ void EMU::open_debugger(int cpu_index)
                                        bool cp932 = (p->osd->get_console_code_page() == 932);
                                        
                                        p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
-                                       cpu->get_debug_regs_info(buffer, 1024);
+                                       cpu->debug_regs_info(buffer, 1024);
                                        my_printf(p->osd, _T("%s\n"), buffer);
                                        
                                        p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_INTENSITY);
index 3d8bc3b..dcdf967 100644 (file)
@@ -243,7 +243,6 @@ public:
        void enable_mouse();
        void disenable_mouse();
        void toggle_mouse();
-       bool get_mouse_enabled();
        bool is_mouse_enabled();
 #ifdef USE_AUTO_KEY
        void start_auto_key();
@@ -292,8 +291,8 @@ public:
        
        // sound
        void mute_sound();
-       void start_recording_sound();
-       void stop_recording_sound();
+       void start_record_sound();
+       void stop_record_sound();
        bool is_sound_recording();
        
        // video device
index 1b77ffb..f4d1dcb 100644 (file)
@@ -88,7 +88,7 @@ void EmuThreadClass::calc_volume_from_level(int num, int level)
 int EmuThreadClass::get_interval(void)
 {
        static int accum = 0;
-       accum += p_emu->frame_interval();
+       accum += p_emu->get_frame_interval();
        int interval = accum >> 10;
        accum -= interval << 10;
        return interval;
@@ -108,7 +108,7 @@ void EmuThreadClass::moved_mouse(int x, int y)
 void EmuThreadClass::button_pressed_mouse(Qt::MouseButton button)
 {
        int stat = p_emu->get_mouse_button();
-       bool flag = p_emu->get_mouse_enabled();
+       bool flag = p_emu->is_mouse_enabled();
        switch(button) {
        case Qt::LeftButton:
                stat |= 0x01;
@@ -189,12 +189,12 @@ void EmuThreadClass::do_stop_auto_key(void)
     defined(USE_FD5) || defined(USE_FD6) || defined(USE_FD7) || defined(USE_FD8)
 void EmuThreadClass::do_write_protect_disk(int drv, bool flag)
 {
-       p_emu->set_disk_protected(drv, flag);
+       p_emu->is_floppy_disk_protected(drv, flag);
 }
 
 void EmuThreadClass::do_close_disk(int drv)
 {
-       p_emu->close_disk(drv);
+       p_emu->close_floppy_disk(drv);
        p_emu->d88_file[drv].bank_num = 0;
        p_emu->d88_file[drv].cur_bank = -1;
 }
@@ -241,7 +241,7 @@ void EmuThreadClass::do_open_disk(int drv, QString path, int bank)
        } else {
           bank = 0;
        }
-       p_emu->open_disk(drv, localPath.constData(), bank);
+       p_emu->open_floppy_disk(drv, localPath.constData(), bank);
        emit sig_update_recent_disk(drv);
 }
 
@@ -305,12 +305,12 @@ void EmuThreadClass::do_write_protect_quickdisk(int drv, bool flag)
 
 void EmuThreadClass::do_close_quickdisk(int drv)
 {
-       p_emu->close_quickdisk(drv);
+       p_emu->close_quick_disk(drv);
 }
 
 void EmuThreadClass::do_open_quickdisk(int drv, QString path)
 {
-       p_emu->open_quickdisk(drv, path.toLocal8Bit().constData());
+       p_emu->open_quick_disk(drv, path.toLocal8Bit().constData());
 }
 #endif
 
@@ -403,10 +403,10 @@ void EmuThreadClass::sample_access_drv(void)
        int i;
 #if defined(USE_QD1)
 # if defined(USE_ACCESS_LAMP)      
-       access_drv = p_emu->get_vm()->access_lamp();
+       access_drv = p_emu->get_access_lamp();
 # endif
        for(i = 0; i < MAX_QD ; i++) {
-               if(p_emu->quickdisk_inserted(i)) {
+               if(p_emu->is_quick_disk_inserted(i)) {
                //           printf("%d\n", access_drv);
 # if defined(USE_ACCESS_LAMP)      
                        if(i == (access_drv - 1)) {
@@ -435,10 +435,10 @@ void EmuThreadClass::sample_access_drv(void)
 
 #if defined(USE_FD1)
 # if defined(USE_ACCESS_LAMP)      
-       access_drv = p_emu->get_vm()->access_lamp();
+       access_drv = p_emu->get_access_lamp();
 # endif
        for(i = 0; i < MAX_FD; i++) {
-               if(p_emu->disk_inserted(i)) {
+               if(p_emu->is_floppy_disk_inserted(i)) {
 # if defined(USE_ACCESS_LAMP)      
                        if(i == (access_drv - 1)) {
                                alamp = QString::fromUtf8("<FONT COLOR=RED>●</FONT> ");
@@ -469,12 +469,12 @@ void EmuThreadClass::sample_access_drv(void)
        }
 #endif
 #if defined(USE_TAPE) && !defined(TAPE_BINARY_ONLY)
-       if(p_emu->tape_inserted()) {
-               int tape_counter = p_emu->tape_position();
+       if(p_emu->is_tape_inserted()) {
+               int tape_counter = p_emu->get_tape_position();
                tmpstr = QString::fromUtf8("");
-               if(p_emu->tape_playing()) {
+               if(p_emu->is_tape_playing()) {
                        tmpstr = QString::fromUtf8("<FONT COLOR=BLUE>▶ </FONT>");
-               } else if(p_emu->tape_recording()) {
+               } else if(p_emu->is_tape_recording()) {
                        tmpstr = QString::fromUtf8("<FONT COLOR=RED>● </FONT>");
                } else {
                        tmpstr = QString::fromUtf8("<FONT COLOR=BLACK>■ </FONT>");
@@ -601,12 +601,12 @@ void EmuThreadClass::doWork(const QString &params)
                        opengl_filter_num_bak = config.opengl_filter_num;
 #endif
                        if(bStartRecordSoundReq != false) {
-                               p_emu->start_rec_sound();
+                               p_emu->start_record_sound();
                                bStartRecordSoundReq = false;
                                req_draw = true;
                        }
                        if(bStopRecordSoundReq != false) {
-                               p_emu->stop_rec_sound();
+                               p_emu->stop_record_sound();
                                bStopRecordSoundReq = false;
                                req_draw = true;
                        }
@@ -626,7 +626,7 @@ void EmuThreadClass::doWork(const QString &params)
                        run_frames = p_emu->run();
                        total_frames += run_frames;
 #if defined(USE_MINIMUM_RENDERING)
-                       req_draw |= p_emu->screen_changed();
+                       req_draw |= p_emu->is_screen_changed();
 #else
                        req_draw = true;
 #endif                 
@@ -640,7 +640,7 @@ void EmuThreadClass::doWork(const QString &params)
                        sample_access_drv();
 
                        interval += get_interval();
-                       now_skip = p_emu->now_skip() && !p_emu->now_rec_video();
+                       now_skip = p_emu->is_frame_skippable() && !p_emu->is_video_recording();
 
                        if((prev_skip && !now_skip) || next_time == 0) {
                                next_time = tick_timer.elapsed();
@@ -700,7 +700,7 @@ void EmuThreadClass::doSetDisplaySize(int w, int h, int ww, int wh)
 {
        p_emu->suspend();
        //p_emu->set_vm_screen_size(w, h, -1, -1, ww, wh);
-       p_emu->set_window_size(w, h, true);
+       p_emu->set_host_window_size(w, h, true);
 }
 
 void EmuThreadClass::doUpdateVolumeLevel(int num, int level)
index 324bfb5..39babcf 100644 (file)
@@ -79,8 +79,8 @@ void Ui_MainWindow::OnOpenDebugger(int no)
                        emu->hDebugger->debugger_thread_param.osd = emu->get_osd();
                        emu->hDebugger->debugger_thread_param.vm = vm;
                        emu->hDebugger->debugger_thread_param.cpu_index = no;
-                       emu->stop_rec_sound();
-                       emu->stop_rec_video();
+                       emu->stop_record_sound();
+                       emu->stop_record_video();
                        emu->now_debugging = true;
                        connect(this, SIGNAL(quit_debugger_thread()), emu->hDebugger, SLOT(doExit()));
                        //connect(this, SIGNAL(quit_debugger_thread()), emu->hDebugger, SLOT(close()));
@@ -116,19 +116,19 @@ void OnStartRecordScreen(int num)
        const int fps[3] = {60, 30, 15};
        if((num < 0) || (num > 2)) return;
        if(emu) {
-               //emit sig_emu_start_rec_screen();
-               emu->start_rec_sound();
-               if(!emu->start_rec_video(fps[num])) {
-                       emu->stop_rec_sound();
+               //emit sig_emu_start_record_screen();
+               emu->start_record_sound();
+               if(!emu->start_record_video(fps[num])) {
+                       emu->stop_record_sound();
                }
        }
 }
 void OnStopRecordScreen(void)
 {
        if(emu) {
-               //emit sig_emu_stop_rec_screen();
-               emu->stop_rec_video();
-               emu->stop_rec_sound();
+               //emit sig_emu_stop_record_screen();
+               emu->stop_record_video();
+               emu->stop_record_sound();
        }
 }
 
index 83d026f..1654468 100644 (file)
@@ -170,7 +170,7 @@ void JoyThreadClass::x_axis_changed(int index, int value)
        if(p_emu == NULL) return;
        if((index < 0) || (index >= 2)) return;
        p_emu->lock_vm();
-       uint32_t *joy_status = p_emu->joy_buffer();
+       uint32_t *joy_status = p_emu->get_joy_buffer();
    
        if(joy_status != NULL) {
                if(value < -8192) { // left
@@ -189,7 +189,7 @@ void JoyThreadClass::y_axis_changed(int index, int value)
        if(p_emu == NULL) return;
        if((index < 0) || (index >= 2)) return;
        p_emu->lock_vm();
-       uint32_t *joy_status = p_emu->joy_buffer();
+       uint32_t *joy_status = p_emu->get_joy_buffer();
    
        if(joy_status != NULL) {
                if(value < -8192) {// up
@@ -208,7 +208,7 @@ void JoyThreadClass::button_down(int index, unsigned int button)
        if(p_emu == NULL) return;
        if((index < 0) || (index >= 2)) return;
        p_emu->lock_vm();
-       uint32_t *joy_status = p_emu->joy_buffer();
+       uint32_t *joy_status = p_emu->get_joy_buffer();
        if(joy_status != NULL) {
                joy_status[index] |= (1 << (button + 4));
        }
@@ -220,7 +220,7 @@ void JoyThreadClass::button_up(int index, unsigned int button)
        if(p_emu == NULL) return;
        if((index < 0) || (index >= 2)) return;
        p_emu->lock_vm();
-       uint32_t *joy_status = p_emu->joy_buffer();
+       uint32_t *joy_status = p_emu->get_joy_buffer();
        if(joy_status != NULL) {
                joy_status[index] &= ~(1 << (button + 4));
        }
index 56c25d8..e097bdd 100644 (file)
@@ -1,20 +1,20 @@
 <!DOCTYPE RCC><RCC version="1.0">
 <qresource>
     <file alias="credits.html">../../../res/credits.html</file>
-    <file alias="readme.txt">../../../../../readme.txt</file>
-    <file alias="readme.qt.txt">../../../../../readme.qt.txt</file>
-    <file alias="readme_by_mr_tanam.txt">../../../../../readme_by_mr_tanam.txt</file>
-    <file alias="readme_by_artane.txt">../../../../../readme_by_artane.txt</file>
-    <file alias="readme_fm7.txt">../../../../../readme_fm7.txt</file>
-    <file alias="readme_fm7.jp.txt">../../../../../readme_fm7.jp.txt</file>
-    <file alias="RELEASENOTE.txt">../../../../../RELEASENOTE.txt</file>
-    <file alias="ChangeLog.txt">../../../../../ChangeLog</file>
+    <file alias="readme.txt">../../../../readme.txt</file>
+    <file alias="readme.qt.txt">../../../../readme.qt.txt</file>
+    <file alias="readme_by_mr_tanam.txt">../../../../readme_by_mr_tanam.txt</file>
+    <file alias="readme_by_artane.txt">../../../../readme_by_artane.txt</file>
+    <file alias="readme_fm7.txt">../../../../readme_fm7.txt</file>
+    <file alias="readme_fm7.jp.txt">../../../../readme_fm7.jp.txt</file>
+    <file alias="RELEASENOTE.txt">../../../../RELEASENOTE.txt</file>
+    <file alias="ChangeLog.txt">../../../../ChangeLog</file>
     
-    <file alias="history.txt">../../../../../history.txt</file>
-    <file alias="history_by_mr_tanam.txt">../../../../../history_by_mr_tanam.txt</file>
-    <file alias="revision.txt">../../../../../revision.txt</file>
+    <file alias="history.txt">../../../../history.txt</file>
+    <file alias="history_by_mr_tanam.txt">../../../../history_by_mr_tanam.txt</file>
+    <file alias="revision.txt">../../../../revision.txt</file>
     
-    <file alias="LICENSE.txt">../../../../../LICENSE</file>
-    <file alias="LICENSE.ja.txt">../../../../../LICENSE.ja.txt</file>
+    <file alias="LICENSE.txt">../../../../LICENSE</file>
+    <file alias="LICENSE.ja.txt">../../../../LICENSE.ja.txt</file>
 </qresource>
 </RCC>
index 93a2f0f..fc50651 100644 (file)
@@ -80,7 +80,7 @@ void GLDrawClass::mousePressEvent(QMouseEvent *event)
        }
        if(QApplication::overrideCursor() == NULL) {
                if(p_emu != NULL) {
-                       if(p_emu->get_mouse_enabled()) {
+                       if(p_emu->is_mouse_enabled()) {
                                QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
                        }
                }
@@ -127,7 +127,7 @@ void GLDrawClass::do_save_frame_screen(void)
                tmps = tmps + QString::fromUtf8("_");
                tmps = tmps + nowTime.toString(QString::fromUtf8("yyyy-MM-dd_hh-mm-ss.zzz"));
                tmps = tmps + QString::fromUtf8(".png");
-               filename_screen_pixmap = QString::fromLocal8Bit(application_path()) + tmps;
+               filename_screen_pixmap = QString::fromLocal8Bit(get_application_path()) + tmps;
        }
 }
 
index a017517..010872f 100644 (file)
@@ -248,7 +248,7 @@ void GLDraw_3_0::initLocalGLObjects(void)
        if(uTmpDepthBuffer == 0) {
                extfunc_3_0->glGenRenderbuffers(1, &uTmpDepthBuffer);
                extfunc_3_0->glBindRenderbuffer(GL_RENDERBUFFER, uTmpDepthBuffer);
-               extfunc_3_0->glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, SCREEN_WIDTH_ASPECT, SCREEN_HEIGHT_ASPECT);
+               extfunc_3_0->glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, SCREEN_WIDTH, SCREEN_HEIGHT);
                extfunc_3_0->glBindRenderbuffer(GL_RENDERBUFFER, 0);
        }
 
index aa2685b..a6b6c4b 100644 (file)
@@ -154,7 +154,7 @@ void Ui_MainWindow::do_toggle_mouse(void)
 {
        if(emu == NULL) return;
        emu->lock_vm();
-       bool flag = emu->get_mouse_enabled();
+       bool flag = emu->is_mouse_enabled();
        if(!flag) {
                graphicsView->grabMouse();
                emu->enable_mouse();
@@ -324,7 +324,7 @@ void Ui_MainWindow::LaunchEmuThread(void)
        
        hRunEmu->start();
        AGAR_DebugLog(AGAR_LOG_DEBUG, "EmuThread : Launch done.");
-       this->set_screen_aspect(config.stretch_type);
+       this->set_screen_aspect(config.window_stretch_type);
 }
 
 
index f35da91..ab59d4d 100644 (file)
@@ -155,7 +155,7 @@ void Ui_MainWindow::set_screen_aspect(int num)
        // So, does need below action?
        // Maybe, needs Agar's changing action. 
        
-       config.stretch_type = num;
+       config.window_stretch_type = num;
        
        if(emu) {
                int w, h, n;
@@ -166,9 +166,9 @@ void Ui_MainWindow::set_screen_aspect(int num)
                w = (int)(nd * (double)SCREEN_WIDTH);
                h = (int)(nd * (double)SCREEN_HEIGHT);
 #if defined(USE_CRT_MONITOR_4_3)
-               if(config.stretch_type == 1) {
+               if(config.window_stretch_type == 1) {
                        h = (int)((double)h * ((double)SCREEN_WIDTH / (double)SCREEN_HEIGHT * 3.0 / 4.0));
-               } else if(config.stretch_type == 2) {
+               } else if(config.window_stretch_type == 2) {
                        w = (int)((double)w * (4.0 / (3.0 * (double)SCREEN_WIDTH / (double)SCREEN_HEIGHT)));
                }
                //printf("%d x %d\n", w, h);
index 9882423..7778e0a 100644 (file)
@@ -435,7 +435,7 @@ void Ui_MainWindow::setupUi(void)
                }
        }
        this->set_screen_size(w, h);
-       this->set_screen_aspect(config.stretch_type);
+       this->set_screen_aspect(config.window_stretch_type);
        if(actionScreenSize[config.window_mode] != NULL) {
                double nd = actionScreenSize[config.window_mode]->binds->getDoubleValue();
                graphicsView->do_set_screen_multiply(nd);
index 453c8e9..8a24eef 100644 (file)
@@ -36,9 +36,9 @@ void Object_Menu_Control::set_screen_size(void) {
        w = (int)(nd * (double)SCREEN_WIDTH);
        h = (int)(nd * (double)SCREEN_HEIGHT);
 #if defined(USE_CRT_MONITOR_4_3)
-       if(config.stretch_type == 1) {
+       if(config.window_stretch_type == 1) {
                h = (int)((double)h * ((double)SCREEN_WIDTH / (double)SCREEN_HEIGHT * 3.0 / 4.0));
-       } else if(config.stretch_type == 2) {
+       } else if(config.window_stretch_type == 2) {
                w = (int)((double)w * (4.0 / (3.0 * (double)SCREEN_WIDTH / (double)SCREEN_HEIGHT)));
        }
 #endif
@@ -169,20 +169,20 @@ void Ui_MainWindow::ConfigScreenMenu(void)
        actionDot_by_Dot = new Action_Control(this);
        actionDot_by_Dot->setObjectName(QString::fromUtf8("actionDot_by_Dot"));
        actionDot_by_Dot->setCheckable(true);
-       if(config.stretch_type == 0) actionDot_by_Dot->setChecked(true);
+       if(config.window_stretch_type == 0) actionDot_by_Dot->setChecked(true);
        actionDot_by_Dot->binds->setValue1(0);
        
        actionKeep_Aspect = new Action_Control(this);
        actionKeep_Aspect->setObjectName(QString::fromUtf8("actionKeep_Aspect"));
        actionKeep_Aspect->setCheckable(true);
        actionKeep_Aspect->binds->setValue1(1);
-       if(config.stretch_type == 1) actionKeep_Aspect->setChecked(true);
+       if(config.window_stretch_type == 1) actionKeep_Aspect->setChecked(true);
        
        actionFill_Display = new Action_Control(this);
        actionFill_Display->setObjectName(QString::fromUtf8("actionFill_Display"));
        actionFill_Display->setCheckable(true);
        actionFill_Display->binds->setValue1(2);
-       if(config.stretch_type == 2) actionFill_Display->setChecked(true);
+       if(config.window_stretch_type == 2) actionFill_Display->setChecked(true);
 
        actionGroup_Stretch = new QActionGroup(this);
        actionGroup_Stretch->setExclusive(true);
index dd58876..02a4562 100644 (file)
@@ -121,25 +121,23 @@ Ui_SoundDialog::Ui_SoundDialog(EMU *_emu, QWidget *parent) : QWidget(0)
                        connect(sliderDeviceVolume[ij], SIGNAL(sig_emu_update_volume_level(int, int)),
                                        parent_widget, SLOT(do_emu_update_volume_level(int, int)));
                        
-                       if(!sound_device_monophonic[ii]) {
-                               sliderDeviceVolume[ij + 1] = new Ui_SndSliderObject(_emu, Qt::Vertical, this, ii + 1);
-                               sliderDeviceVolume[ij + 1]->setMinimum(-20);
-                               sliderDeviceVolume[ij + 1]->setMaximum(20);
-                               sliderDeviceVolume[ij + 1]->setSingleStep(1);
-                               sliderDeviceVolume[ij + 1]->setPageStep(4);
-
-                               sliderDeviceVolume[ij + 1]->setValue((config.sound_volume_r[ii] - config.sound_volume_l[ii]) / 2);
-                               sliderDeviceVolume[ij + 1]->connect(sliderDeviceVolume[ij + 1], SIGNAL(valueChanged(int)),
+                       sliderDeviceVolume[ij + 1] = new Ui_SndSliderObject(_emu, Qt::Vertical, this, ii + 1);
+                       sliderDeviceVolume[ij + 1]->setMinimum(-20);
+                       sliderDeviceVolume[ij + 1]->setMaximum(20);
+                       sliderDeviceVolume[ij + 1]->setSingleStep(1);
+                       sliderDeviceVolume[ij + 1]->setPageStep(4);
+                       
+                       sliderDeviceVolume[ij + 1]->setValue((config.sound_volume_r[ii] - config.sound_volume_l[ii]) / 2);
+                       sliderDeviceVolume[ij + 1]->connect(sliderDeviceVolume[ij + 1], SIGNAL(valueChanged(int)),
                                                                                                sliderDeviceVolume[ij + 1], SLOT(setBalanceValue(int)));
-                               connect(sliderDeviceVolume[ij + 1], SIGNAL(sig_emu_update_volume_balance(int, int)),
-                                               parent_widget, SLOT(do_emu_update_volume_balance(int, int)));
-                       }
+                       connect(sliderDeviceVolume[ij + 1], SIGNAL(sig_emu_update_volume_balance(int, int)),
+                                       parent_widget, SLOT(do_emu_update_volume_balance(int, int)));
+                       
                        boxDeviceVolume[ii] = new QGroupBox(lbl);
                        HBoxDeviceVolume[ii] = new QHBoxLayout;
                        HBoxDeviceVolume[ii]->addWidget(sliderDeviceVolume[ij]);
-                       if(!sound_device_monophonic[ii]) {
-                               HBoxDeviceVolume[ii]->addWidget(sliderDeviceVolume[ij + 1]);
-                       }                       
+                       HBoxDeviceVolume[ii]->addWidget(sliderDeviceVolume[ij + 1]);
+
                        boxDeviceVolume[ii]->setLayout(HBoxDeviceVolume[ii]);
                        HBoxWindow->addWidget(boxDeviceVolume[ii]);
                        ij += 2;
index bb5fdb4..e14ecb0 100644 (file)
@@ -93,7 +93,7 @@ int Ui_MainWindow::set_d88_slot(int drive, int num)
 
        if(emu && emu->d88_file[drive].cur_bank != num) {
                emit sig_open_disk(drive, path, num);
-               if(emu->get_disk_protected(drive)) {
+               if(emu->is_floppy_disk_protected(drive)) {
                        menu_fds[drive]->do_set_write_protect(true);
                } else {
                        menu_fds[drive]->do_set_write_protect(false);
@@ -107,8 +107,8 @@ void Ui_MainWindow::do_update_recent_disk(int drv)
        int i;
        if(emu == NULL) return;
        menu_fds[drv]->do_update_histories(listFDs[drv]);
-       menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
-       if(emu->get_disk_protected(drv)) {
+       menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
+       if(emu->is_floppy_disk_protected(drv)) {
                menu_fds[drv]->do_write_protect_media();
        } else {
                menu_fds[drv]->do_write_unprotect_media();
@@ -122,20 +122,20 @@ int Ui_MainWindow::set_recent_disk(int drv, int num)
        char path_shadow[PATH_MAX];
        int i;
        if((num < 0) || (num >= MAX_HISTORY)) return -1;
-       s_path = QString::fromUtf8(config.recent_disk_path[drv][num]);
+       s_path = QString::fromUtf8(config.recent_floppy_disk_path[drv][num]);
        strncpy(path_shadow, s_path.toUtf8().constData(), PATH_MAX);
-       UPDATE_HISTORY(path_shadow, config.recent_disk_path[drv], listFDs[drv]);
+       UPDATE_HISTORY(path_shadow, config.recent_floppy_disk_path[drv], listFDs[drv]);
        strncpy(path_shadow, s_path.toUtf8().constData(), PATH_MAX);
    
        get_parent_dir(path_shadow);
-       strcpy(config.initial_disk_dir, path_shadow);
+       strcpy(config.initial_floppy_disk_dir, path_shadow);
        strncpy(path_shadow, s_path.toUtf8().constData(), PATH_MAX);
 
        if(emu) {
                emit sig_close_disk(drv);
                emit sig_open_disk(drv, s_path, 0);
                menu_fds[drv]->do_update_histories(listFDs[drv]);
-               menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
+               menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
                if(check_file_extension(path_shadow, ".d88") || check_file_extension(path_shadow, ".d77")) {
                        UPDATE_D88_LIST(drv, listD88[drv]);
                        menu_fds[drv]->do_update_inner_media(listD88[drv], 0);
@@ -150,7 +150,7 @@ int Ui_MainWindow::set_recent_disk(int drv, int num)
                                emit sig_close_disk(drv2);
                                emit sig_open_disk(drv2, s_path, 1);
                                menu_fds[drv2]->do_update_histories(listFDs[drv2]);
-                               menu_fds[drv2]->do_set_initialize_directory(config.initial_disk_dir);
+                               menu_fds[drv2]->do_set_initialize_directory(config.initial_floppy_disk_dir);
                                UPDATE_D88_LIST(drv2, listD88[drv2]);
                                menu_fds[drv2]->do_update_inner_media(listD88[drv2], 1);
                        }
@@ -170,9 +170,9 @@ void Ui_MainWindow::_open_disk(int drv, const QString fname)
        if(fname.length() <= 0) return;
        drv = drv & 7;
        strncpy(path_shadow, fname.toUtf8().constData(), PATH_MAX);
-       UPDATE_HISTORY(path_shadow, config.recent_disk_path[drv], listFDs[drv]);
+       UPDATE_HISTORY(path_shadow, config.recent_floppy_disk_path[drv], listFDs[drv]);
        get_parent_dir(path_shadow);
-       strcpy(config.initial_disk_dir, path_shadow);
+       strcpy(config.initial_floppy_disk_dir, path_shadow);
        // Update List
        strncpy(path_shadow, fname.toUtf8().constData(), PATH_MAX);
        if(emu) {
@@ -180,7 +180,7 @@ void Ui_MainWindow::_open_disk(int drv, const QString fname)
                //emu->LockVM();
                emit sig_open_disk(drv, fname, 0);
                menu_fds[drv]->do_update_histories(listFDs[drv]);
-               menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
+               menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
                if(check_file_extension(path_shadow, ".d88") || check_file_extension(path_shadow, ".d77")) {
                        UPDATE_D88_LIST(drv, listD88[drv]);
                        menu_fds[drv]->do_update_inner_media(listD88[drv], 0);
@@ -197,7 +197,7 @@ void Ui_MainWindow::_open_disk(int drv, const QString fname)
                        strncpy(path_shadow, fname.toUtf8().constData(), PATH_MAX);
                        emit sig_open_disk(drv2, fname, 1);
                        menu_fds[drv2]->do_update_histories(listFDs[drv2]);
-                       menu_fds[drv2]->do_set_initialize_directory(config.initial_disk_dir);
+                       menu_fds[drv2]->do_set_initialize_directory(config.initial_floppy_disk_dir);
                        UPDATE_D88_LIST(drv2, listD88[drv2]);
                        menu_fds[drv2]->do_update_inner_media(listD88[drv2], 1);
        }
@@ -230,9 +230,9 @@ void Ui_MainWindow::CreateFloppyMenu(int drv, int drv_base)
                
                menu_fds[drv]->do_clear_inner_media();
                menu_fds[drv]->do_add_media_extension(ext, desc1);
-               SETUP_HISTORY(config.recent_disk_path[drv], listFDs[drv]);
+               SETUP_HISTORY(config.recent_floppy_disk_path[drv], listFDs[drv]);
                menu_fds[drv]->do_update_histories(listFDs[drv]);
-               menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
+               menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
                listD88[drv].clear();
 
                QString name = QString::fromUtf8("FD");
index c50bedd..7364be9 100644 (file)
@@ -22,6 +22,7 @@
 OSD::OSD() : QThread(0)
 {
        VMSemaphore = new QSemaphore(1);
+       locked_vm = false;
 }
 
 OSD::~OSD()
@@ -171,6 +172,7 @@ void OSD::create_date_file_name(_TCHAR *name, int length, const _TCHAR *extensio
 
 void OSD::lock_vm(void)
 {
+       locked_vm = true;
        if(parent_thread != NULL) { 
                if(!parent_thread->now_debugging()) VMSemaphore->acquire(1);
        } else {
@@ -180,6 +182,7 @@ void OSD::lock_vm(void)
 
 void OSD::unlock_vm(void)
 {
+       locked_vm = false;
        if(parent_thread != NULL) { 
                if(!parent_thread->now_debugging()) VMSemaphore->release(1);
        } else {
@@ -187,6 +190,11 @@ void OSD::unlock_vm(void)
        }
 }
 
+bool OSD::is_vm_locked(void)
+{
+       return locked_vm;
+}
+
 void OSD::force_unlock_vm(void)
 {
        if(parent_thread == NULL) {
index 37d3fd7..34a5a3a 100644 (file)
@@ -194,6 +194,7 @@ protected:
        private:
        _TCHAR app_path[_MAX_PATH];
        QElapsedTimer osd_timer;
+       bool locked_vm;
        
        // console
        FILE *hStdIn, *hStdOut;
@@ -255,11 +256,13 @@ protected:
        bitmap_t vm_screen_buffer;
        bitmap_t video_screen_buffer;
        bitmap_t* draw_screen_buffer;
+       int vm_window_width, vm_window_height;
+       int vm_window_width_aspect, vm_window_height_aspect;
        
        int host_window_width, host_window_height;
        bool host_window_mode;
        int base_window_width, base_window_height;
-       int vm_screen_width, vm_screen_height, vm_screen_width_aspect, vm_screen_height_aspect;
+       int vm_screen_width, vm_screen_height;
        int draw_screen_width, draw_screen_height;
        
        
@@ -404,6 +407,8 @@ public:
        void update_input();
        void key_down(int code, bool repeat);
        void key_up(int code);
+       void key_down_native(int code, bool repeat);
+       void key_up_native(int code);
        void key_lost_focus()
        {
                lost_focus = true;
@@ -420,11 +425,11 @@ public:
        void enable_mouse();
        void disenable_mouse();
        void toggle_mouse();
-       bool get_mouse_enabled()
+       bool is_mouse_enabled()
        {
                return mouse_enabled;
        }
-        //QImage *getPseudoVramClass(void) { return pPseudoVram;}
+       //QImage *getPseudoVramClass(void) { return pPseudoVram;}
        void set_mouse_pointer(int x, int y) {
                mouse_ptrx = x;
                mouse_ptry = y;
@@ -438,24 +443,21 @@ public:
 #ifdef USE_AUTO_KEY
        void start_auto_key();
        void stop_auto_key();
-       bool now_auto_key()
-       {
-               return (autokey_phase != 0);
-       }
+       bool now_auto_key;
 #endif
        void modify_key_buffer(int code, uint8 val)
        {
                key_status[code] = val;
        }
-       uint8* key_buffer()
+       uint8* get_key_buffer()
        {
                return key_status;
        }
-       uint32* joy_buffer()
+       uint32* get_joy_buffer()
        {
                return joy_status;
        }
-       int* mouse_buffer()
+       int* get_mouse_buffer()
        {
                return mouse_status;
        }
@@ -516,8 +518,24 @@ public:
        // common screen
        int get_window_width(int mode);
        int get_window_height(int mode);
-       void set_window_size(int window_width, int window_height, bool window_mode);
+       void set_host_window_size(int window_width, int window_height, bool window_mode);
        void set_vm_screen_size(int width, int height, int width_aspect, int height_aspect, int window_width, int window_height);
+       int get_vm_window_width()
+       {
+               return vm_window_width;
+       }
+       int get_vm_window_height()
+       {
+               return vm_window_height;
+       }
+       int get_vm_window_width_aspect()
+       {
+               return vm_window_width_aspect;
+       }
+       int get_vm_window_height_aspect()
+       {
+               return vm_window_height_aspect;
+       }
        scrntype* get_vm_screen_buffer(int y);
        int draw_screen();
 #ifdef ONE_BOARD_MICRO_COMPUTER
@@ -527,11 +545,11 @@ public:
        }
 #endif
        void capture_screen();
-       bool start_rec_video(int fps);
-       void stop_rec_video();
-       void restart_rec_video();
+       bool start_record_video(int fps);
+       void stop_record_video();
+       void restart_record_video();
        void add_extra_frames(int extra_frames);
-       bool now_rec_video;
+       bool now_record_video;
 #ifdef USE_CRT_FILTER
        bool screen_skip_line;
 #endif
@@ -540,10 +558,10 @@ public:
        void update_sound(int* extra_frames);
        void mute_sound();
        void stop_sound();
-       void start_rec_sound();
-       void stop_rec_sound();
-       void restart_rec_sound();
-       bool now_rec_sound;
+       void start_record_sound();
+       void stop_record_sound();
+       void restart_record_sound();
+       bool now_record_sound;
        
 #if defined(USE_MOVIE_PLAYER) || defined(USE_VIDEO_CAPTURE)
        // common video device
@@ -640,6 +658,7 @@ public:
        void lock_vm(void);
        void unlock_vm(void);
        void force_unlock_vm(void);
+       bool is_vm_locked(void);
 
 public slots:
 #ifdef USE_AUTO_KEY
index c322490..e259c9e 100644 (file)
@@ -661,6 +661,134 @@ void OSD::key_up(int code)
 #endif
 }
 
+void OSD::key_down_native(int code, bool repeat)
+{
+       bool keep_frames = false;
+       
+       if(code == 0xf0) {
+               code = VK_CAPITAL;
+               keep_frames = true;
+       } else if(code == 0xf2) {
+               code = VK_KANA;
+               keep_frames = true;
+       } else if(code == 0xf3 || code == 0xf4) {
+               code = VK_KANJI;
+               keep_frames = true;
+       }
+       if(!(code == VK_LSHIFT || code == VK_RSHIFT || code == VK_LCONTROL || code == VK_RCONTROL || code == VK_LMENU || code == VK_RMENU)) {
+               code = keycode_conv[code];
+       }
+       
+#ifdef DONT_KEEEP_KEY_PRESSED
+       if(!(code == VK_LSHIFT || code == VK_RSHIFT || code == VK_LCONTROL || code == VK_RCONTROL || code == VK_LMENU || code == VK_RMENU)) {
+               key_status[code] = KEY_KEEP_FRAMES;
+       } else
+#endif
+       key_status[code] = keep_frames ? KEY_KEEP_FRAMES : 0x80;
+       
+#ifdef NOTIFY_KEY_DOWN
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+       uint8 prev_shift = key_status[VK_SHIFT];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+       uint8 prev_control = key_status[VK_CONTROL];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+       uint8 prev_menu = key_status[VK_MENU];
+#endif
+#endif
+       key_status[VK_SHIFT] = key_status[VK_LSHIFT] | key_status[VK_RSHIFT];
+       key_status[VK_CONTROL] = key_status[VK_LCONTROL] | key_status[VK_RCONTROL];
+       key_status[VK_MENU] = key_status[VK_LMENU] | key_status[VK_RMENU];
+       
+#ifdef NOTIFY_KEY_DOWN
+       if(keep_frames) {
+               repeat = false;
+       }
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+       if(code == VK_LSHIFT || code == VK_RSHIFT) {
+               if(prev_shift == 0 && key_status[VK_SHIFT] != 0) {
+                       vm->key_down(VK_SHIFT, repeat);
+               }
+               return;
+       }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+       if(code == VK_LCONTROL|| code == VK_RCONTROL) {
+               if(prev_control == 0 && key_status[VK_CONTROL] != 0) {
+                       vm->key_down(VK_CONTROL, repeat);
+               }
+               return;
+       }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+       if(code == VK_LMENU|| code == VK_RMENU) {
+               if(prev_menu == 0 && key_status[VK_MENU] != 0) {
+                       vm->key_down(VK_MENU, repeat);
+               }
+               return;
+       }
+#endif
+       vm->key_down(code, repeat);
+#endif
+}
+
+void OSD::key_up_native(int code)
+{
+       if(!(code == VK_LSHIFT || code == VK_RSHIFT || code == VK_LCONTROL || code == VK_RCONTROL || code == VK_LMENU || code == VK_RMENU)) {
+               code = keycode_conv[code];
+       }
+       if(key_status[code] == 0) {
+               return;
+       }
+       if((key_status[code] &= 0x7f) != 0) {
+               return;
+       }
+       
+#ifdef NOTIFY_KEY_DOWN
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+       uint8 prev_shift = key_status[VK_SHIFT];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+       uint8 prev_control = key_status[VK_CONTROL];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+       uint8 prev_menu = key_status[VK_MENU];
+#endif
+#endif
+       key_status[VK_SHIFT] = key_status[VK_LSHIFT] | key_status[VK_RSHIFT];
+       key_status[VK_CONTROL] = key_status[VK_LCONTROL] | key_status[VK_RCONTROL];
+       key_status[VK_MENU] = key_status[VK_LMENU] | key_status[VK_RMENU];
+       
+#ifdef NOTIFY_KEY_DOWN
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+       if(code == VK_LSHIFT || code == VK_RSHIFT) {
+               if(prev_shift != 0 && key_status[VK_SHIFT] == 0) {
+                       vm->key_up(VK_SHIFT);
+               }
+               return;
+       }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+       if(code == VK_LCONTROL|| code == VK_RCONTROL) {
+               if(prev_control != 0 && key_status[VK_CONTROL] == 0) {
+                       vm->key_up(VK_CONTROL);
+               }
+               return;
+       }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+       if(code == VK_LMENU || code == VK_RMENU) {
+               if(prev_menu != 0 && key_status[VK_MENU] == 0) {
+                       vm->key_up(VK_MENU);
+               }
+               return;
+       }
+#endif
+       vm->key_up(code);
+#endif
+}
+
 void OSD::key_down_sub(int code, bool repeat)
 {
        bool keep_frames = false;
index 723e740..0f81654 100644 (file)
@@ -29,8 +29,10 @@ void OSD::initialize_screen()
        
        vm_screen_width = SCREEN_WIDTH;
        vm_screen_height = SCREEN_HEIGHT;
-       vm_screen_width_aspect = SCREEN_WIDTH_ASPECT;
-       vm_screen_height_aspect = SCREEN_HEIGHT_ASPECT;
+       vm_window_width = WINDOW_WIDTH;
+       vm_window_height = WINDOW_HEIGHT;
+       vm_window_width_aspect = WINDOW_WIDTH_ASPECT;
+       vm_window_height_aspect = WINDOW_HEIGHT_ASPECT;
        
        QColor col(0, 0, 0, 255);
        //memset(&vm_screen_buffer, 0, sizeof(bitmap_t));
@@ -38,7 +40,7 @@ void OSD::initialize_screen()
        vm_screen_buffer.height = SCREEN_HEIGHT;
        vm_screen_buffer.pImage = QImage(SCREEN_WIDTH, SCREEN_HEIGHT, QImage::Format_ARGB32);
        vm_screen_buffer.pImage.fill(col);
-       now_rec_video = false;
+       now_record_video = false;
        //pAVIStream = NULL;
        //pAVICompressed = NULL;
        //pAVIFile = NULL;
@@ -50,7 +52,7 @@ void OSD::initialize_screen()
 
 void OSD::release_screen()
 {
-       stop_rec_video();
+       stop_record_video();
        
        //release_d3d9();
        //if(vm_screen_buffer.pImage != NULL) delete vm_screen_buffer.pImage;
@@ -60,24 +62,24 @@ void OSD::release_screen()
 int OSD::get_window_width(int mode)
 {
 #ifdef USE_SCREEN_ROTATE
-       if(config.rotate_type) {
-               return base_window_height + vm_screen_height_aspect * mode;
+       if(config.rotate_type == 1 || config.rotate_type == 3) {
+               return (config.window_stretch_type == 0 ? vm_window_height : vm_window_height_aspect) * (mode + WINDOW_MODE_BASE);
        }
 #endif
-       return base_window_width + vm_screen_width_aspect * mode;
+       return (config.window_stretch_type == 0 ? vm_window_width : vm_window_width_aspect) * (mode + WINDOW_MODE_BASE);
 }
 
 int OSD::get_window_height(int mode)
 {
 #ifdef USE_SCREEN_ROTATE
-       if(config.rotate_type) {
-               return base_window_width + vm_screen_width_aspect * mode;
+       if(config.rotate_type == 1 || config.rotate_type == 3) {
+               return (config.window_stretch_type == 0 ? vm_window_width : vm_window_width_aspect) * (mode + WINDOW_MODE_BASE);
        }
 #endif
-       return base_window_height + vm_screen_height_aspect * mode;
+       return (config.window_stretch_type == 0 ? vm_window_height : vm_window_height_aspect) * (mode + WINDOW_MODE_BASE);
 }
 
-void OSD::set_window_size(int window_width, int window_height, bool window_mode)
+void OSD::set_host_window_size(int window_width, int window_height, bool window_mode)
 {
        if(window_width != -1) {
                host_window_width = window_width;
@@ -91,28 +93,43 @@ void OSD::set_window_size(int window_width, int window_height, bool window_mode)
        first_invalidate = true;
 }
 
-void OSD::set_vm_screen_size(int width, int height, int width_aspect, int height_aspect, int window_width, int window_height)
+void OSD::set_vm_screen_size(int screen_width, int screen_height, int window_width, int window_height, int window_width_aspect, int window_height_aspect)
 {
-       if(vm_screen_width != width || vm_screen_height != height) {
-               if(width_aspect == -1) {
-                       width_aspect = width;
+       if(vm_screen_width != screen_width || vm_screen_height != screen_height) {
+               if(window_width == -1) {
+                       window_width = screen_width;
                }
-               if(height_aspect == -1) {
-                       height_aspect = height;
+               if(window_height == -1) {
+                       window_height = screen_height;
                }
-               int wold = vm_screen_width;
-               int hold = vm_screen_height;
-               vm_screen_width = width;
-               vm_screen_height = height;
-               vm_screen_width_aspect = width_aspect;
-               vm_screen_height_aspect = height_aspect;
-               base_window_width = window_width;
-               base_window_height = window_height;
+               if(window_width_aspect == -1) {
+                       window_width_aspect = window_width;
+               }
+               if(window_height_aspect == -1) {
+                       window_height_aspect = window_height;
+               }
+               vm_screen_width = screen_width;
+               vm_screen_height = screen_height;
+               vm_window_width = window_width;
+               vm_window_height = window_height;
+               vm_window_width_aspect = window_width_aspect;
+               vm_window_height_aspect = window_height_aspect;
+               
                // change the window size
-               //emit sig_resize_vm_screen(vm_screen_width, vm_screen_height);
+               emit sig_resize_vm_screen(&(vm_screen_buffer.pImage), vm_window_width, vm_window_height);
        }
+//     if(vm_screen_buffer.width != vm_screen_width || vm_screen_buffer.height != vm_screen_height) {
+//             if(now_record_video) {
+//                     stop_record_video();
+////                   stop_record_sound();
+//             }
+//             //initialize_screen_buffer(&vm_screen_buffer, vm_screen_width, vm_screen_height, COLORONCOLOR);
+//             initialize_screen_buffer(&vm_screen_buffer, vm_screen_width, vm_screen_height, 0);
+//             emit sig_resize_vm_screen(&(vm_screen_buffer.pImage), vm_window_width, vm_window_height);
+//     }
 }
 
+
 scrntype* OSD::get_vm_screen_buffer(int y)
 {
        return get_buffer(&vm_screen_buffer, y);
@@ -129,16 +146,16 @@ scrntype* OSD::get_buffer(bitmap_t *p, int y)
 int OSD::draw_screen()
 {
        // check avi file recording timing
-       if(now_rec_video && rec_video_run_frames <= 0) {
+       if(now_record_video && rec_video_run_frames <= 0) {
                return 0;
        }
        
        // draw screen
        lock_vm();
        if(vm_screen_buffer.width != vm_screen_width || vm_screen_buffer.height != vm_screen_height) {
-               if(now_rec_video) {
-                       stop_rec_video();
-//                     stop_rec_sound();
+               if(now_record_video) {
+                       stop_record_video();
+//                     stop_record_sound();
                }
                initialize_screen_buffer(&vm_screen_buffer, vm_screen_width, vm_screen_height, 0);
        }
@@ -157,7 +174,7 @@ int OSD::draw_screen()
        first_draw_screen = self_invalidate = true;
        
        // record avi file
-       if(now_rec_video) {
+       if(now_record_video) {
                return add_video_frames();
        } else {
                return 1;
@@ -219,7 +236,7 @@ void OSD::capture_screen()
        // create bitmap
 }
 
-bool OSD::start_rec_video(int fps)
+bool OSD::start_record_video(int fps)
 {
        if(fps > 0) {
                rec_video_fps = fps;
@@ -249,7 +266,7 @@ bool OSD::start_rec_video(int fps)
        strhdr.dwSuggestedBufferSize = video_screen_buffer.lpDib->bmiHeader.biSizeImage;
        SetRect(&strhdr.rcFrame, 0, 0, video_screen_buffer.width, video_screen_buffer.height);
        if(AVIFileCreateStream(pAVIFile, &pAVIStream, &strhdr) != AVIERR_OK) {
-               stop_rec_video();
+               stop_record_video();
                return false;
        }
        
@@ -258,15 +275,15 @@ bool OSD::start_rec_video(int fps)
        pOpts[0] = &AVIOpts;
        if(show_dialog && !AVISaveOptions(main_window_handle, ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE, 1, &pAVIStream, (LPAVICOMPRESSOPTIONS FAR *)&pOpts)) {
                AVISaveOptionsFree(1, (LPAVICOMPRESSOPTIONS FAR *)&pOpts);
-               stop_rec_video();
+               stop_record_video();
                return false;
        }
        if(AVIMakeCompressedStream(&pAVICompressed, pAVIStream, &AVIOpts, NULL) != AVIERR_OK) {
-               stop_rec_video();
+               stop_record_video();
                return false;
        }
        if(AVIStreamSetFormat(pAVICompressed, 0, &video_screen_buffer.lpDib->bmiHeader, video_screen_buffer.lpDib->bmiHeader.biSize + video_screen_buffer.lpDib->bmiHeader.biClrUsed * sizeof(RGBQUAD)) != AVIERR_OK) {
-               stop_rec_video();
+               stop_record_video();
                return false;
        }
        dwAVIFileSize = 0;
@@ -281,11 +298,11 @@ bool OSD::start_rec_video(int fps)
        rec_video_thread_param.frames = 0;
        rec_video_thread_param.result = 0;
 #endif 
-       now_rec_video = true;
+       now_record_video = true;
        return true;
 }
 
-void OSD::stop_rec_video()
+void OSD::stop_record_video()
 {
 #if 0
        // release thread
@@ -310,7 +327,7 @@ void OSD::stop_rec_video()
        pAVIFile = NULL;
        
        // repair header
-       if(now_rec_video) {
+       if(now_record_video) {
                FILE* fp = NULL;
                if((fp = _tfopen(bios_path(video_file_name), _T("r+b"))) != NULL) {
                        // copy fccHandler
@@ -325,15 +342,15 @@ void OSD::stop_rec_video()
                }
        }
 #endif 
-       now_rec_video = false;
+       now_record_video = false;
 }
 
-void OSD::restart_rec_video()
+void OSD::restart_record_video()
 {
-       bool tmp = now_rec_video;
-       stop_rec_video();
+       bool tmp = now_record_video;
+       stop_record_video();
        if(tmp) {
-               start_rec_video(-1);
+               start_record_video(-1);
        }
 }
 
@@ -376,12 +393,12 @@ int OSD::add_video_frames()
                        hVideoThread = (HANDLE)0;
                        
                        if(rec_video_thread_param.result == REC_VIDEO_FULL) {
-                               stop_rec_video();
-                               if(!start_rec_video(-1)) {
+                               stop_record_video();
+                               if(!start_record_video(-1)) {
                                        return 0;
                                }
                        } else if(rec_video_thread_param.result == REC_VIDEO_ERROR) {
-                               stop_rec_video();
+                               stop_record_video();
                                return 0;
                        }
                }
@@ -391,7 +408,7 @@ int OSD::add_video_frames()
                rec_video_thread_param.frames += counter;
                rec_video_thread_param.result = 0;
                if((hVideoThread = (HANDLE)_beginthreadex(NULL, 0, rec_video_thread, &rec_video_thread_param, 0, NULL)) == (HANDLE)0) {
-                       stop_rec_video();
+                       stop_record_video();
                        return 0;
                }
        }
index fde4d81..03ced5d 100644 (file)
@@ -89,9 +89,9 @@ void OSD::initialize_sound(int rate, int samples)
 
        sound_rate = rate;
        sound_samples = samples;
-       sound_ok = sound_started = now_mute = now_rec_sound = false;
+       sound_ok = sound_started = now_mute = now_record_sound = false;
        rec_sound_buffer_ptr = 0;
-       sound_ok = sound_started = now_mute = now_rec_sound = false;
+       sound_ok = sound_started = now_mute = now_record_sound = false;
        sound_write_pos = 0;
        sound_data_len = 0;
        sound_buffer_size = 0;
@@ -172,7 +172,7 @@ void OSD::release_sound()
        }
        if(sound_buf_ptr != NULL) free(sound_buf_ptr);
        // stop recording
-       stop_rec_sound();
+       stop_record_sound();
 }
 
 void OSD::update_sound(int* extra_frames)
@@ -206,14 +206,14 @@ void OSD::update_sound(int* extra_frames)
                //SDL_UnlockAudio();
                // sound buffer must be updated
                Sint16* sound_buffer = (Sint16 *)vm->create_sound(extra_frames);
-               if(now_rec_sound) {
+               if(now_record_sound) {
                        // record sound
                        if(sound_samples > rec_sound_buffer_ptr) {
                                int samples = sound_samples - rec_sound_buffer_ptr;
                                int length = samples * sizeof(uint16) * 2; // stereo
                                rec_sound_fio->Fwrite(sound_buffer + rec_sound_buffer_ptr * 2, length, 1);
                                rec_sound_bytes += length;
-                               if(now_rec_video) {
+                               if(now_record_video) {
                                        // sync video recording
                                        static double frames = 0;
                                        static int prev_samples = -1;
@@ -340,10 +340,10 @@ void OSD::stop_sound()
        }
 }
 
-void OSD::start_rec_sound()
+void OSD::start_record_sound()
 {
    
-       if(!now_rec_sound) {
+       if(!now_record_sound) {
                //LockVM();
                QDateTime nowTime = QDateTime::currentDateTime();
                QString tmps = QString::fromUtf8("Sound_Save_emu");
@@ -365,7 +365,7 @@ void OSD::start_rec_sound()
                        
                        rec_sound_bytes = 0;
                        rec_sound_buffer_ptr = 0;
-                       now_rec_sound = true;
+                       now_record_sound = true;
                } else {
                        // failed to open the wave file
                        delete rec_sound_fio;
@@ -374,9 +374,9 @@ void OSD::start_rec_sound()
        }
 }
 
-void OSD::stop_rec_sound()
+void OSD::stop_record_sound()
 {
-               if(now_rec_sound) {
+               if(now_record_sound) {
                        //LockVM();
                if(rec_sound_bytes == 0) {
                        rec_sound_fio->Fclose();
@@ -407,17 +407,17 @@ void OSD::stop_rec_sound()
                        rec_sound_fio->Fclose();
                }
                delete rec_sound_fio;
-               now_rec_sound = false;
+               now_record_sound = false;
                //UnlockVM();
        }
 }
 
-void OSD::restart_rec_sound()
+void OSD::restart_record_sound()
 {
-       bool tmp = now_rec_sound;
-       stop_rec_sound();
+       bool tmp = now_record_sound;
+       stop_record_sound();
        if(tmp) {
-               start_rec_sound();
+               start_record_sound();
        }
 }
 
index 37baa6c..8ab9869 100644 (file)
@@ -629,11 +629,11 @@ public:
        {
                return NULL;
        }
-       virtual uint32 get_debug_prog_addr_mask()
+       virtual uint32 debug_prog_addr_mask()
        {
                return 0;
        }
-       virtual uint32 get_debug_data_addr_mask()
+       virtual uint32 debug_data_addr_mask()
        {
                return 0;
        }
@@ -695,7 +695,7 @@ public:
        {
                return false;
        }
-       virtual void get_debug_regs_info(_TCHAR *buffer, size_t buffer_len) {}
+       virtual void debug_regs_info(_TCHAR *buffer, size_t buffer_len) {}
        virtual int debug_dasm(uint32 pc, _TCHAR *buffer, size_t buffer_len)
        {
                return 0;
index aff8f15..31f289c 100644 (file)
@@ -2208,12 +2208,14 @@ void DISPLAY::initialize()
 #else
        is_cyclesteal = false;
 #endif 
+//     emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
        emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
        enter_display();
        nmi_event_id = -1;
        firq_mask = false;
        key_firq_req = false;   //firq_mask = true;
        frame_skip_count = 3;
+       emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
 }
 
 void DISPLAY::release()
index 52bdd36..f78a52f 100644 (file)
@@ -118,10 +118,10 @@ FM7_MAINIO::FM7_MAINIO(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, paren
        dmac = NULL;
 #endif 
        memset(io_w_latch, 0xff, 0x100);
-       init_output_signals(&clock_status);
-       init_output_signals(&printer_reset_bus);
-       init_output_signals(&printer_strobe_bus);
-       init_output_signals(&printer_select_bus);
+       initialize_output_signals(&clock_status);
+       initialize_output_signals(&printer_reset_bus);
+       initialize_output_signals(&printer_strobe_bus);
+       initialize_output_signals(&printer_select_bus);
 }
 
 FM7_MAINIO::~FM7_MAINIO()
index 62386ab..4e44aaf 100644 (file)
@@ -71,7 +71,7 @@ void OSD::release_screen()
        release_screen_buffer(&video_screen_buffer);
 }
 
-int OSD::get_window_width(int mode)
+int OSD::get_vm_window_width(int mode)
 {
 #ifdef USE_SCREEN_ROTATE
        if(config.rotate_type == 1 || config.rotate_type == 3) {
@@ -81,7 +81,7 @@ int OSD::get_window_width(int mode)
        return (config.window_stretch_type == 0 ? vm_window_width : vm_window_width_aspect) * (mode + WINDOW_MODE_BASE);
 }
 
-int OSD::get_window_height(int mode)
+int OSD::get_vm_window_height(int mode)
 {
 #ifdef USE_SCREEN_ROTATE
        if(config.rotate_type == 1 || config.rotate_type == 3) {