From 2e4b68cd523f4b28953ce80ec5b1a94d97d5f647 Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Fri, 18 Oct 2024 19:59:56 -0700 Subject: [PATCH] trying to fix AS cart in web host --- cart/as/build.js | 1 + docs/cart/colorbars.null0 | Bin 11027 -> 11027 bytes docs/cart/draw.null0 | Bin 10871 -> 10871 bytes docs/cart/example-as.null0 | Bin 16076 -> 18292 bytes docs/cart/filesystem.null0 | Bin 11908 -> 11988 bytes docs/cart/flappybird.null0 | Bin 1191178 -> 1191178 bytes docs/cart/hello.null0 | Bin 10753 -> 10753 bytes docs/cart/input.null0 | Bin 50744 -> 50744 bytes docs/cart/justlog.null0 | Bin 10733 -> 10733 bytes docs/cart/sound.null0 | Bin 23570 -> 23570 bytes docs/cart/tracker.null0 | Bin 15801 -> 15801 bytes docs/cart/typesizes.null0 | Bin 10841 -> 10841 bytes docs/index.html | 8 +- docs/null0.js | 254 ++++---- docs/null0_wasm.js | 1181 ++++++++++++++++++------------------ docs/null0_wc.js | 13 +- 16 files changed, 731 insertions(+), 726 deletions(-) diff --git a/cart/as/build.js b/cart/as/build.js index 68c8411..c336600 100644 --- a/cart/as/build.js +++ b/cart/as/build.js @@ -18,6 +18,7 @@ await writeFile('build/tmp.ts', (await readFile('null0.ts')) + '\n// user-code:\ const { error, stdout, stderr, stats } = await asc.main([ 'build/tmp.ts', + '--debug', '--runtime', 'minimal', '--config', './node_modules/@assemblyscript/wasi-shim/asconfig.json', '--optimizeLevel', '3', diff --git a/docs/cart/colorbars.null0 b/docs/cart/colorbars.null0 index 1417c39beac587a0d3c38ab4a7a0c010b2ff0e0e..dcc42295024d0f5e90793d146317b863ab9d5808 100644 GIT binary patch delta 49 zcmbOnHaUzpz?+#xgn@y9gJDrq&_rH&_Jp@W=|H^ExLu1GC^UJmmM$}pKl!be8USE0 B599y< delta 49 zcmbOnHaUzpz?+#xgn@y9gTcMddm^tq`_k2%=|H^ExLu1GC^UJmmM$}pKl!be8URdm B4+a1L diff --git a/docs/cart/draw.null0 b/docs/cart/draw.null0 index b2c9d87c4f2f7f06b873a917385cd07f5ed11fc3..1ffc6f5303667781e8dd7897e16cf4b7391fbf29 100644 GIT binary patch delta 49 zcmew!@;!t%z?+#xgn@y9gJDrq&_rH&_Jp@W=|H^E__Zc8P-wEEmM$}pKRHlK4FH2< B57Phu delta 49 zcmew!@;!t%z?+#xgn@y9gTcMddm^tq`_k2%=|H^E__Zc8P-wEEmM$}pKRHlK4FGSa B4)p*4 diff --git a/docs/cart/example-as.null0 b/docs/cart/example-as.null0 index 42f469ccb0ec6241ac22b32b712b1560cbecf500..72f5068d4b53caceed6c868f99042fd9931c9398 100644 GIT binary patch delta 6123 zcmZXYbx_sc)5l3E1tcyYNa>|hLgI4i?vn0q@Y406J470!ySV}q(jkg82p5o$?(Tf> z`+Md)PwdW|-958&&d!{9pFduMey4HB&s5}5(Xf&Jnk9*P!agnV7)T5Tg|Xt>Eo9rc@q2C+8VWzkI!vKMscRdL&8N#s0k z0=fG1Fk+H#CchPNYclRXzi!I0O(0cdN` zW@5UIK>svpbV!v8fpVmLM6BYUaXY` zpSQLE=W8fRJ|jH zZTACJ^o5EA1rBwly;71XE-GdeFnZZ8s>mMBJJ%4X@**p6E(`$$YrWNftLAmeM z%XrvKjyvDct{K`335Jp^W9(5H-V@PHSS|pD3%Q*J5;)>g+bztR$IAw3n_;(}%uhVv znx9eDtB2=xYv;Ebkcm4d>9Bf}f`<`Pwj(iqix&C?cAQ7V;o9Y@tz*7Dd935?~JWSrdU(#yua#??@uibeykEb=&44Q&`5wE z+zZ2TPV&G5%2osf76Uo5^OUP_7UCSO&Rpc=+`6dQIAxfx7NI6fCkp3!@ z2nqAiA0=5wh-}FI|Fntqs7(hG8%H(|6PUx0u7SPAjGyqvf}oktFrxkb39yh3@2U-$ zncubI4MZh9tcEutxHHQ?lFgwGdP2*=Q*d~nPBy{S28fPlc`3#17zLt!bnbu)nXY( zUhDH!S*X4#IKAom{a(>bSw*uslm;4|??{uHl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RjiTIuLI(F4bfP3Qb0M0D01>tEkzD>pr8g2 zPc~SaIk{htZL_ZS877GIUtLt`%|L0W)Jy{TT|rmdyx} z`aT^=hvJM}PKfZNg(x}-HtQ`4hT74(1fgTH;tY|^hnLuJKy)#$RfXHL*|-Bbs^HGQ0dJ;X{gjp10}G|m{rfyHXk-fPlf2vo2CL5 zhU(DU+%YYi5hC?{Iz&f2(6G&lGjcg0!jl%F=qT8%w3i5 diff --git a/docs/cart/justlog.null0 b/docs/cart/justlog.null0 index 226de2e6a6b6ac494b7cadd8debf50f3ff927bdb..db4f0b7683a5f70c7a3edfa676d8f89df731f200 100644 GIT binary patch delta 49 zcmaDG{5F_3z?+#xgn@y9gJDrq&_rH&_Jp@W=|H^EI8l=sC^UJxrYMNL5ydF9y?-U_7y@kZmAx3y#e>7G2rRuusB Cxgrk$ diff --git a/docs/cart/typesizes.null0 b/docs/cart/typesizes.null0 index ab1e3d2d2cf5ac3427bd444797cb435aa7ef7aee..b81066a0b0df02a0490caab4f10ba755f3d696a9 100644 GIT binary patch delta 49 zcmcZ^ax;WCz?+#xgn@y9gJDrq&_rH&_Jp@W=|H^E_^c)~P-rr

Here are some example carts:

- - - + + + - + diff --git a/docs/null0.js b/docs/null0.js index d6f3aa7..87712db 100755 --- a/docs/null0.js +++ b/docs/null0.js @@ -1,5 +1,5 @@ -import loadCart from "./wasm/null0.mjs"; -import wireCartToHost from "./null0_wasm.js"; +import loadCart from './wasm/null0.mjs' +import wireCartToHost from './null0_wasm.js' export const Buttons = { A: 7, @@ -13,57 +13,57 @@ export const Buttons = { UP: 1, DOWN: 3, LEFT: 4, - RIGHT: 2, -}; + RIGHT: 2 +} // get just the null0 wasm-host (emscripten) -export async function getHost( +export async function getHost ( cartUrl, - canvas = document.body.appendChild(document.createElement("canvas")), + canvas = document.body.appendChild(document.createElement('canvas')) ) { - const cartname = cartUrl.split("/").pop().split(".")[0]; + const cartname = cartUrl.split('/').pop().split('.')[0] const host = await loadCart({ canvas, preRun: async function ({ FS }) { - await FS.createPreloadedFile("/", cartname, cartUrl, true, false); + await FS.createPreloadedFile('/', cartname, cartUrl, true, false) }, // for some reason it strips off .null0 - arguments: [`/${cartname}`], - }); + arguments: [`/${cartname}`] + }) // read a file from inside the cart host.readCartFile = (filename) => { - const filenamePtr = host._malloc(filename.length + 1); - host.stringToUTF8(filename, filenamePtr, filename.length + 1); - const bytesHostPtr = host._malloc(4); - const retPtr = host._null0_file_read(filenamePtr, bytesHostPtr); + const filenamePtr = host._malloc(filename.length + 1) + host.stringToUTF8(filename, filenamePtr, filename.length + 1) + const bytesHostPtr = host._malloc(4) + const retPtr = host._null0_file_read(filenamePtr, bytesHostPtr) const r = host.HEAPU8.slice( retPtr, - retPtr + host.HEAPU32[bytesHostPtr / 4], - ); - host._free(bytesHostPtr); - host._free(filenamePtr); - host._free(retPtr); - return r; - }; - - return host; + retPtr + host.HEAPU32[bytesHostPtr / 4] + ) + host._free(bytesHostPtr) + host._free(filenamePtr) + host._free(retPtr) + return r + } + + return host } // setup a cart with engine -export async function setupCart( +export async function setupCart ( url, - canvas = document.body.appendChild(document.createElement("canvas")), + canvas = document.body.appendChild(document.createElement('canvas')) ) { - const host = await getHost(url, canvas); - const out = { host }; - const cart = {}; + const host = await getHost(url, canvas) + const out = { host } + const cart = {} - canvas.width = 320; - canvas.height = 240; - canvas.setAttribute("tabindex", 0); - canvas.addEventListener("click", () => canvas.focus()); + canvas.width = 320 + canvas.height = 240 + canvas.setAttribute('tabindex', 0) + canvas.addEventListener('click', () => canvas.focus()) // TODO: focus/unfocus handlers for sound @@ -72,171 +72,171 @@ export async function setupCart( // minimal WASI that only allows console logging wasi_snapshot_preview1: { - fd_write(fd, iovsPtr, iovsLength, bytesWrittenPtr) { + fd_write (fd, iovsPtr, iovsLength, bytesWrittenPtr) { const iovs = new Uint32Array( cart.memory.buffer, iovsPtr, - iovsLength * 2, - ); + iovsLength * 2 + ) if (fd === 1 || fd === 2) { // stdout/stderr - let text = ""; - let totalBytesWritten = 0; + let text = '' + let totalBytesWritten = 0 for (let i = 0; i < iovsLength * 2; i += 2) { - const offset = iovs[i]; - const length = iovs[i + 1]; - text += cart.getString(offset, length); - totalBytesWritten += length; + const offset = iovs[i] + const length = iovs[i + 1] + text += cart.getString(offset, length) + totalBytesWritten += length } - cart.view.setInt32(bytesWrittenPtr, totalBytesWritten, true); + cart.view.setInt32(bytesWrittenPtr, totalBytesWritten, true) // not exactly right, since it will add newlines, but this covers printf and stuff - text = text.replace(/\n*$/, ""); + text = text.replace(/\n*$/, '') if (fd === 1) { - console.log(text); + console.log(text) } else { - console.error(text); + console.error(text) } } - return 0; + return 0 }, - fd_close() { - return 0; + fd_close () { + return 0 }, - fd_fdstat_get() { - return 0; + fd_fdstat_get () { + return 0 }, - fd_seek() { - return 0; + fd_seek () { + return 0 }, - proc_exit(status) { - console.error("exit", status); - return 0; - }, - }, - }; + proc_exit (status) { + console.error('exit', status) + return 0 + } + } + } - const wasmBytes = host.readCartFile("main.wasm"); - const cartMod = await WebAssembly.compile(wasmBytes); - const { exports } = await WebAssembly.instantiate(cartMod, imports); + const wasmBytes = host.readCartFile('main.wasm') + const cartMod = await WebAssembly.compile(wasmBytes) + const { exports } = await WebAssembly.instantiate(cartMod, imports) for (const k of Object.keys(exports)) { - cart[k] = exports[k]; + cart[k] = exports[k] } - const d = new TextDecoder(); + const d = new TextDecoder() cart.getString = (offset, length) => - d.decode(exports.memory.buffer.slice(offset, offset + length)); - cart.view = new DataView(exports.memory.buffer); + d.decode(exports.memory.buffer.slice(offset, offset + length)) + cart.view = new DataView(exports.memory.buffer) - out.cart = cart; + out.cart = cart if (cart._start) { - cart._start(); + cart._start() } if (cart.load) { - cart.load(); + cart.load() } if (cart.buttonDown) { - canvas.addEventListener("keydown", ({ key }) => { - if (key === "z") { - cart.buttonDown(Buttons.B); + canvas.addEventListener('keydown', ({ key }) => { + if (key === 'z') { + cart.buttonDown(Buttons.B) } - if (key === "x") { - cart.buttonDown(Buttons.A); + if (key === 'x') { + cart.buttonDown(Buttons.A) } - if (key === "a") { - cart.buttonDown(Buttons.Y); + if (key === 'a') { + cart.buttonDown(Buttons.Y) } - if (key === "s") { - cart.buttonDown(Buttons.X); + if (key === 's') { + cart.buttonDown(Buttons.X) } - if (key === "Shift") { - cart.buttonDown(Buttons.SELECT); + if (key === 'Shift') { + cart.buttonDown(Buttons.SELECT) } - if (key === "Enter") { - cart.buttonDown(Buttons.START); + if (key === 'Enter') { + cart.buttonDown(Buttons.START) } - if (key === "q") { - cart.buttonDown(Buttons.L); + if (key === 'q') { + cart.buttonDown(Buttons.L) } - if (key === "w") { - cart.buttonDown(Buttons.R); + if (key === 'w') { + cart.buttonDown(Buttons.R) } - if (key === "ArrowUp") { - cart.buttonDown(Buttons.UP); + if (key === 'ArrowUp') { + cart.buttonDown(Buttons.UP) } - if (key === "ArrowDown") { - cart.buttonDown(Buttons.DOWN); + if (key === 'ArrowDown') { + cart.buttonDown(Buttons.DOWN) } - if (key === "ArrowLeft") { - cart.buttonDown(Buttons.LEFT); + if (key === 'ArrowLeft') { + cart.buttonDown(Buttons.LEFT) } - if (key === "ArrowRight") { - cart.buttonDown(Buttons.RIGHT); + if (key === 'ArrowRight') { + cart.buttonDown(Buttons.RIGHT) } - }); + }) } if (cart.buttonUp) { - canvas.addEventListener("keyup", ({ key }) => { - if (key === "z") { - cart.buttonUp(Buttons.B); + canvas.addEventListener('keyup', ({ key }) => { + if (key === 'z') { + cart.buttonUp(Buttons.B) } - if (key === "x") { - cart.buttonUp(Buttons.A); + if (key === 'x') { + cart.buttonUp(Buttons.A) } - if (key === "a") { - cart.buttonUp(Buttons.Y); + if (key === 'a') { + cart.buttonUp(Buttons.Y) } - if (key === "s") { - cart.buttonUp(Buttons.X); + if (key === 's') { + cart.buttonUp(Buttons.X) } - if (key === "Shift") { - cart.buttonUp(Buttons.SELECT); + if (key === 'Shift') { + cart.buttonUp(Buttons.SELECT) } - if (key === "Enter") { - cart.buttonUp(Buttons.START); + if (key === 'Enter') { + cart.buttonUp(Buttons.START) } - if (key === "q") { - cart.buttonUp(Buttons.L); + if (key === 'q') { + cart.buttonUp(Buttons.L) } - if (key === "w") { - cart.buttonUp(Buttons.R); + if (key === 'w') { + cart.buttonUp(Buttons.R) } - if (key === "ArrowUp") { - cart.buttonUp(Buttons.UP); + if (key === 'ArrowUp') { + cart.buttonUp(Buttons.UP) } - if (key === "ArrowDown") { - cart.buttonUp(Buttons.DOWN); + if (key === 'ArrowDown') { + cart.buttonUp(Buttons.DOWN) } - if (key === "ArrowLeft") { - cart.buttonUp(Buttons.LEFT); + if (key === 'ArrowLeft') { + cart.buttonUp(Buttons.LEFT) } - if (key === "ArrowRight") { - cart.buttonUp(Buttons.RIGHT); + if (key === 'ArrowRight') { + cart.buttonUp(Buttons.RIGHT) } - }); + }) } const cartUpdate = () => { if (cart.update) { - cart.update(); + cart.update() } - window.requestAnimationFrame(cartUpdate); + window.requestAnimationFrame(cartUpdate) if (cart.frameCallback) { - cart.frameCallback(); + cart.frameCallback() } - }; - window.requestAnimationFrame(cartUpdate); + } + window.requestAnimationFrame(cartUpdate) - return out; + return out } -export default setupCart; +export default setupCart diff --git a/docs/null0_wasm.js b/docs/null0_wasm.js index 18855bd..a31cecf 100755 --- a/docs/null0_wasm.js +++ b/docs/null0_wasm.js @@ -1,234 +1,234 @@ // Null0 host interface for web -const MAX_STRING_LEN = 1024 * 20; +const MAX_STRING_LEN = 1024 * 20 -const td = new TextDecoder(); +const td = new TextDecoder() -export default function wireCartToHost(host, cart) { +export default function wireCartToHost (host, cart) { const copyBytesFromCart = (cartPtr, size, retPtr) => { - const cartMem = new DataView(cart.memory.buffer); - const hostPtr = retPtr || host._malloc(size); + const cartMem = new DataView(cart.memory.buffer) + const hostPtr = retPtr || host._malloc(size) for (let b = 0; b < size; b++) { - host.HEAPU8[hostPtr + b] = cartMem.getUint8(cartPtr + b); + host.HEAPU8[hostPtr + b] = cartMem.getUint8(cartPtr + b) } - return hostPtr; - }; + return hostPtr + } const copyBytesToCart = (hostPtr, size, retPtr) => { - const cartMem = new DataView(cart.memory.buffer); - const cartPtr = retPtr || cart.malloc(size); + const cartMem = new DataView(cart.memory.buffer) + const cartPtr = retPtr || cart.malloc(size) for (let b = 0; b < size; b++) { - cartMem.setUint8(cartPtr + b, host.HEAPU8[hostPtr + b]); + cartMem.setUint8(cartPtr + b, host.HEAPU8[hostPtr + b]) } - return cartPtr; - }; + return cartPtr + } const cartStrlen = (pointer) => { - const cartMem = new DataView(cart.memory.buffer); - let end = pointer; + const cartMem = new DataView(cart.memory.buffer) + let end = pointer while (end < pointer + MAX_STRING_LEN) { if (cartMem.getUint8(end) === 0) { - break; + break } - end++; + end++ } - return end - pointer; - }; + return end - pointer + } const hostStrlen = (pointer) => { - let end = pointer; + let end = pointer while (end < pointer + MAX_STRING_LEN) { if (host.HEAPU8[end] === 0) { - break; + break } - end++; + end++ } - return end - pointer; - }; + return end - pointer + } - const cartStr = (pointer) => cart.getString(pointer, cartStrlen(pointer)); + const cartStr = (pointer) => cart.getString(pointer, cartStrlen(pointer)) return { - trace(str) { - console.log(cartStr(str)); + trace (str) { + console.log(cartStr(str)) }, - current_time() { - return BigInt(Date.now()); + current_time () { + return BigInt(Date.now()) }, - delta_time() { - return host._null0_delta_time(); + delta_time () { + return host._null0_delta_time() }, - random_int(min, max) { - return host._null0_random_int(); + random_int (min, max) { + return host._null0_random_int() }, - load_sound(filename) { + load_sound (filename) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - const r = host._null0_load_sound(filenameHostPtr); - host._free(filenameHostPtr); - return r; - }, - play_sound(sound, loop) { - host._null0_play_sound(sound, loop); - }, - stop_sound(sound) { - host._null0_stop_sound(sound); - }, - new_sfx(params) { - const paramsHostPtr = copyBytesFromCart(params, 96); - const r = host._null0_new_sfx(paramsHostPtr); - host._free(paramsHostPtr); - return r; - }, - preset_sfx(params, type) { - const paramsHostPtr = copyBytesFromCart(params, 96); - host._null0_preset_sfx(paramsHostPtr, type); - copyBytesToCart(paramsHostPtr, 96, params); - host._free(paramsHostPtr); - }, - randomize_sfx(params, waveType) { - const paramsHostPtr = copyBytesFromCart(params, 96); - host._null0_randomize_sfx(paramsHostPtr, waveType); - copyBytesToCart(params, 96, paramsHostPtr); - host._free(paramsHostPtr); - }, - mutate_sfx(params, range, mask) { - const paramsHostPtr = copyBytesFromCart(params, 96); - host._null0_mutate_sfx(paramsHostPtr, range, mask); - host._free(paramsHostPtr); - }, - load_sfx(retPtr, filename) { + cartStrlen(filename) + 1 + ) + const r = host._null0_load_sound(filenameHostPtr) + host._free(filenameHostPtr) + return r + }, + play_sound (sound, loop) { + host._null0_play_sound(sound, loop) + }, + stop_sound (sound) { + host._null0_stop_sound(sound) + }, + new_sfx (params) { + const paramsHostPtr = copyBytesFromCart(params, 96) + const r = host._null0_new_sfx(paramsHostPtr) + host._free(paramsHostPtr) + return r + }, + preset_sfx (params, type) { + const paramsHostPtr = copyBytesFromCart(params, 96) + host._null0_preset_sfx(paramsHostPtr, type) + copyBytesToCart(paramsHostPtr, 96, params) + host._free(paramsHostPtr) + }, + randomize_sfx (params, waveType) { + const paramsHostPtr = copyBytesFromCart(params, 96) + host._null0_randomize_sfx(paramsHostPtr, waveType) + copyBytesToCart(params, 96, paramsHostPtr) + host._free(paramsHostPtr) + }, + mutate_sfx (params, range, mask) { + const paramsHostPtr = copyBytesFromCart(params, 96) + host._null0_mutate_sfx(paramsHostPtr, range, mask) + host._free(paramsHostPtr) + }, + load_sfx (retPtr, filename) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - const retHostPtr = host._malloc(96); - host._null0_load_sfx(retHostPtr, filenameHostPtr); - copyBytesToCart(retHostPtr, 96, retPtr); - host._free(retHostPtr); - host._free(filenameHostPtr); + cartStrlen(filename) + 1 + ) + const retHostPtr = host._malloc(96) + host._null0_load_sfx(retHostPtr, filenameHostPtr) + copyBytesToCart(retHostPtr, 96, retPtr) + host._free(retHostPtr) + host._free(filenameHostPtr) }, - unload_sound(sound) { - host._null0_unload_sound(sound); + unload_sound (sound) { + host._null0_unload_sound(sound) }, - key_pressed(key) { - return host._null0_key_pressed(key); + key_pressed (key) { + return host._null0_key_pressed(key) }, - key_down(key) { - return host._null0_key_down(key); + key_down (key) { + return host._null0_key_down(key) }, - key_released(key) { - return host._null0_key_released(key); + key_released (key) { + return host._null0_key_released(key) }, - key_up(key) { - return host._null0_key_up(key); + key_up (key) { + return host._null0_key_up(key) }, - gamepad_button_pressed(gamepad, button) { - return host._null0_gamepad_button_pressed(gamepad, button); + gamepad_button_pressed (gamepad, button) { + return host._null0_gamepad_button_pressed(gamepad, button) }, - gamepad_button_down(gamepad, button) { - return host._null0_gamepad_button_down(gamepad, button); + gamepad_button_down (gamepad, button) { + return host._null0_gamepad_button_down(gamepad, button) }, - gamepad_button_released(gamepad, button) { - return host._null0_gamepad_button_released(gamepad, button); + gamepad_button_released (gamepad, button) { + return host._null0_gamepad_button_released(gamepad, button) }, - mouse_position(retPtr) { - const hostRetPtr = host._malloc(8); - host._null0_mouse_position(hostRetPtr); - copyBytesToCart(hostRetPtr, 8, retPtr); - host._free(hostRetPtr); + mouse_position (retPtr) { + const hostRetPtr = host._malloc(8) + host._null0_mouse_position(hostRetPtr) + copyBytesToCart(hostRetPtr, 8, retPtr) + host._free(hostRetPtr) }, - mouse_button_pressed(button) { - return host._null0_mouse_button_pressed(button); + mouse_button_pressed (button) { + return host._null0_mouse_button_pressed(button) }, - mouse_button_down(button) { - return host._null0_mouse_button_down(button); + mouse_button_down (button) { + return host._null0_mouse_button_down(button) }, - mouse_button_released(button) { - return host._null0_mouse_button_released(button); + mouse_button_released (button) { + return host._null0_mouse_button_released(button) }, - mouse_button_up(button) { - return host._null0_mouse_button_up(button); + mouse_button_up (button) { + return host._null0_mouse_button_up(button) }, - new_image(width, height, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const r = host._null0_clear(width, height, hostColorPtr); - host._free(hostColorPtr); - return r; + new_image (width, height, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const r = host._null0_clear(width, height, hostColorPtr) + host._free(hostColorPtr) + return r }, - image_copy(image) { - return host._null0_image_copy(image); + image_copy (image) { + return host._null0_image_copy(image) }, - image_subimage(image, x, y, width, height) { - return host._null0_image_subimage(image, x, y, width, height); + image_subimage (image, x, y, width, height) { + return host._null0_image_subimage(image, x, y, width, height) }, - clear(color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_clear(hostColorPtr); - host._free(hostColorPtr); + clear (color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_clear(hostColorPtr) + host._free(hostColorPtr) }, - draw_point(x, y, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_point(x, y, hostColorPtr); - host._free(hostColorPtr); + draw_point (x, y, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_point(x, y, hostColorPtr) + host._free(hostColorPtr) }, - draw_line(startPosX, startPosY, endPosX, endPosY, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_line (startPosX, startPosY, endPosX, endPosY, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_line( startPosX, startPosY, endPosX, endPosY, - hostColorPtr, - ); - host._free(hostColorPtr); - }, - draw_rectangle(posX, posY, width, height, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_rectangle(posX, posY, width, height, hostColorPtr); - host._free(hostColorPtr); - }, - draw_triangle(x1, y1, x2, y2, x3, y3, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_triangle(x1, y1, x2, y2, x3, y3, hostColorPtr); - host._free(hostColorPtr); - }, - draw_ellipse(centerX, centerY, radiusX, radiusY, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + hostColorPtr + ) + host._free(hostColorPtr) + }, + draw_rectangle (posX, posY, width, height, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_rectangle(posX, posY, width, height, hostColorPtr) + host._free(hostColorPtr) + }, + draw_triangle (x1, y1, x2, y2, x3, y3, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_triangle(x1, y1, x2, y2, x3, y3, hostColorPtr) + host._free(hostColorPtr) + }, + draw_ellipse (centerX, centerY, radiusX, radiusY, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_ellipse( centerX, centerY, radiusX, radiusY, - hostColorPtr, - ); - host._free(hostColorPtr); - }, - draw_circle(centerX, centerY, radius, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_circle(centerX, centerY, radius, hostColorPtr); - host._free(hostColorPtr); - }, - draw_polygon(points, numPoints, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const size = numPoints * 8; - const hostPointsPtr = copyBytesFromCart(points, size); - host._null0_draw_polygon(hostPointsPtr, numPoints, hostColorPtr); - host._free(hostColorPtr); - host._free(hostPointsPtr); - }, - draw_polyline(points, numPoints, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const size = numPoints * 8; - const hostPointsPtr = copyBytesFromCart(points, size); - host._null0_draw_polyline(hostPointsPtr, numPoints, hostColorPtr); - host._free(hostColorPtr); - host._free(hostPointsPtr); - }, - draw_arc(centerX, centerY, radius, startAngle, endAngle, segments, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + hostColorPtr + ) + host._free(hostColorPtr) + }, + draw_circle (centerX, centerY, radius, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_circle(centerX, centerY, radius, hostColorPtr) + host._free(hostColorPtr) + }, + draw_polygon (points, numPoints, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const size = numPoints * 8 + const hostPointsPtr = copyBytesFromCart(points, size) + host._null0_draw_polygon(hostPointsPtr, numPoints, hostColorPtr) + host._free(hostColorPtr) + host._free(hostPointsPtr) + }, + draw_polyline (points, numPoints, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const size = numPoints * 8 + const hostPointsPtr = copyBytesFromCart(points, size) + host._null0_draw_polyline(hostPointsPtr, numPoints, hostColorPtr) + host._free(hostColorPtr) + host._free(hostPointsPtr) + }, + draw_arc (centerX, centerY, radius, startAngle, endAngle, segments, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_arc( centerX, centerY, @@ -236,31 +236,31 @@ export default function wireCartToHost(host, cart) { startAngle, endAngle, segments, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_rectangle_rounded(x, y, width, height, cornerRadius, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_rectangle_rounded (x, y, width, height, cornerRadius, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_rectangle_rounded( x, y, width, height, cornerRadius, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_image(src, posX, posY) { - host._null0_draw_image(src, posX, posY); + draw_image (src, posX, posY) { + host._null0_draw_image(src, posX, posY) }, - draw_image_tint(src, posX, posY, tint) { - const tintPntr = copyBytesFromCart(tint, 4); - host._null0_draw_image_tint(src, posX, posY, tintPntr); - host._free(tintPntr); + draw_image_tint (src, posX, posY, tint) { + const tintPntr = copyBytesFromCart(tint, 4) + host._null0_draw_image_tint(src, posX, posY, tintPntr) + host._free(tintPntr) }, - draw_image_rotated(src, posX, posY, degrees, offsetX, offsetY, filter) { + draw_image_rotated (src, posX, posY, degrees, offsetX, offsetY, filter) { host._null0_draw_image_rotated( src, posX, @@ -268,16 +268,16 @@ export default function wireCartToHost(host, cart) { degrees, offsetX, offsetY, - filter, - ); + filter + ) }, - draw_image_flipped( + draw_image_flipped ( src, posX, posY, flipHorizontal, flipVertical, - flipDiagonal, + flipDiagonal ) { host._null0_draw_image_flipped( src, @@ -285,10 +285,10 @@ export default function wireCartToHost(host, cart) { posY, flipHorizontal, flipVertical, - flipDiagonal, - ); + flipDiagonal + ) }, - draw_image_scaled( + draw_image_scaled ( src, posX, posY, @@ -296,7 +296,7 @@ export default function wireCartToHost(host, cart) { scaleY, offsetX, offsetY, - filter, + filter ) { host._null0_draw_image_scaled( src, @@ -306,246 +306,246 @@ export default function wireCartToHost(host, cart) { scaleY, offsetX, offsetY, - filter, - ); + filter + ) }, - draw_text(font, text, posX, posY, color) { - const textHostPtr = copyBytesFromCart(text, cartStrlen(text) + 1); - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_text(font, textHostPtr, posX, posY, hostColorPtr); - host._free(textHostPtr); - host._free(hostColorPtr); + draw_text (font, text, posX, posY, color) { + const textHostPtr = copyBytesFromCart(text, cartStrlen(text) + 1) + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_text(font, textHostPtr, posX, posY, hostColorPtr) + host._free(textHostPtr) + host._free(hostColorPtr) }, - save_image(image, filename) { + save_image (image, filename) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - host._null0_save_image(image, filenameHostPtr); - host._free(filenameHostPtr); + cartStrlen(filename) + 1 + ) + host._null0_save_image(image, filenameHostPtr) + host._free(filenameHostPtr) }, - load_image(filename) { + load_image (filename) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - const r = host._null0_load_image(filenameHostPtr); - host._free(filenameHostPtr); - return r; - }, - image_resize(image, newWidth, newHeight, offsetX, offsetY, fill) { - const fillPtr = copyBytesFromCart(fill, 4); + cartStrlen(filename) + 1 + ) + const r = host._null0_load_image(filenameHostPtr) + host._free(filenameHostPtr) + return r + }, + image_resize (image, newWidth, newHeight, offsetX, offsetY, fill) { + const fillPtr = copyBytesFromCart(fill, 4) host._null0_image_resize( image, newWidth, newHeight, offsetX, offsetY, - fillPtr, - ); - host._free(fillPtr); + fillPtr + ) + host._free(fillPtr) }, - image_scale(image, scaleX, scaleY, filter) { - host._null0_image_scale(image, scaleX, scaleY, filter); + image_scale (image, scaleX, scaleY, filter) { + host._null0_image_scale(image, scaleX, scaleY, filter) }, - image_color_replace(image, color, replace) { - const hostColorPtr = copyBytesFromCart(color, 4); - const hostReplacePtr = copyBytesFromCart(replace, 4); - host._null0_image_color_replace(image, hostColorPtr, hostReplacePtr); - host._free(hostColorPtr); - host._free(hostReplacePtr); + image_color_replace (image, color, replace) { + const hostColorPtr = copyBytesFromCart(color, 4) + const hostReplacePtr = copyBytesFromCart(replace, 4) + host._null0_image_color_replace(image, hostColorPtr, hostReplacePtr) + host._free(hostColorPtr) + host._free(hostReplacePtr) }, - image_color_tint(image, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_image_color_tint(image, hostColorPtr); - host._free(hostColorPtr); + image_color_tint (image, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_image_color_tint(image, hostColorPtr) + host._free(hostColorPtr) }, - image_color_fade(image, alpha) { - host._null0_image_color_fade(image, alpha); + image_color_fade (image, alpha) { + host._null0_image_color_fade(image, alpha) }, - font_copy(font) { - return host._null0_font_copy(font); + font_copy (font) { + return host._null0_font_copy(font) }, - font_scale(font, scaleX, scaleY, filter) { - return host._null0_font_scale(font, scaleX, scaleY, filter); + font_scale (font, scaleX, scaleY, filter) { + return host._null0_font_scale(font, scaleX, scaleY, filter) }, - load_font_bmf(filename, characters) { + load_font_bmf (filename, characters) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); + cartStrlen(filename) + 1 + ) const charactersHostPtr = copyBytesFromCart( characters, - cartStrlen(characters) + 1, - ); - const r = host._null0_load_font_bmf(filenameHostPtr, charactersHostPtr); - host._free(filenameHostPtr); - host._free(charactersHostPtr); - return r; - }, - load_font_bmf_from_image(image, characters) { + cartStrlen(characters) + 1 + ) + const r = host._null0_load_font_bmf(filenameHostPtr, charactersHostPtr) + host._free(filenameHostPtr) + host._free(charactersHostPtr) + return r + }, + load_font_bmf_from_image (image, characters) { const charactersHostPtr = copyBytesFromCart( characters, - cartStrlen(characters) + 1, - ); - const r = host._null0_load_font_bmf_from_image(image, charactersHostPtr); - host._free(charactersHostPtr); - return r; - }, - measure_text(retPtr, font, text) { - const textHostPtr = copyBytesFromCart(text, cartStrlen(text)); - const retHostPtr = host._malloc(8); - host._null0_measure_text(retHostPtr, font, textHostPtr); - copyBytesToCart(retHostPtr, 8, retPtr); - host._free(textHostPtr); - host._free(retHostPtr); - }, - measure_image(retPtr, image) { - const retHostPtr = host._malloc(8); - host._null0_measure_image(retHostPtr, image); - copyBytesToCart(retHostPtr, 8, retPtr); - host._free(retHostPtr); - }, - load_font_tty(filename, glyphWidth, glyphHeight, characters) { + cartStrlen(characters) + 1 + ) + const r = host._null0_load_font_bmf_from_image(image, charactersHostPtr) + host._free(charactersHostPtr) + return r + }, + measure_text (retPtr, font, text) { + const textHostPtr = copyBytesFromCart(text, cartStrlen(text)) + const retHostPtr = host._malloc(8) + host._null0_measure_text(retHostPtr, font, textHostPtr) + copyBytesToCart(retHostPtr, 8, retPtr) + host._free(textHostPtr) + host._free(retHostPtr) + }, + measure_image (retPtr, image) { + const retHostPtr = host._malloc(8) + host._null0_measure_image(retHostPtr, image) + copyBytesToCart(retHostPtr, 8, retPtr) + host._free(retHostPtr) + }, + load_font_tty (filename, glyphWidth, glyphHeight, characters) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); + cartStrlen(filename) + 1 + ) const charactersHostPtr = copyBytesFromCart( characters, - cartStrlen(characters) + 1, - ); + cartStrlen(characters) + 1 + ) const r = host._null0_load_font_tty( filenameHostPtr, glyphWidth, glyphHeight, - charactersHostPtr, - ); - host._free(filenameHostPtr); - host._free(charactersHostPtr); - return r; + charactersHostPtr + ) + host._free(filenameHostPtr) + host._free(charactersHostPtr) + return r }, - load_font_tty_from_image(image, glyphWidth, glyphHeight, characters) { + load_font_tty_from_image (image, glyphWidth, glyphHeight, characters) { const charactersHostPtr = copyBytesFromCart( characters, - cartStrlen(characters) + 1, - ); + cartStrlen(characters) + 1 + ) const r = host._null0_load_font_tty_from_image( image, glyphWidth, glyphHeight, - charactersHostPtr, - ); - host._free(charactersHostPtr); - return r; + charactersHostPtr + ) + host._free(charactersHostPtr) + return r }, - load_font_ttf(filename, fontSize) { + load_font_ttf (filename, fontSize) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - const r = host._null0_load_font_ttf(filenameHostPtr, fontSize); - host._free(filenameHostPtr); - return r; + cartStrlen(filename) + 1 + ) + const r = host._null0_load_font_ttf(filenameHostPtr, fontSize) + host._free(filenameHostPtr) + return r }, - image_color_invert(image) { - host._null0_image_color_invert(image); + image_color_invert (image) { + host._null0_image_color_invert(image) }, - image_alpha_border(retPtr, image, threshold) { - const retHostPtr = host._malloc(16); - host._null0_image_alpha_border(retHostPtr, image, threshold); - copyBytesToCart(retPtr, 16, retHostPtr); - host._free(retHostPtr); + image_alpha_border (retPtr, image, threshold) { + const retHostPtr = host._malloc(16) + host._null0_image_alpha_border(retHostPtr, image, threshold) + copyBytesToCart(retPtr, 16, retHostPtr) + host._free(retHostPtr) }, - image_crop(image, x, y, width, height) { - host._null0_image_crop(image, x, y, width, height); + image_crop (image, x, y, width, height) { + host._null0_image_crop(image, x, y, width, height) }, - image_alpha_crop(image, threshold) { - host._null0_image_alpha_crop(image, threshold); + image_alpha_crop (image, threshold) { + host._null0_image_alpha_crop(image, threshold) }, - image_color_brightness(image, factor) { - host._null0_image_color_brightness(image, factor); + image_color_brightness (image, factor) { + host._null0_image_color_brightness(image, factor) }, - image_flip(image, horizontal, vertical) { - host._null0_image_flip(image, horizontal, vertical); + image_flip (image, horizontal, vertical) { + host._null0_image_flip(image, horizontal, vertical) }, - image_color_contrast(image, contrast) { - host._null0_image_color_contrast(image, contrast); + image_color_contrast (image, contrast) { + host._null0_image_color_contrast(image, contrast) }, - image_alpha_mask(image, alphaMask, posX, posY) { - host._null0_image_alpha_mask(image, alphaMask, posX, posY); + image_alpha_mask (image, alphaMask, posX, posY) { + host._null0_image_alpha_mask(image, alphaMask, posX, posY) }, - image_rotate(image, degrees, filter) { - host._null0_image_rotate(image, degrees, filter); + image_rotate (image, degrees, filter) { + host._null0_image_rotate(image, degrees, filter) }, - image_gradient(width, height, topLeft, topRight, bottomLeft, bottomRight) { - const hostTopLeftPtr = copyBytesFromCart(topLeft, 4); - const hostTopRightPtr = copyBytesFromCart(topRight, 4); - const hostBottomLeftPtr = copyBytesFromCart(bottomLeft, 4); - const hostBottomRightPtr = copyBytesFromCart(bottomRight, 4); + image_gradient (width, height, topLeft, topRight, bottomLeft, bottomRight) { + const hostTopLeftPtr = copyBytesFromCart(topLeft, 4) + const hostTopRightPtr = copyBytesFromCart(topRight, 4) + const hostBottomLeftPtr = copyBytesFromCart(bottomLeft, 4) + const hostBottomRightPtr = copyBytesFromCart(bottomRight, 4) const r = host._null0_image_gradient( width, height, hostTopLeftPtr, hostTopRightPtr, hostBottomLeftPtr, - hostBottomRightPtr, - ); - host._free(hostTopLeftPtr); - host._free(hostTopRightPtr); - host._free(hostBottomLeftPtr); - host._free(hostBottomRightPtr); - return r; - }, - unload_image(image) { - host._null0_unload_image(image); - }, - unload_font(font) { - host._null0_unload_font(font); - }, - clear_on_image(destination, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_clear_on_image(destination, hostColorPtr); - host._free(hostColorPtr); - }, - draw_point_on_image(destination, x, y, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_point_on_image(destination, x, y, hostColorPtr); - host._free(hostColorPtr); - }, - draw_line_on_image( + hostBottomRightPtr + ) + host._free(hostTopLeftPtr) + host._free(hostTopRightPtr) + host._free(hostBottomLeftPtr) + host._free(hostBottomRightPtr) + return r + }, + unload_image (image) { + host._null0_unload_image(image) + }, + unload_font (font) { + host._null0_unload_font(font) + }, + clear_on_image (destination, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_clear_on_image(destination, hostColorPtr) + host._free(hostColorPtr) + }, + draw_point_on_image (destination, x, y, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_point_on_image(destination, x, y, hostColorPtr) + host._free(hostColorPtr) + }, + draw_line_on_image ( destination, startPosX, startPosY, endPosX, endPosY, - color, + color ) { - const hostColorPtr = copyBytesFromCart(color, 4); + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_line_on_image( destination, startPosX, startPosY, endPosX, endPosY, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_rectangle_on_image(destination, posX, posY, width, height, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_rectangle_on_image (destination, posX, posY, width, height, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_rectangle_on_image( destination, posX, posY, width, height, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_triangle_on_image(destination, x1, y1, x2, y2, x3, y3, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_triangle_on_image (destination, x1, y1, x2, y2, x3, y3, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_triangle_on_image( destination, x1, @@ -554,76 +554,76 @@ export default function wireCartToHost(host, cart) { y2, x3, y3, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_ellipse_on_image( + draw_ellipse_on_image ( destination, centerX, centerY, radiusX, radiusY, - color, + color ) { - const hostColorPtr = copyBytesFromCart(color, 4); + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_ellipse_on_image( destination, centerX, centerY, radiusX, radiusY, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_circle_on_image(destination, centerX, centerY, radius, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_circle_on_image (destination, centerX, centerY, radius, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_circle_on_image( destination, centerX, centerY, radius, - hostColorPtr, - ); - host._free(hostColorPtr); - }, - draw_polygon_on_image(destination, points, numPoints, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const size = numPoints * 8; - const hostPointsPtr = copyBytesFromCart(points, size); + hostColorPtr + ) + host._free(hostColorPtr) + }, + draw_polygon_on_image (destination, points, numPoints, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const size = numPoints * 8 + const hostPointsPtr = copyBytesFromCart(points, size) host._null0_draw_polygon_on_image( destination, hostPointsPtr, numPoints, - hostColorPtr, - ); - host._free(hostColorPtr); - host._free(hostPointsPtr); - }, - draw_polyline_on_image(destination, points, numPoints, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const size = numPoints * 8; - const hostPointsPtr = copyBytesFromCart(points, size); + hostColorPtr + ) + host._free(hostColorPtr) + host._free(hostPointsPtr) + }, + draw_polyline_on_image (destination, points, numPoints, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const size = numPoints * 8 + const hostPointsPtr = copyBytesFromCart(points, size) host._null0_draw_polyline_on_image( destination, hostPointsPtr, numPoints, - hostColorPtr, - ); - host._free(hostColorPtr); - host._free(hostPointsPtr); + hostColorPtr + ) + host._free(hostColorPtr) + host._free(hostPointsPtr) }, - draw_rectangle_rounded_on_image( + draw_rectangle_rounded_on_image ( destination, x, y, width, height, cornerRadius, - color, + color ) { - const hostColorPtr = copyBytesFromCart(color, 4); + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_rectangle_rounded_on_image( destination, x, @@ -631,24 +631,24 @@ export default function wireCartToHost(host, cart) { width, height, cornerRadius, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_image_on_image(destination, src, posX, posY) { - host._null0_draw_image_on_image(destination, src, posX, posY); + draw_image_on_image (destination, src, posX, posY) { + host._null0_draw_image_on_image(destination, src, posX, posY) }, - draw_image_tint_on_image(destination, src, posX, posY, tint) { - const hostTintPtr = copyBytesFromCart(tint, 4); + draw_image_tint_on_image (destination, src, posX, posY, tint) { + const hostTintPtr = copyBytesFromCart(tint, 4) host._null0_draw_image_tint_on_image( destination, src, posX, posY, - hostTintPtr, - ); + hostTintPtr + ) }, - draw_image_rotated_on_image( + draw_image_rotated_on_image ( destination, src, posX, @@ -656,7 +656,7 @@ export default function wireCartToHost(host, cart) { degrees, offsetX, offsetY, - filter, + filter ) { host._null0_draw_image_rotated_on_image( destination, @@ -666,17 +666,17 @@ export default function wireCartToHost(host, cart) { degrees, offsetX, offsetY, - filter, - ); + filter + ) }, - draw_image_flipped_on_image( + draw_image_flipped_on_image ( destination, src, posX, posY, flipHorizontal, flipVertical, - flipDiagonal, + flipDiagonal ) { host._null0_draw_image_flipped_on_image( destination, @@ -685,10 +685,10 @@ export default function wireCartToHost(host, cart) { posY, flipHorizontal, flipVertical, - flipDiagonal, - ); + flipDiagonal + ) }, - draw_image_scaled_on_image( + draw_image_scaled_on_image ( destination, src, posX, @@ -697,7 +697,7 @@ export default function wireCartToHost(host, cart) { scaleY, offsetX, offsetY, - filter, + filter ) { host._null0_draw_image_scaled_on_image( destination, @@ -708,70 +708,70 @@ export default function wireCartToHost(host, cart) { scaleY, offsetX, offsetY, - filter, - ); + filter + ) }, - draw_text_on_image(destination, font, text, posX, posY, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const textHostPtr = copyBytesFromCart(text, cartStrlen(text) + 1); + draw_text_on_image (destination, font, text, posX, posY, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const textHostPtr = copyBytesFromCart(text, cartStrlen(text) + 1) host._null0_draw_text_on_image( destination, font, textHostPtr, posX, posY, - hostColorPtr, - ); - host._free(hostColorPtr); - host._free(textHostPtr); + hostColorPtr + ) + host._free(hostColorPtr) + host._free(textHostPtr) }, - draw_rectangle_outline(posX, posY, width, height, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_rectangle_outline (posX, posY, width, height, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_rectangle_outline( posX, posY, width, height, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_triangle_outline(x1, y1, x2, y2, x3, y3, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_triangle_outline(x1, y1, x2, y2, x3, y3, hostColorPtr); - host._free(hostColorPtr); + draw_triangle_outline (x1, y1, x2, y2, x3, y3, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_triangle_outline(x1, y1, x2, y2, x3, y3, hostColorPtr) + host._free(hostColorPtr) }, - draw_ellipse_outline(centerX, centerY, radiusX, radiusY, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_ellipse_outline (centerX, centerY, radiusX, radiusY, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_ellipse_outline( centerX, centerY, radiusX, radiusY, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - draw_circle_outline(centerX, centerY, radius, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_circle_outline(centerX, centerY, radius, hostColorPtr); - host._free(hostColorPtr); + draw_circle_outline (centerX, centerY, radius, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_circle_outline(centerX, centerY, radius, hostColorPtr) + host._free(hostColorPtr) }, - draw_polygon_outline(points, numPoints, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - host._null0_draw_polygon_outline(points, numPoints, color); - host._free(hostColorPtr); + draw_polygon_outline (points, numPoints, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + host._null0_draw_polygon_outline(points, numPoints, color) + host._free(hostColorPtr) }, - draw_arc_outline( + draw_arc_outline ( centerX, centerY, radius, startAngle, endAngle, segments, - color, + color ) { - const hostColorPtr = copyBytesFromCart(color, 4); + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_arc_outline( centerX, centerY, @@ -779,40 +779,40 @@ export default function wireCartToHost(host, cart) { startAngle, endAngle, segments, - hostColorPtr, - ); + hostColorPtr + ) }, - draw_rectangle_rounded_outline(x, y, width, height, cornerRadius, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_rectangle_rounded_outline (x, y, width, height, cornerRadius, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_rectangle_rounded_outline( x, y, width, height, cornerRadius, - hostColorPtr, - ); + hostColorPtr + ) }, - draw_rectangle_outline_on_image( + draw_rectangle_outline_on_image ( destination, posX, posY, width, height, - color, + color ) { - const hostColorPtr = copyBytesFromCart(color, 4); + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_rectangle_outline_on_image( destination, posX, posY, width, height, - hostColorPtr, - ); + hostColorPtr + ) }, - draw_triangle_outline_on_image(destination, x1, y1, x2, y2, x3, y3, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_triangle_outline_on_image (destination, x1, y1, x2, y2, x3, y3, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_triangle_outline_on_image( destination, x1, @@ -821,60 +821,60 @@ export default function wireCartToHost(host, cart) { y2, x3, y3, - hostColorPtr, - ); + hostColorPtr + ) }, - draw_ellipse_outline_on_image( + draw_ellipse_outline_on_image ( destination, centerX, centerY, radiusX, radiusY, - color, + color ) { - const hostColorPtr = copyBytesFromCart(color, 4); + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_ellipse_outline_on_image( destination, centerX, centerY, radiusX, radiusY, - hostColorPtr, - ); + hostColorPtr + ) }, - draw_circle_outline_on_image(destination, centerX, centerY, radius, color) { - const hostColorPtr = copyBytesFromCart(color, 4); + draw_circle_outline_on_image (destination, centerX, centerY, radius, color) { + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_circle_outline_on_image( destination, centerX, centerY, radius, - hostColorPtr, - ); + hostColorPtr + ) }, - draw_polygon_outline_on_image(destination, points, numPoints, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const size = numPoints * 8; - const hostPointsPtr = copyBytesFromCart(points, size); + draw_polygon_outline_on_image (destination, points, numPoints, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const size = numPoints * 8 + const hostPointsPtr = copyBytesFromCart(points, size) host._null0_draw_polygon_outline_on_image( destination, hostPointsPtr, numPoints, - hostColorPtr, - ); - host._free(hostColorPtr); - host._free(hostPointsPtr); + hostColorPtr + ) + host._free(hostColorPtr) + host._free(hostPointsPtr) }, - draw_rectangle_rounded_outline_on_image( + draw_rectangle_rounded_outline_on_image ( destination, x, y, width, height, cornerRadius, - color, + color ) { - const hostColorPtr = copyBytesFromCart(color, 4); + const hostColorPtr = copyBytesFromCart(color, 4) host._null0_draw_rectangle_rounded_outline_on_image( destination, x, @@ -882,132 +882,135 @@ export default function wireCartToHost(host, cart) { width, height, cornerRadius, - hostColorPtr, - ); - host._free(hostColorPtr); + hostColorPtr + ) + host._free(hostColorPtr) }, - file_read(filename, bytesRead) { - const filenameHostPtr = copyBytesFromCart( - filename, - cartStrlen(filename) + 1, - ); - const bytesHostPtr = host._malloc(4); - const retPtr = host._null0_file_read(filenameHostPtr, bytesHostPtr); - const r = copyBytesToCart(retPtr, host.HEAPU32[bytesHostPtr / 4]); - copyBytesToCart(bytesHostPtr, 4, bytesRead); - host._free(filenameHostPtr); - host._free(bytesHostPtr); - return r; - }, - file_write(filename, data, byteSize) { + file_read (filename, wasmBytesReadPtr, wasmRetPtr) { + // copy filename from cart to host + const filenameHostPtr = copyBytesFromCart(filename, cartStrlen(filename) + 1) + + // get size of file + const fileInfoHostPtr = host._malloc(40) + host._null0_file_info(fileInfoHostPtr, filenameHostPtr) + const filesize = host.HEAPU32[fileInfoHostPtr / 4] + + // setup cart-pointer for bytesRead/ret + const bytesReadHostPtr = host._malloc(4) + const retPtr = host._malloc(filesize) + + host._null0_file_read(filenameHostPtr, bytesReadHostPtr, retPtr) + copyBytesToCart(retPtr, wasmRetPtr, filesize) + }, + file_write (filename, data, byteSize) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - const bytesHostPtr = copyBytesFromCart(data, byteSize); - copyBytesFromCart(bytesHostPtr, byteSize, data); - const r = host._null0_file_write(filenameHostPtr, bytesHostPtr, byteSize); - host._free(filenameHostPtr); - host._free(bytesHostPtr); - return r; - }, - file_append(filename, data, byteSize) { + cartStrlen(filename) + 1 + ) + const bytesHostPtr = copyBytesFromCart(data, byteSize) + copyBytesFromCart(bytesHostPtr, byteSize, data) + const r = host._null0_file_write(filenameHostPtr, bytesHostPtr, byteSize) + host._free(filenameHostPtr) + host._free(bytesHostPtr) + return r + }, + file_append (filename, data, byteSize) { const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - const bytesHostPtr = copyBytesFromCart(data, byteSize); - copyBytesFromCart(bytesHostPtr, byteSize, data); + cartStrlen(filename) + 1 + ) + const bytesHostPtr = copyBytesFromCart(data, byteSize) + copyBytesFromCart(bytesHostPtr, byteSize, data) const r = host._null0_file_append( filenameHostPtr, bytesHostPtr, - byteSize, - ); - host._free(filenameHostPtr); - host._free(bytesHostPtr); - return r; - }, - file_info(retPtr, filename) { - const retHostPtr = host._malloc(40); + byteSize + ) + host._free(filenameHostPtr) + host._free(bytesHostPtr) + return r + }, + file_info (retPtr, filename) { + const retHostPtr = host._malloc(40) const filenameHostPtr = copyBytesFromCart( filename, - cartStrlen(filename) + 1, - ); - host._null0_file_info(retHostPtr, filenameHostPtr); - copyBytesToCart(retHostPtr, 40, retPtr); - host._free(retHostPtr); - host._free(filenameHostPtr); - }, - get_write_dir() { - const hostRetPtr = host._null0_get_write_dir(); - return copyBytesToCart(hostRetPtr, hostStrlen(hostRetPtr)); - }, - color_tint(retPtr, color, tint) { - const hostColorPtr = copyBytesFromCart(color, 4); - const hostTintPtr = copyBytesFromCart(tint, 4); - const hostRetPtr = host._malloc(4); - host._null0_color_tint(hostRetPtr, hostColorPtr, hostTintPtr); - copyBytesToCart(hostRetPtr, 4, retPtr); - host._free(hostColorPtr); - host._free(hostTintPtr); - host._free(hostRetPtr); - }, - color_fade(retPtr, color, alpha) { - const hostColorPtr = copyBytesFromCart(color, 4); - const hostRetPtr = host.malloc(4); - host._null0_color_fade(hostRetPtr, hostColorPtr, alpha); - copyBytesToCart(hostRetPtr, 4, retPtr); - host._free(hostColorPtr); - host._free(hostRetPtr); - }, - color_brightness(retPtr, color, factor) { - const hostColorPtr = copyBytesFromCart(color, 4); - const hostRetPtr = host.malloc(4); - host._null0_color_brightness(hostRetPtr, hostColorPtr, factor); - copyBytesToCart(hostRetPtr, 4, retPtr); - host._free(hostColorPtr); - host._free(hostRetPtr); - }, - color_invert(retPtr, color) { - const hostColorPtr = copyBytesFromCart(color, 4); - const hostRetPtr = host.malloc(4); - host._null0_color_invert(hostRetPtr, hostColorPtr); - copyBytesToCart(hostRetPtr, 4, retPtr); - host._free(hostColorPtr); - host._free(hostRetPtr); - }, - color_alpha_blend(retPtr, dst, src) { - const hostDstPtr = copyBytesFromCart(dst, 4); - const hostSrcPtr = copyBytesFromCart(src, 4); - const hostRetPtr = host.malloc(4); - host._null0_color_alpha_blend(hostRetPtr, hostDstPtr, hostSrcPtr); - copyBytesToCart(hostRetPtr, 4, retPtr); - host._free(hostDstPtr); - host._free(hostSrcPtr); - host._free(hostRetPtr); - }, - color_contrast(retPtr, color, contrast) { - const hostColorPtr = copyBytesFromCart(color, 4); - const hostRetPtr = host.malloc(4); - host._null0_color_contrast(hostRetPtr, hostColorPtr, contrast); - copyBytesToCart(hostRetPtr, 4, retPtr); - host._free(hostColorPtr); - host._free(hostRetPtr); - }, - color_bilinear_interpolate( + cartStrlen(filename) + 1 + ) + host._null0_file_info(retHostPtr, filenameHostPtr) + copyBytesToCart(retHostPtr, 40, retPtr) + host._free(retHostPtr) + host._free(filenameHostPtr) + }, + get_write_dir () { + const hostRetPtr = host._null0_get_write_dir() + return copyBytesToCart(hostRetPtr, hostStrlen(hostRetPtr)) + }, + color_tint (retPtr, color, tint) { + const hostColorPtr = copyBytesFromCart(color, 4) + const hostTintPtr = copyBytesFromCart(tint, 4) + const hostRetPtr = host._malloc(4) + host._null0_color_tint(hostRetPtr, hostColorPtr, hostTintPtr) + copyBytesToCart(hostRetPtr, 4, retPtr) + host._free(hostColorPtr) + host._free(hostTintPtr) + host._free(hostRetPtr) + }, + color_fade (retPtr, color, alpha) { + const hostColorPtr = copyBytesFromCart(color, 4) + const hostRetPtr = host.malloc(4) + host._null0_color_fade(hostRetPtr, hostColorPtr, alpha) + copyBytesToCart(hostRetPtr, 4, retPtr) + host._free(hostColorPtr) + host._free(hostRetPtr) + }, + color_brightness (retPtr, color, factor) { + const hostColorPtr = copyBytesFromCart(color, 4) + const hostRetPtr = host.malloc(4) + host._null0_color_brightness(hostRetPtr, hostColorPtr, factor) + copyBytesToCart(hostRetPtr, 4, retPtr) + host._free(hostColorPtr) + host._free(hostRetPtr) + }, + color_invert (retPtr, color) { + const hostColorPtr = copyBytesFromCart(color, 4) + const hostRetPtr = host.malloc(4) + host._null0_color_invert(hostRetPtr, hostColorPtr) + copyBytesToCart(hostRetPtr, 4, retPtr) + host._free(hostColorPtr) + host._free(hostRetPtr) + }, + color_alpha_blend (retPtr, dst, src) { + const hostDstPtr = copyBytesFromCart(dst, 4) + const hostSrcPtr = copyBytesFromCart(src, 4) + const hostRetPtr = host.malloc(4) + host._null0_color_alpha_blend(hostRetPtr, hostDstPtr, hostSrcPtr) + copyBytesToCart(hostRetPtr, 4, retPtr) + host._free(hostDstPtr) + host._free(hostSrcPtr) + host._free(hostRetPtr) + }, + color_contrast (retPtr, color, contrast) { + const hostColorPtr = copyBytesFromCart(color, 4) + const hostRetPtr = host.malloc(4) + host._null0_color_contrast(hostRetPtr, hostColorPtr, contrast) + copyBytesToCart(hostRetPtr, 4, retPtr) + host._free(hostColorPtr) + host._free(hostRetPtr) + }, + color_bilinear_interpolate ( retPtr, color00, color01, color10, color11, coordinateX, - coordinateY, + coordinateY ) { - const hostColor00Ptr = copyBytesFromCart(color00, 4); - const hostColor01Ptr = copyBytesFromCart(color01, 4); - const hostColor10Ptr = copyBytesFromCart(color10, 4); - const hostColor11Ptr = copyBytesFromCart(color11, 4); - const hostRetPtr = host.malloc(4); + const hostColor00Ptr = copyBytesFromCart(color00, 4) + const hostColor01Ptr = copyBytesFromCart(color01, 4) + const hostColor10Ptr = copyBytesFromCart(color10, 4) + const hostColor11Ptr = copyBytesFromCart(color11, 4) + const hostRetPtr = host.malloc(4) host._null0_color_bilinear_interpolate( hostRetPtr, hostColor00Ptr, @@ -1015,10 +1018,10 @@ export default function wireCartToHost(host, cart) { hostColor10Ptr, hostColor11Ptr, coordinateX, - coordinateY, - ); - copyBytesToCart(hostRetPtr, 4, retPtr); - host._free(hostRetPtr); - }, - }; + coordinateY + ) + copyBytesToCart(hostRetPtr, 4, retPtr) + host._free(hostRetPtr) + } + } } diff --git a/docs/null0_wc.js b/docs/null0_wc.js index fda8545..3e80670 100644 --- a/docs/null0_wc.js +++ b/docs/null0_wc.js @@ -1,9 +1,10 @@ // this will setup the web-component +/* global HTMLElement */ import setupCart from './null0.js' export default class Null0WebComponent extends HTMLElement { - constructor() { + constructor () { super() this.shadow = this.attachShadow({ mode: 'open' }) this.canvas = document.createElement('canvas') @@ -13,12 +14,12 @@ export default class Null0WebComponent extends HTMLElement { throw new Error('src attribute is required, and should point to your cart URL.') } - setupCart(this.attributes.src.value, this.canvas).then(({host, cart}) => { + setupCart(this.attributes.src.value, this.canvas).then(({ host, cart }) => { this.host = host this.cart = cart if (this.attributes?.fps) { const ctx = this.host.canvas.getContext('2d') - ctx.font = "16px Arial" + ctx.font = '16px Arial' let t = Date.now() let o = t let d = 0 @@ -28,10 +29,10 @@ export default class Null0WebComponent extends HTMLElement { if (t - o > updateTime) { d = Date.now() - t o = t - fps = parseInt(1000/d) + fps = parseInt(1000 / d) } t = Date.now() - + ctx.fillStyle = 'black' ctx.fillText(fps, 9, 19) ctx.fillStyle = 'black' @@ -46,4 +47,4 @@ export default class Null0WebComponent extends HTMLElement { document.addEventListener('DOMContentLoaded', () => { window.customElements.define('null0-cart', Null0WebComponent) -}) \ No newline at end of file +})