OSDN Git Service

[BUILD] Set SOVERSION and GIT hash automatically.
[csp-qt/common_source_project-fm7.git] / source / src / vm / fmr50 / floppy.h
1 /*
2         FUJITSU FMR-50 Emulator 'eFMR-50'
3         FUJITSU FMR-60 Emulator 'eFMR-60'
4
5         Author : Takeda.Toshiya
6         Date   : 2008.04.30 -
7
8         [ floppy ]
9 */
10
11 #ifndef _FLOPPY_H_
12 #define _FLOPPY_H_
13
14 #include "../vm.h"
15 #include "../../emu.h"
16 #include "../device.h"
17
18 #define SIG_FLOPPY_IRQ  0
19
20 class MB8877;
21
22 class FLOPPY : public DEVICE
23 {
24 private:
25         MB8877 *d_fdc;
26         DEVICE *d_pic;
27         
28         int drvreg, drvsel;
29         bool irq, irqmsk, 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         void decl_state();
46         void save_state(FILEIO* state_fio);
47         bool load_state(FILEIO* state_fio);
48         
49         // unique functions
50         void set_context_fdc(MB8877* device)
51         {
52                 d_fdc = device;
53         }
54         void set_context_pic(DEVICE* device)
55         {
56                 d_pic = device;
57         }
58         void change_disk(int drv)
59         {
60                 changed[drv] = true;
61         }
62 };
63
64 #endif
65