mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
cleanup of some conversions (nw)
This commit is contained in:
parent
d0bf3221ea
commit
eaa70ae031
@ -154,10 +154,10 @@ void iq151_minigraf_device::plotter_update(UINT8 control)
|
||||
m_pen = BIT(control, 7);
|
||||
|
||||
// clamp within range
|
||||
m_posx = std::max(m_posx, INT16(0));
|
||||
m_posx = std::min(m_posx, INT16(PAPER_MAX_X));
|
||||
m_posy = std::max(m_posy, INT16(0));
|
||||
m_posy = std::min(m_posy, INT16(PAPER_MAX_Y));
|
||||
m_posx = std::max<INT16>(m_posx, 0);
|
||||
m_posx = std::min<INT16>(m_posx, PAPER_MAX_X);
|
||||
m_posy = std::max<INT16>(m_posy, 0);
|
||||
m_posy = std::min<INT16>(m_posy, PAPER_MAX_Y);
|
||||
|
||||
// if pen is down draws a point
|
||||
if (m_pen)
|
||||
|
@ -349,7 +349,7 @@ void isa8_cga_device::device_start()
|
||||
set_isa_device();
|
||||
m_vram.resize(m_vram_size);
|
||||
m_isa->install_device(0x3d0, 0x3df, read8_delegate( FUNC(isa8_cga_device::io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
|
||||
m_isa->install_bank(0xb8000, 0xb8000 + std::min(size_t(0x8000),m_vram_size) - 1, "bank_cga", &m_vram[0]);
|
||||
m_isa->install_bank(0xb8000, 0xb8000 + std::min<UINT32>(0x8000,m_vram_size) - 1, "bank_cga", &m_vram[0]);
|
||||
if(m_vram_size == 0x4000)
|
||||
m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
|
||||
|
||||
@ -1821,7 +1821,7 @@ WRITE8_MEMBER( isa8_ec1841_0002_device::io_write )
|
||||
read8_delegate( FUNC(isa8_ec1841_0002_device::char_ram_read), this),
|
||||
write8_delegate(FUNC(isa8_ec1841_0002_device::char_ram_write), this) );
|
||||
} else {
|
||||
m_isa->install_bank(0xb8000, 0xb8000 + std::min(size_t(0x8000),m_vram_size) - 1, "bank_cga", &m_vram[0]);
|
||||
m_isa->install_bank(0xb8000, 0xb8000 + std::min<UINT32>(0x8000,m_vram_size) - 1, "bank_cga", &m_vram[0]);
|
||||
if(m_vram_size == 0x4000)
|
||||
m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ void msx_cart_nomapper::initialize_cartridge()
|
||||
break;
|
||||
}
|
||||
|
||||
m_end_address = std::min(m_start_address + size, UINT32(0x10000));
|
||||
m_end_address = std::min<UINT32>(m_start_address + size, 0x10000);
|
||||
}
|
||||
|
||||
READ8_MEMBER(msx_cart_nomapper::read_cart)
|
||||
|
@ -409,7 +409,7 @@ inline void ppc_device::set_timebase(UINT64 newtb)
|
||||
inline UINT32 ppc_device::get_decrementer()
|
||||
{
|
||||
INT64 cycles_until_zero = m_dec_zero_cycles - total_cycles();
|
||||
cycles_until_zero = std::max(cycles_until_zero, INT64(0));
|
||||
cycles_until_zero = std::max<INT64>(cycles_until_zero, 0);
|
||||
|
||||
if (!m_tb_divisor)
|
||||
{
|
||||
|
@ -332,7 +332,7 @@ legacy_poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t
|
||||
|
||||
/* allocate triangle work units */
|
||||
poly->unit_size = (flags & POLYFLAG_ALLOW_QUADS) ? sizeof(quad_work_unit) : sizeof(tri_work_unit);
|
||||
poly->unit_count = std::min(poly->polygon_count * UNITS_PER_POLY, UINT32(65535));
|
||||
poly->unit_count = std::min(poly->polygon_count * UNITS_PER_POLY, 65535U);
|
||||
poly->unit_next = 0;
|
||||
poly->unit = (work_unit **)allocate_array(machine, &poly->unit_size, poly->unit_count);
|
||||
|
||||
|
@ -67,7 +67,7 @@ debug_view_memory_source::debug_view_memory_source(const char *name, memory_regi
|
||||
m_length(region.bytes()),
|
||||
m_offsetxor(ENDIAN_VALUE_NE_NNE(region.endianness(), 0, region.bytewidth() - 1)),
|
||||
m_endianness(region.endianness()),
|
||||
m_prefsize(std::min(region.bytewidth(), UINT8(8)))
|
||||
m_prefsize(std::min<UINT8>(region.bytewidth(), 8))
|
||||
{
|
||||
}
|
||||
|
||||
@ -556,7 +556,7 @@ void debug_view_memory::recompute()
|
||||
m_bytes_per_chunk *= 2;
|
||||
m_chunks_per_row /= 2;
|
||||
}
|
||||
m_chunks_per_row = std::max(UINT32(1), m_chunks_per_row);
|
||||
m_chunks_per_row = std::max(1U, m_chunks_per_row);
|
||||
}
|
||||
|
||||
// recompute the byte offset based on the most recent expression result
|
||||
|
@ -1359,7 +1359,7 @@ void cheat_manager::frame_update()
|
||||
// set up for accumulating output
|
||||
m_lastline = 0;
|
||||
m_numlines = floor(1.0f / mame_machine_manager::instance()->ui().get_line_height());
|
||||
m_numlines = std::min(size_t(m_numlines), m_output.size());
|
||||
m_numlines = std::min<UINT8>(m_numlines, m_output.size());
|
||||
for (auto & elem : m_output)
|
||||
elem.clear();
|
||||
|
||||
|
@ -779,7 +779,7 @@ casserr_t cassette_read_modulated_data(cassette_image *cassette, int channel, do
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_length = std::min(length, UINT64(100000));
|
||||
buffer_length = std::min<UINT64>(length, 100000);
|
||||
alloc_buffer = (UINT8*)malloc(buffer_length);
|
||||
if (!alloc_buffer)
|
||||
{
|
||||
|
@ -514,8 +514,8 @@ void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_m
|
||||
{
|
||||
rgb_t rgb = m_entry_color[index];
|
||||
UINT32 y = 299 * rgb.r() + 587 * rgb.g() + 114 * rgb.b();
|
||||
ymin = std::min(ymin, INT32(y));
|
||||
ymax = std::max(ymax, INT32(y));
|
||||
ymin = std::min<INT32>(ymin, y);
|
||||
ymax = std::max<INT32>(ymax, y);
|
||||
}
|
||||
|
||||
// determine target minimum/maximum
|
||||
|
Loading…
Reference in New Issue
Block a user