Previous 199869 Revisions Next

r17980 Tuesday 18th September, 2012 at 01:20:25 UTC by Angelo Salese
Fixed rounding error on 0x42c2, nw
[src/mame/drivers]raiden2.c
[src/mame/machine]seicop.c

trunk/src/mame/machine/seicop.c
r17979r17980
24632463            */
24642464         if(COP_CMD(0xf9a,0xb9a,0xb9c,0xb9c,0xb9c,0x29c,0x000,0x000,5,0xfcdd))
24652465         {
2466            int dy = r0;
2467            int dx = r1;
24662468            int div = space.read_word(cop_register[0]+(0x36^2));
24672469            int res;
2470            int cop_dist_raw;
24682471
24692472            if(!div)
24702473            {
r17979r17980
24722475               div = 1;
24732476            }
24742477
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;
24782485            res /= div;
24792486
24802487            cop_dist = (1 << (5 - cop_scale)) / div;
trunk/src/mame/drivers/raiden2.c
r17979r17980
497497
498498   switch(data) {
499499   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
502500      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));
503501      /* TODO: check the following, makes Zero Team to crash as soon as this command is triggered. */
504502      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));

Previous 199869 Revisions Next


© 1997-2024 The MAME Team