Compare commits

..

No commits in common. "aa9f112de3483c2284f255eed275ed557ad173a7" and "3176aa887df7f9f98057dcf87ac467618fd6640d" have entirely different histories.

4 changed files with 912 additions and 1086 deletions

View File

@ -47,10 +47,6 @@ prefs_desc platform_prefs_items[] = {
{NULL, TYPE_END, false, NULL} // End of list
};
#ifdef __linux__
// Standard file names and paths
#ifdef SHEEPSHAVER
static const char PREFS_FILE_NAME[] = "/.sheepshaver_prefs";
@ -189,9 +185,9 @@ void LoadPrefs(const char* vmdir)
}
// No prefs file, save defaults in $XDG_CONFIG_HOME directory
//#ifdef __linux__
#ifdef __linux__
PrefsAddString("cdrom", "/dev/cdrom");
//#endif
#endif
printf("No prefs file found, creating new one at %s\n", prefs_name.c_str());
SavePrefs();
}
@ -254,82 +250,6 @@ void SavePrefs(void)
}
}
#else // __linux__
// Prefs file name and path
#ifdef SHEEPSHAVER
static const char PREFS_FILE_NAME[] = ".sheepshaver_prefs";
#else
static const char PREFS_FILE_NAME[] = ".basilisk_ii_prefs";
#endif
string UserPrefsPath;
static string prefs_path;
/*
* Load preferences from settings file
*/
void LoadPrefs(const char *vmdir)
{
if (vmdir) {
prefs_path = string(vmdir) + '/' + string("prefs");
FILE *prefs = fopen(prefs_path.c_str(), "r");
if (!prefs) {
printf("No file at %s found.\n", prefs_path.c_str());
exit(1);
}
LoadPrefsFromStream(prefs);
fclose(prefs);
return;
}
// Construct prefs path
if (UserPrefsPath.empty()) {
char *home = getenv("HOME");
if (home)
prefs_path = string(home) + '/';
prefs_path += PREFS_FILE_NAME;
} else
prefs_path = UserPrefsPath;
// Read preferences from settings file
FILE *f = fopen(prefs_path.c_str(), "r");
if (f != NULL) {
// Prefs file found, load settings
LoadPrefsFromStream(f);
fclose(f);
} else {
//#ifdef __linux__
// PrefsAddString("cdrom", "/dev/cdrom");
//#endif
// No prefs file, save defaults
SavePrefs();
}
}
/*
* Save preferences to settings file
*/
void SavePrefs(void)
{
FILE *f;
if ((f = fopen(prefs_path.c_str(), "w")) != NULL) {
SavePrefsToStream(f);
fclose(f);
}
}
#endif // __linux__
/*
* Add defaults of platform-specific prefs items
* You may also override the defaults set in PrefsInit()

View File

@ -25,10 +25,6 @@ using std::string;
#include "xpram.h"
#ifdef __linux__
// XPRAM file name, set by LoadPrefs() in prefs_unix.cpp
string xpram_name;
@ -77,85 +73,3 @@ void ZapPRAM(void)
assert(!xpram_name.empty());
unlink(xpram_name.c_str());
}
#else // __linux__
// XPRAM file name and path
#if POWERPC_ROM
const char XPRAM_FILE_NAME[] = ".sheepshaver_nvram";
#else
const char XPRAM_FILE_NAME[] = ".basilisk_ii_xpram";
#endif
static char xpram_path[1024];
/*
* Load XPRAM from settings file
*/
void LoadXPRAM(const char *vmdir)
{
if (vmdir) {
#if POWERPC_ROM
snprintf(xpram_path, sizeof(xpram_path), "%s/nvram", vmdir);
#else
snprintf(xpram_path, sizeof(xpram_path), "%s/xpram", vmdir);
#endif
} else {
// Construct XPRAM path
xpram_path[0] = 0;
char *home = getenv("HOME");
if (home != NULL && strlen(home) < 1000) {
strncpy(xpram_path, home, 1000);
strcat(xpram_path, "/");
}
strcat(xpram_path, XPRAM_FILE_NAME);
}
// Load XPRAM from settings file
int fd;
if ((fd = open(xpram_path, O_RDONLY)) >= 0) {
read(fd, XPRAM, XPRAM_SIZE);
close(fd);
}
}
/*
* Save XPRAM to settings file
*/
void SaveXPRAM(void)
{
int fd;
if ((fd = open(xpram_path, O_WRONLY | O_CREAT, 0666)) >= 0) {
write(fd, XPRAM, XPRAM_SIZE);
close(fd);
}
}
/*
* Delete PRAM file
*/
void ZapPRAM(void)
{
// Construct PRAM path
xpram_path[0] = 0;
char *home = getenv("HOME");
if (home != NULL && strlen(home) < 1000) {
strncpy(xpram_path, home, 1000);
strcat(xpram_path, "/");
}
strcat(xpram_path, XPRAM_FILE_NAME);
// Delete file
unlink(xpram_path);
}
#endif // __linux__

View File

@ -1263,11 +1263,9 @@ EOF
fi
fi
case "$host" in
arm-apple-*)
AC_DEFINE_UNQUOTED(NATMEM_OFFSET, 0x400000000000, [Define constant offset for Mac address translation])
;;
esac
if [[ "$target_cpu" = "arm" -o "$target_cpu" = "aarch64" ]]; then
AC_DEFINE_UNQUOTED(NATMEM_OFFSET, 0x400000000000, [Define constant offset for Mac address translation])
fi
AC_MSG_RESULT($WANT_ADDRESSING_MODE)

File diff suppressed because it is too large Load Diff