Previous 199869 Revisions Next

r32398 Friday 26th September, 2014 at 10:48:36 UTC by David Haywood
notes / find trigger legacy change (nw)
[src/mame/machine]raiden2cop.c

trunk/src/mame/machine/raiden2cop.c
r32397r32398
352352
353353   for (int i = 0; i < 32; i++)
354354   {
355      if ((triggerval & mask) == (cop_func_trigger[i] & mask))
355      // technically 'command' could equal cop_func_trigger[i] >> 11, but there is that odd entry in zero team where that doesn't appear to be true (search 'TABLENOTE1')
356
357      if ((triggerval & mask) == (cop_func_trigger[i] & mask) && cop_func_trigger[i] != 0) /* cop_func_trigger[i] != 0 is just being used to prevent matching against empty / unused slots */
356358      {
357359#if LOG_CMDS
358360         seibu_cop_log("    Cop Command %04x found in slot %02x with other params %04x %04x\n", triggerval, i, cop_func_value[i], cop_func_mask[i]);
r32397r32398
381383      return -1;
382384   }
383385
384   printf("multiple matches found with mask passed in! (bad!)\n");
386   printf("multiple matches found with mask passed in! (bad!) (%04x %04x)\n", triggerval, mask);
385387   return -1;
386388
387389}
r32397r32398
763765/* Main COP functionality */
764766
765767// notes about tables:
768// (TABLENOTE1)
766769// in all but one case the upload table position (5-bits) is the SAME as the upper 5-bits of the 'trigger value'
767770// the exception to this rule is program 0x18 uploads on zeroteam
768771//  in this case you can see that the 'trigger' value upper bits are 0x0f, this makes it a potentially interesting case (if it gets used)
r32397r32398
19931996WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
19941997{
19951998   int command;
1999   
19962000
1997
19982001   logerror("%06x: COPX execute table macro command %04x | regs %08x %08x %08x %08x %08x\n", space.device().safe_pc(), data,  cop_regs[0], cop_regs[1], cop_regs[2], cop_regs[3], cop_regs[4]);
19992002
20002003
2001   command = find_trigger_match(data, 0xff00);
2004   command = find_trigger_match(data, 0xf800);
20022005
20032006
20042007   if (command == -1)
r32397r32398
22382241   }
22392242
22402243   if (executed == 0)
2241      if (data!=0xf105) printf("did not execute %04x\n", data); // cup soccer triggers this a lot (and others)
2244      printf("did not execute %04x\n", data); // cup soccer triggers this a lot (and others)
22422245}
22432246
22442247

Previous 199869 Revisions Next


© 1997-2024 The MAME Team