mirror of
https://github.com/holub/mame
synced 2025-04-16 05:24:54 +03:00
fixed one-shot paddle timers in Apple II and clones (#8504)
This commit is contained in:
parent
3e54ade4bc
commit
cd17ea8829
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user