ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/xpram_unix.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/xpram_unix.cpp (file contents):
Revision 1.5 by cebix, 2001-10-07T19:50:21Z vs.
Revision 1.10 by asvitkine, 2009-07-23T19:19:14Z

# Line 1 | Line 1
1   /*
2   *  xpram_unix.cpp - XPRAM handling, Unix specific stuff
3   *
4 < *  Basilisk II (C) 1997-2001 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
# Line 38 | Line 38 | static char xpram_path[1024];
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines