6532riot: updated to use devcb2. nw.

This commit is contained in:
Fabio Priuli 2014-04-30 09:42:07 +00:00
parent 48c3c60cd5
commit bbfd445e15
26 changed files with 254 additions and 384 deletions

View File

@ -121,20 +121,6 @@ static ADDRESS_MAP_START( interpod_mem, AS_PROGRAM, 8, interpod_device )
ADDRESS_MAP_END
//-------------------------------------------------
// riot6532_interface riot_intf
//-------------------------------------------------
static const riot6532_interface riot_intf =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL
};
//-------------------------------------------------
// MACHINE_DRIVER( interpod )
//-------------------------------------------------
@ -144,7 +130,7 @@ static MACHINE_CONFIG_FRAGMENT( interpod )
MCFG_CPU_PROGRAM_MAP(interpod_mem)
MCFG_DEVICE_ADD(R6522_TAG, VIA6522, 1000000)
MCFG_RIOT6532_ADD(R6532_TAG, 1000000, riot_intf)
MCFG_DEVICE_ADD(R6532_TAG, RIOT6532, 1000000)
MCFG_DEVICE_ADD(MC6850_TAG, ACIA6850, 0)
MCFG_CBM_IEEE488_ADD(NULL)

View File

@ -153,7 +153,7 @@ ADDRESS_MAP_END
//-------------------------------------------------
// riot6532_interface riot0_intf uc1
// riot6532 uc1
//-------------------------------------------------
READ8_MEMBER( c2040_device::dio_r )
@ -196,18 +196,9 @@ WRITE8_MEMBER( c2040_device::dio_w )
m_bus->dio_w(this, data);
}
static const riot6532_interface riot0_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c2040_device, dio_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c2040_device, dio_w),
DEVCB_NULL
};
//-------------------------------------------------
// riot6532_interface riot1_intf ue1
// riot6532 ue1
//-------------------------------------------------
READ8_MEMBER( c2040_device::riot1_pa_r )
@ -334,15 +325,6 @@ WRITE8_MEMBER( c2040_device::riot1_pb_w )
output_set_led_value(LED_ERR, BIT(data, 5));
}
static const riot6532_interface riot1_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c2040_device, riot1_pa_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c2040_device, riot1_pb_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c2040_device, riot1_pa_w),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c2040_device, riot1_pb_w),
DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_IRQ0)
};
WRITE8_MEMBER( c2040_device::via_pb_w )
{
@ -467,8 +449,16 @@ static MACHINE_CONFIG_FRAGMENT( c2040 )
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/16)
MCFG_CPU_PROGRAM_MAP(c2040_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_16MHz/16, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_16MHz/16, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_16MHz/16)
MCFG_RIOT6532_IN_PA_CB(READ8(c2040_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c2040_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_16MHz/16)
MCFG_RIOT6532_IN_PA_CB(READ8(c2040_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(c2040_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(c2040_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c2040_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
// controller
MCFG_CPU_ADD(M6504_TAG, M6504, XTAL_16MHz/16)
@ -513,8 +503,16 @@ static MACHINE_CONFIG_FRAGMENT( c4040 )
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/16)
MCFG_CPU_PROGRAM_MAP(c2040_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_16MHz/16, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_16MHz/16, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_16MHz/16)
MCFG_RIOT6532_IN_PA_CB(READ8(c2040_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c2040_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_16MHz/16)
MCFG_RIOT6532_IN_PA_CB(READ8(c2040_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(c2040_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(c2040_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c2040_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
// controller
MCFG_CPU_ADD(M6504_TAG, M6504, XTAL_16MHz/16)

View File

@ -262,7 +262,7 @@ ADDRESS_MAP_END
//-------------------------------------------------
// riot6532_interface riot0_intf uc1
// riot6532 uc1
//-------------------------------------------------
READ8_MEMBER( c8050_device::dio_r )
@ -305,18 +305,8 @@ WRITE8_MEMBER( c8050_device::dio_w )
m_bus->dio_w(this, data);
}
static const riot6532_interface riot0_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8050_device, dio_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8050_device, dio_w),
DEVCB_NULL
};
//-------------------------------------------------
// riot6532_interface riot1_intf ue1
// riot6532 ue1
//-------------------------------------------------
READ8_MEMBER( c8050_device::riot1_pa_r )
@ -443,15 +433,6 @@ WRITE8_MEMBER( c8050_device::riot1_pb_w )
output_set_led_value(LED_ERR, BIT(data, 5));
}
static const riot6532_interface riot1_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8050_device, riot1_pa_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8050_device, riot1_pb_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8050_device, riot1_pa_w),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8050_device, riot1_pb_w),
DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_IRQ0)
};
READ8_MEMBER( c8050_device::via_pa_r )
{
@ -742,8 +723,16 @@ static MACHINE_CONFIG_FRAGMENT( c8050 )
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_12MHz/12)
MCFG_CPU_PROGRAM_MAP(c8050_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_12MHz/12, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_12MHz/12, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(c8050_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(c8050_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
// controller
MCFG_CPU_ADD(M6504_TAG, M6504, XTAL_12MHz/12)
@ -786,8 +775,16 @@ static MACHINE_CONFIG_FRAGMENT( c8250 )
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_12MHz/12)
MCFG_CPU_PROGRAM_MAP(c8050_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_12MHz/12, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_12MHz/12, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(c8050_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(c8050_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
// controller
MCFG_CPU_ADD(M6504_TAG, M6504, XTAL_12MHz/12)
@ -830,8 +827,16 @@ static MACHINE_CONFIG_FRAGMENT( c8250lp )
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_12MHz/12)
MCFG_CPU_PROGRAM_MAP(c8050_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_12MHz/12, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_12MHz/12, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(c8050_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(c8050_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
// controller
MCFG_CPU_ADD(M6504_TAG, M6504, XTAL_12MHz/12)
@ -874,8 +879,16 @@ static MACHINE_CONFIG_FRAGMENT( sfd1001 )
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_12MHz/12)
MCFG_CPU_PROGRAM_MAP(c8050_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_12MHz/12, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_12MHz/12, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_12MHz/12)
MCFG_RIOT6532_IN_PA_CB(READ8(c8050_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(c8050_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(c8050_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8050_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
// controller
MCFG_CPU_ADD(M6504_TAG, M6504, XTAL_12MHz/12)

View File

@ -116,7 +116,7 @@ ADDRESS_MAP_END
//-------------------------------------------------
// riot6532_interface riot0_intf
// riot6532 0
//-------------------------------------------------
READ8_MEMBER( c8280_device::dio_r )
@ -159,18 +159,8 @@ WRITE8_MEMBER( c8280_device::dio_w )
m_bus->dio_w(this, data);
}
static const riot6532_interface riot0_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8280_device, dio_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8280_device, dio_w),
DEVCB_NULL
};
//-------------------------------------------------
// riot6532_interface riot1_intf
// riot6532 1
//-------------------------------------------------
READ8_MEMBER( c8280_device::riot1_pa_r )
@ -298,16 +288,6 @@ WRITE8_MEMBER( c8280_device::riot1_pb_w )
}
static const riot6532_interface riot1_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8280_device, riot1_pa_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8280_device, riot1_pb_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8280_device, riot1_pa_w),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c8280_device, riot1_pb_w),
DEVCB_CPU_INPUT_LINE(M6502_DOS_TAG, INPUT_LINE_IRQ0)
};
//-------------------------------------------------
// wd17xx_interface fdc_intf
//-------------------------------------------------
@ -325,8 +305,16 @@ static MACHINE_CONFIG_FRAGMENT( c8280 )
MCFG_CPU_ADD(M6502_DOS_TAG, M6502, XTAL_12MHz/8)
MCFG_CPU_PROGRAM_MAP(c8280_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_12MHz/8, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_12MHz/8, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_12MHz/8)
MCFG_RIOT6532_IN_PA_CB(READ8(c8280_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8280_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_12MHz/8)
MCFG_RIOT6532_IN_PA_CB(READ8(c8280_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(c8280_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(c8280_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(c8280_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_DOS_TAG, INPUT_LINE_IRQ0))
MCFG_CPU_ADD(M6502_FDC_TAG, M6502, XTAL_12MHz/8)
MCFG_CPU_PROGRAM_MAP(c8280_fdc_mem)

View File

@ -141,7 +141,7 @@ ADDRESS_MAP_END
//-------------------------------------------------
// riot6532_interface riot0_intf
// riot6532 0
//-------------------------------------------------
READ8_MEMBER( base_d9060_device::dio_r )
@ -186,18 +186,8 @@ WRITE8_MEMBER( base_d9060_device::dio_w )
}
static const riot6532_interface riot0_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_d9060_device, dio_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_d9060_device, dio_w),
DEVCB_NULL
};
//-------------------------------------------------
// riot6532_interface riot1_intf
// riot6532 1
//-------------------------------------------------
READ8_MEMBER( base_d9060_device::riot1_pa_r )
@ -324,15 +314,6 @@ WRITE8_MEMBER( base_d9060_device::riot1_pb_w )
output_set_led_value(LED_ERROR, !BIT(data, 5));
}
static const riot6532_interface riot1_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_d9060_device, riot1_pa_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_d9060_device, riot1_pb_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_d9060_device, riot1_pa_w),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_d9060_device, riot1_pb_w),
DEVCB_CPU_INPUT_LINE(M6502_DOS_TAG, INPUT_LINE_IRQ0)
};
WRITE8_MEMBER( base_d9060_device::via_pb_w )
{
@ -394,8 +375,16 @@ static MACHINE_CONFIG_FRAGMENT( d9060 )
MCFG_CPU_ADD(M6502_DOS_TAG, M6502, XTAL_4MHz/4)
MCFG_CPU_PROGRAM_MAP(d9060_main_mem)
MCFG_RIOT6532_ADD(M6532_0_TAG, XTAL_4MHz/4, riot0_intf)
MCFG_RIOT6532_ADD(M6532_1_TAG, XTAL_4MHz/4, riot1_intf)
MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_4MHz/4)
MCFG_RIOT6532_IN_PA_CB(READ8(base_d9060_device, dio_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(base_d9060_device, dio_w))
MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_4MHz/4)
MCFG_RIOT6532_IN_PA_CB(READ8(base_d9060_device, riot1_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(base_d9060_device, riot1_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(base_d9060_device, riot1_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(base_d9060_device, riot1_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_DOS_TAG, INPUT_LINE_IRQ0))
// controller
MCFG_CPU_ADD(M6502_HDC_TAG, M6502, XTAL_4MHz/4)

View File

@ -34,7 +34,6 @@ enum
/***************************************************************************
INTERNAL FUNCTIONS
***************************************************************************/
@ -50,7 +49,7 @@ void riot6532_device::update_irqstate()
if (m_irq != irq)
{
m_irq_func(irq);
m_irq_cb(irq);
m_irq = irq;
}
}
@ -213,7 +212,7 @@ void riot6532_device::reg_w(UINT8 offset, UINT8 data)
else
{
/* A1 selects the port */
riot6532_port *port = &m_port[(offset >> 1) & 1];
riot6532_port *port = &m_port[BIT(offset, 1)];
/* if A0 == 1, we are writing to the port's DDR */
if (offset & 1)
@ -225,7 +224,10 @@ void riot6532_device::reg_w(UINT8 offset, UINT8 data)
else
{
port->m_out = data;
port->m_out_func(0, data);
if (!BIT(offset, 1))
m_out_pa_cb((offs_t)0, data);
else
m_out_pb_cb((offs_t)0, data);
}
/* writes to port A need to update the PA7 state */
@ -293,7 +295,7 @@ UINT8 riot6532_device::reg_r(UINT8 offset, bool debugger_access)
else
{
/* A1 selects the port */
riot6532_port *port = &m_port[(offset >> 1) & 1];
riot6532_port *port = &m_port[BIT(offset, 1)];
/* if A0 == 1, we are reading the port's DDR */
if (offset & 1)
@ -305,17 +307,17 @@ UINT8 riot6532_device::reg_r(UINT8 offset, bool debugger_access)
else
{
/* call the input callback if it exists */
if (!port->m_in_func.isnull())
{
port->m_in = port->m_in_func(0);
if (!BIT(offset, 1))
port->m_in = m_in_pa_cb(0);
else
port->m_in = m_in_pb_cb(0);
/* changes to port A need to update the PA7 state */
if (port == &m_port[0])
/* changes to port A need to update the PA7 state */
if (port == &m_port[0])
{
if (!debugger_access)
{
if ( ! debugger_access )
{
update_pa7_state();
}
update_pa7_state();
}
}
@ -397,56 +399,31 @@ UINT8 riot6532_device::portb_out_get()
//-------------------------------------------------
riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, RIOT6532, "6532 RIOT", tag, owner, clock, "riot6532", __FILE__)
, m_irq(CLEAR_LINE)
, m_pa7dir(0)
, m_pa7prev(0)
: device_t(mconfig, RIOT6532, "6532 RIOT", tag, owner, clock, "riot6532", __FILE__),
m_in_pa_cb(*this),
m_out_pa_cb(*this),
m_in_pb_cb(*this),
m_out_pb_cb(*this),
m_irq_cb(*this),
m_irq(CLEAR_LINE),
m_pa7dir(0),
m_pa7prev(0)
{
memset(m_port, 0x00, sizeof(m_port));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void riot6532_device::device_config_complete()
{
// inherit a copy of the static data
const riot6532_interface *intf = reinterpret_cast<const riot6532_interface *>(static_config());
if (intf != NULL)
{
*static_cast<riot6532_interface *>(this) = *intf;
}
// or initialize to defaults if none provided
else
{
memset(&m_in_a_cb, 0, sizeof(m_in_a_cb));
memset(&m_in_b_cb, 0, sizeof(m_in_b_cb));
memset(&m_out_a_cb, 0, sizeof(m_out_a_cb));
memset(&m_out_b_cb, 0, sizeof(m_out_b_cb));
memset(&m_irq_cb, 0, sizeof(m_irq_cb));
}
}
/*-------------------------------------------------
device_start - device-specific startup
-------------------------------------------------*/
void riot6532_device::device_start()
{
/* configure the ports */
m_port[0].m_in_func.resolve(m_in_a_cb, *this);
m_port[0].m_out_func.resolve(m_out_a_cb, *this);
m_port[1].m_in_func.resolve(m_in_b_cb, *this);
m_port[1].m_out_func.resolve(m_out_b_cb, *this);
/* resolve irq func */
m_irq_func.resolve(m_irq_cb, *this);
/* resolve callbacks */
m_in_pa_cb.resolve_safe(0);
m_out_pa_cb.resolve_safe();
m_in_pb_cb.resolve_safe(0);
m_out_pb_cb.resolve_safe();
m_irq_cb.resolve_safe();
/* allocate timers */
m_timer = machine().scheduler().timer_alloc(FUNC(timer_end_callback), (void *)this);

View File

@ -12,15 +12,24 @@
#include "emu.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_RIOT6532_ADD(_tag, _clock, _intrf) \
MCFG_DEVICE_ADD(_tag, RIOT6532, _clock) \
MCFG_DEVICE_CONFIG(_intrf)
#define MCFG_RIOT6532_IN_PA_CB(_devcb) \
devcb = &riot6532_device::set_in_pa_callback(*device, DEVCB2_##_devcb);
#define MCFG_RIOT6532_OUT_PA_CB(_devcb) \
devcb = &riot6532_device::set_out_pa_callback(*device, DEVCB2_##_devcb);
#define MCFG_RIOT6532_IN_PB_CB(_devcb) \
devcb = &riot6532_device::set_in_pb_callback(*device, DEVCB2_##_devcb);
#define MCFG_RIOT6532_OUT_PB_CB(_devcb) \
devcb = &riot6532_device::set_out_pb_callback(*device, DEVCB2_##_devcb);
#define MCFG_RIOT6532_IRQ_CB(_devcb) \
devcb = &riot6532_device::set_irq_callback(*device, DEVCB2_##_devcb);
/***************************************************************************
@ -28,28 +37,20 @@
***************************************************************************/
// ======================> riot6532_interface
struct riot6532_interface
{
devcb_read8 m_in_a_cb;
devcb_read8 m_in_b_cb;
devcb_write8 m_out_a_cb;
devcb_write8 m_out_b_cb;
devcb_write_line m_irq_cb;
};
// ======================> riot6532_device
class riot6532_device : public device_t,
public riot6532_interface
class riot6532_device : public device_t
{
public:
// construction/destruction
riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _Object> static devcb2_base &set_in_pa_callback(device_t &device, _Object object) { return downcast<riot6532_device &>(device).m_in_pa_cb.set_callback(object); }
template<class _Object> static devcb2_base &set_out_pa_callback(device_t &device, _Object object) { return downcast<riot6532_device &>(device).m_out_pa_cb.set_callback(object); }
template<class _Object> static devcb2_base &set_in_pb_callback(device_t &device, _Object object) { return downcast<riot6532_device &>(device).m_in_pb_cb.set_callback(object); }
template<class _Object> static devcb2_base &set_out_pb_callback(device_t &device, _Object object) { return downcast<riot6532_device &>(device).m_out_pb_cb.set_callback(object); }
template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<riot6532_device &>(device).m_irq_cb.set_callback(object); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@ -74,12 +75,9 @@ protected:
UINT8 m_in;
UINT8 m_out;
UINT8 m_ddr;
devcb_resolved_read8 m_in_func;
devcb_resolved_write8 m_out_func;
};
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@ -95,8 +93,12 @@ private:
riot6532_port m_port[2];
devcb_resolved_write_line m_irq_func;
devcb2_read8 m_in_pa_cb;
devcb2_write8 m_out_pa_cb;
devcb2_read8 m_in_pb_cb;
devcb2_write8 m_out_pb_cb;
devcb2_write_line m_irq_cb;
UINT8 m_irqstate;
UINT8 m_irqenable;
int m_irq;

View File

@ -457,17 +457,6 @@ READ8_MEMBER( exidy_sound_device::r6532_portb_r )
}
static const riot6532_interface r6532_interface =
{
DEVCB_DEVICE_MEMBER("custom", exidy_sound_device, r6532_porta_r), /* port A read handler */
DEVCB_DEVICE_MEMBER("custom", exidy_sound_device, r6532_portb_r), /* port B read handler */
DEVCB_DEVICE_MEMBER("custom", exidy_sound_device, r6532_porta_w), /* port A write handler */
DEVCB_DEVICE_MEMBER("custom", exidy_sound_device, r6532_portb_w), /* port B write handler */
DEVCB_DEVICE_LINE_MEMBER("custom", exidy_sound_device, r6532_irq) /* IRQ callback */
};
/*************************************
*
* 8253 state saving
@ -771,7 +760,12 @@ MACHINE_CONFIG_FRAGMENT( venture_audio )
MCFG_CPU_ADD("audiocpu", M6502, 3579545/4)
MCFG_CPU_PROGRAM_MAP(venture_audio_map)
MCFG_RIOT6532_ADD("riot", SH6532_CLOCK, r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, SH6532_CLOCK)
MCFG_RIOT6532_IN_PA_CB(DEVREAD8("custom", exidy_sound_device, r6532_porta_r))
MCFG_RIOT6532_OUT_PA_CB(DEVWRITE8("custom", exidy_sound_device, r6532_porta_w))
MCFG_RIOT6532_IN_PB_CB(DEVREAD8("custom", exidy_sound_device, r6532_portb_r))
MCFG_RIOT6532_OUT_PB_CB(DEVWRITE8("custom", exidy_sound_device, r6532_portb_w))
MCFG_RIOT6532_IRQ_CB(DEVWRITELINE("custom", exidy_sound_device, r6532_irq))
MCFG_DEVICE_ADD("pia0", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("pia1", pia6821_device, portb_w))
@ -1028,7 +1022,12 @@ MACHINE_CONFIG_FRAGMENT( victory_audio )
MCFG_CPU_ADD("audiocpu", M6502, VICTORY_AUDIO_CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(victory_audio_map)
MCFG_RIOT6532_ADD("riot", SH6532_CLOCK, r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, SH6532_CLOCK)
MCFG_RIOT6532_IN_PA_CB(DEVREAD8("custom", exidy_sound_device, r6532_porta_r))
MCFG_RIOT6532_OUT_PA_CB(DEVWRITE8("custom", exidy_sound_device, r6532_porta_w))
MCFG_RIOT6532_IN_PB_CB(DEVREAD8("custom", exidy_sound_device, r6532_portb_r))
MCFG_RIOT6532_OUT_PB_CB(DEVWRITE8("custom", exidy_sound_device, r6532_portb_w))
MCFG_RIOT6532_IRQ_CB(DEVWRITELINE("custom", exidy_sound_device, r6532_irq))
MCFG_DEVICE_ADD("pia1", PIA6821, 0)
MCFG_PIA_CA2_HANDLER(DEVWRITELINE("custom", victory_sound_device, irq_clear_w))

View File

@ -437,20 +437,6 @@ WRITE_LINE_MEMBER( gottlieb_sound_r1_device::votrax_request )
}
//-------------------------------------------------
// RIOT interface
//-------------------------------------------------
static const riot6532_interface gottlieb_riot6532_intf =
{
DEVCB_NULL,
DEVCB_INPUT_PORT("SB1"),
DEVCB_NULL,
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, gottlieb_sound_r1_device, r6532_portb_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, gottlieb_sound_r1_device, snd_interrupt)
};
//-------------------------------------------------
// audio CPU map
//-------------------------------------------------
@ -477,7 +463,10 @@ MACHINE_CONFIG_FRAGMENT( gottlieb_sound_r1 )
MCFG_CPU_PROGRAM_MAP(gottlieb_sound_r1_map)
// I/O configuration
MCFG_RIOT6532_ADD("riot", SOUND1_CLOCK/4, gottlieb_riot6532_intf)
MCFG_DEVICE_ADD("riot", RIOT6532, SOUND1_CLOCK/4)
MCFG_RIOT6532_IN_PB_CB(IOPORT("SB1"))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(gottlieb_sound_r1_device, r6532_portb_w))
MCFG_RIOT6532_IRQ_CB(WRITELINE(gottlieb_sound_r1_device, snd_interrupt))
// sound devices
MCFG_DAC_ADD("dac")

View File

@ -55,18 +55,6 @@ WRITE_LINE_MEMBER(starwars_state::snd_interrupt)
}
const riot6532_interface starwars_riot6532_intf =
{
DEVCB_DRIVER_MEMBER(starwars_state,r6532_porta_r),
DEVCB_DEVICE_MEMBER("tms", tms5220_device, status_r),
DEVCB_DRIVER_MEMBER(starwars_state,r6532_porta_w),
DEVCB_DEVICE_MEMBER("tms", tms5220_device, data_w),
DEVCB_DRIVER_LINE_MEMBER(starwars_state,snd_interrupt)
};
/*************************************
*
* Sound CPU to/from main CPU

View File

@ -699,16 +699,6 @@ GFXDECODE_END
*
*************************************/
static const riot6532_interface riot_intf =
{
DEVCB_DRIVER_MEMBER(firefox_state,riot_porta_r),
DEVCB_DEVICE_MEMBER("tms", tms5220_device, status_r),
DEVCB_DRIVER_MEMBER(firefox_state,riot_porta_w),
DEVCB_DEVICE_MEMBER("tms", tms5220_device, data_w),
DEVCB_DRIVER_LINE_MEMBER(firefox_state,riot_irq)
};
static MACHINE_CONFIG_START( firefox, firefox_state )
/* basic machine hardware */
@ -728,7 +718,6 @@ static MACHINE_CONFIG_START( firefox, firefox_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", firefox)
MCFG_PALETTE_ADD("palette", 512)
MCFG_LASERDISC_22VP931_ADD("laserdisc")
MCFG_LASERDISC_OVERLAY_DRIVER(64*8, 525, firefox_state, screen_update_firefox)
MCFG_LASERDISC_OVERLAY_CLIP(7*8, 53*8-1, 44, 480+44)
@ -738,7 +727,13 @@ static MACHINE_CONFIG_START( firefox, firefox_state )
MCFG_X2212_ADD_AUTOSAVE("nvram_1c")
MCFG_X2212_ADD_AUTOSAVE("nvram_1d")
MCFG_RIOT6532_ADD("riot", MASTER_XTAL/8, riot_intf)
MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_XTAL/8)
MCFG_RIOT6532_IN_PA_CB(READ8(firefox_state, riot_porta_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(firefox_state, riot_porta_w))
MCFG_RIOT6532_IN_PB_CB(DEVREAD8("tms", tms5220_device, status_r))
MCFG_RIOT6532_OUT_PB_CB(DEVWRITE8("tms", tms5220_device, data_w))
MCFG_RIOT6532_IRQ_CB(WRITELINE(firefox_state, riot_irq))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

View File

@ -170,16 +170,6 @@ WRITE8_MEMBER(gameplan_state::r6532_soundlatch_w)
}
static const riot6532_interface r6532_interface =
{
DEVCB_NULL, /* port A read handler */
DEVCB_NULL, /* port B read handler */
DEVCB_NULL, /* port A write handler */
DEVCB_DRIVER_MEMBER(gameplan_state,r6532_soundlatch_w), /* port B write handler */
DEVCB_DRIVER_LINE_MEMBER(gameplan_state,r6532_irq) /* IRQ callback */
};
/*************************************
*
* Main CPU memory handlers
@ -983,7 +973,9 @@ static MACHINE_CONFIG_START( gameplan, gameplan_state )
MCFG_CPU_ADD("audiocpu", M6502, GAMEPLAN_AUDIO_CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(gameplan_audio_map)
MCFG_RIOT6532_ADD("riot", GAMEPLAN_AUDIO_CPU_CLOCK, r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, GAMEPLAN_AUDIO_CPU_CLOCK)
MCFG_RIOT6532_OUT_PB_CB(WRITE8(gameplan_state, r6532_soundlatch_w))
MCFG_RIOT6532_IRQ_CB(WRITELINE(gameplan_state, r6532_irq))
MCFG_MACHINE_START_OVERRIDE(gameplan_state,gameplan)
MCFG_MACHINE_RESET_OVERRIDE(gameplan_state,gameplan)

View File

@ -157,15 +157,6 @@ WRITE8_MEMBER( spectra_state::portb_w )
}
static const riot6532_interface riot6532_intf =
{
DEVCB_DRIVER_MEMBER(spectra_state, porta_r), // port a in
DEVCB_DRIVER_MEMBER(spectra_state, portb_r), // port b in
DEVCB_DRIVER_MEMBER(spectra_state, porta_w), // port a out
DEVCB_DRIVER_MEMBER(spectra_state, portb_w), // port b in
DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE) // interrupt
};
TIMER_DEVICE_CALLBACK_MEMBER( spectra_state::nmitimer)
{
if (m_t_c > 0x10)
@ -239,8 +230,16 @@ static MACHINE_CONFIG_START( spectra, spectra_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, 3579545/4) // actually a 6503
MCFG_CPU_PROGRAM_MAP(spectra_map)
MCFG_RIOT6532_ADD("riot", 3579545/4, riot6532_intf) // R6532
MCFG_DEVICE_ADD("riot", RIOT6532, 3579545/4)
MCFG_RIOT6532_IN_PA_CB(READ8(spectra_state, porta_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(spectra_state, porta_w))
MCFG_RIOT6532_IN_PB_CB(READ8(spectra_state, portb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(spectra_state, portb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
MCFG_NVRAM_ADD_1FILL("ram")
MCFG_TIMER_DRIVER_ADD_PERIODIC("nmitimer", spectra_state, nmitimer, attotime::from_hz(120))
MCFG_TIMER_DRIVER_ADD_PERIODIC("outtimer", spectra_state, outtimer, attotime::from_hz(1200))

View File

@ -334,7 +334,12 @@ static MACHINE_CONFIG_START( starwars, starwars_state )
MCFG_CPU_ADD("audiocpu", M6809, MASTER_CLOCK / 8)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_RIOT6532_ADD("riot", MASTER_CLOCK / 8, starwars_riot6532_intf)
MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK / 8)
MCFG_RIOT6532_IN_PA_CB(READ8(starwars_state, r6532_porta_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(starwars_state, r6532_porta_w))
MCFG_RIOT6532_IN_PB_CB(DEVREAD8("tms", tms5220_device, status_r))
MCFG_RIOT6532_OUT_PB_CB(DEVWRITE8("tms", tms5220_device, data_w))
MCFG_RIOT6532_IRQ_CB(WRITELINE(starwars_state, snd_interrupt))
MCFG_X2212_ADD_AUTOSAVE("x2212") /* nvram */

View File

@ -380,27 +380,6 @@ void tomcat_state::machine_start()
m_dsp_BIO = 0;
}
static const riot6532_interface tomcat_riot6532_intf =
{
DEVCB_NULL,
/*
PA0 = /WS OUTPUT (TMS-5220 WRITE STROBE)
PA1 = /RS OUTPUT (TMS-5220 READ STROBE)
PA2 = /READY INPUT (TMS-5220 READY FLAG)
PA3 = FSEL OUTPUT Select TMS5220 clock;
0 = 325 KHz (8 KHz sampling)
1 = 398 KHz (10 KHz sampling)
PA4 = /CC1 OUTPUT Coin Counter 1
PA5 = /CC2 OUTPUT Coin Counter 2
PA6 = /MUSRES OUTPUT (Reset the Yamaha)
PA7 = MAINFLAG INPUT
*/
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL, // PB0 - PB7 OUTPUT Speech Data
DEVCB_NULL // connected to IRQ line of 6502
};
static MACHINE_CONFIG_START( tomcat, tomcat_state )
MCFG_CPU_ADD("maincpu", M68010, XTAL_12MHz / 2)
MCFG_CPU_PROGRAM_MAP(tomcat_map)
@ -415,11 +394,24 @@ static MACHINE_CONFIG_START( tomcat, tomcat_state )
MCFG_DEVICE_DISABLE()
MCFG_CPU_PROGRAM_MAP( sound_map)
MCFG_RIOT6532_ADD("riot", XTAL_14_31818MHz / 8, tomcat_riot6532_intf)
MCFG_DEVICE_ADD("riot", RIOT6532, XTAL_14_31818MHz / 8)
/*
PA0 = /WS OUTPUT (TMS-5220 WRITE STROBE)
PA1 = /RS OUTPUT (TMS-5220 READ STROBE)
PA2 = /READY INPUT (TMS-5220 READY FLAG)
PA3 = FSEL OUTPUT Select TMS5220 clock;
0 = 325 KHz (8 KHz sampling)
1 = 398 KHz (10 KHz sampling)
PA4 = /CC1 OUTPUT Coin Counter 1
PA5 = /CC2 OUTPUT Coin Counter 2
PA6 = /MUSRES OUTPUT (Reset the Yamaha)
PA7 = MAINFLAG INPUT
*/
// OUTB PB0 - PB7 OUTPUT Speech Data
// IRQ CB connected to IRQ line of 6502
MCFG_QUANTUM_TIME(attotime::from_hz(4000))
MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_M48T02_ADD( "m48t02" )

View File

@ -71,26 +71,6 @@ WRITE8_MEMBER(tourtabl_state::watchdog_w)
machine().watchdog_reset();
}
static const riot6532_interface r6532_interface_0 =
{
DEVCB_INPUT_PORT("RIOT0_SWA"), /* Port 6 */
DEVCB_INPUT_PORT("RIOT0_SWB"), /* Port 7 */
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(tourtabl_state,watchdog_w),
DEVCB_NULL
};
static const riot6532_interface r6532_interface_1 =
{
DEVCB_INPUT_PORT("RIOT1_SWA"), /* Port 8 */
DEVCB_INPUT_PORT("RIOT1_SWB"), /* Port 9 */
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(tourtabl_state,tourtabl_led_w),
DEVCB_NULL
};
static INPUT_PORTS_START( tourtabl )
PORT_START("PADDLE4")
@ -171,8 +151,15 @@ static MACHINE_CONFIG_START( tourtabl, tourtabl_state )
MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 3) /* actually M6507 */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_RIOT6532_ADD("riot1", MASTER_CLOCK / 3, r6532_interface_0)
MCFG_RIOT6532_ADD("riot2", MASTER_CLOCK / 3, r6532_interface_1)
MCFG_DEVICE_ADD("riot1", RIOT6532, MASTER_CLOCK / 3)
MCFG_RIOT6532_IN_PA_CB(IOPORT("RIOT0_SWA"))
MCFG_RIOT6532_IN_PB_CB(IOPORT("RIOT0_SWB"))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(tourtabl_state, watchdog_w))
MCFG_DEVICE_ADD("riot2", RIOT6532, MASTER_CLOCK / 3)
MCFG_RIOT6532_IN_PA_CB(IOPORT("RIOT1_SWA"))
MCFG_RIOT6532_IN_PB_CB(IOPORT("RIOT1_SWB"))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(tourtabl_state, tourtabl_led_w))
/* video hardware */
MCFG_DEVICE_ADD("tia_video", TIA_NTSC_VIDEO, 0)

View File

@ -77,6 +77,3 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
};
/*----------- defined in audio/starwars.c -----------*/
extern const riot6532_interface starwars_riot6532_intf;

View File

@ -1313,16 +1313,6 @@ READ8_MEMBER(a2600_state::riot_input_port_8_r)
return ioport("SWB")->read();
}
static const riot6532_interface r6532_interface =
{
DEVCB_DRIVER_MEMBER(a2600_state,switch_A_r),
DEVCB_DRIVER_MEMBER(a2600_state,riot_input_port_8_r),
DEVCB_DRIVER_MEMBER(a2600_state,switch_A_w),
DEVCB_DRIVER_MEMBER(a2600_state,switch_B_w),
DEVCB_DRIVER_LINE_MEMBER(a2600_state, irq_callback)
};
void a2600_state::install_banks(int count, unsigned init)
{
int i;
@ -1953,7 +1943,12 @@ static MACHINE_CONFIG_START( a2600, a2600_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* devices */
MCFG_RIOT6532_ADD("riot", MASTER_CLOCK_NTSC / 3, r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK_NTSC / 3)
MCFG_RIOT6532_IN_PA_CB(READ8(a2600_state, switch_A_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
MCFG_RIOT6532_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
MCFG_RIOT6532_IRQ_CB(WRITELINE(a2600_state, irq_callback))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL)
@ -1992,7 +1987,12 @@ static MACHINE_CONFIG_START( a2600p, a2600_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* devices */
MCFG_RIOT6532_ADD("riot", MASTER_CLOCK_PAL / 3, r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK_PAL / 3)
MCFG_RIOT6532_IN_PA_CB(READ8(a2600_state, switch_A_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
MCFG_RIOT6532_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
MCFG_RIOT6532_IRQ_CB(WRITELINE(a2600_state, irq_callback))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL)

View File

@ -1155,7 +1155,10 @@ static MACHINE_CONFIG_START( a7800_ntsc, a7800_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* devices */
MCFG_RIOT6532_ADD("riot", A7800_NTSC_Y1/8, a7800_r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, A7800_NTSC_Y1/8)
MCFG_RIOT6532_IN_PA_CB(READ8(a7800_state, riot_joystick_r))
MCFG_RIOT6532_IN_PB_CB(READ8(a7800_state, riot_console_button_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(a7800_state, riot_button_pullup_w))
MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,a78")
@ -1190,7 +1193,10 @@ static MACHINE_CONFIG_DERIVED( a7800_pal, a7800_ntsc )
/* devices */
MCFG_DEVICE_REMOVE("riot")
MCFG_RIOT6532_ADD("riot", CLK_PAL, a7800_r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, CLK_PAL)
MCFG_RIOT6532_IN_PA_CB(READ8(a7800_state, riot_joystick_r))
MCFG_RIOT6532_IN_PB_CB(READ8(a7800_state, riot_console_button_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(a7800_state, riot_button_pullup_w))
/* software lists */
MCFG_DEVICE_REMOVE("cart_list")

View File

@ -145,16 +145,6 @@ INPUT_PORTS_END
***************************************************************************/
/* Riot interface Z33 */
static const riot6532_interface aim65_riot_interface =
{
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(aim65_state, aim65_riot_b_r),
DEVCB_DRIVER_MEMBER(aim65_state, aim65_riot_a_w),
DEVCB_NULL,
DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE)
};
// Deck 1 can play and record
static const cassette_interface aim65_1_cassette_interface =
{
@ -283,7 +273,10 @@ static MACHINE_CONFIG_START( aim65, aim65_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* other devices */
MCFG_RIOT6532_ADD("riot", AIM65_CLOCK, aim65_riot_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, AIM65_CLOCK)
MCFG_RIOT6532_OUT_PA_CB(WRITE8(aim65_state, aim65_riot_a_w))
MCFG_RIOT6532_IN_PB_CB(READ8(aim65_state, aim65_riot_b_r))
MCFG_RIOT6532_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
MCFG_DEVICE_ADD("via6522_0", VIA6522, 0)
MCFG_VIA6522_READPB_HANDLER(READ8(aim65_state, aim65_pb_r))

View File

@ -215,15 +215,6 @@ WRITE8_MEMBER( beta_state::riot_pb_w )
m_old_data = data;
}
static const riot6532_interface beta_riot_interface =
{
DEVCB_DRIVER_MEMBER(beta_state, riot_pa_r),
DEVCB_DRIVER_MEMBER(beta_state, riot_pb_r),
DEVCB_DRIVER_MEMBER(beta_state, riot_pa_w),
DEVCB_DRIVER_MEMBER(beta_state, riot_pb_w),
DEVCB_CPU_INPUT_LINE(M6502_TAG, M6502_IRQ_LINE)
};
/* Quickload */
DEVICE_IMAGE_UNLOAD_MEMBER( beta_state, beta_eprom )
@ -265,7 +256,12 @@ static MACHINE_CONFIG_START( beta, beta_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* devices */
MCFG_RIOT6532_ADD(M6532_TAG, XTAL_4MHz/4, beta_riot_interface)
MCFG_DEVICE_ADD(M6532_TAG, RIOT6532, XTAL_4MHz/4)
MCFG_RIOT6532_IN_PA_CB(READ8(beta_state, riot_pa_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(beta_state, riot_pa_w))
MCFG_RIOT6532_IN_PB_CB(READ8(beta_state, riot_pb_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(beta_state, riot_pb_w))
MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, M6502_IRQ_LINE))
/* EPROM socket */
MCFG_CARTSLOT_ADD(EPROM_TAG)

View File

@ -185,16 +185,6 @@ WRITE_LINE_MEMBER( junior_state::junior_riot_irq )
}
static const riot6532_interface junior_riot_interface =
{
DEVCB_DRIVER_MEMBER(junior_state, junior_riot_a_r),
DEVCB_DRIVER_MEMBER(junior_state, junior_riot_b_r),
DEVCB_DRIVER_MEMBER(junior_state, junior_riot_a_w),
DEVCB_DRIVER_MEMBER(junior_state, junior_riot_b_w),
DEVCB_DRIVER_LINE_MEMBER(junior_state, junior_riot_irq)
};
TIMER_DEVICE_CALLBACK_MEMBER(junior_state::junior_update_leds)
{
int i;
@ -231,12 +221,17 @@ static MACHINE_CONFIG_START( junior, junior_state )
MCFG_CPU_PROGRAM_MAP(junior_mem)
MCFG_QUANTUM_TIME(attotime::from_hz(50))
/* video hardware */
MCFG_DEFAULT_LAYOUT( layout_junior )
/* Devices */
MCFG_RIOT6532_ADD("riot", XTAL_1MHz, junior_riot_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, XTAL_1MHz)
MCFG_RIOT6532_IN_PA_CB(READ8(junior_state, junior_riot_a_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(junior_state, junior_riot_a_w))
MCFG_RIOT6532_IN_PB_CB(READ8(junior_state, junior_riot_b_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(junior_state, junior_riot_b_w))
MCFG_RIOT6532_IRQ_CB(WRITELINE(junior_state, junior_riot_irq))
MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", junior_state, junior_update_leds, attotime::from_hz(50))
MACHINE_CONFIG_END

View File

@ -156,14 +156,6 @@ WRITE8_MEMBER( sym1_state::sym1_riot_b_w )
m_ttl74145->write(data & 0x0f);
}
const riot6532_interface sym1_r6532_interface =
{
DEVCB_DRIVER_MEMBER(sym1_state, sym1_riot_a_r),
DEVCB_DRIVER_MEMBER(sym1_state, sym1_riot_b_r),
DEVCB_DRIVER_MEMBER(sym1_state, sym1_riot_a_w),
DEVCB_DRIVER_MEMBER(sym1_state, sym1_riot_b_w)
};
//**************************************************************************
// INPUT PORTS
//**************************************************************************
@ -323,7 +315,11 @@ static MACHINE_CONFIG_START( sym1, sym1_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
// devices
MCFG_RIOT6532_ADD("riot", SYM1_CLOCK, sym1_r6532_interface)
MCFG_DEVICE_ADD("riot", RIOT6532, SYM1_CLOCK)
MCFG_RIOT6532_IN_PA_CB(READ8(sym1_state, sym1_riot_a_r))
MCFG_RIOT6532_OUT_PA_CB(WRITE8(sym1_state, sym1_riot_a_w))
MCFG_RIOT6532_IN_PB_CB(READ8(sym1_state, sym1_riot_b_r))
MCFG_RIOT6532_OUT_PB_CB(WRITE8(sym1_state, sym1_riot_b_w))
MCFG_DEVICE_ADD("ttl74145", TTL74145, 0)
MCFG_TTL74145_OUTPUT_LINE_0_CB(WRITELINE(sym1_state, sym1_74145_output_0_w))

View File

@ -125,8 +125,6 @@ protected:
/*----------- defined in machine/a7800.c -----------*/
extern const riot6532_interface a7800_r6532_interface;
void a7800_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions);
#endif /* A7800_H_ */

View File

@ -55,16 +55,6 @@ WRITE8_MEMBER(a7800_state::riot_button_pullup_w)
m_p2_one_button = data & 0x10;
}
const riot6532_interface a7800_r6532_interface =
{
DEVCB_DRIVER_MEMBER(a7800_state,riot_joystick_r),
DEVCB_DRIVER_MEMBER(a7800_state,riot_console_button_r),
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(a7800_state,riot_button_pullup_w),
DEVCB_NULL
};
/***************************************************************************
DRIVER INIT
***************************************************************************/

View File

@ -5,7 +5,7 @@
//-------------------------------------------------
// i8275_interface crtc_intf
// i8275 crtc display pixels
//-------------------------------------------------
I8275_DRAW_CHARACTER_MEMBER( mm1_state::crtc_display_pixels )