Hmm... how is it getting the value for HOME? I may want to leverage that to enable setting HOME in the config/prefs file.
If I get some time I'll try creating a patch for kanjitalk755 fork; but if someone else has time to add that in the next few weeks, I wouldn't object
[edit] Hmm; I don't think that's the only place HOME is checked/set, but it appears to be calling it via SDL. But... it's checking to see if vmdir is set.
Which means, it should be possible to set vmdir somewhere else.
[edit2]
https://github.com/emaculation/macemu/b ... dl.cpp#L32
Code: Select all
void SaveXPRAM(void)
{
// Build a full-path to the file
char full_path[4096];
const char *dir = SDL_getenv("HOME");
if (!dir) {
dir = "./";
}
SDL_snprintf(full_path, sizeof(full_path), "%s/%s", dir, XPRAM_FILE_NAME);
// Save the XPRAM file
FILE *f = fopen(XPRAM_FILE_NAME, "wb");
if (f != NULL) {
fwrite(XPRAM, 256, 1, f);
fclose(f);
}
}
Yeah; instead of setting a single value somewhere in code and referencing that variable/constant in a sane way, the BII/SS code does SDL_getenv("HOME"); all over the place. And unlike for the config file, for the XPRAM file, there's no check for vmdir -- only a check for if the dir exists after attempting to set it via SDL_getenv. This means that bugs abound, as you could save the XPRAM and have it work everything out, but then have something change in the environment while the emulator is running and suddenly the file can't be saved/deleted/loaded anymore, but is written to wherever ./ happens to be, even though it's still there at ~/.basilisk_ii_xpram.
[edit3] Hah! Based on that code, I tried something, and it worked!
I added the following line to my config file:
And now with that, after the initial config (which is passed from the command line, all prefs and xpram values read/write to ./, which is the folder in which BasiliskII.app is run!
[edit4] ...or not. Looking at timestamps, it's still trying to write to the one in ~/ -- I KNOW I've fixed this before (which is where the local copy of the xpram came from)....