Adjustments for use in the web frontend

This commit is contained in:
2025-02-18 15:10:46 -06:00
parent 8ae8980fc8
commit 4f0b889b74
4 changed files with 62 additions and 8 deletions
+24 -2
View File
@@ -1,5 +1,5 @@
"use strict";
import { Constants } from "./Constants.js";
import Constants from /**/"./Constants.js";
// Instantiation guard
const GUARD = Symbol();
@@ -864,6 +864,28 @@ class VB {
return true;
}
// Decode an ISX debugger file to a Virtual Boy ROM
async fromISX(data) {
// Validation
if (data instanceof ArrayBuffer)
data = new Uint8Array(data);
if (
!(data instanceof Uint8Array) &&
!(data instanceof Uint8ClampedArray)
) data = Uint8Array.from(data);
// Send the memory to the core
data = data.slice();
let response = await this.#toCore({
command : "fromISX",
promised : true,
data : data.buffer,
transfers: [ data.buffer ]
});
return response.data == null ? null : new Uint8Array(response.data);
}
// Suspend automatic emulation
async suspend() {
@@ -932,4 +954,4 @@ class VB {
}
export { VB };
export default VB;