src/mess/machine/pc_lpt.c
| r14299 | r14300 | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | DEFINE_LEGACY_DEVICE(PC_LPT, pc_lpt); |
| 246 | |
| 247 | static 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 | } |
| 255 | static const pc_lpt_interface pc_lpt_config = |
| 256 | { |
| 257 | DEVCB_LINE(pc_cpu_line) |
| 258 | }; |
| 259 | |
| 260 | static MACHINE_CONFIG_FRAGMENT( lpt_config ) |
| 261 | MCFG_PC_LPT_ADD("lpt", pc_lpt_config) |
| 262 | MACHINE_CONFIG_END |
| 263 | |
| 264 | static 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" ) |
| 269 | INPUT_PORTS_END |
| 270 | |
| 271 | //************************************************************************** |
| 272 | // GLOBAL VARIABLES |
| 273 | //************************************************************************** |
| 274 | |
| 275 | const device_type ISA8_LPT = &device_creator<isa8_lpt_device>; |
| 276 | |
| 277 | //------------------------------------------------- |
| 278 | // machine_config_additions - device-specific |
| 279 | // machine configurations |
| 280 | //------------------------------------------------- |
| 281 | |
| 282 | machine_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 | |
| 291 | ioport_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 | |
| 304 | isa8_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 | |
| 314 | void isa8_lpt_device::device_start() |
| 315 | { |
| 316 | set_isa_device(); |
| 317 | } |
| 318 | |
| 319 | //------------------------------------------------- |
| 320 | // device_reset - device-specific reset |
| 321 | //------------------------------------------------- |
| 322 | |
| 323 | void 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
| r14299 | r14300 | |
| 7 | 7 | #ifndef __PC_LPT_H__ |
| 8 | 8 | #define __PC_LPT_H__ |
| 9 | 9 | |
| 10 | #include "isa.h" |
| 10 | 11 | #include "devcb.h" |
| 11 | 12 | |
| 12 | 13 | |
| r14299 | r14300 | |
| 48 | 49 | MCFG_DEVICE_REMOVE(_tag) |
| 49 | 50 | |
| 50 | 51 | |
| 52 | //************************************************************************** |
| 53 | // TYPE DEFINITIONS |
| 54 | //************************************************************************** |
| 55 | |
| 56 | // ======================> isa8_lpt_device |
| 57 | |
| 58 | class isa8_lpt_device : |
| 59 | public device_t, |
| 60 | public device_isa8_card_interface |
| 61 | { |
| 62 | public: |
| 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; } |
| 71 | protected: |
| 72 | // device-level overrides |
| 73 | virtual void device_start(); |
| 74 | virtual void device_reset(); |
| 75 | |
| 76 | private: |
| 77 | // internal state |
| 78 | bool m_is_primary; |
| 79 | }; |
| 80 | |
| 81 | |
| 82 | // device type definition |
| 83 | extern const device_type ISA8_LPT; |
| 84 | |
| 51 | 85 | #endif /* __PC_LPT__ */ |
src/mess/drivers/at.c
| r14299 | r14300 | |
| 366 | 366 | SLOT_INTERFACE("ne1000", NE1000) |
| 367 | 367 | SLOT_INTERFACE("3c503", EL2_3C503) |
| 368 | 368 | SLOT_INTERFACE("mpu401", ISA8_MPU401) |
| 369 | SLOT_INTERFACE("lpt", ISA8_LPT) |
| 369 | 370 | // ISA 16 bit |
| 370 | 371 | SLOT_INTERFACE("ide", ISA16_IDE) |
| 371 | 372 | SLOT_INTERFACE("ne2000", NE2000) |
| r14299 | r14300 | |
| 553 | 554 | MCFG_ISA_ONBOARD_ADD("isabus", "fdc", ISA8_FDC, NULL) |
| 554 | 555 | MCFG_ISA_ONBOARD_ADD("isabus", "com", ISA8_COM_AT, NULL) |
| 555 | 556 | MCFG_ISA_ONBOARD_ADD("isabus", "ide", ISA16_IDE, NULL) |
| 557 | MCFG_ISA_ONBOARD_ADD("isabus", "lpt", ISA8_LPT, NULL) |
| 556 | 558 | MCFG_ISA16_SLOT_ADD("isabus","isa1", pc_isa16_cards, "vga", NULL) |
| 557 | 559 | MCFG_ISA16_SLOT_ADD("isabus","isa2", pc_isa16_cards, NULL, NULL) |
| 558 | 560 | MCFG_ISA16_SLOT_ADD("isabus","isa3", pc_isa16_cards, NULL, NULL) |