OSDN Git Service

[INITIAL] Import 20141226 version of http://homepage3.nifty.com/takeda-toshiya/common...
[csp-qt/common_source_project-fm7.git] / source / src / vm / fp1100 / main.h
1 /*\r
2         CASIO FP-1100 Emulator 'eFP-1100'\r
3 \r
4         Author : Takeda.Toshiya\r
5         Date   : 2010.06.17-\r
6 \r
7         [ main pcb ]\r
8 */\r
9 \r
10 #ifndef _MAIN_H_\r
11 #define _MAIN_H_\r
12 \r
13 #include "../vm.h"\r
14 #include "../../emu.h"\r
15 #include "../device.h"\r
16 \r
17 #define SIG_MAIN_INTS   0\r
18 #define SIG_MAIN_INTA   1\r
19 #define SIG_MAIN_INTB   2\r
20 #define SIG_MAIN_INTC   3\r
21 #define SIG_MAIN_INTD   4\r
22 #define SIG_MAIN_COMM   5\r
23 \r
24 class MAIN : public DEVICE\r
25 {\r
26 private:\r
27         // to main cpu\r
28         DEVICE *d_cpu;\r
29         // to sub pcb\r
30         DEVICE *d_sub;\r
31         // to slots\r
32         DEVICE *d_slot[8];\r
33         \r
34         uint8 *wbank[16];\r
35         uint8 *rbank[16];\r
36         uint8 wdmy[0x1000];\r
37         uint8 rdmy[0x1000];\r
38         uint8 ram[0x10000];\r
39         uint8 rom[0x9000];\r
40         \r
41         uint8 comm_data;\r
42         uint8 slot_sel;\r
43         uint8 intr_mask;\r
44         uint8 intr_req;\r
45         \r
46         void update_intr();\r
47         \r
48 public:\r
49         MAIN(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)\r
50         {\r
51                 intr_mask = intr_req = 0;\r
52         }\r
53         ~MAIN() {}\r
54         \r
55         // common functions\r
56         void initialize();\r
57         void reset();\r
58         void write_data8(uint32 addr, uint32 data);\r
59         uint32 read_data8(uint32 addr);\r
60         void write_io8(uint32 addr, uint32 data);\r
61         uint32 read_io8(uint32 addr);\r
62         void write_signal(int id, uint32 data, uint32 mask);\r
63         uint32 intr_ack();\r
64         void intr_reti();\r
65         \r
66         // unique functions\r
67         void set_context_cpu(DEVICE *device)\r
68         {\r
69                 d_cpu = device;\r
70         }\r
71         void set_context_sub(DEVICE *device)\r
72         {\r
73                 d_sub = device;\r
74         }\r
75         void set_context_slot(int slot, DEVICE *device)\r
76         {\r
77                 d_slot[slot] = device;\r
78         }\r
79 };\r
80 \r
81 #endif\r