mirror of
https://github.com/libretro/stella2023.git
synced 2024-11-27 02:40:37 +00:00
Some fixes for bugs mentioned on AtariAge. I only wish these had been
reported before I did the release: Added 'dirtyrects' commandline argument and also to the 'Video Settings' dialog box. This determines whether to use SDL_UpdateRect() or SDL_UpdateRects() in software rendering mode. Apparently, this has to be configurable, since some Windows systems work well with one or the other. Fixed bug where pressing F12 (snapshot) without have a snapshot directory defined caused a segfault. Made ROM launcher ignore case when sorting ROMs. So lowercase names are now embedded in the correct place, instead of being placed after all the uppercase names. Fixed ZIP ROM support when there are multiple items in a ZIP archive. Stella now searches the ZIP file for the first file ending in either '.bin' or '.a26' (not case sensitive). Reverted window resize key combos for OSX back to 'Cmd =' and 'Cmd -' to match the 1.4.2 release. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@849 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
d428b117e4
commit
42b4366ee3
@ -964,7 +964,7 @@
|
||||
|
||||
<tr>
|
||||
<td>Exit emulator</td>
|
||||
<td>Ctrl + q</td>
|
||||
<td>Control + q</td>
|
||||
<td>Cmd + q</td>
|
||||
</tr>
|
||||
|
||||
@ -986,6 +986,12 @@
|
||||
<td>Backslash (\)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Enter/exit debugger</td>
|
||||
<td>Backquote (`)</td>
|
||||
<td>Backquote (`)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Select Game</td>
|
||||
<td>F1</td>
|
||||
@ -1066,8 +1072,8 @@
|
||||
|
||||
<tr>
|
||||
<td>Cheat code entry</td>
|
||||
<td>Ctrl-C</td>
|
||||
<td>Ctrl-C</td>
|
||||
<td>Control + c</td>
|
||||
<td>Cmd + c</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -1531,13 +1537,13 @@
|
||||
<tr>
|
||||
<td>Resize window to next <i>larger</i> size</td>
|
||||
<td>Alt + =</td>
|
||||
<td>Shift-Cmd + =</td>
|
||||
<td>Cmd + =</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Resize window to next <i>smaller</i> size</td>
|
||||
<td>Alt + -</td>
|
||||
<td>Shift-Cmd + -</td>
|
||||
<td>Cmd + -</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -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 <SDL.h>
|
||||
@ -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
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -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 <algorithm>
|
||||
@ -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");
|
||||
|
@ -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 <sstream>
|
||||
@ -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");
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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 <cassert>
|
||||
@ -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,
|
||||
|
@ -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 <cassert>
|
||||
@ -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");
|
||||
|
@ -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 <cctype>
|
||||
#include <algorithm>
|
||||
|
||||
#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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -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;
|
||||
|
@ -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 <sstream>
|
||||
@ -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
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
Loading…
Reference in New Issue
Block a user