trunk/src/mame/machine/raiden2cop.c
| r32397 | r32398 | |
| 352 | 352 | |
| 353 | 353 | for (int i = 0; i < 32; i++) |
| 354 | 354 | { |
| 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 */ |
| 356 | 358 | { |
| 357 | 359 | #if LOG_CMDS |
| 358 | 360 | 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]); |
| r32397 | r32398 | |
| 381 | 383 | return -1; |
| 382 | 384 | } |
| 383 | 385 | |
| 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); |
| 385 | 387 | return -1; |
| 386 | 388 | |
| 387 | 389 | } |
| r32397 | r32398 | |
| 763 | 765 | /* Main COP functionality */ |
| 764 | 766 | |
| 765 | 767 | // notes about tables: |
| 768 | // (TABLENOTE1) |
| 766 | 769 | // in all but one case the upload table position (5-bits) is the SAME as the upper 5-bits of the 'trigger value' |
| 767 | 770 | // the exception to this rule is program 0x18 uploads on zeroteam |
| 768 | 771 | // 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) |
| r32397 | r32398 | |
| 1993 | 1996 | WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w) |
| 1994 | 1997 | { |
| 1995 | 1998 | int command; |
| 1999 | |
| 1996 | 2000 | |
| 1997 | | |
| 1998 | 2001 | 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]); |
| 1999 | 2002 | |
| 2000 | 2003 | |
| 2001 | | command = find_trigger_match(data, 0xff00); |
| 2004 | command = find_trigger_match(data, 0xf800); |
| 2002 | 2005 | |
| 2003 | 2006 | |
| 2004 | 2007 | if (command == -1) |
| r32397 | r32398 | |
| 2238 | 2241 | } |
| 2239 | 2242 | |
| 2240 | 2243 | 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) |
| 2242 | 2245 | } |
| 2243 | 2246 | |
| 2244 | 2247 | |