virtual-machine 0.0.24 → 0.0.26

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.
@@ -206,14 +206,14 @@ if (!("encodeInto" in cachedTextEncoder)) {
206
206
  };
207
207
  }
208
208
  var WASM_VECTOR_LEN = 0;
209
- function wasm_bindgen__convert__closures_____invoke__hfd5f343960464841(arg0, arg1) {
210
- wasm.wasm_bindgen__convert__closures_____invoke__hfd5f343960464841(arg0, arg1);
211
- }
212
209
  function wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919(arg0, arg1, arg2) {
213
210
  wasm.wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919(arg0, arg1, arg2);
214
211
  }
215
- function wasm_bindgen__convert__closures_____invoke__h7c611e26ba1ee3d4(arg0, arg1) {
216
- wasm.wasm_bindgen__convert__closures_____invoke__h7c611e26ba1ee3d4(arg0, arg1);
212
+ function wasm_bindgen__convert__closures_____invoke__h7db8350a65138a75(arg0, arg1) {
213
+ wasm.wasm_bindgen__convert__closures_____invoke__h7db8350a65138a75(arg0, arg1);
214
+ }
215
+ function wasm_bindgen__convert__closures_____invoke__h214e37a833ce8d11(arg0, arg1) {
216
+ wasm.wasm_bindgen__convert__closures_____invoke__h214e37a833ce8d11(arg0, arg1);
217
217
  }
218
218
  var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
219
219
  }, unregister: () => {
@@ -247,6 +247,22 @@ var WasmVm = class {
247
247
  const ret = wasm.wasmvm_get_output(this.__wbg_ptr);
248
248
  return ret === 16777215 ? void 0 : ret;
249
249
  }
250
+ /**
251
+ * Print the VM banner to UART output (visible in browser).
252
+ * Call this after creating the VM to show a boot banner.
253
+ */
254
+ print_banner() {
255
+ wasm.wasmvm_print_banner(this.__wbg_ptr);
256
+ }
257
+ /**
258
+ * Print a status message to UART output (visible in browser).
259
+ * @param {string} message
260
+ */
261
+ print_status(message) {
262
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
263
+ const len0 = WASM_VECTOR_LEN;
264
+ wasm.wasmvm_print_status(this.__wbg_ptr, ptr0, len0);
265
+ }
250
266
  /**
251
267
  * Get the current network connection status.
252
268
  * This checks the actual connection state by seeing if an IP was assigned.
@@ -270,6 +286,15 @@ var WasmVm = class {
270
286
  disconnect_network() {
271
287
  wasm.wasmvm_disconnect_network(this.__wbg_ptr);
272
288
  }
289
+ /**
290
+ * Check how many bytes are pending in the UART output buffer.
291
+ * Useful for debugging output issues.
292
+ * @returns {number}
293
+ */
294
+ uart_output_pending() {
295
+ const ret = wasm.wasmvm_uart_output_pending(this.__wbg_ptr);
296
+ return ret >>> 0;
297
+ }
273
298
  /**
274
299
  * Connect to a WebTransport relay server.
275
300
  * Note: Connection is asynchronous. Check network_status() to monitor connection state.
@@ -317,6 +342,18 @@ var WasmVm = class {
317
342
  input(byte) {
318
343
  wasm.wasmvm_input(this.__wbg_ptr, byte);
319
344
  }
345
+ /**
346
+ * Execute up to N instructions in a batch.
347
+ * Returns the number of instructions actually executed.
348
+ * This is more efficient than calling step() N times due to reduced
349
+ * JS-WASM boundary crossings.
350
+ * @param {number} count
351
+ * @returns {number}
352
+ */
353
+ step_n(count) {
354
+ const ret = wasm.wasmvm_step_n(this.__wbg_ptr, count);
355
+ return ret >>> 0;
356
+ }
320
357
  /**
321
358
  * Get the halt code if the VM has halted.
322
359
  * Code 0x5555 typically means successful shutdown (PASS).
@@ -570,6 +607,9 @@ function __wbg_get_imports() {
570
607
  const ret = arg0.then(arg1);
571
608
  return ret;
572
609
  };
610
+ imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
611
+ console.warn(arg0);
612
+ };
573
613
  imports.wbg.__wbg_writable_523e68bd72433329 = function(arg0) {
574
614
  const ret = arg0.writable;
575
615
  return ret;
@@ -582,16 +622,16 @@ function __wbg_get_imports() {
582
622
  const ret = getStringFromWasm0(arg0, arg1);
583
623
  return ret;
584
624
  };
585
- imports.wbg.__wbindgen_cast_22b48c66901f03d5 = function(arg0, arg1) {
586
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hb099e2ae98169675, wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919);
625
+ imports.wbg.__wbindgen_cast_500637ae475f666c = function(arg0, arg1) {
626
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h31964876cb87df28, wasm_bindgen__convert__closures_____invoke__h214e37a833ce8d11);
587
627
  return ret;
588
628
  };
589
- imports.wbg.__wbindgen_cast_3dba8e634cba348f = function(arg0, arg1) {
590
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1c3a9ff1d3f255ed, wasm_bindgen__convert__closures_____invoke__h7c611e26ba1ee3d4);
629
+ imports.wbg.__wbindgen_cast_9d58885f229d7092 = function(arg0, arg1) {
630
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hb099e2ae98169675, wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919);
591
631
  return ret;
592
632
  };
593
- imports.wbg.__wbindgen_cast_8184f83d0f362634 = function(arg0, arg1) {
594
- const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1c3a9ff1d3f255ed, wasm_bindgen__convert__closures_____invoke__hfd5f343960464841);
633
+ imports.wbg.__wbindgen_cast_ad5da81fd3956308 = function(arg0, arg1) {
634
+ const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h31964876cb87df28, wasm_bindgen__convert__closures_____invoke__h7db8350a65138a75);
595
635
  return ret;
596
636
  };
597
637
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {