diff options
Diffstat (limited to 'src/devices/machine')
-rw-r--r-- | src/devices/machine/genpc.cpp | 121 | ||||
-rw-r--r-- | src/devices/machine/genpc.h | 23 | ||||
-rw-r--r-- | src/devices/machine/netlist.cpp | 20 |
3 files changed, 158 insertions, 6 deletions
diff --git a/src/devices/machine/genpc.cpp b/src/devices/machine/genpc.cpp index e626bf96b30..50528d17aa7 100644 --- a/src/devices/machine/genpc.cpp +++ b/src/devices/machine/genpc.cpp @@ -778,7 +778,118 @@ WRITE8_MEMBER( ibm5150_mb_device::pc_ppi_portb_w ) // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(EC1841_MOTHERBOARD, ec1841_mb_device, "ec1841_mb", "EC-1840 motherboard") +DEFINE_DEVICE_TYPE(EC1840_MOTHERBOARD, ec1840_mb_device, "ec1840_mb", "EC-1840 motherboard") + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void ec1840_mb_device::device_add_mconfig(machine_config &config) +{ + ec1841_mb_device::device_add_mconfig(config); + + m_ppi8255->in_pc_callback().set(FUNC(ec1840_mb_device::pc_ppi_portc_r)); +} + +// via http://oldpc.su/pc/ec1840/ec1840rep.html +static INPUT_PORTS_START( ec1840_mb ) + PORT_START("DSW0") /* SA1 */ + PORT_DIPNAME( 0xc0, 0x40, "Number of floppy drives") + PORT_DIPSETTING( 0x00, "1" ) + PORT_DIPSETTING( 0x40, "2" ) + PORT_DIPSETTING( 0x80, "3" ) + PORT_DIPSETTING( 0xc0, "4" ) + PORT_DIPNAME( 0x30, 0x30, "Graphics adapter") + PORT_DIPSETTING( 0x00, "Reserved" ) + PORT_DIPSETTING( 0x10, "Color 40x25" ) + PORT_DIPSETTING( 0x20, "Color 80x25" ) + PORT_DIPSETTING( 0x30, "Monochrome" ) + PORT_BIT( 0x0c, 0x0c, IPT_UNUSED ) + PORT_DIPNAME( 0x02, 0x02, "DMAC installed") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x02, DEF_STR(Yes) ) + PORT_DIPNAME( 0x01, 0x01, "Boot from floppy") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x01, DEF_STR(Yes) ) + + PORT_START("SA2") + PORT_BIT( 0xcf, 0x00, IPT_UNUSED ) + PORT_DIPNAME( 0x20, 0x20, "SA2.5") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x20, DEF_STR(Yes) ) + PORT_DIPNAME( 0x10, 0x10, "SA2.4") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x10, DEF_STR(Yes) ) +INPUT_PORTS_END + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor ec1840_mb_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( ec1840_mb ); +} + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// ec1840_mb_device - constructor +//------------------------------------------------- + +ec1840_mb_device::ec1840_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ec1841_mb_device(mconfig, EC1840_MOTHERBOARD, tag, owner, clock) +{ +} + +void ec1840_mb_device::device_start() +{ +} + +READ8_MEMBER( ec1840_mb_device::pc_ppi_portc_r ) +{ + int data = 0xff; + + data &= ~0x80; // no parity error + data &= ~0x40; // no error on expansion board + + if (m_ppi_portc_switch_high) + { + /* read hi nibble of SW2 */ + data = data & 0xf0; + + switch (m_ram->size()) + { + case 128 * 1024: data |= 0x00; break; + case 256 * 1024: data |= 0x01; break; + case 384 * 1024: data |= 0x02; break; + case 512 * 1024: data |= 0x03; break; + case 640 * 1024: data |= 0x04; break; + } + + PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data)); + } + else + { + /* read lo nibble of S2 */ + data = (data & 0xf0) | (ioport("DSW0")->read() >> 4); + PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data)); + } + + data = ( data & ~0x20 ) | ( m_pit_out2 ? 0x20 : 0x00 ); + + return data; +} + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +DEFINE_DEVICE_TYPE(EC1841_MOTHERBOARD, ec1841_mb_device, "ec1841_mb", "EC-1841 motherboard") //------------------------------------------------- @@ -820,6 +931,7 @@ static INPUT_PORTS_START( ec1841_mb ) PORT_DIPSETTING( 0x00, DEF_STR(No) ) PORT_START("SA2") + PORT_BIT( 0xcb, 0x00, IPT_UNUSED ) PORT_DIPNAME( 0x04, 0x04, "Speech synthesizer") PORT_DIPSETTING( 0x00, "Installed" ) PORT_DIPSETTING( 0x04, "Not installed" ) @@ -847,6 +959,11 @@ ec1841_mb_device::ec1841_mb_device(const machine_config &mconfig, const char *ta { } +ec1841_mb_device::ec1841_mb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : ibm5160_mb_device(mconfig, type, tag, owner, clock) +{ +} + void ec1841_mb_device::device_start() { } @@ -875,7 +992,7 @@ WRITE8_MEMBER( ec1841_mb_device::pc_ppi_portb_w ) m_pc_kbdc->clock_write_from_mb(m_ppi_clock_signal); } -READ8_MEMBER ( ec1841_mb_device::pc_ppi_portc_r ) +READ8_MEMBER( ec1841_mb_device::pc_ppi_portc_r ) { int data=0xff; diff --git a/src/devices/machine/genpc.h b/src/devices/machine/genpc.h index e222b975873..876005d0a26 100644 --- a/src/devices/machine/genpc.h +++ b/src/devices/machine/genpc.h @@ -158,6 +158,7 @@ private: // device type definition DECLARE_DEVICE_TYPE(IBM5150_MOTHERBOARD, ibm5150_mb_device) + class ec1841_mb_device : public ibm5160_mb_device { public: @@ -165,6 +166,8 @@ public: ec1841_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: + ec1841_mb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // optional information overrides virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; @@ -180,6 +183,26 @@ private: DECLARE_DEVICE_TYPE(EC1841_MOTHERBOARD, ec1841_mb_device) +class ec1840_mb_device : public ec1841_mb_device +{ +public: + // construction/destruction + ec1840_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + +private: + DECLARE_READ8_MEMBER ( pc_ppi_portc_r ); + DECLARE_WRITE8_MEMBER( pc_ppi_portb_w ); +}; + +DECLARE_DEVICE_TYPE(EC1840_MOTHERBOARD, ec1840_mb_device) + + class pc_noppi_mb_device : public ibm5160_mb_device { public: diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index 6abd1bb7195..9d7bed491e0 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -1012,6 +1012,18 @@ void netlist_mame_device::common_dev_start(netlist::netlist_t *lnetlist) const { auto &lsetup = lnetlist->nlstate().setup(); + // Override log statistics + pstring p = plib::util::environment("NL_STATS", ""); + if (p != "") + { + bool err=false; + bool v = plib::pstonum_ne<bool, true>(p, err); + if (err) + lsetup.log().warning("NL_STATS: invalid value {1}", p); + else + lnetlist->enable_stats(v); + } + // register additional devices nl_register_devices(lsetup); @@ -1308,11 +1320,11 @@ offs_t netlist_disassembler::disassemble(std::ostream &stream, offs_t pc, const { unsigned startpc = pc; int relpc = pc - m_dev->genPC(); - if (relpc >= 0 && relpc < m_dev->netlist().queue().size()) + if (relpc >= 0 && relpc < m_dev->netlist().queuex().size()) { - int dpc = m_dev->netlist().queue().size() - relpc - 1; - util::stream_format(stream, "%c %s @%10.7f", (relpc == 0) ? '*' : ' ', m_dev->netlist().queue()[dpc].m_object->name().c_str(), - m_dev->netlist().queue()[dpc].m_exec_time.as_double()); + int dpc = m_dev->netlist().queuex().size() - relpc - 1; + util::stream_format(stream, "%c %s @%10.7f", (relpc == 0) ? '*' : ' ', m_dev->netlist().queuex()[dpc].m_object->name().c_str(), + m_dev->netlist().queuex()[dpc].m_exec_time.as_double()); } pc+=1; |