mirror of https://github.com/stella-emu/stella.git
Re-added ROM browser mode ('rombrowse' commandline argument).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1357 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
88e76cfd6e
commit
4f9b1fdf61
|
@ -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.124 2007-08-21 17:58:25 stephena Exp $
|
// $Id: Settings.cxx,v 1.125 2007-08-22 13:55:40 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -82,6 +82,9 @@ Settings::Settings(OSystem* osystem)
|
||||||
setInternal("palettefile", "");
|
setInternal("palettefile", "");
|
||||||
setInternal("propsfile", "");
|
setInternal("propsfile", "");
|
||||||
|
|
||||||
|
setInternal("rombrowse", "true");
|
||||||
|
setInternal("lastrom", "");
|
||||||
|
|
||||||
setInternal("debuggerres", "1030x690");
|
setInternal("debuggerres", "1030x690");
|
||||||
setInternal("launcherres", "400x300");
|
setInternal("launcherres", "400x300");
|
||||||
setInternal("uipalette", "0");
|
setInternal("uipalette", "0");
|
||||||
|
@ -306,6 +309,7 @@ void Settings::usage()
|
||||||
<< " -p2speed <number> Speed of emulated mouse movement for paddle 2 (0-100)\n"
|
<< " -p2speed <number> Speed of emulated mouse movement for paddle 2 (0-100)\n"
|
||||||
<< " -p3speed <number> Speed of emulated mouse movement for paddle 3 (0-100)\n"
|
<< " -p3speed <number> Speed of emulated mouse movement for paddle 3 (0-100)\n"
|
||||||
<< " -pthresh <number> Set threshold for eliminating paddle jitter\n"
|
<< " -pthresh <number> Set threshold for eliminating paddle jitter\n"
|
||||||
|
<< " -rombrowse <1|0> Use ROM browser mode (shows files and folders)\n"
|
||||||
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
|
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
|
||||||
<< " -ssdir <path> The directory to save snapshot files to\n"
|
<< " -ssdir <path> The directory to save snapshot files to\n"
|
||||||
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
|
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
|
||||||
|
|
|
@ -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: FileSnapDialog.cxx,v 1.11 2007-08-15 17:43:51 stephena Exp $
|
// $Id: FileSnapDialog.cxx,v 1.12 2007-08-22 13:55:40 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
|
||||||
|
@ -49,23 +49,17 @@ FileSnapDialog::FileSnapDialog(
|
||||||
xpos = vBorder; ypos = vBorder;
|
xpos = vBorder; ypos = vBorder;
|
||||||
|
|
||||||
// ROM path
|
// ROM path
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Rom path:",
|
ButtonWidget* romButton =
|
||||||
|
new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Rom path:",
|
||||||
kChooseRomDirCmd);
|
kChooseRomDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(romButton);
|
||||||
xpos += bwidth + 10;
|
xpos += bwidth + 10;
|
||||||
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(myRomPath);
|
wid.push_back(myRomPath);
|
||||||
|
|
||||||
// ROM settings are disabled while in game mode
|
|
||||||
if(!myIsGlobal)
|
|
||||||
{
|
|
||||||
b->clearFlags(WIDGET_ENABLED);
|
|
||||||
myRomPath->setEditable(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// State directory
|
// State directory
|
||||||
xpos = vBorder; ypos += b->getHeight() + 3;
|
xpos = vBorder; ypos += romButton->getHeight() + 3;
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "State path:",
|
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "State path:",
|
||||||
kChooseStateDirCmd);
|
kChooseStateDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
|
@ -114,8 +108,23 @@ FileSnapDialog::FileSnapDialog(
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(mySnapPath);
|
wid.push_back(mySnapPath);
|
||||||
|
|
||||||
// Snapshot single or multiple saves
|
// Use ROM browse mode
|
||||||
xpos = 30; ypos += mySnapPath->getHeight() + 8;
|
xpos = 30; ypos += mySnapPath->getHeight() + 8;
|
||||||
|
myBrowseCheckbox =
|
||||||
|
new CheckboxWidget(this, font, xpos, ypos, "Browse folders", kBrowseDirCmd);
|
||||||
|
wid.push_back(myBrowseCheckbox);
|
||||||
|
|
||||||
|
// Reload current ROM listing (in non-browse mode)
|
||||||
|
xpos += myBrowseCheckbox->getWidth() + 20;
|
||||||
|
myReloadRomButton =
|
||||||
|
new ButtonWidget(this, font, xpos, ypos-2,
|
||||||
|
font.getStringWidth(" Reload ROM Listing "), bheight,
|
||||||
|
"Reload ROM Listing", kReloadRomDirCmd);
|
||||||
|
//myReloadButton->setEditable(true);
|
||||||
|
wid.push_back(myReloadRomButton);
|
||||||
|
|
||||||
|
// Snapshot single or multiple saves
|
||||||
|
xpos = 30; ypos += myBrowseCheckbox->getHeight() + 4;
|
||||||
mySnapSingleCheckbox = new CheckboxWidget(this, font, xpos, ypos,
|
mySnapSingleCheckbox = new CheckboxWidget(this, font, xpos, ypos,
|
||||||
"Multiple snapshots");
|
"Multiple snapshots");
|
||||||
wid.push_back(mySnapSingleCheckbox);
|
wid.push_back(mySnapSingleCheckbox);
|
||||||
|
@ -141,6 +150,15 @@ FileSnapDialog::FileSnapDialog(
|
||||||
|
|
||||||
addToFocusList(wid);
|
addToFocusList(wid);
|
||||||
|
|
||||||
|
// All ROM settings are disabled while in game mode
|
||||||
|
if(!myIsGlobal)
|
||||||
|
{
|
||||||
|
romButton->clearFlags(WIDGET_ENABLED);
|
||||||
|
myRomPath->setEditable(false);
|
||||||
|
myBrowseCheckbox->clearFlags(WIDGET_ENABLED);
|
||||||
|
myReloadRomButton->clearFlags(WIDGET_ENABLED);
|
||||||
|
}
|
||||||
|
|
||||||
// Create file browser dialog
|
// Create file browser dialog
|
||||||
myBrowser = new BrowserDialog(this, font, 60, 20, 200, 200);
|
myBrowser = new BrowserDialog(this, font, 60, 20, 200, 200);
|
||||||
}
|
}
|
||||||
|
@ -159,8 +177,10 @@ void FileSnapDialog::loadConfig()
|
||||||
myCheatFile->setEditString(instance()->cheatFile());
|
myCheatFile->setEditString(instance()->cheatFile());
|
||||||
myPaletteFile->setEditString(instance()->paletteFile());
|
myPaletteFile->setEditString(instance()->paletteFile());
|
||||||
myPropsFile->setEditString(instance()->propertiesFile());
|
myPropsFile->setEditString(instance()->propertiesFile());
|
||||||
|
|
||||||
mySnapPath->setEditString(instance()->settings().getString("ssdir"));
|
mySnapPath->setEditString(instance()->settings().getString("ssdir"));
|
||||||
|
bool b = instance()->settings().getBool("rombrowse");
|
||||||
|
myBrowseCheckbox->setState(b);
|
||||||
|
myReloadRomButton->setEnabled(myIsGlobal && !b);
|
||||||
mySnapSingleCheckbox->setState(!instance()->settings().getBool("sssingle"));
|
mySnapSingleCheckbox->setState(!instance()->settings().getBool("sssingle"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,8 +192,8 @@ void FileSnapDialog::saveConfig()
|
||||||
instance()->settings().setString("cheatfile", myCheatFile->getEditString());
|
instance()->settings().setString("cheatfile", myCheatFile->getEditString());
|
||||||
instance()->settings().setString("palettefile", myPaletteFile->getEditString());
|
instance()->settings().setString("palettefile", myPaletteFile->getEditString());
|
||||||
instance()->settings().setString("propsfile", myPropsFile->getEditString());
|
instance()->settings().setString("propsfile", myPropsFile->getEditString());
|
||||||
|
|
||||||
instance()->settings().setString("ssdir", mySnapPath->getEditString());
|
instance()->settings().setString("ssdir", mySnapPath->getEditString());
|
||||||
|
instance()->settings().setBool("rombrowse", myBrowseCheckbox->getState());
|
||||||
instance()->settings().setBool("sssingle", !mySnapSingleCheckbox->getState());
|
instance()->settings().setBool("sssingle", !mySnapSingleCheckbox->getState());
|
||||||
|
|
||||||
// Flush changes to disk and inform the OSystem
|
// Flush changes to disk and inform the OSystem
|
||||||
|
@ -222,7 +242,10 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
saveConfig();
|
saveConfig();
|
||||||
close();
|
close();
|
||||||
if(myIsGlobal)
|
if(myIsGlobal)
|
||||||
|
{
|
||||||
|
sendCommand(kBrowseChangedCmd, 0, 0); // Call this before refreshing ROMs
|
||||||
sendCommand(kRomDirChosenCmd, 0, 0); // Let the boss know romdir has changed
|
sendCommand(kRomDirChosenCmd, 0, 0); // Let the boss know romdir has changed
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kDefaultsCmd:
|
case kDefaultsCmd:
|
||||||
|
@ -301,6 +324,10 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case kReloadRomDirCmd:
|
||||||
|
sendCommand(kReloadRomDirCmd, 0, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Dialog::handleCommand(sender, cmd, data, 0);
|
Dialog::handleCommand(sender, cmd, data, 0);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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: FileSnapDialog.hxx,v 1.7 2007-08-15 17:43:51 stephena Exp $
|
// $Id: FileSnapDialog.hxx,v 1.8 2007-08-22 13:55:40 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
|
||||||
|
@ -60,6 +60,7 @@ class FileSnapDialog : public Dialog, public CommandSender
|
||||||
kChoosePaletteFileCmd = 'LOpf', // palette file (stella.pal)
|
kChoosePaletteFileCmd = 'LOpf', // palette file (stella.pal)
|
||||||
kChoosePropsFileCmd = 'LOpr', // properties file (stella.pro)
|
kChoosePropsFileCmd = 'LOpr', // properties file (stella.pro)
|
||||||
kChooseSnapDirCmd = 'LOsn', // snapshot dir
|
kChooseSnapDirCmd = 'LOsn', // snapshot dir
|
||||||
|
kBrowseDirCmd = 'LObd', // browse mode
|
||||||
kStateDirChosenCmd = 'LOsc', // state dir changed
|
kStateDirChosenCmd = 'LOsc', // state dir changed
|
||||||
kCheatFileChosenCmd = 'LOcc', // cheatfile changed
|
kCheatFileChosenCmd = 'LOcc', // cheatfile changed
|
||||||
kPaletteFileChosenCmd = 'LOpc', // palette file changed
|
kPaletteFileChosenCmd = 'LOpc', // palette file changed
|
||||||
|
@ -77,6 +78,9 @@ class FileSnapDialog : public Dialog, public CommandSender
|
||||||
EditTextWidget* mySnapPath;
|
EditTextWidget* mySnapPath;
|
||||||
CheckboxWidget* mySnapSingleCheckbox;
|
CheckboxWidget* mySnapSingleCheckbox;
|
||||||
|
|
||||||
|
CheckboxWidget* myBrowseCheckbox;
|
||||||
|
ButtonWidget* myReloadRomButton;
|
||||||
|
|
||||||
// Indicates if this dialog is used for global (vs. in-game) settings
|
// Indicates if this dialog is used for global (vs. in-game) settings
|
||||||
bool myIsGlobal;
|
bool myIsGlobal;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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: LauncherDialog.cxx,v 1.68 2007-01-19 21:53:27 stephena Exp $
|
// $Id: LauncherDialog.cxx,v 1.69 2007-08-22 13:55:40 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
|
||||||
|
@ -201,15 +201,7 @@ void LauncherDialog::updateListing(bool fullReload)
|
||||||
// Disable buttons, pending a reload from disk
|
// Disable buttons, pending a reload from disk
|
||||||
enableButtons(false);
|
enableButtons(false);
|
||||||
|
|
||||||
// Figure out if the ROM dir has changed since we last accessed it.
|
if(FilesystemNode::fileExists(instance()->cacheFile()) && !fullReload)
|
||||||
// If so, we do a full reload from disk (takes quite some time).
|
|
||||||
// Otherwise, we can use the cache file (which is much faster).
|
|
||||||
string currentModTime = FilesystemNode::modTime(romdir);
|
|
||||||
string oldModTime = instance()->settings().getString("modtime");
|
|
||||||
|
|
||||||
if(currentModTime != oldModTime) // romdir has changed
|
|
||||||
loadListFromDisk();
|
|
||||||
else if(FilesystemNode::fileExists(instance()->cacheFile()) && !fullReload)
|
|
||||||
loadListFromCache();
|
loadListFromCache();
|
||||||
else // we have no other choice
|
else // we have no other choice
|
||||||
loadListFromDisk();
|
loadListFromDisk();
|
||||||
|
@ -329,11 +321,6 @@ void LauncherDialog::loadListFromDisk()
|
||||||
// And create a cache file, so that the next time Stella starts,
|
// And create a cache file, so that the next time Stella starts,
|
||||||
// we don't have to do this time-consuming operation again
|
// we don't have to do this time-consuming operation again
|
||||||
createListCache();
|
createListCache();
|
||||||
|
|
||||||
// Finally, update the modification time so we don't have to needlessly
|
|
||||||
// call this method again
|
|
||||||
string currentModTime = FilesystemNode::modTime(romdir);
|
|
||||||
instance()->settings().setString("modtime", currentModTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -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: LauncherDialog.hxx,v 1.25 2007-01-18 16:45:22 knakos Exp $
|
// $Id: LauncherDialog.hxx,v 1.26 2007-08-22 13:55:40 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
|
||||||
|
@ -31,12 +31,8 @@ class StringListWidget;
|
||||||
class ButtonWidget;
|
class ButtonWidget;
|
||||||
class OSystem;
|
class OSystem;
|
||||||
|
|
||||||
#ifdef _WIN32_WCE
|
|
||||||
// different include order for the ce compiler
|
|
||||||
#include "FSNode.hxx"
|
|
||||||
#endif
|
|
||||||
#include "Dialog.hxx"
|
|
||||||
#include "FSNode.hxx"
|
#include "FSNode.hxx"
|
||||||
|
#include "Dialog.hxx"
|
||||||
#include "GameList.hxx"
|
#include "GameList.hxx"
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
|
||||||
|
|
|
@ -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: OptionsDialog.cxx,v 1.58 2007-08-21 17:58:25 stephena Exp $
|
// $Id: OptionsDialog.cxx,v 1.59 2007-08-22 13:55:40 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
|
||||||
|
@ -126,7 +126,7 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
w = 200; h = 155;
|
w = 200; h = 155;
|
||||||
myUIDialog = new UIDialog(myOSystem, parent, font, x, y, w, h);
|
myUIDialog = new UIDialog(myOSystem, parent, font, x, y, w, h);
|
||||||
|
|
||||||
w = 280; h = 170;
|
w = 280; h = 190;
|
||||||
myFileSnapDialog = new FileSnapDialog(myOSystem, parent, font,
|
myFileSnapDialog = new FileSnapDialog(myOSystem, parent, font,
|
||||||
boss, x, y, w, h);
|
boss, x, y, w, h);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue