Open aebrer opened 2 years ago
First we'd need to track memory and CPU usage. :)
Well... those are definitely useful features, but not really what I'm asking about here.
Not trying to replicate the entire stat()
function, just the stat(6)
Would it be possible to emulate this somehow using memory banks? Maybe save a txt file, load it, store any variables it saves in a memory bank, then load the "real" cart and have access to the data that was written in the other cart?
No, carts can't read the filesystem (or other carts)... but outside of tic you could do all this with scripting, just open up the cart, write to it's own actual persistent memory block... then access that data inside TIC either with peek
or pmem
...
from the javascript that runs the emulator.
If all you care about is the browser environ you could probably look into hacking it's pmem
directly, assuming it's just stored in LocalStorage of some such, etc...
thanks :) that's awesome! I will poke around with that when I get some time!
the
stat()
function on the Pico-8 allows you to view a lot of system information, like memory or cpu usage, in real time, from within your cart. In particular,stat(6)
simply returns a string that can be passed in via the command-line argument-p
. This can be incredibly useful for defining a unique random seed from the javascript that runs the emulator.I've been reading through the issues, so I can understand if this isn't something that you want to implement, but I wanted to mention it anyway, as I would greatly enjoy it if I could use it.
Related: Would it be possible to emulate this somehow using memory banks? Maybe save a txt file, load it, store any variables it saves in a memory bank, then load the "real" cart and have access to the data that was written in the other cart?
thanks :)