trunk/src/emu/machine/pla.c
| r18454 | r18455 | |
| 30 | 30 | |
| 31 | 31 | inline void pla_device::parse_fusemap() |
| 32 | 32 | { |
| 33 | memory_region *region = machine().root_device().memregion(tag()); |
| 33 | 34 | jed_data jed; |
| 34 | | jedbin_parse(machine().root_device().memregion(tag())->base(), machine().root_device().memregion(tag())->bytes(), &jed); |
| 35 | |
| 36 | jedbin_parse(region->base(), region->bytes(), &jed); |
| 37 | |
| 38 | //logerror("PLA '%s' %u fuses\n", tag(), jed.numfuses); |
| 39 | |
| 35 | 40 | UINT32 fusenum = 0; |
| 36 | 41 | m_xor = 0; |
| 37 | 42 | |
| r18454 | r18455 | |
| 51 | 56 | { |
| 52 | 57 | m_or[term] |= !jed_get_fuse(&jed, fusenum++) << f; |
| 53 | 58 | } |
| 59 | |
| 60 | //logerror("PLA '%s' %3u COMP %08x TRUE %08x OR %08x\n", tag(), term, m_and_comp[term], m_and_true[term], m_or[term]); |
| 54 | 61 | } |
| 55 | 62 | |
| 56 | 63 | for (int f = 0; f < m_outputs; f++) |
| 57 | 64 | { |
| 58 | 65 | m_xor |= jed_get_fuse(&jed, fusenum++) << f; |
| 59 | 66 | } |
| 67 | |
| 68 | //logerror("PLA '%s' XOR %08x\n", tag(), m_xor); |
| 60 | 69 | } |
| 61 | 70 | |
| 62 | 71 | |
| r18454 | r18455 | |
| 66 | 75 | |
| 67 | 76 | inline bool pla_device::get_product(int term) |
| 68 | 77 | { |
| 78 | UINT32 input_comp = m_and_comp[term] | ~m_i; |
| 69 | 79 | UINT32 input_true = m_and_true[term] | m_i; |
| 70 | | UINT32 input_comp = m_and_comp[term] | ~m_i; |
| 71 | 80 | |
| 72 | | return ((input_true & input_comp) & m_output_mask) == m_output_mask; |
| 81 | //logerror("PLA '%s' %3u COMP %08x TRUE %08x OR %08x : %u\n", tag(), term, ~input_comp & m_output_mask, ~input_true & m_output_mask, m_or[term], (((input_comp & input_true) & m_output_mask) == m_output_mask)); |
| 82 | |
| 83 | return ((input_comp & input_true) & m_output_mask) == m_output_mask; |
| 73 | 84 | } |
| 74 | 85 | |
| 75 | 86 | |
| r18454 | r18455 | |
| 115 | 126 | } |
| 116 | 127 | |
| 117 | 128 | mos8721_device::mos8721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 118 | | : pla_device(mconfig, MOS8721, "MOS8721", tag, owner, clock, 27, 18, 48, 0x7ffffff) |
| 129 | : pla_device(mconfig, MOS8721, "MOS8721", tag, owner, clock, 27, 18, 379, 0x7ffffff) // TODO actual number of terms is unknown |
| 119 | 130 | { |
| 120 | 131 | } |
| 121 | 132 | |