From 867f145b06b8d664f778ff8b9765485d66b4aafc Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 24 Jul 2017 10:24:10 +1000 Subject: [PATCH] scope stuff down again, rvalue on left of ==, fewer early exits (nw) --- src/mame/video/wolfpack.cpp | 15 ++++------ .../modules/debugger/win/consolewininfo.cpp | 28 ++++++++++--------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/mame/video/wolfpack.cpp b/src/mame/video/wolfpack.cpp index 0f2f9e6974f..0d35050a597 100644 --- a/src/mame/video/wolfpack.cpp +++ b/src/mame/video/wolfpack.cpp @@ -96,19 +96,14 @@ WRITE8_MEMBER(wolfpack_state::torpedo_v_w) void wolfpack_state::video_start() { - uint16_t val = 0; - - m_LFSR = std::make_unique(0x8000); - m_screen->register_screen_bitmap(m_helper); - for (int i = 0; i < 0x8000; i++) + m_LFSR = std::make_unique(0x8000); + for (uint16_t i = 0, val = 0; i < 0x8000; i++) { - int bit = (val >> 0x0) ^ (val >> 0xe) ^ 1; - - val = (val << 1) | (bit & 1); - - m_LFSR[i] = (val & 0xc00) == 0xc00; + uint16_t const bit = ~(val ^ (val >> 14)) & 1; + val = (val << 1) | bit; + m_LFSR[i] = (val & 0x0c00) == 0x0c00; } m_current_index = 0x80; diff --git a/src/osd/modules/debugger/win/consolewininfo.cpp b/src/osd/modules/debugger/win/consolewininfo.cpp index 1b7fd42b492..9662ec096cd 100644 --- a/src/osd/modules/debugger/win/consolewininfo.cpp +++ b/src/osd/modules/debugger/win/consolewininfo.cpp @@ -95,25 +95,27 @@ consolewin_info::~consolewin_info() { } + void consolewin_info::set_cpu(device_t &device) { // exit if this cpu is already selected - if (m_current_cpu == &device) - return; - m_current_cpu = &device; + if (&device != m_current_cpu) + { + m_current_cpu = &device; - // first set all the views to the new cpu number - m_views[0]->set_source_for_device(device); - m_views[1]->set_source_for_device(device); + // first set all the views to the new cpu number + m_views[0]->set_source_for_device(device); + m_views[1]->set_source_for_device(device); - // then update the caption - std::string title = string_format("Debug: %s - %s '%s'", device.machine().system().name, device.name(), device.tag()); - std::string curtitle = win_get_window_text_utf8(window()); - if (title != curtitle) - win_set_window_text_utf8(window(), title.c_str()); + // then update the caption + std::string title = string_format("Debug: %s - %s '%s'", device.machine().system().name, device.name(), device.tag()); + std::string curtitle = win_get_window_text_utf8(window()); + if (title != curtitle) + win_set_window_text_utf8(window(), title.c_str()); - // and recompute the children - recompute_children(); + // and recompute the children + recompute_children(); + } }