From 1457cfa95fbe2a0eca20d27fee5691fd4dfce65d Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 1 Jul 2008 14:50:07 +0000 Subject: [PATCH] 01962: tailg: "Fatal error: Input ports cannot be read at init time!" with -debug --- src/mame/drivers/cinemat.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c index 0f23acd53b5..e64afe74d40 100644 --- a/src/mame/drivers/cinemat.c +++ b/src/mame/drivers/cinemat.c @@ -151,8 +151,13 @@ static WRITE8_HANDLER( mux_select_w ) static UINT8 joystick_read(void) { - int xval = (INT16)(cpunum_get_reg(0, CCPU_X) << 4) >> 4; - return (input_port_read_safe(Machine, mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800; + if (mame_get_phase(Machine) != MAME_PHASE_RUNNING) + return 0; + else + { + int xval = (INT16)(cpunum_get_reg(0, CCPU_X) << 4) >> 4; + return (input_port_read_safe(Machine, mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800; + } }