trunk/src/emu/machine/atadev.h
| r23822 | r23823 | |
| 35 | 35 | virtual DECLARE_WRITE_LINE_MEMBER(write_csel) = 0; |
| 36 | 36 | virtual DECLARE_WRITE_LINE_MEMBER(write_dasp) = 0; |
| 37 | 37 | |
| 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 | | |
| 45 | 38 | devcb2_write_line m_irq_handler; |
| 46 | 39 | devcb2_write_line m_dmarq_handler; |
| 47 | 40 | }; |
trunk/src/emu/machine/ataintf.c
| r23822 | r23823 | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | | /*************************************************************************** |
| 71 | | INITIALIZATION AND RESET |
| 72 | | ***************************************************************************/ |
| 73 | | |
| 74 | | UINT8 *ata_interface_device::identify_device_buffer(int _drive) |
| 75 | | { |
| 76 | | return m_slot[_drive]->dev()->identify_device_buffer(); |
| 77 | | } |
| 78 | | |
| 79 | | void 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 | | |
| 86 | | void 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 | | |
| 92 | 70 | /************************************* |
| 93 | 71 | * |
| 94 | 72 | * ATA interface read |
trunk/src/emu/machine/ataintf.h
| r23822 | r23823 | |
| 83 | 83 | 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); } |
| 84 | 84 | 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); } |
| 85 | 85 | |
| 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 | | |
| 90 | 86 | UINT16 read_dma(); |
| 91 | 87 | virtual DECLARE_READ16_MEMBER(read_cs0); |
| 92 | 88 | virtual DECLARE_READ16_MEMBER(read_cs1); |
trunk/src/emu/machine/idehd.h
| r23822 | r23823 | |
| 62 | 62 | virtual DECLARE_WRITE_LINE_MEMBER(write_dasp); |
| 63 | 63 | virtual DECLARE_WRITE_LINE_MEMBER(write_dmack); |
| 64 | 64 | |
| 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 | |
| 67 | 80 | protected: |
| 68 | 81 | virtual void device_start(); |
| 69 | 82 | virtual void device_reset(); |
| r23822 | r23823 | |
| 129 | 142 | UINT16 m_block_count; |
| 130 | 143 | UINT16 m_sectors_until_int; |
| 131 | 144 | |
| 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 | |
| 132 | 150 | emu_timer * m_last_status_timer; |
| 133 | 151 | emu_timer * m_reset_timer; |
| 134 | 152 | }; |
trunk/src/mame/drivers/cobra.c
| r23822 | r23823 | |
| 315 | 315 | #include "cpu/powerpc/ppc.h" |
| 316 | 316 | #include "machine/pci.h" |
| 317 | 317 | #include "machine/ataintf.h" |
| 318 | | #include "machine/timekpr.h" |
| 318 | #include "machine/idehd.h" |
| 319 | 319 | #include "machine/jvshost.h" |
| 320 | 320 | #include "machine/jvsdev.h" |
| 321 | #include "machine/timekpr.h" |
| 321 | 322 | #include "video/konicdev.h" |
| 322 | 323 | #include "video/polynew.h" |
| 323 | 324 | #include "video/rgbgen.h" |
| r23822 | r23823 | |
| 3163 | 3164 | { |
| 3164 | 3165 | m_sub_interrupt = 0xff; |
| 3165 | 3166 | |
| 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(); |
| 3167 | 3169 | |
| 3168 | 3170 | // Cobra expects these settings or the BIOS fails |
| 3169 | 3171 | identify_device[51*2+0] = 0; /* 51: PIO data transfer cycle timing mode */ |
trunk/src/mame/drivers/djmain.c
| r23822 | r23823 | |
| 69 | 69 | #include "sound/k054539.h" |
| 70 | 70 | #include "video/konicdev.h" |
| 71 | 71 | #include "includes/djmain.h" |
| 72 | #include "machine/idehd.h" |
| 72 | 73 | |
| 73 | 74 | |
| 74 | 75 | |
| r23822 | r23823 | |
| 1354 | 1355 | |
| 1355 | 1356 | void djmain_state::machine_start() |
| 1356 | 1357 | { |
| 1358 | ide_hdd_device *hdd = m_ata->subdevice<ata_slot_device>("0")->subdevice<ide_hdd_device>("hdd"); |
| 1357 | 1359 | 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 | |
| 1359 | 1362 | 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); |
| 1361 | 1364 | |
| 1362 | 1365 | save_item(NAME(m_sndram_bank)); |
| 1363 | 1366 | save_item(NAME(m_pending_vb_int)); |
trunk/src/mame/drivers/viper.c
| r23822 | r23823 | |
| 285 | 285 | #include "cpu/powerpc/ppc.h" |
| 286 | 286 | #include "machine/pci.h" |
| 287 | 287 | #include "machine/ataintf.h" |
| 288 | #include "machine/idehd.h" |
| 288 | 289 | #include "machine/timekpr.h" |
| 289 | 290 | #include "video/voodoo.h" |
| 290 | 291 | |
| r23822 | r23823 | |
| 2023 | 2024 | { |
| 2024 | 2025 | mpc8240_epic_reset(); |
| 2025 | 2026 | |
| 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(); |
| 2027 | 2029 | |
| 2028 | 2030 | // Viper expects these settings or the BIOS fails |
| 2029 | 2031 | identify_device[51*2+0] = 0; /* 51: PIO data transfer cycle timing mode */ |
trunk/src/mame/drivers/kinst.c
| r23822 | r23823 | |
| 132 | 132 | #include "cpu/mips/mips3.h" |
| 133 | 133 | #include "cpu/adsp2100/adsp2100.h" |
| 134 | 134 | #include "machine/ataintf.h" |
| 135 | #include "machine/idehd.h" |
| 135 | 136 | #include "machine/midwayic.h" |
| 136 | 137 | #include "audio/dcs.h" |
| 137 | 138 | |
| r23822 | r23823 | |
| 215 | 216 | |
| 216 | 217 | void kinst_state::machine_reset() |
| 217 | 218 | { |
| 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(); |
| 219 | 221 | |
| 220 | 222 | if (strncmp(machine().system().name, "kinst2", 6) != 0) |
| 221 | 223 | { |
trunk/src/mame/drivers/taitotz.c
| r23822 | r23823 | |
| 175 | 175 | #include "cpu/powerpc/ppc.h" |
| 176 | 176 | #include "cpu/tlcs900/tlcs900.h" |
| 177 | 177 | #include "machine/ataintf.h" |
| 178 | #include "machine/idehd.h" |
| 178 | 179 | #include "machine/nvram.h" |
| 179 | 180 | #include "video/polynew.h" |
| 180 | 181 | |
| r23822 | r23823 | |
| 2530 | 2531 | { |
| 2531 | 2532 | if (m_hdd_serial_number != NULL) |
| 2532 | 2533 | { |
| 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(); |
| 2534 | 2536 | |
| 2535 | 2537 | for (int i=0; i < 20; i++) |
| 2536 | 2538 | { |