Moved identify buffer manipulation and master/user password setting from ata interface to the ata mass storage device. These should be stored in the chd (nw)

This commit is contained in:
smf- 2013-06-20 15:47:55 +00:00
parent c630976e21
commit 0fbcc9a1a9
11 changed files with 41 additions and 45 deletions

View File

@ -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)
{

View File

@ -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;
};

View File

@ -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

View File

@ -83,10 +83,6 @@ public:
template<class _Object> static devcb2_base &set_irq_handler(device_t &device, _Object object) { return downcast<ata_interface_device &>(device).m_irq_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_dmarq_handler(device_t &device, _Object object) { return downcast<ata_interface_device &>(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);

View File

@ -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)
{
}

View File

@ -62,7 +62,20 @@ 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();
@ -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;
};

View File

@ -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<ata_slot_device>("0")->subdevice<ide_hdd_device>("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 */

View File

@ -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<ata_slot_device>("0")->subdevice<ide_hdd_device>("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));

View File

@ -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<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd");
UINT8 *identify_device = hdd->identify_device_buffer();
if (strncmp(machine().system().name, "kinst2", 6) != 0)
{

View File

@ -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<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd");
UINT8 *identify_device = hdd->identify_device_buffer();
for (int i=0; i < 20; i++)
{

View File

@ -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<ata_slot_device>("0")->subdevice<ide_hdd_device>("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 */