OSDN Git Service

[VM][FMTOWNS][MEMORY] Fix setup around memory banks by I/O 0404h and 0480h.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz2500 / cmt.h
1 /*
2         SHARP MZ-80B Emulator 'EmuZ-80B'
3         SHARP MZ-2200 Emulator 'EmuZ-2200'
4         SHARP MZ-2500 Emulator 'EmuZ-2500'
5
6         Author : Takeda.Toshiya
7         Date   : 2006.12.04 -
8
9         [ cmt ]
10 */
11
12 #ifndef _CMT_H_
13 #define _CMT_H_
14
15 #include "../vm.h"
16 #include "../../emu.h"
17 #include "../device.h"
18
19 #define SIG_CMT_PIO_PA  0
20 #define SIG_CMT_PIO_PC  1
21 #define SIG_CMT_OUT     2
22 #define SIG_CMT_REMOTE  3
23 #define SIG_CMT_END     4
24 #define SIG_CMT_TOP     5
25
26 class DATAREC;
27
28 namespace MZ2500 {
29
30 class CMT : public DEVICE
31 {
32 private:
33         DEVICE* d_pio;
34         DATAREC *d_drec;
35
36 #if defined(_MZ2500)
37         bool is_mz80b;
38 #endif
39         uint8_t pa, pc;
40         bool play, rec;
41         bool now_play, now_rewind;
42         int register_id_frew;
43         int register_id_ffwd;
44         int register_id_fwd;
45         int register_id_stop;
46         int register_id_eject;
47 #if !defined(_MZ80B)
48         int register_id_apss;
49         bool now_apss;
50         bool now_apss_tmp;
51 #endif
52         int register_id_ipl;
53
54         void fast_forward();
55         void fast_rewind();
56         void forward();
57         void stop();
58
59 public:
60         CMT(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : DEVICE(parent_vm, parent_emu)
61         {
62                 set_device_name(_T("CMT I/F"));
63         }
64         ~CMT() {}
65
66         // common functions
67         void initialize();
68         void reset();
69         void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
70         void __FASTCALL event_callback(int event_id, int err);
71         bool process_state(FILEIO* state_fio, bool loading);
72
73         // unique function
74         void set_context_pio(DEVICE* device)
75         {
76                 d_pio = device;
77         }
78         void set_context_drec(DATAREC* device)
79         {
80                 d_drec = device;
81         }
82         void play_tape(bool value);
83         void rec_tape(bool value);
84         void close_tape();
85 };
86 }
87
88 #endif