trunk/src/mess/machine/md_slot.c
| r21113 | r21114 | |
| 270 | 270 | { LIONK3, "rom_lion3" }, |
| 271 | 271 | { MC_PIRATE, "rom_mcpir" }, |
| 272 | 272 | { MJLOVER, "rom_mjlov" }, |
| 273 | | { MULAN, "rom_mulan"}, |
| 274 | | { POKEMON2, "rom_poke2"}, |
| 275 | 273 | { REALTEC, "rom_realtec" }, |
| 276 | 274 | { REDCL_EN, "rom_redcl" }, |
| 277 | 275 | { REDCLIFF, "rom_redcl" }, |
| r21113 | r21114 | |
| 563 | 561 | for (int x = 0; x < 0x200000/2; x++) |
| 564 | 562 | ROM16[x] = ROM16[x + 2] ^ 0x4040; |
| 565 | 563 | break; |
| 566 | | |
| 567 | | // patch out protection in a bunch of titles... |
| 568 | | case POKEMON2: |
| 569 | | /*todo: emulate protection instead |
| 570 | | 006036:e000 |
| 571 | | 002540:6026 |
| 572 | | 001ed0:6026 |
| 573 | | 002476:6022 |
| 574 | | */ |
| 575 | | ROM16[0x06036/2] = 0xe000; |
| 576 | | ROM16[0x02540/2] = 0x6026; |
| 577 | | ROM16[0x01ed0/2] = 0x6026; |
| 578 | | ROM16[0x02476/2] = 0x6022; |
| 579 | | ROM16[0x7e300/2] = 0x60fe; |
| 580 | | break; |
| 581 | | case MULAN: |
| 582 | | /*todo: emulate protection instead |
| 583 | | 006036:e000 |
| 584 | | +more? |
| 585 | | */ |
| 586 | | // ROM16[0x01ed0/2] = 0xe000; |
| 587 | | // ROM16[0x02540/2] = 0xe000; |
| 588 | | ROM16[0x06036/2] = 0xe000; |
| 589 | | break; |
| 590 | 564 | } |
| 591 | 565 | } |
| 592 | 566 | |
trunk/src/mess/machine/md_slot.h
| r21113 | r21114 | |
| 53 | 53 | LIONK3, /* Lion King 3, Super Donkey Kong 99, Super King Kong 99 */ |
| 54 | 54 | MC_PIRATE, /* Super 19 in 1, Super 15 in 1, 12 in 1 and a few more multicarts */ |
| 55 | 55 | MJLOVER, /* Mahjong Lover */ |
| 56 | | MULAN, /* Hua Mu Lan - Mulan */ |
| 57 | | POKEMON, /* Pocket Monster */ |
| 58 | | POKEMON2, /* Pocket Monster 2 */ |
| 59 | 56 | REALTEC, /* Whac a Critter/Mallet legend, Defend the Earth, Funnyworld/Ballonboy */ |
| 60 | 57 | REDCLIFF, /* Romance of the Three Kingdoms - Battle of Red Cliffs, already decoded from .mdx format */ |
| 61 | 58 | REDCL_EN, /* The encoded version... */ |
trunk/src/mess/machine/md_rom.c
| r21113 | r21114 | |
| 48 | 48 | const device_type MD_ROM_TOPF = &device_creator<md_rom_topf_device>; |
| 49 | 49 | const device_type MD_ROM_RADICA = &device_creator<md_rom_radica_device>; |
| 50 | 50 | |
| 51 | | // below ones are currently unused, because the protection is patched out |
| 52 | | const device_type MD_ROM_MULAN = &device_creator<md_std_rom_device>; |
| 53 | | const device_type MD_ROM_POKE2 = &device_creator<md_std_rom_device>; |
| 54 | 51 | |
| 55 | | |
| 56 | 52 | md_std_rom_device::md_std_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 57 | 53 | : device_t(mconfig, type, name, tag, owner, clock), |
| 58 | 54 | device_md_cart_interface( mconfig, *this ) |
| r21113 | r21114 | |
| 227 | 223 | |
| 228 | 224 | void md_rom_lion3_device::device_start() |
| 229 | 225 | { |
| 230 | | m_prot_data = 0; |
| 231 | | m_prot_cmd = 0; |
| 226 | m_reg[0] = 0; |
| 227 | m_reg[1] = 0; |
| 228 | m_reg[2] = 0; |
| 232 | 229 | m_bank = 0; |
| 233 | | save_item(NAME(m_prot_data)); |
| 234 | | save_item(NAME(m_prot_cmd)); |
| 230 | save_item(NAME(m_reg)); |
| 235 | 231 | save_item(NAME(m_bank)); |
| 236 | 232 | } |
| 237 | 233 | |
| r21113 | r21114 | |
| 570 | 566 | /*------------------------------------------------- |
| 571 | 567 | KOF 99 |
| 572 | 568 | -------------------------------------------------*/ |
| 573 | | // gfx glitch with the new code... uninitialized ram somewhere? |
| 569 | |
| 574 | 570 | READ16_MEMBER(md_rom_kof99_device::read_a13) |
| 575 | 571 | { |
| 576 | 572 | if (offset == 0x00/2) return 0x00; // startup protection check, chinese message if != 0 |
| r21113 | r21114 | |
| 600 | 596 | LION KING 3 |
| 601 | 597 | -------------------------------------------------*/ |
| 602 | 598 | |
| 599 | // TODO: Sould Edge vs Samurai Spirits uses this same mechanism (or a very similar one) |
| 600 | // but expects to bankswitch more than the first 32k chunk... |
| 601 | |
| 603 | 602 | READ16_MEMBER(md_rom_lion3_device::read) |
| 604 | 603 | { |
| 605 | 604 | if (offset < 0x8000/2) |
| 606 | 605 | return m_rom[offset + (m_bank * 0x8000)/2]; |
| 607 | 606 | else if (offset >= 0x600000/2 && offset < 0x700000/2) |
| 608 | 607 | { |
| 609 | | UINT16 retdata = 0; |
| 610 | 608 | switch (offset & 0x7) |
| 611 | 609 | { |
| 610 | case 0: |
| 611 | return m_reg[0]; |
| 612 | case 1: |
| 613 | return m_reg[1]; |
| 612 | 614 | case 2: |
| 613 | | if (m_prot_cmd == 0) |
| 614 | | retdata = (m_prot_data << 1); |
| 615 | | else if (m_prot_cmd == 1) |
| 616 | | retdata = (m_prot_data >> 1); |
| 617 | | else if (m_prot_cmd == 2) |
| 618 | | { |
| 619 | | retdata = m_prot_data >> 4; |
| 620 | | retdata |= (m_prot_data & 0x0f) << 4; |
| 621 | | } |
| 622 | | else |
| 623 | | { |
| 624 | | /* printf("unk prot case %d\n", m_prot_cmd); */ |
| 625 | | retdata = (BIT(m_prot_data, 7) << 0); |
| 626 | | retdata |= (BIT(m_prot_data, 6) << 1); |
| 627 | | retdata |= (BIT(m_prot_data, 5) << 2); |
| 628 | | retdata |= (BIT(m_prot_data, 4) << 3); |
| 629 | | retdata |= (BIT(m_prot_data, 3) << 4); |
| 630 | | retdata |= (BIT(m_prot_data, 2) << 5); |
| 631 | | retdata |= (BIT(m_prot_data, 1) << 6); |
| 632 | | retdata |= (BIT(m_prot_data, 0) << 7); |
| 633 | | } |
| 634 | | break; |
| 635 | | |
| 615 | return m_reg[2]; |
| 636 | 616 | default: |
| 637 | 617 | logerror("protection read, unknown offset %x\n", offset & 0x7); |
| 638 | 618 | break; |
| 639 | 619 | } |
| 640 | | return retdata; |
| 620 | return 0; |
| 641 | 621 | } |
| 642 | 622 | |
| 643 | | return m_rom[offset]; |
| 623 | return m_rom[MD_ADDR(offset)]; |
| 644 | 624 | } |
| 645 | 625 | |
| 646 | 626 | WRITE16_MEMBER(md_rom_lion3_device::write) |
| 647 | 627 | { |
| 648 | 628 | if (offset >= 0x600000/2 && offset < 0x700000/2) |
| 649 | 629 | { |
| 630 | // printf("protection write, offset %d data %d\n", offset & 0x7, data); |
| 650 | 631 | switch (offset & 0x7) |
| 651 | 632 | { |
| 652 | 633 | case 0x0: |
| 653 | | m_prot_data = data; |
| 634 | m_reg[0] = data & 0xff; |
| 654 | 635 | break; |
| 655 | 636 | case 0x1: |
| 656 | | m_prot_cmd = data; |
| 637 | m_reg[1] = data & 0xff; |
| 657 | 638 | break; |
| 658 | 639 | default: |
| 659 | 640 | logerror("protection write, unknown offset %d\n", offset & 0x7); |
| 660 | 641 | break; |
| 661 | 642 | } |
| 662 | | } |
| 663 | | if (offset >= 0x700000/2 && offset < 0x800000/2) |
| 664 | | { |
| 665 | | switch (offset & 0x7) |
| 643 | |
| 644 | // update m_reg[2] |
| 645 | switch (m_reg[1] & 3) |
| 666 | 646 | { |
| 667 | 647 | case 0x0: |
| 668 | | m_bank = data & 0xffff; |
| 648 | m_reg[2] = (m_reg[0] << 1); |
| 669 | 649 | break; |
| 650 | case 0x1: |
| 651 | m_reg[2] = (m_reg[0] >> 1); |
| 652 | break; |
| 653 | case 0x2: |
| 654 | m_reg[2] = (m_reg[0] >> 4) | ((m_reg[0] & 0x0f) << 4); |
| 655 | break; |
| 656 | case 0x3: |
| 670 | 657 | default: |
| 671 | | logerror("bank write, unknown offset %d\n", offset & 0x7); |
| 658 | m_reg[2] = (BIT(m_reg[0], 7) << 0) |
| 659 | | (BIT(m_reg[0], 6) << 1) |
| 660 | | (BIT(m_reg[0], 5) << 2) |
| 661 | | (BIT(m_reg[0], 4) << 3) |
| 662 | | (BIT(m_reg[0], 3) << 4) |
| 663 | | (BIT(m_reg[0], 2) << 5) |
| 664 | | (BIT(m_reg[0], 1) << 6) |
| 665 | | (BIT(m_reg[0], 0) << 7); |
| 672 | 666 | break; |
| 673 | 667 | } |
| 668 | |
| 674 | 669 | } |
| 670 | if (offset >= 0x700000/2) |
| 671 | m_bank = data & 0xff; |
| 675 | 672 | } |
| 676 | 673 | |
| 677 | 674 | /*------------------------------------------------- |
trunk/hash/megadriv.xml
| r21113 | r21114 | |
| 16686 | 16686 | <year>199?</year> |
| 16687 | 16687 | <publisher><unlicensed></publisher> |
| 16688 | 16688 | <part name="cart" interface="megadriv_cart"> |
| 16689 | | <feature name="slot" value="rom_poke2" /> |
| 16689 | <feature name="slot" value="rom_lion3" /> |
| 16690 | 16690 | <dataarea name="rom" size="2097152"> |
| 16691 | 16691 | <rom name="pocket monsters 2 (unl).bin" size="2097152" crc="30f7031f" sha1="dae100dfaee1b5b7816731cb2f43bcda3da273b7" offset="000000" loadflag="load16_word_swap" /> |
| 16692 | 16692 | </dataarea> |
| r21113 | r21114 | |
| 21397 | 21397 | </software> |
| 21398 | 21398 | |
| 21399 | 21399 | <software name="supdaisn"> |
| 21400 | | <description>Super Daisenryaku (Jpn, Rev. 02)</description> |
| 21400 | <description>Super Daisenryaku (Jpn, Rev. A)</description> |
| 21401 | 21401 | <year>1989</year> |
| 21402 | 21402 | <publisher>Sega</publisher> |
| 21403 | 21403 | <info name="serial" value="G-4501-02"/> |
| r21113 | r21114 | |
| 26582 | 26582 | </part> |
| 26583 | 26583 | </software> |
| 26584 | 26584 | |
| 26585 | | <software name="huamul"> |
| 26585 | <software name="mulan"> |
| 26586 | 26586 | <description>Hua Mu Lan - Mulan (Chi)</description> |
| 26587 | 26587 | <year>199?</year> |
| 26588 | 26588 | <publisher><unlicensed></publisher> |
| 26589 | 26589 | <part name="cart" interface="megadriv_cart"> |
| 26590 | | <feature name="slot" value="rom_mulan" /> |
| 26590 | <feature name="slot" value="rom_lion3" /> |
| 26591 | 26591 | <dataarea name="rom" size="2097152"> |
| 26592 | 26592 | <rom name="hua mu lan - mulan (chi) (unl).bin" size="2097152" crc="796882b8" sha1="d8936c1023db646e1e20f9208b68271afbd6dbf4" offset="000000" loadflag="load16_word_swap" /> |
| 26593 | 26593 | </dataarea> |
| r21113 | r21114 | |
| 26873 | 26873 | </part> |
| 26874 | 26874 | </software> |
| 26875 | 26875 | |
| 26876 | <!-- Dump with CRC d65d83d4 is hacked to bypass protection --> |
| 26877 | <software name="ttoon3"> |
| 26878 | <description>Tiny Toon Adventures 3 (Tw)</description> |
| 26879 | <year>199?</year> |
| 26880 | <publisher>Gamtec?</publisher> |
| 26881 | <info name="serial" value="MT-601"/> |
| 26882 | <part name="cart" interface="megadriv_cart"> |
| 26883 | <feature name="slot" value="rom_squir" /> |
| 26884 | <dataarea name="rom" size="1048576"> |
| 26885 | <rom name="tiny toon adventures 3 (unl).bin" size="1048576" crc="f22f569d" sha1="6c68e4c7a5a14f926dc69ea5d5a452d9ead29a8e" offset="000000" loadflag="load16_word_swap" /> |
| 26886 | </dataarea> |
| 26887 | </part> |
| 26888 | </software> |
| 26889 | |
| 26876 | 26890 | <software name="topfight"> |
| 26877 | 26891 | <description>Top Fighter 2000 MK VIII</description> |
| 26878 | 26892 | <year>199?</year> |
| r21113 | r21114 | |
| 27069 | 27083 | <publisher><unlicensed></publisher> |
| 27070 | 27084 | <info name="alt_title" value="Shi Zi Wang 3 - The Lion King 3 (Box?)"/> |
| 27071 | 27085 | <part name="cart" interface="megadriv_cart"> |
| 27072 | | <feature name="slot" value="rom_lion3" /> |
| 27073 | 27086 | <dataarea name="rom" size="4194304"> |
| 27074 | 27087 | <rom name="lion_king_3.bin" size="2097152" crc="87e86943" sha1="0ef55dc45536963c8748192a4cb4864a87b03102" offset="000000" loadflag="load16_word_swap" /> |
| 27075 | 27088 | <rom size="2097152" offset="0x200000" loadflag="reload" /> |
| r21113 | r21114 | |
| 27129 | 27142 | <year>199?</year> |
| 27130 | 27143 | <publisher><unlicensed></publisher> |
| 27131 | 27144 | <part name="cart" interface="megadriv_cart"> |
| 27145 | <feature name="slot" value="rom_lion3" /> |
| 27132 | 27146 | <dataarea name="rom" size="2097152"> |
| 27133 | 27147 | <rom name="soul edge vs samurai spirits (unl).bin" size="2097152" crc="b11bd611" sha1="28cef4b6829a791c56d4764812d0b345595c8389" offset="000000" loadflag="load16_word_swap" /> |
| 27134 | 27148 | </dataarea> |
| r21113 | r21114 | |
| 28026 | 28040 | </part> |
| 28027 | 28041 | </software> |
| 28028 | 28042 | |
| 28029 | | <software name="ttoon3"> |
| 28030 | | <description>Tiny Toon Adventures 3 (Tw, Cracked)</description> |
| 28031 | | <year>199?</year> |
| 28032 | | <publisher>Gamtec?</publisher> |
| 28033 | | <info name="serial" value="MT-601"/> |
| 28034 | | <part name="cart" interface="megadriv_cart"> |
| 28035 | | <dataarea name="rom" size="1048576"> |
| 28036 | | <rom name="tiny toon adventures 3 (unl).bin" size="1048576" crc="d65d83d4" sha1="47b1ad463389d709fb49c7cef8fd033a6f95a301" offset="000000" loadflag="load16_word_swap" /> |
| 28037 | | </dataarea> |
| 28038 | | </part> |
| 28039 | | </software> |
| 28040 | | |
| 28041 | 28043 | <software name="tmntru"> |
| 28042 | 28044 | <description>Teenage Mutant Ninja Turtles - Vozvrashchenie Legendy (Rus)</description> |
| 28043 | 28045 | <year>199?</year> |