mirror of
https://github.com/holub/mame
synced 2025-06-28 23:24:23 +03:00
simplified ide_device_interface part 2 (nw)
This commit is contained in:
parent
b6e4c8ef3a
commit
ed212f0406
@ -341,8 +341,8 @@ void ide_controller_device::device_start()
|
|||||||
dev->m_dmarq_handler.set_callback(DEVCB2_DEVWRITELINE("^", ide_controller_device, dmarq1_write_line));
|
dev->m_dmarq_handler.set_callback(DEVCB2_DEVWRITELINE("^", ide_controller_device, dmarq1_write_line));
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->m_csel = i;
|
dev->write_csel(i);
|
||||||
dev->m_dasp = m_slot[1]->dev() != NULL;
|
dev->write_dasp(m_slot[1]->dev() != NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,34 +80,46 @@ enum
|
|||||||
ide_device_interface::ide_device_interface(const machine_config &mconfig, device_t &device) :
|
ide_device_interface::ide_device_interface(const machine_config &mconfig, device_t &device) :
|
||||||
m_master_password(NULL),
|
m_master_password(NULL),
|
||||||
m_user_password(NULL),
|
m_user_password(NULL),
|
||||||
m_csel(0),
|
|
||||||
m_dasp(0),
|
|
||||||
m_irq_handler(device),
|
m_irq_handler(device),
|
||||||
m_dmarq_handler(device)
|
m_dmarq_handler(device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ide_device_interface::set_irq(int state)
|
ide_mass_storage_device::ide_mass_storage_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock,const char *shortname, const char *source)
|
||||||
|
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||||
|
ide_device_interface(mconfig, *this),
|
||||||
|
device_slot_card_interface(mconfig, *this),
|
||||||
|
m_csel(0),
|
||||||
|
m_dasp(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ide_mass_storage_device::set_irq(int state)
|
||||||
{
|
{
|
||||||
if (state == ASSERT_LINE)
|
if (state == ASSERT_LINE)
|
||||||
LOG(("IDE interrupt assert\n"));
|
LOG(("IDE interrupt assert\n"));
|
||||||
else
|
else
|
||||||
LOG(("IDE interrupt clear\n"));
|
LOG(("IDE interrupt clear\n"));
|
||||||
|
|
||||||
|
m_interrupt_pending = state;
|
||||||
|
|
||||||
/* signal an interrupt */
|
/* signal an interrupt */
|
||||||
m_irq_handler(state);
|
m_irq_handler(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ide_device_interface::set_dmarq(int state)
|
void ide_mass_storage_device::set_dmarq(int state)
|
||||||
{
|
{
|
||||||
m_dmarq_handler(state);
|
m_dmarq_handler(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
ide_mass_storage_device::ide_mass_storage_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock,const char *shortname, const char *source)
|
WRITE_LINE_MEMBER( ide_mass_storage_device::write_csel )
|
||||||
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
|
|
||||||
ide_device_interface(mconfig, *this),
|
|
||||||
device_slot_card_interface(mconfig, *this)
|
|
||||||
{
|
{
|
||||||
|
m_csel = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER( ide_mass_storage_device::write_dasp )
|
||||||
|
{
|
||||||
|
m_dasp = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************
|
/*************************************
|
||||||
@ -364,13 +376,6 @@ void ide_mass_storage_device::device_reset()
|
|||||||
set_dmarq(CLEAR_LINE);
|
set_dmarq(CLEAR_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ide_mass_storage_device::set_irq(int state)
|
|
||||||
{
|
|
||||||
ide_device_interface::set_irq(state);
|
|
||||||
|
|
||||||
m_interrupt_pending = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ide_mass_storage_device::signal_delayed_interrupt(attotime time, int buffer_ready)
|
void ide_mass_storage_device::signal_delayed_interrupt(attotime time, int buffer_ready)
|
||||||
{
|
{
|
||||||
/* clear buffer ready and set the busy flag */
|
/* clear buffer ready and set the busy flag */
|
||||||
|
@ -24,15 +24,15 @@ class ide_device_interface
|
|||||||
public:
|
public:
|
||||||
ide_device_interface(const machine_config &mconfig, device_t &device);
|
ide_device_interface(const machine_config &mconfig, device_t &device);
|
||||||
|
|
||||||
virtual void set_irq(int state);
|
|
||||||
virtual void set_dmarq(int state);
|
|
||||||
|
|
||||||
virtual UINT16 read_dma() = 0;
|
virtual UINT16 read_dma() = 0;
|
||||||
virtual DECLARE_READ16_MEMBER(read_cs0) = 0;
|
virtual DECLARE_READ16_MEMBER(read_cs0) = 0;
|
||||||
virtual DECLARE_READ16_MEMBER(read_cs1) = 0;
|
virtual DECLARE_READ16_MEMBER(read_cs1) = 0;
|
||||||
|
|
||||||
virtual void write_dma(UINT16 data) = 0;
|
virtual void write_dma(UINT16 data) = 0;
|
||||||
virtual DECLARE_WRITE16_MEMBER(write_cs0) = 0;
|
virtual DECLARE_WRITE16_MEMBER(write_cs0) = 0;
|
||||||
virtual DECLARE_WRITE16_MEMBER(write_cs1) = 0;
|
virtual DECLARE_WRITE16_MEMBER(write_cs1) = 0;
|
||||||
|
virtual DECLARE_WRITE_LINE_MEMBER(write_csel) = 0;
|
||||||
|
virtual DECLARE_WRITE_LINE_MEMBER(write_dasp) = 0;
|
||||||
|
|
||||||
virtual UINT8 *get_features() = 0;
|
virtual UINT8 *get_features() = 0;
|
||||||
|
|
||||||
@ -41,9 +41,6 @@ public:
|
|||||||
const UINT8 * m_master_password;
|
const UINT8 * m_master_password;
|
||||||
const UINT8 * m_user_password;
|
const UINT8 * m_user_password;
|
||||||
|
|
||||||
int m_csel;
|
|
||||||
int m_dasp;
|
|
||||||
|
|
||||||
devcb2_write_line m_irq_handler;
|
devcb2_write_line m_irq_handler;
|
||||||
devcb2_write_line m_dmarq_handler;
|
devcb2_write_line m_dmarq_handler;
|
||||||
};
|
};
|
||||||
@ -55,16 +52,15 @@ class ide_mass_storage_device : public device_t,
|
|||||||
public:
|
public:
|
||||||
ide_mass_storage_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock,const char *shortname = "", const char *source = __FILE__);
|
ide_mass_storage_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock,const char *shortname = "", const char *source = __FILE__);
|
||||||
|
|
||||||
virtual int read_sector(UINT32 lba, void *buffer) = 0;
|
|
||||||
virtual int write_sector(UINT32 lba, const void *buffer) = 0;
|
|
||||||
|
|
||||||
virtual void set_irq(int state);
|
|
||||||
virtual UINT16 read_dma();
|
virtual UINT16 read_dma();
|
||||||
virtual DECLARE_READ16_MEMBER(read_cs0);
|
virtual DECLARE_READ16_MEMBER(read_cs0);
|
||||||
virtual DECLARE_READ16_MEMBER(read_cs1);
|
virtual DECLARE_READ16_MEMBER(read_cs1);
|
||||||
|
|
||||||
virtual void write_dma(UINT16 data);
|
virtual void write_dma(UINT16 data);
|
||||||
virtual DECLARE_WRITE16_MEMBER(write_cs0);
|
virtual DECLARE_WRITE16_MEMBER(write_cs0);
|
||||||
virtual DECLARE_WRITE16_MEMBER(write_cs1);
|
virtual DECLARE_WRITE16_MEMBER(write_cs1);
|
||||||
|
virtual DECLARE_WRITE_LINE_MEMBER(write_csel);
|
||||||
|
virtual DECLARE_WRITE_LINE_MEMBER(write_dasp);
|
||||||
|
|
||||||
virtual UINT8 *get_features() { return m_features; }
|
virtual UINT8 *get_features() { return m_features; }
|
||||||
|
|
||||||
@ -73,9 +69,14 @@ protected:
|
|||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||||
|
|
||||||
|
virtual int read_sector(UINT32 lba, void *buffer) = 0;
|
||||||
|
virtual int write_sector(UINT32 lba, const void *buffer) = 0;
|
||||||
virtual bool is_ready() = 0;
|
virtual bool is_ready() = 0;
|
||||||
virtual void read_key(UINT8 key[]) = 0;
|
virtual void read_key(UINT8 key[]) = 0;
|
||||||
|
|
||||||
|
void set_irq(int state);
|
||||||
|
void set_dmarq(int state);
|
||||||
|
|
||||||
UINT8 m_gnetreadlock;
|
UINT8 m_gnetreadlock;
|
||||||
|
|
||||||
UINT8 m_features[IDE_DISK_SECTOR_SIZE];
|
UINT8 m_features[IDE_DISK_SECTOR_SIZE];
|
||||||
@ -99,6 +100,9 @@ private:
|
|||||||
void read_buffer_empty();
|
void read_buffer_empty();
|
||||||
void write_buffer_full();
|
void write_buffer_full();
|
||||||
|
|
||||||
|
int m_csel;
|
||||||
|
int m_dasp;
|
||||||
|
|
||||||
int m_cur_drive;
|
int m_cur_drive;
|
||||||
UINT16 m_cur_cylinder;
|
UINT16 m_cur_cylinder;
|
||||||
UINT8 m_cur_sector;
|
UINT8 m_cur_sector;
|
||||||
|
Loading…
Reference in New Issue
Block a user