Closed karlvr closed 7 months ago
Doesn't exist unfortunately.
It would be quite trivial to add (I did this in my older emulators which have an HTML UI overlay (https://floooh.github.io/virtualkc/), but didn't get around adding the same to the chips emulators.
@floooh thank you, I'm happy to have a crack at it. I'll take a look this weekend. If there are any other pointers you think would help me end up somewhere you're happy with (in case it turns into a PR?) let me know, otherwise I'll report back with what happens!
@floooh hiya, it's like half a year on and I didn't make any progress on this... I'm still interested though. Do you have a moment to give me a bit more of a pointer for adding this?
Right, in the meantime such a Javascript API exists, I added this when creating this VSCode extension:
https://marketplace.visualstudio.com/items?itemName=floooh.vscode-kcide
The basic C code to implement this "web API" is here:
https://github.com/floooh/chips-test/blob/master/examples/common/webapi.c
https://github.com/floooh/chips-test/blob/master/examples/common/webapi.h
...with a specific implementation for the KC85 emulators here:
...and the Javascript glue code between the VSCode extension and WASM emulator is here (this shows how to call C functions via Module._func_name()
:
@floooh thanks for the above, I'm able to make progress with it so I'll close up this issue.
Is there a JavaScript API that I can use to load a file when the user clicks a button? Or to type some text? I feel like there is or nearly is!