(MESS) Cleanups. (nw)

This commit is contained in:
Curt Coder 2013-02-14 18:27:41 +00:00
parent fe4f937c05
commit 0280a7a890
61 changed files with 385 additions and 955 deletions

View File

@ -123,7 +123,24 @@ void mos6581_device::sound_stream_update(sound_stream &stream, stream_sample_t *
READ8_MEMBER( mos6581_device::read )
{
return sid6581_port_r(machine(), m_token, offset);
UINT8 data = 0;
switch (offset & 0x1f)
{
case 0x19:
data = m_read_potx(0);
break;
case 0x1a:
data = m_read_poty(0);
break;
default:
data = sid6581_port_r(machine(), m_token, offset);
break;
}
return data;
}

View File

@ -335,18 +335,6 @@ int sid6581_port_r (running_machine &machine, SID6581_t *This, int offset)
case 0x1f:
data=0xff;
break;
case 0x19: /* paddle 1 */
if (!This->in_potx_func.isnull())
data = This->in_potx_func(offset);
else
data=0;
break;
case 0x1a: /* paddle 2 */
if (!This->in_poty_func.isnull())
data = This->in_poty_func(offset);
else
data=0;
break;
case 0x1b:
This->mixer_channel->update();
data = This->optr3.output;

View File

@ -16,9 +16,6 @@ struct SID6581_t
device_t *device;
sound_stream *mixer_channel; // mame stream/ mixer channel
devcb_resolved_read8 in_potx_func;
devcb_resolved_read8 in_poty_func;
int type;
UINT32 clock;

View File

@ -85,35 +85,35 @@ INPUT_CHANGED_MEMBER(cdi_state::mcu_input)
switch((FPTR)param)
{
case 0x39:
if(m_input1->read() & 0x01) send = true;
if(m_input1 && m_input1->read() & 0x01) send = true;
break;
case 0x37:
if(m_input1->read() & 0x02) send = true;
if(m_input1 && m_input1->read() & 0x02) send = true;
break;
case 0x31:
if(m_input1->read() & 0x04) send = true;
if(m_input1 && m_input1->read() & 0x04) send = true;
break;
case 0x32:
if(m_input1->read() & 0x08) send = true;
if(m_input1 && m_input1->read() & 0x08) send = true;
break;
case 0x33:
if(m_input1->read() & 0x10) send = true;
if(m_input1 && m_input1->read() & 0x10) send = true;
break;
case 0x30:
if(m_input2->read() & 0x01) send = true;
if(m_input2 && m_input2->read() & 0x01) send = true;
break;
case 0x38:
if(m_input2->read() & 0x02) send = true;
if(m_input2 && m_input2->read() & 0x02) send = true;
break;
case 0x34:
if(m_input2->read() & 0x04) send = true;
if(m_input2 && m_input2->read() & 0x04) send = true;
break;
case 0x35:
if(m_input2->read() & 0x08) send = true;
if(m_input2 && m_input2->read() & 0x08) send = true;
break;
case 0x36:
if(m_input2->read() & 0x10) send = true;
if(m_input2 && m_input2->read() & 0x10) send = true;
break;
}

View File

@ -1278,7 +1278,7 @@ WRITE_LINE_MEMBER( c128_state::iec_data_w )
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
READ8_MEMBER( c128_state::exp_dma_r )
READ8_MEMBER( c128_state::exp_dma_cd_r )
{
int ba = 0, aec = 1, z80io = 1;
offs_t vma = 0;
@ -1286,7 +1286,7 @@ READ8_MEMBER( c128_state::exp_dma_r )
return read_memory(space, offset, vma, ba, aec, z80io);
}
WRITE8_MEMBER( c128_state::exp_dma_w )
WRITE8_MEMBER( c128_state::exp_dma_cd_w )
{
int ba = 0, aec = 1, z80io = 1;
offs_t vma = 0;
@ -1323,16 +1323,6 @@ WRITE_LINE_MEMBER( c128_state::exp_reset_w )
}
}
static C64_EXPANSION_INTERFACE( expansion_intf )
{
DEVCB_DRIVER_MEMBER(c128_state, exp_dma_r),
DEVCB_DRIVER_MEMBER(c128_state, exp_dma_w),
DEVCB_DRIVER_LINE_MEMBER(c128_state, exp_irq_w),
DEVCB_DRIVER_LINE_MEMBER(c128_state, exp_nmi_w),
DEVCB_DRIVER_LINE_MEMBER(c128_state, exp_dma_w),
DEVCB_DRIVER_LINE_MEMBER(c128_state, exp_reset_w)
};
//-------------------------------------------------
// C64_USER_PORT_INTERFACE( user_intf )
@ -1410,8 +1400,12 @@ void c128_state::machine_reset()
m_reset = 1;
m_mmu->reset();
m_vic->reset();
m_vdc->reset();
m_sid->reset();
m_cia1->reset();
m_cia2->reset();
m_iec->reset();
m_exp->reset();
m_user->reset();
@ -1469,7 +1463,9 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c128_state, exp_irq_w), DEVWRITELINE(DEVICE_SELF, c128_state, exp_nmi_w), DEVWRITELINE(DEVICE_SELF, c128_state, exp_reset_w))
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, exp_dma_cd_r), DEVWRITE8(DEVICE_SELF, c128_state, exp_dma_cd_w), DEVWRITELINE(DEVICE_SELF, c128_state, exp_dma_w))
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
// software list
@ -1588,7 +1584,9 @@ static MACHINE_CONFIG_START( pal, c128_state )
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c128_state, exp_irq_w), DEVWRITELINE(DEVICE_SELF, c128_state, exp_nmi_w), DEVWRITELINE(DEVICE_SELF, c128_state, exp_reset_w))
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, exp_dma_cd_r), DEVWRITE8(DEVICE_SELF, c128_state, exp_dma_cd_w), DEVWRITELINE(DEVICE_SELF, c128_state, exp_dma_w))
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
// software list

View File

@ -474,6 +474,7 @@ INPUT_PORTS_END
//-------------------------------------------------
static INPUT_PORTS_START( c64gs )
// no keyboard
INPUT_PORTS_END
@ -946,12 +947,12 @@ WRITE8_MEMBER( c64gs_state::cpu_w )
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
READ8_MEMBER( c64_state::exp_dma_r )
READ8_MEMBER( c64_state::exp_dma_cd_r )
{
return m_maincpu->space(AS_PROGRAM).read_byte(offset);
}
WRITE8_MEMBER( c64_state::exp_dma_w )
WRITE8_MEMBER( c64_state::exp_dma_cd_w )
{
m_maincpu->space(AS_PROGRAM).write_byte(offset, data);
}
@ -988,16 +989,6 @@ WRITE_LINE_MEMBER( c64_state::exp_reset_w )
}
}
static C64_EXPANSION_INTERFACE( expansion_intf )
{
DEVCB_DRIVER_MEMBER(c64_state, exp_dma_r),
DEVCB_DRIVER_MEMBER(c64_state, exp_dma_w),
DEVCB_DRIVER_LINE_MEMBER(c64_state, exp_irq_w),
DEVCB_DRIVER_LINE_MEMBER(c64_state, exp_nmi_w),
DEVCB_DRIVER_LINE_MEMBER(c64_state, exp_dma_w),
DEVCB_DRIVER_LINE_MEMBER(c64_state, exp_reset_w)
};
//-------------------------------------------------
// C64_USER_PORT_INTERFACE( user_intf )
@ -1060,8 +1051,11 @@ void c64_state::machine_reset()
{
m_maincpu->reset();
m_vic->reset();
m_sid->reset();
m_cia1->reset();
m_cia2->reset();
m_iec->reset();
m_exp->reset();
m_user->reset();
@ -1111,7 +1105,9 @@ static MACHINE_CONFIG_START( ntsc, c64_state )
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c64_state, exp_irq_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_nmi_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_reset_w))
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, exp_dma_cd_r), DEVWRITE8(DEVICE_SELF, c64_state, exp_dma_cd_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_dma_w))
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
@ -1220,7 +1216,9 @@ static MACHINE_CONFIG_START( pal, c64_state )
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c64_state, exp_irq_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_nmi_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_reset_w))
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, exp_dma_cd_r), DEVWRITE8(DEVICE_SELF, c64_state, exp_dma_cd_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_dma_w))
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
@ -1307,7 +1305,9 @@ static MACHINE_CONFIG_START( pal_gs, c64gs_state )
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL, NULL)
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c64_state, exp_irq_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_nmi_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_reset_w))
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, exp_dma_cd_r), DEVWRITE8(DEVICE_SELF, c64_state, exp_dma_cd_w), DEVWRITELINE(DEVICE_SELF, c64_state, exp_dma_w))
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)

View File

@ -2066,6 +2066,8 @@ MACHINE_RESET_MEMBER( cbm2_state, cbm2 )
m_maincpu->reset();
if (m_crtc) m_crtc->reset();
m_sid->reset();
m_tpi1->reset();
m_tpi2->reset();
m_acia->reset();
@ -2083,6 +2085,8 @@ MACHINE_RESET_MEMBER( p500_state, p500 )
{
MACHINE_RESET_CALL_MEMBER(cbm2);
m_vic->reset();
m_statvid = 1;
m_vicdotsel = 1;
m_vicbnksel = 0x03;

View File

@ -585,6 +585,10 @@ void vic10_state::machine_start()
void vic10_state::machine_reset()
{
m_maincpu->reset();
m_vic->reset();
m_sid->reset();
m_cia->reset();
m_exp->reset();
}

View File

@ -70,46 +70,6 @@ block of RAM instead of 8.
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
enum
{
BLK0 = 0,
BLK1,
BLK2,
BLK3,
BLK4,
BLK5,
BLK6,
BLK7
};
enum
{
RAM0 = 0,
RAM1,
RAM2,
RAM3,
RAM4,
RAM5,
RAM6,
RAM7
};
enum
{
IO0 = 4,
COLOR = 5,
IO2 = 6,
IO3 = 7
};
//**************************************************************************
// MEMORY MANAGEMENT
//**************************************************************************
@ -341,11 +301,6 @@ ADDRESS_MAP_END
// INPUT_PORTS( vic20 )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( vic20_state::restore_w )
{
m_via0->write_ca1(newval);
}
static INPUT_PORTS_START( vic20 )
PORT_START( "ROW0" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Del Inst") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
@ -428,7 +383,7 @@ static INPUT_PORTS_START( vic20 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
PORT_START( "RESTORE" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESTORE") PORT_CODE(KEYCODE_PRTSCR) PORT_CHANGED_MEMBER(DEVICE_SELF, vic20_state, restore_w, 0)
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESTORE") PORT_CODE(KEYCODE_PRTSCR) PORT_WRITE_LINE_DEVICE_MEMBER(M6522_0_TAG, via6522_device, write_ca1)
PORT_START( "LOCK" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
@ -756,6 +711,10 @@ void vic20_state::machine_reset()
{
m_maincpu->reset();
m_vic->reset();
m_via0->reset();
m_via1->reset();
m_iec->reset();
m_exp->reset();
m_user->reset();

View File

@ -184,8 +184,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( iec_srq_w );
DECLARE_WRITE_LINE_MEMBER( iec_data_w );
DECLARE_READ8_MEMBER( exp_dma_r );
DECLARE_WRITE8_MEMBER( exp_dma_w );
DECLARE_READ8_MEMBER( exp_dma_cd_r );
DECLARE_WRITE8_MEMBER( exp_dma_cd_w );
DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
DECLARE_WRITE_LINE_MEMBER( exp_nmi_w );
DECLARE_WRITE_LINE_MEMBER( exp_dma_w );

View File

@ -132,8 +132,8 @@ public:
DECLARE_READ8_MEMBER( cpu_r );
DECLARE_WRITE8_MEMBER( cpu_w );
DECLARE_READ8_MEMBER( exp_dma_r );
DECLARE_WRITE8_MEMBER( exp_dma_w );
DECLARE_READ8_MEMBER( exp_dma_cd_r );
DECLARE_WRITE8_MEMBER( exp_dma_cd_w );
DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
DECLARE_WRITE_LINE_MEMBER( exp_nmi_w );
DECLARE_WRITE_LINE_MEMBER( exp_dma_w );

View File

@ -109,10 +109,42 @@ public:
DECLARE_WRITE_LINE_MEMBER( exp_reset_w );
DECLARE_INPUT_CHANGED_MEMBER( restore_w );
// keyboard state
int m_key_col;
enum
{
BLK0 = 0,
BLK1,
BLK2,
BLK3,
BLK4,
BLK5,
BLK6,
BLK7
};
enum
{
RAM0 = 0,
RAM1,
RAM2,
RAM3,
RAM4,
RAM5,
RAM6,
RAM7
};
enum
{
IO0 = 4,
COLOR = 5,
IO2 = 6,
IO3 = 7
};
};
#endif

View File

@ -372,12 +372,12 @@ static C64H156_INTERFACE( ga_intf )
READ8_MEMBER( c1551_device::exp_dma_r )
{
return m_slot->dma_cd_r(offset);
return m_slot->dma_cd_r(space, offset);
}
WRITE8_MEMBER( c1551_device::exp_dma_w )
{
m_slot->dma_cd_w(offset, data);
m_slot->dma_cd_w(space, offset, data);
}
WRITE_LINE_MEMBER( c1551_device::exp_irq_w )
@ -513,6 +513,8 @@ void c1551_device::device_reset()
m_maincpu->reset();
m_tpi0->reset();
m_exp->reset();
// initialize gate array
m_ga->test_w(1);
@ -597,18 +599,3 @@ void c1551_device::plus4_cd_w(address_space &space, offs_t offset, UINT8 data, i
m_exp->cd_w(space, offset, data, ba, cs0, c1l, c2l, cs1, c1h, c2h);
}
//-------------------------------------------------
// plus4_breset_w - buffered reset write
//-------------------------------------------------
void c1551_device::plus4_breset_w(int state)
{
if (state == ASSERT_LINE)
{
device_reset();
}
m_exp->breset_w(state);
}

View File

@ -78,7 +78,6 @@ protected:
// device_plus4_expansion_card_interface overrides
virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
virtual void plus4_breset_w(int state);
private:
bool tpi1_selected(offs_t offset);

View File

@ -771,9 +771,9 @@ static MACHINE_CONFIG_FRAGMENT( c1570 )
MCFG_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/16, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf)
MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_irq_w))
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_sp_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1571_device, cia_pb_r), DEVWRITE8(DEVICE_SELF_OWNER, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_pc_w))
MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF, c1571_device, cia_irq_w))
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF, c1571_device, cia_sp_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c1571_device, cia_pb_r), DEVWRITE8(DEVICE_SELF, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF, c1571_device, cia_pc_w))
MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1570_floppy_interface)
@ -793,11 +793,9 @@ static MACHINE_CONFIG_FRAGMENT( c1571 )
MCFG_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/16, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf)
MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_irq_w))
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_sp_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1571_device, cia_pb_r), DEVWRITE8(DEVICE_SELF_OWNER, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_pc_w))
MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF, c1571_device, cia_irq_w))
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF, c1571_device, cia_sp_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c1571_device, cia_pb_r), DEVWRITE8(DEVICE_SELF, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF, c1571_device, cia_pc_w))
MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_interface)
@ -839,12 +837,9 @@ static MACHINE_CONFIG_FRAGMENT( mini_chief )
MCFG_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/16, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf)
MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_irq_w))
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_sp_w))
MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, mini_chief_device, cia_pa_r), DEVWRITE8(DEVICE_SELF_OWNER, mini_chief_device, cia_pa_w))
MCFG_MOS6526_PORT_B_CALLBACKS(NULL, DEVWRITE8(DEVICE_SELF_OWNER, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_pc_w))
MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF, c1571_device, cia_irq_w))
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF, c1571_device, cia_sp_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c1571_device, cia_pb_r), DEVWRITE8(DEVICE_SELF, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF, c1571_device, cia_pc_w))
MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_interface)

View File

@ -299,9 +299,9 @@ static MACHINE_CONFIG_FRAGMENT( c1581 )
MCFG_CPU_PROGRAM_MAP(c1581_mem)
MCFG_MOS8520_ADD(M8520_TAG, XTAL_16MHz/8, 0, INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1581_device, cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1581_device, sp_w))
MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1581_device, cia_pa_r), DEVWRITE8(DEVICE_SELF_OWNER, c1581_device, cia_pa_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1581_device, cia_pb_r), DEVWRITE8(DEVICE_SELF_OWNER, c1581_device, cia_pb_w), NULL)
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c1581_device, cnt_w), DEVWRITELINE(DEVICE_SELF, c1581_device, sp_w))
MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c1581_device, cia_pa_r), DEVWRITE8(DEVICE_SELF, c1581_device, cia_pa_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c1581_device, cia_pb_r), DEVWRITE8(DEVICE_SELF, c1581_device, cia_pb_w), NULL)
MCFG_WD1772x_ADD(WD1772_TAG, XTAL_16MHz/2)

View File

@ -20,14 +20,13 @@
const device_type C64_4DXH = &device_creator<c64_4dxh_device>;
INPUT_CHANGED_MEMBER( c64_4dxh_device::fire4 )
{
m_slot->sp2_w(newval);
}
//-------------------------------------------------
// INPUT_PORTS( c64_4dxh )
//-------------------------------------------------
static INPUT_PORTS_START( c64_4player )
static INPUT_PORTS_START( c64_4dxh )
PORT_START("SP2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4dxh_device, fire4, 0)
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, sp2_w)
PORT_START("PB")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
@ -50,7 +49,7 @@ INPUT_PORTS_END
ioport_constructor c64_4dxh_device::device_input_ports() const
{
return INPUT_PORTS_NAME( c64_4player );
return INPUT_PORTS_NAME( c64_4dxh );
}

View File

@ -34,8 +34,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( fire4 );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_4dxh"; }

View File

@ -20,14 +20,13 @@
const device_type C64_4KSA = &device_creator<c64_4ksa_device>;
INPUT_CHANGED_MEMBER( c64_4ksa_device::fire4 )
{
m_slot->sp2_w(newval);
}
//-------------------------------------------------
// INPUT_PORTS( c64_4ksa )
//-------------------------------------------------
static INPUT_PORTS_START( c64_4player )
static INPUT_PORTS_START( c64_4ksa )
PORT_START("SP2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4ksa_device, fire4, 0)
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, sp2_w)
PORT_START("PB")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
@ -50,7 +49,7 @@ INPUT_PORTS_END
ioport_constructor c64_4ksa_device::device_input_ports() const
{
return INPUT_PORTS_NAME( c64_4player );
return INPUT_PORTS_NAME( c64_4ksa );
}

View File

@ -34,8 +34,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( fire4 );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_4ksa"; }

View File

@ -20,14 +20,13 @@
const device_type C64_4TBA = &device_creator<c64_4tba_device>;
INPUT_CHANGED_MEMBER( c64_4tba_device::fire3 )
{
m_slot->sp2_w(newval);
}
//-------------------------------------------------
// INPUT_PORTS( c64_4tba )
//-------------------------------------------------
static INPUT_PORTS_START( c64_4player )
static INPUT_PORTS_START( c64_4tba )
PORT_START("SP2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4tba_device, fire3, 0)
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, sp2_w)
PORT_START("PB")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
@ -50,7 +49,7 @@ INPUT_PORTS_END
ioport_constructor c64_4tba_device::device_input_ports() const
{
return INPUT_PORTS_NAME( c64_4player );
return INPUT_PORTS_NAME( c64_4tba );
}

View File

@ -34,8 +34,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( fire3 );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_4tba"; }

View File

@ -209,7 +209,7 @@ READ8_MEMBER( c64_cpm_cartridge_device::dma_r )
{
offs_t addr = (offset + 0x1000) & 0xffff;
data = m_slot->dma_cd_r(addr);
data = m_slot->dma_cd_r(space, addr);
}
return data;
@ -226,6 +226,6 @@ WRITE8_MEMBER( c64_cpm_cartridge_device::dma_w )
{
offs_t addr = (offset + 0x1000) & 0xffff;
m_slot->dma_cd_w(addr, data);
m_slot->dma_cd_w(space, addr, data);
}
}

View File

@ -51,16 +51,6 @@ machine_config_constructor c64_easyflash_cartridge_device::device_mconfig_additi
// INPUT_PORTS( c64_easyflash )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_easyflash_cartridge_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( c64_easyflash )
PORT_START("JP1")
PORT_DIPNAME( 0x01, 0x00, "Boot" )
@ -68,7 +58,7 @@ static INPUT_PORTS_START( c64_easyflash )
PORT_DIPSETTING( 0x01, "Boot" )
PORT_START("RESET")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, c64_easyflash_cartridge_device, reset, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
INPUT_PORTS_END

View File

@ -36,8 +36,6 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_easyflash"; }

View File

@ -95,19 +95,9 @@ machine_config_constructor c64_final_chesscard_device::device_mconfig_additions(
// INPUT_PORTS( c64_fcc )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_final_chesscard_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( c64_fcc )
PORT_START("RESET")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final_chesscard_device, reset, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
INPUT_PORTS_END

View File

@ -37,7 +37,6 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
DECLARE_READ8_MEMBER( nvram_r );
DECLARE_WRITE8_MEMBER( nvram_w );

View File

@ -18,30 +18,29 @@
const device_type C64_FINAL = &device_creator<c64_final_cartridge_device>;
INPUT_CHANGED_MEMBER( c64_final_cartridge_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
//-------------------------------------------------
// INPUT_CHANGED_MEMBER( freeze )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_final_cartridge_device::freeze )
{
if (!newval)
if (newval)
{
m_game = 0;
}
m_slot->nmi_w(newval ? CLEAR_LINE : ASSERT_LINE);
m_slot->nmi_w(newval);
}
//-------------------------------------------------
// INPUT_PORTS( c64_final )
//-------------------------------------------------
static INPUT_PORTS_START( c64_final )
PORT_START("SW")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final_cartridge_device, reset, 0)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final_cartridge_device, freeze, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final_cartridge_device, freeze, 0)
INPUT_PORTS_END

View File

@ -34,7 +34,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
DECLARE_INPUT_CHANGED_MEMBER( freeze );
protected:

View File

@ -18,31 +18,30 @@
const device_type C64_FINAL3 = &device_creator<c64_final3_cartridge_device>;
INPUT_CHANGED_MEMBER( c64_final3_cartridge_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
//-------------------------------------------------
// INPUT_CHANGED_MEMBER( freeze )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_final3_cartridge_device::freeze )
{
if (!newval)
if (newval)
{
m_game = 0;
m_hidden = 0;
}
m_slot->nmi_w(newval ? CLEAR_LINE : ASSERT_LINE);
m_slot->nmi_w(newval);
}
//-------------------------------------------------
// INPUT_PORTS( c64_final3 )
//-------------------------------------------------
static INPUT_PORTS_START( c64_final3 )
PORT_START("SW")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final3_cartridge_device, reset, 0)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final3_cartridge_device, freeze, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final3_cartridge_device, freeze, 0)
INPUT_PORTS_END

View File

@ -34,7 +34,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
DECLARE_INPUT_CHANGED_MEMBER( freeze );
protected:

View File

@ -150,59 +150,15 @@ static const tpi6525_interface tpi_intf =
};
//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
READ8_MEMBER( c64_ieee488_device::dma_cd_r )
{
return m_slot->dma_cd_r(offset);
}
WRITE8_MEMBER( c64_ieee488_device::dma_cd_w )
{
m_slot->dma_cd_w(offset, data);
}
WRITE_LINE_MEMBER( c64_ieee488_device::irq_w )
{
m_slot->irq_w(state);
}
WRITE_LINE_MEMBER( c64_ieee488_device::nmi_w )
{
m_slot->nmi_w(state);
}
WRITE_LINE_MEMBER( c64_ieee488_device::dma_w )
{
m_slot->dma_w(state);
}
WRITE_LINE_MEMBER( c64_ieee488_device::reset_w )
{
m_slot->reset_w(state);
}
static C64_EXPANSION_INTERFACE( expansion_intf )
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_ieee488_device, dma_cd_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_ieee488_device, dma_cd_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_ieee488_device, irq_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_ieee488_device, nmi_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_ieee488_device, dma_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_ieee488_device, reset_w)
};
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( c64_ieee488 )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( c64_ieee488 )
MCFG_TPI6525_ADD(MOS6525_TAG, tpi_intf)
MCFG_CBM_IEEE488_ADD(NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD()
MACHINE_CONFIG_END
@ -264,16 +220,13 @@ UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 da
{
data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
if (!roml)
if (!roml && m_roml_sel)
{
if (m_roml_sel)
{
data = m_roml[offset & 0xfff];
}
data = m_roml[offset & 0xfff];
}
else if (!io2)
{
data |= tpi6525_r(m_tpi, space, offset & 0x07);
data = tpi6525_r(m_tpi, space, offset & 0x07);
}
return data;

View File

@ -43,12 +43,6 @@ public:
DECLARE_WRITE8_MEMBER( tpi_pa_w );
DECLARE_READ8_MEMBER( tpi_pc_r );
DECLARE_WRITE8_MEMBER( tpi_pc_w );
DECLARE_READ8_MEMBER( dma_cd_r );
DECLARE_WRITE8_MEMBER( dma_cd_w );
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
protected:
// device-level overrides

View File

@ -22,16 +22,6 @@ const device_type C64_MACH5 = &device_creator<c64_mach5_cartridge_device>;
// INPUT_PORTS( c64_mach5 )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_mach5_cartridge_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( c64_mach5 )
PORT_START("S1")
PORT_DIPNAME( 0x01, 0x00, "Mode" )
@ -39,7 +29,7 @@ static INPUT_PORTS_START( c64_mach5 )
PORT_DIPSETTING( 0x01, "C128" )
PORT_START("S2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, c64_mach5_cartridge_device, reset, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
INPUT_PORTS_END

View File

@ -33,8 +33,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_mach5"; }

View File

@ -129,12 +129,12 @@ machine_config_constructor c64_magic_formel_cartridge_device::device_mconfig_add
//-------------------------------------------------
// INPUT_PORTS( c64_magic_formel )
// INPUT_CHANGED_MEMBER( freeze )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_magic_formel_cartridge_device::freeze )
{
if (!newval && (m_pb7_ff & m_cb2_ff))
if (newval && (m_pb7_ff & m_cb2_ff))
{
m_cb2_ff = 0;
@ -146,9 +146,14 @@ INPUT_CHANGED_MEMBER( c64_magic_formel_cartridge_device::freeze )
}
}
//-------------------------------------------------
// INPUT_PORTS( c64_magic_formel )
//-------------------------------------------------
static INPUT_PORTS_START( c64_magic_formel )
PORT_START("FREEZE")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Freeze") PORT_CHANGED_MEMBER(DEVICE_SELF, c64_magic_formel_cartridge_device, freeze, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_magic_formel_cartridge_device, freeze, 0)
INPUT_PORTS_END

View File

@ -45,51 +45,6 @@ static const tpi6525_interface tpi_intf =
};
//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
READ8_MEMBER( c64_magic_voice_cartridge_device::dma_cd_r )
{
return m_slot->dma_cd_r(offset);
}
WRITE8_MEMBER( c64_magic_voice_cartridge_device::dma_cd_w )
{
m_slot->dma_cd_w(offset, data);
}
WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::irq_w )
{
m_slot->irq_w(state);
}
WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::nmi_w )
{
m_slot->nmi_w(state);
}
WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::dma_w )
{
m_slot->dma_w(state);
}
WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::reset_w )
{
m_slot->reset_w(state);
}
static C64_EXPANSION_INTERFACE( expansion_intf )
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, dma_cd_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, dma_cd_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, irq_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, nmi_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, dma_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, reset_w)
};
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( c64_magic_voice )
//-------------------------------------------------
@ -102,7 +57,7 @@ static MACHINE_CONFIG_FRAGMENT( c64_magic_voice )
MCFG_T6721A_EOS_HANDLER(DEVWRITELINE(MOS6525_TAG, tpi6525_device, i2_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD()
MACHINE_CONFIG_END

View File

@ -36,14 +36,6 @@ public:
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
// not really public
DECLARE_READ8_MEMBER( dma_cd_r );
DECLARE_WRITE8_MEMBER( dma_cd_w );
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_magic_voice"; }

View File

@ -30,54 +30,14 @@ const device_type C64_SFX_SOUND_EXPANDER = &device_creator<c64_sfx_sound_expande
// ym3526_interface ym3526_config
//-------------------------------------------------
static const ym3526_interface ym3526_config =
{
DEVCB_LINE_MEMBER(c64_sfx_sound_expander_cartridge_device, irq_w)
};
//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
READ8_MEMBER( c64_sfx_sound_expander_cartridge_device::dma_cd_r )
{
return m_slot->dma_cd_r(offset);
}
WRITE8_MEMBER( c64_sfx_sound_expander_cartridge_device::dma_cd_w )
{
m_slot->dma_cd_w(offset, data);
}
WRITE_LINE_MEMBER( c64_sfx_sound_expander_cartridge_device::irq_w )
WRITE_LINE_MEMBER( c64_sfx_sound_expander_cartridge_device::opl_irq_w )
{
m_slot->irq_w(state);
}
WRITE_LINE_MEMBER( c64_sfx_sound_expander_cartridge_device::nmi_w )
static const ym3526_interface ym3526_config =
{
m_slot->nmi_w(state);
}
WRITE_LINE_MEMBER( c64_sfx_sound_expander_cartridge_device::dma_w )
{
m_slot->dma_w(state);
}
WRITE_LINE_MEMBER( c64_sfx_sound_expander_cartridge_device::reset_w )
{
m_slot->reset_w(state);
}
static C64_EXPANSION_INTERFACE( expansion_intf )
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_sfx_sound_expander_cartridge_device, dma_cd_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_sfx_sound_expander_cartridge_device, dma_cd_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sfx_sound_expander_cartridge_device, irq_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sfx_sound_expander_cartridge_device, nmi_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sfx_sound_expander_cartridge_device, dma_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sfx_sound_expander_cartridge_device, reset_w)
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sfx_sound_expander_cartridge_device, opl_irq_w)
};
@ -91,7 +51,7 @@ static MACHINE_CONFIG_FRAGMENT( c64_sfx_sound_expander )
MCFG_SOUND_CONFIG(ym3526_config)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD()
MACHINE_CONFIG_END

View File

@ -36,13 +36,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
// not really public
DECLARE_READ8_MEMBER( dma_cd_r );
DECLARE_WRITE8_MEMBER( dma_cd_w );
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
DECLARE_WRITE_LINE_MEMBER( opl_irq_w );
protected:
// device-level overrides

View File

@ -51,19 +51,9 @@ const device_type C64_STARDOS = &device_creator<c64_stardos_cartridge_device>;
// INPUT_PORTS( c64_stardos )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_stardos_cartridge_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( c64_stardos )
PORT_START("RESET")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_stardos_cartridge_device, reset, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
INPUT_PORTS_END

View File

@ -35,8 +35,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_stardos"; }

View File

@ -56,51 +56,6 @@ static ADDRESS_MAP_START( c64_supercpu_map, AS_PROGRAM, 8, c64_supercpu_device )
ADDRESS_MAP_END
//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
READ8_MEMBER( c64_supercpu_device::dma_cd_r )
{
return m_slot->dma_cd_r(offset);
}
WRITE8_MEMBER( c64_supercpu_device::dma_cd_w )
{
m_slot->dma_cd_w(offset, data);
}
WRITE_LINE_MEMBER( c64_supercpu_device::irq_w )
{
m_slot->irq_w(state);
}
WRITE_LINE_MEMBER( c64_supercpu_device::nmi_w )
{
m_slot->nmi_w(state);
}
WRITE_LINE_MEMBER( c64_supercpu_device::dma_w )
{
m_slot->dma_w(state);
}
WRITE_LINE_MEMBER( c64_supercpu_device::reset_w )
{
m_slot->reset_w(state);
}
static C64_EXPANSION_INTERFACE( expansion_intf )
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_supercpu_device, dma_cd_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_supercpu_device, dma_cd_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_supercpu_device, irq_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_supercpu_device, nmi_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_supercpu_device, dma_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_supercpu_device, reset_w)
};
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( c64_supercpu )
//-------------------------------------------------
@ -109,7 +64,7 @@ static MACHINE_CONFIG_FRAGMENT( c64_supercpu )
MCFG_CPU_ADD(G65816_TAG, G65816, 1000000)
MCFG_CPU_PROGRAM_MAP(c64_supercpu_map)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD()
MACHINE_CONFIG_END
@ -128,16 +83,6 @@ machine_config_constructor c64_supercpu_device::device_mconfig_additions() const
// INPUT_PORTS( c64_supercpu )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_supercpu_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( c64_supercpu )
PORT_START("FRONT")
PORT_DIPNAME( 0x01, 0x01, "Unit" )
@ -151,7 +96,7 @@ static INPUT_PORTS_START( c64_supercpu )
PORT_DIPSETTING( 0x00, "Turbo" )
PORT_START("RESET")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_supercpu_device, reset, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
INPUT_PORTS_END
@ -165,6 +110,7 @@ ioport_constructor c64_supercpu_device::device_input_ports() const
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************

View File

@ -37,15 +37,6 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
DECLARE_READ8_MEMBER( dma_cd_r );
DECLARE_WRITE8_MEMBER( dma_cd_w );
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_supercpu"; }

View File

@ -89,59 +89,14 @@ static MC6852_INTERFACE( ssda_intf )
};
//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
READ8_MEMBER( c64_tdos_cartridge_device::dma_cd_r )
{
return m_slot->dma_cd_r(offset);
}
WRITE8_MEMBER( c64_tdos_cartridge_device::dma_cd_w )
{
m_slot->dma_cd_w(offset, data);
}
WRITE_LINE_MEMBER( c64_tdos_cartridge_device::irq_w )
{
m_slot->irq_w(state);
}
WRITE_LINE_MEMBER( c64_tdos_cartridge_device::nmi_w )
{
m_slot->nmi_w(state);
}
WRITE_LINE_MEMBER( c64_tdos_cartridge_device::dma_w )
{
m_slot->dma_w(state);
}
WRITE_LINE_MEMBER( c64_tdos_cartridge_device::reset_w )
{
m_slot->reset_w(state);
}
static C64_EXPANSION_INTERFACE( expansion_intf )
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, dma_cd_r),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, dma_cd_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, irq_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, nmi_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, dma_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, reset_w)
};
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( c64_multiscreen )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( c64_tdos )
MCFG_MC6852_ADD(MC68A52P_TAG, XTAL_6_5MHz, ssda_intf)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD()
MACHINE_CONFIG_END

View File

@ -35,14 +35,6 @@ public:
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
// not really public
DECLARE_READ8_MEMBER( dma_cd_r );
DECLARE_WRITE8_MEMBER( dma_cd_w );
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_tdos"; }

View File

@ -56,16 +56,6 @@ const device_type C64_WARP_SPEED = &device_creator<c64_warp_speed_cartridge_devi
// INPUT_PORTS( c64_warp_speed )
//-------------------------------------------------
INPUT_CHANGED_MEMBER( c64_warp_speed_cartridge_device::reset )
{
if (!newval)
{
device_reset();
}
m_slot->reset_w(newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( c64_warp_speed )
PORT_START("SW1")
PORT_DIPNAME( 0x01, 0x01, "Mode" )
@ -73,7 +63,7 @@ static INPUT_PORTS_START( c64_warp_speed )
PORT_DIPSETTING( 0x00, "C128" )
PORT_START("SW2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_warp_speed_cartridge_device, reset, 0)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)
INPUT_PORTS_END

View File

@ -34,8 +34,6 @@ public:
// optional information overrides
virtual ioport_constructor device_input_ports() const;
DECLARE_INPUT_CHANGED_MEMBER( reset );
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "c64_warp_speed"; }

View File

@ -11,14 +11,6 @@
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
#define LOG 0
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
@ -142,66 +134,32 @@ UINT8* device_c64_expansion_card_interface::c64_nvram_pointer(running_machine &m
c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, C64_EXPANSION_SLOT, "C64 expansion port", tag, owner, clock),
device_slot_interface(mconfig, *this),
device_image_interface(mconfig, *this)
device_image_interface(mconfig, *this),
m_read_dma_cd(*this),
m_write_dma_cd(*this),
m_write_irq(*this),
m_write_nmi(*this),
m_write_dma(*this),
m_write_reset(*this)
{
}
//-------------------------------------------------
// c64_expansion_slot_device - destructor
//-------------------------------------------------
c64_expansion_slot_device::~c64_expansion_slot_device()
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void c64_expansion_slot_device::device_config_complete()
{
// inherit a copy of the static data
const c64_expansion_slot_interface *intf = reinterpret_cast<const c64_expansion_slot_interface *>(static_config());
if (intf != NULL)
{
*static_cast<c64_expansion_slot_interface *>(this) = *intf;
}
// or initialize to defaults if none provided
else
{
memset(&m_in_dma_cd_cb, 0, sizeof(m_in_dma_cd_cb));
memset(&m_out_dma_cd_cb, 0, sizeof(m_out_dma_cd_cb));
memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
memset(&m_out_nmi_cb, 0, sizeof(m_out_nmi_cb));
memset(&m_out_dma_cb, 0, sizeof(m_out_dma_cb));
memset(&m_out_reset_cb, 0, sizeof(m_out_reset_cb));
}
// set brief and instance name
update_names();
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void c64_expansion_slot_device::device_start()
{
m_cart = dynamic_cast<device_c64_expansion_card_interface *>(get_card_device());
m_card = dynamic_cast<device_c64_expansion_card_interface *>(get_card_device());
// resolve callbacks
m_in_dma_cd_func.resolve(m_in_dma_cd_cb, *this);
m_out_dma_cd_func.resolve(m_out_dma_cd_cb, *this);
m_out_irq_func.resolve(m_out_irq_cb, *this);
m_out_nmi_func.resolve(m_out_nmi_cb, *this);
m_out_dma_func.resolve(m_out_dma_cb, *this);
m_out_reset_func.resolve(m_out_reset_cb, *this);
m_read_dma_cd.resolve_safe(0);
m_write_dma_cd.resolve_safe();
m_write_irq.resolve_safe();
m_write_nmi.resolve_safe();
m_write_dma.resolve_safe();
m_write_reset.resolve_safe();
// inherit bus clock
if (clock() == 0)
@ -219,8 +177,10 @@ void c64_expansion_slot_device::device_start()
void c64_expansion_slot_device::device_reset()
{
port_reset_w(ASSERT_LINE);
port_reset_w(CLEAR_LINE);
if (get_card_device())
{
get_card_device()->reset();
}
}
@ -230,7 +190,7 @@ void c64_expansion_slot_device::device_reset()
bool c64_expansion_slot_device::call_load()
{
if (m_cart)
if (m_card)
{
size_t size = 0;
@ -240,26 +200,26 @@ bool c64_expansion_slot_device::call_load()
if (!mame_stricmp(filetype(), "80"))
{
fread(m_cart->c64_roml_pointer(machine(), size), size);
m_cart->m_exrom = (0);
fread(m_card->c64_roml_pointer(machine(), size), size);
m_card->m_exrom = (0);
if (size == 0x4000)
{
m_cart->m_game = 0;
m_card->m_game = 0;
}
}
else if (!mame_stricmp(filetype(), "a0"))
{
fread(m_cart->c64_romh_pointer(machine(), 0x2000), 0x2000);
fread(m_card->c64_romh_pointer(machine(), 0x2000), 0x2000);
m_cart->m_exrom = 0;
m_cart->m_game = 0;
m_card->m_exrom = 0;
m_card->m_game = 0;
}
else if (!mame_stricmp(filetype(), "e0"))
{
fread(m_cart->c64_romh_pointer(machine(), 0x2000), 0x2000);
fread(m_card->c64_romh_pointer(machine(), 0x2000), 0x2000);
m_cart->m_game = 0;
m_card->m_game = 0;
}
else if (!mame_stricmp(filetype(), "crt"))
{
@ -273,14 +233,14 @@ bool c64_expansion_slot_device::call_load()
UINT8 *roml = NULL;
UINT8 *romh = NULL;
if (roml_size) roml = m_cart->c64_roml_pointer(machine(), roml_size);
if (romh_size) romh = m_cart->c64_romh_pointer(machine(), romh_size);
if (roml_size) roml = m_card->c64_roml_pointer(machine(), roml_size);
if (romh_size) romh = m_card->c64_romh_pointer(machine(), romh_size);
cbm_crt_read_data(m_file, roml, romh);
}
m_cart->m_exrom = exrom;
m_cart->m_game = game;
m_card->m_exrom = exrom;
m_card->m_game = game;
}
}
else
@ -290,31 +250,31 @@ bool c64_expansion_slot_device::call_load()
if (size)
{
// Ultimax (VIC-10) cartridge
memcpy(m_cart->c64_romh_pointer(machine(), size), get_software_region("uprom"), size);
memcpy(m_card->c64_romh_pointer(machine(), size), get_software_region("uprom"), size);
size = get_software_region_length("lorom");
if (size) memcpy(m_cart->c64_roml_pointer(machine(), size), get_software_region("lorom"), size);
if (size) memcpy(m_card->c64_roml_pointer(machine(), size), get_software_region("lorom"), size);
m_cart->m_exrom = 1;
m_cart->m_game = 0;
m_card->m_exrom = 1;
m_card->m_game = 0;
}
else
{
// Commodore 64/128 cartridge
size = get_software_region_length("roml");
if (size) memcpy(m_cart->c64_roml_pointer(machine(), size), get_software_region("roml"), size);
if (size) memcpy(m_card->c64_roml_pointer(machine(), size), get_software_region("roml"), size);
size = get_software_region_length("romh");
if (size) memcpy(m_cart->c64_romh_pointer(machine(), size), get_software_region("romh"), size);
if (size) memcpy(m_card->c64_romh_pointer(machine(), size), get_software_region("romh"), size);
size = get_software_region_length("ram");
if (size) memset(m_cart->c64_ram_pointer(machine(), size), 0, size);
if (size) memset(m_card->c64_ram_pointer(machine(), size), 0, size);
size = get_software_region_length("nvram");
if (size) memset(m_cart->c64_nvram_pointer(machine(), size), 0, size);
if (size) memset(m_card->c64_nvram_pointer(machine(), size), 0, size);
if (get_feature("exrom") != NULL) m_cart->m_exrom = atol(get_feature("exrom"));
if (get_feature("game") != NULL) m_cart->m_game = atol(get_feature("game"));
if (get_feature("exrom") != NULL) m_card->m_exrom = atol(get_feature("exrom"));
if (get_feature("game") != NULL) m_card->m_game = atol(get_feature("game"));
}
}
}
@ -361,9 +321,9 @@ const char * c64_expansion_slot_device::get_default_card_software(const machine_
UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
{
if (m_cart != NULL)
if (m_card != NULL)
{
data = m_cart->c64_cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
data = m_card->c64_cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
}
return data;
@ -376,9 +336,9 @@ UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8
void c64_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
{
if (m_cart != NULL)
if (m_card != NULL)
{
m_cart->c64_cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2);
m_card->c64_cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2);
}
}
@ -391,9 +351,9 @@ int c64_expansion_slot_device::game_r(offs_t offset, int sphi2, int ba, int rw,
{
int state = 1;
if (m_cart != NULL)
if (m_card != NULL)
{
state = m_cart->c64_game_r(offset, sphi2, ba, rw, hiram);
state = m_card->c64_game_r(offset, sphi2, ba, rw, hiram);
}
return state;
@ -408,59 +368,10 @@ int c64_expansion_slot_device::exrom_r(offs_t offset, int sphi2, int ba, int rw,
{
int state = 1;
if (m_cart != NULL)
if (m_card != NULL)
{
state = m_cart->c64_exrom_r(offset, sphi2, ba, rw, hiram);
state = m_card->c64_exrom_r(offset, sphi2, ba, rw, hiram);
}
return state;
}
WRITE_LINE_MEMBER( c64_expansion_slot_device::port_reset_w ) { if (m_cart != NULL) m_cart->c64_reset_w(state); }
//-------------------------------------------------
// dma_cd_r - DMA read
//-------------------------------------------------
UINT8 c64_expansion_slot_device::dma_cd_r(offs_t offset)
{
return m_in_dma_cd_func(offset);
}
//-------------------------------------------------
// dma_cd_w - DMA write
//-------------------------------------------------
void c64_expansion_slot_device::dma_cd_w(offs_t offset, UINT8 data)
{
m_out_dma_cd_func(offset, data);
}
WRITE_LINE_MEMBER( c64_expansion_slot_device::irq_w ) { m_out_irq_func(state); }
WRITE_LINE_MEMBER( c64_expansion_slot_device::nmi_w ) { m_out_nmi_func(state); }
WRITE_LINE_MEMBER( c64_expansion_slot_device::dma_w ) { m_out_dma_func(state); }
WRITE_LINE_MEMBER( c64_expansion_slot_device::reset_w ) { m_out_reset_func(state); }
//-------------------------------------------------
// phi2 - system clock frequency
//-------------------------------------------------
int c64_expansion_slot_device::phi2()
{
return clock();
}
//-------------------------------------------------
// dotclock - dot clock frequency
//-------------------------------------------------
int c64_expansion_slot_device::dotclock()
{
return phi2() * 8;
}

View File

@ -54,69 +54,71 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define C64_EXPANSION_INTERFACE(_name) \
const c64_expansion_slot_interface (_name) =
#define MCFG_C64_EXPANSION_SLOT_ADD(_tag, _clock, _config, _slot_intf, _def_slot, _def_inp) \
#define MCFG_C64_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot, _def_inp) \
MCFG_DEVICE_ADD(_tag, C64_EXPANSION_SLOT, _clock) \
MCFG_DEVICE_CONFIG(_config) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
#define MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD() \
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, c64_expansion_cards, NULL, NULL) \
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, irq_w), DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, nmi_w), DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)) \
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_cd_r), DEVWRITE8(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_cd_w), DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_w))
#define MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(_irq, _nmi, _reset) \
downcast<c64_expansion_slot_device *>(device)->set_irq_callbacks(DEVCB2_##_irq, DEVCB2_##_nmi, DEVCB2_##_reset);
#define MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(_read, _write, _dma) \
downcast<c64_expansion_slot_device *>(device)->set_dma_callbacks(DEVCB2_##_read, DEVCB2_##_write, DEVCB2_##_dma);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> c64_expansion_slot_interface
struct c64_expansion_slot_interface
{
devcb_read8 m_in_dma_cd_cb;
devcb_write8 m_out_dma_cd_cb;
devcb_write_line m_out_irq_cb;
devcb_write_line m_out_nmi_cb;
devcb_write_line m_out_dma_cb;
devcb_write_line m_out_reset_cb;
};
// ======================> c64_expansion_slot_device
class device_c64_expansion_card_interface;
class c64_expansion_slot_device : public device_t,
public c64_expansion_slot_interface,
public device_slot_interface,
public device_image_interface
{
public:
// construction/destruction
c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~c64_expansion_slot_device();
template<class _irq, class _nmi, class _reset> void set_irq_callbacks(_irq irq, _nmi nmi, _reset reset) {
m_write_irq.set_callback(irq);
m_write_dma_cd.set_callback(nmi);
m_write_reset.set_callback(reset);
}
template<class _read, class _write, class _dma> void set_dma_callbacks(_read read, _write write, _dma dma) {
m_read_dma_cd.set_callback(read);
m_write_dma_cd.set_callback(write);
m_write_dma.set_callback(dma);
}
// computer interface
UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
void cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
int game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
int exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER( port_reset_w );
// cartridge interface
UINT8 dma_cd_r(offs_t offset);
void dma_cd_w(offs_t offset, UINT8 data);
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
int phi2();
int dotclock();
DECLARE_READ8_MEMBER( dma_cd_r ) { return m_read_dma_cd(offset); }
DECLARE_WRITE8_MEMBER( dma_cd_w ) { m_write_dma_cd(offset, data); }
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_write_irq(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_write_nmi(state); }
DECLARE_WRITE_LINE_MEMBER( dma_w ) { m_write_dma(state); }
DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_write_reset(state); }
int phi2() { return clock(); }
int dotclock() { return phi2() * 8; }
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_config_complete() { update_names(); }
virtual void device_start();
virtual void device_reset();
@ -138,14 +140,14 @@ protected:
// slot interface overrides
virtual const char * get_default_card_software(const machine_config &config, emu_options &options);
devcb_resolved_read8 m_in_dma_cd_func;
devcb_resolved_write8 m_out_dma_cd_func;
devcb_resolved_write_line m_out_irq_func;
devcb_resolved_write_line m_out_nmi_func;
devcb_resolved_write_line m_out_dma_func;
devcb_resolved_write_line m_out_reset_func;
devcb2_read8 m_read_dma_cd;
devcb2_write8 m_write_dma_cd;
devcb2_write_line m_write_irq;
devcb2_write_line m_write_nmi;
devcb2_write_line m_write_dma;
devcb2_write_line m_write_reset;
device_c64_expansion_card_interface *m_cart;
device_c64_expansion_card_interface *m_card;
};
@ -172,7 +174,6 @@ protected:
virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { };
virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_game; }
virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_exrom; }
virtual void c64_reset_w(int state) { };
c64_expansion_slot_device *m_slot;

View File

@ -59,15 +59,6 @@ c64_user_port_device::c64_user_port_device(const machine_config &mconfig, const
}
//-------------------------------------------------
// c64_user_port_device - destructor
//-------------------------------------------------
c64_user_port_device::~c64_user_port_device()
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
@ -102,7 +93,7 @@ void c64_user_port_device::device_config_complete()
void c64_user_port_device::device_start()
{
m_cart = dynamic_cast<device_c64_user_port_interface *>(get_card_device());
m_card = dynamic_cast<device_c64_user_port_interface *>(get_card_device());
// resolve callbacks
m_out_cnt1_func.resolve(m_out_cnt1_cb, *this);
@ -120,22 +111,16 @@ void c64_user_port_device::device_start()
void c64_user_port_device::device_reset()
{
port_reset_w(ASSERT_LINE);
port_reset_w(CLEAR_LINE);
if (get_card_device())
{
get_card_device()->reset();
}
}
READ8_MEMBER( c64_user_port_device::pb_r ) { UINT8 data = 0xff; if (m_cart != NULL) data = m_cart->c64_pb_r(space, offset); return data; }
WRITE8_MEMBER( c64_user_port_device::pb_w ) { if (m_cart != NULL) m_cart->c64_pb_w(space, offset, data); }
READ_LINE_MEMBER( c64_user_port_device::pa2_r ) { int state = 1; if (m_cart != NULL) state = m_cart->c64_pa2_r(); return state; }
WRITE_LINE_MEMBER( c64_user_port_device::pa2_w ) { if (m_cart != NULL) m_cart->c64_pa2_w(state); }
WRITE_LINE_MEMBER( c64_user_port_device::pc2_w ) { if (m_cart != NULL) m_cart->c64_pc2_w(state); }
WRITE_LINE_MEMBER( c64_user_port_device::atn_w ) { if (m_cart != NULL) m_cart->c64_atn_w(state); }
WRITE_LINE_MEMBER( c64_user_port_device::port_reset_w ) { if (m_cart != NULL) m_cart->c64_reset_w(state); }
WRITE_LINE_MEMBER( c64_user_port_device::cnt1_w ) { m_out_cnt1_func(state); }
WRITE_LINE_MEMBER( c64_user_port_device::sp1_w ) { m_out_sp1_func(state); }
WRITE_LINE_MEMBER( c64_user_port_device::cnt2_w ) { m_out_cnt2_func(state); }
WRITE_LINE_MEMBER( c64_user_port_device::sp2_w ) { m_out_sp2_func(state); }
WRITE_LINE_MEMBER( c64_user_port_device::flag2_w ) { m_out_flag2_func(state); }
WRITE_LINE_MEMBER( c64_user_port_device::reset_w ) { m_out_reset_func(state); }
READ8_MEMBER( c64_user_port_device::pb_r ) { UINT8 data = 0xff; if (m_card != NULL) data = m_card->c64_pb_r(space, offset); return data; }
WRITE8_MEMBER( c64_user_port_device::pb_w ) { if (m_card != NULL) m_card->c64_pb_w(space, offset, data); }
READ_LINE_MEMBER( c64_user_port_device::pa2_r ) { int state = 1; if (m_card != NULL) state = m_card->c64_pa2_r(); return state; }
WRITE_LINE_MEMBER( c64_user_port_device::pa2_w ) { if (m_card != NULL) m_card->c64_pa2_w(state); }
WRITE_LINE_MEMBER( c64_user_port_device::pc2_w ) { if (m_card != NULL) m_card->c64_pc2_w(state); }
WRITE_LINE_MEMBER( c64_user_port_device::atn_w ) { if (m_card != NULL) m_card->c64_atn_w(state); }

View File

@ -82,7 +82,6 @@ class c64_user_port_device : public device_t,
public:
// construction/destruction
c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~c64_user_port_device();
// computer interface
DECLARE_READ8_MEMBER( pb_r );
@ -90,16 +89,15 @@ public:
DECLARE_READ_LINE_MEMBER( pa2_r );
DECLARE_WRITE_LINE_MEMBER( pa2_w );
DECLARE_WRITE_LINE_MEMBER( pc2_w );
DECLARE_WRITE_LINE_MEMBER( port_reset_w );
DECLARE_WRITE_LINE_MEMBER( atn_w );
// cartridge interface
DECLARE_WRITE_LINE_MEMBER( sp1_w );
DECLARE_WRITE_LINE_MEMBER( cnt1_w );
DECLARE_WRITE_LINE_MEMBER( sp2_w );
DECLARE_WRITE_LINE_MEMBER( cnt2_w );
DECLARE_WRITE_LINE_MEMBER( flag2_w );
DECLARE_WRITE_LINE_MEMBER( atn_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
DECLARE_WRITE_LINE_MEMBER( cnt1_w ) { m_out_cnt1_func(state); }
DECLARE_WRITE_LINE_MEMBER( sp1_w ) { m_out_sp1_func(state); }
DECLARE_WRITE_LINE_MEMBER( cnt2_w ) { m_out_cnt2_func(state); }
DECLARE_WRITE_LINE_MEMBER( sp2_w ) { m_out_sp2_func(state); }
DECLARE_WRITE_LINE_MEMBER( flag2_w ) { m_out_flag2_func(state); }
DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_out_reset_func(state); }
protected:
// device-level overrides
@ -114,7 +112,7 @@ protected:
devcb_resolved_write_line m_out_flag2_func;
devcb_resolved_write_line m_out_reset_func;
device_c64_user_port_interface *m_cart;
device_c64_user_port_interface *m_card;
};
@ -140,9 +138,6 @@ public:
virtual void c64_sp2_w(int state) { };
virtual void c64_atn_w(int state) { };
// reset
virtual void c64_reset_w(int state) { };
protected:
c64_user_port_device *m_slot;
};

View File

@ -183,15 +183,6 @@ plus4_expansion_slot_device::plus4_expansion_slot_device(const machine_config &m
}
//-------------------------------------------------
// plus4_expansion_slot_device - destructor
//-------------------------------------------------
plus4_expansion_slot_device::~plus4_expansion_slot_device()
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
@ -227,7 +218,7 @@ void plus4_expansion_slot_device::device_config_complete()
void plus4_expansion_slot_device::device_start()
{
m_cart = dynamic_cast<device_plus4_expansion_card_interface *>(get_card_device());
m_card = dynamic_cast<device_plus4_expansion_card_interface *>(get_card_device());
// resolve callbacks
m_in_dma_cd_func.resolve(m_in_dma_cd_cb, *this);
@ -251,8 +242,10 @@ void plus4_expansion_slot_device::device_start()
void plus4_expansion_slot_device::device_reset()
{
breset_w(ASSERT_LINE);
breset_w(CLEAR_LINE);
if (get_card_device())
{
get_card_device()->reset();
}
}
@ -262,7 +255,7 @@ void plus4_expansion_slot_device::device_reset()
bool plus4_expansion_slot_device::call_load()
{
if (m_cart)
if (m_card)
{
size_t size = 0;
@ -273,22 +266,22 @@ bool plus4_expansion_slot_device::call_load()
else
{
size = get_software_region_length("c1l");
if (size) memcpy(m_cart->plus4_c1l_pointer(machine(), size), get_software_region("c1l"), size);
if (size) memcpy(m_card->plus4_c1l_pointer(machine(), size), get_software_region("c1l"), size);
size = get_software_region_length("c1h");
if (size) memcpy(m_cart->plus4_c1h_pointer(machine(), size), get_software_region("c1h"), size);
if (size) memcpy(m_card->plus4_c1h_pointer(machine(), size), get_software_region("c1h"), size);
size = get_software_region_length("c2l");
if (size) memcpy(m_cart->plus4_c2l_pointer(machine(), size), get_software_region("c2l"), size);
if (size) memcpy(m_card->plus4_c2l_pointer(machine(), size), get_software_region("c2l"), size);
size = get_software_region_length("c2h");
if (size) memcpy(m_cart->plus4_c2h_pointer(machine(), size), get_software_region("c2h"), size);
if (size) memcpy(m_card->plus4_c2h_pointer(machine(), size), get_software_region("c2h"), size);
size = get_software_region_length("ram");
if (size) memset(m_cart->plus4_ram_pointer(machine(), size), 0, size);
if (size) memset(m_card->plus4_ram_pointer(machine(), size), 0, size);
size = get_software_region_length("nvram");
if (size) memset(m_cart->plus4_nvram_pointer(machine(), size), 0, size);
if (size) memset(m_card->plus4_nvram_pointer(machine(), size), 0, size);
}
}
@ -324,9 +317,9 @@ const char * plus4_expansion_slot_device::get_default_card_software(const machin
UINT8 plus4_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h)
{
if (m_cart != NULL)
if (m_card != NULL)
{
data = m_cart->plus4_cd_r(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h);
data = m_card->plus4_cd_r(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h);
}
return data;
@ -339,55 +332,8 @@ UINT8 plus4_expansion_slot_device::cd_r(address_space &space, offs_t offset, UIN
void plus4_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h)
{
if (m_cart != NULL)
if (m_card != NULL)
{
m_cart->plus4_cd_w(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h);
m_card->plus4_cd_w(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h);
}
}
//-------------------------------------------------
// breset_w - buffered reset write
//-------------------------------------------------
WRITE_LINE_MEMBER( plus4_expansion_slot_device::breset_w )
{
if (m_cart != NULL)
{
m_cart->plus4_breset_w(state);
}
}
//-------------------------------------------------
// dma_cd_r - DMA read
//-------------------------------------------------
UINT8 plus4_expansion_slot_device::dma_cd_r(offs_t offset)
{
return m_in_dma_cd_func(offset);
}
//-------------------------------------------------
// dma_cd_w - DMA write
//-------------------------------------------------
void plus4_expansion_slot_device::dma_cd_w(offs_t offset, UINT8 data)
{
m_out_dma_cd_func(offset, data);
}
WRITE_LINE_MEMBER( plus4_expansion_slot_device::irq_w ) { m_out_irq_func(state); }
WRITE_LINE_MEMBER( plus4_expansion_slot_device::aec_w ) { m_out_aec_func(state); }
//-------------------------------------------------
// phi2 - system clock frequency
//-------------------------------------------------
int plus4_expansion_slot_device::phi2()
{
return clock();
}

View File

@ -94,21 +94,18 @@ class plus4_expansion_slot_device : public device_t,
public:
// construction/destruction
plus4_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~plus4_expansion_slot_device();
// computer interface
UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER( breset_w );
// cartridge interface
UINT8 dma_cd_r(offs_t offset);
void dma_cd_w(offs_t offset, UINT8 data);
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( aec_w );
int phi2();
int dotclock();
DECLARE_READ8_MEMBER( dma_cd_r ) { return m_in_dma_cd_func(offset); }
DECLARE_WRITE8_MEMBER( dma_cd_w ) { m_out_dma_cd_func(offset, data); }
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_out_irq_func(state); }
DECLARE_WRITE_LINE_MEMBER( aec_w ) { m_out_aec_func(state); }
int phi2() { return clock(); }
protected:
// device-level overrides
@ -139,7 +136,7 @@ protected:
devcb_resolved_write_line m_out_irq_func;
devcb_resolved_write_line m_out_aec_func;
device_plus4_expansion_card_interface *m_cart;
device_plus4_expansion_card_interface *m_card;
};
@ -165,7 +162,6 @@ public:
// runtime
virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { return data; };
virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { };
virtual void plus4_breset_w(int state) { };
protected:
plus4_expansion_slot_device *m_slot;

View File

@ -59,15 +59,6 @@ plus4_user_port_device::plus4_user_port_device(const machine_config &mconfig, co
}
//-------------------------------------------------
// plus4_user_port_device - destructor
//-------------------------------------------------
plus4_user_port_device::~plus4_user_port_device()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@ -84,8 +75,10 @@ void plus4_user_port_device::device_start()
void plus4_user_port_device::device_reset()
{
breset_w(ASSERT_LINE);
breset_w(CLEAR_LINE);
if (get_card_device())
{
get_card_device()->reset();
}
}
@ -101,4 +94,3 @@ WRITE_LINE_MEMBER( plus4_user_port_device::dtr_w ) { if (m_cart != NULL) m_cart-
WRITE_LINE_MEMBER( plus4_user_port_device::rts_w ) { if (m_cart != NULL) m_cart->plus4_rts_w(state); }
WRITE_LINE_MEMBER( plus4_user_port_device::rxc_w ) { if (m_cart != NULL) m_cart->plus4_rxc_w(state); }
WRITE_LINE_MEMBER( plus4_user_port_device::atn_w ) { if (m_cart != NULL) m_cart->plus4_atn_w(state); }
WRITE_LINE_MEMBER( plus4_user_port_device::breset_w ) { if (m_cart != NULL) m_cart->plus4_breset_w(state); }

View File

@ -63,7 +63,6 @@ class plus4_user_port_device : public device_t,
public:
// construction/destruction
plus4_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~plus4_user_port_device();
// computer interface
DECLARE_READ8_MEMBER( p_r );
@ -76,7 +75,6 @@ public:
DECLARE_WRITE_LINE_MEMBER( rts_w );
DECLARE_WRITE_LINE_MEMBER( rxc_w );
DECLARE_WRITE_LINE_MEMBER( atn_w );
DECLARE_WRITE_LINE_MEMBER( breset_w );
protected:
// device-level overrides
@ -110,9 +108,6 @@ public:
virtual void plus4_rxc_w(int state) { };
virtual void plus4_atn_w(int state) { };
// reset
virtual void plus4_breset_w(int state) { };
protected:
plus4_user_port_device *m_slot;
};

View File

@ -143,6 +143,6 @@ void vic1010_device::vic20_res_w(int state)
{
for (int i = 0; i < MAX_SLOTS; i++)
{
m_expansion_slot[i]->port_res_w(state);
m_expansion_slot[i]->reset();
}
}

View File

@ -16,7 +16,7 @@
//**************************************************************************
// GLOBAL VARIABLES
// DEVICE DEFINITIONS
//**************************************************************************
const device_type VIC10_EXPANSION_SLOT = &device_creator<vic10_expansion_slot_device>;
@ -113,15 +113,6 @@ vic10_expansion_slot_device::vic10_expansion_slot_device(const machine_config &m
}
//-------------------------------------------------
// vic10_expansion_slot_device - destructor
//-------------------------------------------------
vic10_expansion_slot_device::~vic10_expansion_slot_device()
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
@ -157,7 +148,7 @@ void vic10_expansion_slot_device::device_config_complete()
void vic10_expansion_slot_device::device_start()
{
m_cart = dynamic_cast<device_vic10_expansion_card_interface *>(get_card_device());
m_card = dynamic_cast<device_vic10_expansion_card_interface *>(get_card_device());
// resolve callbacks
m_out_irq_func.resolve(m_out_irq_cb, *this);
@ -181,8 +172,10 @@ void vic10_expansion_slot_device::device_start()
void vic10_expansion_slot_device::device_reset()
{
res_w(ASSERT_LINE);
res_w(CLEAR_LINE);
if (get_card_device())
{
get_card_device()->reset();
}
}
@ -192,7 +185,7 @@ void vic10_expansion_slot_device::device_reset()
bool vic10_expansion_slot_device::call_load()
{
if (m_cart)
if (m_card)
{
size_t size = 0;
@ -202,14 +195,14 @@ bool vic10_expansion_slot_device::call_load()
if (!mame_stricmp(filetype(), "80"))
{
fread(m_cart->vic10_lorom_pointer(machine(), 0x2000), 0x2000);
fread(m_card->vic10_lorom_pointer(machine(), 0x2000), 0x2000);
if (size == 0x4000)
{
fread(m_cart->vic10_uprom_pointer(machine(), 0x2000), 0x2000);
fread(m_card->vic10_uprom_pointer(machine(), 0x2000), 0x2000);
}
}
else if (!mame_stricmp(filetype(), "e0")) fread(m_cart->vic10_uprom_pointer(machine(), size), size);
else if (!mame_stricmp(filetype(), "e0")) fread(m_card->vic10_uprom_pointer(machine(), size), size);
else if (!mame_stricmp(filetype(), "crt"))
{
size_t roml_size = 0;
@ -222,8 +215,8 @@ bool vic10_expansion_slot_device::call_load()
UINT8 *roml = NULL;
UINT8 *romh = NULL;
if (roml_size) roml = m_cart->vic10_lorom_pointer(machine(), roml_size);
if (romh_size) romh = m_cart->vic10_uprom_pointer(machine(), romh_size);
if (roml_size) roml = m_card->vic10_lorom_pointer(machine(), roml_size);
if (romh_size) romh = m_card->vic10_uprom_pointer(machine(), romh_size);
cbm_crt_read_data(m_file, roml, romh);
}
@ -232,13 +225,13 @@ bool vic10_expansion_slot_device::call_load()
else
{
size = get_software_region_length("lorom");
if (size) memcpy(m_cart->vic10_lorom_pointer(machine(), size), get_software_region("lorom"), size);
if (size) memcpy(m_card->vic10_lorom_pointer(machine(), size), get_software_region("lorom"), size);
size = get_software_region_length("uprom");
if (size) memcpy(m_cart->vic10_uprom_pointer(machine(), size), get_software_region("uprom"), size);
if (size) memcpy(m_card->vic10_uprom_pointer(machine(), size), get_software_region("uprom"), size);
size = get_software_region_length("exram");
if (size) m_cart->vic10_exram_pointer(machine(), size);
if (size) m_card->vic10_exram_pointer(machine(), size);
}
}
@ -284,9 +277,9 @@ const char * vic10_expansion_slot_device::get_default_card_software(const machin
UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram)
{
if (m_cart != NULL)
if (m_card != NULL)
{
data = m_cart->vic10_cd_r(space, offset, data, lorom, uprom, exram);
data = m_card->vic10_cd_r(space, offset, data, lorom, uprom, exram);
}
return data;
@ -299,17 +292,15 @@ UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, UIN
void vic10_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram)
{
if (m_cart != NULL)
if (m_card != NULL)
{
m_cart->vic10_cd_w(space, offset, data, lorom, uprom, exram);
m_card->vic10_cd_w(space, offset, data, lorom, uprom, exram);
}
}
WRITE_LINE_MEMBER( vic10_expansion_slot_device::port_res_w ) { if (m_cart != NULL) m_cart->vic10_res_w(state); }
READ_LINE_MEMBER( vic10_expansion_slot_device::p0_r ) { int state = 0; if (m_cart != NULL) state = m_cart->vic10_p0_r(); return state; }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::p0_w ) { if (m_cart != NULL) m_cart->vic10_p0_w(state); }
READ_LINE_MEMBER( vic10_expansion_slot_device::p0_r ) { int state = 0; if (m_card != NULL) state = m_card->vic10_p0_r(); return state; }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::p0_w ) { if (m_card != NULL) m_card->vic10_p0_w(state); }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::irq_w ) { m_out_irq_func(state); }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::sp_w ) { m_out_sp_func(state); if (m_cart != NULL) m_cart->vic10_sp_w(state); }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::cnt_w ) { m_out_cnt_func(state); if (m_cart != NULL) m_cart->vic10_cnt_w(state); }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::sp_w ) { m_out_sp_func(state); if (m_card != NULL) m_card->vic10_sp_w(state); }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::cnt_w ) { m_out_cnt_func(state); if (m_card != NULL) m_card->vic10_cnt_w(state); }
WRITE_LINE_MEMBER( vic10_expansion_slot_device::res_w ) { m_out_res_func(state); }

View File

@ -92,14 +92,12 @@ class vic10_expansion_slot_device : public device_t,
public:
// construction/destruction
vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~vic10_expansion_slot_device();
// computer interface
UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram);
void cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram);
DECLARE_READ_LINE_MEMBER( p0_r );
DECLARE_WRITE_LINE_MEMBER( p0_w );
DECLARE_WRITE_LINE_MEMBER( port_res_w );
// cartridge interface
DECLARE_WRITE_LINE_MEMBER( irq_w );
@ -107,8 +105,6 @@ public:
DECLARE_WRITE_LINE_MEMBER( cnt_w );
DECLARE_WRITE_LINE_MEMBER( res_w );
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
// device-level overrides
virtual void device_config_complete();
@ -138,7 +134,7 @@ protected:
devcb_resolved_write_line m_out_cnt_func;
devcb_resolved_write_line m_out_res_func;
device_vic10_expansion_card_interface *m_cart;
device_vic10_expansion_card_interface *m_card;
};
@ -167,7 +163,6 @@ protected:
virtual void vic10_p0_w(int state) { };
virtual void vic10_sp_w(int state) { };
virtual void vic10_cnt_w(int state) { };
virtual void vic10_res_w(int state) { };
vic10_expansion_slot_device *m_slot;

View File

@ -16,15 +16,7 @@
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
#define LOG 0
//**************************************************************************
// GLOBAL VARIABLES
// DEVICE DEFINITIONS
//**************************************************************************
const device_type VIC20_EXPANSION_SLOT = &device_creator<vic20_expansion_slot_device>;
@ -171,15 +163,6 @@ vic20_expansion_slot_device::vic20_expansion_slot_device(const machine_config &m
}
//-------------------------------------------------
// vic20_expansion_slot_device - destructor
//-------------------------------------------------
vic20_expansion_slot_device::~vic20_expansion_slot_device()
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
@ -214,7 +197,7 @@ void vic20_expansion_slot_device::device_config_complete()
void vic20_expansion_slot_device::device_start()
{
m_cart = dynamic_cast<device_vic20_expansion_card_interface *>(get_card_device());
m_card = dynamic_cast<device_vic20_expansion_card_interface *>(get_card_device());
// resolve callbacks
m_out_irq_func.resolve(m_out_irq_cb, *this);
@ -237,8 +220,10 @@ void vic20_expansion_slot_device::device_start()
void vic20_expansion_slot_device::device_reset()
{
port_res_w(ASSERT_LINE);
port_res_w(CLEAR_LINE);
if (get_card_device())
{
get_card_device()->reset();
}
}
@ -248,18 +233,18 @@ void vic20_expansion_slot_device::device_reset()
bool vic20_expansion_slot_device::call_load()
{
if (m_cart)
if (m_card)
{
size_t size = 0;
if (software_entry() == NULL)
{
if (!mame_stricmp(filetype(), "20")) fread(m_cart->vic20_blk1_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "40")) fread(m_cart->vic20_blk2_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "60")) fread(m_cart->vic20_blk3_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "70")) fread(m_cart->vic20_blk3_pointer(machine(), 0x2000) + 0x1000, 0x1000);
else if (!mame_stricmp(filetype(), "a0")) fread(m_cart->vic20_blk5_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "b0")) fread(m_cart->vic20_blk5_pointer(machine(), 0x2000) + 0x1000, 0x1000);
if (!mame_stricmp(filetype(), "20")) fread(m_card->vic20_blk1_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "40")) fread(m_card->vic20_blk2_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "60")) fread(m_card->vic20_blk3_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "70")) fread(m_card->vic20_blk3_pointer(machine(), 0x2000) + 0x1000, 0x1000);
else if (!mame_stricmp(filetype(), "a0")) fread(m_card->vic20_blk5_pointer(machine(), 0x2000), 0x2000);
else if (!mame_stricmp(filetype(), "b0")) fread(m_card->vic20_blk5_pointer(machine(), 0x2000) + 0x1000, 0x1000);
else if (!mame_stricmp(filetype(), "crt"))
{
// read the header
@ -267,16 +252,14 @@ bool vic20_expansion_slot_device::call_load()
fread(&header, 2);
UINT16 address = pick_integer_le(header, 0, 2);
if (LOG) logerror("Address %04x\n", address);
switch (address)
{
case 0x2000: fread(m_cart->vic20_blk1_pointer(machine(), 0x2000), 0x2000); break;
case 0x4000: fread(m_cart->vic20_blk2_pointer(machine(), 0x2000), 0x2000); break;
case 0x6000: fread(m_cart->vic20_blk3_pointer(machine(), 0x2000), 0x2000); break;
case 0x7000: fread(m_cart->vic20_blk3_pointer(machine(), 0x2000) + 0x1000, 0x1000); break;
case 0xa000: fread(m_cart->vic20_blk5_pointer(machine(), 0x2000), 0x2000); break;
case 0xb000: fread(m_cart->vic20_blk5_pointer(machine(), 0x2000) + 0x1000, 0x1000); break;
case 0x2000: fread(m_card->vic20_blk1_pointer(machine(), 0x2000), 0x2000); break;
case 0x4000: fread(m_card->vic20_blk2_pointer(machine(), 0x2000), 0x2000); break;
case 0x6000: fread(m_card->vic20_blk3_pointer(machine(), 0x2000), 0x2000); break;
case 0x7000: fread(m_card->vic20_blk3_pointer(machine(), 0x2000) + 0x1000, 0x1000); break;
case 0xa000: fread(m_card->vic20_blk5_pointer(machine(), 0x2000), 0x2000); break;
case 0xb000: fread(m_card->vic20_blk5_pointer(machine(), 0x2000) + 0x1000, 0x1000); break;
default: return IMAGE_INIT_FAIL;
}
}
@ -284,22 +267,22 @@ bool vic20_expansion_slot_device::call_load()
else
{
size = get_software_region_length("blk1");
if (size) memcpy(m_cart->vic20_blk1_pointer(machine(), size), get_software_region("blk1"), size);
if (size) memcpy(m_card->vic20_blk1_pointer(machine(), size), get_software_region("blk1"), size);
size = get_software_region_length("blk2");
if (size) memcpy(m_cart->vic20_blk2_pointer(machine(), size), get_software_region("blk2"), size);
if (size) memcpy(m_card->vic20_blk2_pointer(machine(), size), get_software_region("blk2"), size);
size = get_software_region_length("blk3");
if (size) memcpy(m_cart->vic20_blk3_pointer(machine(), size), get_software_region("blk3"), size);
if (size) memcpy(m_card->vic20_blk3_pointer(machine(), size), get_software_region("blk3"), size);
size = get_software_region_length("blk5");
if (size) memcpy(m_cart->vic20_blk5_pointer(machine(), size), get_software_region("blk5"), size);
if (size) memcpy(m_card->vic20_blk5_pointer(machine(), size), get_software_region("blk5"), size);
size = get_software_region_length("ram");
if (size) memcpy(m_cart->vic20_ram_pointer(machine(), size), get_software_region("ram"), size);
if (size) memcpy(m_card->vic20_ram_pointer(machine(), size), get_software_region("ram"), size);
size = get_software_region_length("nvram");
if (size) memcpy(m_cart->vic20_nvram_pointer(machine(), size), get_software_region("nvram"), size);
if (size) memcpy(m_card->vic20_nvram_pointer(machine(), size), get_software_region("nvram"), size);
}
}
@ -336,9 +319,9 @@ const char * vic20_expansion_slot_device::get_default_card_software(const machin
UINT8 vic20_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3)
{
if (m_cart != NULL)
if (m_card != NULL)
{
data = m_cart->vic20_cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3);
data = m_card->vic20_cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3);
}
return data;
@ -351,14 +334,12 @@ UINT8 vic20_expansion_slot_device::cd_r(address_space &space, offs_t offset, UIN
void vic20_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3)
{
if (m_cart != NULL)
if (m_card != NULL)
{
m_cart->vic20_cd_w(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3);
m_card->vic20_cd_w(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3);
}
}
WRITE_LINE_MEMBER( vic20_expansion_slot_device::port_res_w ) { if (m_cart != NULL) m_cart->vic20_res_w(state); }
WRITE_LINE_MEMBER( vic20_expansion_slot_device::irq_w ) { m_out_irq_func(state); }
WRITE_LINE_MEMBER( vic20_expansion_slot_device::nmi_w ) { m_out_nmi_func(state); }
WRITE_LINE_MEMBER( vic20_expansion_slot_device::res_w ) { m_out_res_func(state); }

View File

@ -90,13 +90,10 @@ class vic20_expansion_slot_device : public device_t,
public:
// construction/destruction
vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~vic20_expansion_slot_device();
// computer interface
UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
void cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER( port_res_w );
// cartridge interface
DECLARE_WRITE_LINE_MEMBER( irq_w );
@ -131,7 +128,7 @@ protected:
devcb_resolved_write_line m_out_nmi_func;
devcb_resolved_write_line m_out_res_func;
device_vic20_expansion_card_interface *m_cart;
device_vic20_expansion_card_interface *m_card;
};