From 0dca4d3106afc1e02042b93680f3aebfd086a011 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 7 Apr 2021 23:11:02 +0200 Subject: mephisto_polgar.cpp: split driver into polgar, risc, milano --- scripts/target/mame/mess.lua | 2 + src/devices/machine/chessmachine.cpp | 7 +- src/mame/drivers/cking_master.cpp | 2 + src/mame/drivers/mephisto_academy.cpp | 10 +- src/mame/drivers/mephisto_berlin.cpp | 37 +-- src/mame/drivers/mephisto_milano.cpp | 178 ++++++++++++ src/mame/drivers/mephisto_modena.cpp | 28 +- src/mame/drivers/mephisto_mondial68k.cpp | 6 +- src/mame/drivers/mephisto_polgar.cpp | 281 ++++--------------- src/mame/drivers/mephisto_risc.cpp | 197 +++++++++++++ src/mame/layout/mephisto_academy.lay | 4 +- src/mame/layout/mephisto_alm16.lay | 2 +- src/mame/layout/mephisto_alm32.lay | 2 +- src/mame/layout/mephisto_berlin.lay | 69 ++--- src/mame/layout/mephisto_gen32.lay | 2 +- src/mame/layout/mephisto_milano.lay | 33 +-- src/mame/layout/mephisto_polgar.lay | 29 +- src/mame/layout/mephisto_risc.lay | 461 +++++++++++++++++++++++++++++++ src/mame/mame.lst | 10 +- src/mame/mess.flt | 2 + src/mame/video/mmdisplay2.h | 1 + 21 files changed, 1024 insertions(+), 339 deletions(-) create mode 100644 src/mame/drivers/mephisto_milano.cpp create mode 100644 src/mame/drivers/mephisto_risc.cpp create mode 100644 src/mame/layout/mephisto_risc.lay diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index edd03a28e6f..668fd23d3bc 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -2537,6 +2537,7 @@ files { MAME_DIR .. "src/mame/drivers/mephisto_berlin.cpp", MAME_DIR .. "src/mame/drivers/mephisto_brikett.cpp", MAME_DIR .. "src/mame/drivers/mephisto_glasgow.cpp", + MAME_DIR .. "src/mame/drivers/mephisto_milano.cpp", MAME_DIR .. "src/mame/drivers/mephisto_mm1.cpp", MAME_DIR .. "src/mame/drivers/mephisto_mm2.cpp", MAME_DIR .. "src/mame/drivers/mephisto_modena.cpp", @@ -2546,6 +2547,7 @@ files { MAME_DIR .. "src/mame/drivers/mephisto_mondial68k.cpp", MAME_DIR .. "src/mame/drivers/mephisto_montec.cpp", MAME_DIR .. "src/mame/drivers/mephisto_polgar.cpp", + MAME_DIR .. "src/mame/drivers/mephisto_risc.cpp", MAME_DIR .. "src/mame/machine/mmboard.cpp", MAME_DIR .. "src/mame/machine/mmboard.h", MAME_DIR .. "src/mame/video/mmdisplay2.cpp", diff --git a/src/devices/machine/chessmachine.cpp b/src/devices/machine/chessmachine.cpp index ce0d358f183..c9a00f33dda 100644 --- a/src/devices/machine/chessmachine.cpp +++ b/src/devices/machine/chessmachine.cpp @@ -10,14 +10,15 @@ This is the 2nd (1992) version of The ChessMachine, it is used in: - The ChessMachine EC2, Amiga external module - Mephisto Risc 1MB/II, chess computer -Unlike the SR model (devices/bus/isa/chessmsr.*), RAM size and CPU type -are the same on every known device. - +Hardware notes: - VLSI-ARM VY86C010-12QC (ARM2 CPU) - 1MB RAM (8*Siemens HYB514256B-60) - 128 bytes PROM (4*DM74S288AN) - 2 GALs for I/O handling +Unlike the SR model (devices/bus/isa/chessmsr.*), RAM size and CPU type +are the same on every known device. + Only 4 lines for I/O, so that part is much slower than the SR model. There is no XTAL, it looks like there's a variable resistor for tweaking diff --git a/src/mame/drivers/cking_master.cpp b/src/mame/drivers/cking_master.cpp index c2622c13fa6..5cefa52ef89 100644 --- a/src/mame/drivers/cking_master.cpp +++ b/src/mame/drivers/cking_master.cpp @@ -20,12 +20,14 @@ TODO: ******************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/sensorboard.h" #include "machine/bankdev.h" #include "machine/timer.h" #include "sound/dac.h" #include "video/pwm.h" + #include "speaker.h" // internal artwork diff --git a/src/mame/drivers/mephisto_academy.cpp b/src/mame/drivers/mephisto_academy.cpp index cb910db2671..4ffff24d3d5 100644 --- a/src/mame/drivers/mephisto_academy.cpp +++ b/src/mame/drivers/mephisto_academy.cpp @@ -7,12 +7,12 @@ Mephisto Academy Hardware notes: - PCB label HGS 10 130 01 -- VL65NC02-04PC, 4.91MHz XTAL +- VL65NC02-04PC @ 4.91MHz - 2*32KB ROM(TC57256AD-12), 1st ROM half-empty - 8KB battery-backed RAM(TC5564APL-15) - HD44100H, HD44780, 2*16 chars LCD screen - 8 tri-color leds (not fully used: always outputs 6 red, 2 green) -- magnets chessboard with leds, beeper +- magnets chessboard with leds, piezo Since the program is on an external module, it appears it was meant to be a modular chesscomputer. However, no extra modules were sold separately. @@ -29,6 +29,7 @@ Module PCB is the same as Super Mondial II College, label HGS 10 116 05. #include "video/mmdisplay2.h" #include "video/pwm.h" +// internal artwork #include "mephisto_academy.lh" @@ -125,7 +126,6 @@ INPUT_PORTS_END void academy_state::academy(machine_config &config) { - /* basic machine hardware */ M65C02(config, m_maincpu, 4.9152_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &academy_state::main_map); @@ -137,7 +137,7 @@ void academy_state::academy(machine_config &config) HC259(config, m_outlatch); // SN74HC259N m_outlatch->parallel_out_cb().set("display:dac", FUNC(dac_byte_interface::write)).rshift(2).mask(0x03); - MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_SENSORS_BOARD(config, "board"); // internal MEPHISTO_DISPLAY_MODULE2(config, "display"); // internal PWM_DISPLAY(config, m_led_pwm).set_size(4, 4); @@ -176,7 +176,7 @@ ROM_END Game Drivers ***************************************************************************/ -/* YEAR, NAME, PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */ +/* YEAR, NAME, PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ CONS( 1989, academy, 0, 0, academy, academy, academy_state, empty_init, "Hegener + Glaser", "Mephisto Academy (English)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1989, academyg, academy, 0, academy, academy, academy_state, empty_init, "Hegener + Glaser", "Mephisto Academy (German, 06-03-89)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1989, academyga, academy, 0, academy, academy, academy_state, empty_init, "Hegener + Glaser", "Mephisto Academy (German, 04-10-88)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/mephisto_berlin.cpp b/src/mame/drivers/mephisto_berlin.cpp index 588d829596b..5567e78800f 100644 --- a/src/mame/drivers/mephisto_berlin.cpp +++ b/src/mame/drivers/mephisto_berlin.cpp @@ -33,6 +33,7 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_board(*this, "board") + , m_display(*this, "display") , m_keys(*this, "KEY") { } @@ -48,6 +49,7 @@ private: required_device m_maincpu; required_device m_board; + required_device m_display; required_ioport m_keys; }; @@ -59,10 +61,9 @@ private: u8 berlin_state::input_r() { - if (m_board->mux_r() == 0xff) - return m_keys->read(); - else - return m_board->input_r() ^ 0xff; + // display i/o d7 selects keypad + u8 data = (m_display->io_r() & 0x80) ? 0 : m_keys->read(); + return ~m_board->input_r() | data; } @@ -84,8 +85,8 @@ void berlin_state::berlin_mem(address_map &map) map(0x900000, 0x903fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask16(0xff00); map(0xa00000, 0xa00000).r(FUNC(berlin_state::input_r)); map(0xb00000, 0xb00000).w(m_board, FUNC(mephisto_board_device::mux_w)); - map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_module2_device::latch_w)); - map(0xd00008, 0xd00008).w("display", FUNC(mephisto_display_module2_device::io_w)); + map(0xc00000, 0xc00000).w(m_display, FUNC(mephisto_display_module2_device::latch_w)); + map(0xd00008, 0xd00008).w(m_display, FUNC(mephisto_display_module2_device::io_w)); map(0xe00000, 0xe00000).w(m_board, FUNC(mephisto_board_device::led_w)); } @@ -96,8 +97,8 @@ void berlin_state::berlinp_mem(address_map &map) map(0x800000, 0x800000).r(FUNC(berlin_state::input_r)); map(0x900000, 0x900000).w(m_board, FUNC(mephisto_board_device::mux_w)); map(0xa00000, 0xa00000).w(m_board, FUNC(mephisto_board_device::led_w)); - map(0xb00000, 0xb00000).w("display", FUNC(mephisto_display_module2_device::io_w)); - map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0xb00000, 0xb00000).w(m_display, FUNC(mephisto_display_module2_device::io_w)); + map(0xc00000, 0xc00000).w(m_display, FUNC(mephisto_display_module2_device::latch_w)); map(0xd00000, 0xd07fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000); } @@ -109,14 +110,14 @@ void berlin_state::berlinp_mem(address_map &map) static INPUT_PORTS_START( berlin ) PORT_START("KEY") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("NEW GAME (1/2)") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_F1) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("NEW GAME (2/2)") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_F1) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Clear") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("New Game (1/2)") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_F1) // combine for NEW GAME + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("New Game (2/2)") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_F1) // " INPUT_PORTS_END @@ -137,10 +138,10 @@ void berlin_state::berlin(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); ADDRESS_MAP_BANK(config, "nvram_map").set_map(&berlin_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13); - MEPHISTO_BUTTONS_BOARD(config, m_board); + MEPHISTO_BUTTONS_BOARD(config, m_board); // internal subdevice("board:board")->set_nvram_enable(true); - MEPHISTO_DISPLAY_MODULE2(config, "display"); + MEPHISTO_DISPLAY_MODULE2(config, m_display); // internal config.set_default_layout(layout_mephisto_berlin); } diff --git a/src/mame/drivers/mephisto_milano.cpp b/src/mame/drivers/mephisto_milano.cpp new file mode 100644 index 00000000000..4dc7e225615 --- /dev/null +++ b/src/mame/drivers/mephisto_milano.cpp @@ -0,0 +1,178 @@ +// license:BSD-3-Clause +// copyright-holders:Sandro Ronco +/****************************************************************************** + +Mephisto Milano + +Hardware notes: +- RP65C02G or W65C02P-8 @ 4.91MHz +- 8KB RAM(battery-backed), 64KB ROM +- HD44100H, HD44780, 2*16 chars LCD screen +- 8*8 chessboard buttons, 16 leds, piezo + +Nigel Short is basically a Milano 2.00 + +******************************************************************************/ + +#include "emu.h" + +#include "cpu/m6502/r65c02.h" +#include "machine/74259.h" +#include "machine/nvram.h" +#include "machine/mmboard.h" +#include "video/mmdisplay2.h" + +// internal artwork +#include "mephisto_milano.lh" + + +namespace { + +class mephisto_milano_state : public driver_device +{ +public: + mephisto_milano_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_board(*this, "board") + , m_display(*this, "display") + , m_keys(*this, "KEY") + { } + + void milano(machine_config &config); + +private: + required_device m_maincpu; + required_device m_board; + required_device m_display; + required_ioport m_keys; + + void milano_mem(address_map &map); + + u8 keys_r(offs_t offset); + u8 board_r(); + void io_w(u8 data); +}; + + + +/****************************************************************************** + I/O +******************************************************************************/ + +u8 mephisto_milano_state::keys_r(offs_t offset) +{ + return (BIT(m_keys->read(), offset) << 7) | 0x7f; +} + +u8 mephisto_milano_state::board_r() +{ + return m_board->input_r() ^ 0xff; +} + +void mephisto_milano_state::io_w(u8 data) +{ + // default display module + m_display->io_w(data & 0x0f); + + // high bits go to board leds + m_board->led_w(data >> 4); +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void mephisto_milano_state::milano_mem(address_map &map) +{ + map(0x0000, 0x1fbf).ram().share("nvram"); + map(0x1fc0, 0x1fc0).w(m_display, FUNC(mephisto_display_module2_device::latch_w)); + map(0x1fd0, 0x1fd0).w(m_board, FUNC(mephisto_board_device::mux_w)); + map(0x1fe0, 0x1fe0).r(FUNC(mephisto_milano_state::board_r)); + map(0x1fe8, 0x1fef).w("outlatch", FUNC(hc259_device::write_d7)).nopr(); + map(0x1fd8, 0x1fdf).r(FUNC(mephisto_milano_state::keys_r)); + map(0x1ff0, 0x1ff0).w(FUNC(mephisto_milano_state::io_w)); + map(0x2000, 0xffff).rom(); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( milano ) + PORT_START("KEY") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Training / Pawn") PORT_CODE(KEYCODE_T) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Info / Knight") PORT_CODE(KEYCODE_I) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Memory / Bishop") PORT_CODE(KEYCODE_M) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Level / Queen") PORT_CODE(KEYCODE_L) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Function / King") PORT_CODE(KEYCODE_F) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Enter / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Clear / New Game") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // " +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void mephisto_milano_state::milano(machine_config &config) +{ + R65C02(config, m_maincpu, 4.9152_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_milano_state::milano_mem); + m_maincpu->set_periodic_int(FUNC(mephisto_milano_state::nmi_line_pulse), attotime::from_hz(4.9152_MHz_XTAL / (1 << 13))); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + hc259_device &outlatch(HC259(config, "outlatch")); + outlatch.q_out_cb<0>().set_output("led100"); + outlatch.q_out_cb<1>().set_output("led101"); + outlatch.q_out_cb<2>().set_output("led102"); + outlatch.q_out_cb<3>().set_output("led103"); + outlatch.q_out_cb<4>().set_output("led104"); + outlatch.q_out_cb<5>().set_output("led105"); + + MEPHISTO_BUTTONS_BOARD(config, m_board); // internal + MEPHISTO_DISPLAY_MODULE2(config, m_display); // internal + config.set_default_layout(layout_mephisto_milano); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( milano ) // 1.02 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("milano_b958", 0x0000, 0x10000, CRC(0e9c8fe1) SHA1(e9176f42d86fe57e382185c703c7eff7e63ca711) ) +ROM_END + +ROM_START( milanoa ) // 1.01 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("milano_4af8", 0x0000, 0x10000, CRC(22efc0be) SHA1(921607d6dacf72c0686b8970261c43e2e244dc9f) ) +ROM_END + +ROM_START( nshort ) // 2.00 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("nshort.bin", 0x00000, 0x10000, CRC(4bd51e23) SHA1(3f55cc1c55dae8818b7e9384b6b8d43dc4f0a1af) ) +ROM_END + +} // anonymous namespace + + + +/*************************************************************************** + Game Drivers +***************************************************************************/ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +CONS( 1991, milano, 0, 0, milano, milano, mephisto_milano_state, empty_init, "Hegener + Glaser", "Mephisto Milano (v1.02)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1991, milanoa, milano, 0, milano, milano, mephisto_milano_state, empty_init, "Hegener + Glaser", "Mephisto Milano (v1.01)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +CONS( 1993, nshort, 0, 0, milano, milano, mephisto_milano_state, empty_init, "Hegener + Glaser", "Mephisto Nigel Short", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/mephisto_modena.cpp b/src/mame/drivers/mephisto_modena.cpp index 80928178544..2ade56ab653 100644 --- a/src/mame/drivers/mephisto_modena.cpp +++ b/src/mame/drivers/mephisto_modena.cpp @@ -22,6 +22,7 @@ Hold Pawn + Knight buttons at boot for test mode. #include "speaker.h" +// internal artwork #include "mephisto_modena.lh" @@ -61,7 +62,7 @@ private: void led_w(u8 data); void update_display(); - u8 m_board_mux = 0xff; + u8 m_board_mux = 0; u8 m_digits_idx = 0; u8 m_io_ctrl = 0; }; @@ -70,6 +71,7 @@ void modena_state::machine_start() { m_digits.resolve(); + save_item(NAME(m_board_mux)); save_item(NAME(m_digits_idx)); save_item(NAME(m_io_ctrl)); } @@ -82,7 +84,7 @@ void modena_state::machine_start() void modena_state::update_display() { - m_display->matrix(m_io_ctrl >> 1 & 7, ~m_board_mux); + m_display->matrix(m_io_ctrl >> 1 & 7, m_board_mux); } u8 modena_state::input_r() @@ -94,8 +96,8 @@ u8 modena_state::input_r() data |= m_keys->read(); // read chessboard sensors - for (int i=0; i<8; i++) - if (!BIT(m_board_mux, i)) + for (int i = 0; i < 8; i++) + if (BIT(m_board_mux, i)) data |= m_board->read_rank(i); return data; @@ -104,7 +106,7 @@ u8 modena_state::input_r() void modena_state::led_w(u8 data) { // d0-d7: chessboard mux, led data - m_board_mux = data; + m_board_mux = ~data; update_display(); } @@ -150,14 +152,14 @@ void modena_state::modena_mem(address_map &map) static INPUT_PORTS_START( modena ) PORT_START("KEY") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("BOOK") PORT_CODE(KEYCODE_B) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEMORY") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POSITION") PORT_CODE(KEYCODE_O) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEVEL") PORT_CODE(KEYCODE_L) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FUNCTION") PORT_CODE(KEYCODE_F) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // " + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Book / Pawn") PORT_CODE(KEYCODE_B) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Info / Knight") PORT_CODE(KEYCODE_I) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Memory / Bishop") PORT_CODE(KEYCODE_M) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Level / Queen") PORT_CODE(KEYCODE_L) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Function / King") PORT_CODE(KEYCODE_F) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Clear / New Game") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // " INPUT_PORTS_END diff --git a/src/mame/drivers/mephisto_mondial68k.cpp b/src/mame/drivers/mephisto_mondial68k.cpp index a77d5a43a23..f7031268034 100644 --- a/src/mame/drivers/mephisto_mondial68k.cpp +++ b/src/mame/drivers/mephisto_mondial68k.cpp @@ -91,7 +91,7 @@ void mondial68k_state::update_display() void mondial68k_state::lcd_s_w(u32 data) { // output LCD digits (note: last digit DP segment is unused) - for (int i=0; i<4; i++) + for (int i = 0; i < 4; i++) m_digits[i] = bitswap<8>((data & 0x7fffffff) >> (8 * i), 7,4,5,0,1,2,3,6); } @@ -115,12 +115,12 @@ u8 mondial68k_state::inputs_r() u8 data = 0x00; // read buttons - for (int i=0; i<4; i++) + for (int i = 0; i < 4; i++) if (!BIT(m_input_mux, i)) data |= m_inputs[i]->read(); // read chessboard sensors - for (int i=0; i<8; i++) + for (int i = 0; i < 8; i++) if (!BIT(m_board_mux, i)) data |= m_board->read_rank(i); diff --git a/src/mame/drivers/mephisto_polgar.cpp b/src/mame/drivers/mephisto_polgar.cpp index f6cba480579..4543067da40 100644 --- a/src/mame/drivers/mephisto_polgar.cpp +++ b/src/mame/drivers/mephisto_polgar.cpp @@ -1,34 +1,34 @@ // license:BSD-3-Clause // copyright-holders:Sandro Ronco -/************************************************************************************************** +/****************************************************************************** -Mephisto Polgar and RISC +Mephisto Polgar -The chess engine in Mephisto Risc is also compatible with Tasc's The ChessMachine. +Hardware notes: +- RP65C02G @ 4.91MHz +- 64KB ROM +- Mephisto modular display module +- Mephisto Exclusive/Muenchen chessboard -TODO: -- split driver into several files? mrisc for example is completely different hw - -**************************************************************************************************/ +The 10MHz version has a W65C02P-8 @ 9.83MHz. +******************************************************************************/ #include "emu.h" #include "cpu/m6502/m65c02.h" -#include "cpu/m6502/m65sc02.h" +#include "cpu/m6502/r65c02.h" #include "machine/74259.h" #include "machine/nvram.h" #include "machine/mmboard.h" -#include "machine/chessmachine.h" #include "video/mmdisplay2.h" -#include "speaker.h" - // internal artwork -#include "mephisto_milano.lh" #include "mephisto_polgar.lh" +namespace { + class mephisto_polgar_state : public driver_device { public: @@ -38,192 +38,77 @@ public: , m_keys(*this, "KEY") { } - uint8_t polgar_keys_r(offs_t offset); - void polgar10(machine_config &config); void polgar(machine_config &config); - void polgar_mem(address_map &map); -protected: + +private: required_device m_maincpu; required_ioport m_keys; -}; - -class mephisto_risc_state : public mephisto_polgar_state -{ -public: - mephisto_risc_state(const machine_config &mconfig, device_type type, const char *tag) - : mephisto_polgar_state(mconfig, type, tag) - , m_chessm(*this, "chessm") - , m_rombank(*this, "rombank") - { } - uint8_t chessm_r(); - void chessm_w(uint8_t data); - - void mrisc(machine_config &config); - void mrisc_mem(address_map &map); -protected: - virtual void machine_start() override; + void polgar_mem(address_map &map); -private: - required_device m_chessm; - required_memory_bank m_rombank; - uint8_t m_bank; + u8 keys_r(offs_t offset); }; -class mephisto_milano_state : public mephisto_polgar_state -{ -public: - mephisto_milano_state(const machine_config &mconfig, device_type type, const char *tag) - : mephisto_polgar_state(mconfig, type, tag) - , m_board(*this, "board") - , m_display(*this, "display") - , m_leds(*this, "led%u", 0U) - { } - - uint8_t milano_input_r(); - void milano_led_w(uint8_t data); - void milano_io_w(uint8_t data); - void milano(machine_config &config); - void milano_mem(address_map &map); -protected: - virtual void machine_reset() override; - virtual void machine_start() override; -private: - required_device m_board; - required_device m_display; - output_finder<16> m_leds; - uint8_t m_led_latch; -}; +/****************************************************************************** + I/O +******************************************************************************/ -uint8_t mephisto_polgar_state::polgar_keys_r(offs_t offset) +u8 mephisto_polgar_state::keys_r(offs_t offset) { return (BIT(m_keys->read(), offset) << 7) | 0x7f; } -void mephisto_polgar_state::polgar_mem(address_map &map) -{ - map(0x0000, 0x1fff).ram().share("nvram"); - map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w)); - map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w)); - map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w)); - map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w)); - map(0x2c00, 0x2c07).r(FUNC(mephisto_polgar_state::polgar_keys_r)); - map(0x3000, 0x3000).r("board", FUNC(mephisto_board_device::input_r)); - map(0x3400, 0x3407).w("outlatch", FUNC(hc259_device::write_d7)); - map(0x4000, 0xffff).rom(); -} -uint8_t mephisto_risc_state::chessm_r() -{ - return m_chessm->data_r(); -} +/****************************************************************************** + Address Maps +******************************************************************************/ -void mephisto_risc_state::chessm_w(uint8_t data) -{ - m_chessm->data0_w(data & 1); - m_chessm->data1_w(data & 0x80); - m_chessm->reset_w(data & 2); -} - -void mephisto_risc_state::mrisc_mem(address_map &map) +void mephisto_polgar_state::polgar_mem(address_map &map) { - map.unmap_value_high(); map(0x0000, 0x1fff).ram().share("nvram"); map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w)); map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w)); - map(0x2c00, 0x2c07).r(FUNC(mephisto_risc_state::polgar_keys_r)); map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w)); map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w)); + map(0x2c00, 0x2c07).r(FUNC(mephisto_polgar_state::keys_r)); map(0x3000, 0x3000).r("board", FUNC(mephisto_board_device::input_r)); - map(0x3400, 0x3407).w("outlatch", FUNC(hc259_device::write_d7)).nopr(); - map(0x3800, 0x3800).w(FUNC(mephisto_risc_state::chessm_w)); - map(0x3c00, 0x3c00).r(FUNC(mephisto_risc_state::chessm_r)); - map(0x4000, 0x7fff).rom(); - map(0x8000, 0xffff).bankr("rombank"); -} - - -uint8_t mephisto_milano_state::milano_input_r() -{ - return m_board->input_r() ^ 0xff; -} - -void mephisto_milano_state::milano_led_w(uint8_t data) -{ - m_led_latch = data; - m_board->mux_w(data); -} - -void mephisto_milano_state::milano_io_w(uint8_t data) -{ - if ((data & 0xf0) == 0x90 || (data & 0xf0) == 0x60) - { - uint8_t base = (data & 0xf0) == 0x90 ? 0 : 8; - for(int i=0; i<8; i++) - m_leds[base + i] = BIT(m_led_latch, i) ? 0 : 1; - } - else - { - for(int i=0; i<16; i++) - m_leds[i] = 0; - } - - m_display->io_w(data & 0x0f); + map(0x3400, 0x3407).w("outlatch", FUNC(hc259_device::write_d7)); + map(0x4000, 0xffff).rom(); } -void mephisto_milano_state::milano_mem(address_map &map) -{ - map(0x0000, 0x1fbf).ram().share("nvram"); - - map(0x1fc0, 0x1fc0).w(m_display, FUNC(mephisto_display_module2_device::latch_w)); - map(0x1fd0, 0x1fd0).w(FUNC(mephisto_milano_state::milano_led_w)); - map(0x1fe0, 0x1fe0).r(FUNC(mephisto_milano_state::milano_input_r)); - map(0x1fe8, 0x1fef).w("outlatch", FUNC(hc259_device::write_d7)); - map(0x1fd8, 0x1fdf).r(FUNC(mephisto_milano_state::polgar_keys_r)); - map(0x1ff0, 0x1ff0).w(FUNC(mephisto_milano_state::milano_io_w)); - map(0x2000, 0xffff).rom(); -} +/****************************************************************************** + Input Ports +******************************************************************************/ static INPUT_PORTS_START( polgar ) PORT_START("KEY") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Trn") PORT_CODE(KEYCODE_T) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Info") PORT_CODE(KEYCODE_I) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Mem") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Pos") PORT_CODE(KEYCODE_O) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("FCT") PORT_CODE(KEYCODE_F) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // " + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL / New Game") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // " INPUT_PORTS_END -void mephisto_risc_state::machine_start() -{ - m_rombank->configure_entries(0, 4, memregion("maincpu")->base(), 0x8000); - save_item(NAME(m_bank)); -} -void mephisto_milano_state::machine_start() -{ - m_leds.resolve(); - save_item(NAME(m_led_latch)); -} -void mephisto_milano_state::machine_reset() -{ - m_led_latch = 0; -} +/****************************************************************************** + Machine Configs +******************************************************************************/ void mephisto_polgar_state::polgar(machine_config &config) { - M65C02(config, m_maincpu, XTAL(4'915'200)); // RP65C02G + R65C02(config, m_maincpu, 4.9152_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_polgar_state::polgar_mem); - m_maincpu->set_periodic_int(FUNC(mephisto_polgar_state::nmi_line_pulse), attotime::from_hz(XTAL(4'915'200) / (1 << 13))); + m_maincpu->set_periodic_int(FUNC(mephisto_polgar_state::nmi_line_pulse), attotime::from_hz(4.9152_MHz_XTAL / (1 << 13))); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -243,45 +128,17 @@ void mephisto_polgar_state::polgar(machine_config &config) void mephisto_polgar_state::polgar10(machine_config &config) { polgar(config); - m_maincpu->set_clock(9.8304_MHz_XTAL); // W65C02P-8 - m_maincpu->set_periodic_int(FUNC(mephisto_polgar_state::nmi_line_pulse), attotime::from_hz(9.8304_MHz_XTAL / (1 << 13))); -} - -void mephisto_risc_state::mrisc(machine_config &config) -{ - M65SC02(config, m_maincpu, XTAL(10'000'000) / 4); // G65SC02P-4 - m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_risc_state::mrisc_mem); - m_maincpu->set_periodic_int(FUNC(mephisto_risc_state::irq0_line_hold), attotime::from_hz(XTAL(10'000'000) / (1 << 14))); - - CHESSMACHINE(config, m_chessm, 14'000'000); // Tasc ChessMachine EC PCB, Mephisto manual says 14MHz (no XTAL) - config.set_perfect_quantum(m_maincpu); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - hc259_device &outlatch(HC259(config, "outlatch")); - outlatch.q_out_cb<0>().set_output("led100"); - outlatch.q_out_cb<1>().set_output("led101"); - outlatch.q_out_cb<2>().set_output("led102"); - outlatch.q_out_cb<3>().set_output("led103"); - outlatch.q_out_cb<4>().set_output("led104"); - outlatch.q_out_cb<5>().set_output("led105"); - outlatch.parallel_out_cb().set_membank("rombank").rshift(6).mask(0x03).exor(0x01); - - MEPHISTO_SENSORS_BOARD(config, "board"); - MEPHISTO_DISPLAY_MODULE2(config, "display"); - config.set_default_layout(layout_mephisto_polgar); + M65C02(config.replace(), m_maincpu, 9.8304_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_polgar_state::polgar_mem); + m_maincpu->set_periodic_int(FUNC(mephisto_polgar_state::nmi_line_pulse), attotime::from_hz(9.8304_MHz_XTAL / (1 << 13))); } -void mephisto_milano_state::milano(machine_config &config) -{ - polgar(config); // CPU: W65C02P-8, 4.9152MHz - m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_milano_state::milano_mem); - MEPHISTO_BUTTONS_BOARD(config.replace(), m_board); - m_board->set_disable_leds(true); - config.set_default_layout(layout_mephisto_milano); -} +/****************************************************************************** + ROM Definitions +******************************************************************************/ ROM_START( polgar ) ROM_REGION( 0x10000, "maincpu", 0 ) @@ -303,50 +160,16 @@ ROM_START( polgar101 ) ROM_LOAD("polg_101.bin", 0x00000, 0x10000, CRC(8fb6afa4) SHA1(d1cf868302a665ff351686b26a149ced0045fc81) ) ROM_END -ROM_START( mrisc ) - ROM_REGION( 0x20000, "maincpu", 0 ) - // contains ChessMachine engine at 0x0-0x03fff + 0x10000-0x1c74f, concatenate those sections and make a .bin file, - // then it will work on ChessMachine software. It identifies as R E B E L ver. HG-021 03-04-92 - ROM_LOAD("meph-risci-v1-2.bin", 0x00000, 0x20000, CRC(19c6ab83) SHA1(0baab84e5aa6999c24250938d207145144945fd5) ) -ROM_END +} // anonymous namespace -ROM_START( mrisc2 ) - ROM_REGION( 0x20000, "maincpu", 0 ) - // contains ChessMachine engine at 0x0-0x03fff + 0x10000-0x1cb7f, concatenate those sections and make a .bin file, - // then it will work on ChessMachine software. It identifies as R E B E L ver. 2.31 22-07-93, world champion Madrid 1992 - ROM_LOAD("risc_2.31", 0x00000, 0x20000, CRC(9ecf9cd3) SHA1(7bfc628183037a172242c9589f15aca218d8fb12) ) -ROM_END - -ROM_START( milano ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("milano102.bin", 0x0000, 0x10000, CRC(0e9c8fe1) SHA1(e9176f42d86fe57e382185c703c7eff7e63ca711) ) -ROM_END - -ROM_START( milanoa ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("milano101.bin", 0x0000, 0x10000, CRC(22efc0be) SHA1(921607d6dacf72c0686b8970261c43e2e244dc9f) ) -ROM_END - -ROM_START( nshort ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("nshort.bin", 0x00000, 0x10000, CRC(4bd51e23) SHA1(3f55cc1c55dae8818b7e9384b6b8d43dc4f0a1af) ) -ROM_END /*************************************************************************** - Game driver(s) + Game Drivers ***************************************************************************/ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ CONS( 1990, polgar, 0, 0, polgar, polgar, mephisto_polgar_state, empty_init, "Hegener + Glaser", "Mephisto Polgar (v1.50)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1989, polgara, polgar, 0, polgar, polgar, mephisto_polgar_state, empty_init, "Hegener + Glaser", "Mephisto Polgar (v1.10)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1990, polgar10, polgar, 0, polgar10, polgar, mephisto_polgar_state, empty_init, "Hegener + Glaser", "Mephisto Polgar 10 MHz (v10.0)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1990, polgar101, polgar, 0, polgar10, polgar, mephisto_polgar_state, empty_init, "Hegener + Glaser", "Mephisto Polgar 10 MHz (v10.1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) - -CONS( 1992, mrisc, 0, 0, mrisc, polgar, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto Risc 1MB", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1994, mrisc2, mrisc, 0, mrisc, polgar, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto Risc II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) - -// not modular boards -CONS( 1991, milano, 0, 0, milano, polgar, mephisto_milano_state, empty_init, "Hegener + Glaser", "Mephisto Milano (v1.02)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1991, milanoa, milano, 0, milano, polgar, mephisto_milano_state, empty_init, "Hegener + Glaser", "Mephisto Milano (v1.01)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1993, nshort, milano, 0, milano, polgar, mephisto_milano_state, empty_init, "Hegener + Glaser", "Mephisto Nigel Short", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/mephisto_risc.cpp b/src/mame/drivers/mephisto_risc.cpp new file mode 100644 index 00000000000..edf8cd9b0b8 --- /dev/null +++ b/src/mame/drivers/mephisto_risc.cpp @@ -0,0 +1,197 @@ +// license:BSD-3-Clause +// copyright-holders:Sandro Ronco, hap +/****************************************************************************** + +Mephisto Risc 1MB/II (stylized "risc") + +The chess engine in Mephisto Risc is also compatible with Tasc's The ChessMachine, +see ROM defs for details. + +Hardware notes: +- G65SC02P-4 @ 2.5MHz +- 128KB ROM +- Tasc ChessMachine EC PCB +- Mephisto modular display module +- Mephisto Exclusive/Muenchen chessboard + +******************************************************************************/ + +#include "emu.h" + +#include "cpu/m6502/m65sc02.h" +#include "machine/74259.h" +#include "machine/nvram.h" +#include "machine/mmboard.h" +#include "machine/chessmachine.h" +#include "video/mmdisplay2.h" + +// internal artwork +#include "mephisto_risc.lh" + + +namespace { + +class mephisto_risc_state : public driver_device +{ +public: + mephisto_risc_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_chessm(*this, "chessm") + , m_rombank(*this, "rombank") + , m_keys(*this, "KEY") + { } + + void mrisc(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_maincpu; + required_device m_chessm; + required_memory_bank m_rombank; + required_ioport m_keys; + + void mrisc_mem(address_map &map); + + u8 keys_r(offs_t offset); + u8 chessm_r(); + void chessm_w(u8 data); +}; + +void mephisto_risc_state::machine_start() +{ + m_rombank->configure_entries(0, 4, memregion("maincpu")->base(), 0x8000); +} + + + +/****************************************************************************** + I/O +******************************************************************************/ + +u8 mephisto_risc_state::keys_r(offs_t offset) +{ + return (BIT(m_keys->read(), offset) << 7) | 0x7f; +} + +u8 mephisto_risc_state::chessm_r() +{ + // d0: chessmachine data + return m_chessm->data_r(); +} + +void mephisto_risc_state::chessm_w(u8 data) +{ + // d0,d7: chessmachine data + m_chessm->data0_w(BIT(data, 0)); + m_chessm->data1_w(BIT(data, 7)); + + // d1: chessmachine reset + m_chessm->reset_w(BIT(data, 1)); +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void mephisto_risc_state::mrisc_mem(address_map &map) +{ + map.unmap_value_high(); + map(0x0000, 0x1fff).ram().share("nvram"); + map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w)); + map(0x2c00, 0x2c07).r(FUNC(mephisto_risc_state::keys_r)); + map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w)); + map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w)); + map(0x3000, 0x3000).r("board", FUNC(mephisto_board_device::input_r)); + map(0x3400, 0x3407).w("outlatch", FUNC(hc259_device::write_d7)).nopr(); + map(0x3800, 0x3800).w(FUNC(mephisto_risc_state::chessm_w)); + map(0x3c00, 0x3c00).r(FUNC(mephisto_risc_state::chessm_r)); + map(0x4000, 0x7fff).rom(); + map(0x8000, 0xffff).bankr("rombank"); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( mrisc ) + PORT_START("KEY") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL / New Game") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // " +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void mephisto_risc_state::mrisc(machine_config &config) +{ + M65SC02(config, m_maincpu, 10_MHz_XTAL / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_risc_state::mrisc_mem); + m_maincpu->set_periodic_int(FUNC(mephisto_risc_state::irq0_line_hold), attotime::from_hz(10_MHz_XTAL / (1 << 14))); + + CHESSMACHINE(config, m_chessm, 14'000'000); // Mephisto manual says 14MHz (no XTAL) + config.set_perfect_quantum(m_maincpu); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + hc259_device &outlatch(HC259(config, "outlatch")); + outlatch.q_out_cb<0>().set_output("led100"); + outlatch.q_out_cb<1>().set_output("led101"); + outlatch.q_out_cb<2>().set_output("led102"); + outlatch.q_out_cb<3>().set_output("led103"); + outlatch.q_out_cb<4>().set_output("led104"); + outlatch.q_out_cb<5>().set_output("led105"); + outlatch.parallel_out_cb().set_membank("rombank").rshift(6).mask(0x03).exor(0x01); + + MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_DISPLAY_MODULE2(config, "display"); + config.set_default_layout(layout_mephisto_risc); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( mrisc ) + ROM_REGION( 0x20000, "maincpu", 0 ) + // contains ChessMachine engine at 0x0-0x03fff + 0x10000-0x1c74f, concatenate those sections and make a .bin file, + // then it will work on ChessMachine software. It identifies as R E B E L ver. HG-021 03-04-92 + ROM_LOAD("meph-risci-v1-2.bin", 0x00000, 0x20000, CRC(19c6ab83) SHA1(0baab84e5aa6999c24250938d207145144945fd5) ) +ROM_END + +ROM_START( mrisc2 ) + ROM_REGION( 0x20000, "maincpu", 0 ) + // contains ChessMachine engine at 0x0-0x03fff + 0x10000-0x1cb7f, concatenate those sections and make a .bin file, + // then it will work on ChessMachine software. It identifies as R E B E L ver. 2.31 22-07-93, world champion Madrid 1992 + ROM_LOAD("risc_2.31", 0x00000, 0x20000, CRC(9ecf9cd3) SHA1(7bfc628183037a172242c9589f15aca218d8fb12) ) +ROM_END + +} // anonymous namespace + + + +/*************************************************************************** + Game Drivers +***************************************************************************/ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +CONS( 1992, mrisc, 0, 0, mrisc, mrisc, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto Risc 1MB", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1994, mrisc2, mrisc, 0, mrisc, mrisc, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto Risc II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/layout/mephisto_academy.lay b/src/mame/layout/mephisto_academy.lay index 78ed936902e..57642fb5415 100644 --- a/src/mame/layout/mephisto_academy.lay +++ b/src/mame/layout/mephisto_academy.lay @@ -468,9 +468,9 @@ license:CC0 - + - + diff --git a/src/mame/layout/mephisto_alm16.lay b/src/mame/layout/mephisto_alm16.lay index 20003686635..255e64639e8 100644 --- a/src/mame/layout/mephisto_alm16.lay +++ b/src/mame/layout/mephisto_alm16.lay @@ -460,7 +460,7 @@ license:CC0 - + diff --git a/src/mame/layout/mephisto_alm32.lay b/src/mame/layout/mephisto_alm32.lay index 7103be17efd..b690df7f65b 100644 --- a/src/mame/layout/mephisto_alm32.lay +++ b/src/mame/layout/mephisto_alm32.lay @@ -460,7 +460,7 @@ license:CC0 - + diff --git a/src/mame/layout/mephisto_berlin.lay b/src/mame/layout/mephisto_berlin.lay index 7a307236e2c..1ea3103a18f 100644 --- a/src/mame/layout/mephisto_berlin.lay +++ b/src/mame/layout/mephisto_berlin.lay @@ -25,22 +25,22 @@ license:CC0 - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -390,30 +390,31 @@ license:CC0 - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + diff --git a/src/mame/layout/mephisto_gen32.lay b/src/mame/layout/mephisto_gen32.lay index 0168943ab1d..d3255899625 100644 --- a/src/mame/layout/mephisto_gen32.lay +++ b/src/mame/layout/mephisto_gen32.lay @@ -460,7 +460,7 @@ license:CC0 - + diff --git a/src/mame/layout/mephisto_milano.lay b/src/mame/layout/mephisto_milano.lay index 9bca5ac65f5..829a6204f2d 100644 --- a/src/mame/layout/mephisto_milano.lay +++ b/src/mame/layout/mephisto_milano.lay @@ -430,22 +430,23 @@ license:CC0 - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_polgar.lay b/src/mame/layout/mephisto_polgar.lay index 881f863ef3e..5a953ab4d17 100644 --- a/src/mame/layout/mephisto_polgar.lay +++ b/src/mame/layout/mephisto_polgar.lay @@ -2,8 +2,13 @@ + + + + + @@ -39,15 +44,15 @@ license:CC0 - - - - - - - - - + + + + + + + + + @@ -386,7 +391,7 @@ license:CC0 - + @@ -404,6 +409,10 @@ license:CC0 + + + + diff --git a/src/mame/layout/mephisto_risc.lay b/src/mame/layout/mephisto_risc.lay new file mode 100644 index 00000000000..5a953ab4d17 --- /dev/null +++ b/src/mame/layout/mephisto_risc.lay @@ -0,0 +1,461 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index b33d93fd154..800731bb359 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -22720,6 +22720,11 @@ roma16 // Roma roma16a // Roma roma32 // Roma +@source:mephisto_milano.cpp +milano // 1991 Mephisto Milano +milanoa // 1991 Mephisto Milano +nshort // 1993 Mephisto Nigel Short + @source:mephisto_mm1.cpp mm1 mm1b @@ -22798,11 +22803,10 @@ polgar // 1990 Mephisto Polgar polgara // 1989 Mephisto Polgar polgar10 // 1990 Mephisto Polgar 10MHz polgar101 // 1990 Mephisto Polgar 10MHz + +@source:mephisto_risc.cpp mrisc // 1992 Mephisto RISC 1MB mrisc2 // 1994 Mephisto RISC II -milano // 1991 Mephisto Milano -milanoa // 1991 Mephisto Milano -nshort // 1993 Mephisto Nigel Short @source:mephistp.cpp mephistp // diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 16258f4f1f1..63bb88b8229 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -578,6 +578,7 @@ mephisto_academy.cpp mephisto_berlin.cpp mephisto_brikett.cpp mephisto_glasgow.cpp +mephisto_milano.cpp mephisto_mm1.cpp mephisto_mm2.cpp mephisto_modena.cpp @@ -587,6 +588,7 @@ mephisto_mondial.cpp mephisto_mondial68k.cpp mephisto_montec.cpp mephisto_polgar.cpp +mephisto_risc.cpp meritum.cpp mes.cpp mfabfz.cpp diff --git a/src/mame/video/mmdisplay2.h b/src/mame/video/mmdisplay2.h index 95835363239..03f16ea2e07 100644 --- a/src/mame/video/mmdisplay2.h +++ b/src/mame/video/mmdisplay2.h @@ -31,6 +31,7 @@ public: void latch_w(uint8_t data); void io_w(uint8_t data); + u8 io_r() { return m_ctrl; } protected: // device-level overrides -- cgit v1.2.3