(MESS) Cleanup. (nw)

This commit is contained in:
Curt Coder 2013-02-22 15:23:05 +00:00
parent 2121b5c40d
commit af96c3b896
18 changed files with 560 additions and 307 deletions

6
.gitattributes vendored
View File

@ -6145,7 +6145,7 @@ src/mess/drivers/pegasus.c svneol=native#text/plain
src/mess/drivers/pencil2.c svneol=native#text/plain src/mess/drivers/pencil2.c svneol=native#text/plain
src/mess/drivers/pentagon.c svneol=native#text/plain src/mess/drivers/pentagon.c svneol=native#text/plain
src/mess/drivers/pes.c svneol=native#text/plain src/mess/drivers/pes.c svneol=native#text/plain
src/mess/drivers/pet2001.c svneol=native#text/plain src/mess/drivers/pet.c svneol=native#text/plain
src/mess/drivers/phc25.c svneol=native#text/plain src/mess/drivers/phc25.c svneol=native#text/plain
src/mess/drivers/phunsy.c svneol=native#text/plain src/mess/drivers/phunsy.c svneol=native#text/plain
src/mess/drivers/pimps.c svneol=native#text/plain src/mess/drivers/pimps.c svneol=native#text/plain
@ -6481,7 +6481,7 @@ src/mess/includes/pcw16.h svneol=native#text/plain
src/mess/includes/pdp1.h svneol=native#text/plain src/mess/includes/pdp1.h svneol=native#text/plain
src/mess/includes/pecom.h svneol=native#text/plain src/mess/includes/pecom.h svneol=native#text/plain
src/mess/includes/pes.h svneol=native#text/plain src/mess/includes/pes.h svneol=native#text/plain
src/mess/includes/pet2001.h svneol=native#text/plain src/mess/includes/pet.h svneol=native#text/plain
src/mess/includes/phc25.h svneol=native#text/plain src/mess/includes/phc25.h svneol=native#text/plain
src/mess/includes/pk8020.h svneol=native#text/plain src/mess/includes/pk8020.h svneol=native#text/plain
src/mess/includes/plus4.h svneol=native#text/plain src/mess/includes/plus4.h svneol=native#text/plain
@ -7388,6 +7388,8 @@ src/mess/machine/pce220_ser.h svneol=native#text/plain
src/mess/machine/pcf8593.c svneol=native#text/plain src/mess/machine/pcf8593.c svneol=native#text/plain
src/mess/machine/pcf8593.h svneol=native#text/plain src/mess/machine/pcf8593.h svneol=native#text/plain
src/mess/machine/pecom.c svneol=native#text/plain src/mess/machine/pecom.c svneol=native#text/plain
src/mess/machine/pet_64k.c svneol=native#text/plain
src/mess/machine/pet_64k.h svneol=native#text/plain
src/mess/machine/petcass.c svneol=native#text/plain src/mess/machine/petcass.c svneol=native#text/plain
src/mess/machine/petcass.h svneol=native#text/plain src/mess/machine/petcass.h svneol=native#text/plain
src/mess/machine/petexp.c svneol=native#text/plain src/mess/machine/petexp.c svneol=native#text/plain

View File

@ -3,7 +3,6 @@
TODO: TODO:
- connect CAPS LOCK to charom A12 on international variants - connect CAPS LOCK to charom A12 on international variants
- expansion DMA
*/ */
@ -1329,21 +1328,6 @@ WRITE_LINE_MEMBER( c128_state::exp_reset_w )
} }
//-------------------------------------------------
// C64_USER_PORT_INTERFACE( user_intf )
//-------------------------------------------------
static C64_USER_PORT_INTERFACE( user_intf )
{
DEVCB_DEVICE_LINE_MEMBER(MOS6526_1_TAG, mos6526_device, sp_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_1_TAG, mos6526_device, cnt_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_2_TAG, mos6526_device, sp_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_2_TAG, mos6526_device, cnt_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_2_TAG, mos6526_device, flag_w),
DEVCB_DRIVER_LINE_MEMBER(c128_state, exp_reset_w)
};
//************************************************************************** //**************************************************************************
// MACHINE INITIALIZATION // MACHINE INITIALIZATION
@ -1398,9 +1382,6 @@ void c128_state::machine_start()
void c128_state::machine_reset() void c128_state::machine_reset()
{ {
m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
m_maincpu->reset(); m_maincpu->reset();
m_reset = 1; m_reset = 1;
@ -1463,7 +1444,6 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w)) MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c128_state, cia2_pa_w)) MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c128_state, cia2_pa_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w)) MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL) 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_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w))
@ -1471,7 +1451,10 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, 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_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_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) MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, NULL, DEVWRITELINE(DEVICE_SELF, c128_state, exp_reset_w))
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
// software list // software list
MCFG_SOFTWARE_LIST_ADD("cart_list_vic10", "vic10") MCFG_SOFTWARE_LIST_ADD("cart_list_vic10", "vic10")
@ -1584,7 +1567,6 @@ static MACHINE_CONFIG_START( pal, c128_state )
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w)) MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c128_state, cia2_pa_w)) MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c128_state, cia2_pa_w))
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w)) MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL) 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_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w))
@ -1592,7 +1574,10 @@ static MACHINE_CONFIG_START( pal, c128_state )
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, 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_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_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) MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, NULL, DEVWRITELINE(DEVICE_SELF, c128_state, exp_reset_w))
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
// software list // software list
MCFG_SOFTWARE_LIST_ADD("cart_list_vic10", "vic10") MCFG_SOFTWARE_LIST_ADD("cart_list_vic10", "vic10")

View File

@ -984,21 +984,6 @@ WRITE_LINE_MEMBER( c64_state::exp_reset_w )
} }
//-------------------------------------------------
// C64_USER_PORT_INTERFACE( user_intf )
//-------------------------------------------------
static C64_USER_PORT_INTERFACE( user_intf )
{
DEVCB_DEVICE_LINE_MEMBER(MOS6526_1_TAG, mos6526_device, sp_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_1_TAG, mos6526_device, cnt_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_2_TAG, mos6526_device, sp_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_2_TAG, mos6526_device, cnt_w),
DEVCB_DEVICE_LINE_MEMBER(MOS6526_2_TAG, mos6526_device, flag_w),
DEVCB_DRIVER_LINE_MEMBER(c64_state, exp_reset_w)
};
//************************************************************************** //**************************************************************************
// MACHINE INITIALIZATION // MACHINE INITIALIZATION
@ -1102,7 +1087,9 @@ static MACHINE_CONFIG_START( ntsc, c64_state )
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, 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_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, read), DEVWRITE8(DEVICE_SELF, c64_state, write), DEVWRITELINE(DEVICE_SELF, c64_state, exp_dma_w)) MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, read), DEVWRITE8(DEVICE_SELF, c64_state, write), 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_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, NULL, DEVWRITELINE(DEVICE_SELF, c64_state, exp_reset_w))
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
// software list // software list
@ -1213,7 +1200,9 @@ static MACHINE_CONFIG_START( pal, c64_state )
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, 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_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, read), DEVWRITE8(DEVICE_SELF, c64_state, write), DEVWRITELINE(DEVICE_SELF, c64_state, exp_dma_w)) MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, read), DEVWRITE8(DEVICE_SELF, c64_state, write), 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_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, NULL, DEVWRITELINE(DEVICE_SELF, c64_state, exp_reset_w))
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
// software list // software list
@ -1302,7 +1291,9 @@ static MACHINE_CONFIG_START( pal_gs, c64gs_state )
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, 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_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, read), DEVWRITE8(DEVICE_SELF, c64_state, write), DEVWRITELINE(DEVICE_SELF, c64_state, exp_dma_w)) MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, read), DEVWRITE8(DEVICE_SELF, c64_state, write), 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_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, NULL, DEVWRITELINE(DEVICE_SELF, c64_state, exp_reset_w))
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
// software list // software list

View File

@ -2403,6 +2403,8 @@ static MACHINE_CONFIG_DERIVED( bx256hp, b256hp )
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_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_porta_r), NULL) //MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_porta_r), NULL)
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL) MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL)
MCFG_SOFTWARE_LIST_ADD("flop_list2", "bx256hp_flop")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -2460,6 +2462,8 @@ static MACHINE_CONFIG_DERIVED( cbm730, cbm720 )
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_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_porta_r), NULL) //MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_porta_r), NULL)
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL) MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL)
MCFG_SOFTWARE_LIST_ADD("flop_list2", "bx256hp_flop")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -150,7 +150,9 @@ ROM sockets: UA3 2K or 4K character
*/ */
#include "includes/pet2001.h" #include "includes/pet.h"
static void cbm_pet_quick_sethiaddress( running_machine &machine, UINT16 hiaddress ) static void cbm_pet_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
{ {
@ -169,6 +171,8 @@ static QUICKLOAD_LOAD( cbm_pet )
return general_cbm_loadsnap(image, file_type, quickload_size, 0, cbm_pet_quick_sethiaddress); return general_cbm_loadsnap(image, file_type, quickload_size, 0, cbm_pet_quick_sethiaddress);
} }
//************************************************************************** //**************************************************************************
// INTERRUPTS // INTERRUPTS
//************************************************************************** //**************************************************************************
@ -1490,6 +1494,10 @@ MACHINE_CONFIG_END
//------------------------------------------------- //-------------------------------------------------
static MACHINE_CONFIG_DERIVED_CLASS( cbm8096, pet80, cbm8096_state ) static MACHINE_CONFIG_DERIVED_CLASS( cbm8096, pet80, cbm8096_state )
MCFG_DEVICE_REMOVE(PET_EXPANSION_SLOT_TAG)
MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_16MHz/16, pet_expansion_cards, "64k", NULL)
MCFG_PET_EXPANSION_SLOT_DMA_CALLBACKS(READ8(pet_state, read), WRITE8(pet_state, write))
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("96K") MCFG_RAM_DEFAULT_SIZE("96K")
@ -1809,10 +1817,10 @@ ROM_START( cbm8296 )
ROM_LOAD( "74s288.uc2", 0x00, 0x20, CRC(06030665) SHA1(19dc91ca49ecc20e66c646ba480d2c3bc70a62e6) ) // video/RAM timing ROM_LOAD( "74s288.uc2", 0x00, 0x20, CRC(06030665) SHA1(19dc91ca49ecc20e66c646ba480d2c3bc70a62e6) ) // video/RAM timing
ROM_REGION( 0xf5, "pla1", 0 ) ROM_REGION( 0xf5, "pla1", 0 )
ROM_LOAD( "324744-01.ue6", 0x00, 0xf5, NO_DUMP ) ROM_LOAD( "324744-01.ue6", 0x00, 0xf5, NO_DUMP ) // 8700-009
ROM_REGION( 0xf5, "pla2", 0 ) ROM_REGION( 0xf5, "pla2", 0 )
ROM_LOAD( "324745-01.ue5", 0x00, 0xf5, NO_DUMP ) ROM_LOAD( "324745-01.ue5", 0x00, 0xf5, NO_DUMP ) // 8700-008
ROM_END ROM_END
@ -1835,10 +1843,10 @@ ROM_START( cbm8296d )
ROM_LOAD( "74s288.uc2", 0x00, 0x20, CRC(06030665) SHA1(19dc91ca49ecc20e66c646ba480d2c3bc70a62e6) ) // video/RAM timing ROM_LOAD( "74s288.uc2", 0x00, 0x20, CRC(06030665) SHA1(19dc91ca49ecc20e66c646ba480d2c3bc70a62e6) ) // video/RAM timing
ROM_REGION( 0xf5, "pla1", 0 ) ROM_REGION( 0xf5, "pla1", 0 )
ROM_LOAD( "324744-01.ue6", 0x00, 0xf5, NO_DUMP ) ROM_LOAD( "324744-01.ue6", 0x00, 0xf5, NO_DUMP ) // 8700-009
ROM_REGION( 0xf5, "pla2", 0 ) ROM_REGION( 0xf5, "pla2", 0 )
ROM_LOAD( "324745-01.ue5", 0x00, 0xf5, NO_DUMP ) ROM_LOAD( "324745-01.ue5", 0x00, 0xf5, NO_DUMP ) // 8700-008
ROM_END ROM_END
@ -1861,10 +1869,10 @@ ROM_START( cbm8296d_de )
ROM_LOAD( "74s288.uc2", 0x00, 0x20, CRC(06030665) SHA1(19dc91ca49ecc20e66c646ba480d2c3bc70a62e6) ) // video/RAM timing ROM_LOAD( "74s288.uc2", 0x00, 0x20, CRC(06030665) SHA1(19dc91ca49ecc20e66c646ba480d2c3bc70a62e6) ) // video/RAM timing
ROM_REGION( 0xf5, "pla1", 0 ) ROM_REGION( 0xf5, "pla1", 0 )
ROM_LOAD( "324744-01.ue6", 0x00, 0xf5, NO_DUMP ) ROM_LOAD( "324744-01.ue6", 0x00, 0xf5, NO_DUMP ) // 8700-009
ROM_REGION( 0xf5, "pla2", 0 ) ROM_REGION( 0xf5, "pla2", 0 )
ROM_LOAD( "324745-01.ue5", 0x00, 0xf5, NO_DUMP ) ROM_LOAD( "324745-01.ue5", 0x00, 0xf5, NO_DUMP ) // 8700-008
ROM_END ROM_END
@ -1899,7 +1907,7 @@ COMP( 1981, cbm8032_se, pet8032, 0, pet8032, petb_se, driver_devic
COMP( 1981, superpet, pet8032, 0, superpet, petb, driver_device, 0, "Commodore Business Machines", "SuperPET SP-9000", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) COMP( 1981, superpet, pet8032, 0, superpet, petb, driver_device, 0, "Commodore Business Machines", "SuperPET SP-9000", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
COMP( 1981, mmf9000, pet8032, 0, superpet, petb, driver_device, 0, "Commodore Business Machines", "MicroMainFrame 9000", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) COMP( 1981, mmf9000, pet8032, 0, superpet, petb, driver_device, 0, "Commodore Business Machines", "MicroMainFrame 9000", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
COMP( 1981, mmf9000_se, pet8032, 0, superpet, petb_se, driver_device, 0, "Commodore Business Machines", "MicroMainFrame 9000 (Sweden/Finland)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) COMP( 1981, mmf9000_se, pet8032, 0, superpet, petb_se, driver_device, 0, "Commodore Business Machines", "MicroMainFrame 9000 (Sweden/Finland)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
COMP( 1981, cbm8096, pet8032, 0, cbm8096, petb, driver_device, 0, "Commodore Business Machines", "CBM 8096", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) COMP( 1981, cbm8096, pet8032, 0, cbm8096, petb, driver_device, 0, "Commodore Business Machines", "CBM 8096", GAME_SUPPORTS_SAVE )
COMP( 1984, cbm8296, 0, 0, cbm8296, petb, driver_device, 0, "Commodore Business Machines", "CBM 8296", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) COMP( 1984, cbm8296, 0, 0, cbm8296, petb, driver_device, 0, "Commodore Business Machines", "CBM 8296", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
COMP( 1984, cbm8296d, cbm8296, 0, cbm8296d, petb, driver_device, 0, "Commodore Business Machines", "CBM 8296D", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) COMP( 1984, cbm8296d, cbm8296, 0, cbm8296d, petb, driver_device, 0, "Commodore Business Machines", "CBM 8296D", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
COMP( 1984, cbm8296d_de,cbm8296, 0, cbm8296d, petb_de, driver_device, 0, "Commodore Business Machines", "CBM 8296D (Germany)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) COMP( 1984, cbm8296d_de,cbm8296, 0, cbm8296d, petb_de, driver_device, 0, "Commodore Business Machines", "CBM 8296D (Germany)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )

View File

@ -450,16 +450,11 @@ WRITE8_MEMBER( vic20_state::via1_pa_w )
m_iec->atn_w(!BIT(data, 7)); m_iec->atn_w(!BIT(data, 7));
} }
READ_LINE_MEMBER( vic20_state::via1_ca1_r )
{
return m_restore->read();
}
static const via6522_interface via1_intf = static const via6522_interface via1_intf =
{ {
DEVCB_DRIVER_MEMBER(vic20_state, via1_pa_r), DEVCB_DRIVER_MEMBER(vic20_state, via1_pa_r),
DEVCB_DEVICE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, pb_r), DEVCB_DEVICE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, pb_r),
DEVCB_DRIVER_LINE_MEMBER(vic20_state, via1_ca1_r), DEVCB_INPUT_PORT("RESTORE"),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
@ -469,7 +464,7 @@ static const via6522_interface via1_intf =
DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb1_w), DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb1_w),
DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, motor_w), DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, motor_w),
DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb2_w), DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb2_w),
DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_NMI) DEVCB_CPU_INPUT_LINE(M6502_TAG, M6502_NMI_LINE)
}; };

View File

@ -5,9 +5,9 @@
#include "emu.h" #include "emu.h"
#include "cpu/m6502/m6502.h" #include "cpu/m6502/m6502.h"
#include "machine/cbm_snqk.h"
#include "machine/6522via.h" #include "machine/6522via.h"
#include "machine/6821pia.h" #include "machine/6821pia.h"
#include "machine/cbm_snqk.h"
#include "machine/cbmipt.h" #include "machine/cbmipt.h"
#include "machine/ieee488.h" #include "machine/ieee488.h"
#include "machine/petcass.h" #include "machine/petcass.h"

View File

@ -99,7 +99,6 @@ public:
DECLARE_READ8_MEMBER( via1_pa_r ); DECLARE_READ8_MEMBER( via1_pa_r );
DECLARE_WRITE8_MEMBER( via1_pa_w ); DECLARE_WRITE8_MEMBER( via1_pa_w );
DECLARE_READ_LINE_MEMBER( via1_ca1_r );
DECLARE_READ8_MEMBER( via2_pa_r ); DECLARE_READ8_MEMBER( via2_pa_r );
DECLARE_READ8_MEMBER( via2_pb_r ); DECLARE_READ8_MEMBER( via2_pb_r );

View File

@ -54,39 +54,17 @@ device_c64_user_port_interface::~device_c64_user_port_interface()
c64_user_port_device::c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : c64_user_port_device::c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, C64_USER_PORT, "C64 user port", tag, owner, clock), device_t(mconfig, C64_USER_PORT, "C64 user port", tag, owner, clock),
device_slot_interface(mconfig, *this) device_slot_interface(mconfig, *this),
m_write_cnt1(*this),
m_write_sp1(*this),
m_write_cnt2(*this),
m_write_sp2(*this),
m_write_flag2(*this),
m_write_reset(*this)
{ {
} }
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void c64_user_port_device::device_config_complete()
{
// inherit a copy of the static data
const c64_user_port_interface *intf = reinterpret_cast<const c64_user_port_interface *>(static_config());
if (intf != NULL)
{
*static_cast<c64_user_port_interface *>(this) = *intf;
}
// or initialize to defaults if none provided
else
{
memset(&m_out_cnt1_cb, 0, sizeof(m_out_cnt1_cb));
memset(&m_out_sp1_cb, 0, sizeof(m_out_sp1_cb));
memset(&m_out_cnt2_cb, 0, sizeof(m_out_cnt2_cb));
memset(&m_out_sp2_cb, 0, sizeof(m_out_sp2_cb));
memset(&m_out_flag2_cb, 0, sizeof(m_out_flag2_cb));
memset(&m_out_reset_cb, 0, sizeof(m_out_reset_cb));
}
}
//------------------------------------------------- //-------------------------------------------------
// device_start - device-specific startup // device_start - device-specific startup
//------------------------------------------------- //-------------------------------------------------
@ -96,12 +74,12 @@ void c64_user_port_device::device_start()
m_card = dynamic_cast<device_c64_user_port_interface *>(get_card_device()); m_card = dynamic_cast<device_c64_user_port_interface *>(get_card_device());
// resolve callbacks // resolve callbacks
m_out_cnt1_func.resolve(m_out_cnt1_cb, *this); m_write_cnt1.resolve_safe();
m_out_sp1_func.resolve(m_out_sp1_cb, *this); m_write_sp1.resolve_safe();
m_out_cnt2_func.resolve(m_out_cnt2_cb, *this); m_write_cnt2.resolve_safe();
m_out_sp2_func.resolve(m_out_sp2_cb, *this); m_write_sp2.resolve_safe();
m_out_flag2_func.resolve(m_out_flag2_cb, *this); m_write_flag2.resolve_safe();
m_out_reset_func.resolve(m_out_reset_cb, *this); m_write_reset.resolve_safe();
} }

View File

@ -43,46 +43,48 @@
// INTERFACE CONFIGURATION MACROS // INTERFACE CONFIGURATION MACROS
//************************************************************************** //**************************************************************************
#define C64_USER_PORT_INTERFACE(_name) \ #define MCFG_C64_USER_PORT_ADD(_tag, _slot_intf, _def_slot, _def_inp, _reset) \
const c64_user_port_interface (_name) =
#define MCFG_C64_USER_PORT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \
MCFG_DEVICE_ADD(_tag, C64_USER_PORT, 0) \ MCFG_DEVICE_ADD(_tag, C64_USER_PORT, 0) \
MCFG_DEVICE_CONFIG(_config) \ downcast<c64_user_port_device *>(device)->set_reset_callback(DEVCB2_##_reset); \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
#define MCFG_C64_USER_PORT_CIA1_CALLBACKS(_cnt, _sp) \
downcast<c64_user_port_device *>(device)->set_cia1_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp);
#define MCFG_C64_USER_PORT_CIA2_CALLBACKS(_cnt, _sp, _flag) \
downcast<c64_user_port_device *>(device)->set_cia2_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp, DEVCB2_##_flag);
//************************************************************************** //**************************************************************************
// TYPE DEFINITIONS // TYPE DEFINITIONS
//************************************************************************** //**************************************************************************
// ======================> c64_user_port_interface
struct c64_user_port_interface
{
devcb_write_line m_out_cnt1_cb;
devcb_write_line m_out_sp1_cb;
devcb_write_line m_out_cnt2_cb;
devcb_write_line m_out_sp2_cb;
devcb_write_line m_out_flag2_cb;
devcb_write_line m_out_reset_cb;
};
// ======================> c64_user_port_device // ======================> c64_user_port_device
class device_c64_user_port_interface; class device_c64_user_port_interface;
class c64_user_port_device : public device_t, class c64_user_port_device : public device_t,
public c64_user_port_interface,
public device_slot_interface public device_slot_interface
{ {
public: public:
// construction/destruction // construction/destruction
c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _reset> void set_reset_callback(_reset reset) { m_write_reset.set_callback(reset); }
template<class _cnt, class _sp> void set_cia1_callbacks(_cnt cnt, _sp sp) {
m_write_cnt1.set_callback(cnt);
m_write_sp1.set_callback(sp);
}
template<class _cnt, class _sp, class _flag> void set_cia2_callbacks(_cnt cnt, _sp sp, _flag flag) {
m_write_cnt2.set_callback(cnt);
m_write_sp2.set_callback(sp);
m_write_flag2.set_callback(flag);
}
// computer interface // computer interface
DECLARE_READ8_MEMBER( pb_r ); DECLARE_READ8_MEMBER( pb_r );
DECLARE_WRITE8_MEMBER( pb_w ); DECLARE_WRITE8_MEMBER( pb_w );
@ -96,25 +98,24 @@ public:
DECLARE_WRITE_LINE_MEMBER( sp2_w ); DECLARE_WRITE_LINE_MEMBER( sp2_w );
// cartridge interface // cartridge interface
DECLARE_WRITE_LINE_MEMBER( cia_cnt1_w ) { m_out_cnt1_func(state); } DECLARE_WRITE_LINE_MEMBER( cia_cnt1_w ) { m_write_cnt1(state); }
DECLARE_WRITE_LINE_MEMBER( cia_sp1_w ) { m_out_sp1_func(state); } DECLARE_WRITE_LINE_MEMBER( cia_sp1_w ) { m_write_sp1(state); }
DECLARE_WRITE_LINE_MEMBER( cia_cnt2_w ) { m_out_cnt2_func(state); } DECLARE_WRITE_LINE_MEMBER( cia_cnt2_w ) { m_write_cnt2(state); }
DECLARE_WRITE_LINE_MEMBER( cia_sp2_w ) { m_out_sp2_func(state); } DECLARE_WRITE_LINE_MEMBER( cia_sp2_w ) { m_write_sp2(state); }
DECLARE_WRITE_LINE_MEMBER( cia_flag2_w ) { m_out_flag2_func(state); } DECLARE_WRITE_LINE_MEMBER( cia_flag2_w ) { m_write_flag2(state); }
DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_out_reset_func(state); } DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_write_reset(state); }
protected: protected:
// device-level overrides // device-level overrides
virtual void device_config_complete();
virtual void device_start(); virtual void device_start();
virtual void device_reset(); virtual void device_reset();
devcb_resolved_write_line m_out_cnt1_func; devcb2_write_line m_write_cnt1;
devcb_resolved_write_line m_out_sp1_func; devcb2_write_line m_write_sp1;
devcb_resolved_write_line m_out_cnt2_func; devcb2_write_line m_write_cnt2;
devcb_resolved_write_line m_out_sp2_func; devcb2_write_line m_write_sp2;
devcb_resolved_write_line m_out_flag2_func; devcb2_write_line m_write_flag2;
devcb_resolved_write_line m_out_reset_func; devcb2_write_line m_write_reset;
device_c64_user_port_interface *m_card; device_c64_user_port_interface *m_card;
}; };

View File

@ -1024,7 +1024,7 @@ INPUT_PORTS_START( vic_special )
INPUT_PORTS_END INPUT_PORTS_END
SLOT_INTERFACE_START( pet_expansion_cards ) SLOT_INTERFACE_START( pet_expansion_cards )
//SLOT_INTERFACE("64k", PET_64K) SLOT_INTERFACE("64k", PET_64K)
SLOT_INTERFACE("superpet", SUPERPET) SLOT_INTERFACE("superpet", SUPERPET)
SLOT_INTERFACE_END SLOT_INTERFACE_END

View File

@ -90,6 +90,7 @@
#include "machine/diag264_lb_user.h" #include "machine/diag264_lb_user.h"
#include "machine/fd2000.h" #include "machine/fd2000.h"
#include "machine/interpod.h" #include "machine/interpod.h"
#include "machine/pet_64k.h"
#include "machine/plus4_sid.h" #include "machine/plus4_sid.h"
#include "machine/plus4_std.h" #include "machine/plus4_std.h"
#include "machine/serialbox.h" #include "machine/serialbox.h"

201
src/mess/machine/pet_64k.c Normal file
View File

@ -0,0 +1,201 @@
/**********************************************************************
Commodore PET 64KB RAM Expansion emulation
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
**********************************************************************/
#include "pet_64k.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type PET_64K = &device_creator<pet_64k_expansion_device>;
//**************************************************************************
// INLINE HELPERS
//**************************************************************************
//-------------------------------------------------
// read_ram -
//-------------------------------------------------
inline UINT8 pet_64k_expansion_device::read_ram(offs_t offset)
{
UINT8 data = 0;
if (offset < 0xc000)
{
data = m_ram[(BIT(m_ctrl, 2) << 14) | (offset & 0x3fff)];
}
else
{
data = m_ram[0x8000 | (BIT(m_ctrl, 3) << 14) | (offset & 0x3fff)];
}
return data;
}
//-------------------------------------------------
// write_ram -
//-------------------------------------------------
inline void pet_64k_expansion_device::write_ram(offs_t offset, UINT8 data)
{
if (offset < 0xc000)
{
if (!BIT(m_ctrl, 0))
{
m_ram[(BIT(m_ctrl, 2) << 14) | (offset & 0x3fff)] = data;
}
}
else
{
if (!BIT(m_ctrl, 1))
{
m_ram[0x8000 | (BIT(m_ctrl, 3) << 14) | (offset & 0x3fff)] = data;
}
}
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// pet_64k_expansion_device - constructor
//-------------------------------------------------
pet_64k_expansion_device::pet_64k_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, PET_64K, "PET 64KB RAM", tag, owner, clock),
device_pet_expansion_card_interface(mconfig, *this),
m_ram(*this, "ram"),
m_ctrl(0)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pet_64k_expansion_device::device_start()
{
// allocate memory
m_ram.allocate(0x10000);
// state saving
save_item(NAME(m_ctrl));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void pet_64k_expansion_device::device_reset()
{
m_ctrl = 0;
}
//-------------------------------------------------
// pet_norom_r - NO ROM read
//-------------------------------------------------
int pet_64k_expansion_device::pet_norom_r(address_space &space, offs_t offset, int sel)
{
return !BIT(m_ctrl, 7);
}
//-------------------------------------------------
// pet_bd_r - buffered data read
//-------------------------------------------------
UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int sel)
{
if (BIT(m_ctrl, 7))
{
switch (sel)
{
case pet_expansion_slot_device::SEL8:
if (!BIT(m_ctrl, 5))
{
data = read_ram(offset);
}
break;
case pet_expansion_slot_device::SELE:
if (!BIT(m_ctrl, 6) || !BIT(offset, 11))
{
data = read_ram(offset);
}
break;
case pet_expansion_slot_device::SEL9:
case pet_expansion_slot_device::SELA:
case pet_expansion_slot_device::SELB:
case pet_expansion_slot_device::SELC:
case pet_expansion_slot_device::SELD:
case pet_expansion_slot_device::SELF:
data = read_ram(offset);
break;
}
}
return data;
}
//-------------------------------------------------
// pet_bd_w - buffered data write
//-------------------------------------------------
void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int sel)
{
if (BIT(m_ctrl, 7))
{
switch (sel)
{
case pet_expansion_slot_device::SEL8:
if (!BIT(m_ctrl, 5))
{
write_ram(offset, data);
}
break;
case pet_expansion_slot_device::SELE:
if (!BIT(m_ctrl, 6) || !BIT(offset, 11))
{
write_ram(offset, data);
}
break;
case pet_expansion_slot_device::SEL9:
case pet_expansion_slot_device::SELA:
case pet_expansion_slot_device::SELB:
case pet_expansion_slot_device::SELC:
case pet_expansion_slot_device::SELD:
case pet_expansion_slot_device::SELF:
write_ram(offset, data);
break;
}
}
if (offset == 0xfff0)
{
printf("CTRL %02x\n", data);
m_ctrl = data;
}
}

View File

@ -0,0 +1,58 @@
/**********************************************************************
Commodore PET 64KB RAM Expansion emulation
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
**********************************************************************/
#pragma once
#ifndef __PET_64K__
#define __PET_64K__
#include "emu.h"
#include "machine/petexp.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> pet_64k_expansion_device
class pet_64k_expansion_device : public device_t,
public device_pet_expansion_card_interface
{
public:
// construction/destruction
pet_64k_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_config_complete() { m_shortname = "pet_64k"; }
virtual void device_start();
virtual void device_reset();
// device_pet_expansion_card_interface overrides
virtual int pet_norom_r(address_space &space, offs_t offset, int sel);
virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int sel);
virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int sel);
private:
inline UINT8 read_ram(offs_t offset);
inline void write_ram(offs_t offset, UINT8 data);
optional_shared_ptr<UINT8> m_ram;
UINT8 m_ctrl;
};
// device type definition
extern const device_type PET_64K;
#endif

View File

@ -73,6 +73,26 @@ public:
void dma_bd_w(offs_t offset, UINT8 data); void dma_bd_w(offs_t offset, UINT8 data);
int phi2(); int phi2();
enum
{
SEL0 = 0,
SEL1,
SEL2,
SEL3,
SEL4,
SEL5,
SEL6,
SEL7,
SEL8,
SEL9,
SELA,
SELB,
SELC,
SELD,
SELE,
SELF
};
protected: protected:
// device-level overrides // device-level overrides
virtual void device_start(); virtual void device_start();

View File

@ -111,8 +111,16 @@ machine_config_constructor superpet_device::device_mconfig_additions() const
static INPUT_PORTS_START( superpet ) static INPUT_PORTS_START( superpet )
PORT_START("SW1") PORT_START("SW1")
PORT_DIPNAME( 0x03, 0x02, "RAM" )
PORT_DIPSETTING( 0x00, "Read Only" )
PORT_DIPSETTING( 0x01, "Read/Write" )
PORT_DIPSETTING( 0x02, "System Port" )
PORT_START("SW2") PORT_START("SW2")
PORT_DIPNAME( 0x03, 0x02, "CPU" )
PORT_DIPSETTING( 0x00, "6809" )
PORT_DIPSETTING( 0x01, "6502" )
PORT_DIPSETTING( 0x02, "System Port" )
INPUT_PORTS_END INPUT_PORTS_END
@ -135,8 +143,10 @@ ioport_constructor superpet_device::device_input_ports() const
// update_cpu - // update_cpu -
//------------------------------------------------- //-------------------------------------------------
inline void superpet_device::update_cpu(int cpu) inline void superpet_device::update_cpu()
{ {
int cpu = (m_sw2 == 2) ? BIT(m_system, 0) : m_sw2;
if (cpu) if (cpu)
{ {
// 6502 active // 6502 active
@ -152,6 +162,16 @@ inline void superpet_device::update_cpu(int cpu)
} }
//-------------------------------------------------
// is_ram_writable -
//-------------------------------------------------
inline bool superpet_device::is_ram_writable()
{
return (m_sw1 == 2) ? BIT(m_system, 1) : m_sw1;
}
//************************************************************************** //**************************************************************************
// LIVE DEVICE // LIVE DEVICE
@ -169,8 +189,8 @@ superpet_device::superpet_device(const machine_config &mconfig, const char *tag,
m_dongle(*this, MOS6702_TAG), m_dongle(*this, MOS6702_TAG),
m_rom(*this, M6809_TAG), m_rom(*this, M6809_TAG),
m_ram(*this, "ram"), m_ram(*this, "ram"),
m_sw1(*this, "SW1"), m_io_sw1(*this, "SW1"),
m_sw2(*this, "SW2"), m_io_sw2(*this, "SW2"),
m_system(0), m_system(0),
m_bank(0), m_bank(0),
m_sel9_rom(0), m_sel9_rom(0),
@ -209,8 +229,10 @@ void superpet_device::device_reset()
m_system = 0; m_system = 0;
m_bank = 0; m_bank = 0;
m_sel9_rom = 0; m_sel9_rom = 0;
m_sw1 = m_io_sw1->read();
m_sw2 = m_io_sw2->read();
update_cpu(BIT(m_system, 0)); update_cpu();
} }
@ -234,7 +256,7 @@ UINT8 superpet_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data,
switch (sel) switch (sel)
{ {
case SEL9: case pet_expansion_slot_device::SEL9:
if (m_sel9_rom) if (m_sel9_rom)
{ {
data = m_rom->base()[offset - 0x9000]; data = m_rom->base()[offset - 0x9000];
@ -245,14 +267,18 @@ UINT8 superpet_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data,
} }
break; break;
case SELA: case SELB: case SELC: case SELD: case SELF: case pet_expansion_slot_device::SELA:
case pet_expansion_slot_device::SELB:
case pet_expansion_slot_device::SELC:
case pet_expansion_slot_device::SELD:
case pet_expansion_slot_device::SELF:
if (!norom) if (!norom)
{ {
data = m_rom->base()[offset - 0x9000]; data = m_rom->base()[offset - 0x9000];
} }
break; break;
case SELE: case pet_expansion_slot_device::SELE:
if (!norom && !BIT(offset, 11)) if (!norom && !BIT(offset, 11))
{ {
data = m_rom->base()[offset - 0x9000]; data = m_rom->base()[offset - 0x9000];
@ -289,8 +315,8 @@ void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data,
{ {
switch (sel) switch (sel)
{ {
case SEL9: case pet_expansion_slot_device::SEL9:
if (!m_sel9_rom && BIT(m_system, 1)) if (!m_sel9_rom && is_ram_writable())
{ {
m_ram[((m_bank & 0x0f) << 12) | (offset & 0xfff)] = data; m_ram[((m_bank & 0x0f) << 12) | (offset & 0xfff)] = data;
} }
@ -334,7 +360,7 @@ void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data,
*/ */
m_system = data; m_system = data;
update_cpu(BIT(m_system, 0)); update_cpu();
printf("SYSTEM %02x\n", data); printf("SYSTEM %02x\n", data);
} }
break; break;

View File

@ -57,39 +57,22 @@ protected:
virtual int pet_diag_r(); virtual int pet_diag_r();
virtual void pet_irq_w(int state); virtual void pet_irq_w(int state);
enum
{
SEL0 = 0,
SEL1,
SEL2,
SEL3,
SEL4,
SEL5,
SEL6,
SEL7,
SEL8,
SEL9,
SELA,
SELB,
SELC,
SELD,
SELE,
SELF
};
private: private:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<mos6551_device> m_acia; required_device<mos6551_device> m_acia;
required_device<mos6702_device> m_dongle; required_device<mos6702_device> m_dongle;
required_memory_region m_rom; required_memory_region m_rom;
optional_shared_ptr<UINT8> m_ram; optional_shared_ptr<UINT8> m_ram;
required_ioport m_sw1; required_ioport m_io_sw1;
required_ioport m_sw2; required_ioport m_io_sw2;
inline void update_cpu(int cpu); inline void update_cpu();
inline bool is_ram_writable();
UINT8 m_system; UINT8 m_system;
UINT8 m_bank; UINT8 m_bank;
UINT8 m_sw1;
UINT8 m_sw2;
int m_sel9_rom; int m_sel9_rom;
int m_pet_irq; int m_pet_irq;
int m_acia_irq; int m_acia_irq;

View File

@ -821,10 +821,11 @@ $(MESSOBJ)/casio.a: \
$(MESS_VIDEO)/hd44352.o \ $(MESS_VIDEO)/hd44352.o \
$(MESSOBJ)/cbm.a: \ $(MESSOBJ)/cbm.a: \
$(MESS_DRIVERS)/pet2001.o \ $(MESS_DRIVERS)/pet.o \
$(MESS_MACHINE)/petcass.o \ $(MESS_MACHINE)/petcass.o \
$(MESS_MACHINE)/petexp.o \ $(MESS_MACHINE)/petexp.o \
$(MESS_MACHINE)/petuser.o \ $(MESS_MACHINE)/petuser.o \
$(MESS_MACHINE)/pet_64k.o \
$(MESS_MACHINE)/superpet.o \ $(MESS_MACHINE)/superpet.o \
$(MESS_MACHINE)/mos6702.o \ $(MESS_MACHINE)/mos6702.o \
$(MESS_DRIVERS)/c64.o \ $(MESS_DRIVERS)/c64.o \