OSDN Git Service

[General] Merge Updtream 2020-08-10.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz2500 / mz2500.cpp
index edb6bfd..6f082a4 100644 (file)
@@ -75,7 +75,7 @@ using MZ2500::TIMER;
 // initialize
 // ----------------------------------------------------------------------------
 
-VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
+VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
 {
        // create devices
        first_device = last_device = NULL;
@@ -94,7 +94,13 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        fdc->set_context_noise_seek(new NOISE(this, emu));
        fdc->set_context_noise_head_down(new NOISE(this, emu));
        fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+//     fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
        pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+//     pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
        rtc = new RP5C01(this, emu);    // RP-5C15
        sasi_host = new SCSI_HOST(this, emu);
        sasi_hdd = new SASI_HDD(this, emu);
@@ -313,13 +319,13 @@ void VM::reset()
        opn->write_signal(SIG_YM2203_PORT_B, (monitor_type & 2) ? 0x77 : 0x37, 0xff);
 }
 
-void VM::special_reset()
+void VM::special_reset(int num)
 {
        // reset all devices
 //     for(DEVICE* device = first_device; device; device = device->next_device) {
 //             device->special_reset();
 //     }
-       memory->special_reset();
+       memory->special_reset(num);
        cpu->reset();
 }
 
@@ -620,6 +626,18 @@ void VM::update_config()
        }
 }
 
+double VM::get_current_usec()
+{
+       if(event == NULL) return 0.0;
+       return event->get_current_usec();
+}
+
+uint64_t VM::get_current_clock_uint64()
+{
+               if(event == NULL) return (uint64_t)0;
+               return event->get_current_clock_uint64();
+}
+
 #define STATE_VERSION  8
 
 bool VM::process_state(FILEIO* state_fio, bool loading)
@@ -632,7 +650,7 @@ bool VM::process_state(FILEIO* state_fio, bool loading)
                // const char *name = typeid(*device).name();
                //       But, using get_device_name() instead of typeid(foo).name() 20181008 K.O
                const char *name = device->get_device_name();
-               int len = strlen(name);
+               int len = (int)strlen(name);
                
                if(!state_fio->StateCheckInt32(len)) {
                        if(loading) {