diff --git a/kidlisp/examples/meshes/corridor.lisp b/kidlisp/examples/meshes/corridor.lisp index 113738cadb..5263d5bca7 100644 --- a/kidlisp/examples/meshes/corridor.lisp +++ b/kidlisp/examples/meshes/corridor.lisp @@ -15,7 +15,7 @@ (def tt 0) (now tt (/ frame 60)) (def camx 0) (now camx (* (sin (* tt 0.5)) 80)) -(def camz 0) (now camz (+ (* tt 220) 200)) +(def camz 0) (now camz (+ (% (* tt 220) 3400) 200)) ; the walk loops before the corridor ends (def yaw 0) (now yaw (* (sin (* tt 0.7)) 0.25)) (wipe 90 140 210) diff --git a/xbox/tools/kidlisp-bench.mjs b/xbox/tools/kidlisp-bench.mjs index 359e5b5a60..baf5e7940c 100755 --- a/xbox/tools/kidlisp-bench.mjs +++ b/xbox/tools/kidlisp-bench.mjs @@ -29,6 +29,7 @@ const boots = (text) => text.split('AC_NATIVE_BIOS_READY').length - 1; const liveAfterBoot = (text) => { const at = text.lastIndexOf('AC_NATIVE_BIOS_READY'); return at >= 0 && text.indexOf('AC_NATIVE_LIVE_READY', at) >= 0; }; const bootsBefore = boots(run(['xbox/tools/live.mjs', 'logs', '2000'])); run(['xbox/tools/live.mjs', 'publish', 'kidlisp/build/kidlisp-tv.js']); +try { run(['xbox/tools/live.mjs', 'remove', 'live-post.hlsl']); } catch {} try { run(['xbox/tools/live.mjs', 'restart']); } catch { try { run(['xbox/tools/live.mjs', 'launch']); } catch (error) { console.log('restart failed: ' + (error.message || error)); } } let ready = false, generation = 0; for (let attempt = 0; attempt < 90 && !ready; attempt++) { await sleep(1000); const log = run(['xbox/tools/live.mjs', 'logs', '2000']); ready = boots(log) > bootsBefore && liveAfterBoot(log); if (ready) generation = Number((log.slice(log.lastIndexOf('AC_NATIVE_LIVE_READY')).match(/generation=(\d+)/) || [])[1] || 0); } diff --git a/xbox/tools/live.mjs b/xbox/tools/live.mjs index ff3f96be7c..85f8caa1a8 100644 --- a/xbox/tools/live.mjs +++ b/xbox/tools/live.mjs @@ -389,6 +389,12 @@ async function main() { else if (command === "launch") launch(); else if (command === "stop") stop(); else if (command === "restart") { stop(); launch(); } + else if (command === "remove") { + // delete one file from the app's LocalState (a stale live-post.hlsl survives shader-reset across restarts) + if (!argument) throw new Error("usage: xbox-live remove "); + curl(["--fail", "-u", autoAuth, "-X", "DELETE", appFileUrl(installed(), argument)]); + console.log(JSON.stringify({ removed: argument, package: installed().PackageFullName })); + } else if (command === "publish") publish(argument); else if (command === "shader") publishShader(argument); else if (command === "shader-reset") publishShader(null, true); @@ -399,7 +405,7 @@ async function main() { else if (command === "deploy") { publish(argument); launch(); logs("20"); } else if (command === "hot-deploy") await hotDeploy(argument); else if (command === "deploy-kidlisp") await deployKidLisp(argument); - else throw new Error("commands: status | install [deps...] | prune | launch | stop | restart | publish | shader | shader-reset | logs [lines] | frames [output.json] | screenshot [output.png] | video [seconds] [output.mp4] | deploy | hot-deploy | deploy-kidlisp <$code>"); + else throw new Error("commands: status | install [deps...] | prune | launch | stop | restart | remove | publish | shader | shader-reset | logs [lines] | frames [output.json] | screenshot [output.png] | video [seconds] [output.mp4] | deploy | hot-deploy | deploy-kidlisp <$code>"); } try { await main(); } catch (error) { console.error(error.message); process.exit(1); }