UNPKG

pxt-common-packages

Version:
350 lines (282 loc) 10.2 kB
// total=10109 new=75.23% cached=0.00% other=24.77% (function (ectx) { 'use strict'; const runtime = ectx.runtime; const oops = ectx.oops; const doNothing = ectx.doNothing; const pxsim = ectx.pxsim; const globals = ectx.globals; const maybeYield = ectx.maybeYield; const setupDebugger = ectx.setupDebugger; const isBreakFrame = ectx.isBreakFrame; const breakpoint = ectx.breakpoint; const trace = ectx.trace; const checkStack = ectx.checkStack; const leave = ectx.leave; const checkResumeConsumed = ectx.checkResumeConsumed; const setupResume = ectx.setupResume; const setupLambda = ectx.setupLambda; const checkSubtype = ectx.checkSubtype; const failedCast = ectx.failedCast; const buildResume = ectx.buildResume; const mkVTable = ectx.mkVTable; const bind = ectx.bind; const leaveAccessor = ectx.leaveAccessor; const __this = runtime; const pxtrt = pxsim.pxtrt; let yieldSteps = 1; ectx.setupYield(function() { yieldSteps = 100; }) pxsim.setTitle("screen"); pxsim.setConfigData({}, {}); pxtrt.mapKeyNames = [ "" ]; __this.setupPerfCounters([]); const pxsim_Array__getAt = pxsim.Array_.getAt; const pxsim_Array__length = pxsim.Array_.length; const pxsim_Array__mk = pxsim.Array_.mk; const pxsim_Array__push = pxsim.Array_.push; const pxsim_Boolean__bang = pxsim.Boolean_.bang; const pxsim_String__concat = pxsim.String_.concat; const pxsim_String__stringConv = pxsim.String_.stringConv; const pxsim_numops_toBool = pxsim.numops.toBool; const pxsim_numops_toBoolDecr = pxsim.numops.toBoolDecr; const pxsim_pxtcore_mkAction = pxsim.pxtcore.mkAction; const pxsim_pxtcore_mkClassInstance = pxsim.pxtcore.mkClassInstance; const pxsim_pxtrt_ldlocRef = pxsim.pxtrt.ldlocRef; const pxsim_pxtrt_mapGetByString = pxsim.pxtrt.mapGetByString; const pxsim_pxtrt_stclo = pxsim.pxtrt.stclo; const pxsim_pxtrt_stlocRef = pxsim.pxtrt.stlocRef; const pxsim_Boolean_ = pxsim.Boolean_; const pxsim_pxtcore = pxsim.pxtcore; const pxsim_String_ = pxsim.String_; const pxsim_ImageMethods = pxsim.ImageMethods; const pxsim_Array_ = pxsim.Array_; const pxsim_pxtrt = pxsim.pxtrt; const pxsim_numops = pxsim.numops; function _main___P50800(s) { let r0 = s.r0, step = s.pc; s.pc = -1; while (true) { if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null; switch (step) { case 0: globals._intervals___51043 = (undefined); globals._pollEventQueue___51056 = (undefined); globals.__updated___51290 = (false); r0 = pxsim.control.runInParallel(control___screen_inline__P51295); r0 = pxsim.image.create(178, 128); globals.screen___51318 = (r0); s.tmp_0 = control___screen_setupUpdate__P51292_mk(s); s.tmp_0.arg0 = _screen_internal_inline__P51323; s.callLocIdx = 4; s.pc = 1; return s.tmp_0; case 1: r0 = s.retval; globals.control_EventContext_onStats___51111 = (_screen_internal_inline__P51328); r0 = undefined; return leave(s, r0) default: oops() } } } _main___P50800.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"imagesoverrides.ts","functionName":"<main>","argumentNames":[]} _main___P50800.continuations = [ ] function _main___P50800_mk(s) { checkStack(s.depth); return { parent: s, fn: _main___P50800, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, tmp_0: undefined, } } function control___screen_inline__P51295(s) { let r0 = s.r0, step = s.pc; s.pc = -1; while (true) { if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null; switch (step) { case 0: case 1: r0 = pxsim_numops_toBoolDecr(true); if (!r0) { step = 4; continue; } globals.__updated___51290 = (false); s.tmp_0 = pause__P51120_mk(s); s.tmp_0.arg0 = 200; s.callLocIdx = 2; s.pc = 5; return s.tmp_0; case 5: r0 = s.retval; r0 = pxsim_numops_toBoolDecr(globals.__updated___51290); s.tmp_1 = r0; r0 = pxsim_Boolean__bang(s.tmp_1); s.tmp_0 = r0; r0 = pxsim_numops_toBoolDecr(s.tmp_0); if (!r0) { step = 2; continue; } s.tmp_2 = control___screen_update__P51291_mk(s); s.callLocIdx = 3; s.pc = 6; return s.tmp_2; case 6: r0 = s.retval; globals.__updated___51290 = (true); case 2: case 3: { step = 1; continue; } case 4: r0 = undefined; return leave(s, r0) default: oops() } } } control___screen_inline__P51295.info = {"start":396,"length":211,"line":17,"column":26,"endLine":26,"endColumn":5,"fileName":"frame.ts","functionName":"inline","argumentNames":[]} function control___screen_inline__P51295_mk(s) { checkStack(s.depth); return { parent: s, fn: control___screen_inline__P51295, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, tmp_0: undefined, tmp_1: undefined, tmp_2: undefined, } } function _screen_internal_inline__P51323(s) { let r0 = s.r0, step = s.pc; s.pc = -1; while (true) { if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null; switch (step) { case 0: r0 = pxsim_pxtcore.updateScreen(globals.screen___51318); r0 = undefined; return leave(s, r0) default: oops() } } } _screen_internal_inline__P51323.info = {"start":327,"length":26,"line":8,"column":33,"endLine":8,"endColumn":59,"fileName":"targetoverrides.ts","functionName":"inline","argumentNames":[]} function _screen_internal_inline__P51323_mk(s) { checkStack(s.depth); return { parent: s, fn: _screen_internal_inline__P51323, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, } } function _screen_internal_inline__P51328(s) { let r0 = s.r0, step = s.pc; s.pc = -1; while (true) { if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null; switch (step) { case 0: if (s.lambdaArgs) { s.arg0 = (s.lambdaArgs[0]); s.lambdaArgs = null; } r0 = pxsim_pxtcore.updateStats(s.arg0); r0 = undefined; return leave(s, r0) default: oops() } } } _screen_internal_inline__P51328.info = {"start":390,"length":56,"line":9,"column":35,"endLine":11,"endColumn":5,"fileName":"targetoverrides.ts","functionName":"inline","argumentNames":["msg"]} function _screen_internal_inline__P51328_mk(s) { checkStack(s.depth); return { parent: s, fn: _screen_internal_inline__P51328, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, arg0: undefined, } } function control___screen_setupUpdate__P51292(s) { let r0 = s.r0, step = s.pc; s.pc = -1; while (true) { if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null; switch (step) { case 0: if (s.lambdaArgs) { s.arg0 = (s.lambdaArgs[0]); s.lambdaArgs = null; } globals.__updated___51290 = (true); globals.__update___51288 = (s.arg0); s.tmp_0 = lambda_1_mk(s); s.tmp_0.argL = s.arg0; setupLambda(s.tmp_0, s.tmp_0.argL); s.callLocIdx = 1; s.pc = 1; return s.tmp_0; case 1: r0 = s.retval; r0 = undefined; return leave(s, r0) default: oops() } } } control___screen_setupUpdate__P51292.info = {"start":198,"length":125,"line":10,"column":4,"endLine":14,"endColumn":5,"fileName":"frame.ts","functionName":"setupUpdate","argumentNames":["update"]} function control___screen_setupUpdate__P51292_mk(s) { checkStack(s.depth); return { parent: s, fn: control___screen_setupUpdate__P51292, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, tmp_0: undefined, arg0: undefined, } } function control___screen_update__P51291(s) { let r0 = s.r0, step = s.pc; s.pc = -1; while (true) { if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null; switch (step) { case 0: r0 = pxsim_numops_toBoolDecr(globals.__update___51288); if (!r0) { step = 1; continue; } s.tmp_0 = lambda_1_mk(s); s.tmp_0.argL = globals.__update___51288; setupLambda(s.tmp_0, s.tmp_0.argL); s.callLocIdx = 0; s.pc = 3; return s.tmp_0; case 3: r0 = s.retval; case 1: case 2: globals.__updated___51290 = (true); r0 = undefined; return leave(s, r0) default: oops() } } } control___screen_update__P51291.info = {"start":90,"length":102,"line":4,"column":4,"endLine":8,"endColumn":5,"fileName":"frame.ts","functionName":"update","argumentNames":[]} function control___screen_update__P51291_mk(s) { checkStack(s.depth); return { parent: s, fn: control___screen_update__P51291, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, tmp_0: undefined, } } function pause__P51120(s) { let r0 = s.r0, step = s.pc; s.pc = -1; while (true) { if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null; switch (step) { case 0: if (s.lambdaArgs) { s.arg0 = (s.lambdaArgs[0]); s.lambdaArgs = null; } setupResume(s, 1); pxsim.loops.pause(s.arg0); checkResumeConsumed(); return; case 1: r0 = s.retval; r0 = undefined; return leave(s, r0) default: oops() } } } pause__P51120.info = {"start":246,"length":57,"line":7,"column":0,"endLine":9,"endColumn":1,"fileName":"pxt_modules/base/pause.ts","functionName":"pause","argumentNames":["ms"]} function pause__P51120_mk(s) { checkStack(s.depth); return { parent: s, fn: pause__P51120, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, arg0: undefined, } } function lambda_1_mk(s) { checkStack(s.depth); return { parent: s, fn: null, depth: s.depth + 1, pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null, tmp_0: undefined, tmp_1: undefined, tmp_2: undefined, tmp_3: undefined, tmp_4: undefined, arg0: undefined, } } const breakpoints = setupDebugger(1, ["__updated___51290","screen___51318","__update___51288"]) return _main___P50800 })