From 0ba5d412a4efcc62cef5240271350bfdeef7b8af Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 21 Jul 2019 00:36:19 +0200 Subject: saitek_corona: move to own driver (nw) --- scripts/target/mame/mess.lua | 2 + src/mame/drivers/saitek_corona.cpp | 156 +++++++++ src/mame/drivers/saitek_stratos.cpp | 184 ++++------ src/mame/includes/saitek_stratos.h | 72 ++++ src/mame/layout/saitek_corona.lay | 661 ++++++++++++++++++++++++++++++++++++ src/mame/mame.lst | 6 +- src/mame/mess.flt | 1 + 7 files changed, 964 insertions(+), 118 deletions(-) create mode 100644 src/mame/drivers/saitek_corona.cpp create mode 100644 src/mame/includes/saitek_stratos.h create mode 100644 src/mame/layout/saitek_corona.lay diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 2a3049e20d1..9020ab3996c 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -3060,7 +3060,9 @@ files { MAME_DIR .. "src/mame/drivers/saitek_cp2000.cpp", MAME_DIR .. "src/mame/drivers/saitek_delta1.cpp", MAME_DIR .. "src/mame/drivers/saitek_risc2500.cpp", + MAME_DIR .. "src/mame/includes/saitek_stratos.h", MAME_DIR .. "src/mame/drivers/saitek_stratos.cpp", + MAME_DIR .. "src/mame/drivers/saitek_corona.cpp", -- subdriver of saitek_stratos } createMESSProjects(_target, _subtarget, "samcoupe") diff --git a/src/mame/drivers/saitek_corona.cpp b/src/mame/drivers/saitek_corona.cpp new file mode 100644 index 00000000000..32cc8f1a2fe --- /dev/null +++ b/src/mame/drivers/saitek_corona.cpp @@ -0,0 +1,156 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/*************************************************************************** + +Saitek Corona. This is a subclass of saitek_corona_state. +Please refer to saitek_stratos.cpp for driver notes. + +To be brief, Saitek Corona has two "HELIOS" chips, I/O addressing is completely +different compared to Stratos/Turbo King. + +***************************************************************************/ + +#include "emu.h" +#include "includes/saitek_stratos.h" + +#include "cpu/m6502/m65c02.h" +#include "machine/nvram.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "sound/volt_reg.h" + +#include "softlist.h" +#include "speaker.h" + +// internal artwork +#include "saitek_corona.lh" // clickable + + +class corona_state : public saitek_stratos_state +{ +public: + corona_state(const machine_config &mconfig, device_type type, const char *tag) : + saitek_stratos_state(mconfig, type, tag), + m_board(*this, "board"), + m_dac(*this, "dac") + { } + + // machine drivers + void corona(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // devices/pointers + required_device m_board; + required_device m_dac; + + void main_map(address_map &map); +}; + +void corona_state::machine_start() +{ + saitek_stratos_state::machine_start(); +} + +void corona_state::machine_reset() +{ + saitek_stratos_state::machine_reset(); +} + + + +/****************************************************************************** + I/O +******************************************************************************/ + +// HELIOS + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void corona_state::main_map(address_map &map) +{ + map(0x0000, 0x1fff).ram(); + map(0x8000, 0xffff).rom(); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( corona ) + PORT_INCLUDE( saitek_stratos ) + + PORT_MODIFY("IN.6") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Drivers +******************************************************************************/ + +void corona_state::corona(machine_config &config) +{ + /* basic machine hardware */ + M65C02(config, m_maincpu, 5_MHz_XTAL); // see set_cpu_freq + m_maincpu->set_addrmap(AS_PROGRAM, &corona_state::main_map); + m_maincpu->set_periodic_int(FUNC(corona_state::irq0_line_hold), attotime::from_hz(100)); + + 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(200)); + + /* video hardware */ + PWM_DISPLAY(config, m_display).set_size(2+4, 8+1); + config.set_default_layout(layout_saitek_corona); + + TIMER(config, "lcd_busy").configure_generic(timer_device::expired_delegate()); + + /* sound hardware */ + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); + VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + + /* extension rom */ + GENERIC_CARTSLOT(config, m_extrom, generic_plain_slot, "saitek_egr", "bin"); + m_extrom->set_device_load(FUNC(corona_state::extrom_load), this); + + SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr"); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( corona ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("w2_708g_u2.u2", 0x0000, 0x8000, CRC(52568bb4) SHA1(83fe91787e17bbefc2b3ec651ddb11c88990060d) ) + ROM_LOAD("bw2_708a_u3.u3", 0x8000, 0x8000, CRC(32848f73) SHA1(a447543e3eb4757f9afed26fde77b66985eb96a7) ) +ROM_END + +ROM_START( coronaa ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("w2_a14c_u2.u2", 0x0000, 0x8000, CRC(be82e199) SHA1(cfcc573774b6907ed137dca01fa7f3fce493a89f) ) + ROM_LOAD("bw2_a14_u3.u3", 0x8000, 0x8000, CRC(abe87285) SHA1(b15f7ddeac78d252cf413ba4085523e44c6d15df) ) +ROM_END + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +/* YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */ +CONS( 1988, corona, 0, 0, corona, corona, corona_state, empty_init, "Saitek", "Kasparov Corona (ver. D+)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Corona II +CONS( 1988, coronaa, corona, 0, corona, corona, corona_state, empty_init, "Saitek", "Kasparov Corona (ver. D)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/saitek_stratos.cpp b/src/mame/drivers/saitek_stratos.cpp index 1f8cc6517c3..2d6ca005429 100644 --- a/src/mame/drivers/saitek_stratos.cpp +++ b/src/mame/drivers/saitek_stratos.cpp @@ -7,7 +7,7 @@ SciSys/Saitek Stratos chesscomputer family (1986-1990) - Stratos - Turbo King -- Corona +- Corona --> it's in saitek_corona.cpp - *Simultano *: not dumped yet @@ -34,7 +34,6 @@ Simultano has an extra LCD screen representing the chessboard state. TODO: - emulate LCD at lower level, probably an MCU with embedded LCDC - add LCD 7*7 DMD, it's in m_lcd_data[0x30 to 0x3b] but scrambled -- corona: different addressmap, 64 leds - tking different internal artwork - irq timing is derived from the main XTAL, but result should be similar with 5MHz and 5.67MHz, there are a couple of "FREQ. SEL" nodes on the PCB, maybe related (not the ones in input ports) @@ -45,82 +44,51 @@ TODO: ***************************************************************************/ #include "emu.h" +#include "includes/saitek_stratos.h" + #include "cpu/m6502/m65c02.h" #include "machine/nvram.h" #include "machine/sensorboard.h" -#include "machine/timer.h" #include "sound/dac.h" #include "sound/volt_reg.h" -#include "video/pwm.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" #include "softlist.h" #include "speaker.h" -#include - // internal artwork #include "saitek_stratos.lh" // clickable -namespace { - -class stratos_state : public driver_device +class stratos_state : public saitek_stratos_state { public: stratos_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), + saitek_stratos_state(mconfig, type, tag), m_nvram(*this, "nvram.u7"), m_rombank(*this, "rombank"), m_nvrambank(*this, "nvrambank"), - m_lcd_busy(*this, "lcd_busy"), m_board(*this, "board"), - m_display(*this, "display"), - m_dac(*this, "dac"), - m_extrom(*this, "extrom"), - m_out_digit(*this, "digit%u", 0U), - m_out_lcd(*this, "lcd%u.%u.%u", 0U, 0U, 0U), - m_inputs(*this, "IN.%u", 0) + m_dac(*this, "dac") { } - DECLARE_INPUT_CHANGED_MEMBER(cpu_freq) { set_cpu_freq(); } - DECLARE_INPUT_CHANGED_MEMBER(acl_button) { if (newval) power_off(); } - DECLARE_INPUT_CHANGED_MEMBER(go_button); - // machine drivers void stratos(machine_config &config); - void corona(machine_config &config); void tking2(machine_config &config); protected: virtual void machine_start() override; virtual void machine_reset() override; - virtual void device_post_load() override { update_lcd(); } private: // devices/pointers - required_device m_maincpu; required_device m_nvram; required_memory_bank m_rombank; required_memory_bank m_nvrambank; - required_device m_lcd_busy; required_device m_board; - required_device m_display; required_device m_dac; - required_device m_extrom; - output_finder<8+1> m_out_digit; - output_finder<4, 16, 4> m_out_lcd; - required_ioport_array<8+1> m_inputs; void main_map(address_map &map); - - void clear_lcd() { std::fill_n(m_lcd_data, ARRAY_LENGTH(m_lcd_data), 0); } void update_leds(); - void update_lcd(); - void power_off(); - void set_cpu_freq(); // I/O handlers DECLARE_WRITE8_MEMBER(select_w); @@ -130,9 +98,6 @@ private: DECLARE_READ8_MEMBER(control_r); DECLARE_WRITE8_MEMBER(control_w); DECLARE_READ8_MEMBER(lcd_r); - DECLARE_WRITE8_MEMBER(lcd_w); - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(extrom_load); DECLARE_READ8_MEMBER(extrom_r); std::unique_ptr m_nvram_data; @@ -140,19 +105,49 @@ private: u8 m_select; u8 m_control; u8 m_led_data; - bool m_power; - - u8 m_lcd_count; - u8 m_lcd_address; - u8 m_lcd_data[0x40]; }; -void stratos_state::machine_start() +// saitek_stratos_state + +void saitek_stratos_state::machine_start() { // resolve handlers m_out_digit.resolve(); m_out_lcd.resolve(); + // zerofill + m_power = false; + m_lcd_count = 0; + m_lcd_address = 0; + + // register for savestates + save_item(NAME(m_power)); + save_item(NAME(m_lcd_count)); + save_item(NAME(m_lcd_address)); + save_item(NAME(m_lcd_data)); +} + +void saitek_stratos_state::machine_reset() +{ + m_power = true; + m_lcd_count = 0; + clear_lcd(); + + set_cpu_freq(); +} + +void saitek_stratos_state::set_cpu_freq() +{ + // released with either 5MHz or 5.67MHz speeds + m_maincpu->set_unscaled_clock((ioport("FAKE")->read() & 1) ? 5.67_MHz_XTAL : 5_MHz_XTAL); +} + +// stratos_state + +void stratos_state::machine_start() +{ + saitek_stratos_state::machine_start(); + // init banks m_rombank->configure_entries(0, 2, memregion("maincpu")->base(), 0x8000); @@ -165,38 +160,19 @@ void stratos_state::machine_start() m_select = 0; m_control = 0; m_led_data = 0; - m_power = false; - - m_lcd_count = 0; - m_lcd_address = 0; - clear_lcd(); // register for savestates save_item(NAME(m_select)); save_item(NAME(m_control)); save_item(NAME(m_led_data)); - save_item(NAME(m_power)); - - save_item(NAME(m_lcd_count)); - save_item(NAME(m_lcd_address)); - save_item(NAME(m_lcd_data)); } void stratos_state::machine_reset() { - m_power = true; - m_lcd_count = 0; + saitek_stratos_state::machine_reset(); m_rombank->set_entry(0); m_nvrambank->set_entry(0); - - set_cpu_freq(); -} - -void stratos_state::set_cpu_freq() -{ - // released with either 5MHz or 5.67MHz speeds - m_maincpu->set_unscaled_clock((ioport("FAKE")->read() & 1) ? 5.67_MHz_XTAL : 5_MHz_XTAL); } @@ -207,7 +183,7 @@ void stratos_state::set_cpu_freq() // soft power on/off -INPUT_CHANGED_MEMBER(stratos_state::go_button) +INPUT_CHANGED_MEMBER(saitek_stratos_state::go_button) { if (newval && !m_power) { @@ -216,7 +192,7 @@ INPUT_CHANGED_MEMBER(stratos_state::go_button) } } -void stratos_state::power_off() +void saitek_stratos_state::power_off() { m_power = false; m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); @@ -230,7 +206,7 @@ void stratos_state::power_off() // Endgame ROM -DEVICE_IMAGE_LOAD_MEMBER(stratos_state::extrom_load) +DEVICE_IMAGE_LOAD_MEMBER(saitek_stratos_state::extrom_load) { u32 size = m_extrom->common_get_size("rom"); @@ -256,7 +232,7 @@ READ8_MEMBER(stratos_state::extrom_r) // LCD HLE -void stratos_state::update_lcd() +void saitek_stratos_state::update_lcd() { // output individual segments for (int i = 0; i < 0x40; i++) @@ -274,13 +250,7 @@ void stratos_state::update_lcd() m_out_digit[i + 5] = (m_lcd_data[0x11 + i * 2] << 4 | m_lcd_data[0x11 + i * 2 + 1]) & 0x7f; } -READ8_MEMBER(stratos_state::lcd_r) -{ - // unknown, maybe resets lcd controller - return 0; -} - -WRITE8_MEMBER(stratos_state::lcd_w) +void saitek_stratos_state::lcd_w(u8 data) { // d0-d3: lcd data // d4-d7: unused? @@ -308,6 +278,12 @@ WRITE8_MEMBER(stratos_state::lcd_w) m_lcd_busy->adjust(attotime::from_usec(50)); // ? } +READ8_MEMBER(stratos_state::lcd_r) +{ + // unknown, maybe resets lcd controller + return 0; +} + // HELIOS @@ -411,7 +387,7 @@ void stratos_state::main_map(address_map &map) Input Ports ******************************************************************************/ -static INPUT_PORTS_START( stratos ) +INPUT_PORTS_START( saitek_stratos ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Set Up") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_L) PORT_NAME("Level") @@ -433,7 +409,7 @@ static INPUT_PORTS_START( stratos ) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("King") PORT_START("IN.4") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Play") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Play") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Tab / Color") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") @@ -458,17 +434,17 @@ static INPUT_PORTS_START( stratos ) PORT_CONFSETTING( 0x80, DEF_STR( Normal ) ) PORT_START("RESET") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, go_button, nullptr) PORT_NAME("Go") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, acl_button, nullptr) PORT_NAME("ACL") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, go_button, nullptr) PORT_NAME("Go") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, acl_button, nullptr) PORT_NAME("ACL") PORT_START("FAKE") - PORT_CONFNAME( 0x01, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, cpu_freq, nullptr) // factory set + PORT_CONFNAME( 0x01, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, cpu_freq, nullptr) // factory set PORT_CONFSETTING( 0x00, "5MHz" ) PORT_CONFSETTING( 0x01, "5.67MHz" ) INPUT_PORTS_END static INPUT_PORTS_START( tking2 ) - PORT_INCLUDE( stratos ) + PORT_INCLUDE( saitek_stratos ) PORT_MODIFY("IN.5") PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) @@ -512,18 +488,12 @@ void stratos_state::stratos(machine_config &config) SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr"); } -void stratos_state::corona(machine_config &config) -{ - stratos(config); - - m_board->set_type(sensorboard_device::MAGNETS); -} - void stratos_state::tking2(machine_config &config) { stratos(config); + m_maincpu->set_periodic_int(FUNC(stratos_state::irq0_line_hold), attotime::from_hz(100)); - // seems much more responsive + // seems much more responsive (not just because of higher irq rate) m_board->set_delay(attotime::from_msec(200)); } @@ -565,33 +535,15 @@ ROM_START( tkingb ) // PCB rev. 7 ROM_END -ROM_START( corona ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("w2_708g_u2.u2", 0x0000, 0x8000, CRC(52568bb4) SHA1(83fe91787e17bbefc2b3ec651ddb11c88990060d) ) - ROM_LOAD("bw2_708a_u3.u3", 0x8000, 0x8000, CRC(32848f73) SHA1(a447543e3eb4757f9afed26fde77b66985eb96a7) ) -ROM_END - -ROM_START( coronaa ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("w2_a14c_u2.u2", 0x0000, 0x8000, CRC(be82e199) SHA1(cfcc573774b6907ed137dca01fa7f3fce493a89f) ) - ROM_LOAD("bw2_a14_u3.u3", 0x8000, 0x8000, CRC(abe87285) SHA1(b15f7ddeac78d252cf413ba4085523e44c6d15df) ) -ROM_END - -} // anonymous namespace - - /****************************************************************************** Drivers ******************************************************************************/ -/* YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */ -CONS( 1986, stratos, 0, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1986, stratosa, stratos, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) - -CONS( 1990, tking, 0, 0, tking2, tking2, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 1, ver. D)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Turbo King II -CONS( 1988, tkinga, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // oldest? -CONS( 1988, tkingb, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) +/* YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */ +CONS( 1986, stratos, 0, 0, stratos, saitek_stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1986, stratosa, stratos, 0, stratos, saitek_stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1988, corona, 0, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (ver. D+)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Corona II -CONS( 1988, coronaa, corona, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (ver. D)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1990, tking, 0, 0, tking2, tking2, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 1, ver. D)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Turbo King II +CONS( 1988, tkinga, tking, 0, stratos, saitek_stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // oldest? +CONS( 1988, tkingb, tking, 0, stratos, saitek_stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/includes/saitek_stratos.h b/src/mame/includes/saitek_stratos.h new file mode 100644 index 00000000000..231ea8b53b9 --- /dev/null +++ b/src/mame/includes/saitek_stratos.h @@ -0,0 +1,72 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Saitek Stratos family chess computers shared class + Used in: saitek_stratos.cpp (main driver), saitek_corona.cpp + +*/ + +#ifndef MAME_INCLUDES_SAITEK_STRATOS_H +#define MAME_INCLUDES_SAITEK_STRATOS_H + +#pragma once + +#include "machine/timer.h" +#include "video/pwm.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +#include + + +class saitek_stratos_state : public driver_device +{ +public: + saitek_stratos_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_lcd_busy(*this, "lcd_busy"), + m_display(*this, "display"), + m_extrom(*this, "extrom"), + m_out_digit(*this, "digit%u", 0U), + m_out_lcd(*this, "lcd%u.%u.%u", 0U, 0U, 0U), + m_inputs(*this, "IN.%u", 0) + { } + + DECLARE_INPUT_CHANGED_MEMBER(cpu_freq) { set_cpu_freq(); } + DECLARE_INPUT_CHANGED_MEMBER(acl_button) { if (newval) power_off(); } + DECLARE_INPUT_CHANGED_MEMBER(go_button); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void device_post_load() override { update_lcd(); } + + // devices/pointers + required_device m_maincpu; + required_device m_lcd_busy; + required_device m_display; + required_device m_extrom; + output_finder<8+1> m_out_digit; + output_finder<4, 16, 4> m_out_lcd; + required_ioport_array<8+1> m_inputs; + + // common handlers + void clear_lcd() { std::fill_n(m_lcd_data, ARRAY_LENGTH(m_lcd_data), 0); } + void update_lcd(); + void power_off(); + void set_cpu_freq(); + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(extrom_load); + void lcd_w(u8 data); + + bool m_power; + u8 m_lcd_count; + u8 m_lcd_address; + u8 m_lcd_data[0x40]; +}; + +INPUT_PORTS_EXTERN( saitek_stratos ); + +#endif // MAME_INCLUDES_SAITEK_STRATOS_H diff --git a/src/mame/layout/saitek_corona.lay b/src/mame/layout/saitek_corona.lay new file mode 100644 index 00000000000..af4152e892a --- /dev/null +++ b/src/mame/layout/saitek_corona.lay @@ -0,0 +1,661 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index bce9f1dfe74..3c3b6c7ce28 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -34112,6 +34112,10 @@ sage2 // @source:saitek_chesstrv.cpp chesstrv // +@source:saitek_corona.cpp +corona +coronaa + @source:saitek_cp2000.cpp cp2000 // @@ -34123,8 +34127,6 @@ risc2500 // montreux // @source:saitek_stratos.cpp -corona -coronaa stratos stratosa tking diff --git a/src/mame/mess.flt b/src/mame/mess.flt index f486bb025cd..1ba447dd2f1 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -692,6 +692,7 @@ rzone.cpp sacstate.cpp sage2.cpp saitek_chesstrv.cpp +saitek_corona.cpp saitek_cp2000.cpp saitek_delta1.cpp saitek_risc2500.cpp -- cgit v1.2.3