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 / nor.h
1 /*\r
2         Skelton for retropc emulator\r
3 \r
4         Author : Takeda.Toshiya\r
5         Date   : 2008.06.10-\r
6 \r
7         [ nor gate ]\r
8 */\r
9 \r
10 #ifndef _NOR_H_\r
11 #define _NOR_H_\r
12 \r
13 #include "vm.h"\r
14 #include "../emu.h"\r
15 #include "device.h"\r
16 \r
17 #define SIG_NOR_BIT_0   0x01\r
18 #define SIG_NOR_BIT_1   0x02\r
19 #define SIG_NOR_BIT_2   0x04\r
20 #define SIG_NOR_BIT_3   0x08\r
21 #define SIG_NOR_BIT_4   0x10\r
22 #define SIG_NOR_BIT_5   0x20\r
23 #define SIG_NOR_BIT_6   0x40\r
24 #define SIG_NOR_BIT_7   0x80\r
25 \r
26 class NOR : public DEVICE\r
27 {\r
28 private:\r
29         outputs_t outputs;\r
30         uint32 bits_in;\r
31         bool prev, first;\r
32         \r
33 public:\r
34         NOR(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)\r
35         {\r
36                 init_output_signals(&outputs);\r
37                 bits_in = 0;\r
38                 prev = first = true;\r
39         }\r
40         ~NOR() {}\r
41         \r
42         // common functions\r
43         void write_signal(int id, uint32 data, uint32 mask);\r
44         void save_state(FILEIO* state_fio);\r
45         bool load_state(FILEIO* state_fio);\r
46         \r
47         // unique function\r
48         void set_context_out(DEVICE* device, int id, uint32 mask)\r
49         {\r
50                 register_output_signal(&outputs, device, id, mask);\r
51         }\r
52 };\r
53 \r
54 #endif\r
55 \r