diff options
author | MooglyGuy <therealmogminer@gmail.com> | 2019-06-18 01:49:37 +0200 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2019-06-18 01:50:20 +0200 |
commit | 56af5d0d267e9665802ef47bf9d6c918bdcc8d46 (patch) | |
tree | 12bd978e7dca8cb25c86917ea531db7cc6ea9b53 | |
parent | f8f4f7998d6612e7073e3c3c1325e01e6a2caaeb (diff) |
-dpb_brushproc: Added skeleton device for DPB-7000 Brush Processor Card. [Ryan Holtz]
-am25s55x: Initial device implementation for Am25S557 and 25S558 Combinatorial Multiplier chips. [Ryan Holtz]
-dpb_combiner: Fixed validation, nw
-dpb7000: Added devices for new Brush Processor Card skeleton, nw
-rw-r--r-- | scripts/src/machine.lua | 12 | ||||
-rw-r--r-- | scripts/target/mame/arcade.lua | 1 | ||||
-rw-r--r-- | scripts/target/mame/mess.lua | 3 | ||||
-rw-r--r-- | src/devices/machine/am25s55x.cpp | 204 | ||||
-rw-r--r-- | src/devices/machine/am25s55x.h | 110 | ||||
-rw-r--r-- | src/mame/drivers/dpb7000.cpp | 11 | ||||
-rw-r--r-- | src/mame/video/dpb_brushproc.cpp | 177 | ||||
-rw-r--r-- | src/mame/video/dpb_brushproc.h | 90 | ||||
-rw-r--r-- | src/mame/video/dpb_combiner.cpp | 5 | ||||
-rw-r--r-- | src/mame/video/dpb_combiner.h | 3 |
10 files changed, 609 insertions, 7 deletions
diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index 089d4b80154..cc7119fa555 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -600,6 +600,18 @@ end --------------------------------------------------- -- +--@src/devices/machine/am25s55x.h,MACHINES["AM25S55X"] = true +--------------------------------------------------- + +if (MACHINES["AM25S55X"]~=null) then + files { + MAME_DIR .. "src/devices/machine/am25s55x.cpp", + MAME_DIR .. "src/devices/machine/am25s55x.h", + } +end + +--------------------------------------------------- +-- --@src/devices/machine/am2847.h,MACHINES["AM2847"] = true --------------------------------------------------- diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index d25eaa8c899..d3eced5fdc1 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -408,6 +408,7 @@ MACHINES["ADC083X"] = true MACHINES["ADC1038"] = true MACHINES["ADC1213X"] = true MACHINES["AICARTC"] = true +--MACHINES["AM25S55X"] = true --MACHINES["AM2847"] = true --MACHINES["AM2910"] = true MACHINES["AM53CF96"] = true diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 49eea0436b4..d055213f768 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -412,6 +412,7 @@ MACHINES["ADC083X"] = true MACHINES["ADC1038"] = true MACHINES["ADC1213X"] = true MACHINES["AICARTC"] = true +MACHINES["AM25S55X"] = true MACHINES["AM2847"] = true MACHINES["AM2910"] = true MACHINES["AM53CF96"] = true @@ -3895,6 +3896,8 @@ files { MAME_DIR .. "src/mame/drivers/dpb7000.cpp", MAME_DIR .. "src/mame/video/dpb_combiner.cpp", MAME_DIR .. "src/mame/video/dpb_combiner.h", + MAME_DIR .. "src/mame/video/dpb_brushproc.cpp", + MAME_DIR .. "src/mame/video/dpb_brushproc.h", MAME_DIR .. "src/mame/drivers/dps1.cpp", MAME_DIR .. "src/mame/drivers/dsb46.cpp", MAME_DIR .. "src/mame/drivers/dual68.cpp", diff --git a/src/devices/machine/am25s55x.cpp b/src/devices/machine/am25s55x.cpp new file mode 100644 index 00000000000..c1b4bbd310b --- /dev/null +++ b/src/devices/machine/am25s55x.cpp @@ -0,0 +1,204 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/*************************************************************************** + + am25s55x.h + AMD Am25S557/Am25S558 8x8-bit Combinatorial Multiplier + +***************************************************************************/ + +#include "emu.h" +#include "am25s55x.h" + +/*****************************************************************************/ + +DEFINE_DEVICE_TYPE(AM25S557, am25s557_device, "am25s557", "AMD Am25S557 Combinatorial Multiplier") +DEFINE_DEVICE_TYPE(AM25S558, am25s558_device, "am25s558", "AMD Am25S558 Combinatorial Multiplier") + +//------------------------------------------------- +// am25s55x_device - constructor +//------------------------------------------------- + +am25s55x_device::am25s55x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , m_x_in(0) + , m_y_in(0) + , m_xm(false) + , m_ym(false) + , m_oe(false) + , m_round_s(false) + , m_round_u(false) + , m_s(*this) +{ +} + +am25s557_device::am25s557_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : am25s55x_device(mconfig, AM25S557, tag, owner, clock) + , m_r(false) +{ +} + +am25s558_device::am25s558_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : am25s55x_device(mconfig, AM25S558, tag, owner, clock) +{ +} + +void am25s55x_device::device_start() +{ + save_item(NAME(m_x_in)); + save_item(NAME(m_y_in)); + save_item(NAME(m_xm)); + save_item(NAME(m_ym)); + save_item(NAME(m_oe)); + save_item(NAME(m_round_s)); + save_item(NAME(m_round_u)); + save_item(NAME(m_x.u)); + save_item(NAME(m_y.u)); + save_item(NAME(m_s_out.u)); + + m_s.resolve_safe(); +} + +void am25s55x_device::device_reset() +{ + m_x_in = 0; + m_y_in = 0; + m_xm = false; + m_ym = false; + m_oe = false; + m_round_s = false; + m_round_u = false; + + m_x.u = 0; + m_y.u = 0; + m_s_out.u = 0; +} + +void am25s55x_device::x_w(uint8_t data) +{ + m_x_in = data; +} + +void am25s55x_device::y_w(uint8_t data) +{ + m_y_in = data; +} + +void am25s55x_device::xm_w(int state) +{ + m_xm = (bool)state; +} + +void am25s55x_device::ym_w(int state) +{ + m_ym = (bool)state; +} + +void am25s55x_device::oe_w(int state) +{ + m_oe = (bool)state; +} + +void am25s55x_device::multiply() +{ + if (m_xm) + { + if (m_ym) + { + m_s_out.s = (int16_t)m_x.u * (int16_t)m_y.u; + } + else + { + m_s_out.s = (int16_t)m_x.u * (uint16_t)m_y.u; + } + } + else + { + if (m_ym) + { + m_s_out.s = (uint16_t)m_x.u * (int16_t)m_y.u; + } + else + { + m_s_out.u = (uint16_t)m_x.u * (uint16_t)m_y.u; + } + } + + if (m_round_u) + m_s_out.u += 0x80; + if (m_round_s) + m_s_out.u += 0x40; + + if (!m_oe) + m_s(m_s_out.u); +} + +// +// Am25S557, combined signed/unsigned rounding pin +// + +void am25s557_device::device_start() +{ + am25s55x_device::device_start(); + save_item(NAME(m_r)); +} + +void am25s557_device::device_reset() +{ + am25s55x_device::device_reset(); + m_r = false; +} + +void am25s557_device::xm_w(int state) +{ + am25s55x_device::xm_w(state); + update_rounding(); +} + +void am25s557_device::ym_w(int state) +{ + am25s55x_device::ym_w(state); + update_rounding(); +} + +void am25s557_device::r_w(int state) +{ + m_r = (bool)state; + update_rounding(); +} + +void am25s557_device::update_rounding() +{ + if (m_r) + { + if (m_xm || m_ym) + { + m_round_s = true; + m_round_u = false; + } + else + { + m_round_s = false; + m_round_u = true; + } + } + else + { + m_round_s = false; + m_round_u = false; + } +} + +// +// Am25S558, separate signed/unsigned rounding pins +// + +void am25s558_device::rs_w(int state) +{ + m_round_s = (bool)state; +} + +void am25s558_device::ru_w(int state) +{ + m_round_u = (bool)state; +} diff --git a/src/devices/machine/am25s55x.h b/src/devices/machine/am25s55x.h new file mode 100644 index 00000000000..6501c6065c3 --- /dev/null +++ b/src/devices/machine/am25s55x.h @@ -0,0 +1,110 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/*************************************************************************** + + am25s55x.h + AMD Am25S557/Am25S558 8x8-bit Combinatorial Multiplier + +***************************************************************************/ + +#ifndef MAME_MACHINE_AM25S55X_H +#define MAME_MACHINE_AM25S55X_H + +#pragma once + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> am25s557_base_device + +class am25s55x_device : public device_t +{ +public: + // construction/destruction + am25s55x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock = 0); + + void x_w(uint8_t data); + void y_w(uint8_t data); + virtual void xm_w(int state); + virtual void ym_w(int state); + void oe_w(int state); + + auto s() { return m_s.bind(); } + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + void multiply(); + + union input_reg + { + int8_t s; + uint8_t u; + }; + + union output_reg + { + int16_t s; + uint16_t u; + }; + + uint8_t m_x_in; + uint8_t m_y_in; + bool m_xm; + bool m_ym; + bool m_oe; + + bool m_round_s; + bool m_round_u; + + input_reg m_x; + input_reg m_y; + output_reg m_s_out; + + devcb_write16 m_s; +}; + + +// ======================> am25s557_device + +class am25s557_device : public am25s55x_device +{ +public: + // construction/destruction + am25s557_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + virtual void xm_w(int state) override; + virtual void ym_w(int state) override; + + void r_w(int state); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + void update_rounding(); + + bool m_r; +}; + + +// ======================> am25s558_device + +class am25s558_device : public am25s55x_device +{ +public: + // construction/destruction + am25s558_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + void rs_w(int state); + void ru_w(int state); +}; + +// device type definition +DECLARE_DEVICE_TYPE(AM25S557, am25s557_device) +DECLARE_DEVICE_TYPE(AM25S558, am25s558_device) + +#endif // MAME_MACHINE_AM25S55X_H diff --git a/src/mame/drivers/dpb7000.cpp b/src/mame/drivers/dpb7000.cpp index 39964991c0e..de8138cdb24 100644 --- a/src/mame/drivers/dpb7000.cpp +++ b/src/mame/drivers/dpb7000.cpp @@ -13,11 +13,13 @@ #include "cpu/m68000/m68000.h" #include "cpu/m6800/m6801.h" #include "machine/6850acia.h" +#include "machine/am25s55x.h" #include "machine/am2910.h" #include "machine/com8116.h" #include "machine/input_merger.h" #include "machine/tdc1008.h" #include "video/mc6845.h" +#include "video/dpb_brushproc.h" #include "video/dpb_combiner.h" #include "emupal.h" #include "screen.h" @@ -68,6 +70,7 @@ public: , m_filter_ce(*this, "filter_ce") , m_filter_cf(*this, "filter_cf") , m_filter_cg(*this, "filter_cg") + , m_brush_proc(*this, "brush_proc%u", 0U) , m_combiner(*this, "combiner") { } @@ -158,6 +161,7 @@ private: required_device<tdc1008_device> m_filter_cf; required_device<tdc1008_device> m_filter_cg; + required_device_array<dpb7000_brushproc_card_device, 2> m_brush_proc; required_device<dpb7000_combiner_card_device> m_combiner; emu_timer *m_diskseq_clk; @@ -1180,6 +1184,10 @@ void dpb7000_state::dpb7000(machine_config &config) TDC1008(config, m_filter_cf); TDC1008(config, m_filter_cg); + // Brush Processor Cards + DPB7000_BRUSHPROC(config, m_brush_proc[0]); + DPB7000_BRUSHPROC(config, m_brush_proc[1]); + // Combiner Card DPB7000_COMBINER(config, m_combiner, 14.318181_MHz_XTAL); } @@ -1222,6 +1230,9 @@ ROM_START( dpb7000 ) ROM_REGION(0x800, "fddprom", 0) ROM_LOAD("17446a-gd-m2716.bin", 0x000, 0x800, CRC(a0be00ca) SHA1(48c4f8c07b9f6bc9b68698e1e326782e0b01e1b0)) + ROM_REGION(0x100, "brushstore_prom", 0) + ROM_LOAD("pb-02a-17421-ada.bin", 0x000, 0x100, CRC(84bf7029) SHA1(9d58322994f6f7e99a9c6478577559c8171670ed)) + ROM_REGION(0xc00, "storeaddr_x_prom", 0) ROM_LOAD("pb-032-17425b-bbb.bin", 0x000, 0x400, CRC(2051a6e4) SHA1(3bd8a9015e77b034a94fe072a9753649b76f9f69)) ROM_LOAD("pb-032-17425b-bcb.bin", 0x400, 0x400, CRC(01aaa6f7) SHA1(e31bff0c68f74996368443bfb58a3524a838f270)) diff --git a/src/mame/video/dpb_brushproc.cpp b/src/mame/video/dpb_brushproc.cpp new file mode 100644 index 00000000000..702c7bad950 --- /dev/null +++ b/src/mame/video/dpb_brushproc.cpp @@ -0,0 +1,177 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/*************************************************************************** + + dpb_brushproc.cpp + DPB-7000/1 - Brush Processor Card + +***************************************************************************/ + +#include "emu.h" +#include "dpb_brushproc.h" + +#define VERBOSE (1) +#include "logmacro.h" + +/*****************************************************************************/ + +DEFINE_DEVICE_TYPE(DPB7000_BRUSHPROC, dpb7000_brushproc_card_device, "dpb_brushproc", "Quantel DPB-7000 Brush Processor Card") + + +//------------------------------------------------- +// dpb7000_brushproc_card_device - constructor +//------------------------------------------------- + +dpb7000_brushproc_card_device::dpb7000_brushproc_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, DPB7000_BRUSHPROC, tag, owner, clock) + , m_ext_in(0) + , m_brush_in(0) + , m_k_in(0) + , m_k_enable(0) + , m_k_zero(false) + , m_k_invert(false) + , m_func(0) + , m_sel_eh(false) + , m_b_bus_ah(false) + , m_fcs(false) + , m_store1(*this) + , m_store2(*this) + , m_cbus(*this) + , m_pck(*this) + , m_mult_fa(*this, "mult_fa") + , m_mult_ga(*this, "mult_ga") + , m_mult_gd(*this, "mult_gd") +{ +} + +void dpb7000_brushproc_card_device::device_start() +{ + save_item(NAME(m_store_in)); + save_item(NAME(m_ext_in)); + save_item(NAME(m_brush_in)); + + save_item(NAME(m_k_in)); + save_item(NAME(m_k_enable)); + save_item(NAME(m_k_zero)); + save_item(NAME(m_k_invert)); + + save_item(NAME(m_func)); + + save_item(NAME(m_sel_luma)); + save_item(NAME(m_sel_eh)); + save_item(NAME(m_b_bus_ah)); + save_item(NAME(m_fcs)); + + m_store1.resolve_safe(); + m_store2.resolve_safe(); + m_cbus.resolve_safe(); + m_pck.resolve_safe(); +} + +void dpb7000_brushproc_card_device::device_reset() +{ + memset(m_store_in, 0, 2); + m_ext_in = 0; + m_brush_in = 0; + + m_k_in = 0; + m_k_enable = 0; + m_k_zero = 0; + m_k_invert = 0; + + m_func = 0; + + memset(m_sel_luma, 0, 2); + m_sel_eh = 0; + m_b_bus_ah = 0; + m_fcs = 0; +} + +void dpb7000_brushproc_card_device::device_add_mconfig(machine_config &config) +{ + AM25S558(config, m_mult_fa); + AM25S558(config, m_mult_ga); + AM25S558(config, m_mult_gd); +} + +ROM_START( dpb7000_brushproc ) + ROM_REGION(0x200, "brushproc_prom", 0) + ROM_LOAD("pb-02c-17593-baa.bin", 0x000, 0x200, CRC(a74cc1f5) SHA1(3b789d5a29c70c93dec56f44be8c14b41915bdef)) +ROM_END + +const tiny_rom_entry *dpb7000_brushproc_card_device::device_rom_region() const +{ + return ROM_NAME( dpb7000_brushproc ); +} + +void dpb7000_brushproc_card_device::store1_w(uint8_t data) +{ + m_store_in[0] = data; +} + +void dpb7000_brushproc_card_device::store2_w(uint8_t data) +{ + m_store_in[1] = data; +} + +void dpb7000_brushproc_card_device::ext_w(uint8_t data) +{ + m_ext_in = data; +} + +void dpb7000_brushproc_card_device::brush_w(uint8_t data) +{ + m_brush_in = data; +} + + +void dpb7000_brushproc_card_device::k_w(uint8_t data) +{ + m_k_in = data; +} + +void dpb7000_brushproc_card_device::k_en_w(int state) +{ + m_k_enable = (bool)state; +} + +void dpb7000_brushproc_card_device::k_zero_w(int state) +{ + m_k_zero = (bool)state; +} + +void dpb7000_brushproc_card_device::k_inv_w(int state) +{ + m_k_invert = (bool)state; +} + + +void dpb7000_brushproc_card_device::func_w(uint8_t data) +{ + m_func = data; +} + +void dpb7000_brushproc_card_device::sel_lum1_w(int state) +{ + m_sel_luma[0] = (bool)state; +} + +void dpb7000_brushproc_card_device::sel_lum2_w(int state) +{ + m_sel_luma[1] = (bool)state; +} + +void dpb7000_brushproc_card_device::sel_eh_w(int state) +{ + m_sel_eh = (bool)state; +} + +void dpb7000_brushproc_card_device::b_bus_ah_w(int state) +{ + m_b_bus_ah = (bool)state; +} + +void dpb7000_brushproc_card_device::fixed_col_select_w(int state) +{ + m_fcs = (bool)state; +} diff --git a/src/mame/video/dpb_brushproc.h b/src/mame/video/dpb_brushproc.h new file mode 100644 index 00000000000..e5522cea817 --- /dev/null +++ b/src/mame/video/dpb_brushproc.h @@ -0,0 +1,90 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/*************************************************************************** + + dpb_brushproc.h + DPB-7000/1 - Brush Processor Card + + TODO: + - Everything + +***************************************************************************/ + +#ifndef MAME_VIDEO_DPB_BRUSHPROC_H +#define MAME_VIDEO_DPB_BRUSHPROC_H + +#pragma once + +#include "machine/am25s55x.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> dpb7000_brushproc_card_device + +class dpb7000_brushproc_card_device : public device_t +{ +public: + // construction/destruction + dpb7000_brushproc_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + void store1_w(uint8_t data); + void store2_w(uint8_t data); + void ext_w(uint8_t data); + void brush_w(uint8_t data); + + void k_w(uint8_t data); + void k_en_w(int state); + void k_zero_w(int state); + void k_inv_w(int state); + + void func_w(uint8_t data); + void sel_lum1_w(int state); + void sel_lum2_w(int state); + void sel_eh_w(int state); + void b_bus_ah_w(int state); + void fixed_col_select_w(int state); + + auto store1() { return m_store1.bind(); } + auto store2() { return m_store2.bind(); } + auto cbus() { return m_cbus.bind(); } + auto pck() { return m_pck.bind(); } + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + uint8_t m_store_in[2]; + uint8_t m_ext_in; + uint8_t m_brush_in; + + uint8_t m_k_in; + bool m_k_enable; + bool m_k_zero; + bool m_k_invert; + + uint8_t m_func; + + bool m_sel_luma[2]; + bool m_sel_eh; + bool m_b_bus_ah; + bool m_fcs; + + devcb_write8 m_store1; + devcb_write8 m_store2; + devcb_write8 m_cbus; + devcb_write_line m_pck; + required_device<am25s558_device> m_mult_fa; + required_device<am25s558_device> m_mult_ga; + required_device<am25s558_device> m_mult_gd; +}; + +// device type definition +DECLARE_DEVICE_TYPE(DPB7000_BRUSHPROC, dpb7000_brushproc_card_device) + +#endif // MAME_VIDEO_DPB_BRUSHPROC_H diff --git a/src/mame/video/dpb_combiner.cpp b/src/mame/video/dpb_combiner.cpp index 65e11d0da53..8d0f162b1e8 100644 --- a/src/mame/video/dpb_combiner.cpp +++ b/src/mame/video/dpb_combiner.cpp @@ -5,9 +5,6 @@ dpb_combiner.cpp DPB-7000/1 - Combiner Card - TODO: - - Hook up clocked logic (multipliers, blanking, etc.) - ***************************************************************************/ #include "emu.h" @@ -140,7 +137,7 @@ void dpb7000_combiner_card_device::device_add_mconfig(machine_config &config) TMC28KU(config, m_mult_ga); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(clock(), 910, 0, 640, 525, 0, 480); + m_screen->set_raw(DERIVED_CLOCK(1, 1), 910, 0, 640, 525, 0, 480); m_screen->set_screen_update(FUNC(dpb7000_combiner_card_device::screen_update)); } diff --git a/src/mame/video/dpb_combiner.h b/src/mame/video/dpb_combiner.h index 61bdc79156c..b81f7fd54a6 100644 --- a/src/mame/video/dpb_combiner.h +++ b/src/mame/video/dpb_combiner.h @@ -5,9 +5,6 @@ dpb_combiner.h DPB-7000/1 - Combiner Card - TODO: - - Hook up clocked logic (multipliers, blanking, etc.) - ***************************************************************************/ #ifndef MAME_VIDEO_DPB_COMBINER_H |