trunk/src/mame/drivers/pcktgal.c
| r19858 | r19859 | |
| 19 | 19 | #include "sound/msm5205.h" |
| 20 | 20 | #include "includes/pcktgal.h" |
| 21 | 21 | #include "video/decbac06.h" |
| 22 | #include "machine/deco222.h" |
| 22 | 23 | |
| 23 | 24 | /***************************************************************************/ |
| 24 | 25 | |
| r19858 | r19859 | |
| 217 | 218 | |
| 218 | 219 | /***************************************************************************/ |
| 219 | 220 | |
| 221 | |
| 222 | void pcktgal_state::machine_start() |
| 223 | { |
| 224 | machine().root_device().membank("bank3")->configure_entries(0, 2, machine().root_device().memregion("audiocpu")->base() + 0x10000, 0x4000); |
| 225 | } |
| 226 | |
| 220 | 227 | static MACHINE_CONFIG_START( pcktgal, pcktgal_state ) |
| 221 | 228 | |
| 222 | 229 | /* basic machine hardware */ |
| r19858 | r19859 | |
| 224 | 231 | MCFG_CPU_PROGRAM_MAP(pcktgal_map) |
| 225 | 232 | MCFG_CPU_VBLANK_INT_DRIVER("screen", pcktgal_state, nmi_line_pulse) |
| 226 | 233 | |
| 227 | | MCFG_CPU_ADD("audiocpu", M6502, 1500000) |
| 234 | MCFG_CPU_ADD("audiocpu", DECO_222, 1500000) |
| 228 | 235 | MCFG_CPU_PROGRAM_MAP(pcktgal_sound_map) |
| 229 | 236 | /* IRQs are caused by the ADPCM chip */ |
| 230 | 237 | /* NMIs are caused by the main CPU */ |
| r19858 | r19859 | |
| 265 | 272 | MCFG_SCREEN_UPDATE_DRIVER(pcktgal_state, screen_update_pcktgalb) |
| 266 | 273 | MACHINE_CONFIG_END |
| 267 | 274 | |
| 275 | static MACHINE_CONFIG_DERIVED( pcktgal2, pcktgal ) |
| 276 | MCFG_DEVICE_REMOVE("audiocpu") |
| 277 | MCFG_CPU_ADD("audiocpu", M6502, 1500000) /* doesn't use the encrypted 222 */ |
| 278 | MCFG_CPU_PROGRAM_MAP(pcktgal_sound_map) |
| 279 | MACHINE_CONFIG_END |
| 280 | |
| 268 | 281 | /***************************************************************************/ |
| 269 | 282 | |
| 270 | 283 | ROM_START( pcktgal ) |
| r19858 | r19859 | |
| 408 | 421 | |
| 409 | 422 | /***************************************************************************/ |
| 410 | 423 | |
| 411 | | DRIVER_INIT_MEMBER(pcktgal_state,deco222) |
| 412 | | { |
| 413 | | int A; |
| 414 | | address_space &space = machine().device("audiocpu")->memory().space(AS_PROGRAM); |
| 415 | | UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x10000); |
| 416 | | UINT8 *rom = machine().root_device().memregion("audiocpu")->base(); |
| 417 | 424 | |
| 418 | | space.set_decrypted_region(0x8000, 0xffff, decrypted); |
| 419 | 425 | |
| 420 | | /* bits 5 and 6 of the opcodes are swapped */ |
| 421 | | for (A = 0x8000;A < 0x18000;A++) |
| 422 | | decrypted[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1); |
| 423 | | |
| 424 | | machine().root_device().membank("bank3")->configure_entries(0, 2, machine().root_device().memregion("audiocpu")->base() + 0x10000, 0x4000); |
| 425 | | machine().root_device().membank("bank3")->configure_decrypted_entries(0, 2, &decrypted[0x8000], 0x4000); |
| 426 | | } |
| 427 | | |
| 428 | | DRIVER_INIT_MEMBER(pcktgal_state,graphics) |
| 426 | DRIVER_INIT_MEMBER(pcktgal_state,pcktgal) |
| 429 | 427 | { |
| 430 | 428 | UINT8 *rom = machine().root_device().memregion("gfx1")->base(); |
| 431 | 429 | int len = machine().root_device().memregion("gfx1")->bytes(); |
| 432 | 430 | int i,j,temp[16]; |
| 433 | 431 | |
| 434 | | machine().root_device().membank("bank3")->configure_entries(0, 2, machine().root_device().memregion("audiocpu")->base() + 0x10000, 0x4000); |
| 435 | | |
| 436 | 432 | /* Tile graphics roms have some swapped lines, original version only */ |
| 437 | 433 | for (i = 0x00000;i < len;i += 32) |
| 438 | 434 | { |
| r19858 | r19859 | |
| 445 | 441 | } |
| 446 | 442 | } |
| 447 | 443 | |
| 448 | | DRIVER_INIT_MEMBER(pcktgal_state,pcktgal) |
| 449 | | { |
| 450 | | DRIVER_INIT_CALL(deco222); |
| 451 | | DRIVER_INIT_CALL(graphics); |
| 452 | | } |
| 453 | 444 | |
| 445 | |
| 454 | 446 | /***************************************************************************/ |
| 455 | 447 | |
| 456 | 448 | GAME( 1987, pcktgal, 0, pcktgal, pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal (Japan)", 0 ) |
| 457 | | GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, pcktgal_state, deco222, ROT0, "bootleg", "Pocket Gal (bootleg)", 0 ) |
| 458 | | GAME( 1989, pcktgal2, pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation", "Pocket Gal 2 (English)", 0 ) |
| 459 | | GAME( 1989, pcktgal2j,pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", 0 ) |
| 460 | | GAME( 1989, spool3, pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation", "Super Pool III (English)", 0 ) |
| 461 | | GAME( 1990, spool3i, pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", 0 ) |
| 449 | GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, driver_device, 0, ROT0, "bootleg", "Pocket Gal (bootleg)", 0 ) |
| 450 | GAME( 1989, pcktgal2, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (English)", 0 ) |
| 451 | GAME( 1989, pcktgal2j,pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", 0 ) |
| 452 | GAME( 1989, spool3, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Super Pool III (English)", 0 ) |
| 453 | GAME( 1990, spool3i, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", 0 ) |