trunk/src/mame/drivers/pgm.c
r26161 | r26162 | |
4121 | 4121 | |
4122 | 4122 | GAME( 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 */ |
4123 | 4123 | |
| 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 |
| 4126 | GAME( 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 |
| 4127 | GAME( 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 |
| 4128 | GAME( 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 | |
4124 | 4131 | /* ----------------------------------------------------------------------------------------------------------------------- |
4125 | 4132 | Partially Working, playable, but some imperfections |
4126 | 4133 | -----------------------------------------------------------------------------------------------------------------------*/ |
r26161 | r26162 | |
4156 | 4163 | |
4157 | 4164 | /* 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. */ |
4158 | 4165 | |
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 |
4160 | | GAME( 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 |
4161 | | GAME( 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 |
4162 | | GAME( 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 |
4163 | 4166 | |
4164 | 4167 | // simulation doesn't seem 100% |
4165 | 4168 | GAME( 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
r26161 | r26162 | |
145 | 145 | ADDRESS_MAP_END |
146 | 146 | |
147 | 147 | |
| 148 | |
| 149 | |
| 150 | MACHINE_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 | |
148 | 170 | MACHINE_START_MEMBER(pgm_arm_type3_state,pgm_arm_type3) |
149 | 171 | { |
150 | 172 | MACHINE_START_CALL_MEMBER(pgm); |
r26161 | r26162 | |
166 | 188 | MCFG_CPU_ADD("prot", ARM7, 33333333) // 55857G |
167 | 189 | MCFG_CPU_PROGRAM_MAP(55857G_arm7_map) |
168 | 190 | |
| 191 | MCFG_MACHINE_RESET_OVERRIDE(pgm_arm_type3_state, pgm_arm_type3_reset) |
169 | 192 | MACHINE_CONFIG_END |
170 | 193 | |
171 | 194 | |
r26161 | r26162 | |
378 | 401 | // in the table.. for e8 / fc we can deduce from the calling code and size of the functions expected that they should be the |
379 | 402 | // same as those in the killing blade plus 'killbldp' (there are also explicit jumps to these addresses in the code) |
380 | 403 | // |
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' |
382 | 405 | // 0x150 I haven't seen called, I guess it is 0x38 in size because the execute-only area ends at 0x188 |
383 | 406 | |
384 | 407 | |
r26161 | r26162 | |
407 | 430 | temp16[(base) /2] = 0xE12F; base += 2; |
408 | 431 | |
409 | 432 | // 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; |
412 | 458 | |
| 459 | |
| 460 | |
| 461 | |
413 | 462 | base = 0x150; |
414 | 463 | temp16[(base) /2] = 0xff1e; base += 2; |
415 | 464 | temp16[(base) /2] = 0xe12f; base += 2; |
r26161 | r26162 | |
421 | 470 | temp16[(base) /2] = 0x105c; base += 2; |
422 | 471 | temp16[(base) /2] = 0xE59F; base += 2; |
423 | 472 | |
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; |
427 | 473 | |
428 | 474 | |
429 | | #if 0 |
430 | | m_svg_ram_sel = 1; |
| 475 | |
431 | 476 | |
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 | | |
442 | 477 | machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::theglad_speedup_r),this)); |
443 | 478 | } |
444 | 479 | |
| 480 | INPUT_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 |
| 493 | INPUT_PORTS_END |
| 494 | |
445 | 495 | DRIVER_INIT_MEMBER(pgm_arm_type3_state,svg) |
446 | 496 | { |
447 | 497 | svg_basic_init(); |
r26161 | r26162 | |
475 | 525 | |
476 | 526 | machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::killbldp_speedup_r),this)); |
477 | 527 | |
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; |
482 | 532 | |
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 |
488 | 534 | // temp16[(base) /2] = 0x0000; base += 2; |
489 | 535 | // 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; |
490 | 540 | |
491 | 541 | } |
492 | 542 | |