mirror of
https://github.com/holub/mame
synced 2025-04-21 16:01:56 +03:00
pc/pcipc_sis: preliminary W83787F Super I/O core;
machine/sis85c496: add ISA irq pins;
This commit is contained in:
parent
780764ae7a
commit
66ca989488
@ -4475,6 +4475,18 @@ if (MACHINES["PC87306"]~=null) then
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/w83787f.h,MACHINES["W83787F"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (MACHINES["W83787F"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/machine/w83787f.cpp",
|
||||
MAME_DIR .. "src/devices/machine/w83787f.h",
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/w83977tf.h,MACHINES["W83977TF"] = true
|
||||
|
@ -128,6 +128,25 @@ void sis85c496_host_device::device_add_mconfig(machine_config &config)
|
||||
ISA16(config, m_isabus, 0);
|
||||
m_isabus->set_memspace(m_maincpu, AS_PROGRAM);
|
||||
m_isabus->set_iospace(m_maincpu, AS_IO);
|
||||
m_isabus->irq3_callback().set(FUNC(sis85c496_host_device::pc_irq3_w));
|
||||
m_isabus->irq4_callback().set(FUNC(sis85c496_host_device::pc_irq4_w));
|
||||
m_isabus->irq5_callback().set(FUNC(sis85c496_host_device::pc_irq5_w));
|
||||
m_isabus->irq6_callback().set(FUNC(sis85c496_host_device::pc_irq6_w));
|
||||
m_isabus->irq7_callback().set(FUNC(sis85c496_host_device::pc_irq7_w));
|
||||
m_isabus->irq2_callback().set(FUNC(sis85c496_host_device::pc_irq9_w));
|
||||
m_isabus->irq10_callback().set(FUNC(sis85c496_host_device::pc_irq10_w));
|
||||
m_isabus->irq11_callback().set(FUNC(sis85c496_host_device::pc_irq11_w));
|
||||
m_isabus->irq12_callback().set(FUNC(sis85c496_host_device::pc_irq12m_w));
|
||||
m_isabus->irq14_callback().set(FUNC(sis85c496_host_device::pc_irq14_w));
|
||||
m_isabus->irq15_callback().set(FUNC(sis85c496_host_device::pc_irq15_w));
|
||||
m_isabus->drq0_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq0_w));
|
||||
m_isabus->drq1_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq1_w));
|
||||
m_isabus->drq2_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq2_w));
|
||||
m_isabus->drq3_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq3_w));
|
||||
m_isabus->drq5_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq1_w));
|
||||
m_isabus->drq6_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq2_w));
|
||||
m_isabus->drq7_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq3_w));
|
||||
m_isabus->iochck_callback().set(FUNC(sis85c496_host_device::iochck_w));
|
||||
|
||||
IDE_CONTROLLER_32(config, m_ide[0]).options(ata_devices, "hdd", nullptr, false);
|
||||
m_ide[0]->irq_handler().set(m_pic8259_slave, FUNC(pic8259_device::ir6_w));
|
||||
@ -563,6 +582,20 @@ void sis85c496_host_device::pc_dack5_w(int state) { pc_select_dma_channel(5, sta
|
||||
void sis85c496_host_device::pc_dack6_w(int state) { pc_select_dma_channel(6, state); }
|
||||
void sis85c496_host_device::pc_dack7_w(int state) { pc_select_dma_channel(7, state); }
|
||||
|
||||
void sis85c496_host_device::pc_irq1_w(int state) { m_pic8259_master->ir1_w(state); }
|
||||
void sis85c496_host_device::pc_irq3_w(int state) { m_pic8259_master->ir3_w(state); }
|
||||
void sis85c496_host_device::pc_irq4_w(int state) { m_pic8259_master->ir4_w(state); }
|
||||
void sis85c496_host_device::pc_irq5_w(int state) { m_pic8259_master->ir5_w(state); }
|
||||
void sis85c496_host_device::pc_irq6_w(int state) { m_pic8259_master->ir6_w(state); }
|
||||
void sis85c496_host_device::pc_irq7_w(int state) { m_pic8259_master->ir7_w(state); }
|
||||
void sis85c496_host_device::pc_irq8n_w(int state) { m_pic8259_slave->ir0_w(state); }
|
||||
void sis85c496_host_device::pc_irq9_w(int state) { m_pic8259_slave->ir1_w(state); }
|
||||
void sis85c496_host_device::pc_irq10_w(int state) { m_pic8259_slave->ir2_w(state); }
|
||||
void sis85c496_host_device::pc_irq11_w(int state) { m_pic8259_slave->ir3_w(state); }
|
||||
void sis85c496_host_device::pc_irq12m_w(int state) { m_pic8259_slave->ir4_w(state); }
|
||||
void sis85c496_host_device::pc_irq14_w(int state) { m_pic8259_slave->ir6_w(state); }
|
||||
void sis85c496_host_device::pc_irq15_w(int state) { m_pic8259_slave->ir7_w(state); }
|
||||
|
||||
uint8_t sis85c496_host_device::at_portb_r()
|
||||
{
|
||||
uint8_t data = m_at_speaker;
|
||||
@ -585,17 +618,24 @@ void sis85c496_host_device::at_portb_w(uint8_t data)
|
||||
m_pit8254->write_gate2(BIT(data, 0));
|
||||
at_speaker_set_spkrdata( BIT(data, 1));
|
||||
m_channel_check = BIT(data, 3);
|
||||
//m_isabus->set_nmi_state((m_nmi_enabled==0) && (m_channel_check==0));
|
||||
if (m_channel_check)
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
|
||||
}
|
||||
|
||||
void sis85c496_host_device::iochck_w(int state)
|
||||
{
|
||||
if (!state && !m_channel_check && m_nmi_enabled)
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
}
|
||||
|
||||
uint8_t sis85c496_host_device::at_dma8237_2_r(offs_t offset)
|
||||
{
|
||||
return m_dma8237_2->read( offset / 2);
|
||||
return m_dma8237_2->read(offset / 2);
|
||||
}
|
||||
|
||||
void sis85c496_host_device::at_dma8237_2_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_dma8237_2->write( offset / 2, data);
|
||||
m_dma8237_2->write(offset / 2, data);
|
||||
}
|
||||
|
||||
uint8_t sis85c496_host_device::at_keybc_r(offs_t offset)
|
||||
@ -620,7 +660,7 @@ void sis85c496_host_device::at_keybc_w(offs_t offset, uint8_t data)
|
||||
|
||||
void sis85c496_host_device::rtc_address_nmi_w(uint8_t data)
|
||||
{
|
||||
m_nmi_enabled = BIT(data,7);
|
||||
m_nmi_enabled = BIT(data, 7);
|
||||
//m_isabus->set_nmi_state((m_nmi_enabled==0) && (m_channel_check==0));
|
||||
m_ds12885->address_w(data);
|
||||
}
|
||||
|
@ -46,6 +46,20 @@ public:
|
||||
void set_cpu_tag(const char *tag);
|
||||
void set_ram_size(int ram_size);
|
||||
|
||||
void pc_irq1_w(int state);
|
||||
void pc_irq3_w(int state);
|
||||
void pc_irq4_w(int state);
|
||||
void pc_irq5_w(int state);
|
||||
void pc_irq6_w(int state);
|
||||
void pc_irq7_w(int state);
|
||||
void pc_irq8n_w(int state);
|
||||
void pc_irq9_w(int state);
|
||||
void pc_irq10_w(int state);
|
||||
void pc_irq11_w(int state);
|
||||
void pc_irq12m_w(int state);
|
||||
void pc_irq14_w(int state);
|
||||
void pc_irq15_w(int state);
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
@ -150,6 +164,7 @@ private:
|
||||
void pc_dack7_w(int state);
|
||||
uint8_t at_dma8237_2_r(offs_t offset);
|
||||
void at_dma8237_2_w(offs_t offset, uint8_t data);
|
||||
void iochck_w(int state);
|
||||
uint8_t at_keybc_r(offs_t offset);
|
||||
void at_keybc_w(offs_t offset, uint8_t data);
|
||||
u8 rtc_address_r();
|
||||
|
326
src/devices/machine/w83787f.cpp
Normal file
326
src/devices/machine/w83787f.cpp
Normal file
@ -0,0 +1,326 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders: Angelo Salese
|
||||
/**************************************************************************************************
|
||||
|
||||
Winbond W83787IF / W83787F
|
||||
|
||||
'F is the base, 'IF adds IrDA.
|
||||
Looks similar in design to National PC87306 (including similar reg names)
|
||||
|
||||
**************************************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "bus/isa/isa.h"
|
||||
#include "machine/w83787f.h"
|
||||
|
||||
#define LOG_WARN (1U << 1)
|
||||
|
||||
#define VERBOSE (LOG_GENERAL | LOG_WARN)
|
||||
//#define LOG_OUTPUT_FUNC osd_printf_info
|
||||
#include "logmacro.h"
|
||||
|
||||
#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__)
|
||||
|
||||
DEFINE_DEVICE_TYPE(W83787F, w83787f_device, "pc87306", "National Semiconductor W83787F Super I/O Enhanced Sidewinder Lite")
|
||||
|
||||
w83787f_device::w83787f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, W83787F, tag, owner, clock)
|
||||
, device_isa16_card_interface(mconfig, *this)
|
||||
, device_memory_interface(mconfig, *this)
|
||||
, m_space_config("superio_config_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(w83787f_device::config_map), this))
|
||||
, m_pc_com(*this, "uart%d", 0U)
|
||||
, m_pc_lpt(*this, "lpta")
|
||||
, m_irq1_callback(*this)
|
||||
, m_irq8_callback(*this)
|
||||
, m_irq9_callback(*this)
|
||||
, m_txd1_callback(*this)
|
||||
, m_ndtr1_callback(*this)
|
||||
, m_nrts1_callback(*this)
|
||||
, m_txd2_callback(*this)
|
||||
, m_ndtr2_callback(*this)
|
||||
, m_nrts2_callback(*this)
|
||||
{ }
|
||||
|
||||
|
||||
void w83787f_device::device_start()
|
||||
{
|
||||
set_isa_device();
|
||||
//m_isa->set_dma_channel(0, this, true);
|
||||
//m_isa->set_dma_channel(1, this, true);
|
||||
//m_isa->set_dma_channel(2, this, true);
|
||||
//m_isa->set_dma_channel(3, this, true);
|
||||
remap(AS_IO, 0, 0x400);
|
||||
}
|
||||
|
||||
void w83787f_device::device_reset()
|
||||
{
|
||||
m_locked_state = true;
|
||||
m_cr1 = 0;
|
||||
}
|
||||
|
||||
device_memory_interface::space_config_vector w83787f_device::memory_space_config() const
|
||||
{
|
||||
return space_config_vector {
|
||||
std::make_pair(0, &m_space_config)
|
||||
};
|
||||
}
|
||||
|
||||
void w83787f_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
PC_LPT(config, m_pc_lpt);
|
||||
m_pc_lpt->irq_handler().set(FUNC(w83787f_device::irq_parallel_w));
|
||||
|
||||
NS16550(config, m_pc_com[0], XTAL(1'843'200));
|
||||
m_pc_com[0]->out_int_callback().set(FUNC(w83787f_device::irq_serial1_w));
|
||||
m_pc_com[0]->out_tx_callback().set(FUNC(w83787f_device::txd_serial1_w));
|
||||
m_pc_com[0]->out_dtr_callback().set(FUNC(w83787f_device::dtr_serial1_w));
|
||||
m_pc_com[0]->out_rts_callback().set(FUNC(w83787f_device::rts_serial1_w));
|
||||
|
||||
NS16550(config, m_pc_com[1], XTAL(1'843'200));
|
||||
m_pc_com[1]->out_int_callback().set(FUNC(w83787f_device::irq_serial2_w));
|
||||
m_pc_com[1]->out_tx_callback().set(FUNC(w83787f_device::txd_serial2_w));
|
||||
m_pc_com[1]->out_dtr_callback().set(FUNC(w83787f_device::dtr_serial2_w));
|
||||
m_pc_com[1]->out_rts_callback().set(FUNC(w83787f_device::rts_serial2_w));
|
||||
}
|
||||
|
||||
void w83787f_device::remap(int space_id, offs_t start, offs_t end)
|
||||
{
|
||||
if (space_id == AS_IO)
|
||||
{
|
||||
m_isa->install_device(0x0250, 0x0252, read8sm_delegate(*this, FUNC(w83787f_device::read)), write8sm_delegate(*this, FUNC(w83787f_device::write)));
|
||||
|
||||
//if (BIT(m_fer, 0))
|
||||
const u8 lpt_setting = (m_cr1 >> 4) & 3;
|
||||
if (lpt_setting != 3)
|
||||
{
|
||||
const u16 lpt_port[3] = { 0x3bc, 0x278, 0x378 };
|
||||
const u16 lpt_addr = lpt_port[lpt_setting & 3];
|
||||
LOG("Map LPT1 to I/O port %04x-%04x\n", lpt_addr, lpt_addr + 3);
|
||||
|
||||
m_isa->install_device(lpt_addr, lpt_addr + 3, read8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::read)), write8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::write)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
const u8 uart_setting = (BIT(m_cr1, 2 + i) >> 1) | (BIT(m_cr1, i));
|
||||
if (uart_setting != 3)
|
||||
{
|
||||
const u16 uart_port[3] = { 0x2e8, 0x3e8, 0x3f8 };
|
||||
const u16 uart_addr = uart_port[uart_setting & 3] ^ (i ? 0x100 : 0x000);
|
||||
LOG("Map UART%c to I/O port %04x-%04x\n", i ? 'A' : 'B', uart_addr, uart_addr + 7);
|
||||
m_isa->install_device(uart_addr, uart_addr + 7, read8sm_delegate(*m_pc_com[i], FUNC(ns16450_device::ins8250_r)), write8sm_delegate(*m_pc_com[i], FUNC(ns16450_device::ins8250_w)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u8 w83787f_device::read(offs_t offset)
|
||||
{
|
||||
if (offset != 2 && !machine().side_effects_disabled())
|
||||
{
|
||||
LOGWARN("Invalid %s access read\n", offset & 1 ? "EFIR" : "EFIR");
|
||||
return space().unmap();
|
||||
}
|
||||
|
||||
if (m_locked_state)
|
||||
return space().unmap();
|
||||
|
||||
return space().read_byte(m_index);
|
||||
}
|
||||
|
||||
void w83787f_device::write(offs_t offset, u8 data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
// EFER
|
||||
// TODO: 0x89 with GMRD# pin
|
||||
case 0: m_locked_state = (data != 0x88); break;
|
||||
// EFIR
|
||||
case 1: m_index = data; break;
|
||||
// EFDR
|
||||
case 2:
|
||||
if (!m_locked_state)
|
||||
space().write_byte(m_index, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void w83787f_device::config_map(address_map &map)
|
||||
{
|
||||
map(0x01, 0x01).lrw8(
|
||||
NAME([this] (offs_t offset) {
|
||||
return m_cr1;
|
||||
}),
|
||||
NAME([this] (offs_t offset, u8 data) {
|
||||
m_cr1 = data;
|
||||
remap(AS_IO, 0, 0x400);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* Serial
|
||||
*/
|
||||
|
||||
void w83787f_device::irq_serial1_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x05) == 0x05)
|
||||
return;
|
||||
request_irq(3, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
void w83787f_device::irq_serial2_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x0a) == 0x0a)
|
||||
return;
|
||||
request_irq(4, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
void w83787f_device::txd_serial1_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x05) == 0x05)
|
||||
return;
|
||||
m_txd1_callback(state);
|
||||
}
|
||||
|
||||
void w83787f_device::txd_serial2_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x0a) == 0x0a)
|
||||
return;
|
||||
m_txd2_callback(state);
|
||||
}
|
||||
|
||||
void w83787f_device::dtr_serial1_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x05) == 0x05)
|
||||
return;
|
||||
m_ndtr1_callback(state);
|
||||
}
|
||||
|
||||
void w83787f_device::dtr_serial2_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x0a) == 0x0a)
|
||||
return;
|
||||
m_ndtr2_callback(state);
|
||||
}
|
||||
|
||||
void w83787f_device::rts_serial1_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x05) == 0x05)
|
||||
return;
|
||||
m_nrts1_callback(state);
|
||||
}
|
||||
|
||||
void w83787f_device::rts_serial2_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x0a) == 0x0a)
|
||||
return;
|
||||
m_nrts2_callback(state);
|
||||
}
|
||||
|
||||
void w83787f_device::rxd1_w(int state)
|
||||
{
|
||||
m_pc_com[0]->rx_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::ndcd1_w(int state)
|
||||
{
|
||||
m_pc_com[0]->dcd_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::ndsr1_w(int state)
|
||||
{
|
||||
m_pc_com[0]->dsr_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::nri1_w(int state)
|
||||
{
|
||||
m_pc_com[0]->ri_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::ncts1_w(int state)
|
||||
{
|
||||
m_pc_com[0]->cts_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::rxd2_w(int state)
|
||||
{
|
||||
m_pc_com[1]->rx_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::ndcd2_w(int state)
|
||||
{
|
||||
m_pc_com[1]->dcd_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::ndsr2_w(int state)
|
||||
{
|
||||
m_pc_com[1]->dsr_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::nri2_w(int state)
|
||||
{
|
||||
m_pc_com[1]->ri_w(state);
|
||||
}
|
||||
|
||||
void w83787f_device::ncts2_w(int state)
|
||||
{
|
||||
m_pc_com[1]->cts_w(state);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parallel
|
||||
*/
|
||||
|
||||
void w83787f_device::irq_parallel_w(int state)
|
||||
{
|
||||
if ((m_cr1 & 0x30) == 0x30)
|
||||
return;
|
||||
request_irq(5, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
void w83787f_device::request_irq(int irq, int state)
|
||||
{
|
||||
switch (irq)
|
||||
{
|
||||
case 1:
|
||||
m_irq1_callback(state);
|
||||
break;
|
||||
case 3:
|
||||
m_isa->irq3_w(state);
|
||||
break;
|
||||
case 4:
|
||||
m_isa->irq4_w(state);
|
||||
break;
|
||||
case 5:
|
||||
m_isa->irq5_w(state);
|
||||
break;
|
||||
case 6:
|
||||
m_isa->irq6_w(state);
|
||||
break;
|
||||
case 7:
|
||||
m_isa->irq7_w(state);
|
||||
break;
|
||||
case 8:
|
||||
m_irq8_callback(state);
|
||||
break;
|
||||
case 9:
|
||||
m_irq9_callback(state);
|
||||
break;
|
||||
case 10:
|
||||
m_isa->irq10_w(state);
|
||||
break;
|
||||
case 11:
|
||||
m_isa->irq11_w(state);
|
||||
break;
|
||||
case 12:
|
||||
m_isa->irq12_w(state);
|
||||
break;
|
||||
case 14:
|
||||
m_isa->irq14_w(state);
|
||||
break;
|
||||
case 15:
|
||||
m_isa->irq15_w(state);
|
||||
break;
|
||||
}
|
||||
}
|
95
src/devices/machine/w83787f.h
Normal file
95
src/devices/machine/w83787f.h
Normal file
@ -0,0 +1,95 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders: Angelo Salese
|
||||
|
||||
#ifndef MAME_MACHINE_W83787F_H
|
||||
#define MAME_MACHINE_W83787F_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "bus/isa/isa.h"
|
||||
#include "machine/ins8250.h"
|
||||
#include "machine/pc_lpt.h"
|
||||
|
||||
class w83787f_device : public device_t,
|
||||
public device_isa16_card_interface,
|
||||
public device_memory_interface
|
||||
{
|
||||
public:
|
||||
w83787f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
~w83787f_device() {}
|
||||
|
||||
void remap(int space_id, offs_t start, offs_t end) override;
|
||||
|
||||
// auto gp20_reset() { return m_gp20_reset_callback.bind(); }
|
||||
// auto gp25_gatea20() { return m_gp25_gatea20_callback.bind(); }
|
||||
auto irq1() { return m_irq1_callback.bind(); }
|
||||
auto irq8() { return m_irq8_callback.bind(); }
|
||||
auto irq9() { return m_irq9_callback.bind(); }
|
||||
auto txd1() { return m_txd1_callback.bind(); }
|
||||
auto ndtr1() { return m_ndtr1_callback.bind(); }
|
||||
auto nrts1() { return m_nrts1_callback.bind(); }
|
||||
auto txd2() { return m_txd2_callback.bind(); }
|
||||
auto ndtr2() { return m_ndtr2_callback.bind(); }
|
||||
auto nrts2() { return m_nrts2_callback.bind(); }
|
||||
|
||||
void rxd1_w(int state);
|
||||
void ndcd1_w(int state);
|
||||
void ndsr1_w(int state);
|
||||
void nri1_w(int state);
|
||||
void ncts1_w(int state);
|
||||
void rxd2_w(int state);
|
||||
void ndcd2_w(int state);
|
||||
void ndsr2_w(int state);
|
||||
void nri2_w(int state);
|
||||
void ncts2_w(int state);
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual space_config_vector memory_space_config() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
const address_space_config m_space_config;
|
||||
|
||||
required_device_array<ns16550_device, 2> m_pc_com;
|
||||
required_device<pc_lpt_device> m_pc_lpt;
|
||||
|
||||
devcb_write_line m_irq1_callback;
|
||||
devcb_write_line m_irq8_callback;
|
||||
devcb_write_line m_irq9_callback;
|
||||
devcb_write_line m_txd1_callback;
|
||||
devcb_write_line m_ndtr1_callback;
|
||||
devcb_write_line m_nrts1_callback;
|
||||
devcb_write_line m_txd2_callback;
|
||||
devcb_write_line m_ndtr2_callback;
|
||||
devcb_write_line m_nrts2_callback;
|
||||
|
||||
void request_irq(int irq, int state);
|
||||
|
||||
u8 read(offs_t offset);
|
||||
void write(offs_t offset, u8 data);
|
||||
|
||||
void config_map(address_map &map);
|
||||
|
||||
void irq_parallel_w(int state);
|
||||
|
||||
void irq_serial1_w(int state);
|
||||
void txd_serial1_w(int state);
|
||||
void dtr_serial1_w(int state);
|
||||
void rts_serial1_w(int state);
|
||||
void irq_serial2_w(int state);
|
||||
void txd_serial2_w(int state);
|
||||
void dtr_serial2_w(int state);
|
||||
void rts_serial2_w(int state);
|
||||
|
||||
u8 m_index = 0;
|
||||
|
||||
bool m_locked_state = true;
|
||||
u8 m_cr1 = 0;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(W83787F, w83787f_device);
|
||||
|
||||
#endif // MAME_MACHINE_W83787F_H
|
@ -16,11 +16,18 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "bus/isa/isa_cards.h"
|
||||
#include "bus/rs232/hlemouse.h"
|
||||
#include "bus/rs232/null_modem.h"
|
||||
#include "bus/rs232/rs232.h"
|
||||
#include "bus/rs232/sun_kbd.h"
|
||||
#include "bus/rs232/terminal.h"
|
||||
#include "cpu/i386/i386.h"
|
||||
#include "machine/pci.h"
|
||||
#include "machine/sis85c496.h"
|
||||
#include "machine/w83787f.h"
|
||||
#include "video/voodoo_pci.h"
|
||||
|
||||
|
||||
class sis496_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -33,9 +40,12 @@ public:
|
||||
|
||||
protected:
|
||||
required_device<i486dx4_device> m_maincpu;
|
||||
|
||||
private:
|
||||
void main_io(address_map &map);
|
||||
void main_map(address_map &map);
|
||||
|
||||
static void winbond_superio_config(device_t *device);
|
||||
};
|
||||
|
||||
#define PCI_ID_VIDEO "pci:09.0"
|
||||
@ -66,6 +76,39 @@ void sis496_state::main_io(address_map &map)
|
||||
map.unmap_value_high();
|
||||
}
|
||||
|
||||
static void isa_com(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("microsoft_mouse", MSFT_HLE_SERIAL_MOUSE);
|
||||
device.option_add("logitech_mouse", LOGITECH_HLE_SERIAL_MOUSE);
|
||||
device.option_add("wheel_mouse", WHEEL_HLE_SERIAL_MOUSE);
|
||||
device.option_add("msystems_mouse", MSYSTEMS_HLE_SERIAL_MOUSE);
|
||||
device.option_add("rotatable_mouse", ROTATABLE_HLE_SERIAL_MOUSE);
|
||||
device.option_add("terminal", SERIAL_TERMINAL);
|
||||
device.option_add("null_modem", NULL_MODEM);
|
||||
device.option_add("sun_kbd", SUN_KBD_ADAPTOR);
|
||||
}
|
||||
|
||||
static void isa_internal_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("w83787f", W83787F);
|
||||
}
|
||||
|
||||
void sis496_state::winbond_superio_config(device_t *device)
|
||||
{
|
||||
w83787f_device &fdc = *downcast<w83787f_device *>(device);
|
||||
// fdc.set_sysopt_pin(1);
|
||||
// fdc.gp20_reset().set_inputline(":maincpu", INPUT_LINE_RESET);
|
||||
// fdc.gp25_gatea20().set_inputline(":maincpu", INPUT_LINE_A20);
|
||||
fdc.irq1().set(":pci:05.0", FUNC(sis85c496_host_device::pc_irq1_w));
|
||||
fdc.irq8().set(":pci:05.0", FUNC(sis85c496_host_device::pc_irq8n_w));
|
||||
fdc.txd1().set(":serport0", FUNC(rs232_port_device::write_txd));
|
||||
fdc.ndtr1().set(":serport0", FUNC(rs232_port_device::write_dtr));
|
||||
fdc.nrts1().set(":serport0", FUNC(rs232_port_device::write_rts));
|
||||
fdc.txd2().set(":serport1", FUNC(rs232_port_device::write_txd));
|
||||
fdc.ndtr2().set(":serport1", FUNC(rs232_port_device::write_dtr));
|
||||
fdc.nrts2().set(":serport1", FUNC(rs232_port_device::write_rts));
|
||||
}
|
||||
|
||||
void sis496_state::sis496(machine_config &config)
|
||||
{
|
||||
// Basic machine hardware
|
||||
@ -77,10 +120,25 @@ void sis496_state::sis496(machine_config &config)
|
||||
PCI_ROOT(config, "pci", 0);
|
||||
SIS85C496_HOST(config, "pci:05.0", 0, "maincpu", 32*1024*1024);
|
||||
|
||||
ISA16_SLOT(config, "board4", 0, "pci:05.0:isabus", isa_internal_devices, "w83787f", true).set_option_machine_config("w83787f", winbond_superio_config);
|
||||
ISA16_SLOT(config, "isa1", 0, "pci:05.0:isabus", pc_isa16_cards, "wd90c31_lr", false);
|
||||
ISA16_SLOT(config, "isa2", 0, "pci:05.0:isabus", pc_isa16_cards, nullptr, false);
|
||||
ISA16_SLOT(config, "isa3", 0, "pci:05.0:isabus", pc_isa16_cards, nullptr, false);
|
||||
|
||||
rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, "logitech_mouse"));
|
||||
serport0.rxd_handler().set("board4:w83787f", FUNC(w83787f_device::rxd1_w));
|
||||
serport0.dcd_handler().set("board4:w83787f", FUNC(w83787f_device::ndcd1_w));
|
||||
serport0.dsr_handler().set("board4:w83787f", FUNC(w83787f_device::ndsr1_w));
|
||||
serport0.ri_handler().set("board4:w83787f", FUNC(w83787f_device::nri1_w));
|
||||
serport0.cts_handler().set("board4:w83787f", FUNC(w83787f_device::ncts1_w));
|
||||
|
||||
rs232_port_device &serport1(RS232_PORT(config, "serport1", isa_com, nullptr));
|
||||
serport1.rxd_handler().set("board4:w83787f", FUNC(w83787f_device::rxd2_w));
|
||||
serport1.dcd_handler().set("board4:w83787f", FUNC(w83787f_device::ndcd2_w));
|
||||
serport1.dsr_handler().set("board4:w83787f", FUNC(w83787f_device::ndsr2_w));
|
||||
serport1.ri_handler().set("board4:w83787f", FUNC(w83787f_device::nri2_w));
|
||||
serport1.cts_handler().set("board4:w83787f", FUNC(w83787f_device::ncts2_w));
|
||||
|
||||
// TODO: 9-10-11-12 for PCI_SLOT (according to BIOS)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user