mirror of
https://github.com/holub/mame
synced 2025-06-05 20:33:45 +03:00
distate.cpp: Use count_leading_zeros_64 to calculate format width
This commit is contained in:
parent
62e064ae70
commit
7df764a9d3
@ -127,9 +127,7 @@ void device_state_entry::format_from_mask()
|
||||
// make up a format based on the mask
|
||||
if (m_datamask == 0)
|
||||
throw emu_fatalerror("%s state entry requires a nonzero mask\n", m_symbol);
|
||||
int width = 0;
|
||||
for (u64 tempmask = m_datamask; tempmask != 0; tempmask >>= 4)
|
||||
width++;
|
||||
int width = (63 - count_leading_zeros_64(m_datamask)) / 4 + 1;
|
||||
m_format = string_format("%%0%dX", width);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user