diff --git a/stella/src/emucore/Console.cxx b/stella/src/emucore/Console.cxx index 6ef790cfb..115c7deb7 100644 --- a/stella/src/emucore/Console.cxx +++ b/stella/src/emucore/Console.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Console.cxx,v 1.80 2006-01-10 20:37:00 stephena Exp $ +// $Id: Console.cxx,v 1.81 2006-01-11 14:13:19 stephena Exp $ //============================================================================ #include @@ -349,6 +349,28 @@ void Console::togglePalette(const string& palette) setPalette(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Console::togglePhosphor() +{ + string phosphor = myProperties.get("Display.Phosphor", true); + bool enable; + if(phosphor == "YES") + { + myProperties.set("Display.Phosphor", "No"); + enable = false; + myOSystem->frameBuffer().showMessage("Phosphor effect disabled"); + } + else + { + myProperties.set("Display.Phosphor", "Yes"); + enable = true; + myOSystem->frameBuffer().showMessage("Phosphor effect enabled"); + } + + myOSystem->frameBuffer().enablePhosphor(enable); + setPalette(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Console::saveProperties(string filename, bool merge) { diff --git a/stella/src/emucore/Console.hxx b/stella/src/emucore/Console.hxx index 0c1aa8146..88fdc3ca2 100644 --- a/stella/src/emucore/Console.hxx +++ b/stella/src/emucore/Console.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Console.hxx,v 1.41 2005-12-23 20:48:50 stephena Exp $ +// $Id: Console.hxx,v 1.42 2006-01-11 14:13:19 stephena Exp $ //============================================================================ #ifndef CONSOLE_HXX @@ -37,7 +37,7 @@ class System; This class represents the entire game console. @author Bradford W. Mott - @version $Id: Console.hxx,v 1.41 2005-12-23 20:48:50 stephena Exp $ + @version $Id: Console.hxx,v 1.42 2006-01-11 14:13:19 stephena Exp $ */ class Console { @@ -150,6 +150,11 @@ class Console */ void togglePalette(const string& palette = ""); + /** + Toggles phosphor effect. + */ + void togglePhosphor(); + /** Save a copy of the current properties after any changes. diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index a5e45e356..ca30c59f2 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.cxx,v 1.145 2006-01-09 19:30:04 stephena Exp $ +// $Id: EventHandler.cxx,v 1.146 2006-01-11 14:13:19 stephena Exp $ //============================================================================ #include @@ -453,6 +453,10 @@ void EventHandler::poll(uInt32 time) saveProperties(); break; + case SDLK_p: // Alt-p toggles phosphor effect + myOSystem->console().togglePhosphor(); + break; + // FIXME - these will be removed when a UI is added for event recording case SDLK_e: // Alt-e starts/stops event recording if(myEventStreamer->isRecording())