Previous 199869 Revisions Next

r31970 Sunday 7th September, 2014 at 16:26:13 UTC by O. Galibert
checkpoint (nw)
[src/mame/drivers]raiden2.c
[src/mame/includes]raiden2.h

trunk/src/mame/drivers/raiden2.c
r31969r31970
526526
527527void raiden2_state::cop_collision_read_xy(address_space &space, int slot, UINT32 spradr)
528528{
529   cop_collision_info[slot].y = space.read_dword(spradr+4);
530   cop_collision_info[slot].x = space.read_dword(spradr+8);
529   cop_collision_info[slot].x = space.read_dword(spradr+4);
530   cop_collision_info[slot].y = space.read_dword(spradr+8);
531   cop_collision_info[slot].z = space.read_dword(spradr+12);
531532}
532533
533534void raiden2_state::cop_collision_update_hitbox(address_space &space, int slot, UINT32 hitadr)
534535{
535   UINT32 hitadr2 = space.read_dword(hitadr) + (cop_hit_baseadr << 16);
536   UINT32 hitbox_raw = space.read_dword(hitadr2);
536   UINT32 hitadr2 = space.read_word(hitadr) | (cop_hit_baseadr << 16);
537537
538   INT8 hx = hitbox_raw;
539   UINT8 hw = hitbox_raw >> 8;
540   INT8 hy = hitbox_raw >> 16;
541   UINT8 hh = hitbox_raw >> 24;
538   INT8 hx = space.read_byte(hitadr2++);
539   UINT8 hw = space.read_byte(hitadr2++);
540   INT8 hy = space.read_byte(hitadr2++);
541   UINT8 hh = space.read_byte(hitadr2++);
542   INT8 hz = space.read_byte(hitadr2++);
543   UINT8 hd = space.read_byte(hitadr2++);
542544
543545   cop_collision_info[slot].min_x = (cop_collision_info[slot].x >> 16) + hx;
544546   cop_collision_info[slot].min_y = (cop_collision_info[slot].y >> 16) + hy;
547   cop_collision_info[slot].min_z = (cop_collision_info[slot].z >> 16) + hz;
545548   cop_collision_info[slot].max_x = cop_collision_info[slot].min_x + hw;
546549   cop_collision_info[slot].max_y = cop_collision_info[slot].min_y + hh;
550   cop_collision_info[slot].max_z = cop_collision_info[slot].min_z + hd;
547551
548   cop_hit_status = 3;
552   cop_hit_status = 7;
549553
550554   /* outbound X check */
551555   if(cop_collision_info[0].max_x >= cop_collision_info[1].min_x && cop_collision_info[0].min_x <= cop_collision_info[1].max_x)
552      cop_hit_status &= ~2;
556      cop_hit_status &= ~1;
553557
554558   /* outbound Y check */
555559   if(cop_collision_info[0].max_y >= cop_collision_info[1].min_y && cop_collision_info[0].min_y <= cop_collision_info[1].max_y)
556      cop_hit_status &= ~1;
560      cop_hit_status &= ~2;
557561
562   /* outbound Z check */
563   if(cop_collision_info[0].max_z >= cop_collision_info[1].min_z && cop_collision_info[0].min_z <= cop_collision_info[1].max_z)
564      cop_hit_status &= ~4;
565
558566   cop_hit_val_x = (cop_collision_info[0].x - cop_collision_info[1].x) >> 16;
559567   cop_hit_val_y = (cop_collision_info[0].y - cop_collision_info[1].y) >> 16;
560   cop_hit_val_z = 1;
568   cop_hit_val_z = (cop_collision_info[0].z - cop_collision_info[1].z) >> 16;
561569   cop_hit_val_unk = cop_hit_status; // TODO: there's also bit 2 and 3 triggered in the tests, no known meaning
562570}
563571
trunk/src/mame/includes/raiden2.h
r31969r31970
134134   UINT16 sprite_prot_src_addr[2];
135135
136136   struct {
137      int x, y;
138      int min_x, min_y, max_x, max_y;
137      int x, y, z;
138      int min_x, min_y, min_z, max_x, max_y, max_z;
139139   } cop_collision_info[2];
140140
141141   UINT16 cop_hit_status, cop_hit_baseadr;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team