From 8be0d3eb2955cd8efb0d019535708f5b02477d67 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 25 Mar 2024 14:15:36 +0100 Subject: [PATCH] avr8: fix port D bit 7 toggle on timer2 (cherry picked from commit 2db21a34b5be8782c1ba510c4fdfc96d37cabea4) --- src/devices/cpu/avr8/avr8.cpp | 8 ++++---- src/mame/homebrew/uzebox.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/devices/cpu/avr8/avr8.cpp b/src/devices/cpu/avr8/avr8.cpp index 7779648d0573d..e6e1aa545613c 100644 --- a/src/devices/cpu/avr8/avr8.cpp +++ b/src/devices/cpu/avr8/avr8.cpp @@ -1961,7 +1961,7 @@ void avr8_device::update_timer_waveform_gen_mode(uint8_t t, uint8_t m if (m_timer_top[t] == -1) { m_timer_top[t] = 0; - LOGMASKED((LOG_TIMER0 + t), "%s: update_timer_waveform_gen_mode: Timer %d - Unsupported waveform generation type: %d\n", machine().describe_context(), t, mode); + LOGMASKED((LOG_TIMER0 << t), "%s: update_timer_waveform_gen_mode: Timer %d - Unsupported waveform generation type: %d\n", machine().describe_context(), t, mode); } } @@ -2028,7 +2028,7 @@ void avr8_device::timer2_tick_fast_pwm() if (m_ocr2_not_reached_yet) { // Turn off - m_r[PORTD] |= 1 << 7; + m_r[PORTD] &= ~(1 << 7); m_gpio_out_cb[GPIOD](m_r[PORTD]); m_ocr2_not_reached_yet = false; } @@ -2191,11 +2191,11 @@ void avr8_device::update_timer_clock_source(uint8_t clock_select, con const uint16_t old_prescale = s_prescale_values[(Timer == 2) ? 1 : 0][old_clock_select]; m_timer_prescale[Timer] = (uint16_t)prescale_divisor; - LOGMASKED(LOG_TIMER0 + Timer, "%s: update_timer_clock_source: t = %d, cs = %d\n", machine().describe_context(), Timer, clock_select); + LOGMASKED(LOG_TIMER0 << Timer, "%s: update_timer_clock_source: t = %d, cs = %d\n", machine().describe_context(), Timer, clock_select); if (prescale_divisor == -1) { - LOGMASKED(LOG_TIMER0 + Timer, "%s: timer%d: update_timer_clock_source: External trigger mode not implemented yet\n", machine().describe_context(), Timer); + LOGMASKED(LOG_TIMER0 << Timer, "%s: timer%d: update_timer_clock_source: External trigger mode not implemented yet\n", machine().describe_context(), Timer); m_timer_prescale[Timer] = 0xffff; } diff --git a/src/mame/homebrew/uzebox.cpp b/src/mame/homebrew/uzebox.cpp index 3e7d6b678d737..dac24881d9e4b 100644 --- a/src/mame/homebrew/uzebox.cpp +++ b/src/mame/homebrew/uzebox.cpp @@ -128,7 +128,7 @@ void uzebox_state::port_a_w(uint8_t data) uint8_t uzebox_state::port_a_r() { - return m_port_a | 0xf0; + return m_port_a | 0xf0; } void uzebox_state::port_b_w(uint8_t data)