(MESS) c64 et al: Inherit the bus clock from parent expansion slot. (nw)

This commit is contained in:
Curt Coder 2012-08-22 18:19:39 +00:00
parent 049780af4f
commit 17412cd1de
10 changed files with 58 additions and 13 deletions

View File

@ -634,7 +634,7 @@ static MACHINE_CONFIG_START( vic10, vic10_state )
MCFG_MOS6526R1_ADD(MOS6526_TAG, VIC6566_CLOCK, cia_intf)
MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface)
MCFG_TIMER_ADD(TIMER_C1531_TAG, cassette_tick)
MCFG_VIC10_EXPANSION_SLOT_ADD(VIC10_EXPANSION_SLOT_TAG, expansion_intf, vic10_expansion_cards, NULL, NULL)
MCFG_VIC10_EXPANSION_SLOT_ADD(VIC10_EXPANSION_SLOT_TAG, VIC6566_CLOCK, expansion_intf, vic10_expansion_cards, NULL, NULL)
// software list
MCFG_SOFTWARE_LIST_ADD("cart_list", "vic10")

View File

@ -821,7 +821,6 @@ static MACHINE_CONFIG_START( vic20_common, vic20_state )
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vic20_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vic20_control_port_devices, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, user_intf, vic20_user_port_cards, NULL, NULL)
// software lists
@ -862,6 +861,9 @@ static MACHINE_CONFIG_DERIVED( vic20_ntsc, vic20_common )
MCFG_SOUND_ADD("dac", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6560_CLOCK, expansion_intf, vic20_expansion_cards, NULL, NULL)
// software lists
MCFG_SOFTWARE_LIST_FILTER("cart_list", "NTSC")
MCFG_SOFTWARE_LIST_FILTER("disk_list", "NTSC")
@ -889,6 +891,9 @@ static MACHINE_CONFIG_DERIVED( vic20_pal, vic20_common )
MCFG_PALETTE_LENGTH(16)
MCFG_PALETTE_INIT( vic20 )
// devices
MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6561_CLOCK, expansion_intf, vic20_expansion_cards, NULL, NULL)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_MOS656X_ADD(M6560_TAG, vic_pal_intf)

View File

@ -202,6 +202,14 @@ void c64_expansion_slot_device::device_start()
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);
// inherit bus clock
if (clock() == 0)
{
c64_expansion_slot_device *root = machine().device<c64_expansion_slot_device>(C64_EXPANSION_SLOT_TAG);
assert(root);
set_unscaled_clock(root->clock());
}
}

View File

@ -190,6 +190,14 @@ C64 SERIAL BUS
5) Tei minimum must be 80us for external device to be a listener.
*/
/*
TODO:
- refactor into an actual daisy chain instead of this convenient hack
*/
#include "cbmiec.h"

View File

@ -234,6 +234,14 @@ void plus4_expansion_slot_device::device_start()
m_out_dma_cd_func.resolve(m_out_dma_cd_cb, *this);
m_out_irq_func.resolve(m_out_irq_cb, *this);
m_out_aec_func.resolve(m_out_aec_cb, *this);
// inherit bus clock
if (clock() == 0)
{
plus4_expansion_slot_device *root = machine().device<plus4_expansion_slot_device>(PLUS4_EXPANSION_SLOT_TAG);
assert(root);
set_unscaled_clock(root->clock());
}
}

View File

@ -50,12 +50,12 @@ static VIC20_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( vic1010 )
MCFG_VIC20_EXPANSION_SLOT_ADD("slot1", expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot2", expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot3", expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot4", expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot5", expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot6", expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot1", 0, expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot2", 0, expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot3", 0, expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot4", 0, expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot5", 0, expansion_intf, vic20_expansion_cards, NULL, NULL)
MCFG_VIC20_EXPANSION_SLOT_ADD("slot6", 0, expansion_intf, vic20_expansion_cards, NULL, NULL)
MACHINE_CONFIG_END

View File

@ -9,9 +9,9 @@
#include "emu.h"
#include "emuopts.h"
#include "machine/vic10exp.h"
#include "formats/cbm_crt.h"
#include "formats/imageutl.h"
#include "machine/vic10exp.h"
@ -164,6 +164,14 @@ void vic10_expansion_slot_device::device_start()
m_out_sp_func.resolve(m_out_sp_cb, *this);
m_out_cnt_func.resolve(m_out_cnt_cb, *this);
m_out_res_func.resolve(m_out_res_cb, *this);
// inherit bus clock
if (clock() == 0)
{
vic10_expansion_slot_device *root = machine().device<vic10_expansion_slot_device>(VIC10_EXPANSION_SLOT_TAG);
assert(root);
set_unscaled_clock(root->clock());
}
}

View File

@ -58,8 +58,8 @@
const vic10_expansion_slot_interface (_name) =
#define MCFG_VIC10_EXPANSION_SLOT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \
MCFG_DEVICE_ADD(_tag, VIC10_EXPANSION_SLOT, 0) \
#define MCFG_VIC10_EXPANSION_SLOT_ADD(_tag, _clock, _config, _slot_intf, _def_slot, _def_inp) \
MCFG_DEVICE_ADD(_tag, VIC10_EXPANSION_SLOT, _clock) \
MCFG_DEVICE_CONFIG(_config) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)

View File

@ -220,6 +220,14 @@ void vic20_expansion_slot_device::device_start()
m_out_irq_func.resolve(m_out_irq_cb, *this);
m_out_nmi_func.resolve(m_out_nmi_cb, *this);
m_out_res_func.resolve(m_out_res_cb, *this);
// inherit bus clock
if (clock() == 0)
{
vic20_expansion_slot_device *root = machine().device<vic20_expansion_slot_device>(VIC20_EXPANSION_SLOT_TAG);
assert(root);
set_unscaled_clock(root->clock());
}
}

View File

@ -57,8 +57,8 @@
const vic20_expansion_slot_interface (_name) =
#define MCFG_VIC20_EXPANSION_SLOT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \
MCFG_DEVICE_ADD(_tag, VIC20_EXPANSION_SLOT, 0) \
#define MCFG_VIC20_EXPANSION_SLOT_ADD(_tag, _clock, _config, _slot_intf, _def_slot, _def_inp) \
MCFG_DEVICE_ADD(_tag, VIC20_EXPANSION_SLOT, _clock) \
MCFG_DEVICE_CONFIG(_config) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)