From 3896d83e084873bf5dcf7acc1bb8fb57470fbbdb Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 29 Apr 2023 05:15:07 +1000 Subject: Trivial cleanup. --- src/devices/bus/rs232/null_modem.cpp | 8 +++----- src/devices/bus/rs232/pty.cpp | 15 ++++++--------- src/mame/vectorgraphic/sbcvideo.cpp | 6 +++--- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/devices/bus/rs232/null_modem.cpp b/src/devices/bus/rs232/null_modem.cpp index 5b19f1d8e29..5e79c37bb37 100644 --- a/src/devices/bus/rs232/null_modem.cpp +++ b/src/devices/bus/rs232/null_modem.cpp @@ -96,7 +96,7 @@ TIMER_CALLBACK_MEMBER(null_modem_device::update_queue) if (m_input_count != 0) { - uint8_t fc = m_flow->read(); + uint8_t const fc = m_flow->read(); if (fc == 0 || (fc == 1 && m_rts == 0) || (fc == 2 && m_dtr == 0) || (fc == 4 && m_xoff == 0)) { @@ -106,7 +106,7 @@ TIMER_CALLBACK_MEMBER(null_modem_device::update_queue) } } - int txbaud = convert_baud(m_rs232_txbaud->read()); + int const txbaud = convert_baud(m_rs232_txbaud->read()); m_timer_poll->adjust(attotime::from_hz(txbaud)); } } @@ -123,11 +123,9 @@ void null_modem_device::tra_complete() void null_modem_device::rcv_complete() { - u8 data; - receive_register_extract(); - data = get_received_char(); + uint8_t const data = get_received_char(); if (m_flow->read() != 4) { m_stream->output(data); diff --git a/src/devices/bus/rs232/pty.cpp b/src/devices/bus/rs232/pty.cpp index 4b3a6e9b91c..2e233107afd 100644 --- a/src/devices/bus/rs232/pty.cpp +++ b/src/devices/bus/rs232/pty.cpp @@ -103,11 +103,9 @@ void pseudo_terminal_device::tra_complete() void pseudo_terminal_device::rcv_complete() { - u8 data; - receive_register_extract(); - data = get_received_char(); + uint8_t const data = get_received_char(); if (m_flow->read() != 4) { write(data); @@ -138,17 +136,16 @@ TIMER_CALLBACK_MEMBER(pseudo_terminal_device::update_queue) if (m_input_index == m_input_count) { m_input_index = 0; - int tmp = read(m_input_buffer , sizeof(m_input_buffer)); - if (tmp > 0) { + int const tmp = read(m_input_buffer , sizeof(m_input_buffer)); + if (tmp > 0) m_input_count = tmp; - } else { + else m_input_count = 0; - } } if (m_input_count != 0) { - uint8_t fc = m_flow->read(); + uint8_t const fc = m_flow->read(); if (fc == 0 || (fc == 1 && m_rts == 0) || (fc == 2 && m_dtr == 0) || (fc == 4 && m_xoff == 0)) { @@ -158,7 +155,7 @@ TIMER_CALLBACK_MEMBER(pseudo_terminal_device::update_queue) } } - int txbaud = convert_baud(m_rs232_txbaud->read()); + int const txbaud = convert_baud(m_rs232_txbaud->read()); m_timer_poll->adjust(attotime::from_hz(txbaud)); } } diff --git a/src/mame/vectorgraphic/sbcvideo.cpp b/src/mame/vectorgraphic/sbcvideo.cpp index 5c0cc227450..7af48d780a1 100644 --- a/src/mame/vectorgraphic/sbcvideo.cpp +++ b/src/mame/vectorgraphic/sbcvideo.cpp @@ -26,14 +26,14 @@ void vector_sbc_video_device::spr_w(uint8_t data) void vector_sbc_video_device::res320_mapping_ram_w(offs_t offset, uint8_t data) { // 7200-0001 page 209 (VI A-6) C6 - m_res320_ram[offset & 0x3] = data & 0x0F; + m_res320_ram[offset & 0x3] = data & 0x0f; } static inline rgb_t raw_4bit_to_rgb(uint8_t enc, bool color) { if (color) { // 7200-0001 page 83. Ordering: IBGR - enc = (enc & 0xa) | (BIT(enc, 0) << 2) | BIT(enc, 2); + enc = bitswap<4>(enc, 3, 0, 1, 2); return rgb_t(cga_palette[enc][0], cga_palette[enc][1], cga_palette[enc][2]); } else { // 7200-0001 page 209 C11 @@ -115,7 +115,7 @@ MC6845_UPDATE_ROW(vector_sbc_video_device::update_row) for (uint16_t x = 0; x < x_count*2; x++) { // Character Generators. 7200-0001 page 69 (II 3-6) C4 uint8_t cell = m_buffer->read(x+addr); - uint8_t chr = cell & 0x7F; + uint8_t chr = cell & 0x7f; uint8_t invert = BIT(cell, 7); uint8_t gfxl = m_chrroml[chr | (ra << 7) | (chr1 << 11)]; uint8_t gfxr = m_chrromr[chr | (ra << 7) | (chr1 << 11)]; -- cgit v1.2.3