OSDN Git Service

[VM] MEMORY:: class within some VM will change Foo_MEMORY:: to reduce misundestanding...
[csp-qt/common_source_project-fm7.git] / source / src / vm / fmr30 / floppy.h
1 /*
2         FUJITSU FMR-30 Emulator 'eFMR-30'
3
4         Author : Takeda.Toshiya
5         Date   : 2008.12.31 -
6
7         [ floppy ]
8 */
9
10 #ifndef _FLOPPY_H_
11 #define _FLOPPY_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 #define SIG_FLOPPY_IRQ  0
18
19 class MB8877;
20
21 class FLOPPY : public DEVICE
22 {
23 private:
24         MB8877 *d_fdc;
25         DEVICE *d_pic;
26         
27         uint8_t fdcr, fdsl, fdst;
28         int drvsel;
29         bool irq, changed[4];
30         void update_intr();
31         
32 public:
33         FLOPPY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
34         {
35                 set_device_name(_T("Floppy I/F"));
36         }
37         ~FLOPPY() {}
38         
39         // common functions
40         void initialize();
41         void reset();
42         void write_io8(uint32_t addr, uint32_t data);
43         uint32_t read_io8(uint32_t addr);
44         void write_signal(int id, uint32_t data, uint32_t mask);
45         bool process_state(FILEIO* state_fio, bool loading);
46         
47         // unique functions
48         void set_context_fdc(MB8877* device)
49         {
50                 d_fdc = device;
51         }
52         void set_context_pic(DEVICE* device)
53         {
54                 d_pic = device;
55         }
56         void change_disk(int drv)
57         {
58                 changed[drv] = true;
59         }
60 };
61
62 #endif
63