From 88a92d935795db8e386683f09732b0fab08308b0 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 17 Aug 2024 14:52:38 +0200 Subject: chessmate: update notes, correct dac type and fix lose led --- src/mame/commodore/chessmate.cpp | 74 ++++++++++++++++++++++------------------ src/mame/handheld/gmaster.cpp | 2 +- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/src/mame/commodore/chessmate.cpp b/src/mame/commodore/chessmate.cpp index 36f79c37783..74c142dc361 100644 --- a/src/mame/commodore/chessmate.cpp +++ b/src/mame/commodore/chessmate.cpp @@ -2,15 +2,19 @@ // copyright-holders:Peter Trauner, hap /******************************************************************************* -Commodore Chessmate / Novag Chess Champion MK II +Commodore Chessmate (stylized as CHESSmate) / Novag Chess Champion MK II Initial driver version by PeT mess@utanet.at September 2000. Driver mostly rewritten later. -The hardware is pretty similar to KIM-1. In fact, the chess engine is Peter -R. Jennings's Microchess, originally made for the KIM-1. Jennings went on to -co-found Personal Software (later named VisiCorp, known for VisiCalc). +The hardware is pretty similar to KIM-1. In fact, the chess engine is an improved +version of Peter R. Jennings's Microchess, originally made for the KIM-1. Jennings +went on to co-found Personal Software (later named VisiCorp, known for VisiCalc). -Jennings also licensed Chessmate to Novag, and they released it as the MK II. +It was planned to be called "Bobby", pending Bobby Fischer's approval. Although +the program was stronger than most other chess computers at the time, Fischer +declined the idea after trying out the prototype. + +Commodore also licensed Chessmate to Novag, and they released it as the MK II. The hardware is almost identical and the software is the same(identical ROM labels). Two designs were made, one jukebox shape, and one brick shape. The one in MAME came from the jukebox, but both models have the same ROMs. @@ -85,21 +89,20 @@ private: required_device m_maincpu; required_device m_miot; required_device m_display; - required_device m_dac; + required_device m_dac; optional_ioport_array<5> m_inputs; u8 m_inp_mux = 0; u8 m_7seg_data = 0; u8 m_led_data = 0; - // address maps void main_map(address_map &map); // I/O handlers void update_display(); - void control_w(u8 data); - void digit_w(u8 data); u8 input_r(); + void digit_w(u8 data); + void control_w(u8 data); }; void chmate_state::machine_start() @@ -112,7 +115,7 @@ void chmate_state::machine_start() INPUT_CHANGED_MEMBER(chmate_state::reset_button) { - // assume that NEW GAME button is tied to reset pin(s) + // NEW GAME button is tied to reset pin(s) m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); if (newval) m_miot->reset(); @@ -128,42 +131,45 @@ INPUT_CHANGED_MEMBER(chmate_state::reset_button) void chmate_state::update_display() { - m_display->write_row(4, m_led_data); m_display->matrix_partial(0, 4, 1 << m_inp_mux, m_7seg_data); + m_display->write_row(4, m_led_data | (m_7seg_data >> 5 & 4)); } -void chmate_state::control_w(u8 data) +u8 chmate_state::input_r() { - // d0-d2: 74145 to input mux/digit select - m_inp_mux = data & 7; + u8 data = 0; - // 74145 Q7: speaker out - m_dac->write(BIT(1 << m_inp_mux, 7) & ~m_inputs[4].read_safe(0)); + // PA0-PA6: multiplexed inputs (74145 Q4,Q5) + if (m_inp_mux == 4 || m_inp_mux == 5) + { + // note that number/letter buttons are electronically the same + u8 i = m_inp_mux - 4; + data = m_inputs[i]->read() | m_inputs[i | 2].read_safe(0); + } - // d3-d5: leds (direct) - m_led_data = data >> 3 & 7; - update_display(); + return ~data; } void chmate_state::digit_w(u8 data) { + // PA0-PA6: digit segment data + // PA7: lose led m_7seg_data = data; update_display(); } -u8 chmate_state::input_r() +void chmate_state::control_w(u8 data) { - u8 data = 0; + // PB0-PB2: 74145 to input mux/digit select + m_inp_mux = data & 7; - // multiplexed inputs (74145 Q4,Q5) - if (m_inp_mux == 4 || m_inp_mux == 5) - { - // note that number/letter buttons are electronically the same - u8 i = m_inp_mux - 4; - data = m_inputs[i]->read() | m_inputs[i | 2].read_safe(0); - } + // 74145 Q6,Q7: speaker out + bool sound_on = !m_inputs[4].read_safe(0); + m_dac->write(sound_on ? ((1 << m_inp_mux) >> 6) : 0); - return ~data; + // PB3,PB4: leds (direct) + m_led_data = data >> 3 & 3; + update_display(); } @@ -271,13 +277,13 @@ void chmate_state::chmate(machine_config &config) m_miot->irq_wr_callback().set_inputline(m_maincpu, 0); // video hardware - PWM_DISPLAY(config, m_display).set_size(4+1, 8); - m_display->set_segmask(0xf, 0xff); + PWM_DISPLAY(config, m_display).set_size(4+1, 7); + m_display->set_segmask(0xf, 0x7f); config.set_default_layout(layout_chessmate); // sound hardware SPEAKER(config, "speaker").front_center(); - DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); + DAC_2BIT_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.125); } void chmate_state::mk2(machine_config &config) @@ -320,5 +326,5 @@ ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS SYST( 1978, chmate, 0, 0, chmate, chmate, chmate_state, empty_init, "Commodore", "Chessmate", MACHINE_SUPPORTS_SAVE ) -SYST( 1979, ccmk2, chmate, 0, mk2, mk2, chmate_state, empty_init, "Novag Industries", "Chess Champion: MK II (ver. 1)", MACHINE_SUPPORTS_SAVE ) // 1st version (jukebox model), aka version B -SYST( 1979, ccmk2a, chmate, 0, mk2a, mk2a, chmate_state, empty_init, "Novag Industries", "Chess Champion: MK II (ver. 2)", MACHINE_SUPPORTS_SAVE ) +SYST( 1979, ccmk2, chmate, 0, mk2, mk2, chmate_state, empty_init, "Commodore / Novag Industries", "Chess Champion: MK II (set 1)", MACHINE_SUPPORTS_SAVE ) // 1st version (jukebox model), aka version B +SYST( 1979, ccmk2a, chmate, 0, mk2a, mk2a, chmate_state, empty_init, "Commodore / Novag Industries", "Chess Champion: MK II (set 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/handheld/gmaster.cpp b/src/mame/handheld/gmaster.cpp index 841f42a6e06..e0c8a262b75 100644 --- a/src/mame/handheld/gmaster.cpp +++ b/src/mame/handheld/gmaster.cpp @@ -173,7 +173,7 @@ void gmaster_state::main_map(address_map &map) { // 0x0000-0x0fff is internal ROM map(0x4000, 0x47ff).mirror(0x3800).rw(FUNC(gmaster_state::io_r), FUNC(gmaster_state::io_w)).share("ram"); - map(0x8000, 0xfeff).r("cartslot", FUNC(generic_slot_device::read_rom)); + map(0x8000, 0xffff).r("cartslot", FUNC(generic_slot_device::read_rom)); // 0xff00-0xffff is internal RAM } -- cgit v1.2.3