OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc8801 / pc8801.h
index 6740aac..a7d8479 100644 (file)
 #define CPU_TYPE_DEFAULT       1
 #endif
 #define USE_DIPSWITCH
-#define USE_DEVICE_TYPE                2
-#define USE_FD1
-#define USE_FD2
-#define USE_TAPE
+#define USE_JOYSTICK_TYPE      2
+#define USE_FLOPPY_DISK                2
+#define USE_TAPE               1
 #define TAPE_BINARY_ONLY
 #define NOTIFY_KEY_DOWN
+#define USE_KEY_LOCKED
 #define USE_SHIFT_NUMPAD_KEY
 #define USE_ALT_F10_KEY
 // slow enough for N88-\93ú\96{\8cêBASIC
 #define USE_AUTO_KEY           8
 #define USE_AUTO_KEY_RELEASE   10
+#define USE_AUTO_KEY_NUMPAD
 #define USE_MONITOR_TYPE       2
-#define USE_CRT_FILTER
+#define USE_SCREEN_FILTER
 #define USE_SCANLINE
-#define USE_SCREEN_ROTATE
-#define USE_ACCESS_LAMP
 #ifdef SUPPORT_PC88_OPNA
 #ifdef SUPPORT_PC88_SB2
-#define USE_SOUND_DEVICE_TYPE  3
+#define USE_SOUND_TYPE         6
 #else
-#define USE_SOUND_DEVICE_TYPE  2
+#define USE_SOUND_TYPE         2
 #endif
 #endif
-#define USE_SOUND_FILES 3
-#define USE_SOUND_FILES_FDD
-//#define USE_SOUND_FILES_RELAY
-
-#if defined(USE_SOUND_FILES)
 #if    defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) &&  defined(SUPPORT_PC88_PCG8100)
 #define USE_SOUND_VOLUME       (4 + 4 + 1 + 1 + 1)
 #elif  defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
 #elif  defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
 #define USE_SOUND_VOLUME       (4 + 0 + 0 + 1 + 1)
 #elif !defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) &&  defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (2 + 4 + 1 + 1 + 1)
+#define USE_SOUND_VOLUME       (2 + 2 + 1 + 1 + 1)
 #elif !defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (2 + 4 + 0 + 1 + 1)
+#define USE_SOUND_VOLUME       (2 + 2 + 0 + 1 + 1)
 #elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) &&  defined(SUPPORT_PC88_PCG8100)
 #define USE_SOUND_VOLUME       (2 + 0 + 1 + 1 + 1)
 #elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
 #define USE_SOUND_VOLUME       (2 + 0 + 0 + 1 + 1)
 #endif
-#else
-#if    defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) &&  defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (4 + 4 + 1 + 1)
-#elif  defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (4 + 4 + 0 + 1)
-#elif  defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) &&  defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (4 + 0 + 1 + 1)
-#elif  defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (4 + 0 + 0 + 1)
-#elif !defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) &&  defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (2 + 4 + 1 + 1)
-#elif !defined(SUPPORT_PC88_OPNA) &&  defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (2 + 4 + 0 + 1)
-#elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) &&  defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (2 + 0 + 1 + 1)
-#elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
-#define USE_SOUND_VOLUME       (2 + 0 + 0 + 1)
-#endif
-#endif
+
+#define SUPPORT_TV_RENDER
 #define USE_JOYSTICK
 #define USE_MOUSE
 #define USE_PRINTER
-#define USE_PRINTER_TYPE       4
+#define USE_PRINTER_TYPE       3
 #define USE_DEBUGGER
 #define USE_STATE
+#define USE_CPU_Z80
 
 #include "../../common.h"
 #include "../../fileio.h"
+#include "../vm_template.h"
 
 #ifdef USE_SOUND_VOLUME
 static const _TCHAR *sound_device_caption[] = {
@@ -156,15 +135,16 @@ static const _TCHAR *sound_device_caption[] = {
        _T("OPN (FM)"), _T("OPN (PSG)"),
 #endif
 #ifdef SUPPORT_PC88_SB2
+#ifdef SUPPORT_PC88_OPNA
        _T("SB2 (FM)"), _T("SB2 (PSG)"), _T("SB2 (ADPCM)"), _T("SB2 (Rhythm)"),
+#else
+       _T("SB2 (FM)"), _T("SB2 (PSG)"),
+#endif
 #endif
 #ifdef SUPPORT_PC88_PCG8100
        _T("PCG-8100"),
 #endif
-       _T("Beep"),
-#if defined(USE_SOUND_FILES)
-       _T("FDD"),
-#endif
+       _T("Beep"), _T("Noise (FDD)"),
 };
 #endif
 
@@ -174,6 +154,7 @@ class EVENT;
 
 class I8251;
 class I8255;
+class NOISE;
 class PCM1BIT;
 class UPD1990A;
 class YM2203;
@@ -185,12 +166,14 @@ class UPD765A;
 #ifdef SUPPORT_PC88_PCG8100
 class I8253;
 #endif
-class PC88;
-
-class VM
+namespace PC88DEV {
+       class PC88;
+}
+class VM : public VM_TEMPLATE
 {
 protected:
-       EMU* emu;
+       //EMU* emu;
+       //csp_state_utils* state_entry;
        
        // devices
        EVENT* pc88event;
@@ -210,6 +193,9 @@ protected:
        PC80S31K* pc88sub;
        I8255* pc88pio_sub;
        UPD765A* pc88fdc_sub;
+       NOISE* pc88noise_seek;
+       NOISE* pc88noise_head_down;
+       NOISE* pc88noise_head_up;
        Z80* pc88cpu_sub;
 #ifdef SUPPORT_PC88_PCG8100
        I8253* pc88pit;
@@ -218,7 +204,7 @@ protected:
        PCM1BIT* pc88pcm2;
 #endif
        
-       PC88* pc88;
+       PC88DEV::PC88* pc88;
        
        int boot_mode;
        
@@ -246,7 +232,6 @@ public:
        
        // draw screen
        void draw_screen();
-       uint32_t get_access_lamp_status();
        
        // sound generation
        void initialize_sound(int rate, int samples);
@@ -259,6 +244,8 @@ public:
        // notify key
        void key_down(int code, bool repeat);
        void key_up(int code);
+       bool get_caps_locked();
+       bool get_kana_locked();
        
        // user interface
        void open_floppy_disk(int drv, const _TCHAR* file_path, int bank);
@@ -266,15 +253,15 @@ public:
        bool is_floppy_disk_inserted(int drv);
        void is_floppy_disk_protected(int drv, bool value);
        bool is_floppy_disk_protected(int drv);
-       void play_tape(const _TCHAR* file_path);
-       void rec_tape(const _TCHAR* file_path);
-       void close_tape();
-       bool is_tape_inserted();
+       uint32_t is_floppy_disk_accessed();
+       void play_tape(int drv, const _TCHAR* file_path);
+       void rec_tape(int drv, const _TCHAR* file_path);
+       void close_tape(int drv);
+       bool is_tape_inserted(int drv);
        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
@@ -282,9 +269,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