summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2008-10-12 02:00:52 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2008-10-12 02:00:52 +0000
commit876116276dac4d48784588d5b2a2ad96357cdc80 (patch)
tree794a74f2c2336933d55ae444a16640a5896ab8d5 /src
parent864820d8ade26280adbdb01da26fbdca2b677f99 (diff)
Fix Mantis #01447
Namcos22: prevent Prop Cycle analog controls from underflowing.
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/namcos22.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index cdf64360839..16af5759e6a 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -2576,8 +2576,13 @@ static READ8_HANDLER( propcycle_mcu_adc_r )
{
static UINT16 ddx, ddy;
- ddx = ((input_port_read(machine, "STICKX")^0xff) - 1)<<2;
- ddy = (input_port_read(machine, "STICKY") - 1)<<2;
+ ddx = input_port_read(machine, "STICKX")^0xff;
+ if (ddx > 0) ddx -= 1;
+ ddy = input_port_read(machine, "STICKY");
+ if (ddy > 0) ddy -= 1;
+
+ ddx <<= 2;
+ ddy <<= 2;
switch (offset)
{