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; |