diff options
| -rw-r--r-- | src/devices/cpu/mn1400/mn1400.cpp | 24 | ||||
| -rw-r--r-- | src/devices/cpu/mn1400/mn1400.h | 14 | ||||
| -rw-r--r-- | src/devices/cpu/mn1400/mn1400base.cpp | 28 | ||||
| -rw-r--r-- | src/devices/cpu/mn1400/mn1400base.h | 8 | ||||
| -rw-r--r-- | src/mame/handheld/hh_mn1400.cpp | 66 | ||||
| -rw-r--r-- | src/mame/handheld/scrablex.cpp | 4 | ||||
| -rw-r--r-- | src/mame/layout/scrablexa.lay | 21 | ||||
| -rwxr-xr-x | src/mame/mame.lst | 1 |
8 files changed, 140 insertions, 26 deletions
diff --git a/src/devices/cpu/mn1400/mn1400.cpp b/src/devices/cpu/mn1400/mn1400.cpp index e477ffc47fd..1d0dc807ee9 100644 --- a/src/devices/cpu/mn1400/mn1400.cpp +++ b/src/devices/cpu/mn1400/mn1400.cpp @@ -2,7 +2,7 @@ // copyright-holders:hap /* - Matsushita MN1400 MCU + Matsushita MN1400, MN1405 TODO: - stuff @@ -15,29 +15,23 @@ TODO: #include "mn1400d.h" +// device definitions DEFINE_DEVICE_TYPE(MN1400, mn1400_cpu_device, "mn1400", "Matsushita MN1400") +DEFINE_DEVICE_TYPE(MN1405, mn1405_cpu_device, "mn1405", "Matsushita MN1405") // constructor -mn1400_cpu_device::mn1400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : - mn1400_base_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) +mn1400_cpu_device::mn1400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + mn1400_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data) { } mn1400_cpu_device::mn1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - mn1400_cpu_device(mconfig, MN1400, tag, owner, clock, 10, address_map_constructor(FUNC(mn1400_cpu_device::program_1024x8), this), 6, address_map_constructor(FUNC(mn1400_cpu_device::data_64x4), this)) + mn1400_cpu_device(mconfig, MN1400, tag, owner, clock, 2 /* stack levels */, 10 /* rom bits */, address_map_constructor(FUNC(mn1400_cpu_device::program_1kx8), this), 6 /* ram bits */, address_map_constructor(FUNC(mn1400_cpu_device::data_64x4), this)) { } - -// internal memory maps -void mn1400_cpu_device::program_1024x8(address_map &map) -{ - map(0x000, 0x3ff).rom(); -} - -void mn1400_cpu_device::data_64x4(address_map &map) -{ - map(0x00, 0x3f).ram(); -} +mn1405_cpu_device::mn1405_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + mn1400_cpu_device(mconfig, MN1405, tag, owner, clock, 2, 11, address_map_constructor(FUNC(mn1405_cpu_device::program_2kx8), this), 7, address_map_constructor(FUNC(mn1405_cpu_device::data_128x4), this)) +{ } // disasm diff --git a/src/devices/cpu/mn1400/mn1400.h b/src/devices/cpu/mn1400/mn1400.h index cfe4536794a..2f9907fa889 100644 --- a/src/devices/cpu/mn1400/mn1400.h +++ b/src/devices/cpu/mn1400/mn1400.h @@ -2,7 +2,7 @@ // copyright-holders:hap /* - Matsushita MN1400 MCU + Matsushita MN1400, MN1405 */ @@ -25,7 +25,7 @@ public: mn1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: - mn1400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + mn1400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); // device_disasm_interface overrides virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; @@ -34,16 +34,20 @@ protected: virtual void execute_one() override; virtual bool op_has_param(u8 op) override; - void program_1024x8(address_map &map); - void data_64x4(address_map &map); - // opcode helpers void op_illegal(); // opcode handlers }; +class mn1405_cpu_device : public mn1400_cpu_device +{ +public: + mn1405_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + DECLARE_DEVICE_TYPE(MN1400, mn1400_cpu_device) +DECLARE_DEVICE_TYPE(MN1405, mn1405_cpu_device) #endif // MAME_CPU_MN1400_MN1400_H diff --git a/src/devices/cpu/mn1400/mn1400base.cpp b/src/devices/cpu/mn1400/mn1400base.cpp index b8bd7d3b9d2..812480fc0ac 100644 --- a/src/devices/cpu/mn1400/mn1400base.cpp +++ b/src/devices/cpu/mn1400/mn1400base.cpp @@ -12,10 +12,11 @@ x #include "mn1400base.h" -mn1400_base_device::mn1400_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : +mn1400_base_device::mn1400_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : cpu_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program), m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data), + m_stack_levels(stack_levels), m_prgwidth(prgwidth), m_datawidth(datawidth) { } @@ -91,6 +92,31 @@ void mn1400_base_device::device_reset() //------------------------------------------------- +// common internal memory maps +//------------------------------------------------- + +void mn1400_base_device::program_1kx8(address_map &map) +{ + map(0x000, 0x3ff).rom(); +} + +void mn1400_base_device::program_2kx8(address_map &map) +{ + map(0x000, 0x7ff).rom(); +} + +void mn1400_base_device::data_64x4(address_map &map) +{ + map(0x00, 0x3f).ram(); +} + +void mn1400_base_device::data_128x4(address_map &map) +{ + map(0x00, 0x7f).ram(); +} + + +//------------------------------------------------- // execute //------------------------------------------------- diff --git a/src/devices/cpu/mn1400/mn1400base.h b/src/devices/cpu/mn1400/mn1400base.h index ddaca48c2a1..7780d616d23 100644 --- a/src/devices/cpu/mn1400/mn1400base.h +++ b/src/devices/cpu/mn1400/mn1400base.h @@ -23,7 +23,7 @@ public: protected: // construction/destruction - mn1400_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + mn1400_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); // device-level overrides virtual void device_start() override; @@ -45,9 +45,15 @@ protected: address_space *m_program; address_space *m_data; + void program_1kx8(address_map &map); + void program_2kx8(address_map &map); + void data_64x4(address_map &map); + void data_128x4(address_map &map); + int m_icount; int m_state_count; + int m_stack_levels; int m_prgwidth; // ROM/RAM address size int m_datawidth; // " u16 m_prgmask; // " diff --git a/src/mame/handheld/hh_mn1400.cpp b/src/mame/handheld/hh_mn1400.cpp index 6cdf6c2a883..a026286d69c 100644 --- a/src/mame/handheld/hh_mn1400.cpp +++ b/src/mame/handheld/hh_mn1400.cpp @@ -20,6 +20,9 @@ TODO: #include "screen.h" #include "speaker.h" +// internal artwork +#include "scrablexa.lh" + #include "hh_mn1400_test.lh" // common test-layout - use external artwork @@ -155,6 +158,63 @@ ROM_END + + +/******************************************************************************* + + Selchow & Righter Scrabble Lexor + * PCB label: 2294HB + * MN1405MS MCU (die label: 1405 MS-0) + * 8-digit 14-seg LEDs, 2-bit sound + + This is the MN1405 version, see scrablex.cpp for the MB8841 version. + +*******************************************************************************/ + +class scrablexa_state : public hh_mn1400_state +{ +public: + scrablexa_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_mn1400_state(mconfig, type, tag) + { } + + void scrablexa(machine_config &config); + +private: +}; + +// handlers + +// inputs + +static INPUT_PORTS_START( scrablexa ) +INPUT_PORTS_END + +// config + +void scrablexa_state::scrablexa(machine_config &config) +{ + // basic machine hardware + MN1405(config, m_maincpu, 300000); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(1, 1); + config.set_default_layout(layout_scrablexa); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( scrablexa ) + ROM_REGION( 0x0800, "maincpu", 0 ) + ROM_LOAD( "mn1405ms", 0x0000, 0x0800, NO_DUMP ) +ROM_END + + + } // anonymous namespace /******************************************************************************* @@ -163,5 +223,7 @@ ROM_END *******************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1979, compperf, 0, 0, compperf, compperf, compperf_state, empty_init, "Lakeside", "Computer Perfection", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1979, compperf, 0, 0, compperf, compperf, compperf_state, empty_init, "Lakeside", "Computer Perfection", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) + +SYST( 1980, scrablexa, scrablex, 0, scrablexa, scrablexa, scrablexa_state, empty_init, "Selchow & Righter", "Scrabble Lexor: Computer Word Game (MN1405 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) diff --git a/src/mame/handheld/scrablex.cpp b/src/mame/handheld/scrablex.cpp index db00fccdb35..6cfea5b6019 100644 --- a/src/mame/handheld/scrablex.cpp +++ b/src/mame/handheld/scrablex.cpp @@ -11,7 +11,7 @@ Hardware notes: - Fujitsu MB8841 MCU - 8-digit 14-seg LEDs, 2-bit sound -There's also a version of this game on a Panasonic MN1405 MCU. +There's also a version of this game on a Matsushita MN1405 MCU (see hh_mn1400.cpp). *******************************************************************************/ @@ -228,4 +228,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1980, scrablex, 0, 0, scrablex, scrablex, scrablex_state, empty_init, "Selchow & Righter", "Scrabble Lexor: Computer Word Game", MACHINE_SUPPORTS_SAVE ) +SYST( 1980, scrablex, 0, 0, scrablex, scrablex, scrablex_state, empty_init, "Selchow & Righter", "Scrabble Lexor: Computer Word Game (MB8841 version)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/layout/scrablexa.lay b/src/mame/layout/scrablexa.lay new file mode 100644 index 00000000000..9636296889a --- /dev/null +++ b/src/mame/layout/scrablexa.lay @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!-- +license:CC0-1.0 +--> +<mamelayout version="2"> + + <element name="digit" defstate="0"> + <led14seg><color red="1.0" green="0.1" blue="0.15" /></led14seg> + </element> + + <view name="Internal Layout"> + <element name="digit0" ref="digit"><bounds x="0" y="0" width="10" height="15" /></element> + <element name="digit1" ref="digit"><bounds x="10" y="0" width="10" height="15" /></element> + <element name="digit2" ref="digit"><bounds x="20" y="0" width="10" height="15" /></element> + <element name="digit3" ref="digit"><bounds x="30" y="0" width="10" height="15" /></element> + <element name="digit4" ref="digit"><bounds x="40" y="0" width="10" height="15" /></element> + <element name="digit5" ref="digit"><bounds x="50" y="0" width="10" height="15" /></element> + <element name="digit6" ref="digit"><bounds x="60" y="0" width="10" height="15" /></element> + <element name="digit7" ref="digit"><bounds x="70" y="0" width="10" height="15" /></element> + </view> +</mamelayout> diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 2c726595a25..cb08d4805ae 100755 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -18713,6 +18713,7 @@ gjungler // Gakken @source:handheld/hh_mn1400.cpp compperf // Lakeside +scrablexa // Selchow & Righter @source:handheld/hh_pic16.cpp drdunk // Kmart |
