From 91e35e62ede8ad645c437de40bce5bd66c6af8dc Mon Sep 17 00:00:00 2001 From: Nicola Salmoria Date: Sat, 24 May 2008 22:30:38 +0000 Subject: [PATCH] 01735: sf2m4, sf2m5, sf2m6, sf2m7, sf2yyc, sf2koryu: games with bootleg kludge doesn't work --- src/mame/drivers/cps1.c | 68 +++++++++++++++++++++++++++++++++++------ src/mame/video/cps1.c | 12 ++++++-- 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index 780b7edbb36..a3a3dfa2a9d 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -167,6 +167,13 @@ READ16_HANDLER( cps1_dsw_r ) return (in << 8) | 0xff; } +READ16_HANDLER( cps1_hack_dsw_r ) +{ + static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" }; + int in = input_port_read(machine, dswname[offset]); + return (in << 8) | in; +} + READ16_HANDLER( cps1_in1_r ) { return input_port_read(machine, "IN1"); @@ -174,14 +181,12 @@ READ16_HANDLER( cps1_in1_r ) READ16_HANDLER( cps1_in2_r ) { - int buttons = input_port_read(machine, "IN2"); - return buttons << 8 | buttons; + return input_port_read(machine, "IN2"); } READ16_HANDLER( cps1_in3_r ) { - int buttons = input_port_read(machine, "IN3"); - return buttons << 8 | buttons; + return input_port_read(machine, "IN3"); } @@ -5200,6 +5205,41 @@ ROM_START( nemoj ) ROM_LOAD( "nm_31.13c", 0x20000, 0x20000, CRC(2650a0a8) SHA1(e9e8cc1b27a2cb3e87124061fabcf42982f0611f) ) // == nm_19.12c ROM_END +/* +B-Board 90629B + +for gfx can use either mask ROMs (HN62404P-17) in the upper four rows, or +EPROMS (HN27C4096G-15) in the lower four rows. + +euro version has mask ROMs laid out like this: +sf2-5m.4a in socket 2 +sf2-7m.6a in socket 4 +sf2-1m.3a in socket 1 +sf2-3m.5a in socket 3 +sf2-6m.4c in socket 11 +sf2-8m.6c in socket 13 +sf2-2m.3c in socket 10 +sf2-4m.5c in socket 12 +sf2-13m.4d in socket 21 +sf2-15m.6d in socket 23 +sf2-9m.3d in socket 20 +sf2-11m.5d in socket 22 + +the Japanese version has EPROMS laid out like this: +sf2_06.8a +sf2_08.10a +sf2_05.7a +sf2_07.9a +sf2_15.8c +sf2_17.10c +sf2_14.7c +sf2_16.9c +sf2_25.8d +sf2_27.10d +sf2_24.7d +sf2_26.9d +*/ + ROM_START( sf2 ) ROM_REGION( CODE_SIZE, REGION_CPU1, 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "sf2e.30g", 0x00000, 0x20000, CRC(fe39ee33) SHA1(22558eb15e035b09b80935a32b8425d91cd79669) ) // matches sf2u.30i @@ -7754,6 +7794,14 @@ static DRIVER_INIT( forgottn ) DRIVER_INIT_CALL(cps1); } +static DRIVER_INIT( sf2hack ) +{ + /* some SF2 hacks have some inputs wired to the LSB instead of MSB */ + memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x800018, 0x80001f, 0, 0, cps1_hack_dsw_r); + + DRIVER_INIT_CALL(cps1); +} + static DRIVER_INIT( wof ) { wof_decode(); @@ -7894,12 +7942,12 @@ GAME( 1992, sf2accp2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg GAME( 1992, sf2m1, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M1)", GAME_NOT_WORKING ) GAME( 1992, sf2m2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M2)", GAME_NOT_WORKING ) GAME( 1992, sf2m3, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M3)", GAME_NOT_WORKING ) -GAME( 1992, sf2m4, sf2ce, cps1_12MHz, sf2j, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M4)", 0 ) -GAME( 1992, sf2m5, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M5)", 0 ) -GAME( 1992, sf2m6, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M6)", 0 ) -GAME( 1992, sf2m7, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M7)", 0 ) -GAME( 1992, sf2yyc, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (YYC)", 0 ) -GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Kouryu)", 0 ) +GAME( 1992, sf2m4, sf2ce, cps1_12MHz, sf2j, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M4)", 0 ) +GAME( 1992, sf2m5, sf2ce, cps1_12MHz, sf2, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M5)", 0 ) +GAME( 1992, sf2m6, sf2ce, cps1_12MHz, sf2, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M6)", 0 ) +GAME( 1992, sf2m7, sf2ce, cps1_12MHz, sf2, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M7)", 0 ) +GAME( 1992, sf2yyc, sf2ce, cps1_12MHz, sf2, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (YYC)", 0 ) +GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (Kouryu)", 0 ) GAME( 1992, varth, 0, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920714)" , 0) // "ETC" 12MHz not verified but game slows down at 10MHz GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920612)" , 0) // "ETC" GAME( 1992, varthu, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom (Romstar license)", "Varth - Operation Thunderstorm (US 920612)", 0 ) diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index 877b8f692b4..28fee67aa45 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -423,7 +423,7 @@ static const struct CPS1config *cps1_game_config; #define CPS_B_21_QS3 0x0e,0x0c00, -1, -1, -1, -1, 0x2c, -1, -1, 0x12,{0x14,0x16,0x08,0x0a},0x0c, {0x04,0x02,0x20,0x00,0x00} #define CPS_B_21_QS4 0x2e,0x0c01, -1, -1, -1, -1, 0x1c,0x1e,0x08, 0x16,{0x00,0x02,0x28,0x2a},0x2c, {0x04,0x08,0x10,0x00,0x00} #define CPS_B_21_QS5 0x1e,0x0c02, -1, -1, -1, -1, 0x0c, -1, -1, 0x2a,{0x2c,0x2e,0x30,0x32},0x1c, {0x04,0x08,0x10,0x00,0x00} -#define HACK_B_1 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x14,{0x12,0x10,0x0e,0x0c},0x1c, {0xff,0xff,0xff,0x00,0x00} +#define HACK_B_1 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x14,{0x12,0x10,0x0e,0x0c},0x0a, {0x0e,0x0e,0x0e,0x30,0x30} /* CPS_B_21_DEF is CPS-B-21 at default settings (no battery) @@ -1511,7 +1511,12 @@ READ16_HANDLER( cps1_cps_b_r ) cps1_cps_b_regs[cps1_game_config->mult_factor2/2]) >> 16; if (offset == cps1_game_config->in2_addr/2) /* Extra input ports (on C-board) */ - return input_port_read(machine, "IN2"); + { + if (cps1_game_config->bootleg_kludge == 1) + return input_port_read(machine, "IN2") << 8; + else + return input_port_read(machine, "IN2"); + } if (offset == cps1_game_config->in3_addr/2) /* Player 4 controls (on C-board) ("Captain Commando") */ return input_port_read(machine, "IN3"); @@ -1593,7 +1598,8 @@ WRITE16_HANDLER( cps1_cps_b_w ) offset != cps1_game_config->priority[2]/2 && offset != cps1_game_config->priority[3]/2 && offset != cps1_game_config->palette_control/2 && - offset != cps1_game_config->out2_addr/2) + offset != cps1_game_config->out2_addr/2 && + !cps1_game_config->bootleg_kludge) popmessage("CPS-B write %04x to port %02x contact MAMEDEV", data, offset*2); }