trunk/src/mame/machine/seicop.c
| r17979 | r17980 | |
| 2463 | 2463 | */ |
| 2464 | 2464 | if(COP_CMD(0xf9a,0xb9a,0xb9c,0xb9c,0xb9c,0x29c,0x000,0x000,5,0xfcdd)) |
| 2465 | 2465 | { |
| 2466 | int dy = r0; |
| 2467 | int dx = r1; |
| 2466 | 2468 | int div = space.read_word(cop_register[0]+(0x36^2)); |
| 2467 | 2469 | int res; |
| 2470 | int cop_dist_raw; |
| 2468 | 2471 | |
| 2469 | 2472 | if(!div) |
| 2470 | 2473 | { |
| r17979 | r17980 | |
| 2472 | 2475 | div = 1; |
| 2473 | 2476 | } |
| 2474 | 2477 | |
| 2475 | | /* TODO: not yet accurate (throws some bits away while converting) */ |
| 2476 | | res = cop_dist; |
| 2477 | | res <<= 5 - cop_scale; |
| 2478 | /* TODO: calculation of this one should occur at 0x3b30/0x3bb0 I *think* */ |
| 2479 | /* TODO: recheck if cop_scale still masks at 3 with this command */ |
| 2480 | dx >>= 11 + cop_scale; |
| 2481 | dy >>= 11 + cop_scale; |
| 2482 | cop_dist_raw = sqrt((double)(dx*dx+dy*dy)); |
| 2483 | |
| 2484 | res = cop_dist_raw; |
| 2478 | 2485 | res /= div; |
| 2479 | 2486 | |
| 2480 | 2487 | cop_dist = (1 << (5 - cop_scale)) / div; |
trunk/src/mame/drivers/raiden2.c
| r17979 | r17980 | |
| 497 | 497 | |
| 498 | 498 | switch(data) { |
| 499 | 499 | case 0x0205: // 0205 0006 ffeb 0000 - 0188 0282 0082 0b8e 098e 0000 0000 0000 |
| 500 | | printf("%08x %08x\n",space.read_dword(cop_regs[0] + 0x1c + offset*4),space.read_dword(cop_regs[0] + 0x10 + offset*4)); |
| 501 | | |
| 502 | 500 | space.write_dword(cop_regs[0] + 4 + offset*4, space.read_dword(cop_regs[0] + 4 + offset*4) + space.read_dword(cop_regs[0] + 0x10 + offset*4)); |
| 503 | 501 | /* TODO: check the following, makes Zero Team to crash as soon as this command is triggered. */ |
| 504 | 502 | space.write_dword(cop_regs[0] + 0x1c + offset*4, space.read_dword(cop_regs[0] + 0x1c + offset*4) + space.read_dword(cop_regs[0] + 0x10 + offset*4)); |