trunk/src/mame/drivers/shootout.c
| r19860 | r19861 | |
| 38 | 38 | #include "cpu/m6502/m6502.h" |
| 39 | 39 | #include "sound/2203intf.h" |
| 40 | 40 | #include "includes/shootout.h" |
| 41 | #include "machine/deco222.h" |
| 41 | 42 | |
| 42 | 43 | /*******************************************************************************/ |
| 43 | 44 | |
| r19860 | r19861 | |
| 264 | 265 | static MACHINE_CONFIG_START( shootout, shootout_state ) |
| 265 | 266 | |
| 266 | 267 | /* basic machine hardware */ |
| 267 | | MCFG_CPU_ADD("maincpu", M6502, 2000000) /* 2 MHz? */ |
| 268 | MCFG_CPU_ADD("maincpu", DECO_222, 2000000) /* 2 MHz? */ |
| 268 | 269 | MCFG_CPU_PROGRAM_MAP(shootout_map) |
| 269 | 270 | |
| 270 | 271 | MCFG_CPU_ADD("audiocpu", M6502, 1500000) |
| r19860 | r19861 | |
| 317 | 318 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 318 | 319 | MACHINE_CONFIG_END |
| 319 | 320 | |
| 321 | static MACHINE_CONFIG_DERIVED( shootouk, shootouj ) |
| 322 | /* the Korean 'bootleg' has the usual DECO222 style encryption */ |
| 323 | MCFG_DEVICE_REMOVE("maincpu") |
| 324 | MCFG_CPU_ADD("maincpu", DECO_222, 2000000) /* 2 MHz? */ |
| 325 | MCFG_CPU_PROGRAM_MAP(shootouj_map) |
| 326 | MACHINE_CONFIG_END |
| 320 | 327 | |
| 328 | |
| 329 | |
| 321 | 330 | ROM_START( shootout ) |
| 322 | 331 | ROM_REGION( 2*0x20000, "maincpu", 0 ) /* 128k for code + 128k for decrypted opcodes */ |
| 323 | 332 | ROM_LOAD( "cu00.b1", 0x08000, 0x8000, CRC(090edeb6) SHA1(ab849d123dacf3947b1ebd29b70a20e066911a60) ) /* opcodes encrypted */ |
| r19860 | r19861 | |
| 404 | 413 | |
| 405 | 414 | DRIVER_INIT_MEMBER(shootout_state,shootout) |
| 406 | 415 | { |
| 407 | | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 408 | | int length = machine().root_device().memregion("maincpu")->bytes(); |
| 409 | | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, length - 0x8000); |
| 410 | | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
| 411 | | int A; |
| 412 | | |
| 413 | | space.set_decrypted_region(0x8000, 0xffff, decrypt); |
| 414 | | |
| 415 | | for (A = 0x8000;A < length;A++) |
| 416 | | decrypt[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x40) >> 1) | ((rom[A] & 0x20) << 1); |
| 417 | | |
| 418 | 416 | machine().root_device().membank("bank1")->configure_entries(0, 16, machine().root_device().memregion("maincpu")->base() + 0x10000, 0x4000); |
| 419 | | machine().root_device().membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x8000, 0x4000); |
| 420 | 417 | } |
| 421 | 418 | |
| 422 | | DRIVER_INIT_MEMBER(shootout_state,shootouj) |
| 423 | | { |
| 424 | | machine().root_device().membank("bank1")->configure_entries(0, 16, machine().root_device().memregion("maincpu")->base() + 0x10000, 0x4000); |
| 425 | | } |
| 426 | 419 | |
| 427 | | |
| 428 | 420 | GAME( 1985, shootout, 0, shootout, shootout, shootout_state, shootout, ROT0, "Data East USA", "Shoot Out (US)", 0) |
| 429 | | GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootouj, ROT0, "Data East Corporation", "Shoot Out (Japan)", 0 ) |
| 430 | | GAME( 1985, shootoutb, shootout, shootouj, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", 0 ) |
| 421 | GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", 0 ) |
| 422 | GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", 0 ) |