Open jumpjack opened 1 year ago
Good idea. I'll try to do this ASAP. I need to merge changes from the main branch as well.
In the meantime I found a method to load local files from user's PC:
https://jumpjack.github.io/oricutronJS/
I see there are two DBs, "/readwritefs" and "emscripten_filesystem", but the second one is apparently never used by the emulator, so I just ignore it.
It doesn't work on Chrome on a Mac. What browser did you test it on ?
We can talk about this here: https://forum.defence-force.org/viewtopic.php?p=27823#p27823 In order not to pollute all contributors mail boxes.
Replacing "fetch->url" in these lines:
https://github.com/pete-gordon/oricutron/blob/075c517a15ff15dfa8424dd7f88b6baf5cd486e7/main.c#L1793
https://github.com/pete-gordon/oricutron/blob/075c517a15ff15dfa8424dd7f88b6baf5cd486e7/main.c#L1804
by just the filename if the string contains a remote url, would allow loading any remote file into the emulator. For example, the download of https://jumpjack.github.io/oricutronJS/space1999-en.dsk succeeds, but of course creation of emulator file
fails (but error is shown only in browser console, not in emulator console, where only the same messages of a valid download appear: "MFM DISK" and "STATUS 200").
Probably an alternative mode to use remote files in the emulator would be retrieving them from the web page and storing them into /readwritefs/ session storage key.... but I have no idea of how to do it. :-)
As a side note, probably this couple of lines should be moved before the "downloading file" message.