trunk/src/mame/machine/raiden2cop.c
| r32404 | r32405 | |
| 1345 | 1345 | |
| 1346 | 1346 | void raiden2cop_device::LEGACY_execute_b100(address_space &space, int offset, UINT16 data) |
| 1347 | 1347 | { |
| 1348 | | LEGACY_cop_collision_update_hitbox(space, 0, cop_regs[2]); |
| 1348 | LEGACY_cop_collision_update_hitbox(space, data, 0, cop_regs[2]); |
| 1349 | 1349 | } |
| 1350 | 1350 | |
| 1351 | 1351 | /* |
| r32404 | r32405 | |
| 1360 | 1360 | |
| 1361 | 1361 | void raiden2cop_device::LEGACY_execute_b900(address_space &space, int offset, UINT16 data) |
| 1362 | 1362 | { |
| 1363 | | LEGACY_cop_collision_update_hitbox(space, 1, cop_regs[3]); |
| 1363 | LEGACY_cop_collision_update_hitbox(space, data, 1, cop_regs[3]); |
| 1364 | 1364 | } |
| 1365 | 1365 | |
| 1366 | 1366 | /* |
| r32404 | r32405 | |
| 1615 | 1615 | 0x588 bits 2 & 3 = 0x580 bits 0 & 1 |
| 1616 | 1616 | */ |
| 1617 | 1617 | |
| 1618 | | void raiden2cop_device::LEGACY_cop_collision_update_hitbox(address_space &space, int slot, UINT32 hitadr) |
| 1618 | void raiden2cop_device::LEGACY_cop_collision_update_hitbox(address_space &space, UINT16 data, int slot, UINT32 hitadr) |
| 1619 | 1619 | { |
| 1620 | 1620 | 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; |
| 1623 | 1622 | |
| 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 | |
| 1624 | 1639 | INT16 dx[3],size[3]; |
| 1625 | 1640 | |
| 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 | } |
| 1626 | 1646 | |
| 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 | | |
| 1634 | 1647 | int j = slot; |
| 1635 | | int i; |
| 1636 | 1648 | |
| 1637 | 1649 | UINT8 res; |
| 1638 | 1650 | |
| 1639 | | res = 7; |
| 1651 | if (num_axis==3) res = 7; |
| 1652 | else res = 3; |
| 1640 | 1653 | |
| 1641 | 1654 | //for (j = 0; j < 2; j++) |
| 1642 | | for (i = 0; i < 3;i++) |
| 1655 | for (i = 0; i < num_axis;i++) |
| 1643 | 1656 | { |
| 1644 | 1657 | if (cop_collision_info[j].allow_swap && (cop_collision_info[j].flags_swap & (1 << i))) |
| 1645 | 1658 | { |