diff --git a/src/mame/drivers/agat.cpp b/src/mame/drivers/agat.cpp index 6a899e085bd..4f7b20828b4 100644 --- a/src/mame/drivers/agat.cpp +++ b/src/mame/drivers/agat.cpp @@ -585,10 +585,24 @@ uint8_t agat_base_state::controller_strobe_r() void agat_base_state::controller_strobe_w(uint8_t data) { - m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_joy1x->read(); - m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_joy1y->read(); - m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_joy2x->read(); - m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_joy2y->read(); + // 555 monostable one-shot timers; a running timer cannot be restarted + if (machine().time().as_double() >= m_joystick_x1_time) + { + m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_joy1x->read(); + } + if (machine().time().as_double() >= m_joystick_y1_time) + { + m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_joy1y->read(); + } + if (machine().time().as_double() >= m_joystick_x2_time) + { + m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_joy2x->read(); + } + if (machine().time().as_double() >= m_joystick_y2_time) + { + m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_joy2y->read(); + } + } uint8_t agat_base_state::c080_r(offs_t offset) diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp index 21cc5fcfc00..d43eb3fa842 100644 --- a/src/mame/drivers/apple2.cpp +++ b/src/mame/drivers/apple2.cpp @@ -677,10 +677,24 @@ u8 apple2_state::controller_strobe_r() void apple2_state::controller_strobe_w(u8 data) { - m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); - m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); - m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); - m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + // 558 monostable one-shot timers; a running timer cannot be restarted + if (machine().time().as_double() >= m_joystick_x1_time) + { + m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); + } + if (machine().time().as_double() >= m_joystick_y1_time) + { + m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); + } + if (machine().time().as_double() >= m_joystick_x2_time) + { + m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); + } + if (machine().time().as_double() >= m_joystick_y2_time) + { + m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + } + } u8 apple2_state::c080_r(offs_t offset) diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index da3b6038563..d0279537c2c 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -1903,10 +1903,23 @@ void apple2e_state::do_io(int offset, bool is_iic) accel_normal_speed(); } - m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); - m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); - m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); - m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + // 558 monostable one-shot timers; a running timer cannot be restarted + if (machine().time().as_double() >= m_joystick_x1_time) + { + m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); + } + if (machine().time().as_double() >= m_joystick_y1_time) + { + m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); + } + if (machine().time().as_double() >= m_joystick_x2_time) + { + m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); + } + if (machine().time().as_double() >= m_joystick_y2_time) + { + m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + } break; default: diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index 1fc12562cd1..80f4588bcfe 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -2187,10 +2187,23 @@ void apple2gs_state::do_io(int offset) accel_normal_speed(); } - m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); - m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); - m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); - m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + // 558 monostable one-shot timers; a running timer cannot be restarted + if (machine().time().as_double() >= m_joystick_x1_time) + { + m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); + } + if (machine().time().as_double() >= m_joystick_y1_time) + { + m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); + } + if (machine().time().as_double() >= m_joystick_x2_time) + { + m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); + } + if (machine().time().as_double() >= m_joystick_y2_time) + { + m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + } break; default: @@ -2627,10 +2640,24 @@ u8 apple2gs_state::c000_r(offs_t offset) accel_normal_speed(); } - m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); - m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); - m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); - m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + // 558 monostable one-shot timers; a running timer cannot be restarted + if (machine().time().as_double() >= m_joystick_x1_time) + { + m_joystick_x1_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl0_r(); + } + if (machine().time().as_double() >= m_joystick_y1_time) + { + m_joystick_y1_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl1_r(); + } + if (machine().time().as_double() >= m_joystick_x2_time) + { + m_joystick_x2_time = machine().time().as_double() + m_x_calibration * m_gameio->pdl2_r(); + } + if (machine().time().as_double() >= m_joystick_y2_time) + { + m_joystick_y2_time = machine().time().as_double() + m_y_calibration * m_gameio->pdl3_r(); + } + } return m_rom[offset + 0x3c000];