Newer
Older
console.image = (url: string, size = 80) => {
const style = `font-size: ${size}px; background-image: url("${url}"); background-size: contain; background-repeat: no-repeat;`;
console.log("%c ", style);
};
const wasm = async (setHook = true) => {
// in case the set hook flag is set, then tries to
// set the panic hook for the WASM module, this call
// may fail in some versions of wasm-bindgen as the
// thread is still marked as "panicking", so we need to
// wrap the call around try/catch
if (setHook) {
try {
GameBoy.set_panic_hook_ws();
} catch (err) {
console.error(err);
}
}