Previous 199869 Revisions Next

r19859 Thursday 27th December, 2012 at 15:56:45 UTC by David Haywood
pcktgal - use the 222 (nw)
[src/mame/drivers]pcktgal.c
[src/mame/includes]pcktgal.h

trunk/src/mame/drivers/pcktgal.c
r19858r19859
1919#include "sound/msm5205.h"
2020#include "includes/pcktgal.h"
2121#include "video/decbac06.h"
22#include "machine/deco222.h"
2223
2324/***************************************************************************/
2425
r19858r19859
217218
218219/***************************************************************************/
219220
221
222void 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
220227static MACHINE_CONFIG_START( pcktgal, pcktgal_state )
221228
222229   /* basic machine hardware */
r19858r19859
224231   MCFG_CPU_PROGRAM_MAP(pcktgal_map)
225232   MCFG_CPU_VBLANK_INT_DRIVER("screen", pcktgal_state,  nmi_line_pulse)
226233
227   MCFG_CPU_ADD("audiocpu", M6502, 1500000)
234   MCFG_CPU_ADD("audiocpu", DECO_222, 1500000)
228235   MCFG_CPU_PROGRAM_MAP(pcktgal_sound_map)
229236                     /* IRQs are caused by the ADPCM chip */
230237                     /* NMIs are caused by the main CPU */
r19858r19859
265272   MCFG_SCREEN_UPDATE_DRIVER(pcktgal_state, screen_update_pcktgalb)
266273MACHINE_CONFIG_END
267274
275static 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)
279MACHINE_CONFIG_END
280
268281/***************************************************************************/
269282
270283ROM_START( pcktgal )
r19858r19859
408421
409422/***************************************************************************/
410423
411DRIVER_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();
417424
418   space.set_decrypted_region(0x8000, 0xffff, decrypted);
419425
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
428DRIVER_INIT_MEMBER(pcktgal_state,graphics)
426DRIVER_INIT_MEMBER(pcktgal_state,pcktgal)
429427{
430428   UINT8 *rom = machine().root_device().memregion("gfx1")->base();
431429   int len = machine().root_device().memregion("gfx1")->bytes();
432430   int i,j,temp[16];
433431
434   machine().root_device().membank("bank3")->configure_entries(0, 2, machine().root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
435
436432   /* Tile graphics roms have some swapped lines, original version only */
437433   for (i = 0x00000;i < len;i += 32)
438434   {
r19858r19859
445441   }
446442}
447443
448DRIVER_INIT_MEMBER(pcktgal_state,pcktgal)
449{
450   DRIVER_INIT_CALL(deco222);
451   DRIVER_INIT_CALL(graphics);
452}
453444
445
454446/***************************************************************************/
455447
456448GAME( 1987, pcktgal,  0,       pcktgal, pcktgal, pcktgal_state, pcktgal,  ROT0, "Data East Corporation", "Pocket Gal (Japan)", 0 )
457GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, pcktgal_state, deco222,  ROT0, "bootleg", "Pocket Gal (bootleg)", 0 )
458GAME( 1989, pcktgal2, pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation", "Pocket Gal 2 (English)", 0 )
459GAME( 1989, pcktgal2j,pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", 0 )
460GAME( 1989, spool3,   pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation", "Super Pool III (English)", 0 )
461GAME( 1990, spool3i,  pcktgal, pcktgal, pcktgal, pcktgal_state, graphics, ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", 0 )
449GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, driver_device, 0,        ROT0, "bootleg", "Pocket Gal (bootleg)", 0 )
450GAME( 1989, pcktgal2, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal,  ROT0, "Data East Corporation", "Pocket Gal 2 (English)", 0 )
451GAME( 1989, pcktgal2j,pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal,  ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", 0 )
452GAME( 1989, spool3,   pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal,  ROT0, "Data East Corporation", "Super Pool III (English)", 0 )
453GAME( 1990, spool3i,  pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal,  ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", 0 )
trunk/src/mame/includes/pcktgal.h
r19858r19859
1414   DECLARE_WRITE8_MEMBER(pcktgal_adpcm_data_w);
1515   DECLARE_READ8_MEMBER(pcktgal_adpcm_reset_r);
1616   DECLARE_DRIVER_INIT(pcktgal);
17   DECLARE_DRIVER_INIT(deco222);
18   DECLARE_DRIVER_INIT(graphics);
1917   virtual void palette_init();
18   virtual void machine_start();
2019   UINT32 screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2120   UINT32 screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2221};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team