Previous 199869 Revisions Next

r19858 Thursday 27th December, 2012 at 15:33:58 UTC by David Haywood
may as well treat this as a 222, it either is, or has the same thing in logic (nw)
[src/mame/drivers]liberate.c

trunk/src/mame/drivers/liberate.c
r19857r19858
1919#include "cpu/m6502/m6502.h"
2020#include "sound/ay8910.h"
2121#include "includes/liberate.h"
22#include "machine/deco222.h"
2223
2324/*************************************
2425 *
r19857r19858
825826   MCFG_CPU_IO_MAP(deco16_io_map)
826827   MCFG_CPU_VBLANK_INT_DRIVER("screen", liberate_state,  deco16_interrupt)
827828
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? */
829830   MCFG_CPU_PROGRAM_MAP(liberate_sound_map)
830831   MCFG_CPU_PERIODIC_INT_DRIVER(liberate_state, nmi_line_pulse, 16*60) /* ??? */
831832
r19857r19858
904905   MCFG_CPU_IO_MAP(deco16_io_map)
905906   MCFG_CPU_VBLANK_INT_DRIVER("screen", liberate_state,  deco16_interrupt)
906907
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? */
908909   MCFG_CPU_PROGRAM_MAP(liberate_sound_map)
909910   MCFG_CPU_PERIODIC_INT_DRIVER(liberate_state, nmi_line_pulse, 16*60) /* ??? */
910911
r19857r19858
13441345 *
13451346 *************************************/
13461347
1347static 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
13611348DRIVER_INIT_MEMBER(liberate_state,prosport)
13621349{
13631350   UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
r19857r19858
13671354   for (i = 0; i < 0x10000; i++)
13681355      RAM[i] = ((RAM[i] & 0x0f) << 4) | ((RAM[i] & 0xf0) >> 4);
13691356
1370   sound_cpu_decrypt(machine());
13711357}
13721358
13731359DRIVER_INIT_MEMBER(liberate_state,yellowcb)
r19857r19858
13941380   }
13951381
13961382   machine().root_device().membank("bank1")->configure_decrypted_entry(0, decrypted + 0x8000);
1397
1398   sound_cpu_decrypt(machine());
13991383}
14001384
14011385/*************************************

Previous 199869 Revisions Next


© 1997-2024 The MAME Team