samples: fix console output in pi example for Wasm BE

This commit is contained in:
Alexey Andreev 2024-09-19 20:41:12 +02:00
parent 6613d379ec
commit 28c64ef7d8

View File

@ -37,8 +37,9 @@
let memory = new Int8Array(instance.exports.memory.buffer); let memory = new Int8Array(instance.exports.memory.buffer);
let string = ""; let string = "";
for (let i = 0; i < count; ++i) { for (let i = 0; i < count; ++i) {
string += $rt_putStdoutCustom(memory[address++]); string += String.fromCharCode(memory[address++]);
} }
$rt_putStdoutCustom(string);
} }
o.teavm.putwcharsOut = putwchars; o.teavm.putwcharsOut = putwchars;
o.teavm.putwcharsErr = putwchars; o.teavm.putwcharsErr = putwchars;