summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/chessmst.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/chessmst.cpp')
-rw-r--r--src/mame/drivers/chessmst.cpp152
1 files changed, 62 insertions, 90 deletions
diff --git a/src/mame/drivers/chessmst.cpp b/src/mame/drivers/chessmst.cpp
index d8d7e3d01fc..2cea7fe0f12 100644
--- a/src/mame/drivers/chessmst.cpp
+++ b/src/mame/drivers/chessmst.cpp
@@ -7,14 +7,15 @@ Chess-Master (G-5003-501) (2 roms set)
Chess-Master Diamond (G-5004-500)
TODO:
-- figure out why chessmsta won't work, u2616 is probably a bad dump or misplaced
+- redump chessmsta u2616
- use pwm_display for the leds
-****************************************************************************/
-
+***************************************************************************/
#include "emu.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
#include "cpu/z80/z80.h"
#include "machine/clock.h"
#include "machine/z80pio.h"
@@ -22,15 +23,15 @@ TODO:
#include "sound/beep.h"
#include "sound/spkrdev.h"
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
-
#include "speaker.h"
+// internal artwork
#include "chessmst.lh"
#include "chessmstdm.lh"
+namespace {
+
class chessmst_state : public driver_device
{
public:
@@ -58,24 +59,8 @@ public:
protected:
virtual void machine_start() override;
- virtual void machine_reset() override;
-
- void digits_w(uint8_t data);
- void pio1_port_a_w(uint8_t data);
- void pio1_port_b_w(uint8_t data);
- void pio1_port_b_dm_w(uint8_t data);
- uint8_t pio2_port_a_r();
- void pio2_port_b_w(uint8_t data);
- DECLARE_WRITE_LINE_MEMBER( timer_555_w );
-
- void chessmst_io(address_map &map);
- void chessmst_mem(address_map &map);
- void chessmstdm_mem(address_map &map);
- void chessmstdm_io(address_map &map);
private:
- void update_display();
-
required_device<z80_device> m_maincpu;
required_device_array<z80pio_device, 2> m_pio;
optional_device<speaker_sound_device> m_speaker;
@@ -88,6 +73,21 @@ private:
output_finder<> m_monitor_led;
output_finder<> m_playmode_led;
+ void chessmst_io(address_map &map);
+ void chessmst_mem(address_map &map);
+ void chessmstdm_mem(address_map &map);
+ void chessmstdm_io(address_map &map);
+
+ void digits_w(uint8_t data);
+ void pio1_port_a_w(uint8_t data);
+ void pio1_port_b_w(uint8_t data);
+ void pio1_port_b_dm_w(uint8_t data);
+ uint8_t pio2_port_a_r();
+ void pio2_port_b_w(uint8_t data);
+ DECLARE_WRITE_LINE_MEMBER(timer_555_w);
+
+ void update_display();
+
uint16_t m_matrix = 0;
uint16_t m_led_sel = 0;
uint8_t m_digit_matrix = 0;
@@ -109,12 +109,8 @@ void chessmst_state::machine_start()
save_item(NAME(m_digit));
}
-void chessmst_state::machine_reset()
-{
-}
-
-/* Address Maps */
+// Address Maps
void chessmst_state::chessmst_mem(address_map &map)
{
@@ -147,14 +143,14 @@ void chessmst_state::chessmstdm_io(address_map &map)
map(0x4c, 0x4c).w(FUNC(chessmst_state::digits_w));
}
-WRITE_LINE_MEMBER( chessmst_state::timer_555_w )
+WRITE_LINE_MEMBER(chessmst_state::timer_555_w)
{
m_pio[1]->strobe_b(state);
m_pio[1]->data_b_write(m_matrix);
}
-/* Input ports */
+// Input ports
INPUT_CHANGED_MEMBER(chessmst_state::reset_button)
{
@@ -205,7 +201,7 @@ static INPUT_PORTS_START( chessmstdm )
INPUT_PORTS_END
-/* I/O */
+// I/O
void chessmst_state::update_display()
{
@@ -290,7 +286,7 @@ void chessmst_state::pio2_port_b_w(uint8_t data)
}
-/* Machine Configuration */
+// Machine Configuration
static const z80_daisy_config chessmst_daisy_chain[] =
{
@@ -306,7 +302,7 @@ static const z80_daisy_config chessmstdm_daisy_chain[] =
void chessmst_state::chessmst(machine_config &config)
{
- /* basic machine hardware */
+ // basic machine hardware
Z80(config, m_maincpu, 9.8304_MHz_XTAL/4); // UB880 Z80 clone
m_maincpu->set_addrmap(AS_PROGRAM, &chessmst_state::chessmst_mem);
m_maincpu->set_addrmap(AS_IO, &chessmst_state::chessmst_io);
@@ -321,104 +317,78 @@ void chessmst_state::chessmst(machine_config &config)
m_pio[1]->in_pa_callback().set(FUNC(chessmst_state::pio2_port_a_r));
m_pio[1]->out_pb_callback().set(FUNC(chessmst_state::pio2_port_b_w));
- 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 */
+ config.set_default_layout(layout_chessmst);
+
+ // sound hardware
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
}
void chessmst_state::chessmsta(machine_config &config)
{
- /* basic machine hardware */
- Z80(config, m_maincpu, 8_MHz_XTAL/2); // UA880 Z80 clone
- m_maincpu->set_addrmap(AS_PROGRAM, &chessmst_state::chessmst_mem);
- m_maincpu->set_addrmap(AS_IO, &chessmst_state::chessmst_io);
- m_maincpu->set_daisy_config(chessmst_daisy_chain);
-
- Z80PIO(config, m_pio[0], 8_MHz_XTAL/2);
- m_pio[0]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- m_pio[0]->out_pa_callback().set(FUNC(chessmst_state::pio1_port_a_w));
- m_pio[0]->out_pb_callback().set(FUNC(chessmst_state::pio1_port_b_w));
-
- Z80PIO(config, m_pio[1], 8_MHz_XTAL/2);
- m_pio[1]->in_pa_callback().set(FUNC(chessmst_state::pio2_port_a_r));
- m_pio[1]->out_pb_callback().set(FUNC(chessmst_state::pio2_port_b_w));
-
- 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));
+ chessmst(config);
- /* sound hardware */
- SPEAKER(config, "mono").front_center();
- SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+ // faster UA880 CPU
+ const XTAL clk = 8_MHz_XTAL / 2;
+ m_maincpu->set_clock(clk);
+ m_pio[0]->set_clock(clk);
+ m_pio[1]->set_clock(clk);
}
void chessmst_state::chessmstdm(machine_config &config)
{
- /* basic machine hardware */
- Z80(config, m_maincpu, 8_MHz_XTAL/2); // UA880 Z80 clone
+ chessmsta(config);
+
+ // basic machine hardware
m_maincpu->set_addrmap(AS_PROGRAM, &chessmst_state::chessmstdm_mem);
m_maincpu->set_addrmap(AS_IO, &chessmst_state::chessmstdm_io);
m_maincpu->set_daisy_config(chessmstdm_daisy_chain);
- Z80PIO(config, m_pio[0], 8_MHz_XTAL/2);
- m_pio[0]->out_pa_callback().set(FUNC(chessmst_state::pio1_port_a_w));
+ CLOCK(config, "555_timer", 500).signal_handler().set(FUNC(chessmst_state::timer_555_w));
+
m_pio[0]->out_pb_callback().set(FUNC(chessmst_state::pio1_port_b_dm_w));
m_pio[0]->in_pb_callback().set_ioport("EXTRA");
- Z80PIO(config, m_pio[1], 8_MHz_XTAL/2);
+ m_pio[0]->out_int_callback().set_nop();
m_pio[1]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
- m_pio[1]->in_pa_callback().set(FUNC(chessmst_state::pio2_port_a_r));
- m_pio[1]->out_pb_callback().set(FUNC(chessmst_state::pio2_port_b_w));
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));
-
- /* sound hardware */
- SPEAKER(config, "mono").front_center();
+ // sound hardware
+ config.device_remove("speaker");
BEEP(config, m_beeper, 1000).add_route(ALL_OUTPUTS, "mono", 0.25);
+ // cartridge
GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "chessmstdm_cart");
SOFTWARE_LIST(config, "cart_list").set_original("chessmstdm");
}
-/* ROM definition */
+// ROM definition
ROM_START( chessmst )
ROM_REGION( 0x2800, "maincpu", ROMREGION_ERASEFF )
- ROM_LOAD("056.bin", 0x0000, 0x0400, CRC(2b90e5d3) SHA1(c47445964b2e6cb11bd1f27e395cf980c97af196) )
- ROM_LOAD("057.bin", 0x0400, 0x0400, CRC(e666fc56) SHA1(3fa75b82cead81973bea94191a5c35f0acaaa0e6) )
- ROM_LOAD("058.bin", 0x0800, 0x0400, CRC(6a17fbec) SHA1(019051e93a5114477c50eaa87e1ff01b02eb404d) )
- ROM_LOAD("059.bin", 0x0c00, 0x0400, CRC(e96e3d07) SHA1(20fab75f206f842231f0414ebc473ce2a7371e7f) )
- ROM_LOAD("060.bin", 0x1000, 0x0400, CRC(0e31f000) SHA1(daac924b79957a71a4b276bf2cef44badcbe37d3) )
- ROM_LOAD("061.bin", 0x1400, 0x0400, CRC(69ad896d) SHA1(25d999b59d4cc74bd339032c26889af00e64df60) )
- ROM_LOAD("062.bin", 0x1800, 0x0400, CRC(c42925fe) SHA1(c42d8d7c30a9b6d91ac994cec0cc2723f41324e9) )
- ROM_LOAD("063.bin", 0x1c00, 0x0400, CRC(86be4cdb) SHA1(741f984c15c6841e227a8722ba30cf9e6b86d878) )
- ROM_LOAD("064.bin", 0x2000, 0x0400, CRC(e82f5480) SHA1(38a939158052f5e6484ee3725b86e522541fe4aa) )
- ROM_LOAD("065.bin", 0x2400, 0x0400, CRC(4ec0e92c) SHA1(0b748231a50777391b04c1778750fbb46c21bee8) )
+ ROM_LOAD("056.bin", 0x0000, 0x0400, CRC(2b90e5d3) SHA1(c47445964b2e6cb11bd1f27e395cf980c97af196) ) // U505
+ ROM_LOAD("057.bin", 0x0400, 0x0400, CRC(e666fc56) SHA1(3fa75b82cead81973bea94191a5c35f0acaaa0e6) ) // "
+ ROM_LOAD("058.bin", 0x0800, 0x0400, CRC(6a17fbec) SHA1(019051e93a5114477c50eaa87e1ff01b02eb404d) ) // "
+ ROM_LOAD("059.bin", 0x0c00, 0x0400, CRC(e96e3d07) SHA1(20fab75f206f842231f0414ebc473ce2a7371e7f) ) // "
+ ROM_LOAD("060.bin", 0x1000, 0x0400, CRC(0e31f000) SHA1(daac924b79957a71a4b276bf2cef44badcbe37d3) ) // "
+ ROM_LOAD("061.bin", 0x1400, 0x0400, CRC(69ad896d) SHA1(25d999b59d4cc74bd339032c26889af00e64df60) ) // "
+ ROM_LOAD("062.bin", 0x1800, 0x0400, CRC(c42925fe) SHA1(c42d8d7c30a9b6d91ac994cec0cc2723f41324e9) ) // "
+ ROM_LOAD("063.bin", 0x1c00, 0x0400, CRC(86be4cdb) SHA1(741f984c15c6841e227a8722ba30cf9e6b86d878) ) // "
+ ROM_LOAD("064.bin", 0x2000, 0x0400, CRC(e82f5480) SHA1(38a939158052f5e6484ee3725b86e522541fe4aa) ) // "
+ ROM_LOAD("065.bin", 0x2400, 0x0400, CRC(4ec0e92c) SHA1(0b748231a50777391b04c1778750fbb46c21bee8) ) // "
ROM_END
ROM_START( chessmsta )
ROM_REGION( 0x2800, "maincpu", ROMREGION_ERASEFF )
- ROM_LOAD("2764.bin", 0x0000, 0x2000, CRC(6be28876) SHA1(fd7d77b471e7792aef3b2b3f7ff1de4cdafc94c9) )
- ROM_LOAD("u2616bm108.bin", 0x2000, 0x0800, BAD_DUMP CRC(6e69ace3) SHA1(e099b6b6cc505092f64b8d51ab9c70aa64f58f70) )
+ ROM_LOAD("bm001.d204", 0x0000, 0x2000, CRC(6be28876) SHA1(fd7d77b471e7792aef3b2b3f7ff1de4cdafc94c9) ) // U2364D45
+ ROM_LOAD("bm108.d205", 0x2000, 0x0800, CRC(6e69ace3) SHA1(e099b6b6cc505092f64b8d51ab9c70aa64f58f70) BAD_DUMP ) // U2616D45 - problem with d3
ROM_END
ROM_START( chessmstdm )
@@ -427,8 +397,10 @@ ROM_START( chessmstdm )
ROM_LOAD("201", 0x2000, 0x2000, CRC(c9dc7f29) SHA1(a3e1b66d0e15ffe83a9165d15c4a83013852c2fe) ) // "
ROM_END
+} // anonymous namespace
+
-/* Driver */
+// 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 \"Karl Marx\" Erfurt", "Chess-Master (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )