From 12a7bb6ea2d96e1d12ee23d7127b80a4abc3b3f0 Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 13 Jun 2013 12:35:02 +0000 Subject: [PATCH] moved the status timer across (nw) --- src/emu/machine/idectrl.c | 9 ++++----- src/emu/machine/idectrl.h | 1 - src/emu/machine/idehd.c | 13 +++++++++++++ src/emu/machine/idehd.h | 2 ++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index 63c5e47b5cb..7cdb7f8ede8 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -1006,10 +1006,10 @@ READ16_MEMBER( ide_controller_device::read_cs0 ) /* return the current status and clear any pending interrupts */ case IDE_BANK0_STATUS_COMMAND: result = dev->status; - if (last_status_timer->elapsed() > TIME_PER_ROTATION) + if (dev->last_status_timer->elapsed() > TIME_PER_ROTATION) { result |= IDE_STATUS_HIT_INDEX; - last_status_timer->adjust(attotime::never); + dev->last_status_timer->adjust(attotime::never); } if (dev->interrupt_pending == ASSERT_LINE) set_irq(CLEAR_LINE); @@ -1067,10 +1067,10 @@ READ16_MEMBER( ide_controller_device::read_cs1 ) { case IDE_BANK1_STATUS_CONTROL: result = dev->status; - if (last_status_timer->elapsed() > TIME_PER_ROTATION) + if (dev->last_status_timer->elapsed() > TIME_PER_ROTATION) { result |= IDE_STATUS_HIT_INDEX; - last_status_timer->adjust(attotime::never); + dev->last_status_timer->adjust(attotime::never); } break; @@ -1311,7 +1311,6 @@ void ide_controller_device::device_start() slot[1] = subdevice("1"); /* create a timer for timing status */ - last_status_timer = timer_alloc(TID_NULL); reset_timer = timer_alloc(TID_RESET_CALLBACK); /* register ide states */ diff --git a/src/emu/machine/idectrl.h b/src/emu/machine/idectrl.h index f9246bafa2d..3014ad98fc5 100644 --- a/src/emu/machine/idectrl.h +++ b/src/emu/machine/idectrl.h @@ -130,7 +130,6 @@ private: UINT8 config_register[IDE_CONFIG_REGISTERS]; UINT8 config_register_num; - emu_timer * last_status_timer; emu_timer * reset_timer; UINT8 cur_drive; diff --git a/src/emu/machine/idehd.c b/src/emu/machine/idehd.c index 6d1d2a6185a..9144cf8aa56 100644 --- a/src/emu/machine/idehd.c +++ b/src/emu/machine/idehd.c @@ -2,6 +2,17 @@ #define PRINTF_IDE_COMMANDS 0 +enum +{ + TID_NULL, + TID_DELAYED_INTERRUPT, + TID_DELAYED_INTERRUPT_BUFFER_READY, + TID_RESET_CALLBACK, + TID_SECURITY_ERROR_DONE, + TID_READ_SECTOR_DONE_CALLBACK, + TID_WRITE_SECTOR_DONE_CALLBACK +}; + //************************************************************************** // IDE DEVICE INTERFACE //************************************************************************** @@ -272,6 +283,8 @@ void ide_hdd_device::device_start() save_item(NAME(dma_active)); save_item(NAME(verify_only)); + + last_status_timer = timer_alloc(TID_NULL); } //------------------------------------------------- diff --git a/src/emu/machine/idehd.h b/src/emu/machine/idehd.h index 71e03e082ad..a727240d633 100644 --- a/src/emu/machine/idehd.h +++ b/src/emu/machine/idehd.h @@ -67,6 +67,8 @@ public: UINT8 gnetreadlock; + emu_timer * last_status_timer; + protected: UINT8 m_features[IDE_DISK_SECTOR_SIZE]; UINT16 m_num_cylinders;