// handle protected carts static void install_protection(device_image_interface& image) { neogeo_state *state = image.device().machine().driver_data<neogeo_state>(); const char *crypt_feature = image.get_feature( "crypt" ); if(crypt_feature == NULL) return; if(strcmp(crypt_feature,"fatfury2_prot") == 0) { fatfury2_install_protection(image.device().machine()); logerror("Installed Fatal Fury 2 protection\n"); } if(strcmp(crypt_feature,"kof99_crypt") == 0) { kof99_decrypt_68k(image.device().machine()); state->m_fixed_layer_bank_type = 1; kof99_neogeo_gfx_decrypt(image.device().machine(), 0x00); kof99_install_protection(image.device().machine()); logerror("Decrypted KOF99 code and graphics.\n"); } if(strcmp(crypt_feature,"mslug3_crypt") == 0) { state->m_fixed_layer_bank_type = 1; kof99_neogeo_gfx_decrypt(image.device().machine(), 0xad); logerror("Decrypted Metal Slug 3 graphics\n"); } if(strcmp(crypt_feature,"matrim_crypt") == 0) { matrim_decrypt_68k(image.device().machine()); neo_pcm2_swap(image.device().machine(), 1); state->m_fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x6a); logerror("Decrypted Matrimelee code, sound and graphics\n"); } if(strcmp(crypt_feature,"svc_crypt") == 0) { svc_px_decrypt(image.device().machine()); neo_pcm2_swap(image.device().machine(), 3); state->m_fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x57); install_pvc_protection(image.device().machine()); logerror("Decrypted SvC code, sound and graphics.\n"); } if(strcmp(crypt_feature,"samsho5_crypt") == 0) { samsho5_decrypt_68k(image.device().machine()); neo_pcm2_swap(image.device().machine(), 4); state->m_fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x0f); logerror("Decrypted Samurai Shodown V code, sound and graphics.\n"); } if(strcmp(crypt_feature,"kof2000_crypt") == 0) { kof2000_decrypt_68k(image.device().machine()); state->m_fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x00); kof2000_install_protection(image.device().machine()); logerror("Decrypted KOF2000 code, sound and graphics.\n"); } if(strcmp(crypt_feature,"kof2001_crypt") == 0) { state->m_fixed_layer_bank_type = 1; kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x1e); neogeo_cmc50_m1_decrypt(image.device().machine()); logerror("Decrypted KOF2001 code and graphics.\n"); } if(strcmp(crypt_feature,"kof2002_crypt") == 0) { kof2002_decrypt_68k(image.device().machine()); neo_pcm2_swap(image.device().machine(), 0); neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0xec); logerror("Decrypted KOF2002 code, sound and graphics.\n"); } if(strcmp(crypt_feature,"mslug4_crypt") == 0) { state->m_fixed_layer_bank_type = 1; /* USA violent content screen is wrong -- not a bug, confirmed on real hardware! */ neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x31); neo_pcm2_snk_1999(image.device().machine(), 8); logerror("Decrypted Metal Slug 4 code, sound and graphics.\n"); } if(strcmp(crypt_feature,"mslug5_crypt") == 0) { mslug5_decrypt_68k(image.device().machine()); neo_pcm2_swap(image.device().machine(), 2); state->m_fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x19); install_pvc_protection(image.device().machine()); logerror("Decrypted Metal Slug 5 code and graphics, and installed protection routines.\n"); } if(strcmp(crypt_feature,"kof2003_crypt") == 0) { kof2003h_decrypt_68k(image.device().machine()); neo_pcm2_swap(image.device().machine(), 5); state->m_fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x9d); install_pvc_protection(image.device().machine()); logerror("Decrypted KOF2003 code and graphicss, and installed protection routines.\n"); } if(strcmp(crypt_feature,"samsho5s_crypt") == 0) { samsh5sp_decrypt_68k(image.device().machine()); neo_pcm2_swap(image.device().machine(), 6); state->m_fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(image.device().machine()); kof2000_neogeo_gfx_decrypt(image.device().machine(), 0x0d); } }
static void Neo_Init(long srate) { // if a delta-t region doesn't exist, map both to the same rom if (!rom_getregionsize(RGN_SAMP2)) { // horrible cheese neogeo_ym2610_interface.pcmromb[0] = RGN_SAMP1; } else { neogeo_ym2610_interface.pcmromb[0] = RGN_SAMP2; } // init bank offsets nbnk8 = 0x8000; nbnkc = 0xc000; nbnke = 0xe000; nbnkf = 0xf000; cpu_setbank(4, &prgrom[nbnkf]); cpu_setbank(3, &prgrom[nbnke]); cpu_setbank(2, &prgrom[nbnkc]); cpu_setbank(1, &prgrom[nbnk8]); // super sidekicks4's dump is slightly out of order: the first 2 megs goes // at 0x200000 and the second at 000000. rearrange here. if (Machine->refcon == 7) { char *s1, *s2, *d; s1 = s2 = d = (char *)rom_getregion(RGN_SAMP1); s2 = s1 + 0x200000; d = s1 + 0x600000; memcpy(d, s2, 0x200000); memcpy(s2, s1, 0x200000); memcpy(s1, d, 0x200000); } if (Machine->refcon == 6) // rotd decrypt { } if (Machine->refcon == 8) // kof2002 decrypt { } if (Machine->refcon == 9) // matrimelee decrypt { } if (Machine->refcon == 10) // mslug4 decrypt { } // set up decrypt switch (Machine->refcon) { case 6: // rotd neo_pcm2_snk_1999(16); break; case 8: // kof2002 neo_pcm2_swap(0); break; case 9: // matrimelee neo_pcm2_swap(1); break; case 10: // mslug4 neo_pcm2_snk_1999(8); break; case 11: // mslug5 neo_pcm2_swap(2); break; case 12: // svc neo_pcm2_swap(3); break; case 13: // samsho5 neo_pcm2_swap(4); break; case 14: // kof2003 neo_pcm2_swap(5); break; case 15: // samsh5sp neo_pcm2_swap(6); break; case 16: // pnyaa neo_pcm2_snk_1999(4); break; } // set up command format switch (Machine->refcon) { // most Alpha Denshi games and a few others (the metal slugs) have // no command prefix for music. case 1: break; // most Data East (DECO) games need special treatment case 2: m1snd_addToCmdQueue(0x16); m1snd_addToCmdQueue(0x16); m1snd_addToCmdQueue(0x19); m1snd_addToCmdQueue(0x16); m1snd_addToCmdQueue(0x16); m1snd_setNoPrefixOnStop(); break; // some Alpha Denshi games are different in a different way // (just to be different no doubt) case 3: m1snd_setCmdPrefix(0xfc); break; // WH2Jet and WHPerfect have yet another prefix case 4: m1snd_setCmdPrefix(0xfd); break; // Puzzle Bobble 2 needs a very special init sequence to work properly case 5: m1snd_addToCmdQueue(1); m1snd_addToCmdQueue(3); m1snd_addToCmdQueue(3); m1snd_addToCmdQueue(1); m1snd_addToCmdQueue(3); m1snd_addToCmdQueue(7); m1snd_addToCmdQueue(0x19); m1snd_addToCmdQueue(0x1a); m1snd_addToCmdQueue(0x19); break; // most games use SNK's default sound driver and are happy that way... case 7: // neo bomberman and super sidekicks 4 need some special attention but still use the default case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: default: m1snd_setCmdPrefix(7); break; } }