Previous 199869 Revisions Next

r32350 Wednesday 24th September, 2014 at 13:08:26 UTC by David Haywood
divide into functions (nw)
[src/mame/machine]raiden2cop.c raiden2cop.h

trunk/src/mame/machine/raiden2cop.c
r32349r32350
754754## - trig (masked) :  (sq0, sq1, sq2, sq3, sq4, sq5, sq6, sq7)  valu  mask
75575500 - 0205 (0205  ) :  (188, 282, 082, b8e, 98e, 000, 000, 000)  6     ffeb   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
75675600 - 0105 (0105  ) :  (180, 2e0, 0a0, 000, 000, 000, 000, 000)  6     fffb   (zeroteamsr)
757*/
758void raiden2cop_device::execute_0205(address_space &space, int offset, UINT16 data)
759{
760   int ppos = space.read_dword(cop_regs[0] + 4 + offset * 4);
761   int npos = ppos + space.read_dword(cop_regs[0] + 0x10 + offset * 4);
762   int delta = (npos >> 16) - (ppos >> 16);
763   space.write_dword(cop_regs[0] + 4 + offset * 4, npos);
764   space.write_word(cop_regs[0] + 0x1e + offset * 4, space.read_word(cop_regs[0] + 0x1e + offset * 4) + delta);
765}
757766
767/*
75876801 - 0905 (0905  ) :  (194, 288, 088, 000, 000, 000, 000, 000)  6     fbfb   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
75976901 - 0b05 (0b05  ) :  (180, 2e0, 0a0, 182, 2e0, 0c0, 000, 000)  6     ffdb   (zeroteamsr)
770*/
760771
772// triggered with 0904 0905
773/* X Se Dae and Zero Team uses this variant */
774void raiden2cop_device::execute_0904(address_space &space, int offset, UINT16 data)
775{
776   space.write_dword(cop_regs[0] + 16 + offset * 4, space.read_dword(cop_regs[0] + 16 + offset * 4) - space.read_dword(cop_regs[0] + 0x28 + offset * 4));
777}
778
779void raiden2cop_device::execute_0905(address_space &space, int offset, UINT16 data)
780{
781   space.write_dword(cop_regs[0] + 16 + offset * 4, space.read_dword(cop_regs[0] + 16 + offset * 4) + space.read_dword(cop_regs[0] + 0x28 + offset * 4));
782}
783
784
785/*
76178602 - 138e (130e  ) :  (984, aa4, d82, aa2, 39b, b9a, b9a, b9a)  5     bf7f   (heatbrl, legionna)
76278702 - 138e (130e  ) :  (984, aa4, d82, aa2, 39b, b9a, b9a, a9a)  5     bf7f   (cupsoc, godzilla, grainbow, denjinmk)
76378802 - 130e (130e  ) :  (984, aa4, d82, aa2, 39b, b9a, b9a, a9a)  5     bf7f   (raiden2, raidendx, zeroteam, xsedae)
789*/
764790
791// triggered with 130e, 138e
792void raiden2cop_device::execute_130e(address_space &space, int offset, UINT16 data)
793{
794   // this can't be right
795   execute_338e(space, offset, data);
796}
797
798/*
76579903 - 1905 (1905  ) :  (994, a88, 088, 000, 000, 000, 000, 000)  6     fbfb   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
800*/
766801
802/*
76780304 - 2288 (2208  ) :  (f8a, b8a, 388, b9c, b9a, a9a, 000, 000)  5     f5df   (heatbrl, legionna)
76880404 - 2288 (2208  ) :  (f8a, b8a, 388, b9a, b9a, a9a, 000, 000)  5     f5df   (cupsoc, godzilla, grainbow, denjinmk)
76980504 - 2208 (2208  ) :  (f8a, b8a, 388, b9a, b9a, a9a, 000, 000)  5     f5df   (raiden2, raidendx, zeroteam, xsedae)
806*/
770807
808// also triggered with 0x2208
809void raiden2cop_device::execute_2288(address_space &space, int offset, UINT16 data)
810{
811   int dx = space.read_word(cop_regs[0] + 0x12);
812   int dy = space.read_word(cop_regs[0] + 0x16);
813
814   if (!dy) {
815      cop_status |= 0x8000;
816      cop_angle = 0;
817   }
818   else {
819      cop_angle = atan(double(dx) / double(dy)) * 128 / M_PI;
820      if (dy < 0)
821         cop_angle += 0x80;
822   }
823
824   if (data & 0x0080) {
825      space.write_byte(cop_regs[0] + 0x34, cop_angle);
826   }
827}
828
829/*
77183005 - 2a05 (2a05  ) :  (9af, a82, 082, a8f, 18e, 000, 000, 000)  6     ebeb   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
831*/
772832
833void raiden2cop_device::execute_2a05(address_space &space, int offset, UINT16 data)
834{
835   int delta = space.read_word(cop_regs[1] + 0x1e + offset * 4);
836   space.write_dword(cop_regs[0] + 4 + 2 + offset * 4, space.read_word(cop_regs[0] + 4 + 2 + offset * 4) + delta);
837   space.write_dword(cop_regs[0] + 0x1e + offset * 4, space.read_word(cop_regs[0] + 0x1e + offset * 4) + delta);
838}
839
840
841/*
77384206 - 338e (330e  ) :  (984, aa4, d82, aa2, 39c, b9c, b9c, a9a)  5     bf7f   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx)
77484306 - 330e (330e  ) :  (984, aa4, d82, aa2, 39c, b9c, b9c, a9a)  5     bf7f   (zeroteam, xsedae)
844*/
845void raiden2cop_device::execute_338e(address_space &space, int offset, UINT16 data)
846{
847   int dx = space.read_dword(cop_regs[1] + 4) - space.read_dword(cop_regs[0] + 4);
848   int dy = space.read_dword(cop_regs[1] + 8) - space.read_dword(cop_regs[0] + 8);
775849
850   if (!dy) {
851      cop_status |= 0x8000;
852      cop_angle = 0;
853   }
854   else {
855      cop_angle = atan(double(dx) / double(dy)) * 128 / M_PI;
856      if (dy < 0)
857         cop_angle += 0x80;
858   }
859
860   if (data & 0x0080) {
861      space.write_byte(cop_regs[0] + 0x34, cop_angle);
862   }
863}
864
865/*
77686607 - 3bb0 (3b30  ) :  (f9c, b9c, b9c, b9c, b9c, b9c, b9c, 99c)  4     007f   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx)
77786707 - 3b30 (3b30  ) :  (f9c, b9c, b9c, b9c, b9c, b9c, b9c, 99c)  4     007f   (zeroteam, xsedae)
868*/
778869
870// triggered with 0x39b0, 0x3b30, 0x3bb0
871
872void raiden2cop_device::execute_3b30(address_space &space, int offset, UINT16 data)
873{
874   /* TODO: these are actually internally loaded via 0x130e command */
875   int dx, dy;
876
877   dx = space.read_dword(cop_regs[1] + 4) - space.read_dword(cop_regs[0] + 4);
878   dy = space.read_dword(cop_regs[1] + 8) - space.read_dword(cop_regs[0] + 8);
879
880   dx = dx >> 16;
881   dy = dy >> 16;
882   cop_dist = sqrt((double)(dx*dx + dy*dy));
883
884   if (data & 0x0080)
885      space.write_word(cop_regs[0] + (data & 0x200 ? 0x3a : 0x38), cop_dist);
886}
887
888
889/*
77989008 - 42c2 (4242  ) :  (f9a, b9a, b9c, b9c, b9c, 29c, 000, 000)  5     fcdd   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
891*/
892void raiden2cop_device::execute_42c2(address_space &space, int offset, UINT16 data)
893{
894   int div = space.read_word(cop_regs[0] + (0x36));
895   if (!div)
896      div = 1;
780897
898   /* TODO: bits 5-6-15 */
899   cop_status = 7;
900
901   space.write_word(cop_regs[0] + (0x38), (cop_dist << (5 - cop_scale)) / div);
902}
903
904
905/*
78190609 - 4aa0 (4a20  ) :  (f9a, b9a, b9c, b9c, b9c, 99b, 000, 000)  5     fcdd   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
907*/
908void raiden2cop_device::execute_4aa0(address_space &space, int offset, UINT16 data)
909{
910   int div = space.read_word(cop_regs[0] + (0x38));
911   if (!div)
912      div = 1;
782913
914   /* TODO: bits 5-6-15 */
915   cop_status = 7;
916
917   space.write_word(cop_regs[0] + (0x36), (cop_dist << (5 - cop_scale)) / div);
918}
919
920/*
7839210a - 5105 (5105  ) :  (a80, 984, 082, 000, 000, 000, 000, 000)  5     fefb   (cupsoc, grainbow)
7849220a - 5205 (5205  ) :  (180, 2e0, 3a0, 0a0, 3a0, 000, 000, 000)  6     fff7   (raiden2, raidendx)
7859230a - 5105 (5105  ) :  (180, 2e0, 0a0, 000, 000, 000, 000, 000)  6     fffb   (zeroteam, xsedae)
786
924*/
925void raiden2cop_device::execute_5205(address_space &space, int offset, UINT16 data)
926{
927   space.write_dword(cop_regs[1], space.read_dword(cop_regs[0]));
928}
929/*
7879300b - 5905 (5905  ) :  (9c8, a84, 0a2, 000, 000, 000, 000, 000)  5     fffb   (cupsoc, grainbow)
7889310b - 5a05 (5a05  ) :  (180, 2e0, 3a0, 0a0, 3a0, 000, 000, 000)  6     fff7   (raiden2, raidendx)
7899320b - 5a85 (5a05  ) :  (180, 2e0, 0a0, 182, 2e0, 0c0, 3c0, 3c0)  6     ffdb   (zeroteam, xsedae)
933*/
934void raiden2cop_device::execute_5a05(address_space &space, int offset, UINT16 data)
935{
936   space.write_dword(cop_regs[1], space.read_dword(cop_regs[0]));
937}
790938
939/*
7919400c - 6200 (6200  ) :  (380, 39a, 380, a80, 29a, 000, 000, 000)  8     f3e7   (heatbrl, legionna, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
7929410c - 6200 (6200  ) :  (3a0, 3a6, 380, aa0, 2a6, 000, 000, 000)  8     f3e7   (cupsoc)
793942
943*/
944void raiden2cop_device::execute_6200(address_space &space, int offset, UINT16 data)
945{
946   UINT8 angle = space.read_byte(cop_regs[0] + 0x34);
947   UINT16 flags = space.read_word(cop_regs[0]);
948   cop_angle_target &= 0xff;
949   cop_angle_step &= 0xff;
950   flags &= ~0x0004;
951   int delta = angle - cop_angle_target;
952   if (delta >= 128)
953      delta -= 256;
954   else if (delta < -128)
955      delta += 256;
956   if (delta < 0) {
957      if (delta >= -cop_angle_step) {
958         angle = cop_angle_target;
959         flags |= 0x0004;
960      }
961      else
962         angle += cop_angle_step;
963   }
964   else {
965      if (delta <= cop_angle_step) {
966         angle = cop_angle_target;
967         flags |= 0x0004;
968      }
969      else
970         angle -= cop_angle_step;
971   }
972   space.write_word(cop_regs[0], flags);
973   space.write_byte(cop_regs[0] + 0x34, angle);
974}
975
976/*
977
7949780d - 6880 (6800  ) :  (b80, ba0, 000, 000, 000, 000, 000, 000)  a     fff3   (heatbrl, legionna, cupsoc, godzilla, denjinmk)
7959790d - 6980 (6900  ) :  (b80, ba0, 000, 000, 000, 000, 000, 000)  a     fff3   (grainbow, zeroteam, xsedae)
796980
r32349r32350
8009840f - 7e05 (7e05  ) :  (180, 282, 080, 180, 282, 000, 000, 000)  6     fffb   (raidendx)
801985*/
802986
987void raiden2cop_device::execute_7e05(address_space &space, int offset, UINT16 data) // raidendx
988{
989   space.write_byte(0x470, space.read_byte(cop_regs[4]));
990}
991
803992/*
80499310 - 8100 (8100  ) :  (b9a, b88, 888, 000, 000, 000, 000, 000)  7     fdfb   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
805994*/
r32349r32350
8451034
8461035// x
8471036
1037*/
1038
1039/*
848104014 - a100 (a100  ) :  (b80, b82, b84, b86, 000, 000, 000, 000)  0     ffff   (heatbrl, zeroteam, xsedae)
849104114 - a180 (a100  ) :  (b80, b82, b84, b86, 000, 000, 000, 000)  0     ffff   (legionna, cupsoc, godzilla, denjinmk)
850104214 - a180 (a100  ) :  (b80, b82, b84, b86, 000, 000, 000, 000)  0     02ff   (grainbow)
851104314 - a100 (a100  ) :  (b80, b82, b84, b86, 000, 000, 000, 000)  0     00ff   (raiden2, raidendx)
852
1044*/
1045void raiden2cop_device::execute_a100(address_space &space, int offset, UINT16 data)
1046{
1047   cop_collision_read_pos(space, 0, cop_regs[0], data & 0x0080);
1048}
1049/*
853105015 - a900 (a900  ) :  (ba0, ba2, ba4, ba6, 000, 000, 000, 000)  f     ffff   (heatbrl, zeroteam, xsedae)
854105115 - a980 (a900  ) :  (ba0, ba2, ba4, ba6, 000, 000, 000, 000)  f     ffff   (legionna, cupsoc, godzilla, denjinmk)
855105215 - a980 (a900  ) :  (ba0, ba2, ba4, ba6, 000, 000, 000, 000)  f     02ff   (grainbow)
856105315 - a900 (a900  ) :  (ba0, ba2, ba4, ba6, 000, 000, 000, 000)  f     00ff   (raiden2, raidendx)
857
1054*/
1055void raiden2cop_device::execute_a900(address_space &space, int offset, UINT16 data)
1056{
1057   cop_collision_read_pos(space, 1, cop_regs[1], data & 0x0080);
1058}
1059/*
858106016 - b080 (b000  ) :  (b40, bc0, bc2, 000, 000, 000, 000, 000)  9     ffff   (heatbrl)
859106116 - b100 (b100  ) :  (b40, bc0, bc2, 000, 000, 000, 000, 000)  9     ffff   (legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
860
1062*/
1063void raiden2cop_device::execute_b100(address_space &space, int offset, UINT16 data)
1064{
1065   cop_collision_update_hitbox(space, 0, cop_regs[2]);
1066}
1067/*
861106817 - b880 (b800  ) :  (b60, be0, be2, 000, 000, 000, 000, 000)  6     ffff   (heatbrl)
862106917 - b900 (b900  ) :  (b60, be0, be2, 000, 000, 000, 000, 000)  6     ffff   (legionna, cupsoc, godzilla, grainbow, denjinmk, raiden2, raidendx, zeroteam, xsedae)
1070*/
1071void raiden2cop_device::execute_b900(address_space &space, int offset, UINT16 data)
1072{
1073   cop_collision_update_hitbox(space, 1, cop_regs[3]);
1074}
8631075
1076/*
864107718 - c480 (c400  ) :  (080, 882, 000, 000, 000, 000, 000, 000)  a     ff00   (heatbrl, legionna, cupsoc, godzilla, grainbow, denjinmk)
865107818 - 7c80 (7c00  ) :  (080, 882, 000, 000, 000, 000, 000, 000)  a     ff00   (zeroteam, xsedae)
8661079
r32349r32350
87910921e - f105 (f105  ) :  (a88, 994, 088, 000, 000, 000, 000, 000)  5     fefb   (cupsoc, grainbow)
88010931e - f205 (f205  ) :  (182, 2e0, 3c0, 0c0, 3c0, 000, 000, 000)  6     fff7   (raiden2, raidendx)
88110941e - f790 (f710  ) :  (f80, b84, b84, b84, b84, b84, b84, b84)  4     00ff   (zeroteam, xsedae)
1095*/
8821096
1097void raiden2cop_device::execute_f205(address_space &space, int offset, UINT16 data)
1098{
1099   space.write_dword(cop_regs[2], space.read_dword(cop_regs[0]+4));
1100}
1101
1102/*
88311031f - fc84 (fc04  ) :  (182, 280, 000, 000, 000, 000, 000, 000)  6     00ff   (zeroteam, xsedae)
884
8851104*/
8861105
8871106READ16_MEMBER( raiden2cop_device::cop_status_r)
r32349r32350
9851204
9861205   switch(data) {
9871206   case 0x0205: {  // 0205 0006 ffeb 0000 - 0188 0282 0082 0b8e 098e 0000 0000 0000
988      int ppos = space.read_dword(cop_regs[0] + 4 + offset*4);
989      int npos = ppos + space.read_dword(cop_regs[0] + 0x10 + offset*4);
990      int delta = (npos >> 16) - (ppos >> 16);
991      space.write_dword(cop_regs[0] + 4 + offset*4, npos);
992      space.write_word(cop_regs[0] + 0x1e + offset*4, space.read_word(cop_regs[0] + 0x1e + offset*4) + delta);
1207      execute_0205(space, offset, data); // angle from dx/dy
9931208      break;
9941209   }
9951210
996   case 0x0904: { /* X Se Dae and Zero Team uses this variant */
997      space.write_dword(cop_regs[0] + 16 + offset*4, space.read_dword(cop_regs[0] + 16 + offset*4) - space.read_dword(cop_regs[0] + 0x28 + offset*4));
1211   case 0x0904: /* X Se Dae and Zero Team uses this variant */
1212      execute_0904(space, offset, data);
9981213      break;
999   }
1214   
10001215   case 0x0905: //  0905 0006 fbfb 0008 - 0194 0288 0088 0000 0000 0000 0000 0000
1001      space.write_dword(cop_regs[0] + 16 + offset*4, space.read_dword(cop_regs[0] + 16 + offset*4) + space.read_dword(cop_regs[0] + 0x28 + offset*4));
1216      execute_0905(space, offset, data);
10021217      break;
10031218
10041219   case 0x130e:   // 130e 0005 bf7f 0010 - 0984 0aa4 0d82 0aa2 039b 0b9a 0b9a 0a9a
10051220   case 0x138e:
1221      execute_130e(space, offset, data); // angle from dx/dy
1222      break;
1223
10061224   case 0x338e: { // 338e 0005 bf7f 0030 - 0984 0aa4 0d82 0aa2 039c 0b9c 0b9c 0a9a
1007      int dx = space.read_dword(cop_regs[1]+4) - space.read_dword(cop_regs[0]+4);
1008      int dy = space.read_dword(cop_regs[1]+8) - space.read_dword(cop_regs[0]+8);
1009
1010      if(!dy) {
1011         cop_status |= 0x8000;
1012         cop_angle = 0;
1013      } else {
1014         cop_angle = atan(double(dx)/double(dy)) * 128 / M_PI;
1015         if(dy<0)
1016            cop_angle += 0x80;
1017      }
1018
1019      if(data & 0x0080) {
1020         space.write_byte(cop_regs[0]+0x34, cop_angle);
1021      }
1225      execute_338e(space, offset, data); // angle from dx/dy
10221226      break;
10231227   }
10241228
10251229   case 0x2208:
10261230   case 0x2288: { // 2208 0005 f5df 0020 - 0f8a 0b8a 0388 0b9a 0b9a 0a9a 0000 0000
1027      int dx = space.read_word(cop_regs[0]+0x12);
1028      int dy = space.read_word(cop_regs[0]+0x16);
1029
1030      if(!dy) {
1031         cop_status |= 0x8000;
1032         cop_angle = 0;
1033      } else {
1034         cop_angle = atan(double(dx)/double(dy)) * 128 / M_PI;
1035         if(dy<0)
1036            cop_angle += 0x80;
1037      }
1038
1039      if(data & 0x0080) {
1040         space.write_byte(cop_regs[0]+0x34, cop_angle);
1041      }
1231      execute_2288(space, offset, data); // angle from dx/dy
10421232      break;
10431233   }
10441234
10451235   case 0x2a05: { // 2a05 0006 ebeb 0028 - 09af 0a82 0082 0a8f 018e 0000 0000 0000
1046      int delta = space.read_word(cop_regs[1] + 0x1e + offset*4);
1047      space.write_dword(cop_regs[0] + 4+2  + offset*4, space.read_word(cop_regs[0] + 4+2  + offset*4) + delta);
1048      space.write_dword(cop_regs[0] + 0x1e + offset*4, space.read_word(cop_regs[0] + 0x1e + offset*4) + delta);
1236      execute_2a05(space, offset, data);
10491237      break;
10501238   }
10511239
10521240   case 0x39b0:
10531241   case 0x3b30:
10541242   case 0x3bb0: { // 3bb0 0004 007f 0038 - 0f9c 0b9c 0b9c 0b9c 0b9c 0b9c 0b9c 099c
1055      /* TODO: these are actually internally loaded via 0x130e command */
1056      int dx,dy;
1243      execute_3b30(space, offset, data);
10571244
1058      dx = space.read_dword(cop_regs[1]+4) - space.read_dword(cop_regs[0]+4);
1059      dy = space.read_dword(cop_regs[1]+8) - space.read_dword(cop_regs[0]+8);
1060     
1061      dx = dx >> 16;
1062      dy = dy >> 16;
1063      cop_dist = sqrt((double)(dx*dx+dy*dy));
1064     
1065      if(data & 0x0080)
1066         space.write_word(cop_regs[0]+(data & 0x200 ? 0x3a : 0x38), cop_dist);
10671245      break;
10681246   }
10691247
10701248   case 0x42c2: { // 42c2 0005 fcdd 0040 - 0f9a 0b9a 0b9c 0b9c 0b9c 029c 0000 0000
1071      int div = space.read_word(cop_regs[0]+(0x36));
1072      if(!div)
1073         div = 1;
1074
1075      /* TODO: bits 5-6-15 */
1076      cop_status = 7;
1077
1078      space.write_word(cop_regs[0]+(0x38), (cop_dist << (5 - cop_scale)) / div);
1249      execute_42c2(space, offset, data); // DIVIDE
10791250      break;
10801251   }
10811252
10821253   case 0x4aa0: { // 4aa0 0005 fcdd 0048 - 0f9a 0b9a 0b9c 0b9c 0b9c 099b 0000 0000
1083      int div = space.read_word(cop_regs[0]+(0x38));
1084      if(!div)
1085         div = 1;
1086
1087      /* TODO: bits 5-6-15 */
1088      cop_status = 7;
1089
1090      space.write_word(cop_regs[0]+(0x36), (cop_dist << (5 - cop_scale)) / div);
1254      execute_4aa0(space, offset, data); // DIVIDE
10911255      break;
10921256   }
10931257
10941258   case 0x6200: {
1095      UINT8 angle = space.read_byte(cop_regs[0]+0x34);
1096      UINT16 flags = space.read_word(cop_regs[0]);
1097      cop_angle_target &= 0xff;
1098      cop_angle_step &= 0xff;
1099      flags &= ~0x0004;
1100      int delta = angle - cop_angle_target;
1101      if(delta >= 128)
1102         delta -= 256;
1103      else if(delta < -128)
1104         delta += 256;
1105      if(delta < 0) {
1106         if(delta >= -cop_angle_step) {
1107            angle = cop_angle_target;
1108            flags |= 0x0004;
1109         } else
1110            angle += cop_angle_step;
1111      } else {
1112         if(delta <= cop_angle_step) {
1113            angle = cop_angle_target;
1114            flags |= 0x0004;
1115         } else
1116            angle -= cop_angle_step;
1117      }
1118      space.write_word(cop_regs[0], flags);
1119      space.write_byte(cop_regs[0]+0x34, angle);
1259      execute_6200(space, offset, data); // Target Angle calcs
11201260      break;
11211261   }
11221262
r32349r32350
11321272
11331273   case 0x5205:   // 5205 0006 fff7 0050 - 0180 02e0 03a0 00a0 03a0 0000 0000 0000
11341274      //      fprintf(stderr, "sprcpt 5205 %04x %04x %04x %08x %08x\n", cop_regs[0], cop_regs[1], cop_regs[3], space.read_dword(cop_regs[0]), space.read_dword(cop_regs[3]));
1135      space.write_dword(cop_regs[1], space.read_dword(cop_regs[0]));
1275      execute_5205(space, offset, data);
11361276      break;
11371277
11381278   case 0x5a05:   // 5a05 0006 fff7 0058 - 0180 02e0 03a0 00a0 03a0 0000 0000 0000
11391279      //      fprintf(stderr, "sprcpt 5a05 %04x %04x %04x %08x %08x\n", cop_regs[0], cop_regs[1], cop_regs[3], space.read_dword(cop_regs[0]), space.read_dword(cop_regs[3]));
1140      space.write_dword(cop_regs[1], space.read_dword(cop_regs[0]));
1280      execute_5a05(space, offset, data);
1281   
11411282      break;
11421283
11431284   case 0xf205:   // f205 0006 fff7 00f0 - 0182 02e0 03c0 00c0 03c0 0000 0000 0000
11441285      //      fprintf(stderr, "sprcpt f205 %04x %04x %04x %08x %08x\n", cop_regs[0]+4, cop_regs[1], cop_regs[3], space.read_dword(cop_regs[0]+4), space.read_dword(cop_regs[3]));
1145      space.write_dword(cop_regs[2], space.read_dword(cop_regs[0]+4));
1286      execute_f205(space, offset, data);
11461287      break;
11471288
11481289      // raidendx only
11491290   case 0x7e05:
1150      space.write_byte(0x470, space.read_byte(cop_regs[4]));
1291      execute_7e05(space, offset, data);
11511292      break;
11521293
11531294   case 0xa100:
11541295   case 0xa180:
1155      cop_collision_read_pos(space, 0, cop_regs[0], data & 0x0080);
1296      execute_a100(space, offset, data); // collisions
11561297      break;
11571298
11581299   case 0xa900:
11591300   case 0xa980:
1160      cop_collision_read_pos(space, 1, cop_regs[1], data & 0x0080);
1301      execute_a900(space, offset, data); // collisions
11611302      break;
11621303
11631304   case 0xb100: {
1164      cop_collision_update_hitbox(space, 0, cop_regs[2]);
1305      execute_b100(space, offset, data); // collisions
11651306      break;
11661307   }
11671308
11681309   case 0xb900: {
1169      cop_collision_update_hitbox(space, 1, cop_regs[3]);
1310      execute_b900(space, offset, data); // collisions
11701311      break;
11711312   }
11721313
trunk/src/mame/machine/raiden2cop.h
r32349r32350
149149   void execute_8100(address_space &space, int offset, UINT16 data);
150150   void execute_8900(address_space &space, int offset, UINT16 data);
151151
152   void execute_42c2(address_space &space, int offset, UINT16 data);
153   void execute_4aa0(address_space &space, int offset, UINT16 data);
154   void execute_6200(address_space &space, int offset, UINT16 data);
155
156   void execute_338e(address_space &space, int offset, UINT16 data);
157   void execute_2288(address_space &space, int offset, UINT16 data);
158   void execute_0205(address_space &space, int offset, UINT16 data);
159   void execute_3b30(address_space &space, int offset, UINT16 data);
160   void execute_130e(address_space &space, int offset, UINT16 data);
161   void execute_0904(address_space &space, int offset, UINT16 data);
162   void execute_0905(address_space &space, int offset, UINT16 data);
163   void execute_2a05(address_space &space, int offset, UINT16 data);
164   void execute_7e05(address_space &space, int offset, UINT16 data);
165   void execute_5205(address_space &space, int offset, UINT16 data);
166   void execute_5a05(address_space &space, int offset, UINT16 data);
167
168   void execute_f205(address_space &space, int offset, UINT16 data);
169   void execute_a100(address_space &space, int offset, UINT16 data);
170   void execute_a900(address_space &space, int offset, UINT16 data);
171   void execute_b100(address_space &space, int offset, UINT16 data);
172   void execute_b900(address_space &space, int offset, UINT16 data);
173
174
152175   // Sort DMA (zeroteam, cupsoc)
153176
154177   UINT32 cop_sort_ram_addr, cop_sort_lookup;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team