Exemplo n.º 1
0
static void calculate_collisions()
{
	int	X0,Y0;
	int	X1,Y1;
	int	CM,HM;

	Y0 = pmcram[0];
	Y0 = (Y0 << 8) + pmcram[1];
	Y0 = (Y0 - 15) / 5;
	Y1 = (pmcram[2] - 15) / 5;

	if (pmcram[5] < 16)
	{
		// US Thunder Cross uses this form
		X0 = pmcram[5];
		X0 = (X0 << 8) + pmcram[6];
		X0 = (X0 - 16) / 5;
		X1 = (pmcram[7] - 16) / 5;
	}
	else
	{
		// Japan Thunder Cross uses this form
		X0 = (pmcram[5] - 16) / 5;
		X1 = (pmcram[6] - 16) / 5;
	}

	CM = pmcram[3];
	HM = pmcram[4];

	run_collisions(X0,Y0,X1,Y1,CM,HM);
}
Exemplo n.º 2
0
static void calculate_collisions( running_machine *machine )
{
	thunderx_state *state = (thunderx_state *)machine->driver_data;
	int	X0,Y0;
	int	X1,Y1;
	int	CM,HM;

	// the data at 0x00 to 0x06 defines the operation
	//
	// 0x00 : word : last byte of set 0
	// 0x02 : byte : last byte of set 1
	// 0x03 : byte : collide mask
	// 0x04 : byte : hit mask
	// 0x05 : byte : first byte of set 0
	// 0x06 : byte : first byte of set 1
	//
	// the USA version is slightly different:
	//
	// 0x05 : word : first byte of set 0
	// 0x07 : byte : first byte of set 1
	//
	// the operation is to intersect set 0 with set 1
	// collide mask specifies objects to ignore
	// hit mask is 40 to set bit on object 0 and object 1
	// hit mask is 20 to set bit on object 1 only

	Y0 = state->pmcram[0];
	Y0 = (Y0 << 8) + state->pmcram[1];
	Y0 = (Y0 - 15) / 5;
	Y1 = (state->pmcram[2] - 15) / 5;

	if (state->pmcram[5] < 16)
	{
		// US Thunder Cross uses this form
		X0 = state->pmcram[5];
		X0 = (X0 << 8) + state->pmcram[6];
		X0 = (X0 - 16) / 5;
		X1 = (state->pmcram[7] - 16) / 5;
	}
	else
	{
		// Japan Thunder Cross uses this form
		X0 = (state->pmcram[5] - 16) / 5;
		X1 = (state->pmcram[6] - 16) / 5;
	}

	CM = state->pmcram[3];
	HM = state->pmcram[4];

	run_collisions(machine, X0, Y0, X1, Y1, CM, HM);
}