From b1dff791ed66f114f3b8d63c156d8f16f06c0f0c Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 2 Jul 2019 01:16:36 +0200 Subject: fidel_card: disconnect from fidelbase class (nw) --- src/mame/drivers/fidel_card.cpp | 67 ++++++++++++++++++++++++------------- src/mame/drivers/fidel_vsc.cpp | 11 ++++-- src/mame/drivers/hh_ucom4.cpp | 1 - src/mame/layout/scisys_chesstrv.lay | 44 ++++++++++++------------ src/mame/machine/fidelbase.cpp | 3 -- 5 files changed, 75 insertions(+), 51 deletions(-) diff --git a/src/mame/drivers/fidel_card.cpp b/src/mame/drivers/fidel_card.cpp index 6a9fff06c8d..51e3c6fe570 100644 --- a/src/mame/drivers/fidel_card.cpp +++ b/src/mame/drivers/fidel_card.cpp @@ -2,8 +2,6 @@ // copyright-holders:Kevin Horton, Jonathan Gevaryahu, Sandro Ronco, hap /****************************************************************************** -* fidel_card.cpp, subdriver of machine/fidelbase.cpp, machine/chessbase.cpp - Fidelity electronic card games - *Bridge Challenger (BRC) - Advanced Bridge Challenger (UBC) @@ -17,9 +15,6 @@ Fidelity electronic card games NOTE: The card scanner is simulated, but the player is kind of forced to cheat and has to peek at the card before it is scanned. -TODO: -- Z80 WAIT pin is not fully emulated, affecting VBRC speech busy state - ******************************************************************************* Voice Bridge Challenger (Model VBRC, later reissued as Model 7002) @@ -164,12 +159,14 @@ Two card decks exist (red and blue), each has the same set of barcodes. ******************************************************************************/ #include "emu.h" -#include "includes/fidelbase.h" - #include "cpu/z80/z80.h" #include "cpu/mcs48/mcs48.h" +#include "video/pwm.h" #include "machine/i8243.h" #include "machine/clock.h" +#include "machine/timer.h" +#include "sound/dac.h" +#include "sound/s14001a.h" #include "sound/volt_reg.h" #include "speaker.h" @@ -181,13 +178,18 @@ Two card decks exist (red and blue), each has the same set of barcodes. namespace { -class card_state : public fidelbase_state +class card_state : public driver_device { public: card_state(const machine_config &mconfig, device_type type, const char *tag) : - fidelbase_state(mconfig, type, tag), + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), m_mcu(*this, "mcu"), - m_i8243(*this, "i8243") + m_i8243(*this, "i8243"), + m_display(*this, "display"), + m_speech(*this, "speech"), + m_dac(*this, "dac"), + m_inputs(*this, "IN.%u", 0) { } // machine drivers @@ -196,7 +198,7 @@ public: void bv3(machine_config &config); void gin(machine_config &config); - virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button) override; + DECLARE_INPUT_CHANGED_MEMBER(reset_button); DECLARE_INPUT_CHANGED_MEMBER(start_scan); protected: @@ -206,8 +208,13 @@ private: void brc_base(machine_config &config); // devices/pointers + required_device m_maincpu; required_device m_mcu; required_device m_i8243; + required_device m_display; + optional_device m_speech; + optional_device m_dac; + required_ioport_array<8> m_inputs; // address maps void main_map(address_map &map); @@ -215,6 +222,8 @@ private: TIMER_DEVICE_CALLBACK_MEMBER(barcode_shift) { m_barcode >>= 1; } u32 m_barcode; + u16 m_vfd_data; + u8 m_inp_mux; // I/O handlers void update_display(); @@ -227,14 +236,19 @@ private: void card_state::machine_start() { - fidelbase_state::machine_start(); - - // zerofill/register for savestates + // zerofill m_barcode = 0; + m_vfd_data = 0; + m_inp_mux = 0; + + // register for savestates save_item(NAME(m_barcode)); + save_item(NAME(m_vfd_data)); + save_item(NAME(m_inp_mux)); } + /****************************************************************************** Devices, I/O ******************************************************************************/ @@ -243,10 +257,9 @@ void card_state::machine_start() void card_state::update_display() { - // 14seg led segments, d15(12) is extra led - u16 outdata = bitswap<16>(m_7seg_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8); - set_display_segmask(0xff, 0x3fff); - display_matrix(16, 8, outdata, m_led_select); + // 14seg VFD segments, d15(12) is extra LED + u16 outdata = bitswap<16>(m_vfd_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8); + m_display->matrix(m_inp_mux, outdata); } WRITE8_MEMBER(card_state::speech_w) @@ -266,7 +279,7 @@ template void card_state::ioexp_port_w(uint8_t data) { // P4x-P7x: digit segment data - m_7seg_data = (m_7seg_data & ~(0xf << (4*P))) | ((data & 0xf) << (4*P)); + m_vfd_data = (m_vfd_data & ~(0xf << (4*P))) | ((data & 0xf) << (4*P)); update_display(); // P71 is tone (not on speech model) @@ -279,16 +292,22 @@ void card_state::ioexp_port_w(uint8_t data) WRITE8_MEMBER(card_state::mcu_p1_w) { - // P10-P17: select digits, input mux - m_inp_mux = m_led_select = data; + // P10-P17: input mux, digit select + m_inp_mux = data; update_display(); } READ8_MEMBER(card_state::mcu_p2_r) { // P20-P23: I8243 P2 + u8 data = m_i8243->p2_r() & 0x0f; + // P24-P27: multiplexed inputs (active low) - return (m_i8243->p2_r() & 0x0f) | (read_inputs(8) << 4 ^ 0xf0); + for (int i = 0; i < 8; i++) + if (BIT(m_inp_mux, i)) + data |= m_inputs[i]->read() << 4; + + return data ^ 0xf0; } READ_LINE_MEMBER(card_state::mcu_t0_r) @@ -567,7 +586,9 @@ void card_state::brc_base(machine_config &config) TIMER(config, "barcode_shift").configure_periodic(FUNC(card_state::barcode_shift), attotime::from_msec(2)); - TIMER(config, "display_decay").configure_periodic(FUNC(card_state::display_decay_tick), attotime::from_msec(1)); + /* video hardware */ + PWM_DISPLAY(config, m_display).set_size(8, 16); + m_display->set_segmask(0xff, 0x3fff); config.set_default_layout(layout_fidel_brc); } diff --git a/src/mame/drivers/fidel_vsc.cpp b/src/mame/drivers/fidel_vsc.cpp index a47c3648ec3..6c7e15427ef 100644 --- a/src/mame/drivers/fidel_vsc.cpp +++ b/src/mame/drivers/fidel_vsc.cpp @@ -124,8 +124,8 @@ PA.7 - button row 8 PB.0 - button column I PB.1 - button column J PB.2 - hi/lo TSI speaker volume -PB.3 - violet wire -PB.4 - white wire (and TSI BUSY line) +PB.3 - violet wire to printer port? +PB.4 - white wire to printer port? (and TSI BUSY line) PB.5 - selection jumper input (see below) PB.6 - TSI start line PB.7 - TSI ROM A12 line @@ -142,6 +142,13 @@ Anyways, the two jumpers are connected to button columns A and B and the common connects to Z80A PIO PB.5, which basically makes a 10th button row. I would expect that the software reads these once on startup only. +printer: +-------- +This is the 1st Fidelity chess computer with a printer port. Many later Fidelity chess +computers also have support for it. Two models were released: +FP: Challenger Printer - thermal printer, MCU=D8048C243 +IFP: Impact Printer - also compatible with C64 apparently. + ******************************************************************************/ #include "emu.h" diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp index 2b3d208312a..cce4f3d54bd 100644 --- a/src/mame/drivers/hh_ucom4.cpp +++ b/src/mame/drivers/hh_ucom4.cpp @@ -877,7 +877,6 @@ static INPUT_PORTS_START( splasfgt ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END - void splasfgt_state::splasfgt(machine_config &config) { /* basic machine hardware */ diff --git a/src/mame/layout/scisys_chesstrv.lay b/src/mame/layout/scisys_chesstrv.lay index 968ff146e9f..f71a5902764 100644 --- a/src/mame/layout/scisys_chesstrv.lay +++ b/src/mame/layout/scisys_chesstrv.lay @@ -358,34 +358,34 @@ - + - + - + - + - + - + - + @@ -402,14 +402,16 @@ + + - - + + @@ -419,8 +421,8 @@ - - + + @@ -453,16 +455,16 @@ - + - - - - + + + + @@ -549,14 +551,12 @@ - + - - - - + + - + diff --git a/src/mame/machine/fidelbase.cpp b/src/mame/machine/fidelbase.cpp index e1da97c2e19..dae297109b5 100644 --- a/src/mame/machine/fidelbase.cpp +++ b/src/mame/machine/fidelbase.cpp @@ -27,9 +27,6 @@ Keypad legend: Read the official manual(s) on how to play. -Peripherals, compatible with various boards: -- Fidelity Challenger Printer - thermal printer, MCU=D8048C243 - Program/data cartridges, for various boards, some cross-compatible: - CB9: Challenger Book Openings 1 - 8KB (label not known) - CB16: Challenger Book Openings 2 - 8+8KB 101-1042A01,02 -- cgit v1.2.3