From 14b04d517be750aef1833976d7ed8228f925480f Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 13 Jun 2017 20:47:02 -0400 Subject: [PATCH] subsino.cpp: Use 8255 devices (most of which are only used for input) --- src/mame/drivers/subsino.cpp | 89 ++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 39 deletions(-) diff --git a/src/mame/drivers/subsino.cpp b/src/mame/drivers/subsino.cpp index 9077357db71..b9c859903f1 100644 --- a/src/mame/drivers/subsino.cpp +++ b/src/mame/drivers/subsino.cpp @@ -666,6 +666,9 @@ WRITE8_MEMBER(subsino_state::subsino_out_a_w) */ + if (data == 0xff) + return; + output().set_lamp_value(8, (data) & 1); /* Lamp 8 */ output().set_lamp_value(9, (data >> 1) & 1); /* Lamp 9 */ output().set_lamp_value(10, (data >> 2) & 1); /* Lamp 10 */ @@ -830,13 +833,8 @@ static ADDRESS_MAP_START( srider_map, AS_PROGRAM, 8, subsino_state ) AM_RANGE( 0x0c000, 0x0cfff ) AM_RAM - AM_RANGE( 0x0d000, 0x0d000 ) AM_READ_PORT( "SW1" ) - AM_RANGE( 0x0d001, 0x0d001 ) AM_READ_PORT( "SW2" ) - AM_RANGE( 0x0d002, 0x0d002 ) AM_READ_PORT( "SW3" ) - - AM_RANGE( 0x0d004, 0x0d004 ) AM_READ_PORT( "SW4" ) - AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INA" ) - AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INB" ) + AM_RANGE( 0x0d000, 0x0d002 ) AM_DEVREAD("ppi1", i8255_device, read) + AM_RANGE( 0x0d004, 0x0d006 ) AM_DEVREAD("ppi2", i8255_device, read) AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE(subsino_out_b_w ) AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE(subsino_out_a_w ) @@ -857,13 +855,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sharkpy_map, AS_PROGRAM, 8, subsino_state ) AM_RANGE( 0x09800, 0x09fff ) AM_RAM - AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" ) - AM_RANGE( 0x09001, 0x09001 ) AM_READ_PORT( "SW2" ) - AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "SW3" ) - - AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "SW4" ) - AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INA" ) - AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "INB" ) + AM_RANGE( 0x09000, 0x09002 ) AM_DEVREAD("ppi1", i8255_device, read) + AM_RANGE( 0x09004, 0x09006 ) AM_DEVREAD("ppi2", i8255_device, read) AM_RANGE( 0x09009, 0x09009 ) AM_WRITE(subsino_out_b_w ) AM_RANGE( 0x0900a, 0x0900a ) AM_WRITE(subsino_out_a_w ) @@ -892,12 +885,9 @@ this event makes the game to reset without any money in the bank. static ADDRESS_MAP_START( victor21_map, AS_PROGRAM, 8, subsino_state ) AM_RANGE( 0x09800, 0x09fff ) AM_RAM - AM_RANGE( 0x09000, 0x09000 ) AM_WRITE(subsino_out_a_w ) - AM_RANGE( 0x09001, 0x09001 ) AM_WRITE(subsino_out_b_w ) - AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "INC" ) + AM_RANGE( 0x09000, 0x09003 ) AM_DEVREADWRITE("ppi", i8255_device, read, write) AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "INA" ) AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INB" ) - AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "SW1" ) AM_RANGE( 0x09007, 0x09007 ) AM_READ_PORT( "SW2" ) AM_RANGE( 0x09008, 0x09008 ) AM_READ_PORT( "SW3" ) @@ -1034,13 +1024,8 @@ WRITE8_MEMBER(subsino_state::subsino_out_c_w) static ADDRESS_MAP_START( tisub_map, AS_PROGRAM, 8, subsino_state ) AM_RANGE( 0x09800, 0x09fff ) AM_RAM - AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" ) - AM_RANGE( 0x09001, 0x09001 ) AM_READ_PORT( "SW2" ) - AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "SW3" ) - - AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "SW4" ) - AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INA" ) - AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "INB" ) + AM_RANGE( 0x09000, 0x09002 ) AM_DEVREAD("ppi1", i8255_device, read) + AM_RANGE( 0x09004, 0x09006 ) AM_DEVREAD("ppi2", i8255_device, read) /* 0x09008: is marked as OUTPUT C in the test mode. */ AM_RANGE( 0x09008, 0x09008 ) AM_WRITE(subsino_out_c_w ) @@ -1132,13 +1117,8 @@ static ADDRESS_MAP_START( stbsub_map, AS_PROGRAM, 8, subsino_state ) AM_RANGE( 0x0c000, 0x0cfff ) AM_RAM - AM_RANGE( 0x0d000, 0x0d000 ) AM_READ_PORT( "SW1" ) - AM_RANGE( 0x0d001, 0x0d001 ) AM_READ_PORT( "SW2" ) - AM_RANGE( 0x0d002, 0x0d002 ) AM_READ_PORT( "SW3" ) - - AM_RANGE( 0x0d004, 0x0d004 ) AM_READ_PORT( "SW4" ) - AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INB" ) - AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INA" ) + AM_RANGE( 0x0d000, 0x0d002 ) AM_DEVREAD("ppi1", i8255_device, read) + AM_RANGE( 0x0d004, 0x0d006 ) AM_DEVREAD("ppi2", i8255_device, read) AM_RANGE( 0x0d008, 0x0d008 ) AM_RAM AM_SHARE("stbsub_out_c") @@ -1175,13 +1155,9 @@ static ADDRESS_MAP_START( mtrainnv_map, AS_PROGRAM, 8, subsino_state ) AM_RANGE( 0x0c000, 0x0cfff ) AM_RAM - AM_RANGE( 0x0d000, 0x0d000 ) AM_READ_PORT( "SW1" ) - AM_RANGE( 0x0d001, 0x0d001 ) AM_READ_PORT( "SW2" ) - AM_RANGE( 0x0d002, 0x0d002 ) AM_READ_PORT( "SW3" ) + AM_RANGE( 0x0d000, 0x0d002 ) AM_DEVREAD("ppi1", i8255_device, read) + AM_RANGE( 0x0d004, 0x0d006 ) AM_DEVREAD("ppi2", i8255_device, read) - AM_RANGE( 0x0d004, 0x0d004 ) AM_READ_PORT( "SW4" ) - AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INB" ) - AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INA" ) AM_RANGE( 0x0d008, 0x0d008 ) AM_RAM AM_SHARE("stbsub_out_c") // AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE // AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE @@ -2781,6 +2757,11 @@ static MACHINE_CONFIG_START( victor21 ) MCFG_CPU_PROGRAM_MAP(victor21_map) MCFG_CPU_IO_MAP(subsino_iomap) + MCFG_DEVICE_ADD("ppi", I8255A, 0) + MCFG_I8255_OUT_PORTA_CB(WRITE8(subsino_state, subsino_out_a_w)) + MCFG_I8255_OUT_PORTB_CB(WRITE8(subsino_state, subsino_out_b_w)) + MCFG_I8255_IN_PORTC_CB(IOPORT("INC")) + MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) /* video hardware */ @@ -2856,6 +2837,16 @@ static MACHINE_CONFIG_START( srider ) MCFG_CPU_PROGRAM_MAP(srider_map) MCFG_CPU_IO_MAP(subsino_iomap) + MCFG_DEVICE_ADD("ppi1", I8255A, 0) + MCFG_I8255_IN_PORTA_CB(IOPORT("SW1")) + MCFG_I8255_IN_PORTB_CB(IOPORT("SW2")) + MCFG_I8255_IN_PORTC_CB(IOPORT("SW3")) + + MCFG_DEVICE_ADD("ppi2", I8255A, 0) + MCFG_I8255_IN_PORTA_CB(IOPORT("SW4")) + MCFG_I8255_IN_PORTB_CB(IOPORT("INA")) + MCFG_I8255_IN_PORTC_CB(IOPORT("INB")) + MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) /* video hardware */ @@ -2898,6 +2889,16 @@ static MACHINE_CONFIG_START( tisub ) MCFG_CPU_PROGRAM_MAP(tisub_map) MCFG_CPU_IO_MAP(subsino_iomap) + MCFG_DEVICE_ADD("ppi1", I8255A, 0) + MCFG_I8255_IN_PORTA_CB(IOPORT("SW1")) + MCFG_I8255_IN_PORTB_CB(IOPORT("SW2")) + MCFG_I8255_IN_PORTC_CB(IOPORT("SW3")) + + MCFG_DEVICE_ADD("ppi2", I8255A, 0) + MCFG_I8255_IN_PORTA_CB(IOPORT("SW4")) + MCFG_I8255_IN_PORTB_CB(IOPORT("INA")) + MCFG_I8255_IN_PORTC_CB(IOPORT("INB")) + MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) /* video hardware */ @@ -2929,6 +2930,16 @@ static MACHINE_CONFIG_START( stbsub ) MCFG_CPU_PROGRAM_MAP(stbsub_map) MCFG_CPU_IO_MAP(subsino_iomap) + MCFG_DEVICE_ADD("ppi1", I8255A, 0) + MCFG_I8255_IN_PORTA_CB(IOPORT("SW1")) + MCFG_I8255_IN_PORTB_CB(IOPORT("SW2")) + MCFG_I8255_IN_PORTC_CB(IOPORT("SW3")) + + MCFG_DEVICE_ADD("ppi2", I8255A, 0) + MCFG_I8255_IN_PORTA_CB(IOPORT("SW4")) + MCFG_I8255_IN_PORTB_CB(IOPORT("INB")) + MCFG_I8255_IN_PORTC_CB(IOPORT("INA")) + MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) /* video hardware */ @@ -3531,7 +3542,7 @@ Chips: 2x custom QFP44 label SUBSINOSS9100 1x custom DIP42 label SUBSINOSS9101 -2x D8255AC-2 (are they 8255 equivalent?) +2x D8255AC-2 (equivalent to 8255) 1x custom QFP44 label K-665 (sound)(equivalent to OKI M6295) 1x custom DIP24 label SM64 (sound)(equivalent to YM3812) 1x custom DIP8 label K-664 (sound)(equivalent to YM3014)