OSDN Git Service

[VM][FM7][WIP] Fix still not working some software without re-construct VMs at FM...
authorK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 6 Apr 2016 18:35:57 +0000 (03:35 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 6 Apr 2016 18:35:57 +0000 (03:35 +0900)
source/src/emu.cpp
source/src/vm/fm7/fm7.cpp
source/src/vm/fm7/fm7.h
source/src/vm/fm7/fm7_mainio.cpp

index db81202..21de4c6 100644 (file)
@@ -91,16 +91,16 @@ EMU::EMU()
        osd->instance_handle = hinst;
 #endif
        osd->initialize(sound_rate, sound_samples);
-       
        // initialize vm
        osd->vm = vm = new VM(this);
-// Below is temporally workaround. I will fix ASAP (or give up): 20160311 K.Ohta
-// Problems seem to be resolved. See fm7.cpp. 20160319 K.Ohta
-//#if defined(_FM7) || defined(_FMNEW7) || defined(_FM8) ||    \
-//     defined(_FM77_VARIANTS) || defined(_FM77AV_VARIANTS)
-       //delete vm;
-       //osd->vm = vm = new VM(this);
-//#endif
+       // Below is temporally workaround. I will fix ASAP (or give up): 20160311 K.Ohta
+       // Problems seem to be resolved. See fm7.cpp. 20160319 K.Ohta
+       // Still not resolved with FM-7/77 :-( 20160407 K.Ohta
+#if defined(_FM7) || defined(_FMNEW7) || defined(_FM8) || \
+       defined(_FM77_VARIANTS)
+       delete vm;
+       osd->vm = vm = new VM(this);
+#endif
 #ifdef USE_AUTO_KEY
        initialize_auto_key();
 #endif
index 383b29d..449252d 100644 (file)
@@ -111,6 +111,8 @@ VM::VM(EMU* parent_emu): emu(parent_emu)
 #if defined(_FM8) || defined(_FM7) || defined(_FMNEW7)
        if((config.dipswitch & FM7_DIPSW_CONNECT_KANJIROM) != 0) {
                kanjiclass1 = new KANJIROM(this, emu, false);
+       } else {
+               kanjiclass1 = NULL;
        }
 #else
        kanjiclass1 = new KANJIROM(this, emu, false);
@@ -118,10 +120,6 @@ VM::VM(EMU* parent_emu): emu(parent_emu)
 #ifdef CAPABLE_KANJI_CLASS2
        kanjiclass2 = new KANJIROM(this, emu, true);
 #endif
-       
-       //mainmem = new FM7_MAINMEM(this, emu);
-
-
 #if defined(USE_LED_DEVICE)
        led_terminate = new DUMMYDEVICE(this, emu);
 #else
@@ -340,7 +338,6 @@ void VM::connect_bus(void)
        z80cpu->set_context_debugger(new DEBUGGER(this, emu));
 # endif
 #endif
-
        for(DEVICE* device = first_device; device; device = device->next_device) {
                device->initialize();
        }
@@ -353,11 +350,7 @@ void VM::connect_bus(void)
 #else
                fdc->set_drive_type(i, DRIVE_TYPE_2D);
 #endif
-#if defined(_FM77AV_VARIANTS)
-               fdc->set_drive_rpm(i, 360);
-#else          
                fdc->set_drive_rpm(i, 360);
-#endif         
                fdc->set_drive_mfm(i, true);
        }
 #if defined(_FM77) || defined(_FM77L4)
@@ -535,6 +528,11 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
        } else if(ch-- == 0) {
                drec->set_volume(0, decibel_l, decibel_r);
        }
+#if defined(_FM77AV_VARIANTS)
+        else if(ch-- == 0) {
+               keyboard_beep->set_volume(0, decibel_l, decibel_r);
+       }
+#endif 
 }
 #endif
 
index ebf2ca6..c94b841 100644 (file)
@@ -320,6 +320,9 @@ static const _TCHAR *sound_device_caption[] = {
 # endif
        _T("OPN (FM)"), _T("OPN (PSG)"), _T("WHG (FM)"), _T("WHG (PSG)"), _T("THG (FM)"), _T("THG (PSG)"),
        _T("Beep"), _T("CMT"),
+# if defined(_FM77AV_VARIANTS)
+       _T("Keyboard"),
+# endif
 #endif 
 };
 #endif
@@ -392,7 +395,7 @@ protected:
 #endif
        MB8877* fdc;
 #if defined(_FM8)
-       YM2203 *psg;
+       YM2203psg;
 #else  
        YM2203* opn[3];
 # if !defined(_FM77AV_VARIANTS)
index 837b611..6ced85b 100644 (file)
@@ -215,10 +215,8 @@ void FM7_MAINIO::reset()
 #endif
        // Around boot rom
 #if defined(_FM77_VARIANTS)
-       //boot_ram = (mainmem->read_signal(FM7_MAINIO_BOOTRAM_RW) == 0) ? false : true;
        boot_ram = false;
 #elif defined(_FM77AV_VARIANTS)
-       //boot_ram = (mainmem->read_signal(FM7_MAINIO_BOOTRAM_RW) == 0) ? false : true;
        boot_ram = true;
 #endif
        // FD05
@@ -333,7 +331,6 @@ void FM7_MAINIO::set_clockmode(uint8_t flags)
        }
        if(f != clock_fast) {
                this->write_signal(FM7_MAINIO_CLOCKMODE, clock_fast ? 1 : 0, 1);
-               //mainmem->write_signal(FM7_MAINIO_CLOCKMODE, clock_fast ? 1 : 0, 1);
        }
 }