diff --git a/src/emu/machine/atadev.c b/src/emu/machine/atadev.c index 0bbb77dfb17..73e2a63f61e 100644 --- a/src/emu/machine/atadev.c +++ b/src/emu/machine/atadev.c @@ -11,8 +11,6 @@ //------------------------------------------------- ata_device_interface::ata_device_interface(const machine_config &mconfig, device_t &device) : - m_master_password(NULL), - m_user_password(NULL), m_irq_handler(device), m_dmarq_handler(device) { diff --git a/src/emu/machine/atadev.h b/src/emu/machine/atadev.h index 39862bd958f..bf5a7c92423 100644 --- a/src/emu/machine/atadev.h +++ b/src/emu/machine/atadev.h @@ -35,13 +35,6 @@ public: virtual DECLARE_WRITE_LINE_MEMBER(write_csel) = 0; virtual DECLARE_WRITE_LINE_MEMBER(write_dasp) = 0; - virtual UINT8 *identify_device_buffer() = 0; - - UINT8 m_master_password_enable; - UINT8 m_user_password_enable; - const UINT8 * m_master_password; - const UINT8 * m_user_password; - devcb2_write_line m_irq_handler; devcb2_write_line m_dmarq_handler; }; diff --git a/src/emu/machine/ataintf.c b/src/emu/machine/ataintf.c index e194e8a6ff9..7d41cd81e5c 100644 --- a/src/emu/machine/ataintf.c +++ b/src/emu/machine/ataintf.c @@ -67,28 +67,6 @@ WRITE_LINE_MEMBER( ata_interface_device::dmarq1_write_line ) } -/*************************************************************************** - INITIALIZATION AND RESET -***************************************************************************/ - -UINT8 *ata_interface_device::identify_device_buffer(int _drive) -{ - return m_slot[_drive]->dev()->identify_device_buffer(); -} - -void ata_interface_device::set_master_password(int _drive, const UINT8 *password) -{ - m_slot[_drive]->dev()->m_master_password = password; - m_slot[_drive]->dev()->m_master_password_enable = (password != NULL); -} - - -void ata_interface_device::set_user_password(int _drive, const UINT8 *password) -{ - m_slot[_drive]->dev()->m_user_password = password; - m_slot[_drive]->dev()->m_user_password_enable = (password != NULL); -} - /************************************* * * ATA interface read diff --git a/src/emu/machine/ataintf.h b/src/emu/machine/ataintf.h index 162e7a84670..db17e736eed 100644 --- a/src/emu/machine/ataintf.h +++ b/src/emu/machine/ataintf.h @@ -83,10 +83,6 @@ public: template static devcb2_base &set_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } template static devcb2_base &set_dmarq_handler(device_t &device, _Object object) { return downcast(device).m_dmarq_handler.set_callback(object); } - UINT8 *identify_device_buffer(int drive); - void set_master_password(int drive, const UINT8 *password); - void set_user_password(int drive, const UINT8 *password); - UINT16 read_dma(); virtual DECLARE_READ16_MEMBER(read_cs0); virtual DECLARE_READ16_MEMBER(read_cs1); diff --git a/src/emu/machine/idehd.c b/src/emu/machine/idehd.c index ef1db95b4c9..ff5af4efee3 100644 --- a/src/emu/machine/idehd.c +++ b/src/emu/machine/idehd.c @@ -78,7 +78,9 @@ ata_mass_storage_device::ata_mass_storage_device(const machine_config &mconfig, m_dasp(0), m_dmack(0), m_dmarq(0), - m_irq(0) + m_irq(0), + m_master_password(NULL), + m_user_password(NULL) { } diff --git a/src/emu/machine/idehd.h b/src/emu/machine/idehd.h index 0dad83cb18d..e8d07a39c2a 100644 --- a/src/emu/machine/idehd.h +++ b/src/emu/machine/idehd.h @@ -62,8 +62,21 @@ public: virtual DECLARE_WRITE_LINE_MEMBER(write_dasp); virtual DECLARE_WRITE_LINE_MEMBER(write_dmack); - virtual UINT8 *identify_device_buffer() { return m_identify_device; } - + UINT8 *identify_device_buffer() { return m_identify_device; } + + void set_master_password(const UINT8 *password) + { + m_master_password = password; + m_master_password_enable = (password != NULL); + } + + + void set_user_password(const UINT8 *password) + { + m_user_password = password; + m_user_password_enable = (password != NULL); + } + protected: virtual void device_start(); virtual void device_reset(); @@ -129,6 +142,11 @@ private: UINT16 m_block_count; UINT16 m_sectors_until_int; + UINT8 m_master_password_enable; + UINT8 m_user_password_enable; + const UINT8 * m_master_password; + const UINT8 * m_user_password; + emu_timer * m_last_status_timer; emu_timer * m_reset_timer; }; diff --git a/src/mame/drivers/cobra.c b/src/mame/drivers/cobra.c index 552ac942acb..d54ce42c7c6 100644 --- a/src/mame/drivers/cobra.c +++ b/src/mame/drivers/cobra.c @@ -315,9 +315,10 @@ #include "cpu/powerpc/ppc.h" #include "machine/pci.h" #include "machine/ataintf.h" -#include "machine/timekpr.h" +#include "machine/idehd.h" #include "machine/jvshost.h" #include "machine/jvsdev.h" +#include "machine/timekpr.h" #include "video/konicdev.h" #include "video/polynew.h" #include "video/rgbgen.h" @@ -3163,7 +3164,8 @@ void cobra_state::machine_reset() { m_sub_interrupt = 0xff; - UINT8 *identify_device = m_ata->identify_device_buffer(0); + ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); + UINT8 *identify_device = hdd->identify_device_buffer(); // Cobra expects these settings or the BIOS fails identify_device[51*2+0] = 0; /* 51: PIO data transfer cycle timing mode */ diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c index 1dfb1f80f88..f3be6572557 100644 --- a/src/mame/drivers/djmain.c +++ b/src/mame/drivers/djmain.c @@ -69,6 +69,7 @@ hard drive 3.5 adapter long 3.5 IDE cable 3.5 adapter PCB #include "sound/k054539.h" #include "video/konicdev.h" #include "includes/djmain.h" +#include "machine/idehd.h" @@ -1354,10 +1355,12 @@ static const k054539_interface k054539_config = void djmain_state::machine_start() { + ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); if (m_ata_master_password != NULL) - m_ata->set_master_password(0, m_ata_master_password); + hdd->set_master_password(m_ata_master_password); + if (m_ata_user_password != NULL) - m_ata->set_user_password(0, m_ata_user_password); + hdd->set_user_password(m_ata_user_password); save_item(NAME(m_sndram_bank)); save_item(NAME(m_pending_vb_int)); diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c index 866eafb94c1..02bd679d847 100644 --- a/src/mame/drivers/kinst.c +++ b/src/mame/drivers/kinst.c @@ -132,6 +132,7 @@ Notes: #include "cpu/mips/mips3.h" #include "cpu/adsp2100/adsp2100.h" #include "machine/ataintf.h" +#include "machine/idehd.h" #include "machine/midwayic.h" #include "audio/dcs.h" @@ -215,7 +216,8 @@ void kinst_state::machine_start() void kinst_state::machine_reset() { - UINT8 *identify_device = m_ata->identify_device_buffer(0); + ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); + UINT8 *identify_device = hdd->identify_device_buffer(); if (strncmp(machine().system().name, "kinst2", 6) != 0) { diff --git a/src/mame/drivers/taitotz.c b/src/mame/drivers/taitotz.c index 7bc1a12f172..b27e58a3ea0 100644 --- a/src/mame/drivers/taitotz.c +++ b/src/mame/drivers/taitotz.c @@ -175,6 +175,7 @@ Notes: #include "cpu/powerpc/ppc.h" #include "cpu/tlcs900/tlcs900.h" #include "machine/ataintf.h" +#include "machine/idehd.h" #include "machine/nvram.h" #include "video/polynew.h" @@ -2530,7 +2531,8 @@ void taitotz_state::machine_reset() { if (m_hdd_serial_number != NULL) { - UINT8 *identify_device = m_ata->identify_device_buffer(0); + ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); + UINT8 *identify_device = hdd->identify_device_buffer(); for (int i=0; i < 20; i++) { diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c index 6b704a7ba4c..e24ee5ed0b9 100644 --- a/src/mame/drivers/viper.c +++ b/src/mame/drivers/viper.c @@ -285,6 +285,7 @@ An additional control PCB is used for Mocap Golf for the golf club sensor. It co #include "cpu/powerpc/ppc.h" #include "machine/pci.h" #include "machine/ataintf.h" +#include "machine/idehd.h" #include "machine/timekpr.h" #include "video/voodoo.h" @@ -2023,7 +2024,8 @@ void viper_state::machine_reset() { mpc8240_epic_reset(); - UINT8 *identify_device = m_ata->identify_device_buffer(0); + ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); + UINT8 *identify_device = hdd->identify_device_buffer(); // Viper expects these settings or the BIOS fails identify_device[51*2+0] = 0; /* 51: PIO data transfer cycle timing mode */