mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
cdp1852: Replace callback macros with devcb3 bindings; use line write handler to clock output from TPB (nw)
comx35: Add SC and TPB handlers for the expansion bus (nw)
This commit is contained in:
parent
37918a690c
commit
375427dcee
@ -73,9 +73,7 @@ uint8_t comx_expansion_slot_device::mrd_r(address_space &space, offs_t offset, i
|
|||||||
uint8_t data = 0;
|
uint8_t data = 0;
|
||||||
|
|
||||||
if (m_card != nullptr)
|
if (m_card != nullptr)
|
||||||
{
|
|
||||||
data = m_card->comx_mrd_r(space, offset, extrom);
|
data = m_card->comx_mrd_r(space, offset, extrom);
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -88,10 +86,8 @@ uint8_t comx_expansion_slot_device::mrd_r(address_space &space, offs_t offset, i
|
|||||||
void comx_expansion_slot_device::mwr_w(address_space &space, offs_t offset, uint8_t data)
|
void comx_expansion_slot_device::mwr_w(address_space &space, offs_t offset, uint8_t data)
|
||||||
{
|
{
|
||||||
if (m_card != nullptr)
|
if (m_card != nullptr)
|
||||||
{
|
|
||||||
m_card->comx_mwr_w(space, offset, data);
|
m_card->comx_mwr_w(space, offset, data);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -103,9 +99,7 @@ uint8_t comx_expansion_slot_device::io_r(address_space &space, offs_t offset)
|
|||||||
uint8_t data = 0;
|
uint8_t data = 0;
|
||||||
|
|
||||||
if (m_card != nullptr)
|
if (m_card != nullptr)
|
||||||
{
|
|
||||||
data = m_card->comx_io_r(space, offset);
|
data = m_card->comx_io_r(space, offset);
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -118,10 +112,8 @@ uint8_t comx_expansion_slot_device::io_r(address_space &space, offs_t offset)
|
|||||||
void comx_expansion_slot_device::io_w(address_space &space, offs_t offset, uint8_t data)
|
void comx_expansion_slot_device::io_w(address_space &space, offs_t offset, uint8_t data)
|
||||||
{
|
{
|
||||||
if (m_card != nullptr)
|
if (m_card != nullptr)
|
||||||
{
|
|
||||||
m_card->comx_io_w(space, offset, data);
|
m_card->comx_io_w(space, offset, data);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -131,10 +123,8 @@ void comx_expansion_slot_device::io_w(address_space &space, offs_t offset, uint8
|
|||||||
WRITE_LINE_MEMBER(comx_expansion_slot_device::ds_w)
|
WRITE_LINE_MEMBER(comx_expansion_slot_device::ds_w)
|
||||||
{
|
{
|
||||||
if (m_card != nullptr)
|
if (m_card != nullptr)
|
||||||
{
|
|
||||||
m_card->comx_ds_w(state);
|
m_card->comx_ds_w(state);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -144,24 +134,47 @@ WRITE_LINE_MEMBER( comx_expansion_slot_device::ds_w )
|
|||||||
WRITE_LINE_MEMBER(comx_expansion_slot_device::q_w)
|
WRITE_LINE_MEMBER(comx_expansion_slot_device::q_w)
|
||||||
{
|
{
|
||||||
if (m_card != nullptr)
|
if (m_card != nullptr)
|
||||||
{
|
|
||||||
m_card->comx_q_w(state);
|
m_card->comx_q_w(state);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// ef4_r - EF4 poll
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
READ_LINE_MEMBER(comx_expansion_slot_device::ef4_r)
|
READ_LINE_MEMBER(comx_expansion_slot_device::ef4_r)
|
||||||
{
|
{
|
||||||
int state = CLEAR_LINE;
|
int state = CLEAR_LINE;
|
||||||
|
|
||||||
if (m_card != nullptr)
|
if (m_card != nullptr)
|
||||||
{
|
|
||||||
state = m_card->comx_ef4_r();
|
state = m_card->comx_ef4_r();
|
||||||
}
|
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// sc_w - state code/N0-N2 write
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
WRITE8_MEMBER(comx_expansion_slot_device::sc_w)
|
||||||
|
{
|
||||||
|
if (m_card != nullptr)
|
||||||
|
m_card->comx_sc_w(offset, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// tpb_w - TPB write
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(comx_expansion_slot_device::tpb_w)
|
||||||
|
{
|
||||||
|
if (m_card != nullptr)
|
||||||
|
m_card->comx_tpb_w(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// SLOT_INTERFACE( comx_expansion_cards )
|
// SLOT_INTERFACE( comx_expansion_cards )
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
@ -91,6 +91,9 @@ public:
|
|||||||
|
|
||||||
DECLARE_WRITE_LINE_MEMBER(irq_w) { m_write_irq(state); }
|
DECLARE_WRITE_LINE_MEMBER(irq_w) { m_write_irq(state); }
|
||||||
|
|
||||||
|
DECLARE_WRITE8_MEMBER(sc_w);
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(tpb_w);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
@ -116,6 +119,8 @@ protected:
|
|||||||
virtual int comx_ef4_r() { return CLEAR_LINE; }
|
virtual int comx_ef4_r() { return CLEAR_LINE; }
|
||||||
virtual void comx_ds_w(int state) { m_ds = state; }
|
virtual void comx_ds_w(int state) { m_ds = state; }
|
||||||
virtual void comx_q_w(int state) { }
|
virtual void comx_q_w(int state) { }
|
||||||
|
virtual void comx_sc_w(int n, int sc) { }
|
||||||
|
virtual void comx_tpb_w(int state) { }
|
||||||
|
|
||||||
// memory access
|
// memory access
|
||||||
virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) { return 0; }
|
virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) { return 0; }
|
||||||
|
@ -39,13 +39,16 @@ enum
|
|||||||
// cdp1852_device - constructor
|
// cdp1852_device - constructor
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
cdp1852_device::cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
cdp1852_device::cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||||
device_t(mconfig, CDP1852, tag, owner, clock),
|
device_t(mconfig, CDP1852, tag, owner, clock),
|
||||||
m_read_mode(*this),
|
m_read_mode(*this),
|
||||||
m_write_sr(*this),
|
m_write_sr(*this),
|
||||||
m_read_data(*this),
|
m_read_data(*this),
|
||||||
m_write_data(*this),
|
m_write_data(*this),
|
||||||
m_new_data(0), m_data(0), m_next_data(0), m_sr(0), m_next_sr(0), m_scan_timer(nullptr)
|
m_new_data(false), m_data(0),
|
||||||
|
m_clock_active(true), m_sr(false), m_next_sr(false),
|
||||||
|
m_update_do_timer(nullptr),
|
||||||
|
m_update_sr_timer(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,16 +66,13 @@ void cdp1852_device::device_start()
|
|||||||
m_write_data.resolve_safe();
|
m_write_data.resolve_safe();
|
||||||
|
|
||||||
// allocate timers
|
// allocate timers
|
||||||
if (clock() > 0)
|
m_update_do_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdp1852_device::update_do), this));
|
||||||
{
|
m_update_sr_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdp1852_device::update_sr), this));
|
||||||
m_scan_timer = timer_alloc();
|
|
||||||
m_scan_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// register for state saving
|
// register for state saving
|
||||||
save_item(NAME(m_new_data));
|
save_item(NAME(m_new_data));
|
||||||
save_item(NAME(m_data));
|
save_item(NAME(m_data));
|
||||||
save_item(NAME(m_next_data));
|
save_item(NAME(m_clock_active));
|
||||||
save_item(NAME(m_sr));
|
save_item(NAME(m_sr));
|
||||||
save_item(NAME(m_next_sr));
|
save_item(NAME(m_next_sr));
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ void cdp1852_device::device_reset()
|
|||||||
if (!m_read_mode())
|
if (!m_read_mode())
|
||||||
{
|
{
|
||||||
// reset service request flip-flop
|
// reset service request flip-flop
|
||||||
set_sr_line(1);
|
set_sr_line(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -98,16 +98,23 @@ void cdp1852_device::device_reset()
|
|||||||
m_write_data((offs_t)0, m_data);
|
m_write_data((offs_t)0, m_data);
|
||||||
|
|
||||||
// reset service request flip-flop
|
// reset service request flip-flop
|
||||||
set_sr_line(0);
|
set_sr_line(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_timer - handler timer events
|
// clock_w - clock write
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void cdp1852_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
WRITE_LINE_MEMBER(cdp1852_device::clock_w)
|
||||||
|
{
|
||||||
|
if (m_clock_active != bool(state))
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_clock_active = bool(state);
|
||||||
|
|
||||||
|
if (!state)
|
||||||
{
|
{
|
||||||
if (!m_read_mode())
|
if (!m_read_mode())
|
||||||
{
|
{
|
||||||
@ -121,18 +128,12 @@ void cdp1852_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
|||||||
{
|
{
|
||||||
if (m_new_data)
|
if (m_new_data)
|
||||||
{
|
{
|
||||||
m_new_data = 0;
|
m_new_data = false;
|
||||||
|
|
||||||
// latch data into register
|
|
||||||
m_data = m_next_data;
|
|
||||||
|
|
||||||
// output data
|
|
||||||
m_write_data((offs_t)0, m_data);
|
|
||||||
|
|
||||||
// signal peripheral device
|
// signal peripheral device
|
||||||
set_sr_line(1);
|
set_sr_line(true);
|
||||||
|
|
||||||
m_next_sr = 0;
|
m_next_sr = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -140,36 +141,57 @@ void cdp1852_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// set_sr_line -
|
// set_sr_line -
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void cdp1852_device::set_sr_line(int state)
|
void cdp1852_device::set_sr_line(bool state)
|
||||||
{
|
{
|
||||||
if (m_sr != state)
|
if (m_sr != state)
|
||||||
{
|
{
|
||||||
m_sr = state;
|
m_sr = state;
|
||||||
|
|
||||||
m_write_sr(m_sr);
|
m_update_sr_timer->adjust(attotime::zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// update_do - update data output
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
TIMER_CALLBACK_MEMBER(cdp1852_device::update_do)
|
||||||
|
{
|
||||||
|
m_write_data(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// update_sr - update status request output
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
TIMER_CALLBACK_MEMBER(cdp1852_device::update_sr)
|
||||||
|
{
|
||||||
|
m_write_sr(m_sr ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// read - data read
|
// read - data read
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
READ8_MEMBER(cdp1852_device::read)
|
READ8_MEMBER(cdp1852_device::read)
|
||||||
{
|
{
|
||||||
if (!m_read_mode() && !clock())
|
if (!m_read_mode() && m_clock_active)
|
||||||
{
|
{
|
||||||
// input data into register
|
// input data into register
|
||||||
m_data = m_read_data(0);
|
m_data = m_read_data(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_sr_line(1);
|
set_sr_line(true);
|
||||||
|
|
||||||
return m_data;
|
return m_data;
|
||||||
}
|
}
|
||||||
@ -181,9 +203,11 @@ READ8_MEMBER( cdp1852_device::read )
|
|||||||
|
|
||||||
WRITE8_MEMBER(cdp1852_device::write)
|
WRITE8_MEMBER(cdp1852_device::write)
|
||||||
{
|
{
|
||||||
if (m_read_mode())
|
if (m_read_mode() && m_clock_active)
|
||||||
{
|
{
|
||||||
m_next_data = data;
|
// output data
|
||||||
m_new_data = 1;
|
m_update_do_timer->adjust(attotime::zero, data);
|
||||||
|
|
||||||
|
m_new_data = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,24 +29,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
|
||||||
// INTERFACE CONFIGURATION MACROS
|
|
||||||
//**************************************************************************
|
|
||||||
|
|
||||||
#define MCFG_CDP1852_MODE_CALLBACK(_read) \
|
|
||||||
downcast<cdp1852_device &>(*device).set_mode_rd_callback(DEVCB_##_read);
|
|
||||||
|
|
||||||
#define MCFG_CDP1852_SR_CALLBACK(_write) \
|
|
||||||
downcast<cdp1852_device &>(*device).set_sr_wr_callback(DEVCB_##_write);
|
|
||||||
|
|
||||||
#define MCFG_CDP1852_DI_CALLBACK(_read) \
|
|
||||||
downcast<cdp1852_device &>(*device).set_data_rd_callback(DEVCB_##_read);
|
|
||||||
|
|
||||||
#define MCFG_CDP1852_DO_CALLBACK(_write) \
|
|
||||||
downcast<cdp1852_device &>(*device).set_data_wr_callback(DEVCB_##_write);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// TYPE DEFINITIONS
|
// TYPE DEFINITIONS
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -57,41 +39,46 @@ class cdp1852_device : public device_t
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
|
||||||
|
|
||||||
template <class Object> devcb_base &set_mode_rd_callback(Object &&cb) { return m_read_mode.set_callback(std::forward<Object>(cb)); }
|
auto mode_cb() { return m_read_mode.bind(); }
|
||||||
template <class Object> devcb_base &set_sr_wr_callback(Object &&cb) { return m_write_sr.set_callback(std::forward<Object>(cb)); }
|
auto sr_cb() { return m_write_sr.bind(); }
|
||||||
template <class Object> devcb_base &set_data_rd_callback(Object &&cb) { return m_read_data.set_callback(std::forward<Object>(cb)); }
|
auto di_cb() { return m_read_data.bind(); }
|
||||||
template <class Object> devcb_base &set_data_wr_callback(Object &&cb) { return m_write_data.set_callback(std::forward<Object>(cb)); }
|
auto do_cb() { return m_write_data.bind(); }
|
||||||
|
|
||||||
DECLARE_READ8_MEMBER(read);
|
DECLARE_READ8_MEMBER(read);
|
||||||
DECLARE_WRITE8_MEMBER(write);
|
DECLARE_WRITE8_MEMBER(write);
|
||||||
|
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(clock_w);
|
||||||
|
|
||||||
uint8_t do_r() { return m_data; }
|
uint8_t do_r() { return m_data; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_sr_line(int state);
|
void set_sr_line(bool state);
|
||||||
|
|
||||||
|
TIMER_CALLBACK_MEMBER(update_do);
|
||||||
|
TIMER_CALLBACK_MEMBER(update_sr);
|
||||||
|
|
||||||
devcb_read_line m_read_mode;
|
devcb_read_line m_read_mode;
|
||||||
devcb_write_line m_write_sr;
|
devcb_write_line m_write_sr;
|
||||||
devcb_read8 m_read_data;
|
devcb_read8 m_read_data;
|
||||||
devcb_write8 m_write_data;
|
devcb_write8 m_write_data;
|
||||||
|
|
||||||
int m_new_data; // new data written
|
bool m_new_data; // new data written
|
||||||
uint8_t m_data; // data latch
|
u8 m_data; // data latch
|
||||||
uint8_t m_next_data; // next data
|
|
||||||
|
|
||||||
int m_sr; // service request flag
|
bool m_clock_active; // input clock
|
||||||
int m_next_sr; // next value of service request flag
|
bool m_sr; // service request flag
|
||||||
|
bool m_next_sr; // next value of service request flag
|
||||||
|
|
||||||
// timers
|
// timers
|
||||||
emu_timer *m_scan_timer;
|
emu_timer *m_update_do_timer;
|
||||||
|
emu_timer *m_update_sr_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -438,22 +438,26 @@ MACHINE_CONFIG_START(cidelsa_state::altair)
|
|||||||
cpu.wait_cb().set_constant(1);
|
cpu.wait_cb().set_constant(1);
|
||||||
cpu.clear_cb().set(FUNC(cidelsa_state::clear_r));
|
cpu.clear_cb().set(FUNC(cidelsa_state::clear_r));
|
||||||
cpu.q_cb().set(FUNC(cidelsa_state::q_w));
|
cpu.q_cb().set(FUNC(cidelsa_state::q_w));
|
||||||
|
cpu.tpb_cb().set("ic26", FUNC(cdp1852_device::clock_w));
|
||||||
|
|
||||||
MCFG_NVRAM_ADD_0FILL("nvram")
|
MCFG_NVRAM_ADD_0FILL("nvram")
|
||||||
|
|
||||||
/* input/output hardware */
|
/* input/output hardware */
|
||||||
MCFG_DEVICE_ADD("ic23", CDP1852, 0) // clock is really tied to CDP1869 CMSEL (pin 37)
|
cdp1852_device &ic23(CDP1852(config, "ic23")); // clock is really tied to CDP1869 CMSEL (pin 37)
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
|
ic23.mode_cb().set_constant(0);
|
||||||
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN0"))
|
ic23.di_cb().set_ioport("IN0");
|
||||||
MCFG_DEVICE_ADD("ic24", CDP1852, 0)
|
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
|
cdp1852_device &ic24(CDP1852(config, "ic24"));
|
||||||
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN1"))
|
ic24.mode_cb().set_constant(0);
|
||||||
MCFG_DEVICE_ADD("ic25", CDP1852, 0)
|
ic24.di_cb().set_ioport("IN1");
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
|
|
||||||
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN2"))
|
cdp1852_device &ic25(CDP1852(config, "ic25"));
|
||||||
MCFG_DEVICE_ADD("ic26", CDP1852, ALTAIR_CHR1 / 8) // clock is CDP1802 TPB
|
ic25.mode_cb().set_constant(0);
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(1))
|
ic25.di_cb().set_ioport("IN2");
|
||||||
MCFG_CDP1852_DO_CALLBACK(WRITE8(*this, cidelsa_state, altair_out1_w))
|
|
||||||
|
cdp1852_device &ic26(CDP1852(config, "ic26")); // clock is CDP1802 TPB
|
||||||
|
ic26.mode_cb().set_constant(1);
|
||||||
|
ic26.do_cb().set(FUNC(cidelsa_state::altair_out1_w));
|
||||||
|
|
||||||
/* sound and video hardware */
|
/* sound and video hardware */
|
||||||
altair_video(config);
|
altair_video(config);
|
||||||
@ -467,6 +471,7 @@ MACHINE_CONFIG_START(draco_state::draco)
|
|||||||
cpu.wait_cb().set_constant(1);
|
cpu.wait_cb().set_constant(1);
|
||||||
cpu.clear_cb().set(FUNC(draco_state::clear_r));
|
cpu.clear_cb().set(FUNC(draco_state::clear_r));
|
||||||
cpu.q_cb().set(FUNC(draco_state::q_w));
|
cpu.q_cb().set(FUNC(draco_state::q_w));
|
||||||
|
cpu.tpb_cb().set("ic32", FUNC(cdp1852_device::clock_w));
|
||||||
|
|
||||||
MCFG_NVRAM_ADD_0FILL("nvram")
|
MCFG_NVRAM_ADD_0FILL("nvram")
|
||||||
|
|
||||||
@ -480,18 +485,21 @@ MACHINE_CONFIG_START(draco_state::draco)
|
|||||||
MCFG_COP400_READ_IN_CB(READ8(*this, draco_state, sound_in_r))
|
MCFG_COP400_READ_IN_CB(READ8(*this, draco_state, sound_in_r))
|
||||||
|
|
||||||
/* input/output hardware */
|
/* input/output hardware */
|
||||||
MCFG_DEVICE_ADD("ic29", CDP1852, 0) // clock is really tied to CDP1869 CMSEL (pin 37)
|
cdp1852_device &ic29(CDP1852(config, "ic29")); // clock is really tied to CDP1869 CMSEL (pin 37)
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
|
ic29.mode_cb().set_constant(0);
|
||||||
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN0"))
|
ic29.di_cb().set_ioport("IN0");
|
||||||
MCFG_DEVICE_ADD("ic30", CDP1852, 0)
|
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
|
cdp1852_device &ic30(CDP1852(config, "ic30"));
|
||||||
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN1"))
|
ic30.mode_cb().set_constant(0);
|
||||||
MCFG_DEVICE_ADD("ic31", CDP1852, 0)
|
ic30.di_cb().set_ioport("IN1");
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
|
|
||||||
MCFG_CDP1852_DI_CALLBACK(IOPORT("IN2"))
|
cdp1852_device &ic31(CDP1852(config, "ic31"));
|
||||||
MCFG_DEVICE_ADD("ic32", CDP1852, ALTAIR_CHR1 / 8) // clock is CDP1802 TPB
|
ic31.mode_cb().set_constant(0);
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(1))
|
ic31.di_cb().set_ioport("IN2");
|
||||||
MCFG_CDP1852_DO_CALLBACK(WRITE8(*this, draco_state, out1_w))
|
|
||||||
|
cdp1852_device &ic32(CDP1852(config, "ic32")); // clock is CDP1802 TPB
|
||||||
|
ic32.mode_cb().set_constant(1);
|
||||||
|
ic32.do_cb().set(FUNC(draco_state::out1_w));
|
||||||
|
|
||||||
/* sound and video hardware */
|
/* sound and video hardware */
|
||||||
draco_video(config);
|
draco_video(config);
|
||||||
|
@ -597,15 +597,17 @@ void comx35_state::machine_reset()
|
|||||||
|
|
||||||
MACHINE_CONFIG_START(comx35_state::pal)
|
MACHINE_CONFIG_START(comx35_state::pal)
|
||||||
// basic system hardware
|
// basic system hardware
|
||||||
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, cdp1869_device::CPU_CLK_PAL)
|
cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, cdp1869_device::CPU_CLK_PAL));
|
||||||
MCFG_DEVICE_PROGRAM_MAP(comx35_mem)
|
cpu.set_addrmap(AS_PROGRAM, &comx35_state::comx35_mem);
|
||||||
MCFG_DEVICE_IO_MAP(comx35_io)
|
cpu.set_addrmap(AS_IO, &comx35_state::comx35_io);
|
||||||
MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
|
cpu.wait_cb().set_constant(1);
|
||||||
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, comx35_state, clear_r))
|
cpu.clear_cb().set(FUNC(comx35_state::clear_r));
|
||||||
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, comx35_state, ef2_r))
|
cpu.ef2_cb().set(FUNC(comx35_state::ef2_r));
|
||||||
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, comx35_state, ef4_r))
|
cpu.ef4_cb().set(FUNC(comx35_state::ef4_r));
|
||||||
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, comx35_state, q_w))
|
cpu.q_cb().set(FUNC(comx35_state::q_w));
|
||||||
MCFG_COSMAC_SC_CALLBACK(WRITE8(*this, comx35_state, sc_w))
|
cpu.sc_cb().set(FUNC(comx35_state::sc_w));
|
||||||
|
cpu.sc_cb().append(EXPANSION_TAG, FUNC(comx_expansion_slot_device::sc_w));
|
||||||
|
cpu.tpb_cb().set(EXPANSION_TAG, FUNC(comx_expansion_slot_device::tpb_w));
|
||||||
|
|
||||||
// sound and video hardware
|
// sound and video hardware
|
||||||
comx35_pal_video(config);
|
comx35_pal_video(config);
|
||||||
@ -647,15 +649,17 @@ MACHINE_CONFIG_END
|
|||||||
|
|
||||||
MACHINE_CONFIG_START(comx35_state::ntsc)
|
MACHINE_CONFIG_START(comx35_state::ntsc)
|
||||||
// basic system hardware
|
// basic system hardware
|
||||||
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, cdp1869_device::CPU_CLK_NTSC)
|
cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, cdp1869_device::CPU_CLK_NTSC));
|
||||||
MCFG_DEVICE_PROGRAM_MAP(comx35_mem)
|
cpu.set_addrmap(AS_PROGRAM, &comx35_state::comx35_mem);
|
||||||
MCFG_DEVICE_IO_MAP(comx35_io)
|
cpu.set_addrmap(AS_IO, &comx35_state::comx35_io);
|
||||||
MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
|
cpu.wait_cb().set_constant(1);
|
||||||
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, comx35_state, clear_r))
|
cpu.clear_cb().set(FUNC(comx35_state::clear_r));
|
||||||
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, comx35_state, ef2_r))
|
cpu.ef2_cb().set(FUNC(comx35_state::ef2_r));
|
||||||
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, comx35_state, ef4_r))
|
cpu.ef4_cb().set(FUNC(comx35_state::ef4_r));
|
||||||
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, comx35_state, q_w))
|
cpu.q_cb().set(FUNC(comx35_state::q_w));
|
||||||
MCFG_COSMAC_SC_CALLBACK(WRITE8(*this, comx35_state, sc_w))
|
cpu.sc_cb().set(FUNC(comx35_state::sc_w));
|
||||||
|
cpu.sc_cb().append(EXPANSION_TAG, FUNC(comx_expansion_slot_device::sc_w));
|
||||||
|
cpu.tpb_cb().set(EXPANSION_TAG, FUNC(comx_expansion_slot_device::tpb_w));
|
||||||
|
|
||||||
// sound and video hardware
|
// sound and video hardware
|
||||||
comx35_ntsc_video(config);
|
comx35_ntsc_video(config);
|
||||||
|
@ -255,30 +255,34 @@ WRITE8_MEMBER( tmc600_state::sc_w )
|
|||||||
|
|
||||||
MACHINE_CONFIG_START(tmc600_state::tmc600)
|
MACHINE_CONFIG_START(tmc600_state::tmc600)
|
||||||
// CPU
|
// CPU
|
||||||
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, XTAL(3'570'000))
|
cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, 3.57_MHz_XTAL));
|
||||||
MCFG_DEVICE_PROGRAM_MAP(tmc600_map)
|
cpu.set_addrmap(AS_PROGRAM, &tmc600_state::tmc600_map);
|
||||||
MCFG_DEVICE_IO_MAP(tmc600_io_map)
|
cpu.set_addrmap(AS_IO, &tmc600_state::tmc600_io_map);
|
||||||
MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
|
cpu.wait_cb().set_constant(1);
|
||||||
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, tmc600_state, ef2_r))
|
cpu.ef2_cb().set(FUNC(tmc600_state::ef2_r));
|
||||||
MCFG_COSMAC_EF3_CALLBACK(READLINE(*this, tmc600_state, ef3_r))
|
cpu.ef3_cb().set(FUNC(tmc600_state::ef3_r));
|
||||||
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, tmc600_state, q_w))
|
cpu.q_cb().set(FUNC(tmc600_state::q_w));
|
||||||
MCFG_COSMAC_SC_CALLBACK(WRITE8(*this, tmc600_state, sc_w))
|
cpu.sc_cb().set(FUNC(tmc600_state::sc_w));
|
||||||
|
cpu.tpb_cb().set(CDP1852_KB_TAG, FUNC(cdp1852_device::clock_w));
|
||||||
|
cpu.tpb_cb().append(CDP1852_TMC700_TAG, FUNC(cdp1852_device::clock_w));
|
||||||
|
|
||||||
// sound and video hardware
|
// sound and video hardware
|
||||||
tmc600_video(config);
|
tmc600_video(config);
|
||||||
|
|
||||||
// keyboard output latch
|
// keyboard output latch
|
||||||
MCFG_DEVICE_ADD(CDP1852_KB_TAG, CDP1852, XTAL(3'570'000)/8) // clock is CDP1802 TPB
|
CDP1852(config, m_bwio); // clock is CDP1802 TPB
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(1))
|
m_bwio->mode_cb().set_constant(1);
|
||||||
|
|
||||||
|
#if 0
|
||||||
// address bus demux for expansion bus
|
// address bus demux for expansion bus
|
||||||
MCFG_DEVICE_ADD(CDP1852_BUS_TAG, CDP1852, 0) // clock is expansion bus TPA
|
cdp1852_device &demux(CDP1852(config, CDP1852_BUS_TAG)); // clock is expansion bus TPA
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(0))
|
demux.mode_cb().set_constant(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
// printer output latch
|
// printer output latch
|
||||||
MCFG_DEVICE_ADD(CDP1852_TMC700_TAG, CDP1852, XTAL(3'570'000)/8) // clock is CDP1802 TPB
|
cdp1852_device &prtout(CDP1852(config, CDP1852_KB_TAG)); // clock is CDP1802 TPB
|
||||||
MCFG_CDP1852_MODE_CALLBACK(CONSTANT(1))
|
prtout.mode_cb().set_constant(1);
|
||||||
MCFG_CDP1852_DO_CALLBACK(WRITE8(*this, tmc600_state, printer_w))
|
prtout.do_cb().set(FUNC(tmc600_state::printer_w));
|
||||||
|
|
||||||
// printer connector
|
// printer connector
|
||||||
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
||||||
|
Loading…
Reference in New Issue
Block a user