summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/alto2/a2mouse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/alto2/a2mouse.cpp')
-rw-r--r--src/devices/cpu/alto2/a2mouse.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/devices/cpu/alto2/a2mouse.cpp b/src/devices/cpu/alto2/a2mouse.cpp
index 4ee209e6c1d..3747abb71ea 100644
--- a/src/devices/cpu/alto2/a2mouse.cpp
+++ b/src/devices/cpu/alto2/a2mouse.cpp
@@ -148,7 +148,7 @@ INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_x )
{
int16_t ox = static_cast<int16_t>(oldval);
int16_t nx = static_cast<int16_t>(newval);
- m_mouse.dx = std::min(std::max(0, m_mouse.dx + (nx - ox)), 639);
+ m_mouse.dx = std::clamp(m_mouse.dx + (nx - ox), 0, 639);
}
/**
@@ -162,7 +162,7 @@ INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_y )
{
int16_t oy = static_cast<int16_t>(oldval);
int16_t ny = static_cast<int16_t>(newval);
- m_mouse.dy = std::min(std::max(0, m_mouse.dy + (ny - oy)), 824);
+ m_mouse.dy = std::clamp(m_mouse.dy + (ny - oy), 0, 824);
}
/**
@@ -233,7 +233,7 @@ static const prom_load_t pl_madr_a32 =
void alto2_cpu_device::init_mouse()
{
memset(&m_mouse, 0, sizeof(m_mouse));
- m_madr_a32 = prom_load(machine(), &pl_madr_a32, memregion("madr_a32")->base());
+ m_madr_a32 = prom_load<uint8_t>(machine(), &pl_madr_a32, memregion("madr_a32")->base());
}
void alto2_cpu_device::exit_mouse()