diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mame/drivers/dpb7000.cpp | 106 | ||||
-rw-r--r-- | src/mame/video/dpb_combiner.cpp | 235 | ||||
-rw-r--r-- | src/mame/video/dpb_combiner.h | 99 |
3 files changed, 413 insertions, 27 deletions
diff --git a/src/mame/drivers/dpb7000.cpp b/src/mame/drivers/dpb7000.cpp index 05b18bae9c8..39964991c0e 100644 --- a/src/mame/drivers/dpb7000.cpp +++ b/src/mame/drivers/dpb7000.cpp @@ -17,8 +17,8 @@ #include "machine/com8116.h" #include "machine/input_merger.h" #include "machine/tdc1008.h" -#include "machine/tmc208k.h" #include "video/mc6845.h" +#include "video/dpb_combiner.h" #include "emupal.h" #include "screen.h" #include <deque> @@ -68,11 +68,7 @@ public: , m_filter_ce(*this, "filter_ce") , m_filter_cf(*this, "filter_cf") , m_filter_cg(*this, "filter_cg") - , m_combiner_ge(*this, "combiner_ge") // Lum I - , m_combiner_gd(*this, "combiner_gd") // Lum II - , m_combiner_gc(*this, "combiner_gc") // Chroma I - , m_combiner_gb(*this, "combiner_gb") // Chroma II - , m_combiner_ga(*this, "combiner_ga") // Ext I & II + , m_combiner(*this, "combiner") { } @@ -162,11 +158,7 @@ private: required_device<tdc1008_device> m_filter_cf; required_device<tdc1008_device> m_filter_cg; - required_device<tmc28ku_device> m_combiner_ge; - required_device<tmc28ku_device> m_combiner_gd; - required_device<tmc28ku_device> m_combiner_gc; - required_device<tmc28ku_device> m_combiner_gb; - required_device<tmc28ku_device> m_combiner_ga; + required_device<dpb7000_combiner_card_device> m_combiner; emu_timer *m_diskseq_clk; emu_timer *m_field_in_clk; @@ -227,8 +219,23 @@ private: uint16_t m_cursor_size_x; uint16_t m_cursor_size_y; + // Store Address Card + uint16_t m_rhscr[2]; + uint16_t m_rvscr[2]; + uint16_t m_rzoom[2]; + uint16_t m_fld_sel[2]; + uint16_t m_cxpos[2]; + uint16_t m_cypos[2]; + // Brush Address Card uint16_t m_brush_addr_func; + uint8_t m_bif; + uint8_t m_bixos; + uint8_t m_biyos; + uint8_t m_bxlen; + uint8_t m_bylen; + uint8_t m_plum; + uint8_t m_pchr; }; void dpb7000_state::main_map(address_map &map) @@ -425,8 +432,23 @@ void dpb7000_state::machine_start() save_item(NAME(m_cursor_size_x)); save_item(NAME(m_cursor_size_y)); + // Store Address Card + save_item(NAME(m_rhscr)); + save_item(NAME(m_rvscr)); + save_item(NAME(m_rzoom)); + save_item(NAME(m_fld_sel)); + save_item(NAME(m_cxpos)); + save_item(NAME(m_cypos)); + // Brush Address Card save_item(NAME(m_brush_addr_func)); + save_item(NAME(m_bif)); + save_item(NAME(m_bixos)); + save_item(NAME(m_biyos)); + save_item(NAME(m_bxlen)); + save_item(NAME(m_bylen)); + save_item(NAME(m_plum)); + save_item(NAME(m_pchr)); } void dpb7000_state::machine_reset() @@ -472,8 +494,23 @@ void dpb7000_state::machine_reset() m_cursor_size_x = 0; m_cursor_size_y = 0; + // Store Address Card + memset(m_rhscr, 0, sizeof(uint16_t) * 2); + memset(m_rvscr, 0, sizeof(uint16_t) * 2); + memset(m_rzoom, 0, sizeof(uint16_t) * 2); + memset(m_fld_sel, 0, sizeof(uint16_t) * 2); + memset(m_cxpos, 0, sizeof(uint16_t) * 2); + memset(m_cypos, 0, sizeof(uint16_t) * 2); + // Brush Address Card m_brush_addr_func = 0; + m_bif = 0; + m_bixos = 0; + m_biyos = 0; + m_bxlen = 0; + m_bylen = 0; + m_plum = 0; + m_pchr = 0; } void dpb7000_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) @@ -811,21 +848,39 @@ WRITE16_MEMBER(dpb7000_state::cpu_ctrlbus_w) { case 0: LOGMASKED(LOG_CTRLBUS | LOG_STORE_ADDR, "%s: CPU write to Store Address Card (%s), set RHSCR: %03x\n", machine().describe_context(), BIT(data, 15) ? "II" : "Both", data & 0xfff); + m_rhscr[1] = data & 0xfff; + if (BIT(data, 15)) + m_rhscr[0] = data & 0xfff; break; case 1: LOGMASKED(LOG_CTRLBUS | LOG_STORE_ADDR, "%s: CPU write to Store Address Card (%s), set RVSCR: %03x\n", machine().describe_context(), BIT(data, 15) ? "II" : "Both", data & 0xfff); + m_rvscr[1] = data & 0xfff; + if (BIT(data, 15)) + m_rvscr[0] = data & 0xfff; break; case 2: LOGMASKED(LOG_CTRLBUS | LOG_STORE_ADDR, "%s: CPU write to Store Address Card (%s), set R ZOOM: %03x\n", machine().describe_context(), BIT(data, 15) ? "II" : "Both", data & 0xfff); + m_rzoom[1] = data & 0xfff; + if (BIT(data, 15)) + m_rzoom[0] = data & 0xfff; break; case 3: LOGMASKED(LOG_CTRLBUS | LOG_STORE_ADDR, "%s: CPU write to Store Address Card (%s), set FLDSEL: %03x\n", machine().describe_context(), BIT(data, 15) ? "II" : "Both", data & 0xfff); + m_fld_sel[1] = data & 0xfff; + if (BIT(data, 15)) + m_fld_sel[0] = data & 0xfff; break; case 4: LOGMASKED(LOG_CTRLBUS | LOG_STORE_ADDR, "%s: CPU write to Store Address Card (%s), set CXPOS: %03x\n", machine().describe_context(), BIT(data, 15) ? "II" : "Both", data & 0xfff); + m_cxpos[1] = data & 0xfff; + if (BIT(data, 15)) + m_cxpos[0] = data & 0xfff; break; case 5: LOGMASKED(LOG_CTRLBUS | LOG_STORE_ADDR, "%s: CPU write to Store Address Card (%s), set CYPOS: %03x\n", machine().describe_context(), BIT(data, 15) ? "II" : "Both", data & 0xfff); + m_cypos[1] = data & 0xfff; + if (BIT(data, 15)) + m_cypos[0] = data & 0xfff; break; default: LOGMASKED(LOG_CTRLBUS | LOG_STORE_ADDR, "%s: CPU write to Store Address Card (%s), unknown register: %04x\n", machine().describe_context(), BIT(data, 15) ? "II" : "Both", data); @@ -842,24 +897,31 @@ WRITE16_MEMBER(dpb7000_state::cpu_ctrlbus_w) { case 1: LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: BIF = %02x\n", machine().describe_context(), data & 0xff); + m_bif = data & 0xff; break; case 2: LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: BIXOS = %d\n", machine().describe_context(), data & 0x7); + m_bixos = data & 0x7; break; case 3: LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: BIYOS = %d\n", machine().describe_context(), data & 0x7); + m_biyos = data & 0x7; break; case 4: LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: BXLEN = %02x\n", machine().describe_context(), data & 0x3f); + m_bxlen = data & 0x3f; break; case 5: LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: BYLEN = %02x\n", machine().describe_context(), data & 0x3f); + m_bylen = data & 0x3f; break; case 6: - LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: PLUM = %03x(?)\n", machine().describe_context(), data & 0xfff); + LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: PLUM = %03x(?)\n", machine().describe_context(), data & 0xff); + m_plum = data & 0xff; break; case 7: - LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: PCHR = %03x(?)\n", machine().describe_context(), data & 0xfff); + LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: PCHR = %03x(?)\n", machine().describe_context(), data & 0xff); + m_pchr = data & 0xff; break; default: LOGMASKED(LOG_CTRLBUS | LOG_BRUSH_ADDR, "%s: Brush Address Card, Register Write: Unknown (%04x)\n", machine().describe_context(), data); @@ -867,7 +929,7 @@ WRITE16_MEMBER(dpb7000_state::cpu_ctrlbus_w) } break; - case 10: // Output Timing Card - cursor registers, Combiner Card + case 10: // Output Timing Card - cursor registers; Combiner Card { const uint8_t hi_bits = (data >> 14) & 3; if (hi_bits == 0) // Cursor Parameters @@ -891,15 +953,9 @@ WRITE16_MEMBER(dpb7000_state::cpu_ctrlbus_w) break; } } - else if (hi_bits == 3) // Cursor Misc. + else if (hi_bits == 3) // Combiner Card, constant registers { - if ((data & 0x2c00) == 0) - { - } - else - { - LOGMASKED(LOG_CTRLBUS | LOG_OUTPUT_TIMING | LOG_UNKNOWN, "%s: CPU write to Output Timing Card, unknown Cursor Misc. value: %04x\n", machine().describe_context(), data); - } + m_combiner->reg_w(data); } else { @@ -1125,11 +1181,7 @@ void dpb7000_state::dpb7000(machine_config &config) TDC1008(config, m_filter_cg); // Combiner Card - TMC28KU(config, m_combiner_ge); - TMC28KU(config, m_combiner_gd); - TMC28KU(config, m_combiner_gc); - TMC28KU(config, m_combiner_gb); - TMC28KU(config, m_combiner_ga); + DPB7000_COMBINER(config, m_combiner, 14.318181_MHz_XTAL); } diff --git a/src/mame/video/dpb_combiner.cpp b/src/mame/video/dpb_combiner.cpp new file mode 100644 index 00000000000..295e7d11dea --- /dev/null +++ b/src/mame/video/dpb_combiner.cpp @@ -0,0 +1,235 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/*************************************************************************** + + dpb_combiner.cpp + DPB-7000/1 - Combiner Card + + TODO: + - Hook up clocked logic (multipliers, blanking, etc.) + +***************************************************************************/ + +#include "emu.h" +#include "dpb_combiner.h" + +#define VERBOSE (1) +#include "logmacro.h" + +/*****************************************************************************/ + +DEFINE_DEVICE_TYPE(DPB7000_COMBINER, dpb7000_combiner_card_device, "dpb_combiner", "Quantel DPB-7000 Combiner Card") + + +//------------------------------------------------- +// dpb7000_combiner_card_device - constructor +//------------------------------------------------- + +dpb7000_combiner_card_device::dpb7000_combiner_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, DPB7000_COMBINER, tag, owner, clock) + , m_chr_i_in(false) + , m_chr_i(false) + , m_palette_l(false) + , m_cursor_enb(false) + , m_cursor_col(false) + , m_cursor_luma(0) + , m_cursor_u(0) + , m_cursor_v(0) + , m_invert_mask(0) + , m_lum(*this) + , m_chr(*this) + , m_fsck(nullptr) + , m_mult_ge(*this, "mult_ge") // Lum I + , m_mult_gd(*this, "mult_gd") // Lum II + , m_mult_gc(*this, "mult_gc") // Chroma I + , m_mult_gb(*this, "mult_gb") // Chroma II + , m_mult_ga(*this, "mult_ga") // Ext I & II +{ +} + +void dpb7000_combiner_card_device::device_start() +{ + save_item(NAME(m_lum_in)); + save_item(NAME(m_latched_lum)); + save_item(NAME(m_chr_in)); + save_item(NAME(m_latched_chr)); + save_item(NAME(m_ext_in)); + + save_item(NAME(m_blank_lum)); + save_item(NAME(m_chr_i_in)); + save_item(NAME(m_chr_i)); + save_item(NAME(m_palette_l)); + save_item(NAME(m_cursor_enb)); + save_item(NAME(m_cursor_col)); + + save_item(NAME(m_cursor_luma)); + save_item(NAME(m_cursor_u)); + save_item(NAME(m_cursor_v)); + save_item(NAME(m_invert_mask)); + save_item(NAME(m_select_matte)); + save_item(NAME(m_matte_ext)); + save_item(NAME(m_matte_y)); + save_item(NAME(m_matte_u)); + save_item(NAME(m_matte_v)); + + m_lum.resolve_safe(); + m_chr.resolve_safe(); +} + +void dpb7000_combiner_card_device::device_reset() +{ + memset(m_lum_in, 0, 2); + memset(m_latched_lum, 0, 2); + memset(m_chr_in, 0, 2); + memset(m_latched_chr, 0, 2); + memset(m_ext_in, 0, 2); + + memset(m_blank_lum, 0, 2); + m_chr_i_in = false; + m_chr_i = false; + m_palette_l = false; + m_cursor_enb = false; + m_cursor_col = false; + + m_cursor_luma = 0; + m_cursor_u = 0; + m_cursor_v = 0; + m_invert_mask = 0; + memset(m_select_matte, 0, 2); + memset(m_matte_ext, 0, 2); + memset(m_matte_y, 0, 2); + memset(m_matte_u, 0, 2); + memset(m_matte_v, 0, 2); +} + +void dpb7000_combiner_card_device::device_add_mconfig(machine_config &config) +{ + TMC28KU(config, m_mult_ge); + TMC28KU(config, m_mult_gd); + TMC28KU(config, m_mult_gc); + TMC28KU(config, m_mult_gb); + TMC28KU(config, m_mult_ga); +} + +void dpb7000_combiner_card_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + if (id == FSCK_TIMER) + { + fsck_tick(); + } +} + +void dpb7000_combiner_card_device::fsck_tick() +{ +} + +void dpb7000_combiner_card_device::reg_w(uint16_t data) +{ + static const char* const s_const_names[16] = { "Y0", "CY", "CU", "CV", "ES", "EI", "EII", "Y7", "IS", "IY", "IU", "IV", "IIS", "IIY", "IIU", "IIV" }; + LOG("%s: CPU write to Combiner Card: %s = %02x\n", machine().describe_context(), s_const_names[(data >> 10) & 0xf], (uint8_t)data); + switch ((data >> 10) & 0xf) + { + case 1: // CY + m_cursor_luma = (uint8_t)data; + break; + case 2: // CU + m_cursor_u = (uint8_t)data; + break; + case 3: // CV + m_cursor_v = (uint8_t)data; + break; + case 4: // ES + m_invert_mask = (uint8_t)data; + break; + case 5: // EI + m_matte_ext[0] = (uint8_t)data; + break; + case 6: // EII + m_matte_ext[1] = (uint8_t)data; + break; + case 8: // IS + m_select_matte[0] = BIT(data, 0); + break; + case 9: // IY + m_matte_y[0] = (uint8_t)data; + break; + case 10: // IU + m_matte_u[0] = (uint8_t)data; + break; + case 11: // IV + m_matte_v[0] = (uint8_t)data; + break; + case 12: // IIS + m_select_matte[1] = BIT(data, 0); + break; + case 13: // IIY + m_matte_y[1] = (uint8_t)data; + break; + case 14: // IIU + m_matte_u[1] = (uint8_t)data; + break; + case 15: // IIV + m_matte_v[1] = (uint8_t)data; + break; + } +} + +void dpb7000_combiner_card_device::lum1_w(uint8_t data) +{ + m_lum_in[0] = data; +} + +void dpb7000_combiner_card_device::lum2_w(uint8_t data) +{ + m_lum_in[1] = data; +} + +void dpb7000_combiner_card_device::blank_lum1(int state) +{ + m_blank_lum[0] = (bool)state; +} + +void dpb7000_combiner_card_device::blank_lum2(int state) +{ + m_blank_lum[1] = (bool)state; +} + +void dpb7000_combiner_card_device::chr1_w(uint8_t data) +{ + m_chr_in[0] = data; +} + +void dpb7000_combiner_card_device::chr2_w(uint8_t data) +{ + m_chr_in[1] = data; +} + +void dpb7000_combiner_card_device::chr_flag_w(int state) +{ + m_chr_i_in = (bool)state; +} + +void dpb7000_combiner_card_device::ext1_w(uint8_t data) +{ + m_ext_in[0] = data; +} + +void dpb7000_combiner_card_device::ext2_w(uint8_t data) +{ + m_ext_in[1] = data; +} + +void dpb7000_combiner_card_device::palette_l_w(int state) +{ + m_palette_l = (bool)state; +} + +void dpb7000_combiner_card_device::cursor_enb_w(int state) +{ + m_cursor_enb = (bool)state; +} + +void dpb7000_combiner_card_device::cursor_col_w(int state) +{ + m_cursor_col = (bool)state; +} diff --git a/src/mame/video/dpb_combiner.h b/src/mame/video/dpb_combiner.h new file mode 100644 index 00000000000..e6d7a358a98 --- /dev/null +++ b/src/mame/video/dpb_combiner.h @@ -0,0 +1,99 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/*************************************************************************** + + dpb_combiner.h + DPB-7000/1 - Combiner Card + + TODO: + - Hook up clocked logic (multipliers, blanking, etc.) + +***************************************************************************/ + +#ifndef MAME_VIDEO_DPB_COMBINER_H +#define MAME_VIDEO_DPB_COMBINER_H + +#pragma once + +#include "machine/tmc208k.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> dpb7000_combiner_card_device + +class dpb7000_combiner_card_device : public device_t +{ +public: + // construction/destruction + dpb7000_combiner_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + void reg_w(uint16_t data); + void lum1_w(uint8_t data); + void lum2_w(uint8_t data); + void blank_lum1(int state); + void blank_lum2(int state); + void chr1_w(uint8_t data); + void chr2_w(uint8_t data); + void chr_flag_w(int state); + void ext1_w(uint8_t data); + void ext2_w(uint8_t data); + void palette_l_w(int state); + void cursor_enb_w(int state); + void cursor_col_w(int state); + + auto lum() { return m_lum.bind(); } + auto chr() { return m_chr.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 void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + static constexpr device_timer_id FSCK_TIMER = 0; + + void fsck_tick(); + + uint8_t m_lum_in[2]; + uint8_t m_latched_lum[2]; + uint8_t m_chr_in[2]; + uint8_t m_latched_chr[2]; + uint8_t m_ext_in[2]; + + bool m_blank_lum[2]; + bool m_chr_i_in; + bool m_chr_i; + bool m_palette_l; + bool m_cursor_enb; + bool m_cursor_col; + + uint8_t m_cursor_luma; + uint8_t m_cursor_u; + uint8_t m_cursor_v; + uint8_t m_invert_mask; + bool m_select_matte[2]; + uint8_t m_matte_ext[2]; + uint8_t m_matte_y[2]; + uint8_t m_matte_u[2]; + uint8_t m_matte_v[2]; + + devcb_write8 m_lum; + devcb_write8 m_chr; + + emu_timer *m_fsck; + + required_device<tmc28ku_device> m_mult_ge; + required_device<tmc28ku_device> m_mult_gd; + required_device<tmc28ku_device> m_mult_gc; + required_device<tmc28ku_device> m_mult_gb; + required_device<tmc28ku_device> m_mult_ga; +}; + +// device type definition +DECLARE_DEVICE_TYPE(DPB7000_COMBINER, dpb7000_combiner_card_device) + +#endif // MAME_VIDEO_DPB_COMBINER_H |