trunk/src/mame/machine/pgmprot_igs027a_type3.c
| r26205 | r26206 | |
| 159 | 159 | if (!strcmp(machine().system().name, "theglad")) base = 0x3316; |
| 160 | 160 | if (!strcmp(machine().system().name, "theglad100")) base = 0x3316; |
| 161 | 161 | if (!strcmp(machine().system().name, "theglad101")) base = 0x3316; |
| 162 | if (!strcmp(machine().system().name, "happy6")) base = 0x3316; |
| 162 | 163 | |
| 163 | 164 | if (base != -1) |
| 164 | 165 | { |
| r26205 | r26206 | |
| 643 | 644 | share16[0x158/2] = 0x0005; |
| 644 | 645 | } |
| 645 | 646 | |
| 647 | // todo, collapse these to an address swap |
| 648 | void pgm_arm_type3_state::pgm_descramble_happy6(UINT8* src) |
| 649 | { |
| 650 | UINT8* buffer = auto_alloc_array(machine(), UINT8, 0x800000); |
| 651 | int writeaddress = 0; |
| 652 | |
| 653 | for (int j = 0; j < 0x800; j += 0x200) |
| 654 | { |
| 655 | for (int i = j; i < 0x800000; i += 0x800) |
| 656 | { |
| 657 | memcpy(buffer + writeaddress, src + i, 0x200); |
| 658 | writeaddress += 0x200; |
| 659 | } |
| 660 | } |
| 661 | memcpy(src, buffer, 0x800000); |
| 662 | auto_free(machine(), buffer); |
| 663 | } |
| 664 | |
| 665 | |
| 666 | |
| 667 | void pgm_arm_type3_state::pgm_descramble_happy6_2(UINT8* src) |
| 668 | { |
| 669 | UINT8* buffer = auto_alloc_array(machine(), UINT8, 0x800000); |
| 670 | int writeaddress = 0; |
| 671 | for (int k = 0; k < 0x800000; k += 0x100000) |
| 672 | { |
| 673 | for (int j = 0; j < 0x40000; j += 0x10000) |
| 674 | { |
| 675 | for (int i = j; i < 0x100000; i += 0x40000) |
| 676 | { |
| 677 | memcpy(buffer + writeaddress, src + i + k, 0x10000); |
| 678 | writeaddress += 0x10000; |
| 679 | } |
| 680 | } |
| 681 | } |
| 682 | memcpy(src, buffer, 0x800000); |
| 683 | auto_free(machine(), buffer); |
| 684 | } |
| 685 | |
| 686 | INPUT_PORTS_START( happy6 ) |
| 687 | PORT_INCLUDE ( pgm ) |
| 688 | |
| 689 | PORT_START("RegionHack") /* Region - actually supplied by protection device */ |
| 690 | PORT_CONFNAME( 0x00ff, 0x0000, DEF_STR( Region ) ) |
| 691 | PORT_CONFSETTING( 0x0000, DEF_STR( China ) ) |
| 692 | PORT_CONFSETTING( 0x0001, DEF_STR( Taiwan ) ) |
| 693 | PORT_CONFSETTING( 0x0002, DEF_STR( Hong_Kong ) ) |
| 694 | PORT_CONFSETTING( 0x0003, "Singapore" ) |
| 695 | PORT_CONFSETTING( 0x0004, "Oversea" ) // unlikely this actually exists, there's no english anything! |
| 696 | PORT_CONFSETTING( 0x00ff, "Don't Change" ) // don't hack the region |
| 697 | INPUT_PORTS_END |
| 698 | |
| 646 | 699 | DRIVER_INIT_MEMBER(pgm_arm_type3_state,happy6) |
| 647 | 700 | { |
| 701 | UINT8 *src; |
| 702 | |
| 703 | src = (UINT8 *)(machine().root_device().memregion("tiles")->base()) + 0x180000; |
| 704 | pgm_descramble_happy6(src); |
| 705 | pgm_descramble_happy6_2(src); |
| 706 | |
| 707 | src = (UINT8 *)(machine().root_device().memregion("sprcol")->base()) + 0x000000; |
| 708 | pgm_descramble_happy6(src); |
| 709 | pgm_descramble_happy6_2(src); |
| 710 | |
| 711 | src = (UINT8 *)(machine().root_device().memregion("sprcol")->base()) + 0x0800000; |
| 712 | pgm_descramble_happy6(src); |
| 713 | pgm_descramble_happy6_2(src); |
| 714 | |
| 715 | src = (UINT8 *)(machine().root_device().memregion("sprmask")->base()); |
| 716 | pgm_descramble_happy6(src); |
| 717 | pgm_descramble_happy6_2(src); |
| 718 | |
| 719 | src = (UINT8 *)(machine().root_device().memregion("ics")->base()) + 0x400000; |
| 720 | pgm_descramble_happy6(src); |
| 721 | pgm_descramble_happy6_2(src); |
| 722 | |
| 648 | 723 | svg_basic_init(); |
| 649 | 724 | pgm_happy6_decrypt(machine()); |
| 650 | 725 | svg_latch_init(); |
| 651 | 726 | pgm_create_dummy_internal_arm_region_theglad(); |
| 652 | 727 | pgm_patch_external_arm_rom_jumptable_theglada(0x5f1c0); |
| 653 | | |
| 728 | |
| 729 | machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::theglad_speedup_r),this)); |
| 654 | 730 | } |
trunk/src/mame/drivers/pgm.c
| r26205 | r26206 | |
| 4225 | 4225 | GAME( 2004, kovlsjba, kovshp, pgm_arm_type1, kovsh, pgm_arm_type1_state, kovlsqh2, ROT0, "bootleg", "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN, set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 4226 | 4226 | |
| 4227 | 4227 | |
| 4228 | | GAME( 2004, happy6, pgm, pgm_arm_type3, pgm, pgm_arm_type3_state, happy6, ROT0, "IGS", "Happy 6-in-1 (ver. 101CN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 4228 | GAME( 2004, happy6, pgm, pgm_arm_type3, happy6, pgm_arm_type3_state, happy6, ROT0, "IGS", "Happy 6-in-1 (ver. 101CN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 4229 | 4229 | |
| 4230 | 4230 | GAME( 2005, svg, pgm, pgm_arm_type3, pgm, pgm_arm_type3_state, svg, ROT0, "IGS / Idea Factory", "S.V.G. - Spectral vs Generation (M68k label V200) (ARM label V200, ROM 10/11/05 S.V.G V201)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // label was 200, but it's code rev 201? // ARM time: 10:07:20 |
| 4231 | 4231 | GAME( 2005, svgpcb, svg, pgm_arm_type3, pgm, pgm_arm_type3_state, svgpcb, ROT0, "IGS / Idea Factory", "S.V.G. - Spectral vs Generation (M68k label V100JP) (ARM label V100JP ROM 05/12/05 S.V.G V100) (JAMMA PCB)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // ARM time: 15:31:35 |