mirror of
https://github.com/holub/mame
synced 2025-10-05 00:38:58 +03:00
7200fifo: Separate device types by size (nw)
bus/isa/aha174x: Add FIFOs (nw)
This commit is contained in:
parent
737efd0d75
commit
f64cf21a2c
@ -47,6 +47,7 @@ aha174x_device::aha174x_device(const machine_config &mconfig, device_type type,
|
||||
, device_isa16_card_interface(mconfig, *this)
|
||||
, m_hpc(*this, "hpc")
|
||||
, m_busaic(*this, "busaic")
|
||||
, m_fifo(*this, "fifo%u", 0U)
|
||||
, m_bios(*this, "bios")
|
||||
{
|
||||
}
|
||||
@ -72,6 +73,10 @@ void aha174x_device::hpc_map(address_map &map)
|
||||
map(0x2000, 0x2003).rw(m_busaic, FUNC(aic565_device::local_r), FUNC(aic565_device::local_w));
|
||||
map(0x4000, 0x4002).rw("bmic", FUNC(i82355_device::local_r), FUNC(i82355_device::local_w));
|
||||
map(0x5000, 0x500f).m("scsi:7:scsic", FUNC(aic6251a_device::map));
|
||||
map(0x7000, 0x7000).w(m_fifo[0], FUNC(fifo7200_device::data_byte_w));
|
||||
map(0x7001, 0x7001).w(m_fifo[1], FUNC(fifo7200_device::data_byte_w));
|
||||
map(0x7002, 0x7002).r(m_fifo[0], FUNC(fifo7200_device::data_byte_r));
|
||||
map(0x7003, 0x7003).r(m_fifo[1], FUNC(fifo7200_device::data_byte_r));
|
||||
map(0x8000, 0xffff).rom().region("mcode", 0);
|
||||
}
|
||||
|
||||
@ -122,6 +127,9 @@ void aha1742a_device::device_add_mconfig(machine_config &config)
|
||||
I82355(config, "bmic", 0);
|
||||
//bmic.lint_callback().set_inputline(m_hpc, hpc_device::I2_LINE);
|
||||
|
||||
IDT7201(config, m_fifo[0]);
|
||||
IDT7201(config, m_fifo[1]);
|
||||
|
||||
NSCSI_BUS(config, "scsi");
|
||||
NSCSI_CONNECTOR(config, "scsi:0", aha174x_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:1", aha174x_scsi_devices, nullptr);
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "isa.h"
|
||||
#include "cpu/hpc/hpc.h"
|
||||
#include "machine/aic565.h"
|
||||
#include "machine/7200fifo.h"
|
||||
#include "machine/upd765.h"
|
||||
|
||||
class aha174x_device : public device_t, public device_isa16_card_interface
|
||||
@ -28,6 +29,7 @@ protected:
|
||||
|
||||
required_device<hpc46003_device> m_hpc;
|
||||
required_device<aic565_device> m_busaic;
|
||||
required_device_array<fifo7200_device, 2> m_fifo;
|
||||
required_region_ptr<u8> m_bios;
|
||||
};
|
||||
|
||||
|
@ -14,21 +14,55 @@
|
||||
#include "machine/7200fifo.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(FIFO7200, fifo7200_device, "fifo7200", "IDT7200 FIFO")
|
||||
DEFINE_DEVICE_TYPE(IDT7200, idt7200_device, "idt7200", "IDT7200 FIFO (256x9)")
|
||||
DEFINE_DEVICE_TYPE(IDT7201, idt7201_device, "idt7201", "IDT7201 FIFO (512x9)")
|
||||
DEFINE_DEVICE_TYPE(IDT7202, idt7202_device, "idt7202", "IDT7202 FIFO (1024x9)")
|
||||
|
||||
//-------------------------------------------------
|
||||
// fifo7200_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
fifo7200_device::fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, FIFO7200, tag, owner, clock),
|
||||
m_ram_size(0), m_read_ptr(0), m_write_ptr(0), m_ef(0), m_ff(0), m_hf(0),
|
||||
fifo7200_device::fifo7200_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, int size)
|
||||
: device_t(mconfig, type, tag, owner, (uint32_t)0),
|
||||
m_ram_size(size),
|
||||
m_read_ptr(0), m_write_ptr(0), m_ef(0), m_ff(0), m_hf(0),
|
||||
m_ef_handler(*this),
|
||||
m_ff_handler(*this),
|
||||
m_hf_handler(*this)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// idt7200_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
idt7200_device::idt7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: fifo7200_device(mconfig, IDT7200, tag, owner, 0x100)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// idt7201_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
idt7201_device::idt7201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: fifo7200_device(mconfig, IDT7201, tag, owner, 0x200)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// idt7202_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
idt7202_device::idt7202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: fifo7200_device(mconfig, IDT7202, tag, owner, 0x400)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
@ -61,18 +61,9 @@ The following chips are functionally equivalent and pin-compatible.
|
||||
class fifo7200_device : public device_t
|
||||
{
|
||||
public:
|
||||
fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, int size)
|
||||
: fifo7200_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
set_ram_size(size);
|
||||
}
|
||||
|
||||
fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
auto ef_handler() { return m_ef_handler.bind(); }
|
||||
auto ff_handler() { return m_ff_handler.bind(); }
|
||||
auto hf_handler() { return m_hf_handler.bind(); }
|
||||
void set_ram_size(int size) { m_ram_size = size; }
|
||||
|
||||
DECLARE_READ_LINE_MEMBER( ef_r ) { return !m_ef; } // _EF
|
||||
DECLARE_READ_LINE_MEMBER( ff_r ) { return !m_ff; } // _FF
|
||||
@ -87,6 +78,8 @@ public:
|
||||
DECLARE_READ8_MEMBER( data_byte_r ) { return (uint8_t)fifo_read(); }
|
||||
|
||||
protected:
|
||||
fifo7200_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, int size);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
@ -96,7 +89,7 @@ private:
|
||||
uint16_t fifo_read();
|
||||
|
||||
std::vector<uint16_t> m_buffer;
|
||||
int m_ram_size;
|
||||
const int m_ram_size;
|
||||
|
||||
int m_read_ptr;
|
||||
int m_write_ptr;
|
||||
@ -110,7 +103,33 @@ private:
|
||||
devcb_write_line m_hf_handler;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(FIFO7200, fifo7200_device)
|
||||
// ======================> idt7200_device
|
||||
|
||||
class idt7200_device : public fifo7200_device
|
||||
{
|
||||
public:
|
||||
idt7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
};
|
||||
|
||||
// ======================> idt7201_device
|
||||
|
||||
class idt7201_device : public fifo7200_device
|
||||
{
|
||||
public:
|
||||
idt7201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
};
|
||||
|
||||
// ======================> idt7202_device
|
||||
|
||||
class idt7202_device : public fifo7200_device
|
||||
{
|
||||
public:
|
||||
idt7202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
};
|
||||
|
||||
// device type definitions
|
||||
DECLARE_DEVICE_TYPE(IDT7200, idt7200_device)
|
||||
DECLARE_DEVICE_TYPE(IDT7201, idt7201_device)
|
||||
DECLARE_DEVICE_TYPE(IDT7202, idt7202_device)
|
||||
|
||||
#endif // MAME_MACHINE_7200FIFO_H
|
||||
|
@ -1883,8 +1883,8 @@ void seibuspi_state::spi(machine_config &config)
|
||||
INTEL_E28F008SA(config, "soundflash1"); // Sharp LH28F008 on newer mainboard revision
|
||||
INTEL_E28F008SA(config, "soundflash2"); // "
|
||||
|
||||
FIFO7200(config, m_soundfifo[0], 0x200); // LH5496D, but on single board hw it's one CY7C421
|
||||
FIFO7200(config, m_soundfifo[1], 0x200); // "
|
||||
IDT7201(config, m_soundfifo[0]); // LH5496D, but on single board hw it's one CY7C421
|
||||
IDT7201(config, m_soundfifo[1]); // "
|
||||
|
||||
/* video hardware */
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
|
@ -2717,8 +2717,8 @@ void zn_state::coh1002msnd(machine_config &config)
|
||||
m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::cbaj_z80_map);
|
||||
m_audiocpu->set_addrmap(AS_IO, &zn_state::cbaj_z80_port_map);
|
||||
|
||||
FIFO7200(config, m_cbaj_fifo[0], 0x400); // LH540202
|
||||
FIFO7200(config, m_cbaj_fifo[1], 0x400); // "
|
||||
IDT7202(config, m_cbaj_fifo[0]); // LH540202
|
||||
IDT7202(config, m_cbaj_fifo[1]); // "
|
||||
|
||||
config.m_minimum_quantum = attotime::from_hz(6000);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user