From 1f80aa99597910fdd7e59fe30a0e4e4dd07ec6e6 Mon Sep 17 00:00:00 2001 From: smf- Date: Wed, 12 Jun 2013 19:28:18 +0000 Subject: [PATCH] moved a couple more variables (nw) --- src/emu/machine/idectrl.c | 41 +++++++++++++++++---------------------- src/emu/machine/idectrl.h | 3 --- src/emu/machine/idehd.c | 3 +++ src/emu/machine/idehd.h | 3 +++ 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index 634b05eb7b2..68fb9a6ebf7 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -312,7 +312,7 @@ void ide_controller_device::read_sector_done() count = dev->read_sector(lba, dev->buffer); /* by default, mark the buffer ready and the seek complete */ - if (!verify_only) + if (!dev->verify_only) status |= IDE_STATUS_BUFFER_READY; status |= IDE_STATUS_SEEK_COMPLETE; @@ -332,7 +332,7 @@ void ide_controller_device::read_sector_done() error = IDE_ERROR_NONE; /* signal an interrupt */ - if (!verify_only) + if (!dev->verify_only) sectors_until_int--; if (sectors_until_int == 0 || dev->sector_count == 1) { @@ -341,11 +341,11 @@ void ide_controller_device::read_sector_done() } /* handle DMA */ - if (dma_active) + if (dev->dma_active) set_dmarq(1); /* if we're just verifying we can read the next sector */ - if (verify_only) + if (dev->verify_only) read_buffer_empty(); } @@ -554,7 +554,7 @@ void ide_controller_device::write_sector_done() status &= ~IDE_STATUS_BUFFER_READY; /* keep going for DMA */ - if (dma_active && dev->sector_count != 0) + if (dev->dma_active && dev->sector_count != 0) { set_dmarq(1); } @@ -599,8 +599,8 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = 1; - dma_active = 0; - verify_only = 0; + dev->dma_active = 0; + dev->verify_only = 0; /* start the read going */ read_first_sector(); @@ -613,8 +613,8 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = 1; - dma_active = 0; - verify_only = 0; + dev->dma_active = 0; + dev->verify_only = 0; /* start the read going */ read_first_sector(); @@ -628,8 +628,8 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = 1; - dma_active = 0; - verify_only = 1; + dev->dma_active = 0; + dev->verify_only = 1; /* start the read going */ read_first_sector(); @@ -642,8 +642,8 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = dev->sector_count; - dma_active = 1; - verify_only = 0; + dev->dma_active = 1; + dev->verify_only = 0; /* start the read going */ read_first_sector(); @@ -657,7 +657,7 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = 1; - dma_active = 0; + dev->dma_active = 0; /* mark the buffer ready */ status |= IDE_STATUS_BUFFER_READY; @@ -670,7 +670,7 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = 1; - dma_active = 0; + dev->dma_active = 0; /* mark the buffer ready */ status |= IDE_STATUS_BUFFER_READY; @@ -683,7 +683,7 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = dev->sector_count; - dma_active = 1; + dev->dma_active = 1; /* start the read going */ set_dmarq(1); @@ -695,7 +695,7 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = 0; - dma_active = 0; + dev->dma_active = 0; /* mark the buffer ready */ status |= IDE_STATUS_BUFFER_READY; @@ -803,7 +803,7 @@ void ide_controller_device::handle_command(UINT8 _command) /* reset the buffer */ dev->buffer_offset = 0; sectors_until_int = 0; - dma_active = 0; + dev->dma_active = 0; /* mark the buffer ready */ status |= IDE_STATUS_BUFFER_READY; @@ -1275,7 +1275,6 @@ ide_controller_device::ide_controller_device(const machine_config &mconfig, devi command(0), interrupt_pending(0), sectors_until_int(0), - verify_only(0), config_unknown(0), config_register_num(0), cur_drive(0), @@ -1292,7 +1291,6 @@ ide_controller_device::ide_controller_device(const machine_config &mconfig, cons command(0), interrupt_pending(0), sectors_until_int(0), - verify_only(0), config_unknown(0), config_register_num(0), cur_drive(0), @@ -1323,9 +1321,6 @@ void ide_controller_device::device_start() save_item(NAME(interrupt_pending)); save_item(NAME(sectors_until_int)); - - save_item(NAME(dma_active)); - save_item(NAME(config_unknown)); save_item(NAME(config_register)); save_item(NAME(config_register_num)); diff --git a/src/emu/machine/idectrl.h b/src/emu/machine/idectrl.h index 37e7fa0a449..831c2ba98cc 100644 --- a/src/emu/machine/idectrl.h +++ b/src/emu/machine/idectrl.h @@ -129,11 +129,8 @@ private: UINT8 error; UINT8 command; - UINT8 dma_active; UINT8 interrupt_pending; - UINT16 sectors_until_int; - UINT8 verify_only; UINT8 config_unknown; UINT8 config_register[IDE_CONFIG_REGISTERS]; diff --git a/src/emu/machine/idehd.c b/src/emu/machine/idehd.c index 66dadae3113..97b96f13a48 100644 --- a/src/emu/machine/idehd.c +++ b/src/emu/machine/idehd.c @@ -263,6 +263,9 @@ void ide_hdd_device::device_start() save_item(NAME(gnetreadlock)); save_item(NAME(block_count)); + + save_item(NAME(dma_active)); + save_item(NAME(verify_only)); } //------------------------------------------------- diff --git a/src/emu/machine/idehd.h b/src/emu/machine/idehd.h index ef60fbf3222..3ae6e34efe0 100644 --- a/src/emu/machine/idehd.h +++ b/src/emu/machine/idehd.h @@ -36,6 +36,9 @@ public: UINT16 sector_count; UINT16 block_count; + UINT8 dma_active; + UINT8 verify_only; + UINT8 master_password_enable; UINT8 user_password_enable; const UINT8 * master_password;