pxt-microbit 4.1.8 → 4.1.9

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.
@@ -1007,6 +1007,8 @@ declare namespace pxsim.ImageMethods {
1007
1007
  function _fillCircle(img: RefImage, cxy: number, r: number, c: number): void;
1008
1008
  function _blitRow(img: RefImage, xy: number, from: RefImage, xh: number): void;
1009
1009
  function blitRow(img: RefImage, x: number, y: number, from: RefImage, fromX: number, fromH: number): void;
1010
+ function _blit(img: RefImage, src: RefImage, args: RefCollection): void;
1011
+ function blit(dst: RefImage, src: RefImage, args: RefCollection): void;
1010
1012
  }
1011
1013
  declare namespace pxsim.image {
1012
1014
  function byteHeight(h: number, bpp: number): number;
@@ -1222,6 +1224,8 @@ declare namespace pxsim._wifi {
1222
1224
  export function connect(ssid: string, pass: string): int32;
1223
1225
  export function disconnect(): int32;
1224
1226
  export function isConnected(): boolean;
1227
+ export function ipInfo(): RefBuffer;
1228
+ export function rssi(): number;
1225
1229
  export function _raiseEvent(id: number): void;
1226
1230
  export {};
1227
1231
  }
@@ -3904,6 +3904,44 @@ var pxsim;
3904
3904
  }
3905
3905
  }
3906
3906
  ImageMethods.blitRow = blitRow;
3907
+ function _blit(img, src, args) {
3908
+ blit(img, src, args);
3909
+ }
3910
+ ImageMethods._blit = _blit;
3911
+ function blit(dst, src, args) {
3912
+ const xDst = args.getAt(0);
3913
+ const yDst = args.getAt(1);
3914
+ const wDst = args.getAt(2);
3915
+ const hDst = args.getAt(3);
3916
+ const xSrc = args.getAt(4);
3917
+ const ySrc = args.getAt(5);
3918
+ const wSrc = args.getAt(6);
3919
+ const hSrc = args.getAt(7);
3920
+ const transparent = args.getAt(8);
3921
+ const xSrcStep = ((wSrc << 16) / wDst) | 0;
3922
+ const ySrcStep = ((hSrc << 16) / hDst) | 0;
3923
+ const xDstClip = Math.abs(Math.min(0, xDst));
3924
+ const yDstClip = Math.abs(Math.min(0, yDst));
3925
+ const xDstStart = xDst + xDstClip;
3926
+ const yDstStart = yDst + yDstClip;
3927
+ const xDstEnd = Math.min(dst._width, xDst + wDst);
3928
+ const yDstEnd = Math.min(dst._height, yDst + hDst);
3929
+ const xSrcStart = Math.max(0, (xSrc << 16) + xDstClip * xSrcStep);
3930
+ const ySrcStart = Math.max(0, (ySrc << 16) + yDstClip * ySrcStep);
3931
+ const xSrcEnd = Math.min(src._width, xSrc + wSrc) << 16;
3932
+ const ySrcEnd = Math.min(src._height, ySrc + hSrc) << 16;
3933
+ for (let yDstCur = yDstStart, ySrcCur = ySrcStart; yDstCur < yDstEnd && ySrcCur < ySrcEnd; ++yDstCur, ySrcCur += ySrcStep) {
3934
+ const ySrcCurI = ySrcCur >> 16;
3935
+ for (let xDstCur = xDstStart, xSrcCur = xSrcStart; xDstCur < xDstEnd && xSrcCur < xSrcEnd; ++xDstCur, xSrcCur += xSrcStep) {
3936
+ const xSrcCurI = xSrcCur >> 16;
3937
+ const cSrc = getPixel(src, xSrcCurI, ySrcCurI);
3938
+ if (!transparent || cSrc) {
3939
+ setPixel(dst, xDstCur, yDstCur, cSrc);
3940
+ }
3941
+ }
3942
+ }
3943
+ }
3944
+ ImageMethods.blit = blit;
3907
3945
  })(ImageMethods = pxsim.ImageMethods || (pxsim.ImageMethods = {}));
3908
3946
  })(pxsim || (pxsim = {}));
3909
3947
  (function (pxsim) {
@@ -4948,6 +4986,10 @@ var pxsim;
4948
4986
  _wifi.disconnect = disconnect;
4949
4987
  function isConnected() { return true; }
4950
4988
  _wifi.isConnected = isConnected;
4989
+ function ipInfo() { return new pxsim.RefBuffer(new Uint8Array(4 * 3)); }
4990
+ _wifi.ipInfo = ipInfo;
4991
+ function rssi() { return -24; }
4992
+ _wifi.rssi = rssi;
4951
4993
  function _raiseEvent(id) {
4952
4994
  pxsim.control.raiseEvent(_wifi.eventID(), id, undefined);
4953
4995
  }