mirror of https://github.com/stella-emu/stella.git
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
This commit is contained in:
parent
afe8477d36
commit
e745cd4343
|
@ -462,10 +462,10 @@ Stella debugger.</p>
|
||||||
<tr><td> _reset</td><td> !(*SWCHB & $02)</td><td> Game Reset pressed</td></tr>
|
<tr><td> _reset</td><td> !(*SWCHB & $02)</td><td> Game Reset pressed</td></tr>
|
||||||
<tr><td> _color</td><td> *SWCHB & $08</td><td> Color/BW set to Color</td></tr>
|
<tr><td> _color</td><td> *SWCHB & $08</td><td> Color/BW set to Color</td></tr>
|
||||||
<tr><td> _bw</td><td> !(*SWCHB & $08)</td><td> Color/BW set to BW</td></tr>
|
<tr><td> _bw</td><td> !(*SWCHB & $08)</td><td> Color/BW set to BW</td></tr>
|
||||||
<tr><td> _diff0a</td><td> !(*SWCHB & $40)</td><td> Right difficulty set to A (easy)</td></tr>
|
<tr><td> _diff0b</td><td> !(*SWCHB & $40)</td><td> Right difficulty set to B (easy)</td></tr>
|
||||||
<tr><td> _diff0b</td><td> *SWCHB & $40</td><td> Right difficulty set to B (hard)</td></tr>
|
<tr><td> _diff0a</td><td> *SWCHB & $40</td><td> Right difficulty set to A (hard)</td></tr>
|
||||||
<tr><td> _diff1a</td><td> !(*SWCHB & $80)</td><td> Right difficulty set to A (easy)</td></tr>
|
<tr><td> _diff1b</td><td> !(*SWCHB & $80)</td><td> Right difficulty set to B (easy)</td></tr>
|
||||||
<tr><td> _diff1b</td><td> *SWCHB & $80</td><td> Right difficulty set to B (hard)</td></tr>
|
<tr><td> _diff1a</td><td> *SWCHB & $80</td><td> Right difficulty set to A (hard)</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p>Don't worry about memorizing them all: the Prompt "help" command
|
<p>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).</p>
|
that holds 'number of scanlines' on an actual console).</p>
|
||||||
<table border="1" cellpadding="3">
|
<table border="1" cellpadding="3">
|
||||||
<tr><th>Function</th><th>Description</th></tr>
|
<tr><th>Function</th><th>Description</th></tr>
|
||||||
<tr><td> _scan</td><td> current scanline count</td></tr>
|
<tr><td> _scan</td><td> Current scanline count</td></tr>
|
||||||
<tr><td> _bank</td><td> currently selected bank</td></tr>
|
<tr><td> _bank</td><td> Currently selected bank</td></tr>
|
||||||
<tr><td> _fcount</td><td> number of frames since emulation started</td></tr>
|
<tr><td> _fcount</td><td> Number of frames since emulation started</td></tr>
|
||||||
<tr><td> _cclocks</td><td> color clocks on a scanline</td></tr>
|
<tr><td> _cclocks</td><td> Color clocks on a scanline</td></tr>
|
||||||
<tr><td> _vsync</td><td> whether vertical sync is enabled (1 or 0)</td></tr>
|
<tr><td> _vsync</td><td> Whether vertical sync is enabled (1 or 0)</td></tr>
|
||||||
<tr><td> _vblank</td><td> whether vertical blank is enabled (1 or 0)</td></tr>
|
<tr><td> _vblank</td><td> Whether vertical blank is enabled (1 or 0)</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p><b>_scan</b> always contains the current scanline count. You can use
|
<p><b>_scan</b> always contains the current scanline count. You can use
|
||||||
|
@ -655,8 +655,7 @@ of the strobe registers at any time.</p>
|
||||||
<p>The collision registers are displayed in decoded format, in a table.
|
<p>The collision registers are displayed in decoded format, in a table.
|
||||||
You can see exactly which objects have hit what. These are read-only
|
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
|
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
|
course, you can clear all the collisions with the CXCLR Strobe button.</p>
|
||||||
Strobe button.</p>
|
|
||||||
|
|
||||||
<p>To the right of each color register, you'll see a small rectangle
|
<p>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
|
drawn in the current color. Changing a color register will change the
|
||||||
|
@ -673,7 +672,15 @@ in another part of the debugger).</p>
|
||||||
<p><img src="graphics/debugger_iotab.png"></p>
|
<p><img src="graphics/debugger_iotab.png"></p>
|
||||||
|
|
||||||
<p>As with the TIA tab, most of the values here will be self-explanatory to a 2600
|
<p>As with the TIA tab, most of the values here will be self-explanatory to a 2600
|
||||||
programmer, and almost all can be modified.<p>
|
programmer, and almost all can be modified. However, the SWCHx registers need
|
||||||
|
further explanation:<p>
|
||||||
|
<p>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.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
|
||||||
<!-- ///////////////////////////////////////////////////////////////////////// -->
|
<!-- ///////////////////////////////////////////////////////////////////////// -->
|
||||||
|
|
|
@ -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: 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 <sstream>
|
#include <sstream>
|
||||||
|
@ -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,
|
void FBSurfaceSoft::drawChar(const GUI::Font* font, uInt8 chr,
|
||||||
uInt32 tx, uInt32 ty, uInt32 color)
|
uInt32 tx, uInt32 ty, uInt32 color)
|
||||||
{
|
{
|
||||||
// TODO - test this in 16-bit, and re-write 24-bit
|
|
||||||
const FontDesc& desc = font->desc();
|
const FontDesc& desc = font->desc();
|
||||||
|
|
||||||
// If this character is not included in the font, use the default char.
|
// 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;
|
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
|
// Get buffer position where upper-left pixel of the character will be drawn
|
||||||
uInt8* buffer = (uInt8*) surface->pixels + myBaseOffset + yorig * myPitch + xorig;
|
uInt8* buffer = (uInt8*) mySurface->pixels + myBaseOffset +
|
||||||
uInt32 pixel = myDefPalette[color];
|
(ty + desc.ascent - bby - bbh) * myPitch +
|
||||||
uInt8 r = (pixel & myFormat->Rmask) >> myFormat->Rshift;
|
tx + bbx;
|
||||||
uInt8 g = (pixel & myFormat->Gmask) >> myFormat->Gshift;
|
|
||||||
uInt8 b = (pixel & myFormat->Bmask) >> myFormat->Bshift;
|
|
||||||
|
|
||||||
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++;
|
const uInt32 ptr = *tmp++;
|
||||||
int ystride = myZoomLevel;
|
uInt32 mask = 0x8000;
|
||||||
while(ystride--)
|
|
||||||
|
uInt8* buf_ptr = buffer;
|
||||||
|
for(int x = 0; x < bbw; x++, mask >>= 1)
|
||||||
{
|
{
|
||||||
if(fontbuf)
|
if(ptr & mask)
|
||||||
{
|
{
|
||||||
uInt32 mask = 0x80000000;
|
*buf_ptr++ = r; *buf_ptr++ = g; *buf_ptr++ = b;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
screenofsY += myPitch;
|
else
|
||||||
|
buf_ptr += 3;
|
||||||
}
|
}
|
||||||
|
buffer += myPitch;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
|
|
|
@ -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: 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"
|
#include "bspf.hxx"
|
||||||
|
@ -78,10 +78,10 @@ static const string builtin_functions[][3] = {
|
||||||
{ "_reset", "!(*SWCHB & $01)", "Game Reset pressed" },
|
{ "_reset", "!(*SWCHB & $01)", "Game Reset pressed" },
|
||||||
{ "_color", "*SWCHB & $08", "Color/BW set to Color" },
|
{ "_color", "*SWCHB & $08", "Color/BW set to Color" },
|
||||||
{ "_bw", "!(*SWCHB & $08)", "Color/BW set to BW" },
|
{ "_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 (easy)" },
|
||||||
{ "_diff0b", "*SWCHB & $40", "Right difficulty set to B (hard)" },
|
{ "_diff0a", "*SWCHB & $40", "Right difficulty set to A (hard)" },
|
||||||
{ "_diff1a", "!(*SWCHB & $80)", "Right difficulty set to A (easy)" },
|
{ "_diff1b", "!(*SWCHB & $80)", "Right difficulty set to B (easy)" },
|
||||||
{ "_diff1b", "*SWCHB & $80", "Right difficulty set to B (hard)" },
|
{ "_diff1a", "*SWCHB & $80", "Right difficulty set to A (hard)" },
|
||||||
|
|
||||||
// empty string marks end of list, do not remove
|
// empty string marks end of list, do not remove
|
||||||
{ "", "", "" }
|
{ "", "", "" }
|
||||||
|
|
|
@ -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: 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 <fstream>
|
#include <fstream>
|
||||||
|
@ -931,6 +931,13 @@ void DebuggerParser::executeHelp()
|
||||||
}
|
}
|
||||||
commandResult += "\nBuilt-in functions:\n";
|
commandResult += "\nBuilt-in functions:\n";
|
||||||
commandResult += debugger->builtinHelp();
|
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";
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -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: 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 <sstream>
|
#include <sstream>
|
||||||
|
@ -1877,7 +1877,7 @@ bool EventHandler::enterDebugMode()
|
||||||
{
|
{
|
||||||
myOSystem->debugger().setQuitState();
|
myOSystem->debugger().setQuitState();
|
||||||
setEventState(S_EMULATE);
|
setEventState(S_EMULATE);
|
||||||
myOSystem->frameBuffer().showMessage("Error creating debugger window, check dimensions");
|
myOSystem->frameBuffer().showMessage("Debugger window too large");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
myOverlay->reStack();
|
myOverlay->reStack();
|
||||||
|
|
|
@ -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: 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 <algorithm>
|
#include <algorithm>
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include "Font.hxx"
|
#include "Font.hxx"
|
||||||
#include "Launcher.hxx"
|
#include "Launcher.hxx"
|
||||||
#include "MediaSrc.hxx"
|
#include "MediaSrc.hxx"
|
||||||
|
#include "MediaFactory.hxx"
|
||||||
#include "Menu.hxx"
|
#include "Menu.hxx"
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
#include "Settings.hxx"
|
#include "Settings.hxx"
|
||||||
|
@ -80,12 +81,9 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
|
||||||
}
|
}
|
||||||
myInitializedCount++;
|
myInitializedCount++;
|
||||||
|
|
||||||
// Set fullscreen flag
|
// Make sure this mode is even possible
|
||||||
#ifdef WINDOWED_SUPPORT
|
if(myOSystem->desktopWidth() < width || myOSystem->desktopHeight() < height)
|
||||||
mySDLFlags = myOSystem->settings().getBool("fullscreen") ? SDL_FULLSCREEN : 0;
|
return false;
|
||||||
#else
|
|
||||||
mySDLFlags = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set the available video modes for this framebuffer
|
// Set the available video modes for this framebuffer
|
||||||
setAvailableVidModes(width, height);
|
setAvailableVidModes(width, height);
|
||||||
|
@ -98,6 +96,13 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
if(myInitializedCount == 1) setWindowIcon();
|
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))
|
if(!initSubsystem(mode))
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Couldn't initialize video subsystem" << endl;
|
cerr << "ERROR: Couldn't initialize video subsystem" << endl;
|
||||||
|
@ -777,11 +782,10 @@ const StringMap& FrameBuffer::supportedTIAFilters(const string& type)
|
||||||
myOSystem->desktopWidth(), myOSystem->desktopHeight());
|
myOSystem->desktopWidth(), myOSystem->desktopHeight());
|
||||||
uInt8 mask = (type == "soft" ? 0x1 : 0x2);
|
uInt8 mask = (type == "soft" ? 0x1 : 0x2);
|
||||||
|
|
||||||
#ifdef SMALL_SCREEN
|
|
||||||
uInt32 firstmode = 0;
|
|
||||||
#else
|
|
||||||
uInt32 firstmode = 1;
|
uInt32 firstmode = 1;
|
||||||
#endif
|
if(myOSystem->desktopWidth() < 640 || myOSystem->desktopHeight() < 480)
|
||||||
|
firstmode = 0;
|
||||||
|
|
||||||
myTIAFilters.clear();
|
myTIAFilters.clear();
|
||||||
for(uInt32 i = firstmode; i < GFX_NumModes; ++i)
|
for(uInt32 i = firstmode; i < GFX_NumModes; ++i)
|
||||||
{
|
{
|
||||||
|
@ -843,11 +847,12 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
|
||||||
// for the given dimensions
|
// for the given dimensions
|
||||||
uInt32 max_zoom = maxWindowSizeForScreen(baseWidth, baseHeight,
|
uInt32 max_zoom = maxWindowSizeForScreen(baseWidth, baseHeight,
|
||||||
myOSystem->desktopWidth(), myOSystem->desktopHeight());
|
myOSystem->desktopWidth(), myOSystem->desktopHeight());
|
||||||
#ifdef SMALL_SCREEN
|
|
||||||
uInt32 firstmode = 0;
|
// Figure our the smallest zoom level we can use
|
||||||
#else
|
|
||||||
uInt32 firstmode = 1;
|
uInt32 firstmode = 1;
|
||||||
#endif
|
if(myOSystem->desktopWidth() < 640 || myOSystem->desktopHeight() < 480)
|
||||||
|
firstmode = 0;
|
||||||
|
|
||||||
for(uInt32 i = firstmode; i < GFX_NumModes; ++i)
|
for(uInt32 i = firstmode; i < GFX_NumModes; ++i)
|
||||||
{
|
{
|
||||||
uInt32 zoom = ourGraphicsModes[i].zoom;
|
uInt32 zoom = ourGraphicsModes[i].zoom;
|
||||||
|
|
|
@ -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: 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
|
#ifndef MEDIA_FACTORY_HXX
|
||||||
|
@ -23,13 +23,15 @@ class FrameBuffer;
|
||||||
class Sound;
|
class Sound;
|
||||||
class OSystem;
|
class OSystem;
|
||||||
|
|
||||||
|
#include "Rect.hxx"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class deals with the different framebuffer/sound implementations
|
This class deals with the different framebuffer/sound implementations
|
||||||
for the various ports of Stella, and always returns a valid media object
|
for the various ports of Stella, and always returns a valid media object
|
||||||
based on the specific port and restrictions on that port.
|
based on the specific port and restrictions on that port.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@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
|
class MediaFactory
|
||||||
{
|
{
|
||||||
|
|
|
@ -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: 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 <cassert>
|
#include <cassert>
|
||||||
|
@ -192,7 +192,7 @@ bool OSystem::create()
|
||||||
// We can probably add ifdefs to take care of corner cases,
|
// We can probably add ifdefs to take care of corner cases,
|
||||||
// but the means we've failed to abstract it enough ...
|
// 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
|
// 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
|
// 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()
|
if(!createFrameBuffer()) // Takes care of initializeVideo()
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Couldn't create framebuffer for console" << endl;
|
cerr << "ERROR: Couldn't create framebuffer for console" << endl;
|
||||||
|
myEventHandler->reset(EventHandler::S_LAUNCHER);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
myConsole->initializeAudio();
|
myConsole->initializeAudio();
|
||||||
|
@ -828,6 +829,9 @@ void OSystem::queryVideoHardware()
|
||||||
myDesktopWidth = info->current_w;
|
myDesktopWidth = info->current_w;
|
||||||
myDesktopHeight = info->current_h;
|
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
|
// Then get the valid fullscreen modes
|
||||||
// If there are any errors, just use the desktop resolution
|
// If there are any errors, just use the desktop resolution
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
|
@ -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: 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
|
//#define DEBUG_HMOVE
|
||||||
|
@ -2013,73 +2013,71 @@ uInt8 TIA::peek(uInt16 addr)
|
||||||
// Update frame to current color clock before we look at anything!
|
// Update frame to current color clock before we look at anything!
|
||||||
updateFrame(mySystem->cycles() * 3);
|
updateFrame(mySystem->cycles() * 3);
|
||||||
|
|
||||||
uInt8 retval = 0x00;
|
uInt8 data = 0x00;
|
||||||
|
|
||||||
switch(addr & 0x000f)
|
switch(addr & 0x000f)
|
||||||
{
|
{
|
||||||
case CXM0P:
|
case CXM0P:
|
||||||
retval = ((myCollision & 0x0001) ? 0x80 : 0x00) |
|
data = ((myCollision & 0x0001) ? 0x80 : 0x00) |
|
||||||
((myCollision & 0x0002) ? 0x40 : 0x00);
|
((myCollision & 0x0002) ? 0x40 : 0x00);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CXM1P:
|
case CXM1P:
|
||||||
retval = ((myCollision & 0x0004) ? 0x80 : 0x00) |
|
data = ((myCollision & 0x0004) ? 0x80 : 0x00) |
|
||||||
((myCollision & 0x0008) ? 0x40 : 0x00);
|
((myCollision & 0x0008) ? 0x40 : 0x00);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CXP0FB:
|
case CXP0FB:
|
||||||
retval = ((myCollision & 0x0010) ? 0x80 : 0x00) |
|
data = ((myCollision & 0x0010) ? 0x80 : 0x00) |
|
||||||
((myCollision & 0x0020) ? 0x40 : 0x00);
|
((myCollision & 0x0020) ? 0x40 : 0x00);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CXP1FB:
|
case CXP1FB:
|
||||||
retval = ((myCollision & 0x0040) ? 0x80 : 0x00) |
|
data = ((myCollision & 0x0040) ? 0x80 : 0x00) |
|
||||||
((myCollision & 0x0080) ? 0x40 : 0x00);
|
((myCollision & 0x0080) ? 0x40 : 0x00);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CXM0FB:
|
case CXM0FB:
|
||||||
retval = ((myCollision & 0x0100) ? 0x80 : 0x00) |
|
data = ((myCollision & 0x0100) ? 0x80 : 0x00) |
|
||||||
((myCollision & 0x0200) ? 0x40 : 0x00);
|
((myCollision & 0x0200) ? 0x40 : 0x00);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CXM1FB:
|
case CXM1FB:
|
||||||
retval = ((myCollision & 0x0400) ? 0x80 : 0x00) |
|
data = ((myCollision & 0x0400) ? 0x80 : 0x00) |
|
||||||
((myCollision & 0x0800) ? 0x40 : 0x00);
|
((myCollision & 0x0800) ? 0x40 : 0x00);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CXBLPF:
|
case CXBLPF:
|
||||||
retval = (myCollision & 0x1000) ? 0x80 : 0x00;
|
data = (myCollision & 0x1000) ? 0x80 : 0x00;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CXPPMM:
|
case CXPPMM:
|
||||||
retval = ((myCollision & 0x2000) ? 0x80 : 0x00) |
|
data = ((myCollision & 0x2000) ? 0x80 : 0x00) |
|
||||||
((myCollision & 0x4000) ? 0x40 : 0x00);
|
((myCollision & 0x4000) ? 0x40 : 0x00);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INPT0:
|
case INPT0:
|
||||||
retval = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Nine));
|
data = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Nine));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INPT1:
|
case INPT1:
|
||||||
retval = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Five));
|
data = dumpedInputPort(myConsole.controller(Controller::Left).read(Controller::Five));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INPT2:
|
case INPT2:
|
||||||
retval = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Nine));
|
data = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Nine));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INPT3:
|
case INPT3:
|
||||||
retval = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Five));
|
data = dumpedInputPort(myConsole.controller(Controller::Right).read(Controller::Five));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INPT4:
|
case INPT4:
|
||||||
retval = myConsole.controller(Controller::Left).read(Controller::Six) ?
|
data = myConsole.controller(Controller::Left).read(Controller::Six) ? 0x80 : 0x00;
|
||||||
0x80 : 0x00;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INPT5:
|
case INPT5:
|
||||||
retval = myConsole.controller(Controller::Right).read(Controller::Six) ?
|
data = myConsole.controller(Controller::Right).read(Controller::Six) ? 0x80 : 0x00;
|
||||||
0x80 : 0x00;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x0e: // TODO - document this address
|
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
|
// On certain CMOS EPROM chips the unused TIA pins on a read are not
|
||||||
// floating but pulled high. Programmers might want to check their
|
// floating but pulled high. Programmers might want to check their
|
||||||
// games for compatibility, so we make this optional.
|
// games for compatibility, so we make this optional.
|
||||||
retval |= myFloatTIAOutputPins ? (mySystem->getDataBusState() & 0x3F) : 0x3F;
|
data |= myFloatTIAOutputPins ? (mySystem->getDataBusState() & 0x3F) : 0x3F;
|
||||||
|
|
||||||
return retval;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -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: 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
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -33,21 +33,11 @@ class TabWidget;
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#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.
|
This is the base class for all dialog boxes.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@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
|
class Dialog : public GuiObject
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,45 +13,31 @@
|
||||||
// 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: 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 <sstream>
|
|
||||||
|
|
||||||
class Properties;
|
|
||||||
|
|
||||||
#include "LauncherDialog.hxx"
|
#include "LauncherDialog.hxx"
|
||||||
#include "Version.hxx"
|
#include "Version.hxx"
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
#include "Settings.hxx"
|
#include "Settings.hxx"
|
||||||
#include "FrameBuffer.hxx"
|
#include "FrameBuffer.hxx"
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
#include "Launcher.hxx"
|
|
||||||
|
|
||||||
#ifdef SMALL_SCREEN
|
#include "Launcher.hxx"
|
||||||
#define MIN_WIDTH 320
|
|
||||||
#define MIN_HEIGHT 240
|
|
||||||
#else
|
|
||||||
#define MIN_WIDTH 640
|
|
||||||
#define MIN_HEIGHT 480
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Launcher::Launcher(OSystem* osystem)
|
Launcher::Launcher(OSystem* osystem)
|
||||||
: DialogContainer(osystem),
|
: DialogContainer(osystem)
|
||||||
myWidth(MIN_WIDTH),
|
|
||||||
myHeight(MIN_HEIGHT)
|
|
||||||
{
|
{
|
||||||
int w, h;
|
myOSystem->settings().getSize("launcherres", (int&)myWidth, (int&)myHeight);
|
||||||
myOSystem->settings().getSize("launcherres", w, h);
|
|
||||||
myWidth = BSPF_max(w, 0);
|
|
||||||
myHeight = BSPF_max(h, 0);
|
|
||||||
|
|
||||||
// Error check the resolution
|
// The launcher dialog is resizable, within certain bounds
|
||||||
myWidth = BSPF_max(myWidth, (uInt32)MIN_WIDTH);
|
// We check those bounds now
|
||||||
myWidth = BSPF_min(myWidth, osystem->desktopWidth());
|
myWidth = BSPF_max(myWidth, osystem->desktopWidth() >= 640 ? 640u : 320u);
|
||||||
myHeight = BSPF_max(myHeight, (uInt32)MIN_HEIGHT);
|
myHeight = BSPF_max(myHeight, osystem->desktopHeight() >= 480 ? 480u : 240u);
|
||||||
|
myWidth = BSPF_min(myWidth, osystem->desktopWidth());
|
||||||
myHeight = BSPF_min(myHeight, osystem->desktopHeight());
|
myHeight = BSPF_min(myHeight, osystem->desktopHeight());
|
||||||
|
|
||||||
myOSystem->settings().setSize("launcherres", myWidth, myHeight);
|
myOSystem->settings().setSize("launcherres", myWidth, myHeight);
|
||||||
|
|
||||||
myBaseDialog = new LauncherDialog(myOSystem, this, 0, 0, myWidth, myHeight);
|
myBaseDialog = new LauncherDialog(myOSystem, this, 0, 0, myWidth, myHeight);
|
||||||
|
|
|
@ -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.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
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -437,16 +437,21 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
myCurrentNode = FilesystemNode(rom);
|
myCurrentNode = FilesystemNode(rom);
|
||||||
updateListing();
|
updateListing();
|
||||||
}
|
}
|
||||||
else if(!LauncherFilterDialog::isValidRomName(rom, extension) ||
|
|
||||||
!instance().createConsole(rom, md5))
|
|
||||||
{
|
|
||||||
instance().frameBuffer().showMessage("Not a valid ROM file", kMiddleCenter);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if !defined(GP2X) // Quick GP2X hack to spare flash-card saves
|
if(LauncherFilterDialog::isValidRomName(rom, extension))
|
||||||
instance().settings().setString("lastrom", myList->getSelectedString());
|
{
|
||||||
#endif
|
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;
|
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: 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
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -22,6 +22,8 @@
|
||||||
#ifndef RECT_HXX
|
#ifndef RECT_HXX
|
||||||
#define RECT_HXX
|
#define RECT_HXX
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
|
@ -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: 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
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -230,11 +230,7 @@ void VideoDialog::loadConfig()
|
||||||
instance().frameBuffer().supportedTIAFilters(gl ? "gl" : "soft");
|
instance().frameBuffer().supportedTIAFilters(gl ? "gl" : "soft");
|
||||||
myTIAFilterPopup->addItems(items);
|
myTIAFilterPopup->addItems(items);
|
||||||
myTIAFilterPopup->setSelected(instance().settings().getString("tia_filter"),
|
myTIAFilterPopup->setSelected(instance().settings().getString("tia_filter"),
|
||||||
#ifdef SMALL_SCREEN
|
instance().desktopWidth() < 640 ? "zoom1x" : "zoom2x");
|
||||||
"zoom1x");
|
|
||||||
#else
|
|
||||||
"zoom2x");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TIA Palette
|
// TIA Palette
|
||||||
myTIAPalettePopup->setSelected(
|
myTIAPalettePopup->setSelected(
|
||||||
|
@ -342,11 +338,7 @@ void VideoDialog::setDefaults()
|
||||||
{
|
{
|
||||||
myRendererPopup->setSelected("soft", "");
|
myRendererPopup->setSelected("soft", "");
|
||||||
myTIAFilterPopup->setSelected(
|
myTIAFilterPopup->setSelected(
|
||||||
#ifdef SMALL_SCREEN
|
instance().desktopWidth() < 640 ? "zoom1x" : "zoom2x", "");
|
||||||
"zoom1x", "");
|
|
||||||
#else
|
|
||||||
"zoom2x", "");
|
|
||||||
#endif
|
|
||||||
myTIAPalettePopup->setSelected("standard", "");
|
myTIAPalettePopup->setSelected("standard", "");
|
||||||
myFSResPopup->setSelected("auto", "");
|
myFSResPopup->setSelected("auto", "");
|
||||||
myFrameTimingPopup->setSelected("sleep", "");
|
myFrameTimingPopup->setSelected("sleep", "");
|
||||||
|
|
Loading…
Reference in New Issue