Previous 15994 Revisions Next

r14300 Wednesday 1st February, 2012 at 11:17:35 UTC by Miodrag Milanović
Made isa_lpt device and connected it on board for some machines (nw)
[src/mess/drivers]at.c
[src/mess/includes]at.h
[src/mess/machine]pc_lpt.c pc_lpt.h

src/mess/machine/pc_lpt.c
r14299r14300
243243}
244244
245245DEFINE_LEGACY_DEVICE(PC_LPT, pc_lpt);
246
247static WRITE_LINE_DEVICE_HANDLER(pc_cpu_line)
248{
249   isa8_lpt_device   *lpt  = downcast<isa8_lpt_device *>(device->owner());
250   if (lpt->is_primary())
251      lpt->m_isa->irq7_w(state);
252   else
253      lpt->m_isa->irq5_w(state);
254}
255static const pc_lpt_interface pc_lpt_config =
256{
257   DEVCB_LINE(pc_cpu_line)
258};
259
260static MACHINE_CONFIG_FRAGMENT( lpt_config )
261   MCFG_PC_LPT_ADD("lpt", pc_lpt_config)
262MACHINE_CONFIG_END
263
264static INPUT_PORTS_START( lpt_dsw )
265   PORT_START("DSW")
266   PORT_DIPNAME( 0x01, 0x00, "Base address")
267   PORT_DIPSETTING(   0x00, "0x378" )
268   PORT_DIPSETTING(   0x01, "0x278" )
269INPUT_PORTS_END
270
271//**************************************************************************
272//  GLOBAL VARIABLES
273//**************************************************************************
274
275const device_type ISA8_LPT = &device_creator<isa8_lpt_device>;
276
277//-------------------------------------------------
278//  machine_config_additions - device-specific
279//  machine configurations
280//-------------------------------------------------
281
282machine_config_constructor isa8_lpt_device::device_mconfig_additions() const
283{
284   return MACHINE_CONFIG_NAME( lpt_config );
285}
286
287//-------------------------------------------------
288//  input_ports - device-specific input ports
289//-------------------------------------------------
290
291ioport_constructor isa8_lpt_device::device_input_ports() const
292{
293   return INPUT_PORTS_NAME( lpt_dsw );
294}
295
296//**************************************************************************
297//  LIVE DEVICE
298//**************************************************************************
299
300//-------------------------------------------------
301//  isa8_lpt_device - constructor
302//-------------------------------------------------
303
304isa8_lpt_device::isa8_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
305        device_t(mconfig, ISA8_LPT, "ISA8_LPT", tag, owner, clock),
306      device_isa8_card_interface(mconfig, *this)
307{
308}
309
310//-------------------------------------------------
311//  device_start - device-specific startup
312//-------------------------------------------------
313
314void isa8_lpt_device::device_start()
315{
316   set_isa_device();
317}
318
319//-------------------------------------------------
320//  device_reset - device-specific reset
321//-------------------------------------------------
322
323void isa8_lpt_device::device_reset()
324{
325   m_is_primary = (input_port_read(*this, "DSW") & 1) ? false : true;
326   if (m_is_primary) {
327      m_isa->install_device(subdevice("lpt"), 0x0378, 0x037b, 0, 0, FUNC(pc_lpt_r), FUNC(pc_lpt_w) );
328   } else {
329      m_isa->install_device(subdevice("lpt"), 0x0278, 0x027b, 0, 0, FUNC(pc_lpt_r), FUNC(pc_lpt_w) );
330   }
331}
src/mess/machine/pc_lpt.h
r14299r14300
77#ifndef __PC_LPT_H__
88#define __PC_LPT_H__
99
10#include "isa.h"
1011#include "devcb.h"
1112
1213
r14299r14300
4849   MCFG_DEVICE_REMOVE(_tag)
4950
5051
52//**************************************************************************
53//  TYPE DEFINITIONS
54//**************************************************************************
55
56// ======================> isa8_lpt_device
57
58class isa8_lpt_device :
59      public device_t,
60      public device_isa8_card_interface
61{
62public:
63        // construction/destruction
64        isa8_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
65
66      // optional information overrides
67      virtual machine_config_constructor device_mconfig_additions() const;
68      virtual ioport_constructor device_input_ports() const;
69     
70      bool is_primary() { return m_is_primary; }
71protected:
72        // device-level overrides
73        virtual void device_start();
74        virtual void device_reset();
75
76private:
77        // internal state
78      bool m_is_primary;
79};
80
81
82// device type definition
83extern const device_type ISA8_LPT;
84
5185#endif /* __PC_LPT__ */
src/mess/includes/at.h
r14299r14300
5959#include "machine/isa_ide.h"
6060
6161#include "machine/pc_mouse.h"
62#include "machine/pc_lpt.h"
6263
6364
6465class at_state : public driver_device
src/mess/drivers/at.c
r14299r14300
366366   SLOT_INTERFACE("ne1000", NE1000)
367367   SLOT_INTERFACE("3c503", EL2_3C503)
368368   SLOT_INTERFACE("mpu401", ISA8_MPU401)
369   SLOT_INTERFACE("lpt", ISA8_LPT)
369370   // ISA 16 bit
370371   SLOT_INTERFACE("ide", ISA16_IDE)
371372   SLOT_INTERFACE("ne2000", NE2000)
r14299r14300
553554   MCFG_ISA_ONBOARD_ADD("isabus", "fdc", ISA8_FDC, NULL)
554555   MCFG_ISA_ONBOARD_ADD("isabus", "com", ISA8_COM_AT, NULL)
555556   MCFG_ISA_ONBOARD_ADD("isabus", "ide", ISA16_IDE, NULL)
557   MCFG_ISA_ONBOARD_ADD("isabus", "lpt", ISA8_LPT, NULL)
556558   MCFG_ISA16_SLOT_ADD("isabus","isa1", pc_isa16_cards, "vga", NULL)
557559   MCFG_ISA16_SLOT_ADD("isabus","isa2", pc_isa16_cards, NULL, NULL)
558560   MCFG_ISA16_SLOT_ADD("isabus","isa3", pc_isa16_cards, NULL, NULL)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team