From d713b8c1c508c65800025ab847e6f3d15a59dc4b Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 3 Feb 2024 20:26:19 +0100 Subject: [PATCH] cop400: zerofill more class variables, thayers: add todo note about key conflict, y301xl: update company string --- src/devices/cpu/cop400/cop400.cpp | 28 +++++++++++++++++++++++----- src/devices/cpu/cop400/cop400.h | 2 +- src/mame/chess/yeno_301xl.cpp | 2 +- src/mame/misc/thayers.cpp | 7 +++---- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/devices/cpu/cop400/cop400.cpp b/src/devices/cpu/cop400/cop400.cpp index 6b7522350e6..8b4ffbe3094 100644 --- a/src/devices/cpu/cop400/cop400.cpp +++ b/src/devices/cpu/cop400/cop400.cpp @@ -1065,11 +1065,11 @@ void cop400_cpu_device::inil_tick() void cop400_cpu_device::device_start() { - /* find address spaces */ + // find address spaces space(AS_PROGRAM).cache(m_program); space(AS_DATA).specific(m_data); - /* allocate counter timer */ + // allocate counter timer m_counter_timer = nullptr; if (m_has_counter) { @@ -1077,7 +1077,7 @@ void cop400_cpu_device::device_start() m_counter_timer->adjust(attotime::zero, 0, attotime::from_ticks(m_cki * 4, clock())); } - /* register for state saving */ + // register for state saving save_item(NAME(m_pc)); save_item(NAME(m_prevpc)); save_item(NAME(m_sa)); @@ -1133,21 +1133,39 @@ void cop400_cpu_device::device_start() set_icountptr(m_icount); + // zerofill + m_pc = 0; + m_prevpc = 0; + m_a = 0; + m_b = 0; + m_c = 0; + m_en = 0; + m_g = 0; m_q = 0; m_sa = 0; m_sb = 0; m_sc = 0; m_sio = 0; + m_skl = 0; + + m_t = 0; + m_skt_latch = 0; + m_il = 0; - m_in[0] = m_in[1] = m_in[2] = m_in[3] = 0; + memset(m_in, 0, sizeof(m_in)); m_si = 0; m_so_output = 0; m_sk_output = 0; m_l_output = 0; + + m_skip = false; m_skip_lbi = 0; m_last_skip = false; - m_skip = false; + m_halt = false; + m_idle = false; + m_opcode = 0x44; + m_second_byte = false; } diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h index 45b2b4d0f25..4c51e36595b 100644 --- a/src/devices/cpu/cop400/cop400.h +++ b/src/devices/cpu/cop400/cop400.h @@ -199,7 +199,7 @@ protected: // registers uint16_t m_pc; // 9/10/11-bit ROM address program counter uint16_t m_prevpc; // previous value of program counter - uint8_t m_a; // 4-bit accumulator + uint8_t m_a; // 4-bit accumulator uint8_t m_b; // 5/6/7-bit RAM address register int m_c; // 1-bit carry register uint8_t m_en; // 4-bit enable register diff --git a/src/mame/chess/yeno_301xl.cpp b/src/mame/chess/yeno_301xl.cpp index 9253b32da0e..8811c76dbdc 100644 --- a/src/mame/chess/yeno_301xl.cpp +++ b/src/mame/chess/yeno_301xl.cpp @@ -237,4 +237,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1988, y301xl, 0, 0, y301xl, y301xl, y301xl_state, empty_init, "Yeno", "301 XL (Yeno)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1988, y301xl, 0, 0, y301xl, y301xl, y301xl_state, empty_init, "Yeno / Bray Research", "301 XL (Yeno)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/misc/thayers.cpp b/src/mame/misc/thayers.cpp index 20f0b9150f3..10c32e887aa 100644 --- a/src/mame/misc/thayers.cpp +++ b/src/mame/misc/thayers.cpp @@ -9,6 +9,7 @@ TODO: - No viable solution for reading configuration DIPs at init time, so the driver is hard-coded to LD-V1000 mode. + - conflict between keyboard and service mode default key (F2) *************************************************************************/ @@ -507,7 +508,7 @@ void thayers_state::den_w(offs_t offset, u8 data) // 7 N/C static constexpr u8 LED_MAP[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x00 }; - m_digits[(offset * 8) | (data >> 4 & 7)] = LED_MAP[data & 0x0f]; + m_digits[(offset << 3 & 8) | (data >> 4 & 7)] = LED_MAP[data & 0x0f]; } @@ -563,9 +564,7 @@ static INPUT_PORTS_START( thayers ) PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "A:8" ) PORT_START("DSWB") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION( "B:1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_SERVICE_DIPLOC( 0x01, 0x01, "B:1" ) PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "B:2" ) PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "B:3" ) PORT_DIPNAME( 0x18, 0x18, "LD Player" ) PORT_DIPLOCATION( "B:5,4" )