From 5d2285479002b66548e719b3b351d795542dd198 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 8 Dec 2019 14:42:45 +0100 Subject: New machines marked as NOT_WORKING ---------------------------------- Sphinx 40 [hap, Berger] --- scripts/target/mame/mess.lua | 1 + src/devices/video/lc7582.h | 22 +- src/mame/drivers/cxg_ch2001.cpp | 2 +- src/mame/drivers/cxg_sphinx40.cpp | 315 ++++++++++++++++++++++++++++ src/mame/drivers/tasc.cpp | 2 +- src/mame/layout/cxg_sphinx40.lay | 420 ++++++++++++++++++++++++++++++++++++++ src/mame/mame.lst | 3 + src/mame/mess.flt | 1 + 8 files changed, 754 insertions(+), 12 deletions(-) create mode 100644 src/mame/drivers/cxg_sphinx40.cpp create mode 100644 src/mame/layout/cxg_sphinx40.lay diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 65981f546c3..3c3a07bf176 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -2000,6 +2000,7 @@ createMESSProjects(_target, _subtarget, "cxg") files { MAME_DIR .. "src/mame/drivers/cxg_ch2001.cpp", MAME_DIR .. "src/mame/drivers/cxg_dominator.cpp", + MAME_DIR .. "src/mame/drivers/cxg_sphinx40.cpp", } createMESSProjects(_target, _subtarget, "cybiko") diff --git a/src/devices/video/lc7582.h b/src/devices/video/lc7582.h index a2744aad0b6..72f37371a68 100644 --- a/src/devices/video/lc7582.h +++ b/src/devices/video/lc7582.h @@ -15,16 +15,18 @@ quick pinout reference (64-pin QFP) -1-54: S1-S53 segment outputs, pin 24 N/C, pins 45-54 also used with AD/DSP -55: OSC -56: Vdd -57: _INH -58: Vlcd -59: Vss -60: CE \ -61: CLK | serial input -62: DATA / -63,64: COM1/COM2 outputs +pin desc +------------------------------ +1-54 = S1-S53 segment outputs, pin 24 N/C, pins 45-54 also used with AD/DSP +55 = OSC +56 = Vdd +57 = _INH +58 = Vlcd +59 = Vss +60 = CE \ +61 = CLK | serial input +62 = DATA / +63,64 = COM1/COM2 outputs */ diff --git a/src/mame/drivers/cxg_ch2001.cpp b/src/mame/drivers/cxg_ch2001.cpp index 96aa6e1f553..afa4fdab5e1 100644 --- a/src/mame/drivers/cxg_ch2001.cpp +++ b/src/mame/drivers/cxg_ch2001.cpp @@ -8,7 +8,7 @@ CXG Chess 3000 is assumed to be on similar hardware as this. The chess engine is by Richard Lang, based on Cyrus. -CXG Systems S.A. and Newcrest Technology Ltd. involved the same people, with +CXG Systems S.A. and Newcrest Technology Ltd. are related companies, with Eric White at the steering wheel. Newcrest(1984-1991) is probably a rename of "White & Allcock"(1981-1984). diff --git a/src/mame/drivers/cxg_sphinx40.cpp b/src/mame/drivers/cxg_sphinx40.cpp new file mode 100644 index 00000000000..1875bc4ee59 --- /dev/null +++ b/src/mame/drivers/cxg_sphinx40.cpp @@ -0,0 +1,315 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Berger +/****************************************************************************** + +CXG Sphinx 40 / 50 + +This is a modular chesscomputer, similar to Mephisto's 3-drawers one. +Chesscomputer on the right, LCD in the middle, and future expansion(?) on the left. +The only difference between 40 and 50 is the board size (40cm vs 50cm). + +The chess engine is Cyrus 68K, by Mark Taylor, with advice from David Levy. +It's not related to the Z80 version of Cyrus, only by name. + +This chessboard was also used on the Sphinx 40 / 50 Plus, which is another +incarnation of Frans Morsch's Dominator program. + +TODO: +- unmapped read from 0x200000, looks like expansion ROM +- verify XTAL and irq source/frequency +- identify buttons +- lcd + +Hardware notes: + +Distribution board: +- PCB label: C 1987 CXG SYSTEMS S.A 68K 600 203 +- Hitachi HD46821P (6821 PIA) +- piezo, connector to chessboard (magnet sensors, 8*8 leds) + +Program/CPU module: +- PCB label: (C) 1987 NEWCREST TECHNOLOGY LTD, CXG-68K-600-001 +- daughterboard for buttons, label CXG SYSTEMS, 68K-600-101 +- Signetics SCN68000C8N64 @ 8MHz +- 64KB ROM (2*GI 27256-20) +- 128KB RAM (4*KM41464AP-12 64kx4 DRAM) +- 2KB battery-backed RAM (NEC D449C) + +LCD module +- PCB label: CXG-68K-600-302 +- Hitachi HD61603 LCD Driver +- 2 displays (4 digits each) + +******************************************************************************/ + +#include "emu.h" +#include "cpu/m68000/m68000.h" +#include "machine/6821pia.h" +#include "machine/bankdev.h" +#include "machine/nvram.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "sound/volt_reg.h" +#include "video/pwm.h" +#include "speaker.h" + +// internal artwork +#include "cxg_sphinx40.lh" // clickable + + +namespace { + +class sphinx40_state : public driver_device +{ +public: + sphinx40_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_pia(*this, "pia"), + m_display(*this, "display"), + m_board(*this, "board"), + m_dac(*this, "dac"), + m_inputs(*this, "IN.%u", 0) + { } + + // machine drivers + void sphinx40(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + // devices/pointers + required_device m_maincpu; + required_device m_pia; + required_device m_display; + required_device m_board; + required_device m_dac; + required_ioport_array<4> m_inputs; + + // address maps + void main_map(address_map &map); + void nvram_map(address_map &map); + + // I/O handlers + DECLARE_READ8_MEMBER(input_r); + DECLARE_WRITE8_MEMBER(input_w); + DECLARE_WRITE8_MEMBER(lcd_w); + + void update_display(); + DECLARE_WRITE8_MEMBER(cb_mux_w); + DECLARE_WRITE8_MEMBER(cb_leds_w); + DECLARE_READ8_MEMBER(cb_r); + + u8 m_cb_mux = 0; + u8 m_led_data = 0; + u8 m_inp_mux = 0; +}; + +void sphinx40_state::machine_start() +{ + // register for savestates + save_item(NAME(m_cb_mux)); + save_item(NAME(m_led_data)); + save_item(NAME(m_inp_mux)); +} + + + +/****************************************************************************** + I/O +******************************************************************************/ + +// 6821 PIA + +void sphinx40_state::update_display() +{ + m_display->matrix(m_cb_mux, m_led_data); +} + +WRITE8_MEMBER(sphinx40_state::cb_mux_w) +{ + // PA0-PA7: chessboard input/led mux + m_cb_mux = ~data; + update_display(); +} + +WRITE8_MEMBER(sphinx40_state::cb_leds_w) +{ + // PB0-PB7: chessboard leds + m_led_data = ~data; + update_display(); +} + + +// TTL + +READ8_MEMBER(sphinx40_state::cb_r) +{ + u8 data = 0; + + // d0-d7: multiplexed inputs (chessboard) + for (int i = 0; i < 8; i++) + if (BIT(m_cb_mux, i)) + data |= m_board->read_rank(i, true); + + return data; +} + +WRITE8_MEMBER(sphinx40_state::input_w) +{ + // d0-d3: input mux (buttons) + m_inp_mux = ~data & 0xf; +} + +READ8_MEMBER(sphinx40_state::input_r) +{ + u8 data = 0; + + // d0-d7: multiplexed inputs (buttons) + for (int i = 0; i < 4; i++) + if (BIT(m_inp_mux, i)) + data |= m_inputs[i]->read(); + + return ~data; +} + +WRITE8_MEMBER(sphinx40_state::lcd_w) +{ + // d0-d3: HD61603 data + //printf("%X ",data); +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void sphinx40_state::main_map(address_map &map) +{ + map(0x000000, 0x00ffff).rom(); + map(0x100000, 0x11ffff).ram(); + map(0x400000, 0x400fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask16(0x00ff); + map(0x70fcf1, 0x70fcf1).r(FUNC(sphinx40_state::cb_r)); + map(0x70fd71, 0x70fd71).r(FUNC(sphinx40_state::input_r)); + map(0x70fdb1, 0x70fdb1).w(FUNC(sphinx40_state::input_w)); + map(0x70fde0, 0x70fde0).w(FUNC(sphinx40_state::lcd_w)); + map(0x70fff0, 0x70fff7).rw(m_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write)).umask16(0xff00); +} + +void sphinx40_state::nvram_map(address_map &map) +{ + // nvram is 8-bit (2KB) + map(0x000, 0x7ff).ram().share("nvram"); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( sphinx40 ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) // rook + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) // bishop + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) + + PORT_START("IN.2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) // knight + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) // sound? + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) // pawn + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) + + PORT_START("IN.3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) // king + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) // pawn? + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) // new game? + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) // queen + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COMMA) +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Drivers +******************************************************************************/ + +void sphinx40_state::sphinx40(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 8000000); + m_maincpu->set_addrmap(AS_PROGRAM, &sphinx40_state::main_map); + + const attotime irq_period = attotime::from_hz(8000000 / 0x1000); + m_maincpu->set_periodic_int(FUNC(sphinx40_state::irq4_line_hold), irq_period); + + PIA6821(config, m_pia, 0); + m_pia->writepa_handler().set(FUNC(sphinx40_state::cb_mux_w)); + m_pia->writepb_handler().set(FUNC(sphinx40_state::cb_leds_w)); + m_pia->cb2_handler().set(m_dac, FUNC(dac_bit_interface::write)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + ADDRESS_MAP_BANK(config, "nvram_map").set_map(&sphinx40_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 11); + + SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS); + m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); + m_board->set_delay(attotime::from_msec(150)); + + /* video hardware */ + + PWM_DISPLAY(config, m_display).set_size(8, 8); + config.set_default_layout(layout_cxg_sphinx40); + + /* sound hardware */ + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); + VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( sphinx40 ) + ROM_REGION16_BE( 0x10000, "maincpu", 0 ) + ROM_LOAD16_BYTE("gold.u3", 0x0000, 0x8000, CRC(e7cccd12) SHA1(4542f62963ab78796626c0c938e39e715d1c19f8) ) + ROM_LOAD16_BYTE("orange.u2", 0x0001, 0x8000, CRC(9e0bbd15) SHA1(5867f35489d15c1e395f6b2aa91a76d74ad6f2f4) ) +ROM_END + +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */ +CONS( 1987, sphinx40, 0, 0, sphinx40, sphinx40, sphinx40_state, empty_init, "CXG Systems / Newcrest Technology", "Sphinx 40", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/tasc.cpp b/src/mame/drivers/tasc.cpp index a86d2538349..16f3b5709fb 100644 --- a/src/mame/drivers/tasc.cpp +++ b/src/mame/drivers/tasc.cpp @@ -246,7 +246,7 @@ void tasc_state::tasc(machine_config &config) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2) | ROM_BIOS(bios)) ROM_START( tascr30 ) - ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_REGION32_LE( 0x40000, "maincpu", 0 ) ROM_DEFAULT_BIOS("v25") ROM_SYSTEM_BIOS( 0, "v21", "System V0.31, Gideon 2.1" ) // 3-May-93, 3-Feb-93 (prototype, later released in 2012) ROM_SYSTEM_BIOS( 1, "v22", "System V0.31, The King 2.20" ) // 3-May-93, 23-Apr-93 diff --git a/src/mame/layout/cxg_sphinx40.lay b/src/mame/layout/cxg_sphinx40.lay new file mode 100644 index 00000000000..e7a06ac3494 --- /dev/null +++ b/src/mame/layout/cxg_sphinx40.lay @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 6ee01709012..6e4828df4cf 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -11275,6 +11275,9 @@ ch2001 @source:cxg_dominator.cpp sdtor +@source:cxg_sphinx40.cpp +sphinx40 + @source:cxhumax.cpp hxhdci2k // diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 66595060eb0..24e97deb16a 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -178,6 +178,7 @@ ct486.cpp cvicny.cpp cxg_ch2001.cpp cxg_dominator.cpp +cxg_sphinx40.cpp cxhumax.cpp cybiko.cpp cz101.cpp -- cgit v1.2.3