Example #1
0
void wofch3p_init(void)
{
	UINT8 *mem8 = memory_region_cpu1;
	// patch to 3 players
	mem8[0x7715] = 0x60;
	mem8[0xed928] = 0x01;
	mem8[0xed946] = 0x01;

	wof_decode();
}
Example #2
0
static int Drvq1Init()
{
  int nRet=0; unsigned char *pqs=NULL;
  Cps=1; Cps1Qs=1;
  nCpsRomLen= 2*0x080000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 8*0x080000;
  nCpsZRomLen= 2*0x020000;
  nCpsQSamLen= 4*0x080000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000000,0,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,1,1); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTiles(CpsGfx         , 2);
  CpsLoadTiles(CpsGfx+0x200000, 6);

  nCpsLcReg=0x62; // Layer control register is at 0x62
  CpsLayEn[1]=0x10;
  CpsLayEn[2]=0x08;
  CpsLayEn[3]=0x04;

  // Protection enable code by KEV
  CpsMProt[0]=0x00;
  CpsMProt[1]=0x00;
  CpsMProt[2]=0x00;
  CpsMProt[3]=0x00;

  // Start of Board ID improvments by KEV. 0x00,0x0000
  CpsBID[0]=0x00;
  CpsBID[1]=0x00;
  CpsBID[2]=0x00;
  //end

  MaskAddr[0]=0x64;
  MaskAddr[1]=0x66;
  MaskAddr[2]=0x68;
  MaskAddr[3]=0x6a;

  nRet=BurnLoadRom(CpsZRom,10,1);
  wof_decode();

  pqs=(unsigned char *)CpsQSam;
  nRet=BurnLoadRom(pqs         ,11,1);
  nRet=BurnLoadRom(pqs+0x080000,12,1);
  nRet=BurnLoadRom(pqs+0x100000,13,1);
  nRet=BurnLoadRom(pqs+0x180000,14,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
Example #3
0
void wof3js_init(void)
{
	UINT8 *mem8 = memory_region_cpu1;

	// Patch Q sound protection? check
	mem8[0x0554] = 0xb4;
	mem8[0x0555] = 0x54;
	mem8[0x5a50] = 0x5c;
	mem8[0x5a51] = 0x31;
	mem8[0x5a52] = 0x0c;
	mem8[0x5a53] = 0x00;
	mem8[0x5a54] = 0x5c;
	mem8[0x5a55] = 0x11;
	mem8[0x5a56] = 0x0f;
	mem8[0x5a58] = 0x5c;
	mem8[0x5a59] = 0x11;
	mem8[0x5a5a] = 0x11;
	mem8[0x5a5b] = 0x00;

	wof_decode();
}
Example #4
0
void wofb_init(void)
{
	UINT8 *mem8 = memory_region_cpu1;
	// Fix gfx
	mem8[0x506] = 0xE7;
	mem8[0x507] = 0x48;
	mem8[0x508] = 0xFE;
	mem8[0x509] = 0xFF;
	mem8[0x50A] = 0xF8;
	mem8[0x50B] = 0x4B;
	mem8[0x6ABC] = 0x6;
	mem8[0x6ABD] = 0x1;
	// Fix sound
	mem8[0x764E] = 0x71;
	mem8[0x7650] = 0x71;
	mem8[0x7651] = 0x4E;
	// Fix screen transitions
	mem8[0x5D236] = 0xFC;
	mem8[0x5D237] = 0x28;
	mem8[0x5D238] = 0x0;
	mem8[0x5D23B] = 0x1;

	wof_decode();
}
Example #5
0
void wofsjb_init(void)
{
	UINT8 *mem8 = memory_region_cpu1;
	
	// Fix sprites update
	mem8[0x532] = 0xED;
	mem8[0x533] = 0x33;
	mem8[0x534] = 0xD2;
	mem8[0x535] = 0xE3;
	mem8[0x536] = 0x80;
	mem8[0x537] = 0x00;
	mem8[0x538] = 0x00;
	mem8[0x539] = 0x01;

	// Patch Q sound protection? check
	mem8[0x5a1a] = 0x00;
	mem8[0x5a1b] = 0x67;
	mem8[0x5a1c] = 0x56;
	mem8[0x5a1d] = 0x00;
	mem8[0x5a1e] = 0x7c;
	mem8[0x5a1f] = 0x20;
	mem8[0x5a20] = 0xf1;
	mem8[0x5a21] = 0x00;
	mem8[0x5a22] = 0x00;
	mem8[0x5a23] = 0x80;
	mem8[0x5a24] = 0x28;
	mem8[0x5a25] = 0x4a;
	mem8[0x5a26] = 0x1f;
	mem8[0x5a27] = 0x00;
	mem8[0x5a28] = 0x00;
	mem8[0x5a29] = 0x6a;
	mem8[0x5a40] = 0x5c;
	mem8[0x5a41] = 0x11;
	mem8[0x5a42] = 0x01;
	mem8[0x5a43] = 0x00;
	mem8[0x5a44] = 0x5c;
	mem8[0x5a45] = 0x11;
	mem8[0x5a46] = 0x03;
	mem8[0x5a47] = 0x00;
	mem8[0x5a4a] = 0x07;
	mem8[0x5a4b] = 0x00;
	mem8[0x5a4c] = 0x5c;
	mem8[0x5a4d] = 0x11;
	mem8[0x5a4e] = 0x09;
	mem8[0x5a4f] = 0x00;
	mem8[0x5a50] = 0x5c;
	mem8[0x5a51] = 0x31;
	mem8[0x5a52] = 0x0c;
	mem8[0x5a53] = 0x00;
	mem8[0x5a54] = 0x5c;
	mem8[0x5a55] = 0x11;
	mem8[0x5a56] = 0x0f;
	mem8[0x5a57] = 0x00;
	mem8[0x5a58] = 0x5c;
	mem8[0x5a59] = 0x11;
	mem8[0x72a6] = 0x71;
	mem8[0x72a7] = 0x4e;
	mem8[0x72a8] = 0x71;
	mem8[0x72a9] = 0x4e;
	mem8[0x72aa] = 0x71;
	mem8[0x72ab] = 0x4e;
	mem8[0x72ac] = 0x71;
	mem8[0x72ad] = 0x4e;
	mem8[0x72ae] = 0x71;
	mem8[0x72af] = 0x4e;
	mem8[0x72b0] = 0x71;
	mem8[0x72b1] = 0x4e;
	mem8[0x72b2] = 0x39;
	mem8[0x72b3] = 0x30;
	mem8[0x72b4] = 0xf1;
	mem8[0x72b5] = 0x00;
	mem8[0x72b6] = 0xfe;
	mem8[0x72b7] = 0x9f;
	mem8[0x72b8] = 0x00;
	mem8[0x72b9] = 0x0c;

	wof_decode();
}
Example #6
0
void wofh_init(void)
{
	UINT8 *mem8 = memory_region_cpu1;

	// Stage Order
	mem8[0x072a6] = 0x00;
	// Disable Sprite Recoding
	mem8[0x5d858] = 0x00;
	mem8[0x5d859] = 0x61;
	mem8[0x5d85a] = 0xe6;
	mem8[0x5d85b] = 0x01;
	mem8[0x5d890] = 0x6d;
	mem8[0x5d891] = 0x0c;
	mem8[0x5d892] = 0x00;
	mem8[0x5d893] = 0x90;
	mem8[0x5d894] = 0xd2;
	mem8[0x5d895] = 0xe3;
	mem8[0x5d8e8] = 0x90;
	mem8[0x5d8e9] = 0x00;
	mem8[0x5d8ea] = 0x00;
	mem8[0x5d8eb] = 0x00;
	mem8[0x5d8f8] = 0x90;
	mem8[0x5d8f9] = 0x00;
	mem8[0x5d8fa] = 0x00;
	mem8[0x5d8fb] = 0x40;
	// Patch protection? check
	mem8[0xf11ec] = 0x71;
	mem8[0xf11ed] = 0x4e;
	mem8[0xf11ee] = 0x71;
	mem8[0xf11ef] = 0x4e;
	// Patch Q sound protection? check
	mem8[0x05a0e] = 0x39;
	mem8[0x05a0f] = 0x30;
	mem8[0x05a10] = 0xf1;
	mem8[0x05a12] = 0xfe;
	mem8[0x05a13] = 0x9f;
	mem8[0x05a14] = 0x00;
	mem8[0x05a15] = 0x0c;
	mem8[0x05a16] = 0x77;
	mem8[0x05a17] = 0x00;
	mem8[0x05a18] = 0xf4;
	mem8[0x05a19] = 0x66;
	mem8[0x05a1a] = 0xf9;
	mem8[0x05a1b] = 0x4e;
	mem8[0x05a1c] = 0x00;
	mem8[0x05a1e] = 0xb2;
	mem8[0x05a1f] = 0x72;
	mem8[0x05a20] = 0x7c;
	mem8[0x05a21] = 0x20;
	mem8[0x05a22] = 0xf1;
	mem8[0x05a23] = 0x00;
	mem8[0x05a24] = 0x00;
	mem8[0x05a25] = 0x80;
	mem8[0x05a26] = 0x7c;
	mem8[0x05a27] = 0x11;
	mem8[0x05a29] = 0x00;
	mem8[0x05a2a] = 0x01;
	mem8[0x05a2c] = 0x7c;
	mem8[0x05a2d] = 0x11;
	mem8[0x05a2e] = 0x10;
	mem8[0x05a2f] = 0x00;
	mem8[0x05a30] = 0x0f;
	mem8[0x05a31] = 0x00;
	mem8[0x05a32] = 0x7c;
	mem8[0x05a33] = 0x11;
	mem8[0x05a34] = 0x00;
	mem8[0x05a35] = 0x00;
	mem8[0x05a36] = 0x07;
	mem8[0x05a38] = 0x7c;
	mem8[0x05a39] = 0x11;
	mem8[0x05a3a] = 0x00;
	mem8[0x05a3b] = 0x00;
	mem8[0x05a3c] = 0x09;
	mem8[0x05a3d] = 0x00;
	mem8[0x05a3e] = 0x7c;
	mem8[0x05a3f] = 0x11;
	mem8[0x05a40] = 0x00;
	mem8[0x05a41] = 0x00;
	mem8[0x05a42] = 0x0c;
	mem8[0x05a44] = 0x41;
	mem8[0x05a48] = 0x7c;
	mem8[0x05a4a] = 0x00;
	mem8[0x05a4c] = 0x11;
	mem8[0x05a4d] = 0x00;
	mem8[0x05a4e] = 0x7c;
	mem8[0x05a4f] = 0x11;
	mem8[0x05a50] = 0x00;
	mem8[0x05a51] = 0x00;
	mem8[0x05a52] = 0x17;
	mem8[0x05a54] = 0x7c;
	mem8[0x05a56] = 0x00;
	mem8[0x05a58] = 0x19;
	mem8[0x05a59] = 0x00;
	mem8[0x05a5a] = 0x7c;
	mem8[0x05a5b] = 0x11;
	mem8[0x05a5c] = 0x00;
	mem8[0x05a5d] = 0x00;
	mem8[0x05a5e] = 0x13;
	mem8[0x05a60] = 0x7c;
	mem8[0x05a62] = 0x00;
	mem8[0x05a64] = 0x15;
	mem8[0x05a65] = 0x00;
	mem8[0x05a66] = 0x7c;
	mem8[0x05a67] = 0x11;
	mem8[0x05a68] = 0x00;
	mem8[0x05a69] = 0x00;
	mem8[0x05a6a] = 0x1f;
	mem8[0x05a6c] = 0xf9;
	mem8[0x05a6d] = 0x4e;
	mem8[0x05a6e] = 0x05;
	mem8[0x05a70] = 0x2c;
	mem8[0x05a71] = 0xe8;
	mem8[0x0729a] = 0xf9;
	mem8[0x0729c] = 0x00;
	mem8[0x0729d] = 0x00;
	mem8[0x0729e] = 0x0e;
	mem8[0x0729f] = 0x5a;
	mem8[0x5e826] = 0xf9;
	mem8[0x5e827] = 0x4e;
	mem8[0x5e828] = 0x00;
	mem8[0x5e82a] = 0x20;
	mem8[0x5e82b] = 0x5a;

	wof_decode();
}
Example #7
0
void wof3sj_init(void)
{
	UINT8 *mem8 = memory_region_cpu1;

	// Disable Sprite Recoding
	mem8[0x5de96] = 0x00;
	mem8[0x5de97] = 0x61;
	mem8[0x5de98] = 0xe6;
	mem8[0x5de99] = 0x01;
	mem8[0x5dece] = 0x6d;
	mem8[0x5decf] = 0x0c;
	mem8[0x5ded0] = 0x00;
	mem8[0x5ded1] = 0x90;
	mem8[0x5ded2] = 0xd2;
	mem8[0x5ded3] = 0xe3;
	mem8[0x5df26] = 0x90;
	mem8[0x5df27] = 0x00;
	mem8[0x5df28] = 0x00;
	mem8[0x5df29] = 0x00;
	mem8[0x5df36] = 0x90;
	mem8[0x5df37] = 0x00;
	mem8[0x5df38] = 0x00;
	mem8[0x5df39] = 0x40;
	// Patch Q sound protection? check
	mem8[0x05a0e] = 0x39;
	mem8[0x05a0f] = 0x30;
	mem8[0x05a10] = 0xf1;
	mem8[0x05a12] = 0xfe;
	mem8[0x05a13] = 0x9f;
	mem8[0x05a14] = 0x00;
	mem8[0x05a15] = 0x0c;
	mem8[0x05a16] = 0x77;
	mem8[0x05a17] = 0x00;
	mem8[0x05a18] = 0xf4;
	mem8[0x05a19] = 0x66;
	mem8[0x05a1a] = 0xf9;
	mem8[0x05a1b] = 0x4e;
	mem8[0x05a1c] = 0x00;
	mem8[0x05a1e] = 0xbe;
	mem8[0x05a1f] = 0x72;
	mem8[0x05a20] = 0x7c;
	mem8[0x05a21] = 0x20;
	mem8[0x05a22] = 0xf1;
	mem8[0x05a23] = 0x00;
	mem8[0x05a24] = 0x00;
	mem8[0x05a25] = 0x80;
	mem8[0x05a26] = 0x7c;
	mem8[0x05a27] = 0x11;
	mem8[0x05a29] = 0x00;
	mem8[0x05a2a] = 0x01;
	mem8[0x05a2c] = 0x7c;
	mem8[0x05a2d] = 0x11;
	mem8[0x05a2e] = 0x10;
	mem8[0x05a2f] = 0x00;
	mem8[0x05a30] = 0x0f;
	mem8[0x05a31] = 0x00;
	mem8[0x05a32] = 0x7c;
	mem8[0x05a33] = 0x11;
	mem8[0x05a34] = 0x00;
	mem8[0x05a35] = 0x00;
	mem8[0x05a36] = 0x07;
	mem8[0x05a38] = 0x7c;
	mem8[0x05a39] = 0x11;
	mem8[0x05a3a] = 0x00;
	mem8[0x05a3b] = 0x00;
	mem8[0x05a3c] = 0x09;
	mem8[0x05a3d] = 0x00;
	mem8[0x05a3e] = 0x7c;
	mem8[0x05a3f] = 0x11;
	mem8[0x05a40] = 0x00;
	mem8[0x05a41] = 0x00;
	mem8[0x05a42] = 0x0c;
	mem8[0x05a44] = 0x41;
	mem8[0x05a48] = 0x7c;
	mem8[0x05a4a] = 0x00;
	mem8[0x05a4c] = 0x11;
	mem8[0x05a4d] = 0x00;
	mem8[0x05a4e] = 0x7c;
	mem8[0x05a4f] = 0x11;
	mem8[0x05a50] = 0x00;
	mem8[0x05a51] = 0x00;
	mem8[0x05a52] = 0x17;
	mem8[0x05a54] = 0x7c;
	mem8[0x05a56] = 0x00;
	mem8[0x05a58] = 0x19;
	mem8[0x05a59] = 0x00;
	mem8[0x05a5a] = 0x7c;
	mem8[0x05a5b] = 0x11;
	mem8[0x05a5c] = 0x00;
	mem8[0x05a5d] = 0x00;
	mem8[0x05a5e] = 0x13;
	mem8[0x05a60] = 0x7c;
	mem8[0x05a62] = 0x00;
	mem8[0x05a64] = 0x15;
	mem8[0x05a65] = 0x00;
	mem8[0x05a66] = 0x7c;
	mem8[0x05a67] = 0x11;
	mem8[0x05a68] = 0x00;
	mem8[0x05a69] = 0x00;
	mem8[0x05a6a] = 0x1f;
	mem8[0x05a6c] = 0xf9;
	mem8[0x05a6d] = 0x4e;
	mem8[0x05a6e] = 0x05;
	mem8[0x05a70] = 0x6a;
	mem8[0x05a71] = 0xee;
	mem8[0x072a6] = 0xf9;
	mem8[0x072a8] = 0x00;
	mem8[0x072a9] = 0x00;
	mem8[0x072aa] = 0x0e;
	mem8[0x072ab] = 0x5a;
	mem8[0x5ee64] = 0xf9;
	mem8[0x5ee65] = 0x4e;
	mem8[0x5ee66] = 0x00;
	mem8[0x5ee68] = 0x20;
	mem8[0x5ee69] = 0x5a;

	wof_decode();
}
Example #8
0
int memory_init(void)
{
	int i, res;

	memory_region_cpu1   = NULL;
	memory_region_cpu2   = NULL;
	memory_region_gfx1   = NULL;
	memory_region_sound1 = NULL;
	memory_region_user1  = NULL;
	memory_region_user2  = NULL;

	memory_length_cpu1   = 0;
	memory_length_cpu2   = 0;
	memory_length_gfx1   = 0;
	memory_length_sound1 = 0;
	memory_length_user1  = 0;
	memory_length_user2  = 0;

	pad_wait_clear();
	video_clear_screen();
	msg_screen_init(WP_LOGO, ICON_SYSTEM, TEXT(LOAD_ROM));

	msg_printf(TEXT(CHECKING_ROM_INFO));

	if ((res = load_rom_info(game_name)) != 0)
	{
		switch (res)
		{
		case 1: msg_printf(TEXT(THIS_GAME_NOT_SUPPORTED)); break;
		case 2: msg_printf(TEXT(ROM_NOT_FOUND)); break;
		case 3: msg_printf(TEXT(ROMINFO_NOT_FOUND)); break;
		}
		msg_printf(TEXT(PRESS_ANY_BUTTON2));
		pad_wait_press(PAD_WAIT_INFINITY);
		Loop = LOOP_BROWSER;
		return 0;
	}

	i = 0;
	driver = NULL;
	while (CPS1_driver[i].name)
	{
		if (!strcmp(game_name, CPS1_driver[i].name))
		{
			driver = &CPS1_driver[i];
			break;
		}
		i++;
	}
	if (!driver)
	{
		msg_printf(TEXT(DRIVER_FOR_x_NOT_FOUND), game_name);
		msg_printf(TEXT(PRESS_ANY_BUTTON2));
		pad_wait_press(PAD_WAIT_INFINITY);
		Loop = LOOP_BROWSER;
		return 0;
	}

	if (parent_name[0])
		msg_printf(TEXT(ROMSET_x_PARENT_x), game_name, parent_name);
	else
		msg_printf(TEXT(ROMSET_x), game_name);

	load_gamecfg(game_name);
#ifdef ADHOC
	if (adhoc_enable)
	{
		/* AdHoc通信時は一部オプションで固定の設定を使用 */
		cps_raster_enable    = 1;
		psp_cpuclock         = PSPCLOCK_333;
		option_vsync         = 0;
		option_autoframeskip = 0;
		option_frameskip     = 0;
		option_showfps       = 0;
		option_speedlimit    = 1;
		option_sound_enable  = 1;
		option_samplerate    = 0;
	}
	else
#endif
	{
#ifdef COMMAND_LIST
		if (parent_name[0])
			load_commandlist(game_name, parent_name);
		else
			load_commandlist(game_name, NULL);
#endif
	}

	set_cpu_clock(psp_cpuclock);

	if (load_rom_cpu1() == 0) return 0;
	if (load_rom_cpu2() == 0) return 0;
	if (load_rom_gfx1() == 0) return 0;
	if (load_rom_sound1() == 0) return 0;
	if (load_rom_user1() == 0) return 0;

	static_ram1 = (UINT8 *)cps1_ram - 0xff0000;
	static_ram2 = (UINT8 *)cps1_gfxram - 0x900000;

	qsound_sharedram1 = &memory_region_cpu2[0xc000];
	qsound_sharedram2 = &memory_region_cpu2[0xf000];

	memset(cps1_ram, 0, sizeof(cps1_ram));
	memset(cps1_gfxram, 0, sizeof(cps1_gfxram));
	memset(cps1_output, 0, sizeof(cps1_output));

	if (machine_driver_type == MACHINE_qsound)
	{
		machine_sound_type = SOUND_QSOUND;
		z80_read_memory_8 = cps1_qsound_readmem;
		z80_write_memory_8 = cps1_qsound_writemem;
		memory_length_user2 = 0x8000;

		if ((memory_region_user2 = (UINT8 *)memalign(MEM_ALIGN, 0x8000)) == NULL)
		{
			fatalerror(TEXT(COULD_NOT_ALLOCATE_MEMORY_0x8000BYTE));
			return 0;
		}
		memset(memory_region_user2, 0, 0x8000);
	}
	else if (machine_driver_type == MACHINE_wofhfh)
	{
		machine_sound_type = SOUND_YM2151_CPS1;
		z80_read_memory_8 = cps1_sound_readmem;
		z80_write_memory_8 = cps1_sound_writemem;

		memory_region_user2 = memory_region_cpu2;
	}
	else
	{
		machine_sound_type = SOUND_YM2151_CPS1;
#if !RELEASE
		if (machine_init_type == INIT_kodb)
		{
			z80_read_memory_8 = cps1_kodb_readmem;
			z80_write_memory_8 = cps1_kodb_writemem;
		}
		else
#endif
		{
			z80_read_memory_8 = cps1_sound_readmem;
			z80_write_memory_8 = cps1_sound_writemem;
		}
		memory_region_user2 = memory_region_cpu2;
	}

	switch (machine_init_type)
	{
	case INIT_wof:      wof_decode();      break;
	case INIT_dino:     dino_decode();     break;
	case INIT_punisher: punisher_decode(); break;
	case INIT_slammast: slammast_decode(); break;
	case INIT_pang3:    pang3_decode();    break;
#if !RELEASE
	case INIT_kodb:     kodb_init();       break;
	case INIT_sf2m13:   sf2m13_init();     break;
	case INIT_wofh:     wofh_init();       break;
	case INIT_wof3js:   wof3js_init();     break;
	case INIT_wof3sj:   wof3sj_init();     break;
	case INIT_wofsjb:   wofsjb_init();     break;
	case INIT_dinoh:    dino_decode();     break;
	case INIT_dinob:    dinob_init();      break;
	case INIT_dinohunt: dinohunt_init();   break;
	case INIT_sf2m3:    sf2m3_init();      break;
	case INIT_wofb:     wofb_init();       break;
	case INIT_wofch3p:  wofch3p_init();    break;
#endif
	}

	return 1;
}