diff --git a/src/mame/drivers/im01.cpp b/src/mame/drivers/im01.cpp index 3d891e21e1c..a8312043c7f 100644 --- a/src/mame/drivers/im01.cpp +++ b/src/mame/drivers/im01.cpp @@ -1,36 +1,53 @@ // license:BSD-3-Clause // copyright-holders:hap -// thanks-to:Radon17, Berger +// thanks-to:Radon17, RCgoff, Berger /****************************************************************************** Электроника ИМ-01 (Elektronika IM-01) Soviet chess computer, produced by Svetana from 1986-1992. ИМ-01Т is the same hardware, improved program and has 1 more difficulty level. +ИМ-05 is also on similar hardware, it was released after the Soviet dissolution. TODO: -- emulate К1801ВМ1, using T11 for now and I hope it works ok +- emulate К1801ВМ1/2, using T11 for now and I hope it works ok - emulate K1809BB1, IRQ is from here too (measured 177.4Hz) +- emulate К1573ХМ1 - It's running a bit too fast?: CPU clock was measured 4.61MHz, beeper frequency 3.73kHz and beeper duration 34.2ms. In MAME, beeper frequency is 4.15kHz and duration is 31ms, meaning it's around 1.1 times faster, maybe К1801ВМ1 internal timing differs from T11, and/or MAME's T11 core timing itself is not 100% accurate. -- Is im01t extra RAM chip used at all, and if so, where is it mapped? - Even when trying to solve mate problems (level 7, and overclocked CPU), - there are no unmapped writes. -- What is 0x6000-0x7fff for? im01 will test for both RAM and ROM in this +- Is im01t/im05 extra RAM chip used at all? Even when trying to solve mate + problems (level 7, and overclocked CPU), there are no writes to it. +- What is im01 0x6000-0x7fff for? it will test for both RAM and ROM in this area if no bus error was triggered, and will fail to boot up. +- verify im05 XTAL and IRQ +- verify im05 button functions -******************************************************************************* +=============================================================================== Hardware notes: + +ИМ-01: - К1801ВМ1 CPU (PDP-11 derived) @ ~4.61MHz (9216 кгц XTAL) - 16KB ROM (2*К1809РЕ1), 2KB RAM(К1809РУ1) (4KB RAM for ИМ-01Т) - K1809BB1 (I/O, counter) - 4-digit VFD 7seg panel(cyan, green window overlay), beeper -Keypad legend (excluding A1-H8 and black/white): +ИМ-01Т: +- 4KB RAM (2*К1809РУ1), but also seen with 1 К1809РУ1 like ИМ-01 +- rest is same as ИМ-01 + +ИМ-05: +- КМ1801ВМ2 CPU (similar to К1801ВМ1) +- 24KB ROM (3*К1809РЕ1), 4KB RAM (2*КР573РУ10) +- К1573ХМ1 (I/O controller) +- rest is same as ИМ-01 + +=============================================================================== + +ИМ-01 keypad legend (excluding A1-H8 and black/white): Фиг: префиксная клавиша для ввода кода шахматной фигуры, - Prefix Key (hold) а также для установки фигур в начальную позицию, @@ -56,6 +73,17 @@ N: чксло ходов - Show Moves * note: hold Фиг +ИМ-05 keypad legend (differences shown, preliminary): + +Реж: режима - Mode (no hold) +НП: - - Reset +СД: - - Cancel? +↓: - - Confirm (level/piece) +→: - - Forward +CТА: - - Enter Move +ПХ: - - Hint +Р: - - Promotion (hold) + ******************************************************************************/ #include "emu.h" @@ -68,10 +96,13 @@ N: чксло ходов - Show Moves // internal artwork #include "im01.lh" // clickable +#include "im05.lh" // clickable namespace { +// ИМ-01 / shared + class im01_state : public driver_device { public: @@ -84,24 +115,26 @@ public: { } void im01(machine_config &config); + void im01t(machine_config &config); protected: virtual void machine_start() override; -private: // devices/pointers required_device m_maincpu; required_device m_display; required_device m_dac; required_ioport_array<6> m_inputs; - void main_map(address_map &map); + void im01_map(address_map &map); + void im01t_map(address_map &map); u8 irq_callback(offs_t offset); INTERRUPT_GEN_MEMBER(interrupt); // I/O handlers void update_display(); + virtual u8 get_segs(u8 data) { return bitswap<8>(data,0,1,2,3,4,5,6,7); } u16 mux_r(offs_t offset, u16 mem_mask); void mux_w(offs_t offset, u16 data, u16 mem_mask); u16 digit_r(offs_t offset, u16 mem_mask); @@ -120,6 +153,24 @@ void im01_state::machine_start() save_item(NAME(m_digit_data)); } +// ИМ-05 + +class im05_state : public im01_state +{ +public: + im05_state(const machine_config &mconfig, device_type type, const char *tag) : + im01_state(mconfig, type, tag) + { } + + void im05(machine_config &config); + +private: + void im05_map(address_map &map); + + // digit segments are in a different order + virtual u8 get_segs(u8 data) override { return bitswap<8>(data,0,1,6,4,2,3,5,7); } +}; + /****************************************************************************** @@ -150,7 +201,7 @@ INTERRUPT_GEN_MEMBER(im01_state::interrupt) void im01_state::update_display() { - m_display->matrix(m_inp_mux, bitswap<8>(m_digit_data,0,1,2,3,4,5,6,7)); + m_display->matrix(m_inp_mux, get_segs(m_digit_data)); } u16 im01_state::mux_r(offs_t offset, u16 mem_mask) @@ -204,7 +255,7 @@ void im01_state::error_w(offs_t offset, u16 data, u16 mem_mask) Address Maps ******************************************************************************/ -void im01_state::main_map(address_map &map) +void im01_state::im01_map(address_map &map) { map(0x0000, 0x07ff).ram(); map(0x2000, 0x5fff).rom(); @@ -214,6 +265,18 @@ void im01_state::main_map(address_map &map) map(0xffe8, 0xffe9).w(FUNC(im01_state::error_w)).nopr(); } +void im01_state::im01t_map(address_map &map) +{ + im01_map(map); + map(0x0800, 0x0fff).ram(); +} + +void im05_state::im05_map(address_map &map) +{ + im01t_map(map); + map(0x6000, 0x7fff).rom(); +} + /****************************************************************************** @@ -258,6 +321,44 @@ static INPUT_PORTS_START( im01 ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Set Level") INPUT_PORTS_END +static INPUT_PORTS_START( im05 ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_A) PORT_NAME("A 1 / Pawn") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_B) PORT_NAME("B 2 / Knight") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_C) PORT_NAME("C 3 / Bishop") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_D) PORT_NAME("D 4 / Rook") + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME(u8"Р (Promotion)") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("? (Verify Position)") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME(u8"ПХ (Hint)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Forward") + + PORT_START("IN.2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME(u8"CТА (Enter)") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME(u8"CИ (Clear Entry)") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Confirm") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") + + PORT_START("IN.3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_CODE(KEYCODE_E) PORT_NAME("E 5 / Queen") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_F) PORT_NAME("F 6 / King") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_G) PORT_NAME("G 7") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_H) PORT_NAME("H 8") + + PORT_START("IN.4") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME(u8"N (Show Moves)") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_Z) PORT_NAME("White / 9") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME(u8"И (Show Analyzed Move)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME(u8"Реж (Mode)") + + PORT_START("IN.5") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Set Level") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_X) PORT_NAME("Black / 0") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME(u8"СД (Cancel)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME(u8"НП (Reset)") +INPUT_PORTS_END + /****************************************************************************** @@ -269,9 +370,9 @@ void im01_state::im01(machine_config &config) // basic machine hardware T11(config, m_maincpu, 9.216_MHz_XTAL / 2); // actually К1801ВМ1 m_maincpu->set_initial_mode(3 << 13); - m_maincpu->set_addrmap(AS_PROGRAM, &im01_state::main_map); + m_maincpu->set_addrmap(AS_PROGRAM, &im01_state::im01_map); m_maincpu->in_iack().set(FUNC(im01_state::irq_callback)); - m_maincpu->set_periodic_int(FUNC(im01_state::interrupt), attotime::from_hz(177)); + m_maincpu->set_periodic_int(FUNC(im01_state::interrupt), attotime::from_hz(177)); // measured // video hardware PWM_DISPLAY(config, m_display).set_size(5, 7); @@ -283,6 +384,26 @@ void im01_state::im01(machine_config &config) DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); } +void im01_state::im01t(machine_config &config) +{ + im01(config); + + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &im01_state::im01t_map); +} + +void im05_state::im05(machine_config &config) +{ + im01(config); + + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &im05_state::im05_map); + m_maincpu->set_periodic_int(FUNC(im05_state::interrupt), attotime::from_hz(512)); // approximation + + // video hardware + config.set_default_layout(layout_im05); +} + /****************************************************************************** @@ -301,6 +422,13 @@ ROM_START( im01t ) ROM_LOAD("0000149", 0x4000, 0x2000, CRC(43b14589) SHA1(b083b631f38a26a335226bc474669ef7f332f541) ) ROM_END +ROM_START( im05 ) + ROM_REGION16_LE( 0x10000, "maincpu", 0 ) + ROM_LOAD("0000205", 0x2000, 0x2000, CRC(8aa51bcb) SHA1(211a3fa22627e828841121a735b4625a4bbff4da) ) + ROM_LOAD("0000206", 0x4000, 0x2000, CRC(3d3ecea6) SHA1(045abe1c935a8748b5a20a11f10f34c835c54156) ) + ROM_LOAD("0000207", 0x6000, 0x2000, CRC(3323378a) SHA1(94a890bff34699c8b8c516fb446872089778cf97) ) +ROM_END + } // anonymous namespace @@ -311,4 +439,6 @@ ROM_END // YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS CONS( 1986, im01, 0, 0, im01, im01, im01_state, empty_init, "Svetlana", "Elektronika IM-01", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1991, im01t, im01, 0, im01, im01, im01_state, empty_init, "Svetlana", "Elektronika IM-01T", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1991, im01t, im01, 0, im01t, im01, im01_state, empty_init, "Svetlana", "Elektronika IM-01T", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +CONS( 1993, im05, 0, 0, im05, im05, im05_state, empty_init, "Svetlana", "Elektronika IM-05", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/layout/im05.lay b/src/mame/layout/im05.lay new file mode 100644 index 00000000000..b7a11d19430 --- /dev/null +++ b/src/mame/layout/im05.lay @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/machine/alpha8201.cpp b/src/mame/machine/alpha8201.cpp index bd9a6c95e7a..0f3da510f57 100644 --- a/src/mame/machine/alpha8201.cpp +++ b/src/mame/machine/alpha8201.cpp @@ -6,9 +6,9 @@ ---------------------------------------------------------------------------- -The Alpha-8201/830x isn't a real CPU. It is a Hitachi HD44801 4-bit MCU, -programmed to interpret an external program using a custom instruction set. -Alpha-8301 has an expanded instruction set, backwards compatible with Alpha-8201. +The Alpha-8x0x isn't a real CPU. It is a Hitachi HD44801 4-bit MCU, programmed +to interpret an external program using a custom instruction set. Alpha-8302 +has an expanded instruction set, backwards compatible with Alpha-8201. Game Year MCU @@ -185,7 +185,7 @@ opcode mnemonic function flags 1111--xx mirror for the above Notes: -[1] bug: the Z flag is not updated correctly after a LD A,Rn instruction. Fixed in 8302 (possibly 8301). +[1] bug: the Z flag is not updated correctly after a LD A,Rn instruction. Fixed in 8302. 8302 CONFIRMED OPCODES: diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 81e061e9c9a..b7463be1bb3 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -17163,6 +17163,7 @@ ikt5a // @source:im01.cpp im01 im01t +im05 @source:imds2.cpp imds2 // Intellec MDS series-II