1 |
|
/* |
2 |
|
* xpram_beos.cpp - XPRAM handling, BeOS specific stuff |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 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 |
26 |
|
|
27 |
|
|
28 |
|
// XPRAM file name and path |
29 |
+ |
#if POWERPC_ROM |
30 |
+ |
const char XPRAM_FILE_NAME[] = "SheepShaver_NVRAM"; |
31 |
+ |
#else |
32 |
|
const char XPRAM_FILE_NAME[] = "BasiliskII_XPRAM"; |
33 |
+ |
#endif |
34 |
|
static BPath xpram_path; |
35 |
|
|
36 |
|
|
38 |
|
* Load XPRAM from settings file |
39 |
|
*/ |
40 |
|
|
41 |
< |
void LoadXPRAM(void) |
41 |
> |
void LoadXPRAM(const char *vmdir) |
42 |
|
{ |
43 |
|
// Construct XPRAM path |
44 |
|
find_directory(B_USER_SETTINGS_DIRECTORY, &xpram_path, true); |
47 |
|
// Load XPRAM from settings file |
48 |
|
int fd; |
49 |
|
if ((fd = open(xpram_path.Path(), O_RDONLY)) >= 0) { |
50 |
< |
read(fd, XPRAM, 256); |
50 |
> |
read(fd, XPRAM, XPRAM_SIZE); |
51 |
|
close(fd); |
52 |
|
} |
53 |
|
} |
62 |
|
if (xpram_path.InitCheck() != B_NO_ERROR) |
63 |
|
return; |
64 |
|
int fd; |
65 |
< |
if ((fd = open(xpram_path.Path(), O_WRONLY | O_CREAT, 0664)) >= 0) { |
66 |
< |
write(fd, XPRAM, 256); |
65 |
> |
if ((fd = open(xpram_path.Path(), O_WRONLY | O_CREAT, 0666)) >= 0) { |
66 |
> |
write(fd, XPRAM, XPRAM_SIZE); |
67 |
|
close(fd); |
68 |
|
} |
69 |
|
} |