Previous 199869 Revisions Next

r18274 Thursday 4th October, 2012 at 02:03:22 UTC by Angelo Salese
Experimental collision detection from Haze, nw
[src/mame/machine]seicop.c

trunk/src/mame/machine/seicop.c
r18273r18274
20442044*/
20452045static void cop_take_hit_box_params(UINT8 offs)
20462046{
2047   INT16 start_x,start_y,end_x,end_y;
2047   INT16 start_x,start_y,height,width;
20482048
2049   /* TODO: hack for SD Gundam */
2050   #if 0
2051   if(cop_collision_info[offs].hitbox_y == 0x2800 && cop_collision_info[offs].hitbox_x == 0xa000)
20522049   {
2053      end_y = 0xff;
2054      start_y = -16;
2055      end_x = 0xff;
2056      start_x = 0;
2057   }
2058   else
2059   #endif
2060   {
2061      end_y = INT8(cop_collision_info[offs].hitbox_y >> 8);
2062      start_y = INT8(cop_collision_info[offs].hitbox_y);
2063      end_x = INT8(cop_collision_info[offs].hitbox_x >> 8);
2064      start_x = INT8(cop_collision_info[offs].hitbox_x);
2065   }
2050      height = UINT8(cop_collision_info[offs].hitbox_y >> 8);
2051       start_y = INT8(cop_collision_info[offs].hitbox_y);
2052      width = UINT8(cop_collision_info[offs].hitbox_x >> 8);
2053       start_x = INT8(cop_collision_info[offs].hitbox_x);
2054    }
20662055
2067   cop_collision_info[offs].min_x = start_x + (cop_collision_info[offs].x >> 16);
2068   cop_collision_info[offs].min_y = start_y + (cop_collision_info[offs].y >> 16);
2069   cop_collision_info[offs].max_x = end_x + (cop_collision_info[offs].x >> 16);
2070   cop_collision_info[offs].max_y = end_y + (cop_collision_info[offs].y >> 16);
2056   cop_collision_info[offs].min_x = (cop_collision_info[offs].x >> 16) + start_x;
2057   cop_collision_info[offs].max_x = cop_collision_info[offs].min_x + width;
2058   cop_collision_info[offs].min_y = (cop_collision_info[offs].y >> 16) + start_y;
2059   cop_collision_info[offs].max_y = cop_collision_info[offs].min_y + height;
20712060}
20722061
20732062
r18273r18274
27552744            /* 0xc [1] */
27562745
27572746            cur_angle = space.read_byte(cop_register[1] + (0xc ^ 3));
2758            space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) & 0xfb); //correct?
2747            //space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) & 0xfb); //correct?
27592748
27602749            if(cur_angle >= cop_angle_compare)
27612750            {
r18273r18274
27632752               if(cur_angle <= cop_angle_compare)
27642753               {
27652754                  cur_angle = cop_angle_compare;
2766                  space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) | 2);
2755                  //space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) | 2);
27672756               }
27682757            }
27692758            else if(cur_angle <= cop_angle_compare)
r18273r18274
27722761               if(cur_angle >= cop_angle_compare)
27732762               {
27742763                  cur_angle = cop_angle_compare;
2775                  space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) | 2);
2764                  //space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) | 2);
27762765               }
27772766            }
27782767

Previous 199869 Revisions Next


© 1997-2024 The MAME Team