Previous 199869 Revisions Next

r21114 Saturday 16th February, 2013 at 07:51:40 UTC by Fabio Priuli
(MESS) megadriv.xml: added original uncracked dump of Tiny Toon Adventures 3 [Barver, Azathoth]
(MESS) megadriv.c: emulated protection in mulan, pokemon 2 (previously patched out) and in the real ttoon3 dump. [Fabio Priuli]
[hash]megadriv.xml
[src/mess/drivers]megadriv.c
[src/mess/machine]md_rom.c md_rom.h md_slot.c md_slot.h

trunk/src/mess/machine/md_slot.c
r21113r21114
270270   { LIONK3, "rom_lion3" },
271271   { MC_PIRATE, "rom_mcpir" },
272272   { MJLOVER, "rom_mjlov" },
273   { MULAN, "rom_mulan"},
274   { POKEMON2, "rom_poke2"},
275273   { REALTEC, "rom_realtec" },
276274   { REDCL_EN, "rom_redcl" },
277275   { REDCLIFF, "rom_redcl" },
r21113r21114
563561         for (int x = 0; x < 0x200000/2; x++)
564562            ROM16[x] = ROM16[x + 2] ^ 0x4040;
565563         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;
590564   }
591565}
592566
trunk/src/mess/machine/md_slot.h
r21113r21114
5353   LIONK3,                      /* Lion King 3, Super Donkey Kong 99, Super King Kong 99 */
5454   MC_PIRATE,                   /* Super 19 in 1, Super 15 in 1, 12 in 1 and a few more multicarts */
5555   MJLOVER,                     /* Mahjong Lover */
56   MULAN,                       /* Hua Mu Lan - Mulan */
57   POKEMON,                     /* Pocket Monster */
58   POKEMON2,                    /* Pocket Monster 2 */
5956   REALTEC,                     /* Whac a Critter/Mallet legend, Defend the Earth, Funnyworld/Ballonboy */
6057   REDCLIFF,                    /* Romance of the Three Kingdoms - Battle of Red Cliffs, already decoded from .mdx format */
6158   REDCL_EN,                    /* The encoded version... */
trunk/src/mess/machine/md_rom.c
r21113r21114
4848const device_type MD_ROM_TOPF = &device_creator<md_rom_topf_device>;
4949const device_type MD_ROM_RADICA = &device_creator<md_rom_radica_device>;
5050
51// below ones are currently unused, because the protection is patched out
52const device_type MD_ROM_MULAN = &device_creator<md_std_rom_device>;
53const device_type MD_ROM_POKE2 = &device_creator<md_std_rom_device>;
5451
55
5652md_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)
5753               : device_t(mconfig, type, name, tag, owner, clock),
5854               device_md_cart_interface( mconfig, *this )
r21113r21114
227223
228224void md_rom_lion3_device::device_start()
229225{
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;
232229   m_bank = 0;
233   save_item(NAME(m_prot_data));
234   save_item(NAME(m_prot_cmd));
230   save_item(NAME(m_reg));
235231   save_item(NAME(m_bank));
236232}
237233
r21113r21114
570566/*-------------------------------------------------
571567 KOF 99
572568 -------------------------------------------------*/
573// gfx glitch with the new code... uninitialized ram somewhere?
569
574570READ16_MEMBER(md_rom_kof99_device::read_a13)
575571{
576572   if (offset == 0x00/2)   return 0x00;    // startup protection check, chinese message if != 0
r21113r21114
600596 LION KING 3
601597 -------------------------------------------------*/
602598
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
603602READ16_MEMBER(md_rom_lion3_device::read)
604603{
605604   if (offset < 0x8000/2)
606605      return m_rom[offset + (m_bank * 0x8000)/2];
607606   else if (offset >= 0x600000/2 && offset < 0x700000/2)
608607   {
609      UINT16 retdata = 0;
610608      switch (offset & 0x7)
611609      {
610         case 0:
611            return m_reg[0];
612         case 1:
613            return m_reg[1];
612614         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];
636616         default:
637617            logerror("protection read, unknown offset %x\n", offset & 0x7);
638618            break;
639619      }
640      return retdata;
620      return 0;
641621   }
642622
643   return m_rom[offset];
623   return m_rom[MD_ADDR(offset)];
644624}
645625
646626WRITE16_MEMBER(md_rom_lion3_device::write)
647627{
648628   if (offset >= 0x600000/2 && offset < 0x700000/2)
649629   {
630//      printf("protection write, offset %d data %d\n", offset & 0x7, data);
650631      switch (offset & 0x7)
651632      {
652633         case 0x0:
653            m_prot_data = data;
634            m_reg[0] = data & 0xff;
654635            break;
655636         case 0x1:
656            m_prot_cmd = data;
637            m_reg[1] = data & 0xff;
657638            break;
658639         default:
659640            logerror("protection write, unknown offset %d\n", offset & 0x7);
660641            break;
661642      }
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)
666646      {
667647         case 0x0:
668            m_bank = data & 0xffff;
648            m_reg[2] = (m_reg[0] << 1);
669649            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:
670657         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);
672666            break;
673667      }
668     
674669   }
670   if (offset >= 0x700000/2)
671      m_bank = data & 0xff;
675672}
676673
677674/*-------------------------------------------------
trunk/src/mess/machine/md_rom.h
r21113r21114
235235   virtual DECLARE_WRITE16_MEMBER(write);
236236
237237private:
238   UINT8 m_prot_data, m_prot_cmd;
238   UINT8 m_reg[3];
239239   UINT16 m_bank;
240240};
241241
trunk/src/mess/drivers/megadriv.c
r21113r21114
345345   SLOT_INTERFACE_INTERNAL("rom_soulb",  MD_ROM_SOULB)
346346   SLOT_INTERFACE_INTERNAL("rom_squir",  MD_ROM_SQUIR)
347347   SLOT_INTERFACE_INTERNAL("rom_topf",  MD_ROM_TOPF)
348// these have protection patched out, instead of emulated!
349   SLOT_INTERFACE_INTERNAL("rom_mulan",  MD_STD_ROM)
350   SLOT_INTERFACE_INTERNAL("rom_poke2",  MD_STD_ROM)
351348SLOT_INTERFACE_END
352349
353350static MACHINE_CONFIG_START( ms_megadriv, md_cons_state )
trunk/hash/megadriv.xml
r21113r21114
1668616686      <year>199?</year>
1668716687      <publisher>&lt;unlicensed&gt;</publisher>
1668816688      <part name="cart" interface="megadriv_cart">
16689         <feature name="slot" value="rom_poke2" />
16689         <feature name="slot" value="rom_lion3" />
1669016690         <dataarea name="rom" size="2097152">
1669116691            <rom name="pocket monsters 2 (unl).bin" size="2097152" crc="30f7031f" sha1="dae100dfaee1b5b7816731cb2f43bcda3da273b7" offset="000000" loadflag="load16_word_swap" />
1669216692         </dataarea>
r21113r21114
2139721397   </software>
2139821398
2139921399   <software name="supdaisn">
21400      <description>Super Daisenryaku (Jpn, Rev. 02)</description>
21400      <description>Super Daisenryaku (Jpn, Rev. A)</description>
2140121401      <year>1989</year>
2140221402      <publisher>Sega</publisher>
2140321403      <info name="serial" value="G-4501-02"/>
r21113r21114
2658226582      </part>
2658326583   </software>
2658426584
26585   <software name="huamul">
26585   <software name="mulan">
2658626586      <description>Hua Mu Lan - Mulan (Chi)</description>
2658726587      <year>199?</year>
2658826588      <publisher>&lt;unlicensed&gt;</publisher>
2658926589      <part name="cart" interface="megadriv_cart">
26590         <feature name="slot" value="rom_mulan" />
26590         <feature name="slot" value="rom_lion3" />
2659126591         <dataarea name="rom" size="2097152">
2659226592            <rom name="hua mu lan - mulan (chi) (unl).bin" size="2097152" crc="796882b8" sha1="d8936c1023db646e1e20f9208b68271afbd6dbf4" offset="000000" loadflag="load16_word_swap" />
2659326593         </dataarea>
r21113r21114
2687326873      </part>
2687426874   </software>
2687526875
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
2687626890   <software name="topfight">
2687726891      <description>Top Fighter 2000 MK VIII</description>
2687826892      <year>199?</year>
r21113r21114
2706927083      <publisher>&lt;unlicensed&gt;</publisher>
2707027084      <info name="alt_title" value="Shi Zi Wang 3 - The Lion King 3 (Box?)"/>
2707127085      <part name="cart" interface="megadriv_cart">
27072         <feature name="slot" value="rom_lion3" />
2707327086         <dataarea name="rom" size="4194304">
2707427087            <rom name="lion_king_3.bin" size="2097152" crc="87e86943" sha1="0ef55dc45536963c8748192a4cb4864a87b03102" offset="000000" loadflag="load16_word_swap" />
2707527088            <rom size="2097152" offset="0x200000" loadflag="reload" />
r21113r21114
2712927142      <year>199?</year>
2713027143      <publisher>&lt;unlicensed&gt;</publisher>
2713127144      <part name="cart" interface="megadriv_cart">
27145         <feature name="slot" value="rom_lion3" />
2713227146         <dataarea name="rom" size="2097152">
2713327147            <rom name="soul edge vs samurai spirits (unl).bin" size="2097152" crc="b11bd611" sha1="28cef4b6829a791c56d4764812d0b345595c8389" offset="000000" loadflag="load16_word_swap" />
2713427148         </dataarea>
r21113r21114
2802628040      </part>
2802728041   </software>
2802828042
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
2804128043   <software name="tmntru">
2804228044      <description>Teenage Mutant Ninja Turtles - Vozvrashchenie Legendy (Rus)</description>
2804328045      <year>199?</year>

Previous 199869 Revisions Next


© 1997-2024 The MAME Team