trunk/src/mame/drivers/liberate.c
| r19857 | r19858 | |
| 19 | 19 | #include "cpu/m6502/m6502.h" |
| 20 | 20 | #include "sound/ay8910.h" |
| 21 | 21 | #include "includes/liberate.h" |
| 22 | #include "machine/deco222.h" |
| 22 | 23 | |
| 23 | 24 | /************************************* |
| 24 | 25 | * |
| r19857 | r19858 | |
| 825 | 826 | MCFG_CPU_IO_MAP(deco16_io_map) |
| 826 | 827 | MCFG_CPU_VBLANK_INT_DRIVER("screen", liberate_state, deco16_interrupt) |
| 827 | 828 | |
| 828 | | MCFG_CPU_ADD("audiocpu",M6502, 1500000) |
| 829 | MCFG_CPU_ADD("audiocpu",DECO_222, 1500000) /* is it a real 222 (M6502 with bitswapped opcodes), or the same thing in external logic? */ |
| 829 | 830 | MCFG_CPU_PROGRAM_MAP(liberate_sound_map) |
| 830 | 831 | MCFG_CPU_PERIODIC_INT_DRIVER(liberate_state, nmi_line_pulse, 16*60) /* ??? */ |
| 831 | 832 | |
| r19857 | r19858 | |
| 904 | 905 | MCFG_CPU_IO_MAP(deco16_io_map) |
| 905 | 906 | MCFG_CPU_VBLANK_INT_DRIVER("screen", liberate_state, deco16_interrupt) |
| 906 | 907 | |
| 907 | | MCFG_CPU_ADD("audiocpu", M6502, 1500000/2) |
| 908 | MCFG_CPU_ADD("audiocpu", DECO_222, 1500000/2) /* is it a real 222 (M6502 with bitswapped opcodes), or the same thing in external logic? */ |
| 908 | 909 | MCFG_CPU_PROGRAM_MAP(liberate_sound_map) |
| 909 | 910 | MCFG_CPU_PERIODIC_INT_DRIVER(liberate_state, nmi_line_pulse, 16*60) /* ??? */ |
| 910 | 911 | |
| r19857 | r19858 | |
| 1344 | 1345 | * |
| 1345 | 1346 | *************************************/ |
| 1346 | 1347 | |
| 1347 | | static void sound_cpu_decrypt(running_machine &machine) |
| 1348 | | { |
| 1349 | | address_space &space = machine.device("audiocpu")->memory().space(AS_PROGRAM); |
| 1350 | | UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000); |
| 1351 | | UINT8 *rom = machine.root_device().memregion("audiocpu")->base(); |
| 1352 | | int i; |
| 1353 | | |
| 1354 | | /* Bit swapping on sound cpu - Opcodes only */ |
| 1355 | | for (i = 0xc000; i < 0x10000; i++) |
| 1356 | | decrypted[i - 0xc000] = ((rom[i] & 0x20) << 1) | ((rom[i] & 0x40) >> 1) | (rom[i] & 0x9f); |
| 1357 | | |
| 1358 | | space.set_decrypted_region(0xc000, 0xffff, decrypted); |
| 1359 | | } |
| 1360 | | |
| 1361 | 1348 | DRIVER_INIT_MEMBER(liberate_state,prosport) |
| 1362 | 1349 | { |
| 1363 | 1350 | UINT8 *RAM = machine().root_device().memregion("maincpu")->base(); |
| r19857 | r19858 | |
| 1367 | 1354 | for (i = 0; i < 0x10000; i++) |
| 1368 | 1355 | RAM[i] = ((RAM[i] & 0x0f) << 4) | ((RAM[i] & 0xf0) >> 4); |
| 1369 | 1356 | |
| 1370 | | sound_cpu_decrypt(machine()); |
| 1371 | 1357 | } |
| 1372 | 1358 | |
| 1373 | 1359 | DRIVER_INIT_MEMBER(liberate_state,yellowcb) |
| r19857 | r19858 | |
| 1394 | 1380 | } |
| 1395 | 1381 | |
| 1396 | 1382 | machine().root_device().membank("bank1")->configure_decrypted_entry(0, decrypted + 0x8000); |
| 1397 | | |
| 1398 | | sound_cpu_decrypt(machine()); |
| 1399 | 1383 | } |
| 1400 | 1384 | |
| 1401 | 1385 | /************************************* |