1 |
|
/* |
2 |
|
* xpram_unix.cpp - XPRAM handling, Unix specific stuff |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2005 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[] = ".basilisk_ii_xpram"; |
33 |
+ |
#endif |
34 |
|
static char xpram_path[1024]; |
35 |
|
|
36 |
|
|
52 |
|
// Load XPRAM from settings file |
53 |
|
int fd; |
54 |
|
if ((fd = open(xpram_path, O_RDONLY)) >= 0) { |
55 |
< |
read(fd, XPRAM, 256); |
55 |
> |
read(fd, XPRAM, XPRAM_SIZE); |
56 |
|
close(fd); |
57 |
|
} |
58 |
|
} |
66 |
|
{ |
67 |
|
int fd; |
68 |
|
if ((fd = open(xpram_path, O_WRONLY | O_CREAT, 0666)) >= 0) { |
69 |
< |
write(fd, XPRAM, 256); |
69 |
> |
write(fd, XPRAM, XPRAM_SIZE); |
70 |
|
close(fd); |
71 |
|
} |
72 |
|
} |