Adjustments for use in the web frontend
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user