Picotron Playground -- an experimental web-based edition of my WIP Fantasy Workstation -- is OUT NOW! It includes a code editor and terminal program for poking around some demos of the #picotron API and runtime.
Picotron Playground -- an experimental web-based edition of my WIP Fantasy Workstation -- is OUT NOW! It includes a code editor and terminal program for poking around some demos of the #picotron API and runtime.
@zep I need to find how to properly use the 64 colors but meanwhile, looks like I made something work on Picotron! :P
EDIT : nevermind, instead of *16, just use *256. Got to port it and make it look as good as the original now!
@zep Hey, are you be fine with us also peeking around in the system folder.
Was able to write a small crappy script that show the content of "/system/tools/code.lua" for example. Mind if I would share this.
Or is there even a build in tool like less or cat to inspect those files. ... vim on picotron... oh the possibilities ... I'm a bit excited... :D
@ztiromoritz sure, np! Note that there is a lot of placeholder stuff in there though.
There isn't cat etc. yet but of course there will be :)
@ztiromoritz I just realised.. you can use /system/tools/code.lua for that too:
$ /system/tools/code /system/util/mkdir.lua
@zep haha, I missed this combination, after $ load system/api.lua
did not work.
The scripts that are directly in system/ seemed to be on the PATH. But not code.lua So I stopped there. And took a hard look at the js bundle which includes the files and learned some api from there to write my script.
@zep tline3d documentation is incorrect!
doc:
tline3d(src, x0, y0, x1, y1, u0, v0, u1, v1, [w0, w1])
code (works):
tline3d(src, x0, y0, x1, y1, u0, u1, v0, v1, [w0, w1])
this is inconsistent with x/y parameters ordering!
@fsouchu The documented order is indeed the intended one (u0, v0, u1, v1) but I might have a blind spot for why the behavior is wrong. e.g. why does this work in highway.p64?
tline3d(ss, sx, 270, sx, 50, (x+vx*z0)/z0, (y+vy*z0)/z0, (x+vx*z1)/z1, (y+vy*z1)/z1, 1.0/z0, 1.0/z1)
@zep crash drawing long lines (educated guess - will do repro later)
Uncaught RuntimeError: memory access out of bounds
at 001f2e56:0x27e90
at 001f2e56:0x147a0
at 001f2e56:0x77e4f
at Module.dynCall_vii (p64_playground_5.js:1:1181814)
at invoke_vii (p64_playground_5.js:1:1177064)
at 001f2e56:0x1342e
at 001f2e56:0x144d5
at 001f2e56:0x43139
at 001f2e56:0x4276b
at 001f2e56:0x1434b
@zep Picotron v7 raises an error on nil table iterator. Expected?
for i,v in pairs(nil) do
end
>>bad argument #1...
@fsouchu Which browser / OS are you using? I tried v7 under [Win10 | Lubuntu] x [Chrome | Firefox | Edge] but couldn't reproduce yet. Note that you might need to grant permission depending on the browser.
I have no doubt that the clipboard doesn't work across all browsers though! (am using the newish browser API as I can't get away with the same tricks that PICO-8 uses).
@fsouchu There will be built-in cross-multiply, dot product etc. for f64 userdata, but I'm not sure of the basic syntax yet. I like:
v = userdata("f64", 3)
?v.x -- means get(v,0) or v[0]
v += v2 -- add v2 to v
But on trying some toy programs, it just feels too weird without being allowed components on the LHS, which is difficult (and maybe ill-advised?) to wrangle in Lua's implementation:
v.x = 3 -- surely!
v[0] = 3