From f6eb6c2de9f5ecd2d73596b263787344f826ab9e Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Sat, 12 Oct 2024 14:12:46 -0700 Subject: [PATCH] got as file read sorta wokring --- cart/as/build.js | 3 +-- cart/as/src/assets/cyber.txt | 2 -- cart/as/src/main.ts | 6 +++--- null0_api/src/null0_api_wamr.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cart/as/build.js b/cart/as/build.js index 4ab9815..003219d 100644 --- a/cart/as/build.js +++ b/cart/as/build.js @@ -19,8 +19,7 @@ await writeFile('build/tmp.ts', (await readFile('null0.ts')) + '\n// user-code:\ const { error, stdout, stderr, stats } = await asc.main([ 'build/tmp.ts', // '--lowMemoryLimit', - '--initialMemory', '512', - '--maximumMemory', '512', + '--stackSize', '8092', '--runtime', 'stub', '--config', './node_modules/@assemblyscript/wasi-shim/asconfig.json', '--optimizeLevel', '3', diff --git a/cart/as/src/assets/cyber.txt b/cart/as/src/assets/cyber.txt index 69c97b4..8c8b365 100755 --- a/cart/as/src/assets/cyber.txt +++ b/cart/as/src/assets/cyber.txt @@ -1,3 +1 @@ Disposable voodoo god crypto-sensory corporation beef noodles sprawl human engine monofilament neural. Marketing sensory office footage Legba alcohol man hotdog modem-space sentient. Office sign futurity silent gang industrial grade post. Kanji pre-franchise meta-render-farm corrupted spook city shanty town claymore mine-ware systema savant plastic Shibuya fluidity grenade. Plastic jeans post-courier systema film network convenience store. Car engine rebar into weathered refrigerator Shibuya realism assault-space hacker pre-Kowloon footage media network pen. Cartel tanto sentient knife hotdog network market tank-traps crypto-range-rover towards. Dome shrine stimulate nodality katana meta-pen futurity math-receding. - -Sprawl DIY construct dolphin jeans-space fetishism gang Shibuya sunglasses market. Alcohol cyber-bomb dolphin soul-delay drone bridge into market convenience store render-farm BASE jump long-chain hydrocarbons pre-nodal point. Nodal point shoes skyscraper tiger-team convenience store stimulate papier-mache car katana. Skyscraper tank-traps shoes math-convenience store beef noodles face forwards assassin sub-orbital narrative semiotics weathered silent monofilament kanji RAF. Crypto-paranoid sensory uplink San Francisco rain knife systemic courier garage jeans. Military-grade shoes physical sensory cardboard geodesic Chiba semiotics motion futurity katana sprawl BASE jump. Bomb semiotics assassin A.I. 3D-printed augmented reality dolphin San Francisco meta. Systema tattoo construct neon into order-flow stimulate drugs 8-bit sign Legba. Fetishism cartel gang urban shrine nano-saturation point woman receding otaku monofilament 8-bit free-market rebar j-pop. diff --git a/cart/as/src/main.ts b/cart/as/src/main.ts index 6a04b21..0c5dcf1 100644 --- a/cart/as/src/main.ts +++ b/cart/as/src/main.ts @@ -8,10 +8,10 @@ export function load(): void { console.log(`Text-size: ${d.width.toString()}x${d.height.toString()}`) x = 160 - (d.width/2) y = 120 - (d.height/2) - const t = file_read("assets/cyber.txt") - // TODO: this currently spits out a bunch of extra bytes - console.log(String.UTF8.decode(t)) + const t = file_read("assets/cyber.txt") + trace(t.byteLength.toString()) + trace(String.UTF8.decode(t)) } // called on every frame diff --git a/null0_api/src/null0_api_wamr.h b/null0_api/src/null0_api_wamr.h index 0f65e07..29b4388 100755 --- a/null0_api/src/null0_api_wamr.h +++ b/null0_api/src/null0_api_wamr.h @@ -775,7 +775,7 @@ RuntimeInitArgs null0_init_args() { RuntimeInitArgs init_args; memset(&init_args, 0, sizeof(RuntimeInitArgs)); - static char global_heap_buf[512 * 1024]; + static char global_heap_buf[8092 * 8]; init_args.mem_alloc_type = Alloc_With_Pool; init_args.mem_alloc_option.pool.heap_buf = global_heap_buf; init_args.mem_alloc_option.pool.heap_size = sizeof(global_heap_buf);