moved the status timer across (nw)

This commit is contained in:
smf- 2013-06-13 12:35:02 +00:00
parent 493194ac6f
commit 12a7bb6ea2
4 changed files with 19 additions and 6 deletions

View File

@ -1006,10 +1006,10 @@ READ16_MEMBER( ide_controller_device::read_cs0 )
/* return the current status and clear any pending interrupts */ /* return the current status and clear any pending interrupts */
case IDE_BANK0_STATUS_COMMAND: case IDE_BANK0_STATUS_COMMAND:
result = dev->status; 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; result |= IDE_STATUS_HIT_INDEX;
last_status_timer->adjust(attotime::never); dev->last_status_timer->adjust(attotime::never);
} }
if (dev->interrupt_pending == ASSERT_LINE) if (dev->interrupt_pending == ASSERT_LINE)
set_irq(CLEAR_LINE); set_irq(CLEAR_LINE);
@ -1067,10 +1067,10 @@ READ16_MEMBER( ide_controller_device::read_cs1 )
{ {
case IDE_BANK1_STATUS_CONTROL: case IDE_BANK1_STATUS_CONTROL:
result = dev->status; 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; result |= IDE_STATUS_HIT_INDEX;
last_status_timer->adjust(attotime::never); dev->last_status_timer->adjust(attotime::never);
} }
break; break;
@ -1311,7 +1311,6 @@ void ide_controller_device::device_start()
slot[1] = subdevice<ide_slot_device>("1"); slot[1] = subdevice<ide_slot_device>("1");
/* create a timer for timing status */ /* create a timer for timing status */
last_status_timer = timer_alloc(TID_NULL);
reset_timer = timer_alloc(TID_RESET_CALLBACK); reset_timer = timer_alloc(TID_RESET_CALLBACK);
/* register ide states */ /* register ide states */

View File

@ -130,7 +130,6 @@ private:
UINT8 config_register[IDE_CONFIG_REGISTERS]; UINT8 config_register[IDE_CONFIG_REGISTERS];
UINT8 config_register_num; UINT8 config_register_num;
emu_timer * last_status_timer;
emu_timer * reset_timer; emu_timer * reset_timer;
UINT8 cur_drive; UINT8 cur_drive;

View File

@ -2,6 +2,17 @@
#define PRINTF_IDE_COMMANDS 0 #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 // IDE DEVICE INTERFACE
//************************************************************************** //**************************************************************************
@ -272,6 +283,8 @@ void ide_hdd_device::device_start()
save_item(NAME(dma_active)); save_item(NAME(dma_active));
save_item(NAME(verify_only)); save_item(NAME(verify_only));
last_status_timer = timer_alloc(TID_NULL);
} }
//------------------------------------------------- //-------------------------------------------------

View File

@ -67,6 +67,8 @@ public:
UINT8 gnetreadlock; UINT8 gnetreadlock;
emu_timer * last_status_timer;
protected: protected:
UINT8 m_features[IDE_DISK_SECTOR_SIZE]; UINT8 m_features[IDE_DISK_SECTOR_SIZE];
UINT16 m_num_cylinders; UINT16 m_num_cylinders;