mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
isa_ide : correctly mapped alternate port [Miodrag Milanovic]
This makes a586 boot from primary HDD
This commit is contained in:
parent
e39b9ad818
commit
837eecb817
@ -9,27 +9,34 @@
|
||||
#include "machine/idectrl.h"
|
||||
#include "imagedev/harddriv.h"
|
||||
|
||||
static READ16_DEVICE_HANDLER( ide16_r )
|
||||
READ16_MEMBER(isa16_ide_device::ide16_r)
|
||||
{
|
||||
return ide_controller16_r(device, space, 0x1f0/2 + offset, mem_mask);
|
||||
return ide_controller16_r(m_ide, space, 0x1f0/2 + offset, mem_mask);
|
||||
}
|
||||
|
||||
static WRITE16_DEVICE_HANDLER( ide16_w )
|
||||
WRITE16_MEMBER(isa16_ide_device::ide16_w)
|
||||
{
|
||||
ide_controller16_w(device, space, 0x1f0/2 + offset, data, mem_mask);
|
||||
ide_controller16_w(m_ide, space, 0x1f0/2 + offset, data, mem_mask);
|
||||
}
|
||||
|
||||
|
||||
static READ16_DEVICE_HANDLER( ide16_alt_r )
|
||||
READ8_MEMBER(isa16_ide_device::ide16_alt_r )
|
||||
{
|
||||
return ide_controller16_r(device, space, 0x3f6/2 + offset, 0x00ff);
|
||||
return ide_controller16_r(m_ide, space, 0x3f6/2, 0x00ff);
|
||||
}
|
||||
|
||||
static WRITE16_DEVICE_HANDLER( ide16_alt_w )
|
||||
WRITE8_MEMBER(isa16_ide_device::ide16_alt_w )
|
||||
{
|
||||
ide_controller16_w(device, space, 0x3f6/2 + offset, data, 0x00ff);
|
||||
ide_controller16_w(m_ide, space, 0x3f6/2, data, 0x00ff);
|
||||
}
|
||||
|
||||
DEVICE_ADDRESS_MAP_START(map, 16, isa16_ide_device)
|
||||
AM_RANGE(0x0, 0x7) AM_READWRITE(ide16_r, ide16_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
DEVICE_ADDRESS_MAP_START(alt_map, 8, isa16_ide_device)
|
||||
AM_RANGE(0x6, 0x6) AM_READWRITE(ide16_alt_r, ide16_alt_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
WRITE_LINE_MEMBER(isa16_ide_device::ide_interrupt)
|
||||
{
|
||||
if (is_primary())
|
||||
@ -90,7 +97,8 @@ ioport_constructor isa16_ide_device::device_input_ports() const
|
||||
isa16_ide_device::isa16_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, ISA16_IDE, "IDE Fixed Drive Adapter", tag, owner, clock),
|
||||
device_isa16_card_interface( mconfig, *this ),
|
||||
m_is_primary(true)
|
||||
m_is_primary(true),
|
||||
m_ide(*this, "ide")
|
||||
{
|
||||
}
|
||||
|
||||
@ -111,10 +119,10 @@ void isa16_ide_device::device_reset()
|
||||
{
|
||||
m_is_primary = (ioport("DSW")->read() & 1) ? false : true;
|
||||
if (m_is_primary) {
|
||||
m_isa->install16_device(subdevice("ide"), 0x01f0, 0x01f7, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
|
||||
//m_isa->install16_device(subdevice("ide"), 0x03f6, 0x03f7, 0, 0, FUNC(ide16_alt_r), FUNC(ide16_alt_w) );
|
||||
m_isa->install_device(0x01f0, 0x01f7, *this, &isa16_ide_device::map, 16);
|
||||
m_isa->install_device(0x03f0, 0x03f7, *this, &isa16_ide_device::alt_map);
|
||||
} else {
|
||||
m_isa->install16_device(subdevice("ide"), 0x0170, 0x0177, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
|
||||
m_isa->install16_device(subdevice("ide"), 0x0376, 0x0377, 0, 0, FUNC(ide16_alt_r), FUNC(ide16_alt_w) );
|
||||
m_isa->install_device(0x0170, 0x0177, *this, &isa16_ide_device::map, 16);
|
||||
m_isa->install_device(0x0370, 0x0377, *this, &isa16_ide_device::alt_map);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/isa.h"
|
||||
#include "machine/idectrl.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
@ -25,7 +26,12 @@ public:
|
||||
|
||||
bool is_primary() { return m_is_primary; }
|
||||
DECLARE_WRITE_LINE_MEMBER(ide_interrupt);
|
||||
|
||||
DECLARE_ADDRESS_MAP(map, 16);
|
||||
DECLARE_ADDRESS_MAP(alt_map, 8);
|
||||
READ16_MEMBER(ide16_r);
|
||||
WRITE16_MEMBER(ide16_w);
|
||||
READ8_MEMBER(ide16_alt_r);
|
||||
WRITE8_MEMBER(ide16_alt_w);
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
@ -35,6 +41,7 @@ protected:
|
||||
private:
|
||||
// internal state
|
||||
bool m_is_primary;
|
||||
required_device<ide_controller_device> m_ide;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user