Previous 199869 Revisions Next

r21436 Monday 25th February, 2013 at 13:10:03 UTC by Miodrag Milanović
isa_ide : correctly mapped alternate port [Miodrag Milanovic]

This makes a586 boot from primary HDD
[src/mess/machine]isa_ide.c isa_ide.h

trunk/src/mess/machine/isa_ide.c
r21435r21436
99#include "machine/idectrl.h"
1010#include "imagedev/harddriv.h"
1111
12static READ16_DEVICE_HANDLER( ide16_r )
12READ16_MEMBER(isa16_ide_device::ide16_r)
1313{
14   return ide_controller16_r(device, space, 0x1f0/2 + offset, mem_mask);
14   return ide_controller16_r(m_ide, space, 0x1f0/2 + offset, mem_mask);
1515}
1616
17static WRITE16_DEVICE_HANDLER( ide16_w )
17WRITE16_MEMBER(isa16_ide_device::ide16_w)
1818{
19   ide_controller16_w(device, space, 0x1f0/2 + offset, data, mem_mask);
19   ide_controller16_w(m_ide, space, 0x1f0/2 + offset, data, mem_mask);
2020}
2121
22
23static READ16_DEVICE_HANDLER( ide16_alt_r )
22READ8_MEMBER(isa16_ide_device::ide16_alt_r )
2423{
25   return ide_controller16_r(device, space, 0x3f6/2 + offset, 0x00ff);
24   return ide_controller16_r(m_ide, space, 0x3f6/2, 0x00ff);
2625}
2726
28static WRITE16_DEVICE_HANDLER( ide16_alt_w )
27WRITE8_MEMBER(isa16_ide_device::ide16_alt_w )
2928{
30   ide_controller16_w(device, space, 0x3f6/2 + offset, data, 0x00ff);
29   ide_controller16_w(m_ide, space, 0x3f6/2, data, 0x00ff);
3130}
3231
32DEVICE_ADDRESS_MAP_START(map, 16, isa16_ide_device)
33   AM_RANGE(0x0, 0x7) AM_READWRITE(ide16_r, ide16_w)
34ADDRESS_MAP_END
35
36DEVICE_ADDRESS_MAP_START(alt_map, 8, isa16_ide_device)
37   AM_RANGE(0x6, 0x6) AM_READWRITE(ide16_alt_r, ide16_alt_w)
38ADDRESS_MAP_END
39
3340WRITE_LINE_MEMBER(isa16_ide_device::ide_interrupt)
3441{
3542   if (is_primary())
r21435r21436
9097isa16_ide_device::isa16_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
9198      : device_t(mconfig, ISA16_IDE, "IDE Fixed Drive Adapter", tag, owner, clock),
9299      device_isa16_card_interface( mconfig, *this ),
93      m_is_primary(true)
100      m_is_primary(true),
101      m_ide(*this, "ide")
94102{
95103}
96104
r21435r21436
111119{
112120   m_is_primary = (ioport("DSW")->read() & 1) ? false : true;
113121   if (m_is_primary) {
114      m_isa->install16_device(subdevice("ide"), 0x01f0, 0x01f7, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
115      //m_isa->install16_device(subdevice("ide"), 0x03f6, 0x03f7, 0, 0, FUNC(ide16_alt_r), FUNC(ide16_alt_w) );
122      m_isa->install_device(0x01f0, 0x01f7, *this, &isa16_ide_device::map, 16);
123      m_isa->install_device(0x03f0, 0x03f7, *this, &isa16_ide_device::alt_map);
116124   } else {
117      m_isa->install16_device(subdevice("ide"), 0x0170, 0x0177, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
118      m_isa->install16_device(subdevice("ide"), 0x0376, 0x0377, 0, 0, FUNC(ide16_alt_r), FUNC(ide16_alt_w) );
125      m_isa->install_device(0x0170, 0x0177, *this, &isa16_ide_device::map, 16);
126      m_isa->install_device(0x0370, 0x0377, *this, &isa16_ide_device::alt_map);
119127   }
120128}
trunk/src/mess/machine/isa_ide.h
r21435r21436
55
66#include "emu.h"
77#include "machine/isa.h"
8#include "machine/idectrl.h"
89
910//**************************************************************************
1011//  TYPE DEFINITIONS
r21435r21436
2526
2627   bool is_primary() { return m_is_primary; }
2728   DECLARE_WRITE_LINE_MEMBER(ide_interrupt);
28
29   DECLARE_ADDRESS_MAP(map, 16);
30   DECLARE_ADDRESS_MAP(alt_map, 8);
31   READ16_MEMBER(ide16_r);
32   WRITE16_MEMBER(ide16_w);
33   READ8_MEMBER(ide16_alt_r);
34   WRITE8_MEMBER(ide16_alt_w);
2935protected:
3036   // device-level overrides
3137   virtual void device_start();
r21435r21436
3541private:
3642   // internal state
3743   bool m_is_primary;
44   required_device<ide_controller_device> m_ide;
3845};
3946
4047

Previous 199869 Revisions Next


© 1997-2024 The MAME Team