Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to download data from within the emulated OS #20

Open
jywarren opened this issue May 7, 2020 · 2 comments
Open

Ability to download data from within the emulated OS #20

jywarren opened this issue May 7, 2020 · 2 comments

Comments

@jywarren
Copy link

jywarren commented May 7, 2020

In #5 @dluciv explored ways to upload data into the emulated OS, and there are some working examples. I'm curious about the opposite; if, say, we create a HyperCard stack inside the emulator, could we copy it onto a disk and then download the disk in the browser environment?

@DrJosh9000 as you seem to have set up the very cool https://hypercardadventures.com/ with the ability to upload a disk at runtime, maybe you had thoughts about downloading data too? Thanks, all.

@DrJosh9000
Copy link
Contributor

So, loading/saving disk images on HCA wasn't a huge feat of hacks, just:

(a) coming up with a decent UI for letting the user load and save files to JS memory
(b) the emscripten file API allowing exchange between JS memory and the emscripten filesystem, and
(c) there being a command interface in PCE, which I augmented with some C-side helpers and exported to emscripten

The real trick would be reading and writing individual files (like how Mini vMac has its ImportFl / ExportFl tools), but I didn't get far into the Mini vMac source last time I went looking. Also quirks get in the way of vintage files working in the modern world (legacy encodings, resource forks). Disk images are at least a bit more portable.

@jsdf
Copy link
Owner

jsdf commented May 22, 2020

This would be much easier to do with my BasiliskII port, as BasiliskII already has the functionality of exposing the host OS filesystem to the emulator: https://github.com/jsdf/macemu

Once you can transfer files to or from the host filesystem, it's just a matter of using the Emscripten filesystem APIs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants