OSDN Git Service

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