We were getting it wrong for negative values.
Signed-off-by: Axel Davy <axel.davy@ens.fr>
static void
sm1_parse_dst_param(struct sm1_dst_param *dst, DWORD tok)
{
- uint8_t shift;
+ int8_t shift;
dst->file =
(tok & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT |
(tok & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2;
dst->mask = (tok & NINED3DSP_WRITEMASK_MASK) >> NINED3DSP_WRITEMASK_SHIFT;
dst->mod = (tok & D3DSP_DSTMOD_MASK) >> D3DSP_DSTMOD_SHIFT;
shift = (tok & D3DSP_DSTSHIFT_MASK) >> D3DSP_DSTSHIFT_SHIFT;
- dst->shift = (shift & 0x8) ? -(shift & 0x7) : shift & 0x7;
+ dst->shift = (shift & 0x7) - (shift & 0x8);
}
static void