From 06980c1e1d3ca30bb221ad5aa2473bff8bb8006e Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 8 Dec 2023 11:14:28 +0100 Subject: New working systems ------------------- Constellation Junior [hap, Mychess] --- src/mame/chess/yeno_301xl.cpp | 12 +- src/mame/cxg/senterprise.cpp | 2 +- src/mame/hegenerglaser/europa.cpp | 2 +- src/mame/layout/novag_constjr.lay | 487 ++++++++++++++++++++++++++++++++++++++ src/mame/mame.lst | 3 + src/mame/novag/constjr.cpp | 240 +++++++++++++++++++ src/mame/novag/micro2.cpp | 5 +- src/mame/novag/snova.cpp | 2 +- src/mame/saitek/companion2.cpp | 6 +- 9 files changed, 742 insertions(+), 17 deletions(-) create mode 100644 src/mame/layout/novag_constjr.lay create mode 100644 src/mame/novag/constjr.cpp diff --git a/src/mame/chess/yeno_301xl.cpp b/src/mame/chess/yeno_301xl.cpp index 32e8cb458a1..040bfca21db 100644 --- a/src/mame/chess/yeno_301xl.cpp +++ b/src/mame/chess/yeno_301xl.cpp @@ -13,7 +13,7 @@ TRAP interrupt for the beeper routine. Very strange. Hardware notes: - PCB label: WSE 8108A -- Hitachi HD63B01X0, 8MHz XTAL +- Hitachi HD63B01X0P, 8MHz XTAL - 8*8 chessboard buttons, 16+1 LEDs, piezo Yeno 309 XT is on the same PCB, and has the same MCU ROM. @@ -67,7 +67,6 @@ private: required_ioport_array<2> m_inputs; emu_timer *m_standbytimer; - bool m_power = false; u16 m_inp_mux = 0; // I/O handlers @@ -83,7 +82,6 @@ void y301xl_state::machine_start() m_standbytimer = timer_alloc(FUNC(y301xl_state::set_standby), this); // register for savestates - save_item(NAME(m_power)); save_item(NAME(m_inp_mux)); } @@ -95,8 +93,6 @@ void y301xl_state::machine_start() void y301xl_state::machine_reset() { - m_power = true; - m_maincpu->set_input_line(HD6301_IRQ_LINE, CLEAR_LINE); m_maincpu->set_input_line(M6801_STBY_LINE, CLEAR_LINE); } @@ -108,13 +104,11 @@ TIMER_CALLBACK_MEMBER(y301xl_state::set_standby) INPUT_CHANGED_MEMBER(y301xl_state::power_off) { - if (newval && m_power) + if (newval && !m_maincpu->standby()) { - m_power = false; - // IRQ1 when power switch is set to SAVE, followed by STBY after a short delay m_maincpu->set_input_line(HD6301_IRQ_LINE, ASSERT_LINE); - m_standbytimer->adjust(attotime::from_msec(100), M6801_STBY_LINE); + m_standbytimer->adjust(attotime::from_msec(50), M6801_STBY_LINE); } } diff --git a/src/mame/cxg/senterprise.cpp b/src/mame/cxg/senterprise.cpp index f9f562f2a16..133c0d4e304 100644 --- a/src/mame/cxg/senterprise.cpp +++ b/src/mame/cxg/senterprise.cpp @@ -17,7 +17,7 @@ TODO: Hardware notes: - PCB label (Super Crown): CXG 218-600-001 -- Hitachi HD6301Y0 (mode 2), 8MHz XTAL +- Hitachi HD6301Y0P (mode 2), 8MHz XTAL - 2KB battery-backed RAM (HM6116LP-3) - chessboard buttons, 24 LEDs, piezo diff --git a/src/mame/hegenerglaser/europa.cpp b/src/mame/hegenerglaser/europa.cpp index f3a71333777..e52dbc7b12b 100644 --- a/src/mame/hegenerglaser/europa.cpp +++ b/src/mame/hegenerglaser/europa.cpp @@ -12,7 +12,7 @@ NVRAM won't save properly. Hardware notes: - PCB label: 957&958-2, europa.H+G -- Hitachi HD63B01Y0, 8MHz resonator +- Hitachi HD63B01Y0F, 8MHz resonator - 8*8 chessboard buttons, 24 LEDs, piezo Mephisto Europa A and Mephisto Marco Polo have the exact same MCU. diff --git a/src/mame/layout/novag_constjr.lay b/src/mame/layout/novag_constjr.lay new file mode 100644 index 00000000000..ec8dc807e36 --- /dev/null +++ b/src/mame/layout/novag_constjr.lay @@ -0,0 +1,487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index eb023164856..d845fc9a25f 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -34739,6 +34739,9 @@ constq ssensor4 supercon +@source:novag/constjr.cpp +constjr + @source:novag/diablo.cpp diablo68 diablo68a diff --git a/src/mame/novag/constjr.cpp b/src/mame/novag/constjr.cpp new file mode 100644 index 00000000000..4e08b8eb78a --- /dev/null +++ b/src/mame/novag/constjr.cpp @@ -0,0 +1,240 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Mychess +/******************************************************************************* + +Novag Constellation Junior (aka Constellation Jr.) + +NOTE: It triggers an NMI at power-off (or power-failure). If this isn't done, +NVRAM won't work properly. + +The interface and look are very similar to Novag Presto (Micro II program). +The chess engine is by David Kittinger. + +Constellation Junior model number is 852, but the MCU label says 846, and the MCU +datestamp is from 1984. There is no known Novag model 846, so perhaps they intended +to sell it in 1984, but changed their mind and delayed it until early 1985. + +Hardware notes: +- PCB label: 100040/100039 +- Hitachi HD6301V1P @ ~4MHz (LC oscillator) +- 8*8 chessboard buttons, 16+4 leds, piezo + +TODO: +- if/when MAME supports an exit callback, hook up power-off NMI to that + +BATANB: +- slower chessboard button response when a piece moves 1 square vertically between + the 4th and the 5th ranks, hence the 350ms set_delay + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/m6800/m6801.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "video/pwm.h" + +#include "speaker.h" + +// internal artwork +#include "novag_constjr.lh" + + +namespace { + +class constjr_state : public driver_device +{ +public: + constjr_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_dac(*this, "dac"), + m_inputs(*this, "IN.0") + { } + + DECLARE_INPUT_CHANGED_MEMBER(power_off); + + void constjr(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // devices/pointers + required_device m_maincpu; + required_device m_board; + required_device m_display; + required_device m_dac; + required_ioport m_inputs; + + emu_timer *m_standbytimer; + u16 m_inp_mux = 0; + + // I/O handlers + void board_w(u8 data); + void control_w(u8 data); + void ledsel_w(u8 data); + u8 input_r(); + + TIMER_CALLBACK_MEMBER(set_standby); +}; + +void constjr_state::machine_start() +{ + m_standbytimer = timer_alloc(FUNC(constjr_state::set_standby), this); + + // register for savestates + save_item(NAME(m_inp_mux)); +} + + + +/******************************************************************************* + Power +*******************************************************************************/ + +void constjr_state::machine_reset() +{ + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + m_maincpu->set_input_line(M6801_STBY_LINE, CLEAR_LINE); +} + +TIMER_CALLBACK_MEMBER(constjr_state::set_standby) +{ + m_maincpu->set_input_line(M6801_STBY_LINE, ASSERT_LINE); +} + +INPUT_CHANGED_MEMBER(constjr_state::power_off) +{ + if (newval && !m_maincpu->standby()) + { + // NMI when power goes off, followed by STBY after a short delay + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + m_standbytimer->adjust(attotime::from_msec(50), M6801_STBY_LINE); + } +} + + + +/******************************************************************************* + I/O +*******************************************************************************/ + +void constjr_state::board_w(u8 data) +{ + // P10-P17: input mux (chessboard), led data + m_inp_mux = (m_inp_mux & 0x100) | (data ^ 0xff); + m_display->write_mx(~data); +} + +void constjr_state::control_w(u8 data) +{ + // P22: speaker out + m_dac->write(BIT(~data, 2)); + + // P24: input mux (buttons) + m_inp_mux = (m_inp_mux & 0xff) | (~data << 4 & 0x100); +} + +void constjr_state::ledsel_w(u8 data) +{ + // P35-P37: led select + m_display->write_my(~data >> 5 & 7); +} + +u8 constjr_state::input_r() +{ + // P40-P47: multiplexed inputs + u8 data = 0; + + // read buttons + if (m_inp_mux & 0x100) + data |= m_inputs->read(); + + // read chessboard + for (int i = 0; i < 8; i++) + if (BIT(m_inp_mux, i)) + data |= m_board->read_rank(i, true); + + return ~data; +} + + + +/******************************************************************************* + Input Ports +*******************************************************************************/ + +static INPUT_PORTS_START( constjr ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_B) PORT_NAME("Black/White") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_V) PORT_NAME("Verify / Pawn") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_U) PORT_NAME("Set Up / Rook") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game / Knight") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_CODE(KEYCODE_L) PORT_NAME("Set Level / Bishop") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_S) PORT_NAME("Sound / Queen") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back / King") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_G) PORT_NAME("Go") + + PORT_START("POWER") // needs to be triggered for nvram to work + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, constjr_state, power_off, 0) PORT_NAME("Power Off") +INPUT_PORTS_END + + + +/******************************************************************************* + Machine Configs +*******************************************************************************/ + +void constjr_state::constjr(machine_config &config) +{ + // basic machine hardware + HD6301V1(config, m_maincpu, 4'000'000); // approximation, no XTAL + m_maincpu->nvram_enable_backup(true); + m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301v1_cpu_device::nvram_set_battery)); + m_maincpu->standby_cb().append([this](int state) { if (state) m_display->clear(); }); + m_maincpu->out_p1_cb().set(FUNC(constjr_state::board_w)); + m_maincpu->out_p2_cb().set(FUNC(constjr_state::control_w)); + m_maincpu->out_p3_cb().set(FUNC(constjr_state::ledsel_w)); + m_maincpu->in_p4_cb().set(FUNC(constjr_state::input_r)); + + SENSORBOARD(config, 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(350)); + m_board->set_nvram_enable(true); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(3, 8); + config.set_default_layout(layout_novag_constjr); + + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); +} + + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + +ROM_START( constjr ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD("hd6301v1p_d24_ucc-846", 0x0000, 0x1000, CRC(e73703e4) SHA1(03eb889a9981a6bdfca129ea84f984fbf7858d47) ) +ROM_END + +} // anonymous namespace + + + +/******************************************************************************* + Drivers +*******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1985, constjr, 0, 0, constjr, constjr, constjr_state, empty_init, "Novag", "Constellation Junior", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/novag/micro2.cpp b/src/mame/novag/micro2.cpp index 484b46bfbad..f86b85ba75e 100644 --- a/src/mame/novag/micro2.cpp +++ b/src/mame/novag/micro2.cpp @@ -12,9 +12,10 @@ This program was used in several Novag chesscomputers: - Novag Octo suspected, to be confirmed: -- Novag Allegro +- Novag Allegro (not Allegro 4) - Novag Piccolo -- Novag Alto + +The chess engine is by Julio Kaplan, not David Kittinger. Hardware notes: diff --git a/src/mame/novag/snova.cpp b/src/mame/novag/snova.cpp index d6b39d73b25..98b74e647a6 100644 --- a/src/mame/novag/snova.cpp +++ b/src/mame/novag/snova.cpp @@ -11,7 +11,7 @@ NVRAM won't work properly (supremo doesn't have NVRAM). TODO: - beeps are glitchy, as if interrupted for too long -- if/when MAME supports an exit callback, hook up power-off NMI to that +- if/when MAME supports an exit callback, hook up nsnova power-off NMI to that - nsnova serial port isn't working, MCU emulation problem? - nsnova unmapped reads from 0x33/0x34 - is "Aquamarine / Super Nova" the same rom as nsnova and just a redesign? diff --git a/src/mame/saitek/companion2.cpp b/src/mame/saitek/companion2.cpp index 4891b01fdc0..728bf7ef7f3 100644 --- a/src/mame/saitek/companion2.cpp +++ b/src/mame/saitek/companion2.cpp @@ -22,7 +22,7 @@ Hardware notes: Chess Companion II: - PCB label: YO1B-01 REV.B -- Hitachi HD6301V1 (0609V171) @ ~4MHz (LC oscillator) +- Hitachi HD6301V1P (0609V171) @ ~4MHz (LC oscillator) - chessboard buttons, 16+5 leds, piezo Explorer Chess: @@ -57,7 +57,7 @@ CXG Enterprise "S" / Star Chess is on very similar hardware, so it's emulated in this driver too. Hardware notes: -- Hitachi HD6301V1 (HD6301V1C42P), 7.15909MHz XTAL +- Hitachi HD6301V1P (HD6301V1C42P), 7.15909MHz XTAL - port 2 I/O is changed a bit, rest is same as compan2 HD6301V1C42P MCU is used in: @@ -179,7 +179,7 @@ INPUT_CHANGED_MEMBER(compan2_state::power_off) m_power = false; // when power switch is set to MEMORY, it triggers an NMI after a short delay - attotime delay = attotime::from_msec(100); + attotime delay = attotime::from_msec(50); m_nmitimer->adjust(delay, INPUT_LINE_NMI); // afterwards, MCU STBY pin is asserted after a short delay -- cgit v1.2.3