Previous 199869 Revisions Next

r32137 Tuesday 16th September, 2014 at 20:03:07 UTC by O. Galibert
fix sprite clipping (nw)
[src/mame/drivers]raiden2.c

trunk/src/mame/drivers/raiden2.c
r32136r32137
12381238   sprite_prot_src_addr[1] = data;
12391239   UINT32 src = (sprite_prot_src_addr[0]<<4)+sprite_prot_src_addr[1];
12401240
1241   int x = ((space.read_dword(src+0x08) >> 16) - (sprite_prot_x)) & 0xffff;
1242   int y = ((space.read_dword(src+0x04) >> 16) - (sprite_prot_y)) & 0xffff;
1241   int x = INT16((space.read_dword(src+0x08) >> 16) - (sprite_prot_x));
1242   int y = INT16((space.read_dword(src+0x04) >> 16) - (sprite_prot_y));
12431243
12441244   UINT16 head1 = space.read_word(src+cop_spr_off);
12451245   UINT16 head2 = space.read_word(src+cop_spr_off+2);
12461246
1247   int w = (((head1 >> 8 ) & 7) + 1) << 3;
1248   int h = (((head1 >> 12) & 7) + 1) << 3;
1247   int w = (((head1 >> 8 ) & 7) + 1) << 4;
1248   int h = (((head1 >> 12) & 7) + 1) << 4;
12491249
1250   UINT16 flag = x-w > -w && x-w < cop_spr_maxx+w && y-h > -h && y-h < 240+h ? 1 : 0;
1251   
1250   UINT16 flag = x-w/2 > -w && x-w/2 < cop_spr_maxx+w && y-h/2 > -h && y-h/2 < 256+h ? 1 : 0;
1251
12521252   flag = (space.read_word(src) & 0xfffe) | flag;
12531253   space.write_word(src, flag);
12541254
r32136r32137
12561256   {
12571257      space.write_word(dst1,   head1);
12581258      space.write_word(dst1+2, head2);
1259      space.write_word(dst1+4, x-w);
1260      space.write_word(dst1+6, y-h);
1259      space.write_word(dst1+4, x-w/2);
1260      space.write_word(dst1+6, y-h/2);
12611261
12621262      dst1 += 8;
12631263   }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team