OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc6001 / pc6001.h
index 30c1e5a..a02cc0a 100644 (file)
 #define MC6847_ATTR_INV                0x01
 
 // device informations for win32
-#define USE_CART1
-#define USE_FD1
-#define USE_FD2
+#define USE_CART               1
 #if defined(_PC6601) || defined(_PC6601SR)
-#define USE_FD3
-#define USE_FD4
+#define USE_FLOPPY_DISK                4
+#else
+#define USE_FLOPPY_DISK                2
 #endif
-#define USE_TAPE
-//#define USE_TAPE_PTR
+#define USE_TAPE               1
+#define USE_TAPE_BUTTON
 #define TAPE_PC6001
 #define NOTIFY_KEY_DOWN
 #define USE_SHIFT_NUMPAD_KEY
 #define USE_AUTO_KEY_RELEASE   10
 #define USE_AUTO_KEY_CAPS
 #if !defined(_PC6001)
-#define USE_CRT_FILTER
+#define USE_SCREEN_FILTER
 #define USE_SCANLINE
 #endif
-#define USE_ACCESS_LAMP
 #if defined(_PC6001)
-#define USE_SOUND_VOLUME       2
+#define USE_SOUND_VOLUME       4
 #else
-#define USE_SOUND_VOLUME       3
+#define USE_SOUND_VOLUME       5
 #endif
+#define USE_JOYSTICK
 #define USE_PRINTER
+#define USE_PRINTER_TYPE       3
 #define USE_DEBUGGER
 #define USE_STATE
-#define USE_JOYSTICK
-#define USE_CRT_MONITOR_4_3 1
-//#define USE_MOUSE
+#define USE_CPU_MCS48
+#define USE_CPU_Z80
 
 #include "../../common.h"
 #include "../../fileio.h"
+#include "../vm_template.h"
 
 #ifdef USE_SOUND_VOLUME
 static const _TCHAR *sound_device_caption[] = {
@@ -118,10 +118,9 @@ static const _TCHAR *sound_device_caption[] = {
 #if !defined(_PC6001)
        _T("Voice"),
 #endif
-       _T("CMT"),
+       _T("CMT (Signal)"), _T("Noise (FDD)"), _T("Noise (CMT)"),
 };
 #endif
-
 class EMU;
 class DEVICE;
 class EVENT;
@@ -133,57 +132,77 @@ class MC6847;
 #else
 class UPD7752;
 #endif
+class NOISE;
 class PC6031;
 class PC80S31K;
 class UPD765A;
+#if defined(_PC6001MK2SR) || defined(_PC6601SR)
 class YM2203;
+#else
+class AY_3_891X;
+#endif
 class Z80;
 
 class DATAREC;
 class MCS48;
 
 #ifdef _PC6001
-class DISPLAY;
+namespace PC6001 {
+       class DISPLAY;
+}
 #endif
 #if defined(_PC6601) || defined(_PC6601SR)
-class FLOPPY;
+namespace PC6001 {
+       class FLOPPY;
+}
 #endif
-class JOYSTICK;
-class MEMORY;
-class PSUB;
-class SUB;
-class TIMER;
 
-class VM
+namespace PC6001 {
+       class JOYSTICK;
+       class MEMORY;
+       class PSUB;
+       class SUB;
+       class TIMER;
+}
+
+class VM : public VM_TEMPLATE
 {
 protected:
-       EMU* emu;
+       //EMU* emu;
+
        int vdata;
        
        // devices
-       EVENT* event;
+       //EVENT* event;
        
        DEVICE* printer;
        I8255* pio_sub;
        IO* io;
+       NOISE* noise_seek;
+       NOISE* noise_head_down;
+       NOISE* noise_head_up;
+#if defined(_PC6001MK2SR) || defined(_PC6601SR)
        YM2203* psg;
+#else
+       AY_3_891X* psg;
+#endif
        Z80* cpu;
 #ifdef _PC6001
        MC6847* vdp;
-       DISPLAY* display;
+       PC6001::DISPLAY* display;
 #else
        UPD7752* voice;
 #endif
 #if defined(_PC6601) || defined(_PC6601SR)
-       FLOPPY* floppy;
+       PC6001::FLOPPY* floppy;
 #endif
-       JOYSTICK* joystick;
-       MEMORY* memory;
-       PSUB* psub;
-       TIMER* timer;
+       PC6001::JOYSTICK* joystick;
+       PC6001::MEMORY* memory;
+       PC6001::PSUB* psub;
+       PC6001::TIMER* timer;
        
        MCS48* cpu_sub;
-       SUB* sub;
+       PC6001::SUB* sub;
        DATAREC* drec;
        
        PC6031* pc6031;
@@ -222,7 +241,7 @@ public:
        
        // sound generation
        void initialize_sound(int rate, int samples);
-       uint16* create_sound(int* extra_frames);
+       uint16_t* create_sound(int* extra_frames);
        int get_sound_buffer_ptr();
 #ifdef USE_SOUND_VOLUME
        void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
@@ -236,24 +255,30 @@ public:
        void open_cart(int drv, const _TCHAR* file_path);
        void close_cart(int drv);
        bool is_cart_inserted(int drv);
-       int get_access_lamp_status();
        void open_floppy_disk(int drv, const _TCHAR* file_path, int bank);
        void close_floppy_disk(int drv);
        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();
-       bool is_tape_playing();
-       bool is_tape_recording();
-       int get_tape_position();
+       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_tape_playing(int drv);
+       bool is_tape_recording(int drv);
+       int get_tape_position(int drv);
+       const _TCHAR* get_tape_message(int drv);
+       void push_play(int drv);
+       void push_stop(int drv);
+       void push_fast_forward(int drv);
+       void push_fast_rewind(int drv);
+       void push_apss_forward(int drv) {}
+       void push_apss_rewind(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
@@ -261,9 +286,9 @@ public:
        
        // devices
        DEVICE* get_device(int id);
-       DEVICE* dummy;
-       DEVICE* first_device;
-       DEVICE* last_device;
+       //DEVICE* dummy;
+       //DEVICE* first_device;
+       //DEVICE* last_device;
        
        int sr_mode;
 };