Previous 199869 Revisions Next

r32405 Friday 26th September, 2014 at 15:50:28 UTC by David Haywood
improve legionna collisions (nw)
[src/mame/machine]raiden2cop.c raiden2cop.h

trunk/src/mame/machine/raiden2cop.c
r32404r32405
13451345
13461346void raiden2cop_device::LEGACY_execute_b100(address_space &space, int offset, UINT16 data)
13471347{
1348   LEGACY_cop_collision_update_hitbox(space, 0, cop_regs[2]);
1348   LEGACY_cop_collision_update_hitbox(space, data, 0, cop_regs[2]);
13491349}
13501350
13511351/*
r32404r32405
13601360
13611361void raiden2cop_device::LEGACY_execute_b900(address_space &space, int offset, UINT16 data)
13621362{
1363   LEGACY_cop_collision_update_hitbox(space, 1, cop_regs[3]);
1363   LEGACY_cop_collision_update_hitbox(space, data, 1, cop_regs[3]);
13641364}
13651365
13661366/*
r32404r32405
161516150x588 bits 2 & 3 = 0x580 bits 0 & 1
16161616*/
16171617
1618void  raiden2cop_device::LEGACY_cop_collision_update_hitbox(address_space &space, int slot, UINT32 hitadr)
1618void  raiden2cop_device::LEGACY_cop_collision_update_hitbox(address_space &space, UINT16 data, int slot, UINT32 hitadr)
16191619{
16201620   UINT32 hitadr2 = space.read_word(hitadr) | (cop_hit_baseadr << 16); // DON'T use cop_read_word here, doesn't need endian fixing?!
1621   UINT16 hithoxy = space.read_word(hitadr2);
1622   UINT16 hitboxx = space.read_word(hitadr2 + 2);
1621   int num_axis = 2;
16231622
1623   // guess, heatbrl doesn't have this set and clearly only wants 2 axis to be checked (otherwise it reads bad params into the 3rd)
1624   // everything else has it set, and legionna clearly wants 3 axis for jumping attacks to work
1625   if (data & 0x0100) num_axis = 3;
1626
1627   int i;
1628
1629   for(i=0; i<3; i++) {
1630      cop_collision_info[slot].dx[i] = 0;
1631      cop_collision_info[slot].size[i] = 0;
1632   }
1633
1634   for(i=0; i<num_axis; i++) {
1635      cop_collision_info[slot].dx[i] = space.read_byte(1^ (hitadr2++));
1636      cop_collision_info[slot].size[i] = space.read_byte(1^ (hitadr2++));
1637   }
1638
16241639   INT16 dx[3],size[3];
16251640
1641   for (i = 0; i < num_axis; i++)
1642   {
1643      size[i] = UINT8(cop_collision_info[slot].size[i]);
1644      dx[i] = INT8(cop_collision_info[slot].dx[i]);
1645   }
16261646
1627   size[0] = UINT8(hithoxy >> 8);
1628   dx[0] = INT8(hithoxy);
1629   size[1] = UINT8(hitboxx >> 8);
1630   dx[1] = INT8(hitboxx);
1631   size[2] = 0;
1632   dx[2] = 0;
1633
16341647   int j = slot;
1635   int i;
16361648   
16371649   UINT8 res;
16381650
1639   res = 7;
1651   if (num_axis==3) res = 7;
1652   else res = 3;
16401653
16411654   //for (j = 0; j < 2; j++)
1642   for (i = 0; i < 3;i++)
1655   for (i = 0; i < num_axis;i++)
16431656   {
16441657      if (cop_collision_info[j].allow_swap && (cop_collision_info[j].flags_swap & (1 << i)))
16451658      {
trunk/src/mame/machine/raiden2cop.h
r32404r32405
241241   };
242242
243243   struct LEGACY_collision_info m_LEGACY_cop_collision_info[2];
244   void  LEGACY_cop_collision_update_hitbox(address_space &space, int slot, UINT32 hitadr);
244   void  LEGACY_cop_collision_update_hitbox(address_space &space, UINT16 data, int slot, UINT32 hitadr);
245245
246246   // endian stuff?
247247   int m_cpu_is_68k;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team