From bb222482b6fe6a2fb5b446aa2b321c44ad1f20d6 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 16 May 2020 22:09:23 +0200 Subject: [PATCH] novag_micro2: change npresto/nocto to nmicro2 (nw) --- src/mame/drivers/fidel_sc6.cpp | 1 + src/mame/drivers/novag_micro2.cpp | 151 +++++++-------- src/mame/layout/fidel_msc_v2.lay | 2 + src/mame/layout/novag_micro2.lay | 298 +++++++++++++++--------------- src/mame/mame.lst | 3 +- 5 files changed, 214 insertions(+), 241 deletions(-) diff --git a/src/mame/drivers/fidel_sc6.cpp b/src/mame/drivers/fidel_sc6.cpp index f67ae5212f3..0fc5a34068b 100644 --- a/src/mame/drivers/fidel_sc6.cpp +++ b/src/mame/drivers/fidel_sc6.cpp @@ -34,6 +34,7 @@ modules. The module overrides the internal ROM, by asserting the EA pin. TODO: - MSC MCU is currently emulated as I8039, due to missing EA pin emulation +- different button panel for fidel_msc_v2 artwork ******************************************************************************/ diff --git a/src/mame/drivers/novag_micro2.cpp b/src/mame/drivers/novag_micro2.cpp index 6fe03d645a8..854188c780b 100644 --- a/src/mame/drivers/novag_micro2.cpp +++ b/src/mame/drivers/novag_micro2.cpp @@ -3,29 +3,51 @@ // thanks-to:Berger /****************************************************************************** -Novag Presto / Novag Octo +Novag Micro II (model 821) -Hardware notes (Presto): +This program was used in several Novag chesscomputers: +- Novag Micro II (1st use) +- Novag Presto +- Novag Octo + +suspected, to be confirmed: +- Novag Micro III +- Novag Allegro +- Novag Piccolo +- Novag Alto + +Hardware notes: + +Micro II: +- Mitsubishi M5L8049-079P-6, 6MHz XTAL +- buzzer, 20 leds, 8*8 chessboard buttons + +Presto (listed differences): - NEC D80C49C MCU(serial 186), OSC from LC circuit measured ~6MHz -- buzzer, 16+4 LEDs, 8*8 chessboard buttons -Octo has a NEC D80C49HC MCU(serial 111), OSC from LC circuit measured ~12MHz -The buzzer has a little electronic circuit going on, not sure whatfor. -Otherwise, it's identical to Presto. The MCU internal ROM is same too. +Octo (listed differences): +- NEC D80C49HC MCU(serial 111), 12MHz OSC from LC circuit, this was advertised + as 15MHz on the box, but measured ~12MHz (older Octo version is probably ~6MHz?) +- speaker circuit is a bit different, not sure why + +Note that even though the MCUs are different, internal ROM contents is +identical for Micro II, Presto, Octo. TODO: - controls are too sensitive, is there a bug in the CPU core timer emulation? 6MHz: valid (single) button press registered between 307ms and 436ms, - 12MHz: between 154ms and 218ms, 15MHz: between 123ms and 174ms. + 12MHz: between 154ms and 218ms. ******************************************************************************/ #include "emu.h" + #include "cpu/mcs48/mcs48.h" #include "machine/sensorboard.h" #include "sound/dac.h" #include "sound/volt_reg.h" #include "video/pwm.h" + #include "speaker.h" // internal artwork @@ -34,12 +56,10 @@ TODO: namespace { -// Presto / shared - -class presto_state : public driver_device +class micro2_state : public driver_device { public: - presto_state(const machine_config &mconfig, device_type type, const char *tag) : + micro2_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_display(*this, "display"), @@ -49,11 +69,16 @@ public: { } // machine configs - void presto(machine_config &config); - void octo(machine_config &config); + void micro2(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(cpu_freq) { set_cpu_freq(); } protected: virtual void machine_start() override; + virtual void machine_reset() override { set_cpu_freq(); } + +private: + void set_cpu_freq(); // devices/pointers required_device m_maincpu; @@ -68,50 +93,25 @@ protected: DECLARE_WRITE8_MEMBER(control_w); DECLARE_READ8_MEMBER(input_r); - bool m_kp_select; - u8 m_inp_mux; - u8 m_led_select; + bool m_kp_select = false; + u8 m_inp_mux = 0; + u8 m_led_select = 0; }; -void presto_state::machine_start() +void micro2_state::machine_start() { - // zerofill - m_kp_select = false; - m_inp_mux = 0; - m_led_select = 0; - // register for savestates save_item(NAME(m_kp_select)); save_item(NAME(m_inp_mux)); save_item(NAME(m_led_select)); } -// Octo - -class octo_state : public presto_state +void micro2_state::set_cpu_freq() { -public: - octo_state(const machine_config &mconfig, device_type type, const char *tag) : - presto_state(mconfig, type, tag) - { } - - DECLARE_INPUT_CHANGED_MEMBER(octo_cpu_freq) { octo_set_cpu_freq(); } - -protected: - virtual void machine_reset() override; - void octo_set_cpu_freq(); -}; - -void octo_state::machine_reset() -{ - presto_state::machine_reset(); - octo_set_cpu_freq(); -} - -void octo_state::octo_set_cpu_freq() -{ - // Octo was released with either 12MHz or 15MHz CPU - m_maincpu->set_unscaled_clock((ioport("FAKE")->read() & 1) ? (15000000) : (12000000)); + // known CPU speeds: 6MHz(XTAL), 6MHz(LC), 12MHz(LC) + u32 clock = (ioport("FAKE")->read() & 1) ? 12000000 : 6000000; + m_board->set_delay(attotime::from_ticks(2000000, clock)); // see TODO + m_maincpu->set_unscaled_clock(clock); } @@ -122,19 +122,19 @@ void octo_state::octo_set_cpu_freq() // MCU ports/generic -void presto_state::update_display() +void micro2_state::update_display() { m_display->matrix(m_led_select, m_inp_mux); } -WRITE8_MEMBER(presto_state::mux_w) +WRITE8_MEMBER(micro2_state::mux_w) { // D0-D7: input mux, led data m_inp_mux = ~data; update_display(); } -WRITE8_MEMBER(presto_state::control_w) +WRITE8_MEMBER(micro2_state::control_w) { // P21: keypad select m_kp_select = bool(~data & 2); @@ -147,7 +147,7 @@ WRITE8_MEMBER(presto_state::control_w) update_display(); } -READ8_MEMBER(presto_state::input_r) +READ8_MEMBER(micro2_state::input_r) { u8 data = 0; @@ -170,25 +170,21 @@ READ8_MEMBER(presto_state::input_r) Input Ports ******************************************************************************/ -static INPUT_PORTS_START( presto ) +static INPUT_PORTS_START( micro2 ) PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Black/White") // Octo calls it "Change Color" + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("B/W") // aka "Black/White" or "Change Color" PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Verify / Pawn") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Set Up / Rook") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Knight") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Set Level / Bishop") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Level / Bishop") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Queen") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Take Back / King") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Go") -INPUT_PORTS_END - -static INPUT_PORTS_START( octo ) - PORT_INCLUDE( presto ) PORT_START("FAKE") - PORT_CONFNAME( 0x01, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, octo_state, octo_cpu_freq, 0) // factory set - PORT_CONFSETTING( 0x00, "12MHz" ) - PORT_CONFSETTING( 0x01, "15MHz" ) + PORT_CONFNAME( 0x01, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, micro2_state, cpu_freq, 0) // factory set + PORT_CONFSETTING( 0x00, "6MHz" ) + PORT_CONFSETTING( 0x01, "12MHz" ) INPUT_PORTS_END @@ -197,17 +193,16 @@ INPUT_PORTS_END Machine Configs ******************************************************************************/ -void presto_state::presto(machine_config &config) +void micro2_state::micro2(machine_config &config) { /* basic machine hardware */ - I8049(config, m_maincpu, 6000000); // LC circuit, measured 6MHz - m_maincpu->p1_in_cb().set(FUNC(presto_state::input_r)); - m_maincpu->p2_out_cb().set(FUNC(presto_state::control_w)); - m_maincpu->bus_out_cb().set(FUNC(presto_state::mux_w)); + I8049(config, m_maincpu, 6_MHz_XTAL); // see set_cpu_freq + m_maincpu->p1_in_cb().set(FUNC(micro2_state::input_r)); + m_maincpu->p2_out_cb().set(FUNC(micro2_state::control_w)); + m_maincpu->bus_out_cb().set(FUNC(micro2_state::mux_w)); 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(320)); /* video hardware */ PWM_DISPLAY(config, m_display).set_size(3, 8); @@ -219,30 +214,15 @@ void presto_state::presto(machine_config &config) VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); } -void presto_state::octo(machine_config &config) -{ - presto(config); - - /* basic machine hardware */ - m_maincpu->set_clock(12000000); // LC circuit, measured, see octo_set_cpu_freq - - m_board->set_delay(attotime::from_msec(160)); -} - /****************************************************************************** ROM Definitions ******************************************************************************/ -ROM_START( npresto ) +ROM_START( nmicro2 ) ROM_REGION( 0x0800, "maincpu", 0 ) - ROM_LOAD("d80c49c_186", 0x0000, 0x0800, CRC(29a0eb4c) SHA1(e058d6018e53ddcaa3b5ec25b33b8bff091b04db) ) -ROM_END - -ROM_START( nocto ) - ROM_REGION( 0x0800, "maincpu", 0 ) - ROM_LOAD("d80c49hc_111", 0x0000, 0x0800, CRC(29a0eb4c) SHA1(e058d6018e53ddcaa3b5ec25b33b8bff091b04db) ) // same program as npresto + ROM_LOAD("8049_8210", 0x0000, 0x0800, CRC(29a0eb4c) SHA1(e058d6018e53ddcaa3b5ec25b33b8bff091b04db) ) ROM_END } // anonymous namespace @@ -254,5 +234,4 @@ ROM_END ******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -CONS( 1984, npresto, 0, 0, presto, presto, presto_state, empty_init, "Novag", "Presto (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1987, nocto, npresto, 0, octo, octo, octo_state, empty_init, "Novag", "Octo (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1982, nmicro2, 0, 0, micro2, micro2, micro2_state, empty_init, "Novag", "Micro II (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/layout/fidel_msc_v2.lay b/src/mame/layout/fidel_msc_v2.lay index 3cfac1a3495..bae4fac4582 100644 --- a/src/mame/layout/fidel_msc_v2.lay +++ b/src/mame/layout/fidel_msc_v2.lay @@ -498,6 +498,8 @@ license:CC0 + + diff --git a/src/mame/layout/novag_micro2.lay b/src/mame/layout/novag_micro2.lay index 2b0eaab8b13..b1037400658 100644 --- a/src/mame/layout/novag_micro2.lay +++ b/src/mame/layout/novag_micro2.lay @@ -6,7 +6,11 @@ license:CC0 - + + + + + @@ -17,89 +21,70 @@ license:CC0 - - - - - - - - - + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - + + + + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + @@ -384,106 +369,113 @@ license:CC0 - + - - - - - - - - - + + + + + + + + - - - - + + + + + + + + - - - - - - - - + - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + - - - - + + + + - + + + + - + - - - - - - + - - - - - - - - + + + + + + - - - - - - - - + + + + + + - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index a30c07a92bf..7f8f3ed7153 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -31962,8 +31962,7 @@ diablo68 // scorpio68 // @source:novag_micro2.cpp -nocto // -npresto // +nmicro2 @source:novag_savant.cpp savant //