trunk/src/mame/machine/seicop.c
r18004 | r18005 | |
1527 | 1527 | |
1528 | 1528 | 0x00 0x00 | 0x0067 0x10 0x2d 0x0000 0x0001 0x0020 0xb5 0x0b50 |
1529 | 1529 | |
| 1530 | *same as 0x3bb0 |
1530 | 1531 | |
1531 | | *same as 0x3bb0 |
| 1532 | command 0x6200 |
| 1533 | raw angle|angle compare|angle mod value| res | |
| 1534 | ---------|-------------|---------------|-----| |
| 1535 | 0x00 **** 0x00 0x00 |
| 1536 | 0x00 0x00 0x20 0x00 |
| 1537 | 0x00 0x20 0x20 0x20 |
| 1538 | 0x00 0x40 0x20 0x20 |
| 1539 | 0x00 0x60 0x20 0x20 |
| 1540 | 0x00 0x80 0x20 0xe0 |
| 1541 | 0x00 0xa0 0x20 0xe0 |
| 1542 | 0x00 0xc0 0x20 0xe0 |
| 1543 | 0x00 0xe0 0x20 0xe0 |
| 1544 | 0x00 0x00 0x40 0x00 |
| 1545 | 0x00 0x20 0x40 0x20 |
| 1546 | 0x00 0x40 0x40 0x40 |
| 1547 | 0x00 0x60 0x40 0x40 |
| 1548 | 0x00 0x80 0x40 0xc0 |
| 1549 | 0x00 0xa0 0x40 0xc0 |
| 1550 | 0x00 0xc0 0x40 0xc0 |
| 1551 | 0x00 0xe0 0x40 0xe0 |
| 1552 | 0x00 0x00 0x60 0x00 |
| 1553 | 0x00 0x20 0x60 0x20 |
| 1554 | 0x00 0x40 0x60 0x60 * |
| 1555 | 0x00 0x60 0x60 0x60 |
| 1556 | 0x00 0x80 0x60 0xa0 |
| 1557 | 0x00 0xa0 0x60 0xa0 |
| 1558 | 0x00 0xc0 0x60 0xc0 |
| 1559 | 0x00 0xe0 0x60 0xe0 |
| 1560 | 0x00 0x00 0x80 0x00 |
| 1561 | 0x00 0x20 0x80 0x80 * |
| 1562 | 0x00 0x40 0x80 0x80 * |
| 1563 | 0x00 0x60 0x80 0x80 * |
| 1564 | 0x00 0x80 0x80 0x80 * |
| 1565 | 0x00 0xa0 0x80 0x80 |
| 1566 | 0x00 0xc0 0x80 0x80 |
| 1567 | 0x00 0xe0 0x80 0x80 |
| 1568 | 0x00 0x00 0xa0 0x00 |
| 1569 | 0x00 0x20 0xa0 0x20 |
| 1570 | 0x00 0x40 0xa0 0xa0 |
| 1571 | 0x00 0x60 0xa0 0xa0 |
| 1572 | 0x00 0x80 0xa0 0x60 |
| 1573 | 0x00 0xa0 0xa0 0x60 |
| 1574 | 0x00 0xc0 0xa0 0x60 |
| 1575 | 0x00 0xe0 0xa0 0xe0 |
| 1576 | 0x00 0x00 0xc0 0x00 |
| 1577 | 0x00 0x20 0xc0 0x20 |
| 1578 | 0x00 0x40 0xc0 0xc0 |
| 1579 | 0x00 0x60 0xc0 **** |
| 1580 | 0x00 0x80 0xc0 0x40 |
| 1581 | 0x00 0xa0 0xc0 **** |
| 1582 | 0x00 0xc0 0xc0 0xc0 |
| 1583 | 0x00 0xe0 0xc0 0xe0 |
| 1584 | 0x00 0x00 0xe0 0x00 |
| 1585 | 0x00 0x20 0xe0 0x20 |
| 1586 | 0x00 0x40 0xe0 0xe0 |
| 1587 | 0x00 0x60 0xe0 0xe0 |
| 1588 | 0x00 0x80 0xe0 0x20 |
| 1589 | 0x00 0xa0 0xe0 0x20 |
| 1590 | 0x00 0xc0 0xe0 0xc0 |
| 1591 | 0x00 0xe0 0xe0 0xe0 |
1532 | 1592 | */ |
1533 | 1593 | |
1534 | 1594 | #include "emu.h" |
r18004 | r18005 | |
1868 | 1928 | static INT16 cop_hit_val_x,cop_hit_val_y,cop_hit_val_z,cop_hit_val_unk; |
1869 | 1929 | static UINT32 cop_sort_lookup,cop_sort_ram_addr,cop_sort_param; |
1870 | 1930 | static INT8 cop_angle_compare; |
1871 | | static UINT8 cop_angle_mod_val; |
| 1931 | static INT8 cop_angle_mod_val; |
1872 | 1932 | static struct |
1873 | 1933 | { |
1874 | 1934 | int x,y; |
r18004 | r18005 | |
2091 | 2151 | break; |
2092 | 2152 | |
2093 | 2153 | /* triggered before 0x6200 in Seibu Cup, looks like an angle value ... */ |
2094 | | case (0x01c/2): cop_angle_compare = cop_mcu_ram[0x1c/2] & 0xff; break; |
2095 | | case (0x01e/2): cop_angle_mod_val = cop_mcu_ram[0x1e/2] & 0xff; break; |
| 2154 | case (0x01c/2): cop_angle_compare = INT8(cop_mcu_ram[0x1c/2]); break; |
| 2155 | case (0x01e/2): cop_angle_mod_val = INT8(cop_mcu_ram[0x1e/2]); break; |
2096 | 2156 | |
2097 | 2157 | case (0x08c/2): cop_sprite_dma_abs_y = (cop_mcu_ram[0x08c/2]); break; |
2098 | 2158 | case (0x08e/2): cop_sprite_dma_abs_x = (cop_mcu_ram[0x08e/2]); break; |
r18004 | r18005 | |
2658 | 2718 | { |
2659 | 2719 | INT8 cur_angle; |
2660 | 2720 | |
2661 | | cur_angle = space.read_byte(cop_register[0] + (0x34 ^ 3)); |
| 2721 | cur_angle = INT8(space.read_byte(cop_register[0] + (0x34 ^ 3))); |
2662 | 2722 | //space.write_byte(cop_register[0] + (0^3),space.read_byte(cop_register[0] + (0^3)) & 0xfb); //correct? |
| 2723 | /* |
| 2724 | 0x00 0x00 0x60 0x00 |
| 2725 | 0x00 0x20 0x60 0x20 |
| 2726 | 0x00 0x40 0x60 0x60 |
| 2727 | 0x00 0x60 0x60 0x60 |
| 2728 | 0x00 0x80 0x60 0xa0 |
| 2729 | 0x00 0xa0 0x60 0xa0 |
| 2730 | 0x00 0xc0 0x60 0xc0 |
| 2731 | 0x00 0xe0 0x60 0xe0 |
| 2732 | */ |
2663 | 2733 | |
2664 | | if(cur_angle >= cop_angle_compare) |
| 2734 | if(cur_angle > cop_angle_compare) |
2665 | 2735 | { |
2666 | 2736 | cur_angle -= cop_angle_mod_val; |
2667 | 2737 | |
2668 | | if(cur_angle <= cop_angle_compare) |
2669 | | { |
| 2738 | if(cur_angle < cop_angle_compare) |
2670 | 2739 | cur_angle = cop_angle_compare; |
2671 | | //space.write_byte(cop_register[0] + (0^3),space.read_byte(cop_register[0] + (0^3)) | 2); |
2672 | | } |
2673 | 2740 | } |
2674 | | else if(cur_angle <= cop_angle_compare) |
| 2741 | else if(cur_angle < cop_angle_compare) |
2675 | 2742 | { |
2676 | 2743 | cur_angle += cop_angle_mod_val; |
2677 | 2744 | |
2678 | | if(cur_angle >= cop_angle_compare) |
2679 | | { |
| 2745 | if(cur_angle > cop_angle_compare) |
2680 | 2746 | cur_angle = cop_angle_compare; |
2681 | | //space.write_byte(cop_register[0] + (0^3),space.read_byte(cop_register[0] + (0^3)) | 2); |
2682 | | } |
2683 | 2747 | } |
2684 | 2748 | |
2685 | 2749 | space.write_byte(cop_register[0] + (0x34 ^ 3),cur_angle); |