From 0676cd1144f4b98c1ad02333cbba3ae5541e7a37 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Sat, 22 Mar 2014 22:37:54 +0000 Subject: [PATCH] mos6526: devcb2 cleanup. (nw) --- src/emu/bus/cbmiec/c1571.c | 32 +++++++++----- src/emu/bus/cbmiec/c1581.c | 12 ++++-- src/emu/machine/mos6526.c | 1 + src/emu/machine/mos6526.h | 65 +++++++++++++---------------- src/mess/drivers/c128.c | 54 ++++++++++++++++-------- src/mess/drivers/c64.c | 78 +++++++++++++++++++++++----------- src/mess/drivers/c65.c | 27 ++++++------ src/mess/drivers/cbm2.c | 85 +++++++++++++++++++++----------------- src/mess/drivers/sbc6510.c | 8 ++-- src/mess/drivers/vic10.c | 12 ++++-- 10 files changed, 224 insertions(+), 150 deletions(-) diff --git a/src/emu/bus/cbmiec/c1571.c b/src/emu/bus/cbmiec/c1571.c index 3a328b39739..3733582e77d 100644 --- a/src/emu/bus/cbmiec/c1571.c +++ b/src/emu/bus/cbmiec/c1571.c @@ -640,10 +640,14 @@ static MACHINE_CONFIG_FRAGMENT( c1570 ) MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE(C64H156_TAG, c64h156_device, oe_w)) MCFG_VIA6522_IRQ_HANDLER(WRITELINE(c1571_device, via1_irq_w)) - MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, WRITELINE(c1571_device, cia_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c1571_device, cia_cnt_w), WRITELINE(c1571_device, cia_sp_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c1571_device, cia_pb_r), WRITE8(c1571_device, cia_pb_w), WRITELINE(c1571_device, cia_pc_w)) - + MCFG_DEVICE_ADD(M6526_TAG, MOS6526, XTAL_16MHz/16) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c1571_device, cia_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c1571_device, cia_cnt_w)) + MCFG_MOS6526_SP_CALLBACK(WRITELINE(c1571_device, cia_sp_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c1571_device, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1571_device, cia_pb_w)) + MCFG_MOS6526_PC_CALLBACK(WRITELINE(c1571_device, cia_pc_w)) + MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2) MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz) MCFG_64H156_BYTE_CALLBACK(WRITELINE(c1571_device, byte_w)) @@ -687,9 +691,13 @@ static MACHINE_CONFIG_FRAGMENT( c1571 ) MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE(C64H156_TAG, c64h156_device, oe_w)) MCFG_VIA6522_IRQ_HANDLER(WRITELINE(c1571_device, via1_irq_w)) - MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, WRITELINE(c1571_device, cia_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c1571_device, cia_cnt_w), WRITELINE(c1571_device, cia_sp_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c1571_device, cia_pb_r), WRITE8(c1571_device, cia_pb_w), WRITELINE(c1571_device, cia_pc_w)) + MCFG_DEVICE_ADD(M6526_TAG, MOS6526, XTAL_16MHz/16) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c1571_device, cia_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c1571_device, cia_cnt_w)) + MCFG_MOS6526_SP_CALLBACK(WRITELINE(c1571_device, cia_sp_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c1571_device, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1571_device, cia_pb_w)) + MCFG_MOS6526_PC_CALLBACK(WRITELINE(c1571_device, cia_pc_w)) MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2) MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz) @@ -779,9 +787,13 @@ static MACHINE_CONFIG_FRAGMENT( mini_chief ) MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE(C64H156_TAG, c64h156_device, oe_w)) MCFG_VIA6522_IRQ_HANDLER(WRITELINE(c1571_device, via1_irq_w)) - MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, WRITELINE(c1571_device, cia_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c1571_device, cia_cnt_w), WRITELINE(c1571_device, cia_sp_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c1571_device, cia_pb_r), WRITE8(c1571_device, cia_pb_w), WRITELINE(c1571_device, cia_pc_w)) + MCFG_DEVICE_ADD(M6526_TAG, MOS6526, XTAL_16MHz/16) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c1571_device, cia_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c1571_device, cia_cnt_w)) + MCFG_MOS6526_SP_CALLBACK(WRITELINE(c1571_device, cia_sp_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c1571_device, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1571_device, cia_pb_w)) + MCFG_MOS6526_PC_CALLBACK(WRITELINE(c1571_device, cia_pc_w)) MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2) MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz) diff --git a/src/emu/bus/cbmiec/c1581.c b/src/emu/bus/cbmiec/c1581.c index b2357c2df95..e48b93d21bf 100644 --- a/src/emu/bus/cbmiec/c1581.c +++ b/src/emu/bus/cbmiec/c1581.c @@ -271,10 +271,14 @@ static MACHINE_CONFIG_FRAGMENT( c1581 ) MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/8) 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(WRITELINE(c1581_device, cnt_w), WRITELINE(c1581_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c1581_device, cia_pa_r), WRITE8(c1581_device, cia_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c1581_device, cia_pb_r), WRITE8(c1581_device, cia_pb_w), NULL) + MCFG_DEVICE_ADD(M8520_TAG, MOS8520, XTAL_16MHz/8) + MCFG_MOS6526_IRQ_CALLBACK(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0)) + MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c1581_device, cnt_w)) + MCFG_MOS6526_SP_CALLBACK(WRITELINE(c1581_device, sp_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c1581_device, cia_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c1581_device, cia_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c1581_device, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1581_device, cia_pb_w)) MCFG_WD1772x_ADD(WD1772_TAG, XTAL_16MHz/2) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", c1581_floppies, "35dd", c1581_device::floppy_formats) diff --git a/src/emu/machine/mos6526.c b/src/emu/machine/mos6526.c index 3ce9296bedd..4f03b8b262a 100644 --- a/src/emu/machine/mos6526.c +++ b/src/emu/machine/mos6526.c @@ -613,6 +613,7 @@ mos6526_device::mos6526_device(const machine_config &mconfig, const char *tag, d device_execute_interface(mconfig, *this), m_icount(0), m_variant(TYPE_6526), + m_tod_clock(0), m_write_irq(*this), m_write_pc(*this), m_write_cnt(*this), diff --git a/src/emu/machine/mos6526.h b/src/emu/machine/mos6526.h index 6fb8ac933ca..078bbbd9349 100644 --- a/src/emu/machine/mos6526.h +++ b/src/emu/machine/mos6526.h @@ -71,31 +71,32 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_MOS6526_ADD(_tag, _clock, _tod_clock, _irq) \ - MCFG_DEVICE_ADD(_tag, MOS6526, _clock) \ - downcast(device)->set_callbacks(_tod_clock, DEVCB2_##_irq); +#define MCFG_MOS6526_TOD(_clock) \ + mos6526_device::static_set_tod_clock(*device, _clock); -#define MCFG_MOS6526A_ADD(_tag, _clock, _tod_clock, _irq) \ - MCFG_DEVICE_ADD(_tag, MOS6526A, _clock) \ - downcast(device)->set_callbacks(_tod_clock, DEVCB2_##_irq); +#define MCFG_MOS6526_IRQ_CALLBACK(_write) \ + devcb = &mos6526_device::set_irq_wr_callback(*device, DEVCB2_##_write); -#define MCFG_MOS8520_ADD(_tag, _clock, _tod_clock, _irq) \ - MCFG_DEVICE_ADD(_tag, MOS8520, _clock) \ - downcast(device)->set_callbacks(_tod_clock, DEVCB2_##_irq); +#define MCFG_MOS6526_CNT_CALLBACK(_write) \ + devcb = &mos6526_device::set_cnt_wr_callback(*device, DEVCB2_##_write); -#define MCFG_MOS5710_ADD(_tag, _clock, _tod_clock, _irq) \ - MCFG_DEVICE_ADD(_tag, MOS5710, _clock) \ - downcast(device)->set_callbacks(_tod_clock, DEVCB2_##_irq); +#define MCFG_MOS6526_SP_CALLBACK(_write) \ + devcb = &mos6526_device::set_sp_wr_callback(*device, DEVCB2_##_write); +#define MCFG_MOS6526_PA_INPUT_CALLBACK(_read) \ + devcb = &mos6526_device::set_pa_rd_callback(*device, DEVCB2_##_read); -#define MCFG_MOS6526_SERIAL_CALLBACKS(_cnt, _sp) \ - downcast(device)->set_serial_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp); +#define MCFG_MOS6526_PA_OUTPUT_CALLBACK(_write) \ + devcb = &mos6526_device::set_pa_wr_callback(*device, DEVCB2_##_write); -#define MCFG_MOS6526_PORT_A_CALLBACKS(_read, _write) \ - downcast(device)->set_port_a_callbacks(DEVCB2_##_read, DEVCB2_##_write); +#define MCFG_MOS6526_PB_INPUT_CALLBACK(_read) \ + devcb = &mos6526_device::set_pb_rd_callback(*device, DEVCB2_##_read); -#define MCFG_MOS6526_PORT_B_CALLBACKS(_read, _write, _pc) \ - downcast(device)->set_port_b_callbacks(DEVCB2_##_read, DEVCB2_##_write, DEVCB2_##_pc); +#define MCFG_MOS6526_PB_OUTPUT_CALLBACK(_write) \ + devcb = &mos6526_device::set_pb_wr_callback(*device, DEVCB2_##_write); + +#define MCFG_MOS6526_PC_CALLBACK(_write) \ + devcb = &mos6526_device::set_pc_wr_callback(*device, DEVCB2_##_write); @@ -113,26 +114,16 @@ public: mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); mos6526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - template void set_callbacks(int tod_clock, _irq irq) { - m_tod_clock = tod_clock; - m_write_irq.set_callback(irq); - } + static void static_set_tod_clock(device_t &device, int clock) { downcast(device).m_tod_clock = clock; } - template void set_serial_callbacks(_cnt cnt, _sp sp) { - m_write_cnt.set_callback(cnt); - m_write_sp.set_callback(sp); - } - - template void set_port_a_callbacks(_read rd, _write wr) { - m_read_pa.set_callback(rd); - m_write_pa.set_callback(wr); - } - - template void set_port_b_callbacks(_read rd, _write wr, _pc pc) { - m_read_pb.set_callback(rd); - m_write_pb.set_callback(wr); - m_write_pc.set_callback(pc); - } + template static devcb2_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } + template static devcb2_base &set_cnt_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_sp.set_callback(object); } + template static devcb2_base &set_sp_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_cnt.set_callback(object); } + template static devcb2_base &set_pa_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_pa.set_callback(object); } + template static devcb2_base &set_pa_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_pa.set_callback(object); } + template static devcb2_base &set_pb_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_pb.set_callback(object); } + template static devcb2_base &set_pb_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_pb.set_callback(object); } + template static devcb2_base &set_pc_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_pc.set_callback(object); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c index 4fa2d51f077..78ffbc7c979 100644 --- a/src/mess/drivers/c128.c +++ b/src/mess/drivers/c128.c @@ -1488,14 +1488,24 @@ static MACHINE_CONFIG_START( ntsc, c128_state ) MCFG_MOS8722_EXROM_CALLBACK(READLINE(c128_state, mmu_exrom_r)) MCFG_MOS8722_SENSE40_CALLBACK(READLINE(c128_state, mmu_sense40_r)) MCFG_MOS8721_ADD(MOS8721_TAG) - MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia1_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c128_state, cia1_cnt_w), WRITELINE(c128_state, cia1_sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL) - MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) + MCFG_DEVICE_ADD(MOS6526_1_TAG, MOS6526, VIC6567_CLOCK) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c128_state, cia1_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c128_state, cia1_cnt_w)) + MCFG_MOS6526_SP_CALLBACK(WRITELINE(c128_state, cia1_sp_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c128_state, cia1_pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c128_state, cia1_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c128_state, cia1_pb_w)) + MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, VIC6567_CLOCK) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c128_state, cia2_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c128_state, cia2_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c128_state, cia2_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c128_state, cia2_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c128_state, cia2_pb_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w)) @@ -1588,7 +1598,7 @@ MACHINE_CONFIG_END //------------------------------------------------- -// MACHINE_CONFIG( ntsc ) +// MACHINE_CONFIG( pal ) //------------------------------------------------- static MACHINE_CONFIG_START( pal, c128_state ) @@ -1638,14 +1648,24 @@ static MACHINE_CONFIG_START( pal, c128_state ) MCFG_MOS8722_EXROM_CALLBACK(READLINE(c128_state, mmu_exrom_r)) MCFG_MOS8722_SENSE40_CALLBACK(READLINE(c128_state, mmu_sense40_r)) MCFG_MOS8721_ADD(MOS8721_TAG) - MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c128_state, cia1_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c128_state, cia1_cnt_w), WRITELINE(c128_state, cia1_sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL) - MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) + MCFG_DEVICE_ADD(MOS6526_1_TAG, MOS6526, VIC6569_CLOCK) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c128_state, cia1_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c128_state, cia1_cnt_w)) + MCFG_MOS6526_SP_CALLBACK(WRITELINE(c128_state, cia1_sp_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c128_state, cia1_pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c128_state, cia1_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c128_state, cia1_pb_w)) + MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, VIC6569_CLOCK) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c128_state, cia2_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c128_state, cia2_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c128_state, cia2_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c128_state, cia2_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c128_state, cia2_pb_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w)) diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c index c50b5635cef..01897ecb2b0 100644 --- a/src/mess/drivers/c64.c +++ b/src/mess/drivers/c64.c @@ -1114,14 +1114,24 @@ static MACHINE_CONFIG_START( ntsc, c64_state ) // devices MCFG_PLS100_ADD(PLA_TAG) - MCFG_MOS6526_ADD(MOS6526_1_TAG, XTAL_14_31818MHz/14, 60, WRITELINE(c64_state, cia1_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) - MCFG_MOS6526_ADD(MOS6526_2_TAG, XTAL_14_31818MHz/14, 60, WRITELINE(c64_state, cia2_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) + MCFG_DEVICE_ADD(MOS6526_1_TAG, MOS6526, XTAL_14_31818MHz/14) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c64_state, cia1_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64_state, cia1_pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64_state, cia1_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia1_pb_w)) + MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, XTAL_14_31818MHz/14) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c64_state, cia2_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64_state, cia2_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c64_state, cia2_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64_state, cia2_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia2_pb_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) MCFG_CBM_IEC_ADD("c1541") MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) @@ -1255,14 +1265,24 @@ static MACHINE_CONFIG_START( pal, c64_state ) // devices MCFG_PLS100_ADD(PLA_TAG) - MCFG_MOS6526_ADD(MOS6526_1_TAG, XTAL_17_734472MHz/18, 50, WRITELINE(c64_state, cia1_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) - MCFG_MOS6526_ADD(MOS6526_2_TAG, XTAL_17_734472MHz/18, 60, WRITELINE(c64_state, cia2_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) + MCFG_DEVICE_ADD(MOS6526_1_TAG, MOS6526, XTAL_17_734472MHz/18) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c64_state, cia1_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64_state, cia1_pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64_state, cia1_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia1_pb_w)) + MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, XTAL_17_734472MHz/18) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c64_state, cia2_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64_state, cia2_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c64_state, cia2_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64_state, cia2_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia2_pb_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) MCFG_CBM_IEC_ADD("c1541") MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) @@ -1374,14 +1394,24 @@ static MACHINE_CONFIG_START( pal_gs, c64gs_state ) // devices MCFG_PLS100_ADD(PLA_TAG) - MCFG_MOS6526_ADD(MOS6526_1_TAG, XTAL_17_734472MHz/18, 50, WRITELINE(c64_state, cia1_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64gs_state, cia1_pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64gs_state, cia1_pb_r), WRITE8(c64gs_state, cia1_pb_w), NULL) - MCFG_MOS6526_ADD(MOS6526_2_TAG, XTAL_17_734472MHz/18, 60, WRITELINE(c64_state, cia2_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) + MCFG_DEVICE_ADD(MOS6526_1_TAG, MOS6526, XTAL_17_734472MHz/18) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c64_state, cia1_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64_state, cia1_pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64_state, cia1_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia1_pb_w)) + MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, XTAL_17_734472MHz/18) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c64_state, cia2_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64_state, cia2_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c64_state, cia2_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64_state, cia2_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia2_pb_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) MCFG_CBM_IEC_ADD(NULL) MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_9)) diff --git a/src/mess/drivers/c65.c b/src/mess/drivers/c65.c index 23ef1043945..ee0095dd8b5 100644 --- a/src/mess/drivers/c65.c +++ b/src/mess/drivers/c65.c @@ -581,12 +581,18 @@ static MACHINE_CONFIG_START( c65, c65_state ) MCFG_QUICKLOAD_ADD("quickload", c65_state, cbm_c65, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) /* cia */ - MCFG_MOS6526_ADD("cia_0", 3500000, 60, WRITELINE(c65_state, c65_cia0_interrupt)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c65_state, c65_cia0_port_a_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c65_state, c65_cia0_port_b_r), WRITE8(c65_state, c65_cia0_port_b_w), NULL) + MCFG_DEVICE_ADD("cia_0", MOS6526, 3500000) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, c65_cia0_interrupt)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, c65_cia0_port_a_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c65_state, c65_cia0_port_b_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c65_state, c65_cia0_port_b_w)) - MCFG_MOS6526_ADD("cia_1", 3500000, 60, WRITELINE(c65_state, c65_cia1_interrupt)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c65_state, c65_cia1_port_a_r), WRITE8(c65_state, c65_cia1_port_a_w)) + MCFG_DEVICE_ADD("cia_1", MOS6526, 3500000) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, c65_cia1_interrupt)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, c65_cia1_port_a_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c65_state, c65_cia1_port_a_w)) /* floppy from serial bus */ MCFG_CBM_IEC_ADD(NULL) @@ -616,14 +622,11 @@ static MACHINE_CONFIG_DERIVED( c65pal, c65 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) /* cia */ - MCFG_DEVICE_REMOVE("cia_0") - MCFG_DEVICE_REMOVE("cia_1") - MCFG_MOS6526_ADD("cia_0", 3500000, 50, WRITELINE(c65_state, c65_cia0_interrupt)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c65_state, c65_cia0_port_a_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c65_state, c65_cia0_port_b_r), WRITE8(c65_state, c65_cia0_port_b_w), NULL) + MCFG_DEVICE_MODIFY("cia_0") + MCFG_MOS6526_TOD(50) - MCFG_MOS6526_ADD("cia_1", 3500000, 50, WRITELINE(c65_state, c65_cia1_interrupt)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c65_state, c65_cia1_port_a_r), WRITE8(c65_state, c65_cia1_port_a_w)) + MCFG_DEVICE_MODIFY("cia_1") + MCFG_MOS6526_TOD(50) MACHINE_CONFIG_END diff --git a/src/mess/drivers/cbm2.c b/src/mess/drivers/cbm2.c index 2fff94d2ba4..18337765bdb 100644 --- a/src/mess/drivers/cbm2.c +++ b/src/mess/drivers/cbm2.c @@ -2137,7 +2137,6 @@ static MACHINE_CONFIG_START( p500_ntsc, p500_state ) MCFG_PLS100_ADD(PLA2_TAG) MCFG_TPI6525_ADD(MOS6525_1_TAG, p500_tpi1_intf) MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf) - MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, VIC6567_CLOCK) MCFG_MOS6551_XTAL(XTAL_1_8432MHz) MCFG_MOS6551_IRQ_HANDLER(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w)) @@ -2145,11 +2144,16 @@ static MACHINE_CONFIG_START( p500_ntsc, p500_state ) MCFG_MOS6551_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) MCFG_MOS6551_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) MCFG_MOS6551_RXC_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_etc)) - - MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_14_31818MHz/14, 60, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(cbm2_state, cia_pa_r), WRITE8(cbm2_state, cia_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) + MCFG_DEVICE_ADD(MOS6526_TAG, MOS6526A, XTAL_14_31818MHz/14) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(cbm2_state, cia_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(cbm2_state, cia_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(cbm2_state, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) MCFG_DS75160A_ADD(DS75160A_TAG, DEVREAD8(IEEE488_TAG, ieee488_device, dio_r), DEVWRITE8(IEEE488_TAG, ieee488_device, dio_w)) MCFG_DEVICE_ADD(DS75161A_TAG, DS75161A, 0) MCFG_DS75161A_IN_REN_CB(DEVREADLINE(IEEE488_TAG, ieee488_device, ren_r)) @@ -2180,7 +2184,6 @@ static MACHINE_CONFIG_START( p500_ntsc, p500_state ) MCFG_CBM2_USER_PORT_SP_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, sp_w)) MCFG_CBM2_USER_PORT_CNT_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, cnt_w)) MCFG_CBM2_USER_PORT_FLAG_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w)) - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(MOS6551A_TAG, mos6551_device, write_rxd)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(MOS6551A_TAG, mos6551_device, write_dcd)) @@ -2238,16 +2241,20 @@ static MACHINE_CONFIG_START( p500_pal, p500_state ) MCFG_PLS100_ADD(PLA2_TAG) MCFG_TPI6525_ADD(MOS6525_1_TAG, p500_tpi1_intf) MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf) - MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, 0) MCFG_MOS6551_XTAL(XTAL_1_8432MHz) MCFG_MOS6551_IRQ_HANDLER(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w)) MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) - - MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_17_734472MHz/18, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(cbm2_state, cia_pa_r), WRITE8(cbm2_state, cia_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) + MCFG_DEVICE_ADD(MOS6526_TAG, MOS6526A, XTAL_17_734472MHz/18) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(cbm2_state, cia_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(cbm2_state, cia_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(cbm2_state, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) MCFG_DS75160A_ADD(DS75160A_TAG, DEVREAD8(IEEE488_TAG, ieee488_device, dio_r), DEVWRITE8(IEEE488_TAG, ieee488_device, dio_w)) MCFG_DEVICE_ADD(DS75161A_TAG, DS75161A, 0) MCFG_DS75161A_IN_REN_CB(DEVREADLINE(IEEE488_TAG, ieee488_device, ren_r)) @@ -2278,7 +2285,6 @@ static MACHINE_CONFIG_START( p500_pal, p500_state ) MCFG_CBM2_USER_PORT_SP_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, sp_w)) MCFG_CBM2_USER_PORT_CNT_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, cnt_w)) MCFG_CBM2_USER_PORT_FLAG_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w)) - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(MOS6551A_TAG, mos6551_device, write_rxd)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(MOS6551A_TAG, mos6551_device, write_dcd)) @@ -2335,16 +2341,20 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state ) MCFG_PLS100_ADD(PLA1_TAG) MCFG_TPI6525_ADD(MOS6525_1_TAG, tpi1_intf) MCFG_TPI6525_ADD(MOS6525_2_TAG, tpi2_intf) - MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, 0) MCFG_MOS6551_XTAL(XTAL_1_8432MHz) MCFG_MOS6551_IRQ_HANDLER(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w)) MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) - - MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_18MHz/9, 60, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(cbm2_state, cia_pa_r), WRITE8(cbm2_state, cia_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) + MCFG_DEVICE_ADD(MOS6526_TAG, MOS6526A, XTAL_18MHz/9) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(cbm2_state, cia_pa_r)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(cbm2_state, cia_pa_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(cbm2_state, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w)) + MCFG_MOS6526_PC_CALLBACK(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) MCFG_DS75160A_ADD(DS75160A_TAG, DEVREAD8(IEEE488_TAG, ieee488_device, dio_r), DEVWRITE8(IEEE488_TAG, ieee488_device, dio_w)) MCFG_DEVICE_ADD(DS75161A_TAG, DS75161A, 0) MCFG_DS75161A_IN_REN_CB(DEVREADLINE(IEEE488_TAG, ieee488_device, ren_r)) @@ -2374,7 +2384,6 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state ) MCFG_CBM2_USER_PORT_SP_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, sp_w)) MCFG_CBM2_USER_PORT_CNT_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, cnt_w)) MCFG_CBM2_USER_PORT_FLAG_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w)) - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(MOS6551A_TAG, mos6551_device, write_rxd)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(MOS6551A_TAG, mos6551_device, write_dcd)) @@ -2416,11 +2425,8 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( cbm2lp_pal, cbm2lp_ntsc ) MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal) - MCFG_DEVICE_REMOVE(MOS6526_TAG) - MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_17_734472MHz/18, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(cbm2_state, cia_pa_r), WRITE8(cbm2_state, cia_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) + MCFG_DEVICE_MODIFY(MOS6526_TAG) + MCFG_MOS6526_TOD(50) MACHINE_CONFIG_END @@ -2483,10 +2489,12 @@ static MACHINE_CONFIG_DERIVED( bx256hp, b256hp ) MCFG_PIC8259_ADD(EXT_I8259A_TAG, INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0), VCC, NULL) MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf) - MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 60, WRITELINE(cbm2_state, ext_cia_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_device, pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(cbm2_state, ext_cia_pb_r), WRITE8(cbm2_state, ext_cia_pb_w), NULL) + MCFG_DEVICE_ADD(EXT_MOS6526_TAG, MOS6526, XTAL_18MHz/9) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(cbm2_state, ext_cia_irq_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(DEVREAD8(EXT_MOS6525_TAG, tpi6525_device, pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(cbm2_state, ext_cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(cbm2_state, ext_cia_pb_w)) MCFG_SOFTWARE_LIST_ADD("flop_list2", "bx256hp_flop") MACHINE_CONFIG_END @@ -2503,11 +2511,8 @@ static MACHINE_CONFIG_DERIVED( cbm2hp_pal, cbm2hp_ntsc ) MCFG_DEVICE_REMOVE(MOS6525_2_TAG) MCFG_TPI6525_ADD(MOS6525_2_TAG, hp_tpi2_intf) - MCFG_DEVICE_REMOVE(MOS6526_TAG) - MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_18MHz/9, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(cbm2_state, cia_pa_r), WRITE8(cbm2_state, cia_pa_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w)) + MCFG_DEVICE_MODIFY(MOS6526_TAG) + MCFG_MOS6526_TOD(50) MACHINE_CONFIG_END @@ -2542,10 +2547,12 @@ static MACHINE_CONFIG_DERIVED( cbm730, cbm720 ) MCFG_PIC8259_ADD(EXT_I8259A_TAG, INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0), VCC, NULL) MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf) - MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 50, WRITELINE(cbm2_state, ext_cia_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_device, pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(cbm2_state, ext_cia_pb_r), WRITE8(cbm2_state, ext_cia_pb_w), NULL) + MCFG_DEVICE_ADD(EXT_MOS6526_TAG, MOS6526, XTAL_18MHz/9) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(cbm2_state, ext_cia_irq_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(DEVREAD8(EXT_MOS6525_TAG, tpi6525_device, pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(cbm2_state, ext_cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(cbm2_state, ext_cia_pb_w)) MCFG_SOFTWARE_LIST_ADD("flop_list2", "bx256hp_flop") MACHINE_CONFIG_END diff --git a/src/mess/drivers/sbc6510.c b/src/mess/drivers/sbc6510.c index f49e6d975c0..755097014d7 100644 --- a/src/mess/drivers/sbc6510.c +++ b/src/mess/drivers/sbc6510.c @@ -322,9 +322,11 @@ static MACHINE_CONFIG_START( sbc6510, sbc6510_state ) MCFG_SOUND_CONFIG(sbc6510_ay_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_MOS6526_ADD("cia6526", XTAL_1MHz, 50, INPUTLINE("maincpu", M6510_IRQ_LINE)) - MCFG_MOS6526_PORT_A_CALLBACKS(NULL, WRITE8(sbc6510_state, key_w)) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(sbc6510_state, key_r), NULL, NULL) + MCFG_DEVICE_ADD("cia6526", MOS6526, XTAL_1MHz) + MCFG_MOS6526_TOD(50) + MCFG_MOS6526_IRQ_CALLBACK(INPUTLINE("maincpu", M6510_IRQ_LINE)) + MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(sbc6510_state, key_w)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(sbc6510_state, key_r)) MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mess/drivers/vic10.c b/src/mess/drivers/vic10.c index 1bce8448c42..e258d834850 100644 --- a/src/mess/drivers/vic10.c +++ b/src/mess/drivers/vic10.c @@ -631,10 +631,14 @@ static MACHINE_CONFIG_START( vic10, vic10_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) // devices - MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_8MHz/8, 60, WRITELINE(vic10_state, cia_irq_w)) - MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, cnt_w), DEVWRITELINE(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, sp_w)) - MCFG_MOS6526_PORT_A_CALLBACKS(READ8(vic10_state, cia_pa_r), NULL) - MCFG_MOS6526_PORT_B_CALLBACKS(READ8(vic10_state, cia_pb_r), WRITE8(vic10_state, cia_pb_w), NULL) + MCFG_DEVICE_ADD(MOS6526_TAG, MOS6526, XTAL_8MHz/8) + MCFG_MOS6526_TOD(60) + MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(vic10_state, cia_irq_w)) + MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, cnt_w)) + MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, sp_w)) + MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(vic10_state, cia_pa_r)) + MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(vic10_state, cia_pb_r)) + MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(vic10_state, cia_pb_w)) MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w)) MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS6566_TAG, mos6566_device, lp_w))