diff --git a/src/mame/drivers/aladbl.c b/src/mame/drivers/aladbl.c index 646a4ba2c8d..cba7aca6ef2 100644 --- a/src/mame/drivers/aladbl.c +++ b/src/mame/drivers/aladbl.c @@ -154,56 +154,6 @@ ROM_START( mk3ghw ) // roms are scrambled, we take care of the address descrambl ROM_CONTINUE( 0x300000, 0x040000) ROM_END -// this should be correct, the areas of the rom that differ to the original -// after this decode look like intentional changes -static DRIVER_INIT( mk3ghw ) -{ - DRIVER_INIT_CALL(megadriv); - - UINT8 *ROM = memory_region(machine, "maincpu"); - int x; - - for (x=0x000001;x<0x100001;x+=2) - { - if (x&0x80000) - { - ROM[x] = ROM[x]^0xff; - ROM[x] = BITSWAP8(ROM[x], 0,3,2,5,4,6,7,1); - } - else - { - ROM[x] = ROM[x]^0xff; - ROM[x] = BITSWAP8(ROM[x], 4,0,7,1,3,6,2,5); - } - } - - for (x=0x100001;x<0x400000;x+=2) - { - if (x&0x80000) - { - ROM[x] = ROM[x]^0xff; - ROM[x] = BITSWAP8(ROM[x], 2,7,5,4,1,0,3,6); - } - else - { - ROM[x] = BITSWAP8(ROM[x], 6,1,4,2,7,0,3,5); - } - } - - // boot vectors don't seem to be valid, so they are patched... - ROM[1] = 0x01; - ROM[0] = 0x00; - ROM[3] = 0x00; - ROM[2] = 0x00; - ROM[5] = 0x00; - ROM[4] = 0x00; - ROM[7] = 0x02; - ROM[6] = 0x10; - - memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770071, 0, 0, "DSWA"); - memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770072, 0x770073, 0, 0, "DSWB"); -} - static WRITE16_HANDLER( aladbl_w ) { @@ -229,13 +179,72 @@ static READ16_HANDLER( aladbl_r ) return 0x0000; } + +static READ16_HANDLER( mk3ghw_dsw_r ) +{ + static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" }; + return input_port_read(space->machine, dswname[offset]); +} + + static DRIVER_INIT( aladbl ) { // 220000 = writes to mcu? 330000 = reads? memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x220000, 0x220001, 0, 0, aladbl_w); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x330000, 0x330001, 0, 0, aladbl_r); + DRIVER_INIT_CALL(megadrij); } -GAME( 1993, aladbl , 0, megadriv, aladbl, aladbl, ROT0, "bootleg / Sega", "Aladdin (bootleg of Japanese Megadrive version)", 0) -GAME( 1996, mk3ghw , 0, megadriv, mk3ghw, mk3ghw, ROT0, "bootleg / Midway", "Mortal Kombat 3 (bootleg of Megadrive version)", 0) +// this should be correct, the areas of the rom that differ to the original +// after this decode look like intentional changes +static DRIVER_INIT( mk3ghw ) +{ + int x; + UINT8 *rom = memory_region(machine, "maincpu"); + + for (x=0x000001;x<0x100001;x+=2) + { + if (x&0x80000) + { + rom[x] = rom[x]^0xff; + rom[x] = BITSWAP8(rom[x], 0,3,2,5,4,6,7,1); + } + else + { + rom[x] = rom[x]^0xff; + rom[x] = BITSWAP8(rom[x], 4,0,7,1,3,6,2,5); + } + } + + for (x=0x100001;x<0x400000;x+=2) + { + if (x&0x80000) + { + rom[x] = rom[x]^0xff; + rom[x] = BITSWAP8(rom[x], 2,7,5,4,1,0,3,6); + } + else + { + rom[x] = BITSWAP8(rom[x], 6,1,4,2,7,0,3,5); + } + } + + // boot vectors don't seem to be valid, so they are patched... + rom[0x01] = 0x01; + rom[0x00] = 0x00; + rom[0x03] = 0x00; + rom[0x02] = 0x00; + rom[0x05] = 0x00; + rom[0x04] = 0x00; + rom[0x07] = 0x02; + rom[0x06] = 0x10; + + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770075, 0, 0, mk3ghw_dsw_r ); + + DRIVER_INIT_CALL(megadriv); +} + + +GAME( 1993, aladbl, 0, megadriv, aladbl, aladbl, ROT0, "bootleg / Sega", "Aladdin (bootleg of Japanese Megadrive version)", 0) +GAME( 1996, mk3ghw, 0, megadriv, mk3ghw, mk3ghw, ROT0, "bootleg / Midway", "Mortal Kombat 3 (bootleg of Megadrive version)", 0) diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c index c8a53db40d8..3bf75e8d3bd 100644 --- a/src/mame/drivers/megadriv.c +++ b/src/mame/drivers/megadriv.c @@ -1533,6 +1533,7 @@ INPUT_PORTS_START( megadri6 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_PLAYER(2) PORT_NAME("P2 MODE") // mode INPUT_PORTS_END +/* verified from M68000 code */ INPUT_PORTS_START( ssf2ghw ) PORT_INCLUDE( md_common ) @@ -1546,7 +1547,7 @@ INPUT_PORTS_START( ssf2ghw ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) PORT_START("EXTRA1") /* Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) @@ -1606,7 +1607,8 @@ INPUT_PORTS_START( ssf2ghw ) // PORT_DIPSETTING( 0x00, "10 (Fastest)" ) INPUT_PORTS_END -INPUT_PORTS_START(mk3ghw) +/* verified from M68000 code */ +INPUT_PORTS_START( mk3ghw ) PORT_INCLUDE( md_common ) PORT_MODIFY("PAD1") @@ -1634,8 +1636,8 @@ INPUT_PORTS_START(mk3ghw) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_START("DSWA") PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) @@ -1646,22 +1648,32 @@ INPUT_PORTS_START(mk3ghw) PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) - PORT_BIT( 0xf8, 0x00, IPT_UNUSED ) +// PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_START("DSWB") - PORT_DIPUNKNOWN( 0x01, 0x00 ) - PORT_DIPUNKNOWN( 0x02, 0x00 ) - PORT_DIPUNKNOWN( 0x04, 0x00 ) - PORT_DIPUNKNOWN( 0x08, 0x00 ) - PORT_DIPUNKNOWN( 0x10, 0x00 ) - PORT_DIPUNKNOWN( 0x20, 0x00 ) + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) + PORT_DIPSETTING( 0x07, DEF_STR( Easiest ) ) + PORT_DIPSETTING( 0x06, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x05, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) +// PORT_DIPSETTING( 0x02, DEF_STR( Hardest ) ) +// PORT_DIPSETTING( 0x01, DEF_STR( Hardest ) ) +// PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) + PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH ) + PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH ) + PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPUNKNOWN( 0x80, 0x00 ) + PORT_DIPNAME( 0x80, 0x80, "Blood" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("DSWC") /* not even read in this set */ INPUT_PORTS_END - +/* verified from M68000 code */ INPUT_PORTS_START( aladbl ) PORT_INCLUDE( md_common ) @@ -1691,11 +1703,57 @@ INPUT_PORTS_START( aladbl ) PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) /* "NORMAL" */ PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) /* "DIFFICULT" */ // PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) - PORT_DIPUNUSED( 0x0040, IP_ACTIVE_HIGH ) - PORT_DIPUNUSED( 0x0080, IP_ACTIVE_HIGH ) + PORT_DIPUNUSED( 0x40, IP_ACTIVE_HIGH ) + PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH ) PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) /* needed to avoid credits getting mad */ INPUT_PORTS_END +/* verified from M68000 code */ +INPUT_PORTS_START( ssgbl ) + PORT_INCLUDE( md_common ) + + PORT_MODIFY("PAD1") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Shoot") // a + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Jump") // b + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) // c (duplicate shoot button) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) // start + + PORT_MODIFY("PAD2") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P1 Shoot") // a + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P1 Jump") // b + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) // c (duplicate shoot button) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) + + PORT_START("IN0") /* 3rd I/O port */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) + + PORT_START("DSWA") + PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) + + PORT_START("DSWB") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) + PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) + + PORT_START("DSWC") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x03, "3" ) + PORT_DIPSETTING( 0x02, "4" ) + PORT_DIPSETTING( 0x01, "5" ) + PORT_DIPSETTING( 0x00, "6" ) +INPUT_PORTS_END + UINT8 megadrive_io_data_regs[3]; UINT8 megadrive_io_ctrl_regs[3]; static UINT8 megadrive_io_tx_regs[3]; diff --git a/src/mame/drivers/ssf2md.c b/src/mame/drivers/ssf2md.c index af7290623d4..cc390d7a9b7 100644 --- a/src/mame/drivers/ssf2md.c +++ b/src/mame/drivers/ssf2md.c @@ -30,4 +30,4 @@ static DRIVER_INIT( ssf2ghw ) } -GAME( 1994, ssf2ghw, 0, megadriv, ssf2ghw, ssf2ghw, ROT0, "bootleg / Capcom", "Super Street Fighter II - The New Challengers (Arcade bootleg of Japanese MegaDrive version)", 0 ) +GAME( 1994, ssf2ghw, 0, megadriv, ssf2ghw, ssf2ghw, ROT0, "bootleg / Capcom", "Super Street Fighter II - The New Challengers (Arcade bootleg of Japanese MegaDrive version)", 0 ) diff --git a/src/mame/drivers/ssgbl.c b/src/mame/drivers/ssgbl.c index 90480f992d0..99ed110b679 100644 --- a/src/mame/drivers/ssgbl.c +++ b/src/mame/drivers/ssgbl.c @@ -3,8 +3,6 @@ /* Sunset Riders bootleg - based on Genesis / Megadrive version - - coinage system is protected? (by what?) - - title raster effect is broken (bug in megadrive code, happens with normal set too) */ @@ -18,57 +16,52 @@ ROM_START( ssgbl ) ROM_END -static READ16_HANDLER( sunsetbl_r ) +static READ16_HANDLER( ssgbl_dsw_r ) { - return mame_rand(space->machine); + static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" }; + return input_port_read(space->machine, dswname[offset]); } -static READ16_HANDLER( sunsetbl2_r ) +static DRIVER_INIT( ssgbl ) { - return 0x0000;//mame_rand(space->machine); -} - -static DRIVER_INIT( sunsetbl ) -{ - int i; + int x; UINT8* rom = memory_region(machine, "maincpu"); /* todo, reduce bitswaps to single swap */ - for (i=0x00001;i<0x40000;i+=2) + for (x=0x00001;x<0x40000;x+=2) { - rom[i] = rom[i] ^ 0xff; - rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,1,0 ); - rom[i] = BITSWAP8(rom[i], 1,6,5,4,3,2,7,0 ); - rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0 ); - rom[i] = BITSWAP8(rom[i], 7,6,5,2,3,4,1,0 ); - rom[i] = BITSWAP8(rom[i], 5,6,7,4,3,2,1,0 ); - rom[i] = BITSWAP8(rom[i], 7,5,6,4,3,2,1,0 ); + rom[x] = rom[x] ^ 0xff; + rom[x] = BITSWAP8(rom[x], 7,6,5,4,3,2,1,0 ); + rom[x] = BITSWAP8(rom[x], 1,6,5,4,3,2,7,0 ); + rom[x] = BITSWAP8(rom[x], 7,6,5,3,4,2,1,0 ); + rom[x] = BITSWAP8(rom[x], 7,6,5,2,3,4,1,0 ); + rom[x] = BITSWAP8(rom[x], 5,6,7,4,3,2,1,0 ); + rom[x] = BITSWAP8(rom[x], 7,5,6,4,3,2,1,0 ); } - for (i=0x40001;i<0x80000;i+=2) + for (x=0x40001;x<0x80000;x+=2) { - rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,1,0 ); - rom[i] = BITSWAP8(rom[i], 7,6,1,4, 3,2,5,0); - rom[i] = BITSWAP8(rom[i], 7,6,5,4,0,2,1,3 ); - rom[i] = BITSWAP8(rom[i], 2,6,5,4,3,7,1,0 ); - rom[i] = BITSWAP8(rom[i], 7,6,5,0,3,2,1,4 ); - rom[i] = BITSWAP8(rom[i], 7,6,5,1,3,2,4,0 ); + rom[x] = BITSWAP8(rom[x], 7,6,5,4,3,2,1,0 ); + rom[x] = BITSWAP8(rom[x], 7,6,1,4,3,2,5,0 ); + rom[x] = BITSWAP8(rom[x], 7,6,5,4,0,2,1,3 ); + rom[x] = BITSWAP8(rom[x], 2,6,5,4,3,7,1,0 ); + rom[x] = BITSWAP8(rom[x], 7,6,5,0,3,2,1,4 ); + rom[x] = BITSWAP8(rom[x], 7,6,5,1,3,2,4,0 ); } - memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x77007f, 0, 0, sunsetbl_r); - memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa10006, 0xa10007, 0, 0, sunsetbl2_r); // coins?? - - /* patch the startup and boot vector?! */ - rom[0x01] = 0x00; - rom[0x00] = 0xff; - rom[0x03] = 0xff; + // boot vectors don't seem to be valid, so they are patched... + rom[0x01] = 0x01; + rom[0x00] = 0x00; + rom[0x03] = 0x00; rom[0x02] = 0x00; rom[0x06] = 0xd2; rom[0x07] = 0x00; + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770075, 0, 0, ssgbl_dsw_r ); + DRIVER_INIT_CALL(megadriv); } -GAME( 1993, ssgbl , 0, megadriv, megadriv, sunsetbl, ROT0, "bootleg", "Sunset Riders (bootleg of Megadrive version)", GAME_NOT_WORKING) // playable, but coin system is broken +GAME( 1993, ssgbl, 0, megadriv, ssgbl, ssgbl, ROT0, "bootleg", "Sunset Riders (bootleg of Megadrive version)", 0) diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h index edeee6a6996..036fd83e749 100644 --- a/src/mame/includes/megadriv.h +++ b/src/mame/includes/megadriv.h @@ -13,6 +13,7 @@ extern DRIVER_INIT( mpnew ); INPUT_PORTS_EXTERN( md_common ); INPUT_PORTS_EXTERN( megadriv ); INPUT_PORTS_EXTERN( aladbl ); +INPUT_PORTS_EXTERN( ssgbl ); INPUT_PORTS_EXTERN( megadri6 ); INPUT_PORTS_EXTERN( ssf2ghw ); INPUT_PORTS_EXTERN( mk3ghw );