trunk/src/mame/drivers/model2.c
| r243130 | r243131 | |
| 1235 | 1235 | }; |
| 1236 | 1236 | |
| 1237 | 1237 | |
| 1238 | | READ32_MEMBER(model2_state::model2_prot_r) |
| 1239 | | { |
| 1240 | | UINT32 retval = 0; |
| 1241 | 1238 | |
| 1242 | | if (offset == 0x10000/4) |
| 1243 | | { |
| 1244 | | // status: bit 0 = 1 for busy, 0 for ready |
| 1245 | | retval = 0; // we're always ready |
| 1246 | | } |
| 1247 | | else if (offset == 0x1000e/4) |
| 1248 | | { |
| 1249 | | retval = m_protram[m_protstate+1] | m_protram[m_protstate+0]<<8; |
| 1250 | | retval <<= 16; |
| 1251 | | m_protstate+=2; |
| 1252 | | } |
| 1253 | | else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, space.device().safe_pc()); |
| 1254 | | |
| 1255 | | printf("model2_prot_r %08x: %08x (%08x)\n", offset*4, retval, mem_mask); |
| 1256 | | |
| 1257 | | return retval; |
| 1258 | | } |
| 1259 | | |
| 1260 | | WRITE32_MEMBER(model2_state::model2_prot_w) |
| 1261 | | { |
| 1262 | | printf("model2_prot_w %08x: %08x (%08x)\n", offset*4, data, mem_mask); |
| 1263 | | |
| 1264 | | if (mem_mask == 0xffff0000) |
| 1265 | | { |
| 1266 | | data >>= 16; |
| 1267 | | } |
| 1268 | | |
| 1269 | | if (offset == 0x10008/4) |
| 1270 | | { |
| 1271 | | m_protpos = data; |
| 1272 | | } |
| 1273 | | else if (offset == 0x1000c/4) |
| 1274 | | { |
| 1275 | | switch (data) |
| 1276 | | { |
| 1277 | | // zerogun |
| 1278 | | case 0xA1BC: |
| 1279 | | case 0xAD23: |
| 1280 | | case 0x13CD: |
| 1281 | | case 0x4D53: |
| 1282 | | case 0x234D: |
| 1283 | | case 0x113D: |
| 1284 | | case 0x1049: |
| 1285 | | case 0x993D: |
| 1286 | | case 0x983C: |
| 1287 | | case 0x935: |
| 1288 | | case 0x9845: |
| 1289 | | case 0x556D: |
| 1290 | | case 0x98CC: |
| 1291 | | case 0x3422: |
| 1292 | | case 0x10: |
| 1293 | | m_protstate = 0; |
| 1294 | | memcpy(m_protram+2, ZGUNProt+((2*m_protpos)/12)*8, sizeof(ZGUNProt)); |
| 1295 | | break; |
| 1296 | | |
| 1297 | | // pltkids |
| 1298 | | case 0x7140: |
| 1299 | | m_protstate = 0; |
| 1300 | | strcpy((char *)m_protram+2, "98-PILOT "); |
| 1301 | | break; |
| 1302 | | |
| 1303 | | default: |
| 1304 | | m_protstate = 0; |
| 1305 | | break; |
| 1306 | | } |
| 1307 | | } |
| 1308 | | else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc()); |
| 1309 | | |
| 1310 | | } |
| 1311 | | |
| 1312 | | |
| 1313 | 1239 | READ32_MEMBER(model2_state::model2_5881prot_r) |
| 1314 | 1240 | { |
| 1315 | 1241 | UINT32 retval = 0; |
| r243130 | r243131 | |
| 1372 | 1298 | } |
| 1373 | 1299 | |
| 1374 | 1300 | |
| 1375 | | READ32_MEMBER(model2_state::doa_prot_r) |
| 1376 | | { |
| 1377 | | UINT32 retval = 0; |
| 1378 | 1301 | |
| 1379 | | if (offset == 0x7ff8/4) |
| 1380 | | { |
| 1381 | | retval = m_protram[m_protstate+1] | m_protram[m_protstate]<<8; |
| 1382 | | m_protstate+=2; |
| 1383 | | } |
| 1384 | | else if (offset == 0x400c/4) |
| 1385 | | { |
| 1386 | | m_prot_a = !m_prot_a; |
| 1387 | | if (m_prot_a) |
| 1388 | | retval = 0xffff; |
| 1389 | | else |
| 1390 | | retval = 0xfff0; |
| 1391 | | } |
| 1392 | | else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, space.device().safe_pc()); |
| 1393 | | |
| 1394 | | return retval; |
| 1395 | | } |
| 1396 | | |
| 1397 | | |
| 1398 | | WRITE32_MEMBER(model2_state::doa_prot_w) |
| 1399 | | { |
| 1400 | | if (offset == 0x7ff2 / 4) |
| 1401 | | { |
| 1402 | | if (data == 0) |
| 1403 | | { |
| 1404 | | m_protstate = 0; |
| 1405 | | strcpy((char *)m_protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00"); |
| 1406 | | } |
| 1407 | | } |
| 1408 | | else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc()); |
| 1409 | | } |
| 1410 | | |
| 1411 | 1302 | /* Daytona "To The MAXX" PIC protection simulation */ |
| 1412 | 1303 | |
| 1413 | 1304 | |
| r243130 | r243131 | |
| 2611 | 2502 | MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) |
| 2612 | 2503 | MACHINE_CONFIG_END |
| 2613 | 2504 | |
| 2505 | static MACHINE_CONFIG_DERIVED( model2a_0229, model2a ) |
| 2506 | MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0) |
| 2507 | // MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback) |
| 2508 | MACHINE_CONFIG_END |
| 2509 | |
| 2614 | 2510 | READ8_MEMBER(model2_state::driveio_port_r) |
| 2615 | 2511 | { |
| 2616 | 2512 | return m_driveio_comm_data; |
| r243130 | r243131 | |
| 2714 | 2610 | MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) |
| 2715 | 2611 | MACHINE_CONFIG_END |
| 2716 | 2612 | |
| 2613 | static MACHINE_CONFIG_DERIVED( model2b_0229, model2b ) |
| 2614 | MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0) |
| 2615 | // MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback) |
| 2616 | MACHINE_CONFIG_END |
| 2617 | |
| 2618 | |
| 2717 | 2619 | static ADDRESS_MAP_START( copro_tgpx4_map, AS_PROGRAM, 32, model2_state ) |
| 2718 | 2620 | AM_RANGE(0x00000000, 0x00007fff) AM_RAM AM_SHARE("tgpx4_program") |
| 2719 | 2621 | ADDRESS_MAP_END |
| r243130 | r243131 | |
| 6004 | 5906 | { |
| 6005 | 5907 | astring key = parameter(":315_5881:key"); |
| 6006 | 5908 | |
| 6007 | | if (key) |
| 6008 | | { |
| 6009 | | m_maincpu->space(AS_PROGRAM).install_ram(0x01d80000, 0x01d8ffff); |
| 6010 | | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d90000, 0x01d9ffff, read32_delegate(FUNC(model2_state::model2_5881prot_r), this), write32_delegate(FUNC(model2_state::model2_5881prot_w), this)); |
| 6011 | | } |
| 6012 | | else |
| 6013 | | { |
| 6014 | | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r), this), write32_delegate(FUNC(model2_state::model2_prot_w), this)); |
| 6015 | | m_protstate = m_protpos = 0; |
| 6016 | | } |
| 5909 | m_maincpu->space(AS_PROGRAM).install_ram(0x01d80000, 0x01d8ffff); |
| 5910 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d90000, 0x01d9ffff, read32_delegate(FUNC(model2_state::model2_5881prot_r), this), write32_delegate(FUNC(model2_state::model2_5881prot_w), this)); |
| 5911 | |
| 6017 | 5912 | } |
| 6018 | 5913 | |
| 6019 | 5914 | DRIVER_INIT_MEMBER(model2_state,pltkids) |
| r243130 | r243131 | |
| 6084 | 5979 | |
| 6085 | 5980 | DRIVER_INIT_MEMBER(model2_state,doa) |
| 6086 | 5981 | { |
| 6087 | | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::doa_prot_r),this), write32_delegate(FUNC(model2_state::doa_prot_w),this)); |
| 6088 | | m_protstate = m_protpos = 0; |
| 6089 | | |
| 5982 | m_0229crypt->install_doa_protection(); |
| 6090 | 5983 | |
| 6091 | 5984 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); |
| 6092 | 5985 | ROM[0x630/4] = 0x08000004; |
| r243130 | r243131 | |
| 6128 | 6021 | GAME( 1995, vf2o, vf2, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6129 | 6022 | GAME( 1995, vcop2, 0, model2a, vcop2, driver_device, 0, ROT0, "Sega", "Virtua Cop 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6130 | 6023 | GAME( 1995, skytargt, 0, model2a, skytargt,driver_device, 0, ROT0, "Sega", "Sky Target", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6131 | | GAME( 1996, doaa, doa, model2a, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2A, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6024 | GAME( 1996, doaa, doa, model2a_0229, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2A, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6132 | 6025 | GAME( 1997, zeroguna, zerogun, model2a_5881, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6133 | 6026 | GAME( 1997, zerogunaj, zerogun, model2a_5881, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6134 | 6027 | GAME( 1997, motoraid, 0, model2a, manxtt, driver_device, 0, ROT0, "Sega", "Motor Raid - Twin", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| r243130 | r243131 | |
| 6149 | 6042 | GAME( 1996, lastbrnx, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6150 | 6043 | GAME( 1996, lastbrnxu,lastbrnx, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6151 | 6044 | GAME( 1996, lastbrnxj,lastbrnx, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6152 | | GAME( 1996, doa, 0, model2b, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6045 | GAME( 1996, doa, 0, model2b_0229, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6153 | 6046 | GAME( 1996, sgt24h, 0, model2b, srallyc, model2_state, sgt24h, ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6154 | 6047 | GAME( 1996, von, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (USA, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 6155 | 6048 | GAME( 1996, vonj, von, model2b, model2, driver_device, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (Japan, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
trunk/src/mame/drivers/stv.c
| r243130 | r243131 | |
| 912 | 912 | |
| 913 | 913 | DRIVER_INIT_MEMBER(stv_state,decathlt) |
| 914 | 914 | { |
| 915 | | m_decathlt_lastcount = 0; |
| 916 | | m_decathlt_prot_uploadmode = 0; |
| 917 | | m_decathlt_prot_uploadoffset = 0; |
| 918 | | install_decathlt_protection(); |
| 915 | m_5838crypt->install_decathlt_protection(); |
| 919 | 916 | DRIVER_INIT_CALL(stv); |
| 920 | 917 | } |
| 921 | 918 | |
| r243130 | r243131 | |
| 1022 | 1019 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1023 | 1020 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1024 | 1021 | |
| 1022 | MACHINE_CONFIG_END |
| 1023 | |
| 1024 | static MACHINE_CONFIG_DERIVED( stv_5881, stv ) |
| 1025 | 1025 | MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) |
| 1026 | 1026 | MCFG_SET_READ_CALLBACK(stv_state, crypt_read_callback) |
| 1027 | 1027 | MACHINE_CONFIG_END |
| 1028 | 1028 | |
| 1029 | static MACHINE_CONFIG_DERIVED( stv_5838, stv ) |
| 1030 | MCFG_DEVICE_ADD("315_5838", SEGA315_5838_COMP, 0) |
| 1031 | // MCFG_SET_5838_READ_CALLBACK(stv_state, crypt_read_callback) |
| 1032 | MACHINE_CONFIG_END |
| 1033 | |
| 1034 | |
| 1029 | 1035 | /* |
| 1030 | 1036 | Batman Forever has an extra ADSP, used for sound. |
| 1031 | 1037 | Similar if not the same as Magic the Gathering, probably needs merging. |
| r243130 | r243131 | |
| 3025 | 3031 | |
| 3026 | 3032 | //GAME YEAR, NAME, PARENT, MACH, INP, INIT, MONITOR |
| 3027 | 3033 | /* Playable */ |
| 3028 | | GAME( 1998, astrass, stvbios, stv, stv6b, stv_state, astrass, ROT0, "Sunsoft", "Astra SuperStars (J 980514 V1.002)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3034 | GAME( 1998, astrass, stvbios, stv_5881, stv6b, stv_state, astrass, ROT0, "Sunsoft", "Astra SuperStars (J 980514 V1.002)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3029 | 3035 | GAME( 1995, bakubaku, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Baku Baku Animal (J 950407 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3030 | 3036 | GAME( 1996, batmanfr, stvbios, batmanfr, stv, stv_state, batmanfr, ROT0, "Acclaim", "Batman Forever (JUE 960507 V1.000)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3031 | 3037 | GAME( 1996, colmns97, stvbios, stv, stv, stv_state, colmns97, ROT0, "Sega", "Columns '97 (JET 961209 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| r243130 | r243131 | |
| 3037 | 3043 | GAME( 1996, diehard, stvbios, stv, stv, stv_state, diehard, ROT0, "Sega", "Die Hard Arcade (UET 960515 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3038 | 3044 | GAME( 1996, dnmtdeka, diehard, stv, stv, stv_state, dnmtdeka, ROT0, "Sega", "Dynamite Deka (J 960515 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3039 | 3045 | GAME( 1995, ejihon, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Ejihon Tantei Jimusyo (J 950613 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3040 | | GAME( 1998, elandore, stvbios, stv, stv6b, stv_state, elandore, ROT0, "Sai-Mate", "Touryuu Densetsu Elan-Doree / Elan Doree - Legend of Dragoon (JUET 980922 V1.006)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3041 | | GAME( 1999, ffreveng, stvbios, stv, stv, stv_state, ffreveng, ROT0, "Capcom", "Final Fight Revenge (JUET 990714 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3046 | GAME( 1998, elandore, stvbios, stv_5881, stv6b, stv_state, elandore, ROT0, "Sai-Mate", "Touryuu Densetsu Elan-Doree / Elan Doree - Legend of Dragoon (JUET 980922 V1.006)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3047 | GAME( 1999, ffreveng, stvbios, stv_5881, stv, stv_state, ffreveng, ROT0, "Capcom", "Final Fight Revenge (JUET 990714 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3042 | 3048 | GAME( 1995, fhboxers, stvbios, stv, stv, stv_state, fhboxers, ROT0, "Sega", "Funky Head Boxers (JUETBKAL 951218 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3043 | 3049 | GAME( 1997, findlove, stvbios, stv, stv, stv_state, stv, ROT0, "Daiki / FCF", "Zenkoku Seifuku Bishoujo Grand Prix Find Love (J 971212 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3044 | 3050 | GAME( 1994, gaxeduel, stvbios, stv, stv6b, stv_state, gaxeduel, ROT0, "Sega", "Golden Axe - The Duel (JUETL 950117 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS) |
| r243130 | r243131 | |
| 3054 | 3060 | GAME( 1995, pblbeach, stvbios, stv, stv, stv_state, pblbeach, ROT0, "T&E Soft", "Pebble Beach - The Great Shot (JUE 950913 V0.990)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3055 | 3061 | GAME( 1996, prikura, stvbios, stv, stv, stv_state, prikura, ROT0, "Atlus", "Princess Clara Daisakusen (J 960910 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3056 | 3062 | GAME( 1996, puyosun, stvbios, stv, stv, stv_state, puyosun, ROT0, "Compile", "Puyo Puyo Sun (J 961115 V0.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3057 | | GAME( 1998, rsgun, stvbios, stv, stv, stv_state, rsgun, ROT0, "Treasure", "Radiant Silvergun (JUET 980523 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3063 | GAME( 1998, rsgun, stvbios, stv_5881, stv, stv_state, rsgun, ROT0, "Treasure", "Radiant Silvergun (JUET 980523 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3058 | 3064 | GAME( 1998, sasissu, stvbios, stv, stv, stv_state, sasissu, ROT0, "Sega", "Taisen Tanto-R Sashissu!! (J 980216 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3059 | 3065 | GAME( 1999, sanjeon, sasissu, stv, stv, stv_state, sanjeon, ROT0, "Sega / Deniam", "DaeJeon! SanJeon SuJeon (AJTUE 990412 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3060 | 3066 | GAME( 1997, seabass, stvbios, stv, stv, stv_state, seabass, ROT0, "A wave inc. (Able license)", "Sea Bass Fishing (JUET 971110 V0.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3061 | 3067 | GAME( 1995, shanhigw, stvbios, stv, stv, stv_state, shanhigw, ROT0, "Sunsoft / Activision", "Shanghai - The Great Wall / Shanghai Triple Threat (JUE 950623 V1.005)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3062 | 3068 | GAME( 1997, shienryu, stvbios, stv, stv, stv_state, shienryu, ROT270, "Warashi", "Shienryu (JUET 961226 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3063 | | GAME( 1998, sss, stvbios, stv, stv, stv_state, sss, ROT0, "Capcom / Cave / Victor", "Steep Slope Sliders (JUET 981110 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3069 | GAME( 1998, sss, stvbios, stv_5881, stv, stv_state, sss, ROT0, "Capcom / Cave / Victor", "Steep Slope Sliders (JUET 981110 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3064 | 3070 | GAME( 1995, sandor, stvbios, stv, stv, stv_state, sandor, ROT0, "Sega", "Puzzle & Action: Sando-R (J 951114 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3065 | 3071 | GAME( 1997, thunt, sandor, stv, stv, stv_state, thunt, ROT0, "Sega", "Puzzle & Action: Treasure Hunt (JUET 970901 V2.00E)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3066 | 3072 | GAME( 1997, thuntk, sandor, stv, stv, stv_state, sandor, ROT0, "Sega / Deniam", "Puzzle & Action: BoMulEul Chajara (JUET 970125 V2.00K)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3067 | | GAME( 1998, twcup98, stvbios, stv, stv, stv_state, twcup98, ROT0, "Tecmo", "Tecmo World Cup '98 (JUET 980410 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3073 | GAME( 1998, twcup98, stvbios, stv_5881, stv, stv_state, twcup98, ROT0, "Tecmo", "Tecmo World Cup '98 (JUET 980410 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3068 | 3074 | GAME( 1995, smleague, stvbios, stv, stv, stv_state, smleague, ROT0, "Sega", "Super Major League (U 960108 V1.000)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3069 | 3075 | GAME( 1995, finlarch, smleague,stv, stv, stv_state, finlarch, ROT0, "Sega", "Final Arch (J 950714 V1.001)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3070 | 3076 | GAME( 1996, sokyugrt, stvbios, stv, stv, stv_state, sokyugrt, ROT0, "Raizing / Eighting", "Soukyugurentai / Terra Diver (JUET 960821 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| r243130 | r243131 | |
| 3092 | 3098 | |
| 3093 | 3099 | /* Doing something.. but not enough yet */ |
| 3094 | 3100 | GAME( 1995, vfremix, stvbios, stv, stv, stv_state, vfremix, ROT0, "Sega", "Virtua Fighter Remix (JUETBKAL 950428 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) |
| 3095 | | GAME( 1996, decathlt, stvbios, stv, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960709 V1.001)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) |
| 3096 | | GAME( 1996, decathlto, decathlt,stv, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960424 V1.000)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) |
| 3101 | GAME( 1996, decathlt, stvbios, stv_5838, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960709 V1.001)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) |
| 3102 | GAME( 1996, decathlto, decathlt,stv_5838, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960424 V1.000)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) |
| 3097 | 3103 | |
| 3098 | 3104 | /* Gives I/O errors */ |
| 3099 | 3105 | GAME( 1996, magzun, stvbios, stv, stv, stv_state, magzun, ROT0, "Sega", "Magical Zunou Power (J 961031 V1.000)", GAME_NOT_WORKING ) |
trunk/src/mame/machine/315-5838_317-0229_comp.c
| r0 | r243131 | |
| 1 | /* Sega Compression (and possibly encryption) device |
| 2 | |
| 3 | 315-5838 - Decathlete (ST-V) |
| 4 | 317-0229 - Dead or Alive (Model 2A) |
| 5 | |
| 6 | Package Type: TQFP100 |
| 7 | |
| 8 | This appears to be a dual channel compression chip, used in 1996, predating the 5881. |
| 9 | Decathlete uses it to compress ALL the game graphics, Dead or Alive uses it for a |
| 10 | dumb security check, decompressing a single string. |
| 11 | |
| 12 | Dead of Alive only uses a single channel, and has the source data in RAM, not ROM. |
| 13 | This is similar to how some 5881 games were set up, with the ST-V versions decrypting |
| 14 | data directly from ROM and the Model 2 ones using a RAM source buffer. |
| 15 | |
| 16 | */ |
| 17 | |
| 18 | #include "emu.h" |
| 19 | #include "machine/315-5838_317-0229_comp.h" |
| 20 | |
| 21 | extern const device_type SEGA315_5838_COMP = &device_creator<sega_315_5838_comp_device>; |
| 22 | |
| 23 | |
| 24 | sega_315_5838_comp_device::sega_315_5838_comp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 25 | : device_t(mconfig, SEGA315_5838_COMP, "Sega 315-5838 / 317-0029 Compression (Encryption?)", tag, owner, clock, "SEGA315_5838", __FILE__) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | |
| 30 | |
| 31 | void sega_315_5838_comp_device::device_start() |
| 32 | { |
| 33 | m_decathlt_lastcount = 0; |
| 34 | m_decathlt_prot_uploadmode = 0; |
| 35 | m_decathlt_prot_uploadoffset = 0; |
| 36 | } |
| 37 | |
| 38 | void sega_315_5838_comp_device::device_reset() |
| 39 | { |
| 40 | memset(m_decathlt_protregs, 0, sizeof(m_decathlt_protregs)); |
| 41 | m_decathlt_lastcount = 0; |
| 42 | m_decathlt_prot_uploadmode = 0; |
| 43 | m_decathlt_prot_uploadoffset = 0; |
| 44 | m_decathlt_part = 1; |
| 45 | |
| 46 | m_protstate = 0; |
| 47 | } |
| 48 | |
| 49 | |
| 50 | /************************** |
| 51 | * |
| 52 | * Decathlete |
| 53 | * |
| 54 | **************************/ |
| 55 | |
| 56 | READ32_MEMBER( sega_315_5838_comp_device::decathlt_prot_r ) |
| 57 | { |
| 58 | // the offsets written to the protection device definitely only refer to 2 of the roms |
| 59 | // it's a fair assumption to say that only those 2 are connected to the protection device |
| 60 | UINT8 *ROM = (UINT8 *)memregion(":abus")->base()+0x1000000; |
| 61 | UINT32 *fake0 = (UINT32*)memregion( ":fake0" )->base(); |
| 62 | |
| 63 | if (offset==2) |
| 64 | { |
| 65 | UINT32 retvalue = 0xffff; |
| 66 | |
| 67 | switch (m_decathlt_protregs[0]) |
| 68 | { |
| 69 | default: |
| 70 | retvalue = ROM[(m_decathlt_protregs[0]*2)-2]; |
| 71 | retvalue <<= 8; |
| 72 | retvalue |= ROM[((m_decathlt_protregs[0]+1)*2)+1-2]; |
| 73 | retvalue <<= 8; |
| 74 | retvalue |= ROM[((m_decathlt_protregs[0]+1)*2)-2]; |
| 75 | retvalue <<= 8; |
| 76 | retvalue |= ROM[((m_decathlt_protregs[0]+2)*2)+1-2]; |
| 77 | m_decathlt_lastcount++; |
| 78 | logerror("read addr %08x, blah_r %08x - read count count %08x\n", m_decathlt_protregs[0], retvalue, m_decathlt_lastcount*4); |
| 79 | m_decathlt_protregs[0]+=2; |
| 80 | return retvalue; |
| 81 | |
| 82 | case 0x03228e4: |
| 83 | if (fake0) retvalue = fake0[(((0x20080/4)+m_decathlt_lastcount))]; |
| 84 | m_decathlt_lastcount++; |
| 85 | return retvalue; |
| 86 | |
| 87 | case 0x00a9f3a: |
| 88 | if (fake0) retvalue = fake0[(((0x00000/4)+m_decathlt_lastcount))]; |
| 89 | m_decathlt_lastcount++; |
| 90 | return retvalue; |
| 91 | |
| 92 | case 0x0213ab4: |
| 93 | if (fake0) retvalue = fake0[(((0x40000/4)+m_decathlt_lastcount))]; |
| 94 | m_decathlt_lastcount++; |
| 95 | return retvalue; |
| 96 | |
| 97 | case 0x01efaf0: |
| 98 | if (fake0) retvalue = fake0[(((0x60000/4)+m_decathlt_lastcount))]; |
| 99 | m_decathlt_lastcount++; |
| 100 | return retvalue; |
| 101 | |
| 102 | case 0x033f16c: |
| 103 | case 0x038929c: |
| 104 | |
| 105 | |
| 106 | |
| 107 | case 0x00de05a: |
| 108 | case 0x0334258: |
| 109 | case 0x019fb82: |
| 110 | case 0x033dbf6: |
| 111 | case 0x0011ac6: |
| 112 | case 0x00060dc: |
| 113 | case 0x0000002: |
| 114 | case 0x0008c90: |
| 115 | case 0x035cdc8: |
| 116 | case 0x0327960: |
| 117 | case 0x0329b8c: |
| 118 | case 0x00d6e92: |
| 119 | case 0x000081e: |
| 120 | case 0x00035d6: |
| 121 | case 0x00089a6: |
| 122 | case 0x03315f4: |
| 123 | case 0x0023fe0: |
| 124 | case 0x001e290: |
| 125 | case 0x0026e86: |
| 126 | case 0x0012494: |
| 127 | case 0x001b35a: |
| 128 | case 0x0018424: |
| 129 | |
| 130 | return retvalue; |
| 131 | } |
| 132 | |
| 133 | |
| 134 | } |
| 135 | else |
| 136 | { |
| 137 | logerror("%06x Decathlete prot R offset %04x mask %08x regs %08x, %08x, %08x, %08x\n", safe_pc(), offset, mem_mask, m_decathlt_protregs[0], m_decathlt_protregs[1], m_decathlt_protregs[2], m_decathlt_protregs[3]); |
| 138 | } |
| 139 | |
| 140 | return m_decathlt_protregs[offset]; |
| 141 | } |
| 142 | |
| 143 | |
| 144 | void sega_315_5838_comp_device::write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which) |
| 145 | { |
| 146 | |
| 147 | printf("write_prot_data %08x %08x %08x\n", offset, data, mem_mask); |
| 148 | |
| 149 | m_decathlt_protregs[offset] = (data&mem_mask)|(m_decathlt_protregs[offset]&~mem_mask); |
| 150 | // m_decathlt_protregs[0] = 0x0c00000/4; |
| 151 | |
| 152 | if (offset==0) // seems to set a source address |
| 153 | { |
| 154 | m_decathlt_part ^=1; |
| 155 | |
| 156 | //if (m_decathlt_part==0) logerror("%d, last read count was %06x\n",which, m_decathlt_lastcount*4); |
| 157 | m_decathlt_lastcount = 0; |
| 158 | if (m_decathlt_part==1) logerror("%d Decathlete prot W offset %04x data %08x, %08x, >>> regs %08x <<<<, %08x, %08x, %08x\n",which, offset, data, m_decathlt_protregs[0], m_decathlt_protregs[0]*4, m_decathlt_protregs[1], m_decathlt_protregs[2], m_decathlt_protregs[3]); |
| 159 | } |
| 160 | |
| 161 | if (offset==1) // uploads 2 tables... |
| 162 | { |
| 163 | if (mem_mask==0xffff0000) |
| 164 | { |
| 165 | if (data == 0x80000000) |
| 166 | { |
| 167 | // logerror("changed to upload mode 1\n"); |
| 168 | m_decathlt_prot_uploadmode = 1; |
| 169 | m_decathlt_prot_uploadoffset = 0; |
| 170 | } |
| 171 | else if (data == 0x80800000) |
| 172 | { |
| 173 | // logerror("changed to upload mode 2\n"); |
| 174 | m_decathlt_prot_uploadmode = 2; |
| 175 | m_decathlt_prot_uploadoffset = 0; |
| 176 | } |
| 177 | else |
| 178 | { |
| 179 | // logerror("unknown upload mode\n"); |
| 180 | m_decathlt_prot_uploadmode = 2; |
| 181 | m_decathlt_prot_uploadoffset = 0; |
| 182 | } |
| 183 | |
| 184 | // logerror("ARGH! %08x %08x\n",mem_mask,data); |
| 185 | } |
| 186 | else if (mem_mask==0x0000ffff) |
| 187 | { |
| 188 | if (m_decathlt_prot_uploadmode==1) |
| 189 | { |
| 190 | if (m_decathlt_prot_uploadoffset>=24) |
| 191 | { |
| 192 | // logerror("upload mode 1 error, too big\n"); |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | //logerror("uploading table 1 %04x %04x\n",m_decathlt_prot_uploadoffset, data&0xffff); |
| 197 | m_decathlt_prottable1[m_decathlt_prot_uploadoffset]=data&0xffff; |
| 198 | m_decathlt_prot_uploadoffset++; |
| 199 | |
| 200 | printf("table 1 %04x\n", data & 0xffff); |
| 201 | |
| 202 | { |
| 203 | /* 0x18 (24) values in this table, rom data is 0x1800000 long, maybe it has |
| 204 | something to do with that? or 24-address b its? |
| 205 | |
| 206 | uploaded values appear to be 12-bit, some are repeated |
| 207 | */ |
| 208 | |
| 209 | { |
| 210 | FILE* fp; |
| 211 | if (which==1) fp = fopen("table1x","wb"); |
| 212 | else fp = fopen("table1","wb"); |
| 213 | |
| 214 | { |
| 215 | fwrite(&m_decathlt_prottable1,24,2,fp); |
| 216 | } |
| 217 | fclose(fp); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | } |
| 222 | else if (m_decathlt_prot_uploadmode==2) |
| 223 | { |
| 224 | if (m_decathlt_prot_uploadoffset>=128) |
| 225 | { |
| 226 | //logerror("upload mode 2 error, too big\n"); |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | //logerror("uploading table 2 %04x %04x\n",m_decathlt_prot_uploadoffset, data&0xffff); |
| 231 | m_decathlt_prottable2[m_decathlt_prot_uploadoffset]=data&0xffff; |
| 232 | m_decathlt_prot_uploadoffset++; |
| 233 | |
| 234 | printf("dictionary %04x\n", data & 0xffff); |
| 235 | |
| 236 | |
| 237 | { |
| 238 | /* the table uploaded here is a 256 byte table with 256 unique values, remaps something? */ |
| 239 | |
| 240 | { |
| 241 | FILE* fp; |
| 242 | if (which==1) fp = fopen("table2x","wb"); |
| 243 | else fp = fopen("table2","wb"); |
| 244 | |
| 245 | { |
| 246 | fwrite(&m_decathlt_prottable2,128,2,fp); |
| 247 | } |
| 248 | fclose(fp); |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | else |
| 253 | { |
| 254 | // logerror("unknown upload mode!\n"); |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | if (offset>1) |
| 260 | { |
| 261 | // logerror("higher offset write\n"); |
| 262 | } |
| 263 | |
| 264 | } |
| 265 | |
| 266 | WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_w ) |
| 267 | { |
| 268 | write_prot_data(data,mem_mask, offset, 0); |
| 269 | |
| 270 | } |
| 271 | |
| 272 | WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot2_w ) |
| 273 | { |
| 274 | write_prot_data(data,mem_mask, offset, 1); |
| 275 | |
| 276 | |
| 277 | } |
| 278 | |
| 279 | void sega_315_5838_comp_device::install_decathlt_protection() |
| 280 | { |
| 281 | /* It uploads 2 tables here, then performs what looks like a number of transfers, setting |
| 282 | a source address of some kind (scrambled?) and then making many reads from a single address */ |
| 283 | |
| 284 | //todo, install these in the driver, they differ between games |
| 285 | cpu_device* cpu = (cpu_device*)machine().device(":maincpu"); |
| 286 | |
| 287 | |
| 288 | cpu->space(AS_PROGRAM).install_readwrite_handler(0x37FFFF0, 0x37FFFFF, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w), this)); |
| 289 | /* It accesses the device at this address too, with different tables, for the game textures, should it just act like a mirror, or a secondary device? */ |
| 290 | cpu->space(AS_PROGRAM).install_readwrite_handler(0x27FFFF0, 0x27FFFFF, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_w), this)); |
| 291 | } |
| 292 | |
| 293 | |
| 294 | READ32_MEMBER(sega_315_5838_comp_device::doa_prot_r) |
| 295 | { |
| 296 | UINT32 retval = 0; |
| 297 | |
| 298 | if (offset == 0x7ff8/4) |
| 299 | { |
| 300 | retval = m_protram[m_protstate+1] | m_protram[m_protstate]<<8; |
| 301 | m_protstate+=2; |
| 302 | printf("doa_prot_read %08x %08x %08x\n", offset*4, retval, mem_mask); |
| 303 | } |
| 304 | else if (offset == 0x400c/4) // todo, is this actually part of the protection? it's in the address range, but decathlete doesn't have it afaik. |
| 305 | { |
| 306 | m_prot_a = !m_prot_a; |
| 307 | if (m_prot_a) |
| 308 | retval = 0xffff; |
| 309 | else |
| 310 | retval = 0xfff0; |
| 311 | } |
| 312 | else |
| 313 | { |
| 314 | printf("doa_prot_read %08x %08x %08x\n", offset*4, retval, mem_mask); |
| 315 | logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, space.device().safe_pc()); |
| 316 | } |
| 317 | |
| 318 | return retval; |
| 319 | } |
| 320 | |
| 321 | |
| 322 | WRITE32_MEMBER(sega_315_5838_comp_device::doa_prot_w) |
| 323 | { |
| 324 | printf("doa_prot_w %08x %08x %08x\n", offset*4, data, mem_mask); |
| 325 | |
| 326 | if (offset == 0x7ff2 / 4) |
| 327 | { |
| 328 | if (data == 0) |
| 329 | { |
| 330 | m_protstate = 0; |
| 331 | strcpy((char *)m_protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00"); // this is the single decompressed string DOA needs |
| 332 | } |
| 333 | } |
| 334 | else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc()); |
| 335 | } |
| 336 | |
| 337 | |
| 338 | void sega_315_5838_comp_device::install_doa_protection() |
| 339 | { |
| 340 | //todo, install these in the driver, they differ between games |
| 341 | cpu_device* cpu = (cpu_device*)machine().device(":maincpu"); |
| 342 | cpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_w), this)); |
| 343 | } |
| | No newline at end of file |