From f42533c206d8c5a4a8122075931f3fedd15fd9df Mon Sep 17 00:00:00 2001 From: cracyc Date: Fri, 10 May 2013 22:38:58 +0000 Subject: [PATCH] (mess) slotify pc joystick [Carl] (mess) asst128 toggles tc in the dor (nw) -- The asst128 still doesn't boot though it does run the boot sector now. It seems to skip every other cylinder. --- src/mess/drivers/amstr_pc.c | 8 ++-- src/mess/drivers/pc.c | 64 ++++++++++++++++++--------- src/mess/includes/pc.h | 1 + src/mess/machine/isa_sblaster.c | 12 +++--- src/mess/machine/isa_ssi2001.c | 6 +-- src/mess/machine/isa_stereo_fx.c | 6 +-- src/mess/machine/pc.c | 7 +++ src/mess/machine/pc_joy.c | 74 +++++++++++++++++++------------- src/mess/machine/pc_joy.h | 49 ++++++++++++++++++--- 9 files changed, 154 insertions(+), 73 deletions(-) diff --git a/src/mess/drivers/amstr_pc.c b/src/mess/drivers/amstr_pc.c index 289c3d1ae51..384f3289ef9 100644 --- a/src/mess/drivers/amstr_pc.c +++ b/src/mess/drivers/amstr_pc.c @@ -87,7 +87,7 @@ static ADDRESS_MAP_START(ppc512_io, AS_IO, 16, amstrad_pc_state ) AM_RANGE(0x0078, 0x0079) AM_READWRITE8(pc1640_mouse_x_r, pc1640_mouse_x_w, 0xffff) AM_RANGE(0x007a, 0x007b) AM_READWRITE8(pc1640_mouse_y_r, pc1640_mouse_y_w, 0xffff) AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("pc_joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) AM_RANGE(0x0278, 0x027b) AM_READ8(pc200_port278_r, 0xffff) AM_DEVWRITE8_LEGACY("lpt_2", pc_lpt_w, 0x00ff) AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) @@ -115,7 +115,7 @@ static ADDRESS_MAP_START(pc200_io, AS_IO, 16, amstrad_pc_state ) AM_RANGE(0x0078, 0x0079) AM_READWRITE8(pc1640_mouse_x_r, pc1640_mouse_x_w, 0xffff) AM_RANGE(0x007a, 0x007b) AM_READWRITE8(pc1640_mouse_y_r, pc1640_mouse_y_w, 0xffff) AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("pc_joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) AM_RANGE(0x0278, 0x027b) AM_READ8(pc200_port278_r, 0xffff) AM_DEVWRITE8_LEGACY("lpt_2", pc_lpt_w, 0x00ff) AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) @@ -297,7 +297,7 @@ static MACHINE_CONFIG_START( pc200, amstrad_pc_state ) MCFG_PC_FDC_XT_ADD("fdc") - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) @@ -370,7 +370,7 @@ static MACHINE_CONFIG_START( ppc512, amstrad_pc_state ) MCFG_PC_FDC_XT_ADD("fdc") - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) diff --git a/src/mess/drivers/pc.c b/src/mess/drivers/pc.c index 56c72046fdf..e2f08daa498 100644 --- a/src/mess/drivers/pc.c +++ b/src/mess/drivers/pc.c @@ -194,7 +194,7 @@ static ADDRESS_MAP_START(pc8_io, AS_IO, 8, pc_state ) AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE("ppi8255", i8255_device, read, write) AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) AM_RANGE(0x00a0, 0x00a0) AM_WRITE(pc_nmi_enable_w ) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("pc_joy", pc_joy_device, joy_port_r, joy_port_w) AM_RANGE(0x0240, 0x0257) AM_READWRITE(pc_rtc_r, pc_rtc_w) AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w) AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE("ins8250_3", ins8250_device, ins8250_r, ins8250_w) @@ -220,7 +220,7 @@ static ADDRESS_MAP_START(pc16_io, AS_IO, 16, pc_state ) AM_RANGE(0x0070, 0x007f) AM_RAM // needed for Poisk-2 AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) AM_RANGE(0x00a0, 0x00a1) AM_WRITE8(pc_nmi_enable_w, 0x00ff ) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("pc_joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) AM_RANGE(0x0240, 0x0257) AM_READWRITE8(pc_rtc_r, pc_rtc_w, 0xffff) AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE8_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w, 0xffff) AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) @@ -274,6 +274,25 @@ static ADDRESS_MAP_START(iskr1031_io, AS_IO, 16, pc_state) AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff) ADDRESS_MAP_END +static ADDRESS_MAP_START(asst128_io, AS_IO, 16, pc_state) + ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE8("dma8237", am9517a_device, read, write, 0xffff) + AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE8_LEGACY("pic8259", pic8259_r, pic8259_w, 0xffff) + AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8_LEGACY("pit8253", pit8253_r, pit8253_w, 0xffff) + AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE8("ppi8255", i8255_device, read, write, 0xffff) + AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) + AM_RANGE(0x00a0, 0x00a1) AM_WRITE8( pc_nmi_enable_w, 0x00ff ) +// AM_RANGE(0x0200, 0x0207) AM_READWRITE8_LEGACY(pc_JOY_r, pc_JOY_w, 0xffff) + AM_RANGE(0x0240, 0x0257) AM_READWRITE8(pc_rtc_r, pc_rtc_w, 0xffff) +// AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) + AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) + AM_RANGE(0x0340, 0x0357) AM_NOP /* anonymous bios should not recogniced realtimeclock */ + AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff) +// AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8("ins8250_2", ins8250_device, ins8250_r, ins8250_w, 0xffff) + AM_RANGE(0x03f2, 0x03f3) AM_WRITE8(asst128_fdc_dor_w, 0xffff) + AM_RANGE(0x03f4, 0x03f5) AM_DEVICE8("fdc:upd765", upd765a_device, map, 0xffff) + AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff) +ADDRESS_MAP_END static ADDRESS_MAP_START( ibm5550_map, AS_PROGRAM, 16, pc_state ) ADDRESS_MAP_UNMAP_HIGH @@ -295,7 +314,7 @@ static ADDRESS_MAP_START(ibm5550_io, AS_IO, 16, pc_state ) AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE8("ppi8255", i8255_device, read, write, 0xffff) AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) AM_RANGE(0x00a0, 0x00a1) AM_READWRITE8(unk_r, pc_nmi_enable_w, 0x00ff ) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("pc_joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) AM_RANGE(0x0240, 0x0257) AM_READWRITE8(pc_rtc_r, pc_rtc_w, 0xffff) AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE8_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w, 0xffff) AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) @@ -326,7 +345,7 @@ static ADDRESS_MAP_START(europc_io, AS_IO, 8, europc_pc_state ) AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE_LEGACY("pit8253", pit8253_r, pit8253_w) AM_RANGE(0x0060, 0x0063) AM_READWRITE(europc_pio_r, europc_pio_w) AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("pc_joy", pc_joy_device, joy_port_r, joy_port_w) AM_RANGE(0x0250, 0x025f) AM_READWRITE(europc_jim_r, europc_jim_w) AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w) AM_RANGE(0x02e0, 0x02e0) AM_READ(europc_jim2_r) @@ -361,7 +380,7 @@ static ADDRESS_MAP_START(tandy1000_io, AS_IO, 8, tandy_pc_state ) AM_RANGE(0x0060, 0x0063) AM_READWRITE(tandy1000_pio_r, tandy1000_pio_w) AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) AM_RANGE(0x00c0, 0x00c0) AM_DEVWRITE("sn76496", ncr7496_device, write) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("pc_joy", pc_joy_device, joy_port_r, joy_port_w) AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE("ins8250_1", ins8250_device, ins8250_r, ins8250_w) AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc_t1t_p37x_r, pc_t1t_p37x_w) AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w) @@ -391,7 +410,7 @@ static ADDRESS_MAP_START(tandy1000_16_io, AS_IO, 16, tandy_pc_state ) AM_RANGE(0x0060, 0x0063) AM_READWRITE8(tandy1000_pio_r, tandy1000_pio_w, 0xffff) AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) AM_RANGE(0x00c0, 0x00c1) AM_DEVWRITE8("sn76496", ncr7496_device, write, 0xffff) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("pc_joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) AM_RANGE(0x0378, 0x037f) AM_READWRITE8(pc_t1t_p37x_r, pc_t1t_p37x_w, 0xffff) AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff) @@ -423,7 +442,7 @@ static ADDRESS_MAP_START(tandy1000_286_io, AS_IO, 16, tandy_pc_state ) AM_RANGE(0x0060, 0x0063) AM_READWRITE8(tandy1000_pio_r, tandy1000_pio_w, 0xffff) AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) AM_RANGE(0x00c0, 0x00c1) AM_DEVWRITE8("sn76496", ncr7496_device, write, 0xffff) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("pc_joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) AM_RANGE(0x0378, 0x037f) AM_READWRITE8(pc_t1t_p37x_r, pc_t1t_p37x_w, 0xffff) AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff) @@ -455,7 +474,7 @@ static ADDRESS_MAP_START(ibmpcjr_io, AS_IO, 8, tandy_pc_state ) AM_RANGE(0x00c0, 0x00c0) AM_DEVWRITE("sn76496", sn76496_device, write) AM_RANGE(0x00f2, 0x00f2) AM_WRITE(pcjr_fdc_dor_w) AM_RANGE(0x00f4, 0x00f5) AM_DEVICE("upd765", upd765a_device, map) - AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) + AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("pc_joy", pc_joy_device, joy_port_r, joy_port_w) AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE("ins8250_1", ins8250_device, ins8250_r, ins8250_w) AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc_t1t_p37x_r, pc_t1t_p37x_w) AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w) @@ -994,7 +1013,7 @@ static MACHINE_CONFIG_START( pccga, pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") @@ -1060,7 +1079,7 @@ static MACHINE_CONFIG_START( europc, europc_pc_state ) MCFG_RS232_PORT_ADD( "serport1", ibm5150_serport_config[1], ibm5150_com, NULL, NULL ) MCFG_RS232_PORT_ADD( "serport2", ibm5150_serport_config[2], ibm5150_com, NULL, NULL ) MCFG_RS232_PORT_ADD( "serport3", ibm5150_serport_config[3], ibm5150_com, NULL, NULL ) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") /* video hardware */ MCFG_FRAGMENT_ADD( pcvideo_aga ) @@ -1127,7 +1146,7 @@ static MACHINE_CONFIG_START( t1000hx, tandy_pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") @@ -1181,7 +1200,7 @@ static MACHINE_CONFIG_START( t1000_16, tandy_pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "35dd", 0, pc_state::floppy_formats) @@ -1230,7 +1249,7 @@ static MACHINE_CONFIG_START( t1000_286, tandy_pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "35dd", 0, pc_state::floppy_formats) @@ -1299,7 +1318,7 @@ static MACHINE_CONFIG_START( ibmpcjr, tandy_pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") /* cassette */ MCFG_CASSETTE_ADD( "cassette", ibm5150_cassette_interface ) @@ -1499,6 +1518,11 @@ static MACHINE_CONFIG_START( iskr1031, pc_state ) MCFG_RAM_DEFAULT_SIZE("640K") MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( asst128, iskr1031 ) + MCFG_CPU_REPLACE("maincpu", I8086, 4772720) + MCFG_CPU_PROGRAM_MAP(iskr1031_map) + MCFG_CPU_IO_MAP(asst128_io) +MACHINE_CONFIG_END static MACHINE_CONFIG_START( iskr3104, pc_state ) /* basic machine hardware */ @@ -1542,7 +1566,7 @@ static MACHINE_CONFIG_START( iskr3104, pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") @@ -1598,7 +1622,7 @@ static MACHINE_CONFIG_START( poisk2, pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") @@ -1653,7 +1677,7 @@ static MACHINE_CONFIG_START( zenith, pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") @@ -1708,7 +1732,7 @@ static MACHINE_CONFIG_START( olivetti, pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") @@ -1763,7 +1787,7 @@ static MACHINE_CONFIG_START( ibm5550, pc_state ) MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_PC_FDC_XT_ADD("fdc") @@ -2366,7 +2390,7 @@ COMP( 1989, t1000tl2, ibm5150, 0, t1000_286, tandy1t, pc_state, COMP( 1989, iskr1031, ibm5150, 0, iskr1031, pccga, pc_state, pccga, "Schetmash", "Iskra 1031", GAME_NOT_WORKING) COMP( 1989, iskr1030m, ibm5150, 0, iskr1031, pccga, pc_state, pccga, "Schetmash", "Iskra 1030M", GAME_NOT_WORKING) COMP( 1992, iskr3104, ibm5150, 0, iskr3104, pcega, pc_state, pccga, "Schetmash", "Iskra 3104", GAME_NOT_WORKING) -COMP( 198?, asst128, ibm5150, 0, iskr1031, pccga, pc_state, pccga, "Schetmash", "Assistent 128", GAME_NOT_WORKING) +COMP( 198?, asst128, ibm5150, 0, asst128, pccga, pc_state, pccga, "Schetmash", "Assistent 128", GAME_NOT_WORKING) COMP( 1987, ec1840, ibm5150, 0, iskr1031, pccga, pc_state, pccga, "", "EC-1840", GAME_NOT_WORKING) COMP( 1987, ec1841, ibm5150, 0, ec1841, pccga, pc_state, pccga, "", "EC-1841", GAME_NOT_WORKING) COMP( 1989, ec1845, ibm5150, 0, iskr1031, pccga, pc_state, pccga, "", "EC-1845", GAME_NOT_WORKING) diff --git a/src/mess/includes/pc.h b/src/mess/includes/pc.h index 810590b6f77..0ec37c4330e 100644 --- a/src/mess/includes/pc.h +++ b/src/mess/includes/pc.h @@ -141,6 +141,7 @@ public: DECLARE_WRITE8_MEMBER(pcjr_fdc_dor_w); DECLARE_READ8_MEMBER(pcjx_port_1ff_r); DECLARE_WRITE8_MEMBER(pcjx_port_1ff_w); + DECLARE_WRITE8_MEMBER(asst128_fdc_dor_w); void pcjx_set_bank(int unk1, int unk2, int unk3); void fdc_interrupt(bool state); diff --git a/src/mess/machine/isa_sblaster.c b/src/mess/machine/isa_sblaster.c index 714aea530de..87112b44c6f 100644 --- a/src/mess/machine/isa_sblaster.c +++ b/src/mess/machine/isa_sblaster.c @@ -107,7 +107,7 @@ static MACHINE_CONFIG_FRAGMENT( sblaster1_0_config ) MCFG_SOUND_ADD("sbdacr", DAC, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) MACHINE_CONFIG_END @@ -125,7 +125,7 @@ static MACHINE_CONFIG_FRAGMENT( sblaster1_5_config ) MCFG_SOUND_ADD("sbdacr", DAC, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) MACHINE_CONFIG_END @@ -143,7 +143,7 @@ static MACHINE_CONFIG_FRAGMENT( sblaster_16_config ) MCFG_SOUND_ADD("sbdacr", DAC, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL) MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL) MACHINE_CONFIG_END @@ -1122,7 +1122,7 @@ sb_device::sb_device(const machine_config &mconfig, device_type type, const char device_serial_interface(mconfig, *this), m_dacl(*this, "sbdacl"), m_dacr(*this, "sbdacr"), - m_joy(*this, "joy"), + m_joy(*this, "pc_joy"), m_mdout(*this, "mdout") { } @@ -1164,7 +1164,7 @@ isa16_sblaster16_device::isa16_sblaster16_device(const machine_config &mconfig, void sb8_device::device_start() { - m_isa->install_device( 0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("joy"))); + m_isa->install_device( 0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("pc_joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("pc_joy"))); m_isa->install_device( 0x0226, 0x0227, 0, 0, read8_delegate(FUNC(sb_device::dsp_reset_r), this), write8_delegate(FUNC(sb_device::dsp_reset_w), this)); m_isa->install_device( 0x022a, 0x022b, 0, 0, read8_delegate(FUNC(sb_device::dsp_data_r), this), write8_delegate(FUNC(sb_device::dsp_data_w), this) ); m_isa->install_device( 0x022c, 0x022d, 0, 0, read8_delegate(FUNC(sb_device::dsp_wbuf_status_r), this), write8_delegate(FUNC(sb_device::dsp_cmd_w), this) ); @@ -1222,7 +1222,7 @@ void isa8_sblaster1_5_device::device_start() void sb16_device::device_start() { - m_isa->install_device( 0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("joy"))); + m_isa->install_device( 0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("pc_joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("pc_joy"))); m_isa->install_device( 0x0224, 0x0225, 0, 0, read8_delegate(FUNC(sb16_device::mixer_r), this), write8_delegate(FUNC(sb16_device::mixer_w), this)); m_isa->install_device( 0x0226, 0x0227, 0, 0, read8_delegate(FUNC(sb_device::dsp_reset_r), this), write8_delegate(FUNC(sb_device::dsp_reset_w), this)); m_isa->install_device( 0x022a, 0x022b, 0, 0, read8_delegate(FUNC(sb_device::dsp_data_r), this), write8_delegate(FUNC(sb_device::dsp_data_w), this) ); diff --git a/src/mess/machine/isa_ssi2001.c b/src/mess/machine/isa_ssi2001.c index feed5092639..24ababd1bfa 100644 --- a/src/mess/machine/isa_ssi2001.c +++ b/src/mess/machine/isa_ssi2001.c @@ -8,7 +8,7 @@ static MACHINE_CONFIG_FRAGMENT( ssi2001 ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("sid6581", MOS6581, XTAL_14_31818MHz/16) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MACHINE_CONFIG_END machine_config_constructor ssi2001_device::device_mconfig_additions() const @@ -19,7 +19,7 @@ machine_config_constructor ssi2001_device::device_mconfig_additions() const ssi2001_device::ssi2001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ISA8_SSI2001, "Innovation SSI-2001 Audio Adapter", tag, owner, clock, "ssi2001", __FILE__), device_isa8_card_interface(mconfig, *this), - m_joy(*this, "joy"), + m_joy(*this, "pc_joy"), m_sid(*this, "sid6581") { } @@ -27,7 +27,7 @@ ssi2001_device::ssi2001_device(const machine_config &mconfig, const char *tag, d void ssi2001_device::device_start() { set_isa_device(); - m_isa->install_device(0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("joy"))); + m_isa->install_device(0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("pc_joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("pc_joy"))); m_isa->install_device(0x0280, 0x029F, 0, 0, read8_delegate(FUNC(mos6581_device::read), subdevice("sid6581")), write8_delegate(FUNC(mos6581_device::write), subdevice("sid6581"))); } diff --git a/src/mess/machine/isa_stereo_fx.c b/src/mess/machine/isa_stereo_fx.c index e3c1b7573c7..f57aeb0365f 100644 --- a/src/mess/machine/isa_stereo_fx.c +++ b/src/mess/machine/isa_stereo_fx.c @@ -123,7 +123,7 @@ static MACHINE_CONFIG_FRAGMENT( stereo_fx ) MCFG_SOUND_ADD("dacr", DAC, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00) - MCFG_PC_JOY_ADD("joy") + MCFG_PC_JOY_ADD("pc_joy") MACHINE_CONFIG_END const rom_entry *stereo_fx_device::device_rom_region() const @@ -195,7 +195,7 @@ stereo_fx_device::stereo_fx_device(const machine_config &mconfig, const char *ta device_isa8_card_interface(mconfig, *this), m_dacl(*this, "dacl"), m_dacr(*this, "dacr"), - m_joy(*this, "joy"), + m_joy(*this, "pc_joy"), m_cpu(*this, "stereo_fx_cpu") { m_t1 = 0; @@ -204,7 +204,7 @@ stereo_fx_device::stereo_fx_device(const machine_config &mconfig, const char *ta void stereo_fx_device::device_start() { set_isa_device(); - m_isa->install_device(0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("joy"))); + m_isa->install_device(0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice("pc_joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice("pc_joy"))); m_isa->install_device(0x0226, 0x0227, 0, 0, read8_delegate(FUNC(stereo_fx_device::invalid_r), this), write8_delegate(FUNC(stereo_fx_device::dsp_reset_w), this)); m_isa->install_device(0x022a, 0x022b, 0, 0, read8_delegate(FUNC(stereo_fx_device::dsp_data_r), this), write8_delegate(FUNC(stereo_fx_device::invalid_w), this) ); m_isa->install_device(0x022c, 0x022d, 0, 0, read8_delegate(FUNC(stereo_fx_device::dsp_wbuf_status_r), this), write8_delegate(FUNC(stereo_fx_device::dsp_cmd_w), this) ); diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c index 0d983078e9a..5783fe49355 100644 --- a/src/mess/machine/pc.c +++ b/src/mess/machine/pc.c @@ -1322,6 +1322,13 @@ READ8_MEMBER(pc_state::mc1502_wd17xx_motor_r) return data; } +WRITE8_MEMBER(pc_state::asst128_fdc_dor_w) +{ + pc_fdc_xt_device *fdc = machine().device("fdc"); + + fdc->tc_w((data & 0x80) == 0x80); + fdc->dor_w(space, offset, data, mem_mask); +} /********************************************************** * diff --git a/src/mess/machine/pc_joy.c b/src/mess/machine/pc_joy.c index e7aa6b3ec17..b65593d3f39 100644 --- a/src/mess/machine/pc_joy.c +++ b/src/mess/machine/pc_joy.c @@ -6,45 +6,52 @@ * *************************************************************************/ -#include "emu.h" #include "pc_joy.h" +const device_type PC_JOY = &device_creator; + +pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, PC_JOY, "PC joystick port", tag, owner, clock, "pc_joy", __FILE__), + device_slot_interface(mconfig, *this) +{ +} + READ8_MEMBER ( pc_joy_device::joy_port_r ) { - UINT8 data = 0xf; - int delta; - attotime new_time = machine().time(); - delta = ((new_time - m_stime) * 256 * 1000).seconds; + int delta = ((machine().time() - m_stime) * 256 * 1000).seconds; - data = m_btn->read() ^ 0xf0; + if(!m_dev) + return 0xf0; - /* timer overflow? Nope, otherwise some HWs can't verify the port properly */ - //if ((new_time - JOY_time) > attotime::from_msec(10)) - //{ - //} - //else - - if (m_x1->read() < delta) data &= ~0x01; - if (m_y1->read() < delta) data &= ~0x02; - if (m_x2->read() < delta) data &= ~0x04; - if (m_y2->read() < delta) data &= ~0x08; - return data; + return (m_dev->btn() << 4) | (m_dev->y2(delta) << 3) | (m_dev->x2(delta) << 2) | (m_dev->y1(delta) << 1) | m_dev->x1(delta); } - - WRITE8_MEMBER ( pc_joy_device::joy_port_w ) { m_stime = machine().time(); + m_dev->port_write(); +} + +void pc_joy_device::device_config_complete() +{ + m_dev = dynamic_cast(get_card_device()); +} + +device_pc_joy_interface::device_pc_joy_interface(const machine_config &mconfig, device_t &device) : + device_slot_card_interface(mconfig, device) +{ +} + +device_pc_joy_interface::~device_pc_joy_interface() +{ } static INPUT_PORTS_START( pc_joystick ) PORT_START("btn") - PORT_BIT ( 0xf, 0xf, IPT_UNUSED ) - PORT_BIT( 0x0010, 0x0000, IPT_BUTTON1) PORT_NAME("Joystick 1 Button 1") - PORT_BIT( 0x0020, 0x0000, IPT_BUTTON2) PORT_NAME("Joystick 1 Button 2") - PORT_BIT( 0x0040, 0x0000, IPT_BUTTON1) PORT_NAME("Joystick 2 Button 1") PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(2) - PORT_BIT( 0x0080, 0x0000, IPT_BUTTON2) PORT_NAME("Joystick 2 Button 2") PORT_CODE(JOYCODE_BUTTON2) PORT_PLAYER(2) + PORT_BIT( 0x1, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Joystick 1 Button 1") + PORT_BIT( 0x2, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Joystick 1 Button 2") + PORT_BIT( 0x4, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Joystick 2 Button 1") PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(2) + PORT_BIT( 0x8, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Joystick 2 Button 2") PORT_CODE(JOYCODE_BUTTON2) PORT_PLAYER(2) PORT_START("x1") PORT_BIT(0xff,0x80,IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(1,0xff) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) @@ -59,10 +66,16 @@ static INPUT_PORTS_START( pc_joystick ) PORT_BIT(0xff,0x80,IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(1,0xff) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) INPUT_PORTS_END -const device_type PC_JOY = &device_creator; +ioport_constructor pc_basic_joy_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( pc_joystick ); +} -pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, PC_JOY, "PC joystick", tag, owner, clock), +const device_type PC_BASIC_JOY = &device_creator; + +pc_basic_joy_device::pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, PC_BASIC_JOY, "PC basic joystick", tag, owner, clock, "basic_joy", __FILE__), + device_pc_joy_interface(mconfig, *this), m_btn(*this, "btn"), m_x1(*this, "x1"), m_y1(*this, "y1"), @@ -71,7 +84,6 @@ pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, dev { } -ioport_constructor pc_joy_device::device_input_ports() const -{ - return INPUT_PORTS_NAME( pc_joystick ); -} +SLOT_INTERFACE_START(pc_joysticks) + SLOT_INTERFACE("basic_joy", PC_BASIC_JOY) +SLOT_INTERFACE_END diff --git a/src/mess/machine/pc_joy.h b/src/mess/machine/pc_joy.h index e6033f52ca6..b5a69dd833f 100644 --- a/src/mess/machine/pc_joy.h +++ b/src/mess/machine/pc_joy.h @@ -12,16 +12,56 @@ #include "emu.h" #define MCFG_PC_JOY_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, PC_JOY, 0) + MCFG_DEVICE_ADD(_tag, PC_JOY, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(pc_joysticks, "basic_joy", NULL, false) -class pc_joy_device : public device_t +SLOT_INTERFACE_EXTERN(pc_joysticks); + +class device_pc_joy_interface: public device_slot_card_interface +{ +public: + device_pc_joy_interface(const machine_config &mconfig, device_t &device); + virtual ~device_pc_joy_interface(); + + virtual bool x1(int delta) { return false; } + virtual bool x2(int delta) { return false; } + virtual bool y1(int delta) { return false; } + virtual bool y2(int delta) { return false; } + virtual UINT8 btn() { return 0xf; } + virtual void port_write() { } +}; + +class pc_joy_device : public device_t, + public device_slot_interface { public: pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - virtual ioport_constructor device_input_ports() const; DECLARE_READ8_MEMBER(joy_port_r); DECLARE_WRITE8_MEMBER(joy_port_w); +protected: + virtual void device_start() { m_stime = machine().time(); } + virtual void device_config_complete(); +private: + attotime m_stime; + device_pc_joy_interface *m_dev; +}; + +extern const device_type PC_JOY; + +class pc_basic_joy_device : public device_t, + public device_pc_joy_interface +{ +public: + pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ioport_constructor device_input_ports() const; + + virtual bool x1(int delta) { return (m_x1->read() > delta); } + virtual bool x2(int delta) { return (m_x2->read() > delta); } + virtual bool y1(int delta) { return (m_y1->read() > delta); } + virtual bool y2(int delta) { return (m_y2->read() > delta); } + virtual UINT8 btn() { return m_btn->read(); } + protected: virtual void device_start() {} @@ -31,9 +71,6 @@ private: required_ioport m_y1; required_ioport m_x2; required_ioport m_y2; - - attotime m_stime; }; -extern const device_type PC_JOY; #endif /* PC_JOY_H */