rp2040js 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,8 +102,8 @@ class Interpolator {
102
102
  const sclamp0 = bit_1.s32(result0) < bit_1.s32(this.base0) ? this.base0 : (bit_1.s32(result0) > bit_1.s32(this.base1) ? this.base1 : result0);
103
103
  const clamp0 = ctrl0.signed ? sclamp0 : uclamp0;
104
104
  const alpha1 = result1 & 0xff;
105
- const ublend1 = bit_1.u32(this.base0) + (((alpha1 * (bit_1.u32(this.base1) - bit_1.u32(this.base0))) / 256) | 0);
106
- const sblend1 = bit_1.s32(this.base0) + (((alpha1 * (bit_1.s32(this.base1) - bit_1.s32(this.base0))) / 256) | 0);
105
+ const ublend1 = bit_1.u32(this.base0) + (Math.floor((alpha1 * (bit_1.u32(this.base1) - bit_1.u32(this.base0))) / 256) | 0);
106
+ const sblend1 = bit_1.s32(this.base0) + (Math.floor((alpha1 * (bit_1.s32(this.base1) - bit_1.s32(this.base0))) / 256) | 0);
107
107
  const blend1 = ctrl1.signed ? sblend1 : ublend1;
108
108
  this.smresult0 = bit_1.u32(result0);
109
109
  this.smresult1 = bit_1.u32(result1);
@@ -98,8 +98,8 @@ export class Interpolator {
98
98
  const sclamp0 = s32(result0) < s32(this.base0) ? this.base0 : (s32(result0) > s32(this.base1) ? this.base1 : result0);
99
99
  const clamp0 = ctrl0.signed ? sclamp0 : uclamp0;
100
100
  const alpha1 = result1 & 0xff;
101
- const ublend1 = u32(this.base0) + (((alpha1 * (u32(this.base1) - u32(this.base0))) / 256) | 0);
102
- const sblend1 = s32(this.base0) + (((alpha1 * (s32(this.base1) - s32(this.base0))) / 256) | 0);
101
+ const ublend1 = u32(this.base0) + (Math.floor((alpha1 * (u32(this.base1) - u32(this.base0))) / 256) | 0);
102
+ const sblend1 = s32(this.base0) + (Math.floor((alpha1 * (s32(this.base1) - s32(this.base0))) / 256) | 0);
103
103
  const blend1 = ctrl1.signed ? sblend1 : ublend1;
104
104
  this.smresult0 = u32(result0);
105
105
  this.smresult1 = u32(result1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rp2040js",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Raspberry Pi Pico (RP2040) Emulator",
5
5
  "repository": "https://github.com/wokwi/rp2040js",
6
6
  "keywords": [