diff options
Diffstat (limited to 'src/mame/drivers/pachifev.c')
-rw-r--r-- | src/mame/drivers/pachifev.c | 310 |
1 files changed, 155 insertions, 155 deletions
diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c index e3cae96050e..f7cb8f8ef51 100644 --- a/src/mame/drivers/pachifev.c +++ b/src/mame/drivers/pachifev.c @@ -112,70 +112,70 @@ public: WRITE8_MEMBER(pachifev_state::controls_w) { - if(!data) - { - - - /*end of input read*/ - m_power=0; - m_max_power=m_input_power; - if(--m_cnt <= 0) /* why to do it N times? no idea.. someone should fix it */ - { - m_cnt=0; - m_input_power=0; - } - } + if(!data) + { + + + /*end of input read*/ + m_power=0; + m_max_power=m_input_power; + if(--m_cnt <= 0) /* why to do it N times? no idea.. someone should fix it */ + { + m_cnt=0; + m_input_power=0; + } + } } READ8_MEMBER(pachifev_state::controls_r) { - int output_bit=(m_power < m_max_power)?0:1; - ++m_power; - return output_bit; + int output_bit=(m_power < m_max_power)?0:1; + ++m_power; + return output_bit; } static ADDRESS_MAP_START( pachifev_map, AS_PROGRAM, 8, pachifev_state ) - AM_RANGE(0x0000, 0xdfff) AM_ROM - - AM_RANGE(0xe000, 0xe7ff) AM_RAM - AM_RANGE(0xf000, 0xf0fb) AM_NOP /* internal ram */ - AM_RANGE(0xff00, 0xff00) AM_READ_PORT("IN0") - AM_RANGE(0xff02, 0xff02) AM_READ_PORT("IN1") - AM_RANGE(0xff04, 0xff04) AM_READ_PORT("DSW1") - AM_RANGE(0xff06, 0xff06) AM_READ_PORT("DSW2") - AM_RANGE(0xff08, 0xff08) AM_READ_PORT("DSW3") - AM_RANGE(0xff10, 0xff10) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write) - AM_RANGE(0xff12, 0xff12) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write) - AM_RANGE(0xff20, 0xff20) AM_DEVWRITE("y2404_1", y2404_device, write) - AM_RANGE(0xff30, 0xff30) AM_DEVWRITE("y2404_2", y2404_device, write) - AM_RANGE(0xff40, 0xff40) AM_WRITE(controls_w) - AM_RANGE(0xff50, 0xff50) AM_WRITENOP /* unknown */ - AM_RANGE(0xfffa, 0xfffb) AM_NOP /* decrementer */ - AM_RANGE(0xfffc, 0xffff) AM_NOP /* nmi */ + AM_RANGE(0x0000, 0xdfff) AM_ROM + + AM_RANGE(0xe000, 0xe7ff) AM_RAM + AM_RANGE(0xf000, 0xf0fb) AM_NOP /* internal ram */ + AM_RANGE(0xff00, 0xff00) AM_READ_PORT("IN0") + AM_RANGE(0xff02, 0xff02) AM_READ_PORT("IN1") + AM_RANGE(0xff04, 0xff04) AM_READ_PORT("DSW1") + AM_RANGE(0xff06, 0xff06) AM_READ_PORT("DSW2") + AM_RANGE(0xff08, 0xff08) AM_READ_PORT("DSW3") + AM_RANGE(0xff10, 0xff10) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write) + AM_RANGE(0xff12, 0xff12) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write) + AM_RANGE(0xff20, 0xff20) AM_DEVWRITE("y2404_1", y2404_device, write) + AM_RANGE(0xff30, 0xff30) AM_DEVWRITE("y2404_2", y2404_device, write) + AM_RANGE(0xff40, 0xff40) AM_WRITE(controls_w) + AM_RANGE(0xff50, 0xff50) AM_WRITENOP /* unknown */ + AM_RANGE(0xfffa, 0xfffb) AM_NOP /* decrementer */ + AM_RANGE(0xfffc, 0xffff) AM_NOP /* nmi */ ADDRESS_MAP_END static ADDRESS_MAP_START( pachifev_cru, AS_IO, 8, pachifev_state ) - AM_RANGE(0x000, 0x000) AM_READ(controls_r) + AM_RANGE(0x000, 0x000) AM_READ(controls_r) ADDRESS_MAP_END /* verified from TMS9995 code */ static INPUT_PORTS_START( pachifev ) /* 0xff00, cpl'ed -> 0xf0a0 (internal RAM) */ - PORT_START("IN0") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* select initial for player 1 and player 2 (upright) */ - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x4d, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START("IN0") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* select initial for player 1 and player 2 (upright) */ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x4d, IP_ACTIVE_LOW, IPT_UNUSED ) /* 0xff02, cpl'ed -> 0xf0a1 (internal RAM) */ - PORT_START("IN1") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL /* select initial for player 2 (cocktail) */ - PORT_BIT( 0xfd, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START("IN1") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL /* select initial for player 2 (cocktail) */ + PORT_BIT( 0xfd, IP_ACTIVE_LOW, IPT_UNUSED ) /* 0xff04, cpl'ed -> 0xf0a2 (internal RAM) */ - PORT_START("DSW1") + PORT_START("DSW1") PORT_DIPNAME( 0x07, 0x07, "Difficulty ?" ) /* table at 0x5000 - see notes */ PORT_DIPSETTING( 0x07, "-8" ) PORT_DIPSETTING( 0x06, "-6" ) @@ -185,52 +185,52 @@ static INPUT_PORTS_START( pachifev ) PORT_DIPSETTING( 0x02, "+4" ) PORT_DIPSETTING( 0x01, "+6" ) PORT_DIPSETTING( 0x00, "+8" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x30, 0x00, "Balls" ) /* table at 0x5020 */ - PORT_DIPSETTING( 0x30, "25" ) - PORT_DIPSETTING( 0x20, "50" ) - PORT_DIPSETTING( 0x10, "100" ) - PORT_DIPSETTING( 0x00, "200" ) - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + PORT_DIPNAME( 0x30, 0x00, "Balls" ) /* table at 0x5020 */ + PORT_DIPSETTING( 0x30, "25" ) + PORT_DIPSETTING( 0x20, "50" ) + PORT_DIPSETTING( 0x10, "100" ) + PORT_DIPSETTING( 0x00, "200" ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) /* 0xff06, cpl'ed -> 0xf0a3 (internal RAM) */ - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x00, "Time" ) /* table at 0x5028 */ - PORT_DIPSETTING( 0x00, "180" ) - PORT_DIPSETTING( 0x01, "120" ) - PORT_DIPSETTING( 0x02, "150" ) - PORT_DIPSETTING( 0x03, "90" ) + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x00, "Time" ) /* table at 0x5028 */ + PORT_DIPSETTING( 0x00, "180" ) + PORT_DIPSETTING( 0x01, "120" ) + PORT_DIPSETTING( 0x02, "150" ) + PORT_DIPSETTING( 0x03, "90" ) PORT_DIPUNUSED( 0x04, 0x04 ) PORT_DIPUNUSED( 0x08, 0x08 ) - PORT_DIPNAME( 0x30, 0x30, "Limit (Level 4)" ) /* table at 0x5038 - stored at 0xe02a.w */ - PORT_DIPSETTING( 0x30, "500" ) - PORT_DIPSETTING( 0x20, "1000" ) - PORT_DIPSETTING( 0x10, "1500" ) - PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0xc0, 0xc0, "Limit (Levels 1 to 3)" ) /* table at 0x5030 - stored at 0xe028.w */ - PORT_DIPSETTING( 0xc0, "300" ) - PORT_DIPSETTING( 0x80, "500" ) - PORT_DIPSETTING( 0x40, "1000" ) - PORT_DIPSETTING( 0x00, "1500" ) + PORT_DIPNAME( 0x30, 0x30, "Limit (Level 4)" ) /* table at 0x5038 - stored at 0xe02a.w */ + PORT_DIPSETTING( 0x30, "500" ) + PORT_DIPSETTING( 0x20, "1000" ) + PORT_DIPSETTING( 0x10, "1500" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0xc0, 0xc0, "Limit (Levels 1 to 3)" ) /* table at 0x5030 - stored at 0xe028.w */ + PORT_DIPSETTING( 0xc0, "300" ) + PORT_DIPSETTING( 0x80, "500" ) + PORT_DIPSETTING( 0x40, "1000" ) + PORT_DIPSETTING( 0x00, "1500" ) /* 0xff08, cpl'ed -> 0xf0a4 (internal RAM) */ - PORT_START("DSW3") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_START("DSW3") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPUNUSED( 0x02, 0x02 ) PORT_DIPUNUSED( 0x04, 0x04 ) - PORT_DIPNAME( 0x18, 0x18, "Bonus Time" ) /* table at 0x3500 */ - PORT_DIPSETTING( 0x18, "5" ) - PORT_DIPSETTING( 0x10, "8" ) - PORT_DIPSETTING( 0x08, "10" ) - PORT_DIPSETTING( 0x00, "15" ) + PORT_DIPNAME( 0x18, 0x18, "Bonus Time" ) /* table at 0x3500 */ + PORT_DIPSETTING( 0x18, "5" ) + PORT_DIPSETTING( 0x10, "8" ) + PORT_DIPSETTING( 0x08, "10" ) + PORT_DIPSETTING( 0x00, "15" ) PORT_DIPNAME( 0xe0, 0xe0, "Bonus Ball" ) /* table at 0x3508 */ PORT_DIPSETTING( 0xe0, "3" ) PORT_DIPSETTING( 0xc0, "4" ) @@ -241,11 +241,11 @@ static INPUT_PORTS_START( pachifev ) PORT_DIPSETTING( 0x20, "13" ) PORT_DIPSETTING( 0x00, "15" ) - PORT_START("PLUNGER_P1") - PORT_BIT( 0x3f, 0x00, IPT_POSITIONAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(30) PORT_KEYDELTA(4) PORT_CENTERDELTA(0xff) + PORT_START("PLUNGER_P1") + PORT_BIT( 0x3f, 0x00, IPT_POSITIONAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(30) PORT_KEYDELTA(4) PORT_CENTERDELTA(0xff) - PORT_START("PLUNGER_P2") - PORT_BIT( 0x3f, 0x00, IPT_POSITIONAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(30) PORT_KEYDELTA(4) PORT_CENTERDELTA(0xff) PORT_COCKTAIL + PORT_START("PLUNGER_P2") + PORT_BIT( 0x3f, 0x00, IPT_POSITIONAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(30) PORT_KEYDELTA(4) PORT_CENTERDELTA(0xff) PORT_COCKTAIL INPUT_PORTS_END @@ -262,7 +262,7 @@ INPUT_PORTS_END static const sn76496_config psg_intf = { - DEVCB_NULL + DEVCB_NULL }; @@ -273,32 +273,32 @@ static void pf_adpcm_int(device_t *device) { pachifev_state *state = device->machine().driver_data<pachifev_state>(); - if (state->m_adpcm_pos >= 0x4000 || state->m_adpcm_idle) - { - state->m_adpcm_idle = 1; - msm5205_reset_w(device,1); - state->m_trigger = 0; - } - else - { - UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base(); - - state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) ); - msm5205_data_w(device,state->m_adpcm_data & 0xf); - state->m_trigger^=1; - if(state->m_trigger == 0) - { - state->m_adpcm_pos++; - if((ROM[state->m_adpcm_pos] & 0xff) == 0xff) - state->m_adpcm_idle = 1; - } - } + if (state->m_adpcm_pos >= 0x4000 || state->m_adpcm_idle) + { + state->m_adpcm_idle = 1; + msm5205_reset_w(device,1); + state->m_trigger = 0; + } + else + { + UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base(); + + state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) ); + msm5205_data_w(device,state->m_adpcm_data & 0xf); + state->m_trigger^=1; + if(state->m_trigger == 0) + { + state->m_adpcm_pos++; + if((ROM[state->m_adpcm_pos] & 0xff) == 0xff) + state->m_adpcm_idle = 1; + } + } } static const msm5205_interface msm5205_config = { - pf_adpcm_int, /* interrupt function */ - MSM5205_S48_4B /* 8kHz */ + pf_adpcm_int, /* interrupt function */ + MSM5205_S48_4B /* 8kHz */ }; #endif @@ -306,21 +306,21 @@ static const msm5205_interface msm5205_config = void pachifev_state::machine_reset() { - m_power=0; - m_max_power=0; - m_input_power=0; - m_previous_power=0; - m_cnt=0; + m_power=0; + m_max_power=0; + m_input_power=0; + m_previous_power=0; + m_cnt=0; #if USE_MSM - m_adpcm_pos = 0; + m_adpcm_pos = 0; #endif } INTERRUPT_GEN_MEMBER(pachifev_state::pachifev_vblank_irq) { - { + { static const char *const inname[2] = { "PLUNGER_P1", "PLUNGER_P2" }; /* I wish I had found a better way to handle cocktail inputs, but I can't find a way to access internal RAM */ @@ -332,28 +332,28 @@ INTERRUPT_GEN_MEMBER(pachifev_state::pachifev_vblank_irq) if ((ramspace.read_byte(0xe00f) == 0x01) && ((ioport("DSW1")->read() & 0x08) == 0x00)) player = 1; - int current_power=ioport(inname[player])->read() & 0x3f; - if(current_power != m_previous_power) - { - popmessage ("%d%%", (current_power * 100) / 0x3f); - } + int current_power=ioport(inname[player])->read() & 0x3f; + if(current_power != m_previous_power) + { + popmessage ("%d%%", (current_power * 100) / 0x3f); + } - if( (!current_power) && (m_previous_power) ) - { - m_input_power=m_previous_power; - m_cnt=NUM_PLUNGER_REPEATS; - } + if( (!current_power) && (m_previous_power) ) + { + m_input_power=m_previous_power; + m_cnt=NUM_PLUNGER_REPEATS; + } - m_previous_power=current_power; - } + m_previous_power=current_power; + } } static TMS9928A_INTERFACE(pachifev_tms9928a_interface) { "screen", - 0x4000, - DEVCB_NULL + 0x4000, + DEVCB_NULL }; void pachifev_state::machine_start() @@ -368,51 +368,51 @@ void pachifev_state::machine_start() static const struct tms9995reset_param pachifev_processor_config = { - 1,0,0 + 1,0,0 }; static MACHINE_CONFIG_START( pachifev, pachifev_state ) - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS9995L, XTAL_12MHz) - MCFG_CPU_CONFIG(pachifev_processor_config) - MCFG_CPU_PROGRAM_MAP(pachifev_map) - MCFG_CPU_IO_MAP(pachifev_cru) + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS9995L, XTAL_12MHz) + MCFG_CPU_CONFIG(pachifev_processor_config) + MCFG_CPU_PROGRAM_MAP(pachifev_map) + MCFG_CPU_IO_MAP(pachifev_cru) MCFG_CPU_VBLANK_INT_DRIVER("screen", pachifev_state, pachifev_vblank_irq) - /* video hardware */ + /* video hardware */ MCFG_TMS9928A_ADD( "tms9928a", TMS9928A, pachifev_tms9928a_interface ) MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) MCFG_SCREEN_UPDATE_DEVICE( "tms9928a", tms9928a_device, screen_update ) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") #if USE_MSM - MCFG_SOUND_ADD("adpcm", MSM5205, XTAL_384kHz) /* guess */ - MCFG_SOUND_CONFIG(msm5205_config) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + MCFG_SOUND_ADD("adpcm", MSM5205, XTAL_384kHz) /* guess */ + MCFG_SOUND_CONFIG(msm5205_config) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) #endif - MCFG_SOUND_ADD("y2404_1", Y2404, XTAL_10_738635MHz/3) /* guess */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + MCFG_SOUND_ADD("y2404_1", Y2404, XTAL_10_738635MHz/3) /* guess */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MCFG_SOUND_CONFIG(psg_intf) - MCFG_SOUND_ADD("y2404_2", Y2404, XTAL_10_738635MHz/3) /* guess */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + MCFG_SOUND_ADD("y2404_2", Y2404, XTAL_10_738635MHz/3) /* guess */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MCFG_SOUND_CONFIG(psg_intf) MACHINE_CONFIG_END ROM_START( pachifev ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ic42.00", 0x00000, 0x2000, CRC(9653546e) SHA1(0836d01118241d38bbf61732275afe3ae47d0622) ) - ROM_LOAD( "ic43.01", 0x02000, 0x2000, CRC(5572dce5) SHA1(fad45b33e095ac6e3ed3d7cdc3d8678c153a1b38) ) - ROM_LOAD( "ic44.02", 0x04000, 0x2000, CRC(98b3841f) SHA1(0563139877bf01e1673767ee1798bbcf68adadea) ) - ROM_LOAD( "ic45.03", 0x06000, 0x2000, CRC(6b76e6fa) SHA1(5be10ab0b76e2061fc7e9c77649572955bee7661) ) - ROM_LOAD( "ic46.04", 0x08000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) ) - /* empty ROM socket - no data for 0xa000 - 0xbfff */ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "ic42.00", 0x00000, 0x2000, CRC(9653546e) SHA1(0836d01118241d38bbf61732275afe3ae47d0622) ) + ROM_LOAD( "ic43.01", 0x02000, 0x2000, CRC(5572dce5) SHA1(fad45b33e095ac6e3ed3d7cdc3d8678c153a1b38) ) + ROM_LOAD( "ic44.02", 0x04000, 0x2000, CRC(98b3841f) SHA1(0563139877bf01e1673767ee1798bbcf68adadea) ) + ROM_LOAD( "ic45.03", 0x06000, 0x2000, CRC(6b76e6fa) SHA1(5be10ab0b76e2061fc7e9c77649572955bee7661) ) + ROM_LOAD( "ic46.04", 0x08000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) ) + /* empty ROM socket - no data for 0xa000 - 0xbfff */ ROM_LOAD( "ic48.50", 0x0c000, 0x2000, CRC(4ff52b70) SHA1(a459b52712250d2ecdbe6aeb8c400806867e9857) ) - ROM_REGION( 0x4000, "adpcm", 0 ) - ROM_LOAD( "ic66.10", 0x0000, 0x2000, CRC(217c573e) SHA1(6fb90865d1d81f5ea00fa7916d0ccb6756ef5ce5) ) + ROM_REGION( 0x4000, "adpcm", 0 ) + ROM_LOAD( "ic66.10", 0x0000, 0x2000, CRC(217c573e) SHA1(6fb90865d1d81f5ea00fa7916d0ccb6756ef5ce5) ) ROM_END |