OSDN Git Service

[VM][General] Apply Upstream 2018-10-07.Still WIP.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz80k / mz80k.h
index 89e3481..530c5bc 100644 (file)
 // device informations for win32
 #define USE_DIPSWITCH
 #define USE_TAPE               1
-#define USE_TAPE_BUTTON
-#define NOTIFY_KEY_DOWN
 #define USE_KEY_LOCKED
-#define USE_SHIFT_NUMPAD_KEY
-#define USE_ALT_F10_KEY
 #define USE_AUTO_KEY           5
 #define USE_AUTO_KEY_RELEASE   6
 #define USE_AUTO_KEY_NO_CAPS
@@ -81,6 +77,7 @@
 
 #include "../../common.h"
 #include "../../fileio.h"
+#include "../vm_template.h"
 
 #ifdef USE_SOUND_VOLUME
 static const _TCHAR *sound_device_caption[] = {
@@ -106,27 +103,33 @@ class LS393;
 class PCM1BIT;
 class Z80;
 
-class KEYBOARD;
-class MEMORY;
-class PRINTER;
-
+namespace MZ80 {
+       class KEYBOARD;
+       class MEMORY;
+       class PRINTER;
+}
 #if defined(SUPPORT_MZ80AIF)
 class MB8877;
 class IO;
-class MZ80AIF;
+namespace MZ80 {
+       class MZ80AIF;
+}
 #elif defined(SUPPORT_MZ80FIO)
-class T3444A;
 class IO;
-class MZ80FIO;
+class T3444A;
+namespace MZ80 {
+       class MZ80FIO;
+}
 #endif
 
-class VM
+class VM : public VM_TEMPLATE
 {
 protected:
-       EMU* emu;
+       //EMU* emu;
+       //csp_state_utils* state_entry;
        
        // devices
-       EVENT* event;
+       //EVENT* event;
        
 #if defined(_MZ1200) || defined(_MZ80A)
        AND* and_int;
@@ -138,18 +141,18 @@ protected:
        PCM1BIT* pcm;
        Z80* cpu;
        
-       KEYBOARD* keyboard;
-       MEMORY* memory;
-       PRINTER* printer;
+       MZ80::KEYBOARD* keyboard;
+       MZ80::MEMORY* memory;
+       MZ80::PRINTER* printer;
        
 #if defined(SUPPORT_MZ80AIF)
        MB8877* fdc;
        IO* io;
-       MZ80AIF* mz80aif;
+       MZ80::MZ80AIF* mz80aif;
 #elif defined(SUPPORT_MZ80FIO)
        T3444A* fdc;
        IO* io;
-       MZ80FIO* mz80fio;
+       MZ80::MZ80FIO* mz80fio;
 #endif
        
 public:
@@ -167,6 +170,10 @@ public:
        // drive virtual machine
        void reset();
        void run();
+       double get_frame_rate()
+       {
+               return FRAMES_PER_SEC;
+       }
        
 #ifdef USE_DEBUGGER
        // debugger
@@ -216,8 +223,7 @@ public:
        bool is_frame_skippable();
        
        void update_config();
-       void save_state(FILEIO* state_fio);
-       bool load_state(FILEIO* state_fio);
+       bool process_state(FILEIO* state_fio, bool loading);
        
        // ----------------------------------------
        // for each device
@@ -225,9 +231,9 @@ public:
        
        // devices
        DEVICE* get_device(int id);
-       DEVICE* dummy;
-       DEVICE* first_device;
-       DEVICE* last_device;
+       //DEVICE* dummy;
+       //DEVICE* first_device;
+       //DEVICE* last_device;
 };
 
 #endif