Previous 199869 Revisions Next

r26201 Saturday 16th November, 2013 at 17:26:27 UTC by David Haywood
shuffle some code about (nw)
[src/mame/drivers]pgm.c
[src/mame/includes]pgm.h
[src/mame/machine]pgmprot_igs027a_type3.c

trunk/src/mame/drivers/pgm.c
r26200r26201
36763676
36773677   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
36783678   // data before 0x188 is read-protected and cannot be read even with a trojan (as with most 2001/2+ IGS titles)
3679   ROM_LOAD( "happy6_igs027a.bin", 0x000000, 0x04000, NO_DUMP )
3679//   ROM_LOAD( "happy6_igs027a.bin", 0x000000, 0x04000, NO_DUMP )
3680   // for testing only, this is from the gladiator and wrong for this game.
3681   ROM_LOAD( "happy6_igs027a_execute_only_area", 0x0000, 0x00188, NO_DUMP )
3682   ROM_LOAD( "happy6_igs027a_v100_japan.bin", 0x0188, 0x3e78, BAD_DUMP CRC(d7f06e2d) SHA1(9c3aca7a487f5329d84731e2c63d5ed591bf9d24) )    // from 'thegladpcb set'
36803683
3684
36813685   ROM_REGION( 0x800000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */
36823686   ROM_LOAD( "happy6in1_v101cn.u26", 0x000000, 0x400000, CRC(4a48ca1c) SHA1(3bebc091787903d45cb84c7302046602a903f59c) )
36833687
trunk/src/mame/machine/pgmprot_igs027a_type3.c
r26200r26201
77 used by
88
99 Demon Front (dmnfrnt) *1
10 The Gladiator (theglad)
10 The Gladiator (theglad) *2
1111 Spectral vs. Generation (svg)
1212 Happy 6-in-1 (happy6)
1313 The Killing Blade Plus (killbldp) *2
r26200r26201
1515 None of these work at all, with the following exception.
1616
1717 *1 - We bypass the internal ROM entirely! Game doesn't jump back
18 *2 - Partial dump of the internal ROM is used, but 'Execute Only' region is missing
18 *2 - Partial dump of internal ROM is used (currently only dumped from a Japan PCB, patched for other types) The missing code from the EO area is replaced with our own fake code with the same function
19 *2 - Complete dump of IGS027A ROM sourced from a bootleg, looks to be legitimate.
1920
2021 ----
2122
r26200r26201
3435 55857G is also used on the Cave single board PGM systems, but in those
3536 cases it behaves like the 55857E (pgmprot1.c)
3637
38 Most of these games run almost entirely on the ARM, simply passing display lists back to the 68k to process and reading inputs from the 68k into the shared RAM.
39
3740 ***********************************************************************/
3841
3942#include "emu.h"
r26200r26201
230233   temp16[(0x0092)/2] = 0x1000;
231234}
232235
233
234
235236void pgm_arm_type3_state::svg_latch_init()
236237{
237238   m_svg_latchdata_68k_w = 0;
r26200r26201
250251}
251252
252253
253DRIVER_INIT_MEMBER(pgm_arm_type3_state,theglad)
254void pgm_arm_type3_state::pgm_create_dummy_internal_arm_region_theglad(void)
254255{
255   svg_basic_init();
256   pgm_theglad_decrypt(machine());
257   svg_latch_init();
258//   pgm_create_dummy_internal_arm_region(0x188);
259
260256   UINT16 *temp16 = (UINT16 *)memregion("prot")->base();
261257
262258   int i;
r26200r26201
267263
268264   }
269265
270   
271
272
273
274
275266   // the interrupt code appears to be at 0x08000010
276267   // so point the FIQ vector to jump there, the actual internal EO area code
277268   // would not look like this because this reads from the EO area to get the jump address which is verified
r26200r26201
470461   base = 0x184;
471462   temp16[(base) /2] = 0x105c; base += 2;
472463   temp16[(base) /2] = 0xE59F; base += 2;
464}
473465
466DRIVER_INIT_MEMBER(pgm_arm_type3_state,theglad)
467{
468   svg_basic_init();
469   pgm_theglad_decrypt(machine());
470   svg_latch_init();
471//   pgm_create_dummy_internal_arm_region(0x188);
474472
475
473   pgm_create_dummy_internal_arm_region_theglad();
476474   
477475
478476   machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::theglad_speedup_r),this));
479477}
480478
481DRIVER_INIT_MEMBER(pgm_arm_type3_state, theglada)
479void pgm_arm_type3_state::pgm_patch_external_arm_rom_jumptable_theglada(int base)
482480{
483   DRIVER_INIT_CALL(theglad);
484
485481   // we don't have the correct internal ROM for this version, so insead we use the one we have and patch the jump table in the external ROM
486482   UINT32 subroutine_addresses[] =
487483   {
r26200r26201
504500      0x2BF4, 0x2CD8, 0x2E2C
505501   };
506502   UINT16 *extprot = (UINT16 *)memregion("user1")->base();
507   int base = 0x82078;
508503   /*
509504   0x00C8,0x00B4,0x00DC,0x011C,0x0160,0x02DC,0x0330,0x033C,
510505   0x0348,0x0354,0x0398,0x03A8,0x0410,0x0454,0x0480,0x059C,
r26200r26201
534529      base += 4;
535530//      printf("%04x (%08x)\n", subroutine_addresses[i], addr );
536531   }
532}
537533
534DRIVER_INIT_MEMBER(pgm_arm_type3_state, theglada)
535{
536   DRIVER_INIT_CALL(theglad);
537
538   pgm_patch_external_arm_rom_jumptable_theglada(0x82078);
538539   
539540}
540541
r26200r26201
647648   svg_basic_init();
648649   pgm_happy6_decrypt(machine());
649650   svg_latch_init();
650   pgm_create_dummy_internal_arm_region(0x4000);
651   pgm_create_dummy_internal_arm_region_theglad();
652   pgm_patch_external_arm_rom_jumptable_theglada(0x5f1c0);
653   
651654}
trunk/src/mame/includes/pgm.h
r26200r26201
346346   DECLARE_WRITE32_MEMBER( svg_latch_arm_w );
347347   void svg_basic_init();
348348   void pgm_create_dummy_internal_arm_region(int size);
349   void pgm_patch_external_arm_rom_jumptable_theglada(int base);
350   void pgm_create_dummy_internal_arm_region_theglad(void);
349351   void svg_latch_init();
350352   DECLARE_READ32_MEMBER( dmnfrnt_speedup_r );
351353   DECLARE_READ16_MEMBER( dmnfrnt_main_speedup_r );

Previous 199869 Revisions Next


© 1997-2024 The MAME Team