Skip to content

json_preconfig

mithrendal edited this page Nov 11, 2021 · 6 revisions

for more complex preconfiguration scenarios it turned out, that the hash separated #key=value pair notation was a bit limited. Especially when configuring collections or nested objects.

JSON is now another great way to express preconfiguration in vc64web. What we can do more with it is described in preconfig of scripts and buttons

basically we can express all previous settings as in the hash separated key value pair notation. Plus we can now define action buttons with action scripts ... even autorun scripts are possible that start background scripts which in turn can provide input/output data interaction of the emulated C64 with the internet.

one exception is the hashtag preconfig for the second SID ... as 2ndSID is no valid JSON key we had to alter it to so #2ndSID=d420 is in JSON now {"_2ndSID":"d420"}

example of auto starting

https://vc64web.github.io/#{"openROMS":true,"wide":true,"border":false,"url":"http://csdb.dk/getinternalfile.php/205484/elite-code-mechanics.prg"}

example of an autorun script

https://vc64web.github.io/#{"openROMS":true,"buttons":[{"run":true,"script":"await%20wasm_ready_after_reset();action(`'helloworld'`)"}]}

Clone this wiki locally