From 6a91b86301735847652fe99e5df1a211169e1cea Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 20 Mar 2022 20:51:35 +0100 Subject: New machines marked as NOT_WORKING ---------------------------------- 18R (Rockwell) [hap, Sean Riddle] --- scripts/target/mame/mess.lua | 1 + src/devices/cpu/b5000/b5000.cpp | 5 +- src/devices/cpu/b5000/b6100.cpp | 4 +- src/mame/drivers/hh_b5000.cpp | 225 ++++++++++++++++++++++++++++++++++++++ src/mame/layout/hh_b5000_test.lay | 36 ++++++ src/mame/layout/rw18r.lay | 21 ++++ src/mame/mame.lst | 3 + src/mame/mess.flt | 1 + 8 files changed, 293 insertions(+), 3 deletions(-) create mode 100644 src/mame/drivers/hh_b5000.cpp create mode 100644 src/mame/layout/hh_b5000_test.lay create mode 100644 src/mame/layout/rw18r.lay diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 63413ecf81b..30b1ff15c98 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -3589,6 +3589,7 @@ files { MAME_DIR .. "src/mame/includes/aim65.h", MAME_DIR .. "src/mame/machine/aim65.cpp", MAME_DIR .. "src/mame/drivers/aim65_40.cpp", + MAME_DIR .. "src/mame/drivers/hh_b5000.cpp", MAME_DIR .. "src/mame/drivers/hh_pps41.cpp", } diff --git a/src/devices/cpu/b5000/b5000.cpp b/src/devices/cpu/b5000/b5000.cpp index 491fc470095..f1f94120fef 100644 --- a/src/devices/cpu/b5000/b5000.cpp +++ b/src/devices/cpu/b5000/b5000.cpp @@ -5,6 +5,8 @@ Rockwell B5000 MCU TODO: +- only one device dumped (Rockwell 8R) and it doesn't work at all +- is unmapped ram mirrored? (that goes for subdevices too) - fix digit segment decoder, there should be a minus sign in it */ @@ -31,7 +33,8 @@ b5000_cpu_device::b5000_cpu_device(const machine_config &mconfig, const char *ta // internal memory maps void b5000_cpu_device::program_448x8(address_map &map) { - map(0x000, 0x1ff).rom(); + map(0x000, 0x07f).rom(); + map(0x0c0, 0x1ff).rom(); } void b5000_cpu_device::data_45x4(address_map &map) diff --git a/src/devices/cpu/b5000/b6100.cpp b/src/devices/cpu/b5000/b6100.cpp index 3654e54b996..879026d9061 100644 --- a/src/devices/cpu/b5000/b6100.cpp +++ b/src/devices/cpu/b5000/b6100.cpp @@ -51,13 +51,13 @@ std::unique_ptr b6100_cpu_device::create_disassembler() // digit segment decoder u16 b6100_cpu_device::decode_digit(u8 data) { - static u8 lut_segs[0x10] = + static u16 lut_segs[0x10] = { // 0-9 same as B5000 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, // EFG, BCG, none, SEG8, SEG9, SEG10 - 0x70, 0x46, 0x00, 0x08, 0x10, 0x20 + 0x70, 0x46, 0x00, 0x80, 0x100, 0x200 }; return lut_segs[data & 0xf]; } diff --git a/src/mame/drivers/hh_b5000.cpp b/src/mame/drivers/hh_b5000.cpp new file mode 100644 index 00000000000..01d089ecc84 --- /dev/null +++ b/src/mame/drivers/hh_b5000.cpp @@ -0,0 +1,225 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Sean Riddle +/*************************************************************************** + +Rockwell B5000 MCU series handhelds (before PPS-4/1) +Mostly calculators on these MCUs, but also Mattel's first couple of handhelds. + +ROM source notes when dumped from another model, but confident it's the same: +- rw18r: Rockwell 8R + +TODO: +- figure out why rw18r doesn't work (ROM dump is good) + +***************************************************************************/ + +#include "emu.h" + +#include "cpu/b5000/b5000.h" +#include "cpu/b5000/b6000.h" +#include "cpu/b5000/b6100.h" +#include "video/pwm.h" +#include "sound/spkrdev.h" + +#include "speaker.h" + +// internal artwork +#include "rw18r.lh" + +//#include "hh_b5000_test.lh" // common test-layout - use external artwork + + +class hh_b5000_state : public driver_device +{ +public: + hh_b5000_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_display(*this, "display"), + m_speaker(*this, "speaker"), + m_inputs(*this, "IN.%u", 0) + { } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + // devices + required_device m_maincpu; + optional_device m_display; + optional_device m_speaker; + optional_ioport_array<5> m_inputs; // max 5 + + u16 m_inp_mux = 0; + + // MCU output pin state + u16 m_str = 0; + u16 m_seg = 0; + + u8 read_inputs(int columns); +}; + + +// machine start/reset + +void hh_b5000_state::machine_start() +{ + // register for savestates + save_item(NAME(m_inp_mux)); + save_item(NAME(m_str)); + save_item(NAME(m_seg)); +} + +void hh_b5000_state::machine_reset() +{ +} + + + +/*************************************************************************** + + Helper Functions + +***************************************************************************/ + +// generic input handlers + +u8 hh_b5000_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; +} + + + +/*************************************************************************** + + Minidrivers (subclass, I/O, Inputs, Machine Config, ROM Defs) + +***************************************************************************/ + +namespace { + +/*************************************************************************** + + Rockwell 8R, Rockwell 18R + * B5000 MCU (label B5000CC) + * 8-digit 7seg display + + This MCU was used in Rockwell 8R, 18R, and 9TR. It was also sold by + Tandy (Radio Shack) as EC-220. + +***************************************************************************/ + +class rw18r_state : public hh_b5000_state +{ +public: + rw18r_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_b5000_state(mconfig, type, tag) + { } + + void rw18r(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); + u8 read_kb(); +}; + +// handlers + +void rw18r_state::write_str(u16 data) +{ + // STR0-STR7: digit select + // STR4-STR8: input mux + m_display->write_my(data); + m_inp_mux = data >> 4; +} + +void rw18r_state::write_seg(u16 data) +{ + // SEG0-SEG7: digit segment data + m_display->write_mx(bitswap<8>(data,0,7,6,5,4,3,2,1)); +} + +u8 rw18r_state::read_kb() +{ + // KB: multiplexed inputs + return read_inputs(5); +} + +// config + +static INPUT_PORTS_START( rw18r ) + PORT_START("IN.0") // STR4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE/C") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + + PORT_START("IN.1") // STR5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + + PORT_START("IN.2") // STR6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"×") + + PORT_START("IN.3") // STR7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") + + PORT_START("IN.4") // STR8 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("STO") // unpopulated on 8R + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("RCL") // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("%") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") +INPUT_PORTS_END + +void rw18r_state::rw18r(machine_config &config) +{ + // basic machine hardware + B5000(config, m_maincpu, 240000); // approximation + m_maincpu->write_str().set(FUNC(rw18r_state::write_str)); + m_maincpu->write_seg().set(FUNC(rw18r_state::write_seg)); + m_maincpu->read_kb().set(FUNC(rw18r_state::read_kb)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(8, 8); + m_display->set_segmask(0xff, 0xff); + config.set_default_layout(layout_rw18r); +} + +// roms + +ROM_START( rw18r ) + ROM_REGION( 0x200, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "b5000cc", 0x000, 0x080, CRC(ace32614) SHA1(23cf11acf2e73ce2dfc165cb87f86fab15f69ff7) ) + ROM_CONTINUE( 0x0c0, 0x140 ) +ROM_END + + + +} // anonymous namespace + +/*************************************************************************** + + Game driver(s) + +***************************************************************************/ + +// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +CONS( 1975, rw18r, 0, 0, rw18r, rw18r, rw18r_state, empty_init, "Rockwell", "18R (Rockwell)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) diff --git a/src/mame/layout/hh_b5000_test.lay b/src/mame/layout/hh_b5000_test.lay new file mode 100644 index 00000000000..be9d45aabcc --- /dev/null +++ b/src/mame/layout/hh_b5000_test.lay @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/rw18r.lay b/src/mame/layout/rw18r.lay new file mode 100644 index 00000000000..455ead0b630 --- /dev/null +++ b/src/mame/layout/rw18r.lay @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index b9a2614a304..c5deb939ec2 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -16435,6 +16435,9 @@ hexionb // bootleg @source:hh_amis2k.cpp wildfire // Parker Bros +@source:hh_b5000.cpp +rw18r // Rockwell + @source:hh_cop400.cpp bship82 // Milton Bradley ctstein // Castle Toy diff --git a/src/mame/mess.flt b/src/mame/mess.flt index a1c70c71f09..37db6d8e047 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -406,6 +406,7 @@ hec2hrp.cpp hektor.cpp hhtiger.cpp hh_amis2k.cpp +hh_b5000.cpp hh_cop400.cpp hh_cops1.cpp hh_hmcs40.cpp -- cgit v1.2.3