mirror of
https://github.com/holub/mame
synced 2025-06-10 06:47:18 +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
|
// make up a format based on the mask
|
||||||
if (m_datamask == 0)
|
if (m_datamask == 0)
|
||||||
throw emu_fatalerror("%s state entry requires a nonzero mask\n", m_symbol);
|
throw emu_fatalerror("%s state entry requires a nonzero mask\n", m_symbol);
|
||||||
int width = 0;
|
int width = (63 - count_leading_zeros_64(m_datamask)) / 4 + 1;
|
||||||
for (u64 tempmask = m_datamask; tempmask != 0; tempmask >>= 4)
|
|
||||||
width++;
|
|
||||||
m_format = string_format("%%0%dX", width);
|
m_format = string_format("%%0%dX", width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user