1 |
|
/* |
2 |
|
* xpram_unix.cpp - XPRAM handling, Unix specific stuff |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2002 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2008 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
38 |
|
* Load XPRAM from settings file |
39 |
|
*/ |
40 |
|
|
41 |
< |
void LoadXPRAM(void) |
41 |
> |
void LoadXPRAM(const char *vmdir) |
42 |
|
{ |
43 |
< |
// Construct XPRAM path |
44 |
< |
xpram_path[0] = 0; |
45 |
< |
char *home = getenv("HOME"); |
46 |
< |
if (home != NULL && strlen(home) < 1000) { |
47 |
< |
strncpy(xpram_path, home, 1000); |
48 |
< |
strcat(xpram_path, "/"); |
43 |
> |
if (vmdir) { |
44 |
> |
#if POWERPC_ROM |
45 |
> |
snprintf(xpram_path, sizeof(xpram_path), "%s/nvram", vmdir); |
46 |
> |
#else |
47 |
> |
snprintf(xpram_path, sizeof(xpram_path), "%s/xpram", vmdir); |
48 |
> |
#endif |
49 |
> |
} else { |
50 |
> |
// Construct XPRAM path |
51 |
> |
xpram_path[0] = 0; |
52 |
> |
char *home = getenv("HOME"); |
53 |
> |
if (home != NULL && strlen(home) < 1000) { |
54 |
> |
strncpy(xpram_path, home, 1000); |
55 |
> |
strcat(xpram_path, "/"); |
56 |
> |
} |
57 |
> |
strcat(xpram_path, XPRAM_FILE_NAME); |
58 |
|
} |
50 |
– |
strcat(xpram_path, XPRAM_FILE_NAME); |
59 |
|
|
60 |
|
// Load XPRAM from settings file |
61 |
|
int fd; |