mirror of https://github.com/stella-emu/stella.git
Made all statefiles be named according to their romname as given in
the properties file (instead of using md5sum). The md5sum naming is no longer needed, and made it very difficult for users to distribute the state files. Similar to above, removed ability to name snapshots according to md5sum, and instead use romname. Consequently, removed all references to 'ssname' commandline argument and GUI related config options. Added ability to specify a different 'base directory' for settings, state files, etc. Normally, this is chosen at compile time, and is set to $HOME/.stella/ for Linux and OSX, and the current dir for Win32. Now, if you set the 'STELLA_BASEDIR' environment variable, it will use that path instead. Note that this must be set every time Stella is run, since there's no way to save it to a settings file (since the settings file location is dependent on what the env var contains). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1147 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
8757c935c2
commit
76eb15a8be
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: mainSDL.cxx,v 1.66 2006-10-22 18:58:45 stephena Exp $
|
// $Id: mainSDL.cxx,v 1.67 2006-11-13 00:21:40 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
@ -85,23 +85,29 @@ int SDL_main(int argc, char* argv[])
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
// Get the base directory for storing all Stella settings/statefiles/etc
|
||||||
|
// This can't be stored in the actual settings file for obvious reasons,
|
||||||
|
// so we get it from an environment var (if it exists)
|
||||||
|
const char* bd_ptr = SDL_getenv("STELLA_BASEDIR");
|
||||||
|
const string& basedir = bd_ptr ? string(bd_ptr) : "";
|
||||||
|
|
||||||
// Create the parent OSystem object and settings
|
// Create the parent OSystem object and settings
|
||||||
#if defined(UNIX)
|
#if defined(UNIX)
|
||||||
theOSystem = new OSystemUNIX();
|
theOSystem = new OSystemUNIX(basedir);
|
||||||
SettingsUNIX settings(theOSystem);
|
SettingsUNIX settings(theOSystem);
|
||||||
#elif defined(WIN32)
|
#elif defined(WIN32)
|
||||||
theOSystem = new OSystemWin32();
|
theOSystem = new OSystemWin32(basedir);
|
||||||
SettingsWin32 settings(theOSystem);
|
SettingsWin32 settings(theOSystem);
|
||||||
#elif defined(MAC_OSX)
|
#elif defined(MAC_OSX)
|
||||||
theOSystem = new OSystemMACOSX();
|
theOSystem = new OSystemMACOSX(basedir);
|
||||||
SettingsMACOSX settings(theOSystem);
|
SettingsMACOSX settings(theOSystem);
|
||||||
#elif defined(GP2X)
|
#elif defined(GP2X)
|
||||||
theOSystem = new OSystemGP2X();
|
theOSystem = new OSystemGP2X(basedir);
|
||||||
SettingsGP2X settings(theOSystem);
|
SettingsGP2X settings(theOSystem);
|
||||||
#elif defined(PSP)
|
#elif defined(PSP)
|
||||||
fprintf(stderr,"---------------- Stderr Begins ----------------\n");
|
fprintf(stderr,"---------------- Stderr Begins ----------------\n");
|
||||||
fprintf(stdout,"---------------- Stdout Begins ----------------\n");
|
fprintf(stdout,"---------------- Stdout Begins ----------------\n");
|
||||||
theOSystem = new OSystemPSP();
|
theOSystem = new OSystemPSP(basedir);
|
||||||
SettingsPSP settings(theOSystem);
|
SettingsPSP settings(theOSystem);
|
||||||
#else
|
#else
|
||||||
#error Unsupported platform!
|
#error Unsupported platform!
|
||||||
|
@ -136,7 +142,7 @@ int main(int argc, char* argv[])
|
||||||
// Request that the SDL window be centered, if possible
|
// Request that the SDL window be centered, if possible
|
||||||
// At some point, this should be properly integrated into the UI
|
// At some point, this should be properly integrated into the UI
|
||||||
if(theOSystem->settings().getBool("center"))
|
if(theOSystem->settings().getBool("center"))
|
||||||
putenv("SDL_VIDEO_CENTERED=1");
|
SDL_putenv("SDL_VIDEO_CENTERED=1");
|
||||||
|
|
||||||
//// Main loop ////
|
//// Main loop ////
|
||||||
// First we check if a ROM is specified on the commandline. If so, and if
|
// First we check if a ROM is specified on the commandline. If so, and if
|
||||||
|
@ -162,7 +168,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
// Set up any breakpoint that was on the command line
|
// Set up any breakpoint that was on the command line
|
||||||
// (and remove the key from the settings, so they won't get set again)
|
// (and remove the key from the settings, so they won't get set again)
|
||||||
string initBreak = theOSystem->settings().getString("break");
|
const string& initBreak = theOSystem->settings().getString("break");
|
||||||
if(initBreak != "")
|
if(initBreak != "")
|
||||||
{
|
{
|
||||||
int bp = dbg.stringToValue(initBreak);
|
int bp = dbg.stringToValue(initBreak);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EventHandler.cxx,v 1.169 2006-11-10 06:14:14 stephena Exp $
|
// $Id: EventHandler.cxx,v 1.170 2006-11-13 00:21:40 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -2033,9 +2033,12 @@ inline bool EventHandler::isJitter(int paddle, int value)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void EventHandler::saveState()
|
void EventHandler::saveState()
|
||||||
{
|
{
|
||||||
string md5 = myOSystem->console().properties().get(Cartridge_MD5);
|
const string& name = myOSystem->console().properties().get(Cartridge_Name);
|
||||||
|
const string& md5 = myOSystem->console().properties().get(Cartridge_MD5);
|
||||||
|
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
buf << myOSystem->stateDir() << BSPF_PATH_SEPARATOR << md5 << ".st" << myLSState;
|
buf << myOSystem->stateDir() << BSPF_PATH_SEPARATOR
|
||||||
|
<< name << ".st" << myLSState;
|
||||||
|
|
||||||
// Make sure the file can be opened for writing
|
// Make sure the file can be opened for writing
|
||||||
Serializer out;
|
Serializer out;
|
||||||
|
@ -2052,8 +2055,8 @@ void EventHandler::saveState()
|
||||||
buf << "State " << myLSState << " saved";
|
buf << "State " << myLSState << " saved";
|
||||||
if(myOSystem->settings().getBool("autoslot"))
|
if(myOSystem->settings().getBool("autoslot"))
|
||||||
{
|
{
|
||||||
buf << ", switching to slot " << (myLSState+1) % 10;
|
|
||||||
changeState(false); // don't show a message for state change
|
changeState(false); // don't show a message for state change
|
||||||
|
buf << ", switching to slot " << myLSState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2087,9 +2090,12 @@ void EventHandler::changeState(bool show)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void EventHandler::loadState()
|
void EventHandler::loadState()
|
||||||
{
|
{
|
||||||
string md5 = myOSystem->console().properties().get(Cartridge_MD5);
|
const string& name = myOSystem->console().properties().get(Cartridge_Name);
|
||||||
|
const string& md5 = myOSystem->console().properties().get(Cartridge_MD5);
|
||||||
|
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
buf << myOSystem->stateDir() << BSPF_PATH_SEPARATOR << md5 << ".st" << myLSState;
|
buf << myOSystem->stateDir() << BSPF_PATH_SEPARATOR
|
||||||
|
<< name << ".st" << myLSState;
|
||||||
|
|
||||||
// Make sure the file can be opened for reading
|
// Make sure the file can be opened for reading
|
||||||
Deserializer in;
|
Deserializer in;
|
||||||
|
@ -2126,16 +2132,11 @@ void EventHandler::takeSnapshot()
|
||||||
// Figure out the correct snapshot name
|
// Figure out the correct snapshot name
|
||||||
string filename;
|
string filename;
|
||||||
string sspath = myOSystem->settings().getString("ssdir");
|
string sspath = myOSystem->settings().getString("ssdir");
|
||||||
string ssname = myOSystem->settings().getString("ssname");
|
|
||||||
|
|
||||||
if(sspath.length() > 0)
|
if(sspath.length() > 0)
|
||||||
if(sspath.substr(sspath.length()-1) != BSPF_PATH_SEPARATOR)
|
if(sspath.substr(sspath.length()-1) != BSPF_PATH_SEPARATOR)
|
||||||
sspath += BSPF_PATH_SEPARATOR;
|
sspath += BSPF_PATH_SEPARATOR;
|
||||||
|
|
||||||
if(ssname == "romname")
|
|
||||||
sspath += myOSystem->console().properties().get(Cartridge_Name);
|
sspath += myOSystem->console().properties().get(Cartridge_Name);
|
||||||
else if(ssname == "md5sum")
|
|
||||||
sspath += myOSystem->console().properties().get(Cartridge_MD5);
|
|
||||||
|
|
||||||
// Check whether we want multiple snapshots created
|
// Check whether we want multiple snapshots created
|
||||||
if(!myOSystem->settings().getBool("sssingle"))
|
if(!myOSystem->settings().getBool("sssingle"))
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Settings.cxx,v 1.89 2006-11-08 00:09:53 stephena Exp $
|
// $Id: Settings.cxx,v 1.90 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -73,7 +73,6 @@ Settings::Settings(OSystem* osystem)
|
||||||
setInternal("showinfo", "false");
|
setInternal("showinfo", "false");
|
||||||
|
|
||||||
setInternal("ssdir", "");
|
setInternal("ssdir", "");
|
||||||
setInternal("ssname", "romname");
|
|
||||||
setInternal("sssingle", "false");
|
setInternal("sssingle", "false");
|
||||||
|
|
||||||
setInternal("romdir", "");
|
setInternal("romdir", "");
|
||||||
|
@ -266,10 +265,6 @@ void Settings::validate()
|
||||||
s = getString("palette");
|
s = getString("palette");
|
||||||
if(s != "standard" && s != "original" && s != "z26")
|
if(s != "standard" && s != "original" && s != "z26")
|
||||||
setInternal("palette", "standard");
|
setInternal("palette", "standard");
|
||||||
|
|
||||||
s = getString("ssname");
|
|
||||||
if(s != "romname" && s != "md5sum")
|
|
||||||
setInternal("ssname", "romname");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -333,7 +328,6 @@ void Settings::usage()
|
||||||
#endif
|
#endif
|
||||||
#ifdef SNAPSHOT_SUPPORT
|
#ifdef SNAPSHOT_SUPPORT
|
||||||
<< " -ssdir <path> The directory to save snapshot files to\n"
|
<< " -ssdir <path> The directory to save snapshot files to\n"
|
||||||
<< " -ssname <name> How to name the snapshot (romname or md5sum)\n"
|
|
||||||
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
|
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
|
||||||
<< endl
|
<< endl
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemGP2X.cxx,v 1.10 2006-09-17 21:44:22 azaballa Exp $
|
// $Id: OSystemGP2X.cxx,v 1.11 2006-11-13 00:21:41 stephena Exp $
|
||||||
// Modified on 2006/01/06 by Alex Zaballa for use on GP2X
|
// Modified on 2006/01/06 by Alex Zaballa for use on GP2X
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
OSystemGP2X::OSystemGP2X()
|
OSystemGP2X::OSystemGP2X(const string& path) : OSystem()
|
||||||
{
|
{
|
||||||
// GP2X needs all config files in exec directory
|
// GP2X needs all config files in exec directory
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemGP2X.hxx,v 1.6 2006-03-02 13:10:53 stephena Exp $
|
// $Id: OSystemGP2X.hxx,v 1.7 2006-11-13 00:21:41 stephena Exp $
|
||||||
// Modified by Alex Zaballa on 2006/01/04 for use on GP2X
|
// Modified by Alex Zaballa on 2006/01/04 for use on GP2X
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class OSystemGP2X : public OSystem
|
||||||
/**
|
/**
|
||||||
Create a new GP2X-specific operating system object
|
Create a new GP2X-specific operating system object
|
||||||
*/
|
*/
|
||||||
OSystemGP2X();
|
OSystemGP2X(const string& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: LauncherOptionsDialog.cxx,v 1.17 2006-05-04 17:45:25 stephena Exp $
|
// $Id: LauncherOptionsDialog.cxx,v 1.18 2006-11-13 00:21:41 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -97,19 +97,8 @@ LauncherOptionsDialog::LauncherOptionsDialog(
|
||||||
_w - xpos - 10, font.getLineHeight(),
|
_w - xpos - 10, font.getLineHeight(),
|
||||||
"", kTextAlignLeft);
|
"", kTextAlignLeft);
|
||||||
|
|
||||||
// Snapshot save name
|
|
||||||
xpos = 10; ypos += mySnapPath->getHeight() + 8;
|
|
||||||
mySnapTypePopup = new PopUpWidget(myTab, font, xpos, ypos,
|
|
||||||
font.getStringWidth("romname"),
|
|
||||||
font.getLineHeight(),
|
|
||||||
"Save snapshot as: ",
|
|
||||||
font.getStringWidth("Save snapshot as: "), 0);
|
|
||||||
mySnapTypePopup->appendEntry("romname", 1);
|
|
||||||
mySnapTypePopup->appendEntry("md5sum", 2);
|
|
||||||
wid.push_back(mySnapTypePopup);
|
|
||||||
|
|
||||||
// Snapshot single or multiple saves
|
// Snapshot single or multiple saves
|
||||||
xpos = 30; ypos += mySnapTypePopup->getHeight() + 5;
|
xpos = 30; ypos += mySnapPath->getHeight() + 8;
|
||||||
mySnapSingleCheckbox = new CheckboxWidget(myTab, font, xpos, ypos,
|
mySnapSingleCheckbox = new CheckboxWidget(myTab, font, xpos, ypos,
|
||||||
"Multiple snapshots");
|
"Multiple snapshots");
|
||||||
wid.push_back(mySnapSingleCheckbox);
|
wid.push_back(mySnapSingleCheckbox);
|
||||||
|
@ -168,14 +157,6 @@ void LauncherOptionsDialog::loadConfig()
|
||||||
s = instance()->settings().getString("ssdir");
|
s = instance()->settings().getString("ssdir");
|
||||||
mySnapPath->setLabel(s);
|
mySnapPath->setLabel(s);
|
||||||
|
|
||||||
s = instance()->settings().getString("ssname");
|
|
||||||
if(s == "romname")
|
|
||||||
mySnapTypePopup->setSelectedTag(1);
|
|
||||||
else if(s == "md5sum")
|
|
||||||
mySnapTypePopup->setSelectedTag(2);
|
|
||||||
else
|
|
||||||
mySnapTypePopup->setSelectedTag(0);
|
|
||||||
|
|
||||||
b = instance()->settings().getBool("sssingle");
|
b = instance()->settings().getBool("sssingle");
|
||||||
mySnapSingleCheckbox->setState(!b);
|
mySnapSingleCheckbox->setState(!b);
|
||||||
|
|
||||||
|
@ -197,9 +178,6 @@ void LauncherOptionsDialog::saveConfig()
|
||||||
s = mySnapPath->getLabel();
|
s = mySnapPath->getLabel();
|
||||||
instance()->settings().setString("ssdir", s);
|
instance()->settings().setString("ssdir", s);
|
||||||
|
|
||||||
s = mySnapTypePopup->getSelectedString();
|
|
||||||
instance()->settings().setString("ssname", s);
|
|
||||||
|
|
||||||
b = mySnapSingleCheckbox->getState();
|
b = mySnapSingleCheckbox->getState();
|
||||||
instance()->settings().setBool("sssingle", !b);
|
instance()->settings().setBool("sssingle", !b);
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: LauncherOptionsDialog.hxx,v 1.10 2006-03-19 20:57:55 stephena Exp $
|
// $Id: LauncherOptionsDialog.hxx,v 1.11 2006-11-13 00:21:41 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -47,7 +47,17 @@ class LauncherOptionsDialog : public Dialog, public CommandSender
|
||||||
|
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
|
void openRomBrowser();
|
||||||
|
void openSnapBrowser();
|
||||||
|
|
||||||
|
private:
|
||||||
|
enum {
|
||||||
|
kChooseRomDirCmd = 'LOrm', // rom select
|
||||||
|
kChooseSnapDirCmd = 'LOsn', // snap select
|
||||||
|
kBrowseDirCmd = 'LObd' // browse mode
|
||||||
|
};
|
||||||
|
|
||||||
BrowserDialog* myBrowser;
|
BrowserDialog* myBrowser;
|
||||||
TabWidget* myTab;
|
TabWidget* myTab;
|
||||||
|
|
||||||
|
@ -58,18 +68,7 @@ class LauncherOptionsDialog : public Dialog, public CommandSender
|
||||||
|
|
||||||
// Snapshot controls
|
// Snapshot controls
|
||||||
StaticTextWidget* mySnapPath;
|
StaticTextWidget* mySnapPath;
|
||||||
PopUpWidget* mySnapTypePopup;
|
|
||||||
CheckboxWidget* mySnapSingleCheckbox;
|
CheckboxWidget* mySnapSingleCheckbox;
|
||||||
|
|
||||||
private:
|
|
||||||
enum {
|
|
||||||
kChooseRomDirCmd = 'LOrm', // rom select
|
|
||||||
kChooseSnapDirCmd = 'LOsn', // snap select
|
|
||||||
kBrowseDirCmd = 'LObd' // browse mode
|
|
||||||
};
|
|
||||||
|
|
||||||
void openRomBrowser();
|
|
||||||
void openSnapBrowser();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemMACOSX.cxx,v 1.11 2006-04-05 02:18:58 markgrebe Exp $
|
// $Id: OSystemMACOSX.cxx,v 1.12 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
@ -93,10 +93,10 @@ void macOSXSendMenuEvent(int event)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
OSystemMACOSX::OSystemMACOSX()
|
OSystemMACOSX::OSystemMACOSX(const string& path) : OSystem()
|
||||||
{
|
{
|
||||||
// First set variables that the OSystem needs
|
const string& basedir = (path.length() > 0) ? path :
|
||||||
string basedir = string(getenv("HOME")) + "/.stella";
|
string(getenv("HOME")) + "/.stella";
|
||||||
setBaseDir(basedir);
|
setBaseDir(basedir);
|
||||||
|
|
||||||
setStateDir(basedir + "/state");
|
setStateDir(basedir + "/state");
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemMACOSX.hxx,v 1.4 2006-03-27 16:00:37 stephena Exp $
|
// $Id: OSystemMACOSX.hxx,v 1.5 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef OSYSTEM_MACOSX_HXX
|
#ifndef OSYSTEM_MACOSX_HXX
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
This class defines UNIX-like OS's (Linux) system specific settings.
|
This class defines UNIX-like OS's (Linux) system specific settings.
|
||||||
|
|
||||||
@author Mark Grebe
|
@author Mark Grebe
|
||||||
@version $Id: OSystemMACOSX.hxx,v 1.4 2006-03-27 16:00:37 stephena Exp $
|
@version $Id: OSystemMACOSX.hxx,v 1.5 2006-11-13 00:21:41 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class OSystemMACOSX : public OSystem
|
class OSystemMACOSX : public OSystem
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ class OSystemMACOSX : public OSystem
|
||||||
/**
|
/**
|
||||||
Create a new UNIX-specific operating system object
|
Create a new UNIX-specific operating system object
|
||||||
*/
|
*/
|
||||||
OSystemMACOSX();
|
OSystemMACOSX(const string& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemPSP.cxx,v 1.5 2006-01-08 02:28:04 stephena Exp $
|
// $Id: OSystemPSP.cxx,v 1.6 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
OSystemPSP::OSystemPSP()
|
OSystemPSP::OSystemPSP(const string& path) : OSystem()
|
||||||
{
|
{
|
||||||
// First set variables that the OSystem needs
|
// First set variables that the OSystem needs
|
||||||
string basedir = string("ms0:/stella");
|
string basedir = string("ms0:/stella");
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemPSP.hxx,v 1.4 2006-03-02 13:10:53 stephena Exp $
|
// $Id: OSystemPSP.hxx,v 1.5 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef OSYSTEM_PSP_HXX
|
#ifndef OSYSTEM_PSP_HXX
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
This class defines PSP-specific settings.
|
This class defines PSP-specific settings.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: OSystemPSP.hxx,v 1.4 2006-03-02 13:10:53 stephena Exp $
|
@version $Id: OSystemPSP.hxx,v 1.5 2006-11-13 00:21:41 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class OSystemPSP : public OSystem
|
class OSystemPSP : public OSystem
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ class OSystemPSP : public OSystem
|
||||||
/**
|
/**
|
||||||
Create a new PSP-specific operating system object
|
Create a new PSP-specific operating system object
|
||||||
*/
|
*/
|
||||||
OSystemPSP();
|
OSystemPSP(const string& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemUNIX.cxx,v 1.20 2006-03-25 00:34:17 stephena Exp $
|
// $Id: OSystemUNIX.cxx,v 1.21 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
@ -50,10 +50,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
OSystemUNIX::OSystemUNIX()
|
OSystemUNIX::OSystemUNIX(const string& path) : OSystem()
|
||||||
{
|
{
|
||||||
// First set variables that the OSystem needs
|
const string& basedir = (path.length() > 0) ? path :
|
||||||
string basedir = string(getenv("HOME")) + "/.stella";
|
string(getenv("HOME")) + "/.stella";
|
||||||
setBaseDir(basedir);
|
setBaseDir(basedir);
|
||||||
|
|
||||||
setStateDir(basedir + "/state");
|
setStateDir(basedir + "/state");
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemUNIX.hxx,v 1.10 2006-01-31 17:26:56 stephena Exp $
|
// $Id: OSystemUNIX.hxx,v 1.11 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef OSYSTEM_UNIX_HXX
|
#ifndef OSYSTEM_UNIX_HXX
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
This class defines UNIX-like OS's (Linux) system specific settings.
|
This class defines UNIX-like OS's (Linux) system specific settings.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: OSystemUNIX.hxx,v 1.10 2006-01-31 17:26:56 stephena Exp $
|
@version $Id: OSystemUNIX.hxx,v 1.11 2006-11-13 00:21:41 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class OSystemUNIX : public OSystem
|
class OSystemUNIX : public OSystem
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ class OSystemUNIX : public OSystem
|
||||||
/**
|
/**
|
||||||
Create a new UNIX-specific operating system object
|
Create a new UNIX-specific operating system object
|
||||||
*/
|
*/
|
||||||
OSystemUNIX();
|
OSystemUNIX(const string& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemWin32.cxx,v 1.12 2006-03-17 19:44:19 stephena Exp $
|
// $Id: OSystemWin32.cxx,v 1.13 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -38,23 +38,23 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
OSystemWin32::OSystemWin32()
|
OSystemWin32::OSystemWin32(const string& path) : OSystem()
|
||||||
{
|
{
|
||||||
// TODO - there really should be code here to determine which version
|
// TODO - there really should be code here to determine which version
|
||||||
// of Windows is being used.
|
// of Windows is being used.
|
||||||
// If using a version which supports multiple users (NT and above),
|
// If using a version which supports multiple users (NT and above),
|
||||||
// the relevant directories should be created in per-user locations.
|
// the relevant directories should be created in per-user locations.
|
||||||
// For now, we just put it in the same directory as the executable.
|
// For now, we just put it in the same directory as the executable.
|
||||||
|
const string& basedir = (path.length() > 0) ? path : ".";
|
||||||
|
|
||||||
string basedir = ".\\";
|
|
||||||
setBaseDir(basedir);
|
setBaseDir(basedir);
|
||||||
|
|
||||||
setStateDir(basedir + "state\\");
|
setStateDir(basedir + "\\state\\");
|
||||||
|
|
||||||
setPropertiesDir(basedir);
|
setPropertiesDir(basedir);
|
||||||
setConfigFile(basedir + "stella.ini");
|
setConfigFile(basedir + "\\stella.ini");
|
||||||
|
|
||||||
setCacheFile(basedir + "stella.cache");
|
setCacheFile(basedir + "\\stella.cache");
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystemWin32.hxx,v 1.5 2006-01-08 02:28:04 stephena Exp $
|
// $Id: OSystemWin32.hxx,v 1.6 2006-11-13 00:21:41 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef OSYSTEM_WIN32_HXX
|
#ifndef OSYSTEM_WIN32_HXX
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
This class defines Windows system specific settings.
|
This class defines Windows system specific settings.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: OSystemWin32.hxx,v 1.5 2006-01-08 02:28:04 stephena Exp $
|
@version $Id: OSystemWin32.hxx,v 1.6 2006-11-13 00:21:41 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class OSystemWin32 : public OSystem
|
class OSystemWin32 : public OSystem
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ class OSystemWin32 : public OSystem
|
||||||
/**
|
/**
|
||||||
Create a new Win32 operating system object
|
Create a new Win32 operating system object
|
||||||
*/
|
*/
|
||||||
OSystemWin32();
|
OSystemWin32(const string& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -31,7 +31,7 @@ extern void KeySetMode(int);
|
||||||
extern bool RequestRefresh;
|
extern bool RequestRefresh;
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
OSystemWinCE::OSystemWinCE()
|
OSystemWinCE::OSystemWinCE(const string& path) : OSystem()
|
||||||
{
|
{
|
||||||
string basedir = ((string) getcwd()) + '\\';
|
string basedir = ((string) getcwd()) + '\\';
|
||||||
setBaseDir(basedir);
|
setBaseDir(basedir);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
class OSystemWinCE : public OSystem
|
class OSystemWinCE : public OSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OSystemWinCE();
|
OSystemWinCE(const string& path);
|
||||||
virtual ~OSystemWinCE();
|
virtual ~OSystemWinCE();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue