mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-06-09 16:29:30 +00:00
9128314cb8
SDL 1.x is used for display, rather than Mac OS X specific backend. If time permits, I'll port it to SDL 2, if only to reduce Basilisk's overall code foot-print. Lots of features are apt to be disabled, as many 'dummy' backends were used. Video-depths other than 1-bit or 32-bit are untested, and in some cases (4-bit, at least) are currently non-functional. This is due to a partial re-write of the SDL backend's blitting code, which was non-functional when low-bit-depths were used. The SDL backend was also rewired, on OSX, to not attempt to align the display buffer on page-boundaries. So far, this doesn't seem to cause any notice-able problems, however, that's only using limited knowledge and testing (System 7.5.x does boot and display at 640x480, though!). The original display-buffer allocation code was failing to run, in some cases. Preferences are, on Mac, currently hardcoded to be accessed at /tmp/BasiliskII/BasiliskII_Prefs. The folder, "/tmp/BasiliskII/", may be a symbolic link to elsewhere, though.
90 lines
2.0 KiB
C++
90 lines
2.0 KiB
C++
/*
|
|
* prefs_dummy.cpp - Preferences handling, dummy implementation
|
|
*
|
|
* Basilisk II (C) 1997-2008 Christian Bauer
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#include "sysdeps.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string>
|
|
|
|
#include "prefs.h"
|
|
|
|
|
|
// Platform-specific preferences items
|
|
prefs_desc platform_prefs_items[] = {
|
|
{NULL, TYPE_END, false} // End of list
|
|
};
|
|
|
|
|
|
// Prefs file name and path
|
|
#if defined(__APPLE__) && defined(__MACH__)
|
|
const char PREFS_FILE_NAME[] = "/tmp/BasiliskII/BasiliskII_Prefs"; // HACK: for now, just load stuff from a fixed dir, inside /tmp
|
|
#else
|
|
const char PREFS_FILE_NAME[] = "BasiliskII_Prefs";
|
|
#endif
|
|
|
|
std::string UserPrefsPath;
|
|
|
|
|
|
/*
|
|
* Load preferences from settings file
|
|
*/
|
|
|
|
void LoadPrefs(const char * vmdir) // TODO: load prefs from 'vmdir'
|
|
{
|
|
// Read preferences from settings file
|
|
FILE *f = fopen(PREFS_FILE_NAME, "r");
|
|
if (f != NULL) {
|
|
|
|
// Prefs file found, load settings
|
|
LoadPrefsFromStream(f);
|
|
fclose(f);
|
|
|
|
} else {
|
|
|
|
// No prefs file, save defaults
|
|
SavePrefs();
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
* Save preferences to settings file
|
|
*/
|
|
|
|
void SavePrefs(void)
|
|
{
|
|
FILE *f;
|
|
if ((f = fopen(PREFS_FILE_NAME, "w")) != NULL) {
|
|
SavePrefsToStream(f);
|
|
fclose(f);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
* Add defaults of platform-specific prefs items
|
|
* You may also override the defaults set in PrefsInit()
|
|
*/
|
|
|
|
void AddPlatformPrefsDefaults(void)
|
|
{
|
|
}
|