Previous 15994 Revisions Next

r14014 Friday 13th January, 2012 at 14:45:08 UTC by Miodrag Milanović
Made all drivers use ISA IDE implementation, fixed some issues regarding default settings and made 2nd-ary IDE available on at586 (no whatsnew)
[src/emu]mconfig.c
[src/mess/drivers]at.c
[src/mess/machine]isa.h isa_ide.c isa_ide.h

src/emu/mconfig.c
r14013r14014
8585               if (strcmp(selval, intf[i].name) == 0) {
8686                  device_t *new_dev = device_add(&owner, intf[i].name, intf[i].devtype, 0);
8787                  found = true;
88                  if (!options.exists(owner.tag()))
88                  const char *def = slot->get_default_card(devicelist(), options);
89                  if ((def!=NULL) && (strcmp(def,selval)==0))
8990                     device_t::static_set_input_default(*new_dev, slot->input_ports_defaults());
9091               }
9192            }
src/mess/machine/isa_ide.c
r14013r14014
2222static void ide_interrupt(device_t *device, int state)
2323{
2424   isa16_ide_device *ide  = downcast<isa16_ide_device *>(device->owner());
25   ide->m_isa->irq14_w(state);
25   if (ide->is_primary()) {
26      ide->m_isa->irq14_w(state);
27   } else {
28      ide->m_isa->irq15_w(state);
29   }
2630}
2731
2832
r14013r14014
3438   MCFG_IDE_CONTROLLER_REGIONS("harddisk1", "harddisk2")
3539MACHINE_CONFIG_END
3640
41static INPUT_PORTS_START( ide )
42   PORT_START("DSW")
43   PORT_DIPNAME( 0x01, 0x00, "IDE Configuration")
44   PORT_DIPSETTING(   0x00, "Primary" )
45   PORT_DIPSETTING(   0x01, "Secondary" )
46INPUT_PORTS_END
47
3748//**************************************************************************
3849//  GLOBAL VARIABLES
3950//**************************************************************************
r14013r14014
5061   return MACHINE_CONFIG_NAME( ide );
5162}
5263
64//-------------------------------------------------
65//  input_ports - device-specific input ports
66//-------------------------------------------------
67
68ioport_constructor isa16_ide_device::device_input_ports() const
69{
70   return INPUT_PORTS_NAME( ide );
71}
72
5373//**************************************************************************
5474//  LIVE DEVICE
5575//**************************************************************************
r14013r14014
6080
6181isa16_ide_device::isa16_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6282      : device_t(mconfig, ISA16_IDE, "ISA16_IDE", tag, owner, clock),
63      device_isa16_card_interface( mconfig, *this )
83      device_isa16_card_interface( mconfig, *this ),
84      m_is_primary(true)
6485{
6586}
6687
r14013r14014
7192void isa16_ide_device::device_start()
7293{
7394   set_isa_device();
74   m_isa->install16_device(subdevice("ide"), 0x01f0, 0x01f7, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
7595}
7696
7797//-------------------------------------------------
r14013r14014
7999//-------------------------------------------------
80100
81101void isa16_ide_device::device_reset()
82{
102{   
103   m_is_primary = (input_port_read(this, "DSW") & 1) ? false : true;
104   if (m_is_primary) {   
105      m_isa->install16_device(subdevice("ide"), 0x01f0, 0x01f7, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
106   } else {
107      m_isa->install16_device(subdevice("ide"), 0x0170, 0x0177, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
108   }
83109}
src/mess/machine/isa_ide.h
r14013r14014
2222
2323      // optional information overrides
2424      virtual machine_config_constructor device_mconfig_additions() const;
25      virtual ioport_constructor device_input_ports() const;     
26     
27      bool is_primary() { return m_is_primary; }
2528protected:
2629        // device-level overrides
2730        virtual void device_start();
r14013r14014
2932
3033private:
3134        // internal state
35      bool m_is_primary;
3236};
3337
3438
src/mess/machine/isa.h
r14013r14014
8484
8585#define MCFG_ISA_ONBOARD_ADD(_isatag, _tag, _dev_type, _def_inp) \
8686    MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
87   device_isa8_card_interface::static_set_isabus_tag(*device, _isatag); \
8788   MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
88   device_isa8_card_interface::static_set_isabus_tag(*device, _isatag);
8989
9090
9191#define MCFG_ISA16_BUS_ADD(_tag, _cputag, _config) \
src/mess/drivers/at.c
r14013r14014
1313
1414#include "includes/at.h"
1515
16READ32_MEMBER( at_state::ide_r )
17{
18   return ide_controller32_r(m_ide, 0x1f0/4 + offset, mem_mask);
19}
20
21WRITE32_MEMBER( at_state::ide_w )
22{
23   ide_controller32_w(m_ide, 0x1f0/4 + offset, data, mem_mask);
24}
25
2616static ADDRESS_MAP_START( at16_map, AS_PROGRAM, 16, at_state )
2717   AM_RANGE(0x000000, 0x09ffff) AM_MIRROR(0xff000000) AM_RAMBANK("bank10")
2818   AM_RANGE(0x0c0000, 0x0c7fff) AM_ROM
r14013r14014
152142   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r, at_page8_w, 0xffffffff)
153143   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
154144   AM_RANGE(0x00c0, 0x00df) AM_READWRITE8(at_dma8237_2_r, at_dma8237_2_w, 0xffffffff)
155   AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide_r, ide_w)
156145ADDRESS_MAP_END
157146
158147
r14013r14014
195184   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r, at_page8_w, 0xffffffff)
196185   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
197186   AM_RANGE(0x00c0, 0x00df) AM_READWRITE8(at_dma8237_2_r, at_dma8237_2_w, 0xffffffff)
198   AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide_r, ide_w)
199187ADDRESS_MAP_END
200188
201189
r14013r14014
210198   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
211199   AM_RANGE(0x00c0, 0x00df) AM_READWRITE8(at_dma8237_2_r, at_dma8237_2_w, 0xffffffff)
212200   AM_RANGE(0x00e0, 0x00ef) AM_NOP // used for timing?
213   AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide_r, ide_w)
214201   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE_LEGACY("pcibus", pci_32le_r, pci_32le_w)
215202ADDRESS_MAP_END
216203
r14013r14014
317304   DEVCB_DEVICE_LINE_MEMBER("keybc", at_keyboard_controller_device, keyboard_data_w)
318305};
319306
320static void ide_interrupt(device_t *device, int state)
321{
322   pic8259_ir6_w(device->machine().device("pic8259_slave"),state);
323}
324
325307WRITE_LINE_MEMBER( at_state::at_mc146818_irq )
326308{
327309   pic8259_ir0_w(m_pic8259_slave, (state) ? 0 : 1);
r14013r14014
559541   MCFG_ISA16_BUS_ADD("isabus", "maincpu", isabus_intf)
560542   MCFG_ISA_ONBOARD_ADD("isabus", "fdc", ISA8_FDC, NULL)
561543   MCFG_ISA_ONBOARD_ADD("isabus", "com", ISA8_COM_AT, NULL)
544   MCFG_ISA_ONBOARD_ADD("isabus", "ide", ISA16_IDE, NULL)
562545   MCFG_ISA16_SLOT_ADD("isabus","isa1", pc_isa16_cards, NULL, NULL)
563546   MCFG_ISA16_SLOT_ADD("isabus","isa2", pc_isa16_cards, NULL, NULL)
564547   MCFG_ISA16_SLOT_ADD("isabus","isa3", pc_isa16_cards, NULL, NULL)
r14013r14014
566549
567550   MCFG_FRAGMENT_ADD( pcvideo_vga )
568551
569   /* harddisk */
570   MCFG_HARDDISK_ADD("harddisk1")
571   MCFG_HARDDISK_ADD("harddisk2")
572   MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt)
573   MCFG_IDE_CONTROLLER_REGIONS("harddisk1", "harddisk2")
574
575552   /* internal ram */
576553   MCFG_RAM_ADD(RAM_TAG)
577554   MCFG_RAM_DEFAULT_SIZE("1664K")
r14013r14014
600577   MCFG_RAM_EXTRA_OPTIONS("1M,2M,8M,16M,32M,64M")
601578MACHINE_CONFIG_END
602579
580//-------------------------------------------------
581//  DEVICE_INPUT_DEFAULTS( ide_2nd)
582//-------------------------------------------------
603583
584static DEVICE_INPUT_DEFAULTS_START( ide_2nd )
585   DEVICE_INPUT_DEFAULTS("DSW", 0x01, 0x01)
586DEVICE_INPUT_DEFAULTS_END
587
588
604589static MACHINE_CONFIG_DERIVED( at586, at386 )
605590   MCFG_CPU_REPLACE("maincpu", PENTIUM, 60000000)
606591   MCFG_CPU_PROGRAM_MAP(at586_map)
r14013r14014
613598   MCFG_PCI_BUS_DEVICE(0, "i82439tx", i82439tx_pci_read, i82439tx_pci_write)
614599   MCFG_PCI_BUS_DEVICE(1, "i82371ab", i82371ab_pci_read, i82371ab_pci_write)
615600
601   MCFG_ISA16_SLOT_ADD("isabus","isa5", pc_isa16_cards, "ide", ide_2nd) //2nd-ary IDE
602   
616603   MCFG_DEVICE_REMOVE(RAM_TAG)
617604   MCFG_RAM_ADD(RAM_TAG)
618605   MCFG_RAM_DEFAULT_SIZE("4M")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team