Exemple #1
0
static void c64_software_list_cartridge_load(device_image_interface &image)
{
	legacy_c64_state *state = image.device().machine().driver_data<legacy_c64_state>();

	// initialize ROML and ROMH pointers
	state->m_roml = state->m_c64_roml;
	state->m_romh = state->m_c64_romh;

	// clear ROML and ROMH areas
	memset(state->m_roml, 0, 0x2000);
	memset(state->m_romh, 0, 0x2000);

	// set GAME and EXROM
	state->m_game = atol(image.get_feature("game"));
	state->m_exrom = atol(image.get_feature("exrom"));

	// determine cartridge type
	const char *cart_type = image.get_feature("cart_type");

	if (cart_type == NULL)
	{
		load_standard_c64_cartridge(image);
	}
	else
	{
		if (!strcmp(cart_type, "vizawrite"))
			load_vizawrite_cartridge(image);

		else if (!strcmp(cart_type, "hugo"))
			load_hugo_cartridge(image);

		else if (!strcmp(cart_type, "easy_calc_result"))
			load_easy_calc_result_cartridge(image);

		else if (!strcmp(cart_type, "pagefox"))
			load_pagefox_cartridge(image);

		else if (!strcmp(cart_type, "multiscreen"))
			/*

                TODO: crashes on protection check after cartridge RAM test

                805A: lda  $01
                805C: and  #$FE
                805E: sta  $01
                8060: m6502_brk#$00 <-- BOOM!

            */
			load_multiscreen_cartridge(image);

		else if (!strcmp(cart_type, "simons_basic"))
			load_simons_basic_cartridge(image);

		else if (!strcmp(cart_type, "super_explode"))
			load_super_explode_cartridge(image);

		else
			load_standard_c64_cartridge(image);
	}
}
Exemple #2
0
// 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);
	}
}