summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2017-09-15 00:03:07 +0200
committer hap <happppp@users.noreply.github.com>2017-09-15 00:03:07 +0200
commitb117f75925eeb44924d8c38c93c75117315bd147 (patch)
tree952b9b97e0197701dbf5fcad5c68d884b100a310
parent3663e561370aca95b0f07a48c16492f4308636ff (diff)
ioport: remove really bad usage of machine->rand() (nw)
-rw-r--r--src/emu/ioport.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index 3b408d808d2..eae5a94faa0 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -488,17 +488,12 @@ void digital_joystick::frame_update()
// to a diagonal, or from one diagonal directly to an extreme diagonal.
//
// The chances of this happening with a keyboard are slim, but we still need to
- // constrain this case.
- //
- // For now, just resolve randomly.
+ // constrain this case. Let's pick the horizontal axis.
//
if ((m_current4way & (UP_BIT | DOWN_BIT)) &&
(m_current4way & (LEFT_BIT | RIGHT_BIT)))
{
- if (machine->rand() & 1)
- m_current4way &= ~(LEFT_BIT | RIGHT_BIT);
- else
- m_current4way &= ~(UP_BIT | DOWN_BIT);
+ m_current4way &= ~(UP_BIT | DOWN_BIT);
}
}
}