From e745cd4343f7c1ffaba4ae4ebae77f79e2399847 Mon Sep 17 00:00:00 2001
From: stephena
Date: Wed, 14 Jan 2009 20:31:07 +0000
Subject: [PATCH] Partially updated codebase to consider 320x240 as the
absolute smallest screen size that can be used; Stella will fail with an
assert if this isn't the case. While in this 'small screen' mode, the
maximum TIA image is 1x, and the debugger isn't allowed at all. Fonts will
also be made much smaller. Still TODO is convert some dialogs that aren't
quite small enough (although they're all within 5-10 pixels of the correct
size).
Fixed FrameBuffer so that requesting a video mode that isn't possible
will now fail gracefully (essentially, return a 'false' instead of
going ahead and creating it anyway).
Fixed error in debugger functions for difficulty switches; they were
reversed.
Added debugger pseudo-registers to documentation and debugger 'help'
command.
Fixed drawing of fonts in 24-bit software rendering (although I have
no hardware to test it on).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1618 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
---
stella/docs/debugger.html | 33 +++++++++-------
stella/src/common/FrameBufferSoft.cxx | 52 +++++++++++---------------
stella/src/debugger/Debugger.cxx | 10 ++---
stella/src/debugger/DebuggerParser.cxx | 9 ++++-
stella/src/emucore/EventHandler.cxx | 4 +-
stella/src/emucore/FrameBuffer.cxx | 35 +++++++++--------
stella/src/emucore/MediaFactory.hxx | 6 ++-
stella/src/emucore/OSystem.cxx | 8 +++-
stella/src/emucore/TIA.cxx | 52 +++++++++++++-------------
stella/src/gui/Dialog.hxx | 14 +------
stella/src/gui/Launcher.cxx | 34 +++++------------
stella/src/gui/LauncherDialog.cxx | 23 +++++++-----
stella/src/gui/Rect.hxx | 4 +-
stella/src/gui/VideoDialog.cxx | 14 ++-----
14 files changed, 143 insertions(+), 155 deletions(-)
diff --git a/stella/docs/debugger.html b/stella/docs/debugger.html
index 2aae71b49..1fe074e01 100644
--- a/stella/docs/debugger.html
+++ b/stella/docs/debugger.html
@@ -462,10 +462,10 @@ Stella debugger.
_reset | !(*SWCHB & $02) | Game Reset pressed |
_color | *SWCHB & $08 | Color/BW set to Color |
_bw | !(*SWCHB & $08) | Color/BW set to BW |
- _diff0a | !(*SWCHB & $40) | Right difficulty set to A (easy) |
- _diff0b | *SWCHB & $40 | Right difficulty set to B (hard) |
- _diff1a | !(*SWCHB & $80) | Right difficulty set to A (easy) |
- _diff1b | *SWCHB & $80 | Right difficulty set to B (hard) |
+ _diff0b | !(*SWCHB & $40) | Right difficulty set to B (easy) |
+ _diff0a | *SWCHB & $40 | Right difficulty set to A (hard) |
+ _diff1b | !(*SWCHB & $80) | Right difficulty set to B (easy) |
+ _diff1a | *SWCHB & $80 | Right difficulty set to A (hard) |
Don't worry about memorizing them all: the Prompt "help" command
@@ -480,12 +480,12 @@ of scanlines in a frame, a real system would not (there is no register
that holds 'number of scanlines' on an actual console).
Function | Description |
- _scan | current scanline count |
- _bank | currently selected bank |
- _fcount | number of frames since emulation started |
- _cclocks | color clocks on a scanline |
- _vsync | whether vertical sync is enabled (1 or 0) |
- _vblank | whether vertical blank is enabled (1 or 0) |
+ _scan | Current scanline count |
+ _bank | Currently selected bank |
+ _fcount | Number of frames since emulation started |
+ _cclocks | Color clocks on a scanline |
+ _vsync | Whether vertical sync is enabled (1 or 0) |
+ _vblank | Whether vertical blank is enabled (1 or 0) |
_scan always contains the current scanline count. You can use
@@ -655,8 +655,7 @@ of the strobe registers at any time.
The collision registers are displayed in decoded format, in a table.
You can see exactly which objects have hit what. These are read-only
displays; you can't toggle the bits in the current release of Stella. Of
-course, you can clear all the collisions from the TIA tab with the CXCLR
-Strobe button.
+course, you can clear all the collisions with the CXCLR Strobe button.
To the right of each color register, you'll see a small rectangle
drawn in the current color. Changing a color register will change the
@@ -673,7 +672,15 @@ in another part of the debugger).
As with the TIA tab, most of the values here will be self-explanatory to a 2600
-programmer, and almost all can be modified.
+programmer, and almost all can be modified. However, the SWCHx registers need
+further explanation:
+
SWCHA(W) can be directly modified; here, the (W) stands for write. Similarly,
+SWACNT can be directly modified. However, the results of reading back from
+the SWCHA register are influenced by SWACNT, and SWCHA(R) is a read-only display
+reflecting this result.
+SWCHB cannot be directly modified; it will be indirectly modified by setting
+the various difficulty switches, color/BW button, select/reset, etc. SWBCNT
+is hardwired as read-only, and is not shown.
diff --git a/stella/src/common/FrameBufferSoft.cxx b/stella/src/common/FrameBufferSoft.cxx
index 34c008321..6c8bcea8a 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.92 2009-01-10 18:52:55 stephena Exp $
+// $Id: FrameBufferSoft.cxx,v 1.93 2009-01-14 20:31:07 stephena Exp $
//============================================================================
#include
@@ -566,7 +566,6 @@ void FBSurfaceSoft::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 colo
void FBSurfaceSoft::drawChar(const GUI::Font* font, uInt8 chr,
uInt32 tx, uInt32 ty, uInt32 color)
{
- // TODO - test this in 16-bit, and re-write 24-bit
const FontDesc& desc = font->desc();
// If this character is not included in the font, use the default char.
@@ -617,44 +616,35 @@ void FBSurfaceSoft::drawChar(const GUI::Font* font, uInt8 chr,
}
break;
}
- case 3:
+ case 3: // TODO - check if this actually works; I don't have access to a 24-bit video card
{
-#if 0
// Get buffer position where upper-left pixel of the character will be drawn
- uInt8* buffer = (uInt8*) surface->pixels + myBaseOffset + yorig * myPitch + xorig;
- uInt32 pixel = myDefPalette[color];
- uInt8 r = (pixel & myFormat->Rmask) >> myFormat->Rshift;
- uInt8 g = (pixel & myFormat->Gmask) >> myFormat->Gshift;
- uInt8 b = (pixel & myFormat->Bmask) >> myFormat->Bshift;
+ uInt8* buffer = (uInt8*) mySurface->pixels + myBaseOffset +
+ (ty + desc.ascent - bby - bbh) * myPitch +
+ tx + bbx;
- for(int y = h; y; --y)
+ uInt32 pixel = myFB.myDefPalette[color];
+ uInt8 r = (pixel & myFB.myFormat->Rmask) >> myFB.myFormat->Rshift;
+ uInt8 g = (pixel & myFB.myFormat->Gmask) >> myFB.myFormat->Gshift;
+ uInt8 b = (pixel & myFB.myFormat->Bmask) >> myFB.myFormat->Bshift;
+
+ for(int y = 0; y < bbh; y++)
{
- const uInt32 fontbuf = *tmp++;
- int ystride = myZoomLevel;
- while(ystride--)
+ const uInt32 ptr = *tmp++;
+ uInt32 mask = 0x8000;
+
+ uInt8* buf_ptr = buffer;
+ for(int x = 0; x < bbw; x++, mask >>= 1)
{
- if(fontbuf)
+ if(ptr & mask)
{
- uInt32 mask = 0x80000000;
- int pos = screenofsY;
- for(int x = 0; x < w; x++, mask >>= 1)
- {
- int xstride = myZoomLevel;
- if((fontbuf & mask) != 0)
- {
- while(xstride--)
- {
- buffer[pos++] = r; buffer[pos++] = g; buffer[pos++] = b;
- }
- }
- else
- pos += xstride + xstride + xstride;
- }
+ *buf_ptr++ = r; *buf_ptr++ = g; *buf_ptr++ = b;
}
- screenofsY += myPitch;
+ else
+ buf_ptr += 3;
}
+ buffer += myPitch;
}
-#endif
break;
}
case 4:
diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx
index a77d94110..eb2fe7a58 100644
--- a/stella/src/debugger/Debugger.cxx
+++ b/stella/src/debugger/Debugger.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: Debugger.cxx,v 1.130 2009-01-01 18:13:35 stephena Exp $
+// $Id: Debugger.cxx,v 1.131 2009-01-14 20:31:07 stephena Exp $
//============================================================================
#include "bspf.hxx"
@@ -78,10 +78,10 @@ static const string builtin_functions[][3] = {
{ "_reset", "!(*SWCHB & $01)", "Game Reset pressed" },
{ "_color", "*SWCHB & $08", "Color/BW set to Color" },
{ "_bw", "!(*SWCHB & $08)", "Color/BW set to BW" },
- { "_diff0a", "!(*SWCHB & $40)", "Right difficulty set to A (easy)" },
- { "_diff0b", "*SWCHB & $40", "Right difficulty set to B (hard)" },
- { "_diff1a", "!(*SWCHB & $80)", "Right difficulty set to A (easy)" },
- { "_diff1b", "*SWCHB & $80", "Right difficulty set to B (hard)" },
+ { "_diff0b", "!(*SWCHB & $40)", "Right difficulty set to B (easy)" },
+ { "_diff0a", "*SWCHB & $40", "Right difficulty set to A (hard)" },
+ { "_diff1b", "!(*SWCHB & $80)", "Right difficulty set to B (easy)" },
+ { "_diff1a", "*SWCHB & $80", "Right difficulty set to A (hard)" },
// empty string marks end of list, do not remove
{ "", "", "" }
diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx
index 5785accbd..2482a45c5 100644
--- a/stella/src/debugger/DebuggerParser.cxx
+++ b/stella/src/debugger/DebuggerParser.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: DebuggerParser.cxx,v 1.109 2009-01-01 18:13:35 stephena Exp $
+// $Id: DebuggerParser.cxx,v 1.110 2009-01-14 20:31:07 stephena Exp $
//============================================================================
#include
@@ -931,6 +931,13 @@ void DebuggerParser::executeHelp()
}
commandResult += "\nBuilt-in functions:\n";
commandResult += debugger->builtinHelp();
+ commandResult += "\nPseudo-registers:\n";
+ commandResult += "_scan Current scanline count\n";
+ commandResult += "_bank Currently selected bank\n";
+ commandResult += "_fcount Number of frames since emulation started\n";
+ commandResult += "_cclocks Color clocks on current scanline\n";
+ commandResult += "_vsync Whether vertical sync is enabled (1 or 0)\n";
+ commandResult += "_vblank Whether vertical blank is enabled (1 or 0)\n";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx
index ebad24f89..1722b8046 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.237 2009-01-11 19:10:40 stephena Exp $
+// $Id: EventHandler.cxx,v 1.238 2009-01-14 20:31:07 stephena Exp $
//============================================================================
#include
@@ -1877,7 +1877,7 @@ bool EventHandler::enterDebugMode()
{
myOSystem->debugger().setQuitState();
setEventState(S_EMULATE);
- myOSystem->frameBuffer().showMessage("Error creating debugger window, check dimensions");
+ myOSystem->frameBuffer().showMessage("Debugger window too large");
return false;
}
myOverlay->reStack();
diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx
index f0f9d6200..56503c7d3 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.159 2009-01-13 20:26:02 stephena Exp $
+// $Id: FrameBuffer.cxx,v 1.160 2009-01-14 20:31:07 stephena Exp $
//============================================================================
#include
@@ -28,6 +28,7 @@
#include "Font.hxx"
#include "Launcher.hxx"
#include "MediaSrc.hxx"
+#include "MediaFactory.hxx"
#include "Menu.hxx"
#include "OSystem.hxx"
#include "Settings.hxx"
@@ -80,12 +81,9 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
}
myInitializedCount++;
- // Set fullscreen flag
-#ifdef WINDOWED_SUPPORT
- mySDLFlags = myOSystem->settings().getBool("fullscreen") ? SDL_FULLSCREEN : 0;
-#else
- mySDLFlags = 0;
-#endif
+ // Make sure this mode is even possible
+ if(myOSystem->desktopWidth() < width || myOSystem->desktopHeight() < height)
+ return false;
// Set the available video modes for this framebuffer
setAvailableVidModes(width, height);
@@ -98,6 +96,13 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
setWindowTitle(title);
if(myInitializedCount == 1) setWindowIcon();
+ // Set fullscreen flag
+ #ifdef WINDOWED_SUPPORT
+ mySDLFlags = myOSystem->settings().getBool("fullscreen") ? SDL_FULLSCREEN : 0;
+ #else
+ mySDLFlags = 0;
+ #endif
+
if(!initSubsystem(mode))
{
cerr << "ERROR: Couldn't initialize video subsystem" << endl;
@@ -777,11 +782,10 @@ const StringMap& FrameBuffer::supportedTIAFilters(const string& type)
myOSystem->desktopWidth(), myOSystem->desktopHeight());
uInt8 mask = (type == "soft" ? 0x1 : 0x2);
-#ifdef SMALL_SCREEN
- uInt32 firstmode = 0;
-#else
uInt32 firstmode = 1;
-#endif
+ if(myOSystem->desktopWidth() < 640 || myOSystem->desktopHeight() < 480)
+ firstmode = 0;
+
myTIAFilters.clear();
for(uInt32 i = firstmode; i < GFX_NumModes; ++i)
{
@@ -843,11 +847,12 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
// for the given dimensions
uInt32 max_zoom = maxWindowSizeForScreen(baseWidth, baseHeight,
myOSystem->desktopWidth(), myOSystem->desktopHeight());
- #ifdef SMALL_SCREEN
- uInt32 firstmode = 0;
- #else
+
+ // Figure our the smallest zoom level we can use
uInt32 firstmode = 1;
- #endif
+ if(myOSystem->desktopWidth() < 640 || myOSystem->desktopHeight() < 480)
+ firstmode = 0;
+
for(uInt32 i = firstmode; i < GFX_NumModes; ++i)
{
uInt32 zoom = ourGraphicsModes[i].zoom;
diff --git a/stella/src/emucore/MediaFactory.hxx b/stella/src/emucore/MediaFactory.hxx
index 7b7577222..3ad55b319 100644
--- a/stella/src/emucore/MediaFactory.hxx
+++ b/stella/src/emucore/MediaFactory.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: MediaFactory.hxx,v 1.6 2009-01-01 18:13:36 stephena Exp $
+// $Id: MediaFactory.hxx,v 1.7 2009-01-14 20:31:07 stephena Exp $
//============================================================================
#ifndef MEDIA_FACTORY_HXX
@@ -23,13 +23,15 @@ class FrameBuffer;
class Sound;
class OSystem;
+#include "Rect.hxx"
+
/**
This class deals with the different framebuffer/sound implementations
for the various ports of Stella, and always returns a valid media object
based on the specific port and restrictions on that port.
@author Stephen Anthony
- @version $Id: MediaFactory.hxx,v 1.6 2009-01-01 18:13:36 stephena Exp $
+ @version $Id: MediaFactory.hxx,v 1.7 2009-01-14 20:31:07 stephena Exp $
*/
class MediaFactory
{
diff --git a/stella/src/emucore/OSystem.cxx b/stella/src/emucore/OSystem.cxx
index df38f296d..3eae8ed8e 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.146 2009-01-13 20:26:02 stephena Exp $
+// $Id: OSystem.cxx,v 1.147 2009-01-14 20:31:07 stephena Exp $
//============================================================================
#include
@@ -192,7 +192,7 @@ bool OSystem::create()
// We can probably add ifdefs to take care of corner cases,
// but the means we've failed to abstract it enough ...
////////////////////////////////////////////////////////////////////
- bool smallScreen = myDesktopWidth <= 320 || myDesktopHeight <= 240;
+ bool smallScreen = myDesktopWidth < 640 || myDesktopHeight < 480;
// This font is used in a variety of situations when a really small
// font is needed; we let the specific widget/dialog decide when to
@@ -429,6 +429,7 @@ bool OSystem::createConsole(const string& romfile, const string& md5sum)
if(!createFrameBuffer()) // Takes care of initializeVideo()
{
cerr << "ERROR: Couldn't create framebuffer for console" << endl;
+ myEventHandler->reset(EventHandler::S_LAUNCHER);
return false;
}
myConsole->initializeAudio();
@@ -828,6 +829,9 @@ void OSystem::queryVideoHardware()
myDesktopWidth = info->current_w;
myDesktopHeight = info->current_h;
+ // Various parts of the codebase assume a minimum screen size of 320x240
+ assert(myDesktopWidth >= 320 && myDesktopHeight >= 240);
+
// Then get the valid fullscreen modes
// If there are any errors, just use the desktop resolution
ostringstream buf;
diff --git a/stella/src/emucore/TIA.cxx b/stella/src/emucore/TIA.cxx
index a96919500..ce809c378 100644
--- a/stella/src/emucore/TIA.cxx
+++ b/stella/src/emucore/TIA.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: TIA.cxx,v 1.99 2009-01-13 01:18:24 stephena Exp $
+// $Id: TIA.cxx,v 1.100 2009-01-14 20:31:07 stephena Exp $
//============================================================================
//#define DEBUG_HMOVE
@@ -2013,73 +2013,71 @@ uInt8 TIA::peek(uInt16 addr)
// Update frame to current color clock before we look at anything!
updateFrame(mySystem->cycles() * 3);
- uInt8 retval = 0x00;
+ uInt8 data = 0x00;
switch(addr & 0x000f)
{
case CXM0P:
- retval = ((myCollision & 0x0001) ? 0x80 : 0x00) |
- ((myCollision & 0x0002) ? 0x40 : 0x00);
+ data = ((myCollision & 0x0001) ? 0x80 : 0x00) |
+ ((myCollision & 0x0002) ? 0x40 : 0x00);
break;
case CXM1P:
- retval = ((myCollision & 0x0004) ? 0x80 : 0x00) |
- ((myCollision & 0x0008) ? 0x40 : 0x00);
+ data = ((myCollision & 0x0004) ? 0x80 : 0x00) |
+ ((myCollision & 0x0008) ? 0x40 : 0x00);
break;
case CXP0FB:
- retval = ((myCollision & 0x0010) ? 0x80 : 0x00) |
- ((myCollision & 0x0020) ? 0x40 : 0x00);
+ data = ((myCollision & 0x0010) ? 0x80 : 0x00) |
+ ((myCollision & 0x0020) ? 0x40 : 0x00);
break;
case CXP1FB:
- retval = ((myCollision & 0x0040) ? 0x80 : 0x00) |
- ((myCollision & 0x0080) ? 0x40 : 0x00);
+ data = ((myCollision & 0x0040) ? 0x80 : 0x00) |
+ ((myCollision & 0x0080) ? 0x40 : 0x00);
break;
case CXM0FB:
- retval = ((myCollision & 0x0100) ? 0x80 : 0x00) |
- ((myCollision & 0x0200) ? 0x40 : 0x00);
+ data = ((myCollision & 0x0100) ? 0x80 : 0x00) |
+ ((myCollision & 0x0200) ? 0x40 : 0x00);
break;
case CXM1FB:
- retval = ((myCollision & 0x0400) ? 0x80 : 0x00) |
- ((myCollision & 0x0800) ? 0x40 : 0x00);
+ data = ((myCollision & 0x0400) ? 0x80 : 0x00) |
+ ((myCollision & 0x0800) ? 0x40 : 0x00);
break;
case CXBLPF:
- retval = (myCollision & 0x1000) ? 0x80 : 0x00;
+ data = (myCollision & 0x1000) ? 0x80 : 0x00;
break;
case CXPPMM:
- retval = ((myCollision & 0x2000) ? 0x80 : 0x00) |
- ((myCollision & 0x4000) ? 0x40 : 0x00);
+ data = ((myCollision & 0x2000) ? 0x80 : 0x00) |
+ ((myCollision & 0x4000) ? 0x40 : 0x00);
break;
case INPT0:
- retval = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Nine));
+ data = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Nine));
break;
case INPT1:
- retval = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Five));
+ data = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Five));
break;
case INPT2:
- retval = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Nine));
+ data = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Nine));
break;
case INPT3:
- retval = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Five));
+ data = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Five));
break;
case INPT4:
- retval = myConsole.controller(Controller::Left).read(Controller::Six) ?
- 0x80 : 0x00;
+ data = myConsole.controller(Controller::Left).read(Controller::Six) ? 0x80 : 0x00;
break;
case INPT5:
- retval = myConsole.controller(Controller::Right).read(Controller::Six) ?
- 0x80 : 0x00;
+ data = myConsole.controller(Controller::Right).read(Controller::Six) ? 0x80 : 0x00;
break;
case 0x0e: // TODO - document this address
@@ -2090,9 +2088,9 @@ uInt8 TIA::peek(uInt16 addr)
// On certain CMOS EPROM chips the unused TIA pins on a read are not
// floating but pulled high. Programmers might want to check their
// games for compatibility, so we make this optional.
- retval |= myFloatTIAOutputPins ? (mySystem->getDataBusState() & 0x3F) : 0x3F;
+ data |= myFloatTIAOutputPins ? (mySystem->getDataBusState() & 0x3F) : 0x3F;
- return retval;
+ return data;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/stella/src/gui/Dialog.hxx b/stella/src/gui/Dialog.hxx
index 8c1e980d1..4d2ab092c 100644
--- a/stella/src/gui/Dialog.hxx
+++ b/stella/src/gui/Dialog.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: Dialog.hxx,v 1.43 2009-01-06 23:02:18 stephena Exp $
+// $Id: Dialog.hxx,v 1.44 2009-01-14 20:31:07 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -33,21 +33,11 @@ class TabWidget;
#include "bspf.hxx"
-/*
-#ifdef SMALL_SCREEN
- #define _DLG_MIN_SWIDTH 320
- #define _DLG_MIN_SHEIGHT 210
-#else
- #define _DLG_MIN_SWIDTH 640
- #define _DLG_MIN_SHEIGHT 420
-#endif
-*/
-
/**
This is the base class for all dialog boxes.
@author Stephen Anthony
- @version $Id: Dialog.hxx,v 1.43 2009-01-06 23:02:18 stephena Exp $
+ @version $Id: Dialog.hxx,v 1.44 2009-01-14 20:31:07 stephena Exp $
*/
class Dialog : public GuiObject
{
diff --git a/stella/src/gui/Launcher.cxx b/stella/src/gui/Launcher.cxx
index e7ce90bb0..66a524ee0 100644
--- a/stella/src/gui/Launcher.cxx
+++ b/stella/src/gui/Launcher.cxx
@@ -13,45 +13,31 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Launcher.cxx,v 1.26 2009-01-01 18:13:38 stephena Exp $
+// $Id: Launcher.cxx,v 1.27 2009-01-14 20:31:07 stephena Exp $
//============================================================================
-#include
-
-class Properties;
-
#include "LauncherDialog.hxx"
#include "Version.hxx"
#include "OSystem.hxx"
#include "Settings.hxx"
#include "FrameBuffer.hxx"
#include "bspf.hxx"
-#include "Launcher.hxx"
-#ifdef SMALL_SCREEN
- #define MIN_WIDTH 320
- #define MIN_HEIGHT 240
-#else
- #define MIN_WIDTH 640
- #define MIN_HEIGHT 480
-#endif
+#include "Launcher.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Launcher::Launcher(OSystem* osystem)
- : DialogContainer(osystem),
- myWidth(MIN_WIDTH),
- myHeight(MIN_HEIGHT)
+ : DialogContainer(osystem)
{
- int w, h;
- myOSystem->settings().getSize("launcherres", w, h);
- myWidth = BSPF_max(w, 0);
- myHeight = BSPF_max(h, 0);
+ myOSystem->settings().getSize("launcherres", (int&)myWidth, (int&)myHeight);
- // Error check the resolution
- myWidth = BSPF_max(myWidth, (uInt32)MIN_WIDTH);
- myWidth = BSPF_min(myWidth, osystem->desktopWidth());
- myHeight = BSPF_max(myHeight, (uInt32)MIN_HEIGHT);
+ // The launcher dialog is resizable, within certain bounds
+ // We check those bounds now
+ myWidth = BSPF_max(myWidth, osystem->desktopWidth() >= 640 ? 640u : 320u);
+ myHeight = BSPF_max(myHeight, osystem->desktopHeight() >= 480 ? 480u : 240u);
+ myWidth = BSPF_min(myWidth, osystem->desktopWidth());
myHeight = BSPF_min(myHeight, osystem->desktopHeight());
+
myOSystem->settings().setSize("launcherres", myWidth, myHeight);
myBaseDialog = new LauncherDialog(myOSystem, this, 0, 0, myWidth, myHeight);
diff --git a/stella/src/gui/LauncherDialog.cxx b/stella/src/gui/LauncherDialog.cxx
index eec8c969e..470da0536 100644
--- a/stella/src/gui/LauncherDialog.cxx
+++ b/stella/src/gui/LauncherDialog.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: LauncherDialog.cxx,v 1.100 2009-01-11 19:10:40 stephena Exp $
+// $Id: LauncherDialog.cxx,v 1.101 2009-01-14 20:31:07 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -437,16 +437,21 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
myCurrentNode = FilesystemNode(rom);
updateListing();
}
- else if(!LauncherFilterDialog::isValidRomName(rom, extension) ||
- !instance().createConsole(rom, md5))
- {
- instance().frameBuffer().showMessage("Not a valid ROM file", kMiddleCenter);
- }
else
{
- #if !defined(GP2X) // Quick GP2X hack to spare flash-card saves
- instance().settings().setString("lastrom", myList->getSelectedString());
- #endif
+ if(LauncherFilterDialog::isValidRomName(rom, extension))
+ {
+ if(instance().createConsole(rom, md5))
+ {
+ #if !defined(GP2X) // Quick GP2X hack to spare flash-card saves
+ instance().settings().setString("lastrom", myList->getSelectedString());
+ #endif
+ }
+ else
+ instance().frameBuffer().showMessage("Error creating console (screen too small)", kMiddleCenter);
+ }
+ else
+ instance().frameBuffer().showMessage("Not a valid ROM file", kMiddleCenter);
}
}
break;
diff --git a/stella/src/gui/Rect.hxx b/stella/src/gui/Rect.hxx
index 5db5a544e..25c7c65ae 100644
--- a/stella/src/gui/Rect.hxx
+++ b/stella/src/gui/Rect.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: Rect.hxx,v 1.8 2009-01-01 18:13:39 stephena Exp $
+// $Id: Rect.hxx,v 1.9 2009-01-14 20:31:07 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -22,6 +22,8 @@
#ifndef RECT_HXX
#define RECT_HXX
+#include
+
#include "bspf.hxx"
namespace GUI {
diff --git a/stella/src/gui/VideoDialog.cxx b/stella/src/gui/VideoDialog.cxx
index 0d677b206..b9281b61d 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.62 2009-01-13 14:45:34 stephena Exp $
+// $Id: VideoDialog.cxx,v 1.63 2009-01-14 20:31:07 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -230,11 +230,7 @@ void VideoDialog::loadConfig()
instance().frameBuffer().supportedTIAFilters(gl ? "gl" : "soft");
myTIAFilterPopup->addItems(items);
myTIAFilterPopup->setSelected(instance().settings().getString("tia_filter"),
-#ifdef SMALL_SCREEN
- "zoom1x");
-#else
- "zoom2x");
-#endif
+ instance().desktopWidth() < 640 ? "zoom1x" : "zoom2x");
// TIA Palette
myTIAPalettePopup->setSelected(
@@ -342,11 +338,7 @@ void VideoDialog::setDefaults()
{
myRendererPopup->setSelected("soft", "");
myTIAFilterPopup->setSelected(
-#ifdef SMALL_SCREEN
- "zoom1x", "");
-#else
- "zoom2x", "");
-#endif
+ instance().desktopWidth() < 640 ? "zoom1x" : "zoom2x", "");
myTIAPalettePopup->setSelected("standard", "");
myFSResPopup->setSelected("auto", "");
myFrameTimingPopup->setSelected("sleep", "");