diff options
author | Curt Coder <curtcoder@mail.com> | 2012-09-11 14:30:18 +0000 |
---|---|---|
committer | Curt Coder <curtcoder@mail.com> | 2012-09-11 14:30:18 +0000 |
commit | 1df58104fedb600014fa1c1908bf8ee7972b48d4 (patch) | |
tree | 7521f5b6fd21750b69167788d259604aea41cabb /src/emu | |
parent | 1b2cab76dfab1d31854df0143488b14266320864 (diff) |
Generalized the PLS100 into a PLA device of variable amounts of inputs/outputs/terms. [Curt Coder]
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/emu.mak | 22 | ||||
-rw-r--r-- | src/emu/machine/pla.c (renamed from src/emu/machine/pls100.c) | 48 | ||||
-rw-r--r-- | src/emu/machine/pla.h (renamed from src/emu/machine/pls100.h) | 55 |
3 files changed, 81 insertions, 44 deletions
diff --git a/src/emu/emu.mak b/src/emu/emu.mak index 6351390faee..67d9bb9bde0 100644 --- a/src/emu/emu.mak +++ b/src/emu/emu.mak @@ -223,17 +223,17 @@ EMUMACHINEOBJS = \ $(EMUMACHINE)/netlist.o \ $(EMUMACHINE)/net_lib.o \ $(EMUMACHINE)/nmc9306.o \ - $(EMUMACHINE)/nscsi_bus.o \ - $(EMUMACHINE)/nscsi_cd.o \ - $(EMUMACHINE)/nscsi_hd.o \ + $(EMUMACHINE)/nscsi_bus.o \ + $(EMUMACHINE)/nscsi_cd.o \ + $(EMUMACHINE)/nscsi_hd.o \ $(EMUMACHINE)/nvram.o \ $(EMUMACHINE)/pc16552d.o \ - $(EMUMACHINE)/pci.o \ + $(EMUMACHINE)/pci.o \ $(EMUMACHINE)/pd4990a.o \ $(EMUMACHINE)/pic8259.o \ $(EMUMACHINE)/pit8253.o \ - $(EMUMACHINE)/pls100.o \ - $(EMUMACHINE)/ram.o \ + $(EMUMACHINE)/pla.o \ + $(EMUMACHINE)/ram.o \ $(EMUMACHINE)/roc10937.o \ $(EMUMACHINE)/rp5c01.o \ $(EMUMACHINE)/rp5c15.o \ @@ -293,7 +293,7 @@ EMUVIDEOOBJS = \ $(EMUVIDEO)/huc6261.o \ $(EMUVIDEO)/huc6270.o \ $(EMUVIDEO)/huc6272.o \ - $(EMUVIDEO)/i8275.o \ + $(EMUVIDEO)/i8275.o \ $(EMUVIDEO)/k053250.o \ $(EMUVIDEO)/m50458.o \ $(EMUVIDEO)/mb90082.o \ @@ -302,12 +302,12 @@ EMUVIDEOOBJS = \ $(EMUVIDEO)/pc_cga.o \ $(EMUVIDEO)/cgapal.o \ $(EMUVIDEO)/pc_vga.o \ - $(EMUVIDEO)/poly.o \ - $(EMUVIDEO)/psx.o \ + $(EMUVIDEO)/poly.o \ + $(EMUVIDEO)/psx.o \ $(EMUVIDEO)/ramdac.o \ $(EMUVIDEO)/resnet.o \ $(EMUVIDEO)/rgbutil.o \ - $(EMUVIDEO)/s2636.o \ + $(EMUVIDEO)/s2636.o \ $(EMUVIDEO)/saa5050.o \ $(EMUVIDEO)/sed1330.o \ $(EMUVIDEO)/tlc34076.o \ @@ -315,7 +315,7 @@ EMUVIDEOOBJS = \ $(EMUVIDEO)/tms9927.o \ $(EMUVIDEO)/tms9928a.o \ $(EMUVIDEO)/upd3301.o \ - $(EMUVIDEO)/v9938.o \ + $(EMUVIDEO)/v9938.o \ $(EMUVIDEO)/vector.o \ $(EMUVIDEO)/voodoo.o \ diff --git a/src/emu/machine/pls100.c b/src/emu/machine/pla.c index 2f3a0ba2d85..28c1609e11a 100644 --- a/src/emu/machine/pls100.c +++ b/src/emu/machine/pla.c @@ -7,8 +7,7 @@ **********************************************************************/ -#include "emu.h" -#include "pls100.h" +#include "pla.h" @@ -17,6 +16,7 @@ //************************************************************************** const device_type PLS100 = &device_creator<pls100_device>; +const device_type MOS8721 = &device_creator<mos8721_device>; @@ -28,32 +28,32 @@ const device_type PLS100 = &device_creator<pls100_device>; // parse_fusemap - //------------------------------------------------- -inline void pls100_device::parse_fusemap() +inline void pla_device::parse_fusemap() { jed_data jed; jedbin_parse(machine().root_device().memregion(tag())->base(), machine().root_device().memregion(tag())->bytes(), &jed); UINT32 fusenum = 0; m_xor = 0; - for (int term = 0; term < PAL_TERMS; term++) + for (int term = 0; term < m_terms; term++) { m_and_comp[term] = 0; m_and_true[term] = 0; m_or[term] = 0; - for (int i = 0; i < PAL_INPUTS; i++) + for (int i = 0; i < m_inputs; i++) { m_and_comp[term] |= jed_get_fuse(&jed, fusenum++) << i; m_and_true[term] |= jed_get_fuse(&jed, fusenum++) << i; } - for (int f = 0; f < PAL_OUTPUTS; f++) + for (int f = 0; f < m_outputs; f++) { m_or[term] |= !jed_get_fuse(&jed, fusenum++) << f; } } - for (int f = 0; f < PAL_OUTPUTS; f++) + for (int f = 0; f < m_outputs; f++) { m_xor |= jed_get_fuse(&jed, fusenum++) << f; } @@ -64,12 +64,12 @@ inline void pls100_device::parse_fusemap() // get_product - //------------------------------------------------- -inline int pls100_device::get_product(int term) +inline int pla_device::get_product(int term) { - UINT16 input_true = m_and_true[term] | m_i; - UINT16 input_comp = m_and_comp[term] | (m_i ^ 0xffff); + UINT32 input_true = m_and_true[term] | m_i; + UINT32 input_comp = m_and_comp[term] | ~m_i; - return (input_true & input_comp) == 0xffff; + return ((input_true & input_comp) & m_output_mask) == m_output_mask; } @@ -77,11 +77,11 @@ inline int pls100_device::get_product(int term) // update_outputs - //------------------------------------------------- -inline void pls100_device::update_outputs() +inline void pla_device::update_outputs() { m_s = 0; - for (int term = 0; term < PAL_TERMS; term++) + for (int term = 0; term < m_terms; term++) { if (get_product(term)) { @@ -97,11 +97,25 @@ inline void pls100_device::update_outputs() //************************************************************************** //------------------------------------------------- -// pls100_device - constructor +// pla_device - constructor //------------------------------------------------- +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 output_mask) + : device_t(mconfig, type, name, tag, owner, clock), + m_inputs(inputs), + m_outputs(outputs), + m_terms(terms), + m_output_mask(output_mask) +{ +} + pls100_device::pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, PLS100, "PLS100", tag, owner, clock) + : pla_device(mconfig, PLS100, "PLS100", tag, owner, clock, 16, 8, 48, 0xffff) +{ +} + +mos8721_device::mos8721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pla_device(mconfig, MOS8721, "MOS8721", tag, owner, clock, 27, 18, 48, 0x7ffffff) { } @@ -110,7 +124,7 @@ pls100_device::pls100_device(const machine_config &mconfig, const char *tag, dev // device_start - device-specific startup //------------------------------------------------- -void pls100_device::device_start() +void pla_device::device_start() { // parse fusemap assert(machine().root_device().memregion(tag()) != NULL); @@ -126,7 +140,7 @@ void pls100_device::device_start() // read - //------------------------------------------------- -UINT8 pls100_device::read(UINT16 input) +UINT32 pla_device::read(UINT32 input) { m_i = input; diff --git a/src/emu/machine/pls100.h b/src/emu/machine/pla.h index 80f9cc7d09a..1a20a8f0280 100644 --- a/src/emu/machine/pls100.h +++ b/src/emu/machine/pla.h @@ -26,8 +26,8 @@ #pragma once -#ifndef __PLS100__ -#define __PLS100__ +#ifndef __PLA__ +#define __PLA__ #include "emu.h" #include "jedparse.h" @@ -38,9 +38,7 @@ // MACROS / CONSTANTS //************************************************************************** -#define PAL_INPUTS 16 -#define PAL_OUTPUTS 8 -#define PAL_TERMS 48 +#define MAX_TERMS 512 @@ -51,42 +49,67 @@ #define MCFG_PLS100_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, PLS100, 0) +#define MCFG_MOS8721_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, MOS8721, 0) ///************************************************************************* // TYPE DEFINITIONS ///************************************************************************* -// ======================> pls100_device +// ======================> pla_device -class pls100_device : public device_t +class pla_device : public device_t { public: // construction/destruction - pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + 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); - UINT8 read(UINT16 input); + UINT32 read(UINT32 input); protected: // device-level overrides virtual void device_start(); -private: inline void parse_fusemap(); inline int get_product(int term); inline void update_outputs(); - UINT16 m_i; - UINT8 m_s; - UINT16 m_and_true[PAL_TERMS]; - UINT16 m_and_comp[PAL_TERMS]; - UINT16 m_or[PAL_TERMS]; - UINT8 m_xor; + int m_inputs; + int m_outputs; + int m_terms; + UINT32 m_output_mask; + + UINT32 m_i; + UINT32 m_s; + UINT32 m_and_true[MAX_TERMS]; + UINT32 m_and_comp[MAX_TERMS]; + UINT32 m_or[MAX_TERMS]; + UINT32 m_xor; +}; + + +// ======================> pls100_device + +class pls100_device : public pla_device +{ +public: + pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +// ======================> mos8721_device + +class mos8721_device : public pla_device +{ +public: + mos8721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // device type definition extern const device_type PLS100; +extern const device_type MOS8721; |