trunk/src/emu/machine/pla.c
| r31132 | r31133 | |
| 30 | 30 | // pla_device - constructor |
| 31 | 31 | //------------------------------------------------- |
| 32 | 32 | |
| 33 | | pla_device::pla_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int inputs, int outputs, int terms, UINT32 input_mask, const char *shortname, const char *source) |
| 34 | | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 35 | | m_inputs(inputs), |
| 36 | | m_outputs(outputs), |
| 37 | | m_terms(terms), |
| 38 | | m_input_mask(((UINT64)input_mask << 32) | input_mask) |
| 33 | pla_device::pla_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int inputs, int outputs, int terms, UINT32 input_mask, const char *shortname, const char *source) : |
| 34 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 35 | m_inputs(inputs), |
| 36 | m_outputs(outputs), |
| 37 | m_terms(terms), |
| 38 | m_input_mask(((UINT64)input_mask << 32) | input_mask) |
| 39 | 39 | { |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | | pls100_device::pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 43 | | : pla_device(mconfig, PLS100, "PLS100", tag, owner, clock, 16, 8, 48, 0xffff, "pls100", __FILE__) |
| 42 | pls100_device::pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 43 | pla_device(mconfig, PLS100, "PLS100", tag, owner, clock, 16, 8, 48, 0xffff, "pls100", __FILE__), |
| 44 | m_output(*this, "output") |
| 44 | 45 | { |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | | mos8721_device::mos8721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 48 | | : pla_device(mconfig, MOS8721, "MOS8721", tag, owner, clock, 27, 18, 379, 0x7ffffff, "mos8721", __FILE__) // TODO actual number of terms is unknown |
| 48 | mos8721_device::mos8721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 49 | pla_device(mconfig, MOS8721, "MOS8721", tag, owner, clock, 27, 18, 379, 0x7ffffff, "mos8721", __FILE__) // TODO actual number of terms is unknown |
| 49 | 50 | { |
| 50 | 51 | } |
| 51 | 52 | |
| r31132 | r31133 | |
| 70 | 71 | m_cache_ptr = 0; |
| 71 | 72 | } |
| 72 | 73 | |
| 74 | void pls100_device::device_start() |
| 75 | { |
| 76 | pla_device::device_start(); |
| 73 | 77 | |
| 78 | m_output.allocate(0x10000); |
| 79 | |
| 80 | for (UINT32 input = 0; input < 0x10000; input++) |
| 81 | { |
| 82 | m_output[input] = pla_device::read(input); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | |
| 74 | 87 | //------------------------------------------------- |
| 75 | 88 | // parse_fusemap - |
| 76 | 89 | //------------------------------------------------- |
| r31132 | r31133 | |
| 163 | 176 | |
| 164 | 177 | return s >> 32; |
| 165 | 178 | } |
| 179 | |
| 180 | |
| 181 | //------------------------------------------------- |
| 182 | // read - |
| 183 | //------------------------------------------------- |
| 184 | |
| 185 | UINT32 pls100_device::read(UINT32 input) |
| 186 | { |
| 187 | return m_output[input]; |
| 188 | } |
trunk/src/emu/machine/pla.h
| r31132 | r31133 | |
| 68 | 68 | // construction/destruction |
| 69 | 69 | pla_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int inputs, int outputs, int terms, UINT32 output_mask, const char *shortname, const char *source); |
| 70 | 70 | |
| 71 | | UINT32 read(UINT32 input); |
| 71 | virtual UINT32 read(UINT32 input); |
| 72 | 72 | |
| 73 | 73 | protected: |
| 74 | 74 | // device-level overrides |
| r31132 | r31133 | |
| 101 | 101 | { |
| 102 | 102 | public: |
| 103 | 103 | pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 104 | |
| 105 | // device-level overrides |
| 106 | virtual void device_start(); |
| 107 | |
| 108 | virtual UINT32 read(UINT32 input); |
| 109 | |
| 110 | private: |
| 111 | optional_shared_ptr<UINT8> m_output; |
| 104 | 112 | }; |
| 105 | 113 | |
| 106 | 114 | |