scope stuff down again, rvalue on left of ==, fewer early exits (nw)

This commit is contained in:
Vas Crabb 2017-07-24 10:24:10 +10:00
parent e9e209a34c
commit 867f145b06
2 changed files with 20 additions and 23 deletions

View File

@ -96,19 +96,14 @@ WRITE8_MEMBER(wolfpack_state::torpedo_v_w)
void wolfpack_state::video_start() void wolfpack_state::video_start()
{ {
uint16_t val = 0;
m_LFSR = std::make_unique<uint8_t[]>(0x8000);
m_screen->register_screen_bitmap(m_helper); m_screen->register_screen_bitmap(m_helper);
for (int i = 0; i < 0x8000; i++) m_LFSR = std::make_unique<uint8_t []>(0x8000);
for (uint16_t i = 0, val = 0; i < 0x8000; i++)
{ {
int bit = (val >> 0x0) ^ (val >> 0xe) ^ 1; uint16_t const bit = ~(val ^ (val >> 14)) & 1;
val = (val << 1) | bit;
val = (val << 1) | (bit & 1); m_LFSR[i] = (val & 0x0c00) == 0x0c00;
m_LFSR[i] = (val & 0xc00) == 0xc00;
} }
m_current_index = 0x80; m_current_index = 0x80;

View File

@ -95,25 +95,27 @@ consolewin_info::~consolewin_info()
{ {
} }
void consolewin_info::set_cpu(device_t &device) void consolewin_info::set_cpu(device_t &device)
{ {
// exit if this cpu is already selected // exit if this cpu is already selected
if (m_current_cpu == &device) if (&device != m_current_cpu)
return; {
m_current_cpu = &device; m_current_cpu = &device;
// first set all the views to the new cpu number // first set all the views to the new cpu number
m_views[0]->set_source_for_device(device); m_views[0]->set_source_for_device(device);
m_views[1]->set_source_for_device(device); m_views[1]->set_source_for_device(device);
// then update the caption // then update the caption
std::string title = string_format("Debug: %s - %s '%s'", device.machine().system().name, device.name(), device.tag()); 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()); std::string curtitle = win_get_window_text_utf8(window());
if (title != curtitle) if (title != curtitle)
win_set_window_text_utf8(window(), title.c_str()); win_set_window_text_utf8(window(), title.c_str());
// and recompute the children // and recompute the children
recompute_children(); recompute_children();
}
} }