From 173962bf18acf20ada60d1b592bf798be28a32a5 Mon Sep 17 00:00:00 2001 From: Sandro Ronco Date: Sat, 6 Jul 2019 22:13:19 +0200 Subject: Add chesspieces to risc2500.cpp and chessmst.cpp (nw) --- src/mame/drivers/chessmst.cpp | 131 ++---- src/mame/drivers/risc2500.cpp | 79 +--- src/mame/layout/chessmst.lay | 952 ++++++++++++++++++----------------------- src/mame/layout/chessmstdm.lay | 859 ++++++++++++++++--------------------- src/mame/layout/risc2500.lay | 852 ++++++++++++++++++------------------ 5 files changed, 1210 insertions(+), 1663 deletions(-) diff --git a/src/mame/drivers/chessmst.cpp b/src/mame/drivers/chessmst.cpp index 0e29d45d49f..68080cec60b 100644 --- a/src/mame/drivers/chessmst.cpp +++ b/src/mame/drivers/chessmst.cpp @@ -15,6 +15,7 @@ #include "cpu/z80/z80.h" #include "machine/clock.h" #include "machine/z80pio.h" +#include "machine/sensorboard.h" #include "sound/beep.h" #include "sound/spkrdev.h" @@ -36,13 +37,13 @@ public: m_pio(*this, "z80pio%u", 0), m_speaker(*this, "speaker"), m_beeper(*this, "beeper"), + m_board(*this, "board"), m_extra(*this, "EXTRA"), m_buttons(*this, "BUTTONS"), m_digits(*this, "digit%u", 0U), m_leds(*this, "led_%c%u", unsigned('a'), 1U) { } - DECLARE_INPUT_CHANGED_MEMBER(chessmst_sensor); DECLARE_INPUT_CHANGED_MEMBER(reset_button); DECLARE_INPUT_CHANGED_MEMBER(view_monitor_button); @@ -74,6 +75,7 @@ private: required_device_array m_pio; optional_device m_speaker; optional_device m_beeper; + required_device m_board; required_ioport m_extra; required_ioport m_buttons; output_finder<4> m_digits; @@ -81,7 +83,6 @@ private: uint16_t m_matrix; uint16_t m_led_sel; - uint8_t m_sensor[64]; uint8_t m_digit_matrix; int m_digit_dot; uint16_t m_digit; @@ -141,91 +142,8 @@ INPUT_CHANGED_MEMBER(chessmst_state::view_monitor_button) } } -INPUT_CHANGED_MEMBER(chessmst_state::chessmst_sensor) -{ - uint8_t pos = (uint8_t)(uintptr_t)param; - - if (newval) - { - m_sensor[pos] = !m_sensor[pos]; - } -} - /* Input ports */ static INPUT_PORTS_START( chessmst ) - PORT_START("COL_A") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 0) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 1) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 2) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 3) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 4) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 5) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 6) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 7) - PORT_START("COL_B") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 8) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 9) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 10) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 11) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 12) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 13) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 14) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 15) - PORT_START("COL_C") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 16) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 17) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 18) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 19) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 20) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 21) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 22) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 23) - PORT_START("COL_D") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 24) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 25) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 26) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 27) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 28) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 29) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 30) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 31) - PORT_START("COL_E") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 32) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 33) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 34) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 35) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 36) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 37) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 38) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 39) - PORT_START("COL_F") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 40) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 41) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 42) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 43) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 44) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 45) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 46) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 47) - PORT_START("COL_G") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 48) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 49) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 50) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 51) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 52) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 53) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 54) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 55) - PORT_START("COL_H") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 56) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 57) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 58) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 59) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 60) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 61) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 62) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, chessmst_sensor, 63) - PORT_START("BUTTONS") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Hint [7]") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_H) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Random [6]") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_R) @@ -242,9 +160,7 @@ static INPUT_PORTS_START( chessmst ) INPUT_PORTS_END static INPUT_PORTS_START( chessmstdm ) - PORT_INCLUDE(chessmst) - - PORT_MODIFY("BUTTONS") + PORT_START("BUTTONS") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Move Fore") PORT_CODE(KEYCODE_RIGHT) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Move Back") PORT_CODE(KEYCODE_LEFT) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Board") PORT_CODE(KEYCODE_B) @@ -254,7 +170,7 @@ static INPUT_PORTS_START( chessmstdm ) PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Function / Notation") PORT_CODE(KEYCODE_F) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) - PORT_MODIFY("EXTRA") + PORT_START("EXTRA") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Monitor") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, view_monitor_button, 0) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("View") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, view_monitor_button, 0) INPUT_PORTS_END @@ -267,7 +183,6 @@ void chessmst_state::machine_start() save_item(NAME(m_matrix)); save_item(NAME(m_led_sel)); - save_item(NAME(m_sensor)); save_item(NAME(m_digit_matrix)); save_item(NAME(m_digit_dot)); save_item(NAME(m_digit)); @@ -275,12 +190,6 @@ void chessmst_state::machine_start() void chessmst_state::machine_reset() { - //reset all sensors - memset(m_sensor, 1, sizeof(m_sensor)); - - //positioning the pieces for start next game - for (int i=0; i<64; i+=8) - m_sensor[i+0] = m_sensor[i+1] = m_sensor[i+6] = m_sensor[i+7] = 0; } void chessmst_state::update_display() @@ -348,11 +257,10 @@ READ8_MEMBER( chessmst_state::pio2_port_a_r ) // The pieces position on the chessboard is identified by 64 Hall // sensors, which are in a 8x8 matrix with the corresponding LEDs. for (int i=0; i<8; i++) - for (int j=0; j<8; j++) - { - if (m_matrix & (1 << j)) - data |= (m_sensor[j * 8 + i] ? (1 << i) : 0); - } + { + if (m_matrix & (1 << i)) + data |= ~m_board->read_file(i); + } if (m_matrix & 0x100) data |= m_buttons->read(); @@ -397,6 +305,11 @@ void chessmst_state::chessmst(machine_config &config) config.set_default_layout(layout_chessmst); + SENSORBOARD(config, m_board); + 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(100)); + /* sound hardware */ SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); @@ -421,6 +334,11 @@ void chessmst_state::chessmsta(machine_config &config) config.set_default_layout(layout_chessmst); + SENSORBOARD(config, m_board); + 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(100)); + /* sound hardware */ SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); @@ -446,6 +364,11 @@ void chessmst_state::chessmstdm(machine_config &config) config.set_default_layout(layout_chessmstdm); + SENSORBOARD(config, m_board); + 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(100)); + clock_device &_555_timer(CLOCK(config, "555_timer", 500)); // from 555 timer _555_timer.signal_handler().set(FUNC(chessmst_state::timer_555_w)); @@ -488,6 +411,6 @@ ROM_END /* Driver */ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1984, chessmst, 0, 0, chessmst, chessmst, chessmst_state, empty_init, "VEB Mikroelektronik Erfurt", "Chess-Master (set 1)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) -COMP( 1984, chessmsta, chessmst, 0, chessmsta, chessmst, chessmst_state, empty_init, "VEB Mikroelektronik Erfurt", "Chess-Master (set 2)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) -COMP( 1987, chessmstdm, 0, 0, chessmstdm, chessmstdm, chessmst_state, empty_init, "VEB Mikroelektronik Erfurt", "Chess-Master Diamond", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) +COMP( 1984, chessmst, 0, 0, chessmst, chessmst, chessmst_state, empty_init, "VEB Mikroelektronik Erfurt", "Chess-Master (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +COMP( 1984, chessmsta, chessmst, 0, chessmsta, chessmst, chessmst_state, empty_init, "VEB Mikroelektronik Erfurt", "Chess-Master (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) +COMP( 1987, chessmstdm, 0, 0, chessmstdm, chessmstdm, chessmst_state, empty_init, "VEB Mikroelektronik Erfurt", "Chess-Master Diamond", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/risc2500.cpp b/src/mame/drivers/risc2500.cpp index 36803729ee5..bb22d416e34 100644 --- a/src/mame/drivers/risc2500.cpp +++ b/src/mame/drivers/risc2500.cpp @@ -7,6 +7,10 @@ Saitek RISC 2500, Mephisto Montreux The chess engine is also compatible with Tasc's The ChessMachine software. Was the hardware+software subcontracted to Tasc? It has similarities with Tasc R30. +notes: +- holding LEFT+RIGHT on boot load the QC TestMode +- holding UP+DOWN on boot load the TestMode + TODO: - bootrom disable timer shouldn't be needed, real ARM has already fetched the next opcode - Sound is too short and high pitched, better when you underclock the cpu. @@ -21,6 +25,7 @@ TODO: #include "cpu/arm/arm.h" #include "machine/ram.h" #include "machine/nvram.h" +#include "machine/sensorboard.h" #include "sound/dac.h" #include "sound/volt_reg.h" #include "emupal.h" @@ -39,6 +44,7 @@ public: , m_ram(*this, "ram") , m_nvram(*this, "nvram") , m_dac(*this, "dac") + , m_board(*this, "board") , m_inputs(*this, "P%u", 0) , m_digits(*this, "digit%u", 0U) , m_syms(*this, "sym%u", 0U) @@ -68,6 +74,7 @@ private: required_device m_ram; required_device m_nvram; required_device m_dac; + required_device m_board; required_ioport_array<8> m_inputs; output_finder<12> m_digits; output_finder<14> m_syms; @@ -129,98 +136,34 @@ INPUT_CHANGED_MEMBER(risc2500_state::on_button) static INPUT_PORTS_START( risc2500 ) PORT_START("P0") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H1 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G1 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F1 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E1 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D1 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C1 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B1 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A1 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Pawn") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("BACK") PORT_START("P1") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H2 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G2 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F2 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E2 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D2 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C2 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B2 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A2 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Knight") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_NAME("ENTER") PORT_START("P2") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H3 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G3 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F3 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E3 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D3 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C3 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B3 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A3 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Bishop") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("DOWN") PORT_START("P3") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H4 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G4 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F4 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E4 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D4 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C4 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B4 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A4 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Rook") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_UP) PORT_NAME("UP") PORT_START("P4") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H5 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G5 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F5 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E5 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D5 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C5 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B5 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A5 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Queen") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("MENU") PORT_START("P5") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H6 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G6 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F6 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E6 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D6 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C6 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B6 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A6 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("King") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("PLAY") PORT_START("P6") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H7 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G7 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F7 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E7 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D7 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C7 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B7 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A7 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("RIGHT") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("NEW GAME") PORT_START("P7") - PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // H8 - PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // G8 - PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // F8 - PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // E8 - PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // D8 - PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // C8 - PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // B8 - PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_IMPULSE(10) // A8 PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("LEFT") PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("OFF") @@ -236,7 +179,10 @@ READ32_MEMBER(risc2500_state::p1000_r) for(int i=0; i<8; i++) { if (m_p1000 & (1 << i)) + { data |= m_inputs[i]->read(); + data |= m_board->read_rank(i, true); + } } return data; @@ -339,6 +285,11 @@ void risc2500_state::risc2500(machine_config &config) PALETTE(config, "palette", palette_device::MONOCHROME); + SENSORBOARD(config, m_board); + m_board->set_type(sensorboard_device::BUTTONS); + m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); + m_board->set_delay(attotime::from_msec(100)); + RAM(config, m_ram).set_default_size("2M").set_extra_options("128K, 256K, 512K, 1M, 2M"); NVRAM(config, "nvram", nvram_device::DEFAULT_NONE); diff --git a/src/mame/layout/chessmst.lay b/src/mame/layout/chessmst.lay index 77c04215faa..3ddc2be5b5e 100644 --- a/src/mame/layout/chessmst.lay +++ b/src/mame/layout/chessmst.lay @@ -1,129 +1,6 @@ - @@ -133,16 +10,6 @@ - - - - - - - - - - @@ -154,9 +21,6 @@ - - - @@ -183,434 +47,428 @@ - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/chessmstdm.lay b/src/mame/layout/chessmstdm.lay index 1a8bb373c8a..94a12915ab2 100644 --- a/src/mame/layout/chessmstdm.lay +++ b/src/mame/layout/chessmstdm.lay @@ -1,130 +1,6 @@ - - @@ -143,16 +19,6 @@ - - - - - - - - - - @@ -164,9 +30,6 @@ - - - @@ -201,389 +64,383 @@ - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + diff --git a/src/mame/layout/risc2500.lay b/src/mame/layout/risc2500.lay index 20f515f873b..b2b095749f2 100644 --- a/src/mame/layout/risc2500.lay +++ b/src/mame/layout/risc2500.lay @@ -1,124 +1,6 @@ - - @@ -132,7 +14,7 @@ - + @@ -143,17 +25,6 @@ - - - - - - - - - - - @@ -181,341 +52,428 @@ - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3