diff --git a/stella/docs/stella.html b/stella/docs/stella.html index b3b43678f..218c03f16 100644 --- a/stella/docs/stella.html +++ b/stella/docs/stella.html @@ -964,7 +964,7 @@ Exit emulator - Ctrl + q + Control + q Cmd + q @@ -986,6 +986,12 @@ Backslash (\) + + Enter/exit debugger + Backquote (`) + Backquote (`) + + Select Game F1 @@ -1066,8 +1072,8 @@ Cheat code entry - Ctrl-C - Ctrl-C + Control + c + Cmd + c @@ -1531,13 +1537,13 @@ Resize window to next larger size Alt + = - Shift-Cmd + = + Cmd + = Resize window to next smaller size Alt + - - Shift-Cmd + - + Cmd + - diff --git a/stella/src/common/FrameBufferSoft.cxx b/stella/src/common/FrameBufferSoft.cxx index e5e3a2bd8..a183bae37 100644 --- a/stella/src/common/FrameBufferSoft.cxx +++ b/stella/src/common/FrameBufferSoft.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: FrameBufferSoft.cxx,v 1.38 2005-09-11 15:44:51 stephena Exp $ +// $Id: FrameBufferSoft.cxx,v 1.39 2005-10-18 18:49:46 stephena Exp $ //============================================================================ #include @@ -275,15 +275,13 @@ void FrameBufferSoft::postFrameUpdate() // This is a performance hack until I have more time to work // on the Win32 code. It seems that SDL_UpdateRects() is very // expensive in Windows, so we force a full screen update instead. -#ifdef WIN32 - if(myRectList->numRects() > 0) + if(myUseDirtyRects) + SDL_UpdateRects(myScreen, myRectList->numRects(), myRectList->rects()); + else if(myRectList->numRects() > 0) { SDL_Flip(myScreen); myRectList->start(); } -#else - SDL_UpdateRects(myScreen, myRectList->numRects(), myRectList->rects()); -#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 9b9241cc9..47c639861 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.105 2005-10-14 14:07:24 stephena Exp $ +// $Id: EventHandler.cxx,v 1.106 2005-10-18 18:49:46 stephena Exp $ //============================================================================ #include @@ -311,6 +311,7 @@ void EventHandler::poll(uInt32 time) // These keys work in all states switch(int(key)) { + #ifndef MAC_OSX case SDLK_EQUALS: myOSystem->frameBuffer().resize(NextSize); break; @@ -319,7 +320,6 @@ void EventHandler::poll(uInt32 time) myOSystem->frameBuffer().resize(PreviousSize); break; - #ifndef MAC_OSX case SDLK_RETURN: myOSystem->frameBuffer().toggleFullscreen(); break; @@ -412,6 +412,14 @@ void EventHandler::poll(uInt32 time) handleMacOSXKeypress(int(key)); break; + case SDLK_EQUALS: + myOSystem->frameBuffer().resize(NextSize); + break; + + case SDLK_MINUS: + myOSystem->frameBuffer().resize(PreviousSize); + break; + case SDLK_RETURN: myOSystem->frameBuffer().toggleFullscreen(); break; @@ -1553,8 +1561,9 @@ void EventHandler::takeSnapshot() string sspath = myOSystem->settings().getString("ssdir"); string ssname = myOSystem->settings().getString("ssname"); - if(sspath.substr(sspath.length()-1) != BSPF_PATH_SEPARATOR) - sspath += BSPF_PATH_SEPARATOR; + if(sspath.length() > 0) + if(sspath.substr(sspath.length()-1) != BSPF_PATH_SEPARATOR) + sspath += BSPF_PATH_SEPARATOR; if(ssname == "romname") sspath += myOSystem->console().properties().get("Cartridge.Name"); diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index b0b7eff38..efb531149 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.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: FrameBuffer.cxx,v 1.66 2005-08-29 18:36:41 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.67 2005-10-18 18:49:46 stephena Exp $ //============================================================================ #include @@ -146,6 +146,8 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height, // Erase any messages from a previous run myMessageTime = 0; + + myUseDirtyRects = myOSystem->settings().getBool("dirtyrects"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/emucore/FrameBuffer.hxx b/stella/src/emucore/FrameBuffer.hxx index 946ad10f0..487548615 100644 --- a/stella/src/emucore/FrameBuffer.hxx +++ b/stella/src/emucore/FrameBuffer.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: FrameBuffer.hxx,v 1.58 2005-10-09 17:31:47 stephena Exp $ +// $Id: FrameBuffer.hxx,v 1.59 2005-10-18 18:49:46 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_HXX @@ -52,7 +52,7 @@ enum FrameStyle { All GUI elements (ala ScummVM) are drawn here as well. @author Stephen Anthony - @version $Id: FrameBuffer.hxx,v 1.58 2005-10-09 17:31:47 stephena Exp $ + @version $Id: FrameBuffer.hxx,v 1.59 2005-10-18 18:49:46 stephena Exp $ */ class FrameBuffer { @@ -434,6 +434,9 @@ class FrameBuffer // The aspect ratio of the window float theAspectRatio; + // Use dirty updates (SDL_UpdateRects instead of SDL_UpdateRect) + bool myUseDirtyRects; + // Table of RGB values for GUI elements static const uInt8 ourGUIColors[kNumColors-256][3]; diff --git a/stella/src/emucore/OSystem.cxx b/stella/src/emucore/OSystem.cxx index 0d83e31b1..fc519fa8a 100644 --- a/stella/src/emucore/OSystem.cxx +++ b/stella/src/emucore/OSystem.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: OSystem.cxx,v 1.41 2005-10-09 17:31:47 stephena Exp $ +// $Id: OSystem.cxx,v 1.42 2005-10-18 18:49:46 stephena Exp $ //============================================================================ #include @@ -370,15 +370,37 @@ bool OSystem::openROM(const string& rom, uInt8** image, int* size) if(unzGoToFirstFile(tz) == UNZ_OK) { unz_file_info ufo; - unzGetCurrentFileInfo(tz, &ufo, 0, 0, 0, 0, 0, 0); + for(;;) // Loop through all files for valid 2600 images + { + // Longer filenames might be possible, but I don't + // think people would name files that long in zip files... + char filename[1024]; + + unzGetCurrentFileInfo(tz, &ufo, filename, 1024, 0, 0, 0, 0); + filename[1023] = '\0'; + + if(strlen(filename) >= 4) + { + // Grab 3-character extension + char* ext = filename + strlen(filename) - 4; + + if(!STR_CASE_CMP(ext, ".bin") || !STR_CASE_CMP(ext, ".a26")) + break; + } + + // Scan the next file in the zip + if(unzGoToNextFile(tz) != UNZ_OK) + break; + } + + // Now see if we got a valid image if(ufo.uncompressed_size <= 0) { unzClose(tz); return false; } - - *size = ufo.uncompressed_size; + *size = ufo.uncompressed_size; *image = new uInt8[*size]; // We don't have to check for any return errors from these functions, diff --git a/stella/src/emucore/Settings.cxx b/stella/src/emucore/Settings.cxx index 4a02ce48c..473ff7c95 100644 --- a/stella/src/emucore/Settings.cxx +++ b/stella/src/emucore/Settings.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: Settings.cxx,v 1.62 2005-10-02 19:10:39 stephena Exp $ +// $Id: Settings.cxx,v 1.63 2005-10-18 18:49:46 stephena Exp $ //============================================================================ #include @@ -39,6 +39,7 @@ Settings::Settings(OSystem* osystem) // Now fill it with options that are common to all versions of Stella set("video", "soft"); + set("dirtyrects", "true"); set("gl_filter", "nearest"); set("gl_aspect", "2.0"); diff --git a/stella/src/gui/GameList.cxx b/stella/src/gui/GameList.cxx index 55adba1f1..3679a28ee 100644 --- a/stella/src/gui/GameList.cxx +++ b/stella/src/gui/GameList.cxx @@ -13,12 +13,15 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: GameList.cxx,v 1.5 2005-06-16 00:55:59 stephena Exp $ +// $Id: GameList.cxx,v 1.6 2005-10-18 18:49:46 stephena Exp $ // // Based on code from KStella - Stella frontend // Copyright (C) 2003-2005 Stephen Anthony //============================================================================ +#include +#include + #include "GuiUtils.hxx" #include "GameList.hxx" @@ -34,7 +37,8 @@ GameList::~GameList() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void GameList::appendGame(const string& rom, const string& name, const string& note) +void GameList::appendGame(const string& rom, const string& name, + const string& note) { Entry g; g._rom = rom; @@ -55,9 +59,17 @@ void GameList::sortByName() { unsigned int min = i; for (unsigned int j = i+1; j < myArray.size(); j++) - if (myArray[j]._name < myArray[min]._name) + { + // TODO - add option for this + string atJ = myArray[j]._name; + string atMin = myArray[min]._name; + transform(atJ.begin(), atJ.end(), atJ.begin(), (int(*)(int)) toupper); + transform(atMin.begin(), atMin.end(), atMin.begin(), (int(*)(int)) toupper); + + if (atJ < atMin) min = j; if (min != i) SWAP(myArray[min], myArray[i]); + } } } diff --git a/stella/src/gui/VideoDialog.cxx b/stella/src/gui/VideoDialog.cxx index fc98f8ad0..a66acbd6b 100644 --- a/stella/src/gui/VideoDialog.cxx +++ b/stella/src/gui/VideoDialog.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: VideoDialog.cxx,v 1.24 2005-09-11 15:44:51 stephena Exp $ +// $Id: VideoDialog.cxx,v 1.25 2005-10-18 18:49:46 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -51,21 +51,11 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent, woff = 110, labelWidth = 55; - // Video driver (query OSystem for what's supported) - myDriverPopup = new PopUpWidget(this, xoff, yoff, woff, kLineHeight, - "Driver: ", labelWidth); - unsigned int itemNum = 1; - StringList::const_iterator iter; - if(instance()->driverList().size() > 0) - { - for (iter = instance()->driverList().begin(); iter != instance()->driverList().end(); - ++iter, ++itemNum) - { - myDriverPopup->appendEntry(*iter, itemNum); - } - } - else - myDriverPopup->setEnabled(false); + // Use dirty rectangle updates + myDirtyPopup = new PopUpWidget(this, xoff, yoff, woff, kLineHeight, + "Dirty Rects: ", labelWidth); + myDirtyPopup->appendEntry("Yes", 1); + myDirtyPopup->appendEntry("No", 2); yoff += kVideoRowHeight + 4; // Video renderer @@ -158,18 +148,9 @@ void VideoDialog::loadConfig() double f; // Driver setting - s = instance()->settings().getString("video_driver"); - unsigned int itemNum = 1; - StringList::const_iterator iter; - for (iter = instance()->driverList().begin(); iter != instance()->driverList().end(); - ++iter, ++itemNum) - { - if(*iter == s) - { - myDriverPopup->setSelectedTag(itemNum); - break; - } - } + b = instance()->settings().getBool("dirtyrects"); + i = b ? 1 : 2; + myDirtyPopup->setSelectedTag(i); // Renderer setting s = instance()->settings().getString("video"); @@ -240,9 +221,14 @@ void VideoDialog::saveConfig() int i; bool b, restart = false; - // Driver setting - s = myDriverPopup->getSelectedString(); - instance()->settings().setString("video_driver", s); + // Dirty rectangle updates + i = myDirtyPopup->getSelectedTag(); + b = (i == 1) ? 1 : 0; + if(b != instance()->settings().getBool("dirtyrects")) + { + instance()->settings().setBool("dirtyrects", b); + restart = true; + } // Renderer setting i = myRendererPopup->getSelectedTag(); @@ -322,8 +308,7 @@ void VideoDialog::saveConfig() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void VideoDialog::setDefaults() { - if(myDriverPopup->isEnabled()) - myDriverPopup->setSelectedTag(1); + myDirtyPopup->setSelectedTag(1); myRendererPopup->setSelectedTag(1); myFilterPopup->setSelectedTag(1); myPalettePopup->setSelectedTag(1); @@ -354,6 +339,9 @@ void VideoDialog::handleRendererChange(int item) myAspectRatioSlider->setEnabled(active); myAspectRatioLabel->setEnabled(active); myUseDeskResCheckbox->setEnabled(active); + + // Also, in OpenGL mode, certain software related items are disabled + myDirtyPopup->setEnabled(!active); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/VideoDialog.hxx b/stella/src/gui/VideoDialog.hxx index 0587b2324..d7e98f6a2 100644 --- a/stella/src/gui/VideoDialog.hxx +++ b/stella/src/gui/VideoDialog.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: VideoDialog.hxx,v 1.9 2005-09-06 19:42:35 stephena Exp $ +// $Id: VideoDialog.hxx,v 1.10 2005-10-18 18:49:46 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -48,7 +48,7 @@ class VideoDialog : public Dialog ~VideoDialog(); protected: - PopUpWidget* myDriverPopup; + PopUpWidget* myDirtyPopup; PopUpWidget* myRendererPopup; PopUpWidget* myFilterPopup; SliderWidget* myAspectRatioSlider; diff --git a/stella/src/win32/SettingsWin32.cxx b/stella/src/win32/SettingsWin32.cxx index 55bf44970..e5a85dfc9 100644 --- a/stella/src/win32/SettingsWin32.cxx +++ b/stella/src/win32/SettingsWin32.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: SettingsWin32.cxx,v 1.18 2005-09-13 18:27:42 stephena Exp $ +// $Id: SettingsWin32.cxx,v 1.19 2005-10-18 18:49:46 stephena Exp $ //============================================================================ #include @@ -28,8 +28,9 @@ SettingsWin32::SettingsWin32(OSystem* osystem) : Settings(osystem) { - set("fragsize", "2048"); // Anything less than this usually causes sound skipping - set("video", "hard"); // Use software mode with hardware surface + set("fragsize", "2048"); // Anything less than this usually causes sound skipping + set("video", "hard"); // Use software mode with hardware surface + set("dirtyrects", "false") // Most Windows systems work better without this } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -