From 7cb810089144d42d202e0b267235174d7869c5aa Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 10 Oct 2025 11:29:09 +0200 Subject: checkpoint --- code/platform.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'code/platform.js') diff --git a/code/platform.js b/code/platform.js index 163b0ad..7790297 100644 --- a/code/platform.js +++ b/code/platform.js @@ -46,6 +46,15 @@ async function main() var messageJS = ReadHeapString(message, length); console.log(messageJS); }, + floor: Math.floor, + ceil: Math.ceil, + sqrt: Math.sqrt, + pow: Math.pow, + fmod: Math.fround, // Note: JavaScript doesn't have a native fmod function, so we use fround as a close approximation + cos: Math.cos, + acos: Math.acos, + fabs: Math.abs, // Note: JavaScript doesn't have a native fabs function, so we use abs as a close approximation + round: Math.round, }; const { instance } = await WebAssembly.instantiateStreaming( @@ -63,7 +72,7 @@ async function main() canvas.width = width; canvas.height = height; - const buffer_address = instance.exports.Buffer.value; + const buffer_address = instance.exports.GlobalImageBuffer.value; const image = new ImageData( new Uint8ClampedArray(instance.exports.memory.buffer, buffer_address, -- cgit v1.2.3-70-g09d2