Repository navigation
Improved D template - #1891
Improved D template#1891
Conversation
| "--strip-all", | ||
| "--allow-undefined", | ||
| "--stack-first", | ||
| "--no-entry" |
There was a problem hiding this comment.
We also need to pull over:
"--initial-memory=65536",
"--max-memory=65536",
"-zstack-size=14752"
But with TIC-80 specific values, which I think would mean 256kb memory and 96kb "reserved"... which I THINK means stack-size should be 96*1024 + 8 * 1024 (assuming we want an 8kb actual stack)... does that sound right? With the stack growing downwards from 96kb+8kb, sicne we're using --stack-first.
There was a problem hiding this comment.
Let me run some tests with the numbers.
There was a problem hiding this comment.
So the numbers for TIC-80 would be, for 8k actual stack:
"--initial-memory=262144",
"--max-memory=262144",
"-zstack-size=106496"
There was a problem hiding this comment.
Did we ever get this changed?
| #!/bin/sh | ||
| make clean | ||
| make | ||
| tic80 --fs . --cmd 'load wasmdemo.wasmp & import binary cart.wasm & run & exit' |
There was a problem hiding this comment.
Just me, but nothing about build to me implies "run" also... I think perhaps we need build_and_run or something...? Thoughts?
There was a problem hiding this comment.
I'm fine calling it build_and_run. As is typical, this started out with the make commands, and then I added the tic80 command line too to run. As the README states, these are just convenience scripts.
| const PERSISTENT_MEMORY_PTR = cast(ubyte*)0x14004; | ||
| const SPRITE_FLAGS_PTR = cast(ubyte*)0x14404; | ||
| const SYSTEM_FONT_PTR = cast(ubyte*)0x14604; | ||
| const WASM_FREE_RAM_PTR = cast(ubyte*)0x18000; |
There was a problem hiding this comment.
Do you really think we should provide this out of the box? Does D not allocate globals and such things starting here automatically? (like C)
There was a problem hiding this comment.
I suppose you are referring to WASM_FREE_RAM_PTR? Since TIC-80 allows peeking and poking anywhere, I put this in as well. But yes, generally the game programmer will leave to D to manage memory.
There was a problem hiding this comment.
I know. I'm just not sure we want to encourage this. Someone who knows what they are doing can add that line to their own source easily enough without us including it in the core examples. And if they do not know what they are doing they probably shouldn't be using WASM_FREE_RAM_PTR in the first place...
Thoughts?
There was a problem hiding this comment.
Let's leave it out then.
| make clean | ||
| make | ||
| tic80 --fs . --cmd 'load wasmdemo.wasmp & import binary cart.wasm & save game.tic & exit' | ||
| tic80 --fs . --cmd 'load game.tic & run & exit' |
There was a problem hiding this comment.
Why do we need to invoke tic80 twice vs doing it all in a single session?
There was a problem hiding this comment.
My intention is to demonstrate the two separate actions -- creating a .tic file from necessary artifacts, and running the .tic directly without reference to said artifacts -- for the programmer who is new to this console.
|
I OK with the PR, @joshgoebel please let me know when we are ready to merge. |
Fixes #1888.