OSDN Git Service

[VM][General] Merge Upstream 20180530.
[csp-qt/common_source_project-fm7.git] / source / src / vm / x1 / floppy.h
1 /*
2         SHARP X1 Emulator 'eX1'
3         SHARP X1twin Emulator 'eX1twin'
4         SHARP X1turbo Emulator 'eX1turbo'
5         SHARP X1turboZ Emulator 'eX1turboZ'
6
7         Author : Takeda.Toshiya
8         Date   : 2009.03.14-
9
10         [ floppy ]
11 */
12
13 #ifndef _FLOPPY_H_
14 #define _FLOPPY_H_
15
16 #include "../vm.h"
17 #include "../../emu.h"
18 #include "../device.h"
19
20 class MB8877;
21 #ifdef _X1TURBO_FEATURE
22 class Z80DMA;
23 #endif
24
25 class FLOPPY : public DEVICE
26 {
27 private:
28         MB8877 *d_fdc;
29         int prev;
30         bool motor_on;
31         int register_id;
32         
33 public:
34         FLOPPY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
35         {
36                 prev = 0;
37                 motor_on = false;
38                 set_device_name(_T("Floppy I/F"));
39         }
40         ~FLOPPY() {}
41         
42         // common functions
43         void reset();
44         void write_io8(uint32_t addr, uint32_t data);
45 #ifdef _X1TURBO_FEATURE
46         uint32_t read_io8(uint32_t addr);
47 #endif
48         void event_callback(int event_id, int err);
49         void decl_state();
50         void save_state(FILEIO* state_fio);
51         bool load_state(FILEIO* state_fio);
52         
53         // unique functions
54         void set_context_fdc(MB8877* device)
55         {
56                 d_fdc = device;
57         }
58 };
59
60 #endif
61