mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
machine/ataflash.cpp: Untangle from the parallel ATA interface.
This isolates the ATA disk drive interface implementation from the physical parallel ATA device interface. The ATA Flash PC Card is no longer a kind of parallel ATA device.
This commit is contained in:
parent
4d944e28e4
commit
f197f35c25
@ -496,8 +496,6 @@ if (BUSES["ATA"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/ata/atadev.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/atadev.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/atahle.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/atahle.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/ataintf.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/ataintf.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/atapicdr.cpp",
|
||||
@ -508,10 +506,10 @@ if (BUSES["ATA"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/ata/cp2024.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/cr589.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/cr589.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/hdd.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/hdd.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/gdrom.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/gdrom.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/idehd.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/idehd.h",
|
||||
MAME_DIR .. "src/devices/bus/ata/px320a.cpp",
|
||||
MAME_DIR .. "src/devices/bus/ata/px320a.h",
|
||||
}
|
||||
|
@ -928,6 +928,18 @@ if (MACHINES["AT45DBXX"]~=null) then
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/atahle.h,MACHINES["ATAHLE"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (MACHINES["ATAHLE"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/machine/atahle.cpp",
|
||||
MAME_DIR .. "src/devices/machine/atahle.h",
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/ataflash.h,MACHINES["ATAFLASH"] = true
|
||||
@ -941,6 +953,18 @@ if (MACHINES["ATAFLASH"]~=null) then
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/atastorage.h,MACHINES["ATASTORAGE"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (MACHINES["ATASTORAGE"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/machine/atastorage.cpp",
|
||||
MAME_DIR .. "src/devices/machine/atastorage.h",
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/atmel_arm_aic.h,MACHINES["ARM_AIC"] = true
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "atapicdr.h"
|
||||
#include "cp2024.h"
|
||||
#include "idehd.h"
|
||||
#include "hdd.h"
|
||||
#include "px320a.h"
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -21,6 +21,7 @@ atapi_cdrom_device::atapi_cdrom_device(const machine_config &mconfig, const char
|
||||
|
||||
atapi_cdrom_device::atapi_cdrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
atapi_hle_device(mconfig, type, tag, owner, clock),
|
||||
device_ata_interface(mconfig, *this),
|
||||
ultra_dma_mode(0)
|
||||
{
|
||||
}
|
||||
|
@ -13,10 +13,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "atadev.h"
|
||||
#include "atapihle.h"
|
||||
|
||||
#include "machine/t10mmc.h"
|
||||
|
||||
class atapi_cdrom_device : public atapi_hle_device, public t10mmc
|
||||
|
||||
class atapi_cdrom_device : public atapi_hle_device, public device_ata_interface, public t10mmc
|
||||
{
|
||||
public:
|
||||
atapi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
@ -25,6 +28,20 @@ public:
|
||||
|
||||
uint16_t *identify_device_buffer() { return m_identify_buffer; }
|
||||
|
||||
// device_ata_interface implementation
|
||||
virtual uint16_t read_dma() override { return dma_r(); }
|
||||
virtual uint16_t read_cs0(offs_t offset, uint16_t mem_mask) override { return command_r(offset); }
|
||||
virtual uint16_t read_cs1(offs_t offset, uint16_t mem_mask) override { return control_r(offset); }
|
||||
|
||||
virtual void write_dma(uint16_t data) override { dma_w(data); }
|
||||
virtual void write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask) override { command_w(offset, data); }
|
||||
virtual void write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask) override { control_w(offset, data); }
|
||||
|
||||
virtual void write_dmack(int state) override { set_dmack_in(state); }
|
||||
virtual void write_csel(int state) override { set_csel_in(state); }
|
||||
virtual void write_dasp(int state) override { set_dasp_in(state); }
|
||||
virtual void write_pdiag(int state) override { set_pdiag_in(state); }
|
||||
|
||||
protected:
|
||||
atapi_cdrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
@ -40,6 +57,13 @@ protected:
|
||||
u32 m_sequence_counter;
|
||||
bool m_media_change;
|
||||
uint16_t ultra_dma_mode;
|
||||
|
||||
private:
|
||||
// ata_hle_device_base implementation
|
||||
virtual void set_irq_out(int state) override { device_ata_interface::set_irq(state); }
|
||||
virtual void set_dmarq_out(int state) override { device_ata_interface::set_dmarq(state); }
|
||||
virtual void set_dasp_out(int state) override { device_ata_interface::set_dasp(state); }
|
||||
virtual void set_pdiag_out(int state) override { device_ata_interface::set_pdiag(state); }
|
||||
};
|
||||
|
||||
class atapi_fixed_cdrom_device : public atapi_cdrom_device
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include "emu.h"
|
||||
#include "atapihle.h"
|
||||
|
||||
atapi_hle_device::atapi_hle_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ata_hle_device(mconfig, type, tag, owner, clock),
|
||||
atapi_hle_device::atapi_hle_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ata_hle_device_base(mconfig, type, tag, owner, clock),
|
||||
m_packet(0),
|
||||
m_data_size(0)
|
||||
{
|
||||
@ -13,13 +13,13 @@ atapi_hle_device::atapi_hle_device(const machine_config &mconfig, device_type ty
|
||||
void atapi_hle_device::device_start()
|
||||
{
|
||||
t10_start(*this);
|
||||
ata_hle_device::device_start();
|
||||
ata_hle_device_base::device_start();
|
||||
}
|
||||
|
||||
void atapi_hle_device::device_reset()
|
||||
{
|
||||
t10_reset();
|
||||
ata_hle_device::device_reset();
|
||||
ata_hle_device_base::device_reset();
|
||||
}
|
||||
|
||||
void atapi_hle_device::process_buffer()
|
||||
@ -257,7 +257,7 @@ void atapi_hle_device::process_command()
|
||||
break;
|
||||
|
||||
default:
|
||||
ata_hle_device::process_command();
|
||||
ata_hle_device_base::process_command();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -267,7 +267,7 @@ void atapi_hle_device::finished_command()
|
||||
switch (m_command)
|
||||
{
|
||||
default:
|
||||
ata_hle_device::finished_command();
|
||||
ata_hle_device_base::finished_command();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -13,10 +13,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "atahle.h"
|
||||
#include "machine/atahle.h"
|
||||
#include "machine/t10spc.h"
|
||||
|
||||
class atapi_hle_device : public ata_hle_device, public virtual t10spc
|
||||
class atapi_hle_device : public ata_hle_device_base, public virtual t10spc
|
||||
{
|
||||
public:
|
||||
enum atapi_features_flag_t
|
||||
|
45
src/devices/bus/ata/hdd.cpp
Normal file
45
src/devices/bus/ata/hdd.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:smf
|
||||
#include "emu.h"
|
||||
#include "hdd.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// IDE HARD DISK DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(IDE_HARDDISK, ide_hdd_device, "idehd", "IDE Hard Disk")
|
||||
|
||||
//-------------------------------------------------
|
||||
// ide_hdd_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ide_hdd_device::ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ide_hdd_device(mconfig, IDE_HARDDISK, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
ide_hdd_device::ide_hdd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ide_hdd_device_base(mconfig, type, tag, owner, clock),
|
||||
device_ata_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// ATA COMPACTFLASH CARD DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(ATA_CF, ata_cf_device, "atacf", "ATA CompactFlash Card")
|
||||
|
||||
//-------------------------------------------------
|
||||
// ata_cf_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ata_cf_device::ata_cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
cf_device_base(mconfig, ATA_CF, tag, owner, clock),
|
||||
device_ata_interface(mconfig, *this)
|
||||
{
|
||||
}
|
92
src/devices/bus/ata/hdd.h
Normal file
92
src/devices/bus/ata/hdd.h
Normal file
@ -0,0 +1,92 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:smf
|
||||
/***************************************************************************
|
||||
|
||||
hdd.h
|
||||
|
||||
IDE hard disk on ATA bus
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_ATA_IDEHD_H
|
||||
#define MAME_BUS_ATA_IDEHD_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "atadev.h"
|
||||
|
||||
#include "machine/atastorage.h"
|
||||
#include "imagedev/harddriv.h"
|
||||
|
||||
#include "harddisk.h"
|
||||
|
||||
|
||||
// ======================> ide_hdd_device
|
||||
|
||||
class ide_hdd_device : public ide_hdd_device_base, public device_ata_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device_ata_interface implementation
|
||||
virtual uint16_t read_dma() override { return dma_r(); }
|
||||
virtual uint16_t read_cs0(offs_t offset, uint16_t mem_mask) override { return command_r(offset); }
|
||||
virtual uint16_t read_cs1(offs_t offset, uint16_t mem_mask) override { return control_r(offset); }
|
||||
|
||||
virtual void write_dma(uint16_t data) override { dma_w(data); }
|
||||
virtual void write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask) override { command_w(offset, data); }
|
||||
virtual void write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask) override { control_w(offset, data); }
|
||||
|
||||
virtual void write_dmack(int state) override { set_dmack_in(state); }
|
||||
virtual void write_csel(int state) override { set_csel_in(state); }
|
||||
virtual void write_dasp(int state) override { set_dasp_in(state); }
|
||||
virtual void write_pdiag(int state) override { set_pdiag_in(state); }
|
||||
|
||||
protected:
|
||||
ide_hdd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
private:
|
||||
// ata_hle_device_base implementation
|
||||
virtual void set_irq_out(int state) override { device_ata_interface::set_irq(state); }
|
||||
virtual void set_dmarq_out(int state) override { device_ata_interface::set_dmarq(state); }
|
||||
virtual void set_dasp_out(int state) override { device_ata_interface::set_dasp(state); }
|
||||
virtual void set_pdiag_out(int state) override { device_ata_interface::set_pdiag(state); }
|
||||
};
|
||||
|
||||
|
||||
// ======================> ata_cf_device
|
||||
|
||||
class ata_cf_device : public cf_device_base, public device_ata_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ata_cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device_ata_interface implementation
|
||||
virtual uint16_t read_dma() override { return dma_r(); }
|
||||
virtual uint16_t read_cs0(offs_t offset, uint16_t mem_mask) override { return command_r(offset); }
|
||||
virtual uint16_t read_cs1(offs_t offset, uint16_t mem_mask) override { return control_r(offset); }
|
||||
|
||||
virtual void write_dma(uint16_t data) override { dma_w(data); }
|
||||
virtual void write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask) override { command_w(offset, data); }
|
||||
virtual void write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask) override { control_w(offset, data); }
|
||||
|
||||
virtual void write_dmack(int state) override { set_dmack_in(state); }
|
||||
virtual void write_csel(int state) override { set_csel_in(state); }
|
||||
virtual void write_dasp(int state) override { set_dasp_in(state); }
|
||||
virtual void write_pdiag(int state) override { set_pdiag_in(state); }
|
||||
|
||||
private:
|
||||
// ata_hle_device_base implementation
|
||||
virtual void set_irq_out(int state) override { device_ata_interface::set_irq(state); }
|
||||
virtual void set_dmarq_out(int state) override { device_ata_interface::set_dmarq(state); }
|
||||
virtual void set_dasp_out(int state) override { device_ata_interface::set_dasp(state); }
|
||||
virtual void set_pdiag_out(int state) override { device_ata_interface::set_pdiag(state); }
|
||||
};
|
||||
|
||||
// device type declaration
|
||||
DECLARE_DEVICE_TYPE(IDE_HARDDISK, ide_hdd_device)
|
||||
DECLARE_DEVICE_TYPE(ATA_CF, ata_cf_device)
|
||||
|
||||
#endif // MAME_BUS_ATA_IDEHD_H
|
@ -41,9 +41,8 @@ INPUT_PORTS_END
|
||||
// ide_device - constructor
|
||||
//-------------------------------------------------
|
||||
ide_device::ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, EPSON_QX_OPTION_IDE, tag, owner, clock),
|
||||
ide_hdd_device_base(mconfig, EPSON_QX_OPTION_IDE, tag, owner, clock),
|
||||
device_option_expansion_interface(mconfig, *this),
|
||||
m_hdd(*this, "hdd"),
|
||||
m_iobase(*this, "IOBASE"),
|
||||
m_installed(false)
|
||||
{
|
||||
@ -57,19 +56,13 @@ ioport_constructor ide_device::device_input_ports() const
|
||||
return INPUT_PORTS_NAME( ide );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - device-specific config
|
||||
//-------------------------------------------------
|
||||
void ide_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
IDE_HARDDISK(config, m_hdd, 0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
void ide_device::device_start()
|
||||
{
|
||||
ide_hdd_device_base::device_start();
|
||||
|
||||
m_installed = false;
|
||||
|
||||
save_item(NAME(m_installed));
|
||||
@ -80,6 +73,8 @@ void ide_device::device_start()
|
||||
//-------------------------------------------------
|
||||
void ide_device::device_reset()
|
||||
{
|
||||
ide_hdd_device_base::device_reset();
|
||||
|
||||
if (!m_installed) {
|
||||
address_space &space = m_bus->iospace();
|
||||
offs_t iobase = m_iobase->read() & 0xf0;
|
||||
@ -91,9 +86,9 @@ void ide_device::device_reset()
|
||||
uint8_t ide_device::read(offs_t offset)
|
||||
{
|
||||
if (offset < 8) {
|
||||
return m_hdd->read_cs0(offset);
|
||||
return command_r(offset);
|
||||
} else if (offset == 14 || offset == 15) {
|
||||
return m_hdd->read_cs1(offset & 7);
|
||||
return control_r(offset & 7);
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
@ -101,9 +96,9 @@ uint8_t ide_device::read(offs_t offset)
|
||||
void ide_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (offset < 8) {
|
||||
m_hdd->write_cs0(offset, data);
|
||||
command_w(offset, data);
|
||||
} else if (offset == 14) {
|
||||
m_hdd->write_cs1(offset & 7, data);
|
||||
control_w(offset & 7, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "option.h"
|
||||
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "machine/atastorage.h"
|
||||
|
||||
namespace bus::epson_qx {
|
||||
|
||||
@ -23,19 +23,17 @@ namespace bus::epson_qx {
|
||||
|
||||
/* Epson IDE Device */
|
||||
|
||||
class ide_device : public device_t, public bus::epson_qx::device_option_expansion_interface
|
||||
// TODO: this thing should probably implement the ATA controller interface rather than having an IDE hard disk with no slot
|
||||
class ide_device : public ide_hdd_device_base, public device_option_expansion_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
// device_t implementation
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
uint8_t read(offs_t offset);
|
||||
@ -44,7 +42,12 @@ protected:
|
||||
void map(address_map &map);
|
||||
|
||||
private:
|
||||
required_device<ide_hdd_device> m_hdd;
|
||||
// ata_hle_device_base implementation
|
||||
virtual void set_irq_out(int state) override { }
|
||||
virtual void set_dmarq_out(int state) override { }
|
||||
virtual void set_dasp_out(int state) override { }
|
||||
virtual void set_pdiag_out(int state) override { }
|
||||
|
||||
required_ioport m_iobase;
|
||||
|
||||
bool m_installed;
|
||||
|
@ -11,14 +11,14 @@ ata_flash_pccard_device::ata_flash_pccard_device(const machine_config &mconfig,
|
||||
}
|
||||
|
||||
ata_flash_pccard_device::ata_flash_pccard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ide_hdd_device(mconfig, type, tag, owner, clock)
|
||||
: ide_hdd_device_base(mconfig, type, tag, owner, clock)
|
||||
, device_pccard_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
void ata_flash_pccard_device::device_reset()
|
||||
{
|
||||
ide_hdd_device::device_reset();
|
||||
ide_hdd_device_base::device_reset();
|
||||
|
||||
if (m_image->exists())
|
||||
{
|
||||
@ -36,11 +36,11 @@ uint16_t ata_flash_pccard_device::read_memory(offs_t offset, uint16_t mem_mask)
|
||||
if(offset <= 7)
|
||||
{
|
||||
m_8bit_data_transfers = !ACCESSING_BITS_8_15; // HACK
|
||||
return read_cs0(offset, mem_mask);
|
||||
return command_r(offset);
|
||||
}
|
||||
else if(offset <= 15)
|
||||
{
|
||||
return read_cs1(offset & 7, mem_mask);
|
||||
return control_r(offset & 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -53,11 +53,11 @@ void ata_flash_pccard_device::write_memory(offs_t offset, uint16_t data, uint16_
|
||||
if(offset <= 7)
|
||||
{
|
||||
m_8bit_data_transfers = !ACCESSING_BITS_8_15; // HACK
|
||||
write_cs0(offset, data, mem_mask);
|
||||
command_w(offset, data);
|
||||
}
|
||||
else if( offset <= 15)
|
||||
{
|
||||
write_cs1(offset & 7, data, mem_mask);
|
||||
control_w(offset & 7, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "pccard.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "atastorage.h"
|
||||
|
||||
DECLARE_DEVICE_TYPE(ATA_FLASH_PCCARD, ata_flash_pccard_device)
|
||||
|
||||
class ata_flash_pccard_device : public ide_hdd_device, public device_pccard_interface
|
||||
class ata_flash_pccard_device : public ide_hdd_device_base, public device_pccard_interface
|
||||
{
|
||||
public:
|
||||
ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
@ -23,13 +23,19 @@ public:
|
||||
protected:
|
||||
ata_flash_pccard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
// device_t implementation
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual attotime seek_time() override;
|
||||
uint8_t calculate_status() override { return ata_hle_device::calculate_status(); }
|
||||
uint8_t calculate_status() override { return ata_hle_device_base::calculate_status(); }
|
||||
|
||||
private:
|
||||
// ata_hle_device_base implementation
|
||||
virtual void set_irq_out(int state) override { }
|
||||
virtual void set_dmarq_out(int state) override { }
|
||||
virtual void set_dasp_out(int state) override { }
|
||||
virtual void set_pdiag_out(int state) override { }
|
||||
|
||||
std::vector<uint8_t> m_cis;
|
||||
uint8_t m_configuration_option;
|
||||
uint8_t m_configuration_and_status;
|
||||
|
@ -40,9 +40,8 @@ enum
|
||||
#define DEVICE1_PDIAG_TIME (attotime::from_msec(2))
|
||||
#define DIAGNOSTIC_TIME (attotime::from_msec(2))
|
||||
|
||||
ata_hle_device::ata_hle_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ata_hle_device_base::ata_hle_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
device_ata_interface(mconfig, *this),
|
||||
m_buffer_offset(0),
|
||||
m_buffer_size(0),
|
||||
m_error(0),
|
||||
@ -70,7 +69,7 @@ ata_hle_device::ata_hle_device(const machine_config &mconfig, device_type type,
|
||||
{
|
||||
}
|
||||
|
||||
void ata_hle_device::device_start()
|
||||
void ata_hle_device_base::device_start()
|
||||
{
|
||||
MINIMUM_COMMAND_TIME = attotime::from_usec(10);
|
||||
|
||||
@ -105,11 +104,11 @@ void ata_hle_device::device_start()
|
||||
|
||||
save_item(NAME(m_identify_buffer));
|
||||
|
||||
m_busy_timer = timer_alloc(FUNC(ata_hle_device::busy_tick), this);
|
||||
m_buffer_empty_timer = timer_alloc(FUNC(ata_hle_device::empty_tick), this);
|
||||
m_busy_timer = timer_alloc(FUNC(ata_hle_device_base::busy_tick), this);
|
||||
m_buffer_empty_timer = timer_alloc(FUNC(ata_hle_device_base::empty_tick), this);
|
||||
}
|
||||
|
||||
void ata_hle_device::device_reset()
|
||||
void ata_hle_device_base::device_reset()
|
||||
{
|
||||
/* reset the drive state */
|
||||
set_dasp(CLEAR_LINE);
|
||||
@ -132,7 +131,7 @@ void ata_hle_device::device_reset()
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::soft_reset()
|
||||
void ata_hle_device_base::soft_reset()
|
||||
{
|
||||
m_buffer_offset = 0;
|
||||
m_buffer_size = 0;
|
||||
@ -146,19 +145,19 @@ void ata_hle_device::soft_reset()
|
||||
start_busy(DIAGNOSTIC_TIME, PARAM_DIAGNOSTIC);
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(ata_hle_device::busy_tick)
|
||||
TIMER_CALLBACK_MEMBER(ata_hle_device_base::busy_tick)
|
||||
{
|
||||
m_status &= ~IDE_STATUS_BSY;
|
||||
finished_busy(param);
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(ata_hle_device::empty_tick)
|
||||
TIMER_CALLBACK_MEMBER(ata_hle_device_base::empty_tick)
|
||||
{
|
||||
m_buffer_empty_timer->enable(false);
|
||||
fill_buffer();
|
||||
}
|
||||
|
||||
void ata_hle_device::finished_busy(int param)
|
||||
void ata_hle_device_base::finished_busy(int param)
|
||||
{
|
||||
switch (param)
|
||||
{
|
||||
@ -182,7 +181,7 @@ void ata_hle_device::finished_busy(int param)
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::process_command()
|
||||
void ata_hle_device_base::process_command()
|
||||
{
|
||||
switch (m_command)
|
||||
{
|
||||
@ -208,7 +207,7 @@ void ata_hle_device::process_command()
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::finished_command()
|
||||
void ata_hle_device_base::finished_command()
|
||||
{
|
||||
switch (m_command)
|
||||
{
|
||||
@ -240,7 +239,7 @@ void ata_hle_device::finished_command()
|
||||
}
|
||||
}
|
||||
|
||||
bool ata_hle_device::set_dma_mode(int word)
|
||||
bool ata_hle_device_base::set_dma_mode(int word)
|
||||
{
|
||||
if ((m_identify_buffer[word] >> (m_sector_count & 7)) & 1)
|
||||
{
|
||||
@ -255,7 +254,7 @@ bool ata_hle_device::set_dma_mode(int word)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ata_hle_device::set_features()
|
||||
bool ata_hle_device_base::set_features()
|
||||
{
|
||||
switch (m_feature)
|
||||
{
|
||||
@ -318,7 +317,7 @@ bool ata_hle_device::set_features()
|
||||
return false;
|
||||
}
|
||||
|
||||
int ata_hle_device::bit_to_mode(uint16_t word)
|
||||
int ata_hle_device_base::bit_to_mode(uint16_t word)
|
||||
{
|
||||
switch (word>>8)
|
||||
{
|
||||
@ -344,24 +343,24 @@ int ata_hle_device::bit_to_mode(uint16_t word)
|
||||
}
|
||||
|
||||
// Return the currently selected single word dma mode, -1 if none selected
|
||||
int ata_hle_device::single_word_dma_mode()
|
||||
int ata_hle_device_base::single_word_dma_mode()
|
||||
{
|
||||
return bit_to_mode(m_identify_buffer[62]);
|
||||
}
|
||||
|
||||
// Return the currently selected multi word dma mode, -1 if none selected
|
||||
int ata_hle_device::multi_word_dma_mode()
|
||||
int ata_hle_device_base::multi_word_dma_mode()
|
||||
{
|
||||
return bit_to_mode(m_identify_buffer[63]);
|
||||
}
|
||||
|
||||
// Return the currently selected ultra dma mode, -1 if none selected
|
||||
int ata_hle_device::ultra_dma_mode()
|
||||
int ata_hle_device_base::ultra_dma_mode()
|
||||
{
|
||||
return bit_to_mode(m_identify_buffer[88]);
|
||||
}
|
||||
|
||||
uint16_t ata_hle_device::read_data()
|
||||
uint16_t ata_hle_device_base::read_data()
|
||||
{
|
||||
/* fetch the correct amount of data */
|
||||
uint16_t result = m_buffer[m_buffer_offset++];
|
||||
@ -378,7 +377,7 @@ uint16_t ata_hle_device::read_data()
|
||||
return result;
|
||||
}
|
||||
|
||||
void ata_hle_device::write_data(uint16_t data)
|
||||
void ata_hle_device_base::write_data(uint16_t data)
|
||||
{
|
||||
/* store the correct amount of data */
|
||||
m_buffer[m_buffer_offset++] = data;
|
||||
@ -393,67 +392,27 @@ void ata_hle_device::write_data(uint16_t data)
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::update_irq()
|
||||
void ata_hle_device_base::update_irq()
|
||||
{
|
||||
if (device_selected() && (m_device_control & IDE_DEVICE_CONTROL_NIEN) == 0)
|
||||
device_ata_interface::set_irq(m_irq);
|
||||
set_irq_out(m_irq);
|
||||
else
|
||||
device_ata_interface::set_irq(CLEAR_LINE);
|
||||
set_irq_out(CLEAR_LINE);
|
||||
}
|
||||
|
||||
void ata_hle_device::set_irq(int state)
|
||||
{
|
||||
if (m_irq != state)
|
||||
{
|
||||
m_irq = state;
|
||||
|
||||
update_irq();
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::set_dmarq(int state)
|
||||
{
|
||||
if (m_dmarq != state)
|
||||
{
|
||||
m_dmarq = state;
|
||||
|
||||
device_ata_interface::set_dmarq(state);
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::set_dasp(int state)
|
||||
{
|
||||
if (m_daspout != state)
|
||||
{
|
||||
m_daspout = state;
|
||||
|
||||
device_ata_interface::set_dasp(state);
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::set_pdiag(int state)
|
||||
{
|
||||
if (m_pdiagout != state)
|
||||
{
|
||||
m_pdiagout = state;
|
||||
|
||||
device_ata_interface::set_pdiag(state);
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::start_busy(const attotime &time, int param)
|
||||
void ata_hle_device_base::start_busy(const attotime &time, int param)
|
||||
{
|
||||
m_status |= IDE_STATUS_BSY;
|
||||
m_busy_timer->adjust(time, param);
|
||||
}
|
||||
|
||||
void ata_hle_device::stop_busy()
|
||||
void ata_hle_device_base::stop_busy()
|
||||
{
|
||||
m_status &= ~IDE_STATUS_BSY;
|
||||
m_busy_timer->adjust(attotime::never);
|
||||
}
|
||||
|
||||
void ata_hle_device::read_buffer_empty()
|
||||
void ata_hle_device_base::read_buffer_empty()
|
||||
{
|
||||
m_buffer_offset = 0;
|
||||
|
||||
@ -471,7 +430,7 @@ void ata_hle_device::read_buffer_empty()
|
||||
fill_buffer();
|
||||
}
|
||||
|
||||
void ata_hle_device::write_buffer_full()
|
||||
void ata_hle_device_base::write_buffer_full()
|
||||
{
|
||||
m_buffer_offset = 0;
|
||||
|
||||
@ -484,7 +443,7 @@ void ata_hle_device::write_buffer_full()
|
||||
process_buffer();
|
||||
}
|
||||
|
||||
void ata_hle_device::start_diagnostic()
|
||||
void ata_hle_device_base::start_diagnostic()
|
||||
{
|
||||
m_error = IDE_ERROR_DIAGNOSTIC_FAILED;
|
||||
|
||||
@ -499,7 +458,7 @@ void ata_hle_device::start_diagnostic()
|
||||
finished_diagnostic();
|
||||
}
|
||||
|
||||
void ata_hle_device::finished_diagnostic()
|
||||
void ata_hle_device_base::finished_diagnostic()
|
||||
{
|
||||
m_resetting = false;
|
||||
|
||||
@ -507,17 +466,7 @@ void ata_hle_device::finished_diagnostic()
|
||||
}
|
||||
|
||||
|
||||
void ata_hle_device::write_csel(int state)
|
||||
{
|
||||
m_csel = state;
|
||||
}
|
||||
|
||||
void ata_hle_device::write_dasp(int state)
|
||||
{
|
||||
m_daspin = state;
|
||||
}
|
||||
|
||||
void ata_hle_device::write_dmack(int state)
|
||||
void ata_hle_device_base::set_dmack_in(int state)
|
||||
{
|
||||
if (state && !m_dmack && single_word_dma_mode() >= 0)
|
||||
set_dmarq(CLEAR_LINE);
|
||||
@ -525,7 +474,7 @@ void ata_hle_device::write_dmack(int state)
|
||||
m_dmack = state;
|
||||
}
|
||||
|
||||
void ata_hle_device::write_pdiag(int state)
|
||||
void ata_hle_device_base::set_pdiag_in(int state)
|
||||
{
|
||||
m_pdiagin = state;
|
||||
|
||||
@ -536,7 +485,7 @@ void ata_hle_device::write_pdiag(int state)
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t ata_hle_device::read_dma()
|
||||
uint16_t ata_hle_device_base::dma_r()
|
||||
{
|
||||
uint16_t result = 0xffff;
|
||||
|
||||
@ -578,7 +527,7 @@ uint16_t ata_hle_device::read_dma()
|
||||
return result;
|
||||
}
|
||||
|
||||
uint16_t ata_hle_device::read_cs0(offs_t offset, uint16_t mem_mask)
|
||||
uint16_t ata_hle_device_base::command_r(offs_t offset)
|
||||
{
|
||||
uint16_t result = 0xffff;
|
||||
|
||||
@ -586,7 +535,7 @@ uint16_t ata_hle_device::read_cs0(offs_t offset, uint16_t mem_mask)
|
||||
{
|
||||
if (m_dmack)
|
||||
{
|
||||
logerror( "%s: %s dev %d read_cs0 %04x %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset, mem_mask );
|
||||
logerror( "%s: %s dev %d read_cs0 %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset );
|
||||
}
|
||||
else if ((m_status & IDE_STATUS_BSY) && offset != IDE_CS0_STATUS_R)
|
||||
{
|
||||
@ -597,7 +546,7 @@ uint16_t ata_hle_device::read_cs0(offs_t offset, uint16_t mem_mask)
|
||||
switch (offset)
|
||||
{
|
||||
case IDE_CS0_DATA_RW:
|
||||
logerror( "%s: %s dev %d read_cs0 %04x %04x ignored (BSY)\n", machine().describe_context(), tag(), dev(), offset, mem_mask );
|
||||
logerror( "%s: %s dev %d read_cs0 %04x ignored (BSY)\n", machine().describe_context(), tag(), dev(), offset );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -682,7 +631,7 @@ uint16_t ata_hle_device::read_cs0(offs_t offset, uint16_t mem_mask)
|
||||
|
||||
/* log anything else */
|
||||
default:
|
||||
logerror("%s:unknown IDE cs0 read at %03X, mem_mask=%X\n", machine().describe_context(), offset, mem_mask);
|
||||
logerror("%s:unknown IDE cs0 read at %03X\n", machine().describe_context(), offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -690,18 +639,18 @@ uint16_t ata_hle_device::read_cs0(offs_t offset, uint16_t mem_mask)
|
||||
|
||||
/* logit */
|
||||
// if (offset != IDE_CS0_DATA_RW && offset != IDE_CS0_STATUS_R)
|
||||
LOG(("%s:IDE cs0 read %X at %X (err: %X), mem_mask=%X\n", machine().describe_context(), result, offset, m_error, mem_mask));
|
||||
LOG(("%s:IDE cs0 read %X at %X (err: %X)\n", machine().describe_context(), result, offset, m_error));
|
||||
|
||||
/* return the result */
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
uint16_t ata_hle_device::read_cs1(offs_t offset, uint16_t mem_mask)
|
||||
uint16_t ata_hle_device_base::control_r(offs_t offset)
|
||||
{
|
||||
/* logit */
|
||||
// if (offset != IDE_CS1_ALTERNATE_STATUS_R)
|
||||
LOG(("%s:IDE cs1 read at %X, mem_mask=%d\n", machine().describe_context(), offset, mem_mask));
|
||||
LOG(("%s:IDE cs1 read at %X\n", machine().describe_context(), offset));
|
||||
|
||||
uint16_t result = 0xffff;
|
||||
|
||||
@ -709,7 +658,7 @@ uint16_t ata_hle_device::read_cs1(offs_t offset, uint16_t mem_mask)
|
||||
{
|
||||
if (m_dmack)
|
||||
{
|
||||
logerror( "%s: %s dev %d read_cs1 %04x %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset, mem_mask );
|
||||
logerror( "%s: %s dev %d read_cs1 %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -753,7 +702,7 @@ uint16_t ata_hle_device::read_cs1(offs_t offset, uint16_t mem_mask)
|
||||
|
||||
/* log anything else */
|
||||
default:
|
||||
logerror("%s:unknown IDE cs1 read at %03X, mem_mask=%d\n", machine().describe_context(), offset, mem_mask);
|
||||
logerror("%s:unknown IDE cs1 read at %03X\n", machine().describe_context(), offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -763,7 +712,7 @@ uint16_t ata_hle_device::read_cs1(offs_t offset, uint16_t mem_mask)
|
||||
return result;
|
||||
}
|
||||
|
||||
void ata_hle_device::write_dma( uint16_t data )
|
||||
void ata_hle_device_base::dma_w(uint16_t data)
|
||||
{
|
||||
if (device_selected())
|
||||
{
|
||||
@ -801,23 +750,23 @@ void ata_hle_device::write_dma( uint16_t data )
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
void ata_hle_device_base::command_w(offs_t offset, uint16_t data)
|
||||
{
|
||||
/* logit */
|
||||
if (offset != IDE_CS0_DATA_RW)
|
||||
LOG(("%s:IDE cs0 write to %X = %08X, mem_mask=%d\n", machine().describe_context(), offset, data, mem_mask));
|
||||
LOG(("%s:IDE cs0 write to %X = %04X\n", machine().describe_context(), offset, data));
|
||||
|
||||
if (m_dmack)
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask );
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset, data );
|
||||
}
|
||||
else if ((m_status & IDE_STATUS_BSY) && offset != IDE_CS0_COMMAND_W)
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x %04x ignored (BSY) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask, m_command );
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x ignored (BSY) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, m_command );
|
||||
}
|
||||
else if ((m_status & IDE_STATUS_DRQ) && offset != IDE_CS0_DATA_RW && offset != IDE_CS0_COMMAND_W)
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x %04x ignored (DRQ) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask, m_command );
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x ignored (DRQ) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, m_command );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -831,7 +780,7 @@ void ata_hle_device::write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
{
|
||||
if (!(m_status & IDE_STATUS_DRQ))
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x %04x ignored (!DRQ)\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask );
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x ignored (!DRQ)\n", machine().describe_context(), tag(), dev(), offset, data );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -878,11 +827,11 @@ void ata_hle_device::write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
// Packet devices can accept DEVICE RESET when BSY or DRQ is set.
|
||||
if (m_status & IDE_STATUS_BSY)
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x %04x ignored (BSY) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask, m_command );
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x ignored (BSY) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, m_command );
|
||||
}
|
||||
else if (m_status & IDE_STATUS_DRQ)
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x %04x ignored (DRQ) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask, m_command );
|
||||
logerror( "%s: %s dev %d write_cs0 %04x %04x ignored (DRQ) command %02x\n", machine().describe_context(), tag(), dev(), offset, data, m_command );
|
||||
}
|
||||
else if (device_selected() || m_command == IDE_COMMAND_DIAGNOSTIC)
|
||||
{
|
||||
@ -904,20 +853,20 @@ void ata_hle_device::write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
break;
|
||||
|
||||
default:
|
||||
logerror("%s:unknown IDE cs0 write at %03X = %04x, mem_mask=%d\n", machine().describe_context(), offset, data, mem_mask);
|
||||
logerror("%s:unknown IDE cs0 write at %03X = %04x\n", machine().describe_context(), offset, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ata_hle_device::write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
void ata_hle_device_base::control_w(offs_t offset, uint16_t data)
|
||||
{
|
||||
/* logit */
|
||||
LOG(("%s:IDE cs1 write to %X = %08X, mem_mask=%d\n", machine().describe_context(), offset, data, mem_mask));
|
||||
LOG(("%s:IDE cs1 write to %X = %08X\n", machine().describe_context(), offset, data));
|
||||
|
||||
if (m_dmack)
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs1 %04x %04x %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask );
|
||||
logerror( "%s: %s dev %d write_cs1 %04x %04x ignored (DMACK)\n", machine().describe_context(), tag(), dev(), offset, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -939,7 +888,7 @@ void ata_hle_device::write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
{
|
||||
if (m_resetting)
|
||||
{
|
||||
logerror( "%s: %s dev %d write_cs1 %04x %04x %04x ignored (RESET)\n", machine().describe_context(), tag(), dev(), offset, data, mem_mask );
|
||||
logerror( "%s: %s dev %d write_cs1 %04x %04x ignored (RESET)\n", machine().describe_context(), tag(), dev(), offset, data );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -959,7 +908,7 @@ void ata_hle_device::write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
break;
|
||||
|
||||
default:
|
||||
logerror("%s:unknown IDE cs1 write at %03X = %04x, mem_mask=%d\n", machine().describe_context(), offset, data, mem_mask);
|
||||
logerror("%s:unknown IDE cs1 write at %03X = %04x\n", machine().describe_context(), offset, data);
|
||||
break;
|
||||
}
|
||||
}
|
@ -7,31 +7,15 @@
|
||||
ATA Device HLE
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_ATA_ATAHLE_H
|
||||
#define MAME_BUS_ATA_ATAHLE_H
|
||||
#ifndef MAME_MACHINE_ATAHLE_H
|
||||
#define MAME_MACHINE_ATAHLE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "atadev.h"
|
||||
|
||||
class ata_hle_device : public device_t, public device_ata_interface
|
||||
class ata_hle_device_base : public device_t
|
||||
{
|
||||
public:
|
||||
virtual uint16_t read_dma() override;
|
||||
virtual uint16_t read_cs0(offs_t offset, uint16_t mem_mask = 0xffff) override;
|
||||
virtual uint16_t read_cs1(offs_t offset, uint16_t mem_mask = 0xffff) override;
|
||||
|
||||
virtual void write_dma(uint16_t data) override;
|
||||
virtual void write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask = 0xffff) override;
|
||||
virtual void write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask = 0xffff) override;
|
||||
virtual void write_csel(int state) override;
|
||||
virtual void write_dasp(int state) override;
|
||||
virtual void write_dmack(int state) override;
|
||||
virtual void write_pdiag(int state) override;
|
||||
|
||||
protected:
|
||||
ata_hle_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
ata_hle_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
@ -39,10 +23,54 @@ protected:
|
||||
TIMER_CALLBACK_MEMBER(busy_tick);
|
||||
TIMER_CALLBACK_MEMBER(empty_tick);
|
||||
|
||||
void set_irq(int state);
|
||||
void set_dmarq(int state);
|
||||
void set_dasp(int state);
|
||||
void set_pdiag(int state);
|
||||
uint16_t dma_r();
|
||||
uint16_t command_r(offs_t offset);
|
||||
uint16_t control_r(offs_t offset);
|
||||
|
||||
void dma_w(uint16_t data);
|
||||
void command_w(offs_t offset, uint16_t data);
|
||||
void control_w(offs_t offset, uint16_t data);
|
||||
|
||||
void set_csel_in(int state) { m_csel = state; }
|
||||
void set_dasp_in(int state) { m_daspin = state; }
|
||||
void set_dmack_in(int state);
|
||||
void set_pdiag_in(int state);
|
||||
|
||||
void set_irq(int state)
|
||||
{
|
||||
if (m_irq != state)
|
||||
{
|
||||
m_irq = state;
|
||||
update_irq();
|
||||
}
|
||||
}
|
||||
|
||||
void set_dmarq(int state)
|
||||
{
|
||||
if (m_dmarq != state)
|
||||
{
|
||||
m_dmarq = state;
|
||||
set_dmarq_out(state);
|
||||
}
|
||||
}
|
||||
|
||||
void set_dasp(int state)
|
||||
{
|
||||
if (m_daspout != state)
|
||||
{
|
||||
m_daspout = state;
|
||||
set_dasp_out(state);
|
||||
}
|
||||
}
|
||||
|
||||
void set_pdiag(int state)
|
||||
{
|
||||
if (m_pdiagout != state)
|
||||
{
|
||||
m_pdiagout = state;
|
||||
set_pdiag_out(state);
|
||||
}
|
||||
}
|
||||
|
||||
void start_busy(const attotime &time, int param);
|
||||
void stop_busy();
|
||||
@ -197,6 +225,11 @@ protected:
|
||||
bool m_8bit_data_transfers;
|
||||
|
||||
private:
|
||||
virtual void set_irq_out(int state) = 0;
|
||||
virtual void set_dmarq_out(int state) = 0;
|
||||
virtual void set_dasp_out(int state) = 0;
|
||||
virtual void set_pdiag_out(int state) = 0;
|
||||
|
||||
void update_irq();
|
||||
void write_buffer_full();
|
||||
void start_diagnostic();
|
||||
@ -220,4 +253,4 @@ private:
|
||||
emu_timer *m_buffer_empty_timer;
|
||||
};
|
||||
|
||||
#endif // MAME_BUS_ATA_ATAHLE_H
|
||||
#endif // MAME_MACHINE_ATAHLE_H
|
@ -1,7 +1,7 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:smf
|
||||
#include "emu.h"
|
||||
#include "idehd.h"
|
||||
#include "atastorage.h"
|
||||
|
||||
/***************************************************************************
|
||||
DEBUGGING
|
||||
@ -20,8 +20,8 @@
|
||||
#define TIME_FULL_STROKE_SEEK (attotime::from_usec(13000))
|
||||
#define TIME_AVERAGE_ROTATIONAL_LATENCY (attotime::from_usec(1300))
|
||||
|
||||
ata_mass_storage_device::ata_mass_storage_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ata_hle_device(mconfig, type, tag, owner, clock),
|
||||
ata_mass_storage_device_base::ata_mass_storage_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ata_hle_device_base(mconfig, type, tag, owner, clock),
|
||||
m_can_identify_device(0),
|
||||
m_num_cylinders(0),
|
||||
m_num_sectors(0),
|
||||
@ -38,7 +38,7 @@ ata_mass_storage_device::ata_mass_storage_device(const machine_config &mconfig,
|
||||
*
|
||||
*************************************/
|
||||
|
||||
uint32_t ata_mass_storage_device::lba_address()
|
||||
uint32_t ata_mass_storage_device_base::lba_address()
|
||||
{
|
||||
/* LBA direct? */
|
||||
if (m_device_head & IDE_DEVICE_HEAD_L)
|
||||
@ -87,7 +87,7 @@ static void swap_strncpy(uint16_t *dst, const char *src, int field_size_in_words
|
||||
}
|
||||
|
||||
|
||||
void ata_mass_storage_device::ide_build_identify_device()
|
||||
void ata_mass_storage_device_base::ide_build_identify_device()
|
||||
{
|
||||
memset(m_identify_buffer, 0, sizeof(m_identify_buffer));
|
||||
int total_sectors = m_num_cylinders * m_num_heads * m_num_sectors;
|
||||
@ -196,9 +196,9 @@ void ata_mass_storage_device::ide_build_identify_device()
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void ata_mass_storage_device::device_start()
|
||||
void ata_mass_storage_device_base::device_start()
|
||||
{
|
||||
ata_hle_device::device_start();
|
||||
ata_hle_device_base::device_start();
|
||||
|
||||
save_item(NAME(m_can_identify_device));
|
||||
save_item(NAME(m_num_cylinders));
|
||||
@ -212,9 +212,9 @@ void ata_mass_storage_device::device_start()
|
||||
save_item(NAME(m_block_count));
|
||||
}
|
||||
|
||||
void ata_mass_storage_device::soft_reset()
|
||||
void ata_mass_storage_device_base::soft_reset()
|
||||
{
|
||||
ata_hle_device::soft_reset();
|
||||
ata_hle_device_base::soft_reset();
|
||||
|
||||
m_cur_lba = 0;
|
||||
m_status |= IDE_STATUS_DSC;
|
||||
@ -223,13 +223,13 @@ void ata_mass_storage_device::soft_reset()
|
||||
m_user_password_enable = (m_user_password != nullptr);
|
||||
}
|
||||
|
||||
void ata_mass_storage_device::perform_diagnostic()
|
||||
void ata_mass_storage_device_base::perform_diagnostic()
|
||||
{
|
||||
if (m_can_identify_device)
|
||||
m_error = IDE_ERROR_DIAGNOSTIC_PASSED;
|
||||
}
|
||||
|
||||
void ata_mass_storage_device::signature()
|
||||
void ata_mass_storage_device_base::signature()
|
||||
{
|
||||
m_sector_count = 1;
|
||||
m_sector_number = 1;
|
||||
@ -238,7 +238,7 @@ void ata_mass_storage_device::signature()
|
||||
m_device_head = 0;
|
||||
}
|
||||
|
||||
void ata_mass_storage_device::finished_command()
|
||||
void ata_mass_storage_device_base::finished_command()
|
||||
{
|
||||
int total_sectors = m_num_cylinders * m_num_heads * m_num_sectors;
|
||||
|
||||
@ -298,7 +298,7 @@ void ata_mass_storage_device::finished_command()
|
||||
break;
|
||||
|
||||
default:
|
||||
ata_hle_device::finished_command();
|
||||
ata_hle_device_base::finished_command();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -309,7 +309,7 @@ void ata_mass_storage_device::finished_command()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void ata_mass_storage_device::next_sector()
|
||||
void ata_mass_storage_device_base::next_sector()
|
||||
{
|
||||
uint8_t cur_head = m_device_head & IDE_DEVICE_HEAD_HS;
|
||||
|
||||
@ -362,7 +362,7 @@ void ata_mass_storage_device::next_sector()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void ata_mass_storage_device::security_error()
|
||||
void ata_mass_storage_device_base::security_error()
|
||||
{
|
||||
/* set error state */
|
||||
m_status |= IDE_STATUS_ERR;
|
||||
@ -378,7 +378,7 @@ void ata_mass_storage_device::security_error()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
attotime ata_mass_storage_device::seek_time()
|
||||
attotime ata_mass_storage_device_base::seek_time()
|
||||
{
|
||||
int sectors_per_cylinder = m_num_heads * m_num_sectors;
|
||||
|
||||
@ -400,7 +400,7 @@ attotime ata_mass_storage_device::seek_time()
|
||||
return seek_time + TIME_AVERAGE_ROTATIONAL_LATENCY;
|
||||
}
|
||||
|
||||
void ata_mass_storage_device::fill_buffer()
|
||||
void ata_mass_storage_device_base::fill_buffer()
|
||||
{
|
||||
switch (m_command)
|
||||
{
|
||||
@ -437,7 +437,7 @@ void ata_mass_storage_device::fill_buffer()
|
||||
}
|
||||
|
||||
|
||||
void ata_mass_storage_device::finished_read()
|
||||
void ata_mass_storage_device_base::finished_read()
|
||||
{
|
||||
int lba = lba_address(), read_status;
|
||||
|
||||
@ -489,7 +489,7 @@ void ata_mass_storage_device::finished_read()
|
||||
}
|
||||
|
||||
|
||||
void ata_mass_storage_device::read_first_sector()
|
||||
void ata_mass_storage_device_base::read_first_sector()
|
||||
{
|
||||
if (m_master_password_enable || m_user_password_enable)
|
||||
{
|
||||
@ -509,7 +509,7 @@ void ata_mass_storage_device::read_first_sector()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void ata_mass_storage_device::process_buffer()
|
||||
void ata_mass_storage_device_base::process_buffer()
|
||||
{
|
||||
if (m_command == IDE_COMMAND_SECURITY_UNLOCK)
|
||||
{
|
||||
@ -571,7 +571,7 @@ void ata_mass_storage_device::process_buffer()
|
||||
}
|
||||
|
||||
|
||||
void ata_mass_storage_device::finished_write()
|
||||
void ata_mass_storage_device_base::finished_write()
|
||||
{
|
||||
int lba = lba_address(), count;
|
||||
|
||||
@ -627,7 +627,7 @@ void ata_mass_storage_device::finished_write()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void ata_mass_storage_device::process_command()
|
||||
void ata_mass_storage_device_base::process_command()
|
||||
{
|
||||
m_sectors_until_int = 0;
|
||||
m_buffer_size = IDE_DISK_SECTOR_SIZE;
|
||||
@ -780,7 +780,7 @@ void ata_mass_storage_device::process_command()
|
||||
break;
|
||||
|
||||
default:
|
||||
ata_hle_device::process_command();
|
||||
ata_hle_device_base::process_command();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -789,27 +789,19 @@ void ata_mass_storage_device::process_command()
|
||||
// IDE HARD DISK DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(IDE_HARDDISK, ide_hdd_device, "idehd", "IDE Hard Disk")
|
||||
|
||||
//-------------------------------------------------
|
||||
// ide_hdd_device - constructor
|
||||
// ide_hdd_device_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ide_hdd_device::ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ide_hdd_device(mconfig, IDE_HARDDISK, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
ide_hdd_device::ide_hdd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ata_mass_storage_device(mconfig, type, tag, owner, clock),
|
||||
ide_hdd_device_base::ide_hdd_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ata_mass_storage_device_base(mconfig, type, tag, owner, clock),
|
||||
m_image(*this, "image")
|
||||
{
|
||||
}
|
||||
|
||||
void ide_hdd_device::device_start()
|
||||
void ide_hdd_device_base::device_start()
|
||||
{
|
||||
ata_mass_storage_device::device_start();
|
||||
ata_mass_storage_device_base::device_start();
|
||||
|
||||
/* create a timer for timing status */
|
||||
m_last_status_timer = machine().scheduler().timer_alloc(timer_expired_delegate());
|
||||
@ -819,7 +811,7 @@ void ide_hdd_device::device_start()
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void ide_hdd_device::device_reset()
|
||||
void ide_hdd_device_base::device_reset()
|
||||
{
|
||||
if (m_image->exists() && !m_can_identify_device)
|
||||
{
|
||||
@ -851,12 +843,12 @@ void ide_hdd_device::device_reset()
|
||||
m_can_identify_device = 1;
|
||||
}
|
||||
|
||||
ata_mass_storage_device::device_reset();
|
||||
ata_mass_storage_device_base::device_reset();
|
||||
}
|
||||
|
||||
uint8_t ide_hdd_device::calculate_status()
|
||||
uint8_t ide_hdd_device_base::calculate_status()
|
||||
{
|
||||
uint8_t result = ata_hle_device::calculate_status();
|
||||
uint8_t result = ata_hle_device_base::calculate_status();
|
||||
|
||||
if (m_last_status_timer->elapsed() > TIME_PER_ROTATION)
|
||||
{
|
||||
@ -871,7 +863,7 @@ uint8_t ide_hdd_device::calculate_status()
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void ide_hdd_device::device_add_mconfig(machine_config &config)
|
||||
void ide_hdd_device_base::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
HARDDISK(config, "image", "ide_hdd");
|
||||
}
|
||||
@ -880,15 +872,12 @@ void ide_hdd_device::device_add_mconfig(machine_config &config)
|
||||
// ATA COMPACTFLASH CARD DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(ATA_CF, ide_cf_device, "atacf", "ATA CompactFlash Card")
|
||||
|
||||
//-------------------------------------------------
|
||||
// ide_cf_device - constructor
|
||||
// cf_device_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ide_cf_device::ide_cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ide_hdd_device(mconfig, ATA_CF, tag, owner, clock)
|
||||
cf_device_base::cf_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ide_hdd_device_base(mconfig, type, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
@ -896,7 +885,7 @@ ide_cf_device::ide_cf_device(const machine_config &mconfig, const char *tag, dev
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void ide_cf_device::device_add_mconfig(machine_config &config)
|
||||
void cf_device_base::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
HARDDISK(config, "image", "ata_cf");
|
||||
}
|
||||
@ -905,7 +894,7 @@ void ide_cf_device::device_add_mconfig(machine_config &config)
|
||||
// ide_build_identify_device
|
||||
//-------------------------------------------------
|
||||
|
||||
void ide_cf_device::ide_build_identify_device()
|
||||
void cf_device_base::ide_build_identify_device()
|
||||
{
|
||||
memset(m_identify_buffer, 0, sizeof(m_identify_buffer));
|
||||
int total_sectors = m_num_cylinders * m_num_heads * m_num_sectors;
|
@ -4,20 +4,23 @@
|
||||
|
||||
idehd.h
|
||||
|
||||
IDE Harddisk
|
||||
IDE hard disk
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_ATA_IDEHD_H
|
||||
#define MAME_BUS_ATA_IDEHD_H
|
||||
#ifndef MAME_MACHINE_ATASTORAGE_H
|
||||
#define MAME_MACHINE_ATASTORAGE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "atahle.h"
|
||||
#include "harddisk.h"
|
||||
|
||||
#include "imagedev/harddriv.h"
|
||||
|
||||
class ata_mass_storage_device : public ata_hle_device
|
||||
#include "harddisk.h"
|
||||
|
||||
|
||||
class ata_mass_storage_device_base : public ata_hle_device_base
|
||||
{
|
||||
public:
|
||||
uint16_t *identify_device_buffer() { return m_identify_buffer; }
|
||||
@ -35,8 +38,9 @@ public:
|
||||
}
|
||||
|
||||
void set_dma_transfer_time(const attotime time) { m_dma_transfer_time = time; }
|
||||
|
||||
protected:
|
||||
ata_mass_storage_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
ata_mass_storage_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_start() override;
|
||||
|
||||
@ -84,16 +88,13 @@ private:
|
||||
attotime m_dma_transfer_time;
|
||||
};
|
||||
|
||||
// ======================> ide_hdd_device
|
||||
// ======================> ide_hdd_device_base
|
||||
|
||||
class ide_hdd_device : public ata_mass_storage_device
|
||||
class ide_hdd_device_base : public ata_mass_storage_device_base
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
ide_hdd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
// construction/destruction
|
||||
ide_hdd_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
@ -117,23 +118,19 @@ private:
|
||||
emu_timer * m_last_status_timer;
|
||||
};
|
||||
|
||||
// ======================> ide_cf_device
|
||||
|
||||
class ide_cf_device : public ide_hdd_device
|
||||
// ======================> cf_device_base
|
||||
|
||||
class cf_device_base : public ide_hdd_device_base
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ide_cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// construction/destruction
|
||||
cf_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
void ide_build_identify_device() override;
|
||||
virtual void ide_build_identify_device() override;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(IDE_HARDDISK, ide_hdd_device)
|
||||
DECLARE_DEVICE_TYPE(ATA_CF, ide_cf_device)
|
||||
|
||||
#endif // MAME_BUS_ATA_IDEHD_H
|
||||
#endif // MAME_MACHINE_ATASTORAGE_H
|
@ -337,22 +337,24 @@ Notes:
|
||||
#include "emu.h"
|
||||
#include "jaguar.h"
|
||||
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "bus/generic/carts.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "cpu/jaguar/jaguar.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/m68000/m68020.h"
|
||||
#include "cpu/mips/mips1.h"
|
||||
#include "cpu/jaguar/jaguar.h"
|
||||
#include "imagedev/cdromimg.h"
|
||||
#include "imagedev/snapquik.h"
|
||||
#include "machine/eepromser.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "machine/vt83c461.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "sound/cdda.h"
|
||||
#include "cdrom.h"
|
||||
|
||||
#include "softlist_dev.h"
|
||||
#include "speaker.h"
|
||||
|
||||
#include "cdrom.h"
|
||||
|
||||
#define COJAG_CLOCK XTAL(52'000'000)
|
||||
#define R3000_CLOCK XTAL(40'000'000)
|
||||
#define M68K_CLOCK XTAL(50'000'000)
|
||||
|
@ -321,7 +321,7 @@
|
||||
#include "windy2.h"
|
||||
|
||||
#include "bus/ata/ataintf.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/powerpc/ppc.h"
|
||||
#include "machine/lpci.h"
|
||||
#include "machine/timekpr.h"
|
||||
|
@ -72,7 +72,7 @@ hard drive 3.5 adapter long 3.5 IDE cable 3.5 adapter PCB
|
||||
#include "konami_helper.h"
|
||||
|
||||
#include "bus/ata/ataintf.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/m68000/m68020.h"
|
||||
#include "sound/k054539.h"
|
||||
|
||||
|
@ -139,30 +139,31 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "k057714.h"
|
||||
#include "midikbd.h"
|
||||
|
||||
#include "bus/ata/ataintf.h"
|
||||
#include "bus/ata/atapicdr.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/powerpc/ppc.h"
|
||||
#include "machine/fdc37c665gt.h"
|
||||
#include "machine/ins8250.h"
|
||||
#include "machine/intelfsh.h"
|
||||
#include "machine/mb8421.h"
|
||||
#include "midikbd.h"
|
||||
#include "machine/rtc65271.h"
|
||||
#include "machine/timer.h"
|
||||
#include "sound/cdda.h"
|
||||
#include "sound/xt446.h"
|
||||
#include "sound/rf5c400.h"
|
||||
#include "sound/ymz280b.h"
|
||||
#include "k057714.h"
|
||||
|
||||
#include "imagedev/floppy.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
#include "osdcomm.h"
|
||||
|
||||
#include "wdlfft/fft.h"
|
||||
|
@ -403,15 +403,17 @@ The golf club acts like a LED gun. PCB power input is 12V.
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "cpu/powerpc/ppc.h"
|
||||
#include "cpu/upd78k/upd78k4.h"
|
||||
#include "bus/ata/ataintf.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "machine/lpci.h"
|
||||
#include "machine/timekpr.h"
|
||||
#include "machine/timer.h"
|
||||
#include "sound/dmadac.h"
|
||||
#include "video/voodoo_banshee.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "bus/ata/atapicdr.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "bus/isa/isa_cards.h"
|
||||
#include "cpu/i386/i386.h"
|
||||
#include "machine/at.h"
|
||||
|
@ -8,14 +8,14 @@
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/pci.h"
|
||||
#include "machine/idectrl.h"
|
||||
#include "xbox_pci.h"
|
||||
#include "xbox.h"
|
||||
|
||||
#include "cpu/i386/i386.h"
|
||||
#include "bus/ata/atapicdr.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/i386/i386.h"
|
||||
#include "machine/idectrl.h"
|
||||
#include "machine/pci.h"
|
||||
|
||||
#include "speaker.h"
|
||||
|
||||
@ -49,7 +49,7 @@ protected:
|
||||
|
||||
// devices
|
||||
optional_device<bus_master_ide_controller_device> m_ide;
|
||||
required_device<ata_mass_storage_device> m_devh;
|
||||
required_device<ata_mass_storage_device_base> m_devh;
|
||||
required_device<atapi_cdrom_device> m_devc;
|
||||
};
|
||||
|
||||
|
@ -191,7 +191,7 @@
|
||||
#include "cage.h"
|
||||
#include "dcs.h"
|
||||
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/adsp2100/adsp2100.h"
|
||||
#include "cpu/mips/mips3.h"
|
||||
#include "machine/gt64xxx.h"
|
||||
|
@ -277,7 +277,7 @@
|
||||
|
||||
#include "dcs.h"
|
||||
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "bus/rs232/rs232.h"
|
||||
#include "cpu/adsp2100/adsp2100.h"
|
||||
#include "cpu/mips/mips3.h"
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "emu.h"
|
||||
#include "turrett.h"
|
||||
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
|
||||
|
||||
/*************************************
|
||||
@ -331,7 +331,7 @@ public:
|
||||
if (m_device_head & IDE_DEVICE_HEAD_L)
|
||||
return (((m_device_head & IDE_DEVICE_HEAD_HS) << 24) | (m_cylinder_high << 16) | (m_cylinder_low << 8) | m_sector_number) - 63;
|
||||
|
||||
return ata_mass_storage_device::lba_address();
|
||||
return ide_hdd_device::lba_address();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -187,7 +187,7 @@ Notes:
|
||||
#include "dcs.h"
|
||||
|
||||
#include "bus/ata/ataintf.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/adsp2100/adsp2100.h"
|
||||
#include "cpu/mips/mips3.h"
|
||||
|
||||
|
@ -430,15 +430,15 @@ Thanks to Alex, Mr Mudkips, and Philip Burke for this info.
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "jvs13551.h"
|
||||
#include "xbox_pci.h"
|
||||
#include "xbox.h"
|
||||
|
||||
#include "machine/pci.h"
|
||||
#include "machine/idectrl.h"
|
||||
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/i386/i386.h"
|
||||
#include "jvs13551.h"
|
||||
#include "machine/jvshost.h"
|
||||
#include "naomigd.h"
|
||||
|
||||
@ -1506,22 +1506,46 @@ void ohci_hlean2131sc_device::device_start()
|
||||
|
||||
// ======================> ide_baseboard_device
|
||||
|
||||
class ide_baseboard_device : public ata_mass_storage_device
|
||||
class ide_baseboard_device : public ata_mass_storage_device_base, public device_ata_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ide_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device_ata_interface implementation
|
||||
virtual uint16_t read_dma() override { return dma_r(); }
|
||||
virtual uint16_t read_cs0(offs_t offset, uint16_t mem_mask) override { return command_r(offset); }
|
||||
virtual uint16_t read_cs1(offs_t offset, uint16_t mem_mask) override { return control_r(offset); }
|
||||
|
||||
virtual void write_dma(uint16_t data) override { dma_w(data); }
|
||||
virtual void write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask) override { command_w(offset, data); }
|
||||
virtual void write_cs1(offs_t offset, uint16_t data, uint16_t mem_mask) override { control_w(offset, data); }
|
||||
|
||||
virtual void write_dmack(int state) override { set_dmack_in(state); }
|
||||
virtual void write_csel(int state) override { set_csel_in(state); }
|
||||
virtual void write_dasp(int state) override { set_dasp_in(state); }
|
||||
virtual void write_pdiag(int state) override { set_pdiag_in(state); }
|
||||
|
||||
// ata_mass_storage_device_base implementation
|
||||
virtual int read_sector(uint32_t lba, void *buffer) override;
|
||||
virtual int write_sector(uint32_t lba, const void *buffer) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
// device_t implementation
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
uint8_t read_buffer[0x20]{};
|
||||
uint8_t write_buffer[0x20]{};
|
||||
chihiro_state *chihirosystem{};
|
||||
static const int size_factor = 2;
|
||||
|
||||
private:
|
||||
// ata_hle_device_base implementation
|
||||
virtual void set_irq_out(int state) override { device_ata_interface::set_irq(state); }
|
||||
virtual void set_dmarq_out(int state) override { device_ata_interface::set_dmarq(state); }
|
||||
virtual void set_dasp_out(int state) override { device_ata_interface::set_dasp(state); }
|
||||
virtual void set_pdiag_out(int state) override { device_ata_interface::set_pdiag(state); }
|
||||
};
|
||||
|
||||
//**************************************************************************
|
||||
@ -1536,7 +1560,8 @@ DEFINE_DEVICE_TYPE(IDE_BASEBOARD, ide_baseboard_device, "ide_baseboard", "IDE Ba
|
||||
//-------------------------------------------------
|
||||
|
||||
ide_baseboard_device::ide_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ata_mass_storage_device(mconfig, IDE_BASEBOARD, tag, owner, clock)
|
||||
: ata_mass_storage_device_base(mconfig, IDE_BASEBOARD, tag, owner, clock)
|
||||
, device_ata_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1546,7 +1571,7 @@ ide_baseboard_device::ide_baseboard_device(const machine_config &mconfig, const
|
||||
|
||||
void ide_baseboard_device::device_start()
|
||||
{
|
||||
ata_mass_storage_device::device_start();
|
||||
ata_mass_storage_device_base::device_start();
|
||||
chihirosystem = machine().driver_data<chihiro_state>();
|
||||
// savestates
|
||||
save_item(NAME(read_buffer));
|
||||
@ -1568,7 +1593,7 @@ void ide_baseboard_device::device_reset()
|
||||
m_can_identify_device = 1;
|
||||
}
|
||||
|
||||
ata_mass_storage_device::device_reset();
|
||||
ata_mass_storage_device_base::device_reset();
|
||||
}
|
||||
|
||||
int ide_baseboard_device::read_sector(uint32_t lba, void *buffer)
|
||||
|
@ -14,7 +14,7 @@ NOTES:
|
||||
#include "atm.h"
|
||||
|
||||
#include "bus/ata/atapicdr.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
#define LOG_MEM (1U << 1)
|
||||
|
@ -40,7 +40,7 @@ TODO:
|
||||
|
||||
#include "bus/ata/atapicdr.h"
|
||||
#include "bus/ata/ataintf.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "bus/isa/isa.h"
|
||||
#include "bus/isa/isa_cards.h"
|
||||
#include "bus/pc_kbd/keyboards.h"
|
||||
|
@ -873,91 +873,91 @@ ROM_END
|
||||
ROM_START(raycris)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "raycris", 0, SHA1(9d255710c87c3286542d357820d828807cc6ca07))
|
||||
ROM_END
|
||||
|
||||
ROM_START(raycrisj)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "raycrisj", 0, SHA1(015cb0e6c4421cc38809de28c4793b4491386aee))
|
||||
ROM_END
|
||||
|
||||
ROM_START(gobyrc)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard2:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard2" )
|
||||
DISK_IMAGE( "gobyrc", 0, SHA1(0bee1f495fc8b033fd56aad9260ae94abb35eb58))
|
||||
ROM_END
|
||||
|
||||
ROM_START(rcdego)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "rcdego", 0, SHA1(9e177f2a3954cfea0c8c5a288e116324d10f5dd1))
|
||||
ROM_END
|
||||
|
||||
ROM_START(chaoshea)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "chaosheat", 0, SHA1(c13b7d7025eee05f1f696d108801c7bafb3f1356))
|
||||
ROM_END
|
||||
|
||||
ROM_START(chaosheaj)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "chaosheatj", 0, SHA1(2f211ac08675ea8ec33c7659a13951db94eaa627))
|
||||
ROM_END
|
||||
|
||||
ROM_START(flipmaze)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "flipmaze", 0, SHA1(423b6c06f4f2d9a608ce20b61a3ac11687d22c40) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(spuzbobl)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard2:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard2" )
|
||||
DISK_IMAGE( "spuzbobl", 0, SHA1(1b1c72fb7e5656021485fefaef8f2ba48e2b4ea8))
|
||||
ROM_END
|
||||
|
||||
ROM_START(spuzboblj)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard2:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard2" )
|
||||
DISK_IMAGE( "spuzbobj", 0, SHA1(dac433cf88543d2499bf797d7406b82ae4338726))
|
||||
ROM_END
|
||||
|
||||
ROM_START(soutenry)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "soutenry", 0, SHA1(9204d0be833d29f37b8cd3fbdf09da69b622254b))
|
||||
ROM_END
|
||||
|
||||
ROM_START(shanghss)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "shanghss", 0, SHA1(7964f71ec5c81d2120d83b63a82f97fbad5a8e6d))
|
||||
ROM_END
|
||||
|
||||
ROM_START(sianniv)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "sianniv", 0, SHA1(1e08b813190a9e1baf29bc16884172d6c8da7ae3))
|
||||
ROM_END
|
||||
|
||||
ROM_START(kollon)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "kollon", 0, SHA1(d8ea5b5b0ee99004b16ef89883e23de6c7ddd7ce))
|
||||
ROM_END
|
||||
|
||||
@ -965,21 +965,21 @@ ROM_START(kollonc)
|
||||
TAITOGNET_BIOS
|
||||
ROM_DEFAULT_BIOS( "v2" )
|
||||
|
||||
DISK_REGION( "pccard:taitocf:image" )
|
||||
DISK_REGION( "ata:pccard:taitocf" )
|
||||
DISK_IMAGE( "kollonc", 0, SHA1(ce62181659701cfb8f7c564870ab902be4d8e060)) /* Original Taito Compact Flash version */
|
||||
ROM_END
|
||||
|
||||
ROM_START(shikigam)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "shikigam", 0, SHA1(fa49a0bc47f5cb7c30d7e49e2c3696b21bafb840))
|
||||
ROM_END
|
||||
|
||||
ROM_START(shikigama)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "shikigama", 0, SHA1(a6fe194c86730963301be9710782ca4ac1bf3e8d))
|
||||
ROM_END
|
||||
|
||||
@ -989,42 +989,42 @@ ROM_END
|
||||
ROM_START(otenamih)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "otenamih", 0, SHA1(b3babe3a1876c43745616ee1e7d87276ce7dad0b) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(psyvaria)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "psyvaria", 0, SHA1(3c7fca5180356190a8bf94b22a847fdd2e6a4e13))
|
||||
ROM_END
|
||||
|
||||
ROM_START(psyvarij)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "psyvarij", 0, SHA1(b981a42a10069322b77f7a268beae1d409b4156d))
|
||||
ROM_END
|
||||
|
||||
ROM_START(psyvarrv)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "psyvarrv", 0, SHA1(277c4f52502bcd7acc1889840962ec80d56465f3))
|
||||
ROM_END
|
||||
|
||||
ROM_START(zooo)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "zooo", 0, SHA1(e275b3141b2bc49142990e6b497a5394a314a30b))
|
||||
ROM_END
|
||||
|
||||
ROM_START(zokuoten)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "zokuoten", 0, SHA1(5ce13db00518f96af64935176c71ec68d2a51938))
|
||||
ROM_END
|
||||
|
||||
@ -1032,7 +1032,7 @@ ROM_START(otenamhf)
|
||||
TAITOGNET_BIOS
|
||||
ROM_DEFAULT_BIOS( "v2" )
|
||||
|
||||
DISK_REGION( "pccard:taitocf:image" )
|
||||
DISK_REGION( "ata:pccard:taitocf" )
|
||||
DISK_IMAGE( "otenamhf", 0, SHA1(5b15c33bf401e5546d78e905f538513d6ffcf562)) /* Original Taito Compact Flash version */
|
||||
ROM_END
|
||||
|
||||
@ -1042,14 +1042,14 @@ ROM_END
|
||||
ROM_START(nightrai)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "nightrai", 0, SHA1(74d0458f851cbcf10453c5cc4c47bb4388244cdf))
|
||||
ROM_END
|
||||
|
||||
ROM_START(otenki)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "otenki", 0, SHA1(7e745ca4c4570215f452fd09cdd56a42c39caeba))
|
||||
ROM_END
|
||||
|
||||
@ -1059,21 +1059,21 @@ ROM_END
|
||||
ROM_START(usagi)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard2:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard2" )
|
||||
DISK_IMAGE( "usagi", 0, SHA1(edf9dd271957f6cb06feed238ae21100514bef8e))
|
||||
ROM_END
|
||||
|
||||
ROM_START(mahjngoh)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "mahjngoh", 0, SHA1(3ef1110d15582d7c0187438d7ad61765dd121cff))
|
||||
ROM_END
|
||||
|
||||
ROM_START(shangtou)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "shanghaito", 0, SHA1(9901db5a9aae77e3af4157aa2c601eaab5b7ca85) )
|
||||
ROM_END
|
||||
|
||||
@ -1083,7 +1083,7 @@ ROM_END
|
||||
ROM_START(xiistag)
|
||||
TAITOGNET_BIOS
|
||||
|
||||
DISK_REGION( "pccard:taitopccard1:image" )
|
||||
DISK_REGION( "ata:pccard:taitopccard1" )
|
||||
DISK_IMAGE( "xiistag", 0, SHA1(586e37c8d926293b2bd928e5f0d693910cfb05a2))
|
||||
ROM_END
|
||||
|
||||
|
@ -173,7 +173,7 @@ Notes:
|
||||
|
||||
#include "emu.h"
|
||||
#include "bus/ata/ataintf.h"
|
||||
#include "bus/ata/idehd.h"
|
||||
#include "bus/ata/hdd.h"
|
||||
#include "cpu/powerpc/ppc.h"
|
||||
#include "cpu/tlcs900/tmp95c063.h"
|
||||
#include "machine/nvram.h"
|
||||
|
Loading…
Reference in New Issue
Block a user