OSDN Git Service

[VM][FM7] keyboard.cpp : Add implementation ofd RTC, includes within keyboard.
[csp-qt/common_source_project-fm7.git] / source / src / vm / tf20.h
1 /*
2         Skelton for retropc emulator
3
4         Author : Takeda.Toshiya
5         Date   : 2015.01.30-
6
7         [ EPSON TF-20 ]
8 */
9
10 #ifndef _TF20_H_
11 #define _TF20_H_
12
13 #include "vm.h"
14 #include "../emu.h"
15 #include "device.h"
16
17 class TF20 : public DEVICE
18 {
19 private:
20         DEVICE *d_cpu, *d_fdc, *d_pio, *d_sio;
21         
22         uint8 rom[0x800];
23         uint8 ram[0x10000];
24         bool rom_selected;
25         
26         uint8 wdmy[0x800];
27         uint8 rdmy[0x800];
28         uint8* wbank[32];
29         uint8* rbank[32];
30         
31 public:
32         TF20(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
33         {
34                 drive_no = 0;
35         }
36         ~TF20() {}
37         
38         // common functions
39         void initialize();
40         void reset();
41         uint32 read_data8(uint32 addr);
42         void write_data8(uint32 addr, uint32 data);
43         uint32 read_io8(uint32 addr);
44         void write_io8(uint32 addr, uint32 data);
45         uint32 intr_ack();
46         void save_state(FILEIO* state_fio);
47         bool load_state(FILEIO* state_fio);
48         
49         // unique functions
50         void set_context_cpu(DEVICE* device)
51         {
52                 d_cpu = device;
53         }
54         void set_context_fdc(DEVICE* device)
55         {
56                 d_fdc = device;
57         }
58         void set_context_pio(DEVICE* device)
59         {
60                 d_pio = device;
61         }
62         void set_context_sio(DEVICE* device)
63         {
64                 d_sio = device;
65         }
66         int drive_no;
67 };
68
69 #endif
70