Previous 199869 Revisions Next

r26162 Thursday 14th November, 2013 at 20:36:35 UTC by David Haywood
I think it basically works now, so marked it as such, need to test more tho so might end up unmarking it again later.
[src/mame/drivers]pgm.c
[src/mame/includes]pgm.h
[src/mame/machine]pgmprot_igs027a_type3.c

trunk/src/mame/includes/pgm.h
r26161r26162
383383   DECLARE_READ16_MEMBER( dmnfrnt_main_speedup_r );
384384   DECLARE_READ32_MEMBER( killbldp_speedup_r );
385385   DECLARE_READ32_MEMBER( theglad_speedup_r );
386   DECLARE_MACHINE_RESET(pgm_arm_type3_reset);
386387};
387388
388389
r26161r26162
531532/*----------- defined in machine/pgmprot3.c -----------*/
532533
533534MACHINE_CONFIG_EXTERN( pgm_arm_type3 );
535INPUT_PORTS_EXTERN(theglad);
534536
535537/*----------- defined in machine/pgmprot4.c -----------*/
536538
trunk/src/mame/drivers/pgm.c
r26161r26162
41214121
41224122GAME( 2005, killbldp,     pgm,       pgm_arm_type3,     pgm, pgm_arm_type3_state,    killbldp,   ROT0,   "IGS", "The Killing Blade Plus (ver. 300)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) /* using internal rom from bootleg */
41234123
4124// we're using a partial dump of the internal rom (sans the execute only area) with handcrafted startup code..
4125// all 3 68k roms still have V100 strings, but are clearly different builds, there don't appear to be build string dates in them.  Two of the external ARM roms are marked V100 but are different builds, the single PCB v100 appears to be a later revision than the cart V100 as it shares the internal ROM with the V107 cart version, the v100 cart has a different internal ROM
4126GAME( 2003, theglad,      pgm,       pgm_arm_type3,     theglad, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V101) (ARM label V107, ROM 06/06/03 SHEN JIAN V107)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // ARM time: 16:17:27
4127GAME( 2003, theglada,     theglad,   pgm_arm_type3,     theglad, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 01/16/03 SHEN JIAN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // ARM time: 10:39:25
4128GAME( 2003, thegladpcb,   theglad,   pgm_arm_type3,     theglad, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 02/25/03 SHEN JIAN) (JAMMA PCB)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )// ARM time: 16:32:21
4129
4130
41244131/* -----------------------------------------------------------------------------------------------------------------------
41254132   Partially Working, playable, but some imperfections
41264133   -----------------------------------------------------------------------------------------------------------------------*/
r26161r26162
41564163
41574164/* Games below this point are known to have an 'execute only' internal ROM area covering an area at the start of the internal ROM.  This can't be read when running code from either internal or external ROM space. */
41584165
4159// all 3 68k roms still have V100 strings, but are clearly different builds, there don't appear to be build string dates in them.  Two of the external ARM roms are marked V100 but are different builds, the single PCB v100 appears to be a later revision than the cart V100 as it shares the internal ROM with the V107 cart version, the v100 cart has a different internal ROM
4160GAME( 2003, theglad,      pgm,       pgm_arm_type3,     pgm, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator - Road of the Sword / Shen Jian (M68k label V101) (ARM label V107, ROM 06/06/03 SHEN JIAN V107)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // ARM time: 16:17:27
4161GAME( 2003, theglada,     theglad,   pgm_arm_type3,     pgm, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator - Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 01/16/03 SHEN JIAN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // ARM time: 10:39:25
4162GAME( 2003, thegladpcb,   theglad,   pgm_arm_type3,     pgm, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator - Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 02/25/03 SHEN JIAN) (JAMMA PCB)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // ARM time: 16:32:21
41634166
41644167// simulation doesn't seem 100%
41654168GAME( 2004, oldsplus,     pgm,       pgm_arm_type1_sim, oldsplus, pgm_arm_type1_state,     oldsplus,   ROT0,   "IGS", "Oriental Legend Special Plus / Xi You Shi E Zhuan Super Plus", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */
trunk/src/mame/machine/pgmprot_igs027a_type3.c
r26161r26162
145145ADDRESS_MAP_END
146146
147147
148
149
150MACHINE_RESET_MEMBER(pgm_arm_type3_state, pgm_arm_type3_reset)
151{
152   // this is the location of the region in the internal rom, for some reaosn Japan doesn't play attract music (original game feature? bad code flow?)
153   UINT16 *temp16 = (UINT16 *)memregion("prot")->base();
154   int base = -1;
155
156   if (!strcmp(machine().system().name, "theglad")) base = 0x3316;
157   if (!strcmp(machine().system().name, "thegladpcb")) base = 0x3316;
158
159   if (base != -1)
160   {
161      int regionhack = ioport("RegionHack")->read();
162      if (regionhack != 0xff)
163      {
164         temp16[(base) / 2] = regionhack; base += 2;
165      }
166   }
167   MACHINE_RESET_CALL_MEMBER(pgm);
168}
169
148170MACHINE_START_MEMBER(pgm_arm_type3_state,pgm_arm_type3)
149171{
150172   MACHINE_START_CALL_MEMBER(pgm);
r26161r26162
166188   MCFG_CPU_ADD("prot", ARM7, 33333333)    // 55857G
167189   MCFG_CPU_PROGRAM_MAP(55857G_arm7_map)
168190
191   MCFG_MACHINE_RESET_OVERRIDE(pgm_arm_type3_state, pgm_arm_type3_reset)
169192MACHINE_CONFIG_END
170193
171194
r26161r26162
378401   // in the table.. for e8 / fc we can deduce from the calling code and size of the functions expected that they should be the
379402   // same as those in the killing blade plus 'killbldp'  (there are also explicit jumps to these addresses in the code)
380403   //
381   // 0x110 is called after the 'continue' screen, I suspect it is unique code to the gladiator, probably 0x40 bytes long due to next entry being at 0x150
404   // 0x110 is called after the 'continue' screen, and on inserting coin, I guess it should change the game state, causing it to jump to the title screen when you insert a coin, and back to the attract after the game.. some kind of 'soft reset'
382405   // 0x150 I haven't seen called, I guess it is 0x38 in size because the execute-only area ends at 0x188
383406
384407
r26161r26162
407430   temp16[(base) /2] = 0xE12F; base += 2;
408431
409432//   base = 0x110; // already at 0x110
410   temp16[(base) /2] = 0xff1e; base += 2;
411   temp16[(base) /2] = 0xe12f; base += 2;
433//   temp16[(base) /2] = 0xff1e; base += 2;
434//   temp16[(base) /2] = 0xe12f; base += 2;
435//   temp16[(base) /2] = 0xf302; base += 2;
436//   temp16[(base) /2] = 0xe3a0; base += 2;
437   // set up stack again, soft-reset reset with a ram variable set to 0
438   temp16[(base) /2] = 0x00D1; base += 2;
439   temp16[(base) /2] = 0xE3A0; base += 2;
440   temp16[(base) /2] = 0xF000; base += 2;
441   temp16[(base) /2] = 0xE121; base += 2;
442   temp16[(base) /2] = 0xD0b8; base += 2;
443   temp16[(base) /2] = 0xE59F; base += 2;
444   temp16[(base) /2] = 0x00D3; base += 2;
445   temp16[(base) /2] = 0xE3A0; base += 2;
446   temp16[(base) /2] = 0xF000; base += 2;
447   temp16[(base) /2] = 0xE121; base += 2;
448   temp16[(base) /2] = 0xD0b0; base += 2;
449   temp16[(base) /2] = 0xE59F; base += 2;
450   temp16[(base) /2] = 0x10b8; base += 2;
451   temp16[(base) /2] = 0xE59F; base += 2;
452   temp16[(base) /2] = 0x0000; base += 2;
453   temp16[(base) /2] = 0xE3A0; base += 2;
454   temp16[(base) /2] = 0x0000; base += 2;
455   temp16[(base) /2] = 0xE581; base += 2;
456   temp16[(base) /2] = 0xF302; base += 2;
457   temp16[(base) /2] = 0xE3A0; base += 2;
412458
459
460   
461
413462   base = 0x150;
414463   temp16[(base) /2] = 0xff1e; base += 2;
415464   temp16[(base) /2] = 0xe12f; base += 2;
r26161r26162
421470   temp16[(base) /2] = 0x105c; base += 2;
422471   temp16[(base) /2] = 0xE59F; base += 2;
423472
424   // this is the location of the region in the internal rom, for some reaosn Japan doesn't play attract music (original game feature? bad code flow?)
425   base = 0x3316;
426   temp16[(base) / 2] = 0x0006; base += 2;
427473
428474
429#if 0
430   m_svg_ram_sel = 1;
475   
431476
432   for (int i = 0; i < 0x8000; i++)
433   {
434      UINT16 *share16;
435      share16 = (UINT16 *)(m_svg_shareram[1]);
436      share16[i / 2] = 0x0003;
437      share16 = (UINT16 *)(m_svg_shareram[0]);
438      share16[i / 2] = 0x0003;
439   }
440#endif
441
442477   machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::theglad_speedup_r),this));
443478}
444479
480INPUT_PORTS_START( theglad )
481   PORT_INCLUDE ( pgm )
482
483   PORT_START("RegionHack")    /* Region - actually supplied by protection device */
484   PORT_CONFNAME( 0x00ff, 0x0006, DEF_STR( Region ) ) // oddly the game has no music when set to Japan, might be an emulation bug.. hack it to another region until we figure that out
485   PORT_CONFSETTING(      0x0000, DEF_STR( China ) )
486   PORT_CONFSETTING(      0x0001, DEF_STR( Taiwan ) )
487   PORT_CONFSETTING(      0x0002, DEF_STR( Japan ) )
488   PORT_CONFSETTING(      0x0003, DEF_STR( Korea ) )
489   PORT_CONFSETTING(      0x0004, DEF_STR( Hong_Kong ) )
490   PORT_CONFSETTING(      0x0005, "Spanish Territories" )
491   PORT_CONFSETTING(      0x0006, DEF_STR( World ) )
492   PORT_CONFSETTING(      0x00ff, "Don't Change" ) // don't hack the region
493INPUT_PORTS_END
494
445495DRIVER_INIT_MEMBER(pgm_arm_type3_state,svg)
446496{
447497   svg_basic_init();
r26161r26162
475525
476526   machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::killbldp_speedup_r),this));
477527
478   UINT16 *temp16 = (UINT16 *)memregion("prot")->base();
479   int base = 0xfc;
480   temp16[(base) /2] = 0x0000; base += 2;   
481   temp16[(base) /2] = 0xE1A0; base += 2;   
528//   UINT16 *temp16 = (UINT16 *)memregion("prot")->base();
529//   int base = 0xfc; // startup table uploads
530//   temp16[(base) /2] = 0x0000; base += 2;   
531//   temp16[(base) /2] = 0xE1A0; base += 2;   
482532   
483   base = 0xd4;
484   temp16[(base) /2] = 0x0000; base += 2;   
485   temp16[(base) /2] = 0xE1A0; base += 2;   
486
487//   base = 0x120;
533//   base = 0xd4; // startup table uploads
488534//   temp16[(base) /2] = 0x0000; base += 2;   
489535//   temp16[(base) /2] = 0xE1A0; base += 2;   
536//
537//   base = 0x120; // reset game state, uncomment this to break boot sequence how theglad was broken...
538//   temp16[(base) /2] = 0x0000; base += 2;   
539//   temp16[(base) /2] = 0xE1A0; base += 2;   
490540
491541}
492542

Previous 199869 Revisions Next


© 1997-2024 The MAME Team