From 265d3f607c5a2f9d629e1cde8027e51532b8edc3 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 21 Apr 2023 17:09:55 +0200 Subject: New systems marked not working ------------------------------ King Kong (Tiger, Quartz Game Clock) [hap, Sean Riddle] Lucky Luke (Tiger, Double Wide Screen) [hap, Sean Riddle] --- src/devices/cpu/tms1000/tms0970.cpp | 2 +- src/mame/handheld/hh_cop400.cpp | 12 +- src/mame/handheld/hh_hmcs40.cpp | 12 +- src/mame/handheld/hh_melps4.cpp | 6 +- src/mame/handheld/hh_pic16.cpp | 10 +- src/mame/handheld/hh_smc1k.cpp | 328 ++++++++++++++++++++++++++++++++++++ src/mame/handheld/hh_tms1k.cpp | 10 +- src/mame/handheld/hh_ucom4.cpp | 10 +- src/mame/layout/hh_smc1k_test.lay | 36 ++++ src/mame/mame.lst | 4 + src/mame/namco/namcos22.cpp | 2 +- 11 files changed, 400 insertions(+), 32 deletions(-) create mode 100644 src/mame/handheld/hh_smc1k.cpp create mode 100644 src/mame/layout/hh_smc1k_test.lay diff --git a/src/devices/cpu/tms1000/tms0970.cpp b/src/devices/cpu/tms1000/tms0970.cpp index 258e33efd86..16ae5f1969b 100644 --- a/src/devices/cpu/tms1000/tms0970.cpp +++ b/src/devices/cpu/tms1000/tms0970.cpp @@ -91,7 +91,7 @@ void tms0970_cpu_device::device_reset() if (imask & 0x40 && (imask & 0x20) == 0) msel = (op & 0xf) | (op >> 1 & 0x10); - msel = bitswap<8>(msel,7,6,5,0,1,2,3,4); // lines are reversed + msel = bitswap<5>(msel,0,1,2,3,4); // lines are reversed u32 mmask = m_mpla->read(msel); mmask ^= 0x09fe; // invert active-negative diff --git a/src/mame/handheld/hh_cop400.cpp b/src/mame/handheld/hh_cop400.cpp index 89bbaa5e978..1f8faa5a8f9 100644 --- a/src/mame/handheld/hh_cop400.cpp +++ b/src/mame/handheld/hh_cop400.cpp @@ -81,12 +81,12 @@ protected: optional_ioport_array<6> m_inputs; // max 6 // misc common - u8 m_l = 0; // MCU port L write data - u8 m_g = 0; // MCU port G write data - u8 m_d = 0; // MCU port D write data - int m_so = 0; // MCU SO line state - int m_sk = 0; // MCU SK line state - u16 m_inp_mux = ~0; // multiplexed inputs mask + u8 m_l = 0; // MCU port L write data + u8 m_g = 0; // MCU port G write data + u8 m_d = 0; // MCU port D write data + int m_so = 0; // MCU SO line state + int m_sk = 0; // MCU SK line state + u16 m_inp_mux = ~0; // multiplexed inputs mask u16 read_inputs(int columns, u16 colmask = ~0); void set_power(bool state); diff --git a/src/mame/handheld/hh_hmcs40.cpp b/src/mame/handheld/hh_hmcs40.cpp index 01a3312d92a..1558f996d0b 100644 --- a/src/mame/handheld/hh_hmcs40.cpp +++ b/src/mame/handheld/hh_hmcs40.cpp @@ -175,13 +175,13 @@ protected: optional_ioport_array<7> m_inputs; // max 7 // misc common - u8 m_r[8] = { }; // MCU R ports write data (optional) - u16 m_d = 0; // MCU D port write data (optional) - u8 m_int[2] = { }; // MCU INT0/1 pins state - u16 m_inp_mux = 0; // multiplexed inputs mask + u8 m_r[8] = { }; // MCU R ports write data (optional) + u16 m_d = 0; // MCU D port write data (optional) + u8 m_int[2] = { }; // MCU INT0/1 pins state + u16 m_inp_mux = 0; // multiplexed inputs mask - u32 m_grid = 0; // VFD current row data - u64 m_plate = 0; // VFD current column data + u32 m_grid = 0; // VFD current row data + u64 m_plate = 0; // VFD current column data u16 read_inputs(int columns); void refresh_interrupts(void); diff --git a/src/mame/handheld/hh_melps4.cpp b/src/mame/handheld/hh_melps4.cpp index 9b2c92e6523..ac884e346f3 100644 --- a/src/mame/handheld/hh_melps4.cpp +++ b/src/mame/handheld/hh_melps4.cpp @@ -49,10 +49,10 @@ protected: optional_ioport_array<4> m_inputs; // max 4 // misc common - u16 m_inp_mux = 0; // multiplexed inputs mask + u16 m_inp_mux = 0; // multiplexed inputs mask - u32 m_grid = 0; // VFD current row data - u32 m_plate = 0; // VFD current column data + u32 m_grid = 0; // VFD current row data + u32 m_plate = 0; // VFD current column data u8 read_inputs(int columns); }; diff --git a/src/mame/handheld/hh_pic16.cpp b/src/mame/handheld/hh_pic16.cpp index 7eaa6095407..659aebaa272 100644 --- a/src/mame/handheld/hh_pic16.cpp +++ b/src/mame/handheld/hh_pic16.cpp @@ -115,11 +115,11 @@ protected: optional_ioport_array<6> m_inputs; // max 6 // misc common - u8 m_a = 0; // MCU port A write data - u8 m_b = 0; // " B - u8 m_c = 0; // " C - u8 m_d = 0; // " D - u16 m_inp_mux = ~0; // multiplexed inputs mask + u8 m_a = 0; // MCU port A write data + u8 m_b = 0; // " B + u8 m_c = 0; // " C + u8 m_d = 0; // " D + u16 m_inp_mux = ~0; // multiplexed inputs mask u16 read_inputs(int columns, u16 colmask = ~0); u8 read_rotated_inputs(int columns, u8 rowmask = ~0); diff --git a/src/mame/handheld/hh_smc1k.cpp b/src/mame/handheld/hh_smc1k.cpp new file mode 100644 index 00000000000..16915d722c5 --- /dev/null +++ b/src/mame/handheld/hh_smc1k.cpp @@ -0,0 +1,328 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Sean Riddle +/******************************************************************************* + +Suwa Seikosha (S-MOS) SMC11xx handhelds +Some LCD games with this MCU, and perhaps early-80s Seiko wristwatches too. + +Before Tiger's 78-xxx series (hh_sm510.cpp), they released their games in Europe +through different publishers, eg. Orlitronic in France, Virca in Italy. + +TODO: +- add common mcfg (like hh_sm510) when more games are added? +- add svg for: tkkongq, tlluke2 + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/tms1000/smc1102.h" +#include "sound/spkrdev.h" + +#include "screen.h" +#include "speaker.h" + +#include "hh_smc1k_test.lh" // common test-layout - no svg artwork(yet), use external artwork + + +namespace { + +class hh_smc1k_state : public driver_device +{ +public: + hh_smc1k_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_speaker(*this, "speaker"), + m_inputs(*this, "IN.%u", 0), + m_out_x(*this, "%u.%u", 0U, 0U) + { } + + virtual DECLARE_INPUT_CHANGED_MEMBER(acl_button); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + // devices + required_device m_maincpu; + optional_device m_speaker; + optional_ioport_array<4> m_inputs; // max 4 + output_finder<4, 32> m_out_x; + + virtual void write_segs(offs_t offset, u32 data); + u8 read_inputs(int columns); + + u8 m_inp_mux = 0; +}; + + +// machine start/reset + +void hh_smc1k_state::machine_start() +{ + // resolve handlers + m_out_x.resolve(); + + // register for savestates + save_item(NAME(m_inp_mux)); +} + +void hh_smc1k_state::machine_reset() +{ +} + + + +/******************************************************************************* + + Helper Functions + +*******************************************************************************/ + +// LCD screen + +void hh_smc1k_state::write_segs(offs_t offset, u32 data) +{ + for (int i = 0; i < 32; i++) + { + // 4*32 segments + m_out_x[offset & 3][i] = data & 1; + data >>= 1; + } +} + + +// generic input handlers + +u8 hh_smc1k_state::read_inputs(int columns) +{ + u8 ret = 0; + + // read selected input rows + for (int i = 0; i < columns; i++) + if (m_inp_mux >> i & 1) + ret |= m_inputs[i]->read(); + + return ret; +} + +INPUT_CHANGED_MEMBER(hh_smc1k_state::acl_button) +{ + // for when an input is directly tied to MCU INIT pin + m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); +} + + + +/******************************************************************************* + + Minidrivers (subclass, I/O, Inputs, Machine Config, ROM Defs) + +*******************************************************************************/ + +/******************************************************************************* + + Tiger King Kong (model 7-721) + * PCB label: TG-LC003 + * SMC1112 under epoxy (die label: SMC1112 D0W0) + * lcd screen with custom segments, 1-bit sound + + Pyramid is suspected to have the same ROM as this. + + This is the "Quartz Game Clock" version. Tiger also released King Kong on + several older LCD series. + +*******************************************************************************/ + +class tkkongq_state : public hh_smc1k_state +{ +public: + tkkongq_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_smc1k_state(mconfig, type, tag) + { } + + void tkkongq(machine_config &config); + +private: + void write_r(u32 data); + void write_o(u16 data); + u8 read_k(); +}; + +// handlers + +void tkkongq_state::write_r(u32 data) +{ + // R0,R1: input mux + m_inp_mux = data & 3; + + // R7: speaker out + m_speaker->level_w(BIT(data, 7)); +} + +u8 tkkongq_state::read_k() +{ + // K: multiplexed inputs + return read_inputs(2); +} + +// inputs + +static INPUT_PORTS_START( tkkongq ) + PORT_START("IN.0") // R0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_16WAY + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_16WAY + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_16WAY + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_16WAY + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Mode") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Game A") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Game B") + + PORT_START("ACL") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, tkkongq_state, acl_button, 0) PORT_NAME("Set") +INPUT_PORTS_END + +// config + +void tkkongq_state::tkkongq(machine_config &config) +{ + // basic machine hardware + SMC1112(config, m_maincpu, 32.768_kHz_XTAL); + m_maincpu->write_r().set(FUNC(tkkongq_state::write_r)); + m_maincpu->read_k().set(FUNC(tkkongq_state::read_k)); + m_maincpu->write_segs().set(FUNC(tkkongq_state::write_segs)); + + // video hardware + config.set_default_layout(layout_hh_smc1k_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( tkkongq ) + ROM_REGION( 0x0800, "maincpu", 0 ) + ROM_LOAD( "smc1112_d0w0", 0x0000, 0x0800, CRC(77ff7a01) SHA1(ed5dc860e400dc11518b0a32f13879e143c17953) ) +ROM_END + + + + + +/******************************************************************************* + + Tiger Lucky Luke (model 7-???) + * PCB label: REV 0, ET820, MM + * SMC1112 under epoxy (die label: SMC1112 D2A0) + * lcd screen with custom segments, 1-bit sound + + Mickey Mouse is suspected to have the same ROM as this. + + This is the "Double Wide Screen" version, there's also a "Large Screen" one. + +*******************************************************************************/ + +class tlluke2_state : public hh_smc1k_state +{ +public: + tlluke2_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_smc1k_state(mconfig, type, tag) + { } + + void tlluke2(machine_config &config); + +private: + void write_r(u32 data); + void write_o(u16 data); + u8 read_k(); +}; + +// handlers + +void tlluke2_state::write_r(u32 data) +{ + // R0-R2: input mux + m_inp_mux = data & 7; + + // R7: speaker out + m_speaker->level_w(BIT(data, 7)); +} + +u8 tlluke2_state::read_k() +{ + // K: multiplexed inputs + return read_inputs(3); +} + +// inputs + +static INPUT_PORTS_START( tlluke2 ) + PORT_START("IN.0") // R0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Mode") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Game A") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Game B") + + PORT_START("IN.1") // R1 + PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Jump/Open + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_START("ACL") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, tlluke2_state, acl_button, 0) PORT_NAME("ACL") +INPUT_PORTS_END + +// config + +void tlluke2_state::tlluke2(machine_config &config) +{ + // basic machine hardware + SMC1112(config, m_maincpu, 32.768_kHz_XTAL); + m_maincpu->write_r().set(FUNC(tlluke2_state::write_r)); + m_maincpu->read_k().set(FUNC(tlluke2_state::read_k)); + m_maincpu->write_segs().set(FUNC(tlluke2_state::write_segs)); + + // video hardware + config.set_default_layout(layout_hh_smc1k_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( tlluke2 ) + ROM_REGION( 0x0800, "maincpu", 0 ) + ROM_LOAD( "smc1112_d2a0", 0x0000, 0x0800, CRC(73df08ff) SHA1(8ddf058e74e07364ab702e01f1cecb5fdb22133f) ) +ROM_END + + + +} // anonymous namespace + +/******************************************************************************* + + Game driver(s) + +*******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS + +// Tiger Quartz Game Clock +SYST( 1982, tkkongq, 0, 0, tkkongq, tkkongq, tkkongq_state, empty_init, "Tiger Electronics", "King Kong (Tiger, Quartz Game Clock)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) + +// Tiger Double Wide Screen +SYST( 1984, tlluke2, 0, 0, tlluke2, tlluke2, tlluke2_state, empty_init, "Tiger Electronics", "Lucky Luke (Tiger, Double Wide Screen)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) diff --git a/src/mame/handheld/hh_tms1k.cpp b/src/mame/handheld/hh_tms1k.cpp index d1d29633de1..59908a98164 100644 --- a/src/mame/handheld/hh_tms1k.cpp +++ b/src/mame/handheld/hh_tms1k.cpp @@ -383,13 +383,13 @@ protected: output_finder<> m_out_power; // power state, eg. led // misc common - u32 m_r = 0U; // MCU R-pins data - u16 m_o = 0U; // MCU O-pins data - u32 m_inp_mux = 0U; // multiplexed inputs mask + u32 m_r = 0U; // MCU R-pins data + u16 m_o = 0U; // MCU O-pins data + u32 m_inp_mux = 0U; // multiplexed inputs mask bool m_power_on = false; - u32 m_grid = 0U; // VFD/LED current row data - u32 m_plate = 0U; // VFD/LED current column data + u32 m_grid = 0U; // VFD/LED current row data + u32 m_plate = 0U; // VFD/LED current column data u8 read_inputs(int columns); u8 read_rotated_inputs(int columns, u8 rowmask = 0xf); diff --git a/src/mame/handheld/hh_ucom4.cpp b/src/mame/handheld/hh_ucom4.cpp index c9c598636a6..d3ce0178850 100644 --- a/src/mame/handheld/hh_ucom4.cpp +++ b/src/mame/handheld/hh_ucom4.cpp @@ -143,12 +143,12 @@ protected: optional_ioport_array<6> m_inputs; // max 6 // misc common - u8 m_port[9] = { }; // MCU port A-I write data (optional) - u8 m_int = 0; // MCU INT pin state - u16 m_inp_mux = 0; // multiplexed inputs mask + u8 m_port[9] = { }; // MCU port A-I write data (optional) + u8 m_int = 0; // MCU INT pin state + u16 m_inp_mux = 0; // multiplexed inputs mask - u32 m_grid = 0; // VFD current row data - u32 m_plate = 0; // VFD current column data + u32 m_grid = 0; // VFD current row data + u32 m_plate = 0; // VFD current column data u8 read_inputs(int columns); void refresh_interrupts(void); diff --git a/src/mame/layout/hh_smc1k_test.lay b/src/mame/layout/hh_smc1k_test.lay new file mode 100644 index 00000000000..384d4958b9c --- /dev/null +++ b/src/mame/layout/hh_smc1k_test.lay @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 3155b3c6fc2..29030f74b3e 100755 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -18905,6 +18905,10 @@ txmenpx // Tiger vespovar // Elektronika vfutbol // Elektronika +@source:handheld/hh_smc1k.cpp +tkkongq // Tiger +tlluke2 // Tiger + @source:handheld/hh_tms1k.cpp alphie // Playskool arcmania // Milton Bradley diff --git a/src/mame/namco/namcos22.cpp b/src/mame/namco/namcos22.cpp index 88876febb63..519a0f7d7fd 100644 --- a/src/mame/namco/namcos22.cpp +++ b/src/mame/namco/namcos22.cpp @@ -5425,7 +5425,7 @@ ROM_START( alpines ) ROM_LOAD( "af1wavea.2l", 0x000000, 0x400000, CRC(28cca494) SHA1(4ff87ab85fd17bf8dbee5b03d99cc5c31dd6349a) ) ROM_END -ROM_START( alpinesa ) // only 4 different DWORDs at 0x700, pretty certain it's the serial number +ROM_START( alpinesa ) // only 4 different DWORDs at 0x700, it's either a serial number, or a log from when Namco serviced the cabinet ROM_REGION( 0x800000, "maincpu", 0 ) /* main program */ ROM_LOAD32_BYTE( "af2ver-a_ll.ic2", 0x000003, 0x200000, CRC(d8025e98) SHA1(e1c08557e70d632bf1e99356d6c6f76b5f407b8f) ) ROM_LOAD32_BYTE( "af2ver-a_lm.ic3", 0x000002, 0x200000, CRC(5f805d51) SHA1(b7fa9028deeaf1c549e9c2d6099925a0d0ad1598) ) -- cgit v1.2.3