Previous 199869 Revisions Next

r23823 Thursday 20th June, 2013 at 15:47:55 UTC by smf
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)
[src/emu/machine]atadev.c atadev.h ataintf.c ataintf.h idehd.c idehd.h
[src/mame/drivers]cobra.c djmain.c kinst.c taitotz.c viper.c

trunk/src/emu/machine/atadev.c
r23822r23823
1111//-------------------------------------------------
1212
1313ata_device_interface::ata_device_interface(const machine_config &mconfig, device_t &device) :
14   m_master_password(NULL),
15   m_user_password(NULL),
1614   m_irq_handler(device),
1715   m_dmarq_handler(device)
1816{
trunk/src/emu/machine/atadev.h
r23822r23823
3535   virtual DECLARE_WRITE_LINE_MEMBER(write_csel) = 0;
3636   virtual DECLARE_WRITE_LINE_MEMBER(write_dasp) = 0;
3737
38   virtual UINT8 *identify_device_buffer() = 0;
39
40   UINT8           m_master_password_enable;
41   UINT8           m_user_password_enable;
42   const UINT8 *   m_master_password;
43   const UINT8 *   m_user_password;
44
4538   devcb2_write_line m_irq_handler;
4639   devcb2_write_line m_dmarq_handler;
4740};
trunk/src/emu/machine/ataintf.c
r23822r23823
6767}
6868
6969
70/***************************************************************************
71    INITIALIZATION AND RESET
72***************************************************************************/
73
74UINT8 *ata_interface_device::identify_device_buffer(int _drive)
75{
76   return m_slot[_drive]->dev()->identify_device_buffer();
77}
78
79void ata_interface_device::set_master_password(int _drive, const UINT8 *password)
80{
81   m_slot[_drive]->dev()->m_master_password = password;
82   m_slot[_drive]->dev()->m_master_password_enable = (password != NULL);
83}
84
85
86void ata_interface_device::set_user_password(int _drive, const UINT8 *password)
87{
88   m_slot[_drive]->dev()->m_user_password = password;
89   m_slot[_drive]->dev()->m_user_password_enable = (password != NULL);
90}
91
9270/*************************************
9371 *
9472 *  ATA interface read
trunk/src/emu/machine/ataintf.h
r23822r23823
8383   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); }
8484   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); }
8585
86   UINT8 *identify_device_buffer(int drive);
87   void set_master_password(int drive, const UINT8 *password);
88   void set_user_password(int drive, const UINT8 *password);
89
9086   UINT16 read_dma();
9187   virtual DECLARE_READ16_MEMBER(read_cs0);
9288   virtual DECLARE_READ16_MEMBER(read_cs1);
trunk/src/emu/machine/idehd.c
r23822r23823
7878   m_dasp(0),
7979   m_dmack(0),
8080   m_dmarq(0),
81   m_irq(0)
81   m_irq(0),
82   m_master_password(NULL),
83   m_user_password(NULL)
8284{
8385}
8486
trunk/src/emu/machine/idehd.h
r23822r23823
6262   virtual DECLARE_WRITE_LINE_MEMBER(write_dasp);
6363   virtual DECLARE_WRITE_LINE_MEMBER(write_dmack);
6464
65   virtual UINT8 *identify_device_buffer() { return m_identify_device; }
66   
65   UINT8 *identify_device_buffer() { return m_identify_device; }
66
67   void set_master_password(const UINT8 *password)
68   {
69      m_master_password = password;
70      m_master_password_enable = (password != NULL);
71   }
72
73
74   void set_user_password(const UINT8 *password)
75   {
76      m_user_password = password;
77      m_user_password_enable = (password != NULL);
78   }
79
6780protected:
6881   virtual void device_start();
6982   virtual void device_reset();
r23822r23823
129142   UINT16          m_block_count;
130143   UINT16          m_sectors_until_int;
131144
145   UINT8           m_master_password_enable;
146   UINT8           m_user_password_enable;
147   const UINT8 *   m_master_password;
148   const UINT8 *   m_user_password;
149
132150   emu_timer *     m_last_status_timer;
133151   emu_timer *     m_reset_timer;
134152};
trunk/src/mame/drivers/cobra.c
r23822r23823
315315#include "cpu/powerpc/ppc.h"
316316#include "machine/pci.h"
317317#include "machine/ataintf.h"
318#include "machine/timekpr.h"
318#include "machine/idehd.h"
319319#include "machine/jvshost.h"
320320#include "machine/jvsdev.h"
321#include "machine/timekpr.h"
321322#include "video/konicdev.h"
322323#include "video/polynew.h"
323324#include "video/rgbgen.h"
r23822r23823
31633164{
31643165   m_sub_interrupt = 0xff;
31653166
3166   UINT8 *identify_device = m_ata->identify_device_buffer(0);
3167   ide_hdd_device *hdd = m_ata->subdevice<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd");
3168   UINT8 *identify_device = hdd->identify_device_buffer();
31673169
31683170   // Cobra expects these settings or the BIOS fails
31693171   identify_device[51*2+0] = 0;           /* 51: PIO data transfer cycle timing mode */
trunk/src/mame/drivers/djmain.c
r23822r23823
6969#include "sound/k054539.h"
7070#include "video/konicdev.h"
7171#include "includes/djmain.h"
72#include "machine/idehd.h"
7273
7374
7475
r23822r23823
13541355
13551356void djmain_state::machine_start()
13561357{
1358   ide_hdd_device *hdd = m_ata->subdevice<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd");
13571359   if (m_ata_master_password != NULL)
1358      m_ata->set_master_password(0, m_ata_master_password);
1360      hdd->set_master_password(m_ata_master_password);
1361
13591362   if (m_ata_user_password != NULL)
1360      m_ata->set_user_password(0, m_ata_user_password);
1363      hdd->set_user_password(m_ata_user_password);
13611364
13621365   save_item(NAME(m_sndram_bank));
13631366   save_item(NAME(m_pending_vb_int));
trunk/src/mame/drivers/viper.c
r23822r23823
285285#include "cpu/powerpc/ppc.h"
286286#include "machine/pci.h"
287287#include "machine/ataintf.h"
288#include "machine/idehd.h"
288289#include "machine/timekpr.h"
289290#include "video/voodoo.h"
290291
r23822r23823
20232024{
20242025   mpc8240_epic_reset();
20252026
2026   UINT8 *identify_device = m_ata->identify_device_buffer(0);
2027   ide_hdd_device *hdd = m_ata->subdevice<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd");
2028   UINT8 *identify_device = hdd->identify_device_buffer();
20272029
20282030   // Viper expects these settings or the BIOS fails
20292031   identify_device[51*2+0] = 0;           /* 51: PIO data transfer cycle timing mode */
trunk/src/mame/drivers/kinst.c
r23822r23823
132132#include "cpu/mips/mips3.h"
133133#include "cpu/adsp2100/adsp2100.h"
134134#include "machine/ataintf.h"
135#include "machine/idehd.h"
135136#include "machine/midwayic.h"
136137#include "audio/dcs.h"
137138
r23822r23823
215216
216217void kinst_state::machine_reset()
217218{
218   UINT8 *identify_device = m_ata->identify_device_buffer(0);
219   ide_hdd_device *hdd = m_ata->subdevice<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd");
220   UINT8 *identify_device = hdd->identify_device_buffer();
219221
220222   if (strncmp(machine().system().name, "kinst2", 6) != 0)
221223   {
trunk/src/mame/drivers/taitotz.c
r23822r23823
175175#include "cpu/powerpc/ppc.h"
176176#include "cpu/tlcs900/tlcs900.h"
177177#include "machine/ataintf.h"
178#include "machine/idehd.h"
178179#include "machine/nvram.h"
179180#include "video/polynew.h"
180181
r23822r23823
25302531{
25312532   if (m_hdd_serial_number != NULL)
25322533   {
2533      UINT8 *identify_device = m_ata->identify_device_buffer(0);
2534      ide_hdd_device *hdd = m_ata->subdevice<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd");
2535      UINT8 *identify_device = hdd->identify_device_buffer();
25342536
25352537      for (int i=0; i < 20; i++)
25362538      {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team