Previous 199869 Revisions Next

r20696 Sunday 3rd February, 2013 at 13:13:52 UTC by Fabio Priuli
(MESS) megadriv.c: many updates to cart handling [Fabio Priuli]
 - updated carts to be slot devices
 - simplified loading and bankswitch mechanism
 - added support for real Sonic & Knuckles lock-on emulation (you can combine it freely
   with other carts, through the -cart2 slot which gets added automatically)
 - remove need for "pcb_type" feature from xml softlist, since the new "slot" feature is enough
 - moved SVP emulation to src/mess/ in view of conversion to a slot device as well
[hash]megadriv.xml
[src/mame]mame.mak
[src/mame/drivers]hshavoc.c megadrvb.c megatech.c
[src/mame/includes]megadriv.h
[src/mame/machine]md_cart.c megadriv.c megasvp.c
[src/mess]mess.mak
[src/mess/drivers]megadriv.c
[src/mess/includes]md.h*
[src/mess/machine]md_eeprom.c* md_eeprom.h* md_jcart.c* md_jcart.h* md_rom.c* md_rom.h* md_sk.c* md_sk.h* md_slot.c* md_slot.h* md_stm95.c* md_stm95.h* megasvp.c*

trunk/hash/megadriv.xml
r20695r20696
225225      <publisher>Electronic Arts</publisher>
226226      <part name="cart" interface="megadriv_cart">
227227         <feature name="pcb_type" value="SEGA-SRAM" />
228         <feature name="slot" value="rom_sram" />
228229         <dataarea name="rom" size="4194304">
229230            <rom name="nhl94_hl9402" size="1048576" crc="acecd225" sha1="5a11c7e3c925a6e256d2000b292ad7aa530bda0f" offset="000000" />
230231         </dataarea>
r20695r20696
248249      <publisher>Electronic Arts</publisher>
249250      <part name="cart" interface="megadriv_cart">
250251         <feature name="pcb_type" value="SEGA-SRAM" />
252         <feature name="slot" value="rom_sram" />
251253         <dataarea name="rom" size="4194304">
252254            <rom name="pga_tour_golf_pgt04" size="1048576" crc="8d980bb4" sha1="89b50dae5c88f633458a6faeb4ee288fcc94c1b1" offset="000000" />
253255         </dataarea>
r20695r20696
508510      <info name="serial" value="G-4503"/>
509511      <part name="cart" interface="megadriv_cart">
510512         <feature name="pcb_type" value="SEGA-EEPROM" />
513         <feature name="slot" value="rom_eeprom" />
511514         <feature name="pcb" value="171-5878" />
512515         <feature name="ic1" value="MPR-12750A-T" />
513516         <feature name="ic2" value="X24CO1P" />
r20695r20696
560563      <publisher>Sega</publisher>
561564      <part name="cart" interface="megadriv_cart">
562565         <feature name="pcb_type" value="SEGA-EEPROM" />
566         <feature name="slot" value="rom_eeprom" />
563567         <feature name="pcb" value="171-6584A" />
564568         <feature name="ic1" value="MPR-16211-SM" />
565569         <feature name="ic2" value="74HC32N" />
r20695r20696
676680      <publisher>Codemasters</publisher>
677681      <part name="cart" interface="megadriv_cart">
678682         <feature name="pcb_type" value="CM-JCART-SEPROM" />
683         <feature name="slot" value="rom_codemast" />
679684         <feature name="pcb" value="SRJCV2-1" />
680685         <dataarea name="rom" size="1048576">
681686            <rom name="mdm_2bead.bin" size="1048576" crc="42bfb7eb" sha1="ab29077a6a5c2ccc777b0bf22f4d5908401f4d47" offset="000000" loadflag="load16_word_swap" />
r20695r20696
689694      <publisher>Codemasters</publisher>
690695      <part name="cart" interface="megadriv_cart">
691696         <feature name="pcb_type" value="CM-JCART-SEPROM" />
697         <feature name="slot" value="rom_mm96" />
692698         <feature name="pcb" value="SRJCV2-2" />
693699         <dataarea name="rom" size="1048576">
694700            <rom name="mm96mdeddb.bin" size="1048576" crc="23319d0d" sha1="e8ff759679a0df2b3f9ece37ef686f248d3cf37b" offset="000000" loadflag="load16_word_swap" />
r20695r20696
703709      <publisher>Codemasters</publisher>
704710      <part name="cart" interface="megadriv_cart">
705711         <feature name="pcb_type" value="CM-JCART" />
712         <feature name="slot" value="rom_jcart" />
706713         <feature name="pcb" value="SRJCV1-2" />
707714         <dataarea name="rom" size="1048576">
708715            <rom name="mdst6636.bin" size="1048576" crc="94e505b2" sha1="4c830ace4590294bb374b4cab71ebebf44d9a07a" offset="000000" loadflag="load16_word_swap" />
r20695r20696
717724      <publisher>Sega</publisher>
718725      <part name="cart" interface="megadriv_cart">
719726         <feature name="pcb_type" value="SEGA-SRAM" />
727         <feature name="slot" value="rom_sram" />
720728         <feature name="pcb" value="171-5921" />
721729         <feature name="ic1" value="MPR-12851A S40" />
722730         <feature name="ic2" value="MPR-12852A-S" />
r20695r20696
738746      <publisher>Sega</publisher>
739747      <part name="cart" interface="megadriv_cart">
740748         <feature name="pcb_type" value="SEGA-SRAM" />
749         <feature name="slot" value="rom_sram" />
741750         <feature name="pcb" value="171-6278A" />
742751         <feature name="ic1" value="MPR-16933-H" />
743752         <feature name="ic2" value="GM76C88ALK-15" />
r20695r20696
770779      <publisher>Sega</publisher>
771780      <part name="cart" interface="megadriv_cart">
772781         <feature name="pcb_type" value="SEGA-SRAM" />
782         <feature name="slot" value="rom_sram" />
773783         <feature name="pcb" value="171-6278A" />
774784         <feature name="ic1" value="MPR-17512-U" />
775785         <feature name="ic2" value="GM76C88ALK-15" />
r20695r20696
789799      <publisher>Sega</publisher>
790800      <part name="cart" interface="megadriv_cart">
791801         <feature name="pcb_type" value="SEGA-SRAM" />
802         <feature name="slot" value="rom_sram" />
792803         <feature name="pcb" value="171-6278A" />
793804         <dataarea name="rom" size="2097152">
794805            <rom name="mpr-17513.ic1" size="2097152" crc="08dc1ead" sha1="7890074018f165eeb1281d81039fb07ccde7d197" offset="000000" loadflag="load16_word_swap" />
r20695r20696
804815      <publisher>Sega</publisher>
805816      <part name="cart" interface="megadriv_cart">
806817         <feature name="pcb_type" value="SEGA-SRAM" />
818         <feature name="slot" value="rom_sram" />
807819         <feature name="pcb" value="171-6278A" />
808820         <dataarea name="rom" size="2097152">
809821            <rom name="mpr-17514.ic1" size="2097152" crc="332b9ecd" sha1="65c8b7ab94b05812d009b4bebda3c49891a6bfbe" offset="000000" loadflag="load16_word_swap" />
r20695r20696
819831      <publisher>Sega</publisher>
820832      <part name="cart" interface="megadriv_cart">
821833         <feature name="pcb_type" value="SEGA-FRAM" />
834         <feature name="slot" value="rom_fram" />
822835         <feature name="pcb" value="171-6658A" />
823836         <feature name="ic1" value="MPR-16342-S" />
824837         <feature name="ic2" value="FM1208S-200CC" />
r20695r20696
843856      <info name="alt_title" value="ソニック・ザ・ヘッジホッグ3"/>
844857      <part name="cart" interface="megadriv_cart">
845858         <feature name="pcb_type" value="SEGA-FRAM" />
859         <feature name="slot" value="rom_fram" />
846860         <feature name="pcb" value="171-6658A" />
847861         <dataarea name="rom" size="2097152">
848862            <rom name="mpr-16343.ic1" size="2097152" crc="f4951d1f" sha1="7b98b21b7274233e962132bc22a7ccdf548c0ddb" offset="000000" loadflag="load16_word_swap" />
r20695r20696
902916      <publisher>Sega</publisher>
903917      <part name="cart" interface="megadriv_cart">
904918         <feature name="pcb_type" value="SEGA-SRAM" />
919         <feature name="slot" value="rom_sram" />
905920         <feature name="pcb" value="171-6583B" />
906921         <feature name="ic1" value="MPR-17720-SM" />
907922         <feature name="ic2" value="MPR-17720-SM" />
r20695r20696
963978      <publisher>Sega</publisher>
964979      <part name="cart" interface="megadriv_cart">
965980         <feature name="pcb_type" value="SEGA-SRAM" />
981         <feature name="slot" value="rom_sram" />
966982         <feature name="pcb" value="171-6278A" />
967983         <dataarea name="rom" size="2097152">
968984            <rom name="mpr-18090.ic1" size="2097152" crc="52c7252b" sha1="4352ae7ba1316e4384c4632be80f2fe277443f51" offset="000000" loadflag="load16_word_swap" />
r20695r20696
10521068         <feature name="pcb" value="171-6304A" />
10531069         <feature name="ic1" value="MPR-14860-T" />
10541070         <feature name="pcb_type" value="SEGA-EEPROM" />
1071         <feature name="slot" value="rom_eeprom" />
10551072         <dataarea name="rom" size="524288">
10561073            <rom name="mpr-14860.ic1" size="524288" crc="4fef37c8" sha1="eb4aca22f8b5837a0a0b10491c46714948b09844" offset="000000" loadflag="load16_word_swap" />
10571074         </dataarea>
r20695r20696
12721289      <info name="alt_title" value="Landstalker (Box)"/>
12731290      <part name="cart" interface="megadriv_cart">
12741291         <feature name="pcb_type" value="SEGA-SRAM" />
1292         <feature name="slot" value="rom_sram" />
12751293         <feature name="pcb" value="171-6278A" />
12761294         <feature name="ic1" value="MPR-15976-S" />
12771295         <feature name="ic2" value="MB8464A-10LL" />
r20695r20696
13491367      <publisher>Electronic Arts</publisher>
13501368      <part name="cart" interface="megadriv_cart">
13511369         <feature name="pcb_type" value="SEGA-SRAM" />
1370         <feature name="slot" value="rom_sram" />
13521371         <feature name="pcb" value="P10002 REV J" />
13531372         <feature name="u1" value="FIFA95B1 SOCCER" />
13541373         <feature name="u2" value="GM76C88ALK-15" />
r20695r20696
15751594      <info name="alt_title" value="A列車で行こうMD ~ A Ressha de Ikou MD (Box)"/>
15761595      <part name="cart" interface="megadriv_cart">
15771596         <feature name="pcb_type" value="SEGA-SRAM" />
1597         <feature name="slot" value="rom_sram" />
15781598         <dataarea name="rom" size="524288">
15791599            <rom name="a ressha de ikou md (jpn).bin" size="524288" crc="3d45de4f" sha1="d0d0aaad68978fd15c5857773141ae639de1abc7" offset="000000" loadflag="load16_word_swap" />
15801600         </dataarea>
r20695r20696
16831703      <info name="alt_title" value="アドバンスド大戦略 -ドイツ電撃作戦-"/>
16841704      <part name="cart" interface="megadriv_cart">
16851705         <feature name="pcb_type" value="SEGA-SRAM" />
1706         <feature name="slot" value="rom_sram" />
16861707         <dataarea name="rom" size="1048576">
16871708            <rom name="mpr-13842a.bin" size="1048576" crc="e0d5e18a" sha1="842430c0465d810576e75851023929fec873580d" offset="000000" loadflag="load16_word_swap" />
16881709         </dataarea>
r20695r20696
19171938      <publisher>Koei</publisher>
19181939      <part name="cart" interface="megadriv_cart">
19191940         <feature name="pcb_type" value="SEGA-SRAM" />
1941         <feature name="slot" value="rom_sram" />
19201942         <dataarea name="rom" size="1048576">
19211943            <rom name="aerobiz (usa).bin" size="1048576" crc="cfaa9bce" sha1="104ad3c6f5aaba08270faf427991d6a256c6e67c" offset="000000" loadflag="load16_word_swap" />
19221944         </dataarea>
r20695r20696
19341956      <info name="alt_title" value="エアーマネジメント 大空に賭ける"/>
19351957      <part name="cart" interface="megadriv_cart">
19361958         <feature name="pcb_type" value="SEGA-SRAM" />
1959         <feature name="slot" value="rom_sram" />
19371960         <dataarea name="rom" size="1048576">
19381961            <rom name="air management - oozora ni kakeru (jpn).bin" size="1048576" crc="b3db0c71" sha1="b4e5752453cb3e4b3f6cb4fd9ad6473b4b8addd4" offset="000000" loadflag="load16_word_swap" />
19391962         </dataarea>
r20695r20696
19481971      <publisher>Koei</publisher>
19491972      <part name="cart" interface="megadriv_cart">
19501973         <feature name="pcb_type" value="SEGA-SRAM" />
1974         <feature name="slot" value="rom_sram" />
19511975         <dataarea name="rom" size="1048576">
19521976            <rom name="aerobiz supersonic (usa).bin" size="1048576" crc="9377f1b5" sha1="f29b148c052f50a89e3b877ce027a0d5aaa387d1" offset="000000" loadflag="load16_word_swap" />
19531977         </dataarea>
r20695r20696
19651989      <info name="alt_title" value="エアーマネジメントII 航空王をめざせ"/>
19661990      <part name="cart" interface="megadriv_cart">
19671991         <feature name="pcb_type" value="SEGA-SRAM" />
1992         <feature name="slot" value="rom_sram" />
19681993         <dataarea name="rom" size="1048576">
19691994            <rom name="air management ii - koukuuou o mezase (jpn).bin" size="1048576" crc="4582817b" sha1="6ed89fc3302023bc95c2bba0d45fe1d30e1c5d86" offset="000000" loadflag="load16_word_swap" />
19701995         </dataarea>
r20695r20696
26332658      <publisher>Sega</publisher>
26342659      <part name="cart" interface="megadriv_cart">
26352660         <feature name="pcb_type" value="SEGA-SRAM" />
2661         <feature name="slot" value="rom_sram" />
26362662         <dataarea name="rom" size="2097152">
26372663            <rom name="atp tour (euro).bin" size="2097152" crc="1a3da8c5" sha1="c5fe0fe967369e9d9e855fd3c7826c8f583c49e3" offset="000000" loadflag="load16_word_swap" />
26382664         </dataarea>
r20695r20696
26472673      <publisher>Sega</publisher>
26482674      <part name="cart" interface="megadriv_cart">
26492675         <feature name="pcb_type" value="SEGA-SRAM" />
2676         <feature name="slot" value="rom_sram" />
26502677         <dataarea name="rom" size="2097152">
26512678            <rom name="atp tour championship tennis (prototype - aug 02, 1994).bin" size="2097152" crc="686a9fa1" sha1="3e29c757cedf2334d830f4375242c066f83e0d36" offset="000000" loadflag="load16_word_swap" />
26522679         </dataarea>
r20695r20696
26612688      <publisher>Sega</publisher>
26622689      <part name="cart" interface="megadriv_cart">
26632690         <feature name="pcb_type" value="SEGA-SRAM" />
2691         <feature name="slot" value="rom_sram" />
26642692         <dataarea name="rom" size="2097152">
26652693            <rom name="atp tour championship tennis (prototype - aug 05, 1994).bin" size="2097152" crc="a1fef967" sha1="9fae94e52de4bde42ac45f0e3d3964ccd094b375" offset="000000" loadflag="load16_word_swap" />
26662694         </dataarea>
r20695r20696
26752703      <publisher>Sega</publisher>
26762704      <part name="cart" interface="megadriv_cart">
26772705         <feature name="pcb_type" value="SEGA-SRAM" />
2706         <feature name="slot" value="rom_sram" />
26782707         <dataarea name="rom" size="2097152">
26792708            <rom name="atp tour championship tennis (prototype - aug 08, 1994).bin" size="2097152" crc="e6398864" sha1="2cade1465fd5a835523b688bb675f67a7012e67d" offset="000000" loadflag="load16_word_swap" />
26802709         </dataarea>
r20695r20696
26902719      <publisher>Sega</publisher>
26912720      <part name="cart" interface="megadriv_cart">
26922721         <feature name="pcb_type" value="SEGA-SRAM" />
2722         <feature name="slot" value="rom_sram" />
26932723         <dataarea name="rom" size="2097152">
26942724            <rom name="atp tour championship tennis (prototype - jul 19, 1994).bin" size="2097152" crc="cb927488" sha1="e0e94be5c1f76465151cf6c6357d67ba68170676" offset="000000" loadflag="load16_word_swap" />
26952725         </dataarea>
r20695r20696
27042734      <publisher>Sega</publisher>
27052735      <part name="cart" interface="megadriv_cart">
27062736         <feature name="pcb_type" value="SEGA-SRAM" />
2737         <feature name="slot" value="rom_sram" />
27072738         <dataarea name="rom" size="2097152">
27082739            <rom name="atp tour championship tennis (prototype - jul 23, 1994).bin" size="2097152" crc="a15d5051" sha1="88005e79f325e20c804e04a7a310a6d19b7f7cce" offset="000000" loadflag="load16_word_swap" />
27092740         </dataarea>
r20695r20696
27312762      <publisher>Sega</publisher>
27322763      <part name="cart" interface="megadriv_cart">
27332764         <feature name="pcb_type" value="SEGA-SRAM" />
2765         <feature name="slot" value="rom_sram" />
27342766         <dataarea name="rom" size="2097152">
27352767            <rom name="atp tour championship tennis (prototype - may 09, 1994).bin" size="2097152" crc="b17a8dbc" sha1="dbaa2f60df5811026539d1f4c6ad50b596b1356a" offset="000000" loadflag="load16_word_swap" />
27362768         </dataarea>
r20695r20696
27452777      <publisher>Sega</publisher>
27462778      <part name="cart" interface="megadriv_cart">
27472779         <feature name="pcb_type" value="SEGA-SRAM" />
2780         <feature name="slot" value="rom_sram" />
27482781         <dataarea name="rom" size="2097152">
27492782            <rom name="atp tour championship tennis (prototype - sep 08, 1994).bin" size="2097152" crc="b83f4ca4" sha1="c2e277d1cf4fa9def71014dc7cf6ebe34d521281" offset="000000" loadflag="load16_word_swap" />
27502783         </dataarea>
r20695r20696
27592792      <publisher>Sega</publisher>
27602793      <part name="cart" interface="megadriv_cart">
27612794         <feature name="pcb_type" value="SEGA-SRAM" />
2795         <feature name="slot" value="rom_sram" />
27622796         <dataarea name="rom" size="2097152">
27632797            <rom name="atp tour championship tennis (usa).bin" size="2097152" crc="8c822884" sha1="1ccd027cac63ee56b24a54a84706646d22d0b610" offset="000000" loadflag="load16_word_swap" />
27642798         </dataarea>
r20695r20696
28312865      <info name="alt_title" value="アイルトン・セナ スーパーモナコGP II"/>
28322866      <part name="cart" interface="megadriv_cart">
28332867         <feature name="pcb_type" value="SEGA-SRAM" />
2868         <feature name="slot" value="rom_sram" />
28342869         <dataarea name="rom" size="1048576">
28352870            <rom name="mpr-14861.bin" size="1048576" crc="60af0f76" sha1="373fb1744170a114ef99802db987bc9aae009032" offset="000000" loadflag="load16_word_swap" />
28362871         </dataarea>
r20695r20696
28452880      <publisher>Sega</publisher>
28462881      <part name="cart" interface="megadriv_cart">
28472882         <feature name="pcb_type" value="SEGA-SRAM" />
2883         <feature name="slot" value="rom_sram" />
28482884         <dataarea name="rom" size="1048576">
28492885            <rom name="ayrton senna's super monaco gp ii (usa).bin" size="1048576" crc="eac8ded6" sha1="1ee87744d86c4bdd4958cc70d77538351aa206e6" offset="000000" loadflag="load16_word_swap" />
28502886         </dataarea>
r20695r20696
29753011      <info name="alt_title" value="バハムート戦記"/>
29763012      <part name="cart" interface="megadriv_cart">
29773013         <feature name="pcb_type" value="SEGA-SRAM" />
3014         <feature name="slot" value="rom_sram" />
29783015         <dataarea name="rom" size="524288">
29793016            <rom name="mpr-13677.bin" size="524288" crc="b1e268da" sha1="cee49b613298e060d938de523dfcbb27e790b5af" offset="000000" loadflag="load16_word_swap" />
29803017         </dataarea>
r20695r20696
30483085      <publisher>Accolade</publisher>
30493086      <part name="cart" interface="megadriv_cart">
30503087         <feature name="pcb_type" value="SEGA-SRAM" />
3088         <feature name="slot" value="rom_sram" />
30513089         <dataarea name="rom" size="2097152">
30523090            <rom name="barkley shut up and jam! 2 (usa).bin" size="2097152" crc="321bb6bd" sha1="b13f13ccc1a21dacd295f30c66695bf97bbeff8d" offset="000000" loadflag="load16_word_swap" />
30533091         </dataarea>
r20695r20696
36363674      <publisher>Electronic Arts</publisher>
36373675      <part name="cart" interface="megadriv_cart">
36383676         <feature name="pcb_type" value="SEGA-SRAM" />
3677         <feature name="slot" value="rom_sram" />
36393678         <dataarea name="rom" size="1048576">
36403679            <rom name="bwcf01.bin" size="1048576" crc="3ed83362" sha1="2bbb454900ac99172a2d72d1e6f96a96b8d6840b" offset="000000" loadflag="load16_word_swap" />
36413680         </dataarea>
r20695r20696
36503689      <publisher>Electronic Arts</publisher>
36513690      <part name="cart" interface="megadriv_cart">
36523691         <feature name="pcb_type" value="SEGA-SRAM" />
3692         <feature name="slot" value="rom_sram" />
36533693         <dataarea name="rom" size="2097152">
36543694            <rom name="bill walsh college football 95 (usa).bin" size="2097152" crc="a582f45a" sha1="2ae000f45474b3cdedd08eeca7f5e195959ba689" offset="000000" loadflag="load16_word_swap" />
36553695         </dataarea>
r20695r20696
37833823      <info name="alt_title" value="ブルーアルマナック"/>
37843824      <part name="cart" interface="megadriv_cart">
37853825         <feature name="pcb_type" value="SEGA-SRAM" />
3826         <feature name="slot" value="rom_sram" />
37863827         <dataarea name="rom" size="1048576">
37873828            <rom name="blue almanac (jpn).bin" size="1048576" crc="7222ebb3" sha1="0be0d4d3e192beb4106c0a95c1fb0aec952c3917" offset="000000" loadflag="load16_word_swap" />
37883829         </dataarea>
r20695r20696
40704111      <publisher>Accolade</publisher>
40714112      <part name="cart" interface="megadriv_cart">
40724113         <feature name="pcb_type" value="SEGA-SRAM" />
4114         <feature name="slot" value="rom_sram" />
40734115         <dataarea name="rom" size="2097152">
40744116            <rom name="brett hull hockey '95 (usa).bin" size="2097152" crc="f7775a09" sha1="bcc9d8a737b5b6ccc5ddcd5906202508e4307f79" offset="000000" loadflag="load16_word_swap" />
40754117         </dataarea>
r20695r20696
41074149      <publisher>Codemasters</publisher>
41084150      <part name="cart" interface="megadriv_cart">
41094151         <feature name="pcb_type" value="CM-SEPROM" />
4152         <feature name="slot" value="rom_blara" />
41104153         <dataarea name="rom" size="1048576">
41114154            <rom name="brian lara cricket 96 (euro) (april 1996).bin" size="1048576" crc="fe52f7e1" sha1="3e1ef39e9008a4a55fd57b25948668c8c52ba9e3" offset="000000" loadflag="load16_word_swap" />
41124155         </dataarea>
r20695r20696
41194162      <publisher>Codemasters</publisher>
41204163      <part name="cart" interface="megadriv_cart">
41214164         <feature name="pcb_type" value="CM-SEPROM" />
4165         <feature name="slot" value="rom_blara" />
41224166         <dataarea name="rom" size="1048576">
41234167            <rom name="mdbl_9844.bin" size="1048576" crc="fa3024af" sha1="0b08788a0f8214c5d07b8e2293f0b954dd05bef5" offset="000000" loadflag="load16_word_swap" />
41244168         </dataarea>
r20695r20696
49444988      <publisher>Electronic Arts</publisher>
49454989      <part name="cart" interface="megadriv_cart">
49464990         <feature name="pcb_type" value="SEGA-SRAM" />
4991         <feature name="slot" value="rom_sram" />
49474992         <dataarea name="rom" size="2097152">
49484993            <rom name="coach k college basketball (usa).bin" size="2097152" crc="67c309c6" sha1="8ff5d7a7fcc47f030a3ea69f4534d9c892f58ce2" offset="000000" loadflag="load16_word_swap" />
49494994         </dataarea>
r20695r20696
49695014      <publisher>Electronic Arts</publisher>
49705015      <part name="cart" interface="megadriv_cart">
49715016         <feature name="pcb_type" value="SEGA-SRAM" />
5017         <feature name="slot" value="rom_sram" />
49725018         <dataarea name="rom" size="2097152">
49735019            <rom name="college football usa 97 (usa).bin" size="2097152" crc="2ebb90a3" sha1="9b93035ecdc2b6f0815281764ef647f2de039e7b" offset="000000" loadflag="load16_word_swap" />
49745020         </dataarea>
r20695r20696
49835029      <publisher>Sega</publisher>
49845030      <part name="cart" interface="megadriv_cart">
49855031         <feature name="pcb_type" value="SEGA-SRAM" />
5032         <feature name="slot" value="rom_sram" />
49865033         <dataarea name="rom" size="2097152">
49875034            <rom name="college football's national championship (usa).bin" size="2097152" crc="172c5dbb" sha1="a3db8661e160e07b09bca03ba0d20ba4e80a4c59" offset="000000" loadflag="load16_word_swap" />
49885035         </dataarea>
r20695r20696
49975044      <publisher>Sega</publisher>
49985045      <part name="cart" interface="megadriv_cart">
49995046         <feature name="pcb_type" value="SEGA-SRAM" />
5047         <feature name="slot" value="rom_sram" />
50005048         <dataarea name="rom" size="2097152">
50015049            <rom name="college football's national championship (prototype - apr 13, 1994).bin" size="2097152" crc="d9772def" sha1="2eb0daad82caff6bcefb438297a2d701c99173c5" offset="000000" loadflag="load16_word_swap" />
50025050         </dataarea>
r20695r20696
50115059      <publisher>Sega</publisher>
50125060      <part name="cart" interface="megadriv_cart">
50135061         <feature name="pcb_type" value="SEGA-SRAM" />
5062         <feature name="slot" value="rom_sram" />
50145063         <dataarea name="rom" size="2097152">
50155064            <rom name="college football's national championship (prototype - apr 18, 1994).bin" size="2097152" crc="e0a1705f" sha1="ea19e141c64cc4abc6e7d7eea7bbb6783569a05a" offset="000000" loadflag="load16_word_swap" />
50165065         </dataarea>
r20695r20696
50255074      <publisher>Sega</publisher>
50265075      <part name="cart" interface="megadriv_cart">
50275076         <feature name="pcb_type" value="SEGA-SRAM" />
5077         <feature name="slot" value="rom_sram" />
50285078         <dataarea name="rom" size="2097152">
50295079            <rom name="college football's national championship (prototype - apr 19, 1994).bin" size="2097152" crc="d5fe66c3" sha1="9961db2c46f0189c419da2e335e6ca974eaa5379" offset="000000" loadflag="load16_word_swap" />
50305080         </dataarea>
r20695r20696
50395089      <publisher>Sega</publisher>
50405090      <part name="cart" interface="megadriv_cart">
50415091         <feature name="pcb_type" value="SEGA-SRAM" />
5092         <feature name="slot" value="rom_sram" />
50425093         <dataarea name="rom" size="2097152">
50435094            <rom name="college football's national championship (prototype - apr 29, 1994).bin" size="2097152" crc="99da1973" sha1="11e333a326ea71f77b816add76defc8f2846710d" offset="000000" loadflag="load16_word_swap" />
50445095         </dataarea>
r20695r20696
50535104      <publisher>Sega</publisher>
50545105      <part name="cart" interface="megadriv_cart">
50555106         <feature name="pcb_type" value="SEGA-SRAM" />
5107         <feature name="slot" value="rom_sram" />
50565108         <dataarea name="rom" size="2097152">
50575109            <rom name="college football's national championship (prototype - jun 01, 1994).bin" size="2097152" crc="994dbc8f" sha1="99e5ec2705fac1566e47fd813d6cf5b5e7f7daf4" offset="000000" loadflag="load16_word_swap" />
50585110         </dataarea>
r20695r20696
50675119      <publisher>Sega</publisher>
50685120      <part name="cart" interface="megadriv_cart">
50695121         <feature name="pcb_type" value="SEGA-SRAM" />
5122         <feature name="slot" value="rom_sram" />
50705123         <dataarea name="rom" size="2097152">
50715124            <rom name="college football's national championship (prototype - jun 03, 1994).bin" size="2097152" crc="9ca29321" sha1="1e155744a1c089cd2332c27cdad48e7f243c2fc8" offset="000000" loadflag="load16_word_swap" />
50725125         </dataarea>
r20695r20696
50815134      <publisher>Sega</publisher>
50825135      <part name="cart" interface="megadriv_cart">
50835136         <feature name="pcb_type" value="SEGA-SRAM" />
5137         <feature name="slot" value="rom_sram" />
50845138         <dataarea name="rom" size="2097152">
50855139            <rom name="college football's national championship (prototype - jun 07, 1994).bin" size="2097152" crc="b40b791e" sha1="334daa4f48dea4d85145fcd1bfb03f522532a9ae" offset="000000" loadflag="load16_word_swap" />
50865140         </dataarea>
r20695r20696
50955149      <publisher>Sega</publisher>
50965150      <part name="cart" interface="megadriv_cart">
50975151         <feature name="pcb_type" value="SEGA-SRAM" />
5152         <feature name="slot" value="rom_sram" />
50985153         <dataarea name="rom" size="2097152">
50995154            <rom name="college football's national championship (prototype - jun 08, 1994).bin" size="2097152" crc="d008debc" sha1="1b69304213ef1732c0b9b2f059179a7cf18b2c75" offset="000000" loadflag="load16_word_swap" />
51005155         </dataarea>
r20695r20696
51095164      <publisher>Sega</publisher>
51105165      <part name="cart" interface="megadriv_cart">
51115166         <feature name="pcb_type" value="SEGA-SRAM" />
5167         <feature name="slot" value="rom_sram" />
51125168         <dataarea name="rom" size="2097152">
51135169            <rom name="college football's national championship (prototype - jun 14, 1994).bin" size="2097152" crc="ecef7de7" sha1="923ce9034f37167b65aec97e160f6fe34ea2da33" offset="000000" loadflag="load16_word_swap" />
51145170         </dataarea>
r20695r20696
51235179      <publisher>Sega</publisher>
51245180      <part name="cart" interface="megadriv_cart">
51255181         <feature name="pcb_type" value="SEGA-SRAM" />
5182         <feature name="slot" value="rom_sram" />
51265183         <dataarea name="rom" size="2097152">
51275184            <rom name="college football's national championship (prototype - jun 15, 1994).bin" size="2097152" crc="c7e5a998" sha1="c9d010a0ffccecc2c01412daf64bf1b0eaf5055e" offset="000000" loadflag="load16_word_swap" />
51285185         </dataarea>
r20695r20696
51375194      <publisher>Sega</publisher>
51385195      <part name="cart" interface="megadriv_cart">
51395196         <feature name="pcb_type" value="SEGA-SRAM" />
5197         <feature name="slot" value="rom_sram" />
51405198         <dataarea name="rom" size="2097152">
51415199            <rom name="college football's national championship (prototype - jun 18, 1994).bin" size="2097152" crc="74988a9d" sha1="164e3fc32aa295b0d87e1508dd5fe75f9a7cadb9" offset="000000" loadflag="load16_word_swap" />
51425200         </dataarea>
r20695r20696
51515209      <publisher>Sega</publisher>
51525210      <part name="cart" interface="megadriv_cart">
51535211         <feature name="pcb_type" value="SEGA-SRAM" />
5212         <feature name="slot" value="rom_sram" />
51545213         <dataarea name="rom" size="2097152">
51555214            <rom name="college football's national championship (prototype - jun 20, 1994).bin" size="2097152" crc="898c17fa" sha1="4b30eea2fb1187cf3c9150f9dee5b5b9571c76f5" offset="000000" loadflag="load16_word_swap" />
51565215         </dataarea>
r20695r20696
51655224      <publisher>Sega</publisher>
51665225      <part name="cart" interface="megadriv_cart">
51675226         <feature name="pcb_type" value="SEGA-SRAM" />
5227         <feature name="slot" value="rom_sram" />
51685228         <dataarea name="rom" size="2097152">
51695229            <rom name="college football's national championship (prototype - may 03, 1994).bin" size="2097152" crc="db1a3f66" sha1="d9db6ecb032fd88443d0575b01e61cb4aeea5703" offset="000000" loadflag="load16_word_swap" />
51705230         </dataarea>
r20695r20696
51795239      <publisher>Sega</publisher>
51805240      <part name="cart" interface="megadriv_cart">
51815241         <feature name="pcb_type" value="SEGA-SRAM" />
5242         <feature name="slot" value="rom_sram" />
51825243         <dataarea name="rom" size="2097152">
51835244            <rom name="college football's national championship (prototype - may 06, 1994).bin" size="2097152" crc="0a538e75" sha1="ee673500aef188ca7cf086fb1cf616b58896fdcb" offset="000000" loadflag="load16_word_swap" />
51845245         </dataarea>
r20695r20696
51935254      <publisher>Sega</publisher>
51945255      <part name="cart" interface="megadriv_cart">
51955256         <feature name="pcb_type" value="SEGA-SRAM" />
5257         <feature name="slot" value="rom_sram" />
51965258         <dataarea name="rom" size="2097152">
51975259            <rom name="college football's national championship (prototype - may 11, 1994 - a).bin" size="2097152" crc="ce65b294" sha1="b16e953b695148b8284f87be566774379c4c2453" offset="000000" loadflag="load16_word_swap" />
51985260         </dataarea>
r20695r20696
52075269      <publisher>Sega</publisher>
52085270      <part name="cart" interface="megadriv_cart">
52095271         <feature name="pcb_type" value="SEGA-SRAM" />
5272         <feature name="slot" value="rom_sram" />
52105273         <dataarea name="rom" size="2097152">
52115274            <rom name="college football's national championship (prototype - may 17, 1994 - a).bin" size="2097152" crc="8cfd4c86" sha1="01ed2026a930383d926d71192b2a8f9417dfb245" offset="000000" loadflag="load16_word_swap" />
52125275         </dataarea>
r20695r20696
52215284      <publisher>Sega</publisher>
52225285      <part name="cart" interface="megadriv_cart">
52235286         <feature name="pcb_type" value="SEGA-SRAM" />
5287         <feature name="slot" value="rom_sram" />
52245288         <dataarea name="rom" size="2097152">
52255289            <rom name="college football's national championship (prototype - may 20, 1994).bin" size="2097152" crc="f285385e" sha1="0b26c5748e976a64c02864e1934f2b50f6953cba" offset="000000" loadflag="load16_word_swap" />
52265290         </dataarea>
r20695r20696
52355299      <publisher>Sega</publisher>
52365300      <part name="cart" interface="megadriv_cart">
52375301         <feature name="pcb_type" value="SEGA-SRAM" />
5302         <feature name="slot" value="rom_sram" />
52385303         <dataarea name="rom" size="2097152">
52395304            <rom name="college football's national championship (prototype - may 25, 1994).bin" size="2097152" crc="482e334a" sha1="e2fb264a11e08d57acf2756688880cd6fc353aba" offset="000000" loadflag="load16_word_swap" />
52405305         </dataarea>
r20695r20696
52495314      <publisher>Sega</publisher>
52505315      <part name="cart" interface="megadriv_cart">
52515316         <feature name="pcb_type" value="SEGA-SRAM" />
5317         <feature name="slot" value="rom_sram" />
52525318         <dataarea name="rom" size="2097152">
52535319            <rom name="college football's national championship (prototype - may 31, 1994).bin" size="2097152" crc="c6766745" sha1="157b65be9d946c46f77a90e4a5847fa41f2692b9" offset="000000" loadflag="load16_word_swap" />
52545320         </dataarea>
r20695r20696
52635329      <publisher>Sega</publisher>
52645330      <part name="cart" interface="megadriv_cart">
52655331         <feature name="pcb_type" value="SEGA-SRAM" />
5332         <feature name="slot" value="rom_sram" />
52665333         <dataarea name="rom" size="2097152">
52675334            <rom name="college football's national championship ii (usa).bin" size="2097152" crc="65b64413" sha1="9609f9934a80dba183dab603ae07f445f02b919d" offset="000000" loadflag="load16_word_swap" />
52685335         </dataarea>
r20695r20696
52775344      <publisher>Acclaim Entertainment</publisher>
52785345      <part name="cart" interface="megadriv_cart">
52795346         <feature name="pcb_type" value="CSLAM" />
5347         <feature name="slot" value="rom_cslam" />
52805348         <dataarea name="rom" size="4194304">
52815349            <rom name="college slam (usa).bin" size="4194304" crc="96a42431" sha1="0dbbe740b14077fe8648955f7e17965ea25f382a" offset="000000" loadflag="load16_word_swap" />
52825350         </dataarea>
r20695r20696
65386606      <publisher>Virgin Interactive</publisher>
65396607      <part name="cart" interface="megadriv_cart">
65406608         <feature name="pcb_type" value="SEGA-SRAM" />
6609         <feature name="slot" value="rom_sram" />
65416610         <dataarea name="rom" size="1048576">
65426611            <rom name="dino dini's soccer (euro).bin" size="1048576" crc="4608f53a" sha1="49d4a654dd2f393e43a363ed171e73cd4c8ff4f4" offset="000000" loadflag="load16_word_swap" />
65436612         </dataarea>
r20695r20696
67126781      <publisher>&lt;unknown&gt;</publisher>
67136782      <part name="cart" interface="megadriv_cart">
67146783         <feature name="pcb_type" value="SEGA-SRAM" />
6784         <feature name="slot" value="rom_sram" />
67156785         <dataarea name="rom" size="786432">
67166786            <rom name="dominus (usa) (prototype).bin" size="786432" crc="30006ebd" sha1="fde8160bf51575463e81cbd0b5d12fb5d49eb695" offset="000000" loadflag="load16_word_swap" />
67176787         </dataarea>
r20695r20696
69276997      <info name="alt_title" value="ドラゴンスレイヤー英雄伝説"/>
69286998      <part name="cart" interface="megadriv_cart">
69296999         <feature name="pcb_type" value="SEGA-SRAM" />
7000         <feature name="slot" value="rom_sram" />
69307001         <dataarea name="rom" size="2097152">
69317002            <rom name="dragon slayer - eiyuu densetsu (jpn).bin" size="2097152" crc="01bc1604" sha1="f67c9139bbc93f171e274a5cd3fba66480cd8244" offset="000000" loadflag="load16_word_swap" />
69327003         </dataarea>
r20695r20696
69447015      <info name="alt_title" value="ドラゴンスレイヤー英雄伝説II"/>
69457016      <part name="cart" interface="megadriv_cart">
69467017         <feature name="pcb_type" value="SEGA-SRAM" />
7018         <feature name="slot" value="rom_sram" />
69477019         <dataarea name="rom" size="2097152">
69487020            <rom name="dragon slayer - eiyuu densetsu ii (jpn).bin" size="2097152" crc="46924dc3" sha1="79b6201301acb5d9e9c56dcf65a9bcf9d9a931ab" offset="000000" loadflag="load16_word_swap" />
69497021         </dataarea>
r20695r20696
70337105      <publisher>Tec Toy</publisher>
70347106      <part name="cart" interface="megadriv_cart">
70357107         <feature name="pcb_type" value="SEGA-SRAM" />
7108         <feature name="slot" value="rom_sram" />
70367109         <dataarea name="rom" size="4194304">
70377110            <rom name="duke nukem 3d (bra).bin" size="4194304" crc="6bd2accb" sha1="a4663f2b96787a92db604a92491fa27e2b5ced9e" offset="000000" loadflag="load16_word_swap" />
70387111         </dataarea>
r20695r20696
70807153      <publisher>Sega</publisher>
70817154      <part name="cart" interface="megadriv_cart">
70827155         <feature name="pcb_type" value="SEGA-SRAM" />
7156         <feature name="slot" value="rom_sram" />
70837157         <dataarea name="rom" size="1048576">
70847158            <rom name="dungeons &amp; dragons - warriors of the eternal sun (euro, usa).bin" size="1048576" crc="af4a9cd7" sha1="9135f7fda03ef7da92dfade9c0df75808214f693" offset="000000" loadflag="load16_word_swap" />
70857159         </dataarea>
r20695r20696
71227196      <publisher>Sega</publisher>
71237197      <part name="cart" interface="megadriv_cart">
71247198         <feature name="pcb_type" value="SEGA-SRAM" />
7199         <feature name="slot" value="rom_sram" />
71257200         <dataarea name="rom" size="2621440">
71267201            <rom name="dyna brothers 2 - sega channel special (jpn).bin" size="2621440" crc="ba3554bc" sha1="8e10298dfff521397f0e82d1787e701d6928750b" offset="000000" loadflag="load16_word_swap" />
71277202         </dataarea>
r20695r20696
75387613      <publisher>Electronic Arts</publisher>
75397614      <part name="cart" interface="megadriv_cart">
75407615         <feature name="pcb_type" value="SEGA-SRAM" />
7616         <feature name="slot" value="rom_sram" />
75417617         <dataarea name="rom" size="2097152">
75427618            <rom name="swed9584.bin" size="2097152" crc="e10a25c0" sha1="5f2c8303099ce13fe1e5760b7ef598a2967bfa8d" offset="000000" loadflag="load16_word_swap" />
75437619         </dataarea>
r20695r20696
75527628      <publisher>Electronic Arts</publisher>
75537629      <part name="cart" interface="megadriv_cart">
75547630         <feature name="pcb_type" value="SEGA-SRAM" />
7631         <feature name="slot" value="rom_sram" />
75557632         <dataarea name="rom" size="2097152">
75567633            <rom name="elitserien 96 (sweden).bin" size="2097152" crc="9821d0a3" sha1="085fb8e6f0d2ff0f399de5c57eb13d9c9325dbae" offset="000000" loadflag="load16_word_swap" />
75577634         </dataarea>
r20695r20696
77587835      <publisher>Sony Imagesoft</publisher>
77597836      <part name="cart" interface="megadriv_cart">
77607837         <feature name="pcb_type" value="SEGA-SRAM" />
7838         <feature name="slot" value="rom_sram" />
77617839         <dataarea name="rom" size="2097152">
77627840            <rom name="espn national hockey night (usa).bin" size="2097152" crc="1d08828c" sha1="cfd65e3ffb17e1718356ef8de7c527e2c9fd8940" offset="000000" loadflag="load16_word_swap" />
77637841         </dataarea>
r20695r20696
77727850      <publisher>Sony Imagesoft</publisher>
77737851      <part name="cart" interface="megadriv_cart">
77747852         <feature name="pcb_type" value="SEGA-SRAM" />
7853         <feature name="slot" value="rom_sram" />
77757854         <dataarea name="rom" size="2097152">
77767855            <rom name="espn national hockey night (usa) (beta).bin" size="2097152" crc="a427814a" sha1="c890fc232ca46a9499bb4e3107a519ae2d8edb81" offset="000000" loadflag="load16_word_swap" />
77777856         </dataarea>
r20695r20696
77867865      <publisher>Sony Imagesoft</publisher>
77877866      <part name="cart" interface="megadriv_cart">
77887867         <feature name="pcb_type" value="SEGA-SRAM" />
7868         <feature name="slot" value="rom_sram" />
77897869         <dataarea name="rom" size="2097152">
77907870            <rom name="espn speed world (usa).bin" size="2097152" crc="f50be478" sha1="9400a2ee865f11d68c766059318d6fe69987d89b" offset="000000" loadflag="load16_word_swap" />
77917871         </dataarea>
r20695r20696
78007880      <publisher>Sony Imagesoft</publisher>
78017881      <part name="cart" interface="megadriv_cart">
78027882         <feature name="pcb_type" value="SEGA-SRAM" />
7883         <feature name="slot" value="rom_sram" />
78037884         <dataarea name="rom" size="2097152">
78047885            <rom name="espn sunday night nfl (usa).bin" size="2097152" crc="61e9c309" sha1="03f8c8805ebd4313c8a7d76b34121339bad33f89" offset="000000" loadflag="load16_word_swap" />
78057886         </dataarea>
r20695r20696
79228003      <publisher>Renovation</publisher>
79238004      <part name="cart" interface="megadriv_cart">
79248005         <feature name="pcb_type" value="SEGA-SRAM" />
8006         <feature name="slot" value="rom_sram" />
79258007         <dataarea name="rom" size="1048576">
79268008            <rom name="exile (usa).bin" size="1048576" crc="1b569dc2" sha1="28377e9a68c2dcdfdb4133c2eb0b634aec552958" offset="000000" loadflag="load16_word_swap" />
79278009         </dataarea>
r20695r20696
79398021      <info name="alt_title" value="エグザイル ~時の狭間へ~"/>
79408022      <part name="cart" interface="megadriv_cart">
79418023         <feature name="pcb_type" value="SEGA-SRAM" />
8024         <feature name="slot" value="rom_sram" />
79428025         <dataarea name="rom" size="1048576">
79438026            <rom name="exile - toki no hazama e (jpn).bin" size="1048576" crc="880bf311" sha1="14ef77cbf6c023365e168f54456d5486679292ef" offset="000000" loadflag="load16_word_swap" />
79448027         </dataarea>
r20695r20696
80918174      <publisher>Tengen</publisher>
80928175      <part name="cart" interface="megadriv_cart">
80938176         <feature name="pcb_type" value="SEGA-SRAM" />
8177         <feature name="slot" value="rom_sram" />
80948178         <dataarea name="rom" size="1048576">
80958179            <rom name="mpr-15834.bin" size="1048576" crc="fbdd4520" sha1="a8327157f6537f4cd5daaff648864e8e0bf945f1" offset="000000" loadflag="load16_word_swap" />
80968180         </dataarea>
r20695r20696
81418225      <info name="alt_title" value="エフワン サーカス エムディ"/>
81428226      <part name="cart" interface="megadriv_cart">
81438227         <feature name="pcb_type" value="SEGA-SRAM" />
8228         <feature name="slot" value="rom_sram" />
81448229         <dataarea name="rom" size="524288">
81458230            <rom name="f1 circus md (jpn).bin" size="524288" crc="5d30befb" sha1="2efb8d46163e785a57421e726991328024ecd2a7" offset="000000" loadflag="load16_word_swap" />
81468231         </dataarea>
r20695r20696
82278312      <info name="alt_title" value="ファステスト・ワン"/>
82288313      <part name="cart" interface="megadriv_cart">
82298314         <feature name="pcb_type" value="SEGA-SRAM" />
8315         <feature name="slot" value="rom_sram" />
82308316         <dataarea name="rom" size="524288">
82318317            <rom name="fastest 1 (jpn).bin" size="524288" crc="bb43f0de" sha1="837a19b4b821076f1cd01d53d90b4553a0252340" offset="000000" loadflag="load16_word_swap" />
82328318         </dataarea>
r20695r20696
83828468      <publisher>Chuanpu Technologies</publisher>
83838469      <part name="cart" interface="megadriv_cart">
83848470         <feature name="pcb_type" value="SEGA-SRAM" />
8471         <feature name="slot" value="rom_sram" />
83858472         <dataarea name="rom" size="2097152">
83868473            <rom name="unknown chinese game 1 (chi).bin" size="2097152" crc="dfacb9ff" sha1="4283bb9aec05098b9f6b1739e1b02c1bb1f8242f" offset="000000" loadflag="load16_word_swap" />
83878474         </dataarea>
r20695r20696
84738560      <publisher>&lt;unlicensed&gt;</publisher>
84748561      <part name="cart" interface="megadriv_cart">
84758562         <feature name="pcb_type" value="SEGA-SRAM" />
8563         <feature name="slot" value="rom_sram" />
84768564         <dataarea name="rom" size="2097152">
84778565            <rom name="futbol argentino 98 - pasion de multitudes (unl).bin" size="2097152" crc="5c015888" sha1="44adb1cf6c1ce6e53314dc336168c5cf3313a739" offset="000000" loadflag="load16_word_swap" />
84788566         </dataarea>
r20695r20696
84878575      <publisher>Electronic Arts</publisher>
84888576      <part name="cart" interface="megadriv_cart">
84898577         <feature name="pcb_type" value="SEGA-SRAM" />
8578         <feature name="slot" value="rom_sram" />
84908579         <dataarea name="rom" size="2097152">
84918580            <rom name="fifa01.bin" size="2097152" crc="bad30ffa" sha1="a7fcfe478b368d7d33bcbca65245f5faed9a1e07" offset="000000" loadflag="load16_word_swap" />
84928581         </dataarea>
r20695r20696
85018590      <publisher>&lt;unlicensed&gt;</publisher>
85028591      <part name="cart" interface="megadriv_cart">
85038592         <feature name="pcb_type" value="SEGA-SRAM" />
8593         <feature name="slot" value="rom_sram" />
85048594         <dataarea name="rom" size="2097152">
85058595            <rom name="fifa soccer 99 (pirate) (unl).bin" size="2097152" crc="c5c5a4b0" sha1="2c8c1dc0aaa711e3ab3fe0d74b79184f33127350" offset="000000" loadflag="load16_word_swap" />
85068596         </dataarea>
r20695r20696
85268616      <publisher>Electronic Arts</publisher>
85278617      <part name="cart" interface="megadriv_cart">
85288618         <feature name="pcb_type" value="SEGA-SRAM" />
8619         <feature name="slot" value="rom_sram" />
85298620         <dataarea name="rom" size="2097152">
85308621            <rom name="fifa 98 - road to world cup (euro).bin" size="2097152" crc="96947f57" sha1="6613f13da5494aaaba3222ed5e730ec9ce3c09a7" offset="000000" loadflag="load16_word_swap" />
85318622         </dataarea>
r20695r20696
88068897      <publisher>Acclaim Entertainment</publisher>
88078898      <part name="cart" interface="megadriv_cart">
88088899         <feature name="pcb_type" value="CSLAM" />
8900         <feature name="slot" value="rom_cslam" />
88098901         <dataarea name="rom" size="4194304">
88108902            <rom name="frank thomas big hurt baseball (euro, usa).bin" size="4194304" crc="863e0950" sha1="9c978aaab10e16be59558561b07a0c610c74b43e" offset="000000" loadflag="load16_word_swap" />
88118903         </dataarea>
r20695r20696
90359127      <publisher>Koei</publisher>
90369128      <part name="cart" interface="megadriv_cart">
90379129         <feature name="pcb_type" value="SEGA-SRAM" />
9130         <feature name="slot" value="rom_sram" />
90389131         <dataarea name="rom" size="1048576">
90399132            <rom name="gemfire (usa).bin" size="1048576" crc="3d36135b" sha1="98da5fdec3147edb75210ccf662601e502e23c31" offset="000000" loadflag="load16_word_swap" />
90409133         </dataarea>
r20695r20696
90529145      <info name="alt_title" value="ロイヤルブラッド"/>
90539146      <part name="cart" interface="megadriv_cart">
90549147         <feature name="pcb_type" value="SEGA-SRAM" />
9148         <feature name="slot" value="rom_sram" />
90559149         <dataarea name="rom" size="1048576">
90569150            <rom name="royal blood (jpn).bin" size="1048576" crc="0e0107f1" sha1="914f684f085927257020ffaa1ca536ec057e1603" offset="000000" loadflag="load16_word_swap" />
90579151         </dataarea>
r20695r20696
91029196      <publisher>Koei</publisher>
91039197      <part name="cart" interface="megadriv_cart">
91049198         <feature name="pcb_type" value="SEGA-SRAM" />
9199         <feature name="slot" value="rom_sram" />
91059200         <dataarea name="rom" size="1048576">
91069201            <rom name="genghis khan ii - clan of the gray wolf (usa).bin" size="1048576" crc="87a281ae" sha1="4c1151413a261ad271543eeb64f512053f261a35" offset="000000" loadflag="load16_word_swap" />
91079202         </dataarea>
r20695r20696
91199214      <info name="alt_title" value="蒼き狼と白き牝鹿 元朝秘史"/>
91209215      <part name="cart" interface="megadriv_cart">
91219216         <feature name="pcb_type" value="SEGA-SRAM" />
9217         <feature name="slot" value="rom_sram" />
91229218         <dataarea name="rom" size="1310720">
91239219            <rom name="aoki ookami to shiroki meshika - genchou hishi (jpn).bin" size="1310720" crc="10be1d93" sha1="0de0f798f636285da2b4d248f9894bf975b45304" offset="000000" loadflag="load16_word_swap" />
91249220         </dataarea>
r20695r20696
95039599      <info name="alt_title" value="グレイテスト ヘビーウェイツ"/>
95049600      <part name="cart" interface="megadriv_cart">
95059601         <feature name="pcb_type" value="SEGA-EEPROM" />
9602         <feature name="slot" value="rom_eeprom" />
95069603         <dataarea name="rom" size="2097152">
95079604            <rom name="greatest heavyweights (jpn).bin" size="2097152" crc="7ef8b162" sha1="1d5fe812df75e0dc1ff379c563058e078b839a09" offset="000000" loadflag="load16_word_swap" />
95089605         </dataarea>
r20695r20696
95159612      <publisher>Sega</publisher>
95169613      <part name="cart" interface="megadriv_cart">
95179614         <feature name="pcb_type" value="SEGA-EEPROM" />
9615         <feature name="slot" value="rom_eeprom" />
95189616         <dataarea name="rom" size="2097152">
95199617            <rom name="greatest heavyweights (usa).bin" size="2097152" crc="6e3621d5" sha1="4ef7aec80003aab0e1d2260b7fc0d22d63d90038" offset="000000" loadflag="load16_word_swap" />
95209618         </dataarea>
r20695r20696
96969794      <publisher>Accolade</publisher>
96979795      <part name="cart" interface="megadriv_cart">
96989796         <feature name="pcb_type" value="SEGA-SRAM" />
9797         <feature name="slot" value="rom_sram" />
96999798         <dataarea name="rom" size="2097152">
97009799            <rom name="hardball '94 (euro, usa).bin" size="2097152" crc="ea9c4878" sha1="eceeecb3d520f9b350e41d0dd010abefbcfbbdab" offset="000000" loadflag="load16_word_swap" />
97019800         </dataarea>
r20695r20696
994510044      <info name="alt_title" value="ハイブリッド・フロント"/>
994610045      <part name="cart" interface="megadriv_cart">
994710046         <feature name="pcb_type" value="SEGA-SRAM" />
10047         <feature name="slot" value="rom_sram" />
994810048         <dataarea name="rom" size="2097152">
994910049            <rom name="hybrid front, the (jpn).bin" size="2097152" crc="a1f1cfe7" sha1="ed592c78ef60d91a6c5723d11cd553d3798524e1" offset="000000" loadflag="load16_word_swap" />
995010050         </dataarea>
r20695r20696
995910059      <publisher>Sega</publisher>
996010060      <part name="cart" interface="megadriv_cart">
996110061         <feature name="pcb_type" value="SEGA-SRAM" />
10062         <feature name="slot" value="rom_sram" />
996210063         <dataarea name="rom" size="3145728">
996310064            <rom name="hybrid front, the (jpn) (beta).bin" size="3145728" crc="04f02687" sha1="b6e72b69a22869f966c52e7d58d146bc48b5eb84" offset="000000" loadflag="load16_word_swap" />
996410065         </dataarea>
r20695r20696
1005610157      <publisher>Electronic Arts</publisher>
1005710158      <part name="cart" interface="megadriv_cart">
1005810159         <feature name="pcb_type" value="SEGA-SRAM" />
10160         <feature name="slot" value="rom_sram" />
1005910161         <dataarea name="rom" size="2097152">
1006010162            <rom name="img international tour tennis (euro, usa).bin" size="2097152" crc="e04ffc2b" sha1="1f1b410d17b39851785dee3eee332fff489db395" offset="000000" loadflag="load16_word_swap" />
1006110163         </dataarea>
r20695r20696
1035410456      <info name="alt_title" value="Jリーグ・オフィシャルTVゲームプロストライカー ~ J.League Pro Striker (Box)"/>
1035510457      <part name="cart" interface="megadriv_cart">
1035610458         <feature name="pcb_type" value="SEGA-SRAM" />
10459         <feature name="slot" value="rom_sram" />
1035710460         <dataarea name="rom" size="1048576">
1035810461            <rom name="j. league pro striker (jpn) (v1.3).bin" size="1048576" crc="2d5b7a11" sha1="1e437182fab2980156b101a53623c3c2f27c3a6c" offset="000000" loadflag="load16_word_swap" />
1035910462         </dataarea>
r20695r20696
1037210475      <info name="alt_title" value="Jリーグ・オフィシャルTVゲームプロストライカー ~ J.League Pro Striker (Box)"/>
1037310476      <part name="cart" interface="megadriv_cart">
1037410477         <feature name="pcb_type" value="SEGA-SRAM" />
10478         <feature name="slot" value="rom_sram" />
1037510479         <dataarea name="rom" size="1048576">
1037610480            <rom name="j. league pro striker (jpn) (v1.0).bin" size="1048576" crc="ec229156" sha1="d3dcc24e50373234988061d3ef56c16d28e580ad" offset="000000" loadflag="load16_word_swap" />
1037710481         </dataarea>
r20695r20696
1039010494      <info name="alt_title" value="Jリーグ・オフィシャルTVゲームプロストライカー2"/>
1039110495      <part name="cart" interface="megadriv_cart">
1039210496         <feature name="pcb_type" value="SEGA-SRAM" />
10497         <feature name="slot" value="rom_sram" />
1039310498         <dataarea name="rom" size="2097152">
1039410499            <rom name="mpr-16857.bin" size="2097152" crc="9fe71002" sha1="924f1ae3d90bec7326a5531cd1d598cdeba30d36" offset="000000" loadflag="load16_word_swap" />
1039510500         </dataarea>
r20695r20696
1040710512      <info name="alt_title" value="プロストライカー ファイナルステージ"/>
1040810513      <part name="cart" interface="megadriv_cart">
1040910514         <feature name="pcb_type" value="SEGA-SRAM" />
10515         <feature name="slot" value="rom_sram" />
1041010516         <dataarea name="rom" size="2097152">
1041110517            <rom name="j. league pro striker final stage (jpn).bin" size="2097152" crc="e35e25fb" sha1="74e4a3ac4b93e25ace6ec8c3818e0df2390cffa2" offset="000000" loadflag="load16_word_swap" />
1041210518         </dataarea>
r20695r20696
1042410530      <info name="alt_title" value="Jリーグ・オフィシャルTVゲーム プロストライカー 完全版"/>
1042510531      <part name="cart" interface="megadriv_cart">
1042610532         <feature name="pcb_type" value="SEGA-SRAM" />
10533         <feature name="slot" value="rom_sram" />
1042710534         <dataarea name="rom" size="1048576">
1042810535            <rom name="mpr-16267.bin" size="1048576" crc="0abed379" sha1="7cfd8c9119d0565ee9a7708dc46bb34dd3258e37" offset="000000" loadflag="load16_word_swap" />
1042910536         </dataarea>
r20695r20696
1043910546      <publisher>Accolade</publisher>
1044010547      <part name="cart" interface="megadriv_cart">
1044110548         <feature name="pcb_type" value="SEGA-SRAM" />
10549         <feature name="slot" value="rom_sram" />
1044210550         <dataarea name="rom" size="1048576">
1044310551            <rom name="jack nicklaus' power challenge golf (euro, usa).bin" size="1048576" crc="5545e909" sha1="8d7edfe87da732ecd9820a6afbb9c5700cce43b2" offset="000000" loadflag="load16_word_swap" />
1044410552         </dataarea>
r20695r20696
1054310651      <info name="alt_title" value="日本プロ麻雀連盟公認 雀皇登龍門"/>
1054410652      <part name="cart" interface="megadriv_cart">
1054510653         <feature name="pcb_type" value="SEGA-SRAM" />
10654         <feature name="slot" value="rom_sram" />
1054610655         <dataarea name="rom" size="1048576">
1054710656            <rom name="janou touryuumon (jpn).bin" size="1048576" crc="b5ef97c6" sha1="4f307e0146e944fbbd4537f5cdc5da136204fc9b" offset="000000" loadflag="load16_word_swap" />
1054810657         </dataarea>
r20695r20696
1117411283      <info name="alt_title" value="機動警察パトレイバー 98式起動せよ!"/>
1117511284      <part name="cart" interface="megadriv_cart">
1117611285         <feature name="pcb_type" value="SEGA-SRAM" />
11286         <feature name="slot" value="rom_sram" />
1117711287         <dataarea name="rom" size="524288">
1117811288            <rom name="kidou keisatsu patlabor - 98-shiki kidou seyo! (jpn).bin" size="524288" crc="21a0e749" sha1="5595422530e6891042a4a005d11b79af7f09fe9b" offset="000000" loadflag="load16_word_swap" />
1117911289         </dataarea>
r20695r20696
1119111301      <info name="alt_title" value="闘技王キングコロッサス"/>
1119211302      <part name="cart" interface="megadriv_cart">
1119311303         <feature name="pcb_type" value="SEGA-SRAM" />
11304         <feature name="slot" value="rom_sram" />
1119411305         <dataarea name="rom" size="1048576">
1119511306            <rom name="mpr-14929.bin" size="1048576" crc="ffe7b3c7" sha1="92bfb3548ebff18eedebe07751bf2170f95780d7" offset="000000" loadflag="load16_word_swap" />
1119611307         </dataarea>
r20695r20696
1129111402      <info name="alt_title" value="騎士伝説"/>
1129211403      <part name="cart" interface="megadriv_cart">
1129311404         <feature name="pcb_type" value="SEGA-SRAM" />
11405         <feature name="slot" value="rom_sram" />
1129411406         <dataarea name="rom" size="1572864">
1129511407            <rom name="kishi densetsu (jpn).bin" size="1572864" crc="22e1f04a" sha1="2884f79b8f717fc9e244dac0fb441bdc44c68203" offset="000000" loadflag="load16_word_swap" />
1129611408         </dataarea>
r20695r20696
1137711489      <publisher>Electronic Arts</publisher>
1137811490      <part name="cart" interface="megadriv_cart">
1137911491         <feature name="pcb_type" value="SEGA-SRAM" />
11492         <feature name="slot" value="rom_sram" />
1138011493         <dataarea name="rom" size="2097152">
1138111494            <rom name="la russa baseball 95 (usa, aus).bin" size="2097152" crc="3f848a92" sha1="0e73742113aa3f0aa5b010bb847569589cd3a5b0" offset="000000" loadflag="load16_word_swap" />
1138211495         </dataarea>
r20695r20696
1140211515      <publisher>Sega</publisher>
1140311516      <part name="cart" interface="megadriv_cart">
1140411517         <feature name="pcb_type" value="SEGA-SRAM" />
11518         <feature name="slot" value="rom_sram" />
1140511519         <dataarea name="rom" size="2097152">
1140611520            <rom name="landstalker - the treasures of king nole (euro).bin" size="2097152" crc="e3c65277" sha1="9fbadc86319936855831ecd096d82d716b304215" offset="000000" loadflag="load16_word_swap" />
1140711521         </dataarea>
r20695r20696
1141611530      <publisher>Sega</publisher>
1141711531      <part name="cart" interface="megadriv_cart">
1141811532         <feature name="pcb_type" value="SEGA-SRAM" />
11533         <feature name="slot" value="rom_sram" />
1141911534         <dataarea name="rom" size="2097152">
1142011535            <rom name="landstalker - die schatze von konig nolo (germany).bin" size="2097152" crc="10fedb8f" sha1="b0b447158cabb562e6bf4c0b829ed938b34afb52" offset="000000" loadflag="load16_word_swap" />
1142111536         </dataarea>
r20695r20696
1143311548      <info name="alt_title" value="ランドストーカー ~皇帝の財宝~"/>
1143411549      <part name="cart" interface="megadriv_cart">
1143511550         <feature name="pcb_type" value="SEGA-SRAM" />
11551         <feature name="slot" value="rom_sram" />
1143611552         <dataarea name="rom" size="2097152">
1143711553            <rom name="landstalker - koutei no zaihou (jpn).bin" size="2097152" crc="60d4cedb" sha1="cdbc7cd9ceb181cad9e49b641ff717072546f0d9" offset="000000" loadflag="load16_word_swap" />
1143811554         </dataarea>
r20695r20696
1144811564      <info name="alt_title" value="Landstalker (Box)"/>
1144911565      <part name="cart" interface="megadriv_cart">
1145011566         <feature name="pcb_type" value="SEGA-SRAM" />
11567         <feature name="slot" value="rom_sram" />
1145111568         <dataarea name="rom" size="2097152">
1145211569            <rom name="landstalker (usa).bin" size="2097152" crc="fbbb5b97" sha1="24345e29427b000b90df778965dd8834300a9dde" offset="000000" loadflag="load16_word_swap" />
1145311570         </dataarea>
r20695r20696
1146211579      <publisher>Sega</publisher>
1146311580      <part name="cart" interface="megadriv_cart">
1146411581         <feature name="pcb_type" value="SEGA-SRAM" />
11582         <feature name="slot" value="rom_sram" />
1146511583         <dataarea name="rom" size="2097152">
1146611584            <rom name="landstalker (usa) (beta).bin" size="2097152" crc="70483d03" sha1="dfca19397479852584d4ac6fcbe27412f9bc1af0" offset="000000" loadflag="load16_word_swap" />
1146711585         </dataarea>
r20695r20696
1147911597      <info name="alt_title" value="ラングリッサー"/>
1148011598      <part name="cart" interface="megadriv_cart">
1148111599         <feature name="pcb_type" value="SEGA-SRAM" />
11600         <feature name="slot" value="rom_sram" />
1148211601         <dataarea name="rom" size="524288">
1148311602            <rom name="mpr-13845.bin" size="524288" crc="b6ea5016" sha1="cc67c5a3b91e706b495eb561a95a038fff72b5da" offset="000000" loadflag="load16_word_swap" />
1148411603         </dataarea>
r20695r20696
1149611615      <info name="alt_title" value="ラングリッサーII"/>
1149711616      <part name="cart" interface="megadriv_cart">
1149811617         <feature name="pcb_type" value="SEGA-SRAM" />
11618         <feature name="slot" value="rom_sram" />
1149911619         <dataarea name="rom" size="2097152">
1150011620            <rom name="langrisser ii (jpn) (v1.2).bin" size="2097152" crc="4967c9f9" sha1="167944091348c89ce43dfa4854f8a51ed7276dde" offset="000000" loadflag="load16_word_swap" />
1150111621         </dataarea>
r20695r20696
1151011630      <publisher>NCS</publisher>
1151111631      <part name="cart" interface="megadriv_cart">
1151211632         <feature name="pcb_type" value="SEGA-SRAM" />
11633         <feature name="slot" value="rom_sram" />
1151311634         <dataarea name="rom" size="2097152">
1151411635            <rom name="langrisser ii (jpn) (v1.1).bin" size="2097152" crc="0caa0593" sha1="4ba6591dfd85aa75ffe8dc21137a9291aa7f5603" offset="000000" loadflag="load16_word_swap" />
1151511636         </dataarea>
r20695r20696
1152411645      <publisher>NCS</publisher>
1152511646      <part name="cart" interface="megadriv_cart">
1152611647         <feature name="pcb_type" value="SEGA-SRAM" />
11648         <feature name="slot" value="rom_sram" />
1152711649         <dataarea name="rom" size="2097152">
1152811650            <rom name="langrisser ii (jpn).bin" size="2097152" crc="7f891dfc" sha1="4bbc2502784a61eedf45eca5303dc68062964ff4" offset="000000" loadflag="load16_word_swap" />
1152911651         </dataarea>
r20695r20696
1174111863      <publisher>Koei</publisher>
1174211864      <part name="cart" interface="megadriv_cart">
1174311865         <feature name="pcb_type" value="SEGA-SRAM" />
11866         <feature name="slot" value="rom_sram" />
1174411867         <dataarea name="rom" size="2097152">
1174511868            <rom name="liberty or death (usa).bin" size="2097152" crc="2adb0364" sha1="c0ddfc2149cd84fbb0c5860b98c3a16f6000b85e" offset="000000" loadflag="load16_word_swap" />
1174611869         </dataarea>
r20695r20696
1175811881      <info name="alt_title" value="ライト クルセイダー"/>
1175911882      <part name="cart" interface="megadriv_cart">
1176011883         <feature name="pcb_type" value="SEGA-SRAM" />
11884         <feature name="slot" value="rom_sram" />
1176111885         <dataarea name="rom" size="2097152">
1176211886            <rom name="light crusader (jpn).bin" size="2097152" crc="237076a4" sha1="2b8c0931c33c143d41ef7cff6a8dbb9b8351d613" offset="000000" loadflag="load16_word_swap" />
1176311887         </dataarea>
r20695r20696
1177211896      <publisher>Sega</publisher>
1177311897      <part name="cart" interface="megadriv_cart">
1177411898         <feature name="pcb_type" value="SEGA-SRAM" />
11899         <feature name="slot" value="rom_sram" />
1177511900         <dataarea name="rom" size="2097152">
1177611901            <rom name="light crusader (kor).bin" size="2097152" crc="6d0cbcb2" sha1="0f018f95b4933bb5b3b3a91cee8b9a8ecb376942" offset="000000" loadflag="load16_word_swap" />
1177711902         </dataarea>
r20695r20696
1178611911      <publisher>Sega</publisher>
1178711912      <part name="cart" interface="megadriv_cart">
1178811913         <feature name="pcb_type" value="SEGA-SRAM" />
11914         <feature name="slot" value="rom_sram" />
1178911915         <dataarea name="rom" size="2097152">
1179011916            <rom name="light crusader (prototype - jun 08, 1995).bin" size="2097152" crc="e350ccfa" sha1="0bf26dba5324471532db776da1ee4c0c06add1e5" offset="000000" loadflag="load16_word_swap" />
1179111917         </dataarea>
r20695r20696
1180011926      <publisher>Sega</publisher>
1180111927      <part name="cart" interface="megadriv_cart">
1180211928         <feature name="pcb_type" value="SEGA-SRAM" />
11929         <feature name="slot" value="rom_sram" />
1180311930         <dataarea name="rom" size="2097152">
1180411931            <rom name="light crusader (usa).bin" size="2097152" crc="beb715dc" sha1="df58fbcbede4b9659740b5505641d4cc7dd1b7f8" offset="000000" loadflag="load16_word_swap" />
1180511932         </dataarea>
r20695r20696
1185311980      <info name="alt_title" value="ロードモナーク とことん戦闘伝説"/>
1185411981      <part name="cart" interface="megadriv_cart">
1185511982         <feature name="pcb_type" value="SEGA-SRAM" />
11983         <feature name="slot" value="rom_sram" />
1185611984         <dataarea name="rom" size="2097152">
1185711985            <rom name="lord monarch - tokoton sentou densetsu (jpn).bin" size="2097152" crc="238bf5db" sha1="9b5c71d70de132c8ba6f2adfdeba43077f76ac3e" offset="000000" loadflag="load16_word_swap" />
1185811986         </dataarea>
r20695r20696
1195512083      <publisher>Electronic Arts</publisher>
1195612084      <part name="cart" interface="megadriv_cart">
1195712085         <feature name="pcb_type" value="SEGA-SRAM" />
12086         <feature name="slot" value="rom_sram" />
1195812087         <dataarea name="rom" size="2097152">
1195912088            <rom name="madden nfl '94 (euro, usa).bin" size="2097152" crc="d14b811b" sha1="856d68d3e8589df3452096434feef823684d11eb" offset="000000" loadflag="load16_word_swap" />
1196012089         </dataarea>
r20695r20696
1196912098      <publisher>Electronic Arts</publisher>
1197012099      <part name="cart" interface="megadriv_cart">
1197112100         <feature name="pcb_type" value="SEGA-SRAM" />
12101         <feature name="slot" value="rom_sram" />
1197212102         <dataarea name="rom" size="2097152">
1197312103            <rom name="madden nfl 95 (euro, usa).bin" size="2097152" crc="db0be0c2" sha1="41cde6211da87a8e61e2ffd42cef5de588f9b9fc" offset="000000" loadflag="load16_word_swap" />
1197412104         </dataarea>
r20695r20696
1198312113      <publisher>Electronic Arts</publisher>
1198412114      <part name="cart" interface="megadriv_cart">
1198512115         <feature name="pcb_type" value="SEGA-SRAM" />
12116         <feature name="slot" value="rom_sram" />
1198612117         <dataarea name="rom" size="2097152">
1198712118            <rom name="madden nfl 96 (euro, usa).bin" size="2097152" crc="f126918b" sha1="35a4241eed51f10de2e63c843f162ce5d92c70a2" offset="000000" loadflag="load16_word_swap" />
1198812119         </dataarea>
r20695r20696
1199712128      <publisher>Electronic Arts</publisher>
1199812129      <part name="cart" interface="megadriv_cart">
1199912130         <feature name="pcb_type" value="SEGA-SRAM" />
12131         <feature name="slot" value="rom_sram" />
1200012132         <dataarea name="rom" size="2097152">
1200112133            <rom name="madden nfl 97 (euro, usa).bin" size="2097152" crc="c4b4e112" sha1="63544d2a0230be102f2558c03a74855fc712b865" offset="000000" loadflag="load16_word_swap" />
1200212134         </dataarea>
r20695r20696
1202512157      <info name="alt_title" value="魔導物語I"/>
1202612158      <part name="cart" interface="megadriv_cart">
1202712159         <feature name="pcb_type" value="SEGA-SRAM" />
12160         <feature name="slot" value="rom_sram" />
1202812161         <dataarea name="rom" size="2097152">
1202912162            <rom name="madou monogatari i (jpn).bin" size="2097152" crc="dd82c401" sha1="143456600e44f543796cf6ade77830115a8f2f99" offset="000000" loadflag="load16_word_swap" />
1203012163         </dataarea>
r20695r20696
1235212485      <publisher>Renovation</publisher>
1235312486      <part name="cart" interface="megadriv_cart">
1235412487         <feature name="pcb_type" value="SEGA-SRAM" />
12488         <feature name="slot" value="rom_sram" />
1235512489         <dataarea name="rom" size="524288">
1235612490            <rom name="master of monsters (usa).bin" size="524288" crc="91354820" sha1="28f38617911a99504542b30f70c0d9c81996ef65" offset="000000" loadflag="load16_word_swap" />
1235712491         </dataarea>
r20695r20696
1236912503      <info name="alt_title" value="マスター・オブ・モンスターズ"/>
1237012504      <part name="cart" interface="megadriv_cart">
1237112505         <feature name="pcb_type" value="SEGA-SRAM" />
12506         <feature name="slot" value="rom_sram" />
1237212507         <dataarea name="rom" size="524288">
1237312508            <rom name="mpr-14120.bin" size="524288" crc="d51ee8c2" sha1="ca62d376be5cc7b944bbe9b5f2610f8bb55a2fed" offset="000000" loadflag="load16_word_swap" />
1237412509         </dataarea>
r20695r20696
1240012535      <info name="alt_title" value="魔天の創滅"/>
1240112536      <part name="cart" interface="megadriv_cart">
1240212537         <feature name="pcb_type" value="SEGA-SRAM" />
12538         <feature name="slot" value="rom_sram" />
1240312539         <dataarea name="rom" size="1048576">
1240412540            <rom name="maten no soumetsu (jpn).bin" size="1048576" crc="b804a105" sha1="31bc44b019310e18174eb5e1a6d8e7d351103e4e" offset="000000" loadflag="load16_word_swap" />
1240512541         </dataarea>
r20695r20696
1262012756      <publisher>Capcom</publisher>
1262112757      <part name="cart" interface="megadriv_cart">
1262212758         <feature name="pcb_type" value="SEGA-EEPROM" />
12759         <feature name="slot" value="rom_eeprom" />
1262312760         <dataarea name="rom" size="2097152">
1262412761            <rom name="mega man - the wily wars (euro).bin" size="2097152" crc="dcf6e8b2" sha1="ea9ae2043c97db716a8d31ee90e581c3d75f4e3e" offset="000000" loadflag="load16_word_swap" />
1262512762         </dataarea>
r20695r20696
1263512772      <info name="alt_title" value="ロックマン メガワールド"/>
1263612773      <part name="cart" interface="megadriv_cart">
1263712774         <feature name="pcb_type" value="SEGA-SRAM" />
12775         <feature name="slot" value="rom_sram" />
1263812776         <dataarea name="rom" size="2097152">
1263912777            <rom name="rockman mega world (jpn).bin" size="2097152" crc="4d87235e" sha1="4dfcf5c07106f6db4d8b7e73a053bb46a21686c3" offset="000000" loadflag="load16_word_swap" />
1264012778         </dataarea>
r20695r20696
1295913097      <publisher>Codemasters</publisher>
1296013098      <part name="cart" interface="megadriv_cart">
1296113099         <feature name="pcb_type" value="CM-JCART-SEPROM" />
13100         <feature name="slot" value="rom_mm96" />
1296213101         <dataarea name="rom" size="1048576">
1296313102            <rom name="mm96md7cc3.bin" size="1048576" crc="7492b1de" sha1="9f47fcc7bb2f5921cb1c3beb06b668ffb292cb08" offset="000000" loadflag="load16_word_swap" />
1296413103         </dataarea>
r20695r20696
1297113110      <publisher>Codemasters</publisher>
1297213111      <part name="cart" interface="megadriv_cart">
1297313112         <feature name="pcb_type" value="CM-JCART-SEPROM" />
13113         <feature name="slot" value="rom_codemast" />
1297413114         <dataarea name="rom" size="1048576">
1297513115            <rom name="micro machines 2 - turbo tournament (euro) (j-cart) (alt).bin" size="1048576" crc="01c22a5d" sha1="cb5fb33212592809639b37c2babd72a7953fa102" offset="000000" loadflag="load16_word_swap" />
1297613116         </dataarea>
r20695r20696
1298313123      <publisher>Codemasters</publisher>
1298413124      <part name="cart" interface="megadriv_cart">
1298513125         <feature name="pcb_type" value="CM-JCART-SEPROM" />
13126         <feature name="slot" value="rom_codemast" />
1298613127         <dataarea name="rom" size="1048576">
1298713128            <rom name="micro machines military (euro) (j-cart).bin" size="1048576" crc="b3abb15e" sha1="6d3df64ab8bb0b559f216adca62d1cdd74704a26" offset="000000" loadflag="load16_word_swap" />
1298813129         </dataarea>
r20695r20696
1327913420      <info name="alt_title" value="超球界ミラクルナイン"/>
1328013421      <part name="cart" interface="megadriv_cart">
1328113422         <feature name="pcb_type" value="SEGA-SRAM" />
13423         <feature name="slot" value="rom_sram" />
1328213424         <dataarea name="rom" size="2097152">
1328313425            <rom name="chou kyuukai miracle nine (jpn).bin" size="2097152" crc="6d8c2206" sha1="af2fd89dc7fb4ac0647c09edff462c7ae92dc771" offset="000000" loadflag="load16_word_swap" />
1328413426         </dataarea>
r20695r20696
1332613468      <publisher>Electronic Arts</publisher>
1332713469      <part name="cart" interface="megadriv_cart">
1332813470         <feature name="pcb_type" value="SEGA-SRAM" />
13471         <feature name="slot" value="rom_sram" />
1332913472         <dataarea name="rom" size="2097152">
1333013473            <rom name="mlbpa baseball (usa).bin" size="2097152" crc="14a8064d" sha1="5a85c659db9dd7485ed1463a252f0941346aba24" offset="000000" loadflag="load16_word_swap" />
1333113474         </dataarea>
r20695r20696
1336513508      <info name="alt_title" value="モンスターワールドIV"/>
1336613509      <part name="cart" interface="megadriv_cart">
1336713510         <feature name="pcb_type" value="SEGA-SRAM" />
13511         <feature name="slot" value="rom_sram" />
1336813512         <dataarea name="rom" size="2097152">
1336913513            <rom name="monster world iv (jpn).bin" size="2097152" crc="36a3aaa4" sha1="46ba5e8775a2223fe5056f54555d9caa7d04f4e1" offset="000000" loadflag="load16_word_swap" />
1337013514         </dataarea>
r20695r20696
1367213816      <info name="alt_title" value="中嶋 悟 監修F-1 グランプリ"/>
1367313817      <part name="cart" interface="megadriv_cart">
1367413818         <feature name="pcb_type" value="SEGA-SRAM" />
13819         <feature name="slot" value="rom_sram" />
1367513820         <dataarea name="rom" size="1048576">
1367613821            <rom name="nakajima satoru kanshuu f1 grand prix (jpn).bin" size="1048576" crc="93be47cf" sha1="e108342d53e1542d572d2e45524efbfe9d5dc964" offset="000000" loadflag="load16_word_swap" />
1367713822         </dataarea>
r20695r20696
1370313848      <info name="alt_title" value="中嶋 悟 監修 エフワンスーパーライセンス"/>
1370413849      <part name="cart" interface="megadriv_cart">
1370513850         <feature name="pcb_type" value="SEGA-SRAM" />
13851         <feature name="slot" value="rom_sram" />
1370613852         <dataarea name="rom" size="1048576">
1370713853            <rom name="nakajima satoru kanshuu f1 super license (jpn).bin" size="1048576" crc="8774bc79" sha1="ad5456259890bcb32098f82f14a1d5355af83f7e" offset="000000" loadflag="load16_word_swap" />
1370813854         </dataarea>
r20695r20696
1371813864      <info name="alt_title" value="NBA Action '94 (Box)"/>
1371913865      <part name="cart" interface="megadriv_cart">
1372013866         <feature name="pcb_type" value="SEGA-SRAM" />
13867         <feature name="slot" value="rom_sram" />
1372113868         <dataarea name="rom" size="2097152">
1372213869            <rom name="nba action (usa).bin" size="2097152" crc="99c348ba" sha1="e2b5290d656219636e2422fcf93424ae602c4d29" offset="000000" loadflag="load16_word_swap" />
1372313870         </dataarea>
r20695r20696
1374313890      <publisher>Sega</publisher>
1374413891      <part name="cart" interface="megadriv_cart">
1374513892         <feature name="pcb_type" value="SEGA-SRAM" />
13893         <feature name="slot" value="rom_sram" />
1374613894         <dataarea name="rom" size="2097152">
1374713895            <rom name="nba action (prototype - jan 16, 1994).bin" size="2097152" crc="fe43c79d" sha1="da6fcc1d7069e315797dd40a89e21963ab766b9e" offset="000000" loadflag="load16_word_swap" />
1374813896         </dataarea>
r20695r20696
1375713905      <publisher>Sega</publisher>
1375813906      <part name="cart" interface="megadriv_cart">
1375913907         <feature name="pcb_type" value="SEGA-SRAM" />
13908         <feature name="slot" value="rom_sram" />
1376013909         <dataarea name="rom" size="2097152">
1376113910            <rom name="nba action (prototype - jan 27, 1994) (broken - c08 missing).bin" size="2097152" crc="176a4bc5" sha1="d5a6fbf8fe19bf70631a847e6b5e6a35878c7ae8" offset="000000" loadflag="load16_word_swap" />
1376213911         </dataarea>
r20695r20696
1377213921      <info name="alt_title" value="NBA Action '95 Starring David Robinson (Box)"/>
1377313922      <part name="cart" interface="megadriv_cart">
1377413923         <feature name="pcb_type" value="SEGA-SRAM" />
13924         <feature name="slot" value="rom_sram" />
1377513925         <dataarea name="rom" size="2097152">
1377613926            <rom name="nba action '95 starring david robinson (euro, usa).bin" size="2097152" crc="aa7006d6" sha1="34e2df219e09c24c95c588a37d2a2c5e15814d68" offset="000000" loadflag="load16_word_swap" />
1377713927         </dataarea>
r20695r20696
1378613936      <publisher>Sega</publisher>
1378713937      <part name="cart" interface="megadriv_cart">
1378813938         <feature name="pcb_type" value="SEGA-SRAM" />
13939         <feature name="slot" value="rom_sram" />
1378913940         <dataarea name="rom" size="2097152">
1379013941            <rom name="nba action '95 (prototype - dec 02, 1994 - b).bin" size="2097152" crc="04bf6f6e" sha1="42c55adad0249bb09350d1ac7c9bfb737ed091c8" offset="000000" loadflag="load16_word_swap" />
1379113942         </dataarea>
r20695r20696
1380013951      <publisher>Sega</publisher>
1380113952      <part name="cart" interface="megadriv_cart">
1380213953         <feature name="pcb_type" value="SEGA-SRAM" />
13954         <feature name="slot" value="rom_sram" />
1380313955         <dataarea name="rom" size="2097152">
1380413956            <rom name="nba action '95 (prototype - dec 09, 1994).bin" size="2097152" crc="2b198487" sha1="2c34500bf06bbac610e8fca45db48382e32c8807" offset="000000" loadflag="load16_word_swap" />
1380513957         </dataarea>
r20695r20696
1381413966      <publisher>Sega</publisher>
1381513967      <part name="cart" interface="megadriv_cart">
1381613968         <feature name="pcb_type" value="SEGA-SRAM" />
13969         <feature name="slot" value="rom_sram" />
1381713970         <dataarea name="rom" size="2097152">
1381813971            <rom name="nba action '95 (prototype - dec 15, 1994).bin" size="2097152" crc="10a3b46d" sha1="c3f88b334af683e8ac98cafafa9abf4dfe65a4b7" offset="000000" loadflag="load16_word_swap" />
1381913972         </dataarea>
r20695r20696
1382813981      <publisher>Sega</publisher>
1382913982      <part name="cart" interface="megadriv_cart">
1383013983         <feature name="pcb_type" value="SEGA-SRAM" />
13984         <feature name="slot" value="rom_sram" />
1383113985         <dataarea name="rom" size="2097152">
1383213986            <rom name="nba action '95 (prototype - dec 22, 1994 - a).bin" size="2097152" crc="f92ba323" sha1="35f7436fa15591234edcb6fe72da24d091963d30" offset="000000" loadflag="load16_word_swap" />
1383313987         </dataarea>
r20695r20696
1384213996      <publisher>Sega</publisher>
1384313997      <part name="cart" interface="megadriv_cart">
1384413998         <feature name="pcb_type" value="SEGA-SRAM" />
13999         <feature name="slot" value="rom_sram" />
1384514000         <dataarea name="rom" size="2097152">
1384614001            <rom name="nba action '95 (prototype - dec 24, 1994 - a).bin" size="2097152" crc="ddb04550" sha1="248e67cad67118a1449de308bac0437641bda3ec" offset="000000" loadflag="load16_word_swap" />
1384714002         </dataarea>
r20695r20696
1385614011      <publisher>Sega</publisher>
1385714012      <part name="cart" interface="megadriv_cart">
1385814013         <feature name="pcb_type" value="SEGA-SRAM" />
14014         <feature name="slot" value="rom_sram" />
1385914015         <dataarea name="rom" size="2097152">
1386014016            <rom name="nba action '95 (prototype - dec 29, 1994).bin" size="2097152" crc="dcebe32a" sha1="2604a03c1dc59538a82e32bcc6f8a995bd8af609" offset="000000" loadflag="load16_word_swap" />
1386114017         </dataarea>
r20695r20696
1387014026      <publisher>Sega</publisher>
1387114027      <part name="cart" interface="megadriv_cart">
1387214028         <feature name="pcb_type" value="SEGA-SRAM" />
14029         <feature name="slot" value="rom_sram" />
1387314030         <dataarea name="rom" size="2097152">
1387414031            <rom name="nba action '95 (prototype - dec 30, 1994).bin" size="2097152" crc="d87956c9" sha1="4ddbe2f458915db0da45fa490d653f2d94ec1263" offset="000000" loadflag="load16_word_swap" />
1387514032         </dataarea>
r20695r20696
1388414041      <publisher>Sega</publisher>
1388514042      <part name="cart" interface="megadriv_cart">
1388614043         <feature name="pcb_type" value="SEGA-SRAM" />
14044         <feature name="slot" value="rom_sram" />
1388714045         <dataarea name="rom" size="2097152">
1388814046            <rom name="nba action '95 (prototype - dec 31, 1994).bin" size="2097152" crc="582a378f" sha1="ba08a3f042f96b4b3bb889bbacb6a5e13b114f0c" offset="000000" loadflag="load16_word_swap" />
1388914047         </dataarea>
r20695r20696
1389814056      <publisher>Sega</publisher>
1389914057      <part name="cart" interface="megadriv_cart">
1390014058         <feature name="pcb_type" value="SEGA-SRAM" />
14059         <feature name="slot" value="rom_sram" />
1390114060         <dataarea name="rom" size="2097152">
1390214061            <rom name="nba action '95 (prototype - feb 01, 1995).bin" size="2097152" crc="2c02a79d" sha1="3dbc1a80005eb6783feeb4d3604d382d1cf688bc" offset="000000" loadflag="load16_word_swap" />
1390314062         </dataarea>
r20695r20696
1391314072      <publisher>Sega</publisher>
1391414073      <part name="cart" interface="megadriv_cart">
1391514074         <feature name="pcb_type" value="SEGA-SRAM" />
14075         <feature name="slot" value="rom_sram" />
1391614076         <dataarea name="rom" size="2094238">
1391714077            <rom name="nba action '95 (prototype - feb 1, 1995).bin" size="2094238" crc="c4a0a624" sha1="58c88d26baffd0f68c2b5d95284323ba99db9b5a" offset="000000" loadflag="load16_word_swap" />
1391814078         </dataarea>
r20695r20696
1392714087      <publisher>Sega</publisher>
1392814088      <part name="cart" interface="megadriv_cart">
1392914089         <feature name="pcb_type" value="SEGA-SRAM" />
14090         <feature name="slot" value="rom_sram" />
1393014091         <dataarea name="rom" size="2089456">
1393114092            <rom name="nba action '95 (prototype - feb 2, 1995).bin" size="2089456" crc="a9167903" sha1="3a5a95a79b1b2da0b35e8cde02d8645fe474fdde" offset="000000" loadflag="load16_word_swap" />
1393214093         </dataarea>
r20695r20696
1394114102      <publisher>Sega</publisher>
1394214103      <part name="cart" interface="megadriv_cart">
1394314104         <feature name="pcb_type" value="SEGA-SRAM" />
14105         <feature name="slot" value="rom_sram" />
1394414106         <dataarea name="rom" size="2097152">
1394514107            <rom name="nba action '95 (prototype - jan 03, 1995).bin" size="2097152" crc="374af160" sha1="b50be710436a3cb1f7644fdfac5d5098cd9dbb2b" offset="000000" loadflag="load16_word_swap" />
1394614108         </dataarea>
r20695r20696
1395514117      <publisher>Sega</publisher>
1395614118      <part name="cart" interface="megadriv_cart">
1395714119         <feature name="pcb_type" value="SEGA-SRAM" />
14120         <feature name="slot" value="rom_sram" />
1395814121         <dataarea name="rom" size="2097152">
1395914122            <rom name="nba action '95 (prototype - jan 08, 1995).bin" size="2097152" crc="0a6b7b9e" sha1="3a60332ee684ff8accd96aef404346e66e267b6f" offset="000000" loadflag="load16_word_swap" />
1396014123         </dataarea>
r20695r20696
1396914132      <publisher>Sega</publisher>
1397014133      <part name="cart" interface="megadriv_cart">
1397114134         <feature name="pcb_type" value="SEGA-SRAM" />
14135         <feature name="slot" value="rom_sram" />
1397214136         <dataarea name="rom" size="2097152">
1397314137            <rom name="nba action '95 (prototype - jan 12, 1995).bin" size="2097152" crc="b47ff025" sha1="9f6a2ea386d383aee3be06d6b74fda67b1ebd960" offset="000000" loadflag="load16_word_swap" />
1397414138         </dataarea>
r20695r20696
1398314147      <publisher>Sega</publisher>
1398414148      <part name="cart" interface="megadriv_cart">
1398514149         <feature name="pcb_type" value="SEGA-SRAM" />
14150         <feature name="slot" value="rom_sram" />
1398614151         <dataarea name="rom" size="2097152">
1398714152            <rom name="nba action '95 (prototype - jan 15, 1995 - a).bin" size="2097152" crc="9c6a1f27" sha1="2fdb8879d50d963d984c280cab2e279b9479081f" offset="000000" loadflag="load16_word_swap" />
1398814153         </dataarea>
r20695r20696
1399714162      <publisher>Sega</publisher>
1399814163      <part name="cart" interface="megadriv_cart">
1399914164         <feature name="pcb_type" value="SEGA-SRAM" />
14165         <feature name="slot" value="rom_sram" />
1400014166         <dataarea name="rom" size="2097152">
1400114167            <rom name="nba action '95 (prototype - jan 21, 1995).bin" size="2097152" crc="e337bdfb" sha1="591288688956cec3d0aca3dd099b3e0985ca947a" offset="000000" loadflag="load16_word_swap" />
1400214168         </dataarea>
r20695r20696
1401114177      <publisher>Sega</publisher>
1401214178      <part name="cart" interface="megadriv_cart">
1401314179         <feature name="pcb_type" value="SEGA-SRAM" />
14180         <feature name="slot" value="rom_sram" />
1401414181         <dataarea name="rom" size="2097152">
1401514182            <rom name="nba action '95 (prototype - jan 22, 1995 - b).bin" size="2097152" crc="7bd7ca47" sha1="f219274a65c31d76a2d6633b7e7cf65462850f47" offset="000000" loadflag="load16_word_swap" />
1401614183         </dataarea>
r20695r20696
1402514192      <publisher>Sega</publisher>
1402614193      <part name="cart" interface="megadriv_cart">
1402714194         <feature name="pcb_type" value="SEGA-SRAM" />
14195         <feature name="slot" value="rom_sram" />
1402814196         <dataarea name="rom" size="2097152">
1402914197            <rom name="nba action '95 (prototype - jan 24, 1995 - b).bin" size="2097152" crc="15abcf41" sha1="eb99f0e1cac800f94743fde873448e56edb46333" offset="000000" loadflag="load16_word_swap" />
1403014198         </dataarea>
r20695r20696
1403914207      <publisher>Sega</publisher>
1404014208      <part name="cart" interface="megadriv_cart">
1404114209         <feature name="pcb_type" value="SEGA-SRAM" />
14210         <feature name="slot" value="rom_sram" />
1404214211         <dataarea name="rom" size="2089360">
1404314212            <rom name="nba action '95 (prototype - jan 27, 1995 - a).bin" size="2089360" crc="79c7fb00" sha1="90c246dcb8ccea0f30ae5582b610721fc802f937" offset="000000" loadflag="load16_word_swap" />
1404414213         </dataarea>
r20695r20696
1405314222      <publisher>Sega</publisher>
1405414223      <part name="cart" interface="megadriv_cart">
1405514224         <feature name="pcb_type" value="SEGA-SRAM" />
14225         <feature name="slot" value="rom_sram" />
1405614226         <dataarea name="rom" size="2089360">
1405714227            <rom name="nba action '95 (prototype - jan 27, 1995 - b).bin" size="2089360" crc="ef7f608b" sha1="32104d3585dcbf190904accdb9528f0b7105eb4b" offset="000000" loadflag="load16_word_swap" />
1405814228         </dataarea>
r20695r20696
1406714237      <publisher>Sega</publisher>
1406814238      <part name="cart" interface="megadriv_cart">
1406914239         <feature name="pcb_type" value="SEGA-SRAM" />
14240         <feature name="slot" value="rom_sram" />
1407014241         <dataarea name="rom" size="2097152">
1407114242            <rom name="nba action '95 (prototype - jan 28, 1995 - a).bin" size="2097152" crc="57c2c69c" sha1="f1affb6e01ca23b67aee9e1c1767f9ec13849823" offset="000000" loadflag="load16_word_swap" />
1407214243         </dataarea>
r20695r20696
1408114252      <publisher>Sega</publisher>
1408214253      <part name="cart" interface="megadriv_cart">
1408314254         <feature name="pcb_type" value="SEGA-SRAM" />
14255         <feature name="slot" value="rom_sram" />
1408414256         <dataarea name="rom" size="2089374">
1408514257            <rom name="nba action '95 (prototype - jan 28, 1995).bin" size="2089374" crc="97d7075d" sha1="dd1256efa397a56d461e2bc7aec9f72aff9b04fb" offset="000000" loadflag="load16_word_swap" />
1408614258         </dataarea>
r20695r20696
1409514267      <publisher>Sega</publisher>
1409614268      <part name="cart" interface="megadriv_cart">
1409714269         <feature name="pcb_type" value="SEGA-SRAM" />
14270         <feature name="slot" value="rom_sram" />
1409814271         <dataarea name="rom" size="2097152">
1409914272            <rom name="nba action '95 (prototype - jan 30, 1995).bin" size="2097152" crc="2fac80b2" sha1="ab90daf9791fa7347fb8f040e27f91b6bae46e1e" offset="000000" loadflag="load16_word_swap" />
1410014273         </dataarea>
r20695r20696
1410914282      <publisher>Sega</publisher>
1411014283      <part name="cart" interface="megadriv_cart">
1411114284         <feature name="pcb_type" value="SEGA-SRAM" />
14285         <feature name="slot" value="rom_sram" />
1411214286         <dataarea name="rom" size="2097152">
1411314287            <rom name="nba action '95 (prototype - nov 18, 1994).bin" size="2097152" crc="2d411e4b" sha1="492776fc2659091d435a79588efcdd8e06d3cd0b" offset="000000" loadflag="load16_word_swap" />
1411414288         </dataarea>
r20695r20696
1412314297      <publisher>Sega</publisher>
1412414298      <part name="cart" interface="megadriv_cart">
1412514299         <feature name="pcb_type" value="SEGA-SRAM" />
14300         <feature name="slot" value="rom_sram" />
1412614301         <dataarea name="rom" size="2097152">
1412714302            <rom name="nba action '95 (prototype - nov 23, 1994 - a).bin" size="2097152" crc="4650cfcc" sha1="0eee2e7296e3eed5dbf85954ce14a53622ae3d64" offset="000000" loadflag="load16_word_swap" />
1412814303         </dataarea>
r20695r20696
1417014345      <publisher>Arena</publisher>
1417114346      <part name="cart" interface="megadriv_cart">
1417214347         <feature name="pcb_type" value="NBAJAM" />
14348         <feature name="slot" value="rom_nbajam" />
1417314349         <dataarea name="rom" size="2097152">
1417414350            <rom name="nba jam (euro, usa) (v1.1).bin" size="2097152" crc="eb8360e6" sha1="55f2b26a932c69b2c7cb4f24f56b43f24f113a7c" offset="000000" loadflag="load16_word_swap" />
1417514351         </dataarea>
r20695r20696
1418214358      <publisher>Arena</publisher>
1418314359      <part name="cart" interface="megadriv_cart">
1418414360         <feature name="pcb_type" value="NBAJAM" />
14361         <feature name="slot" value="rom_nbajam" />
1418514362         <dataarea name="rom" size="2097152">
1418614363            <rom name="s285_ver_1.00.bin" size="2097152" crc="10fa248f" sha1="99c5bc57fdea7f9df0cd8dec54160b162342344d" offset="000000" loadflag="load16_word_swap" />
1418714364         </dataarea>
r20695r20696
1419714374      <info name="alt_title" value="NBA ジャム"/>
1419814375      <part name="cart" interface="megadriv_cart">
1419914376         <feature name="pcb_type" value="NBAJAM" />
14377         <feature name="slot" value="rom_nbajam" />
1420014378         <dataarea name="rom" size="2097152">
1420114379            <rom name="nba jam (jpn).bin" size="2097152" crc="a6c6305a" sha1="2a88b2e1ecf115fa6246397d829448b755a5385e" offset="000000" loadflag="load16_word_swap" />
1420214380         </dataarea>
r20695r20696
1421014388      <info name="alt_title" value="NBA ジャム"/>
1421114389      <part name="cart" interface="megadriv_cart">
1421214390         <feature name="pcb_type" value="NBAJAM" />
14391         <feature name="slot" value="rom_nbajam" />
1421314392         <feature name="pcb" value="171-6568C" />
1421414393         <feature name="pcb2" value="837-9952" />
1421514394         <feature name="ic1" value="27c4000" />
r20695r20696
1425314432      <info name="alt_title" value="NBA ジャム トーナメントエディション"/>
1425414433      <part name="cart" interface="megadriv_cart">
1425514434         <feature name="pcb_type" value="NBAJAMTE" />
14435         <feature name="slot" value="rom_nbajamte" />
1425614436         <dataarea name="rom" size="3145728">
1425714437            <rom name="nba jam tournament edition (world).bin" size="3145728" crc="e9ffcb37" sha1="ddbf09c5e6ed5d528ef5ec816129a332c685f103" offset="000000" loadflag="load16_word_swap" />
1425814438         </dataarea>
r20695r20696
1426514445      <publisher>Acclaim Entertainment</publisher>
1426614446      <part name="cart" interface="megadriv_cart">
1426714447         <feature name="pcb_type" value="NBAJAMTE" />
14448         <feature name="slot" value="rom_nbajamte" />
1426814449         <dataarea name="rom" size="3145728">
1426914450            <rom name="nba jam tournament edition (world) (fixed).bin" size="3145728" crc="6e25ebf0" sha1="0f5bb5d5352fe2ebe4b4051a1dd9b9fde4b505ab" offset="000000" loadflag="load16_word_swap" />
1427014451         </dataarea>
r20695r20696
1427714458      <publisher>Electronic Arts</publisher>
1427814459      <part name="cart" interface="megadriv_cart">
1427914460         <feature name="pcb_type" value="SEGA-SRAM" />
14461         <feature name="slot" value="rom_sram" />
1428014462         <dataarea name="rom" size="2097152">
1428114463            <rom name="nba live 95 (euro, usa).bin" size="2097152" crc="66018abc" sha1="f86bc9601751ac94119ab2f3ecce2029d5678f01" offset="000000" loadflag="load16_word_swap" />
1428214464         </dataarea>
r20695r20696
1430214484      <publisher>Electronic Arts</publisher>
1430314485      <part name="cart" interface="megadriv_cart">
1430414486         <feature name="pcb_type" value="SEGA-SRAM" />
14487         <feature name="slot" value="rom_sram" />
1430514488         <dataarea name="rom" size="2097152">
1430614489            <rom name="nba live 96 (euro, usa).bin" size="2097152" crc="49de0062" sha1="5fca106c839d3dea11cbf6842d1d7650db06ca72" offset="000000" loadflag="load16_word_swap" />
1430714490         </dataarea>
r20695r20696
1431614499      <publisher>Electronic Arts</publisher>
1431714500      <part name="cart" interface="megadriv_cart">
1431814501         <feature name="pcb_type" value="SEGA-SRAM" />
14502         <feature name="slot" value="rom_sram" />
1431914503         <dataarea name="rom" size="2097152">
1432014504            <rom name="nba live 97 (euro, usa).bin" size="2097152" crc="7024843a" sha1="1671451ab4ab6991e13db70671054c0f2c652a95" offset="000000" loadflag="load16_word_swap" />
1432114505         </dataarea>
r20695r20696
1438614570      <info name="alt_title" value="NBAプロバスケットボール'94"/>
1438714571      <part name="cart" interface="megadriv_cart">
1438814572         <feature name="pcb_type" value="SEGA-SRAM" />
14573         <feature name="slot" value="rom_sram" />
1438914574         <dataarea name="rom" size="2097152">
1439014575            <rom name="nba pro basketball '94 (jpn).bin" size="2097152" crc="eea19bce" sha1="99c91fe3a5401e84e7b3fd2218dcb3aeaf10db74" offset="000000" loadflag="load16_word_swap" />
1439114576         </dataarea>
r20695r20696
1440014585      <publisher>Electronic Arts</publisher>
1440114586      <part name="cart" interface="megadriv_cart">
1440214587         <feature name="pcb_type" value="SEGA-SRAM" />
14588         <feature name="slot" value="rom_sram" />
1440314589         <dataarea name="rom" size="2097152">
1440414590            <rom name="nba showdown '94 (euro, usa).bin" size="2097152" crc="160b7090" sha1="3134a3cb63115d2e16e63a76c2708cdaecab83e4" offset="000000" loadflag="load16_word_swap" />
1440514591         </dataarea>
r20695r20696
1441514601      <publisher>Electronic Arts</publisher>
1441614602      <part name="cart" interface="megadriv_cart">
1441714603         <feature name="pcb_type" value="SEGA-SRAM" />
14604         <feature name="slot" value="rom_sram" />
1441814605         <dataarea name="rom" size="2097152">
1441914606            <rom name="nba showdown '94 (usa) (beta).bin" size="2097152" crc="6643a308" sha1="e804ca0f4da505056f0813f00df9b139248f59af" offset="000000" status="baddump" loadflag="load16_word_swap" />
1442014607         </dataarea>
r20695r20696
1442914616      <publisher>Mindscape</publisher>
1443014617      <part name="cart" interface="megadriv_cart">
1443114618         <feature name="pcb_type" value="SEGA-SRAM" />
14619         <feature name="slot" value="rom_sram" />
1443214620         <dataarea name="rom" size="1572864">
1443314621            <rom name="ncaa final four basketball (usa).bin" size="1572864" crc="ed0c1303" sha1="29021b8c3bbcc62606c692a3de90d4e7a71b6361" offset="000000" loadflag="load16_word_swap" />
1443414622         </dataarea>
r20695r20696
1444314631      <publisher>Mindscape</publisher>
1444414632      <part name="cart" interface="megadriv_cart">
1444514633         <feature name="pcb_type" value="SEGA-SRAM" />
14634         <feature name="slot" value="rom_sram" />
1444614635         <dataarea name="rom" size="1048576">
1444714636            <rom name="ncaa football (usa).bin" size="1048576" crc="081012f0" sha1="227e3c650d01c35a80de8a3ef9b18f96c07ecd38" offset="000000" loadflag="load16_word_swap" />
1444814637         </dataarea>
r20695r20696
1447414663      <info name="alt_title" value="デビルズコース"/>
1447514664      <part name="cart" interface="megadriv_cart">
1447614665         <feature name="pcb_type" value="SEGA-SRAM" />
14666         <feature name="slot" value="rom_sram" />
1447714667         <dataarea name="rom" size="1572864">
1447814668            <rom name="new 3d golf simulation devil's course (jpn).bin" size="1572864" crc="bd090c67" sha1="4509c10ab263175c605111c72c6c63c57321046a" offset="000000" loadflag="load16_word_swap" />
1447914669         </dataarea>
r20695r20696
1449114681      <info name="alt_title" value="遥かなるオーガスタ"/>
1449214682      <part name="cart" interface="megadriv_cart">
1449314683         <feature name="pcb_type" value="SEGA-SRAM" />
14684         <feature name="slot" value="rom_sram" />
1449414685         <dataarea name="rom" size="1572864">
1449514686            <rom name="mpr-16076.bin" size="1572864" crc="d2a9bf92" sha1="d023f9fc5d7c7f2873a5bf79f6035111b78cdd5d" offset="000000" loadflag="load16_word_swap" />
1449614687         </dataarea>
r20695r20696
1450814699      <info name="alt_title" value="ワイアラエの奇蹟"/>
1450914700      <part name="cart" interface="megadriv_cart">
1451014701         <feature name="pcb_type" value="SEGA-SRAM" />
14702         <feature name="slot" value="rom_sram" />
1451114703         <dataarea name="rom" size="1572864">
1451214704            <rom name="new 3d golf simulation waialae no kiseki (jpn).bin" size="1572864" crc="cbe2c1f6" sha1="5d78c5cf3a514275a7df6d9fdbd708584b42e697" offset="000000" loadflag="load16_word_swap" />
1451314705         </dataarea>
r20695r20696
1452214714      <publisher>Sega</publisher>
1452314715      <part name="cart" interface="megadriv_cart">
1452414716         <feature name="pcb_type" value="SEGA-SRAM" />
14717         <feature name="slot" value="rom_sram" />
1452514718         <dataarea name="rom" size="2097152">
1452614719            <rom name="nfl '95 (euro, usa).bin" size="2097152" crc="b58e4a81" sha1="327249456f96ccb3e9758c0162c5f3e3f389072f" offset="000000" loadflag="load16_word_swap" />
1452714720         </dataarea>
r20695r20696
1464614839      <publisher>Sega</publisher>
1464714840      <part name="cart" interface="megadriv_cart">
1464814841         <feature name="pcb_type" value="SEGA-SRAM" />
14842         <feature name="slot" value="rom_sram" />
1464914843         <dataarea name="rom" size="2097152">
1465014844            <rom name="nfl '95 (prototype - sep 01, 1994).bin" size="2097152" crc="9240fcaa" sha1="ea1126f9cade3ec680dd029af10a5268cd5afa72" offset="000000" loadflag="load16_word_swap" />
1465114845         </dataarea>
r20695r20696
1466014854      <publisher>Sega</publisher>
1466114855      <part name="cart" interface="megadriv_cart">
1466214856         <feature name="pcb_type" value="SEGA-SRAM" />
14857         <feature name="slot" value="rom_sram" />
1466314858         <dataarea name="rom" size="2097152">
1466414859            <rom name="nfl '95 (prototype - sep 02, 1994).bin" size="2097152" crc="ff049a49" sha1="83c70177164e418b988ed9144d9d12c0e7052c3b" offset="000000" loadflag="load16_word_swap" />
1466514860         </dataarea>
r20695r20696
1467414869      <publisher>Sega</publisher>
1467514870      <part name="cart" interface="megadriv_cart">
1467614871         <feature name="pcb_type" value="SEGA-SRAM" />
14872         <feature name="slot" value="rom_sram" />
1467714873         <dataarea name="rom" size="2097152">
1467814874            <rom name="nfl '95 (prototype - sep 04, 1994).bin" size="2097152" crc="60604d40" sha1="c07558f34b7480e063eb60126fc33fba36ae3daa" offset="000000" loadflag="load16_word_swap" />
1467914875         </dataarea>
r20695r20696
1468814884      <publisher>Sega</publisher>
1468914885      <part name="cart" interface="megadriv_cart">
1469014886         <feature name="pcb_type" value="SEGA-SRAM" />
14887         <feature name="slot" value="rom_sram" />
1469114888         <dataarea name="rom" size="2097152">
1469214889            <rom name="nfl '95 (prototype - sep 05, 1994 - b).bin" size="2097152" crc="123985a5" sha1="f25cbabd3f6284387e66eaa72fa4124f3768121e" offset="000000" loadflag="load16_word_swap" />
1469314890         </dataarea>
r20695r20696
1470214899      <publisher>Sega</publisher>
1470314900      <part name="cart" interface="megadriv_cart">
1470414901         <feature name="pcb_type" value="SEGA-SRAM" />
14902         <feature name="slot" value="rom_sram" />
1470514903         <dataarea name="rom" size="2097152">
1470614904            <rom name="nfl '95 (prototype - sep 05, 1994).bin" size="2097152" crc="dbdf61ac" sha1="787f8093d8a5c55ee9dcaa49925752169527fa62" offset="000000" loadflag="load16_word_swap" />
1470714905         </dataarea>
r20695r20696
1471614914      <publisher>Sega</publisher>
1471714915      <part name="cart" interface="megadriv_cart">
1471814916         <feature name="pcb_type" value="SEGA-SRAM" />
14917         <feature name="slot" value="rom_sram" />
1471914918         <dataarea name="rom" size="2097152">
1472014919            <rom name="nfl '95 (prototype - sep 06, 1994).bin" size="2097152" crc="624b8699" sha1="59c548514bee4be7a5e6e3483ac3122d410a7e4e" offset="000000" loadflag="load16_word_swap" />
1472114920         </dataarea>
r20695r20696
1473014929      <publisher>Sega</publisher>
1473114930      <part name="cart" interface="megadriv_cart">
1473214931         <feature name="pcb_type" value="SEGA-SRAM" />
14932         <feature name="slot" value="rom_sram" />
1473314933         <dataarea name="rom" size="2097152">
1473414934            <rom name="nfl '95 (prototype - sep 07, 1994).bin" size="2097152" crc="ae8aa4be" sha1="ddf2b988bc035a0736ed3a1d7c8e6aa8cd2625f8" offset="000000" loadflag="load16_word_swap" />
1473514935         </dataarea>
r20695r20696
1474414944      <publisher>Sega</publisher>
1474514945      <part name="cart" interface="megadriv_cart">
1474614946         <feature name="pcb_type" value="SEGA-SRAM" />
14947         <feature name="slot" value="rom_sram" />
1474714948         <dataarea name="rom" size="2097152">
1474814949            <rom name="nfl '95 (prototype - sep 08, 1994).bin" size="2097152" crc="22c5e289" sha1="f8689fd01dedced28ca417bf7ff8a9eea9973c3d" offset="000000" loadflag="load16_word_swap" />
1474914950         </dataarea>
r20695r20696
1475814959      <publisher>Sega</publisher>
1475914960      <part name="cart" interface="megadriv_cart">
1476014961         <feature name="pcb_type" value="SEGA-SRAM" />
14962         <feature name="slot" value="rom_sram" />
1476114963         <dataarea name="rom" size="2097152">
1476214964            <rom name="nfl '95 (prototype - sep 09, 1994).bin" size="2097152" crc="55df1066" sha1="2ba79a9a638894abbcd0702ba380b68ccaebb50f" offset="000000" loadflag="load16_word_swap" />
1476314965         </dataarea>
r20695r20696
1477214974      <publisher>Sega</publisher>
1477314975      <part name="cart" interface="megadriv_cart">
1477414976         <feature name="pcb_type" value="SEGA-SRAM" />
14977         <feature name="slot" value="rom_sram" />
1477514978         <dataarea name="rom" size="2097152">
1477614979            <rom name="nfl '95 (prototype - sep 11, 1994 - b).bin" size="2097152" crc="111ac6a0" sha1="2e3e044bd6061002444bdc4bbe5de1f8c8417ce6" offset="000000" loadflag="load16_word_swap" />
1477714980         </dataarea>
r20695r20696
1478614989      <publisher>Sega</publisher>
1478714990      <part name="cart" interface="megadriv_cart">
1478814991         <feature name="pcb_type" value="SEGA-SRAM" />
14992         <feature name="slot" value="rom_sram" />
1478914993         <dataarea name="rom" size="2097152">
1479014994            <rom name="nfl '95 (prototype - sep 11, 1994).bin" size="2097152" crc="21614c4f" sha1="91babf6f0d86e19e82c3f045d01e99ea9fe0253c" offset="000000" loadflag="load16_word_swap" />
1479114995         </dataarea>
r20695r20696
1480015004      <publisher>Sega</publisher>
1480115005      <part name="cart" interface="megadriv_cart">
1480215006         <feature name="pcb_type" value="SEGA-SRAM" />
15007         <feature name="slot" value="rom_sram" />
1480315008         <dataarea name="rom" size="2097152">
1480415009            <rom name="nfl 98 (usa).bin" size="2097152" crc="f73ec54c" sha1="27ea0133251e96c091b5a96024eb099cdca21e40" offset="000000" loadflag="load16_word_swap" />
1480515010         </dataarea>
r20695r20696
1482815033      <info name="alt_title" value="NFL プロフットボール'94"/>
1482915034      <part name="cart" interface="megadriv_cart">
1483015035         <feature name="pcb_type" value="SEGA-SRAM" />
15036         <feature name="slot" value="rom_sram" />
1483115037         <dataarea name="rom" size="2097152">
1483215038            <rom name="nfl football '94 (jpn).bin" size="2097152" crc="e490dc4a" sha1="a530a93d124ccecfbf54f0534b6d3269026e5988" offset="000000" loadflag="load16_word_swap" />
1483315039         </dataarea>
r20695r20696
1484515051      <info name="alt_title" value="NFLクォーターバッククラブ'95"/>
1484615052      <part name="cart" interface="megadriv_cart">
1484715053         <feature name="pcb_type" value="NBAJAMTE" />
15054         <feature name="slot" value="rom_nbajamte" />
1484815055         <dataarea name="rom" size="3145728">
1484915056            <rom name="nfl quarterback club (world).bin" size="3145728" crc="94542eaf" sha1="60744af955df83278f119df3478baeebd735a26c" offset="000000" loadflag="load16_word_swap" />
1485015057         </dataarea>
r20695r20696
1485715064      <publisher>Acclaim Entertainment</publisher>
1485815065      <part name="cart" interface="megadriv_cart">
1485915066         <feature name="pcb_type" value="NFLQB96" />
15067         <feature name="slot" value="rom_nflqb96" />
1486015068         <dataarea name="rom" size="4194304">
1486115069            <rom name="nfl quarterback club 96 (euro, usa).bin" size="4194304" crc="d5a37cab" sha1="2948419532a6079404f05348bc4bbf2dd989622d" offset="000000" loadflag="load16_word_swap" />
1486215070         </dataarea>
r20695r20696
1488315091      <info name="alt_title" value="NHK大河ドラマ 太平記"/>
1488415092      <part name="cart" interface="megadriv_cart">
1488515093         <feature name="pcb_type" value="SEGA-SRAM" />
15094         <feature name="slot" value="rom_sram" />
1488615095         <dataarea name="rom" size="1048576">
1488715096            <rom name="nhk taiga drama - taiheiki (jpn).bin" size="1048576" crc="09fbb30e" sha1="67358048fc9bc93d8835af852bc437124e015a61" offset="000000" loadflag="load16_word_swap" />
1488815097         </dataarea>
r20695r20696
1489715106      <publisher>Electronic Arts</publisher>
1489815107      <part name="cart" interface="megadriv_cart">
1489915108         <feature name="pcb_type" value="SEGA-SRAM" />
15109         <feature name="slot" value="rom_sram" />
1490015110         <dataarea name="rom" size="2097152">
1490115111            <rom name="nhl 95 (euro, usa).bin" size="2097152" crc="e8ee917e" sha1="09e87b076aa4cd6f057a1d65bb50fd889b509b44" offset="000000" loadflag="load16_word_swap" />
1490215112         </dataarea>
r20695r20696
1492215132      <publisher>Electronic Arts</publisher>
1492315133      <part name="cart" interface="megadriv_cart">
1492415134         <feature name="pcb_type" value="SEGA-SRAM" />
15135         <feature name="slot" value="rom_sram" />
1492515136         <dataarea name="rom" size="2097152">
1492615137            <rom name="nhl 97 (euro, usa).bin" size="2097152" crc="f067c103" sha1="8a90d7921ab8380c0abb0b5515a6b9f96ca6023c" offset="000000" loadflag="load16_word_swap" />
1492715138         </dataarea>
r20695r20696
1494715158      <publisher>Sega</publisher>
1494815159      <part name="cart" interface="megadriv_cart">
1494915160         <feature name="pcb_type" value="SEGA-SRAM" />
15161         <feature name="slot" value="rom_sram" />
1495015162         <dataarea name="rom" size="2097152">
1495115163            <rom name="nhl all-star hockey '95 (usa).bin" size="2097152" crc="e6c0218b" sha1="f2069295f99b5d50444668cfa9d4216d988d5f46" offset="000000" loadflag="load16_word_swap" />
1495215164         </dataarea>
r20695r20696
1496115173      <publisher>Sega</publisher>
1496215174      <part name="cart" interface="megadriv_cart">
1496315175         <feature name="pcb_type" value="SEGA-SRAM" />
15176         <feature name="slot" value="rom_sram" />
1496415177         <dataarea name="rom" size="2097146">
1496515178            <rom name="nhl all-star hockey '95 (prototype - dec 01, 1994 - b).bin" size="2097146" crc="c209d720" sha1="ff9e08e779ed07f0d055ba7ba34d602c5e6f892d" offset="000000" loadflag="load16_word_swap" />
1496615179         </dataarea>
r20695r20696
1497515188      <publisher>Sega</publisher>
1497615189      <part name="cart" interface="megadriv_cart">
1497715190         <feature name="pcb_type" value="SEGA-SRAM" />
15191         <feature name="slot" value="rom_sram" />
1497815192         <dataarea name="rom" size="2097146">
1497915193            <rom name="nhl all-star hockey '95 (prototype - dec 01, 1994).bin" size="2097146" crc="112e4cb3" sha1="212449ee98b48e3aa8e7bee5791e6359f10f06de" offset="000000" loadflag="load16_word_swap" />
1498015194         </dataarea>
r20695r20696
1498915203      <publisher>Sega</publisher>
1499015204      <part name="cart" interface="megadriv_cart">
1499115205         <feature name="pcb_type" value="SEGA-SRAM" />
15206         <feature name="slot" value="rom_sram" />
1499215207         <dataarea name="rom" size="2097146">
1499315208            <rom name="nhl all-star hockey '95 (prototype - dec 02, 1994).bin" size="2097146" crc="01d6a6c7" sha1="130f95bccd159234c117890b0412b415b43161a9" offset="000000" loadflag="load16_word_swap" />
1499415209         </dataarea>
r20695r20696
1505815273      <publisher>Sega</publisher>
1505915274      <part name="cart" interface="megadriv_cart">
1506015275         <feature name="pcb_type" value="SEGA-SRAM" />
15276         <feature name="slot" value="rom_sram" />
1506115277         <dataarea name="rom" size="2097146">
1506215278            <rom name="nhl all-star hockey '95 (prototype - nov 23, 1994).bin" size="2097146" crc="88d4fc38" sha1="4550baf4f39ff20aacb52aade9d03598c47ce1b2" offset="000000" loadflag="load16_word_swap" />
1506315279         </dataarea>
r20695r20696
1507215288      <publisher>Sega</publisher>
1507315289      <part name="cart" interface="megadriv_cart">
1507415290         <feature name="pcb_type" value="SEGA-SRAM" />
15291         <feature name="slot" value="rom_sram" />
1507515292         <dataarea name="rom" size="2097146">
1507615293            <rom name="nhl all-star hockey '95 (prototype - nov 27, 1994).bin" size="2097146" crc="658ffe52" sha1="c36c767bc1cfcc3301ca84fa37bc22bfb1e3678d" offset="000000" loadflag="load16_word_swap" />
1507715294         </dataarea>
r20695r20696
1508615303      <publisher>Sega</publisher>
1508715304      <part name="cart" interface="megadriv_cart">
1508815305         <feature name="pcb_type" value="SEGA-SRAM" />
15306         <feature name="slot" value="rom_sram" />
1508915307         <dataarea name="rom" size="2097146">
1509015308            <rom name="nhl all-star hockey '95 (prototype - nov 28, 1994).bin" size="2097146" crc="51ad0056" sha1="5e54fe1f0a3dee5a9cec0722ab9eb5f17b6862db" offset="000000" loadflag="load16_word_swap" />
1509115309         </dataarea>
r20695r20696
1510015318      <publisher>Sega</publisher>
1510115319      <part name="cart" interface="megadriv_cart">
1510215320         <feature name="pcb_type" value="SEGA-SRAM" />
15321         <feature name="slot" value="rom_sram" />
1510315322         <dataarea name="rom" size="2097146">
1510415323            <rom name="nhl all-star hockey '95 (prototype - nov 29, 1994).bin" size="2097146" crc="a060a60b" sha1="574bbf1b0890ca46fbee9e3f211060f15c02d037" offset="000000" loadflag="load16_word_swap" />
1510515324         </dataarea>
r20695r20696
1515815377      <publisher>Electronic Arts</publisher>
1515915378      <part name="cart" interface="megadriv_cart">
1516015379         <feature name="pcb_type" value="NHLPA" />
15380         <feature name="slot" value="rom_nhlpa" />
1516115381         <dataarea name="rom" size="524288">
1516215382            <rom name="h9306.bin" size="524288" crc="f361d0bf" sha1="2ab048fc7209df28b00ef47f2f686f5b7208466e" offset="000000" loadflag="load16_word_swap" />
1516315383         </dataarea>
r20695r20696
1517015390      <publisher>Electronic Arts</publisher>
1517115391      <part name="cart" interface="megadriv_cart">
1517215392         <feature name="pcb_type" value="NHLPA" />
15393         <feature name="slot" value="rom_nhlpa" />
1517315394         <dataarea name="rom" size="524288">
1517415395            <rom name="nhlpa hockey 93 (euro, usa).bin" size="524288" crc="cbbf4262" sha1="8efc1cacb079ea223966dda065c16c49e584cac2" offset="000000" loadflag="load16_word_swap" />
1517515396         </dataarea>
r20695r20696
1520415425      <publisher>Tec Toy</publisher>
1520515426      <part name="cart" interface="megadriv_cart">
1520615427         <feature name="pcb_type" value="SEGA-SRAM" />
15428         <feature name="slot" value="rom_sram" />
1520715429         <dataarea name="rom" size="2097152">
1520815430            <rom name="nightmare circus (bra).bin" size="2097152" crc="06da3217" sha1="3c80ff5ba54abe4702a3bb7d812571d3dc50c00f" offset="000000" loadflag="load16_word_swap" />
1520915431         </dataarea>
r20695r20696
1521815440      <publisher>Tec Toy</publisher>
1521915441      <part name="cart" interface="megadriv_cart">
1522015442         <feature name="pcb_type" value="SEGA-SRAM" />
15443         <feature name="slot" value="rom_sram" />
1522115444         <dataarea name="rom" size="2097152">
1522215445            <rom name="nightmare circus (bra) (alt).bin" size="2097152" crc="31de5a94" sha1="61b7d25e15011d379d07a8dad4f8c5bb5f75e29f" offset="000000" loadflag="load16_word_swap" />
1522315446         </dataarea>
r20695r20696
1524615469      <info name="alt_title" value="日刊スポーツ プロ野球VAN"/>
1524715470      <part name="cart" interface="megadriv_cart">
1524815471         <feature name="pcb_type" value="SEGA-SRAM" />
15472         <feature name="slot" value="rom_sram" />
1524915473         <dataarea name="rom" size="524288">
1525015474            <rom name="nikkan sports pro yakyuu van (jpn).bin" size="524288" crc="c3655a59" sha1="d29f7e70feae3b4f1b423026b7a124514ee48dcf" offset="000000" loadflag="load16_word_swap" />
1525115475         </dataarea>
r20695r20696
1529915523      <info name="alt_title" value="信長の野望 武将風雲録"/>
1530015524      <part name="cart" interface="megadriv_cart">
1530115525         <feature name="pcb_type" value="SEGA-SRAM" />
15526         <feature name="slot" value="rom_sram" />
1530215527         <dataarea name="rom" size="1048576">
1530315528            <rom name="mpr-14456.bin" size="1048576" crc="30bf8637" sha1="1ed50cae48405ec8ad9257df3d445521e60636d8" offset="000000" loadflag="load16_word_swap" />
1530415529         </dataarea>
r20695r20696
1531615541      <info name="alt_title" value="信長の野望 覇王伝"/>
1531715542      <part name="cart" interface="megadriv_cart">
1531815543         <feature name="pcb_type" value="SEGA-SRAM" />
15544         <feature name="slot" value="rom_sram" />
1531915545         <dataarea name="rom" size="2097152">
1532015546            <rom name="nobunaga no yabou - haouden (jpn).bin" size="2097152" crc="96c01fc6" sha1="9246a29b25e276dc1f7edfae87229549cf87d92e" offset="000000" loadflag="load16_word_swap" />
1532115547         </dataarea>
r20695r20696
1533015556      <publisher>Koei</publisher>
1533115557      <part name="cart" interface="megadriv_cart">
1533215558         <feature name="pcb_type" value="SEGA-SRAM" />
15559         <feature name="slot" value="rom_sram" />
1533315560         <dataarea name="rom" size="524288">
1533415561            <rom name="nobunaga's ambition (usa).bin" size="524288" crc="b9bc07bc" sha1="394c6b46a9e9b9177a135fd8fd43392eb1099666" offset="000000" loadflag="load16_word_swap" />
1533515562         </dataarea>
r20695r20696
1534715574      <info name="alt_title" value="信長の野望 全・国・版"/>
1534815575      <part name="cart" interface="megadriv_cart">
1534915576         <feature name="pcb_type" value="SEGA-SRAM" />
15577         <feature name="slot" value="rom_sram" />
1535015578         <dataarea name="rom" size="524288">
1535115579            <rom name="nobunaga no yabou - zenkoku ban (jpn).bin" size="524288" crc="1381b313" sha1="a1f64afbf3bcdc85b61bce96454105128ca6746a" offset="000000" loadflag="load16_word_swap" />
1535215580         </dataarea>
r20695r20696
1554315771      <publisher>Koei</publisher>
1554415772      <part name="cart" interface="megadriv_cart">
1554515773         <feature name="pcb_type" value="SEGA-SRAM" />
15774         <feature name="slot" value="rom_sram" />
1554615775         <dataarea name="rom" size="1048576">
1554715776            <rom name="operation europe - path to victory 1939-45 (usa).bin" size="1048576" crc="e7cba1d8" sha1="e2e484c6db2bb058d04288b4dfea0ed199108d24" offset="000000" loadflag="load16_word_swap" />
1554815777         </dataarea>
r20695r20696
1556015789      <info name="alt_title" value="ヨーロッパ戦線"/>
1556115790      <part name="cart" interface="megadriv_cart">
1556215791         <feature name="pcb_type" value="SEGA-SRAM" />
15792         <feature name="slot" value="rom_sram" />
1556315793         <dataarea name="rom" size="1048576">
1556415794            <rom name="europa sensen (jpn).bin" size="1048576" crc="b0416c60" sha1="d382f977ea3071f133a947ceb3528904e72f9bc9" offset="000000" loadflag="load16_word_swap" />
1556515795         </dataarea>
r20695r20696
1570415934      <publisher>&lt;unknown&gt;</publisher>
1570515935      <part name="cart" interface="megadriv_cart">
1570615936         <feature name="pcb_type" value="SEGA-SRAM" />
15937         <feature name="slot" value="rom_sram" />
1570715938         <dataarea name="rom" size="1048576">
1570815939            <rom name="junker's high (jpn) (beta) (bad dump).bin" size="1048576" crc="23534949" sha1="81a9b6d29878b4e9313a887b5349c12846b9d77f" offset="000000" status="baddump" loadflag="load16_word_swap" />
1570915940         </dataarea>
r20695r20696
1580116032      <publisher>Koei</publisher>
1580216033      <part name="cart" interface="megadriv_cart">
1580316034         <feature name="pcb_type" value="SEGA-SRAM" />
16035         <feature name="slot" value="rom_sram" />
1580416036         <dataarea name="rom" size="1048576">
1580516037            <rom name="pacific theater of operations (usa).bin" size="1048576" crc="d9d4c6e2" sha1="41d1d1956104133388b4ea69792fccca8013524a" offset="000000" loadflag="load16_word_swap" />
1580616038         </dataarea>
r20695r20696
1581816050      <info name="alt_title" value="提督の決断"/>
1581916051      <part name="cart" interface="megadriv_cart">
1582016052         <feature name="pcb_type" value="SEGA-SRAM" />
16053         <feature name="slot" value="rom_sram" />
1582116054         <dataarea name="rom" size="1048576">
1582216055            <rom name="teitoku no ketsudan (jpn).bin" size="1048576" crc="9b08e4e4" sha1="adc4c03636dbd8ca5449a8a66c6a7b7ef281893a" offset="000000" loadflag="load16_word_swap" />
1582316056         </dataarea>
r20695r20696
1594016173      <publisher>Sega</publisher>
1594116174      <part name="cart" interface="megadriv_cart">
1594216175         <feature name="pcb_type" value="SEGA-SRAM" />
16176         <feature name="slot" value="rom_sram" />
1594316177         <dataarea name="rom" size="2097152">
1594416178            <rom name="pebble beach golf links (euro).bin" size="2097152" crc="6cfc7297" sha1="53e8e8f11fb9950732409b770b7d9c8dabe85a19" offset="000000" loadflag="load16_word_swap" />
1594516179         </dataarea>
r20695r20696
1595416188      <publisher>Sega</publisher>
1595516189      <part name="cart" interface="megadriv_cart">
1595616190         <feature name="pcb_type" value="SEGA-SRAM" />
16191         <feature name="slot" value="rom_sram" />
1595716192         <dataarea name="rom" size="2097152">
1595816193            <rom name="pebble beach golf links (usa).bin" size="2097152" crc="95823c43" sha1="c9971710651056b8211b9bbd68eb5d1569e39e1f" offset="000000" loadflag="load16_word_swap" />
1595916194         </dataarea>
r20695r20696
1597116206      <info name="alt_title" value="ペブルビーチの波濤"/>
1597216207      <part name="cart" interface="megadriv_cart">
1597316208         <feature name="pcb_type" value="SEGA-SRAM" />
16209         <feature name="slot" value="rom_sram" />
1597416210         <dataarea name="rom" size="1572864">
1597516211            <rom name="new 3d golf simulation pebble beach no hatou (jpn).bin" size="1572864" crc="96ed2e5d" sha1="dee8430f4f15b4d04e1e3c0cc9d7d7f55ca1ad7b" offset="000000" loadflag="load16_word_swap" />
1597616212         </dataarea>
r20695r20696
1598616222      <info name="alt_title" value="Pelé II - World Tournament Soccer (USA Box)"/>
1598716223      <part name="cart" interface="megadriv_cart">
1598816224         <feature name="pcb_type" value="SEGA-SRAM" />
16225         <feature name="slot" value="rom_sram" />
1598916226         <dataarea name="rom" size="2097152">
1599016227            <rom name="pele ii - world tournament soccer (euro, usa).bin" size="2097152" crc="05a486e9" sha1="96498065545ed122aa29471d762a2ae1362b2dea" offset="000000" loadflag="load16_word_swap" />
1599116228         </dataarea>
r20695r20696
1600116238      <publisher>Accolade</publisher>
1600216239      <part name="cart" interface="megadriv_cart">
1600316240         <feature name="pcb_type" value="SEGA-SRAM" />
16241         <feature name="slot" value="rom_sram" />
1600416242         <dataarea name="rom" size="1048576">
1600516243            <rom name="pele! (euro, usa).bin" size="1048576" crc="5a8abe51" sha1="c0a91e2d10b98174faa647fb732c335d7438abf7" offset="000000" loadflag="load16_word_swap" />
1600616244         </dataarea>
r20695r20696
1605216290      <publisher>Electronic Arts</publisher>
1605316291      <part name="cart" interface="megadriv_cart">
1605416292         <feature name="pcb_type" value="SEGA-SRAM" />
16293         <feature name="slot" value="rom_sram" />
1605516294         <dataarea name="rom" size="1048576">
1605616295            <rom name="euro03.bin" size="1048576" crc="8ca45acd" sha1="640615be6891a8457d94bb81b0e8e1fa7c5119a8" offset="000000" loadflag="load16_word_swap" />
1605716296         </dataarea>
r20695r20696
1606616305      <publisher>Electronic Arts</publisher>
1606716306      <part name="cart" interface="megadriv_cart">
1606816307         <feature name="pcb_type" value="SEGA-SRAM" />
16308         <feature name="slot" value="rom_sram" />
1606916309         <dataarea name="rom" size="2097152">
1607016310            <rom name="pga9601.bin" size="2097152" crc="9698bbde" sha1="abc2a8d773724cd8fb1aeae483f5ca72f47e77fa" offset="000000" loadflag="load16_word_swap" />
1607116311         </dataarea>
r20695r20696
1610216342      <publisher>Electronic Arts</publisher>
1610316343      <part name="cart" interface="megadriv_cart">
1610416344         <feature name="pcb_type" value="SEGA-SRAM" />
16345         <feature name="slot" value="rom_sram" />
1610516346         <dataarea name="rom" size="1048576">
1610616347            <rom name="pga tour golf ii (euro, usa) (v1.1).bin" size="1048576" crc="e82b8606" sha1="12d5236a4ff23c5b1e4f452b3abd3d48e6e55314" offset="000000" loadflag="load16_word_swap" />
1610716348         </dataarea>
r20695r20696
1611916360      <info name="alt_title" value="PGAツアーゴルフII"/>
1612016361      <part name="cart" interface="megadriv_cart">
1612116362         <feature name="pcb_type" value="SEGA-SRAM" />
16363         <feature name="slot" value="rom_sram" />
1612216364         <dataarea name="rom" size="1048576">
1612316365            <rom name="pga tour golf ii (jpn).bin" size="1048576" crc="c05b7a4a" sha1="a5896f2f019530929194a6d80828d18b859b9174" offset="000000" loadflag="load16_word_swap" />
1612416366         </dataarea>
r20695r20696
1613316375      <publisher>Electronic Arts</publisher>
1613416376      <part name="cart" interface="megadriv_cart">
1613516377         <feature name="pcb_type" value="SEGA-SRAM" />
16378         <feature name="slot" value="rom_sram" />
1613616379         <dataarea name="rom" size="2097152">
1613716380            <rom name="pga tour golf iii (euro, usa).bin" size="2097152" crc="aeb3f65f" sha1="702707efcbfe229f6e190f2b6c71b6f53ae9ec36" offset="000000" loadflag="load16_word_swap" />
1613816381         </dataarea>
r20695r20696
1614716390      <publisher>Sega</publisher>
1614816391      <part name="cart" interface="megadriv_cart">
1614916392         <feature name="pcb_type" value="SEGA-SRAM" />
16393         <feature name="slot" value="rom_sram" />
1615016394         <dataarea name="rom" size="786432">
1615116395            <rom name="phantasy star ii (euro, usa).bin" size="786432" crc="0d07d0ef" sha1="fcd032ded2235171f51db316ad1b7688fbbdafe4" offset="000000" loadflag="load16_word_swap" />
1615216396         </dataarea>
r20695r20696
1616116405      <publisher>Tec Toy</publisher>
1616216406      <part name="cart" interface="megadriv_cart">
1616316407         <feature name="pcb_type" value="SEGA-SRAM" />
16408         <feature name="slot" value="rom_sram" />
1616416409         <dataarea name="rom" size="786432">
1616516410            <rom name="phantasy star ii (bra).bin" size="786432" crc="e6688b66" sha1="ab62fac112cb4dd1f19cb973bd7952b161f6d100" offset="000000" loadflag="load16_word_swap" />
1616616411         </dataarea>
r20695r20696
1617816423      <info name="alt_title" value="ファンタシースターII 還らざる時の終わりに"/>
1617916424      <part name="cart" interface="megadriv_cart">
1618016425         <feature name="pcb_type" value="SEGA-SRAM" />
16426         <feature name="slot" value="rom_sram" />
1618116427         <dataarea name="rom" size="786432">
1618216428            <rom name="mpr-12140+mpr-12181+mpr-12182.bin" size="786432" crc="bec8eb5a" sha1="fc186c681e110723b4be5590f242c73d5004c8a7" offset="000000" loadflag="load16_word_swap" />
1618316429         </dataarea>
r20695r20696
1628016526      <publisher>Sega</publisher>
1628116527      <part name="cart" interface="megadriv_cart">
1628216528         <feature name="pcb_type" value="SEGA-SRAM" />
16529         <feature name="slot" value="rom_sram" />
1628316530         <dataarea name="rom" size="786432">
1628416531            <rom name="phantasy star iii - generations of doom (euro, usa, kor).bin" size="786432" crc="c6b42b0f" sha1="59d4914e652672fd1e453c76b8250d17e8ca154e" offset="000000" loadflag="load16_word_swap" />
1628516532         </dataarea>
r20695r20696
1629416541      <publisher>Tec Toy</publisher>
1629516542      <part name="cart" interface="megadriv_cart">
1629616543         <feature name="pcb_type" value="SEGA-SRAM" />
16544         <feature name="slot" value="rom_sram" />
1629716545         <dataarea name="rom" size="786432">
1629816546            <rom name="phantasy star iii - generations of doom (bra).bin" size="786432" crc="2e9b4c23" sha1="59ccfc6b85b95666d0e2c85e3e08c847c4a7ad34" offset="000000" loadflag="load16_word_swap" />
1629916547         </dataarea>
r20695r20696
1631116559      <info name="alt_title" value="ファンタシースターIII 時の継承者"/>
1631216560      <part name="cart" interface="megadriv_cart">
1631316561         <feature name="pcb_type" value="SEGA-SRAM" />
16562         <feature name="slot" value="rom_sram" />
1631416563         <dataarea name="rom" size="786432">
1631516564            <rom name="phantasy star iii - toki no keishousha (jpn).bin" size="786432" crc="6c48c06f" sha1="68b0f8e73dea5dca1b6ac8c0e12bc1d9761edf32" offset="000000" loadflag="load16_word_swap" />
1631616565         </dataarea>
r20695r20696
1632616575      <info name="alt_title" value="Phantasy Star IV (Box)"/>
1632716576      <part name="cart" interface="megadriv_cart">
1632816577         <feature name="pcb_type" value="SEGA-SRAM" />
16578         <feature name="slot" value="rom_sram" />
1632916579         <dataarea name="rom" size="3145728">
1633016580            <rom name="phantasy star iv (usa).bin" size="3145728" crc="fe236442" sha1="bc7ff6d6a8408f38562bc610f24645cad6c42629" offset="000000" loadflag="load16_word_swap" />
1633116581         </dataarea>
r20695r20696
1634216592      <info name="alt_title" value="Phantasy Star IV (Box)"/>
1634316593      <part name="cart" interface="megadriv_cart">
1634416594         <feature name="pcb_type" value="SEGA-SRAM" />
16595         <feature name="slot" value="rom_sram" />
1634516596         <dataarea name="rom" size="3145728">
1634616597            <rom name="phantasy star iv (euro).bin" size="3145728" crc="389c2968" sha1="f055fc02142334ea798c696ec8d4c262ca28d847" offset="000000" loadflag="load16_word_swap" />
1634716598         </dataarea>
r20695r20696
1635916610      <info name="alt_title" value="ァンタシースター ~千年紀の終りに~"/>
1636016611      <part name="cart" interface="megadriv_cart">
1636116612         <feature name="pcb_type" value="SEGA-SRAM" />
16613         <feature name="slot" value="rom_sram" />
1636216614         <dataarea name="rom" size="3145728">
1636316615            <rom name="phantasy star - sennenki no owari ni (jpn).bin" size="3145728" crc="f0bfad42" sha1="9d330d5e395b7caae11fae92f71d259b8391904b" offset="000000" loadflag="load16_word_swap" />
1636416616         </dataarea>
r20695r20696
1637316625      <publisher>Sega</publisher>
1637416626      <part name="cart" interface="megadriv_cart">
1637516627         <feature name="pcb_type" value="SEGA-SRAM" />
16628         <feature name="slot" value="rom_sram" />
1637616629         <dataarea name="rom" size="3145728">
1637716630            <rom name="phantasy star iv (prototype - aug 15, 1994).bin" size="3145728" crc="60137f25" sha1="81fe74c288bcf97b70758442c520ec47308cfcee" offset="000000" loadflag="load16_word_swap" />
1637816631         </dataarea>
r20695r20696
1638716640      <publisher>Sega</publisher>
1638816641      <part name="cart" interface="megadriv_cart">
1638916642         <feature name="pcb_type" value="SEGA-SRAM" />
16643         <feature name="slot" value="rom_sram" />
1639016644         <dataarea name="rom" size="3145728">
1639116645            <rom name="phantasy star iv (prototype - jun 08, 1994).bin" size="3145728" crc="dc2e1c0a" sha1="d72b9d68cfb54b4221f3a2416eac30a94accd427" offset="000000" loadflag="load16_word_swap" />
1639216646         </dataarea>
r20695r20696
1640116655      <publisher>Sega</publisher>
1640216656      <part name="cart" interface="megadriv_cart">
1640316657         <feature name="pcb_type" value="SEGA-SRAM" />
16658         <feature name="slot" value="rom_sram" />
1640416659         <dataarea name="rom" size="3145728">
1640516660            <rom name="phantasy star iv (prototype - may 30, 1994).bin" size="3145728" crc="b32b17e1" sha1="803877f317eeaaec57af07451a5ccf9309db513c" offset="000000" loadflag="load16_word_swap" />
1640616661         </dataarea>
r20695r20696
1641516670      <publisher>Sega</publisher>
1641616671      <part name="cart" interface="megadriv_cart">
1641716672         <feature name="pcb_type" value="SEGA-SRAM" />
16673         <feature name="slot" value="rom_sram" />
1641816674         <dataarea name="rom" size="3145728">
1641916675            <rom name="phantasy star iv (prototype - nov 07, 1994).bin" size="3145728" crc="bda29cdf" sha1="e0c3de9991a03fd48dc85caae6415aaac016ab4a" offset="000000" loadflag="load16_word_swap" />
1642016676         </dataarea>
r20695r20696
1642916685      <publisher>Sega</publisher>
1643016686      <part name="cart" interface="megadriv_cart">
1643116687         <feature name="pcb_type" value="SEGA-SRAM" />
16688         <feature name="slot" value="rom_sram" />
1643216689         <dataarea name="rom" size="3145728">
1643316690            <rom name="phantasy star iv (prototype - oct 27, 1994).bin" size="3145728" crc="12a2590a" sha1="6720d3afcd28cad06ac15749843d2a6995f403dc" offset="000000" loadflag="load16_word_swap" />
1643416691         </dataarea>
r20695r20696
1655616813      <publisher>Microprose</publisher>
1655716814      <part name="cart" interface="megadriv_cart">
1655816815         <feature name="pcb_type" value="SEGA-SRAM" />
16816         <feature name="slot" value="rom_sram" />
1655916817         <dataarea name="rom" size="1048576">
1656016818            <rom name="pirates! gold (usa).bin" size="1048576" crc="ed50e75c" sha1="ea597dbefc8f804524606af3c1c4fe6ba55e86e9" offset="000000" loadflag="load16_word_swap" />
1656116819         </dataarea>
r20695r20696
1665316911      <publisher>&lt;unlicensed&gt;</publisher>
1665416912      <part name="cart" interface="megadriv_cart">
1665516913         <feature name="pcb_type" value="POKEMON" />
16914         <feature name="slot" value="rom_poke" />
1665616915         <dataarea name="rom" size="2097152">
1665716916            <rom name="pocket monsters (unl).bin" size="2097152" crc="f68f6367" sha1="d10de935e099c520384c986b1f00fd5e72d64e03" offset="000000" loadflag="load16_word_swap" />
1665816917         </dataarea>
r20695r20696
1667616935      <publisher>&lt;unlicensed&gt;</publisher>
1667716936      <part name="cart" interface="megadriv_cart">
1667816937         <feature name="pcb_type" value="POKEMON2" />
16938         <feature name="slot" value="rom_poke2" />
1667916939         <dataarea name="rom" size="2097152">
1668016940            <rom name="pocket monsters 2 (unl).bin" size="2097152" crc="30f7031f" sha1="dae100dfaee1b5b7816731cb2f43bcda3da273b7" offset="000000" loadflag="load16_word_swap" />
1668116941         </dataarea>
r20695r20696
1676017020      <info name="alt_title" value="パワーモンガー"/>
1676117021      <part name="cart" interface="megadriv_cart">
1676217022         <feature name="pcb_type" value="SEGA-SRAM" />
17023         <feature name="slot" value="rom_sram" />
1676317024         <dataarea name="rom" size="1048576">
1676417025            <rom name="power monger (jpn, kor).bin" size="1048576" crc="553289b3" sha1="f0a48f25d87f7a6d17ff76f5e29ea7be2d430ce4" offset="000000" loadflag="load16_word_swap" />
1676517026         </dataarea>
r20695r20696
1681017071      <publisher>Sega</publisher>
1681117072      <part name="cart" interface="megadriv_cart">
1681217073         <feature name="pcb_type" value="SEGA-SRAM" />
17074         <feature name="slot" value="rom_sram" />
1681317075         <dataarea name="rom" size="1048576">
1681417076            <rom name="mpr-18473.bin" size="1048576" crc="303b889f" sha1="2916e5ef628e077cde87be873e0ea2507ef5c844" offset="000000" loadflag="load16_word_swap" />
1681517077         </dataarea>
r20695r20696
1682417086      <publisher>Sega</publisher>
1682517087      <part name="cart" interface="megadriv_cart">
1682617088         <feature name="pcb_type" value="SEGA-SRAM" />
17089         <feature name="slot" value="rom_sram" />
1682717090         <dataarea name="rom" size="1048576">
1682817091            <rom name="premier manager 97 (euro).bin" size="1048576" crc="fccbf69b" sha1="e2df3b48170e1a7bde46af2adbf939803e267e13" offset="000000" loadflag="load16_word_swap" />
1682917092         </dataarea>
r20695r20696
1684917112      <publisher>Sega</publisher>
1685017113      <part name="cart" interface="megadriv_cart">
1685117114         <feature name="pcb_type" value="SEGA-SRAM" />
17115         <feature name="slot" value="rom_sram" />
1685217116         <dataarea name="rom" size="2097152">
1685317117            <rom name="prime time nfl starring deion sanders (usa).bin" size="2097152" crc="5aa53cbc" sha1="7d7a5a920ac30831556b58caac66f4a8dde1632a" offset="000000" loadflag="load16_word_swap" />
1685417118         </dataarea>
r20695r20696
1749317757      <info name="alt_title" value="乱世の覇者"/>
1749417758      <part name="cart" interface="megadriv_cart">
1749517759         <feature name="pcb_type" value="SEGA-SRAM" />
17760         <feature name="slot" value="rom_sram" />
1749617761         <dataarea name="rom" size="1048576">
1749717762            <rom name="ransei no hasha (jpn).bin" size="1048576" crc="a9a0083d" sha1="7c431e26226b99d09d61c4dc64131b2d81ae870e" offset="000000" loadflag="load16_word_swap" />
1749817763         </dataarea>
r20695r20696
1758117846      <info name="alt_title" value="レンタヒーロー"/>
1758217847      <part name="cart" interface="megadriv_cart">
1758317848         <feature name="pcb_type" value="SEGA-SRAM" />
17849         <feature name="slot" value="rom_sram" />
1758417850         <dataarea name="rom" size="1048576">
1758517851            <rom name="mpr-14187.bin" size="1048576" crc="2e515f82" sha1="a07e4d56c9842e1177df9016fb9478060dc4c1c6" offset="000000" loadflag="load16_word_swap" />
1758617852         </dataarea>
r20695r20696
1776318029      <publisher>Electronic Arts</publisher>
1776418030      <part name="cart" interface="megadriv_cart">
1776518031         <feature name="pcb_type" value="NHLPA" />
18032         <feature name="slot" value="rom_nhlpa" />
1776618033         <dataarea name="rom" size="1048576">
1776718034            <rom name="rin09.bin" size="1048576" crc="41fcc497" sha1="84851ce4527761b8d74ce581c19e15d0dd17f368" offset="000000" loadflag="load16_word_swap" />
1776818035         </dataarea>
r20695r20696
1822118488      <publisher>Koei</publisher>
1822218489      <part name="cart" interface="megadriv_cart">
1822318490         <feature name="pcb_type" value="SEGA-SRAM" />
18491         <feature name="slot" value="rom_sram" />
1822418492         <dataarea name="rom" size="1048576">
1822518493            <rom name="romance of the three kingdoms ii (usa).bin" size="1048576" crc="3d842478" sha1="89fc2203b0369565124184690a5a5037ac9c54d7" offset="000000" loadflag="load16_word_swap" />
1822618494         </dataarea>
r20695r20696
1823818506      <info name="alt_title" value="三国志II"/>
1823918507      <part name="cart" interface="megadriv_cart">
1824018508         <feature name="pcb_type" value="SEGA-SRAM" />
18509         <feature name="slot" value="rom_sram" />
1824118510         <dataarea name="rom" size="1048576">
1824218511            <rom name="mpr-14455.bin" size="1048576" crc="437ba326" sha1="d9a912caacaa476a890564f62b6ce9cc8f60496e" offset="000000" loadflag="load16_word_swap" />
1824318512         </dataarea>
r20695r20696
1825218521      <publisher>Koei</publisher>
1825318522      <part name="cart" interface="megadriv_cart">
1825418523         <feature name="pcb_type" value="SEGA-SRAM" />
18524         <feature name="slot" value="rom_sram" />
1825518525         <dataarea name="rom" size="1310720">
1825618526            <rom name="romance of the three kingdoms iii - dragon of destiny (usa).bin" size="1310720" crc="7e41c8fe" sha1="a47b0ac13ef8229fbfc89216c8ecb66d72f6f73a" offset="000000" loadflag="load16_word_swap" />
1825718527         </dataarea>
r20695r20696
1826918539      <info name="alt_title" value="三国志III"/>
1827018540      <part name="cart" interface="megadriv_cart">
1827118541         <feature name="pcb_type" value="SEGA-SRAM" />
18542         <feature name="slot" value="rom_sram" />
1827218543         <dataarea name="rom" size="1572864">
1827318544            <rom name="sangokushi iii (jpn).bin" size="1572864" crc="a8de6aea" sha1="c85d03a6bcfeccc66ea3fa3cbda006c83576815f" offset="000000" loadflag="load16_word_swap" />
1827418545         </dataarea>
r20695r20696
1840518676      <publisher>&lt;unknown&gt;</publisher>
1840618677      <part name="cart" interface="megadriv_cart">
1840718678         <feature name="pcb_type" value="SEGA-SRAM" />
18679         <feature name="slot" value="rom_sram" />
1840818680         <dataarea name="rom" size="1048576">
1840918681            <rom name="san guo zhi lie zhuan - luan shi qun ying (chi).bin" size="1048576" crc="3b5cc398" sha1="7aaa0cc1dafaa14e6d62d6c1dbd462e69617bf7e" offset="000000" loadflag="load16_word_swap" />
1841018682         </dataarea>
r20695r20696
1844718719      <info name="alt_title" value="三国志列伝 乱世の英雄たち"/>
1844818720      <part name="cart" interface="megadriv_cart">
1844918721         <feature name="pcb_type" value="SEGA-SRAM" />
18722         <feature name="slot" value="rom_sram" />
1845018723         <dataarea name="rom" size="1048576">
1845118724            <rom name="sangokushi retsuden - ransei no eiyuutachi (jpn).bin" size="1048576" crc="0f56785a" sha1="9b79f91060e68b9f6f48c8a5f38bc9873d03c4a9" offset="000000" loadflag="load16_word_swap" />
1845218725         </dataarea>
r20695r20696
1856018833      <publisher>Renegade</publisher>
1856118834      <part name="cart" interface="megadriv_cart">
1856218835         <feature name="pcb_type" value="SEGA-SRAM" />
18836         <feature name="slot" value="rom_sram" />
1856318837         <dataarea name="rom" size="524288">
1856418838            <rom name="mpr-16014.bin" size="524288" crc="f9b396b8" sha1="2ee1ad4aac354b6d227b16976f0875f4625ff604" offset="000000" loadflag="load16_word_swap" />
1856518839         </dataarea>
r20695r20696
1857418848      <publisher>Renegade</publisher>
1857518849      <part name="cart" interface="megadriv_cart">
1857618850         <feature name="pcb_type" value="SEGA-SRAM" />
18851         <feature name="slot" value="rom_sram" />
1857718852         <dataarea name="rom" size="524288">
1857818853            <rom name="sensible soccer (beta).bin" size="524288" crc="ef52664d" sha1="c12a644cf81886050a4ae108b17b3c742055f5c3" offset="000000" loadflag="load16_word_swap" />
1857918854         </dataarea>
r20695r20696
1858918864      <info name="alt_title" value="International Sensible Soccer - Limited Edition: World Champions (Box)"/>
1859018865      <part name="cart" interface="megadriv_cart">
1859118866         <feature name="pcb_type" value="SEGA-SRAM" />
18867         <feature name="slot" value="rom_sram" />
1859218868         <dataarea name="rom" size="524288">
1859318869            <rom name="sensible soccer - international edition (euro).bin" size="524288" crc="04e3bcca" sha1="b88833ba92e084d4433e2b22eeb67e71ed36cd5c" offset="000000" loadflag="load16_word_swap" />
1859418870         </dataarea>
r20695r20696
1868918965      <publisher>Sega</publisher>
1869018966      <part name="cart" interface="megadriv_cart">
1869118967         <feature name="pcb_type" value="SEGA-SRAM" />
18968         <feature name="slot" value="rom_sram" />
1869218969         <dataarea name="rom" size="2097152">
1869318970            <rom name="shadowrun (usa).bin" size="2097152" crc="fbb92909" sha1="a06a281d39e845bff446a541b2ff48e1d93143c2" offset="000000" loadflag="load16_word_swap" />
1869418971         </dataarea>
r20695r20696
1870318980      <publisher>&lt;unknown&gt;</publisher>
1870418981      <part name="cart" interface="megadriv_cart">
1870518982         <feature name="pcb_type" value="SEGA-SRAM" />
18983         <feature name="slot" value="rom_sram" />
1870618984         <dataarea name="rom" size="2097152">
1870718985            <rom name="shadowrun (jpn).bin" size="2097152" crc="d32199f7" sha1="e28bb51227abcc71aaf18d445d3651054247c662" offset="000000" loadflag="load16_word_swap" />
1870818986         </dataarea>
r20695r20696
1871718995      <publisher>Sega</publisher>
1871818996      <part name="cart" interface="megadriv_cart">
1871918997         <feature name="pcb_type" value="SEGA-SRAM" />
18998         <feature name="slot" value="rom_sram" />
1872018999         <dataarea name="rom" size="2097152">
1872119000            <rom name="shadowrun (prototype - dec 28, 1993).bin" size="2097152" crc="2455add2" sha1="2d52cb444802ae6fda8d50b1af5fab10826bc00d" offset="000000" loadflag="load16_word_swap" />
1872219001         </dataarea>
r20695r20696
1873119010      <publisher>Sega</publisher>
1873219011      <part name="cart" interface="megadriv_cart">
1873319012         <feature name="pcb_type" value="SEGA-SRAM" />
19013         <feature name="slot" value="rom_sram" />
1873419014         <dataarea name="rom" size="2097152">
1873519015            <rom name="shadowrun (prototype - dec 31, 1993).bin" size="2097152" crc="bbb5e2fa" sha1="4bb4f490ff22c380df471b63faeb8835f9cf5cb6" offset="000000" loadflag="load16_word_swap" />
1873619016         </dataarea>
r20695r20696
1874519025      <publisher>Sega</publisher>
1874619026      <part name="cart" interface="megadriv_cart">
1874719027         <feature name="pcb_type" value="SEGA-SRAM" />
19028         <feature name="slot" value="rom_sram" />
1874819029         <dataarea name="rom" size="2097152">
1874919030            <rom name="shadowrun (prototype - jan 25, 1994 - c).bin" size="2097152" crc="6e2bbca8" sha1="37b0aecf9d72fa662cadec9c2eba9bbe6fea35d2" offset="000000" loadflag="load16_word_swap" />
1875019031         </dataarea>
r20695r20696
1875919040      <publisher>Sega</publisher>
1876019041      <part name="cart" interface="megadriv_cart">
1876119042         <feature name="pcb_type" value="SEGA-SRAM" />
19043         <feature name="slot" value="rom_sram" />
1876219044         <dataarea name="rom" size="2097152">
1876319045            <rom name="shadowrun (prototype - jan 25, 1994).bin" size="2097152" crc="2a964bcd" sha1="01591ae041031a4820caeb0bfcb1772e8b633352" offset="000000" loadflag="load16_word_swap" />
1876419046         </dataarea>
r20695r20696
1885319135      <publisher>Sega</publisher>
1885419136      <part name="cart" interface="megadriv_cart">
1885519137         <feature name="pcb_type" value="SEGA-SRAM" />
19138         <feature name="slot" value="rom_sram" />
1885619139         <dataarea name="rom" size="1572864">
1885719140            <rom name="shining force (usa).bin" size="1572864" crc="e0594abe" sha1="7cbb3ed31c982750d70a273b9561a9e1b2c04eea" offset="000000" loadflag="load16_word_swap" />
1885819141         </dataarea>
r20695r20696
1886719150      <publisher>Sega</publisher>
1886819151      <part name="cart" interface="megadriv_cart">
1886919152         <feature name="pcb_type" value="SEGA-SRAM" />
19153         <feature name="slot" value="rom_sram" />
1887019154         <dataarea name="rom" size="1572864">
1887119155            <rom name="shining force (usa) (beta).bin" size="1572864" crc="ce67143a" sha1="f026c9243431c9c2d4b0660e340158816a22b869" offset="000000" loadflag="load16_word_swap" />
1887219156         </dataarea>
r20695r20696
1888419168      <info name="alt_title" value="シャイニング・フォース ~神々の遺産~"/>
1888519169      <part name="cart" interface="megadriv_cart">
1888619170         <feature name="pcb_type" value="SEGA-SRAM" />
19171         <feature name="slot" value="rom_sram" />
1888719172         <dataarea name="rom" size="1572864">
1888819173            <rom name="shining force - kamigami no isan (jpn).bin" size="1572864" crc="9378fbcd" sha1="ef8afbdc9af931d9da34d72efc8a76f0d5f4379d" offset="000000" loadflag="load16_word_swap" />
1888919174         </dataarea>
r20695r20696
1890119186      <info name="alt_title" value="シャイニング・フォースII 「古えの封印」"/>
1890219187      <part name="cart" interface="megadriv_cart">
1890319188         <feature name="pcb_type" value="SEGA-SRAM" />
19189         <feature name="slot" value="rom_sram" />
1890419190         <dataarea name="rom" size="2097152">
1890519191            <rom name="shining force ii - koe no fuuin (jpn).bin" size="2097152" crc="0288f3e1" sha1="8e1f1a510af4d43716d9ee34d47becf907dec147" offset="000000" loadflag="load16_word_swap" />
1890619192         </dataarea>
r20695r20696
1891519201      <publisher>Sega</publisher>
1891619202      <part name="cart" interface="megadriv_cart">
1891719203         <feature name="pcb_type" value="SEGA-SRAM" />
19204         <feature name="slot" value="rom_sram" />
1891819205         <dataarea name="rom" size="2097152">
1891919206            <rom name="shining force ii (prototype - apr 04, 1994).bin" size="2097152" crc="5843670c" sha1="cd98c45ec170ce72fabe2237cc55dc4f0b6aa884" offset="000000" loadflag="load16_word_swap" />
1892019207         </dataarea>
r20695r20696
1892919216      <publisher>Sega</publisher>
1893019217      <part name="cart" interface="megadriv_cart">
1893119218         <feature name="pcb_type" value="SEGA-SRAM" />
19219         <feature name="slot" value="rom_sram" />
1893219220         <dataarea name="rom" size="2097152">
1893319221            <rom name="shining force ii (prototype - jun 07, 1994).bin" size="2097152" crc="03b68bba" sha1="caeb48ed31991614c21121bf7d7a899aea946a81" offset="000000" loadflag="load16_word_swap" />
1893419222         </dataarea>
r20695r20696
1894319231      <publisher>Sega</publisher>
1894419232      <part name="cart" interface="megadriv_cart">
1894519233         <feature name="pcb_type" value="SEGA-SRAM" />
19234         <feature name="slot" value="rom_sram" />
1894619235         <dataarea name="rom" size="2097152">
1894719236            <rom name="shining force ii (usa).bin" size="2097152" crc="4815e075" sha1="22defc2e8e6c1dbb20421b906796538725b3d893" offset="000000" loadflag="load16_word_swap" />
1894819237         </dataarea>
r20695r20696
1895719246      <publisher>Sega</publisher>
1895819247      <part name="cart" interface="megadriv_cart">
1895919248         <feature name="pcb_type" value="SEGA-SRAM" />
19249         <feature name="slot" value="rom_sram" />
1896019250         <dataarea name="rom" size="1048576">
1896119251            <rom name="shining in the darkness (euro, usa).bin" size="1048576" crc="4d2785bc" sha1="4e10c90199d6edd2030a4ba1c42c7c166bf309ec" offset="000000" loadflag="load16_word_swap" />
1896219252         </dataarea>
r20695r20696
1897119261      <publisher>Tec Toy</publisher>
1897219262      <part name="cart" interface="megadriv_cart">
1897319263         <feature name="pcb_type" value="SEGA-SRAM" />
19264         <feature name="slot" value="rom_sram" />
1897419265         <dataarea name="rom" size="1048576">
1897519266            <rom name="shining in the darkness (bra).bin" size="1048576" crc="3ee2bbc4" sha1="08c6e884d48329c45d9f090aeea03efd4c1918c0" offset="000000" loadflag="load16_word_swap" />
1897619267         </dataarea>
r20695r20696
1898819279      <info name="alt_title" value="シャイニング&amp;ザ・ダクネス"/>
1898919280      <part name="cart" interface="megadriv_cart">
1899019281         <feature name="pcb_type" value="SEGA-SRAM" />
19282         <feature name="slot" value="rom_sram" />
1899119283         <dataarea name="rom" size="1048576">
1899219284            <rom name="mpr-13807.bin" size="1048576" crc="496af51c" sha1="c09ff5bcee1a29a48c65be4ad584708b85ca549b" offset="000000" loadflag="load16_word_swap" />
1899319285         </dataarea>
r20695r20696
1938619678      <publisher>Sega</publisher>
1938719679      <part name="cart" interface="megadriv_cart">
1938819680         <feature name="pcb_type" value="SEGA-SRAM" />
19681         <feature name="slot" value="rom_sram" />
1938919682         <dataarea name="rom" size="2097152">
1939019683            <rom name="mpr-17499.bin" size="2097152" crc="a30ebdb1" sha1="110a61671b83fe17fba768ab85b535ca1cc6d7ea" offset="000000" loadflag="load16_word_swap" />
1939119684         </dataarea>
r20695r20696
1940019693      <publisher>Atlus</publisher>
1940119694      <part name="cart" interface="megadriv_cart">
1940219695         <feature name="pcb_type" value="SEGA-SRAM" />
19696         <feature name="slot" value="rom_sram" />
1940319697         <dataarea name="rom" size="2097152">
1940419698            <rom name="crusader of centy (usa).bin" size="2097152" crc="41858f6f" sha1="bf2e8d122f4670865bedbc305ef991ee5f52d647" offset="000000" loadflag="load16_word_swap" />
1940519699         </dataarea>
r20695r20696
1941719711      <info name="alt_title" value="新創世紀ラグナセンティ"/>
1941819712      <part name="cart" interface="megadriv_cart">
1941919713         <feature name="pcb_type" value="SEGA-SRAM" />
19714         <feature name="slot" value="rom_sram" />
1942019715         <dataarea name="rom" size="2097152">
1942119716            <rom name="shin souseiki ragnacenty (jpn).bin" size="2097152" crc="6a3f5ae2" sha1="e0df9f3cb64beb3ea921653eccdd45aca6abc0aa" offset="000000" loadflag="load16_word_swap" />
1942219717         </dataarea>
r20695r20696
1944319738      <publisher>Sega</publisher>
1944419739      <part name="cart" interface="megadriv_cart">
1944519740         <feature name="pcb_type" value="SEGA-SRAM" />
19741         <feature name="slot" value="rom_sram" />
1944619742         <dataarea name="rom" size="2097152">
1944719743            <rom name="ragnacenty (kor).bin" size="2097152" crc="77b5b10b" sha1="40265aae1b43f004434194038d32ca6b4841707d" offset="000000" loadflag="load16_word_swap" />
1944819744         </dataarea>
r20695r20696
1945919755      <info name="release" value="19941018 (JPN)"/>
1946019756      <info name="alt_title" value="ソニック&amp;ナックルズ"/>
1946119757      <part name="cart" interface="megadriv_cart">
19462         <dataarea name="rom" size="2097152">
19758         <feature name="slot" value="rom_sk" />
19759         <dataarea name="rom" size="3407872">
1946319760            <rom name="mpr-16910-u.ic1" size="2097152" crc="0658f691" sha1="88d6499d874dcb5721ff58d76fe1b9af811192e3" offset="000000" loadflag="load16_word_swap" />
19761            <rom name="mpr-16911-s.ic2" size="262144" crc="4dcfd55c" sha1="70429f1d80503a0632f603bf762fe0bbaa881d22" offset="0x300000" loadflag="load16_word_swap" />
1946419762         </dataarea>
1946519763      </part>
1946619764   </software>
r20695r20696
1958719885      </part>
1958819886   </software>
1958919887
19590   <software name="sks1">
19591      <description>Sonic &amp; Knuckles + Sonic the Hedgehog (World)</description>
19592      <year>199?</year>
19593      <publisher>&lt;unknown&gt;</publisher>
19594      <part name="cart" interface="megadriv_cart">
19595         <dataarea name="rom" size="2621440">
19596            <!-- rom name="sonic &amp; knuckles + sonic the hedgehog (world).bin" size="2621440" crc="e01f6ed5" sha1="a3084262f5af481df1a5c5ab03c4862551a53c91" offset="000000" loadflag="load16_word_swap" /-->
19597            <rom name="mpr-16910-u.ic1" size="2097152" crc="0658f691" sha1="88d6499d874dcb5721ff58d76fe1b9af811192e3" offset="000000" loadflag="load16_word_swap" />
19598            <rom name="mpr-13913.ic1" size="524288" crc="f9394e97" sha1="6ddb7de1e17e7f6cdb88927bd906352030daa194" offset="0x200000" loadflag="load16_word_swap" />
19599         </dataarea>
19600      </part>
19601   </software>
19602
19603   <software name="sks2">
19604      <description>Sonic &amp; Knuckles + Sonic the Hedgehog 2 (World)</description>
19605      <year>199?</year>
19606      <publisher>&lt;unknown&gt;</publisher>
19607      <part name="cart" interface="megadriv_cart">
19608         <dataarea name="rom" size="3407872">
19609            <!-- rom name="sonic &amp; knuckles + sonic the hedgehog 2 (world).bin" size="3407872" crc="2ac1e7c6" sha1="6cd0537a3aee0e012bb86d5837ddff9342595004" offset="000000" loadflag="load16_word_swap" /-->
19610            <rom name="mpr-16910-u.ic1" size="2097152" crc="0658f691" sha1="88d6499d874dcb5721ff58d76fe1b9af811192e3" offset="000000" loadflag="load16_word_swap" />
19611            <rom name="mpr-16911-s.ic2" size="262144" crc="4dcfd55c" sha1="70429f1d80503a0632f603bf762fe0bbaa881d22" offset="0x300000" loadflag="load16_word_swap" />
19612            <rom name="mpr-15000a.bin" size="1048576" crc="7b905383" sha1="8bca5dcef1af3e00098666fd892dc1c2a76333f9" offset="0x200000" loadflag="load16_word_swap" />
19613         </dataarea>
19614      </part>
19615   </software>
19616
1961719888   <software name="knucklp" cloneof="sks2">
1961819889      <description>Knuckles in Sonic 2 (Prototype 0524, 19940527, 10.46)</description>
1961919890      <year>199?</year>
r20695r20696
1962519896      </part>
1962619897   </software>
1962719898
19628   <software name="sks3">
19629      <description>Sonic &amp; Knuckles + Sonic the Hedgehog 3 (World)</description>
19630      <year>199?</year>
19631      <publisher>&lt;unknown&gt;</publisher>
19632      <part name="cart" interface="megadriv_cart">
19633         <dataarea name="rom" size="4194304">
19634            <!-- rom name="sonic &amp; knuckles + sonic the hedgehog 3 (world).bin" size="4194304" crc="63522553" sha1="cfbf98c36c776677290a872547ac47c53d2761d6" offset="000000" loadflag="load16_word_swap" /-->
19635            <rom name="mpr-16910-u.ic1" size="2097152" crc="0658f691" sha1="88d6499d874dcb5721ff58d76fe1b9af811192e3" offset="000000" loadflag="load16_word_swap" />
19636            <rom name="sonic the hedgehog 3 (usa).bin" size="2097152" crc="9bc192ce" sha1="75e9c4705259d84112b3e697a6c00a0813d47d71" offset="0x200000" loadflag="load16_word_swap" />
19637         </dataarea>
19638      </part>
19639   </software>
19640
1964119899   <software name="skp12" cloneof="sk">
1964219900      <description>Sonic &amp; Knuckles (Prototype 0525, 19940525, 15.28)</description>
1964319901      <year>1994</year>
r20695r20696
1965519913      <publisher>&lt;unknown&gt;</publisher>
1965619914      <part name="cart" interface="megadriv_cart">
1965719915         <feature name="pcb_type" value="SEGA-FRAM" />
19916         <feature name="slot" value="rom_fram" />
1965819917         <dataarea name="rom" size="4194304">
1965919918            <rom name="sonic 3c (prototype 0408 - apr 08, 1994, 17.29).bin" size="4194304" crc="59d23df5" sha1="5f96ddccff1e95d82201687b939973c642a05394" offset="000000" loadflag="load16_word_swap" />
1966019919         </dataarea>
r20695r20696
1966919928      <publisher>&lt;unknown&gt;</publisher>
1967019929      <part name="cart" interface="megadriv_cart">
1967119930         <feature name="pcb_type" value="SEGA-FRAM" />
19931         <feature name="slot" value="rom_fram" />
1967219932         <dataarea name="rom" size="4194304">
1967319933            <rom name="sonic 3c (prototype 0517 - may 17, 1994, 17.08).bin" size="4194304" crc="766c4b81" sha1="d6012af0f7856476892982e50b3d512d606dcb96" offset="000000" loadflag="load16_word_swap" />
1967419934         </dataarea>
r20695r20696
2005320313      <publisher>&lt;unlicensed&gt;</publisher>
2005420314      <part name="cart" interface="megadriv_cart">
2005520315         <feature name="pcb_type" value="SEGA-FRAM" />
20316         <feature name="slot" value="rom_fram" />
2005620317         <dataarea name="rom" size="2097152">
2005720318            <rom name="sonic the hedgehog 3 (pirate).bin" size="2097152" crc="c818f6fd" sha1="bc2b67803bbba89a456a464e679cde4b4bb567fb" offset="000000" loadflag="load16_word_swap" />
2005820319         </dataarea>
r20695r20696
2006720328      <publisher>Sega</publisher>
2006820329      <part name="cart" interface="megadriv_cart">
2006920330         <feature name="pcb_type" value="SEGA-FRAM" />
20331         <feature name="slot" value="rom_fram" />
2007020332         <dataarea name="rom" size="2097152">
2007120333            <rom name="sonic the hedgehog 3 (usa).bin" size="2097152" crc="9bc192ce" sha1="75e9c4705259d84112b3e697a6c00a0813d47d71" offset="000000" loadflag="load16_word_swap" />
2007220334         </dataarea>
r20695r20696
2008120343      <publisher>Treco</publisher>
2008220344      <part name="cart" interface="megadriv_cart">
2008320345         <feature name="pcb_type" value="SEGA-SRAM" />
20346         <feature name="slot" value="rom_sram" />
2008420347         <dataarea name="rom" size="1048576">
2008520348            <rom name="sorcerer's kingdom (usa) (v1.1).bin" size="1048576" crc="bb1fc9ce" sha1="87759abb603f1f97c2e136682dc78eea545338ce" offset="000000" loadflag="load16_word_swap" />
2008620349         </dataarea>
r20695r20696
2009520358      <publisher>Treco</publisher>
2009620359      <part name="cart" interface="megadriv_cart">
2009720360         <feature name="pcb_type" value="SEGA-SRAM" />
20361         <feature name="slot" value="rom_sram" />
2009820362         <dataarea name="rom" size="1048576">
2009920363            <rom name="sorcerer's kingdom (usa).bin" size="1048576" crc="cbe6c1ea" sha1="57322c1714fd4e42e1a10d56bfd795bcbc3380d7" offset="000000" loadflag="load16_word_swap" />
2010020364         </dataarea>
r20695r20696
2011220376      <info name="alt_title" value="ソーサルキングダム"/>
2011320377      <part name="cart" interface="megadriv_cart">
2011420378         <feature name="pcb_type" value="SEGA-SRAM" />
20379         <feature name="slot" value="rom_sram" />
2011520380         <dataarea name="rom" size="1048576">
2011620381            <rom name="sorcer kingdom (jpn).bin" size="1048576" crc="944135ca" sha1="16394aebece9d03f43505eab0827889e1c61857f" offset="000000" loadflag="load16_word_swap" />
2011720382         </dataarea>
r20695r20696
2012920394      <info name="alt_title" value="ソーサリアン"/>
2013020395      <part name="cart" interface="megadriv_cart">
2013120396         <feature name="pcb_type" value="SEGA-SRAM" />
20397         <feature name="slot" value="rom_sram" />
2013220398         <dataarea name="rom" size="524288">
2013320399            <rom name="mpr-12906.bin" size="524288" crc="a143a8c5" sha1="cbd7f0693a0d127138977da7cdf5a7f9440dfd43" offset="000000" loadflag="load16_word_swap" />
2013420400         </dataarea>
r20695r20696
2040720673      <publisher>Sega</publisher>
2040820674      <part name="cart" interface="megadriv_cart">
2040920675         <feature name="pcb_type" value="SEGA-EEPROM" />
20676         <feature name="slot" value="rom_eeprom" />
2041020677         <dataarea name="rom" size="1048576">
2041120678            <rom name="sports talk baseball (usa).bin" size="1048576" crc="0deb79c2" sha1="e223513d9bcecb49a6798720f3195dbd1c34681c" offset="000000" loadflag="load16_word_swap" />
2041220679         </dataarea>
r20695r20696
2045520722      <info name="alt_title" value="スタークルーザー"/>
2045620723      <part name="cart" interface="megadriv_cart">
2045720724         <feature name="pcb_type" value="SEGA-SRAM" />
20725         <feature name="slot" value="rom_sram" />
2045820726         <dataarea name="rom" size="524288">
2045920727            <rom name="star cruiser (jpn).bin" size="524288" crc="2b75b52f" sha1="cb099ecde141beffdfed6bb7f1d3dc6340da81d1" offset="000000" loadflag="load16_word_swap" />
2046020728         </dataarea>
r20695r20696
2049120759      <publisher>Sega</publisher>
2049220760      <part name="cart" interface="megadriv_cart">
2049320761         <feature name="pcb_type" value="SEGA-SRAM" />
20762         <feature name="slot" value="rom_sram" />
2049420763         <dataarea name="rom" size="2097152">
2049520764            <rom name="star trek - the next generation - echoes from the past (usa) (v1.1).bin" size="2097152" crc="ef840ef2" sha1="fe72aff307182dc6970048e88eaa5f03348781f5" offset="000000" loadflag="load16_word_swap" />
2049620765         </dataarea>
r20695r20696
2050520774      <publisher>Sega</publisher>
2050620775      <part name="cart" interface="megadriv_cart">
2050720776         <feature name="pcb_type" value="SEGA-SRAM" />
20777         <feature name="slot" value="rom_sram" />
2050820778         <dataarea name="rom" size="2097152">
2050920779            <rom name="star trek - the next generation - echoes from the past (usa).bin" size="2097152" crc="272153fb" sha1="ca0cf81784262fe6c00502cb495ede7daf3685c0" offset="000000" loadflag="load16_word_swap" />
2051020780         </dataarea>
r20695r20696
2052020790      <publisher>Sega</publisher>
2052120791      <part name="cart" interface="megadriv_cart">
2052220792         <feature name="pcb_type" value="SEGA-SRAM" />
20793         <feature name="slot" value="rom_sram" />
2052320794         <dataarea name="rom" size="2097152">
2052420795            <rom name="star trek - the next generation - echoes from the past (prototype - dec 28, 1994).bin" size="2097152" crc="3ba670f9" sha1="b3f800ae3009296614d1b0943b4245b4510a30f0" offset="000000" loadflag="load16_word_swap" />
2052520796         </dataarea>
r20695r20696
2053520806      <publisher>Sega</publisher>
2053620807      <part name="cart" interface="megadriv_cart">
2053720808         <feature name="pcb_type" value="SEGA-SRAM" />
20809         <feature name="slot" value="rom_sram" />
2053820810         <dataarea name="rom" size="2097152">
2053920811            <rom name="star trek - the next generation - echoes from the past (prototype - dec 29, 1994).bin" size="2097152" crc="316bbc43" sha1="e01d14c9dc9cd63800a793350e88af5de71b699b" offset="000000" loadflag="load16_word_swap" />
2054020812         </dataarea>
r20695r20696
2054920821      <publisher>Sega</publisher>
2055020822      <part name="cart" interface="megadriv_cart">
2055120823         <feature name="pcb_type" value="SEGA-SRAM" />
20824         <feature name="slot" value="rom_sram" />
2055220825         <dataarea name="rom" size="2097152">
2055320826            <rom name="star trek - the next generation - echoes from the past (prototype - jan 03, 1994).bin" size="2097152" crc="cac86b68" sha1="c6d702396d090b80fa1bb86b5079870de1c2dd70" offset="000000" loadflag="load16_word_swap" />
2055420827         </dataarea>
r20695r20696
2056320836      <publisher>Sega</publisher>
2056420837      <part name="cart" interface="megadriv_cart">
2056520838         <feature name="pcb_type" value="SEGA-SRAM" />
20839         <feature name="slot" value="rom_sram" />
2056620840         <dataarea name="rom" size="2097152">
2056720841            <rom name="star trek - the next generation - echoes from the past (prototype - jan 10, 1994).bin" size="2097152" crc="d138ca3e" sha1="4ed46dc5faafa8e92c753fcad5f37dd7c563e28c" offset="000000" loadflag="load16_word_swap" />
2056820842         </dataarea>
r20695r20696
2057720851      <publisher>Sega</publisher>
2057820852      <part name="cart" interface="megadriv_cart">
2057920853         <feature name="pcb_type" value="SEGA-SRAM" />
20854         <feature name="slot" value="rom_sram" />
2058020855         <dataarea name="rom" size="2097152">
2058120856            <rom name="star trek - the next generation - echoes from the past (prototype - jan 18, 1994).bin" size="2097152" crc="d8dab97a" sha1="94a7b71aada60f0a622f6156a31f22700c484505" offset="000000" loadflag="load16_word_swap" />
2058220857         </dataarea>
r20695r20696
2059120866      <publisher>Sega</publisher>
2059220867      <part name="cart" interface="megadriv_cart">
2059320868         <feature name="pcb_type" value="SEGA-SRAM" />
20869         <feature name="slot" value="rom_sram" />
2059420870         <dataarea name="rom" size="2097152">
2059520871            <rom name="star trek - the next generation - echoes from the past (prototype - jan 25, 1994).bin" size="2097152" crc="63f29e6f" sha1="7e1b9bd971088d083c4f9447ae5daff50bcc67c2" offset="000000" loadflag="load16_word_swap" />
2059620872         </dataarea>
r20695r20696
2072120997      <publisher>Sega</publisher>
2072220998      <part name="cart" interface="megadriv_cart">
2072320999         <feature name="pcb_type" value="SEGA-SRAM" />
21000         <feature name="slot" value="rom_sram" />
2072421001         <dataarea name="rom" size="3145728">
2072521002            <rom name="mpr-17588+mpr-17606.bin" size="3145728" crc="1110b0db" sha1="178ef742dad227d4128fa81dddb116bad0cabe1d" offset="000000" loadflag="load16_word_swap" />
2072621003         </dataarea>
r20695r20696
2073521012      <publisher>Sega</publisher>
2073621013      <part name="cart" interface="megadriv_cart">
2073721014         <feature name="pcb_type" value="SEGA-SRAM" />
21015         <feature name="slot" value="rom_sram" />
2073821016         <dataarea name="rom" size="3145728">
2073921017            <rom name="story of thor, the (germany).bin" size="3145728" crc="fa20d011" sha1="a82ffb7c4bf4b0f89f42a9cdc6600bc5bac1c854" offset="000000" loadflag="load16_word_swap" />
2074021018         </dataarea>
r20695r20696
2075221030      <info name="alt_title" value="ストーリー オブ トア 〜光を継ぐ者〜"/>
2075321031      <part name="cart" interface="megadriv_cart">
2075421032         <feature name="pcb_type" value="SEGA-SRAM" />
21033         <feature name="slot" value="rom_sram" />
2075521034         <dataarea name="rom" size="3145728">
2075621035            <rom name="story of thor, the - hikari o tsugumono (jpn).bin" size="3145728" crc="4f39783c" sha1="54296f5cf1917c568bb29b0086641c282b8884bd" offset="000000" loadflag="load16_word_swap" />
2075721036         </dataarea>
r20695r20696
2077921058      <publisher>Sega</publisher>
2078021059      <part name="cart" interface="megadriv_cart">
2078121060         <feature name="pcb_type" value="SEGA-SRAM" />
21061         <feature name="slot" value="rom_sram" />
2078221062         <dataarea name="rom" size="3145728">
2078321063            <rom name="story of thor, the (kor).bin" size="3145728" crc="ee1603c5" sha1="e0a43fb3d6da940b1fda449753bffae637a802cd" offset="000000" loadflag="load16_word_swap" />
2078421064         </dataarea>
r20695r20696
2079321073      <publisher>Sega</publisher>
2079421074      <part name="cart" interface="megadriv_cart">
2079521075         <feature name="pcb_type" value="SEGA-SRAM" />
21076         <feature name="slot" value="rom_sram" />
2079621077         <dataarea name="rom" size="3145728">
2079721078            <rom name="story of thor, the (prototype - oct 04, 1994).bin" size="3145728" crc="9e486f91" sha1="499dd47c325874a231a8d8430aca0bb6feeb3dcd" offset="000000" loadflag="load16_word_swap" />
2079821079         </dataarea>
r20695r20696
2080721088      <publisher>Sega</publisher>
2080821089      <part name="cart" interface="megadriv_cart">
2080921090         <feature name="pcb_type" value="SEGA-SRAM" />
21091         <feature name="slot" value="rom_sram" />
2081021092         <dataarea name="rom" size="3145728">
2081121093            <rom name="story of thor, the (prototype - oct 17, 1994).bin" size="3145728" crc="aa43d34a" sha1="e4b25941aefb58073784616acf7ca7458b213bee" offset="000000" loadflag="load16_word_swap" />
2081221094         </dataarea>
r20695r20696
2082121103      <publisher>Sega</publisher>
2082221104      <part name="cart" interface="megadriv_cart">
2082321105         <feature name="pcb_type" value="SEGA-SRAM" />
21106         <feature name="slot" value="rom_sram" />
2082421107         <dataarea name="rom" size="3145728">
2082521108            <rom name="beyond oasis (prototype - nov 01, 1994).bin" size="3145728" crc="fa59f847" sha1="cb0606faeab0398244d4721d71cf7e1c5724a9ef" offset="000000" loadflag="load16_word_swap" />
2082621109         </dataarea>
r20695r20696
2083521118      <publisher>Sega</publisher>
2083621119      <part name="cart" interface="megadriv_cart">
2083721120         <feature name="pcb_type" value="SEGA-SRAM" />
21121         <feature name="slot" value="rom_sram" />
2083821122         <dataarea name="rom" size="3145728">
2083921123            <rom name="story of thor, the (spain).bin" size="3145728" crc="4631f941" sha1="0fcc02355176e1c96043f4d827a3ff88d2d272df" offset="000000" loadflag="load16_word_swap" />
2084021124         </dataarea>
r20695r20696
2084921133      <publisher>Sega</publisher>
2085021134      <part name="cart" interface="megadriv_cart">
2085121135         <feature name="pcb_type" value="SEGA-SRAM" />
21136         <feature name="slot" value="rom_sram" />
2085221137         <dataarea name="rom" size="3145728">
2085321138            <rom name="beyond oasis (usa).bin" size="3145728" crc="c4728225" sha1="2944910c07c02eace98c17d78d07bef7859d386a" offset="000000" loadflag="load16_word_swap" />
2085421139         </dataarea>
r20695r20696
2125521540      <publisher>Sega</publisher>
2125621541      <part name="cart" interface="megadriv_cart">
2125721542         <feature name="pcb_type" value="SEGA-SRAM" />
21543         <feature name="slot" value="rom_sram" />
2125821544         <dataarea name="rom" size="2097152">
2125921545            <rom name="striker (euro).bin" size="2097152" crc="cc5d7ab2" sha1="9917c35a263cc9bd922d55bf59d01bc2733b4e24" offset="000000" loadflag="load16_word_swap" />
2126021546         </dataarea>
r20695r20696
2126921555      <publisher>Sega</publisher>
2127021556      <part name="cart" interface="megadriv_cart">
2127121557         <feature name="pcb_type" value="SEGA-SRAM" />
21558         <feature name="slot" value="rom_sram" />
2127221559         <dataarea name="rom" size="2097152">
2127321560            <rom name="striker (euro) (beta).bin" size="2097152" crc="c10b270e" sha1="128395e635e948005e89c7f4a6cd5b209be1ffbc" offset="000000" loadflag="load16_word_swap" />
2127421561         </dataarea>
r20695r20696
2143221719      <info name="alt_title" value="スーパー大戦略"/>
2143321720      <part name="cart" interface="megadriv_cart">
2143421721         <feature name="pcb_type" value="SEGA-SRAM" />
21722         <feature name="slot" value="rom_sram" />
2143521723         <dataarea name="rom" size="524288">
2143621724            <rom name="mpr-12477.bin" size="524288" crc="d50a166f" sha1="56d9366b50cea65b16ed621b9a5bf355ef89e6b5" offset="000000" loadflag="load16_word_swap" />
2143721725         </dataarea>
r20695r20696
2151021798      <publisher>Sega</publisher>
2151121799      <part name="cart" interface="megadriv_cart">
2151221800         <feature name="pcb_type" value="SEGA-SRAM" />
21801         <feature name="slot" value="rom_sram" />
2151321802         <dataarea name="rom" size="524288">
2151421803            <rom name="super hydlide (euro).bin" size="524288" crc="1fe2d90b" sha1="6c0a4b72b90ecfe8c324691bc6e54243746043c1" offset="000000" loadflag="load16_word_swap" />
2151521804         </dataarea>
r20695r20696
2153821827      <publisher>Seismic</publisher>
2153921828      <part name="cart" interface="megadriv_cart">
2154021829         <feature name="pcb_type" value="SEGA-SRAM" />
21830         <feature name="slot" value="rom_sram" />
2154121831         <dataarea name="rom" size="524288">
2154221832            <rom name="super hydlide (usa).bin" size="524288" crc="1335ddaa" sha1="5ff65139c7e10539dd5a12bdf56073504c998471" offset="000000" loadflag="load16_word_swap" />
2154321833         </dataarea>
r20695r20696
2155221842      <publisher>U.S. Gold</publisher>
2155321843      <part name="cart" interface="megadriv_cart">
2155421844         <feature name="pcb_type" value="SEGA-SRAM" />
21845         <feature name="slot" value="rom_sram" />
2155521846         <dataarea name="rom" size="524288">
2155621847            <rom name="mpr-15420.bin" size="524288" crc="f43793ff" sha1="4e270b13a399d78d919157e50ab11f4645aa6d32" offset="000000" loadflag="load16_word_swap" />
2155721848         </dataarea>
r20695r20696
2173222023      <publisher>Capcom</publisher>
2173322024      <part name="cart" interface="megadriv_cart">
2173422025         <feature name="pcb_type" value="SSF2" />
21735         <dataarea name="rom" size="20971520">
22026         <feature name="slot" value="rom_ssf2" />
22027         <dataarea name="rom" size="9437184">
2173622028            <rom name="super street fighter ii - the new challengers (euro).bin" size="5242880" crc="682c192f" sha1="56768a0524fa13fcd76474c8bb89b995bb471847" offset="00000" loadflag="load16_word_swap" />
2173722029         </dataarea>
2173822030      </part>
r20695r20696
2174722039      <info name="alt_title" value="スーパーストリートファイターII The New Challengers"/>
2174822040      <part name="cart" interface="megadriv_cart">
2174922041         <feature name="pcb_type" value="SSF2" />
21750         <dataarea name="rom" size="20971520">
22042         <feature name="slot" value="rom_ssf2" />
22043         <dataarea name="rom" size="5242880">
2175122044            <rom name="super street fighter ii - the new challengers (jpn).bin" size="5242880" crc="d8eeb2bd" sha1="24c8634f59a481118f8350125fa6e00d33e04c95" offset="00000" loadflag="load16_word_swap" />
2175222045         </dataarea>
2175322046      </part>
r20695r20696
2175922052      <publisher>Capcom</publisher>
2176022053      <part name="cart" interface="megadriv_cart">
2176122054         <feature name="pcb_type" value="SSF2" />
21762         <dataarea name="rom" size="20971520">
22055         <feature name="slot" value="rom_ssf2" />
22056         <dataarea name="rom" size="5242880">
2176322057            <rom name="super street fighter ii - the new challengers (usa).bin" size="5242880" crc="165defbf" sha1="9ce6e69db9d28386f7542dacd3e3ead28eacf2a4" offset="00000" loadflag="load16_word_swap" />
2176422058         </dataarea>
2176522059      </part>
r20695r20696
2185722151      <info name="alt_title" value="サージングオーラ"/>
2185822152      <part name="cart" interface="megadriv_cart">
2185922153         <feature name="pcb_type" value="SEGA-SRAM" />
22154         <feature name="slot" value="rom_sram" />
2186022155         <dataarea name="rom" size="2097152">
2186122156            <rom name="surging aura (jpn).bin" size="2097152" crc="65ac1d2b" sha1="9f14cd11cfa499cdd58248de81db30f9308326e5" offset="000000" loadflag="load16_word_swap" />
2186222157         </dataarea>
r20695r20696
2193222227      <publisher>Sega</publisher>
2193322228      <part name="cart" interface="megadriv_cart">
2193422229         <feature name="pcb_type" value="SEGA-SRAM" />
22230         <feature name="slot" value="rom_sram" />
2193522231         <dataarea name="rom" size="655360">
2193622232            <rom name="mpr-13430+mpr-13431.bin" size="655360" crc="ea1bc9ab" sha1="c18fc75e0c5fa0e98c8664903e978ec4f73ef5d2" offset="000000" loadflag="load16_word_swap" />
2193722233         </dataarea>
r20695r20696
2194922245      <info name="alt_title" value="ヴァーミリオン"/>
2195022246      <part name="cart" interface="megadriv_cart">
2195122247         <feature name="pcb_type" value="SEGA-SRAM" />
22248         <feature name="slot" value="rom_sram" />
2195222249         <dataarea name="rom" size="655360">
2195322250            <rom name="vermilion (jpn).bin" size="655360" crc="e400dfc3" sha1="697fb165051179a2bbca77c8cfd0c929e334f8c1" offset="000000" loadflag="load16_word_swap" />
2195422251         </dataarea>
r20695r20696
2204722344      <info name="alt_title" value="太閤立志伝"/>
2204822345      <part name="cart" interface="megadriv_cart">
2204922346         <feature name="pcb_type" value="SEGA-SRAM" />
22347         <feature name="slot" value="rom_sram" />
2205022348         <dataarea name="rom" size="1310720">
2205122349            <rom name="taikou risshiden (jpn).bin" size="1310720" crc="f96fe15b" sha1="a96d6492d4e89687d970bc010eb0b93ee2481a44" offset="000000" loadflag="load16_word_swap" />
2205222350         </dataarea>
r20695r20696
2224522543      <publisher>Tecmo</publisher>
2224622544      <part name="cart" interface="megadriv_cart">
2224722545         <feature name="pcb_type" value="SEGA-SRAM" />
22546         <feature name="slot" value="rom_sram" />
2224822547         <dataarea name="rom" size="1048576">
2224922548            <rom name="tecmo super baseball (usa).bin" size="1048576" crc="227a1178" sha1="f2ecc7b32cef29f22eb4a21a22be122bd4bad212" offset="000000" loadflag="load16_word_swap" />
2225022549         </dataarea>
r20695r20696
2225922558      <publisher>Tecmo</publisher>
2226022559      <part name="cart" interface="megadriv_cart">
2226122560         <feature name="pcb_type" value="SEGA-SRAM" />
22561         <feature name="slot" value="rom_sram" />
2226222562         <dataarea name="rom" size="1048576">
2226322563            <rom name="tecmo super bowl (usa) (october 1993).bin" size="1048576" crc="21f27d34" sha1="8d34ffac312caeac853876415c74ab6fe63d8dc2" offset="000000" loadflag="load16_word_swap" />
2226422564         </dataarea>
r20695r20696
2227322573      <publisher>Tecmo</publisher>
2227422574      <part name="cart" interface="megadriv_cart">
2227522575         <feature name="pcb_type" value="SEGA-SRAM" />
22576         <feature name="slot" value="rom_sram" />
2227622577         <dataarea name="rom" size="1048576">
2227722578            <rom name="tecmo super bowl (usa) (september 1993).bin" size="1048576" crc="bd5933ee" sha1="529b8e86b97c326592540f5e427198a205c127d0" offset="000000" loadflag="load16_word_swap" />
2227822579         </dataarea>
r20695r20696
2229022591      <info name="alt_title" value="テクモスーパーボウル"/>
2229122592      <part name="cart" interface="megadriv_cart">
2229222593         <feature name="pcb_type" value="SEGA-SRAM" />
22594         <feature name="slot" value="rom_sram" />
2229322595         <dataarea name="rom" size="1048576">
2229422596            <rom name="tecmo super bowl (jpn).bin" size="1048576" crc="90c6e20c" sha1="477880e7976ac0f7203fddabba4a6e8799aa604d" offset="000000" loadflag="load16_word_swap" />
2229522597         </dataarea>
r20695r20696
2230522607      <publisher>Tecmo</publisher>
2230622608      <part name="cart" interface="megadriv_cart">
2230722609         <feature name="pcb_type" value="SEGA-SRAM" />
22610         <feature name="slot" value="rom_sram" />
2230822611         <dataarea name="rom" size="2097152">
2230922612            <rom name="tecmo super bowl ii - special edition (usa).bin" size="2097152" crc="0a0e67d8" sha1="5fadb2a0e780ec868671b0e888fad5d7c203f59f" offset="000000" loadflag="load16_word_swap" />
2231022613         </dataarea>
r20695r20696
2232222625      <info name="alt_title" value="テクモ スーパーボウルII スペシャルエディション"/>
2232322626      <part name="cart" interface="megadriv_cart">
2232422627         <feature name="pcb_type" value="SEGA-SRAM" />
22628         <feature name="slot" value="rom_sram" />
2232522629         <dataarea name="rom" size="2097152">
2232622630            <rom name="tecmo super bowl ii - special edition (jpn).bin" size="2097152" crc="32fb633d" sha1="cb9e8cc1651b719054f05e1e1a9e0fbbc3876ebd" offset="000000" loadflag="load16_word_swap" />
2232722631         </dataarea>
r20695r20696
2233622640      <publisher>Tecmo</publisher>
2233722641      <part name="cart" interface="megadriv_cart">
2233822642         <feature name="pcb_type" value="SEGA-SRAM" />
22643         <feature name="slot" value="rom_sram" />
2233922644         <dataarea name="rom" size="2097152">
2234022645            <rom name="tecmo super bowl iii - final edition (usa).bin" size="2097152" crc="aae4089f" sha1="d5d1609cdf72d98f5e5daa47a9585ae7ca87a410" offset="000000" loadflag="load16_word_swap" />
2234122646         </dataarea>
r20695r20696
2235022655      <publisher>Tecmo</publisher>
2235122656      <part name="cart" interface="megadriv_cart">
2235222657         <feature name="pcb_type" value="SEGA-SRAM" />
22658         <feature name="slot" value="rom_sram" />
2235322659         <dataarea name="rom" size="1048576">
2235422660            <rom name="tecmo super hockey (usa).bin" size="1048576" crc="5f86ddc9" sha1="4d4fd22d2fafd7e56790029be9b02e61995df11c" offset="000000" loadflag="load16_word_swap" />
2235522661         </dataarea>
r20695r20696
2236422670      <publisher>Tecmo</publisher>
2236522671      <part name="cart" interface="megadriv_cart">
2236622672         <feature name="pcb_type" value="SEGA-SRAM" />
22673         <feature name="slot" value="rom_sram" />
2236722674         <dataarea name="rom" size="1048576">
2236822675            <rom name="tecmo super nba basketball (usa).bin" size="1048576" crc="53913991" sha1="ac7aa724d6464fbd8e3144a49f3821ff6e42f67a" offset="000000" loadflag="load16_word_swap" />
2236922676         </dataarea>
r20695r20696
2238122688      <info name="alt_title" value="テクモ スーパーNBAバスケットボール"/>
2238222689      <part name="cart" interface="megadriv_cart">
2238322690         <feature name="pcb_type" value="SEGA-SRAM" />
22691         <feature name="slot" value="rom_sram" />
2238422692         <dataarea name="rom" size="1048576">
2238522693            <rom name="tecmo super nba basketball (jpn).bin" size="1048576" crc="79f33eb6" sha1="07f160e6eb7e358f54e4fdabfc95bb5525c57fc9" offset="000000" loadflag="load16_word_swap" />
2238622694         </dataarea>
r20695r20696
2253122839      <info name="alt_title" value="TEL・TELスタジアム"/>
2253222840      <part name="cart" interface="megadriv_cart">
2253322841         <feature name="pcb_type" value="SEGA-SRAM" />
22842         <feature name="slot" value="rom_sram" />
2253422843         <dataarea name="rom" size="524288">
2253522844            <rom name="md-tsd.bin" size="524288" crc="54cf8c29" sha1="2924ed0b4266edddbb981f97acb93bbdf90494e6" offset="000000" loadflag="load16_word_swap" />
2253622845         </dataarea>
r20695r20696
2284923158      <publisher>American Softworks</publisher>
2285023159      <part name="cart" interface="megadriv_cart">
2285123160         <feature name="pcb_type" value="SEGA-SRAM" />
23161         <feature name="slot" value="rom_sram" />
2285223162         <dataarea name="rom" size="1048576">
2285323163            <rom name="tnn bass tournament of champions (usa).bin" size="1048576" crc="c83ffa1b" sha1="f76acb6d5da07377685d42daf1ce4ca53be5d6b9" offset="000000" loadflag="load16_word_swap" />
2285423164         </dataarea>
r20695r20696
2286323173      <publisher>American Softworks</publisher>
2286423174      <part name="cart" interface="megadriv_cart">
2286523175         <feature name="pcb_type" value="SEGA-SRAM" />
23176         <feature name="slot" value="rom_sram" />
2286623177         <dataarea name="rom" size="2097152">
2286723178            <rom name="tnn outdoors bass tournament '96 (usa).bin" size="2097152" crc="5c523c0b" sha1="0ca72f28e88675066c466246977143599240b09f" offset="000000" loadflag="load16_word_swap" />
2286823179         </dataarea>
r20695r20696
2302423335      <publisher>Electronic Arts</publisher>
2302523336      <part name="cart" interface="megadriv_cart">
2302623337         <feature name="pcb_type" value="SEGA-SRAM" />
23338         <feature name="slot" value="rom_sram" />
2302723339         <dataarea name="rom" size="1048576">
2302823340            <rom name="tony la russa baseball (usa, aus).bin" size="1048576" crc="24629c78" sha1="0e3f7ebf8661cac9bd7a0c5af64f260e7b5f0a0b" offset="000000" loadflag="load16_word_swap" />
2302923341         </dataarea>
r20695r20696
2315623468      <publisher>Renovation</publisher>
2315723469      <part name="cart" interface="megadriv_cart">
2315823470         <feature name="pcb_type" value="SEGA-SRAM" />
23471         <feature name="slot" value="rom_sram" />
2315923472         <dataarea name="rom" size="1048576">
2316023473            <rom name="traysia (usa).bin" size="1048576" crc="96184f4f" sha1="ff0efe6da308919f843a7593e8af7fae82160b0b" offset="000000" loadflag="load16_word_swap" />
2316123474         </dataarea>
r20695r20696
2317323486      <info name="alt_title" value="港のトレイジア"/>
2317423487      <part name="cart" interface="megadriv_cart">
2317523488         <feature name="pcb_type" value="SEGA-SRAM" />
23489         <feature name="slot" value="rom_sram" />
2317623490         <dataarea name="rom" size="1048576">
2317723491            <rom name="minato no traysia (jpn).bin" size="1048576" crc="bd89fd09" sha1="dea227a41a5ba28f8c8ea75cba12965bbc5ff8da" offset="000000" loadflag="load16_word_swap" />
2317823492         </dataarea>
r20695r20696
2318723501      <publisher>Electronic Arts</publisher>
2318823502      <part name="cart" interface="megadriv_cart">
2318923503         <feature name="pcb_type" value="SEGA-SRAM" />
23504         <feature name="slot" value="rom_sram" />
2319023505         <dataarea name="rom" size="4194304">
2319123506            <rom name="triple play '96 (usa).bin" size="4194304" crc="f1748e91" sha1="c0981b524d5e1c5368f9e74a4ce9c57d87fe323a" offset="000000" loadflag="load16_word_swap" />
2319223507         </dataarea>
r20695r20696
2320123516      <publisher>Electronic Arts</publisher>
2320223517      <part name="cart" interface="megadriv_cart">
2320323518         <feature name="pcb_type" value="SEGA-SRAM" />
23519         <feature name="slot" value="rom_sram" />
2320423520         <dataarea name="rom" size="4194304">
2320523521            <rom name="triple play gold (usa).bin" size="4194304" crc="bbe69017" sha1="007bee242384db1887c5831657470584ff77a163" offset="000000" loadflag="load16_word_swap" />
2320623522         </dataarea>
r20695r20696
2321523531      <publisher>Electronic Arts</publisher>
2321623532      <part name="cart" interface="megadriv_cart">
2321723533         <feature name="pcb_type" value="SEGA-SRAM" />
23534         <feature name="slot" value="rom_sram" />
2321823535         <dataarea name="rom" size="4194304">
2321923536            <rom name="triple play gold (usa) (alt).bin" size="4194304" crc="a89638a0" sha1="cb7f4b9b89fbf6162d7d4182229c8ac473f91cf4" offset="000000" loadflag="load16_word_swap" />
2322023537         </dataarea>
r20695r20696
2325423571      <publisher>Tradewest</publisher>
2325523572      <part name="cart" interface="megadriv_cart">
2325623573         <feature name="pcb_type" value="SEGA-SRAM" />
23574         <feature name="slot" value="rom_sram" />
2325723575         <dataarea name="rom" size="2097152">
2325823576            <rom name="troy aikman nfl football (usa).bin" size="2097152" crc="015f2713" sha1="820efb4a4d3d29036911d9077bb6c0a4ce7f36d4" offset="000000" loadflag="load16_word_swap" />
2325923577         </dataarea>
r20695r20696
2350123819      <publisher>Koei</publisher>
2350223820      <part name="cart" interface="megadriv_cart">
2350323821         <feature name="pcb_type" value="SEGA-SRAM" />
23822         <feature name="slot" value="rom_sram" />
2350423823         <dataarea name="rom" size="1048576">
2350523824            <rom name="uncharted waters (usa).bin" size="1048576" crc="4edaec59" sha1="a76cf7dd06784cba15fa0c3be0ae92cba71ccade" offset="000000" loadflag="load16_word_swap" />
2350623825         </dataarea>
r20695r20696
2351823837      <info name="alt_title" value="大航海時代"/>
2351923838      <part name="cart" interface="megadriv_cart">
2352023839         <feature name="pcb_type" value="SEGA-SRAM" />
23840         <feature name="slot" value="rom_sram" />
2352123841         <dataarea name="rom" size="1048576">
2352223842            <rom name="daikoukai jidai (jpn).bin" size="1048576" crc="5a652458" sha1="a4552b23079b161da9ad47ac7cb9c4ecb3731967" offset="000000" loadflag="load16_word_swap" />
2352323843         </dataarea>
r20695r20696
2353223852      <publisher>Koei</publisher>
2353323853      <part name="cart" interface="megadriv_cart">
2353423854         <feature name="pcb_type" value="SEGA-SRAM" />
23855         <feature name="slot" value="rom_sram" />
2353523856         <dataarea name="rom" size="2097152">
2353623857            <rom name="uncharted waters - new horizons (usa).bin" size="2097152" crc="ead69824" sha1="9fd375cd212a132db24c40a8977c50d0f7b81524" offset="000000" loadflag="load16_word_swap" />
2353723858         </dataarea>
r20695r20696
2354923870      <info name="alt_title" value="大航海時代II"/>
2355023871      <part name="cart" interface="megadriv_cart">
2355123872         <feature name="pcb_type" value="SEGA-SRAM" />
23873         <feature name="slot" value="rom_sram" />
2355223874         <dataarea name="rom" size="2097152">
2355323875            <rom name="daikoukai jidai ii (jpn).bin" size="2097152" crc="e040f0da" sha1="74f61092067d82127cae3306d5a66d3efe946bc3" offset="000000" loadflag="load16_word_swap" />
2355423876         </dataarea>
r20695r20696
2358823910      <publisher>Accolade</publisher>
2358923911      <part name="cart" interface="megadriv_cart">
2359023912         <feature name="pcb_type" value="SEGA-SRAM" />
23913         <feature name="slot" value="rom_sram" />
2359123914         <dataarea name="rom" size="2097152">
2359223915            <rom name="unnecessary roughness 95 (usa).bin" size="2097152" crc="9920e7b7" sha1="7e100cb56c30498c1fee3867ff3612567287b656" offset="000000" loadflag="load16_word_swap" />
2359323916         </dataarea>
r20695r20696
2395924282      <publisher>Electronic Arts</publisher>
2396024283      <part name="cart" interface="megadriv_cart">
2396124284         <feature name="pcb_type" value="SEGA-SRAM" />
24285         <feature name="slot" value="rom_sram" />
2396224286         <dataarea name="rom" size="1048576">
2396324287            <rom name="virtual pinball (euro, usa).bin" size="1048576" crc="d63473aa" sha1="cd066bb54e0a4c21821639728893462b0218597e" offset="000000" loadflag="load16_word_swap" />
2396424288         </dataarea>
r20695r20696
2397624300      <info name="alt_title" value="ヴィクセン357"/>
2397724301      <part name="cart" interface="megadriv_cart">
2397824302         <feature name="pcb_type" value="SEGA-SRAM" />
24303         <feature name="slot" value="rom_sram" />
2397924304         <dataarea name="rom" size="1048576">
2398024305            <rom name="vixen 357 (jpn).bin" size="1048576" crc="3afa2d7b" sha1="460037301df0d67947bd17eddb38a3011896cb43" offset="000000" loadflag="load16_word_swap" />
2398124306         </dataarea>
r20695r20696
2401324338      <info name="alt_title" value="Wacky Worlds Creativity Studio (Box)"/>
2401424339      <part name="cart" interface="megadriv_cart">
2401524340         <feature name="pcb_type" value="SEGA-SRAM" />
24341         <feature name="slot" value="rom_sram" />
2401624342         <dataarea name="rom" size="1048576">
2401724343            <rom name="wacky worlds (usa).bin" size="1048576" crc="8af4552d" sha1="e331c57ce6a176ab9ff1461e9423514756c5558d" offset="000000" loadflag="load16_word_swap" />
2401824344         </dataarea>
r20695r20696
2415724483      <publisher>Micronet</publisher>
2415824484      <part name="cart" interface="megadriv_cart">
2415924485         <feature name="pcb_type" value="SEGA-SRAM" />
24486         <feature name="slot" value="rom_sram" />
2416024487         <dataarea name="rom" size="1048576">
2416124488            <rom name="warrior of rome ii (usa).bin" size="1048576" crc="cd8c472a" sha1="fe4e3684212f1e695bdf4a4c41999fac773259f4" offset="000000" loadflag="load16_word_swap" />
2416224489         </dataarea>
r20695r20696
2417424501      <info name="alt_title" value="シーザーの野望II"/>
2417524502      <part name="cart" interface="megadriv_cart">
2417624503         <feature name="pcb_type" value="SEGA-SRAM" />
24504         <feature name="slot" value="rom_sram" />
2417724505         <dataarea name="rom" size="1048576">
2417824506            <rom name="caesar no yabou ii (jpn).bin" size="1048576" crc="4f327b3a" sha1="cdb2f47bde3ff412c7b1f560637f2ccec023980f" offset="000000" loadflag="load16_word_swap" />
2417924507         </dataarea>
r20695r20696
2418824516      <publisher>Treco</publisher>
2418924517      <part name="cart" interface="megadriv_cart">
2419024518         <feature name="pcb_type" value="SEGA-SRAM" />
24519         <feature name="slot" value="rom_sram" />
2419124520         <dataarea name="rom" size="524288">
2419224521            <rom name="warsong (usa).bin" size="524288" crc="4b680285" sha1="9b13a85f39b3f4cc31f54077df29bbe812405a08" offset="000000" loadflag="load16_word_swap" />
2419324522         </dataarea>
r20695r20696
2421324542      <publisher>Time Warner Interactive</publisher>
2421424543      <part name="cart" interface="megadriv_cart">
2421524544         <feature name="pcb_type" value="SEGA-SRAM" />
24545         <feature name="slot" value="rom_sram" />
2421624546         <dataarea name="rom" size="2097152">
2421724547            <rom name="wayne gretzky and the nhlpa all-stars (euro, usa).bin" size="2097152" crc="c2c13b81" sha1="0b068f684e206139bcd592daba4613cbf634dd56" offset="000000" loadflag="load16_word_swap" />
2421824548         </dataarea>
r20695r20696
2452524855      <publisher>Sega</publisher>
2452624856      <part name="cart" interface="megadriv_cart">
2452724857         <feature name="pcb_type" value="SEGA-EEPROM" />
24858         <feature name="slot" value="rom_eeprom" />
2452824859         <dataarea name="rom" size="786432">
2452924860            <rom name="mpr-14556.bin" size="786432" crc="1592f5b0" sha1="87a968f773c7e807e647c0737132457b06b78276" offset="000000" loadflag="load16_word_swap" />
2453024861         </dataarea>
r20695r20696
2454024871      <info name="alt_title" value="ワンダーボーイV モンスターワールドIII"/>
2454124872      <part name="cart" interface="megadriv_cart">
2454224873         <feature name="pcb_type" value="SEGA-EEPROM" />
24874         <feature name="slot" value="rom_eeprom" />
2454324875         <dataarea name="rom" size="655360">
2454424876            <rom name="wonder boy v - monster world iii (jpn, kor).bin" size="655360" crc="45a50f96" sha1="1582f159e1969ff0541319a9bd7e6f7a53505d01" offset="000000" loadflag="load16_word_swap" />
2454524877         </dataarea>
r20695r20696
2455224884      <publisher>Tec Toy</publisher>
2455324885      <part name="cart" interface="megadriv_cart">
2455424886         <feature name="pcb_type" value="SEGA-EEPROM" />
24887         <feature name="slot" value="rom_eeprom" />
2455524888         <dataarea name="rom" size="1048576">
2455624889            <rom name="turma da monica na terra dos monstros (bra).bin" size="1048576" crc="f8288de1" sha1="80fc2a6a6b8b943f781598094f3b5a5fe4f05ede" offset="000000" loadflag="load16_word_swap" />
2455724890         </dataarea>
r20695r20696
2489525228      <publisher>U.S. Gold</publisher>
2489625229      <part name="cart" interface="megadriv_cart">
2489725230         <feature name="pcb_type" value="SEGA-SRAM" />
25231         <feature name="slot" value="rom_sram" />
2489825232         <dataarea name="rom" size="1048576">
2489925233            <rom name="world cup usa 94 (euro, usa, kor).bin" size="1048576" crc="0171b47f" sha1="af0e8fada3db7e746aef2c0070deb19602c6d32a" offset="000000" loadflag="load16_word_swap" />
2490025234         </dataarea>
r20695r20696
2518925523      <publisher>Sega</publisher>
2519025524      <part name="cart" interface="megadriv_cart">
2519125525         <feature name="pcb_type" value="SEGA-SRAM" />
25526         <feature name="slot" value="rom_sram" />
2519225527         <dataarea name="rom" size="3145728">
2519325528            <rom name="world series baseball '95 (usa).bin" size="3145728" crc="25130077" sha1="878e9fdbbc0b20b27f25d56e4087efbde1e8979a" offset="000000" loadflag="load16_word_swap" />
2519425529         </dataarea>
r20695r20696
2522525560      <publisher>Sega</publisher>
2522625561      <part name="cart" interface="megadriv_cart">
2522725562         <feature name="pcb_type" value="SEGA-SRAM" />
25563         <feature name="slot" value="rom_sram" />
2522825564         <dataarea name="rom" size="3145728">
2522925565            <rom name="world series baseball '95 (prototype - dec 28, 1994 - sb).bin" size="3145728" crc="9e6dbc7c" sha1="5cd3e9cff259cc8d1d6d43be4c1abc5a938f7979" offset="000000" loadflag="load16_word_swap" />
2523025566         </dataarea>
r20695r20696
2523925575      <publisher>Sega</publisher>
2524025576      <part name="cart" interface="megadriv_cart">
2524125577         <feature name="pcb_type" value="SEGA-SRAM" />
25578         <feature name="slot" value="rom_sram" />
2524225579         <dataarea name="rom" size="3145728">
2524325580            <rom name="world series baseball '95 (prototype - feb 02, 1995).bin" size="3145728" crc="a947fe5c" sha1="7049bfd6797a0b45cccc5241d748a76f68ca6257" offset="000000" loadflag="load16_word_swap" />
2524425581         </dataarea>
r20695r20696
2525325590      <publisher>Sega</publisher>
2525425591      <part name="cart" interface="megadriv_cart">
2525525592         <feature name="pcb_type" value="SEGA-SRAM" />
25593         <feature name="slot" value="rom_sram" />
2525625594         <dataarea name="rom" size="3145728">
2525725595            <rom name="world series baseball '95 (prototype - feb 03, 1995).bin" size="3145728" crc="1f3754fc" sha1="2d70804a21c93f8e1c2267404ee0d92905a4a50c" offset="000000" loadflag="load16_word_swap" />
2525825596         </dataarea>
r20695r20696
2526725605      <publisher>Sega</publisher>
2526825606      <part name="cart" interface="megadriv_cart">
2526925607         <feature name="pcb_type" value="SEGA-SRAM" />
25608         <feature name="slot" value="rom_sram" />
2527025609         <dataarea name="rom" size="3145728">
2527125610            <rom name="world series baseball '95 (prototype - feb 07, 1995).bin" size="3145728" crc="e4056559" sha1="9d729e57d6c137fb409646725933ff623f78863e" offset="000000" loadflag="load16_word_swap" />
2527225611         </dataarea>
r20695r20696
2528125620      <publisher>Sega</publisher>
2528225621      <part name="cart" interface="megadriv_cart">
2528325622         <feature name="pcb_type" value="SEGA-SRAM" />
25623         <feature name="slot" value="rom_sram" />
2528425624         <dataarea name="rom" size="3145728">
2528525625            <rom name="world series baseball '95 (prototype - feb 09, 1995 - b).bin" size="3145728" crc="33bb9eda" sha1="18ae5ad695dabfb9ddbe3dd66e2a0582eb5987c8" offset="000000" loadflag="load16_word_swap" />
2528625626         </dataarea>
r20695r20696
2529525635      <publisher>Sega</publisher>
2529625636      <part name="cart" interface="megadriv_cart">
2529725637         <feature name="pcb_type" value="SEGA-SRAM" />
25638         <feature name="slot" value="rom_sram" />
2529825639         <dataarea name="rom" size="3145728">
2529925640            <rom name="world series baseball '95 (prototype - feb 09, 1995).bin" size="3145728" crc="83be98cf" sha1="3c17b99184097e5f968b6f2fb2fc31d25c924971" offset="000000" loadflag="load16_word_swap" />
2530025641         </dataarea>
r20695r20696
2530925650      <publisher>Sega</publisher>
2531025651      <part name="cart" interface="megadriv_cart">
2531125652         <feature name="pcb_type" value="SEGA-SRAM" />
25653         <feature name="slot" value="rom_sram" />
2531225654         <dataarea name="rom" size="3145728">
2531325655            <rom name="world series baseball '95 (prototype - feb 11, 1995).bin" size="3145728" crc="a0664fe9" sha1="d6dbe744b0970a1e6e0d0c5d7d5c8ad6ece06c8a" offset="000000" loadflag="load16_word_swap" />
2531425656         </dataarea>
r20695r20696
2532325665      <publisher>Sega</publisher>
2532425666      <part name="cart" interface="megadriv_cart">
2532525667         <feature name="pcb_type" value="SEGA-SRAM" />
25668         <feature name="slot" value="rom_sram" />
2532625669         <dataarea name="rom" size="3145728">
2532725670            <rom name="world series baseball '95 (prototype - feb 12, 1995).bin" size="3145728" crc="45da8f18" sha1="dd1df8b0ee600d5bef5460cd8e036b66bfe39394" offset="000000" loadflag="load16_word_swap" />
2532825671         </dataarea>
r20695r20696
2533725680      <publisher>Sega</publisher>
2533825681      <part name="cart" interface="megadriv_cart">
2533925682         <feature name="pcb_type" value="SEGA-SRAM" />
25683         <feature name="slot" value="rom_sram" />
2534025684         <dataarea name="rom" size="3145728">
2534125685            <rom name="world series baseball '95 (prototype - feb 13, 1995).bin" size="3145728" crc="9f30ae30" sha1="c5e594842430b824e37993ee8902fd99a2d5086e" offset="000000" loadflag="load16_word_swap" />
2534225686         </dataarea>
r20695r20696
2535125695      <publisher>Sega</publisher>
2535225696      <part name="cart" interface="megadriv_cart">
2535325697         <feature name="pcb_type" value="SEGA-SRAM" />
25698         <feature name="slot" value="rom_sram" />
2535425699         <dataarea name="rom" size="3145728">
2535525700            <rom name="world series baseball '95 (prototype - feb 14, 1995).bin" size="3145728" crc="f300a857" sha1="6271037557f92943ac1a363b42f816b9fd8ca8cb" offset="000000" loadflag="load16_word_swap" />
2535625701         </dataarea>
r20695r20696
2536525710      <publisher>Sega</publisher>
2536625711      <part name="cart" interface="megadriv_cart">
2536725712         <feature name="pcb_type" value="SEGA-SRAM" />
25713         <feature name="slot" value="rom_sram" />
2536825714         <dataarea name="rom" size="3145728">
2536925715            <rom name="world series baseball '95 (prototype - jan 01, 1995 - tst).bin" size="3145728" crc="c7574372" sha1="b9d6cf1a3e342f0e7e0c36a47e92869a6c2bda6d" offset="000000" loadflag="load16_word_swap" />
2537025716         </dataarea>
r20695r20696
2537925725      <publisher>Sega</publisher>
2538025726      <part name="cart" interface="megadriv_cart">
2538125727         <feature name="pcb_type" value="SEGA-SRAM" />
25728         <feature name="slot" value="rom_sram" />
2538225729         <dataarea name="rom" size="3145728">
2538325730            <rom name="world series baseball '95 (prototype - jan 03, 1995 - tst).bin" size="3145728" crc="498363f7" sha1="1c97922c9632e99fda30465341fe39627611d538" offset="000000" loadflag="load16_word_swap" />
2538425731         </dataarea>
r20695r20696
2539325740      <publisher>Sega</publisher>
2539425741      <part name="cart" interface="megadriv_cart">
2539525742         <feature name="pcb_type" value="SEGA-SRAM" />
25743         <feature name="slot" value="rom_sram" />
2539625744         <dataarea name="rom" size="3145728">
2539725745            <rom name="world series baseball '95 (prototype - jan 05, 1995).bin" size="3145728" crc="1820abfb" sha1="956313af554f82ca10052c8c182493284c0567fd" offset="000000" loadflag="load16_word_swap" />
2539825746         </dataarea>
r20695r20696
2540725755      <publisher>Sega</publisher>
2540825756      <part name="cart" interface="megadriv_cart">
2540925757         <feature name="pcb_type" value="SEGA-SRAM" />
25758         <feature name="slot" value="rom_sram" />
2541025759         <dataarea name="rom" size="3145728">
2541125760            <rom name="world series baseball '95 (prototype - jan 09, 1995 - tst).bin" size="3145728" crc="3de7cdbc" sha1="fde563a0b84e6d6f39498964e237d500196a449a" offset="000000" loadflag="load16_word_swap" />
2541225761         </dataarea>
r20695r20696
2542125770      <publisher>Sega</publisher>
2542225771      <part name="cart" interface="megadriv_cart">
2542325772         <feature name="pcb_type" value="SEGA-SRAM" />
25773         <feature name="slot" value="rom_sram" />
2542425774         <dataarea name="rom" size="3145728">
2542525775            <rom name="world series baseball '95 (prototype - jan 10, 1995).bin" size="3145728" crc="ac2772b0" sha1="0fbc4f86ef7dcca024d9e62568288f8792850797" offset="000000" loadflag="load16_word_swap" />
2542625776         </dataarea>
r20695r20696
2544625796      <publisher>Sega</publisher>
2544725797      <part name="cart" interface="megadriv_cart">
2544825798         <feature name="pcb_type" value="SEGA-SRAM" />
25799         <feature name="slot" value="rom_sram" />
2544925800         <dataarea name="rom" size="3145728">
2545025801            <rom name="world series baseball '95 (prototype - jan 16, 1995).bin" size="3145728" crc="f0e22b21" sha1="d2428f24a615a3557c51cbcb750f381cd0db5c50" offset="000000" loadflag="load16_word_swap" />
2545125802         </dataarea>
r20695r20696
2547125822      <publisher>Sega</publisher>
2547225823      <part name="cart" interface="megadriv_cart">
2547325824         <feature name="pcb_type" value="SEGA-SRAM" />
25825         <feature name="slot" value="rom_sram" />
2547425826         <dataarea name="rom" size="3145728">
2547525827            <rom name="world series baseball '95 (prototype - jan 20, 1995).bin" size="3145728" crc="16c15e46" sha1="91e5d6a7c703d3b47886bc05100ab278b89e2ebd" offset="000000" loadflag="load16_word_swap" />
2547625828         </dataarea>
r20695r20696
2548525837      <publisher>Sega</publisher>
2548625838      <part name="cart" interface="megadriv_cart">
2548725839         <feature name="pcb_type" value="SEGA-SRAM" />
25840         <feature name="slot" value="rom_sram" />
2548825841         <dataarea name="rom" size="3145728">
2548925842            <rom name="world series baseball '95 (prototype - jan 25, 1995).bin" size="3145728" crc="b45d9e33" sha1="124fa734eee59420f98fc61e0368dbf1ea9ed255" offset="000000" loadflag="load16_word_swap" />
2549025843         </dataarea>
r20695r20696
2549925852      <publisher>Sega</publisher>
2550025853      <part name="cart" interface="megadriv_cart">
2550125854         <feature name="pcb_type" value="SEGA-SRAM" />
25855         <feature name="slot" value="rom_sram" />
2550225856         <dataarea name="rom" size="3145728">
2550325857            <rom name="world series baseball '95 (prototype - jan 30, 1995).bin" size="3145728" crc="6aa76a9d" sha1="eac7dc5656e27e4c95dfc8b04db85c1c4967b2d5" offset="000000" loadflag="load16_word_swap" />
2550425858         </dataarea>
r20695r20696
2551325867      <publisher>Sega</publisher>
2551425868      <part name="cart" interface="megadriv_cart">
2551525869         <feature name="pcb_type" value="SEGA-SRAM" />
25870         <feature name="slot" value="rom_sram" />
2551625871         <dataarea name="rom" size="3145728">
2551725872            <rom name="world series baseball '96 (usa).bin" size="3145728" crc="04ee8272" sha1="f91eeedbadd277904f821dfaae9e46f6078ff207" offset="000000" loadflag="load16_word_swap" />
2551825873         </dataarea>
r20695r20696
2552725882      <publisher>Sega</publisher>
2552825883      <part name="cart" interface="megadriv_cart">
2552925884         <feature name="pcb_type" value="SEGA-SRAM" />
25885         <feature name="slot" value="rom_sram" />
2553025886         <dataarea name="rom" size="3145728">
2553125887            <rom name="world series baseball '98 (usa).bin" size="3145728" crc="05b1ab53" sha1="0881077fd253d19d43ad45de6089d66e75d856b3" offset="000000" loadflag="load16_word_swap" />
2553225888         </dataarea>
r20695r20696
2554125897      <publisher>Sega</publisher>
2554225898      <part name="cart" interface="megadriv_cart">
2554325899         <feature name="pcb_type" value="SEGA-SRAM" />
25900         <feature name="slot" value="rom_sram" />
2554425901         <dataarea name="rom" size="2097152">
2554525902            <rom name="world series baseball (usa).bin" size="2097152" crc="57c1d5ec" sha1="e63cbd1f00eac2ccd2ee0290e7bf1bb47c1288e4" offset="000000" loadflag="load16_word_swap" />
2554625903         </dataarea>
r20695r20696
2556625923      <publisher>Sega</publisher>
2556725924      <part name="cart" interface="megadriv_cart">
2556825925         <feature name="pcb_type" value="SEGA-SRAM" />
25926         <feature name="slot" value="rom_sram" />
2556925927         <dataarea name="rom" size="2097152">
2557025928            <rom name="world series baseball (prototype - dec 26, 1993).bin" size="2097152" crc="472e6a58" sha1="763dcaf06befe2a95963f9d41393eacf151d5a97" offset="000000" loadflag="load16_word_swap" />
2557125929         </dataarea>
r20695r20696
2558025938      <publisher>Sega</publisher>
2558125939      <part name="cart" interface="megadriv_cart">
2558225940         <feature name="pcb_type" value="SEGA-SRAM" />
25941         <feature name="slot" value="rom_sram" />
2558325942         <dataarea name="rom" size="2097152">
2558425943            <rom name="world series baseball (prototype - dec 29, 1993).bin" size="2097152" crc="ed949936" sha1="fda84389295622191f29b9e0fc94673891fa782a" offset="000000" loadflag="load16_word_swap" />
2558525944         </dataarea>
r20695r20696
2559425953      <publisher>Sega</publisher>
2559525954      <part name="cart" interface="megadriv_cart">
2559625955         <feature name="pcb_type" value="SEGA-SRAM" />
25956         <feature name="slot" value="rom_sram" />
2559725957         <dataarea name="rom" size="2097152">
2559825958            <rom name="world series baseball (prototype - feb 18, 1994).bin" size="2097152" crc="3cadfc50" sha1="63af6038d8904d33ef3ab50820e6df84b44b7ada" offset="000000" loadflag="load16_word_swap" />
2559925959         </dataarea>
r20695r20696
2560825968      <publisher>Sega</publisher>
2560925969      <part name="cart" interface="megadriv_cart">
2561025970         <feature name="pcb_type" value="SEGA-SRAM" />
25971         <feature name="slot" value="rom_sram" />
2561125972         <dataarea name="rom" size="2097152">
2561225973            <rom name="world series baseball (prototype - jan 03, 1994).bin" size="2097152" crc="4b53f035" sha1="449092852822a842a607f40a5685ac73d94f4a93" offset="000000" loadflag="load16_word_swap" />
2561325974         </dataarea>
r20695r20696
2562225983      <publisher>Sega</publisher>
2562325984      <part name="cart" interface="megadriv_cart">
2562425985         <feature name="pcb_type" value="SEGA-SRAM" />
25986         <feature name="slot" value="rom_sram" />
2562525987         <dataarea name="rom" size="2097152">
2562625988            <rom name="world series baseball (prototype - jan 06, 1994).bin" size="2097152" crc="b07de2d3" sha1="4622f2a90007c923f87455a8fd6472b66c44f16c" offset="000000" loadflag="load16_word_swap" />
2562725989         </dataarea>
r20695r20696
2563625998      <publisher>Sega</publisher>
2563725999      <part name="cart" interface="megadriv_cart">
2563826000         <feature name="pcb_type" value="SEGA-SRAM" />
26001         <feature name="slot" value="rom_sram" />
2563926002         <dataarea name="rom" size="2097152">
2564026003            <rom name="world series baseball (prototype - jan 16, 1994).bin" size="2097152" crc="5322133e" sha1="d72d21e5295aaa2be1e14dba382c3cca25eec6ac" offset="000000" loadflag="load16_word_swap" />
2564126004         </dataarea>
r20695r20696
2566126024      <publisher>Sega</publisher>
2566226025      <part name="cart" interface="megadriv_cart">
2566326026         <feature name="pcb_type" value="SEGA-SRAM" />
26027         <feature name="slot" value="rom_sram" />
2566426028         <dataarea name="rom" size="2097152">
2566526029            <rom name="world series baseball (prototype - may 27, 1994).bin" size="2097152" crc="e473728a" sha1="ecbf253f2363a1ac5c3797eb80ffee08a8629ae8" offset="000000" loadflag="load16_word_swap" />
2566626030         </dataarea>
r20695r20696
2572326087      <info name="alt_title" value="レッスル ウォー"/>
2572426088      <part name="cart" interface="megadriv_cart">
2572526089         <feature name="pcb_type" value="SEGA-SRAM" />
26090         <feature name="slot" value="rom_sram" />
2572626091         <dataarea name="rom" size="524288">
2572726092            <rom name="wrestle war (jpn) (beta).bin" size="524288" crc="1cdee87b" sha1="65c4815c6271bb7d526d84dac1bf177741e35364" offset="000000" loadflag="load16_word_swap" />
2572826093         </dataarea>
r20695r20696
2573726102      <publisher>Ming</publisher>
2573826103      <part name="cart" interface="megadriv_cart">
2573926104         <feature name="pcb_type" value="SEGA-SRAM" />
26105         <feature name="slot" value="rom_sram" />
2574026106         <dataarea name="rom" size="2097152">
2574126107            <rom name="wu kong wai zhuan (chi) (unl).bin" size="2097152" crc="880a916e" sha1="dd4d7f7433ab82680d7d36124beca0bacebcd6e4" offset="000000" loadflag="load16_word_swap" />
2574226108         </dataarea>
r20695r20696
2611026476      <publisher>C&amp;E</publisher>
2611126477      <part name="cart" interface="megadriv_cart">
2611226478         <feature name="pcb_type" value="BEGGAR" />
26479         <feature name="slot" value="rom_beggar" />
2611326480         <dataarea name="rom" size="4194304">
2611426481            <rom name="xin qi gai wang zi (chi) (alt) (unl).bin" size="4194304" crc="da5a4bfe" sha1="75f8003a6388814c1880347882b244549da62158" offset="000000" loadflag="load16_word_swap" />
2611526482         </dataarea>
r20695r20696
2612226489      <publisher>C&amp;E</publisher>
2612326490      <part name="cart" interface="megadriv_cart">
2612426491         <feature name="pcb_type" value="BEGGAR" />
26492         <feature name="slot" value="rom_beggar" />
2612526493         <dataarea name="rom" size="4194304">
2612626494            <rom name="xin qi gai wang zi (chi) (unl).bin" size="4194304" crc="dd2f38b5" sha1="4a7494d8601149f43ba7e3595a0b2340cde2e9ba" offset="000000" loadflag="load16_word_swap" />
2612726495         </dataarea>
r20695r20696
2618026548      <publisher>Renovation</publisher>
2618126549      <part name="cart" interface="megadriv_cart">
2618226550         <feature name="pcb_type" value="SEGA-SRAM" />
26551         <feature name="slot" value="rom_sram" />
2618326552         <dataarea name="rom" size="1048576">
2618426553            <rom name="ys iii (usa).bin" size="1048576" crc="ea27976e" sha1="b3331b41a9a5e2c3f4fb3b64c5b005037a3b6fdd" offset="000000" loadflag="load16_word_swap" />
2618526554         </dataarea>
r20695r20696
2619726566      <info name="alt_title" value="ワンダラーズ フロム イース"/>
2619826567      <part name="cart" interface="megadriv_cart">
2619926568         <feature name="pcb_type" value="SEGA-SRAM" />
26569         <feature name="slot" value="rom_sram" />
2620026570         <dataarea name="rom" size="1048576">
2620126571            <rom name="ys - wanderers from ys (jpn).bin" size="1048576" crc="52da4e76" sha1="28dc01d5dde8d569bae3fafce2af55ee9b836454" offset="000000" loadflag="load16_word_swap" />
2620226572         </dataarea>
r20695r20696
2623926609      <info name="alt_title" value="幽☆遊☆白書 外伝"/>
2624026610      <part name="cart" interface="megadriv_cart">
2624126611         <feature name="pcb_type" value="SEGA-SRAM" />
26612         <feature name="slot" value="rom_sram" />
2624226613         <dataarea name="rom" size="2097152">
2624326614            <rom name="yuu yuu hakusho gaiden (jpn).bin" size="2097152" crc="7dc98176" sha1="274b86709b509852ca004ceaa244f3ae1d455c50" offset="000000" loadflag="load16_word_swap" />
2624426615         </dataarea>
r20695r20696
2625626627      <info name="alt_title" value="斬 夜叉円舞曲"/>
2625726628      <part name="cart" interface="megadriv_cart">
2625826629         <feature name="pcb_type" value="SEGA-SRAM" />
26630         <feature name="slot" value="rom_sram" />
2625926631         <dataarea name="rom" size="524288">
2626026632            <rom name="zan yasha enbukyoku (jpn).bin" size="524288" crc="637fe8f3" sha1="f1ea9a88233b76e3df32526be0b64fb653c13b7d" offset="000000" loadflag="load16_word_swap" />
2626126633         </dataarea>
r20695r20696
2648926861      <year>199?</year>
2649026862      <publisher>&lt;unlicensed&gt;</publisher>
2649126863      <part name="cart" interface="megadriv_cart">
26492         <feature name="pcb_type" value="12IN1" />
26493         <dataarea name="rom" size="20971520">
26864         <feature name="pcb_type" value="MC_12IN1" />
26865         <feature name="slot" value="rom_mcpir" />
26866         <dataarea name="rom" size="2097152">
2649426867            <rom name="12-in-1 (unl).bin" size="2097152" crc="a98bf454" sha1="7313c20071de0ab1cd84ac1352cb0ed1c4a4afa8" offset="00000" loadflag="load16_word_swap" />
2649526868         </dataarea>
2649626869      </part>
r20695r20696
2650126874      <year>199?</year>
2650226875      <publisher>&lt;unknown&gt;</publisher>
2650326876      <part name="cart" interface="megadriv_cart">
26504         <feature name="pcb_type" value="12IN1" />
26505         <dataarea name="rom" size="20971520">
26877         <feature name="pcb_type" value="MC_12IN1" />
26878         <feature name="slot" value="rom_mcpir" />
26879         <dataarea name="rom" size="2097152">
2650626880            <rom name="4-in-1 (pirate).bin" size="2097152" crc="be72857b" sha1="2aceca16f13d6a7a6a1bff8543d31bded179df3b" offset="00000" loadflag="load16_word_swap" />
2650726881         </dataarea>
2650826882      </part>
r20695r20696
2651426888      <publisher>&lt;unlicensed&gt;</publisher>
2651526889      <part name="cart" interface="megadriv_cart">
2651626890         <feature name="pcb_type" value="BUGSLIFE" />
26891         <feature name="slot" value="rom_bugs" />
2651726892         <dataarea name="rom" size="1048576">
2651826893            <rom name="bug's life, a (unl).bin" size="1048576" crc="10458e09" sha1="b620c2bebd5bab39bc9258a925169b4c93614599" offset="000000" loadflag="load16_word_swap" />
2651926894         </dataarea>
r20695r20696
2653726912      <publisher>&lt;unlicensed&gt;</publisher>
2653826913      <part name="cart" interface="megadriv_cart">
2653926914         <feature name="pcb_type" value="CHINFIGHT3" />
26540         <dataarea name="rom" size="20971520">
26915         <feature name="slot" value="rom_chinf3" />
26916         <dataarea name="rom" size="2097152">
2654126917            <rom name="chinese fighter iii (unl).bin" size="2097152" crc="e833bc6e" sha1="ecca9d2d21c8e27fc7584d53f557fdd8b4cbffa7" offset="000000" loadflag="load16_word_swap" />
2654226918         </dataarea>
2654326919      </part>
r20695r20696
2654926925      <publisher>Realtec</publisher>
2655026926      <part name="cart" interface="megadriv_cart">
2655126927         <feature name="pcb_type" value="REALTEC" />
26552         <dataarea name="rom" size="20971520">
26928         <feature name="slot" value="rom_realtec" />
26929         <dataarea name="rom" size="524288">
2655326930            <rom name="earth defense (usa) (unl).bin" size="524288" crc="3519c422" sha1="9bf4cda850495d7811df578592289018862df575" offset="00000" loadflag="load16_word_swap" />
2655426931         </dataarea>
2655526932      </part>
r20695r20696
2656126938      <publisher>Realtec</publisher>
2656226939      <part name="cart" interface="megadriv_cart">
2656326940         <feature name="pcb_type" value="REALTEC" />
26564         <dataarea name="rom" size="20971520">
26941         <feature name="slot" value="rom_realtec" />
26942         <dataarea name="rom" size="524288">
2656526943            <rom name="funny world &amp; balloon boy (usa) (unl).bin" size="524288" crc="a82f05f0" sha1="17481c8327433bfce8f7bae493fc044194e400a4" offset="00000" loadflag="load16_word_swap" />
2656626944         </dataarea>
2656726945      </part>
2656826946   </software>
2656926947
2657026948   <!-- // this contains only the first bank, so most of the games are missing -->
26571   <software name="golden10">
26572      <description>Golden 10 in 1</description>
26949   <software name="golden10" supported="partial">
26950      <description>Golden 10 in 1 (Incomplete Dump)</description>
2657326951      <year>199?</year>
2657426952      <publisher>&lt;unlicensed&gt;</publisher>
2657526953      <part name="cart" interface="megadriv_cart">
26576         <feature name="pcb_type" value="12IN1" />
26577         <dataarea name="rom" size="20971520">
26954         <feature name="pcb_type" value="MC_12IN1" />
26955         <feature name="slot" value="rom_mcpir" />
26956         <dataarea name="rom" size="1048576">
2657826957            <rom name="golden 10-in-1 (bad dump).bin" size="1048576" crc="4fa3f82b" sha1="04edbd35fe4916f61b516016b492352d96a8de7f" offset="00000" status="baddump" loadflag="load16_word_swap" />
2657926958         </dataarea>
2658026959      </part>
r20695r20696
2658626965      <publisher>&lt;unlicensed&gt;</publisher>
2658726966      <part name="cart" interface="megadriv_cart">
2658826967         <feature name="pcb_type" value="MULAN" />
26968         <feature name="slot" value="rom_mulan" />
2658926969         <dataarea name="rom" size="2097152">
2659026970            <rom name="hua mu lan - mulan (chi) (unl).bin" size="2097152" crc="796882b8" sha1="d8936c1023db646e1e20f9208b68271afbd6dbf4" offset="000000" loadflag="load16_word_swap" />
2659126971         </dataarea>
r20695r20696
2659826978      <publisher>&lt;unlicensed&gt;</publisher>
2659926979      <part name="cart" interface="megadriv_cart">
2660026980         <feature name="pcb_type" value="SMOUSE" />
26981         <feature name="slot" value="rom_smouse" />
2660126982         <dataarea name="rom" size="524288">
2660226983            <rom name="huan le tao qi shu - smart mouse (chi) (unl).bin" size="524288" crc="decdf740" sha1="df7a2527875317406b466175f0614d343dd32117" offset="000000" loadflag="load16_word_swap" />
2660326984         </dataarea>
r20695r20696
2661026991      <publisher>&lt;unlicensed&gt;</publisher>
2661126992      <part name="cart" interface="megadriv_cart">
2661226993         <feature name="pcb_type" value="KOF98" />
26994         <feature name="slot" value="rom_kof98" />
2661326995         <dataarea name="rom" size="2097152">
2661426996            <rom name="king of fighters '98, the (unl).bin" size="2097152" crc="cbc38eea" sha1="aeee33bfc2c440b6b861ac0d1b9bc9bface24861" offset="000000" loadflag="load16_word_swap" />
2661526997         </dataarea>
r20695r20696
2662227004      <publisher>&lt;unlicensed&gt;</publisher>
2662327005      <part name="cart" interface="megadriv_cart">
2662427006         <feature name="pcb_type" value="KOF99" />
27007         <feature name="slot" value="rom_kof99" />
2662527008         <dataarea name="rom" size="3145728">
2662627009            <rom name="the king of fighters 99 (unl).bin" size="3145728" crc="54638c11" sha1="cdef3008dec2ce1a214af8b9cb000053671a3c36" offset="000000" loadflag="load16_word_swap" />
2662727010         </dataarea>
r20695r20696
2663427017      <year>199?</year>
2663527018      <publisher>&lt;unlicensed&gt;</publisher>
2663627019      <part name="cart" interface="megadriv_cart">
27020         <feature name="pcb_type" value="KOF99" />
27021         <feature name="slot" value="rom_kof99" />
2663727022         <dataarea name="rom" size="3145728">
2663827023            <rom name="king of fighters 99 (unl).bin" size="3145728" crc="ab82afbe" sha1="3947f8b784eb00fba6a9fdd0584c9f70fdff5944" offset="000000" loadflag="load16_word_swap" />
2663927024         </dataarea>
r20695r20696
2664627031      <publisher>&lt;unlicensed&gt;</publisher>
2664727032      <part name="cart" interface="megadriv_cart">
2664827033         <feature name="pcb_type" value="ELFWOR" />
27034         <feature name="slot" value="rom_elfwor" />
2664927035         <dataarea name="rom" size="1048576">
2665027036            <rom name="elf wor (chi) (unl).bin" size="1048576" crc="e24ac6b2" sha1="5fc4591fbb1acc64e184466c7b6287c7f64e0b7a" offset="000000" loadflag="load16_word_swap" />
2665127037         </dataarea>
r20695r20696
2665827044      <publisher>&lt;unlicensed&gt;</publisher>
2665927045      <part name="cart" interface="megadriv_cart">
2666027046         <feature name="pcb_type" value="LIONK2" />
27047         <feature name="slot" value="rom_lion2" />
2666127048         <dataarea name="rom" size="2097152">
2666227049            <rom name="shi zi wang ii - the lion king ii, the (chi) (unl).bin" size="2097152" crc="aff46765" sha1="5649fa1fbfb28d58b0608e8ebc5dc7bd5c4c9678" offset="000000" loadflag="load16_word_swap" />
2666327050         </dataarea>
r20695r20696
2667127058      <info name="alt_title" value="Shi Zi Wang 3 - The Lion King 3 (Box?)"/>
2667227059      <part name="cart" interface="megadriv_cart">
2667327060         <feature name="pcb_type" value="LIONK3" />
26674         <dataarea name="rom" size="20971520">
27061         <feature name="slot" value="rom_lion3" />
27062         <dataarea name="rom" size="4194304">
2667527063            <rom name="shi zi wang 3 - the lion king 3 (chi) (unl).bin" size="2097152" crc="c004219d" sha1="54ffd355b0805741f58329fa38ed3d9f8f7c80ca" offset="00000" loadflag="load16_word_swap" />
27064            <rom size="2097152" offset="0x200000" loadflag="reload" />
2667627065         </dataarea>
2667727066      </part>
2667827067   </software>
r20695r20696
2668327072      <publisher>&lt;unlicensed&gt;</publisher>
2668427073      <part name="cart" interface="megadriv_cart">
2668527074         <feature name="pcb_type" value="MJLOVER" />
27075         <feature name="slot" value="rom_mjlov" />
2668627076         <dataarea name="rom" size="1048576">
2668727077            <rom name="ma jiang qing ren - ji ma jiang zhi (chi) (unl).bin" size="1048576" crc="ddd02ba4" sha1="fe9ec21bd206ad1a178c54a2fee80b553c478fc4" offset="000000" loadflag="load16_word_swap" />
2668827078         </dataarea>
r20695r20696
2669527085      <publisher>&lt;unlicensed&gt;</publisher>
2669627086      <part name="cart" interface="megadriv_cart">
2669727087         <feature name="pcb_type" value="MJLOVER" />
27088         <feature name="slot" value="rom_mjlov" />
2669827089         <dataarea name="rom" size="1048576">
2669927090            <rom name="mahjong lover (unl).bin" size="1048576" crc="f6c2cff2" sha1="80d0635083351f62e708538d4b31278d07170a73" offset="000000" loadflag="load16_word_swap" />
2670027091         </dataarea>
r20695r20696
2670727098      <publisher>&lt;unlicensed&gt;</publisher>
2670827099      <part name="cart" interface="megadriv_cart">
2670927100         <feature name="pcb_type" value="KAIJU" />
26710         <dataarea name="rom" size="20971520">
27101         <feature name="slot" value="rom_pokestad" />
27102         <dataarea name="rom" size="2097152">
2671127103            <rom name="pokemon stadium (unl).bin" size="2097152" crc="fe187c5d" sha1="f65af5d86aba33bd3f4f91a0cd7428778bcceedf" offset="00000" loadflag="load16_word_swap" />
2671227104         </dataarea>
2671327105      </part>
r20695r20696
2671927111      <publisher>&lt;unlicensed&gt;</publisher>
2672027112      <part name="cart" interface="megadriv_cart">
2672127113         <feature name="pcb_type" value="ROCKMANX3" />
27114         <feature name="slot" value="rom_rx3" />
2672227115         <dataarea name="rom" size="2097152">
2672327116            <rom name="rockman x3 (unl).bin" size="2097152" crc="3ee639f0" sha1="37024d0088fab1d76c082014663c58921cdf33df" offset="000000" loadflag="load16_word_swap" />
2672427117         </dataarea>
r20695r20696
2673127124      <publisher>&lt;unlicensed&gt;</publisher>
2673227125      <part name="cart" interface="megadriv_cart">
2673327126         <feature name="pcb_type" value="SOULBLAD" />
27127         <feature name="slot" value="rom_soulb" />
2673427128         <dataarea name="rom" size="4194304">
2673527129            <rom name="soul blade (unl).bin" size="4194304" crc="f26f88d1" sha1="7714e01819ab4a0f424d7e306e9f891031d053a8" offset="000000" loadflag="load16_word_swap" />
2673627130         </dataarea>
r20695r20696
2674227136      <year>199?</year>
2674327137      <publisher>&lt;unlicensed&gt;</publisher>
2674427138      <part name="cart" interface="megadriv_cart">
26745         <feature name="pcb_type" value="SOULBLAD" />
2674627139         <dataarea name="rom" size="3145728">
2674727140            <rom name="soul blade (unl)[p].bin" size="3145728" crc="dd1c7a79" sha1="4bb00b8b42fb50e8d3be092516370fdf1bfc49e1" offset="000000" loadflag="load16_word_swap" />
2674827141         </dataarea>
r20695r20696
2675527148      <publisher>&lt;unlicensed&gt;</publisher>
2675627149      <part name="cart" interface="megadriv_cart">
2675727150         <feature name="pcb_type" value="SQUIRRELK" />
27151         <feature name="slot" value="rom_squir" />
2675827152         <dataarea name="rom" size="1048576">
2675927153            <rom name="squirrel king (chi) (unl).bin" size="1048576" crc="b8261ff5" sha1="2a561b6e47c93272fe5947084837d9f6f514ed38" offset="000000" loadflag="load16_word_swap" />
2676027154         </dataarea>
r20695r20696
2676727161      <publisher>&lt;unknown&gt;</publisher>
2676827162      <part name="cart" interface="megadriv_cart">
2676927163         <feature name="pcb_type" value="MC_SUP15IN1" />
26770         <dataarea name="rom" size="20971520">
27164         <feature name="slot" value="rom_mcpir" />
27165         <dataarea name="rom" size="2097152">
2677127166            <rom name="super 15-in-1 (pirate).bin" size="2097152" crc="6d17dfff" sha1="6b2a6de2622735f6d56c6c9c01f74daa90e355cb" offset="00000" loadflag="load16_word_swap" />
2677227167         </dataarea>
2677327168      </part>
r20695r20696
2677927174      <publisher>&lt;unknown&gt;</publisher>
2678027175      <part name="cart" interface="megadriv_cart">
2678127176         <feature name="pcb_type" value="MC_SUP19IN1" />
26782         <dataarea name="rom" size="20971520">
27177         <feature name="slot" value="rom_mcpir" />
27178         <dataarea name="rom" size="4194304">
2678327179            <rom name="super 19-in-1 (pirate).bin" size="4194304" crc="0ad2b342" sha1="e1c041ba69da087c428dcda16850159f3caebd4b" offset="00000" loadflag="load16_word_swap" />
2678427180         </dataarea>
2678527181      </part>
r20695r20696
2679127187      <publisher>&lt;unlicensed&gt;</publisher>
2679227188      <part name="cart" interface="megadriv_cart">
2679327189         <feature name="pcb_type" value="SBUBBOB" />
27190         <feature name="slot" value="rom_sbubl" />
2679427191         <dataarea name="rom" size="1048576">
2679527192            <rom name="super bubble bobble (chi) (unl).bin" size="1048576" crc="4820a161" sha1="03f40c14624f1522d6e3105997d14e8eaba12257" offset="000000" loadflag="load16_word_swap" />
2679627193         </dataarea>
r20695r20696
2680327200      <publisher>&lt;unlicensed&gt;</publisher>
2680427201      <part name="cart" interface="megadriv_cart">
2680527202         <feature name="pcb_type" value="SDK99" />
26806         <dataarea name="rom" size="20971520">
27203         <feature name="slot" value="rom_lion3" />
27204         <dataarea name="rom" size="4194304">
2680727205            <rom name="super donkey kong 99 (unl) (protected).bin" size="3145728" crc="43be4dd5" sha1="5d3c84bd18f821b20212941a6f7a1a272eb0d7e3" offset="00000" loadflag="load16_word_swap" />
27206            <rom size="1048576" offset="0x300000" loadflag="reload" />
2680827207         </dataarea>
2680927208      </part>
2681027209   </software>
r20695r20696
2681527214      <publisher>&lt;unlicensed&gt;</publisher>
2681627215      <part name="cart" interface="megadriv_cart">
2681727216         <feature name="pcb_type" value="SKINGKONG" />
26818         <dataarea name="rom" size="20971520">
27217         <feature name="slot" value="rom_lion3" />
27218         <dataarea name="rom" size="4194304">
2681927219            <rom name="super king kong 99 (unl).bin" size="2097152" crc="413dfee2" sha1="6973598d77a755beafff31ce85595f9610f8afa5" offset="00000" loadflag="load16_word_swap" />
27220            <rom size="2097152" offset="0x200000" loadflag="reload" />
2682027221         </dataarea>
2682127222      </part>
2682227223   </software>
r20695r20696
2682727228      <publisher>&lt;unlicensed&gt;</publisher>
2682827229      <part name="cart" interface="megadriv_cart">
2682927230         <feature name="pcb_type" value="SMB2" />
27231         <feature name="slot" value="rom_smb2" />
2683027232         <dataarea name="rom" size="2097152">
2683127233            <rom name="super mario 2 1998 (unl).bin" size="2097152" crc="f7e1b3e1" sha1="de10115ce6a7eb416de9cd167df9cf24e34687b1" offset="000000" loadflag="load16_word_swap" />
2683227234         </dataarea>
r20695r20696
2683927241      <publisher>&lt;unlicensed&gt;</publisher>
2684027242      <part name="cart" interface="megadriv_cart">
2684127243         <feature name="pcb_type" value="SMB" />
27244         <feature name="slot" value="rom_smb" />
2684227245         <dataarea name="rom" size="2097152">
2684327246            <rom name="super mario bros. (unl).bin" size="2097152" crc="9cfa2bd8" sha1="5011e16f0ab3a6487a1406b85c6090ad2d1fe345" offset="000000" loadflag="load16_word_swap" />
2684427247         </dataarea>
r20695r20696
2685127254      <publisher>&lt;unlicensed&gt;</publisher>
2685227255      <part name="cart" interface="megadriv_cart">
2685327256         <feature name="pcb_type" value="REDCLIFF" />
26854         <dataarea name="rom" size="20971520">
27257         <feature name="slot" value="rom_redcl" />
27258         <dataarea name="rom" size="2097158">
2685527259            <rom name="the battle of red cliffs - romance of the three kingdoms (unl).bin" size="2097157" crc="44463492" sha1="244334583fde808a56059c0b0eef77742c18274d" offset="00000" loadflag="load16_word_swap" />
2685627260         </dataarea>
2685727261      </part>
r20695r20696
2687427278      <publisher>&lt;unlicensed&gt;</publisher>
2687527279      <part name="cart" interface="megadriv_cart">
2687627280         <feature name="pcb_type" value="TOPFIGHTER" />
26877         <dataarea name="rom" size="20971520">
27281         <feature name="slot" value="rom_topf" />
27282         <dataarea name="rom" size="2097152">
2687827283            <rom name="top fighter 2000 mk viii (unl).bin" size="2097152" crc="f75519dc" sha1="617be8de1444ae0c6610d73967f3f0e67541b05a" offset="00000" loadflag="load16_word_swap" />
2687927284         </dataarea>
2688027285      </part>
r20695r20696
2688527290      <year>199?</year>
2688627291      <publisher>&lt;unlicensed&gt;</publisher>
2688727292      <part name="cart" interface="megadriv_cart">
26888         <feature name="pcb_type" value="TOPFIGHTER" />
26889         <dataarea name="rom" size="20971520">
27293         <dataarea name="rom" size="2097152">
2689027294            <rom name="top fighter 2005 (unl).bin" size="2097152" crc="174defe6" sha1="e2b8ee109d2302778f7a77563045613b0636d470" offset="00000" loadflag="load16_word_swap" />
2689127295         </dataarea>
2689227296      </part>
2689327297   </software>
2689427298
26895   <software name="whacacri">
27299   <software name="whacacri" supported="partial">
2689627300      <description>Whac-a-Critter (USA)</description>
2689727301      <year>1993</year>
2689827302      <publisher>Realtec</publisher>
2689927303      <part name="cart" interface="megadriv_cart">
2690027304         <feature name="pcb_type" value="REALTEC" />
26901         <dataarea name="rom" size="20971520">
27305         <feature name="slot" value="rom_realtec" />
27306         <dataarea name="rom" size="524288">
2690227307            <rom name="whac-a-critter (usa) (unl).bin" size="524288" crc="1bdd02b8" sha1="4b45801b112a641fee936e41a31728ee7aa2f834" offset="00000" loadflag="load16_word_swap" />
2690327308         </dataarea>
2690427309      </part>
r20695r20696
2691027315      <publisher>Radica Games ~ Sega</publisher>
2691127316      <part name="cart" interface="megadriv_cart">
2691227317         <feature name="pcb_type" value="RADICA" />
27318         <feature name="slot" value="rom_radica" />
2691327319         <dataarea name="rom" size="4194304">
2691427320            <rom name="radicav1.bin" size="4194304" crc="3b4c8438" sha1="5ed9c053f9ebc8d4bf571d57e562cf347585d158" offset="000000" />
2691527321         </dataarea>
r20695r20696
2692227328      <publisher>Radica Games ~ Capcom</publisher>
2692327329      <part name="cart" interface="megadriv_cart">
2692427330         <feature name="pcb_type" value="RADICA" />
27331         <feature name="slot" value="rom_radica" />
2692527332         <dataarea name="rom" size="4194304">
2692627333            <rom name="radicasf.bin" size="4194304" crc="868afb44" sha1="f4339e36272c18b1d49aa4095127ed18e0961df6" offset="000000" />
2692727334         </dataarea>
r20695r20696
2693127338<!-- Are these unprotected versions legit? or were they hacked to work with emus? -->
2693227339
2693327340   <software name="chinf3a" cloneof="chinf3">
26934      <description>Chinese Fighter III (Chi, Alt)</description>
27341      <description>Chinese Fighter III (Chi, Unprotected?)</description>
2693527342      <year>199?</year>
2693627343      <publisher>&lt;unlicensed&gt;</publisher>
2693727344      <part name="cart" interface="megadriv_cart">
r20695r20696
2694227349   </software>
2694327350
2694427351   <software name="kof98a" cloneof="kof98">
26945      <description>The King of Fighters '98 (Pirate)</description>
27352      <description>K.O.F 98' (Unprotected?)</description>
2694627353      <year>199?</year>
2694727354      <publisher>&lt;unlicensed&gt;</publisher>
2694827355      <part name="cart" interface="megadriv_cart">
r20695r20696
2704027447      <publisher>&lt;unknown&gt;</publisher>
2704127448      <part name="cart" interface="megadriv_cart">
2704227449         <feature name="pcb_type" value="SEGA-SRAM" />
27450         <feature name="slot" value="rom_sram" />
2704327451         <dataarea name="rom" size="2097152">
2704427452            <rom name="duke_nukem_3d.bin" size="2097152" crc="13e93c0d" sha1="14ce7438a379973c8d66b0cc365d05a04d94f7dd" offset="000000" loadflag="load16_word_swap" />
2704527453         </dataarea>
r20695r20696
2706627474      <info name="alt_title" value="Shi Zi Wang 3 - The Lion King 3 (Box?)"/>
2706727475      <part name="cart" interface="megadriv_cart">
2706827476         <feature name="pcb_type" value="LIONK3" />
27069         <dataarea name="rom" size="20971520">
27477         <feature name="slot" value="rom_lion3" />
27478         <dataarea name="rom" size="4194304">
2707027479            <rom name="lion_king_3.bin" size="2097152" crc="87e86943" sha1="0ef55dc45536963c8748192a4cb4864a87b03102" offset="000000" loadflag="load16_word_swap" />
27480            <rom size="2097152" offset="0x200000" loadflag="reload" />
2707127481         </dataarea>
2707227482      </part>
2707327483   </software>
r20695r20696
2707827488      <publisher>&lt;unlicensed&gt;</publisher>
2707927489      <info name="alt_title" value="Shi Zi Wang 3 - The Lion King 3 (Box?)"/>
2708027490      <part name="cart" interface="megadriv_cart">
27081         <dataarea name="rom" size="20971520">
27491         <dataarea name="rom" size="2097152">
2708227492            <rom name="lion king 3 (unl).bin" size="2097152" crc="8e0555e4" sha1="dc34164d74d9b6542adef6838250793d023cd942" offset="00000" loadflag="load16_word_swap" />
2708327493         </dataarea>
2708427494      </part>
r20695r20696
2815728567      <sharedfeat name="compatibility" value="PAL" />
2815828568      <sharedfeat name="addon" value="SVP" />
2815928569      <part name="cart" interface="megadriv_cart">
28570         <feature name="slot" value="rom_svp" />
2816028571         <dataarea name="rom" size="2097152">
2816128572            <rom name="mpr-16420.bin" size="2097152" crc="9624d4ef" sha1="2c3812f8a010571e51269a33a989598787d27c2d" offset="000000" loadflag="load16_word_swap" />
2816228573         </dataarea>
r20695r20696
2817428585      <sharedfeat name="compatibility" value="EUR-JPN" />
2817528586      <sharedfeat name="addon" value="SVP" />
2817628587      <part name="cart" interface="megadriv_cart">
28588         <feature name="slot" value="rom_svp" />
2817728589         <dataarea name="rom" size="2097152">
2817828590            <rom name="mpr-16389.bin" size="2097152" crc="53a293b5" sha1="0ad38a3ab1cc99edac72184f8ae420e13df5cac6" offset="000000" loadflag="load16_word_swap" />
2817928591         </dataarea>
r20695r20696
2818828600      <sharedfeat name="compatibility" value="NTSC-U" />
2818928601      <sharedfeat name="addon" value="SVP" />
2819028602      <part name="cart" interface="megadriv_cart">
28603         <feature name="slot" value="rom_svp" />
2819128604         <dataarea name="rom" size="2097152">
2819228605            <rom name="virtua racing (usa).bin" size="2097152" crc="7e1a324a" sha1="ff969ae53120cc4e7cb1a8a7e47458f2eb8a2165" offset="000000" loadflag="load16_word_swap" />
2819328606         </dataarea>
trunk/src/mame/mame.mak
r20695r20696
12571257   $(MACHINE)/megacd.o \
12581258   $(MACHINE)/megacdcd.o \
12591259   $(MACHINE)/mega32x.o \
1260   $(MACHINE)/megasvp.o \
12611260   $(MACHINE)/megavdp.o \
1262   $(MACHINE)/md_cart.o \
12631261   $(DRIVERS)/megadrvb.o \
12641262   $(DRIVERS)/megaplay.o \
12651263   $(DRIVERS)/megatech.o \
trunk/src/mame/includes/megadriv.h
r20695r20696
2323#define MASTER_CLOCK_PAL  53203424
2424#define SEGACD_CLOCK      12500000
2525
26#define MD_CPU_REGION_SIZE 0x800000
2627
27#define MAX_MD_CART_SIZE 0x800000
28
29/* where a fresh copy of rom is stashed for reset and banking setup */
30#define VIRGIN_COPY_GEN 0xd00000
31
32#define MD_CPU_REGION_SIZE (MAX_MD_CART_SIZE + VIRGIN_COPY_GEN)
33
3428extern int sega_cd_connected;
3529
3630
r20695r20696
4135INPUT_PORTS_EXTERN( megadri6 );
4236INPUT_PORTS_EXTERN( ssf2mdb );
4337INPUT_PORTS_EXTERN( mk3mdb );
44INPUT_PORTS_EXTERN( megdsvp );
4538
4639MACHINE_CONFIG_EXTERN( megadriv_timers );
4740MACHINE_CONFIG_EXTERN( md_ntsc );
4841MACHINE_CONFIG_EXTERN( md_pal );
4942MACHINE_CONFIG_EXTERN( md_svp );
5043
51MACHINE_CONFIG_EXTERN( megdsvppal );
52MACHINE_CONFIG_EXTERN( megadriv );
53MACHINE_CONFIG_EXTERN( megadpal );
54MACHINE_CONFIG_EXTERN( megdsvp );
5544MACHINE_CONFIG_EXTERN( genesis_32x );
5645MACHINE_CONFIG_EXTERN( genesis_32x_pal );
5746MACHINE_CONFIG_EXTERN( genesis_scd );
r20695r20696
6150MACHINE_CONFIG_EXTERN( genesis_32x_scd );
6251MACHINE_CONFIG_EXTERN( md_bootleg );    // for topshoot.c & hshavoc.c
6352
64extern UINT16* megadriv_backupram;
65extern int megadriv_backupram_length;
53extern cpu_device *_svp_cpu;
6654
6755extern UINT8 megatech_bios_port_cc_dc_r(running_machine &machine, int offset, int ctrl);
6856extern void megadriv_stop_scanline_timer(running_machine &machine);
r20695r20696
384372   int ssf2_lastoff, ssf2_lastdata;
385373};
386374
387class md_cons_state : public md_base_state
375class md_havoc_state : public md_base_state
388376{
389377public:
390   md_cons_state(const machine_config &mconfig, device_type type, const char *tag)
378   md_havoc_state(const machine_config &mconfig, device_type type, const char *tag)
391379   : md_base_state(mconfig, type, tag) { }
392380
393   emu_timer *m_mess_io_timeout[3];
394   int m_mess_io_stage[3];
395   UINT8 m_jcart_io_data[2];
396
397   megadriv_cart m_md_cart;
398
399381   DECLARE_DRIVER_INIT(hshavoc);
400   DECLARE_DRIVER_INIT(topshoot);
401
402   DECLARE_DRIVER_INIT(genesis);
403   DECLARE_DRIVER_INIT(mess_md_common);
404   DECLARE_DRIVER_INIT(md_eur);
405   DECLARE_DRIVER_INIT(md_jpn);
406
407382};
408383
409384
410class mdsvp_state : public md_cons_state
411{
412public:
413   mdsvp_state(const machine_config &mconfig, device_type type, const char *tag)
414   : md_cons_state(mconfig, type, tag) { }
415
416   UINT8 *m_iram; // IRAM (0-0x7ff)
417   UINT8 *m_dram; // [0x20000];
418   UINT32 m_pmac_read[6];  // read modes/addrs for PM0-PM5
419   UINT32 m_pmac_write[6]; // write ...
420   PAIR m_pmc;
421   UINT32 m_emu_status;
422   UINT16 m_XST;       // external status, mapped at a15000 and a15002 on 68k side.
423   UINT16 m_XST2;      // status of XST (bit1 set when 68k writes to XST)
424};
425
426ADDRESS_MAP_EXTERN( svp_ssp_map, driver_device );
427ADDRESS_MAP_EXTERN( svp_ext_map, driver_device );
428extern void svp_init(running_machine &machine);
429extern cpu_device *_svp_cpu;
430
431
432
433385UINT8 megadrive_io_read_data_port_3button(running_machine &machine, int portnum);
434386
435387class _32x_state : public md_base_state
r20695r20696
459411      { }
460412};
461413
462
463/*----------- defined in machine/md_cart.c -----------*/
464
465MACHINE_CONFIG_EXTERN( genesis_cartslot );
466414MACHINE_CONFIG_EXTERN( _32x_cartslot );
467MACHINE_CONFIG_EXTERN( pico_cartslot );
468MACHINE_START( md_sram );
469415
416
470417/*----------- defined in drivers/megadriv.c -----------*/
471418
472419/* These are needed to handle J-Cart inputs */
trunk/src/mame/drivers/megatech.c
r20695r20696
599599   {
600600      if (!mame_stricmp("genesis", pcb_name))
601601      {
602         printf("%s is genesis\n", mt_cart->tag);
602         mame_printf_debug("%s is genesis\n", mt_cart->tag);
603603         state->m_cart_is_genesis[this_cart->slot] = 1;
604604      }
605605      else if (!mame_stricmp("sms", pcb_name))
606606      {
607         printf("%s is sms\n", mt_cart->tag);
607         mame_printf_debug("%s is sms\n", mt_cart->tag);
608608         state->m_cart_is_genesis[this_cart->slot] = 0;
609609      }
610610      else
611611      {
612         printf("%s is invalid\n", mt_cart->tag);
612         mame_printf_debug("%s is invalid\n", mt_cart->tag);
613613      }
614614
615615   }
trunk/src/mame/drivers/hshavoc.c
r20695r20696
115115
116116#endif
117117
118DRIVER_INIT_MEMBER(md_cons_state,hshavoc)
118DRIVER_INIT_MEMBER(md_havoc_state,hshavoc)
119119{
120120   int x;
121121   UINT16 *src = (UINT16 *)machine().root_device().memregion("maincpu")->base();
r20695r20696
227227
228228
229229
230GAME( 1993, hshavoc,   0,        md_bootleg, hshavoc, md_cons_state, hshavoc, ROT0, "Data East",                  "High Seas Havoc",GAME_NOT_WORKING )
231//GAME( 1993, hshavoc2,  hshavoc,  md_bootleg, hshavoc, md_cons_state, genesis, ROT0, "Data East",                  "High Seas Havoc (Genesis ROM)",GAME_NOT_WORKING )
230GAME( 1993, hshavoc,   0,        md_bootleg, hshavoc, md_havoc_state, hshavoc, ROT0, "Data East",                  "High Seas Havoc",GAME_NOT_WORKING )
231//GAME( 1993, hshavoc2,  hshavoc,  md_bootleg, hshavoc, md_havoc_state, genesis, ROT0, "Data East",                  "High Seas Havoc (Genesis ROM)",GAME_NOT_WORKING )
trunk/src/mame/drivers/megadrvb.c
r20695r20696
763763   DRIVER_INIT_CALL(megadriv);
764764}
765765
766DRIVER_INIT_MEMBER(md_cons_state,topshoot)
766DRIVER_INIT_MEMBER(md_boot_state,topshoot)
767767{
768768   machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x200050, 0x200051, FUNC(topshoot_200051_r) );
769769   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x200042, 0x200043, "IN0");
r20695r20696
785785GAME( 1996, mk3mdb,   0, megadrvb,   mk3mdb, md_boot_state,   mk3mdb,   ROT0, "bootleg / Midway", "Mortal Kombat 3 (bootleg of Megadrive version)", 0)
786786GAME( 1994, ssf2mdb,  0, megadrvb,   ssf2mdb, md_boot_state,  ssf2mdb,  ROT0, "bootleg / Capcom", "Super Street Fighter II - The New Challengers (bootleg of Japanese MegaDrive version)", 0)
787787GAME( 1993, srmdb,    0, megadrvb,   srmdb, md_boot_state,    srmdb,    ROT0, "bootleg / Konami", "Sunset Riders (bootleg of Megadrive version)", 0)
788GAME( 1995, topshoot, 0, md_bootleg, topshoot, md_cons_state, topshoot, ROT0, "Sun Mixing",       "Top Shooter", 0)
788GAME( 1995, topshoot, 0, md_bootleg, topshoot, md_boot_state, topshoot, ROT0, "Sun Mixing",       "Top Shooter", 0)
trunk/src/mame/machine/md_cart.c
r20695r20696
1/***************************************************************************
2
3  megadriv.c
4
5  Machine file to handle emulation of the Sega Mega Drive & Genesis in MESS.
6
7    i2c games mapping table:
8
9    game name                         |   SDA_IN   |  SDA_OUT   |     SCL    |  SIZE_MASK     | PAGE_MASK |
10    ----------------------------------|------------|------------|------------|----------------|-----------|
11    NBA Jam                           | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x00ff (24C02) |   0x03    | xx
12    NBA Jam TE                        | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) |   0x03    | xx
13    NBA Jam TE (32x)                  | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) |   0x03    |
14    NFL Quarterback Club              | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) |   0x03    | xx
15    NFL Quarterback Club 96           | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x07ff (24C16) |   0x07    | xx
16    College Slam                      | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) |   0x07    | xx
17    Frank Thomas Big Hurt Baseball    | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) |   0x07    | xx
18    NHLPA Hockey 93                   | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) |   0x03    | xx
19    Rings of Power                    | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) |   0x03    | xx
20    Evander Holyfield's Boxing        | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
21    Greatest Heavyweights of the Ring | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
22    Wonder Boy V                      | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
23    Sports Talk Baseball              | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
24    Megaman - the Wily Wars           | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx **
25    Micro Machines 2                  | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) |   0x0f    |
26    Micro Machines Military           | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) |   0x0f    |
27    Micro Machines 96                 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x07ff (24C16) |   0x0f    |
28    Brian Lara Cricket 96             | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x1fff (24C64) |   0x??*   |
29    ----------------------------------|------------|------------|------------|----------------|-----------|
30
31    * Notes: check these
32    ** original Rockman Mega World (J) set uses normal backup RAM
33
34    2008-09: Moved here cart code and custom mapper handlers. Hopefully,
35        it will make painless the future merging with HazeMD
36    2008-10: Fixed SRAM, matching as much as possible HazeMD. Some game is
37        not detected, however. E.g. Sonic 3. Also some games seem false
38        positives (e.g. Wonderboy 5: according to its headers it should
39        have 1byte of SRAM). Better detection routines would be welcome.
40    2009-06: Changed SRAM code, fixing more games, including Sonic 3. The
41        false positives seem only some of the games using EEPROM. Todo
42        list in mess/drivers/genesis.c includes EEPROM emulation.
43
44***************************************************************************/
45
46
47#include "emu.h"
48#include "formats/imageutl.h"
49#include "cpu/m68000/m68000.h"
50
51#include "imagedev/cartslot.h"
52#include "includes/megadriv.h"
53
54
55/* PCB */
56enum
57{
58   SEGA_STD = 0,
59
60   SEGA_SRAM, SEGA_FRAM,
61
62   CM_JCART, CM_JCART_SEPROM,   /* Codemasters PCB (J-Carts and SEPROM) */
63
64   SSF2,                        /* Super Street Fighter 2 */
65   GAME_KANDUME,                /* Game no Kandume Otokuyou */
66   BEGGAR,                      /* Xin Qigai Wangzi uses different sram start address and has no valid header */
67
68   // EEPROM
69   SEGA_EEPROM,                 /* Wonder Boy V / Evander Holyfield's Boxing / Greatest Heavyweights of the Ring / Sports Talk Baseball / Megaman */
70   NBA_JAM,                     /* NBA Jam */
71   NBA_JAM_TE,                  /* NBA Jam TE / NFL Quarterback Club */
72   NFL_QB_96,                   /* NFL Quarterback Club '96 */
73   C_SLAM,                      /* College Slam / Frank Thomas Big Hurt Baseball */
74   EA_NHLPA,                    /* NHLPA Hockey 93 / Rings of Power */
75   CODE_MASTERS,                /* Micro Machines 2 / Military / 96 / Brian Lara Cricket 96 */
76
77   MC_SUP19IN1,                 /* Super 19 in 1 */
78   MC_SUP15IN1,                 /* Super 15 in 1 */
79   MC_12IN1,                    /* 12 in 1 and a few more multicarts */
80   BUGSLIFE,                    /* A Bug's Life */
81   CHINFIGHT3,                  /* Chinese Fighters 3 */
82   ELFWOR,                      /* Linghuan Daoshi Super Magician */
83   KOF98,                       /* King of Fighters '98 */
84   KOF99,                       /* King of Fighters '99 */
85   LIONK2,                      /* Lion King 2 */
86   LIONK3,                      /* Lion King 3 */
87   SKINGKONG,                   /* Super King Kong 99 */
88   SDK99,                       /* Super Donkey Kong 99 */
89   MJLOVER,                     /* Mahjong Lover */
90   MULAN,                       /* Hua Mu Lan - Mulan */
91   POKEMON,                     /* Pocket Monster */
92   POKEMON2,                    /* Pocket Monster 2 */
93   KAIJU,                       /* Pokemon Stadium */
94   RADICA,                      /* Radica TV games.. these probably should be a separate driver since they are a separate 'console' */
95   REALTEC,                     /* Whac a Critter/Mallet legend, Defend the Earth, Funnyworld/Ballonboy */
96   REDCLIFF,                    /* Romance of the Three Kingdoms - Battle of Red Cliffs, already decoded from .mdx format */
97   REDCL_EN,                    /* The encoded version... */
98   ROCKMANX3,                   /* Rockman X3 */
99   SMB,                         /* Super Mario Bros. */
100   SMB2,                        /* Super Mario Bros. 2 */
101   SMOUSE,                      /* Smart Mouse */
102   SOULBLAD,                    /* Soul Blade */
103   SQUIRRELK,                   /* Squirrel King */
104   SBUBBOB,                     /* Super Bubble Bobble */
105   TOPFIGHTER,                  /* Top Fighter 2000 MK VIII */
106   PSOLAR                       /* Pier Solar */
107};
108
109struct md_pcb
110{
111   const char              *pcb_name;
112   int                     pcb_id;
113};
114
115// Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it
116static const md_pcb pcb_list[] =
117{
118   {"SEGA-EEPROM", SEGA_EEPROM},
119   {"SEGA-SRAM", SEGA_SRAM},
120   {"SEGA-FRAM", SEGA_FRAM},
121
122   {"CM-JCART", CM_JCART},
123   {"CM-JCART-SEPROM", CM_JCART_SEPROM},
124   {"CM-SEPROM", CODE_MASTERS},
125
126   {"SSF2", SSF2},
127   {"GAMEKANDUME", GAME_KANDUME},
128   {"BEGGAR", BEGGAR},
129
130   {"NBAJAM", NBA_JAM},
131   {"NBAJAMTE", NBA_JAM_TE},
132   {"NFLQB96", NFL_QB_96},
133   {"CSLAM", C_SLAM},
134   {"NHLPA", EA_NHLPA},
135
136   {"LIONK3", LIONK3},
137   {"SDK99", SDK99},
138   {"SKINGKONG", SKINGKONG},
139   {"REDCLIFF", REDCL_EN},
140   {"RADICA", RADICA},
141   {"KOF98", KOF98},
142   {"KOF99", KOF99},
143   {"SOULBLAD", SOULBLAD},
144   {"MJLOVER", MJLOVER},
145   {"SQUIRRELK", SQUIRRELK},
146   {"SMOUSE", SMOUSE},
147   {"SMB", SMB},
148   {"SMB2", SMB2},
149   {"KAIJU", KAIJU},
150   {"CHINFIGHT3", CHINFIGHT3},
151   {"LIONK2", LIONK2},
152   {"BUGSLIFE", BUGSLIFE},
153   {"ELFWOR", ELFWOR},
154   {"ROCKMANX3", ROCKMANX3},
155   {"SBUBBOB", SBUBBOB},
156   {"REALTEC", REALTEC},
157   {"MC_SUP19IN1", MC_SUP19IN1},
158   {"MC_SUP15IN1", MC_SUP15IN1},
159   {"MC_12IN1", MC_12IN1},
160   {"TOPFIGHTER", TOPFIGHTER},
161   {"POKEMON", POKEMON},
162   {"POKEMON2", POKEMON2},
163   {"MULAN", MULAN},
164   {"PSOLAR", PSOLAR}
165};
166
167static int md_get_pcb_id(const char *pcb)
168{
169   int i;
170
171   for (i = 0; i < ARRAY_LENGTH(pcb_list); i++)
172   {
173      if (!mame_stricmp(pcb_list[i].pcb_name, pcb))
174         return pcb_list[i].pcb_id;
175   }
176
177   return SEGA_STD;
178}
179
180
181/*************************************
182 *
183 *  Handlers for custom mappers
184 *
185 *************************************/
186
187/*************************************
188 *  Super Street Fighter II
189 *************************************/
190static WRITE16_HANDLER( genesis_ssf2_bank_w )
191{
192   md_cons_state *state = space.machine().driver_data<md_cons_state>();
193   UINT8 *ROM = state->memregion("maincpu")->base();
194
195   if ((state->m_md_cart.ssf2_lastoff != offset) || (state->m_md_cart.ssf2_lastdata != data))
196   {
197      state->m_md_cart.ssf2_lastoff = offset;
198      state->m_md_cart.ssf2_lastdata = data;
199      switch (offset << 1)
200      {
201         case 0x00: /* write protect register */ // this is not a write protect, but seems to do nothing useful but reset bank0 after the checksum test (red screen otherwise)
202            if (data == 2)
203            {
204               memcpy(ROM + 0x000000, ROM + 0x400000 + (((data & 0xf) - 2) * 0x080000), 0x080000);
205            }
206            break;
207         case 0x02: /* 0x080000 - 0x0FFFFF */
208            memcpy(ROM + 0x080000, ROM + 0x400000 + ((data & 0xf) * 0x080000), 0x080000);
209            break;
210         case 0x04: /* 0x100000 - 0x17FFFF */
211            memcpy(ROM + 0x100000, ROM + 0x400000 + ((data & 0xf) * 0x080000), 0x080000);
212            break;
213         case 0x06: /* 0x180000 - 0x1FFFFF */
214            memcpy(ROM + 0x180000, ROM + 0x400000 + ((data & 0xf) * 0x080000), 0x080000);
215            break;
216         case 0x08: /* 0x200000 - 0x27FFFF */
217            memcpy(ROM + 0x200000, ROM + 0x400000 + ((data & 0xf) * 0x080000), 0x080000);
218            break;
219         case 0x0a: /* 0x280000 - 0x2FFFFF */
220            memcpy(ROM + 0x280000, ROM + 0x400000 + ((data & 0xf) * 0x080000), 0x080000);
221            break;
222         case 0x0c: /* 0x300000 - 0x37FFFF */
223            memcpy(ROM + 0x300000, ROM + 0x400000 + ((data & 0xf) * 0x080000), 0x080000);
224            break;
225         case 0x0e: /* 0x380000 - 0x3FFFFF */
226            memcpy(ROM + 0x380000, ROM + 0x400000 + ((data & 0xf) * 0x080000), 0x080000);
227            break;
228      }
229   }
230}
231
232/*************************************
233 *  Lion King 3, Super King Kong 99
234 *  & Super Donkey Kong 99
235 *************************************/
236#ifdef UNUSED_FUNCTION
237static WRITE16_HANDLER( l3alt_pdat_w )
238{
239   md_cons_state *state = space.machine().driver_data<md_cons_state>();
240   state->m_md_cart.l3alt_pdat = data;
241}
242
243static WRITE16_HANDLER( l3alt_pcmd_w )
244{
245   md_cons_state *state = space.machine().driver_data<md_cons_state>();
246   state->m_md_cart.l3alt_pcmd = data;
247}
248#endif
249
250static READ16_HANDLER( l3alt_prot_r )
251{
252   md_cons_state *state = space.machine().driver_data<md_cons_state>();
253   int retdata = 0;
254
255   offset &= 0x07;
256
257   switch (offset)
258   {
259      case 2:
260
261         switch (state->m_md_cart.l3alt_pcmd)
262         {
263            case 1:
264               retdata = state->m_md_cart.l3alt_pdat >> 1;
265               break;
266
267            case 2:
268               retdata = state->m_md_cart.l3alt_pdat >> 4;
269               retdata |= (state->m_md_cart.l3alt_pdat & 0x0f) << 4;
270               break;
271
272            default:
273               /* printf("unk prot case %d\n", l3alt_pcmd); */
274               retdata =  (BIT(state->m_md_cart.l3alt_pdat, 7) << 0);
275               retdata |= (BIT(state->m_md_cart.l3alt_pdat, 6) << 1);
276               retdata |= (BIT(state->m_md_cart.l3alt_pdat, 5) << 2);
277               retdata |= (BIT(state->m_md_cart.l3alt_pdat, 4) << 3);
278               retdata |= (BIT(state->m_md_cart.l3alt_pdat, 3) << 4);
279               retdata |= (BIT(state->m_md_cart.l3alt_pdat, 2) << 5);
280               retdata |= (BIT(state->m_md_cart.l3alt_pdat, 1) << 6);
281               retdata |= (BIT(state->m_md_cart.l3alt_pdat, 0) << 7);
282               break;
283         }
284         break;
285
286      default:
287         logerror("protection read, unknown offset\n");
288         break;
289   }
290
291/*  printf("%06x: l3alt_pdat_w %04x l3alt_pcmd_w %04x return %04x\n", activecpu_get_pc(), l3alt_pdat, l3alt_pcmd, retdata); */
292
293   return retdata;
294}
295
296static WRITE16_HANDLER( l3alt_prot_w )
297{
298   md_cons_state *state = space.machine().driver_data<md_cons_state>();
299   offset &= 0x7;
300
301   switch (offset)
302   {
303      case 0x0:
304         state->m_md_cart.l3alt_pdat = data;
305         break;
306      case 0x1:
307         state->m_md_cart.l3alt_pcmd = data;
308         break;
309      default:
310         logerror("protection write, unknown offst\n");
311         break;
312   }
313}
314
315static WRITE16_HANDLER( l3alt_bank_w )
316{
317   offset &= 0x7;
318
319   switch (offset)
320   {
321      case 0:
322      {
323         UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
324         /* printf("%06x data %04x\n",activecpu_get_pc(), data); */
325         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN + (data & 0xffff) * 0x8000], 0x8000);
326      }
327      break;
328
329      default:
330      logerror("unk bank w\n");
331      break;
332
333   }
334
335}
336
337/*************************************
338 *  Whac a Critter/Mallet Legend,
339 *  Defend the Earth, Funnyworld/Ballonboy
340 *************************************/
341static WRITE16_HANDLER( realtec_402000_w )
342{
343   md_cons_state *state = space.machine().driver_data<md_cons_state>();
344   state->m_md_cart.realtec_bank_addr = 0;
345   state->m_md_cart.realtec_bank_size = (data >> 8) & 0x1f;
346}
347
348static WRITE16_HANDLER( realtec_400000_w )
349{
350   md_cons_state *state = space.machine().driver_data<md_cons_state>();
351   int bankdata = (data >> 9) & 0x7;
352
353   UINT8 *ROM = state->memregion("maincpu")->base();
354
355   state->m_md_cart.realtec_old_bank_addr = state->m_md_cart.realtec_bank_addr;
356   state->m_md_cart.realtec_bank_addr = (state->m_md_cart.realtec_bank_addr & 0x7) | bankdata << 3;
357
358   memcpy(ROM, ROM + (state->m_md_cart.realtec_bank_addr * 0x20000) + 0x400000, state->m_md_cart.realtec_bank_size * 0x20000);
359   memcpy(ROM + state->m_md_cart.realtec_bank_size * 0x20000, ROM + (state->m_md_cart.realtec_bank_addr * 0x20000) + 0x400000, state->m_md_cart.realtec_bank_size * 0x20000);
360}
361
362static WRITE16_HANDLER( realtec_404000_w )
363{
364   md_cons_state *state = space.machine().driver_data<md_cons_state>();
365   int bankdata = (data >> 8) & 0x3;
366   UINT8 *ROM = state->memregion("maincpu")->base();
367
368   state->m_md_cart.realtec_old_bank_addr = state->m_md_cart.realtec_bank_addr;
369   state->m_md_cart.realtec_bank_addr = (state->m_md_cart.realtec_bank_addr & 0xf8) | bankdata;
370
371   if (state->m_md_cart.realtec_old_bank_addr != state->m_md_cart.realtec_bank_addr)
372   {
373      memcpy(ROM, ROM + (state->m_md_cart.realtec_bank_addr * 0x20000)+ 0x400000, state->m_md_cart.realtec_bank_size * 0x20000);
374      memcpy(ROM + state->m_md_cart.realtec_bank_size * 0x20000, ROM + (state->m_md_cart.realtec_bank_addr * 0x20000) + 0x400000, state->m_md_cart.realtec_bank_size * 0x20000);
375   }
376}
377
378/*************************************
379 *  Chinese Fighters 3
380 *************************************/
381static WRITE16_HANDLER( chifi3_bank_w )
382{
383   UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
384
385   if (data == 0xf100) // *hit player
386   {
387      int x;
388      for (x = 0; x < 0x100000; x += 0x10000)
389      {
390         memcpy(ROM + x, ROM + 0x410000, 0x10000);
391      }
392   }
393   else if (data == 0xd700) // title screen..
394   {
395      int x;
396      for (x = 0; x < 0x100000; x += 0x10000)
397      {
398         memcpy(ROM + x, ROM + 0x470000, 0x10000);
399      }
400   }
401   else if (data == 0xd300) // character hits floor
402   {
403      int x;
404      for (x = 0; x < 0x100000; x += 0x10000)
405      {
406         memcpy(ROM + x, ROM + 0x430000, 0x10000);
407      }
408   }
409   else if (data == 0x0000)
410   {
411      int x;
412      for (x = 0; x < 0x100000; x += 0x10000)
413      {
414         memcpy(ROM + x, ROM + 0x400000 + x, 0x10000);
415      }
416   }
417   else
418   {
419      logerror("%06x chifi3, bankw? %04x %04x\n", space.device().safe_pc(), offset, data);
420   }
421
422}
423
424static READ16_HANDLER( chifi3_prot_r )
425{
426   UINT32 retdat;
427
428   /* not 100% correct, there may be some relationship between the reads here
429   and the writes made at the start of the game.. */
430
431   /*
432   04dc10 chifi3, prot_r? 2800
433   04cefa chifi3, prot_r? 65262
434   */
435
436   if (space.device().safe_pc() == 0x01782) // makes 'VS' screen appear
437   {
438      retdat = space.device().state().state_int(M68K_D3) & 0xff;
439      retdat <<= 8;
440      return retdat;
441   }
442   else if (space.device().safe_pc() == 0x1c24) // background gfx etc.
443   {
444      retdat = space.device().state().state_int(M68K_D3) & 0xff;
445      retdat <<= 8;
446      return retdat;
447   }
448   else if (space.device().safe_pc() == 0x10c4a) // unknown
449   {
450      return space.machine().rand();
451   }
452   else if (space.device().safe_pc() == 0x10c50) // unknown
453   {
454      return space.machine().rand();
455   }
456   else if (space.device().safe_pc() == 0x10c52) // relates to the game speed..
457   {
458      retdat = space.device().state().state_int(M68K_D4) & 0xff;
459      retdat <<= 8;
460      return retdat;
461   }
462   else if (space.device().safe_pc() == 0x061ae)
463   {
464      retdat = space.device().state().state_int(M68K_D3) & 0xff;
465      retdat <<= 8;
466      return retdat;
467   }
468   else if (space.device().safe_pc() == 0x061b0)
469   {
470      retdat = space.device().state().state_int(M68K_D3) & 0xff;
471      retdat <<= 8;
472      return retdat;
473   }
474   else
475   {
476      logerror("%06x chifi3, prot_r? %04x\n", space.device().safe_pc(), offset);
477   }
478
479   return 0;
480}
481
482/*************************************
483 *  Super 19 in 1 & Super 15 in 1
484 *************************************/
485static WRITE16_HANDLER( s19in1_bank )
486{
487   UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
488   memcpy(ROM + 0x000000, ROM + 0x400000 + ((offset << 1) * 0x10000), 0x80000);
489}
490
491/*************************************
492 *  Kaiju? (Pokemon Stadium)
493 *************************************/
494static WRITE16_HANDLER( kaiju_bank_w )
495{
496   UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
497   memcpy(ROM + 0x000000, ROM + 0x400000 + (data & 0x7f) * 0x8000, 0x8000);
498}
499
500/*************************************
501 *  Soulblade
502 *************************************/
503static READ16_HANDLER( soulb_400006_r )
504{
505//  printf("%06x soulb_400006_r\n",space.device().safe_pc());
506   return 0xf000;
507}
508
509static READ16_HANDLER( soulb_400002_r )
510{
511//  printf("%06x soulb_400002_r\n",space.device().safe_pc());
512   return 0x9800;
513}
514
515static READ16_HANDLER( soulb_400004_r )
516{
517//  return 0x9800;
518//  printf("%06x soulb_400004_r\n",space.device().safe_pc());
519//
520   return 0xc900;
521//aa
522//c9
523}
524
525/*************************************
526 *  Mahjong Lover
527 *************************************/
528static READ16_HANDLER( mjlovr_prot_1_r )
529{
530   return 0x9000;
531}
532
533static READ16_HANDLER( mjlovr_prot_2_r )
534{
535   return 0xd300;
536}
537
538/*************************************
539 *  Super Mario Bros
540 *************************************/
541static READ16_HANDLER( smbro_prot_r )
542{
543   return 0xc;
544}
545
546
547/*************************************
548 *  Smart Mouse
549 *************************************/
550static READ16_HANDLER( smous_prot_r )
551{
552   switch (offset)
553   {
554      case 0: return 0x5500;
555      case 1: return 0x0f00;
556      case 2: return 0xaa00;
557      case 3: return 0xf000;
558   }
559
560   return -1;
561}
562
563/*************************************
564 *  Super Bubble Bobble MD
565 *************************************/
566static READ16_HANDLER( sbub_extra1_r )
567{
568   return 0x5500;
569}
570
571static READ16_HANDLER( sbub_extra2_r )
572{
573   return 0x0f00;
574}
575
576/*************************************
577 *  King of Fighters 99
578 *************************************/
579static READ16_HANDLER( kof99_A13002_r )
580{
581   // write 02 to a13002.. shift right 1?
582   return 0x01;
583}
584
585static READ16_HANDLER( kof99_00A1303E_r )
586{
587   // write 3e to a1303e.. shift right 1?
588   return 0x1f;
589}
590
591static READ16_HANDLER( kof99_A13000_r )
592{
593   // no write, startup check, chinese message if != 0
594   return 0x0;
595}
596
597/*************************************
598 *  Radica controllers
599 *************************************/
600static READ16_HANDLER( radica_bank_select )
601{
602   int bank = offset & 0x3f;
603   UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
604   memcpy(ROM, ROM + 0x400000 + (bank * 0x10000), 0x400000);
605   return 0;
606}
607
608/*************************************
609 *  ROTK Red Cliff
610 *************************************/
611static READ16_HANDLER( redclif_prot_r )
612{
613   return -0x56 << 8;
614}
615
616static READ16_HANDLER( redclif_prot2_r )
617{
618   return 0x55 << 8;
619}
620
621/*************************************
622 *  Squirrel King
623 *************************************/
624static READ16_HANDLER( squirrel_king_extra_r )
625{
626   md_cons_state *state = space.machine().driver_data<md_cons_state>();
627   return state->m_md_cart.squirrel_king_extra;
628}
629
630static WRITE16_HANDLER( squirrel_king_extra_w )
631{
632   md_cons_state *state = space.machine().driver_data<md_cons_state>();
633   state->m_md_cart.squirrel_king_extra = data;
634}
635
636/*************************************
637 *  Lion King 2
638 *************************************/
639static READ16_HANDLER( lion2_prot1_r )
640{
641   md_cons_state *state = space.machine().driver_data<md_cons_state>();
642   return state->m_md_cart.lion2_prot1_data;
643}
644
645static READ16_HANDLER( lion2_prot2_r )
646{
647   md_cons_state *state = space.machine().driver_data<md_cons_state>();
648   return state->m_md_cart.lion2_prot2_data;
649}
650
651static WRITE16_HANDLER ( lion2_prot1_w )
652{
653   md_cons_state *state = space.machine().driver_data<md_cons_state>();
654   state->m_md_cart.lion2_prot1_data = data;
655}
656
657static WRITE16_HANDLER ( lion2_prot2_w )
658{
659   md_cons_state *state = space.machine().driver_data<md_cons_state>();
660   state->m_md_cart.lion2_prot2_data = data;
661}
662
663/*************************************
664 *  Rockman X3
665 *************************************/
666static READ16_HANDLER( rx3_extra_r )
667{
668   return 0xc;
669}
670
671/*************************************
672 *  King of Fighters 98
673 *************************************/
674static READ16_HANDLER( kof98_aa_r )
675{
676   return 0xaa00;
677}
678
679static READ16_HANDLER( kof98_0a_r )
680{
681   return 0x0a00;
682}
683
684static READ16_HANDLER( kof98_00_r )
685{
686   return 0x0000;
687}
688
689/*************************************
690 *  Super Mario Bros 2
691 *************************************/
692static READ16_HANDLER( smb2_extra_r )
693{
694   return 0xa;
695}
696
697/*************************************
698 *  A Bug's Life
699 *************************************/
700static READ16_HANDLER( bugl_extra_r )
701{
702   return 0x28;
703}
704
705/*************************************
706 *  Linghuan Daoshi Super Magician
707 *  (internal game name Elf Wor)
708 *************************************/
709static READ16_HANDLER( elfwor_400000_r )
710{
711   return 0x5500;
712}
713
714static READ16_HANDLER( elfwor_400002_r )
715{
716   return 0x0f00;
717}
718
719static READ16_HANDLER( elfwor_400004_r )
720{
721   return 0xc900;
722}
723
724static READ16_HANDLER( elfwor_400006_r )
725{
726   return 0x1800;
727}
728
729/*************************************
730 *  Top Fighter - there is more to
731 *  this.. No display at startup etc..
732 *************************************/
733static READ16_HANDLER( topfig_6BD294_r ) /* colours on title screen */
734{
735   static int x = -1;
736
737   /*
738    cpu #0 (PC=00177192): unmapped program memory word write to 006BD240 = 00A8 & 00FF
739    cpu #0 (PC=0017719A): unmapped program memory word write to 006BD2D2 = 0098 & 00FF
740    cpu #0 (PC=001771A2): unmapped program memory word read from 006BD294 & 00FF
741    */
742
743   if (space.device().safe_pc()==0x1771a2) return 0x50;
744   else
745   {
746      x++;
747      logerror("%06x topfig_6BD294_r %04x\n",space.device().safe_pc(), x);
748      return x;
749   }
750}
751
752static READ16_HANDLER( topfig_6F5344_r ) // after char select
753{
754   static int x = -1;
755
756   if (space.device().safe_pc()==0x4C94E)
757   {
758      return space.machine().device("maincpu")->state().state_int((M68K_D0)) & 0xff;
759   }
760   else
761   {
762      x++;
763      logerror("%06x topfig_6F5344_r %04x\n",space.device().safe_pc(), x);
764      return x;
765   }
766}
767
768static WRITE16_HANDLER( topfig_bank_w )
769{
770   UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
771   if (data == 0x002a)
772   {
773      memcpy(ROM + 0x060000, ROM + 0x570000, 0x8000); // == 0x2e*0x8000?!
774      //  printf("%06x offset %06x, data %04x\n",space.device().safe_pc(), offset, data);
775
776   }
777   else if (data==0x0035) // characters ingame
778   {
779      memcpy(ROM + 0x020000, ROM + 0x5a8000, 0x8000); // == 0x35*0x8000
780   }
781   else if (data==0x000f) // special moves
782   {
783      memcpy(ROM + 0x058000, ROM + 0x478000, 0x8000); // == 0xf*0x8000
784   }
785   else if (data==0x0000)
786   {
787      memcpy(ROM + 0x060000, ROM + 0x460000, 0x8000);
788      memcpy(ROM + 0x020000, ROM + 0x420000, 0x8000);
789      memcpy(ROM + 0x058000, ROM + 0x458000, 0x8000);
790      //  printf("%06x offset %06x, data %04x\n",space.device().safe_pc(), offset, data);
791   }
792   else
793   {
794      logerror("%06x offset %06x, data %04x\n", space.device().safe_pc(), offset, data);
795   }
796
797}
798
799static READ16_HANDLER( topfig_645B44_r )
800{
801   //cpu #0 (PC=0004DE00): unmapped program memory word write to 00689B80 = 004A & 00FF
802   //cpu #0 (PC=0004DE08): unmapped program memory word write to 00 = 00B5 & 00FF
803   //cpu #0 (PC=0004DE0C): unmapped program memory word read from 00645B44 & 00FF
804
805   return 0x9f;//0x25;
806}
807
808//cpu #0 (PC=0004CBAE): unmapped program memory word read from 006A35D4 & 00FF -- wants regD7
809
810
811
812/*************************************
813 *  12 in 1 and other multigame carts
814 *************************************/
815static WRITE16_HANDLER( mc_12in1_bank_w )
816{
817   UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
818   logerror("offset %06x", offset << 17);
819   memcpy(ROM + 0x000000, ROM + VIRGIN_COPY_GEN + ((offset & 0x3f) << 17), 0x100000);
820}
821
822
823
824/*************************************
825 *  Stub for TMSS bios bank
826 *************************************/
827static WRITE16_HANDLER( genesis_TMSS_bank_w )
828{
829   /* this probably should do more, like make Genesis V2 'die' if the SEGA string is not written promptly */
830}
831
832/*************************************
833 *  Pier Solar banking
834 *************************************/
835
836static WRITE16_HANDLER( psolar_bank_w )
837{
838   UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
839   logerror("switch bank %02x, page %02x\n",offset, data);
840   memcpy(&ROM[0x280000 + (0x80000 * offset)], &ROM[VIRGIN_COPY_GEN + (0x80000 * (data&0x0f))], 0x80000);
841}
842
843static WRITE16_HANDLER( psolar_unk_w )
844{
845   logerror("A13001 write %02x\n", data);
846}
847
848static int psolar_rdcnt = 0;
849
850static READ16_HANDLER( psolar_hack_r )
851{
852   // ugly hack until we don't know much about game protection
853   // first 3 reads from 15e6 return 0x00000010, then normal 0x00018010 value for crc check
854   UINT16 res;
855   if (psolar_rdcnt < 6) {
856      psolar_rdcnt++;
857      if (offset)
858         res = 0x10;
859      else
860         res = 0x00;
861   } else {
862      if (offset)
863         res = 0x8010;
864      else
865         res = 0x0001;
866   }
867   logerror("read 0x15e6 %d\n",psolar_rdcnt);
868   return res;
869}
870/*************************************
871 *
872 *  Handlers for SRAM & EEPROM
873 *
874 *************************************/
875
876/*************************************
877 *  SRAM
878 *************************************/
879static READ16_HANDLER( genesis_sram_read )
880{
881   md_cons_state *state = space.machine().driver_data<md_cons_state>();
882   UINT8 *ROM;
883   int rom_offset;
884
885   if (state->m_md_cart.sram_active)
886      return state->m_md_cart.sram[offset];
887   else
888   {
889      ROM = state->memregion("maincpu")->base();
890      rom_offset = state->m_md_cart.sram_start + (offset << 1);
891
892      return (UINT16) ROM[rom_offset] | (ROM[rom_offset + 1] << 8);
893   }
894}
895
896static WRITE16_HANDLER( genesis_sram_write )
897{
898   md_cons_state *state = space.machine().driver_data<md_cons_state>();
899   if (state->m_md_cart.sram_active)
900   {
901      if (!state->m_md_cart.sram_readonly)
902         state->m_md_cart.sram[offset] = data;
903   }
904}
905
906static void install_sram_rw_handlers(running_machine &machine, bool mask_addr)
907{
908   md_cons_state *state = machine.driver_data<md_cons_state>();
909   device_image_interface *image = dynamic_cast<device_image_interface *>(machine.device("cart"));
910   // if sram_start/end come from the cart header, they might be incorrect! from softlist, they are fine.
911   UINT32 mask = mask_addr ? 0x3fffff : 0xffffff;
912
913   mame_printf_debug("Allocing %d bytes for sram\n", state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1);
914   state->m_md_cart.sram = auto_alloc_array(machine, UINT16, (state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1) / sizeof(UINT16));
915   image->battery_load(state->m_md_cart.sram, state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1, 0xff); // Dino Dini's Soccer needs backup RAM to be 1fill
916   memcpy(megadriv_backupram, state->m_md_cart.sram, state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1);
917
918   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(state->m_md_cart.sram_start & mask, state->m_md_cart.sram_end & mask, FUNC(genesis_sram_read));
919   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(state->m_md_cart.sram_start & mask, state->m_md_cart.sram_end & mask, FUNC(genesis_sram_write));
920   state->m_md_cart.sram_handlers_installed = 1;
921}
922
923static WRITE16_HANDLER( genesis_sram_toggle )
924{
925   md_cons_state *state = space.machine().driver_data<md_cons_state>();
926
927   /* unsure if this is actually supposed to toggle or just switch on?
928   Yet to encounter game that utilizes */
929   state->m_md_cart.sram_active = (data & 1) ? 1 : 0;
930   state->m_md_cart.sram_readonly = (data & 2) ? 1 : 0;
931
932   if (state->m_md_cart.sram_active && !state->m_md_cart.sram_handlers_installed)
933      install_sram_rw_handlers(space.machine(), TRUE);
934}
935
936static READ16_HANDLER( sega_6658a_reg_r )
937{
938   md_cons_state *state = space.machine().driver_data<md_cons_state>();
939   return state->m_md_cart.sram_active;
940}
941
942static WRITE16_HANDLER( sega_6658a_reg_w )
943{
944   md_cons_state *state = space.machine().driver_data<md_cons_state>();
945   if (data == 1)
946      state->m_md_cart.sram_active = 1;
947   if (data == 0)
948      state->m_md_cart.sram_active = 0;
949}
950
951/*************************************
952 *  I2C EEPROM
953 *  bare minimum handlings
954 *  TODO: supports proper device interfacing and parameter change!
955 *************************************/
956
957static READ16_HANDLER( nba_jam_eeprom_r )
958{
959   md_cons_state *state = space.machine().driver_data<md_cons_state>();
960//  state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
961   return state->m_md_cart.i2c_mem & 1;
962}
963
964static WRITE16_HANDLER( nba_jam_eeprom_w )
965{
966   md_cons_state *state = space.machine().driver_data<md_cons_state>();
967   state->m_md_cart.i2c_clk = (data & 0x0002) >> 1;
968   state->m_md_cart.i2c_mem = (data & 0x0001);
969
970//  i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
971//  i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
972}
973
974static READ16_HANDLER( nba_jam_te_eeprom_r )
975{
976   md_cons_state *state = space.machine().driver_data<md_cons_state>();
977//  state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
978   return (state->m_md_cart.i2c_mem & 1);
979}
980
981static WRITE16_HANDLER( nba_jam_te_eeprom_w )
982{
983   md_cons_state *state = space.machine().driver_data<md_cons_state>();
984   state->m_md_cart.i2c_clk = ((data & 0x0100) >> 8);
985   state->m_md_cart.i2c_mem = data & 0x0001;
986
987//  i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
988//  i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
989}
990
991static READ16_HANDLER( ea_nhlpa_eeprom_r )
992{
993   md_cons_state *state = space.machine().driver_data<md_cons_state>();
994//  state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
995   return (state->m_md_cart.i2c_mem & 1) << 7;
996}
997
998static WRITE16_HANDLER( ea_nhlpa_eeprom_w )
999{
1000   md_cons_state *state = space.machine().driver_data<md_cons_state>();
1001   state->m_md_cart.i2c_clk = ((data & 0x0040) >> 6);
1002   state->m_md_cart.i2c_mem = ((data & 0x0080) >> 7);
1003
1004//  i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
1005//  i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
1006}
1007
1008/* TODO: identical as NBA Jam, used as kludge */
1009static READ16_HANDLER( wboy_v_eeprom_r )
1010{
1011   md_cons_state *state = space.machine().driver_data<md_cons_state>();
1012//  state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
1013   return ~state->m_md_cart.i2c_mem & 1;
1014}
1015
1016static WRITE16_HANDLER( wboy_v_eeprom_w )
1017{
1018   md_cons_state *state = space.machine().driver_data<md_cons_state>();
1019   state->m_md_cart.i2c_clk = (data & 0x0002) >> 1;
1020   state->m_md_cart.i2c_mem = (data & 0x0001);
1021
1022//  i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
1023//  i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
1024}
1025
1026static READ16_HANDLER( codemasters_eeprom_r )
1027{
1028   md_cons_state *state = space.machine().driver_data<md_cons_state>();
1029//  state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
1030   return (state->m_md_cart.i2c_mem & 1) << 7;
1031}
1032
1033static WRITE16_HANDLER( codemasters_eeprom_w )
1034{
1035   md_cons_state *state = space.machine().driver_data<md_cons_state>();
1036   state->m_md_cart.i2c_clk = (data & 0x0200) >> 9;
1037   state->m_md_cart.i2c_mem = (data & 0x0100) >> 8;
1038
1039//  i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
1040//  i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
1041}
1042
1043/* ST M95320 32Kbit serial EEPROM implementation */
1044
1045#define M95320_SIZE 0x1000
1046enum STMSTATE
1047{
1048   IDLE = 0,
1049   CMD_WRSR,
1050   CMD_RDSR,
1051   M95320_CMD_READ,
1052   CMD_WRITE,
1053   READING,
1054   WRITING
1055};
1056
1057class stm95_device
1058{
1059public:
1060   stm95_device() : stm_state(IDLE), stream_pos(0) {};
1061   UINT8   *eeprom_data;
1062   void    set_cs_line(int);
1063   void    set_halt_line(int state) {}; // not implemented
1064   void    set_si_line(int);
1065   void    set_sck_line(int state);
1066   int     get_so_line(void);
1067protected:
1068   int     latch;
1069   int     reset_line;
1070   int     sck_line;
1071   int     WEL;
1072
1073   STMSTATE    stm_state;
1074   int     stream_pos;
1075   int     stream_data;
1076   int     eeprom_addr;
1077};
1078
1079void stm95_device::set_cs_line(int state)
1080{
1081   reset_line = state;
1082   if (reset_line != CLEAR_LINE)
1083   {
1084      stream_pos = 0;
1085      stm_state = IDLE;
1086   }
1087}
1088
1089void stm95_device::set_si_line(int state)
1090{
1091   latch = state;
1092}
1093
1094int stm95_device::get_so_line(void)
1095{
1096   if (stm_state == READING || stm_state == CMD_RDSR)
1097      return (stream_data >> 8) & 1;
1098   else
1099      return 0;
1100}
1101
1102void stm95_device::set_sck_line(int state)
1103{
1104   if (reset_line == CLEAR_LINE)
1105   {
1106      if (state == ASSERT_LINE && sck_line == CLEAR_LINE)
1107      {
1108         switch (stm_state)
1109         {
1110            case IDLE:
1111               stream_data = (stream_data << 1) | (latch ? 1 : 0);
1112               stream_pos++;
1113               if (stream_pos == 8)
1114               {
1115                  stream_pos = 0;
1116                  //printf("STM95 EEPROM: got cmd %02X\n", stream_data&0xff);
1117                  switch(stream_data & 0xff)
1118                  {
1119                     case 0x01:  // write status register
1120                        if (WEL != 0)
1121                           stm_state = CMD_WRSR;
1122                        WEL = 0;
1123                        break;
1124                     case 0x02:  // write
1125                        if (WEL != 0)
1126                           stm_state = CMD_WRITE;
1127                        stream_data = 0;
1128                        WEL = 0;
1129                        break;
1130                     case 0x03:  // read
1131                        stm_state = M95320_CMD_READ;
1132                        stream_data = 0;
1133                        break;
1134                     case 0x04:  // write disable
1135                        WEL = 0;
1136                        break;
1137                     case 0x05:  // read status register
1138                        stm_state = CMD_RDSR;
1139                        stream_data = WEL<<1;
1140                        break;
1141                     case 0x06:  // write enable
1142                        WEL = 1;
1143                        break;
1144                     default:
1145                        logerror("STM95 EEPROM: unknown cmd %02X\n", stream_data&0xff);
1146                  }
1147               }
1148               break;
1149            case CMD_WRSR:
1150               stream_pos++;       // just skip, don't care block protection
1151               if (stream_pos == 8)
1152               {
1153                  stm_state = IDLE;
1154                  stream_pos = 0;
1155               }
1156               break;
1157            case CMD_RDSR:
1158               stream_data = stream_data<<1;
1159               stream_pos++;
1160               if (stream_pos == 8)
1161               {
1162                  stm_state = IDLE;
1163                  stream_pos = 0;
1164               }
1165               break;
1166            case M95320_CMD_READ:
1167               stream_data = (stream_data << 1) | (latch ? 1 : 0);
1168               stream_pos++;
1169               if (stream_pos == 16)
1170               {
1171                  eeprom_addr = stream_data & (M95320_SIZE - 1);
1172                  stream_data = eeprom_data[eeprom_addr];
1173                  stm_state = READING;
1174                  stream_pos = 0;
1175               }
1176               break;
1177            case READING:
1178               stream_data = stream_data<<1;
1179               stream_pos++;
1180               if (stream_pos == 8)
1181               {
1182                  if (++eeprom_addr == M95320_SIZE)
1183                     eeprom_addr = 0;
1184                  stream_data |= eeprom_data[eeprom_addr];
1185                  stream_pos = 0;
1186               }
1187               break;
1188            case CMD_WRITE:
1189               stream_data = (stream_data << 1) | (latch ? 1 : 0);
1190               stream_pos++;
1191               if (stream_pos == 16)
1192               {
1193                  eeprom_addr = stream_data & (M95320_SIZE - 1);
1194                  stm_state = WRITING;
1195                  stream_pos = 0;
1196               }
1197               break;
1198            case WRITING:
1199               stream_data = (stream_data << 1) | (latch ? 1 : 0);
1200               stream_pos++;
1201               if (stream_pos == 8)
1202               {
1203                  eeprom_data[eeprom_addr] = stream_data;
1204                  if (++eeprom_addr == M95320_SIZE)
1205                     eeprom_addr = 0;
1206                  stream_pos = 0;
1207               }
1208               break;
1209         }
1210      }
1211   }
1212   sck_line = state;
1213}
1214
1215stm95_device STM95;
1216
1217static READ16_HANDLER( psolar_eeprom_r )
1218{
1219   return STM95.get_so_line() & 1;
1220}
1221
1222static WRITE16_HANDLER( psolar_eeprom_w )
1223{
1224   STM95.set_si_line(data & 0x01);
1225   STM95.set_cs_line((data & 0x08)?ASSERT_LINE:CLEAR_LINE);
1226   STM95.set_halt_line((data & 0x04)?ASSERT_LINE:CLEAR_LINE);
1227   STM95.set_sck_line((data & 0x02)?ASSERT_LINE:CLEAR_LINE);
1228}
1229
1230/*************************************
1231 *
1232 *  Machine driver reset
1233 *
1234 *************************************/
1235
1236static void setup_megadriv_custom_mappers(running_machine &machine)
1237{
1238   md_cons_state *state = machine.driver_data<md_cons_state>();
1239   UINT32 mirroraddr;
1240   UINT8 *ROM = state->memregion("maincpu")->base();
1241
1242   switch (state->m_md_cart.type)
1243   {
1244      case CM_JCART:
1245      case CM_JCART_SEPROM:
1246         /* Codemasters PCB (J-Carts) */
1247         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_r));
1248         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_w));
1249         break;
1250
1251      case SSF2:
1252         memcpy(&ROM[0x800000], &ROM[VIRGIN_COPY_GEN + 0x400000], 0x100000);
1253         memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000);
1254         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000);
1255
1256         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130ff, FUNC(genesis_ssf2_bank_w));
1257         break;
1258
1259      case LIONK3:
1260      case SKINGKONG:
1261         state->m_md_cart.l3alt_pdat = state->m_md_cart.l3alt_pcmd = 0;
1262         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000); /* default rom */
1263         memcpy(&ROM[0x200000], &ROM[VIRGIN_COPY_GEN], 0x200000); /* default rom */
1264
1265         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w));
1266         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w));
1267         break;
1268
1269      case SDK99:
1270         state->m_md_cart.l3alt_pdat = state->m_md_cart.l3alt_pcmd = 0;
1271
1272         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x300000); /* default rom */
1273         memcpy(&ROM[0x300000], &ROM[VIRGIN_COPY_GEN], 0x100000); /* default rom */
1274
1275         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w));
1276         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w));
1277         break;
1278
1279      case REDCLIFF:
1280         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r));
1281         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r));
1282         break;
1283
1284      case REDCL_EN:
1285         for (int x = VIRGIN_COPY_GEN; x < VIRGIN_COPY_GEN + 0x200005; x++)
1286            ROM[x] ^= 0x40;
1287         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN + 4], 0x200000); /* default rom */
1288
1289         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r));
1290         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r));
1291         break;
1292
1293      case RADICA:
1294         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000);
1295         memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000); // keep a copy for later banking.. making use of huge ROM_REGION allocated to genesis driver
1296         memcpy(&ROM[0x800000], &ROM[VIRGIN_COPY_GEN], 0x400000); // wraparound banking (from hazemd code)
1297
1298         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa1307f, FUNC(radica_bank_select));
1299         break;
1300
1301      case KOF99:
1302         //memcpy(&ROM[0x000000],&ROM[VIRGIN_COPY_GEN],0x300000);
1303         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(kof99_A13000_r));
1304         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13002, 0xa13003, FUNC(kof99_A13002_r));
1305         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa1303e, 0xa1303f, FUNC(kof99_00A1303E_r));
1306         break;
1307
1308      case SOULBLAD:
1309         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(soulb_400002_r));
1310         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(soulb_400004_r));
1311         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400006, 0x400007, FUNC(soulb_400006_r));
1312         break;
1313
1314      case MJLOVER:
1315         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(mjlovr_prot_1_r));
1316         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x401000, 0x401001, FUNC(mjlovr_prot_2_r));
1317         break;
1318
1319      case SQUIRRELK:
1320         state->m_md_cart.squirrel_king_extra = 0;
1321         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_r));
1322         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_w));
1323         break;
1324
1325      case SMOUSE:
1326         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400007, FUNC(smous_prot_r));
1327         break;
1328
1329      case SMB:
1330         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smbro_prot_r));
1331         break;
1332
1333      case SMB2:
1334         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smb2_extra_r));
1335         break;
1336
1337      case KAIJU:
1338         memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x200000);
1339         memcpy(&ROM[0x600000], &ROM[VIRGIN_COPY_GEN], 0x200000);
1340         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000);
1341
1342         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(kaiju_bank_w));
1343         break;
1344
1345      case CHINFIGHT3:
1346         memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x200000);
1347         memcpy(&ROM[0x600000], &ROM[VIRGIN_COPY_GEN], 0x200000);
1348         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000);
1349
1350         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x4fffff, FUNC(chifi3_prot_r));
1351         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x600000, 0x6fffff, FUNC(chifi3_bank_w));
1352         break;
1353
1354      case LIONK2:
1355         state->m_md_cart.lion2_prot1_data = state->m_md_cart.lion2_prot2_data = 0;
1356
1357         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(lion2_prot1_r));
1358         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400006, 0x400007, FUNC(lion2_prot2_r));
1359         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400000, 0x400001, FUNC(lion2_prot1_w));
1360         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400004, 0x400005, FUNC(lion2_prot2_w));
1361         break;
1362
1363      case BUGSLIFE:
1364         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(bugl_extra_r));
1365         break;
1366
1367      case ELFWOR:
1368         /* It return (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). It is probably best to add handlers for all 4 addresses. */
1369         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(elfwor_400000_r));
1370         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(elfwor_400002_r));
1371         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(elfwor_400004_r));
1372         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400006, 0x400007, FUNC(elfwor_400006_r));
1373         break;
1374
1375      case ROCKMANX3:
1376         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(rx3_extra_r));
1377         break;
1378
1379      case SBUBBOB:
1380         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(sbub_extra1_r));
1381         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(sbub_extra2_r));
1382         break;
1383
1384      case KOF98:
1385         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x480000, 0x480001, FUNC(kof98_aa_r));
1386         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4800e0, 0x4800e1, FUNC(kof98_aa_r));
1387         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4824a0, 0x4824a1, FUNC(kof98_aa_r));
1388         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x488880, 0x488881, FUNC(kof98_aa_r));
1389
1390         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4a8820, 0x4a8821, FUNC(kof98_0a_r));
1391         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f8820, 0x4f8821, FUNC(kof98_00_r));
1392         break;
1393
1394      case REALTEC:
1395         /* Realtec mapper!*/
1396         state->m_md_cart.realtec_bank_addr = state->m_md_cart.realtec_bank_size = 0;
1397         state->m_md_cart.realtec_old_bank_addr = -1;
1398
1399         memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x80000);
1400
1401         for (mirroraddr = 0; mirroraddr < 0x400000; mirroraddr += 0x2000)
1402            memcpy(ROM + mirroraddr, ROM + VIRGIN_COPY_GEN + 0x7e000, 0x002000); /* copy last 8kb across the whole rom region */
1403
1404         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400000, 0x400001, FUNC(realtec_400000_w));
1405         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x402000, 0x402001, FUNC(realtec_402000_w));
1406         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x404000, 0x404001, FUNC(realtec_404000_w));
1407         break;
1408
1409      case MC_SUP19IN1:
1410         memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000); // allow hard reset to menu
1411         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank));
1412         break;
1413
1414      case MC_SUP15IN1:
1415         memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x200000); // allow hard reset to menu
1416         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank));
1417         break;
1418
1419      case MC_12IN1:
1420         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000);  /* default rom */
1421         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa1303f, FUNC(mc_12in1_bank_w));
1422         break;
1423
1424      case TOPFIGHTER:
1425         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000);  /* default rom */
1426
1427         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x6f5344, 0x6f5345, FUNC(topfig_6F5344_r) );
1428         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x6bd294, 0x6bd295, FUNC(topfig_6BD294_r) );
1429         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x645b44, 0x645b45, FUNC(topfig_645B44_r) );
1430
1431         /* readd */
1432         //machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x689b80, 0x689b81, FUNC(MWA16_NOP));
1433         //machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x6d8b02, 0x6d8b03, FUNC(MWA16_NOP));
1434
1435         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(topfig_bank_w) );
1436         break;
1437      case PSOLAR:
1438         memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000);
1439         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13002, 0xa13007, FUNC(psolar_bank_w));
1440         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa13001, FUNC(psolar_unk_w));
1441         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x0015e6, 0x0015e9, FUNC(psolar_hack_r));
1442         psolar_rdcnt = 0;
1443         break;
1444   }
1445
1446   /* games whose protection gets patched out */
1447
1448   if (state->m_md_cart.type == POKEMON)
1449   {
1450      /*todo: emulate protection instead
1451       0DD19E:47F8
1452       0DD1A0:FFF0
1453       0DD1A2:4E63
1454       0DD46E:4EF8
1455       0DD470:0300
1456       0DD49C:6002
1457       */
1458
1459      /*
1460
1461       you need to return 1 @ 0xa13002 and 0???1f @ 0xa1303E (it does word reads).
1462
1463       */
1464      UINT16 *ROM16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
1465
1466      ROM16[0x0dd19e/2] = 0x47F8;
1467      ROM16[0x0dd1a0/2] = 0xFFF0;
1468      ROM16[0x0dd1a2/2] = 0x4E63;
1469      ROM16[0x0dd46e/2] = 0x4EF8;
1470      ROM16[0x0dd470/2] = 0x0300;
1471      ROM16[0x0dd49c/2] = 0x6002;
1472   }
1473
1474   if (state->m_md_cart.type == POKEMON2)
1475   {
1476      /*todo: emulate protection instead
1477       006036:E000
1478       002540:6026
1479       001ED0:6026
1480       002476:6022
1481
1482       */
1483      UINT16 *ROM16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
1484
1485      ROM16[0x06036/2] = 0xE000;
1486      ROM16[0x02540/2] = 0x6026;
1487      ROM16[0x01ED0/2] = 0x6026;
1488      ROM16[0x02476/2] = 0x6022;
1489
1490      ROM16[0x7E300/2] = 0x60FE;
1491   }
1492
1493   if (state->m_md_cart.type == MULAN)
1494   {
1495      /*todo: emulate protection instead
1496       006036:E000
1497       +more?
1498
1499       */
1500      //  ROM[0x01ED0/2] = 0xE000;
1501      //  ROM[0x02540/2] = 0xE000;
1502
1503      UINT16 *ROM16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
1504
1505      ROM16[0x06036/2] = 0xE000;
1506   }
1507
1508   /* install NOP handler for TMSS */
1509   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa14000, 0xa14003, FUNC(genesis_TMSS_bank_w));
1510}
1511
1512static void setup_megadriv_sram(device_image_interface &image)
1513{
1514   running_machine &machine = image.device().machine();
1515   md_cons_state *state = machine.driver_data<md_cons_state>();
1516   UINT8 *ROM = state->memregion("maincpu")->base();
1517   megadriv_backupram = NULL;
1518   state->m_md_cart.sram = NULL;
1519   state->m_md_cart.sram_start = state->m_md_cart.sram_end = 0;
1520   state->m_md_cart.has_serial_eeprom = 0;
1521   state->m_md_cart.sram_detected = 0;
1522   state->m_md_cart.sram_handlers_installed = 0;
1523   state->m_md_cart.sram_readonly = 0;
1524   state->m_md_cart.sram_active = 0;
1525
1526   /* install SRAM & i2c handlers for the specific type of cart */
1527   switch (state->m_md_cart.type)
1528   {
1529      // These types only come from xml
1530      // TODO: Eventually megadriv_backupram should point to the allocated cart:sram region!
1531      // For now, we only use the region as a placeholder to carry size info...
1532      case SEGA_SRAM:
1533         state->m_md_cart.sram_start = 0x200000;
1534         state->m_md_cart.sram_end = state->m_md_cart.sram_start + image.get_software_region_length("sram") - 1;
1535         state->m_md_cart.sram_detected = 1;
1536         megadriv_backupram = (UINT16*) (ROM + state->m_md_cart.sram_start);
1537         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle));
1538         if (state->m_md_cart.last_loaded_image_length <= state->m_md_cart.sram_start)
1539         {
1540            state->m_md_cart.sram_active = 1;
1541            install_sram_rw_handlers(machine, FALSE);
1542         }
1543         break;
1544
1545      case BEGGAR:
1546         state->m_md_cart.sram_start = 0x400000;
1547         state->m_md_cart.sram_end = state->m_md_cart.sram_start + 0xffff;
1548         state->m_md_cart.sram_detected = 1;
1549         state->m_md_cart.sram_active = 1;
1550         megadriv_backupram = (UINT16*) (ROM + state->m_md_cart.sram_start);
1551         install_sram_rw_handlers(machine, FALSE);
1552         break;
1553
1554      case SEGA_FRAM:
1555         state->m_md_cart.sram_start = 0x200000;
1556         state->m_md_cart.sram_end = state->m_md_cart.sram_start + image.get_software_region_length("fram") - 1;
1557         state->m_md_cart.sram_detected = 1;
1558         megadriv_backupram = (UINT16*) (ROM + state->m_md_cart.sram_start);
1559         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_r));
1560         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_w));
1561         install_sram_rw_handlers(machine, FALSE);
1562         break;
1563
1564      // These types might come either from xml or from old-styele loading
1565      case SEGA_EEPROM:
1566         state->m_md_cart.has_serial_eeprom = 1;
1567         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(wboy_v_eeprom_r), FUNC(wboy_v_eeprom_w));
1568         break;
1569
1570      case NBA_JAM:
1571         state->m_md_cart.has_serial_eeprom = 1;
1572         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_eeprom_r), FUNC(nba_jam_eeprom_w));
1573         break;
1574
1575      case NBA_JAM_TE:
1576      case NFL_QB_96:
1577      case C_SLAM: // same handling but different sizes
1578         state->m_md_cart.has_serial_eeprom = 1;
1579         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_te_eeprom_r), FUNC(nba_jam_te_eeprom_w));
1580         break;
1581
1582      case EA_NHLPA:
1583         state->m_md_cart.has_serial_eeprom = 1;
1584         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(ea_nhlpa_eeprom_r), FUNC(ea_nhlpa_eeprom_w));
1585         break;
1586
1587      case CODE_MASTERS:
1588      case CM_JCART_SEPROM:
1589         state->m_md_cart.has_serial_eeprom = 1;
1590         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x300000, 0x300001, FUNC(codemasters_eeprom_w));
1591         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x380000, 0x380001, FUNC(codemasters_eeprom_r));
1592         break;
1593      case PSOLAR:
1594         state->m_md_cart.sram_start = 0x800000;
1595         state->m_md_cart.sram_end = state->m_md_cart.sram_start + M95320_SIZE - 1;
1596         state->m_md_cart.sram = auto_alloc_array(machine, UINT16, M95320_SIZE / sizeof(UINT16));
1597         image.battery_load(state->m_md_cart.sram, M95320_SIZE, 0xff);
1598         STM95.eeprom_data = (UINT8*)state->m_md_cart.sram;
1599
1600         state->m_md_cart.has_serial_eeprom = 1;
1601         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13008, 0xa13009, FUNC(psolar_eeprom_w));
1602         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa1300a, 0xa1300b, FUNC(psolar_eeprom_r));
1603         break;
1604   }
1605
1606   // If the cart is not of a special type, we check the header. Unfortunately, there are ROMs without correct info in the header,
1607   // hence we do the mapping anyway, but we activate SRAM later only if the game will access it.
1608   if (!state->m_md_cart.sram_detected && !state->m_md_cart.has_serial_eeprom)
1609   {
1610      /* check if cart has battery save */
1611      if (ROM[0x1b1] == 'R' && ROM[0x1b0] == 'A')
1612      {
1613         /* SRAM info found in header */
1614         state->m_md_cart.sram_start = (ROM[0x1b5] << 24 | ROM[0x1b4] << 16 | ROM[0x1b7] << 8 | ROM[0x1b6]);
1615         state->m_md_cart.sram_end = (ROM[0x1b9] << 24 | ROM[0x1b8] << 16 | ROM[0x1bb] << 8 | ROM[0x1ba]);
1616
1617         if ((state->m_md_cart.sram_start > state->m_md_cart.sram_end) || ((state->m_md_cart.sram_end - state->m_md_cart.sram_start) >= 0x10000))    // we assume at most 64k of SRAM (HazeMD uses at most 64k). is this correct?
1618            state->m_md_cart.sram_end = state->m_md_cart.sram_start + 0x0FFFF;
1619
1620         /* for some games using serial EEPROM, difference between SRAM
1621          end to start is 0 or 1. Currently EEPROM is not emulated. */
1622         if ((state->m_md_cart.sram_end - state->m_md_cart.sram_start) < 2)
1623            state->m_md_cart.has_serial_eeprom = 1;
1624         else
1625            state->m_md_cart.sram_detected = 1;
1626      }
1627      else
1628      {
1629         /* set default SRAM positions, with size = 64k */
1630         state->m_md_cart.sram_start = 0x200000;
1631         state->m_md_cart.sram_end = state->m_md_cart.sram_start + 0xffff;
1632      }
1633
1634      if (state->m_md_cart.sram_start & 1)
1635         state->m_md_cart.sram_start -= 1;
1636
1637      if (!(state->m_md_cart.sram_end & 1))
1638         state->m_md_cart.sram_end += 1;
1639
1640      /* calculate backup RAM location */
1641      megadriv_backupram = (UINT16*) (ROM + (state->m_md_cart.sram_start & 0x3fffff));
1642
1643      if (state->m_md_cart.sram_detected)
1644         logerror("SRAM detected from header: starting location %X - SRAM Length %X\n", state->m_md_cart.sram_start, state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1);
1645
1646      /* Enable SRAM handlers only if the game does not use EEPROM. */
1647      if (!state->m_md_cart.has_serial_eeprom)
1648      {
1649         /* Info from DGen: If SRAM does not overlap main ROM, set it active by
1650          default since a few games can't manage to properly switch it on/off. */
1651         if (state->m_md_cart.last_loaded_image_length <= state->m_md_cart.sram_start)
1652            state->m_md_cart.sram_active = 1;
1653
1654         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle));
1655         //printf("res: start %x, end %x, det %d, active %d\n", state->m_md_cart.sram_start, state->m_md_cart.sram_end, state->m_md_cart.sram_detected, state->m_md_cart.sram_active);
1656
1657         /* Sonic 1 included in Sonic Classics doesn't have SRAM and
1658          does lots of ROM access at this range, then only install read/
1659          write handlers if SRAM is active to not slow down emulation. */
1660         if (state->m_md_cart.sram_active)
1661            install_sram_rw_handlers(machine, TRUE);
1662      }
1663   }
1664}
1665
1666/*************************************
1667 *
1668 *  CART HANDLING
1669 *
1670 *************************************/
1671
1672
1673/*************************************
1674 *  Helper function: Memcmp for both
1675 *  endianness
1676 *************************************/
1677
1678static int allendianmemcmp(const void *s1, const void *s2, size_t n)
1679{
1680   const unsigned char *realbuf;
1681
1682#ifdef LSB_FIRST
1683   unsigned char flippedbuf[64];
1684   unsigned int i;
1685
1686   if ((n & 1) || (n > 63)) return -1 ; // don't want odd sized buffers or too large a compare
1687   for (i = 0; i < n; i++) flippedbuf[i] = *((char *)s2 + (i ^ 1));
1688   realbuf = flippedbuf;
1689
1690#else
1691
1692   realbuf = (unsigned char *)s2;
1693
1694#endif
1695   return memcmp(s1,realbuf,n);
1696}
1697
1698
1699/*************************************
1700 *  Helper function: Detect SMD file
1701 *************************************/
1702
1703/* code taken directly from GoodGEN by Cowering */
1704static int genesis_is_funky_SMD(unsigned char *buf,unsigned int len)
1705{
1706   /* aq quiz */
1707   if (!strncmp("UZ(-01  ", (const char *) &buf[0xf0], 8))
1708      return 1;
1709
1710   /* Phelios USA redump */
1711   /* target earth */
1712   /* klax (namcot) */
1713   if (buf[0x2080] == ' ' && buf[0x0080] == 'S' && buf[0x2081] == 'E' && buf[0x0081] == 'G')
1714      return 1;
1715
1716   /* jap baseball 94 */
1717   if (!strncmp("OL R-AEAL", (const char *) &buf[0xf0], 9))
1718      return 1;
1719
1720   /* devilish Mahjong Tower */
1721   if (!strncmp("optrEtranet", (const char *) &buf[0xf3], 11))
1722      return 1;
1723
1724   /* golden axe 2 beta */
1725   if (buf[0x0100] == 0x3c && buf[0x0101] == 0 && buf[0x0102] == 0 && buf[0x0103] == 0x3c)
1726      return 1;
1727
1728   /* omega race */
1729   if (!strncmp("OEARC   ", (const char *) &buf[0x90], 8))
1730      return 1;
1731
1732   /* budokan beta */
1733   if ((len >= 0x6708+8) && !strncmp(" NTEBDKN", (const char *) &buf[0x6708], 8))
1734      return 1;
1735
1736   /* cdx pro 1.8 bios */
1737   if (!strncmp("so fCXP", (const char *) &buf[0x2c0], 7))
1738      return 1;
1739
1740   /* ishido (hacked) */
1741   if (!strncmp("sio-Wyo ", (const char *) &buf[0x0090], 8))
1742      return 1;
1743
1744   /* onslaught */
1745   if (!strncmp("SS  CAL ", (const char *) &buf[0x0088], 8))
1746      return 1;
1747
1748   /* tram terror pirate */
1749   if ((len >= 0x3648 + 8) && !strncmp("SG NEPIE", (const char *) &buf[0x3648], 8))
1750      return 1;
1751
1752   /* breath of fire 3 chinese */
1753   if (buf[0x0007] == 0x1c && buf[0x0008] == 0x0a && buf[0x0009] == 0xb8 && buf[0x000a] == 0x0a)
1754      return 1;
1755
1756   /*tetris pirate */
1757   if ((len >= 0x1cbe + 5) && !strncmp("@TTI>", (const char *) &buf[0x1cbe], 5))
1758      return 1;
1759
1760   return 0;
1761}
1762
1763/* code taken directly from GoodGEN by Cowering */
1764static int genesis_is_SMD(unsigned char *buf,unsigned int len)
1765{
1766   if (buf[0x2080] == 'S' && buf[0x80] == 'E' && buf[0x2081] == 'G' && buf[0x81] == 'A')
1767      return 1;
1768   return genesis_is_funky_SMD(buf,len);
1769}
1770
1771/*************************************
1772 *  Loading a cart image *not* from
1773 *  softlist
1774 *************************************/
1775
1776static int megadrive_load_nonlist(device_image_interface &image)
1777{
1778   md_cons_state *state = image.device().machine().driver_data<md_cons_state>();
1779   unsigned char *ROM, *rawROM, *tmpROMnew, *tmpROM, *secondhalf;
1780   int relocate, length, ptr, x;
1781#ifdef LSB_FIRST
1782   unsigned char fliptemp;
1783#endif
1784
1785   // STEP 1: determine the file type (SMD? MD? BIN?)
1786   rawROM = state->memregion("maincpu")->base();
1787   ROM = rawROM /*+ 512 */;
1788
1789   state->m_md_cart.last_loaded_image_length = -1;
1790
1791   length = image.fread( rawROM + 0x2000, 0x800000);
1792
1793   logerror("image length = 0x%x\n", length);
1794
1795   /* is this a SMD file? */
1796   if (genesis_is_SMD(&rawROM[0x2200], (unsigned)length))
1797   {
1798//      printf("SMD!\n");
1799      tmpROMnew = ROM;
1800      tmpROM = ROM + 0x2000 + 512;
1801
1802      for (ptr = 0; ptr < MAX_MD_CART_SIZE / (8192); ptr += 2)
1803      {
1804         for (x = 0; x < 8192; x++)
1805         {
1806            *tmpROMnew++ = *(tmpROM + ((ptr + 1) * 8192) + x);
1807            *tmpROMnew++ = *(tmpROM + ((ptr + 0) * 8192) + x);
1808         }
1809      }
1810
1811#ifdef LSB_FIRST
1812      tmpROMnew = ROM;
1813      for (ptr = 0; ptr < length; ptr += 2)
1814      {
1815         fliptemp = tmpROMnew[ptr];
1816         tmpROMnew[ptr] = tmpROMnew[ptr + 1];
1817         tmpROMnew[ptr + 1] = fliptemp;
1818      }
1819#endif
1820      state->m_md_cart.last_loaded_image_length = length - 512;
1821      memcpy(&ROM[VIRGIN_COPY_GEN], &ROM[0x000000], MAX_MD_CART_SIZE);  /* store a copy of data */
1822
1823      relocate = 0;
1824
1825   }
1826   /* is this a MD file? */
1827   else if ((rawROM[0x2080] == 'E') && (rawROM[0x2081] == 'A') &&
1828            (rawROM[0x2082] == 'M' || rawROM[0x2082] == 'G'))
1829   {
1830//      printf("MD!\n");
1831      tmpROMnew = global_alloc_array(unsigned char, length);
1832      secondhalf = &tmpROMnew[length >> 1];
1833
1834      if (!tmpROMnew)
1835      {
1836         logerror("Memory allocation failed reading roms!\n");
1837         return IMAGE_INIT_FAIL;
1838      }
1839
1840      memcpy(tmpROMnew, ROM + 0x2000, length);
1841      for (ptr = 0; ptr < length; ptr += 2)
1842      {
1843         ROM[ptr] = secondhalf[ptr >> 1];
1844         ROM[ptr + 1] = tmpROMnew[ptr >> 1];
1845      }
1846      global_free(tmpROMnew);
1847
1848#ifdef LSB_FIRST
1849      for (ptr = 0; ptr < length; ptr += 2)
1850      {
1851         fliptemp = ROM[ptr];
1852         ROM[ptr] = ROM[ptr+1];
1853         ROM[ptr+1] = fliptemp;
1854      }
1855#endif
1856      state->m_md_cart.last_loaded_image_length = length;
1857      memcpy(&ROM[VIRGIN_COPY_GEN], &ROM[0x000000], MAX_MD_CART_SIZE);  /* store a copy of data */
1858      relocate = 0;
1859
1860   }
1861   /* BIN it is, then */
1862   else
1863   {
1864      relocate = 0x2000;
1865      state->m_md_cart.last_loaded_image_length = length;
1866
1867      for (ptr = 0; ptr < MAX_MD_CART_SIZE + relocate; ptr += 2)      /* mangle bytes for little endian machines */
1868      {
1869#ifdef LSB_FIRST
1870         int temp = ROM[relocate + ptr];
1871
1872         ROM[ptr] = ROM[relocate + ptr + 1];
1873         ROM[ptr + 1] = temp;
1874#else
1875         ROM[ptr] = ROM[relocate + ptr];
1876         ROM[ptr + 1] = ROM[relocate + ptr + 1];
1877#endif
1878      }
1879
1880      memcpy(&ROM[VIRGIN_COPY_GEN], &ROM[0x000000], MAX_MD_CART_SIZE);  /* store a copy of data */
1881   }
1882
1883   // STEP 2: determine the cart type (to deal with pirate mappers & eeprom)
1884
1885   /* Default cartridge type */
1886   state->m_md_cart.type = SEGA_STD;
1887
1888   /* Detect carts which need additional handlers */
1889   {
1890      static const unsigned char smouse_sig[] = { 0x4d, 0xf9, 0x00, 0x40, 0x00, 0x02 },
1891      mjlover_sig[]   = { 0x13, 0xf9, 0x00, 0x40, 0x00, 0x00 }, // move.b  ($400000).l,($FFFF0C).l (partial)
1892      squir_sig[]     = { 0x26, 0x79, 0x00, 0xff, 0x00, 0xfa },
1893      bugsl_sig[]     = { 0x20, 0x12, 0x13, 0xc0, 0x00, 0xff },
1894      sbub_sig[]      = { 0x0c, 0x39, 0x00, 0x55, 0x00, 0x40 }, // cmpi.b  #$55,($400000).l
1895      lk3_sig[]       = { 0x0c, 0x01, 0x00, 0x30, 0x66, 0xe4 },
1896      sdk_sig[]       = { 0x48, 0xe7, 0xff, 0xfe, 0x52, 0x79 },
1897      redcliff_sig[]  = { 0x10, 0x39, 0x00, 0x40, 0x00, 0x04 }, // move.b  ($400004).l,d0
1898      redcl_en_sig[]  = { 0x50, 0x79, 0x40, 0x00, 0x40, 0x44 }, // move.b  ($400004).l,d0
1899      smb_sig[]       = { 0x20, 0x4d, 0x41, 0x52, 0x49, 0x4f },
1900      smb2_sig[]      = { 0x4e, 0xb9, 0x00, 0x0f, 0x25, 0x84 },
1901      kaiju_sig[]     = { 0x19, 0x7c, 0x00, 0x01, 0x00, 0x00 },
1902      chifi3_sig[]    = { 0xb6, 0x16, 0x66, 0x00, 0x00, 0x4a },
1903      lionk2_sig[]    = { 0x26, 0x79, 0x00, 0xff, 0x00, 0xf4 },
1904      rx3_sig[]       = { 0x66, 0x00, 0x00, 0x0e, 0x30, 0x3c },
1905      kof98_sig[]     = { 0x9b, 0xfc, 0x00, 0x00, 0x4a, 0x00 },
1906      s15in1_sig[]    = { 0x22, 0x3c, 0x00, 0xa1, 0x30, 0x00 },
1907      kof99_sig[]     = { 0x20, 0x3c, 0x30, 0x00, 0x00, 0xa1 }, // move.l  #$300000A1,d0
1908      radica_sig[]    = { 0x4e, 0xd0, 0x30, 0x39, 0x00, 0xa1 }, // jmp (a0) move.w ($a130xx),d0
1909      soulb_sig[]     = { 0x33, 0xfc, 0x00, 0x0c, 0x00, 0xff }, // move.w  #$C,($FF020A).l (what happens if check fails)
1910      s19in1_sig[]    = { 0x13, 0xc0, 0x00, 0xa1, 0x30, 0x38 },
1911      rockman_sig[]   = { 0xea, 0x80 };
1912
1913      switch (state->m_md_cart.last_loaded_image_length)
1914      {
1915         case 0x80000:
1916            if (!allendianmemcmp(&ROM[0x08c8], &smouse_sig[0], sizeof(smouse_sig)))
1917               state->m_md_cart.type = SMOUSE;
1918
1919            if (!allendianmemcmp((char *)&ROM[0x7e30e], "SEGA", 4) ||
1920               !allendianmemcmp((char *)&ROM[0x7e100], "SEGA", 4) ||
1921               !allendianmemcmp((char *)&ROM[0x7e1e6], "SEGA", 4))
1922               state->m_md_cart.type = REALTEC;
1923
1924            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-50396", 10)) // NHLPA Hockey 93
1925               state->m_md_cart.type = EA_NHLPA;
1926
1927            if (!allendianmemcmp((char *)&ROM[0x0180], "GM MK-1215", 10)) // Evander Holyfield
1928               state->m_md_cart.type = SEGA_EEPROM;
1929
1930            break;
1931
1932         case 0xc0000:
1933
1934            if (!allendianmemcmp((char *)&ROM[0x0180], "GM G-4060 ", 8)) // Wonder Boy V
1935               state->m_md_cart.type = SEGA_EEPROM;
1936
1937            break;
1938
1939         case 0x100000:
1940            if (!allendianmemcmp(&ROM[0x01b24], &mjlover_sig[0], sizeof(mjlover_sig)))
1941               state->m_md_cart.type = MJLOVER;
1942
1943            if (!allendianmemcmp(&ROM[0x03b4], &squir_sig[0], sizeof(squir_sig)))
1944               state->m_md_cart.type = SQUIRRELK;
1945
1946            if (!allendianmemcmp(&ROM[0xee0d0], &bugsl_sig[0], sizeof(bugsl_sig)))
1947               state->m_md_cart.type = BUGSLIFE;
1948
1949            if (!allendianmemcmp((char *)&ROM[0x0172], "GAME : ELF WOR", 14))
1950               state->m_md_cart.type = ELFWOR;
1951
1952            if (!allendianmemcmp(&ROM[0x123e4], &sbub_sig[0], sizeof(sbub_sig)))
1953               state->m_md_cart.type = SBUBBOB;
1954
1955            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-50176", 10)) // Rings of Power
1956               state->m_md_cart.type = EA_NHLPA;
1957
1958            if (!allendianmemcmp((char *)&ROM[0x0180], "MK 00001211-00", 14)) // Sports Talk Baseball
1959               state->m_md_cart.type = SEGA_EEPROM;
1960
1961            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-120096-", 12)) // Micro Machines 2
1962               state->m_md_cart.type = CODE_MASTERS;
1963
1964            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-120146-", 12)) // Brian Lara Cricket 96 / Shane Wayne Cricket 96
1965               state->m_md_cart.type = CODE_MASTERS;
1966
1967            if (!allendianmemcmp((char *)&ROM[0x0190], "OJKRPTBVFCA     ", 0x10)) // Micro Machines '96 / Military TODO: better way to recognize these?
1968               state->m_md_cart.type = CODE_MASTERS;
1969            break;
1970
1971         case 0x200000:
1972            if (!allendianmemcmp(&ROM[0x18c6], &lk3_sig[0], sizeof(lk3_sig)))
1973               state->m_md_cart.type = LIONK3;
1974
1975            if (!allendianmemcmp(&ROM[0x220], &sdk_sig[0], sizeof(sdk_sig)))
1976               state->m_md_cart.type = SKINGKONG;
1977
1978            if (!allendianmemcmp(&ROM[0xce560], &redcliff_sig[0], sizeof(redcliff_sig)))
1979               state->m_md_cart.type = REDCLIFF;
1980
1981            if (!allendianmemcmp(&ROM[0xc8cb0], &smb_sig[0], sizeof(smb_sig)))
1982               state->m_md_cart.type = SMB;
1983
1984            if (!allendianmemcmp(&ROM[0xf24d6], &smb2_sig[0], sizeof(smb2_sig)))
1985               state->m_md_cart.type = SMB2;
1986
1987            if (!allendianmemcmp(&ROM[0x674e], &kaiju_sig[0], sizeof(kaiju_sig)))
1988               state->m_md_cart.type = KAIJU;
1989
1990            if (!allendianmemcmp(&ROM[0x1780], &chifi3_sig[0], sizeof(chifi3_sig)))
1991               state->m_md_cart.type = CHINFIGHT3;
1992
1993            if (!allendianmemcmp(&ROM[0x03c2], &lionk2_sig[0], sizeof(lionk2_sig)))
1994               state->m_md_cart.type = LIONK2;
1995
1996            if (!allendianmemcmp(&ROM[0xc8b90], &rx3_sig[0], sizeof(rx3_sig)))
1997               state->m_md_cart.type = ROCKMANX3;
1998
1999            if (!allendianmemcmp(&ROM[0x56ae2], &kof98_sig[0], sizeof(kof98_sig)))
2000               state->m_md_cart.type = KOF98;
2001
2002            if (!allendianmemcmp(&ROM[0x17bb2], &s15in1_sig[0], sizeof(s15in1_sig)))
2003               state->m_md_cart.type = MC_SUP15IN1;
2004
2005            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-081326 ", 12)) // NBA Jam
2006               state->m_md_cart.type = NBA_JAM;
2007
2008            if (!allendianmemcmp((char *)&ROM[0x0180], "GM MK-1228", 10)) // Greatest Heavyweight of the Ring
2009               state->m_md_cart.type = SEGA_EEPROM;
2010
2011            if ((!allendianmemcmp((char *)&ROM[0x0180], "GM T-12046", 10)) || // Mega Man
2012               (!allendianmemcmp((char *)&ROM[0x0180], "GM T-12053", 10) && !allendianmemcmp(&ROM[0x18e], &rockman_sig[0], sizeof(rockman_sig)))) // / Rock Man (EEPROM version)
2013               state->m_md_cart.type = SEGA_EEPROM;
2014
2015            break;
2016
2017         case 0x200005:
2018            if (!allendianmemcmp(&ROM[0xce564], &redcl_en_sig[0], sizeof(redcliff_sig)))
2019               state->m_md_cart.type = REDCL_EN;
2020            break;
2021
2022         case 0x300000:
2023            if (!allendianmemcmp(&ROM[0x220], &sdk_sig[0], sizeof(sdk_sig)))
2024               state->m_md_cart.type = SDK99;
2025
2026            if (!allendianmemcmp(&ROM[0x1fd0d2], &kof99_sig[0], sizeof(kof99_sig)))
2027               state->m_md_cart.type = KOF99;
2028
2029            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-81406", 10)) // NBA Jam TE
2030               state->m_md_cart.type = NBA_JAM_TE;
2031
2032            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-081276 ", 12)) // NFL Quarterback Club
2033               state->m_md_cart.type = NBA_JAM_TE;
2034
2035            break;
2036
2037         case 0x400000:
2038            if (!allendianmemcmp(&ROM[0x3c031c], &radica_sig[0], sizeof(radica_sig)) ||
2039               !allendianmemcmp(&ROM[0x3f031c], &radica_sig[0], sizeof(radica_sig))) // ssf+gng + radica vol1
2040               state->m_md_cart.type = RADICA;
2041
2042            if (!allendianmemcmp(&ROM[0x028460], &soulb_sig[0], sizeof(soulb_sig)))
2043               state->m_md_cart.type = SOULBLAD;
2044
2045            if (!allendianmemcmp(&ROM[0x1e700], &s19in1_sig[0], sizeof(s19in1_sig)))
2046               state->m_md_cart.type = MC_SUP19IN1;
2047
2048            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-081586-", 12)) // NFL Quarterback Club 96
2049               state->m_md_cart.type = NFL_QB_96;
2050
2051            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-081576 ", 12)) // College Slam
2052               state->m_md_cart.type = C_SLAM;
2053
2054            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-81476", 10)) // Big Hurt Baseball
2055               state->m_md_cart.type = C_SLAM;
2056
2057            break;
2058
2059         case 0x500000:
2060            if (!allendianmemcmp((char *)&ROM[0x0120], "SUPER STREET FIGHTER2 ", 22))
2061               state->m_md_cart.type = SSF2;
2062            break;
2063         case 0x800000:
2064            if (!allendianmemcmp((char *)&ROM[0x0180], "GM T-574023-", 12)) // Pier Solar
2065               state->m_md_cart.type = PSOLAR;
2066            break;
2067         default:
2068            break;
2069      }
2070   }
2071
2072   return IMAGE_INIT_PASS;
2073}
2074
2075static DEVICE_IMAGE_DISPLAY_INFO(megadriv)
2076{
2077   const char *compatibility = image.get_feature("compatibility");
2078   const char *chips = image.get_feature("addon");
2079   int md_region = megadrive_region_export + (megadrive_region_pal << 1);
2080
2081   if (chips)
2082   {
2083      if (!mame_stricmp(chips, "SVP") && (image.device().machine().device<cpu_device>("svp") == NULL))
2084      {
2085         mame_printf_warning("This software requires emulation of the SVP CPU to work.\n");
2086         mame_printf_warning("It might not work in the system you are using.\n");
2087      }
2088   }
2089
2090   if (compatibility)
2091   {
2092      if (!mame_stricmp(compatibility, "PAL") && (md_region != 3))
2093      {
2094         mame_printf_warning("This software requires a PAL console to work.\n");
2095         mame_printf_warning("It might not work in the system you are using.\n");
2096      }
2097      if (!mame_stricmp(compatibility, "NTSC-J") && (md_region != 0))
2098      {
2099         mame_printf_warning("This software requires a JPN console to work.\n");
2100         mame_printf_warning("It might not work in the system you are using.\n");
2101      }
2102      if (!mame_stricmp(compatibility, "NTSC-U") && (md_region != 1))
2103      {
2104         mame_printf_warning("This software requires a USA console to work.\n");
2105         mame_printf_warning("It might not work in the system you are using.\n");
2106      }
2107      if (!mame_stricmp(compatibility, "EUR-JPN") && (md_region != 0 && md_region != 3))
2108      {
2109         mame_printf_warning("This software requires a PAL or a JPN console to work.\n");
2110         mame_printf_warning("It might not work in the system you are using.\n");
2111      }
2112   }
2113}
2114
2115
2116/*************************************
2117 *  Loading a cart image from softlist
2118 *************************************/
2119
2120static int megadrive_load_list(device_image_interface &image)
2121{
2122   md_cons_state *state = image.device().machine().driver_data<md_cons_state>();
2123   UINT8 *ROM = state->memregion("maincpu")->base();
2124   UINT32 length = image.get_software_region_length("rom");
2125   const char  *pcb_name;
2126   memcpy(ROM, image.get_software_region("rom"), length);
2127
2128   state->m_md_cart.last_loaded_image_length = length;
2129
2130   if ((pcb_name = image.get_feature("pcb_type")) == NULL)
2131      state->m_md_cart.type = SEGA_STD;
2132   else
2133      state->m_md_cart.type = md_get_pcb_id(pcb_name);
2134
2135   memcpy(&ROM[VIRGIN_COPY_GEN], &ROM[0x000000], MAX_MD_CART_SIZE);  /* store a copy of data */
2136
2137   return IMAGE_INIT_PASS;
2138}
2139
2140static DEVICE_IMAGE_LOAD( genesis_cart )
2141{
2142   md_cons_state *state = image.device().machine().driver_data<md_cons_state>();
2143   state->m_md_cart.type = SEGA_STD;
2144   int res;
2145
2146   // STEP 1: load the file image and keep a copy for later banking
2147   // STEP 2: identify the cart type
2148   // The two steps are carried out differently if we are loading from a list or not
2149   if (image.software_entry() == NULL)
2150      res = megadrive_load_nonlist(image);
2151   else
2152      res = megadrive_load_list(image);
2153
2154   logerror("cart type: %d\n", state->m_md_cart.type);
2155
2156   if (res == IMAGE_INIT_PASS)
2157   {
2158      // STEP 3: install memory handlers for this type of cart
2159      setup_megadriv_custom_mappers(image.device().machine());
2160
2161      // STEP 4: take care of SRAM.
2162      setup_megadriv_sram(image);
2163
2164      return IMAGE_INIT_PASS;
2165   }
2166   else
2167      return IMAGE_INIT_FAIL;
2168}
2169
2170/******* SRAM saving *******/
2171
2172static void genesis_machine_stop(running_machine &machine)
2173{
2174   device_image_interface *image = dynamic_cast<device_image_interface *>(machine.device("cart"));
2175   md_cons_state *state = machine.driver_data<md_cons_state>();
2176
2177   /* Write out the battery file if necessary */
2178   if (state->m_md_cart.sram != NULL)
2179   {
2180      mame_printf_debug("Saving sram\n");
2181      image->battery_save(state->m_md_cart.sram, state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1);
2182   }
2183}
2184
2185MACHINE_START( md_sram )
2186{
2187   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(genesis_machine_stop), &machine));
2188}
2189
2190/******* 32X image loading *******/
2191
2192// FIXME: non-softlist loading should keep using ROM_CART_LOAD in the ROM definitions,
2193// once we better integrate softlist with the old loading procedures
2194static DEVICE_IMAGE_LOAD( _32x_cart )
2195{
2196   UINT32 length;
2197   UINT8 *temp_copy;
2198   UINT16 *ROM16;
2199   UINT32 *ROM32;
2200   int i;
2201
2202   if (image.software_entry() == NULL)
2203   {
2204      length = image.length();
2205      temp_copy = auto_alloc_array(image.device().machine(), UINT8, length);
2206      image.fread( temp_copy, length);
2207   }
2208   else
2209   {
2210      length = image.get_software_region_length("rom");
2211      temp_copy = auto_alloc_array(image.device().machine(), UINT8, length);
2212      memcpy(temp_copy, image.get_software_region("rom"), length);
2213   }
2214
2215   /* Copy the cart image in the locations the driver expects */
2216   // Notice that, by using pick_integer, we are sure the code works on both LE and BE machines
2217   ROM16 = (UINT16 *) image.device().machine().root_device().memregion("gamecart")->base();
2218   for (i = 0; i < length; i += 2)
2219      ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
2220
2221   ROM32 = (UINT32 *) image.device().machine().root_device().memregion("gamecart_sh2")->base();
2222   for (i = 0; i < length; i += 4)
2223      ROM32[i / 4] = pick_integer_be(temp_copy, i, 4);
2224
2225   ROM16 = (UINT16 *) image.device().machine().root_device().memregion("maincpu")->base();
2226   for (i = 0x00; i < length; i += 2)
2227      ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
2228
2229   auto_free(image.device().machine(), temp_copy);
2230
2231   return IMAGE_INIT_PASS;
2232}
2233
2234/******* Cart getinfo *******/
2235
2236MACHINE_CONFIG_FRAGMENT( genesis_cartslot )
2237   MCFG_CARTSLOT_ADD("cart")
2238   MCFG_CARTSLOT_EXTENSION_LIST("smd,bin,md,gen")
2239   MCFG_CARTSLOT_MANDATORY
2240   MCFG_CARTSLOT_INTERFACE("megadriv_cart")
2241   MCFG_CARTSLOT_LOAD(genesis_cart)
2242   MCFG_CARTSLOT_DISPLAY_INFO(megadriv)
2243   MCFG_SOFTWARE_LIST_ADD("cart_list","megadriv")
2244MACHINE_CONFIG_END
2245
2246MACHINE_CONFIG_FRAGMENT( _32x_cartslot )
2247   MCFG_CARTSLOT_ADD("cart")
2248   MCFG_CARTSLOT_EXTENSION_LIST("32x,bin")
2249   MCFG_CARTSLOT_MANDATORY
2250   MCFG_CARTSLOT_INTERFACE("_32x_cart")
2251   MCFG_CARTSLOT_LOAD(_32x_cart)
2252   MCFG_SOFTWARE_LIST_ADD("cart_list","32x")
2253MACHINE_CONFIG_END
2254
2255MACHINE_CONFIG_FRAGMENT( pico_cartslot )
2256   MCFG_CARTSLOT_ADD("cart")
2257   MCFG_CARTSLOT_EXTENSION_LIST("bin")
2258   MCFG_CARTSLOT_MANDATORY
2259   MCFG_CARTSLOT_INTERFACE("pico_cart")
2260   MCFG_CARTSLOT_LOAD(genesis_cart)
2261   MCFG_SOFTWARE_LIST_ADD("cart_list","pico")
2262MACHINE_CONFIG_END
trunk/src/mame/machine/megasvp.c
r20695r20696
1/* Megadrive SVP emulation (Virtua Racing) */
2
3#include "includes/megadriv.h"
4
5
6
7/* SVP (virtua racing) */
8cpu_device *_svp_cpu;
9
10
11/****************************************** SVP related *****************************************/
12
13/*
14 * Emulator of memory controller in SVP chip
15 *
16 * Copyright 2008, Grazvydas Ignotas
17 * based on RE work by Tasco Deluxe
18 *
19 * SSP1601 EXT registers are mapped as I/O ports due to their function
20 * (they are interfaced through external bus), and are named as follows
21 * (these are unofficial names, official ones are unknown):
22 *   EXT0: PM0 - programmable register 0
23 *   EXT1: PM1 - ... 1
24 *   EXT2: PM2 - ... 2
25 *   EXT3: XST - external status. Can also act as PM.
26 *   EXT4: PM4 - ... 4
27 *   EXT5: (unused)
28 *   EXT6: PMC - programmable memory register control (PMAC).
29 *   EXT7: AL  - although internal to SSP1601, it still causes bus access
30 *
31 * Depending on GPO bits in status register, PM0, PM1, PM2 and XST can act as
32 * external status registers, os as programmable memory registers. PM4 always
33 * acts as PM register (independent on GPO bits).
34 */
35
36
37#define SSP_PMC_HAVE_ADDR  1  // address written to PMAC, waiting for mode
38#define SSP_PMC_SET        2  // PMAC is set, PMx can be programmed
39
40static int get_inc(int mode)
41{
42   int inc = (mode >> 11) & 7;
43   if (inc != 0) {
44      if (inc != 7) inc--;
45      inc = 1 << inc; // 0 1 2 4 8 16 32 128
46      if (mode & 0x8000) inc = -inc; // decrement mode
47   }
48   return inc;
49}
50
51INLINE void overwrite_write(UINT16 *dst, UINT16 d)
52{
53   if (d & 0xf000) { *dst &= ~0xf000; *dst |= d & 0xf000; }
54   if (d & 0x0f00) { *dst &= ~0x0f00; *dst |= d & 0x0f00; }
55   if (d & 0x00f0) { *dst &= ~0x00f0; *dst |= d & 0x00f0; }
56   if (d & 0x000f) { *dst &= ~0x000f; *dst |= d & 0x000f; }
57}
58
59static UINT32 pm_io(address_space &space, int reg, int write, UINT32 d)
60{
61   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
62   if (state->m_emu_status & SSP_PMC_SET)
63   {
64      state->m_pmac_read[write ? reg + 6 : reg] = state->m_pmc.d;
65      state->m_emu_status &= ~SSP_PMC_SET;
66      return 0;
67   }
68
69   // just in case
70   if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
71      state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
72   }
73
74   if (reg == 4 || (space.device().state().state_int(SSP_ST) & 0x60))
75   {
76      #define CADDR ((((mode<<16)&0x7f0000)|addr)<<1)
77      UINT16 *dram = (UINT16 *)state->m_dram;
78      if (write)
79      {
80         int mode = state->m_pmac_write[reg]>>16;
81         int addr = state->m_pmac_write[reg]&0xffff;
82         if      ((mode & 0x43ff) == 0x0018) // DRAM
83         {
84            int inc = get_inc(mode);
85            if (mode & 0x0400) {
86                  overwrite_write(&dram[addr], d);
87            } else dram[addr] = d;
88            state->m_pmac_write[reg] += inc;
89         }
90         else if ((mode & 0xfbff) == 0x4018) // DRAM, cell inc
91         {
92            if (mode & 0x0400) {
93                  overwrite_write(&dram[addr], d);
94            } else dram[addr] = d;
95            state->m_pmac_write[reg] += (addr&1) ? 31 : 1;
96         }
97         else if ((mode & 0x47ff) == 0x001c) // IRAM
98         {
99            int inc = get_inc(mode);
100            ((UINT16 *)state->m_iram)[addr&0x3ff] = d;
101            state->m_pmac_write[reg] += inc;
102         }
103         else
104         {
105            logerror("ssp FIXME: PM%i unhandled write mode %04x, [%06x] %04x\n",
106                  reg, mode, CADDR, d);
107         }
108      }
109      else
110      {
111         int mode = state->m_pmac_read[reg]>>16;
112         int addr = state->m_pmac_read[reg]&0xffff;
113         if      ((mode & 0xfff0) == 0x0800) // ROM, inc 1, verified to be correct
114         {
115            UINT16 *ROM = (UINT16 *) space.machine().root_device().memregion("maincpu")->base();
116            state->m_pmac_read[reg] += 1;
117            d = ROM[addr|((mode&0xf)<<16)];
118         }
119         else if ((mode & 0x47ff) == 0x0018) // DRAM
120         {
121            int inc = get_inc(mode);
122            d = dram[addr];
123            state->m_pmac_read[reg] += inc;
124         }
125         else
126         {
127            logerror("ssp FIXME: PM%i unhandled read  mode %04x, [%06x]\n",
128                  reg, mode, CADDR);
129            d = 0;
130         }
131      }
132
133      // PMC value corresponds to last PMR accessed (not sure).
134      state->m_pmc.d = state->m_pmac_read[write ? reg + 6 : reg];
135
136      return d;
137   }
138
139   return (UINT32)-1;
140}
141
142static READ16_HANDLER( read_PM0 )
143{
144   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
145   UINT32 d = pm_io(space, 0, 0, 0);
146   if (d != (UINT32)-1) return d;
147   d = state->m_XST2;
148   state->m_XST2 &= ~2; // ?
149   return d;
150}
151
152static WRITE16_HANDLER( write_PM0 )
153{
154   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
155   UINT32 r = pm_io(space, 0, 1, data);
156   if (r != (UINT32)-1) return;
157   state->m_XST2 = data; // ?
158}
159
160static READ16_HANDLER( read_PM1 )
161{
162   UINT32 r = pm_io(space, 1, 0, 0);
163   if (r != (UINT32)-1) return r;
164   logerror("svp: PM1 acces in non PM mode?\n");
165   return 0;
166}
167
168static WRITE16_HANDLER( write_PM1 )
169{
170   UINT32 r = pm_io(space, 1, 1, data);
171   if (r != (UINT32)-1) return;
172   logerror("svp: PM1 acces in non PM mode?\n");
173}
174
175static READ16_HANDLER( read_PM2 )
176{
177   UINT32 r = pm_io(space, 2, 0, 0);
178   if (r != (UINT32)-1) return r;
179   logerror("svp: PM2 acces in non PM mode?\n");
180   return 0;
181}
182
183static WRITE16_HANDLER( write_PM2 )
184{
185   UINT32 r = pm_io(space, 2, 1, data);
186   if (r != (UINT32)-1) return;
187   logerror("svp: PM2 acces in non PM mode?\n");
188}
189
190static READ16_HANDLER( read_XST )
191{
192   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
193   UINT32 d = pm_io(space, 3, 0, 0);
194   if (d != (UINT32)-1) return d;
195
196   return state->m_XST;
197}
198
199static WRITE16_HANDLER( write_XST )
200{
201   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
202   UINT32 r = pm_io(space, 3, 1, data);
203   if (r != (UINT32)-1) return;
204
205   state->m_XST2 |= 1;
206   state->m_XST = data;
207}
208
209static READ16_HANDLER( read_PM4 )
210{
211   return pm_io(space, 4, 0, 0);
212}
213
214static WRITE16_HANDLER( write_PM4 )
215{
216   pm_io(space, 4, 1, data);
217}
218
219static READ16_HANDLER( read_PMC )
220{
221   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
222   if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
223      state->m_emu_status |= SSP_PMC_SET;
224      state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
225      return ((state->m_pmc.w.l << 4) & 0xfff0) | ((state->m_pmc.w.l >> 4) & 0xf);
226   } else {
227      state->m_emu_status |= SSP_PMC_HAVE_ADDR;
228      return state->m_pmc.w.l;
229   }
230}
231
232static WRITE16_HANDLER( write_PMC )
233{
234   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
235   if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
236      state->m_emu_status |= SSP_PMC_SET;
237      state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
238      state->m_pmc.w.h = data;
239   } else {
240      state->m_emu_status |= SSP_PMC_HAVE_ADDR;
241      state->m_pmc.w.l = data;
242   }
243}
244
245static READ16_HANDLER( read_AL )
246{
247   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
248   state->m_emu_status &= ~(SSP_PMC_SET|SSP_PMC_HAVE_ADDR);
249   return 0;
250}
251
252static WRITE16_HANDLER( write_AL )
253{
254}
255
256
257
258static READ16_HANDLER( svp_68k_io_r )
259{
260   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
261   UINT32 d;
262   switch (offset)
263   {
264      // 0xa15000, 0xa15002
265      case 0:
266      case 1:  return state->m_XST;
267      // 0xa15004
268      case 2:  d = state->m_XST2; state->m_XST2 &= ~1; return d;
269      default: logerror("unhandled SVP reg read @ %x\n", offset<<1);
270   }
271   return 0;
272}
273
274static WRITE16_HANDLER( svp_68k_io_w )
275{
276   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
277   switch (offset)
278   {
279      // 0xa15000, 0xa15002
280      case 0:
281      case 1:  state->m_XST = data; state->m_XST2 |= 2; break;
282      // 0xa15006
283      case 3:  break; // possibly halts SSP1601
284      default: logerror("unhandled SVP reg write %04x @ %x\n", data, offset<<1);
285   }
286}
287
288static READ16_HANDLER( svp_68k_cell1_r )
289{
290   // this is rewritten 68k test code
291   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
292   UINT32 a1 = offset;
293   a1 = (a1 & 0x7001) | ((a1 & 0x3e) << 6) | ((a1 & 0xfc0) >> 5);
294   return ((UINT16 *)state->m_dram)[a1];
295}
296
297static READ16_HANDLER( svp_68k_cell2_r )
298{
299   // this is rewritten 68k test code
300   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
301   UINT32 a1 = offset;
302   a1 = (a1 & 0x7801) | ((a1 & 0x1e) << 6) | ((a1 & 0x7e0) >> 4);
303   return ((UINT16 *)state->m_dram)[a1];
304}
305
306ADDRESS_MAP_START( svp_ssp_map, AS_PROGRAM, 16, driver_device )
307   AM_RANGE(0x0000, 0x03ff) AM_ROMBANK("bank3")
308   AM_RANGE(0x0400, 0xffff) AM_ROMBANK("bank4")
309ADDRESS_MAP_END
310
311ADDRESS_MAP_START( svp_ext_map, AS_IO, 16, driver_device )
312   ADDRESS_MAP_GLOBAL_MASK(0xf)
313   AM_RANGE(0*2, 0*2+1) AM_READWRITE_LEGACY(read_PM0, write_PM0)
314   AM_RANGE(1*2, 1*2+1) AM_READWRITE_LEGACY(read_PM1, write_PM1)
315   AM_RANGE(2*2, 2*2+1) AM_READWRITE_LEGACY(read_PM2, write_PM2)
316   AM_RANGE(3*2, 3*2+1) AM_READWRITE_LEGACY(read_XST, write_XST)
317   AM_RANGE(4*2, 4*2+1) AM_READWRITE_LEGACY(read_PM4, write_PM4)
318   AM_RANGE(6*2, 6*2+1) AM_READWRITE_LEGACY(read_PMC, write_PMC)
319   AM_RANGE(7*2, 7*2+1) AM_READWRITE_LEGACY(read_AL, write_AL)
320ADDRESS_MAP_END
321
322
323/* emulate testmode plug */
324static UINT8 megadrive_io_read_data_port_svp(running_machine &machine, int portnum)
325{
326   if (portnum == 0 && machine.root_device().ioport("MEMORY_TEST")->read_safe(0x00))
327   {
328      return (megadrive_io_data_regs[0] & 0xc0);
329   }
330   return megadrive_io_read_data_port_3button(machine, portnum);
331}
332
333
334static READ16_HANDLER( svp_speedup_r )
335{
336      space.device().execute().spin_until_time(attotime::from_usec(100));
337   return 0x0425;
338}
339
340
341void svp_init(running_machine &machine)
342{
343   mdsvp_state *state = machine.driver_data<mdsvp_state>();
344   UINT8 *ROM;
345
346   memset(state->m_pmac_read, 0, ARRAY_LENGTH(state->m_pmac_read));
347   memset(state->m_pmac_write, 0, ARRAY_LENGTH(state->m_pmac_write));
348   state->m_pmc.d = 0;
349   state->m_pmc.w.l = 0;
350   state->m_pmc.w.h = 0;
351   state->m_emu_status = 0;
352   state->m_XST = 0;
353   state->m_XST2 = 0;
354
355   /* SVP stuff */
356   state->m_dram = auto_alloc_array(machine, UINT8, 0x20000);
357   machine.device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x300000, 0x31ffff, state->m_dram);
358   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa15000, 0xa150ff, FUNC(svp_68k_io_r), FUNC(svp_68k_io_w));
359   // "cell arrange" 1 and 2
360   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x390000, 0x39ffff, FUNC(svp_68k_cell1_r));
361   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3a0000, 0x3affff, FUNC(svp_68k_cell2_r));
362
363   machine.device("svp")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x438, 0x438, FUNC(svp_speedup_r));
364
365   state->m_iram = auto_alloc_array(machine, UINT8, 0x800);
366   state->membank("bank3")->set_base(state->m_iram);
367   /* SVP ROM just shares m68k region.. */
368   ROM = state->memregion("maincpu")->base();
369   state->membank("bank4")->set_base(ROM + 0x800);
370
371   megadrive_io_read_data_port_ptr = megadrive_io_read_data_port_svp;
372}
trunk/src/mame/machine/megadriv.c
r20695r20696
3030#include "sound/2612intf.h"
3131
3232#include "sound/dac.h"
33#include "sound/sn76496.h"
3334
34#include "sound/sn76496.h"
3535#include "imagedev/chd_cd.h"
36#include "imagedev/cartslot.h"
37#include "formats/imageutl.h"
38
3639#include "includes/megadriv.h"
3740#include "machine/nvram.h"
3841#include "cpu/ssp1601/ssp1601.h"
r20695r20696
4043#include "machine/megavdp.h"
4144
4245
46MACHINE_CONFIG_EXTERN( megadriv );
4347
4448
4549static cpu_device *_genesis_snd_z80_cpu;
4650int genesis_other_hacks = 0; // misc hacks
4751
4852timer_device* megadriv_scanline_timer;
53cpu_device *_svp_cpu;
4954
5055struct genesis_z80_vars
5156{
r20695r20696
318323{
319324   UINT8 retdata, helper = (megadrive_io_ctrl_regs[portnum] & 0x7f) | 0x80; // bit 7 always comes from megadrive_io_data_regs
320325   static const char *const pad3names[] = { "PAD1", "PAD2", "IN0", "UNK" };
321
326   
322327   if (megadrive_io_data_regs[portnum] & 0x40)
323328   {
324329      /* here we read B, C & the directional buttons */
r20695r20696
885890
886891
887892
888INPUT_PORTS_START( megdsvp )
889   PORT_INCLUDE( megadriv )
890893
891   PORT_START("MEMORY_TEST") /* special memtest mode */
892   /* Region setting for Console */
893   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Test ) )
894   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
895   PORT_DIPSETTING( 0x01, DEF_STR( On ) )
896INPUT_PORTS_END
897
898MACHINE_CONFIG_FRAGMENT( md_svp )
899   MCFG_CPU_ADD("svp", SSP1601, MASTER_CLOCK_NTSC / 7 * 3) /* ~23 MHz (guessed) */
900   MCFG_CPU_PROGRAM_MAP(svp_ssp_map)
901   MCFG_CPU_IO_MAP(svp_ext_map)
902MACHINE_CONFIG_END
903
904MACHINE_CONFIG_DERIVED( megdsvp, megadriv )
905
906   MCFG_CPU_ADD("svp", SSP1601, MASTER_CLOCK_NTSC / 7 * 3) /* ~23 MHz (guessed) */
907   MCFG_CPU_PROGRAM_MAP(svp_ssp_map)
908   MCFG_CPU_IO_MAP(svp_ext_map)
909   /* IRQs are not used by this CPU */
910MACHINE_CONFIG_END
911
912MACHINE_CONFIG_DERIVED( megdsvppal, megadpal )
913
914   MCFG_CPU_ADD("svp", SSP1601, MASTER_CLOCK_PAL / 7 * 3) /* ~23 MHz (guessed) */
915   MCFG_CPU_PROGRAM_MAP(svp_ssp_map)
916   MCFG_CPU_IO_MAP(svp_ext_map)
917   /* IRQs are not used by this CPU */
918MACHINE_CONFIG_END
919
920
921
922
923
924894SCREEN_UPDATE_RGB32(megadriv)
925895{
926896   sega_genesis_vdp_device *vdp = screen.machine().device<sega_genesis_vdp_device>("gen_vdp"); // yuck
r20695r20696
10301000
10311001
10321002
1033UINT16* megadriv_backupram;
1034int megadriv_backupram_length;
1003static UINT16* megadriv_backupram;
1004static int megadriv_backupram_length;
10351005
10361006static NVRAM_HANDLER( megadriv )
10371007{
r20695r20696
11901160   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker",0.25) /* 3.58 MHz */
11911161MACHINE_CONFIG_END
11921162
1193MACHINE_CONFIG_START( megadriv, md_cons_state )
1163MACHINE_CONFIG_START( megadriv, md_base_state )
11941164   MCFG_FRAGMENT_ADD(md_ntsc)
11951165MACHINE_CONFIG_END
11961166
r20695r20696
12451215   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker",0.25) /* 3.58 MHz */
12461216MACHINE_CONFIG_END
12471217
1248MACHINE_CONFIG_START( megadpal, md_cons_state )
1218MACHINE_CONFIG_START( megadpal, md_base_state )
12491219   MCFG_FRAGMENT_ADD(md_pal)
12501220MACHINE_CONFIG_END
12511221
r20695r20696
12951265
12961266MACHINE_CONFIG_END
12971267
1268
1269
1270/******* 32X image loading *******/
1271
1272// FIXME: non-softlist loading should keep using ROM_CART_LOAD in the ROM definitions,
1273// once we better integrate softlist with the old loading procedures
1274static DEVICE_IMAGE_LOAD( _32x_cart )
1275{
1276   UINT32 length;
1277   UINT8 *temp_copy;
1278   UINT16 *ROM16;
1279   UINT32 *ROM32;
1280   int i;
1281   
1282   if (image.software_entry() == NULL)
1283   {
1284      length = image.length();
1285      temp_copy = auto_alloc_array(image.device().machine(), UINT8, length);
1286      image.fread(temp_copy, length);
1287   }
1288   else
1289   {
1290      length = image.get_software_region_length("rom");
1291      temp_copy = auto_alloc_array(image.device().machine(), UINT8, length);
1292      memcpy(temp_copy, image.get_software_region("rom"), length);
1293   }
1294   
1295   /* Copy the cart image in the locations the driver expects */
1296   // Notice that, by using pick_integer, we are sure the code works on both LE and BE machines
1297   ROM16 = (UINT16 *) image.device().machine().root_device().memregion("gamecart")->base();
1298   for (i = 0; i < length; i += 2)
1299      ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
1300   
1301   ROM32 = (UINT32 *) image.device().machine().root_device().memregion("gamecart_sh2")->base();
1302   for (i = 0; i < length; i += 4)
1303      ROM32[i / 4] = pick_integer_be(temp_copy, i, 4);
1304   
1305   ROM16 = (UINT16 *) image.device().machine().root_device().memregion("maincpu")->base();
1306   for (i = 0x00; i < length; i += 2)
1307      ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
1308   
1309   auto_free(image.device().machine(), temp_copy);
1310   
1311   return IMAGE_INIT_PASS;
1312}
1313
1314
1315MACHINE_CONFIG_FRAGMENT( _32x_cartslot )
1316   MCFG_CARTSLOT_ADD("cart")
1317   MCFG_CARTSLOT_EXTENSION_LIST("32x,bin")
1318   MCFG_CARTSLOT_MANDATORY
1319   MCFG_CARTSLOT_INTERFACE("_32x_cart")
1320   MCFG_CARTSLOT_LOAD(_32x_cart)
1321   MCFG_SOFTWARE_LIST_ADD("cart_list","32x")
1322MACHINE_CONFIG_END
1323
1324
1325
12981326struct cdrom_interface scd_cdrom =
12991327{
13001328   "scd_cdrom",
r20695r20696
13621390   _svp_cpu = machine().device<cpu_device>("svp");
13631391   if (_svp_cpu != NULL)
13641392   {
1365      printf("SVP (cpu) found '%s'\n", _svp_cpu->tag() );
1393      printf("SVP (cpu) found '%s'\n", _svp_cpu->tag());
13661394   }
13671395
13681396   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(md_base_state::genesis_int_callback),this));
r20695r20696
14051433      }
14061434      mame_printf_debug("\n");
14071435   }
1408
1409   /* if we have an SVP cpu then do some extra initilization for it */
1410   if (_svp_cpu != NULL)
1411   {
1412      svp_init(machine());
1413   }
1414
1415
14161436}
14171437
14181438DRIVER_INIT_MEMBER(md_base_state,megadriv_c2)
trunk/src/mess/drivers/megadriv.c
r20695r20696
11
22#include "emu.h"
3#include "includes/megadriv.h"
3#include "includes/md.h"
4#include "machine/md_slot.h"
5#include "machine/md_rom.h"
6//#include "machine/md_svp.h"
7#include "machine/md_sk.h"
8#include "machine/md_eeprom.h"
9#include "machine/md_jcart.h"
10#include "machine/md_stm95.h"
411
5class pico_state : public md_cons_state
6{
7public:
8   pico_state(const machine_config &mconfig, device_type type, const char *tag)
9   : md_cons_state(mconfig, type, tag) { }
1012
11   UINT8 m_page_register;
12};
13
1413/*************************************
1514 *
1615 *  Input handlers
r20695r20696
2423   state->m_mess_io_stage[(int)(FPTR)ptr] = -1;
2524}
2625
27/* J-Cart controller port */
28WRITE16_HANDLER( jcart_ctrl_w )
29{
30   md_cons_state *state = space.machine().driver_data<md_cons_state>();
31   state->m_jcart_io_data[0] = (data & 1) << 6;
32   state->m_jcart_io_data[1] = (data & 1) << 6;
33}
34
35READ16_HANDLER( jcart_ctrl_r )
36{
37   md_cons_state *state = space.machine().driver_data<md_cons_state>();
38   UINT16 retdata = 0;
39   UINT8 joy[2];
40
41   if (state->m_jcart_io_data[0] & 0x40)
42   {
43      joy[0] = state->ioport("JCART3_3B")->read_safe(0);
44      joy[1] = state->ioport("JCART4_3B")->read_safe(0);
45      retdata = (state->m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
46   }
47   else
48   {
49      joy[0] = ((state->ioport("JCART3_3B")->read_safe(0) & 0xc0) >> 2) |
50         (state->ioport("JCART3_3B")->read_safe(0) & 0x03);
51      joy[1] = ((state->ioport("JCART4_3B")->read_safe(0) & 0xc0) >> 2) |
52         (state->ioport("JCART4_3B")->read_safe(0) & 0x03);
53      retdata = (state->m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
54   }
55   return retdata;
56}
57
5826static void mess_init_6buttons_pad(running_machine &machine)
5927{
6028   md_cons_state *state = machine.driver_data<md_cons_state>();
r20695r20696
147115   /* Otherwise it's a 3 buttons Joypad */
148116   else
149117   {
150      if (megadrive_io_data_regs[portnum] & 0x40)
118      // handle test input for SVP test
119      if (portnum == 0 && machine.root_device().ioport("MEMORY_TEST")->read_safe(0x00))
151120      {
121         retdata = (megadrive_io_data_regs[0] & 0xc0);
122      }
123      else if (megadrive_io_data_regs[portnum] & 0x40)
124      {
152125         /* here we read B, C & the directional buttons */
153126         retdata = (megadrive_io_data_regs[portnum] & helper_3b) |
154127                  (((state->ioport(pad3names[portnum])->read_safe(0) & 0x3f) | 0x40) & ~helper_3b);
r20695r20696
226199   PORT_CONFNAME( 0xf0, 0x00, "Player 2 Controller" )
227200   PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" )
228201   PORT_CONFSETTING( 0x10, "Joystick 6 Buttons" )
229   PORT_CONFNAME( 0xf00, 0x00, "Player 3 Controller (J-Cart)" )
230   PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" )
231   PORT_CONFNAME( 0xf000, 0x00, "Player 4 Controller (J-Cart)" )
232   PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" )
233202
234203   PORT_START("PAD1_3B")       /* Joypad 1 (3 button + start) NOT READ DIRECTLY */
235204   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
r20695r20696
251220   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 A") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
252221   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
253222
254   PORT_START("JCART3_3B")     /* Joypad 3 on J-Cart (3 button + start) */
255   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
256   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
257   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
258   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
259   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("P3 B") PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
260   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("P3 C") PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
261   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("P3 A") PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
262   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
263
264   PORT_START("JCART4_3B")     /* Joypad 4 on J-Cart (3 button + start) */
265   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
266   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
267   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
268   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
269   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("P4 B") PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
270   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("P4 C") PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
271   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("P4 A") PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
272   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
273
274223   PORT_START("PAD1_6B")       /* Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */
275224   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
276225   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
r20695r20696
317266
318267static MACHINE_START( ms_megadriv )
319268{
269   md_cons_state *state = machine.driver_data<md_cons_state>();
270
320271   mess_init_6buttons_pad(machine);
321   MACHINE_START_CALL( md_sram );
272
273   // small hack, until SVP is converted to be a slot device
274   if (machine.device<cpu_device>("svp") != NULL)
275      svp_init(machine);
276   else
277   {
278      machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7fffff, read16_delegate(FUNC(device_md_cart_interface::read),state->m_slotcart->m_cart), write16_delegate(FUNC(device_md_cart_interface::write),state->m_slotcart->m_cart));
279      machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa13000, 0xa130ff, read16_delegate(FUNC(device_md_cart_interface::read_a13),state->m_slotcart->m_cart), write16_delegate(FUNC(device_md_cart_interface::write_a13),state->m_slotcart->m_cart));
280      machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15000, 0xa150ff, read16_delegate(FUNC(device_md_cart_interface::read_a15),state->m_slotcart->m_cart), write16_delegate(FUNC(device_md_cart_interface::write_a15),state->m_slotcart->m_cart));
281      machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xa14000, 0xa14003, write16_delegate(FUNC(device_md_cart_interface::write_tmss_bank),state->m_slotcart->m_cart));
282   }
322283}
323284
324285static MACHINE_RESET( ms_megadriv )
r20695r20696
326287   MACHINE_RESET_CALL( megadriv );
327288}
328289
290static SLOT_INTERFACE_START(md_cart)
291   SLOT_INTERFACE_INTERNAL("rom",  MD_STD_ROM)
292   SLOT_INTERFACE_INTERNAL("rom_svp",  MD_STD_ROM)
293//   SLOT_INTERFACE_INTERNAL("rom_svp",  MD_ROM_SVP)   // not ready yet...
294   SLOT_INTERFACE_INTERNAL("rom_sk",  MD_ROM_SK)
295// NVRAM handling
296   SLOT_INTERFACE_INTERNAL("rom_sram",  MD_ROM_SRAM)
297   SLOT_INTERFACE_INTERNAL("rom_sramsafe",  MD_ROM_SRAM)
298   SLOT_INTERFACE_INTERNAL("rom_fram",  MD_ROM_FRAM)
299   SLOT_INTERFACE_INTERNAL("rom_beggar",  MD_ROM_BEGGAR)
300// EEPROM handling (not supported fully yet)
301   SLOT_INTERFACE_INTERNAL("rom_eeprom",  MD_STD_EEPROM)
302   SLOT_INTERFACE_INTERNAL("rom_nbajam",  MD_EEPROM_NBAJAM)
303   SLOT_INTERFACE_INTERNAL("rom_nbajamte",  MD_EEPROM_NBAJAMTE)
304   SLOT_INTERFACE_INTERNAL("rom_nflqb",  MD_EEPROM_NFLQB)
305   SLOT_INTERFACE_INTERNAL("rom_cslam",  MD_EEPROM_CSLAM)
306   SLOT_INTERFACE_INTERNAL("rom_nhlpa",  MD_EEPROM_NHLPA)
307   SLOT_INTERFACE_INTERNAL("rom_blara",  MD_EEPROM_BLARA)
308// J-Cart controller (Sampras Tennis)
309   SLOT_INTERFACE_INTERNAL("rom_jcart",  MD_JCART)
310// J-Cart controller + EEPROM handling (not supported fully yet)
311   SLOT_INTERFACE_INTERNAL("rom_codemast",  MD_SEPROM_CODEMAST)
312   SLOT_INTERFACE_INTERNAL("rom_mm96",  MD_SEPROM_MM96)
313// STM95 EEPROM
314   SLOT_INTERFACE_INTERNAL("rom_stm95",  MD_EEPROM_STM95)
315// unique bankswitch
316   SLOT_INTERFACE_INTERNAL("rom_ssf2",  MD_ROM_SSF2)
317   SLOT_INTERFACE_INTERNAL("rom_radica",  MD_ROM_RADICA)
318// pirate mappers (protection and/or bankswitch)
319   SLOT_INTERFACE_INTERNAL("rom_bugs",  MD_ROM_BUGSLIFE)
320   SLOT_INTERFACE_INTERNAL("rom_chinf3",  MD_ROM_CHINF3)
321   SLOT_INTERFACE_INTERNAL("rom_elfwor",  MD_ROM_ELFWOR)
322   SLOT_INTERFACE_INTERNAL("rom_kof98",  MD_ROM_KOF98)
323   SLOT_INTERFACE_INTERNAL("rom_kof99",  MD_ROM_KOF99)
324   SLOT_INTERFACE_INTERNAL("rom_lion2",  MD_ROM_LION2)
325   SLOT_INTERFACE_INTERNAL("rom_lion3",  MD_ROM_LION3)
326   SLOT_INTERFACE_INTERNAL("rom_mcpir",  MD_ROM_MCPIR)
327   SLOT_INTERFACE_INTERNAL("rom_mjlov",  MD_ROM_MJLOV)
328   SLOT_INTERFACE_INTERNAL("rom_pokestad",  MD_ROM_POKESTAD)
329   SLOT_INTERFACE_INTERNAL("rom_realtec",  MD_ROM_REALTEC)
330   SLOT_INTERFACE_INTERNAL("rom_redcl",  MD_ROM_REDCL)
331   SLOT_INTERFACE_INTERNAL("rom_rx3",  MD_ROM_RX3)
332   SLOT_INTERFACE_INTERNAL("rom_sbubl",  MD_ROM_SBUBL)
333   SLOT_INTERFACE_INTERNAL("rom_smb",  MD_ROM_SMB)
334   SLOT_INTERFACE_INTERNAL("rom_smb2",  MD_ROM_SMB2)
335   SLOT_INTERFACE_INTERNAL("rom_smouse",  MD_ROM_SMOUSE)
336   SLOT_INTERFACE_INTERNAL("rom_soulb",  MD_ROM_SOULB)
337   SLOT_INTERFACE_INTERNAL("rom_squir",  MD_ROM_SQUIR)
338   SLOT_INTERFACE_INTERNAL("rom_topf",  MD_ROM_TOPF)
339// these have protection patched out, instead of emulated!
340   SLOT_INTERFACE_INTERNAL("rom_mulan",  MD_STD_ROM)
341   SLOT_INTERFACE_INTERNAL("rom_poke",  MD_STD_ROM)
342   SLOT_INTERFACE_INTERNAL("rom_poke2",  MD_STD_ROM)
343SLOT_INTERFACE_END
344
329345static MACHINE_CONFIG_START( ms_megadriv, md_cons_state )
330346   MCFG_FRAGMENT_ADD( md_ntsc )
331347   MCFG_NVRAM_HANDLER_CLEAR()
r20695r20696
333349   MCFG_MACHINE_START( ms_megadriv )
334350   MCFG_MACHINE_RESET( ms_megadriv )
335351
336   MCFG_FRAGMENT_ADD( genesis_cartslot )
352   MCFG_MD_CARTRIDGE_ADD("mdslot", md_cart, NULL, NULL)
353   MCFG_SOFTWARE_LIST_ADD("cart_list","megadriv")
337354MACHINE_CONFIG_END
338355
339356static MACHINE_CONFIG_START( ms_megadpal, md_cons_state )
r20695r20696
343360   MCFG_MACHINE_START( ms_megadriv )
344361   MCFG_MACHINE_RESET( ms_megadriv )
345362
346   MCFG_FRAGMENT_ADD( genesis_cartslot )
363   MCFG_MD_CARTRIDGE_ADD("mdslot", md_cart, NULL, NULL)
364   MCFG_SOFTWARE_LIST_ADD("cart_list","megadriv")
347365MACHINE_CONFIG_END
348366
349static MACHINE_CONFIG_START( ms_megdsvp, mdsvp_state )
350   MCFG_FRAGMENT_ADD( md_ntsc )
351   MCFG_FRAGMENT_ADD( md_svp )
352   MCFG_NVRAM_HANDLER_CLEAR()
353367
354   MCFG_MACHINE_START( ms_megadriv )
355   MCFG_MACHINE_RESET( ms_megadriv )
356368
357   MCFG_FRAGMENT_ADD( genesis_cartslot )
358MACHINE_CONFIG_END
359369
360static MACHINE_CONFIG_START( ms_megdsvppal, mdsvp_state )
361   MCFG_FRAGMENT_ADD( md_pal )
362   MCFG_FRAGMENT_ADD( md_svp )
363   MCFG_NVRAM_HANDLER_CLEAR()
364
365   MCFG_MACHINE_START( ms_megadriv )
366   MCFG_MACHINE_RESET( ms_megadriv )
367
368   MCFG_FRAGMENT_ADD( genesis_cartslot )
369MACHINE_CONFIG_END
370
371
372
373
374370/*************************************
375371 *
376372 *  ROM definition(s)
r20695r20696
640636   ROM_LOAD( "32x_s_bios.bin", 0x000000,  0x000400, CRC(bfda1fe5) SHA1(4103668c1bbd66c5e24558e73d4f3f92061a109a) )
641637ROM_END
642638
639/****************************************** SVP emulation *****************************************/
643640
641INPUT_PORTS_START( megdsvp )
642   PORT_INCLUDE( megadriv )
643
644   PORT_START("MEMORY_TEST") /* special memtest mode */
645   /* Region setting for Console */
646   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Test ) )
647   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
648   PORT_DIPSETTING( 0x01, DEF_STR( On ) )
649INPUT_PORTS_END
650
651
652static MACHINE_CONFIG_START( megdsvp, mdsvp_state )
653   MCFG_FRAGMENT_ADD( md_ntsc )
654   MCFG_NVRAM_HANDLER_CLEAR()
655
656   MCFG_CPU_ADD("svp", SSP1601, MASTER_CLOCK_NTSC / 7 * 3) /* ~23 MHz (guessed) */
657   MCFG_CPU_PROGRAM_MAP(svp_ssp_map)
658   MCFG_CPU_IO_MAP(svp_ext_map)
659   /* IRQs are not used by this CPU */
660
661   MCFG_MACHINE_START( ms_megadriv )
662   MCFG_MACHINE_RESET( ms_megadriv )
663
664   MCFG_MD_CARTRIDGE_ADD("mdslot", md_cart, NULL, NULL)
665   MCFG_SOFTWARE_LIST_ADD("cart_list","megadriv")
666MACHINE_CONFIG_END
667
668static MACHINE_CONFIG_START( megdsvp_pal, mdsvp_state )
669   MCFG_FRAGMENT_ADD( md_pal )
670   MCFG_NVRAM_HANDLER_CLEAR()
671
672   MCFG_CPU_ADD("svp", SSP1601, MASTER_CLOCK_PAL / 7 * 3) /* ~23 MHz (guessed) */
673   MCFG_CPU_PROGRAM_MAP(svp_ssp_map)
674   MCFG_CPU_IO_MAP(svp_ext_map)
675   /* IRQs are not used by this CPU */
676
677   MCFG_MACHINE_START( ms_megadriv )
678   MCFG_MACHINE_RESET( ms_megadriv )
679
680   MCFG_MD_CARTRIDGE_ADD("mdslot", md_cart, NULL, NULL)
681   MCFG_SOFTWARE_LIST_ADD("cart_list","megadriv")
682MACHINE_CONFIG_END
683
684
644685/****************************************** PICO emulation ****************************************/
645686
646687/*
r20695r20696
828869INPUT_PORTS_END
829870
830871
872static SLOT_INTERFACE_START(pico_cart)
873   SLOT_INTERFACE_INTERNAL("rom",  MD_STD_ROM)
874SLOT_INTERFACE_END
875
876static MACHINE_START(pico)
877{
878   pico_state *state = machine.driver_data<pico_state>();
879   machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7fffff, read16_delegate(FUNC(device_md_cart_interface::read),state->m_picocart->m_cart), write16_delegate(FUNC(device_md_cart_interface::write),state->m_picocart->m_cart));
880   machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa13000, 0xa130ff, read16_delegate(FUNC(device_md_cart_interface::read_a13),state->m_picocart->m_cart), write16_delegate(FUNC(device_md_cart_interface::write_a13),state->m_picocart->m_cart));
881   machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15000, 0xa150ff, read16_delegate(FUNC(device_md_cart_interface::read_a15),state->m_picocart->m_cart), write16_delegate(FUNC(device_md_cart_interface::write_a15),state->m_picocart->m_cart));
882   machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xa14000, 0xa14003, write16_delegate(FUNC(device_md_cart_interface::write_tmss_bank),state->m_picocart->m_cart));
883}
884
831885static MACHINE_CONFIG_START( pico, pico_state )
832886   MCFG_FRAGMENT_ADD( md_ntsc )
833887   MCFG_NVRAM_HANDLER_CLEAR()
r20695r20696
837891
838892   MCFG_DEVICE_REMOVE("genesis_snd_z80")
839893
894   MCFG_MACHINE_START( pico )
840895   MCFG_MACHINE_RESET( ms_megadriv )
841896
842   MCFG_FRAGMENT_ADD( pico_cartslot )
897   MCFG_PICO_CARTRIDGE_ADD("picoslot", pico_cart, NULL, NULL)
898   MCFG_SOFTWARE_LIST_ADD("cart_list","pico")
843899MACHINE_CONFIG_END
844900
845901static MACHINE_CONFIG_START( picopal, pico_state )
r20695r20696
851907
852908   MCFG_DEVICE_REMOVE("genesis_snd_z80")
853909
910   MCFG_MACHINE_START( pico )
854911   MCFG_MACHINE_RESET( ms_megadriv )
855912
856   MCFG_FRAGMENT_ADD( pico_cartslot )
913   MCFG_PICO_CARTRIDGE_ADD("picoslot", pico_cart, NULL, NULL)
914   MCFG_SOFTWARE_LIST_ADD("cart_list","pico")
857915MACHINE_CONFIG_END
858916
859917
r20695r20696
886944
887945// these should not exist, the SVP hardware is in the cart and should be installed dynamically when selected from the Software List
888946// this however involves installing entire CPUs at run/load time and I don't think we can do that.
889CONS( 1993, gensvp,     genesis,   0,      ms_megdsvp,      md, md_cons_state,     genesis,   "Sega",   "Genesis (USA, NTSC, for SVP cart)", 0)
890CONS( 1990, mdsvp,      genesis,   0,      ms_megdsvppal,   md, md_cons_state,     md_eur,    "Sega",   "Mega Drive (Europe, PAL, for SVP cart)", 0)
891CONS( 1988, mdsvpj,     genesis,   0,      ms_megdsvp,      md, md_cons_state,     md_jpn,    "Sega",   "Mega Drive (Japan, NTSC, for SVP cart)", 0)
947CONS( 1993, gensvp,     genesis,   0,      megdsvp,         md, md_cons_state,     genesis,   "Sega",   "Genesis (USA, NTSC, for SVP cart)", 0)
948CONS( 1990, mdsvp,      genesis,   0,      megdsvp_pal,     md, md_cons_state,     md_eur,    "Sega",   "Mega Drive (Europe, PAL, for SVP cart)", 0)
949CONS( 1988, mdsvpj,     genesis,   0,      megdsvp,         md, md_cons_state,     md_jpn,    "Sega",   "Mega Drive (Japan, NTSC, for SVP cart)", 0)
892950
893951// the 32X plugged in the cart slot, games plugged into the 32x.  Maybe it should be handled as an expansion device?
894952CONS( 1994, 32x,        0,         0,      ms_32x,          md, md_cons_state,     genesis,   "Sega",   "Genesis with 32X (USA, NTSC)", GAME_NOT_WORKING )
trunk/src/mess/mess.mak
r20695r20696
455455   $(MAME_MACHINE)/megacd.o \
456456   $(MAME_MACHINE)/megacdcd.o \
457457   $(MAME_MACHINE)/mega32x.o \
458   $(MAME_MACHINE)/megasvp.o \
459458   $(MAME_MACHINE)/megavdp.o \
460459   $(MAME_MACHINE)/dc.o        \
461460   $(MAME_DRIVERS)/naomi.o     \
r20695r20696
16171616
16181617$(MESSOBJ)/sega.a:              \
16191618   $(MESS_DRIVERS)/sg1000.o    \
1620   $(MAME_MACHINE)/md_cart.o   \
1619   $(MESS_MACHINE)/md_slot.o   \
1620   $(MESS_MACHINE)/md_rom.o   \
1621   $(MESS_MACHINE)/md_sk.o   \
1622   $(MESS_MACHINE)/md_eeprom.o   \
1623   $(MESS_MACHINE)/md_jcart.o   \
1624   $(MESS_MACHINE)/md_stm95.o   \
1625   $(MESS_MACHINE)/megasvp.o \
16211626   $(MESS_DRIVERS)/megadriv.o  \
16221627   $(MESS_DRIVERS)/dccons.o    \
16231628   $(MAME_MACHINE)/gdrom.o     \
trunk/src/mess/machine/md_stm95.c
r0r20696
1/***************************************************************************
2
3
4 MegaDrive / Genesis Cart + STM95 EEPROM device
5
6 
7 Emulation by MetalliC, converted to slot by Fabio Priuli
8
9 
10 TO DO: split STM95 to a separate device...
11
12***************************************************************************/
13
14
15#include "emu.h"
16#include "machine/md_stm95.h"
17
18
19void stm95_eeprom_device::set_cs_line(int state)
20{
21   reset_line = state;
22   if (reset_line != CLEAR_LINE)
23   {
24      stream_pos = 0;
25      stm_state = IDLE;
26   }
27}
28
29void stm95_eeprom_device::set_si_line(int state)
30{
31   latch = state;
32}
33
34int stm95_eeprom_device::get_so_line(void)
35{
36   if (stm_state == READING || stm_state == CMD_RDSR)
37      return (stream_data >> 8) & 1;
38   else
39      return 0;
40}
41
42void stm95_eeprom_device::set_sck_line(int state)
43{
44   if (reset_line == CLEAR_LINE)
45   {
46      if (state == ASSERT_LINE && sck_line == CLEAR_LINE)
47      {
48         switch (stm_state)
49         {
50            case IDLE:
51               stream_data = (stream_data << 1) | (latch ? 1 : 0);
52               stream_pos++;
53               if (stream_pos == 8)
54               {
55                  stream_pos = 0;
56                  //printf("STM95 EEPROM: got cmd %02X\n", stream_data&0xff);
57                  switch(stream_data & 0xff)
58                  {
59                     case 0x01:  // write status register
60                        if (WEL != 0)
61                           stm_state = CMD_WRSR;
62                        WEL = 0;
63                        break;
64                     case 0x02:  // write
65                        if (WEL != 0)
66                           stm_state = CMD_WRITE;
67                        stream_data = 0;
68                        WEL = 0;
69                        break;
70                     case 0x03:  // read
71                        stm_state = M95320_CMD_READ;
72                        stream_data = 0;
73                        break;
74                     case 0x04:  // write disable
75                        WEL = 0;
76                        break;
77                     case 0x05:  // read status register
78                        stm_state = CMD_RDSR;
79                        stream_data = WEL<<1;
80                        break;
81                     case 0x06:  // write enable
82                        WEL = 1;
83                        break;
84                     default:
85                        logerror("STM95 EEPROM: unknown cmd %02X\n", stream_data&0xff);
86                  }
87               }
88               break;
89            case CMD_WRSR:
90               stream_pos++;       // just skip, don't care block protection
91               if (stream_pos == 8)
92               {
93                  stm_state = IDLE;
94                  stream_pos = 0;
95               }
96               break;
97            case CMD_RDSR:
98               stream_data = stream_data<<1;
99               stream_pos++;
100               if (stream_pos == 8)
101               {
102                  stm_state = IDLE;
103                  stream_pos = 0;
104               }
105               break;
106            case M95320_CMD_READ:
107               stream_data = (stream_data << 1) | (latch ? 1 : 0);
108               stream_pos++;
109               if (stream_pos == 16)
110               {
111                  eeprom_addr = stream_data & (M95320_SIZE - 1);
112                  stream_data = eeprom_data[eeprom_addr];
113                  stm_state = READING;
114                  stream_pos = 0;
115               }
116               break;
117            case READING:
118               stream_data = stream_data<<1;
119               stream_pos++;
120               if (stream_pos == 8)
121               {
122                  if (++eeprom_addr == M95320_SIZE)
123                     eeprom_addr = 0;
124                  stream_data |= eeprom_data[eeprom_addr];
125                  stream_pos = 0;
126               }
127               break;
128            case CMD_WRITE:
129               stream_data = (stream_data << 1) | (latch ? 1 : 0);
130               stream_pos++;
131               if (stream_pos == 16)
132               {
133                  eeprom_addr = stream_data & (M95320_SIZE - 1);
134                  stm_state = WRITING;
135                  stream_pos = 0;
136               }
137               break;
138            case WRITING:
139               stream_data = (stream_data << 1) | (latch ? 1 : 0);
140               stream_pos++;
141               if (stream_pos == 8)
142               {
143                  eeprom_data[eeprom_addr] = stream_data;
144                  if (++eeprom_addr == M95320_SIZE)
145                     eeprom_addr = 0;
146                  stream_pos = 0;
147               }
148               break;
149         }
150      }
151   }
152   sck_line = state;
153}
154
155
156
157//-------------------------------------------------
158//  md_rom_device - constructor
159//-------------------------------------------------
160
161const device_type MD_EEPROM_STM95 = &device_creator<md_eeprom_stm95_device>;
162
163
164md_eeprom_stm95_device::md_eeprom_stm95_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
165               : device_t(mconfig, type, name, tag, owner, clock),
166               device_md_cart_interface( mconfig, *this )
167{
168}
169
170md_eeprom_stm95_device::md_eeprom_stm95_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
171               : device_t(mconfig, MD_EEPROM_STM95, "MD Cart + EEPROM STM95", tag, owner, clock),
172               device_md_cart_interface( mconfig, *this )
173{
174}
175
176
177void md_eeprom_stm95_device::device_start()
178{
179   m_rdcnt = 0;
180   m_bank[0] = 0;
181   m_bank[1] = 0;
182   m_bank[2] = 0;
183   nvram_alloc(machine(), M95320_SIZE);
184   m_stm95.eeprom_data = (UINT8*)get_nvram_base();
185}
186
187/*-------------------------------------------------
188 mapper specific handlers
189 -------------------------------------------------*/
190
191READ16_MEMBER(md_eeprom_stm95_device::read)
192{
193   if (offset == 0x0015e6/2 || offset == 0x0015e8/2)
194   {
195      // ugly hack until we don't know much about game protection
196      // first 3 reads from 15e6 return 0x00000010, then normal 0x00018010 value for crc check
197      UINT16 res;
198      offset -= 0x0015e6/2;
199      logerror("read 0x15e6 %d\n", m_rdcnt);
200      if (m_rdcnt < 6)
201      {
202         m_rdcnt++;
203         res = offset ? 0x10 : 0;
204      }
205      else
206         res = offset ? 0x8010 : 0x0001;
207      return res;
208   }
209   if (offset < 0x280000/2)
210      return m_rom[offset];
211   else   // last 0x180000 are bankswitched
212   {
213      UINT8 bank = (offset - 0x280000/2) >> 18;
214      return m_rom[(offset & 0x7ffff/2) + (m_bank[bank] * 0x80000)/2];
215   }
216}
217
218READ16_MEMBER(md_eeprom_stm95_device::read_a13)
219{
220   if (offset == 0x0a/2)
221   {
222      return m_stm95.get_so_line() & 1;
223   }
224   return 0xffff;
225}
226
227WRITE16_MEMBER(md_eeprom_stm95_device::write_a13)
228{
229   if (offset == 0x00/2)
230   {
231      logerror("A13001 write %02x\n", data);
232   }
233   else if (offset < 0x08/2)
234   {
235      m_bank[offset - 1] = data & 0x0f;
236   }
237   else if (offset < 0x0a/2)
238   {
239      m_stm95.set_si_line(BIT(data, 0));
240      m_stm95.set_sck_line(BIT(data, 1));
241      m_stm95.set_halt_line(BIT(data, 2));
242      m_stm95.set_cs_line(BIT(data, 3));
243   }
244}
245
Property changes on: trunk/src/mess/machine/md_stm95.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/md_stm95.h
r0r20696
1#ifndef __MD_STM95_H
2#define __MD_STM95_H
3
4#include "machine/md_slot.h"
5
6//**************************************************************************
7//  TYPE DEFINITIONS
8//**************************************************************************
9
10/* ST M95320 32Kbit serial EEPROM implementation */
11// TO DO: STM95 should be made a separate EEPROM device and this should be merged with md_eeprom.c!
12
13#define M95320_SIZE 0x1000
14
15enum STMSTATE
16{
17   IDLE = 0,
18   CMD_WRSR,
19   CMD_RDSR,
20   M95320_CMD_READ,
21   CMD_WRITE,
22   READING,
23   WRITING
24};
25
26class stm95_eeprom_device
27{
28public:
29   stm95_eeprom_device() :
30   stm_state(IDLE),
31   stream_pos(0)
32   {};
33   
34   UINT8   *eeprom_data;
35   void    set_cs_line(int);
36   void    set_halt_line(int state) {}; // not implemented
37   void    set_si_line(int);
38   void    set_sck_line(int state);
39   int     get_so_line(void);
40
41protected:
42   int     latch;
43   int     reset_line;
44   int     sck_line;
45   int     WEL;
46   
47   STMSTATE    stm_state;
48   int     stream_pos;
49   int     stream_data;
50   int     eeprom_addr;
51};
52
53
54// ======================> md_eeprom_stm95_device
55
56class md_eeprom_stm95_device : public device_t,
57                 public device_md_cart_interface
58{
59public:
60   // construction/destruction
61   md_eeprom_stm95_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
62   md_eeprom_stm95_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
63   
64   // device-level overrides
65   virtual void device_start();
66   virtual void device_config_complete() { m_shortname = "md_eeprom_stm95"; }
67     
68   // reading and writing
69   virtual DECLARE_READ16_MEMBER(read);
70   virtual DECLARE_READ16_MEMBER(read_a13);
71   virtual DECLARE_WRITE16_MEMBER(write_a13);
72
73private:
74   UINT8 m_bank[3];
75   int m_rdcnt;
76
77   stm95_eeprom_device m_stm95;
78};
79
80
81// device type definition
82extern const device_type MD_EEPROM_STM95;
83
84#endif
Property changes on: trunk/src/mess/machine/md_stm95.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/md_slot.c
r0r20696
1/***********************************************************************************************************
2 
3
4    MegaDrive cart emulation
5    (through slot devices)
6
7    The driver exposes address ranges
8   0x000000-0x7fffff to read/write (typically cart data, possibly banked, and some protection)
9   0x130000-0x1300ff to read_a13/write_a13 (typically SRAM toggling or protection)
10   0x150000-0x1500ff to read_a15/write_a15 (for SVP registers, not converted yet to slots)
11 
12    currently available slot devices:
13    md_rom: standard carts + carts with NVRAM (SRAM/FRAM) + pirate carts with protection & bankswitch
14    md_eeprom: carts + I2C EEPROM (EEPROM device hooked up only, support to be completed)
15   md_jcart: Codemasters J-Cart & J-Cart+SEPROM (again, EEPROM device hooked up only, support to be completed)
16   md_sk: Sonic & Knuckles pass-thorugh cart (enables a second slot to mount any other cart)
17   md_stm95: cart + STM95 EEPROM (e.g. Pier Solar)
18
19 TODO: currently read access in 0x000000-0x7fffff are not masked (so we assume that no game attempts to
20       read beyond its ROM size). A regression test is pending to identify which games need this and mirror
21       them properly (Eke's doc states ROM data should be mirrored), but none of the ~120 games I tried
22       attempted that and a testcase would be appreciated
23 
24 ***********************************************************************************************************/
25
26
27#include "emu.h"
28#include "machine/md_slot.h"
29
30//**************************************************************************
31//  GLOBAL VARIABLES
32//**************************************************************************
33
34const device_type MD_CART_SLOT = &device_creator<md_cart_slot_device>;
35const device_type PICO_CART_SLOT = &device_creator<pico_cart_slot_device>;
36const device_type MD_SUBCART_SLOT = &device_creator<md_subcart_slot_device>;
37
38
39//**************************************************************************
40//    MD cartridges Interface
41//**************************************************************************
42
43//-------------------------------------------------
44//  device_md_cart_interface - constructor
45//-------------------------------------------------
46
47device_md_cart_interface::device_md_cart_interface(const machine_config &mconfig, device_t &device)
48   : device_slot_card_interface(mconfig, device),
49      m_rom(NULL),
50      m_nvram(NULL),
51      m_rom_size(0),
52      m_nvram_size(0)
53{
54}
55
56
57//-------------------------------------------------
58//  ~device_md_cart_interface - destructor
59//-------------------------------------------------
60
61device_md_cart_interface::~device_md_cart_interface()
62{
63}
64
65//-------------------------------------------------
66//  rom_alloc - alloc the space for the cart
67//-------------------------------------------------
68
69void device_md_cart_interface::rom_alloc(running_machine &machine, size_t size)
70{
71   if (m_rom == NULL)
72   {
73      m_rom = auto_alloc_array_clear(machine, UINT16, size/sizeof(UINT16));
74      m_rom_size = size;
75   }
76}
77
78
79//-------------------------------------------------
80//  nvram_alloc - alloc the space for the nvram
81//-------------------------------------------------
82
83void device_md_cart_interface::nvram_alloc(running_machine &machine, size_t size)
84{
85   if (m_nvram == NULL)
86   {
87      m_nvram = auto_alloc_array_clear(machine, UINT16, size/sizeof(UINT16));
88      m_nvram_size = size;
89   }
90}
91
92
93//**************************************************************************
94//  LIVE DEVICE
95//**************************************************************************
96
97//-------------------------------------------------
98//  base_md_cart_slot_device - constructor
99//-------------------------------------------------
100base_md_cart_slot_device::base_md_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
101                  device_t(mconfig, type, name, tag, owner, clock),
102                  device_image_interface(mconfig, *this),
103                  device_slot_interface(mconfig, *this),
104                  m_type(SEGA_STD)
105{
106}
107
108md_cart_slot_device::md_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
109                  base_md_cart_slot_device(mconfig, MD_CART_SLOT, "MD Cartridge Slot", tag, owner, clock)
110{
111}
112
113md_subcart_slot_device::md_subcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
114                  base_md_cart_slot_device(mconfig, MD_SUBCART_SLOT, "MD Cartridge SubSlot", tag, owner, clock)
115{
116}
117
118pico_cart_slot_device::pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
119                  base_md_cart_slot_device(mconfig, PICO_CART_SLOT, "Pico Cartridge Slot", tag, owner, clock)
120{
121}
122
123//-------------------------------------------------
124//  base_md_cart_slot_device - destructor
125//-------------------------------------------------
126
127base_md_cart_slot_device::~base_md_cart_slot_device()
128{
129}
130
131//-------------------------------------------------
132//  device_start - device-specific startup
133//-------------------------------------------------
134
135void base_md_cart_slot_device::device_start()
136{
137   m_cart = dynamic_cast<device_md_cart_interface *>(get_card_device());
138}
139
140//-------------------------------------------------
141//  device_config_complete - perform any
142//  operations now that the configuration is
143//  complete
144//-------------------------------------------------
145
146void base_md_cart_slot_device::device_config_complete()
147{
148   // set brief and instance name
149   update_names();
150}
151
152
153//-------------------------------------------------
154//  MD PCB
155//-------------------------------------------------
156
157
158struct md_slot
159{
160   int                     pcb_id;
161   const char              *slot_option;
162};
163
164// Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it
165static const md_slot slot_list[] =
166{
167   { SEGA_SK, "rom_sk" },
168   { SEGA_STD, "rom_svp"},
169//   { SEGA_SVP, "rom_svp"},      // not ready yet...
170
171   { SEGA_SRAM, "rom_sram" },
172   { SEGA_FRAM, "rom_fram" },
173   { BEGGAR, "rom_beggar"},
174   
175   { SEGA_EEPROM, "rom_eeprom" },
176   { NBA_JAM, "rom_nbajam" },
177   { NBA_JAM_TE, "rom_nbajamte" },
178   { NFL_QB_96, "rom_nflqb" },
179   { C_SLAM, "rom_cslam" },
180   { EA_NHLPA, "rom_nhlpa" },
181   { BRIAN_LARA, "rom_blara" },
182   
183   { CM_JCART, "rom_jcart" },
184   { CODE_MASTERS, "rom_codemast" },
185   { CM_MM96, "rom_mm96" },
186
187   { PSOLAR, "rom_stm95"},
188   
189   { SSF2, "rom_ssf2" },
190   { RADICA, "rom_radica" },
191//   { GAME_KANDUME, "rom_gkand" },   // what's needed by this?
192   
193   { BUGSLIFE, "rom_bugs" },
194   { CHINFIGHT3, "rom_chinf3" },
195   { ELFWOR, "rom_elfwor" },
196   { KAIJU, "rom_pokestad" },
197   { KOF98, "rom_kof98" },
198   { KOF99, "rom_kof99" },
199   { LIONK2, "rom_lion2" },
200   { LIONK3, "rom_lion3" },
201   { MC_PIRATE, "rom_mcpir" },
202   { MJLOVER, "rom_mjlov" },
203   { MULAN, "rom_mulan"},
204   { POKEMON, "rom_poke"},
205   { POKEMON2, "rom_poke2"},
206   { REALTEC, "rom_realtec" },
207   { REDCL_EN, "rom_redcl" },
208   { REDCLIFF, "rom_redcl" },
209   { ROCKMANX3, "rom_rx3" },
210   { SBUBBOB, "rom_sbubl" },
211   { SMB, "rom_smb" },
212   { SMB2, "rom_smb2" },
213   { SMOUSE, "rom_smouse" },
214   { SOULBLAD, "rom_soulblad" },
215   { SQUIRRELK, "rom_squir" },
216   { TOPFIGHTER, "rom_topf" },
217
218   { SEGA_SRAM_FULLPATH, "rom_sram" },
219   { SEGA_SRAM_FALLBACK, "rom_sramsafe" }
220};
221
222static int md_get_pcb_id(const char *slot)
223{
224   for (int i = 0; i < ARRAY_LENGTH(slot_list); i++)
225   {
226      if (!mame_stricmp(slot_list[i].slot_option, slot))
227         return slot_list[i].pcb_id;
228   }
229   
230   return SEGA_STD;
231}
232
233static const char *md_get_slot(int type)
234{
235   for (int i = 0; i < ARRAY_LENGTH(slot_list); i++)
236   {
237      if (slot_list[i].pcb_id == type)
238         return slot_list[i].slot_option;
239   }
240   
241   return "rom";
242}
243
244
245/*-------------------------------------------------
246 SRAM handling
247 -------------------------------------------------*/
248
249/*-------------------------------------------------
250 call load
251 -------------------------------------------------*/
252
253
254bool base_md_cart_slot_device::call_load()
255{
256   if (m_cart)
257   {
258      m_type = SEGA_STD;
259      int res;
260     
261      // STEP 1: load the file image and keep a copy for later banking
262      // STEP 2: identify the cart type
263      // The two steps are carried out differently if we are loading from a list or not
264      if (software_entry() == NULL)
265         res = load_nonlist();
266      else
267         res = load_list();
268     
269      //printf("cart type: %d\n", m_type);
270     
271      if (res == IMAGE_INIT_PASS)
272      {
273         // STEP 3: install memory handlers for this type of cart
274         setup_custom_mappers();
275         
276         // STEP 4: take care of SRAM.
277         setup_nvram();
278
279         if (m_cart->get_nvram_size())
280            battery_load(m_cart->get_nvram_base(), m_cart->get_nvram_size(), 0xff);
281      }
282
283      return res;
284
285   }
286   
287   return IMAGE_INIT_PASS;
288}
289
290
291int base_md_cart_slot_device::load_list()
292{
293   UINT16 *ROM;
294   UINT32 length = get_software_region_length("rom");
295   const char  *slot_name;
296
297   m_cart->rom_alloc(machine(), length);   
298   ROM = m_cart->get_rom_base();
299   memcpy(ROM, get_software_region("rom"), length);
300   
301   if ((slot_name = get_feature("slot")) == NULL)
302      m_type = SEGA_STD;
303   else
304      m_type = md_get_pcb_id(slot_name);
305   
306   return IMAGE_INIT_PASS;
307}
308
309
310/*************************************
311 *  Helper function: Detect SMD file
312 *************************************/
313
314/* code taken directly from GoodGEN by Cowering */
315static int genesis_is_SMD(unsigned char *buf,unsigned int len)
316{
317   if (buf[0x2080] == 'S' && buf[0x80] == 'E' && buf[0x2081] == 'G' && buf[0x81] == 'A')
318      return 1;
319
320   /* aq quiz */
321   if (!strncmp("UZ(-01  ", (const char *) &buf[0xf0], 8))
322      return 1;
323   
324   /* Phelios USA redump */
325   /* target earth */
326   /* klax (namcot) */
327   if (buf[0x2080] == ' ' && buf[0x0080] == 'S' && buf[0x2081] == 'E' && buf[0x0081] == 'G')
328      return 1;
329   
330   /* jap baseball 94 */
331   if (!strncmp("OL R-AEAL", (const char *) &buf[0xf0], 9))
332      return 1;
333   
334   /* devilish Mahjong Tower */
335   if (!strncmp("optrEtranet", (const char *) &buf[0xf3], 11))
336      return 1;
337   
338   /* golden axe 2 beta */
339   if (buf[0x0100] == 0x3c && buf[0x0101] == 0 && buf[0x0102] == 0 && buf[0x0103] == 0x3c)
340      return 1;
341   
342   /* omega race */
343   if (!strncmp("OEARC   ", (const char *) &buf[0x90], 8))
344      return 1;
345   
346   /* budokan beta */
347   if ((len >= 0x6708 + 8) && !strncmp(" NTEBDKN", (const char *) &buf[0x6708], 8))
348      return 1;
349   
350   /* cdx pro 1.8 bios */
351   if (!strncmp("so fCXP", (const char *) &buf[0x2c0], 7))
352      return 1;
353   
354   /* ishido (hacked) */
355   if (!strncmp("sio-Wyo ", (const char *) &buf[0x0090], 8))
356      return 1;
357   
358   /* onslaught */
359   if (!strncmp("SS  CAL ", (const char *) &buf[0x0088], 8))
360      return 1;
361   
362   /* tram terror pirate */
363   if ((len >= 0x3648 + 8) && !strncmp("SG NEPIE", (const char *) &buf[0x3648], 8))
364      return 1;
365   
366   /* breath of fire 3 chinese */
367   if (buf[0x0007] == 0x1c && buf[0x0008] == 0x0a && buf[0x0009] == 0xb8 && buf[0x000a] == 0x0a)
368      return 1;
369   
370   /*tetris pirate */
371   if ((len >= 0x1cbe + 5) && !strncmp("@TTI>", (const char *) &buf[0x1cbe], 5))
372      return 1;
373   
374   return 0;
375}
376
377/*************************************
378 *  Loading a cart image *not* from
379 *  softlist
380 *************************************/
381
382int base_md_cart_slot_device::load_nonlist()
383{
384   unsigned char *ROM, *tmpROM;
385   UINT32 len = length();
386
387   // this contains an hack for SSF2: its current bankswitch code needs larger rom space to work
388   m_cart->rom_alloc(machine(), (len == 0x500000) ? 0x900000 : len);
389
390   ROM = (unsigned char *)m_cart->get_rom_base();
391   tmpROM = global_alloc_array(unsigned char, len);
392   
393   // STEP 1: determine the file type (SMD? MD? BIN?)
394   fread(tmpROM, len);
395
396   /* is this a SMD file? */
397   if (genesis_is_SMD(&tmpROM[0x200], len))
398   {
399      mame_printf_debug("SMD!\n");
400     
401      for (int ptr = 0; ptr < (len - 0x200) / 0x2000; ptr += 2)
402      {
403         for (int x = 0; x < 0x2000; x++)
404         {
405            *ROM++ = *(tmpROM + 0x200 + ((ptr + 1) * 0x2000) + x);
406            *ROM++ = *(tmpROM + 0x200 + ((ptr + 0) * 0x2000) + x);
407         }
408      }
409     
410      len -= 0x200;
411   }
412   /* is this a MD file? */
413   else if ((tmpROM[0x80] == 'E') && (tmpROM[0x81] == 'A') && (tmpROM[0x82] == 'M' || tmpROM[0x82] == 'G'))
414   {
415      mame_printf_debug("MD!\n");
416     
417      for (int ptr = 0; ptr < len; ptr += 2)
418      {
419         ROM[ptr] = tmpROM[(len >> 1) + (ptr >> 1)];
420         ROM[ptr + 1] = tmpROM[(ptr >> 1)];
421      }
422   }
423   /* BIN it is, then */
424   else
425   {
426      fseek(0, SEEK_SET);
427      fread(ROM, len);
428   }
429
430   global_free(tmpROM);
431
432   // STEP 2: determine the cart type (to deal with pirate mappers & eeprom)
433   m_type = get_cart_type(ROM, len);
434
435#ifdef LSB_FIRST
436   unsigned char fliptemp;
437   // is this really needed nowadays?
438   for (int ptr = 0; ptr < len; ptr += 2)
439   {
440      fliptemp = ROM[ptr];
441      ROM[ptr] = ROM[ptr+1];
442      ROM[ptr+1] = fliptemp;
443   }
444#endif   
445
446   return IMAGE_INIT_PASS;
447}
448
449/*-------------------------------------------------
450 call_unloadload
451 -------------------------------------------------*/
452
453void base_md_cart_slot_device::call_unload()
454{
455   if (m_cart->get_nvram_size())
456      battery_save(m_cart->get_nvram_base(), m_cart->get_nvram_size());
457}
458
459
460void base_md_cart_slot_device::setup_custom_mappers()
461{
462   UINT16 *ROM16 = m_cart->get_rom_base();
463
464   switch (m_type)
465   {
466      case SSF2:
467         // copy the image in 0x400000-0x900000 and keep the beginning for bankswitch
468         for (int x = 0x500000/2; x > 0; x--)
469            ROM16[x + 0x400000/2 - 1] = ROM16[x - 1];
470         for (int x = 0; x < 0x400000/2; x++)
471            ROM16[x] = ROM16[x + 0x400000/2];
472         break;
473      case REDCL_EN:
474         // decrypt
475         for (int x = 0; x < 0x200000/2; x++)
476            ROM16[x] = ROM16[x + 2] ^ 0x4040;
477         break;
478
479      // patch out protection in a bunch of titles...
480      case POKEMON:
481         /*todo: emulate protection instead
482          0dd19e:47f8
483          0dd1a0:fff0
484          0dd1a2:4e63
485          0dd46e:4ef8
486          0dd470:0300
487          0dd49c:6002
488          */
489         /* you need to return 1 @ 0xa13002 and 0???1f @ 0xa1303e (it does word reads). */
490         ROM16[0x0dd19e/2] = 0x47f8;
491         ROM16[0x0dd1a0/2] = 0xfff0;
492         ROM16[0x0dd1a2/2] = 0x4e63;
493         ROM16[0x0dd46e/2] = 0x4ef8;
494         ROM16[0x0dd470/2] = 0x0300;
495         ROM16[0x0dd49c/2] = 0x6002;
496         break;
497      case POKEMON2:
498         /*todo: emulate protection instead
499          006036:e000
500          002540:6026
501          001ed0:6026
502          002476:6022         
503          */
504         ROM16[0x06036/2] = 0xe000;
505         ROM16[0x02540/2] = 0x6026;
506         ROM16[0x01ed0/2] = 0x6026;
507         ROM16[0x02476/2] = 0x6022;
508         ROM16[0x7e300/2] = 0x60fe;
509         break;
510      case MULAN:
511         /*todo: emulate protection instead
512          006036:e000
513          +more?
514          */
515         //  ROM16[0x01ed0/2] = 0xe000;
516         //  ROM16[0x02540/2] = 0xe000;
517         ROM16[0x06036/2] = 0xe000;
518         break;
519   }   
520}
521
522void base_md_cart_slot_device::setup_nvram()
523{
524   UINT8 *ROM = (UINT8 *)m_cart->get_rom_base();
525   m_cart->m_nvram_readonly = 0;
526   m_cart->m_nvram_active = 0;
527   m_cart->m_nvram_handlers_installed = 0;
528
529   /* install SRAM & i2c handlers for the specific type of cart */
530   switch (m_type)
531   {
532      // These types only come from fullpath loading
533      case SEGA_SRAM_FULLPATH:
534         m_cart->m_nvram_start = (ROM[0x1b5] << 24 | ROM[0x1b4] << 16 | ROM[0x1b7] << 8 | ROM[0x1b6]);
535         m_cart->m_nvram_end = (ROM[0x1b9] << 24 | ROM[0x1b8] << 16 | ROM[0x1bb] << 8 | ROM[0x1ba]);
536         logerror("SRAM detected from header: starting location %X - SRAM Length %X\n", m_cart->m_nvram_start, m_cart->m_nvram_end - m_cart->m_nvram_start + 1);
537         
538         // We assume at most 64k of SRAM. is this correct?
539         if ((m_cart->m_nvram_start > m_cart->m_nvram_end) || ((m_cart->m_nvram_end - m_cart->m_nvram_start) >= 0x10000))   
540            m_cart->m_nvram_end = m_cart->m_nvram_start + 0xffff;
541         
542         if (m_cart->m_nvram_start & 1)
543            m_cart->m_nvram_start -= 1;
544         
545         if (!(m_cart->m_nvram_end & 1))
546            m_cart->m_nvram_end += 1;
547         
548         m_cart->nvram_alloc(machine(), m_cart->m_nvram_end - m_cart->m_nvram_start + 1);
549         if (m_cart->m_rom_size <= m_cart->m_nvram_start)
550            m_cart->m_nvram_active = 1;
551         m_cart->m_nvram_handlers_installed = 1;         
552         // don't trust too much header?
553         m_cart->m_nvram_start &= 0x3fffff;
554         m_cart->m_nvram_end &= 0x3fffff;
555         break;
556      case SEGA_SRAM_FALLBACK:
557         m_cart->m_nvram_start = 0x200000;
558         m_cart->m_nvram_end = m_cart->m_nvram_start + 0xffff;
559         m_cart->nvram_alloc(machine(), m_cart->m_nvram_end - m_cart->m_nvram_start + 1);
560         if (m_cart->m_rom_size <= m_cart->m_nvram_start)
561            m_cart->m_nvram_active = 1;
562         break;
563         
564      // These types only come from softlist loading
565      case SEGA_SRAM:
566         m_cart->m_nvram_start = 0x200000;
567         m_cart->m_nvram_end = m_cart->m_nvram_start + get_software_region_length("sram") - 1;
568         m_cart->nvram_alloc(machine(), m_cart->m_nvram_end - m_cart->m_nvram_start + 1);
569         if (m_cart->m_rom_size <= m_cart->m_nvram_start)
570            m_cart->m_nvram_active = 1;
571         m_cart->m_nvram_handlers_installed = 1;
572         break;
573      case SEGA_FRAM:
574         m_cart->m_nvram_start = 0x200000;
575         m_cart->m_nvram_end = m_cart->m_nvram_start + get_software_region_length("fram") - 1;
576         m_cart->nvram_alloc(machine(), m_cart->m_nvram_end - m_cart->m_nvram_start + 1);
577         m_cart->m_nvram_active = 1;
578         m_cart->m_nvram_handlers_installed = 1;
579         break;
580
581      // These types might come from both (pending proper id routines)
582      case BEGGAR:
583         m_cart->m_nvram_start = 0x400000;
584         m_cart->m_nvram_end = m_cart->m_nvram_start + 0xffff;
585         m_cart->nvram_alloc(machine(), m_cart->m_nvram_end - m_cart->m_nvram_start + 1);
586         m_cart->m_nvram_active = 1;
587         m_cart->m_nvram_handlers_installed = 1;
588         break;
589   }
590}
591
592
593
594/*-------------------------------------------------
595 call softlist load
596 -------------------------------------------------*/
597
598bool base_md_cart_slot_device::call_softlist_load(char *swlist, char *swname, rom_entry *start_entry)
599{
600   load_software_part_region(this, swlist, swname, start_entry );
601   return TRUE;
602}
603
604int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
605{
606   int type = SEGA_STD;
607
608   /* Detect carts which need additional handlers */
609   static const unsigned char smouse_sig[] = { 0x4d, 0xf9, 0x00, 0x40, 0x00, 0x02 },
610   mjlover_sig[]   = { 0x13, 0xf9, 0x00, 0x40, 0x00, 0x00 }, // move.b  ($400000).l,($FFFF0C).l (partial)
611   squir_sig[]     = { 0x26, 0x79, 0x00, 0xff, 0x00, 0xfa },
612   bugsl_sig[]     = { 0x20, 0x12, 0x13, 0xc0, 0x00, 0xff },
613   sbub_sig[]      = { 0x0c, 0x39, 0x00, 0x55, 0x00, 0x40 }, // cmpi.b  #$55,($400000).l
614   lk3_sig[]       = { 0x0c, 0x01, 0x00, 0x30, 0x66, 0xe4 },
615   sdk_sig[]       = { 0x48, 0xe7, 0xff, 0xfe, 0x52, 0x79 },
616   redcliff_sig[]  = { 0x10, 0x39, 0x00, 0x40, 0x00, 0x04 }, // move.b  ($400004).l,d0
617   redcl_en_sig[]  = { 0x50, 0x79, 0x40, 0x00, 0x40, 0x44 }, // move.b  ($400004).l,d0
618   smb_sig[]       = { 0x20, 0x4d, 0x41, 0x52, 0x49, 0x4f },
619   smb2_sig[]      = { 0x4e, 0xb9, 0x00, 0x0f, 0x25, 0x84 },
620   kaiju_sig[]     = { 0x19, 0x7c, 0x00, 0x01, 0x00, 0x00 },
621   chifi3_sig[]    = { 0xb6, 0x16, 0x66, 0x00, 0x00, 0x4a },
622   lionk2_sig[]    = { 0x26, 0x79, 0x00, 0xff, 0x00, 0xf4 },
623   rx3_sig[]       = { 0x66, 0x00, 0x00, 0x0e, 0x30, 0x3c },
624   kof98_sig[]     = { 0x9b, 0xfc, 0x00, 0x00, 0x4a, 0x00 },
625   s15in1_sig[]    = { 0x22, 0x3c, 0x00, 0xa1, 0x30, 0x00 },
626   kof99_sig[]     = { 0x20, 0x3c, 0x30, 0x00, 0x00, 0xa1 }, // move.l  #$300000A1,d0
627   radica_sig[]    = { 0x4e, 0xd0, 0x30, 0x39, 0x00, 0xa1 }, // jmp (a0) move.w ($a130xx),d0
628   soulb_sig[]     = { 0x33, 0xfc, 0x00, 0x0c, 0x00, 0xff }, // move.w  #$C,($FF020A).l (what happens if check fails)
629   s19in1_sig[]    = { 0x13, 0xc0, 0x00, 0xa1, 0x30, 0x38 },
630   rockman_sig[]   = { 0xea, 0x80 };
631   
632   switch (len)
633   {           
634      case 0x80000:
635         if (!memcmp(&ROM[0x08c8], smouse_sig, sizeof(smouse_sig)))
636            type = SMOUSE;
637         
638         if (!memcmp((char *)&ROM[0x7e30e], "SEGA", 4) ||
639            !memcmp((char *)&ROM[0x7e100], "SEGA", 4) ||
640            !memcmp((char *)&ROM[0x7e1e6], "SEGA", 4))
641            type = REALTEC;
642         
643         if (!memcmp((char *)&ROM[0x0180], "GM T-50396", 10)) // NHLPA Hockey 93
644            type = EA_NHLPA;
645         
646         if (!memcmp((char *)&ROM[0x0180], "GM MK-1215", 10)) // Evander Holyfield
647            type = SEGA_EEPROM;
648         break;
649         
650      case 0xc0000:
651         
652         if (!memcmp((char *)&ROM[0x0180], "GM G-4060 ", 8)) // Wonder Boy V
653            type = SEGA_EEPROM;
654         break;
655         
656      case 0x100000:
657         if (!memcmp(&ROM[0x01b24], mjlover_sig, sizeof(mjlover_sig)))
658            type = MJLOVER;
659         
660         if (!memcmp(&ROM[0x03b4], squir_sig, sizeof(squir_sig)))
661            type = SQUIRRELK;
662         
663         if (!memcmp(&ROM[0xee0d0], bugsl_sig, sizeof(bugsl_sig)))
664            type = BUGSLIFE;
665         
666         if (!memcmp((char *)&ROM[0x0172], "GAME : ELF WOR", 14))
667            type = ELFWOR;
668         
669         if (!memcmp(&ROM[0x123e4], sbub_sig, sizeof(sbub_sig)))
670            type = SBUBBOB;
671         
672         if (!memcmp((char *)&ROM[0x0180], "GM T-50176", 10)) // Rings of Power
673            type = EA_NHLPA;
674         
675         if (!memcmp((char *)&ROM[0x0180], "MK 00001211-00", 14)) // Sports Talk Baseball
676            type = SEGA_EEPROM;
677         
678         if (!memcmp((char *)&ROM[0x0180], "GM T-120096-", 12)) // Micro Machines 2
679            type = CODE_MASTERS;
680         
681         if (!memcmp((char *)&ROM[0x0180], "GM T-120146-", 12)) // Brian Lara Cricket 96 / Shane Wayne Cricket 96
682            type = BRIAN_LARA;
683         
684         if (!memcmp((char *)&ROM[0x0190], "OJKRPTBVFCA     ", 0x10)) // Micro Machines '96 / Military TODO: better way to recognize these?
685            type = CODE_MASTERS;
686         break;
687         
688      case 0x200000:
689         if (!memcmp(&ROM[0x18c6], lk3_sig, sizeof(lk3_sig)))
690            type = LIONK3;
691         
692         if (!memcmp(&ROM[0x220], sdk_sig, sizeof(sdk_sig)))
693            type = LIONK3;
694         
695         if (!memcmp(&ROM[0xce560], redcliff_sig, sizeof(redcliff_sig)))
696            type = REDCLIFF;
697         
698         if (!memcmp(&ROM[0xc8cb0], smb_sig, sizeof(smb_sig)))
699            type = SMB;
700         
701         if (!memcmp(&ROM[0xf24d6], smb2_sig, sizeof(smb2_sig)))
702            type = SMB2;
703         
704         if (!memcmp(&ROM[0x674e], kaiju_sig, sizeof(kaiju_sig)))
705            type = KAIJU;
706         
707         if (!memcmp(&ROM[0x1780], chifi3_sig, sizeof(chifi3_sig)))
708            type = CHINFIGHT3;
709         
710         if (!memcmp(&ROM[0x03c2], lionk2_sig, sizeof(lionk2_sig)))
711            type = LIONK2;
712         
713         if (!memcmp(&ROM[0xc8b90], rx3_sig, sizeof(rx3_sig)))
714            type = ROCKMANX3;
715         
716         if (!memcmp(&ROM[0x56ae2], kof98_sig, sizeof(kof98_sig)))
717            type = KOF98;
718         
719         if (!memcmp(&ROM[0x17bb2], s15in1_sig, sizeof(s15in1_sig)))
720            type = MC_PIRATE;
721         
722         if (!memcmp((char *)&ROM[0x0180], "GM T-081326 ", 12)) // NBA Jam
723            type = NBA_JAM;
724         
725         if (!memcmp((char *)&ROM[0x0180], "GM MK-1228", 10)) // Greatest Heavyweight of the Ring
726            type = SEGA_EEPROM;
727         
728         if ((!memcmp((char *)&ROM[0x0180], "GM T-12046", 10)) || // Mega Man
729            (!memcmp((char *)&ROM[0x0180], "GM T-12053", 10) && !memcmp(&ROM[0x18e], rockman_sig, sizeof(rockman_sig)))) // / Rock Man (EEPROM version)
730            type = SEGA_EEPROM;
731         
732         break;
733         
734      case 0x200005:
735         if (!memcmp(&ROM[0xce564], redcl_en_sig, sizeof(redcliff_sig)))
736            type = REDCL_EN;
737         break;
738         
739      case 0x300000:
740         if (!memcmp(&ROM[0x220], sdk_sig, sizeof(sdk_sig)))
741            type = LIONK3;
742         
743         if (!memcmp(&ROM[0x1fd0d2], kof99_sig, sizeof(kof99_sig)))
744            type = KOF99;
745         
746         if (!memcmp((char *)&ROM[0x0180], "GM T-81406", 10)) // NBA Jam TE
747            type = NBA_JAM_TE;
748         
749         if (!memcmp((char *)&ROM[0x0180], "GM T-081276 ", 12)) // NFL Quarterback Club
750            type = NBA_JAM_TE;
751         
752         break;
753         
754      case 0x400000:
755         if (!memcmp(&ROM[0x3c031c], radica_sig, sizeof(radica_sig)) ||
756            !memcmp(&ROM[0x3f031c], radica_sig, sizeof(radica_sig))) // ssf+gng + radica vol1
757            type = RADICA;
758         
759         if (!memcmp(&ROM[0x028460], soulb_sig, sizeof(soulb_sig)))
760            type = SOULBLAD;
761         
762         if (!memcmp(&ROM[0x1e700], s19in1_sig, sizeof(s19in1_sig)))
763            type = MC_PIRATE;
764         
765         if (!memcmp((char *)&ROM[0x0180], "GM T-081586-", 12)) // NFL Quarterback Club 96
766            type = NFL_QB_96;
767         
768         if (!memcmp((char *)&ROM[0x0180], "GM T-081576 ", 12)) // College Slam
769            type = C_SLAM;
770         
771         if (!memcmp((char *)&ROM[0x0180], "GM T-81476", 10)) // Big Hurt Baseball
772            type = C_SLAM;
773         
774         break;
775         
776      case 0x500000:
777         if (!memcmp((char *)&ROM[0x0120], "SUPER STREET FIGHTER2 ", 22))
778            type = SSF2;
779         break;
780
781      case 0x800000:
782         if (!memcmp((char *)&ROM[0x0180], "GM T-574023-", 12)) // Pier Solar
783            type = PSOLAR;
784         break;
785
786      default:
787         break;
788   }
789
790   //check for SRAM among the general carts
791   if (type == SEGA_STD)
792   {
793      // If the cart is not of a special type, we check the header for SRAM.
794      if (ROM[0x1b1] == 'R' && ROM[0x1b0] == 'A')
795      {
796         UINT32 start, end;
797         start = (ROM[0x1b5] << 24 | ROM[0x1b4] << 16 | ROM[0x1b7] << 8 | ROM[0x1b6]);
798         end = (ROM[0x1b9] << 24 | ROM[0x1b8] << 16 | ROM[0x1bb] << 8 | ROM[0x1ba]);
799         logerror("SRAM detected from header: starting location %X - SRAM Length %X\n", start, end - start + 1);
800         
801         // For some games using serial EEPROM, difference between SRAM end to start is 0 or 1.
802         // Carts with EEPROM should have been already detected above, but better safe than sorry
803         if (end - start < 2)
804            type = SEGA_EEPROM;
805         else
806            type = SEGA_SRAM_FULLPATH;
807      }
808      else
809      {
810         // Unfortunately, there are ROMs without correct info in the header,
811         // Hence, when loading from fullpath we do the SRAM mapping anyway...
812         // but treat it in a custom way
813         type = SEGA_SRAM_FALLBACK;
814      }
815   }
816   
817   return type;
818}
819/*-------------------------------------------------
820 get default card software
821 -------------------------------------------------*/
822
823const char * base_md_cart_slot_device::get_default_card_software(const machine_config &config, emu_options &options)
824{
825   const char *slot_string = "rom";
826
827   if (open_image_file(options))
828   {
829      UINT32 len = core_fsize(m_file);
830      UINT8 *ROM = global_alloc_array(UINT8, len);
831      int type;
832     
833      core_fread(m_file, ROM, len);
834     
835      type = get_cart_type(ROM, len);
836      slot_string = md_get_slot(type);
837     
838      global_free(ROM);
839      clear();
840   
841      return slot_string;
842   }
843   else
844      return software_get_default_slot(config, options, this, "rom");
845}
846
847
848
849/*-------------------------------------------------
850 read
851 -------------------------------------------------*/
852
853READ16_MEMBER(base_md_cart_slot_device::read)
854{
855   if (m_cart)
856      return m_cart->read(space, offset);
857   else
858      return 0xffff;
859}
860
861READ16_MEMBER(base_md_cart_slot_device::read_a13)
862{
863   if (m_cart)
864      return m_cart->read_a13(space, offset);
865   else
866      return 0xffff;
867}
868
869READ16_MEMBER(base_md_cart_slot_device::read_a15)
870{
871   if (m_cart)
872      return m_cart->read_a15(space, offset);
873   else
874      return 0xffff;
875}
876
877
878/*-------------------------------------------------
879 write
880 -------------------------------------------------*/
881
882WRITE16_MEMBER(base_md_cart_slot_device::write)
883{
884   if (m_cart)
885      m_cart->write(space, offset, data);
886}
887
888WRITE16_MEMBER(base_md_cart_slot_device::write_a13)
889{
890   if (m_cart)
891      m_cart->write_a13(space, offset, data);
892}
893
894WRITE16_MEMBER(base_md_cart_slot_device::write_a15)
895{
896   if (m_cart)
897      m_cart->write_a15(space, offset, data);
898}
899
Property changes on: trunk/src/mess/machine/md_slot.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/machine/md_slot.h
r0r20696
1#ifndef __MD_SLOT_H
2#define __MD_SLOT_H
3
4/***************************************************************************
5 TYPE DEFINITIONS
6 ***************************************************************************/
7
8
9/* PCB */
10enum
11{
12   SEGA_STD = 0,
13
14   // Cart + Slot Expansion
15   SEGA_SK,                     /* Sonic & Knuckles pass-through cart */
16
17   // Cart + SVP
18   SEGA_SVP,                    /* Virtua Racing */
19
20   // Cart + NVRAM
21   SEGA_SRAM, SEGA_FRAM,
22   BEGGAR,                      /* Xin Qigai Wangzi uses different sram start address and has no valid header */
23   
24   // EEPROM
25   SEGA_EEPROM,                 /* Wonder Boy V / Evander Holyfield's Boxing / Greatest Heavyweights of the Ring / Sports Talk Baseball / Megaman */
26   NBA_JAM,                     /* NBA Jam */
27   NBA_JAM_TE,                  /* NBA Jam TE / NFL Quarterback Club */
28   NFL_QB_96,                   /* NFL Quarterback Club '96 */
29   C_SLAM,                      /* College Slam / Frank Thomas Big Hurt Baseball */
30   EA_NHLPA,                    /* NHLPA Hockey 93 / Rings of Power */
31   BRIAN_LARA,                  /* Brian Lara Cricket 96 */
32   PSOLAR,                      /* Pier Solar (STM95 EEPROM) */
33
34   // J-Cart
35   CM_JCART,                    /* Pete Sampras Tennis */
36   CODE_MASTERS,                /* Micro Machines 2 / Military (J-Cart + SEPROM)  */
37   CM_MM96,                     /* Micro Machines 96 (J-Cart + SEPROM, diff I2C model)  */
38   
39   // Various
40   SSF2,                        /* Super Street Fighter 2 */
41   GAME_KANDUME,                /* Game no Kandume Otokuyou */
42   RADICA,                      /* Radica TV games.. these probably should be a separate driver since they are a separate 'console' */
43   
44   BUGSLIFE,                    /* A Bug's Life */
45   CHINFIGHT3,                  /* Chinese Fighters 3 */
46   ELFWOR,                      /* Linghuan Daoshi Super Magician */
47   KAIJU,                       /* Pokemon Stadium */
48   KOF98,                       /* King of Fighters '98 */
49   KOF99,                       /* King of Fighters '99 */
50   LIONK2,                      /* Lion King 2 */
51   LIONK3,                      /* Lion King 3, Super Donkey Kong 99, Super King Kong 99 */
52   MC_PIRATE,                   /* Super 19 in 1, Super 15 in 1, 12 in 1 and a few more multicarts */
53   MJLOVER,                     /* Mahjong Lover */
54   MULAN,                       /* Hua Mu Lan - Mulan */
55   POKEMON,                     /* Pocket Monster */
56   POKEMON2,                    /* Pocket Monster 2 */
57   REALTEC,                     /* Whac a Critter/Mallet legend, Defend the Earth, Funnyworld/Ballonboy */
58   REDCLIFF,                    /* Romance of the Three Kingdoms - Battle of Red Cliffs, already decoded from .mdx format */
59   REDCL_EN,                    /* The encoded version... */
60   ROCKMANX3,                   /* Rockman X3 */
61   SBUBBOB,                     /* Super Bubble Bobble */
62   SMB,                         /* Super Mario Bros. */
63   SMB2,                        /* Super Mario Bros. 2 */
64   SMOUSE,                      /* Smart Mouse */
65   SOULBLAD,                    /* Soul Blade */
66   SQUIRRELK,                   /* Squirrel King */
67   TOPFIGHTER,                  /* Top Fighter 2000 MK VIII */
68
69   // when loading from fullpath, we need to treat SRAM in custom way
70   SEGA_SRAM_FULLPATH,
71   SEGA_SRAM_FALLBACK
72};
73
74
75// ======================> md_cart_interface
76
77struct md_cart_interface
78{
79};
80
81
82// ======================> device_md_cart_interface
83
84class device_md_cart_interface : public device_slot_card_interface
85{
86public:
87   // construction/destruction
88   device_md_cart_interface(const machine_config &mconfig, device_t &device);
89   virtual ~device_md_cart_interface();
90
91   // reading and writing
92   virtual DECLARE_READ16_MEMBER(read) { return 0xffff; }
93   virtual DECLARE_WRITE16_MEMBER(write) {}
94   virtual DECLARE_READ16_MEMBER(read_a13) { return 0xffff; };
95   virtual DECLARE_WRITE16_MEMBER(write_a13) {};
96   virtual DECLARE_READ16_MEMBER(read_a15) { return 0xffff; };
97   virtual DECLARE_WRITE16_MEMBER(write_a15) {};
98
99   /* this probably should do more, like make Genesis V2 'die' if the SEGA string is not written promptly */
100   virtual DECLARE_WRITE16_MEMBER(write_tmss_bank) { logerror("Write to TMSS bank: offset %x data %x\n", 0xa14000 + (offset << 1), data); };
101
102   virtual void rom_alloc(running_machine &machine, size_t size);
103   virtual void nvram_alloc(running_machine &machine, size_t size);
104   virtual UINT16* get_rom_base() { return m_rom; };
105   virtual UINT16* get_nvram_base() { return m_nvram; };
106   virtual UINT32 get_rom_size() { return m_rom_size; };
107   virtual UINT32 get_nvram_size() { return m_nvram_size; };
108   
109   int m_nvram_start, m_nvram_end;
110   int m_nvram_active, m_nvram_readonly;
111   
112   // when loading from fullpath, we create NVRAM even if not set in the header
113   // however in this case we access it only if the game turn it on
114   // the variable below is basically needed to track this...
115   int m_nvram_handlers_installed;
116
117   // internal state
118   UINT16      *m_rom;
119   UINT16      *m_nvram;
120   UINT32 m_rom_size;
121   UINT32 m_nvram_size;
122};
123
124
125// ======================> base_md_cart_slot_device
126
127class base_md_cart_slot_device : public device_t,
128                        public md_cart_interface,
129                        public device_image_interface,
130                        public device_slot_interface
131{
132public:
133   // construction/destruction
134   base_md_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
135   virtual ~base_md_cart_slot_device();
136   
137   // device-level overrides
138   virtual void device_start();
139   virtual void device_config_complete();
140   
141   // image-level overrides
142   virtual bool call_load();
143   virtual void call_unload();
144   virtual bool call_softlist_load(char *swlist, char *swname, rom_entry *start_entry);
145
146   virtual int load_list();
147   virtual int load_nonlist();
148   virtual int get_cart_type(UINT8 *ROM, UINT32 len);
149
150
151   virtual void setup_custom_mappers();
152   virtual void setup_nvram();
153
154   virtual iodevice_t image_type() const { return IO_CARTSLOT; }
155   virtual bool is_readable()  const { return 1; }
156   virtual bool is_writeable() const { return 0; }
157   virtual bool is_creatable() const { return 0; }
158   virtual bool must_be_loaded() const { return 1; }
159   virtual bool is_reset_on_load() const { return 0; }
160   virtual const option_guide *create_option_guide() const { return NULL; }
161   
162   // slot interface overrides
163   virtual const char * get_default_card_software(const machine_config &config, emu_options &options);
164   
165   // reading and writing
166   virtual DECLARE_READ16_MEMBER(read);
167   virtual DECLARE_WRITE16_MEMBER(write);
168   virtual DECLARE_READ16_MEMBER(read_a13);
169   virtual DECLARE_WRITE16_MEMBER(write_a13);
170   virtual DECLARE_READ16_MEMBER(read_a15);
171   virtual DECLARE_WRITE16_MEMBER(write_a15);
172
173// FIXME:
174// this should be private, but then there is some problem installing delegates in the driver...
175//private:
176
177   device_md_cart_interface*      m_cart;
178   
179   int m_type;
180};
181
182// ======================> md_cart_slot_device
183
184class md_cart_slot_device :  public base_md_cart_slot_device
185{
186public:
187   // construction/destruction
188   md_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
189   virtual const char *image_interface() const { return "megadriv_cart"; }
190   virtual const char *file_extensions() const { return "smd,bin,md,gen"; }
191};
192
193
194// ======================> md_subcart_slot_device
195
196class md_subcart_slot_device :  public base_md_cart_slot_device
197{
198public:
199   // construction/destruction
200   md_subcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
201   virtual bool must_be_loaded() const { return 0; }
202   virtual const char *image_interface() const { return "megadriv_cart"; }
203   virtual const char *file_extensions() const { return "smd,bin,md,gen"; }
204};
205
206
207// ======================> pico_cart_slot_device
208
209class pico_cart_slot_device :  public base_md_cart_slot_device
210{
211public:
212   // construction/destruction
213   pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
214   virtual const char *image_interface() const { return "pico_cart"; }
215   virtual const char *file_extensions() const { return "bin,md"; }
216};
217
218
219// device type definition
220extern const device_type MD_CART_SLOT;
221extern const device_type MD_SUBCART_SLOT;   // needed to allow S&K pass-through to have non-mandatory cart
222extern const device_type PICO_CART_SLOT;
223
224
225/***************************************************************************
226 DEVICE CONFIGURATION MACROS
227 ***************************************************************************/
228
229#define MCFG_MD_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \
230   MCFG_DEVICE_ADD(_tag, MD_CART_SLOT, 0) \
231   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
232
233#define MCFG_MDSUB_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \
234   MCFG_DEVICE_ADD(_tag, MD_SUBCART_SLOT, 0) \
235   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
236
237#define MCFG_PICO_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \
238   MCFG_DEVICE_ADD(_tag, PICO_CART_SLOT, 0) \
239   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
240
241
242#endif
Property changes on: trunk/src/mess/machine/md_slot.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/md_eeprom.c
r0r20696
1/***********************************************************************************************************
2 
3 
4 MegaDrive / Genesis cart+EEPROM emulation
5 
6 
7 TODO: proper EEPROM emulation, still not worked on (just hooked up the I2C device)
8 
9
10 i2c games mapping table:
11 
12 game name                         |   SDA_IN   |  SDA_OUT   |     SCL    |  SIZE_MASK     | PAGE_MASK |
13 ----------------------------------|------------|------------|------------|----------------|-----------|
14 NBA Jam                           | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x00ff (24C02) |   0x03    | xx
15 NBA Jam TE                        | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) |   0x03    | xx
16 NBA Jam TE (32x)                  | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) |   0x03    |
17 NFL Quarterback Club              | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) |   0x03    | xx
18 NFL Quarterback Club 96           | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x07ff (24C16) |   0x07    | xx
19 College Slam                      | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) |   0x07    | xx
20 Frank Thomas Big Hurt Baseball    | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) |   0x07    | xx
21 NHLPA Hockey 93                   | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) |   0x03    | xx
22 Rings of Power                    | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) |   0x03    | xx
23 Evander Holyfield's Boxing        | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
24 Greatest Heavyweights of the Ring | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
25 Wonder Boy V                      | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
26 Sports Talk Baseball              | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx
27 Megaman - the Wily Wars           | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) |   0x03    | xx **
28 Micro Machines 2                  | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) |   0x0f    |
29 Micro Machines Military           | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) |   0x0f    |
30 Micro Machines 96                 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x07ff (24C16) |   0x0f    |
31 Brian Lara Cricket 96             | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x1fff (24C64) |   0x??*   |
32 ----------------------------------|------------|------------|------------|----------------|-----------|
33 
34 * Notes: check these
35 ** original Rockman Mega World (J) set uses normal backup RAM
36
37
38 Micro Machines 2, Micro Machines Military, Micro Machines 96 are emulated in md_jcart
39
40***********************************************************************************************************/
41
42
43
44#include "emu.h"
45#include "machine/md_eeprom.h"
46
47
48//-------------------------------------------------
49//  md_rom_device - constructor
50//-------------------------------------------------
51
52const device_type MD_STD_EEPROM = &device_creator<md_std_eeprom_device>;
53const device_type MD_EEPROM_NBAJAM = &device_creator<md_eeprom_nbajam_device>;
54const device_type MD_EEPROM_NBAJAMTE = &device_creator<md_eeprom_nbajamte_device>;
55const device_type MD_EEPROM_NFLQB = &device_creator<md_eeprom_nflqb_device>;
56const device_type MD_EEPROM_CSLAM = &device_creator<md_eeprom_cslam_device>;
57const device_type MD_EEPROM_NHLPA = &device_creator<md_eeprom_nhlpa_device>;
58const device_type MD_EEPROM_BLARA = &device_creator<md_eeprom_blara_device>;
59
60
61md_std_eeprom_device::md_std_eeprom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
62               : device_t(mconfig, type, name, tag, owner, clock),
63               device_md_cart_interface( mconfig, *this ),
64               m_i2cmem(*this, "i2cmem")
65{
66}
67
68md_std_eeprom_device::md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
69               : device_t(mconfig, MD_STD_EEPROM, "MD Standard cart + EEPROM", tag, owner, clock),
70               device_md_cart_interface( mconfig, *this ),
71               m_i2cmem(*this, "i2cmem")
72{
73}
74
75md_eeprom_nbajam_device::md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
76               : md_std_eeprom_device(mconfig, MD_EEPROM_NBAJAM, "MD NBA Jam", tag, owner, clock)
77{
78}
79
80md_eeprom_nbajamte_device::md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
81               : md_std_eeprom_device(mconfig, MD_EEPROM_NBAJAMTE, "MD NBA Jam TE (and a few more)", tag, owner, clock)
82{
83}
84
85md_eeprom_cslam_device::md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
86               : md_std_eeprom_device(mconfig, MD_EEPROM_CSLAM, "MD College Slam", tag, owner, clock)
87{
88}
89
90md_eeprom_nflqb_device::md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
91               : md_std_eeprom_device(mconfig, MD_EEPROM_NFLQB, "MD NFL Quarterback 96", tag, owner, clock)
92{
93}
94
95md_eeprom_nhlpa_device::md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
96               : md_std_eeprom_device(mconfig, MD_EEPROM_NHLPA, "MD NHLPA 93", tag, owner, clock)
97{
98}
99
100md_eeprom_blara_device::md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
101               : md_std_eeprom_device(mconfig, MD_EEPROM_BLARA, "MD Brian Lara", tag, owner, clock)
102{
103}
104
105
106//-------------------------------------------------
107//  SERIAL I2C DEVICE
108//-------------------------------------------------
109
110static const i2cmem_interface md_24c01_i2cmem_interface =
111{
112   I2CMEM_SLAVE_ADDRESS, 0, 0x80
113};
114
115
116static const i2cmem_interface md_24c02_i2cmem_interface =
117{
118   I2CMEM_SLAVE_ADDRESS, 0, 0x100
119};
120
121
122static const i2cmem_interface md_24c16_i2cmem_interface =
123{
124   I2CMEM_SLAVE_ADDRESS, 0, 0x800
125};
126
127
128static const i2cmem_interface md_24c64_i2cmem_interface =
129{
130   I2CMEM_SLAVE_ADDRESS, 0, 0x2000
131};
132
133
134// MD_STD_EEPROM & MD_EEPROM_NHLPA
135MACHINE_CONFIG_FRAGMENT( md_i2c_24c01 )
136   MCFG_I2CMEM_ADD("i2cmem", md_24c01_i2cmem_interface)
137MACHINE_CONFIG_END
138
139// MD_EEPROM_NBAJAM & MD_EEPROM_NBAJAMTE
140MACHINE_CONFIG_FRAGMENT( md_i2c_24c02 )
141   MCFG_I2CMEM_ADD("i2cmem", md_24c02_i2cmem_interface)
142MACHINE_CONFIG_END
143
144// MD_EEPROM_NFLQB
145MACHINE_CONFIG_FRAGMENT( md_i2c_24c16 )
146   MCFG_I2CMEM_ADD("i2cmem", md_24c16_i2cmem_interface)
147MACHINE_CONFIG_END
148
149// MD_EEPROM_CSLAM & MD_EEPROM_BLARA
150MACHINE_CONFIG_FRAGMENT( md_i2c_24c64 )
151   MCFG_I2CMEM_ADD("i2cmem", md_24c64_i2cmem_interface)
152MACHINE_CONFIG_END
153
154
155//-------------------------------------------------
156//  machine_config_additions - device-specific
157//  machine configurations
158//-------------------------------------------------
159
160machine_config_constructor md_std_eeprom_device::device_mconfig_additions() const
161{
162   return MACHINE_CONFIG_NAME( md_i2c_24c01 );
163}
164
165machine_config_constructor md_eeprom_nbajam_device::device_mconfig_additions() const
166{
167   return MACHINE_CONFIG_NAME( md_i2c_24c02 );
168}
169
170machine_config_constructor md_eeprom_nbajamte_device::device_mconfig_additions() const
171{
172   return MACHINE_CONFIG_NAME( md_i2c_24c02 );
173}
174
175machine_config_constructor md_eeprom_cslam_device::device_mconfig_additions() const
176{
177   return MACHINE_CONFIG_NAME( md_i2c_24c64 );
178}
179
180machine_config_constructor md_eeprom_nflqb_device::device_mconfig_additions() const
181{
182   return MACHINE_CONFIG_NAME( md_i2c_24c16 );
183}
184
185machine_config_constructor md_eeprom_nhlpa_device::device_mconfig_additions() const
186{
187   return MACHINE_CONFIG_NAME( md_i2c_24c01 );
188}
189
190machine_config_constructor md_eeprom_blara_device::device_mconfig_additions() const
191{
192   return MACHINE_CONFIG_NAME( md_i2c_24c64 );
193}
194
195
196void md_std_eeprom_device::device_start()
197{
198   m_i2c_mem = 0;
199   m_i2c_clk = 0;
200   save_item(NAME(m_i2c_mem));
201   save_item(NAME(m_i2c_clk));
202}
203
204/*-------------------------------------------------
205 mapper specific handlers
206 -------------------------------------------------*/
207
208/*-------------------------------------------------
209 CART + EEPROM
210 -------------------------------------------------*/
211
212READ16_MEMBER(md_std_eeprom_device::read)
213{
214   if (offset == 0x200000/2)
215   {
216      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
217      return ~m_i2c_mem & 1;
218   }
219   return m_rom[offset];
220}
221
222WRITE16_MEMBER(md_std_eeprom_device::write)
223{
224   if (offset == 0x200000/2)
225   {
226      m_i2c_clk = BIT(data, 1);
227      m_i2c_mem = BIT(data, 0);
228      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
229      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
230   }
231}
232
233READ16_MEMBER(md_eeprom_nbajam_device::read)
234{
235   if (offset == 0x200000/2)
236   {
237      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
238      return m_i2c_mem & 1;
239   }
240   return m_rom[offset];
241}
242
243WRITE16_MEMBER(md_eeprom_nbajam_device::write)
244{
245   if (offset == 0x200000/2)
246   {
247      m_i2c_clk = BIT(data, 1);
248      m_i2c_mem = BIT(data, 0);
249      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
250      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
251   }
252}
253
254READ16_MEMBER(md_eeprom_nbajamte_device::read)
255{
256   if (offset == 0x200000/2)
257   {
258      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
259      return m_i2c_mem & 1;
260   }
261   return m_rom[offset];
262}
263
264WRITE16_MEMBER(md_eeprom_nbajamte_device::write)
265{
266   if (offset == 0x200000/2)
267   {
268      m_i2c_clk = BIT(data, 8);
269      m_i2c_mem = BIT(data, 0);
270      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
271      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
272   }
273}
274
275// same as NBAJAMTE above... derived class?
276READ16_MEMBER(md_eeprom_cslam_device::read)
277{
278   if (offset == 0x200000/2)
279   {
280      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
281      return m_i2c_mem & 1;
282   }
283   return m_rom[offset];
284}
285
286WRITE16_MEMBER(md_eeprom_cslam_device::write)
287{
288   if (offset == 0x200000/2)
289   {
290      m_i2c_clk = BIT(data, 8);
291      m_i2c_mem = BIT(data, 0);
292      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
293      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
294   }
295}
296
297// same as NBAJAMTE above... derived class?
298READ16_MEMBER(md_eeprom_nflqb_device::read)
299{
300   if (offset == 0x200000/2)
301   {
302      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
303      return m_i2c_mem & 1;
304   }
305   return m_rom[offset];
306}
307
308WRITE16_MEMBER(md_eeprom_nflqb_device::write)
309{
310   if (offset == 0x200000/2)
311   {
312      m_i2c_clk = BIT(data, 8);
313      m_i2c_mem = BIT(data, 0);
314      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
315      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
316   }
317}
318
319READ16_MEMBER(md_eeprom_nhlpa_device::read)
320{
321   if (offset == 0x200000/2)
322   {
323      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
324      return (m_i2c_mem & 1) << 7;
325   }
326   return m_rom[offset];
327}
328
329WRITE16_MEMBER(md_eeprom_nhlpa_device::write)
330{
331   if (offset == 0x200000/2)
332   {
333      m_i2c_clk = BIT(data, 6);
334      m_i2c_mem = BIT(data, 7);
335      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
336      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
337   }
338}
339
340READ16_MEMBER(md_eeprom_blara_device::read)
341{
342   if (offset == 0x380000/2)
343   {
344      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
345      return (m_i2c_mem & 1) << 7;
346   }
347   return m_rom[offset];
348}
349
350WRITE16_MEMBER(md_eeprom_blara_device::write)
351{
352   if (offset == 0x380000/2)
353   {
354      m_i2c_clk = BIT(data, 9);
355      m_i2c_mem = BIT(data, 8);
356      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
357      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
358   }
359}
360
Property changes on: trunk/src/mess/machine/md_eeprom.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/md_eeprom.h
r0r20696
1#ifndef __MD_EEPROM_H
2#define __MD_EEPROM_H
3
4#include "machine/md_slot.h"
5#include "machine/i2cmem.h"
6
7
8//**************************************************************************
9//  TYPE DEFINITIONS
10//**************************************************************************
11
12// ======================> md_std_eeprom_device
13
14class md_std_eeprom_device : public device_t,
15                 public device_md_cart_interface
16{
17public:
18   // construction/destruction
19   md_std_eeprom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
20   md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   
22   // device-level overrides
23   virtual void device_start();
24   virtual void device_config_complete() { m_shortname = "md_std_eeprom"; }
25   virtual machine_config_constructor device_mconfig_additions() const;
26     
27   // reading and writing
28   virtual DECLARE_READ16_MEMBER(read);
29   virtual DECLARE_WRITE16_MEMBER(write);
30
31   required_device<i2cmem_device> m_i2cmem;
32   UINT8 m_i2c_mem, m_i2c_clk;
33};
34
35// ======================> md_eeprom_nbajam_device
36
37class md_eeprom_nbajam_device : public md_std_eeprom_device
38{
39public:
40   // construction/destruction
41   md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42   
43   // device-level overrides
44   virtual void device_config_complete() { m_shortname = "md_eeprom_nbajam"; }
45   virtual machine_config_constructor device_mconfig_additions() const;
46   
47   // reading and writing
48   virtual DECLARE_READ16_MEMBER(read);
49   virtual DECLARE_WRITE16_MEMBER(write);
50};
51
52// ======================> md_eeprom_nbajamte_device
53
54class md_eeprom_nbajamte_device : public md_std_eeprom_device
55{
56public:
57   // construction/destruction
58   md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
59   
60   // device-level overrides
61   virtual void device_config_complete() { m_shortname = "md_eeprom_nbajamte"; }
62   virtual machine_config_constructor device_mconfig_additions() const;
63   
64   // reading and writing
65   virtual DECLARE_READ16_MEMBER(read);
66   virtual DECLARE_WRITE16_MEMBER(write);
67};
68
69// ======================> md_eeprom_cslam_device (same read/write as nbajamte, but different I2C type)
70
71class md_eeprom_cslam_device : public md_std_eeprom_device
72{
73public:
74   // construction/destruction
75   md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
76   
77   // device-level overrides
78   virtual void device_config_complete() { m_shortname = "md_eeprom_cslam"; }
79   virtual machine_config_constructor device_mconfig_additions() const;
80   
81   // reading and writing
82   virtual DECLARE_READ16_MEMBER(read);
83   virtual DECLARE_WRITE16_MEMBER(write);
84};
85
86// ======================> md_eeprom_nflqb_device (same read/write as nbajamte, but different I2C type)
87
88class md_eeprom_nflqb_device : public md_std_eeprom_device
89{
90public:
91   // construction/destruction
92   md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
93   
94   // device-level overrides
95   virtual void device_config_complete() { m_shortname = "md_eeprom_nflqb"; }
96   virtual machine_config_constructor device_mconfig_additions() const;
97   
98   // reading and writing
99   virtual DECLARE_READ16_MEMBER(read);
100   virtual DECLARE_WRITE16_MEMBER(write);
101};
102
103// ======================> md_eeprom_nhlpa_device
104
105class md_eeprom_nhlpa_device : public md_std_eeprom_device
106{
107public:
108   // construction/destruction
109   md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
110   
111   // device-level overrides
112   virtual void device_config_complete() { m_shortname = "md_eeprom_nhlpa"; }
113   virtual machine_config_constructor device_mconfig_additions() const;
114   
115   // reading and writing
116   virtual DECLARE_READ16_MEMBER(read);
117   virtual DECLARE_WRITE16_MEMBER(write);
118};
119
120// ======================> md_eeprom_blara_device (same read/write as codemast, but different I2C type)
121
122class md_eeprom_blara_device : public md_std_eeprom_device
123{
124public:
125   // construction/destruction
126   md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
127   
128   // device-level overrides
129   virtual void device_config_complete() { m_shortname = "md_eeprom_blara"; }
130   virtual machine_config_constructor device_mconfig_additions() const;
131   
132   // reading and writing
133   virtual DECLARE_READ16_MEMBER(read);
134   virtual DECLARE_WRITE16_MEMBER(write);
135};
136
137
138// device type definition
139extern const device_type MD_STD_EEPROM;
140extern const device_type MD_EEPROM_NBAJAM;
141extern const device_type MD_EEPROM_NBAJAMTE;
142extern const device_type MD_EEPROM_CSLAM;
143extern const device_type MD_EEPROM_NFLQB;
144extern const device_type MD_EEPROM_NHLPA;
145extern const device_type MD_EEPROM_BLARA;
146
147#endif
Property changes on: trunk/src/mess/machine/md_eeprom.h
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/machine/md_sk.c
r0r20696
1/***********************************************************************************************************
2 
3 
4 Sonic & Knuckles pass-thorugh cart emulation
5
6 
7 TODO: currently we only support loading of base carts with no bankswitch or protection...
8       shall we support other as well?
9 
10 
11 ***********************************************************************************************************/
12
13
14
15
16#include "emu.h"
17#include "machine/md_sk.h"
18#include "machine/md_rom.h"
19
20
21//-------------------------------------------------
22//  md_rom_device - constructor
23//-------------------------------------------------
24
25const device_type MD_ROM_SK = &device_creator<md_rom_sk_device>;
26
27
28md_rom_sk_device::md_rom_sk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
29               : device_t(mconfig, type, name, tag, owner, clock),
30                  device_md_cart_interface( mconfig, *this ),
31                  m_exp(*this, "subslot")
32{
33}
34
35md_rom_sk_device::md_rom_sk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
36               : device_t(mconfig, MD_ROM_SK, "MD Sonic & Knuckles", tag, owner, clock),
37                  device_md_cart_interface( mconfig, *this ),
38                  m_exp(*this, "subslot")
39{
40}
41
42
43void md_rom_sk_device::device_start()
44{
45}
46
47/*-------------------------------------------------
48 mapper specific handlers
49 -------------------------------------------------*/
50
51READ16_MEMBER(md_rom_sk_device::read)
52{
53   if (m_exp->m_cart != NULL && m_exp->m_cart->get_rom_base() != NULL && offset >= 0x200000/2 && offset < (0x200000 + m_exp->m_cart->get_rom_size())/2)
54      return m_exp->m_cart->m_rom[offset - 0x200000/2];
55   return m_rom[offset];
56}
57
58WRITE16_MEMBER(md_rom_sk_device::write)
59{
60// should there be anything here?
61}
62
63//-------------------------------------------------
64//  MACHINE_CONFIG_FRAGMENT( sk_slot )
65//-------------------------------------------------
66
67static SLOT_INTERFACE_START(sk_sub_cart)
68   SLOT_INTERFACE_INTERNAL("rom",  MD_STD_ROM)
69   SLOT_INTERFACE_INTERNAL("rom_svp",  MD_STD_ROM)
70   SLOT_INTERFACE_INTERNAL("rom_sram",  MD_ROM_SRAM)
71   SLOT_INTERFACE_INTERNAL("rom_sramsafe",  MD_ROM_SRAM)
72   SLOT_INTERFACE_INTERNAL("rom_fram",  MD_ROM_FRAM)
73// add all types??
74SLOT_INTERFACE_END
75
76static MACHINE_CONFIG_FRAGMENT( sk_slot )
77   MCFG_MDSUB_CARTRIDGE_ADD("subslot", sk_sub_cart, NULL, NULL)
78MACHINE_CONFIG_END
79
80
81//-------------------------------------------------
82//  machine_config_additions - device-specific
83//  machine configurations
84//-------------------------------------------------
85
86machine_config_constructor md_rom_sk_device::device_mconfig_additions() const
87{
88   return MACHINE_CONFIG_NAME( sk_slot );
89}
90
Property changes on: trunk/src/mess/machine/md_sk.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/md_sk.h
r0r20696
1#ifndef __MD_SK_H
2#define __MD_SK_H
3
4#include "machine/md_slot.h"
5
6
7// ======================> md_rom_sk_device
8
9class md_rom_sk_device : public device_t,
10                 public device_md_cart_interface
11{
12public:
13   // construction/destruction
14   md_rom_sk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
15   md_rom_sk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16   
17   // device-level overrides
18   virtual void device_start();
19   virtual void device_config_complete() { m_shortname = "md_rom_sk"; }
20   virtual machine_config_constructor device_mconfig_additions() const;
21     
22   // reading and writing
23   virtual DECLARE_READ16_MEMBER(read);
24   virtual DECLARE_WRITE16_MEMBER(write);
25
26private:
27   required_device<md_subcart_slot_device> m_exp;
28};
29
30
31// device type definition
32extern const device_type MD_ROM_SK;
33
34#endif
Property changes on: trunk/src/mess/machine/md_sk.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/megasvp.c
r0r20696
1/* Megadrive SVP emulation (Virtua Racing) */
2
3#include "includes/md.h"
4
5
6/****************************************** SVP related *****************************************/
7
8/*
9 * Emulator of memory controller in SVP chip
10 *
11 * Copyright 2008, Grazvydas Ignotas
12 * based on RE work by Tasco Deluxe
13 *
14 * SSP1601 EXT registers are mapped as I/O ports due to their function
15 * (they are interfaced through external bus), and are named as follows
16 * (these are unofficial names, official ones are unknown):
17 *   EXT0: PM0 - programmable register 0
18 *   EXT1: PM1 - ... 1
19 *   EXT2: PM2 - ... 2
20 *   EXT3: XST - external status. Can also act as PM.
21 *   EXT4: PM4 - ... 4
22 *   EXT5: (unused)
23 *   EXT6: PMC - programmable memory register control (PMAC).
24 *   EXT7: AL  - although internal to SSP1601, it still causes bus access
25 *
26 * Depending on GPO bits in status register, PM0, PM1, PM2 and XST can act as
27 * external status registers, os as programmable memory registers. PM4 always
28 * acts as PM register (independent on GPO bits).
29 */
30
31
32#define SSP_PMC_HAVE_ADDR  1  // address written to PMAC, waiting for mode
33#define SSP_PMC_SET        2  // PMAC is set, PMx can be programmed
34
35static int get_inc(int mode)
36{
37   int inc = (mode >> 11) & 7;
38   if (inc != 0) {
39      if (inc != 7) inc--;
40      inc = 1 << inc; // 0 1 2 4 8 16 32 128
41      if (mode & 0x8000) inc = -inc; // decrement mode
42   }
43   return inc;
44}
45
46INLINE void overwrite_write(UINT16 *dst, UINT16 d)
47{
48   if (d & 0xf000) { *dst &= ~0xf000; *dst |= d & 0xf000; }
49   if (d & 0x0f00) { *dst &= ~0x0f00; *dst |= d & 0x0f00; }
50   if (d & 0x00f0) { *dst &= ~0x00f0; *dst |= d & 0x00f0; }
51   if (d & 0x000f) { *dst &= ~0x000f; *dst |= d & 0x000f; }
52}
53
54static UINT32 pm_io(address_space &space, int reg, int write, UINT32 d)
55{
56   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
57   if (state->m_emu_status & SSP_PMC_SET)
58   {
59      state->m_pmac_read[write ? reg + 6 : reg] = state->m_pmc.d;
60      state->m_emu_status &= ~SSP_PMC_SET;
61      return 0;
62   }
63   
64   // just in case
65   if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
66      state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
67   }
68   
69   if (reg == 4 || (space.device().state().state_int(SSP_ST) & 0x60))
70   {
71#define CADDR ((((mode<<16)&0x7f0000)|addr)<<1)
72      UINT16 *dram = (UINT16 *)state->m_dram;
73      if (write)
74      {
75         int mode = state->m_pmac_write[reg]>>16;
76         int addr = state->m_pmac_write[reg]&0xffff;
77         if      ((mode & 0x43ff) == 0x0018) // DRAM
78         {
79            int inc = get_inc(mode);
80            if (mode & 0x0400) {
81               overwrite_write(&dram[addr], d);
82            } else dram[addr] = d;
83            state->m_pmac_write[reg] += inc;
84         }
85         else if ((mode & 0xfbff) == 0x4018) // DRAM, cell inc
86         {
87            if (mode & 0x0400) {
88               overwrite_write(&dram[addr], d);
89            } else dram[addr] = d;
90            state->m_pmac_write[reg] += (addr&1) ? 31 : 1;
91         }
92         else if ((mode & 0x47ff) == 0x001c) // IRAM
93         {
94            int inc = get_inc(mode);
95            ((UINT16 *)state->m_iram)[addr&0x3ff] = d;
96            state->m_pmac_write[reg] += inc;
97         }
98         else
99         {
100            logerror("ssp FIXME: PM%i unhandled write mode %04x, [%06x] %04x\n",
101                   reg, mode, CADDR, d);
102         }
103      }
104      else
105      {
106         int mode = state->m_pmac_read[reg]>>16;
107         int addr = state->m_pmac_read[reg]&0xffff;
108         if      ((mode & 0xfff0) == 0x0800) // ROM, inc 1, verified to be correct
109         {
110            UINT16 *ROM = (UINT16 *) space.machine().root_device().memregion("maincpu")->base();
111            state->m_pmac_read[reg] += 1;
112            d = ROM[addr|((mode&0xf)<<16)];
113         }
114         else if ((mode & 0x47ff) == 0x0018) // DRAM
115         {
116            int inc = get_inc(mode);
117            d = dram[addr];
118            state->m_pmac_read[reg] += inc;
119         }
120         else
121         {
122            logerror("ssp FIXME: PM%i unhandled read  mode %04x, [%06x]\n",
123                   reg, mode, CADDR);
124            d = 0;
125         }
126      }
127     
128      // PMC value corresponds to last PMR accessed (not sure).
129      state->m_pmc.d = state->m_pmac_read[write ? reg + 6 : reg];
130     
131      return d;
132   }
133   
134   return (UINT32)-1;
135}
136
137static READ16_HANDLER( read_PM0 )
138{
139   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
140   UINT32 d = pm_io(space, 0, 0, 0);
141   if (d != (UINT32)-1) return d;
142   d = state->m_XST2;
143   state->m_XST2 &= ~2; // ?
144   return d;
145}
146
147static WRITE16_HANDLER( write_PM0 )
148{
149   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
150   UINT32 r = pm_io(space, 0, 1, data);
151   if (r != (UINT32)-1) return;
152   state->m_XST2 = data; // ?
153}
154
155static READ16_HANDLER( read_PM1 )
156{
157   UINT32 r = pm_io(space, 1, 0, 0);
158   if (r != (UINT32)-1) return r;
159   logerror("svp: PM1 acces in non PM mode?\n");
160   return 0;
161}
162
163static WRITE16_HANDLER( write_PM1 )
164{
165   UINT32 r = pm_io(space, 1, 1, data);
166   if (r != (UINT32)-1) return;
167   logerror("svp: PM1 acces in non PM mode?\n");
168}
169
170static READ16_HANDLER( read_PM2 )
171{
172   UINT32 r = pm_io(space, 2, 0, 0);
173   if (r != (UINT32)-1) return r;
174   logerror("svp: PM2 acces in non PM mode?\n");
175   return 0;
176}
177
178static WRITE16_HANDLER( write_PM2 )
179{
180   UINT32 r = pm_io(space, 2, 1, data);
181   if (r != (UINT32)-1) return;
182   logerror("svp: PM2 acces in non PM mode?\n");
183}
184
185static READ16_HANDLER( read_XST )
186{
187   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
188   UINT32 d = pm_io(space, 3, 0, 0);
189   if (d != (UINT32)-1) return d;
190   
191   return state->m_XST;
192}
193
194static WRITE16_HANDLER( write_XST )
195{
196   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
197   UINT32 r = pm_io(space, 3, 1, data);
198   if (r != (UINT32)-1) return;
199   
200   state->m_XST2 |= 1;
201   state->m_XST = data;
202}
203
204static READ16_HANDLER( read_PM4 )
205{
206   return pm_io(space, 4, 0, 0);
207}
208
209static WRITE16_HANDLER( write_PM4 )
210{
211   pm_io(space, 4, 1, data);
212}
213
214static READ16_HANDLER( read_PMC )
215{
216   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
217   if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
218      state->m_emu_status |= SSP_PMC_SET;
219      state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
220      return ((state->m_pmc.w.l << 4) & 0xfff0) | ((state->m_pmc.w.l >> 4) & 0xf);
221   } else {
222      state->m_emu_status |= SSP_PMC_HAVE_ADDR;
223      return state->m_pmc.w.l;
224   }
225}
226
227static WRITE16_HANDLER( write_PMC )
228{
229   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
230   if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
231      state->m_emu_status |= SSP_PMC_SET;
232      state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
233      state->m_pmc.w.h = data;
234   } else {
235      state->m_emu_status |= SSP_PMC_HAVE_ADDR;
236      state->m_pmc.w.l = data;
237   }
238}
239
240static READ16_HANDLER( read_AL )
241{
242   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
243   state->m_emu_status &= ~(SSP_PMC_SET|SSP_PMC_HAVE_ADDR);
244   return 0;
245}
246
247static WRITE16_HANDLER( write_AL )
248{
249}
250
251
252
253static READ16_HANDLER( svp_68k_io_r )
254{
255   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
256   UINT32 d;
257   switch (offset)
258   {
259         // 0xa15000, 0xa15002
260      case 0:
261      case 1:  return state->m_XST;
262         // 0xa15004
263      case 2:  d = state->m_XST2; state->m_XST2 &= ~1; return d;
264      default: logerror("unhandled SVP reg read @ %x\n", offset<<1);
265   }
266   return 0;
267}
268
269static WRITE16_HANDLER( svp_68k_io_w )
270{
271   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
272   switch (offset)
273   {
274         // 0xa15000, 0xa15002
275      case 0:
276      case 1:  state->m_XST = data; state->m_XST2 |= 2; break;
277         // 0xa15006
278      case 3:  break; // possibly halts SSP1601
279      default: logerror("unhandled SVP reg write %04x @ %x\n", data, offset<<1);
280   }
281}
282
283static READ16_HANDLER( svp_68k_cell1_r )
284{
285   // this is rewritten 68k test code
286   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
287   UINT32 a1 = offset;
288   a1 = (a1 & 0x7001) | ((a1 & 0x3e) << 6) | ((a1 & 0xfc0) >> 5);
289   return ((UINT16 *)state->m_dram)[a1];
290}
291
292static READ16_HANDLER( svp_68k_cell2_r )
293{
294   // this is rewritten 68k test code
295   mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
296   UINT32 a1 = offset;
297   a1 = (a1 & 0x7801) | ((a1 & 0x1e) << 6) | ((a1 & 0x7e0) >> 4);
298   return ((UINT16 *)state->m_dram)[a1];
299}
300
301ADDRESS_MAP_START( svp_ssp_map, AS_PROGRAM, 16, driver_device )
302   AM_RANGE(0x0000, 0x03ff) AM_ROMBANK("bank3")
303   AM_RANGE(0x0400, 0xffff) AM_ROMBANK("bank4")
304ADDRESS_MAP_END
305
306ADDRESS_MAP_START( svp_ext_map, AS_IO, 16, driver_device )
307   ADDRESS_MAP_GLOBAL_MASK(0xf)
308   AM_RANGE(0*2, 0*2+1) AM_READWRITE_LEGACY(read_PM0, write_PM0)
309   AM_RANGE(1*2, 1*2+1) AM_READWRITE_LEGACY(read_PM1, write_PM1)
310   AM_RANGE(2*2, 2*2+1) AM_READWRITE_LEGACY(read_PM2, write_PM2)
311   AM_RANGE(3*2, 3*2+1) AM_READWRITE_LEGACY(read_XST, write_XST)
312   AM_RANGE(4*2, 4*2+1) AM_READWRITE_LEGACY(read_PM4, write_PM4)
313   AM_RANGE(6*2, 6*2+1) AM_READWRITE_LEGACY(read_PMC, write_PMC)
314   AM_RANGE(7*2, 7*2+1) AM_READWRITE_LEGACY(read_AL, write_AL)
315ADDRESS_MAP_END
316
317
318static READ16_HANDLER( svp_speedup_r )
319{
320   space.device().execute().spin_until_time(attotime::from_usec(100));
321   return 0x0425;
322}
323
324
325void svp_init(running_machine &machine)
326{
327   mdsvp_state *state = machine.driver_data<mdsvp_state>();
328   UINT8 *ROM = state->memregion("maincpu")->base();
329   
330   memset(state->m_pmac_read, 0, ARRAY_LENGTH(state->m_pmac_read));
331   memset(state->m_pmac_write, 0, ARRAY_LENGTH(state->m_pmac_write));
332   state->m_pmc.d = 0;
333   state->m_pmc.w.l = 0;
334   state->m_pmc.w.h = 0;
335   state->m_emu_status = 0;
336   state->m_XST = 0;
337   state->m_XST2 = 0;
338   
339   /* SVP stuff */
340   state->m_dram = auto_alloc_array(machine, UINT8, 0x20000);
341   machine.device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x300000, 0x31ffff, state->m_dram);
342   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa15000, 0xa150ff, FUNC(svp_68k_io_r), FUNC(svp_68k_io_w));
343   // "cell arrange" 1 and 2
344   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x390000, 0x39ffff, FUNC(svp_68k_cell1_r));
345   machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3a0000, 0x3affff, FUNC(svp_68k_cell2_r));
346   
347   machine.device("svp")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x438, 0x438, FUNC(svp_speedup_r));
348
349   if (state->m_slotcart->m_cart->get_rom_base() != NULL)
350      memcpy(ROM, state->m_slotcart->m_cart->get_rom_base(), state->m_slotcart->m_cart->get_rom_size());
351
352   state->m_iram = auto_alloc_array(machine, UINT8, 0x800);
353   state->membank("bank3")->set_base(state->m_iram);
354   /* SVP ROM just shares m68k region.. */
355   state->membank("bank4")->set_base(ROM + 0x800);
356}
Property changes on: trunk/src/mess/machine/megasvp.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/md_rom.c
r0r20696
1/***********************************************************************************************************
2 
3 
4 MegaDrive / Genesis cart emulation
5 
6 
7 Here we emulate bankswitch / protection / NVRAM found on generic carts with no additional hardware
8
9
10 ***********************************************************************************************************/
11
12#include "emu.h"
13#include "machine/md_rom.h"
14#include "cpu/m68000/m68000.h"
15
16
17//-------------------------------------------------
18//  md_rom_device - constructor
19//-------------------------------------------------
20
21// BASE CARTS + NVRAM
22const device_type MD_STD_ROM = &device_creator<md_std_rom_device>;
23const device_type MD_ROM_SRAM = &device_creator<md_rom_sram_device>;
24const device_type MD_ROM_FRAM = &device_creator<md_rom_fram_device>;
25
26// BASE CARTS + PROTECTION / BANKSWITCH
27const device_type MD_ROM_SSF2 = &device_creator<md_rom_ssf2_device>;
28const device_type MD_ROM_BUGSLIFE = &device_creator<md_rom_bugslife_device>;
29const device_type MD_ROM_SMOUSE = &device_creator<md_rom_smouse_device>;
30const device_type MD_ROM_SMB = &device_creator<md_rom_smb_device>;
31const device_type MD_ROM_SMB2 = &device_creator<md_rom_smb2_device>;
32const device_type MD_ROM_SBUBL = &device_creator<md_rom_sbubl_device>;
33const device_type MD_ROM_RX3 = &device_creator<md_rom_rx3_device>;
34const device_type MD_ROM_MJLOV = &device_creator<md_rom_mjlov_device>;
35const device_type MD_ROM_KOF98 = &device_creator<md_rom_kof98_device>;
36const device_type MD_ROM_KOF99 = &device_creator<md_rom_kof99_device>;
37const device_type MD_ROM_SOULB = &device_creator<md_rom_soulb_device>;
38const device_type MD_ROM_CHINF3 = &device_creator<md_rom_chinf3_device>;
39const device_type MD_ROM_ELFWOR = &device_creator<md_rom_elfwor_device>;
40const device_type MD_ROM_LION2 = &device_creator<md_rom_lion2_device>;
41const device_type MD_ROM_LION3 = &device_creator<md_rom_lion3_device>;
42const device_type MD_ROM_MCPIR = &device_creator<md_rom_mcpirate_device>;
43const device_type MD_ROM_POKESTAD = &device_creator<md_rom_pokestad_device>;
44const device_type MD_ROM_REALTEC = &device_creator<md_rom_realtec_device>;
45const device_type MD_ROM_REDCL = &device_creator<md_rom_redcl_device>;
46const device_type MD_ROM_SQUIR = &device_creator<md_rom_squir_device>;
47const device_type MD_ROM_TOPF = &device_creator<md_rom_topf_device>;
48const device_type MD_ROM_RADICA = &device_creator<md_rom_radica_device>;
49const device_type MD_ROM_BEGGAR = &device_creator<md_rom_beggar_device>;
50
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_POKE = &device_creator<md_std_rom_device>;
54const device_type MD_ROM_POKE2 = &device_creator<md_std_rom_device>;
55
56
57md_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)
58               : device_t(mconfig, type, name, tag, owner, clock),
59               device_md_cart_interface( mconfig, *this )
60{
61}
62
63md_std_rom_device::md_std_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
64               : device_t(mconfig, MD_STD_ROM, "MD Standard cart", tag, owner, clock),
65               device_md_cart_interface( mconfig, *this )
66{
67}
68
69md_rom_sram_device::md_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
70               : md_std_rom_device(mconfig, MD_ROM_SRAM, "MD Standard cart + SRAM", tag, owner, clock)
71{
72}
73
74md_rom_beggar_device::md_rom_beggar_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
75               : md_std_rom_device(mconfig, MD_ROM_BEGGAR, "MD Xin Qigai Wangzi", tag, owner, clock)
76{
77}
78
79md_rom_fram_device::md_rom_fram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
80               : md_std_rom_device(mconfig, MD_ROM_FRAM, "MD Standard cart + FRAM", tag, owner, clock)
81{
82}
83
84md_rom_ssf2_device::md_rom_ssf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
85               : md_std_rom_device(mconfig, MD_ROM_SSF2, "MD Super SF2", tag, owner, clock)
86{
87}
88
89md_rom_mcpirate_device::md_rom_mcpirate_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
90               : md_std_rom_device(mconfig, MD_ROM_MCPIR, "MD Pirate Multicarts (Various)", tag, owner, clock)
91{
92}
93
94md_rom_bugslife_device::md_rom_bugslife_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
95               : md_std_rom_device(mconfig, MD_ROM_BUGSLIFE, "MD A Bug's Life", tag, owner, clock)
96{
97}
98
99md_rom_smouse_device::md_rom_smouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
100               : md_std_rom_device(mconfig, MD_ROM_SMOUSE, "MD Huan Le Tao Qi Shu / Smart Mouse", tag, owner, clock)
101{
102}
103
104md_rom_smb_device::md_rom_smb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
105               : md_std_rom_device(mconfig, MD_ROM_SMB, "MD Super Mario Bros.", tag, owner, clock)
106{
107}
108
109md_rom_smb2_device::md_rom_smb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
110               : md_std_rom_device(mconfig, MD_ROM_SMB2, "MD Super Mario Bros. 2", tag, owner, clock)
111{
112}
113
114md_rom_sbubl_device::md_rom_sbubl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
115               : md_std_rom_device(mconfig, MD_ROM_SBUBL, "MD Super Bubble Bobble", tag, owner, clock)
116{
117}
118
119md_rom_rx3_device::md_rom_rx3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
120               : md_std_rom_device(mconfig, MD_ROM_SMB2, "MD Rockman X3", tag, owner, clock)
121{
122}
123
124md_rom_mjlov_device::md_rom_mjlov_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
125               : md_std_rom_device(mconfig, MD_ROM_MJLOV, "MD Ma Jiang Qing Ren / Mahjong Lover", tag, owner, clock)
126{
127}
128
129md_rom_kof98_device::md_rom_kof98_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
130               : md_std_rom_device(mconfig, MD_ROM_KOF98, "MD KOF 98", tag, owner, clock)
131{
132}
133
134md_rom_kof99_device::md_rom_kof99_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
135               : md_std_rom_device(mconfig, MD_ROM_KOF99, "MD KOF 99", tag, owner, clock)
136{
137}
138
139md_rom_soulb_device::md_rom_soulb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
140               : md_std_rom_device(mconfig, MD_ROM_SOULB, "MD Soul Blade", tag, owner, clock)
141{
142}
143
144md_rom_chinf3_device::md_rom_chinf3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
145               : md_std_rom_device(mconfig, MD_ROM_CHINF3, "MD Chinese Fighter 3", tag, owner, clock)
146{
147}
148
149md_rom_elfwor_device::md_rom_elfwor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
150               : md_std_rom_device(mconfig, MD_ROM_ELFWOR, "MD Linghuan Daoshi Super Magician / Elf Wor", tag, owner, clock)
151{
152}
153
154md_rom_lion2_device::md_rom_lion2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
155               : md_std_rom_device(mconfig, MD_ROM_LION2, "MD Lion King 2", tag, owner, clock)
156{
157}
158
159md_rom_lion3_device::md_rom_lion3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
160               : md_std_rom_device(mconfig, MD_ROM_LION3, "MD Lion King 3", tag, owner, clock)
161{
162}
163
164md_rom_pokestad_device::md_rom_pokestad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
165               : md_std_rom_device(mconfig, MD_ROM_POKESTAD, "MD Pokemon Stadium", tag, owner, clock)
166{
167}
168
169md_rom_realtec_device::md_rom_realtec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
170               : md_std_rom_device(mconfig, MD_ROM_REALTEC, "MD Realtec", tag, owner, clock)
171{
172}
173
174md_rom_redcl_device::md_rom_redcl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
175               : md_std_rom_device(mconfig, MD_ROM_REDCL, "MD Redcliff", tag, owner, clock)
176{
177}
178
179md_rom_squir_device::md_rom_squir_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
180               : md_std_rom_device(mconfig, MD_ROM_SQUIR, "MD Squirrel King", tag, owner, clock)
181{
182}
183
184md_rom_topf_device::md_rom_topf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
185               : md_std_rom_device(mconfig, MD_ROM_TOPF, "MD Top Fighter", tag, owner, clock)
186{
187}
188
189md_rom_radica_device::md_rom_radica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
190               : md_std_rom_device(mconfig, MD_ROM_RADICA, "MD Radica TV games", tag, owner, clock)
191{
192}
193
194//-------------------------------------------------
195//  device_start - device-specific startup
196//-------------------------------------------------
197
198void md_rom_ssf2_device::device_start()
199{
200   for (int i = 0; i < 7; i++)
201      m_bank[i] = i;
202   m_lastoff = -1;
203   m_lastdata = -1;
204   save_item(NAME(m_bank));
205   save_item(NAME(m_lastoff));
206   save_item(NAME(m_lastdata));
207}
208
209void md_rom_mcpirate_device::device_start()
210{
211   m_bank = 0;
212   save_item(NAME(m_bank));
213}
214
215void md_rom_chinf3_device::device_start()
216{
217   m_bank = 0;
218   save_item(NAME(m_bank));
219}
220
221void md_rom_lion2_device::device_start()
222{
223   m_prot1_data = 0;
224   m_prot2_data = 0;
225   save_item(NAME(m_prot1_data));
226   save_item(NAME(m_prot2_data));
227}
228
229void md_rom_lion3_device::device_start()
230{
231   m_prot_data = 0;
232   m_prot_cmd = 0;
233   m_bank = 0;
234   save_item(NAME(m_prot_data));
235   save_item(NAME(m_prot_cmd));
236   save_item(NAME(m_bank));
237}
238
239void md_rom_pokestad_device::device_start()
240{
241   m_bank = 0;
242   save_item(NAME(m_bank));
243}
244
245void md_rom_realtec_device::device_start()
246{
247   m_bank_addr = 0;
248   m_bank_size = 0;
249   m_old_bank_addr = -1;
250   save_item(NAME(m_bank_addr));
251   save_item(NAME(m_bank_size));
252   save_item(NAME(m_old_bank_addr));
253}
254
255void md_rom_squir_device::device_start()
256{
257   m_latch = 0;
258   save_item(NAME(m_latch));
259}
260
261void md_rom_topf_device::device_start()
262{
263   m_latch = 0;
264   m_bank[0] = m_bank[1] = m_bank[2] = 0;
265   save_item(NAME(m_latch));
266   save_item(NAME(m_bank));
267}
268
269void md_rom_radica_device::device_start()
270{
271   m_bank = 0;
272   save_item(NAME(m_bank));
273}
274
275/*-------------------------------------------------
276 mapper specific handlers
277 -------------------------------------------------*/
278
279/*-------------------------------------------------
280 CART + SRAM
281 -------------------------------------------------*/
282
283READ16_MEMBER(md_rom_sram_device::read)
284{
285   offset <<= 1;
286   // since a lot of generic carts ends up here if loaded from fullpath
287   // we access nvram only if m_nvram_handlers_installed has been turned on
288   if (m_nvram_handlers_installed)
289   {
290      if (offset >= m_nvram_start && offset < m_nvram_end && m_nvram_active)
291         return m_nvram[(offset - m_nvram_start)/2];
292   }
293   return m_rom[offset/2];
294}
295
296WRITE16_MEMBER(md_rom_sram_device::write)
297{
298   // since a lot of generic carts ends up here if loaded from fullpath
299   // we access nvram only if m_nvram_handlers_installed has been turned on
300   if (m_nvram_handlers_installed)
301   {
302      offset <<= 1;
303      if (offset >= m_nvram_start && offset <= m_nvram_end && m_nvram_active && !m_nvram_readonly)
304         m_nvram[(offset - m_nvram_start)/2] = data;
305   }
306}
307
308WRITE16_MEMBER(md_rom_sram_device::write_a13)
309{
310   offset <<= 1;
311   if (offset == 0xf)
312   {
313      /* unsure if this is actually supposed to toggle or just switch on? yet to encounter game that uses this */
314      m_nvram_active = BIT(data, 0);
315      m_nvram_readonly = BIT(data, 1);
316
317      // since a lot of generic carts ends up here if loaded from fullpath
318      // we turn on nvram (with m_nvram_handlers_installed) only if they toggle it on by writing here!
319      if (m_nvram_active && !m_nvram_handlers_installed)
320         m_nvram_handlers_installed = 1;
321   }
322}
323
324/*-------------------------------------------------
325 BEGGAR PRINCE / XIN QIGAI WANGZI [same as above, but diff start/end... merge?]
326 -------------------------------------------------*/
327
328READ16_MEMBER(md_rom_beggar_device::read)
329{
330   offset <<= 1;
331   if (offset >= m_nvram_start && offset < m_nvram_end && m_nvram_active)
332      return m_nvram[(offset - m_nvram_start)/2];
333   return m_rom[offset/2];
334}
335
336WRITE16_MEMBER(md_rom_beggar_device::write)
337{
338   offset <<= 1;
339   if (offset >= m_nvram_start && offset <= m_nvram_end && m_nvram_active && !m_nvram_readonly)
340      m_nvram[(offset - m_nvram_start)/2] = data;
341}
342
343WRITE16_MEMBER(md_rom_beggar_device::write_a13)
344{
345   offset <<= 1;
346   if (offset == 0xf)
347   {
348      /* unsure if this is actually supposed to toggle or just switch on? yet to encounter game that uses this */
349      m_nvram_active = BIT(data, 0);
350      m_nvram_readonly = BIT(data, 1);
351   }
352}
353
354/*-------------------------------------------------
355 CART + FRAM [almost same as SRAM... merge common parts?]
356 -------------------------------------------------*/
357
358READ16_MEMBER(md_rom_fram_device::read)
359{
360   offset <<= 1;
361   if (offset >= m_nvram_start && offset < m_nvram_end && m_nvram_active)
362      return m_nvram[(offset - m_nvram_start)/2];
363   return m_rom[offset/2];
364}
365
366WRITE16_MEMBER(md_rom_fram_device::write_a13)
367{
368   offset <<= 1;
369   if (offset == 0xf)
370      m_nvram_active = BIT(data, 0);
371}
372
373
374READ16_MEMBER(md_rom_fram_device::read_a13)
375{
376   if (offset == 0xf)
377      return m_nvram_active;
378   else
379      return 0xffff;
380}
381
382/*-------------------------------------------------
383 SUPER STREET FIGHTERS 2
384 -------------------------------------------------*/
385
386READ16_MEMBER(md_rom_ssf2_device::read)
387{
388   if (offset < 0x400000/2)
389      return m_rom[offset];
390   else
391      return 0xffff;
392}
393
394// I'm not very fond of the code below...
395WRITE16_MEMBER(md_rom_ssf2_device::write_a13)
396{
397   if (offset >= 0xf0/2)
398   {
399      offset -= 0xf0/2;
400      if ((m_lastoff != offset) || (m_lastdata != data))
401      {
402         m_lastoff = offset;
403         m_lastdata = data;
404         if (offset)   // bank 0 is not modified
405         {
406            UINT16 *ROM = get_rom_base();
407            m_bank[offset] = data & 0xf;
408            memcpy(ROM + offset * 0x080000/2, ROM + 0x400000/2 + (m_bank[offset] * 0x080000)/2, 0x080000);
409         }
410      }
411   }
412}
413
414/*-------------------------------------------------
415 PIRATE MULTICARTS
416 -------------------------------------------------*/
417
418READ16_MEMBER(md_rom_mcpirate_device::read)
419{
420   if (offset < 0x400000/2)
421   {
422      return m_rom[offset + (m_bank * 0x10000)/2];
423   }
424   else
425   {
426      return read(space, offset - 0x400000/2, 0xffff);
427   }
428}
429
430WRITE16_MEMBER(md_rom_mcpirate_device::write_a13)
431{
432   offset <<= 1;
433   if (offset < 0x40)
434      m_bank = offset;
435}
436
437/*-------------------------------------------------
438 A BUG'S LIFE
439 -------------------------------------------------*/
440
441READ16_MEMBER(md_rom_bugslife_device::read_a13)
442{
443   if (offset == 0)
444      return 0x28;
445   else
446      return 0xffff;
447}
448
449/*-------------------------------------------------
450 CHINESE FIGHTER 3
451 -------------------------------------------------*/
452
453READ16_MEMBER(md_rom_chinf3_device::read)
454{
455   if (offset < 0x100000/2)
456   {
457      if (!m_bank)
458         return m_rom[offset & 0xfffff/2];
459      else
460         return m_rom[(offset & 0xffff/2) + (m_bank * 0x10000)/2];
461   }
462   
463   // PROTECTION in 0x400000 - 0x4fffff
464   /* not 100% correct, there may be some relationship between the reads here
465    and the writes made at the start of the game.. */
466   if (offset >= 0x400000/2 && offset < 0x500000/2)
467   {
468      UINT32 retdat = 0;
469      /*
470       04dc10 chifi3, prot_r? 2800
471       04cefa chifi3, prot_r? 65262
472       */
473      if (space.machine().device("maincpu")->safe_pc() == 0x01782) // makes 'VS' screen appear
474      {
475         retdat = space.machine().device("maincpu")->state().state_int(M68K_D3) & 0xff;
476         retdat <<= 8;
477         return retdat;
478      }
479      else if (space.machine().device("maincpu")->safe_pc() == 0x1c24) // background gfx etc.
480      {
481         retdat = space.machine().device("maincpu")->state().state_int(M68K_D3) & 0xff;
482         retdat <<= 8;
483         return retdat;
484      }
485      else if (space.machine().device("maincpu")->safe_pc() == 0x10c4a) // unknown
486      {
487         return space.machine().rand();
488      }
489      else if (space.machine().device("maincpu")->safe_pc() == 0x10c50) // unknown
490      {
491         return space.machine().rand();
492      }
493      else if (space.machine().device("maincpu")->safe_pc() == 0x10c52) // relates to the game speed..
494      {
495         retdat = space.machine().device("maincpu")->state().state_int(M68K_D4) & 0xff;
496         retdat <<= 8;
497         return retdat;
498      }
499      else if (space.machine().device("maincpu")->safe_pc() == 0x061ae)
500      {
501         retdat = space.machine().device("maincpu")->state().state_int(M68K_D3) & 0xff;
502         retdat <<= 8;
503         return retdat;
504      }
505      else if (space.machine().device("maincpu")->safe_pc() == 0x061b0)
506      {
507         retdat = space.machine().device("maincpu")->state().state_int(M68K_D3) & 0xff;
508         retdat <<= 8;
509         return retdat;
510      }
511      else
512      {
513         logerror("%06x chifi3, prot_r? %04x\n", space.machine().device("maincpu")->safe_pc(), offset);
514      }
515      return 0;
516   }
517   
518   return m_rom[offset & 0x1fffff/2];
519}
520
521WRITE16_MEMBER(md_rom_chinf3_device::write)
522{
523   if (offset >= 0x600000/2 && offset < 0x700000/2)
524   {
525      if (data == 0xf100) // *hit player
526         m_bank = 1;
527      else if (data == 0xd700) // title screen..
528         m_bank = 7;
529      else if (data == 0xd300) // character hits floor
530         m_bank = 3;
531      else if (data == 0x0000)
532         m_bank = 0;
533      else
534         logerror("%06x chifi3, bankw? %04x %04x\n", space.device().safe_pc(), offset, data);
535   }
536}
537
538/*-------------------------------------------------
539 LINGHUAN DAOSHI SUPER MAGICIAN / ELF WOR
540 -------------------------------------------------*/
541
542READ16_MEMBER(md_rom_elfwor_device::read)
543{
544   /* It returns (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006).
545    It is probably best to add handlers for all 4 addresses. */
546   if (offset == 0x400000/2)   return 0x5500;
547   if (offset == 0x400002/2)   return 0x0f00;
548   if (offset == 0x400004/2)   return 0xc900;
549   if (offset == 0x400006/2)   return 0x1800;
550   return m_rom[offset];
551}
552
553/*-------------------------------------------------
554 HUAN LE TAO QI SHU / SMART MOUSE
555 -------------------------------------------------*/
556
557READ16_MEMBER(md_rom_smouse_device::read)
558{
559   if (offset == 0x400000/2)   return 0x5500;
560   if (offset == 0x400002/2)   return 0x0f00;
561   if (offset == 0x400004/2)   return 0xaa00;
562   if (offset == 0x400006/2)   return 0xf000;
563   return m_rom[offset];
564}
565
566/*-------------------------------------------------
567 KOF98
568 -------------------------------------------------*/
569
570READ16_MEMBER(md_rom_kof98_device::read)
571{
572   if (offset == 0x480000/2)   return 0xaa00;
573   if (offset == 0x4800e0/2)   return 0xaa00;
574   if (offset == 0x4824a0/2)   return 0xaa00;
575   if (offset == 0x488880/2)   return 0xaa00;
576   if (offset == 0x4a8820/2)   return 0x0a00;
577   if (offset == 0x4f8820/2)   return 0x0000;
578   return m_rom[offset];
579}
580
581/*-------------------------------------------------
582 KOF 99
583 -------------------------------------------------*/
584// gfx glitch with the new code... uninitialized ram somewhere?
585READ16_MEMBER(md_rom_kof99_device::read_a13)
586{
587   if (offset == 0x00/2)   return 0x00;   // startup protection check, chinese message if != 0
588   if (offset == 0x02/2)   return 0x01;   // write 02 to a13002.. shift right 1?
589   if (offset == 0x3e/2)   return 0x1f;   // write 3e to a1303e.. shift right 1?
590   else   return 0xffff;
591}
592
593/*-------------------------------------------------
594 LION KING 2
595 -------------------------------------------------*/
596
597READ16_MEMBER(md_rom_lion2_device::read)
598{
599   if (offset == 0x400002/2)   return m_prot1_data;
600   if (offset == 0x400006/2)   return m_prot2_data;
601   return m_rom[offset];
602}
603
604WRITE16_MEMBER(md_rom_lion2_device::write)
605{
606   if (offset == 0x400000/2)   m_prot1_data = data;
607   if (offset == 0x400004/2)   m_prot2_data = data;
608}
609
610/*-------------------------------------------------
611 LION KING 3
612 -------------------------------------------------*/
613
614READ16_MEMBER(md_rom_lion3_device::read)
615{
616   if (offset < 0x8000/2)
617      return m_rom[offset + (m_bank * 0x8000)/2];
618   else if (offset >= 0x600000/2 && offset < 0x700000/2)
619   {   
620      UINT16 retdata = 0;
621      switch (offset & 0x7)
622      {
623         case 2:
624            if (m_prot_cmd == 0)
625               retdata = (m_prot_data << 1);
626            else if (m_prot_cmd == 1)
627               retdata = (m_prot_data >> 1);
628            else if (m_prot_cmd == 2)
629            {
630               retdata = m_prot_data >> 4;
631               retdata |= (m_prot_data & 0x0f) << 4;
632            }
633            else
634            {
635               /* printf("unk prot case %d\n", m_prot_cmd); */
636               retdata =  (BIT(m_prot_data, 7) << 0);
637               retdata |= (BIT(m_prot_data, 6) << 1);
638               retdata |= (BIT(m_prot_data, 5) << 2);
639               retdata |= (BIT(m_prot_data, 4) << 3);
640               retdata |= (BIT(m_prot_data, 3) << 4);
641               retdata |= (BIT(m_prot_data, 2) << 5);
642               retdata |= (BIT(m_prot_data, 1) << 6);
643               retdata |= (BIT(m_prot_data, 0) << 7);
644            }
645            break;
646           
647         default:
648            logerror("protection read, unknown offset %x\n", offset & 0x7);
649            break;
650      }
651      return retdata;
652   }
653   
654   return m_rom[offset];
655}
656
657WRITE16_MEMBER(md_rom_lion3_device::write)
658{
659   if (offset >= 0x600000/2 && offset < 0x700000/2)
660   {
661      switch (offset & 0x7)
662      {
663         case 0x0:
664            m_prot_data = data;
665            break;
666         case 0x1:
667            m_prot_cmd = data;
668            break;
669         default:
670            logerror("protection write, unknown offset %d\n", offset & 0x7);
671            break;
672      }
673   }
674   if (offset >= 0x700000/2 && offset < 0x800000/2)
675   {
676      switch (offset & 0x7)
677      {
678         case 0x0:
679            m_bank = data & 0xffff;
680            break;
681         default:
682            logerror("bank write, unknown offset %d\n", offset & 0x7);
683            break;
684      }
685   }
686}
687
688/*-------------------------------------------------
689 MA JIANG QING REN / MAHJONG LOVER
690 -------------------------------------------------*/
691
692READ16_MEMBER(md_rom_mjlov_device::read)
693{
694   if (offset == 0x400000/2)   return 0x9000;
695   if (offset == 0x401000/2)   return 0xd300;
696   return m_rom[offset];
697}
698
699
700/*-------------------------------------------------
701 SUPER BUBBLE BOBBLE MD
702 -------------------------------------------------*/
703
704READ16_MEMBER(md_rom_sbubl_device::read)
705{
706   if (offset == 0x400000/2)   return 0x5500;
707   if (offset == 0x400002/2)   return 0x0f00;
708   return m_rom[offset];
709}
710
711/*-------------------------------------------------
712 SOUL BLADE
713 -------------------------------------------------*/
714
715READ16_MEMBER(md_rom_soulb_device::read)
716{
717   if (offset == 0x400002/2)   return 0x9800;
718   if (offset == 0x400004/2)   return 0xc900;
719   if (offset == 0x400006/2)   return 0xf000;
720   return m_rom[offset];
721}
722
723/*-------------------------------------------------
724 POKEMON STADIUM / KAIJU
725 -------------------------------------------------*/
726
727READ16_MEMBER(md_rom_pokestad_device::read)
728{
729   if (offset < 0x8000/2)
730      return m_rom[offset + (m_bank * 0x8000)/2];
731   return m_rom[offset];
732}
733
734WRITE16_MEMBER(md_rom_pokestad_device::write)
735{
736   if (offset >= 0x700000/2 && offset < 0x800000/2)
737      m_bank = data & 0x7f;
738}
739
740/*-------------------------------------------------
741 REALTEC
742 -------------------------------------------------*/
743
744READ16_MEMBER(md_rom_realtec_device::read)
745{
746   if (offset < (m_bank_size * 0x20000))   // two banks of same (variable) size at the bottom of the rom
747      return m_rom[offset + (m_bank_addr * 0x20000)/2];
748   return m_rom[(offset & 0x1fff/2) + 0x7e000/2];   // otherwise it accesses the final 8k of the image
749}
750
751WRITE16_MEMBER(md_rom_realtec_device::write)
752{
753   if (offset == 0x400000/2)
754   {
755      m_old_bank_addr = m_bank_addr;
756      m_bank_addr = (m_bank_addr & 0x7) | ((data >> 9) & 0x7) << 3;
757   }
758   if (offset == 0x402000/2)
759   {
760      m_bank_addr = 0;
761      m_bank_size = (data >> 8) & 0x1f;
762   }
763   if (offset == 0x404000/2)
764   {
765      m_old_bank_addr = m_bank_addr;
766      m_bank_addr = (m_bank_addr & 0xf8) | ((data >> 8) & 0x3);
767   }
768}
769
770/*-------------------------------------------------
771 RED CLIFF
772 -------------------------------------------------*/
773
774READ16_MEMBER(md_rom_redcl_device::read)
775{
776   if (offset == 0x400000/2)   return 0x55 << 8;
777   if (offset == 0x400004/2)   return -0x56 << 8;
778   return m_rom[offset];
779}
780
781/*-------------------------------------------------
782 ROCKMAN X3
783 -------------------------------------------------*/
784
785READ16_MEMBER(md_rom_rx3_device::read_a13)
786{
787   if (offset == 0)
788      return 0x0c;
789   else
790      return 0xffff;
791}
792
793/*-------------------------------------------------
794 SQUIRREL KING
795 -------------------------------------------------*/
796
797READ16_MEMBER(md_rom_squir_device::read)
798{
799   if ((offset >= 0x400000/2) && (offset < 0x400008/2))
800      return m_latch;
801   return m_rom[offset];
802}
803
804WRITE16_MEMBER(md_rom_squir_device::write)
805{
806   if (offset >= 0x400000/2 && offset < 0x400008/2)
807      m_latch = data;
808}
809
810/*-------------------------------------------------
811 SUPER MARIO BROS
812 -------------------------------------------------*/
813
814READ16_MEMBER(md_rom_smb_device::read_a13)
815{
816   if (offset == 0)
817      return 0x0c;
818   else
819      return 0xffff;
820}
821
822/*-------------------------------------------------
823 SUPER MARIO BROS 2
824 -------------------------------------------------*/
825
826READ16_MEMBER(md_rom_smb2_device::read_a13)
827{
828   if (offset == 0)
829      return 0x0a;
830   else
831      return 0xffff;
832}
833
834/*-------------------------------------------------
835 TOP FIGHTER
836 -------------------------------------------------*/
837
838READ16_MEMBER(md_rom_topf_device::read)
839{
840   //cpu #0 (PC=0004CBAE): unmapped program memory word read from 006A35D4 & 00FF -- wants regD7
841   if (offset == 0x645b44/2)
842   {
843      //cpu #0 (PC=0004DE00): unmapped program memory word write to 00689B80 = 004A & 00FF
844      //cpu #0 (PC=0004DE08): unmapped program memory word write to 00 = 00B5 & 00FF
845      //cpu #0 (PC=0004DE0C): unmapped program memory word read from 00645B44 & 00FF
846     
847      return 0x9f;//0x25;
848   }
849   if (offset == 0x6bd294/2)
850   {
851      /*
852       cpu #0 (PC=00177192): unmapped program memory word write to 006BD240 = 00A8 & 00FF
853       cpu #0 (PC=0017719A): unmapped program memory word write to 006BD2D2 = 0098 & 00FF
854       cpu #0 (PC=001771A2): unmapped program memory word read from 006BD294 & 00FF
855       */
856     
857      if (space.device().safe_pc()==0x1771a2) return 0x50;
858      else
859      {
860         m_latch++;
861         logerror("%06x topfig_6BD294_r %04x\n",space.device().safe_pc(), m_latch);
862         return m_latch;
863      }
864   }
865   if (offset == 0x6f5344/2)
866   {
867      if (space.device().safe_pc()==0x4C94E)
868         return space.machine().device("maincpu")->state().state_int((M68K_D0)) & 0xff;
869      else
870      {
871         m_latch++;
872         logerror("%06x topfig_6F5344_r %04x\n", space.device().safe_pc(), m_latch);
873         return m_latch;
874      }
875   }
876
877   if (offset >= 0x20000/2 && offset < 0x28000/2)
878      return m_rom[offset + (m_bank[0] * 0x188000)/2];
879
880   if (offset >= 0x58000/2 && offset < 0x60000/2)
881      return m_rom[offset + (m_bank[1] * 0x20000)/2];
882
883   if (offset >= 0x60000/2 && offset < 0x68000/2)
884      return m_rom[offset + (m_bank[2] * 0x110000)/2];
885
886   return m_rom[offset];
887}
888
889WRITE16_MEMBER(md_rom_topf_device::write)
890{
891   if (offset >= 0x700000/2 && offset < 0x800000/2)
892   {
893      if (data == 0x002a)
894         m_bank[2] = 1;   // == 0x2e*0x8000?!
895      else if (data==0x0035) // characters ingame
896         m_bank[0] = 1;   // == 0x35*0x8000
897      else if (data==0x000f) // special moves
898         m_bank[1] = 1; // == 0xf*0x8000
899      else if (data==0x0000)
900      {
901         m_bank[0] = 0;
902         m_bank[1] = 0;
903         m_bank[2] = 0;
904      }
905      else
906         logerror("%06x offset %06x, data %04x\n", space.device().safe_pc(), offset, data);
907   }
908}
909
910/*-------------------------------------------------
911 RADICA TV GAMES [to be split...]
912 -------------------------------------------------*/
913
914READ16_MEMBER(md_rom_radica_device::read)
915{
916   return m_rom[m_bank * 0x10000/2 + offset];
917}
918
919READ16_MEMBER(md_rom_radica_device::read_a13)
920{
921   if (offset < 0x80)
922      m_bank = offset & 0x3f;
923   return 0;
924}
Property changes on: trunk/src/mess/machine/md_rom.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/machine/md_rom.h
r0r20696
1#ifndef __MD_ROM_H
2#define __MD_ROM_H
3
4#include "machine/md_slot.h"
5
6
7//**************************************************************************
8//  TYPE DEFINITIONS
9//**************************************************************************
10
11// ======================> md_std_rom_device
12
13class md_std_rom_device : public device_t,
14                 public device_md_cart_interface
15{
16public:
17   // construction/destruction
18   md_std_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
19   md_std_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20   
21   // device-level overrides
22   virtual void device_start() {};
23   virtual void device_config_complete() { m_shortname = "md_std_rom"; }
24     
25   // reading and writing
26   virtual DECLARE_READ16_MEMBER(read) { return m_rom[offset]; };
27   virtual DECLARE_WRITE16_MEMBER(write) { };
28};
29
30// ======================> md_rom_sram_device
31
32class md_rom_sram_device : public md_std_rom_device
33{
34public:
35   // construction/destruction
36   md_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37   
38   // device-level overrides
39   virtual void device_config_complete() { m_shortname = "md_rom_sram"; }
40   
41   // reading and writing
42   virtual DECLARE_READ16_MEMBER(read);
43   virtual DECLARE_WRITE16_MEMBER(write);
44   virtual DECLARE_WRITE16_MEMBER(write_a13);
45};
46
47// ======================> md_rom_beggar_device
48
49class md_rom_beggar_device : public md_std_rom_device
50{
51public:
52   // construction/destruction
53   md_rom_beggar_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
54   
55   // device-level overrides
56   virtual void device_config_complete() { m_shortname = "md_rom_beggar"; }
57   
58   // reading and writing
59   virtual DECLARE_READ16_MEMBER(read);
60   virtual DECLARE_WRITE16_MEMBER(write);
61   virtual DECLARE_WRITE16_MEMBER(write_a13);
62};
63
64// ======================> md_rom_fram_device
65
66class md_rom_fram_device : public md_std_rom_device
67{
68public:
69   // construction/destruction
70   md_rom_fram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
71   
72   // device-level overrides
73   virtual void device_config_complete() { m_shortname = "md_rom_fram"; }
74   
75   // reading and writing
76   virtual DECLARE_READ16_MEMBER(read);
77   virtual DECLARE_READ16_MEMBER(read_a13);
78   virtual DECLARE_WRITE16_MEMBER(write_a13);
79};
80
81// ======================> md_rom_ssf2_device
82
83class md_rom_ssf2_device : public md_std_rom_device
84{
85public:
86   // construction/destruction
87   md_rom_ssf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
88   
89   // device-level overrides
90   virtual void device_start();
91   virtual void device_config_complete() { m_shortname = "md_rom_ssf2"; }
92   
93   // reading and writing
94   virtual DECLARE_READ16_MEMBER(read);
95   virtual DECLARE_WRITE16_MEMBER(write_a13);
96
97private:
98   UINT8 m_bank[16];
99   int m_lastoff, m_lastdata;   
100};
101
102// ======================> md_rom_mcpirate_device
103
104class md_rom_mcpirate_device : public md_std_rom_device
105{
106public:
107   // construction/destruction
108   md_rom_mcpirate_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
109   
110   // device-level overrides
111   virtual void device_start();
112   virtual void device_config_complete() { m_shortname = "md_rom_mcpirate"; }
113   
114   // reading and writing
115   virtual DECLARE_READ16_MEMBER(read);
116   virtual DECLARE_WRITE16_MEMBER(write_a13);
117   
118private:
119   UINT8 m_bank;
120};
121
122
123// ======================> md_rom_bugslife_device
124
125class md_rom_bugslife_device : public md_std_rom_device
126{
127public:
128   // construction/destruction
129   md_rom_bugslife_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
130   
131   // device-level overrides
132   virtual void device_config_complete() { m_shortname = "md_rom_bugslife"; }
133   
134   // reading and writing
135   virtual DECLARE_READ16_MEMBER(read_a13);
136};
137
138// ======================> md_rom_chinf3_device
139
140class md_rom_chinf3_device : public md_std_rom_device
141{
142public:
143   // construction/destruction
144   md_rom_chinf3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
145   
146   // device-level overrides
147   virtual void device_start();
148   virtual void device_config_complete() { m_shortname = "md_rom_chinf3"; }
149   
150   // reading and writing
151   virtual DECLARE_READ16_MEMBER(read);
152   virtual DECLARE_WRITE16_MEMBER(write);
153   
154private:
155   int m_bank;
156};
157
158// ======================> md_rom_elfwor_device
159
160class md_rom_elfwor_device : public md_std_rom_device
161{
162public:
163   // construction/destruction
164   md_rom_elfwor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
165   
166   // device-level overrides
167   virtual void device_config_complete() { m_shortname = "md_rom_elfwor"; }
168   
169   // reading and writing
170   virtual DECLARE_READ16_MEMBER(read);
171};
172
173// ======================> md_rom_kof98_device
174
175class md_rom_kof98_device : public md_std_rom_device
176{
177public:
178   // construction/destruction
179   md_rom_kof98_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
180   
181   // device-level overrides
182   virtual void device_config_complete() { m_shortname = "md_rom_kof98"; }
183   
184   // reading and writing
185   virtual DECLARE_READ16_MEMBER(read);
186};
187
188// ======================> md_rom_kof99_device
189
190class md_rom_kof99_device : public md_std_rom_device
191{
192public:
193   // construction/destruction
194   md_rom_kof99_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
195   
196   // device-level overrides
197   virtual void device_config_complete() { m_shortname = "md_rom_kof99"; }
198   
199   // reading and writing
200   virtual DECLARE_READ16_MEMBER(read_a13);
201};
202
203// ======================> md_rom_lion2_device
204
205class md_rom_lion2_device : public md_std_rom_device
206{
207public:
208   // construction/destruction
209   md_rom_lion2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
210   
211   // device-level overrides
212   virtual void device_start();
213   virtual void device_config_complete() { m_shortname = "md_rom_lion2"; }
214   
215   // reading and writing
216   virtual DECLARE_READ16_MEMBER(read);
217   virtual DECLARE_WRITE16_MEMBER(write);
218   
219private:
220   UINT16 m_prot1_data, m_prot2_data;
221};
222
223// ======================> md_rom_lion3_device
224
225class md_rom_lion3_device : public md_std_rom_device
226{
227public:
228   // construction/destruction
229   md_rom_lion3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
230   
231   // device-level overrides
232   virtual void device_start();
233   virtual void device_config_complete() { m_shortname = "md_rom_lion3"; }
234   
235   // reading and writing
236   virtual DECLARE_READ16_MEMBER(read);
237   virtual DECLARE_WRITE16_MEMBER(write);
238   
239private:
240   UINT8 m_prot_data, m_prot_cmd;
241   UINT16 m_bank;
242};
243
244// ======================> md_rom_mjlov_device
245
246class md_rom_mjlov_device : public md_std_rom_device
247{
248public:
249   // construction/destruction
250   md_rom_mjlov_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
251   
252   // device-level overrides
253   virtual void device_config_complete() { m_shortname = "md_rom_mjlov"; }
254   
255   // reading and writing
256   virtual DECLARE_READ16_MEMBER(read);
257};
258
259// ======================> md_rom_pokestad_device
260
261class md_rom_pokestad_device : public md_std_rom_device
262{
263public:
264   // construction/destruction
265   md_rom_pokestad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
266   
267   // device-level overrides
268   virtual void device_start();
269   virtual void device_config_complete() { m_shortname = "md_rom_pokestad"; }
270   
271   // reading and writing
272   virtual DECLARE_READ16_MEMBER(read);
273   virtual DECLARE_WRITE16_MEMBER(write);
274   
275private:
276   UINT8 m_bank;
277};
278
279// ======================> md_rom_realtec_device
280
281class md_rom_realtec_device : public md_std_rom_device
282{
283public:
284   // construction/destruction
285   md_rom_realtec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
286   
287   // device-level overrides
288   virtual void device_start();
289   virtual void device_config_complete() { m_shortname = "md_rom_realtec"; }
290   
291   // reading and writing
292   virtual DECLARE_READ16_MEMBER(read);
293   virtual DECLARE_WRITE16_MEMBER(write);
294   
295private:
296   UINT16 m_bank_addr, m_bank_size, m_old_bank_addr;
297};
298
299// ======================> md_rom_redcl_device
300
301class md_rom_redcl_device : public md_std_rom_device
302{
303public:
304   // construction/destruction
305   md_rom_redcl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
306   
307   // device-level overrides
308   virtual void device_config_complete() { m_shortname = "md_rom_redcl"; }
309   
310   // reading and writing
311   virtual DECLARE_READ16_MEMBER(read);
312};
313
314// ======================> md_rom_rx3_device
315
316class md_rom_rx3_device : public md_std_rom_device
317{
318public:
319   // construction/destruction
320   md_rom_rx3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
321   
322   // device-level overrides
323   virtual void device_config_complete() { m_shortname = "md_rom_rx3"; }
324   
325   // reading and writing
326   virtual DECLARE_READ16_MEMBER(read_a13);
327};
328
329// ======================> md_rom_sbubl_device
330
331class md_rom_sbubl_device : public md_std_rom_device
332{
333public:
334   // construction/destruction
335   md_rom_sbubl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
336   
337   // device-level overrides
338   virtual void device_config_complete() { m_shortname = "md_rom_sbubl"; }
339   
340   // reading and writing
341   virtual DECLARE_READ16_MEMBER(read);
342};
343
344// ======================> md_rom_smb_device
345
346class md_rom_smb_device : public md_std_rom_device
347{
348public:
349   // construction/destruction
350   md_rom_smb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
351   
352   // device-level overrides
353   virtual void device_config_complete() { m_shortname = "md_rom_smb"; }
354   
355   // reading and writing
356   virtual DECLARE_READ16_MEMBER(read_a13);
357};
358
359// ======================> md_rom_smb2_device
360
361class md_rom_smb2_device : public md_std_rom_device
362{
363public:
364   // construction/destruction
365   md_rom_smb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
366   
367   // device-level overrides
368   virtual void device_config_complete() { m_shortname = "md_rom_smb2"; }
369   
370   // reading and writing
371   virtual DECLARE_READ16_MEMBER(read_a13);
372};
373
374// ======================> md_rom_smouse_device
375
376class md_rom_smouse_device : public md_std_rom_device
377{
378public:
379   // construction/destruction
380   md_rom_smouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
381   
382   // device-level overrides
383   virtual void device_config_complete() { m_shortname = "md_rom_smouse"; }
384   
385   // reading and writing
386   virtual DECLARE_READ16_MEMBER(read);
387};
388
389
390// ======================> md_rom_soulb_device
391
392class md_rom_soulb_device : public md_std_rom_device
393{
394public:
395   // construction/destruction
396   md_rom_soulb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
397   
398   // device-level overrides
399   virtual void device_config_complete() { m_shortname = "md_rom_soulb"; }
400   
401   // reading and writing
402   virtual DECLARE_READ16_MEMBER(read);
403};
404
405// ======================> md_rom_squir_device
406
407class md_rom_squir_device : public md_std_rom_device
408{
409public:
410   // construction/destruction
411   md_rom_squir_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
412   
413   // device-level overrides
414   virtual void device_start();
415   virtual void device_config_complete() { m_shortname = "md_rom_squir"; }
416   
417   // reading and writing
418   virtual DECLARE_READ16_MEMBER(read);
419   virtual DECLARE_WRITE16_MEMBER(write);
420   
421private:
422   UINT16 m_latch;
423};
424
425// ======================> md_rom_topf_device
426
427class md_rom_topf_device : public md_std_rom_device
428{
429public:
430   // construction/destruction
431   md_rom_topf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
432   
433   // device-level overrides
434   virtual void device_start();
435   virtual void device_config_complete() { m_shortname = "md_rom_topf"; }
436   
437   // reading and writing
438   virtual DECLARE_READ16_MEMBER(read);
439   virtual DECLARE_WRITE16_MEMBER(write);
440   
441private:
442   UINT16 m_latch;
443   UINT8 m_bank[3];
444};
445
446// ======================> md_rom_radica_device
447
448class md_rom_radica_device : public md_std_rom_device
449{
450public:
451   // construction/destruction
452   md_rom_radica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
453   
454   // device-level overrides
455   virtual void device_start();
456   virtual void device_config_complete() { m_shortname = "md_rom_radica"; }
457   
458   // reading and writing
459   virtual DECLARE_READ16_MEMBER(read);
460   virtual DECLARE_READ16_MEMBER(read_a13);
461   
462private:
463   UINT8 m_bank;
464};
465
466
467
468// device type definition
469extern const device_type MD_STD_ROM;
470extern const device_type MD_ROM_SRAM;
471extern const device_type MD_ROM_FRAM;
472extern const device_type MD_ROM_BEGGAR;
473extern const device_type MD_ROM_BUGSLIFE;
474extern const device_type MD_ROM_CHINF3;
475extern const device_type MD_ROM_ELFWOR;
476extern const device_type MD_ROM_KOF98;
477extern const device_type MD_ROM_KOF99;
478extern const device_type MD_ROM_LION2;
479extern const device_type MD_ROM_LION3;
480extern const device_type MD_ROM_MCPIR;
481extern const device_type MD_ROM_MJLOV;
482extern const device_type MD_ROM_POKESTAD;
483extern const device_type MD_ROM_REALTEC;
484extern const device_type MD_ROM_REDCL;
485extern const device_type MD_ROM_RX3;
486extern const device_type MD_ROM_SBUBL;
487extern const device_type MD_ROM_SMB;
488extern const device_type MD_ROM_SMB2;
489extern const device_type MD_ROM_SMOUSE;
490extern const device_type MD_ROM_SOULB;
491extern const device_type MD_ROM_SSF2;
492extern const device_type MD_ROM_SQUIR;
493extern const device_type MD_ROM_TOPF;
494extern const device_type MD_ROM_RADICA;
495
496// this are currently unused... protection is directly patched out!
497extern const device_type MD_ROM_MULAN;
498extern const device_type MD_ROM_POKE;
499extern const device_type MD_ROM_POKE2;
500
501#endif
Property changes on: trunk/src/mess/machine/md_rom.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/md_jcart.c
r0r20696
1/***********************************************************************************************************
2 
3 
4 MegaDrive / Genesis J-Cart (+SEPROM) emulation
5 
6 
7 i2c games mapping table:
8 
9 game name                         |   SDA_IN   |  SDA_OUT   |     SCL    |  SIZE_MASK     | PAGE_MASK |
10 ----------------------------------|------------|------------|------------|----------------|-----------|
11 Micro Machines 2                  | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) |   0x0f    |
12 Micro Machines Military           | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) |   0x0f    |
13 Micro Machines 96                 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x07ff (24C16) |   0x0f    |
14 ----------------------------------|------------|------------|------------|----------------|-----------|
15 
16 * Notes: check these
17
18
19 TODO: proper SEPROM emulation, still not worked on (just hooked up the I2C device)
20 
21***********************************************************************************************************/
22
23
24
25#include "emu.h"
26#include "machine/md_jcart.h"
27
28
29//-------------------------------------------------
30//  md_rom_device - constructor
31//-------------------------------------------------
32
33const device_type MD_JCART = &device_creator<md_jcart_device>;
34const device_type MD_SEPROM_CODEMAST = &device_creator<md_seprom_codemast_device>;
35const device_type MD_SEPROM_MM96 = &device_creator<md_seprom_mm96_device>;
36
37// Sampras, Super Skidmarks?
38md_jcart_device::md_jcart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
39               : device_t(mconfig, type, name, tag, owner, clock),
40               device_md_cart_interface( mconfig, *this ),
41               m_jcart3(*this, "JCART3"),
42               m_jcart4(*this, "JCART4")
43{
44}
45
46md_jcart_device::md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
47               : device_t(mconfig, MD_JCART, "MD J-Cart games", tag, owner, clock),
48               device_md_cart_interface( mconfig, *this ),
49               m_jcart3(*this, "JCART3"),
50               m_jcart4(*this, "JCART4")
51{
52}
53
54// Micro Machines 2, Micro Machines Military
55md_seprom_codemast_device::md_seprom_codemast_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
56               : md_jcart_device(mconfig, type, name, tag, owner, clock),
57               m_i2cmem(*this, "i2cmem")
58{
59}
60
61md_seprom_codemast_device::md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
62               : md_jcart_device(mconfig, MD_SEPROM_CODEMAST, "MD J-Cart games + SEPROM", tag, owner, clock),
63               m_i2cmem(*this, "i2cmem")
64{
65}
66
67// Micro Machines 96
68md_seprom_mm96_device::md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
69               : md_seprom_codemast_device(mconfig, MD_SEPROM_MM96, "MD Micro Machine 96", tag, owner, clock)
70{
71}
72
73
74//-------------------------------------------------
75//  SERIAL I2C DEVICE
76//-------------------------------------------------
77
78static const i2cmem_interface md_24c08_i2cmem_interface =
79{
80   I2CMEM_SLAVE_ADDRESS, 0, 0x400
81};
82
83static const i2cmem_interface md_24c16a_i2cmem_interface =
84{
85   I2CMEM_SLAVE_ADDRESS, 0, 0x800
86};
87
88// MD_SEPROM_CODEMAST
89MACHINE_CONFIG_FRAGMENT( md_i2c_24c08 )
90   MCFG_I2CMEM_ADD("i2cmem", md_24c08_i2cmem_interface)
91MACHINE_CONFIG_END
92
93// MD_SEPROM_MM96
94MACHINE_CONFIG_FRAGMENT( md_i2c_24c16a )
95   MCFG_I2CMEM_ADD("i2cmem", md_24c16a_i2cmem_interface)
96MACHINE_CONFIG_END
97
98
99//-------------------------------------------------
100//  machine_config_additions - device-specific
101//  machine configurations
102//-------------------------------------------------
103
104machine_config_constructor md_seprom_codemast_device::device_mconfig_additions() const
105{
106   return MACHINE_CONFIG_NAME( md_i2c_24c08 );
107}
108
109machine_config_constructor md_seprom_mm96_device::device_mconfig_additions() const
110{
111   return MACHINE_CONFIG_NAME( md_i2c_24c16a );
112}
113
114
115static INPUT_PORTS_START( jcart_ipt )
116
117   PORT_START("JCART3")     /* Joypad 3 on J-Cart (3 button + start) */
118   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
119   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
120   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
121   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
122   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("P3 B")
123   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("P3 C")
124   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("P3 A")
125   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(3)
126
127   PORT_START("JCART4")     /* Joypad 4 on J-Cart (3 button + start) */
128   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
129   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
130   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
131   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
132   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("P4 B")
133   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("P4 C")
134   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("P4 A")
135   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(4)
136
137INPUT_PORTS_END
138
139ioport_constructor md_jcart_device::device_input_ports() const
140{
141   return INPUT_PORTS_NAME( jcart_ipt );
142}
143
144
145void md_jcart_device::device_start()
146{
147   m_jcart_io_data[0] = 0;
148   m_jcart_io_data[1] = 0;
149   save_item(NAME(m_jcart_io_data));
150}
151
152void md_seprom_codemast_device::device_start()
153{
154   m_i2c_mem = 0;
155   m_i2c_clk = 0;
156   m_jcart_io_data[0] = 0;
157   m_jcart_io_data[1] = 0;
158   save_item(NAME(m_i2c_mem));
159   save_item(NAME(m_i2c_clk));
160   save_item(NAME(m_jcart_io_data));
161}
162
163
164/*-------------------------------------------------
165 mapper specific handlers
166 -------------------------------------------------*/
167
168/*-------------------------------------------------
169 J-CART ONLY (Pete Sampras Tennis)
170 -------------------------------------------------*/
171
172READ16_MEMBER(md_jcart_device::read)
173{
174   if (offset == 0x38fffe/2)
175   {
176      UINT8 joy[2];
177     
178      if (m_jcart_io_data[0] & 0x40)
179      {
180         joy[0] = m_jcart3->read_safe(0);
181         joy[1] = m_jcart4->read_safe(0);
182         return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
183      }
184      else
185      {
186         joy[0] = ((m_jcart3->read_safe(0) & 0xc0) >> 2) | (m_jcart3->read_safe(0) & 0x03);
187         joy[1] = ((m_jcart4->read_safe(0) & 0xc0) >> 2) | (m_jcart4->read_safe(0) & 0x03);
188         return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
189      }
190   }
191   return m_rom[offset];
192}
193
194WRITE16_MEMBER(md_jcart_device::write)
195{
196   if (offset == 0x38fffe/2)
197   {
198      m_jcart_io_data[0] = (data & 1) << 6;
199      m_jcart_io_data[1] = (data & 1) << 6;
200   }
201}
202
203/*-------------------------------------------------
204 J-CART + SEPROM
205 -------------------------------------------------*/
206
207READ16_MEMBER(md_seprom_codemast_device::read)
208{
209   if (offset == 0x380000/2)
210   {
211      m_i2c_mem = i2cmem_sda_read(m_i2cmem);
212      return (m_i2c_mem & 1) << 7;
213   }
214   if (offset == 0x38fffe/2)
215   {
216      UINT8 joy[2];
217     
218      if (m_jcart_io_data[0] & 0x40)
219      {
220         joy[0] = m_jcart3->read_safe(0);
221         joy[1] = m_jcart4->read_safe(0);
222         return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
223      }
224      else
225      {
226         joy[0] = ((m_jcart3->read_safe(0) & 0xc0) >> 2) | (m_jcart3->read_safe(0) & 0x03);
227         joy[1] = ((m_jcart4->read_safe(0) & 0xc0) >> 2) | (m_jcart4->read_safe(0) & 0x03);
228         return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
229      }
230   }
231   return m_rom[offset];
232}
233
234WRITE16_MEMBER(md_seprom_codemast_device::write)
235{
236   if (offset == 0x380000/2)
237   {
238      m_i2c_clk = BIT(data, 9);
239      m_i2c_mem = BIT(data, 8);
240      i2cmem_scl_write(m_i2cmem, m_i2c_clk);
241      i2cmem_sda_write(m_i2cmem, m_i2c_mem);
242   }
243   if (offset == 0x38fffe/2)
244   {
245      m_jcart_io_data[0] = (data & 1) << 6;
246      m_jcart_io_data[1] = (data & 1) << 6;
247   }
248}
249
Property changes on: trunk/src/mess/machine/md_jcart.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/machine/md_jcart.h
r0r20696
1#ifndef __MD_JCART_H
2#define __MD_JCART_H
3
4#include "machine/md_slot.h"
5#include "machine/i2cmem.h"
6
7
8//**************************************************************************
9//  TYPE DEFINITIONS
10//**************************************************************************
11
12// ======================> md_jcart_device
13
14class md_jcart_device : public device_t,
15               public device_md_cart_interface
16{
17public:
18   // construction/destruction
19   md_jcart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
20   md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   
22   // device-level overrides
23   virtual void device_start();
24   virtual void device_config_complete() { m_shortname = "md_jcart"; }
25   virtual ioport_constructor device_input_ports() const;
26
27   // reading and writing
28   virtual DECLARE_READ16_MEMBER(read);
29   virtual DECLARE_WRITE16_MEMBER(write);
30
31   required_ioport m_jcart3;
32   required_ioport m_jcart4;
33
34private:
35   UINT8 m_jcart_io_data[2];
36};
37
38// ======================> md_seprom_codemast_device
39
40class md_seprom_codemast_device : public md_jcart_device
41{
42public:
43   // construction/destruction
44   md_seprom_codemast_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
45   md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
46   
47   // device-level overrides
48   virtual void device_start();
49   virtual void device_config_complete() { m_shortname = "md_seprom_codemast"; }
50   virtual machine_config_constructor device_mconfig_additions() const;
51   
52   // reading and writing
53   virtual DECLARE_READ16_MEMBER(read);
54   virtual DECLARE_WRITE16_MEMBER(write);
55
56   required_device<i2cmem_device> m_i2cmem;
57
58private:
59   UINT8 m_jcart_io_data[2];   
60   UINT8 m_i2c_mem, m_i2c_clk;
61};
62
63// ======================> md_seprom_mm96_device (same read/write as codemast, but different I2C type)
64
65class md_seprom_mm96_device : public md_seprom_codemast_device
66{
67public:
68   // construction/destruction
69   md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
70   
71   // device-level overrides
72   virtual void device_config_complete() { m_shortname = "md_seprom_mm96"; }
73   virtual machine_config_constructor device_mconfig_additions() const;
74};
75
76
77
78// device type definition
79extern const device_type MD_JCART;
80extern const device_type MD_SEPROM_CODEMAST;
81extern const device_type MD_SEPROM_MM96;
82
83#endif
Property changes on: trunk/src/mess/machine/md_jcart.h
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/includes/md.h
r0r20696
1#ifndef __MD__
2#define __MD__
3
4// Temporary include file to handle SVP add-on, until converted to a proper slot device
5// Afterwards, these classes can be moved back to mess/drivers/megadriv.c!
6
7#include "includes/megadriv.h"
8#include "machine/md_slot.h"
9
10class md_cons_state : public md_base_state
11{
12public:
13   md_cons_state(const machine_config &mconfig, device_type type, const char *tag)
14      : md_base_state(mconfig, type, tag),
15      m_slotcart(*this, "mdslot")
16   { }   
17   
18   emu_timer *m_mess_io_timeout[3];
19   int m_mess_io_stage[3];
20   
21   optional_device<md_cart_slot_device> m_slotcart;
22   
23   DECLARE_DRIVER_INIT(mess_md_common);
24   DECLARE_DRIVER_INIT(genesis);
25   DECLARE_DRIVER_INIT(md_eur);
26   DECLARE_DRIVER_INIT(md_jpn);
27};
28
29class mdsvp_state : public md_cons_state
30{
31public:
32   mdsvp_state(const machine_config &mconfig, device_type type, const char *tag)
33      : md_cons_state(mconfig, type, tag) { }
34   
35   UINT8 *m_iram; // IRAM (0-0x7ff)
36   UINT8 *m_dram; // [0x20000];
37   UINT32 m_pmac_read[6];  // read modes/addrs for PM0-PM5
38   UINT32 m_pmac_write[6]; // write ...
39   PAIR m_pmc;
40   UINT32 m_emu_status;
41   UINT16 m_XST;       // external status, mapped at a15000 and a15002 on 68k side.
42   UINT16 m_XST2;      // status of XST (bit1 set when 68k writes to XST)
43};
44
45class pico_state : public md_cons_state
46{
47public:
48   pico_state(const machine_config &mconfig, device_type type, const char *tag)
49      : md_cons_state(mconfig, type, tag),
50      m_picocart(*this, "picoslot") { }
51   
52   optional_device<pico_cart_slot_device> m_picocart;
53   UINT8 m_page_register;
54};
55
56
57
58ADDRESS_MAP_EXTERN( svp_ssp_map, driver_device );
59ADDRESS_MAP_EXTERN( svp_ext_map, driver_device );
60extern void svp_init(running_machine &machine);
61extern cpu_device *_svp_cpu;
62
63
64#endif
Property changes on: trunk/src/mess/includes/md.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Previous 199869 Revisions Next


© 1997-2024 The MAME Team