3 ms·
Sounds awesome. I have some abstractions for making interfacing easier, but I don't have any auto-generated structures. https://github.com/fwsGonzo/rvscript ht
by fwsgonzo 6y ago
Sounds awesome. I have some abstractions for making interfacing easier, but I don't have any auto-generated structures.
https://github.com/fwsGonzo/rvscript https://github.com/fwsGonzo/rvscript
I have done that here. Example:
APICALL(api_math_smoothstep)
{
auto [edge0, edge1, x] = machine.sysargs <float, float, float> ();
x = std::clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f);
machine.cpu.registers().getfl(10).set_float(x * x * (3 - 2 * x));
return 0;
}
"machine" is an argument to each system call handler, so you can have multiple machines for many purposes. For example, I suspect you can use a machine as a savegame - because they are serializable.
- whizzter 6y agoOh! So the emulator i was looking at was yours, it looked damn nice for just this task and i guess i know why now :D Good choice on using var-arg-templates for passing arguments between env and host, i think moving over all scripting bindings to va-templatized bindings is the only sane option for the future (boy have i spent time fighting binding bugs in my days)