From 15a453a55aad12108ee932b2c44ac50a9e101434 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 22 Feb 2024 21:35:21 +0100 Subject: snova/svip: rename driver to primo/vip --- src/mame/mame.lst | 12 +- src/mame/novag/primo.cpp | 475 +++++++++++++++++++++++++++++++++++++++++++++++ src/mame/novag/snova.cpp | 475 ----------------------------------------------- src/mame/novag/svip.cpp | 427 ------------------------------------------ src/mame/novag/vip.cpp | 427 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 908 insertions(+), 908 deletions(-) create mode 100644 src/mame/novag/primo.cpp delete mode 100644 src/mame/novag/snova.cpp delete mode 100644 src/mame/novag/svip.cpp create mode 100644 src/mame/novag/vip.cpp diff --git a/src/mame/mame.lst b/src/mame/mame.lst index e8c1ec00b2c..b881062fce2 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -34865,6 +34865,11 @@ nmicro @source:novag/micro2.cpp nmicro2 +@source:novag/primo.cpp +nprimo +nsnova +supremo + @source:novag/robotadv.cpp robotadv @@ -34887,12 +34892,7 @@ sforteb // sfortec // sfortec1 // -@source:novag/snova.cpp -nprimo -nsnova -supremo - -@source:novag/svip.cpp +@source:novag/vip.cpp nsvip nsvipa nsvipb diff --git a/src/mame/novag/primo.cpp b/src/mame/novag/primo.cpp new file mode 100644 index 00000000000..05d07b632f2 --- /dev/null +++ b/src/mame/novag/primo.cpp @@ -0,0 +1,475 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Berger, bataais +/******************************************************************************* + +Novag Primo & related chess computers. The chess engine is by David Kittinger. + +NOTE: Turn the power switch off before exiting MAME, otherwise NVRAM won't save +properly. + +TODO: +- if/when MAME supports an exit callback, hook up power-off switch to that +- unmapped reads from 0x3c/0x3d (primo/supremo) or 0x33/0x34 (nsnova) +- supremo unmapped writes to 0x2000/0x6000, always 0? +- is "Aquamarine / Super Nova" the same rom as nsnova and just a redesign? +- is the 1st version of supremo(black plastic) the same ROM? + +BTANB: +- primo has the same bug as nvip, where if the user presses Go right after + entering a move, the CPU opponent will answer by playing a move with white + +================================================================================ + +Novag Primo (model 871) +----------------------- + +Hardware notes: +- PCB label: 100059/100060 +- Hitachi HD6301Y0P (mode 2) @ 8MHz +- 2KB RAM(M5M5118P) +- LCD with 4 digits and custom segments, no LCD chip +- buzzer, 16 LEDs, 8*8 chessboard buttons + +The LCD is the same as the one in VIP / Super VIP. + +================================================================================ + +Novag Supremo (model 881) +------------------------- + +Hardware notes: +- PCB label: 100090 +- Hitachi HD63A03YP @ 8MHz +- 32KB ROM(TC57256AD-12), 2KB RAM(TC5516APL) +- rest is same as Primo + +Supremo also had a "limited edition" rerelease in 1990, plastic is fake-wood +instead of black and backpanel sticker is gold, otherwise it's the same game. +The model number is still 881, ROM is the same as the standard fake-wood version. + +================================================================================ + +Novag Super Nova (model 904) +---------------------------- + +Hardware notes: +- Hitachi HD63A03YP @ 16MHz +- 32KB ROM(TC57256AD-12), 8KB RAM(CXK58648P-10L) +- LCD with 4 digits and custom segments, no LCD chip +- RJ-12 port for Novag Super System (like the one in nsvip/sexpertc) +- buzzer, 16 LEDs, 8*8 chessboard buttons + +Older versions had a bug in the opening moves, always playing B5 after D4. + +The program is very similar to Super VIP, it could be said that Super Nova is +the Super VIP combined with the Novag Super System Touch Sensory board. + +*******************************************************************************/ + +#include "emu.h" + +#include "bus/rs232/rs232.h" +#include "cpu/m6800/m6801.h" +#include "machine/nvram.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "video/pwm.h" + +#include "screen.h" +#include "speaker.h" + +// internal artwork +#include "novag_primo.lh" +#include "novag_snova.lh" +#include "novag_supremo.lh" + + +namespace { + +class primo_state : public driver_device +{ +public: + primo_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_lcd_pwm(*this, "lcd_pwm"), + m_led_pwm(*this, "led_pwm"), + m_dac(*this, "dac"), + m_rs232(*this, "rs232"), + m_inputs(*this, "IN.%u", 0), + m_out_lcd(*this, "s%u.%u", 0U, 0U) + { } + + void primo(machine_config &config); + void supremo(machine_config &config); + void snova(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(primo_power_off) { if (newval) m_power = false; } + DECLARE_INPUT_CHANGED_MEMBER(snova_power_off); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override { m_power = true; } + +private: + // devices/pointers + required_device m_maincpu; + required_device m_board; + required_device m_lcd_pwm; + required_device m_led_pwm; + required_device m_dac; + optional_device m_rs232; + required_ioport_array<2> m_inputs; + output_finder<4, 10> m_out_lcd; + + bool m_power = false; + bool m_lcd_strobe = false; + u8 m_inp_mux = 0; + u8 m_select = 0; + u8 m_led_data = 0; + + void primo_map(address_map &map); + void supremo_map(address_map &map); + void snova_map(address_map &map); + + // I/O handlers + void standby(int state); + void lcd_pwm_w(offs_t offset, u8 data); + void update_leds(); + + u8 p2_r(); + void p2_w(u8 data); + void p5_w(u8 data); + void p6_w(u8 data); +}; + +void primo_state::machine_start() +{ + m_out_lcd.resolve(); + + // register for savestates + save_item(NAME(m_power)); + save_item(NAME(m_lcd_strobe)); + save_item(NAME(m_inp_mux)); + save_item(NAME(m_select)); + save_item(NAME(m_led_data)); +} + + + +/******************************************************************************* + I/O +*******************************************************************************/ + +// power + +void primo_state::standby(int state) +{ + // clear display + if (state) + { + m_lcd_pwm->clear(); + m_led_pwm->clear(); + } +} + +INPUT_CHANGED_MEMBER(primo_state::snova_power_off) +{ + // NMI at power-off, which will trigger standby mode + if (newval && !m_maincpu->standby()) + m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); +} + + +// misc + +void primo_state::lcd_pwm_w(offs_t offset, u8 data) +{ + m_out_lcd[offset & 0x3f][offset >> 6] = data; +} + +void primo_state::update_leds() +{ + m_led_pwm->matrix(m_select >> 4 & 3, m_led_data); +} + + +// MCU ports + +u8 primo_state::p2_r() +{ + // P20: 4051 Z + u8 data = 0; + + // read chessboard buttons + for (int i = 0; i < 8; i++) + if (BIT(m_led_data, i)) + data |= BIT(m_board->read_file(i), m_inp_mux); + + // read keypad buttons + for (int i = 0; i < 2; i++) + if (BIT(m_select, i + 6)) + data |= BIT(m_inputs[i]->read(), m_inp_mux); + + // P23 (nprimo, supremo): power switch + if (!m_power) + data |= 8; + + // P23 (nsnova): serial rx + if (m_rs232) + data |= m_rs232->rxd_r() << 3; + + return data ^ 1; +} + +void primo_state::p2_w(u8 data) +{ + // P21: 4066 in/out to LCD + if (m_lcd_strobe && ~data & 2) + { + u16 lcd_data = (m_select << 2 & 0x300) | m_led_data; + m_lcd_pwm->matrix(m_select & 0xf, lcd_data); + } + m_lcd_strobe = bool(data & 2); + + // P22: speaker out + m_dac->write(BIT(data, 2)); + + // P24 (nsnova): serial tx (TTL) + if (m_rs232) + m_rs232->write_txd(BIT(data, 4)); + + // P25-P27: 4051 S0-S2 + // 4051 Y0-Y7: multiplexed inputs + m_inp_mux = data >> 5 & 7; +} + +void primo_state::p5_w(u8 data) +{ + // P50-P53: 4066 control to LCD + // P54,P55: led select + // P56,P57: keypad mux, lcd data + m_select = data ^ 0xf0; + update_leds(); +} + +void primo_state::p6_w(u8 data) +{ + // P60-P67: led data, lcd data, chessboard mux + m_led_data = ~data; + update_leds(); +} + + + +/******************************************************************************* + Address Maps +*******************************************************************************/ + +void primo_state::primo_map(address_map &map) +{ + map(0x4000, 0x47ff).ram().share("nvram"); +} + +void primo_state::supremo_map(address_map &map) +{ + primo_map(map); + map(0x8000, 0xffff).rom(); +} + +void primo_state::snova_map(address_map &map) +{ + map(0x4000, 0x5fff).ram().share("nvram"); + map(0x8000, 0xffff).rom(); +} + + + +/******************************************************************************* + Input Ports +*******************************************************************************/ + +static INPUT_PORTS_START( primo ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Trace Back / Next Best") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Trace Forward / Auto Play") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Set Level / Pawn") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Info / Knight") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Easy / Bishop") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Solve Mate / Rook") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Queen") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / King") + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Go") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Restore") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Hint") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Clear / Clear Board") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Color") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Verify / Set Up") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Random") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") + + 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, primo_state, primo_power_off, 0) PORT_NAME("Power Off") +INPUT_PORTS_END + +static INPUT_PORTS_START( supremo ) + PORT_INCLUDE( primo ) + + PORT_MODIFY("IN.0") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Easy / Print Moves / Bishop") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Solve Mate / Print Eval / Rook") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Print List / Queen") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / Print Board / King") +INPUT_PORTS_END + + +static INPUT_PORTS_START( snova ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Trace Back / Next Best") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Trace Forward / Auto Play") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Set Level / Pawn") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Info / Echo / Knight") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Easy / Moves / Bishop") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Solve Mate / Language / Rook") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Sound / Game / Queen") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Referee / Board / King") + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Go") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Restore") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Hint / Human") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Clear Board / Clear") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Color / Video") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Set Up / Verify") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Random / Auto Clock") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") + + PORT_START("POWER") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, primo_state, snova_power_off, 0) PORT_NAME("Power Off") +INPUT_PORTS_END + + + +/******************************************************************************* + Machine Configs +*******************************************************************************/ + +void primo_state::primo(machine_config &config) +{ + // basic machine hardware + HD6301Y0(config, m_maincpu, 8_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &primo_state::primo_map); + m_maincpu->nvram_enable_backup(true); + m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301y0_cpu_device::nvram_set_battery)); + m_maincpu->standby_cb().append(FUNC(primo_state::standby)); + m_maincpu->in_p2_cb().set(FUNC(primo_state::p2_r)); + m_maincpu->out_p2_cb().set(FUNC(primo_state::p2_w)); + m_maincpu->out_p5_cb().set(FUNC(primo_state::p5_w)); + m_maincpu->out_p6_cb().set(FUNC(primo_state::p6_w)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + 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_lcd_pwm).set_size(4, 10); + m_lcd_pwm->output_x().set(FUNC(primo_state::lcd_pwm_w)); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_refresh_hz(60); + screen.set_size(1920/4, 606/4); + screen.set_visarea_full(); + + PWM_DISPLAY(config, m_led_pwm).set_size(2, 8); + config.set_default_layout(layout_novag_primo); + + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); +} + +void primo_state::supremo(machine_config &config) +{ + primo(config); + + // basic machine hardware + HD6303Y(config.replace(), m_maincpu, 8_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &primo_state::supremo_map); + m_maincpu->nvram_enable_backup(true); + m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6303y_cpu_device::nvram_set_battery)); + m_maincpu->standby_cb().append(FUNC(primo_state::standby)); + m_maincpu->in_p2_cb().set(FUNC(primo_state::p2_r)); + m_maincpu->out_p2_cb().set(FUNC(primo_state::p2_w)); + m_maincpu->out_p5_cb().set(FUNC(primo_state::p5_w)); + m_maincpu->out_p6_cb().set(FUNC(primo_state::p6_w)); + + config.set_default_layout(layout_novag_supremo); +} + +void primo_state::snova(machine_config &config) +{ + supremo(config); + + // basic machine hardware + m_maincpu->set_clock(16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &primo_state::snova_map); + + config.set_default_layout(layout_novag_snova); + + // rs232 (configure after video) + RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); +} + + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + +ROM_START( nprimo ) + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD("novag_871_31y0c34p.u1", 0x0000, 0x4000, CRC(ad692d2e) SHA1(f41ae4e02a83ba6446a6df59a6ee2c2f87a1f4d8) ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + + +ROM_START( supremo ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("sp_a10.u5", 0x8000, 0x8000, CRC(1db63786) SHA1(4f24452ed8955b31ba88f68cc95c357660930aa4) ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + + +ROM_START( nsnova ) // ID = N1.05 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("n_530.u5", 0x8000, 0x8000, CRC(727a0ada) SHA1(129c1edc5c1d2e12ce97ebef81c6d5555464a11d) ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + +} // anonymous namespace + + + +/******************************************************************************* + Drivers +*******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1987, nprimo, 0, 0, primo, primo, primo_state, empty_init, "Novag", "Primo (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +SYST( 1988, supremo, 0, 0, supremo, supremo, primo_state, empty_init, "Novag", "Supremo", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +SYST( 1990, nsnova, 0, 0, snova, snova, primo_state, empty_init, "Novag", "Super Nova (Novag, v1.05)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/novag/snova.cpp b/src/mame/novag/snova.cpp deleted file mode 100644 index ee5fd6c7f0c..00000000000 --- a/src/mame/novag/snova.cpp +++ /dev/null @@ -1,475 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -// thanks-to:Berger, bataais -/******************************************************************************* - -Novag Primo & related chess computers. The chess engine is by David Kittinger. - -NOTE: Turn the power switch off before exiting MAME, otherwise NVRAM won't save -properly. - -TODO: -- if/when MAME supports an exit callback, hook up power-off switch to that -- unmapped reads from 0x3c/0x3d (primo/supremo) or 0x33/0x34 (nsnova) -- supremo unmapped writes to 0x2000/0x6000, always 0? -- is "Aquamarine / Super Nova" the same rom as nsnova and just a redesign? -- is the 1st version of supremo(black plastic) the same ROM? - -BTANB: -- primo has the same bug as nvip, where if the user presses Go right after - entering a move, the CPU opponent will answer by playing a move with white - -================================================================================ - -Novag Primo (model 871) ------------------------ - -Hardware notes: -- PCB label: 100059/100060 -- Hitachi HD6301Y0P (mode 2) @ 8MHz -- 2KB RAM(M5M5118P) -- LCD with 4 digits and custom segments, no LCD chip -- buzzer, 16 LEDs, 8*8 chessboard buttons - -The LCD is the same as the one in VIP / Super VIP. - -================================================================================ - -Novag Supremo (model 881) -------------------------- - -Hardware notes: -- PCB label: 100090 -- Hitachi HD63A03YP @ 8MHz -- 32KB ROM(TC57256AD-12), 2KB RAM(TC5516APL) -- rest is same as Primo - -Supremo also had a "limited edition" rerelease in 1990, plastic is fake-wood -instead of black and backpanel sticker is gold, otherwise it's the same game. -The model number is still 881, ROM is the same as the standard fake-wood version. - -================================================================================ - -Novag Super Nova (model 904) ----------------------------- - -Hardware notes: -- Hitachi HD63A03YP @ 16MHz -- 32KB ROM(TC57256AD-12), 8KB RAM(CXK58648P-10L) -- LCD with 4 digits and custom segments, no LCD chip -- RJ-12 port for Novag Super System (like the one in nsvip/sexpertc) -- buzzer, 16 LEDs, 8*8 chessboard buttons - -Older versions had a bug in the opening moves, always playing B5 after D4. - -The program is very similar to Super VIP, it could be said that Super Nova is -the Super VIP combined with the Novag Super System Touch Sensory board. - -*******************************************************************************/ - -#include "emu.h" - -#include "bus/rs232/rs232.h" -#include "cpu/m6800/m6801.h" -#include "machine/nvram.h" -#include "machine/sensorboard.h" -#include "sound/dac.h" -#include "video/pwm.h" - -#include "screen.h" -#include "speaker.h" - -// internal artwork -#include "novag_primo.lh" -#include "novag_snova.lh" -#include "novag_supremo.lh" - - -namespace { - -class snova_state : public driver_device -{ -public: - snova_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_lcd_pwm(*this, "lcd_pwm"), - m_led_pwm(*this, "led_pwm"), - m_dac(*this, "dac"), - m_rs232(*this, "rs232"), - m_inputs(*this, "IN.%u", 0), - m_out_lcd(*this, "s%u.%u", 0U, 0U) - { } - - void primo(machine_config &config); - void supremo(machine_config &config); - void snova(machine_config &config); - - DECLARE_INPUT_CHANGED_MEMBER(primo_power_off) { if (newval) m_power = false; } - DECLARE_INPUT_CHANGED_MEMBER(snova_power_off); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override { m_power = true; } - -private: - // devices/pointers - required_device m_maincpu; - required_device m_board; - required_device m_lcd_pwm; - required_device m_led_pwm; - required_device m_dac; - optional_device m_rs232; - required_ioport_array<2> m_inputs; - output_finder<4, 10> m_out_lcd; - - bool m_power = false; - bool m_lcd_strobe = false; - u8 m_inp_mux = 0; - u8 m_select = 0; - u8 m_led_data = 0; - - void primo_map(address_map &map); - void supremo_map(address_map &map); - void snova_map(address_map &map); - - // I/O handlers - void standby(int state); - void lcd_pwm_w(offs_t offset, u8 data); - void update_leds(); - - u8 p2_r(); - void p2_w(u8 data); - void p5_w(u8 data); - void p6_w(u8 data); -}; - -void snova_state::machine_start() -{ - m_out_lcd.resolve(); - - // register for savestates - save_item(NAME(m_power)); - save_item(NAME(m_lcd_strobe)); - save_item(NAME(m_inp_mux)); - save_item(NAME(m_select)); - save_item(NAME(m_led_data)); -} - - - -/******************************************************************************* - I/O -*******************************************************************************/ - -// power - -void snova_state::standby(int state) -{ - // clear display - if (state) - { - m_lcd_pwm->clear(); - m_led_pwm->clear(); - } -} - -INPUT_CHANGED_MEMBER(snova_state::snova_power_off) -{ - // NMI at power-off, which will trigger standby mode - if (newval && !m_maincpu->standby()) - m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); -} - - -// misc - -void snova_state::lcd_pwm_w(offs_t offset, u8 data) -{ - m_out_lcd[offset & 0x3f][offset >> 6] = data; -} - -void snova_state::update_leds() -{ - m_led_pwm->matrix(m_select >> 4 & 3, m_led_data); -} - - -// MCU ports - -u8 snova_state::p2_r() -{ - // P20: 4051 Z - u8 data = 0; - - // read chessboard buttons - for (int i = 0; i < 8; i++) - if (BIT(m_led_data, i)) - data |= BIT(m_board->read_file(i), m_inp_mux); - - // read keypad buttons - for (int i = 0; i < 2; i++) - if (BIT(m_select, i + 6)) - data |= BIT(m_inputs[i]->read(), m_inp_mux); - - // P23 (nprimo, supremo): power switch - if (!m_power) - data |= 8; - - // P23 (nsnova): serial rx - if (m_rs232) - data |= m_rs232->rxd_r() << 3; - - return data ^ 1; -} - -void snova_state::p2_w(u8 data) -{ - // P21: 4066 in/out to LCD - if (m_lcd_strobe && ~data & 2) - { - u16 lcd_data = (m_select << 2 & 0x300) | m_led_data; - m_lcd_pwm->matrix(m_select & 0xf, lcd_data); - } - m_lcd_strobe = bool(data & 2); - - // P22: speaker out - m_dac->write(BIT(data, 2)); - - // P24 (nsnova): serial tx (TTL) - if (m_rs232) - m_rs232->write_txd(BIT(data, 4)); - - // P25-P27: 4051 S0-S2 - // 4051 Y0-Y7: multiplexed inputs - m_inp_mux = data >> 5 & 7; -} - -void snova_state::p5_w(u8 data) -{ - // P50-P53: 4066 control to LCD - // P54,P55: led select - // P56,P57: keypad mux, lcd data - m_select = data ^ 0xf0; - update_leds(); -} - -void snova_state::p6_w(u8 data) -{ - // P60-P67: led data, lcd data, chessboard mux - m_led_data = ~data; - update_leds(); -} - - - -/******************************************************************************* - Address Maps -*******************************************************************************/ - -void snova_state::primo_map(address_map &map) -{ - map(0x4000, 0x47ff).ram().share("nvram"); -} - -void snova_state::supremo_map(address_map &map) -{ - primo_map(map); - map(0x8000, 0xffff).rom(); -} - -void snova_state::snova_map(address_map &map) -{ - map(0x4000, 0x5fff).ram().share("nvram"); - map(0x8000, 0xffff).rom(); -} - - - -/******************************************************************************* - Input Ports -*******************************************************************************/ - -static INPUT_PORTS_START( primo ) - PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Trace Back / Next Best") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Trace Forward / Auto Play") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Set Level / Pawn") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Info / Knight") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Easy / Bishop") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Solve Mate / Rook") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Queen") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / King") - - PORT_START("IN.1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Go") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Restore") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Hint") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Clear / Clear Board") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Color") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Verify / Set Up") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Random") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") - - 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, snova_state, primo_power_off, 0) PORT_NAME("Power Off") -INPUT_PORTS_END - -static INPUT_PORTS_START( supremo ) - PORT_INCLUDE( primo ) - - PORT_MODIFY("IN.0") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Easy / Print Moves / Bishop") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Solve Mate / Print Eval / Rook") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Print List / Queen") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / Print Board / King") -INPUT_PORTS_END - - -static INPUT_PORTS_START( snova ) - PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Trace Back / Next Best") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Trace Forward / Auto Play") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Set Level / Pawn") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Info / Echo / Knight") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Easy / Moves / Bishop") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Solve Mate / Language / Rook") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Sound / Game / Queen") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Referee / Board / King") - - PORT_START("IN.1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Go") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Restore") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Hint / Human") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Clear Board / Clear") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Color / Video") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Set Up / Verify") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Random / Auto Clock") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") - - PORT_START("POWER") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, snova_state, snova_power_off, 0) PORT_NAME("Power Off") -INPUT_PORTS_END - - - -/******************************************************************************* - Machine Configs -*******************************************************************************/ - -void snova_state::primo(machine_config &config) -{ - // basic machine hardware - HD6301Y0(config, m_maincpu, 8_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &snova_state::primo_map); - m_maincpu->nvram_enable_backup(true); - m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301y0_cpu_device::nvram_set_battery)); - m_maincpu->standby_cb().append(FUNC(snova_state::standby)); - m_maincpu->in_p2_cb().set(FUNC(snova_state::p2_r)); - m_maincpu->out_p2_cb().set(FUNC(snova_state::p2_w)); - m_maincpu->out_p5_cb().set(FUNC(snova_state::p5_w)); - m_maincpu->out_p6_cb().set(FUNC(snova_state::p6_w)); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - - 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_lcd_pwm).set_size(4, 10); - m_lcd_pwm->output_x().set(FUNC(snova_state::lcd_pwm_w)); - - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); - screen.set_refresh_hz(60); - screen.set_size(1920/4, 606/4); - screen.set_visarea_full(); - - PWM_DISPLAY(config, m_led_pwm).set_size(2, 8); - config.set_default_layout(layout_novag_primo); - - // sound hardware - SPEAKER(config, "speaker").front_center(); - DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); -} - -void snova_state::supremo(machine_config &config) -{ - primo(config); - - // basic machine hardware - HD6303Y(config.replace(), m_maincpu, 8_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &snova_state::supremo_map); - m_maincpu->nvram_enable_backup(true); - m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6303y_cpu_device::nvram_set_battery)); - m_maincpu->standby_cb().append(FUNC(snova_state::standby)); - m_maincpu->in_p2_cb().set(FUNC(snova_state::p2_r)); - m_maincpu->out_p2_cb().set(FUNC(snova_state::p2_w)); - m_maincpu->out_p5_cb().set(FUNC(snova_state::p5_w)); - m_maincpu->out_p6_cb().set(FUNC(snova_state::p6_w)); - - config.set_default_layout(layout_novag_supremo); -} - -void snova_state::snova(machine_config &config) -{ - supremo(config); - - // basic machine hardware - m_maincpu->set_clock(16_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &snova_state::snova_map); - - config.set_default_layout(layout_novag_snova); - - // rs232 (configure after video) - RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); -} - - - -/******************************************************************************* - ROM Definitions -*******************************************************************************/ - -ROM_START( nprimo ) - ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("novag_871_31y0c34p.u1", 0x0000, 0x4000, CRC(ad692d2e) SHA1(f41ae4e02a83ba6446a6df59a6ee2c2f87a1f4d8) ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - - -ROM_START( supremo ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("sp_a10.u5", 0x8000, 0x8000, CRC(1db63786) SHA1(4f24452ed8955b31ba88f68cc95c357660930aa4) ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - - -ROM_START( nsnova ) // ID = N1.05 - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("n_530.u5", 0x8000, 0x8000, CRC(727a0ada) SHA1(129c1edc5c1d2e12ce97ebef81c6d5555464a11d) ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - -} // anonymous namespace - - - -/******************************************************************************* - Drivers -*******************************************************************************/ - -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1987, nprimo, 0, 0, primo, primo, snova_state, empty_init, "Novag", "Primo (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) - -SYST( 1988, supremo, 0, 0, supremo, supremo, snova_state, empty_init, "Novag", "Supremo", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) - -SYST( 1990, nsnova, 0, 0, snova, snova, snova_state, empty_init, "Novag", "Super Nova (Novag, v1.05)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/novag/svip.cpp b/src/mame/novag/svip.cpp deleted file mode 100644 index 92297e4cbd8..00000000000 --- a/src/mame/novag/svip.cpp +++ /dev/null @@ -1,427 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -// thanks-to:Berger -/******************************************************************************* - -Novag VIP & Super VIP - -NOTE: Turn the power switch off before exiting MAME, otherwise NVRAM won't save -properly. - -It's a portable chess computer with keypad input, no embedded chessboard. The -chess engine is similar to other HD6301/3Y ones by David Kittinger. The 'sequels' -of this portable design (Ruby, Sapphire, ..) are on H8. - -TODO: -- if/when MAME supports an exit callback, hook up power-off switch to that -- add Super System peripherals, each has their own MCU -- unmapped reads from 0x3* range, same as snova driver - -BTANB: -- on nvip, if you press GO right after entering a move, it will reply by moving - one of your pieces, taken from the board layout before your move -- just for fun, I'll mention that on many (not all) batches of Super VIP, the - white text label under the Knight button says "Into" instead of "Info" - -================================================================================ - -Novag VIP (aka V.I.P.) (model 872) ----------------------------------- - -Hardware notes: -- PCB label: 100078 -- Hitachi HD6301Y0F (mode 2) @ 8MHz -- 2KB RAM (NEC D449G-15) -- LCD with 4 digits and custom segments, no LCD chip -- 24 buttons, piezo - -The LCD is the same as the one in Primo / Supremo / Super Nova. - -Even though VIP was released first, the functionality of the Super VIP was -already planned according to advertisements. VIP is basically a stripped-down -version, running at lower CPU speed. - -================================================================================ - -Novag Super VIP (aka Super V.I.P.) (model 895) ----------------------------------------------- - -Hardware notes: -- PCB label: 100115 -- Hitachi HD6301Y0F (mode 2) @ 9.83MHz -- 32KB ROM(TC57256AD-12), 2KB RAM(TC5517CFL-20) -- same LCD and button panel as VIP, RJ-12 port - -Super VIP is Novag's first chess computer with a proper serial interface. It -connects to the Novag Super System Distributor, which can then connect to an -external chessboard, TV interface, computer, etc. - -Serial transmission format for Novag Super System is 1 start bit, 8 data bits, -1 stop bit, no parity. On Super VIP, the baud rate is selectable 1200 or 9600, -default 9600 for v3.x, 1200 for v1.x. - -Known official Novag Super System (or compatible) peripherals: -- Super System Chess Board Auto Sensory -- Super System Chess Board Touch Sensory -- Super System TV-Interface -- Universal Electronic Chess Board (aka UCB) - -*******************************************************************************/ - -#include "emu.h" - -#include "bus/rs232/rs232.h" -#include "cpu/m6800/m6801.h" -#include "machine/nvram.h" -#include "machine/sensorboard.h" -#include "sound/dac.h" -#include "video/pwm.h" - -#include "screen.h" -#include "speaker.h" - -// internal artwork -#include "novag_svip.lh" -#include "novag_vip.lh" - - -namespace { - -class svip_state : public driver_device -{ -public: - svip_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_lcd_pwm(*this, "lcd_pwm"), - m_dac(*this, "dac"), - m_rs232(*this, "rs232"), - m_inputs(*this, "IN.%u", 0), - m_out_lcd(*this, "s%u.%u", 0U, 0U) - { } - - void vip(machine_config &config); - void svip(machine_config &config); - - DECLARE_INPUT_CHANGED_MEMBER(power_off) { if (newval) m_power = false; } - DECLARE_CUSTOM_INPUT_MEMBER(power_r) { return m_power ? 1 : 0; } - -protected: - virtual void machine_start() override; - virtual void machine_reset() override { m_power = true; } - -private: - // devices/pointers - required_device m_maincpu; - required_device m_lcd_pwm; - required_device m_dac; - optional_device m_rs232; - required_ioport_array<4> m_inputs; - output_finder<4, 10> m_out_lcd; - - bool m_power = false; - bool m_lcd_strobe = false; - u8 m_inp_mux = 0; - u8 m_select = 0; - - void vip_map(address_map &map); - void svip_map(address_map &map); - - // I/O handlers - void lcd_pwm_w(offs_t offset, u8 data); - u8 p2_r(); - void p2_w(u8 data); - void p5_w(u8 data); - void p6_w(u8 data); -}; - -void svip_state::machine_start() -{ - m_out_lcd.resolve(); - - // register for savestates - save_item(NAME(m_power)); - save_item(NAME(m_lcd_strobe)); - save_item(NAME(m_inp_mux)); - save_item(NAME(m_select)); -} - - - -/******************************************************************************* - I/O -*******************************************************************************/ - -void svip_state::lcd_pwm_w(offs_t offset, u8 data) -{ - m_out_lcd[offset & 0x3f][offset >> 6] = data; -} - -u8 svip_state::p2_r() -{ - u8 data = 0; - - // P20: keyboard lock switch - // P23 (nvip) / P22 (nsvip): power switch - data |= m_inputs[3]->read(); - - // P23 (nsvip): serial rx - if (m_rs232) - data |= m_rs232->rxd_r() ? 0 : 8; - - // P25-P27: multiplexed inputs - for (int i = 0; i < 3; i++) - if (m_inp_mux & m_inputs[i]->read()) - data |= 0x20 << i; - - return ~data; -} - -void svip_state::p2_w(u8 data) -{ - // P21: 4066 in/out to LCD - if (m_lcd_strobe && ~data & 2) - { - u16 lcd_data = (~m_select << 2 & 0x300) | m_inp_mux; - m_lcd_pwm->matrix(m_select & 0xf, lcd_data); - } - m_lcd_strobe = bool(data & 2); - - // P24 (nsvip): serial tx (TTL) - if (m_rs232) - m_rs232->write_txd(BIT(data, 4)); -} - -void svip_state::p5_w(u8 data) -{ - // P50-P53: 4066 control to LCD - // P56,P57: lcd data - m_select = data; - - // P54,P55: speaker out - m_dac->write(data >> 4 & 3); -} - -void svip_state::p6_w(u8 data) -{ - // P60-P67: input mux, lcd data - m_inp_mux = ~data; -} - - - -/******************************************************************************* - Address Maps -*******************************************************************************/ - -void svip_state::vip_map(address_map &map) -{ - map(0x4000, 0x47ff).mirror(0x3800).ram().share("nvram"); -} - -void svip_state::svip_map(address_map &map) -{ - map(0x2000, 0x27ff).mirror(0x1800).ram().share("nvram"); - map(0x4000, 0xbfff).rom().region("eprom", 0); -} - - - -/******************************************************************************* - Input Ports -*******************************************************************************/ - -static INPUT_PORTS_START( vip ) - PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SLASH) PORT_NAME("GO") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_NAME("C/CB") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Verify/Setup") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COLON) PORT_NAME("Random") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("NG") - - PORT_START("IN.1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Left / Nextbest") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_STOP) PORT_NAME("Right / Auto") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Pawn / Level") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("Knight / Info") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Bishop / Easy") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Rook / Solvemate") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Queen / Sound") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("King / Referee") - - PORT_START("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("A 1") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("B 2") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("C 3") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("D 4") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("E 5") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("F 6") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("G 7") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H 8") - - PORT_START("IN.3") - PORT_CONFNAME( 0x01, 0x00, "Keyboard Lock") - PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x01, DEF_STR( On ) ) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(svip_state, power_r) - - 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, svip_state, power_off, 0) PORT_NAME("Power Off") -INPUT_PORTS_END - -static INPUT_PORTS_START( svip ) - PORT_INCLUDE( vip ) - - PORT_MODIFY("IN.0") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore / Replay") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint / Human") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color / Video") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COLON) PORT_NAME("Random / Autoclock") - - PORT_MODIFY("IN.1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Left / Next Best") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_STOP) PORT_NAME("Right / Autoplay") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Pawn / Level") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("Knight / Info / Echo") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Bishop / Easy / Moves") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Rook / Solvemate / Baud") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Queen / Sound / Game") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("King / Referee / Board") - - PORT_MODIFY("IN.3") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(svip_state, power_r) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) -INPUT_PORTS_END - - - -/******************************************************************************* - Machine Configs -*******************************************************************************/ - -void svip_state::vip(machine_config &config) -{ - // basic machine hardware - HD6301Y0(config, m_maincpu, 8_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &svip_state::vip_map); - m_maincpu->nvram_enable_backup(true); - m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301y0_cpu_device::nvram_set_battery)); - m_maincpu->standby_cb().append([this](int state) { if (state) m_lcd_pwm->clear(); }); - m_maincpu->in_p2_cb().set(FUNC(svip_state::p2_r)); - m_maincpu->out_p2_cb().set(FUNC(svip_state::p2_w)); - m_maincpu->out_p5_cb().set(FUNC(svip_state::p5_w)); - m_maincpu->out_p6_cb().set(FUNC(svip_state::p6_w)); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - - // video hardware - PWM_DISPLAY(config, m_lcd_pwm).set_size(4, 10); - m_lcd_pwm->output_x().set(FUNC(svip_state::lcd_pwm_w)); - - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); - screen.set_refresh_hz(60); - screen.set_size(1920/2.5, 606/2.5); - screen.set_visarea_full(); - - config.set_default_layout(layout_novag_vip); - - // sound hardware - SPEAKER(config, "speaker").front_center(); - DAC_2BIT_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.125); -} - -void svip_state::svip(machine_config &config) -{ - vip(config); - - // basic machine hardware - m_maincpu->set_clock(9.8304_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &svip_state::svip_map); - - config.set_default_layout(layout_novag_svip); - - // rs232 (configure after video) - RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); -} - - - -/******************************************************************************* - ROM Definitions -*******************************************************************************/ - -ROM_START( nvip ) - ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("novag_872_31y0c81f", 0x0000, 0x4000, CRC(45f6d397) SHA1(c08ff786bcf8a37baa41a7401adf69a9d1bde81b) ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - - -ROM_START( nsvip ) // serial 7604xx - ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) - - ROM_REGION( 0x8000, "eprom", 0 ) // ID = V3.7 - ROM_LOAD("yellow", 0x4000, 0x4000, CRC(278e98f0) SHA1(a080e2300c90b6daf42fef960642885eb00ee607) ) // no label - ROM_CONTINUE( 0x0000, 0x4000 ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - -ROM_START( nsvipa ) // serial 7569xx - ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) - - ROM_REGION( 0x8000, "eprom", 0 ) // ID = V3.6 - ROM_LOAD("v_117", 0x4000, 0x4000, CRC(2a60a474) SHA1(5dd0a1871fcbbb2a6271f284562a62f98bf9bf93) ) - ROM_CONTINUE( 0x0000, 0x4000 ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - -ROM_START( nsvipb ) // serial 7545xx - ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) - - ROM_REGION( 0x8000, "eprom", 0 ) // ID = V1.03 - ROM_LOAD("sv_111", 0x4000, 0x4000, CRC(4be9a23f) SHA1(1fb8ccec112e485eedd899cbe8c0c2cb99e840a4) ) - ROM_CONTINUE( 0x0000, 0x4000 ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - -ROM_START( nsvipc ) // serial 7524xx - ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) - - ROM_REGION( 0x8000, "eprom", 0 ) // ID = V1.01 - ROM_LOAD("s_vip_920", 0x4000, 0x4000, CRC(6f61b1e1) SHA1(df74a599eb59b113ef60c9fc23f9c603a5de4f9e) ) - ROM_CONTINUE( 0x0000, 0x4000 ) - - ROM_REGION( 36256, "screen", 0 ) - ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) -ROM_END - -} // anonymous namespace - - - -/******************************************************************************* - Drivers -*******************************************************************************/ - -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1987, nvip, 0, 0, vip, vip, svip_state, empty_init, "Novag", "VIP (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) - -SYST( 1989, nsvip, 0, 0, svip, svip, svip_state, empty_init, "Novag", "Super VIP (v3.7)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1989, nsvipa, nsvip, 0, svip, svip, svip_state, empty_init, "Novag", "Super VIP (v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1989, nsvipb, nsvip, 0, svip, svip, svip_state, empty_init, "Novag", "Super VIP (v1.03)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1989, nsvipc, nsvip, 0, svip, svip, svip_state, empty_init, "Novag", "Super VIP (v1.01)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/novag/vip.cpp b/src/mame/novag/vip.cpp new file mode 100644 index 00000000000..6ddc1b9a00d --- /dev/null +++ b/src/mame/novag/vip.cpp @@ -0,0 +1,427 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Berger +/******************************************************************************* + +Novag VIP & Super VIP + +NOTE: Turn the power switch off before exiting MAME, otherwise NVRAM won't save +properly. + +It's a portable chess computer with keypad input, no embedded chessboard. The +chess engine is similar to other HD6301/3Y ones by David Kittinger. The 'sequels' +of this portable design (Ruby, Sapphire, ..) are on H8. + +TODO: +- if/when MAME supports an exit callback, hook up power-off switch to that +- add Super System peripherals, each has their own MCU +- unmapped reads from 0x3* range, same as snova driver + +BTANB: +- on nvip, if you press GO right after entering a move, it will reply by moving + one of your pieces, taken from the board layout before your move +- just for fun, I'll mention that on many (not all) batches of Super VIP, the + white text label under the Knight button says "Into" instead of "Info" + +================================================================================ + +Novag VIP (aka V.I.P.) (model 872) +---------------------------------- + +Hardware notes: +- PCB label: 100078 +- Hitachi HD6301Y0F (mode 2) @ 8MHz +- 2KB RAM (NEC D449G-15) +- LCD with 4 digits and custom segments, no LCD chip +- 24 buttons, piezo + +The LCD is the same as the one in Primo / Supremo / Super Nova. + +Even though VIP was released first, the functionality of the Super VIP was +already planned according to advertisements. VIP is basically a stripped-down +version, running at lower CPU speed. + +================================================================================ + +Novag Super VIP (aka Super V.I.P.) (model 895) +---------------------------------------------- + +Hardware notes: +- PCB label: 100115 +- Hitachi HD6301Y0F (mode 2) @ 9.83MHz +- 32KB ROM(TC57256AD-12), 2KB RAM(TC5517CFL-20) +- same LCD and button panel as VIP, RJ-12 port + +Super VIP is Novag's first chess computer with a proper serial interface. It +connects to the Novag Super System Distributor, which can then connect to an +external chessboard, TV interface, computer, etc. + +Serial transmission format for Novag Super System is 1 start bit, 8 data bits, +1 stop bit, no parity. On Super VIP, the baud rate is selectable 1200 or 9600, +default 9600 for v3.x, 1200 for v1.x. + +Known official Novag Super System (or compatible) peripherals: +- Super System Chess Board Auto Sensory +- Super System Chess Board Touch Sensory +- Super System TV-Interface +- Universal Electronic Chess Board (aka UCB) + +*******************************************************************************/ + +#include "emu.h" + +#include "bus/rs232/rs232.h" +#include "cpu/m6800/m6801.h" +#include "machine/nvram.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "video/pwm.h" + +#include "screen.h" +#include "speaker.h" + +// internal artwork +#include "novag_svip.lh" +#include "novag_vip.lh" + + +namespace { + +class vip_state : public driver_device +{ +public: + vip_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_lcd_pwm(*this, "lcd_pwm"), + m_dac(*this, "dac"), + m_rs232(*this, "rs232"), + m_inputs(*this, "IN.%u", 0), + m_out_lcd(*this, "s%u.%u", 0U, 0U) + { } + + void vip(machine_config &config); + void svip(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(power_off) { if (newval) m_power = false; } + DECLARE_CUSTOM_INPUT_MEMBER(power_r) { return m_power ? 1 : 0; } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override { m_power = true; } + +private: + // devices/pointers + required_device m_maincpu; + required_device m_lcd_pwm; + required_device m_dac; + optional_device m_rs232; + required_ioport_array<4> m_inputs; + output_finder<4, 10> m_out_lcd; + + bool m_power = false; + bool m_lcd_strobe = false; + u8 m_inp_mux = 0; + u8 m_select = 0; + + void vip_map(address_map &map); + void svip_map(address_map &map); + + // I/O handlers + void lcd_pwm_w(offs_t offset, u8 data); + u8 p2_r(); + void p2_w(u8 data); + void p5_w(u8 data); + void p6_w(u8 data); +}; + +void vip_state::machine_start() +{ + m_out_lcd.resolve(); + + // register for savestates + save_item(NAME(m_power)); + save_item(NAME(m_lcd_strobe)); + save_item(NAME(m_inp_mux)); + save_item(NAME(m_select)); +} + + + +/******************************************************************************* + I/O +*******************************************************************************/ + +void vip_state::lcd_pwm_w(offs_t offset, u8 data) +{ + m_out_lcd[offset & 0x3f][offset >> 6] = data; +} + +u8 vip_state::p2_r() +{ + u8 data = 0; + + // P20: keyboard lock switch + // P23 (nvip) / P22 (nsvip): power switch + data |= m_inputs[3]->read(); + + // P23 (nsvip): serial rx + if (m_rs232) + data |= m_rs232->rxd_r() ? 0 : 8; + + // P25-P27: multiplexed inputs + for (int i = 0; i < 3; i++) + if (m_inp_mux & m_inputs[i]->read()) + data |= 0x20 << i; + + return ~data; +} + +void vip_state::p2_w(u8 data) +{ + // P21: 4066 in/out to LCD + if (m_lcd_strobe && ~data & 2) + { + u16 lcd_data = (~m_select << 2 & 0x300) | m_inp_mux; + m_lcd_pwm->matrix(m_select & 0xf, lcd_data); + } + m_lcd_strobe = bool(data & 2); + + // P24 (nsvip): serial tx (TTL) + if (m_rs232) + m_rs232->write_txd(BIT(data, 4)); +} + +void vip_state::p5_w(u8 data) +{ + // P50-P53: 4066 control to LCD + // P56,P57: lcd data + m_select = data; + + // P54,P55: speaker out + m_dac->write(data >> 4 & 3); +} + +void vip_state::p6_w(u8 data) +{ + // P60-P67: input mux, lcd data + m_inp_mux = ~data; +} + + + +/******************************************************************************* + Address Maps +*******************************************************************************/ + +void vip_state::vip_map(address_map &map) +{ + map(0x4000, 0x47ff).mirror(0x3800).ram().share("nvram"); +} + +void vip_state::svip_map(address_map &map) +{ + map(0x2000, 0x27ff).mirror(0x1800).ram().share("nvram"); + map(0x4000, 0xbfff).rom().region("eprom", 0); +} + + + +/******************************************************************************* + Input Ports +*******************************************************************************/ + +static INPUT_PORTS_START( vip ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SLASH) PORT_NAME("GO") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_NAME("C/CB") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Verify/Setup") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COLON) PORT_NAME("Random") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("NG") + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Left / Nextbest") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_STOP) PORT_NAME("Right / Auto") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Pawn / Level") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("Knight / Info") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Bishop / Easy") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Rook / Solvemate") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Queen / Sound") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("King / Referee") + + PORT_START("IN.2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("A 1") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("B 2") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("C 3") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("D 4") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("E 5") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("F 6") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("G 7") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H 8") + + PORT_START("IN.3") + PORT_CONFNAME( 0x01, 0x00, "Keyboard Lock") + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x01, DEF_STR( On ) ) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(vip_state, power_r) + + 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, vip_state, power_off, 0) PORT_NAME("Power Off") +INPUT_PORTS_END + +static INPUT_PORTS_START( svip ) + PORT_INCLUDE( vip ) + + PORT_MODIFY("IN.0") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore / Replay") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint / Human") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color / Video") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COLON) PORT_NAME("Random / Autoclock") + + PORT_MODIFY("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Left / Next Best") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_STOP) PORT_NAME("Right / Autoplay") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Pawn / Level") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("Knight / Info / Echo") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Bishop / Easy / Moves") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Rook / Solvemate / Baud") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Queen / Sound / Game") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("King / Referee / Board") + + PORT_MODIFY("IN.3") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(vip_state, power_r) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) +INPUT_PORTS_END + + + +/******************************************************************************* + Machine Configs +*******************************************************************************/ + +void vip_state::vip(machine_config &config) +{ + // basic machine hardware + HD6301Y0(config, m_maincpu, 8_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &vip_state::vip_map); + m_maincpu->nvram_enable_backup(true); + m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301y0_cpu_device::nvram_set_battery)); + m_maincpu->standby_cb().append([this](int state) { if (state) m_lcd_pwm->clear(); }); + m_maincpu->in_p2_cb().set(FUNC(vip_state::p2_r)); + m_maincpu->out_p2_cb().set(FUNC(vip_state::p2_w)); + m_maincpu->out_p5_cb().set(FUNC(vip_state::p5_w)); + m_maincpu->out_p6_cb().set(FUNC(vip_state::p6_w)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + // video hardware + PWM_DISPLAY(config, m_lcd_pwm).set_size(4, 10); + m_lcd_pwm->output_x().set(FUNC(vip_state::lcd_pwm_w)); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_refresh_hz(60); + screen.set_size(1920/2.5, 606/2.5); + screen.set_visarea_full(); + + config.set_default_layout(layout_novag_vip); + + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_2BIT_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.125); +} + +void vip_state::svip(machine_config &config) +{ + vip(config); + + // basic machine hardware + m_maincpu->set_clock(9.8304_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &vip_state::svip_map); + + config.set_default_layout(layout_novag_svip); + + // rs232 (configure after video) + RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); +} + + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + +ROM_START( nvip ) + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD("novag_872_31y0c81f", 0x0000, 0x4000, CRC(45f6d397) SHA1(c08ff786bcf8a37baa41a7401adf69a9d1bde81b) ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + + +ROM_START( nsvip ) // serial 7604xx + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) + + ROM_REGION( 0x8000, "eprom", 0 ) // ID = V3.7 + ROM_LOAD("yellow", 0x4000, 0x4000, CRC(278e98f0) SHA1(a080e2300c90b6daf42fef960642885eb00ee607) ) // no label + ROM_CONTINUE( 0x0000, 0x4000 ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + +ROM_START( nsvipa ) // serial 7569xx + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) + + ROM_REGION( 0x8000, "eprom", 0 ) // ID = V3.6 + ROM_LOAD("v_117", 0x4000, 0x4000, CRC(2a60a474) SHA1(5dd0a1871fcbbb2a6271f284562a62f98bf9bf93) ) + ROM_CONTINUE( 0x0000, 0x4000 ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + +ROM_START( nsvipb ) // serial 7545xx + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) + + ROM_REGION( 0x8000, "eprom", 0 ) // ID = V1.03 + ROM_LOAD("sv_111", 0x4000, 0x4000, CRC(4be9a23f) SHA1(1fb8ccec112e485eedd899cbe8c0c2cb99e840a4) ) + ROM_CONTINUE( 0x0000, 0x4000 ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + +ROM_START( nsvipc ) // serial 7524xx + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD("novag_895_31y0rk75f", 0x0000, 0x4000, CRC(11a3894e) SHA1(fa455181043ac3ee89412aae563171d87ac55596) ) + + ROM_REGION( 0x8000, "eprom", 0 ) // ID = V1.01 + ROM_LOAD("s_vip_920", 0x4000, 0x4000, CRC(6f61b1e1) SHA1(df74a599eb59b113ef60c9fc23f9c603a5de4f9e) ) + ROM_CONTINUE( 0x0000, 0x4000 ) + + ROM_REGION( 36256, "screen", 0 ) + ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) ) +ROM_END + +} // anonymous namespace + + + +/******************************************************************************* + Drivers +*******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1987, nvip, 0, 0, vip, vip, vip_state, empty_init, "Novag", "VIP (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +SYST( 1989, nsvip, 0, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v3.7)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1989, nsvipa, nsvip, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1989, nsvipb, nsvip, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v1.03)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1989, nsvipc, nsvip, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v1.01)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -- cgit v1.2.3