diff options
author | 2018-05-09 16:34:20 +1000 | |
---|---|---|
committer | 2018-05-09 16:34:20 +1000 | |
commit | 896db0c0db2f72b3171b809fd0bb33451c0f743f (patch) | |
tree | 114a3183a1af40e1bffdddc538378df0ed9683f3 /src/devices/cpu/dsp16 | |
parent | cc65ce9e94c5a1bf47af1d2633317e4bac990655 (diff) |
dsp16: better rnd on negative (nw)
Diffstat (limited to 'src/devices/cpu/dsp16')
-rw-r--r-- | src/devices/cpu/dsp16/dsp16core.ipp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/cpu/dsp16/dsp16core.ipp b/src/devices/cpu/dsp16/dsp16core.ipp index 43920e8aec4..40a605a8762 100644 --- a/src/devices/cpu/dsp16/dsp16core.ipp +++ b/src/devices/cpu/dsp16/dsp16core.ipp @@ -146,7 +146,7 @@ inline void dsp16_device_base::core_state::dau_f2(u16 op) // p 3-13: "Round upper 20 bits of accumulator." // p 3-14: "The contents of the source accumulator, aS, are rounded to 16 bits, and the sign-extended result is placed in aD[35 - 16] with zeroes in aD[15 - 0]." // It presumably rounds to nearest, but does it yield a 16-bit or 20-bit result, and what does it do about overflow? - d = (s + ((0 > s) ? -(s16(1) << 15) : (s16(1) << 15))) & ~((u64(1) << 16) - 1); + d = (s + ((s32(1) << 15) - ((0 > s) ? 1 : 0))) & ~((u64(1) << 16) - 1); break; case 0xc: // aD = y d = dau_y; |