From b6b4957fe87b03b56d39bb5b0bf97c39fdf936eb Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 19 Feb 2020 18:39:55 +0100 Subject: [PATCH] New working machines -------------------- Conchess (standard) [hap, Berger] --- scripts/target/mame/mess.lua | 6 + src/devices/sound/beep.cpp | 2 +- src/mame/drivers/conchess.cpp | 225 ++++++++++++++ src/mame/drivers/mephisto_mm2.cpp | 28 +- src/mame/layout/conchess.lay | 469 ++++++++++++++++++++++++++++++ src/mame/mame.lst | 3 + src/mame/mess.flt | 1 + 7 files changed, 722 insertions(+), 12 deletions(-) create mode 100644 src/mame/drivers/conchess.cpp create mode 100644 src/mame/layout/conchess.lay diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 19dcc978a9a..6c3a65063de 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -1122,6 +1122,7 @@ function linkProjects_mame_mess(_target, _subtarget) "citoh", "coleco", "compugraphic", + "consumenta", "cromemco", "comx", "concept", @@ -1999,6 +2000,11 @@ files { MAME_DIR .. "src/mame/drivers/pwrview.cpp", } +createMESSProjects(_target, _subtarget, "consumenta") +files { + MAME_DIR .. "src/mame/drivers/conchess.cpp", +} + createMESSProjects(_target, _subtarget, "cromemco") files { MAME_DIR .. "src/mame/drivers/c10.cpp", diff --git a/src/devices/sound/beep.cpp b/src/devices/sound/beep.cpp index 6212bed7915..8c5a404afd0 100644 --- a/src/devices/sound/beep.cpp +++ b/src/devices/sound/beep.cpp @@ -16,7 +16,7 @@ #include "emu.h" #include "sound/beep.h" -#define BEEP_RATE (48000) +#define BEEP_RATE (384000) // device type definition diff --git a/src/mame/drivers/conchess.cpp b/src/mame/drivers/conchess.cpp new file mode 100644 index 00000000000..09029274f3f --- /dev/null +++ b/src/mame/drivers/conchess.cpp @@ -0,0 +1,225 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Berger +/****************************************************************************** + +Conchess, a series of modular chess computers by Consumenta Computer. +Hardware development by Loproc (Germany), manufactured at Wallharn Electronics +(Ireland). The core people involved were Ulf Rathsman for the chess engine, +and Johan Enroth. After Consumenta went under in 1983, the Conchess brand was +continued by Systemhuset, Enroth's company. + +Hardware notes: + +Chess boards released were Escorter, Ambassador, and Monarch, each should be the +same hardware, they just differ in size and material. +- TTL, 2 module slots +- 16+64 leds, 16 buttons, reed sensors for magnet chesspieces + +All chess modules appear to be on similar PCBs, with room a 6502/65C02, +and 8 ROM/RAM chips. + +A0 (untitled standard pack-in module): +- SY6502A @ 2MHz (4MHz XTAL) +- 3*8KB ROM, 4KB RAM(2*TMM2016P) +- TTL, beeper + +******************************************************************************/ + +#include "emu.h" +#include "cpu/m6502/m6502.h" +#include "machine/sensorboard.h" +#include "machine/timer.h" +#include "sound/beep.h" +#include "video/pwm.h" +#include "speaker.h" + +// internal artwork +#include "conchess.lh" // clickable + + +namespace { + +class conchess_state : public driver_device +{ +public: + conchess_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_irq_on(*this, "irq_on"), + m_display(*this, "display"), + m_board(*this, "board"), + m_beeper(*this, "beeper"), + m_inputs(*this, "IN.%u", 0) + { } + + // machine configs + void concstd(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + // devices/pointers + required_device m_maincpu; + required_device m_irq_on; + required_device m_display; + required_device m_board; + required_device m_beeper; + required_ioport_array<2> m_inputs; + + // address maps + void main_map(address_map &map); + + // periodic interrupts + template TIMER_DEVICE_CALLBACK_MEMBER(irq_on) { m_maincpu->set_input_line(Line, ASSERT_LINE); } + template TIMER_DEVICE_CALLBACK_MEMBER(irq_off) { m_maincpu->set_input_line(Line, CLEAR_LINE); } + + // I/O handlers + DECLARE_READ8_MEMBER(input_r); + DECLARE_WRITE8_MEMBER(leds_w); + DECLARE_WRITE8_MEMBER(sound_w); + + u8 m_inp_mux = 0; +}; + +void conchess_state::machine_start() +{ + save_item(NAME(m_inp_mux)); +} + + + +/****************************************************************************** + I/O +******************************************************************************/ + +READ8_MEMBER(conchess_state::input_r) +{ + u8 data = 0; + + // read side panel buttons + if (m_inp_mux == 0 || m_inp_mux == 9) + data = m_inputs[m_inp_mux & 1]->read(); + + // read chessboard sensors + else + data = m_board->read_file((m_inp_mux - 1) ^ 7); + + return ~data; +} + +WRITE8_MEMBER(conchess_state::leds_w) +{ + // a0-a3: CD4028B to led select/input mux + m_inp_mux = offset; + if (m_inp_mux & 8) + m_inp_mux &= 9; + + // d0-d7: led data + m_display->matrix(1 << m_inp_mux, data); +} + +WRITE8_MEMBER(conchess_state::sound_w) +{ + // d7: enable beeper + m_beeper->set_state(BIT(data, 7)); +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void conchess_state::main_map(address_map &map) +{ + map(0x0000, 0x0fff).ram(); + map(0x1050, 0x1050).r(FUNC(conchess_state::input_r)); + map(0x1060, 0x106f).w(FUNC(conchess_state::leds_w)); + map(0x1800, 0x1800).w(FUNC(conchess_state::sound_w)); + map(0xa000, 0xffff).rom(); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( conchess ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("O. (Clear)") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Stop") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Dice Symbol (Alternate)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("?-Sign (Analyze)") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Section Sign (Referee)") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("4-Way Arrow (Piece)") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("2-Way Arrow (Level)") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME(". (Continue)") + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Pawn") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Knight") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Bishop") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Rook") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Queen") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("King") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("White") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Black") +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void conchess_state::concstd(machine_config &config) +{ + /* basic machine hardware */ + M6502(config, m_maincpu, 4_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &conchess_state::main_map); + + const attotime irq_period = attotime::from_hz(4_MHz_XTAL / 0x2000); // through 4020 IC, ~488Hz + TIMER(config, m_irq_on).configure_periodic(FUNC(conchess_state::irq_on), irq_period); + m_irq_on->set_start_delay(irq_period - attotime::from_nsec(31200)); // active for ~31.2us + TIMER(config, "irq_off").configure_periodic(FUNC(conchess_state::irq_off), irq_period); + + 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(10, 8); + config.set_default_layout(layout_conchess); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + BEEP(config, m_beeper, 4_MHz_XTAL / 0x400); + m_beeper->add_route(ALL_OUTPUTS, "mono", 0.25); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( concstd ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("c87011.b3", 0xa000, 0x2000, CRC(915e414c) SHA1(80c94712d1c79fa469576c37b80ab66f77c77cc4) ) + ROM_LOAD("c87010.b2", 0xc000, 0x2000, CRC(088c8737) SHA1(9f841b3c47de9ef1da8ce98c0a33a919cba873c6) ) + ROM_LOAD("c87009.b1", 0xe000, 0x2000, CRC(e1c648e2) SHA1(725a6ac1c69f788a7bba0573e5609b55b12899ac) ) +ROM_END + +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */ +CONS( 1982, concstd, 0, 0, concstd, conchess, conchess_state, empty_init, "Consumenta Computer / Loproc", "Conchess (standard)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/mephisto_mm2.cpp b/src/mame/drivers/mephisto_mm2.cpp index 38aee5eb5de..8fb9b3f625d 100644 --- a/src/mame/drivers/mephisto_mm2.cpp +++ b/src/mame/drivers/mephisto_mm2.cpp @@ -67,6 +67,8 @@ The MM V prototype was the program that Ed Schroeder participated with as "Rebel 1989 WMCCC in Portorose. It was used with the TK20 TurboKit. http://chesseval.com/ChessEvalJournal/PrototypeMMV.htm +MM VI (Saitek, 1994) is on different hardware, H8 CPU. + TODO: - need to emulate TurboKit properly, also for mm5p (it's not as simple as a CPU @@ -468,16 +470,6 @@ void mephisto_state::mm2(machine_config &config) ROM Definitions ******************************************************************************/ -ROM_START( rebel5 ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("rebel5_v2.rom", 0x8000, 0x8000, CRC(17232752) SHA1(3cd6893c0071f3dc02785bf99f1950eed81eba39) ) -ROM_END - -ROM_START( rebel5a ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("rebell_5.12.86", 0x8000, 0x8000, CRC(8d02e1ef) SHA1(9972c75936613bd68cfd3fe62bd222e90e8b1083) ) -ROM_END - ROM_START( mm2 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("400", 0x8000, 0x8000, CRC(e8c1f431) SHA1(c32dfa66eefbf3e539438d2fe6e6916f78a128be) ) // HN27C256G-20 @@ -506,6 +498,7 @@ ROM_START( mm2d ) ROM_LOAD("mm2_v1_2.bin", 0xc000, 0x4000, CRC(01143cc1) SHA1(f78474b410dbecb209aa23ef81e9f894e8b54942) ) ROM_END + ROM_START( bup ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("bup_v2_1.bin", 0x8000, 0x4000, CRC(e1e9625a) SHA1(8a757e28b7afca2a092f8ff419087e06b07b743e) ) @@ -518,6 +511,18 @@ ROM_START( bupa ) ROM_LOAD("bup_v1_2.bin", 0xc000, 0x4000, CRC(708338ea) SHA1(d617c4aa2161865a22b4b0646ba793f8a1fda863) ) ROM_END + +ROM_START( rebel5 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("rebel5_v2.rom", 0x8000, 0x8000, CRC(17232752) SHA1(3cd6893c0071f3dc02785bf99f1950eed81eba39) ) +ROM_END + +ROM_START( rebel5a ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("rebell_5.12.86", 0x8000, 0x8000, CRC(8d02e1ef) SHA1(9972c75936613bd68cfd3fe62bd222e90e8b1083) ) +ROM_END + + ROM_START( mm4 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("710", 0x8000, 0x8000, CRC(f68a4124) SHA1(d1d03a9aacc291d5cb720d2ee2a209eeba13a36c) ) @@ -538,6 +543,7 @@ ROM_START( mm4tk ) ROM_LOAD("mm4tk.rom", 0x8000, 0x8000, CRC(51cb36a4) SHA1(9e184b4e85bb721e794b88d8657ae8d2ff5a24af) ) ROM_END + ROM_START( mm5 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("mephisto5.rom", 0x8000, 0x8000, CRC(89c3d9d2) SHA1(77cd6f8eeb03c713249db140d2541e3264328048) ) @@ -570,7 +576,7 @@ CONS( 1984, mm2d, mm2, 0, mm2, mephisto, mephisto_state, empty_i CONS( 1985, bup, 0, 0, bup, bup, mephisto_state, empty_init, "Hegener + Glaser", "Mephisto Blitz- und Problemloesungs-Modul (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1985, bupa, bup, 0, bup, bup, mephisto_state, empty_init, "Hegener + Glaser", "Mephisto Blitz- und Problemloesungs-Modul (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1986, rebel5, 0, 0, rebel5, mephisto, mephisto_state, empty_init, "Hegener + Glaser", "Mephisto Rebell 5,0 (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1986, rebel5, 0, 0, rebel5, mephisto, mephisto_state, empty_init, "Hegener + Glaser", "Mephisto Rebell 5,0 (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // aka MM III CONS( 1986, rebel5a, rebel5, 0, rebel5, mephisto, mephisto_state, empty_init, "Hegener + Glaser", "Mephisto Rebell 5,0 (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1987, mm4, 0, 0, mm4, mephisto, mephisto_state, empty_init, "Hegener + Glaser", "Mephisto MM IV (v7.10)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/layout/conchess.lay b/src/mame/layout/conchess.lay new file mode 100644 index 00000000000..287b831cbd8 --- /dev/null +++ b/src/mame/layout/conchess.lay @@ -0,0 +1,469 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 65eac66ca2c..e9aa9d8e10f 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10502,6 +10502,9 @@ comquest // Comquest Plus German comx35n // comx35p // +@source:conchess.cpp +concstd + @source:concept.cpp concept // 1982 Corvus Concept diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 16d0c85f3c9..6655e6860ab 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -177,6 +177,7 @@ compuchess.cpp compucolor.cpp comquest.cpp comx35.cpp +conchess.cpp concept.cpp controlid.cpp cortex.cpp