pxt-common-packages 10.1.8 → 10.1.11

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.
Files changed (38) hide show
  1. package/built/common-sim.js +2 -2
  2. package/libs/azureiot/built/debug/binary.js +461 -461
  3. package/libs/base/core.cpp +13 -1
  4. package/libs/base/gc.cpp +1 -0
  5. package/libs/color/built/debug/binary.js +8 -8
  6. package/libs/color-sensor/built/debug/binary.js +8 -8
  7. package/libs/controller/built/debug/binary.js +8032 -7916
  8. package/libs/controller---none/built/debug/binary.js +8011 -7895
  9. package/libs/datalogger/built/debug/binary.js +63 -63
  10. package/libs/edge-connector/built/debug/binary.js +8 -8
  11. package/libs/esp32/built/debug/binary.js +462 -462
  12. package/libs/game/built/debug/binary.js +7924 -7808
  13. package/libs/game/camera.ts +3 -4
  14. package/libs/game/physics.ts +30 -0
  15. package/libs/game/sprite.ts +0 -22
  16. package/libs/game---light/compat.ts +10 -0
  17. package/libs/game---light/pxt.json +1 -3
  18. package/libs/lcd/built/debug/binary.js +8 -8
  19. package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
  20. package/libs/lora/built/debug/binary.js +8 -8
  21. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  22. package/libs/mqtt/built/debug/binary.js +176 -176
  23. package/libs/net/built/debug/binary.js +176 -176
  24. package/libs/net-game/built/debug/binary.js +9712 -9596
  25. package/libs/palette/built/debug/binary.js +7923 -7807
  26. package/libs/pixel/built/debug/binary.js +8 -8
  27. package/libs/power/built/debug/binary.js +8 -8
  28. package/libs/proximity/built/debug/binary.js +8 -8
  29. package/libs/radio/built/debug/binary.js +8 -8
  30. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  31. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  32. package/libs/screen/built/debug/binary.js +50 -50
  33. package/libs/screen/sim/image.ts +2 -2
  34. package/libs/screen---st7735/screen.cpp +7 -0
  35. package/libs/servo/built/debug/binary.js +8 -8
  36. package/libs/sprite-scaling/built/debug/binary.js +7923 -7807
  37. package/libs/storyboard/built/debug/binary.js +7923 -7807
  38. package/package.json +1 -1
@@ -1504,7 +1504,19 @@ int getConfig(int key, int defl) {
1504
1504
  return defl;
1505
1505
  int *cfgData = vmImg->configData;
1506
1506
  #else
1507
- int *cfgData = bytecode ? *(int **)&bytecode[18] : NULL;
1507
+ int *cfgData = NULL;
1508
+ if (bytecode) {
1509
+ cfgData = *(int **)&bytecode[18];
1510
+ } else {
1511
+ // This happens when getConfig() is called before the TypeScript
1512
+ // program starts (exec_binary()). One example is overriding heap size with:
1513
+ // namespace userconfig { export const SYSTEM_HEAP_BYTES = 10000 }
1514
+ unsigned *pc = (unsigned *)functionsAndBytecode;
1515
+ if (*pc++ == 0x4210) {
1516
+ uint16_t *bcode = *((uint16_t **)pc++);
1517
+ cfgData = *(int **)&bcode[18];
1518
+ }
1519
+ }
1508
1520
  #endif
1509
1521
 
1510
1522
  if (cfgData) {
package/libs/base/gc.cpp CHANGED
@@ -455,6 +455,7 @@ static GCBlock *allocateBlockCore() {
455
455
  auto lowMem = getConfig(CFG_LOW_MEM_SIMULATION_KB, 0);
456
456
  auto sysHeapSize = getConfig(CFG_SYSTEM_HEAP_BYTES, 4 * 1024);
457
457
  auto heapSize = GC_GET_HEAP_SIZE();
458
+ DMESG("heap: %d (minus %d sys bytes)", heapSize, sysHeapSize);
458
459
  sz = heapSize - sysHeapSize;
459
460
  if (lowMem) {
460
461
  auto memIncrement = 32 * 1024;
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P135987(s) {
59
+ function _main___P136215(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___136230 = (undefined);
70
- globals._pollEventQueue___136243 = (undefined);
69
+ globals._intervals___136458 = (undefined);
70
+ globals._pollEventQueue___136471 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P135987.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"colorbuffer.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P135987.continuations = [ ]
75
+ _main___P136215.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"colorbuffer.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P136215.continuations = [ ]
77
77
 
78
- function _main___P135987_mk(s) {
78
+ function _main___P136215_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P135987, depth: s.depth + 1,
81
+ parent: s, fn: _main___P136215, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P135987_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P135987
91
+ return _main___P136215
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P95076(s) {
59
+ function _main___P95247(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___95319 = (undefined);
70
- globals._pollEventQueue___95332 = (undefined);
69
+ globals._intervals___95490 = (undefined);
70
+ globals._pollEventQueue___95503 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P95076.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tcs34725.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P95076.continuations = [ ]
75
+ _main___P95247.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tcs34725.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P95247.continuations = [ ]
77
77
 
78
- function _main___P95076_mk(s) {
78
+ function _main___P95247_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P95076, depth: s.depth + 1,
81
+ parent: s, fn: _main___P95247, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P95076_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P95076
91
+ return _main___P95247
92
92
  })