diff -Nru stella-4.0/Announce.txt stella-4.1.1/Announce.txt --- stella-4.0/Announce.txt 2014-06-20 23:38:19.000000000 +0000 +++ stella-4.1.1/Announce.txt 2014-09-14 19:58:37.000000000 +0000 @@ -9,7 +9,7 @@ SSSS ttt eeeee llll llll aaaaa =========================================================================== - Release 4.0 for Linux, MacOSX and Windows + Release 4.1.1 for Linux, MacOSX and Windows =========================================================================== The Atari 2600 Video Computer System (VCS), introduced in 1977, was the @@ -21,27 +21,27 @@ developed for Linux by Bradford W. Mott, however, it has been ported to a number of other platforms and is currently maintained by Stephen Anthony. -This is the 4.0 release of Stella for Linux, Mac OSX and Windows. The +This is the 4.1.1 release of Stella for Linux, Mac OSX and Windows. The distributions currently available are: - * Binaries for Windows XP/Vista/7/8 : - Stella-4.0-win32.exe (32-bit EXE installer) - Stella-4.0-x64.exe (64-bit EXE installer) - Stella-4.0-windows.zip (32/64 bit versions) + * Binaries for Windows XP_SP3/Vista/7/8 : + Stella-4.1.1-win32.exe (32-bit EXE installer) + Stella-4.1.1-x64.exe (64-bit EXE installer) + Stella-4.1.1-windows.zip (32/64 bit versions) * Binary distribution for MacOS X 10.5 and above : - Stella-4.0-macosx.dmg (32/64-bit Intel Universal Binary) + Stella-4.1.1-macosx.dmg (32/64-bit Intel Universal Binary) * Binary distribution in 32-bit & 64-bit Ubuntu DEB format : - stella_4.0-1_i386.deb - stella_4.0-1_amd64.deb + stella_4.1.1-1_i386.deb + stella_4.1.1-1_amd64.deb * Binary distribution in 32-bit & 64-bit RPM format : - stella-4.0-2.i386.rpm - stella-4.0-2.x86_64.rpm + stella-4.1.1-2.i386.rpm + stella-4.1.1-2.x86_64.rpm * Source code distribution for all platforms : - stella-4.0-src.tar.gz + stella-4.1.1-src.tar.gz Distribution Site diff -Nru stella-4.0/Changes.txt stella-4.1.1/Changes.txt --- stella-4.0/Changes.txt 2014-07-01 13:32:22.000000000 +0000 +++ stella-4.1.1/Changes.txt 2014-09-14 19:58:37.000000000 +0000 @@ -12,6 +12,46 @@ Release History =========================================================================== +4.1 to 4.1.1: (September 14, 2014) + + * Re-added 'uipalette' option due to popular demand (of at least one + person :)). + + * Fixed bug in Windows port where pressing 'Alt' key combos resulted in + an annoying system beep. Currently this is fixed by patching the SDL2 + library and including a modified version with Stella. + +-Have fun! + + +4.0 to 4.1: (September 1, 2014) + + * Improved 'DASH' bankswitching scheme support; there is now a debugger + tab for changing banks and viewing internal cart RAM, and + autodetection is now implemented. + + * Added 'MDM' (Menu Driven Megacart) bankswitch scheme as described on + AtariAge and originally developed by Edwin Blink. + + * Improved snapshot viewing in the ROM launcher; snapshots are now + scaled to the available space, and can better accommodate sizes + other than those generated by Stella itself. + + * Improved support on multi-monitor systems. Stella will now use the + same monitor for fullscreen-windowed mode switches. Special thanks + to Magnus Lind for patches that added this functionality. + + * Removed the 'bank' command from the debugger prompt, as it only worked + (inconsistently) with certain bankswitch types. The bankswitch UI + should now be used to query/set bank state. + + * Fixed bug in disassembly output; instructions at $F000 were never + being highlighted during execution. + + * The UNIX configure script now supports newer versions of Hurd. + Special thanks to Stephen Kitt for the patch. + + 3.9.3 to 4.0: (July 1, 2014) * Ported Stella to SDL2, which brings many new features. Among the @@ -50,8 +90,6 @@ * Updated included PNG library to latest stable version. --Have fun! - 3.9.2 to 3.9.3: (January 20, 2014) diff -Nru stella-4.0/configure stella-4.1.1/configure --- stella-4.0/configure 2014-02-19 15:34:22.000000000 +0000 +++ stella-4.1.1/configure 2014-07-02 12:16:16.000000000 +0000 @@ -524,7 +524,7 @@ echo_n "Checking hosttype... " echo $_host_os case $_host_os in - linux* | openbsd* | freebsd* | kfreebsd* | netbsd* | bsd* | gnu0.3 | sunos* | hpux* | beos*) + linux* | openbsd* | freebsd* | kfreebsd* | netbsd* | bsd* | gnu0.* | sunos* | hpux* | beos*) DEFINES="$DEFINES -DUNIX" _host_os=unix ;; diff -Nru stella-4.0/debian/changelog stella-4.1.1/debian/changelog --- stella-4.0/debian/changelog 2014-07-02 05:07:43.000000000 +0000 +++ stella-4.1.1/debian/changelog 2014-09-15 21:44:57.000000000 +0000 @@ -1,3 +1,17 @@ +stella (4.1.1-1) unstable; urgency=medium + + * New upstream version. + * Update licensing information. + + -- Stephen Kitt Mon, 15 Sep 2014 23:44:54 +0200 + +stella (4.1-1) unstable; urgency=medium + + * New upstream version. + * Drop hurd-gnu0.5.patch, merged upstream. + + -- Stephen Kitt Wed, 03 Sep 2014 09:11:33 +0200 + stella (4.0-2) unstable; urgency=medium * Support newer versions of Hurd. diff -Nru stella-4.0/debian/copyright stella-4.1.1/debian/copyright --- stella-4.0/debian/copyright 2014-07-01 21:21:41.000000000 +0000 +++ stella-4.1.1/debian/copyright 2014-09-15 21:44:14.000000000 +0000 @@ -15,12 +15,13 @@ 2010-2014 Stephen Kitt License: GPL-2+ -Files: src/cheat/CheatCodeDialog.* src/common/Array.hxx - src/common/FSNodeZIP.* src/common/SharedPtr.hxx - src/common/Stack.hxx src/debugger/gui/* - src/emucore/FrameBuffer.hxx src/emucore/FSNode.* src/gui/* - src/unix/FSNodePOSIX.cxx src/win32/FSNodeWin32.cxx - src/yacc/YaccParser.* +Files: + src/common/Array.hxx + src/common/SharedPtr.hxx + src/common/Stack.hxx + src/emucore/FrameBuffer.hxx + src/emucore/FSNode.* + src/gui/* Copyright: 2002-2004 The ScummVM project License: GPL-2+ diff -Nru stella-4.0/debian/patches/hurd-gnu0.5.patch stella-4.1.1/debian/patches/hurd-gnu0.5.patch --- stella-4.0/debian/patches/hurd-gnu0.5.patch 2014-07-02 05:04:22.000000000 +0000 +++ stella-4.1.1/debian/patches/hurd-gnu0.5.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Description: Support newer versions of Hurd -Author: Stephen Kitt - ---- a/configure -+++ b/configure -@@ -524,7 +524,7 @@ - echo_n "Checking hosttype... " - echo $_host_os - case $_host_os in -- linux* | openbsd* | freebsd* | kfreebsd* | netbsd* | bsd* | gnu0.3 | sunos* | hpux* | beos*) -+ linux* | openbsd* | freebsd* | kfreebsd* | netbsd* | bsd* | gnu0.* | sunos* | hpux* | beos*) - DEFINES="$DEFINES -DUNIX" - _host_os=unix - ;; diff -Nru stella-4.0/debian/patches/series stella-4.1.1/debian/patches/series --- stella-4.0/debian/patches/series 2014-07-02 05:03:34.000000000 +0000 +++ stella-4.1.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -hurd-gnu0.5.patch Binary files /tmp/dFfyyQ2vbU/stella-4.0/docs/graphics/options_misc.png and /tmp/MdMNC0It7P/stella-4.1.1/docs/graphics/options_misc.png differ diff -Nru stella-4.0/docs/index.html stella-4.1.1/docs/index.html --- stella-4.0/docs/index.html 2014-06-30 19:52:19.000000000 +0000 +++ stella-4.1.1/docs/index.html 2014-09-14 19:58:37.000000000 +0000 @@ -10,7 +10,7 @@

A multi-platform Atari 2600 VCS emulator

-

Release 4.0

+

Release 4.1.1



User's Guide

@@ -54,7 +54,7 @@


-
February 1999 - July 2014
+
February 1999 - September 2014
The Stella Team
Stella Homepage
@@ -354,13 +354,12 @@

Windows

-

The Windows version of Stella is designed to work on Windows XP/Vista/7/8 +

The Windows version of Stella is designed to work on Windows XP_SP3/Vista/7/8 with the following:

  • Direct3D or OpenGL capable video card
  • -
  • 64-bit port has been tested on Windows Vista and above only; it may work on - WinXP64 as well, but isn't a priority
  • +
  • 64-bit port has been tested on Windows Vista and above only
  • Visual C++ 2012/2013 (or Express version) is required to compile the Stella source code
@@ -2095,6 +2094,11 @@ +
-uipalette <standard|classic>
+ Use the specified palette for UI elements. + + +
-listdelay <delay>
Set the amount of time to wait between treating successive keypresses as a single word in list widgets (value can range @@ -2476,6 +2480,7 @@ +
ItemBrief descriptionFor more information,
see CommandLine
Interface Palettepalette to use for UI elements-uipalette
List quick delaytime to wait between keypresses in listwidget-listdelay
Mouse wheel scrollnumber of lines mouse scroll will move in listwidget-mscroll
@@ -3206,7 +3211,7 @@ BFSC CPUWIZ 256K + ram CM ¹Spectravideo CompuMate CV Commavid extra ram - DASH ¹²Boulder Dash 2 + DASH Boulder Dash 2 DF CPUWIZ 128K DFSC CPUWIZ 128K + ram DPC Pitfall II @@ -3226,6 +3231,7 @@ FA2 CBS RAM Plus 24/28K FE 8K Decathlon MC ¹²C. Wilkson Megacart + MDM Menu Driven Megacart SB 128-256k SUPERbanking UA 8K UA Ltd. X07 ¹64K AtariAge diff -Nru stella-4.0/src/cheat/BankRomCheat.cxx stella-4.1.1/src/cheat/BankRomCheat.cxx --- stella-4.0/src/cheat/BankRomCheat.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/cheat/BankRomCheat.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: BankRomCheat.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: BankRomCheat.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include "Console.hxx" @@ -54,7 +54,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool BankRomCheat::disable() { - int oldBank = myOSystem->console().cartridge().bank(); + int oldBank = myOSystem->console().cartridge().getBank(); myOSystem->console().cartridge().bank(bank); for(int i = 0; i < count; ++i) @@ -70,7 +70,7 @@ { if(!myEnabled) { - int oldBank = myOSystem->console().cartridge().bank(); + int oldBank = myOSystem->console().cartridge().getBank(); myOSystem->console().cartridge().bank(bank); for(int i = 0; i < count; ++i) diff -Nru stella-4.0/src/common/EventHandlerSDL2.cxx stella-4.1.1/src/common/EventHandlerSDL2.cxx --- stella-4.0/src/common/EventHandlerSDL2.cxx 2014-06-13 14:49:01.000000000 +0000 +++ stella-4.1.1/src/common/EventHandlerSDL2.cxx 2014-08-15 15:13:00.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandlerSDL2.cxx 2920 2014-06-13 14:49:01Z stephena $ +// $Id: EventHandlerSDL2.cxx 2977 2014-08-15 15:13:00Z stephena $ //============================================================================ #include "OSystem.hxx" @@ -36,12 +36,21 @@ { #ifdef JOYSTICK_SUPPORT // Initialize the joystick subsystem - if((SDL_InitSubSystem(SDL_INIT_JOYSTICK) >= 0) && (SDL_NumJoysticks() > 0)) + if(SDL_WasInit(SDL_INIT_JOYSTICK) != 0) { - int numSticks = SDL_NumJoysticks(); - for(int i = 0; i < numSticks; ++i) - addJoystick(new JoystickSDL2(i), i); + if(SDL_NumJoysticks() > 0) + { + int numSticks = SDL_NumJoysticks(); + for(int i = 0; i < numSticks; ++i) + addJoystick(new JoystickSDL2(i), i); + + myOSystem.logMessage("EventHandlerSDL2::initializeJoysticks() +sticks", 2); + } + else + myOSystem.logMessage("EventHandlerSDL2::initializeJoysticks() -sticks", 2); } + else + myOSystem.logMessage("EventHandlerSDL2::initializeJoysticks() failed!", 2); #endif } @@ -198,16 +207,16 @@ handleSystemEvent(EVENT_WINDOW_FOCUS_LOST); break; } - break; + break; // SDL_WINDOWEVENT } } } -#ifdef JOYSTICK_SUPPORT // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EventHandlerSDL2::JoystickSDL2::JoystickSDL2(int idx) : myStick(NULL) { +#ifdef JOYSTICK_SUPPORT myStick = SDL_JoystickOpen(idx); if(myStick) { @@ -215,13 +224,15 @@ SDL_JoystickNumAxes(myStick), SDL_JoystickNumButtons(myStick), SDL_JoystickNumHats(myStick), SDL_JoystickNumBalls(myStick)); } +#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EventHandlerSDL2::JoystickSDL2::~JoystickSDL2() { +#ifdef JOYSTICK_SUPPORT if(myStick) SDL_JoystickClose(myStick); myStick = NULL; -} #endif +} diff -Nru stella-4.0/src/common/EventHandlerSDL2.hxx stella-4.1.1/src/common/EventHandlerSDL2.hxx --- stella-4.0/src/common/EventHandlerSDL2.hxx 2014-06-11 16:06:17.000000000 +0000 +++ stella-4.1.1/src/common/EventHandlerSDL2.hxx 2014-08-15 15:13:00.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandlerSDL2.hxx 2916 2014-06-11 16:06:17Z stephena $ +// $Id: EventHandlerSDL2.hxx 2977 2014-08-15 15:13:00Z stephena $ //============================================================================ #ifndef EVENTHANDLER_SDL2_HXX @@ -29,7 +29,7 @@ that the Stella core can understand. @author Stephen Anthony - @version $Id: EventHandlerSDL2.hxx 2916 2014-06-11 16:06:17Z stephena $ + @version $Id: EventHandlerSDL2.hxx 2977 2014-08-15 15:13:00Z stephena $ */ class EventHandlerSDL2 : public EventHandler { @@ -68,7 +68,6 @@ private: SDL_Event myEvent; - #ifdef JOYSTICK_SUPPORT // A thin wrapper around a basic StellaJoystick, holding the pointer to // the underlying SDL stick. class JoystickSDL2 : public StellaJoystick @@ -80,7 +79,6 @@ private: SDL_Joystick* myStick; }; - #endif }; #endif diff -Nru stella-4.0/src/common/FBSurfaceSDL2.cxx stella-4.1.1/src/common/FBSurfaceSDL2.cxx --- stella-4.0/src/common/FBSurfaceSDL2.cxx 2014-05-14 22:29:53.000000000 +0000 +++ stella-4.1.1/src/common/FBSurfaceSDL2.cxx 2014-09-03 15:23:36.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FBSurfaceSDL2.cxx 2892 2014-05-14 22:29:53Z stephena $ +// $Id: FBSurfaceSDL2.cxx 2990 2014-09-03 15:23:36Z stephena $ //============================================================================ #include "FBSurfaceSDL2.hxx" @@ -26,42 +26,14 @@ mySurface(NULL), myTexture(NULL), mySurfaceIsDirty(true), + myIsVisible(true), myTexAccess(SDL_TEXTUREACCESS_STREAMING), myInterpolate(false), myBlendEnabled(false), myBlendAlpha(255), myStaticData(NULL) { - // Create a surface in the same format as the parent GL class - const SDL_PixelFormat* pf = myFB.myPixelFormat; - - mySurface = SDL_CreateRGBSurface(0, width, height, - pf->BitsPerPixel, pf->Rmask, pf->Gmask, pf->Bmask, pf->Amask); - - // We start out with the src and dst rectangles containing the same - // dimensions, indicating no scaling or re-positioning - mySrcR.x = mySrcR.y = myDstR.x = myDstR.y = 0; - mySrcR.w = myDstR.w = width; - mySrcR.h = myDstR.h = height; - - //////////////////////////////////////////////////// - // These *must* be set for the parent class - myPixels = (uInt32*) mySurface->pixels; - myPitch = mySurface->pitch / pf->BytesPerPixel; - //////////////////////////////////////////////////// - - if(data) - { - myTexAccess = SDL_TEXTUREACCESS_STATIC; - myStaticPitch = mySurface->w * 4; // we need pitch in 'bytes' - myStaticData = new uInt32[mySurface->w * mySurface->h]; - SDL_memcpy(myStaticData, data, mySurface->w * mySurface->h * 4); - } - - applyAttributes(false); - - // To generate texture - reload(); + createSurface(width, height, data); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -92,14 +64,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::drawSurface(const FBSurface* surface) -{ - const FBSurfaceSDL2* s = (const FBSurfaceSDL2*) surface; - SDL_Rect dst = s->myDstR; - SDL_BlitSurface(s->mySurface, &(s->mySrcR), mySurface, &dst); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt32 FBSurfaceSDL2::width() const { return mySurface->w; @@ -112,16 +76,14 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const GUI::Rect& FBSurfaceSDL2::srcRect() +const GUI::Rect& FBSurfaceSDL2::srcRect() const { - mySrcGUIR.setBounds(mySrcR.x, mySrcR.y, mySrcR.x+mySrcR.w, mySrcR.y+mySrcR.h); return mySrcGUIR; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const GUI::Rect& FBSurfaceSDL2::dstRect() +const GUI::Rect& FBSurfaceSDL2::dstRect() const { - myDstGUIR.setBounds(myDstR.x, myDstR.y, myDstR.x+myDstR.w, myDstR.y+myDstR.h); return myDstGUIR; } @@ -129,24 +91,34 @@ void FBSurfaceSDL2::setSrcPos(uInt32 x, uInt32 y) { mySrcR.x = x; mySrcR.y = y; + mySrcGUIR.moveTo(x, y); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL2::setSrcSize(uInt32 w, uInt32 h) { mySrcR.w = w; mySrcR.h = h; + mySrcGUIR.setWidth(w); mySrcGUIR.setHeight(h); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL2::setDstPos(uInt32 x, uInt32 y) { myDstR.x = x; myDstR.y = y; + myDstGUIR.moveTo(x, y); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL2::setDstSize(uInt32 w, uInt32 h) { myDstR.w = w; myDstR.h = h; + myDstGUIR.setWidth(w); myDstGUIR.setHeight(h); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FBSurfaceSDL2::setVisible(bool visible) +{ + myIsVisible = visible; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -157,13 +129,14 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL2::render() +bool FBSurfaceSDL2::render() { - if(mySurfaceIsDirty) + if(mySurfaceIsDirty && myIsVisible) { //cerr << "src: x=" << mySrcR.x << ", y=" << mySrcR.y << ", w=" << mySrcR.w << ", h=" << mySrcR.h << endl; //cerr << "dst: x=" << myDstR.x << ", y=" << myDstR.y << ", w=" << myDstR.w << ", h=" << myDstR.h << endl; +//cerr << "render()\n"; if(myTexAccess == SDL_TEXTUREACCESS_STREAMING) SDL_UpdateTexture(myTexture, &mySrcR, mySurface->pixels, mySurface->pitch); SDL_RenderCopy(myFB.myRenderer, myTexture, &mySrcR, &myDstR); @@ -171,8 +144,9 @@ mySurfaceIsDirty = false; // Let postFrameUpdate() know that a change has been made - myFB.myDirtyFlag = true; + return myFB.myDirtyFlag = true; } + return false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -212,6 +186,57 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FBSurfaceSDL2::resize(uInt32 width, uInt32 height) +{ + // We will only resize when necessary, and not using static textures + if((myTexAccess == SDL_TEXTUREACCESS_STATIC) || + (int(width) <= mySurface->w && int(height) <= mySurface->h)) + return; // don't need to resize at all + + if(mySurface) + SDL_FreeSurface(mySurface); + free(); + + createSurface(width, height, NULL); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FBSurfaceSDL2::createSurface(uInt32 width, uInt32 height, + const uInt32* data) +{ + // Create a surface in the same format as the parent GL class + const SDL_PixelFormat* pf = myFB.myPixelFormat; + + mySurface = SDL_CreateRGBSurface(0, width, height, + pf->BitsPerPixel, pf->Rmask, pf->Gmask, pf->Bmask, pf->Amask); + + // We start out with the src and dst rectangles containing the same + // dimensions, indicating no scaling or re-positioning + mySrcR.x = mySrcR.y = myDstR.x = myDstR.y = 0; + mySrcR.w = myDstR.w = width; + mySrcR.h = myDstR.h = height; + + //////////////////////////////////////////////////// + // These *must* be set for the parent class + myPixels = (uInt32*) mySurface->pixels; + myPitch = mySurface->pitch / pf->BytesPerPixel; + //////////////////////////////////////////////////// + + if(data) + { + myTexAccess = SDL_TEXTUREACCESS_STATIC; + myStaticPitch = mySurface->w * 4; // we need pitch in 'bytes' + myStaticData = new uInt32[mySurface->w * mySurface->h]; + SDL_memcpy(myStaticData, data, mySurface->w * mySurface->h * 4); + } + + applyAttributes(false); + + // To generate texture + reload(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL2::applyAttributes(bool immediate) { myInterpolate = myAttributes.smoothing; diff -Nru stella-4.0/src/common/FBSurfaceSDL2.hxx stella-4.1.1/src/common/FBSurfaceSDL2.hxx --- stella-4.0/src/common/FBSurfaceSDL2.hxx 2014-05-14 22:04:59.000000000 +0000 +++ stella-4.1.1/src/common/FBSurfaceSDL2.hxx 2014-08-28 14:21:44.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FBSurfaceSDL2.hxx 2891 2014-05-14 22:04:59Z stephena $ +// $Id: FBSurfaceSDL2.hxx 2979 2014-08-28 14:21:44Z stephena $ //============================================================================ #ifndef FBSURFACE_SDL2_HXX @@ -40,31 +40,34 @@ // the ones implemented here use SDL-specific code for extra performance // void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color); - void drawSurface(const FBSurface* surface); // With hardware surfaces, it's faster to just update the entire surface - void addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h) { mySurfaceIsDirty = true; } - void addDirtyRect() { mySurfaceIsDirty = true; } + void setDirty() { mySurfaceIsDirty = true; } uInt32 width() const; uInt32 height() const; - const GUI::Rect& srcRect(); - const GUI::Rect& dstRect(); + const GUI::Rect& srcRect() const; + const GUI::Rect& dstRect() const; void setSrcPos(uInt32 x, uInt32 y); void setSrcSize(uInt32 w, uInt32 h); void setDstPos(uInt32 x, uInt32 y); void setDstSize(uInt32 w, uInt32 h); + void setVisible(bool visible); void translateCoords(Int32& x, Int32& y) const; - void render(); + bool render(); void invalidate(); void free(); void reload(); + void resize(uInt32 width, uInt32 height); protected: void applyAttributes(bool immediate); private: + void createSurface(uInt32 width, uInt32 height, const uInt32* data); + + private: FrameBufferSDL2& myFB; SDL_Surface* mySurface; @@ -72,6 +75,7 @@ SDL_Rect mySrcR, myDstR; bool mySurfaceIsDirty; + bool myIsVisible; SDL_TextureAccess myTexAccess; // Is pixel data constant or can it change? bool myInterpolate; // Scaling is smoothed or blocky diff -Nru stella-4.0/src/common/FrameBufferSDL2.cxx stella-4.1.1/src/common/FrameBufferSDL2.cxx --- stella-4.0/src/common/FrameBufferSDL2.cxx 2014-06-30 22:46:33.000000000 +0000 +++ stella-4.1.1/src/common/FrameBufferSDL2.cxx 2014-09-01 21:17:33.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferSDL2.cxx 2944 2014-06-30 22:46:33Z stephena $ +// $Id: FrameBufferSDL2.cxx 2987 2014-09-01 21:17:33Z stephena $ //============================================================================ #include @@ -42,13 +42,14 @@ myDblBufferedFlag(true) { // Initialize SDL2 context - if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) + if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) { ostringstream buf; buf << "ERROR: Couldn't initialize SDL: " << SDL_GetError() << endl; myOSystem.logMessage(buf.str(), 0); return; } + myOSystem.logMessage("FrameBufferSDL2::FrameBufferSDL2 SDL_Init()", 2); // We need a pixel format for palette value calculations // It's done this way (vs directly accessing a FBSurfaceSDL2 object) @@ -77,13 +78,17 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FrameBufferSDL2::queryHardware(uInt32& w, uInt32& h, VariantList& renderers) +void FrameBufferSDL2::queryHardware(Common::Array& displays, + VariantList& renderers) { // First get the maximum windowed desktop resolution - SDL_DisplayMode desktop; - SDL_GetDesktopDisplayMode(0, &desktop); - w = desktop.w; - h = desktop.h; + SDL_DisplayMode display; + int maxDisplays = SDL_GetNumVideoDisplays(); + for(int i = 0; i < maxDisplays; ++i) + { + SDL_GetDesktopDisplayMode(i, &display); + displays.push_back(GUI::Size(display.w, display.h)); + } // For now, supported render types are hardcoded; eventually, SDL may // provide a method to query this @@ -97,6 +102,12 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Int32 FrameBufferSDL2::getCurrentDisplayIndex() +{ + return SDL_GetWindowDisplayIndex(myWindow); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool FrameBufferSDL2::setVideoMode(const string& title, const VideoMode& mode, bool /*fullscreen_toggle*/) { @@ -115,9 +126,26 @@ myRenderer = NULL; } + Int32 displayIndex = mode.fsIndex; + if(displayIndex == -1) + { + // windowed mode + if (myWindow) + { + // Show it on same screen as the previous window + displayIndex = SDL_GetWindowDisplayIndex(myWindow); + } + if(displayIndex < 0) + { + // fallback to the first screen + displayIndex = 0; + } + } + uInt32 pos = myOSystem.settings().getBool("center") - ? SDL_WINDOWPOS_CENTERED : SDL_WINDOWPOS_UNDEFINED; - uInt32 flags = mode.fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0; + ? SDL_WINDOWPOS_CENTERED_DISPLAY(displayIndex) + : SDL_WINDOWPOS_UNDEFINED_DISPLAY(displayIndex); + uInt32 flags = mode.fsIndex != -1 ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0; // OSX seems to have issues with destroying the window, and wants to keep // the same handle diff -Nru stella-4.0/src/common/FrameBufferSDL2.hxx stella-4.1.1/src/common/FrameBufferSDL2.hxx --- stella-4.0/src/common/FrameBufferSDL2.hxx 2014-06-30 22:46:33.000000000 +0000 +++ stella-4.1.1/src/common/FrameBufferSDL2.hxx 2014-09-01 21:17:33.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferSDL2.hxx 2944 2014-06-30 22:46:33Z stephena $ +// $Id: FrameBufferSDL2.hxx 2987 2014-09-01 21:17:33Z stephena $ //============================================================================ #ifndef FRAMEBUFFER_SDL2_HXX @@ -33,7 +33,7 @@ Behind the scenes, it may be using Direct3D, OpenGL(ES), etc. @author Stephen Anthony - @version $Id: FrameBufferSDL2.hxx 2944 2014-06-30 22:46:33Z stephena $ + @version $Id: FrameBufferSDL2.hxx 2987 2014-09-01 21:17:33Z stephena $ */ class FrameBufferSDL2 : public FrameBuffer { @@ -115,7 +115,16 @@ This method is called to query and initialize the video hardware for desktop and fullscreen resolution information. */ - void queryHardware(uInt32& w, uInt32& h, VariantList& renderers); + void queryHardware(Common::Array& displays, VariantList& renderers); + + /** + This method is called to query the video hardware for the index + of the display the current window is displayed on + + @return the current display index or a negative value if no + window is displayed + */ + Int32 getCurrentDisplayIndex(); /** This method is called to change to the given video mode. diff -Nru stella-4.0/src/common/PNGLibrary.cxx stella-4.1.1/src/common/PNGLibrary.cxx --- stella-4.0/src/common/PNGLibrary.cxx 2014-06-20 00:28:57.000000000 +0000 +++ stella-4.1.1/src/common/PNGLibrary.cxx 2014-08-28 14:21:44.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: PNGLibrary.cxx 2929 2014-06-20 00:28:57Z stephena $ +// $Id: PNGLibrary.cxx 2979 2014-08-28 14:21:44Z stephena $ //============================================================================ #include @@ -38,7 +38,6 @@ PNGLibrary::~PNGLibrary() { delete[] ReadInfo.buffer; - delete[] ReadInfo.line; delete[] ReadInfo.row_pointers; } @@ -115,8 +114,8 @@ // We're finished reading png_read_end(png_ptr, info_ptr); - // Scale image to surface dimensions - scaleImagetoSurface(surface); + // Load image into the surface, setting the correct dimensions + loadImagetoSurface(surface); // Cleanup done: @@ -258,16 +257,6 @@ ReadInfo.buffer_size = req_buffer_size; } - uInt32 req_line_size = w * 3; - if(req_line_size > ReadInfo.line_size) - { - delete[] ReadInfo.line; - ReadInfo.line = new uInt32[req_line_size]; - if(ReadInfo.line == NULL) - return false; - - ReadInfo.line_size = req_line_size; - } uInt32 req_row_size = h; if(req_row_size > ReadInfo.row_size) { @@ -287,53 +276,30 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void PNGLibrary::scaleImagetoSurface(FBSurface& surface) +void PNGLibrary::loadImagetoSurface(FBSurface& surface) { - // Figure out the original zoom level of the snapshot - // All snapshots generated by Stella are at most some multiple of 320 - // pixels wide - // The only complication is when the aspect ratio is changed, the width - // can range from 256 (80%) to 320 (100%) - // The following calculation will work up to approx. 16x zoom level, - // but since Stella only generates snapshots at up to 10x, we should - // be fine for a while ... - uInt32 izoom = uInt32(ceil(ReadInfo.width/320.0)), - szoom = surface.width()/320; - - uInt32 sw = ReadInfo.width / izoom * szoom, - sh = ReadInfo.height / izoom * szoom; - sw = BSPF_min(sw, surface.width()); - sh = BSPF_min(sh, surface.height()); - surface.setSrcSize(sw, sh); - surface.setDstSize(sw, sh); - - // Decompress the image, and scale it correctly - uInt32 buf_offset = ReadInfo.pitch * izoom; - uInt32 i_offset = 3 * izoom; - - // We can only scan at most the height of the image to the constraints of - // the surface height (some multiple of 256) - uInt32 iheight = BSPF_min((uInt32)ReadInfo.height, izoom * 256); - - // Grab each non-duplicate row of data from the image - uInt8* buffer = ReadInfo.buffer; - for(uInt32 irow = 0, srow = 0; irow < iheight; irow += izoom, buffer += buf_offset) + // First determine if we need to resize the surface + uInt32 iw = ReadInfo.width, ih = ReadInfo.height; + if(iw > surface.width() || ih > surface.height()) + surface.resize(iw, ih); + + // The source dimensions are set here; the destination dimensions are + // set by whoever owns the surface + surface.setSrcPos(0, 0); + surface.setSrcSize(iw, ih); + + // Convert RGB triples into pixels and store in the surface + uInt32 *s_buf, s_pitch; + surface.basePtr(s_buf, s_pitch); + uInt8* i_buf = ReadInfo.buffer; + uInt32 i_pitch = ReadInfo.pitch; + + for(uInt32 irow = 0; irow < ih; ++irow, i_buf += i_pitch, s_buf += s_pitch) { - // Scale the image data into the temporary line buffer - uInt8* i_ptr = buffer; - uInt32* l_ptr = ReadInfo.line; - for(uInt32 icol = 0; icol < ReadInfo.width; icol += izoom, i_ptr += i_offset) - { - uInt32 pixel = myFB.mapRGB(*i_ptr, *(i_ptr+1), *(i_ptr+2)); - uInt32 xstride = szoom; - while(xstride--) - *l_ptr++ = pixel; - } - - // Then fill the surface with those bytes - uInt32 ystride = szoom; - while(ystride--) - surface.drawPixels(ReadInfo.line, 0, srow++, sw); + uInt8* i_ptr = i_buf; + uInt32* s_ptr = s_buf; + for(uInt32 icol = 0; icol < ReadInfo.width; ++icol, i_ptr += 3) + *s_ptr++ = myFB.mapRGB(*i_ptr, *(i_ptr+1), *(i_ptr+2)); } } @@ -394,5 +360,5 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PNGLibrary::ReadInfoType PNGLibrary::ReadInfo = { - NULL, NULL, 0, 0, 0, NULL, 0, 0, 0 + NULL, NULL, 0, 0, 0, 0, 0 }; diff -Nru stella-4.0/src/common/PNGLibrary.hxx stella-4.1.1/src/common/PNGLibrary.hxx --- stella-4.0/src/common/PNGLibrary.hxx 2014-06-19 16:45:07.000000000 +0000 +++ stella-4.1.1/src/common/PNGLibrary.hxx 2014-08-28 14:21:44.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: PNGLibrary.hxx 2928 2014-06-19 16:45:07Z stephena $ +// $Id: PNGLibrary.hxx 2979 2014-08-28 14:21:44Z stephena $ //============================================================================ #ifndef PNGLIBRARY_HXX @@ -95,8 +95,7 @@ uInt8* buffer; png_bytep* row_pointers; png_uint_32 width, height, pitch; - uInt32* line; - uInt32 buffer_size, line_size, row_size; + uInt32 buffer_size, row_size; } ReadInfoType; static ReadInfoType ReadInfo; @@ -128,12 +127,12 @@ const VariantList& comments); /** - Scale the PNG data from 'ReadInfo' into the FBSurface. For now, scaling - is done on integer boundaries only (ie, 1x, 2x, etc up or down). + Load the PNG data from 'ReadInfo' into the FBSurface. The surface + is resized as necessary to accommodate the data. @param surface The FBSurface into which to place the PNG data */ - void scaleImagetoSurface(FBSurface& surface); + void loadImagetoSurface(FBSurface& surface); /** Write PNG tEXt chunks to the image. diff -Nru stella-4.0/src/common/tv_filters/atari_ntsc_impl.h stella-4.1.1/src/common/tv_filters/atari_ntsc_impl.h --- stella-4.0/src/common/tv_filters/atari_ntsc_impl.h 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/common/tv_filters/atari_ntsc_impl.h 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: atari_ntsc_impl.h 2833 2014-01-12 17:23:42Z stephena $ +// $Id: atari_ntsc_impl.h 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ /* Based on nes_ntsc 0.2.2. http://www.slack.net/~ant/ */ @@ -263,7 +263,7 @@ float* out = impl->to_rgb; int n; - n = burst_count; + //n = burst_count; FIXME: dead code detected by llvm scan-build do { float const* in = decoder; diff -Nru stella-4.0/src/common/Version.hxx stella-4.1.1/src/common/Version.hxx --- stella-4.0/src/common/Version.hxx 2014-07-01 13:32:22.000000000 +0000 +++ stella-4.1.1/src/common/Version.hxx 2014-09-14 19:58:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Version.hxx 2947 2014-07-01 13:32:22Z stephena $ +// $Id: Version.hxx 2995 2014-09-14 19:58:37Z stephena $ //============================================================================ #ifndef VERSION_HXX @@ -22,7 +22,7 @@ #include -#define STELLA_VERSION "4.0" -#define STELLA_BUILD atoi("$Rev: 2947 $" + 6) +#define STELLA_VERSION "4.1.1" +#define STELLA_BUILD atoi("$Rev: 2995 $" + 6) #endif diff -Nru stella-4.0/src/common/ZipHandler.cxx stella-4.1.1/src/common/ZipHandler.cxx --- stella-4.0/src/common/ZipHandler.cxx 2014-06-16 16:34:48.000000000 +0000 +++ stella-4.1.1/src/common/ZipHandler.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ZipHandler.cxx 2926 2014-06-16 16:34:48Z stephena $ +// $Id: ZipHandler.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include @@ -111,8 +111,7 @@ return length; else { - delete[] image; image = 0; - length = 0; + delete[] image; image = NULL; throw zip_error_s[err]; } diff -Nru stella-4.0/src/debugger/CartDebug.cxx stella-4.1.1/src/debugger/CartDebug.cxx --- stella-4.0/src/debugger/CartDebug.cxx 2014-06-16 16:34:48.000000000 +0000 +++ stella-4.1.1/src/debugger/CartDebug.cxx 2014-07-31 15:54:14.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDebug.cxx 2926 2014-06-16 16:34:48Z stephena $ +// $Id: CartDebug.cxx 2967 2014-07-31 15:54:14Z stephena $ //============================================================================ #include @@ -42,8 +42,14 @@ myRWPortAddress(0), myLabelLength(8) // longest pre-defined label { - // Zero-page RAM is always present - addRamArea(0x80, 128, 0, 0); + // Add Zero-page RAM addresses + for(uInt32 i = 0x80; i <= 0xFF; ++i) + { + myState.rport.push_back(i); + myState.wport.push_back(i); + myOldState.rport.push_back(i); + myOldState.wport.push_back(i); + } // Create bank information for each potential bank, and an extra one for ZP RAM // Banksizes greater than 4096 indicate multi-bank ROMs, but we handle only @@ -123,27 +129,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void CartDebug::addRamArea(uInt16 start, uInt16 size, - uInt16 roffset, uInt16 woffset) -{ - // First make sure this area isn't already present - for(uInt32 i = 0; i < myState.rport.size(); ++i) - if(myState.rport[i] == start + roffset || - myState.wport[i] == start + woffset) - return; - - // Otherwise, add a new area - for(uInt32 i = 0; i < size; ++i) - { - myState.rport.push_back(i + start + roffset); - myState.wport.push_back(i + start + woffset); - - myOldState.rport.push_back(i + start + roffset); - myOldState.wport.push_back(i + start + woffset); - } -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const DebuggerState& CartDebug::getState() { myState.ram.clear(); @@ -331,8 +316,8 @@ const DisassemblyTag& tag = myDisassembly.list[i]; const uInt16 address = tag.address & 0xFFF; - // Addresses marked as 'ROW' normally won't have an address - if(address) + // Exclude 'ROW'; they don't have a valid address + if(tag.type != CartDebug::ROW) { // Create a mapping from addresses to line numbers myAddrToLineList.insert(make_pair(address, i)); @@ -542,7 +527,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int CartDebug::getBank() { - return myConsole.cartridge().bank(); + return myConsole.cartridge().getBank(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru stella-4.0/src/debugger/CartDebug.hxx stella-4.1.1/src/debugger/CartDebug.hxx --- stella-4.0/src/debugger/CartDebug.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/debugger/CartDebug.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDebug.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartDebug.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef CART_DEBUG_HXX @@ -121,16 +121,6 @@ // write port area. int readFromWritePort(); - /** - Let the Cart debugger subsystem treat this area as addressable memory. - - @param start The beginning of the RAM area (0x0000 - 0x2000) - @param size Total number of bytes of area - @param roffset Offset to use when reading from RAM (read port) - @param woffset Offset to use when writing to RAM (write port) - */ - void addRamArea(uInt16 start, uInt16 size, uInt16 roffset, uInt16 woffset); - // The following two methods are meant to be used together // First, a call is made to disassemble(), which updates the disassembly // list; it will figure out when an actual complete disassembly is diff -Nru stella-4.0/src/debugger/Debugger.cxx stella-4.1.1/src/debugger/Debugger.cxx --- stella-4.0/src/debugger/Debugger.cxx 2014-06-13 19:53:44.000000000 +0000 +++ stella-4.1.1/src/debugger/Debugger.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.cxx 2923 2014-06-13 19:53:44Z stephena $ +// $Id: Debugger.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include "bspf.hxx" @@ -498,19 +498,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool Debugger::setBank(int bank) -{ - if(myConsole.cartridge().bankCount() > 1) - { - myConsole.cartridge().unlockBank(); - bool status = myConsole.cartridge().bank(bank); - myConsole.cartridge().lockBank(); - return status; - } - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Debugger::patchROM(int addr, int value) { return myConsole.cartridge().patch(addr, value); diff -Nru stella-4.0/src/debugger/Debugger.hxx stella-4.1.1/src/debugger/Debugger.hxx --- stella-4.0/src/debugger/Debugger.hxx 2014-06-20 23:01:11.000000000 +0000 +++ stella-4.1.1/src/debugger/Debugger.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.hxx 2931 2014-06-20 23:01:11Z stephena $ +// $Id: Debugger.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef DEBUGGER_HXX @@ -68,7 +68,7 @@ for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx 2931 2014-06-20 23:01:11Z stephena $ + @version $Id: Debugger.hxx 2960 2014-07-24 17:15:28Z stephena $ */ class Debugger : public DialogContainer { @@ -238,7 +238,6 @@ void setBreakPoint(int bp, bool set); - bool setBank(int bank); bool patchROM(int addr, int value); /** diff -Nru stella-4.0/src/debugger/DebuggerParser.cxx stella-4.1.1/src/debugger/DebuggerParser.cxx --- stella-4.0/src/debugger/DebuggerParser.cxx 2014-06-20 23:01:11.000000000 +0000 +++ stella-4.1.1/src/debugger/DebuggerParser.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerParser.cxx 2931 2014-06-20 23:01:11Z stephena $ +// $Id: DebuggerParser.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include @@ -644,36 +644,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// "bank" -void DebuggerParser::executeBank() -{ - int banks = debugger.cartDebug().bankCount(); - if(argCount == 0) - { - commandResult << debugger.cartDebug().getCartType() << ": "; - if(banks < 2) - commandResult << red("bankswitching not supported by this cartridge"); - else - { - commandResult << "current = " << debugger.cartDebug().getBank() - << " out of " << banks << " banks"; - } - } - else - { - if(banks == 1) - commandResult << red("bankswitching not supported by this cartridge"); - else if(args[0] >= banks) - commandResult << red("invalid bank number (must be 0 to ") - << (banks - 1) << ")"; - else if(debugger.setBank(args[0])) - commandResult << "switched bank OK"; - else - commandResult << red("error switching banks (bankswitching may not be supported)"); - } -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // "base" void DebuggerParser::executeBase() { @@ -1622,15 +1592,6 @@ }, { - "bank", - "Show # of banks, or switch to bank xx", - false, - true, - { kARG_WORD, kARG_END_ARGS }, - &DebuggerParser::executeBank - }, - - { "base", "Set default base (hex, dec, or bin)", true, diff -Nru stella-4.0/src/debugger/DebuggerParser.hxx stella-4.1.1/src/debugger/DebuggerParser.hxx --- stella-4.0/src/debugger/DebuggerParser.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/debugger/DebuggerParser.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerParser.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: DebuggerParser.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef DEBUGGER_PARSER_HXX @@ -72,7 +72,7 @@ private: enum { - kNumCommands = 71, + kNumCommands = 70, kMAX_ARG_TYPES = 10 }; @@ -126,7 +126,6 @@ // List of available command methods void executeA(); - void executeBank(); void executeBase(); void executeBreak(); void executeBreakif(); diff -Nru stella-4.0/src/debugger/DiStella.cxx stella-4.1.1/src/debugger/DiStella.cxx --- stella-4.0/src/debugger/DiStella.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/debugger/DiStella.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DiStella.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: DiStella.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include "bspf.hxx" @@ -307,10 +307,8 @@ if(referenced) // start a new line with a label { if(!line_empty) - { addEntry(CartDebug::ROW); - line_empty = true; - } + myDisasmBuf << Base::HEX4 << myPC+myOffset << "'L" << Base::HEX4 << myPC+myOffset << "'.byte " << "$" << Base::HEX2 << (int)Debugger::debugger().peek(myPC+myOffset); diff -Nru stella-4.0/src/debugger/gui/CartCTYWidget.cxx stella-4.1.1/src/debugger/gui/CartCTYWidget.cxx --- stella-4.0/src/debugger/gui/CartCTYWidget.cxx 2014-06-29 18:37:55.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartCTYWidget.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCTYWidget.cxx 2936 2014-06-29 18:37:55Z stephena $ +// $Id: CartCTYWidget.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include "CartCTY.hxx" @@ -69,7 +69,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeCTYWidget::loadConfig() { - myBank->setSelectedIndex(myCart.bank()-1); + myBank->setSelectedIndex(myCart.getBank()-1); CartDebugWidget::loadConfig(); } @@ -95,7 +95,7 @@ static const char* spot[] = { "", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" }; - uInt16 bank = myCart.bank(); + uInt16 bank = myCart.getBank(); buf << "Bank = " << dec << bank << ", hotspot = " << spot[bank]; return buf.str(); diff -Nru stella-4.0/src/debugger/gui/CartDASHWidget.cxx stella-4.1.1/src/debugger/gui/CartDASHWidget.cxx --- stella-4.0/src/debugger/gui/CartDASHWidget.cxx 1970-01-01 00:00:00.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartDASHWidget.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -0,0 +1,370 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: CartDASHWidget.cxx 2992 2014-09-06 00:33:17Z stephena $ +//============================================================================ + +#include "CartDASH.hxx" +#include "PopUpWidget.hxx" +#include "CartDASHWidget.hxx" + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +CartridgeDASHWidget::CartridgeDASHWidget( + GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, + int x, int y, int w, int h, CartridgeDASH& cart) + : CartDebugWidget(boss, lfont, nfont, x, y, w, h), + myCart(cart) +{ + uInt32 size = cart.mySize; + + ostringstream info; + info << "DASH cartridge - (64K ROM + RAM)\n" + << " 4-64K ROM (1K banks), 32K RAM (512b banks)\n" + << "Each 1K ROM selected by writing to $3F\n" + "Each 512b RAM selected by writing to $3E\n" + " First 512B of bank x (R)\n" + " First 512B of bank x+4 (+$800) (W)\n" + << "Startup bank = 0/-1/-1/0 (ROM)\n"; + + // Eventually, we should query this from the debugger/disassembler + uInt16 start = (cart.myImage[size-3] << 8) | cart.myImage[size-4]; + start -= start % 0x1000; + info << "Bank RORG" << " = $" << Common::Base::HEX4 << start << "\n"; + + int xpos = 10, + ypos = addBaseInformation(size, "A. Davie & T. Jentzsch", info.str()) + + myLineHeight; + + VariantList bankno; + for(uInt32 i = 0; i < myCart.ROM_BANK_COUNT; ++i) + bankno.push_back(i, i); + + VariantList banktype; + banktype.push_back("ROM", "ROM"); + banktype.push_back("RAM", "RAM"); + + for(uInt32 i = 0; i < 4; ++i) + { + int xpos_s, ypos_s = ypos; + + ostringstream label; + label << "Set segment " << i << " as: "; + + new StaticTextWidget(boss, _font, xpos, ypos, _font.getStringWidth(label.str()), + myFontHeight, label.str(), kTextAlignLeft); + ypos += myLineHeight + 8; + + xpos += 20; + myBankNumber[i] = + new PopUpWidget(boss, _font, xpos, ypos-2, _font.getStringWidth("Slot "), + myLineHeight, bankno, "Slot ", + 6*_font.getMaxCharWidth()); + addFocusWidget(myBankNumber[i]); + + xpos += myBankNumber[i]->getWidth(); + myBankType[i] = + new PopUpWidget(boss, _font, xpos, ypos-2, 5*_font.getMaxCharWidth(), + myLineHeight, banktype, " of ", _font.getStringWidth(" of ")); + addFocusWidget(myBankType[i]); + + xpos += myBankType[i]->getWidth() + 10; + + myBankCommit[i] = new ButtonWidget(boss, _font, xpos, ypos-4, + _font.getStringWidth(" Commit "), myButtonHeight, + "Commit", bankEnum[i]); + myBankCommit[i]->setTarget(this); + addFocusWidget(myBankCommit[i]); + + xpos_s = xpos + myBankCommit[i]->getWidth() + 20; + + StaticTextWidget* t; + int addr1 = start + (i*0x400), addr2 = addr1 + 0x1FF; + + label.str(""); + label << Common::Base::HEX4 << addr1 << "-" << Common::Base::HEX4 << addr2; + t = new StaticTextWidget(boss, _font, xpos_s, ypos_s+2, + _font.getStringWidth(label.str()), myFontHeight, label.str(), kTextAlignLeft); + + int xoffset = xpos_s+t->getWidth() + 10; + myBankState[2*i] = new EditTextWidget(boss, _font, xoffset, ypos_s, + w - xoffset - 10, myLineHeight, ""); + myBankState[2*i]->setEditable(false); + ypos_s += myLineHeight + 4; + + label.str(""); + label << Common::Base::HEX4 << (addr2 + 1) << "-" << Common::Base::HEX4 << (addr2 + 1 + 0x1FF); + new StaticTextWidget(boss, _font, xpos_s, ypos_s+2, + _font.getStringWidth(label.str()), myFontHeight, label.str(), kTextAlignLeft); + + myBankState[2*i+1] = new EditTextWidget(boss, _font, xoffset, ypos_s, + w - xoffset - 10, myLineHeight, ""); + myBankState[2*i+1]->setEditable(false); + + xpos = 10; + ypos+= 2 * myLineHeight; + } +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDASHWidget::saveOldState() +{ + myOldState.internalram.clear(); + + for(uInt32 i = 0; i < this->internalRamSize();i++) + myOldState.internalram.push_back(myCart.myRAM[i]); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDASHWidget::loadConfig() +{ + updateUIState(); + CartDebugWidget::loadConfig(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDASHWidget::handleCommand(CommandSender* sender, + int cmd, int data, int id) +{ + uInt16 segment = 0; + switch(cmd) + { + case kBank0Changed: + segment = 0; + break; + case kBank1Changed: + segment = 1; + break; + case kBank2Changed: + segment = 2; + break; + case kBank3Changed: + segment = 3; + break; + } + + // Ignore bank if either number or type hasn't been selected + if(myBankNumber[segment]->getSelected() < 0 || + myBankType[segment]->getSelected() < 0) + return; + + uInt8 bank = (segment << myCart.BANK_BITS) | + (myBankNumber[segment]->getSelected() & myCart.BIT_BANK_MASK); + + myCart.unlockBank(); + + if(myBankType[segment]->getSelectedTag() == "ROM") + myCart.bankROM(bank); + else + myCart.bankRAM(bank); + + myCart.lockBank(); + invalidate(); + updateUIState(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeDASHWidget::bankState() +{ + ostringstream& buf = buffer(); + int lastROMBank = -1; + bool lastSlotRAM = false; + + for(int i = 0; i < 8; ++i) + { + uInt16 bank = myCart.bankInUse[i]; + + if(bank == myCart.BANK_UNDEFINED) // never accessed + { + buf << " U!"; + } + else + { + int bankno = bank & myCart.BIT_BANK_MASK; + + if(bank & myCart.BITMASK_ROMRAM) // was RAM mapped here? + { + // RAM will always need a '+' placed somewhere, since it always + // consists of 512B segments + bool inFirstSlot = (i % 2 == 0); + if(!(inFirstSlot || lastSlotRAM)) + { + lastSlotRAM = false; + buf << " +"; + } + + if(bank & myCart.BITMASK_LOWERUPPER) // upper is write port + buf << " RAM " << bankno << "W"; + else + buf << " RAM " << bankno << "R"; + + if(inFirstSlot) + { + buf << " +"; + lastSlotRAM = true; + } + } + else + { + // ROM can be contiguous, since 2 512B segments can form a single + // 1K bank; in this case we only show the info once + bool highBankSame = (i % 2 == 1) && (bankno == lastROMBank); + if(!highBankSame) + { + buf << " ROM " << bankno; + lastROMBank = bankno; + } + else + lastROMBank = -1; + + lastSlotRAM = false; + } + } + + if((i+1) % 2 == 0 && i < 7) + buf << " /"; + } + + return buf.str(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDASHWidget::updateUIState() +{ + // Set contents for actual banks number and type + for(int i = 0; i < 4; ++i) + { + uInt16 segment = myCart.segmentInUse[i]; + + if(segment == myCart.BANK_UNDEFINED) + { + myBankNumber[i]->clearSelection(); + myBankType[i]->clearSelection(); + } + else + { + int bankno = segment & myCart.BIT_BANK_MASK; + const char* banktype = segment & myCart.BITMASK_ROMRAM ? "RAM" : "ROM"; + + myBankNumber[i]->setSelected(bankno); + myBankType[i]->setSelected(banktype); + } + } + + // Set description for each 512b bank state + for(int i = 0; i < 8; ++i) + { + uInt16 bank = myCart.bankInUse[i]; + + if(bank == myCart.BANK_UNDEFINED) // never accessed + { + myBankState[i]->setText("Undefined"); + } + else + { + ostringstream buf; + int bankno = bank & myCart.BIT_BANK_MASK; + + if(bank & myCart.BITMASK_ROMRAM) // was RAM mapped here? + { + if(bank & myCart.BITMASK_LOWERUPPER) // upper is write port + { + buf << "RAM " << bankno << " @ $" << Common::Base::HEX4 + << (bankno << myCart.RAM_BANK_TO_POWER) << " (W)"; + myBankState[i]->setText(buf.str()); + } + else + { + buf << "RAM " << bankno << " @ $" << Common::Base::HEX4 + << (bankno << myCart.RAM_BANK_TO_POWER) << " (R)"; + myBankState[i]->setText(buf.str()); + } + } + else + { + if(bank & myCart.BITMASK_LOWERUPPER) // upper is high 512b + { + buf << "ROM " << bankno << " @ $" << Common::Base::HEX4 + << ((bankno << myCart.RAM_BANK_TO_POWER) + myCart.RAM_BANK_SIZE); + myBankState[i]->setText(buf.str()); + } + else + { + buf << "ROM " << bankno << " @ $" << Common::Base::HEX4 + << (bankno << myCart.RAM_BANK_TO_POWER); + myBankState[i]->setText(buf.str()); + } + } + } + } +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt32 CartridgeDASHWidget::internalRamSize() +{ + return 32*1024; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt32 CartridgeDASHWidget::internalRamRPort(int start) +{ + return 0x0000 + start; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeDASHWidget::internalRamDescription() +{ + ostringstream desc; + desc << "Accessible 512b at a time via:\n" + << " $F000/$F200/$F400/etc used for Read Access\n" + << " $F800/$FA00/$FC00/etc used for Write Access (+$800)"; + + return desc.str(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const ByteArray& CartridgeDASHWidget::internalRamOld(int start, int count) +{ + myRamOld.clear(); + for(int i = 0; i < count; i++) + myRamOld.push_back(myOldState.internalram[start + i]); + return myRamOld; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const ByteArray& CartridgeDASHWidget::internalRamCurrent(int start, int count) +{ + myRamCurrent.clear(); + for(int i = 0; i < count; i++) + myRamCurrent.push_back(myCart.myRAM[start + i]); + return myRamCurrent; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDASHWidget::internalRamSetValue(int addr, uInt8 value) +{ + myCart.myRAM[addr] = value; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt8 CartridgeDASHWidget::internalRamGetValue(int addr) +{ + return myCart.myRAM[addr]; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const CartridgeDASHWidget::BankID CartridgeDASHWidget::bankEnum[4] = { + kBank0Changed, kBank1Changed, kBank2Changed, kBank3Changed +}; diff -Nru stella-4.0/src/debugger/gui/CartDASHWidget.hxx stella-4.1.1/src/debugger/gui/CartDASHWidget.hxx --- stella-4.0/src/debugger/gui/CartDASHWidget.hxx 1970-01-01 00:00:00.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartDASHWidget.hxx 2014-07-29 00:29:02.000000000 +0000 @@ -0,0 +1,79 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: CartDASHWidget.hxx 2964 2014-07-29 00:29:02Z stephena $ +//============================================================================ + +#ifndef CARTRIDGEDASH_WIDGET_HXX +#define CARTRIDGEDASH_WIDGET_HXX + +class CartridgeDASH; +class ButtonWidget; +class PopUpWidget; + +#include "CartDebugWidget.hxx" + +class CartridgeDASHWidget : public CartDebugWidget +{ + public: + CartridgeDASHWidget(GuiObject* boss, const GUI::Font& lfont, + const GUI::Font& nfont, + int x, int y, int w, int h, + CartridgeDASH& cart); + virtual ~CartridgeDASHWidget() { } + + void saveOldState(); + void loadConfig(); + void handleCommand(CommandSender* sender, int cmd, int data, int id); + + string bankState(); + + // start of functions for Cartridge RAM tab + uInt32 internalRamSize(); + uInt32 internalRamRPort(int start); + string internalRamDescription(); + const ByteArray& internalRamOld(int start, int count); + const ByteArray& internalRamCurrent(int start, int count); + void internalRamSetValue(int addr, uInt8 value); + uInt8 internalRamGetValue(int addr); + // end of functions for Cartridge RAM tab + + private: + void updateUIState(); + + private: + CartridgeDASH& myCart; + + PopUpWidget* myBankNumber[4]; + PopUpWidget* myBankType[4]; + ButtonWidget* myBankCommit[4]; + EditTextWidget* myBankState[8]; + + struct CartState { + ByteArray internalram; + }; + CartState myOldState; + + enum BankID { + kBank0Changed = 'b0CH', + kBank1Changed = 'b1CH', + kBank2Changed = 'b2CH', + kBank3Changed = 'b3CH' + }; + static const BankID bankEnum[4]; +}; + +#endif diff -Nru stella-4.0/src/debugger/gui/CartDPCPlusWidget.cxx stella-4.1.1/src/debugger/gui/CartDPCPlusWidget.cxx --- stella-4.0/src/debugger/gui/CartDPCPlusWidget.cxx 2014-07-01 13:42:50.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartDPCPlusWidget.cxx 2014-07-01 13:43:19.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDPCPlusWidget.cxx 2949 2014-07-01 13:42:50Z stephena $ +// $Id: CartDPCPlusWidget.cxx 2950 2014-07-01 13:43:19Z stephena $ //============================================================================ #include "CartDPCPlus.hxx" diff -Nru stella-4.0/src/debugger/gui/CartDPCWidget.cxx stella-4.1.1/src/debugger/gui/CartDPCWidget.cxx --- stella-4.0/src/debugger/gui/CartDPCWidget.cxx 2014-07-01 13:42:50.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartDPCWidget.cxx 2014-07-01 13:43:19.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDPCWidget.cxx 2949 2014-07-01 13:42:50Z stephena $ +// $Id: CartDPCWidget.cxx 2950 2014-07-01 13:43:19Z stephena $ //============================================================================ #include "CartDPC.hxx" diff -Nru stella-4.0/src/debugger/gui/CartFEWidget.cxx stella-4.1.1/src/debugger/gui/CartFEWidget.cxx --- stella-4.0/src/debugger/gui/CartFEWidget.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartFEWidget.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFEWidget.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartFEWidget.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include "CartFE.hxx" @@ -46,8 +46,8 @@ ostringstream& buf = buffer(); static const char* range[] = { "$F000", "$D000" }; - buf << "Bank = " << dec << myCart.bank() - << ", address range = " << range[myCart.bank()]; + buf << "Bank = " << dec << myCart.getBank() + << ", address range = " << range[myCart.getBank()]; return buf.str(); } diff -Nru stella-4.0/src/debugger/gui/CartMDMWidget.cxx stella-4.1.1/src/debugger/gui/CartMDMWidget.cxx --- stella-4.0/src/debugger/gui/CartMDMWidget.cxx 1970-01-01 00:00:00.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartMDMWidget.cxx 2014-09-04 20:34:58.000000000 +0000 @@ -0,0 +1,102 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: CartMDMWidget.cxx 2991 2014-09-04 20:34:58Z stephena $ +//============================================================================ + +#include "CartMDM.hxx" +#include "PopUpWidget.hxx" +#include "Widget.hxx" +#include "CartMDMWidget.hxx" + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +CartridgeMDMWidget::CartridgeMDMWidget( + GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, + int x, int y, int w, int h, CartridgeMDM& cart) + : CartDebugWidget(boss, lfont, nfont, x, y, w, h), + myCart(cart) +{ + uInt32 size = myCart.mySize; + + ostringstream info; + info << "Menu Driven Megacart, containing up to 128 4K banks\n" + << "Startup bank = " << cart.myStartBank << "\n" + << "\nBanks are selected by reading from $800 - $FFF, where the lower " + "byte determines the 4K bank to use."; + + int xpos = 10, + ypos = addBaseInformation(size, "Edwin Blink", info.str(), 15) + myLineHeight; + + VariantList items; + for(uInt32 i = 0x800; i < (0x800u + myCart.bankCount()); ++i) + { + info.str(""); + info << dec << (i & 0xFF) << " ($" << Common::Base::HEX4 << i << ")"; + items.push_back(info.str()); + } + + myBank = + new PopUpWidget(boss, _font, xpos, ypos-2, _font.getStringWidth("xxx ($0FFF) "), + myLineHeight, items, "Set bank: ", + _font.getStringWidth("Set bank: "), kBankChanged); + myBank->setTarget(this); + addFocusWidget(myBank); + + xpos += myBank->getWidth() + 30; + myBankDisabled = new CheckboxWidget(boss, _font, xpos, ypos, + "Bankswitching is locked/disabled", + kBankDisabled); + myBankDisabled->setTarget(this); + addFocusWidget(myBankDisabled); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeMDMWidget::loadConfig() +{ + myBank->setSelectedIndex(myCart.myCurrentBank); + myBankDisabled->setState(myCart.myBankingDisabled); + + CartDebugWidget::loadConfig(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeMDMWidget::handleCommand(CommandSender* sender, + int cmd, int data, int id) +{ + if(cmd == kBankChanged) + { + myCart.unlockBank(); + myCart.bank(myBank->getSelected()); + myCart.lockBank(); + invalidate(); + } + else if(cmd == kBankDisabled) + { + myCart.myBankingDisabled = myBankDisabled->getState(); + } +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeMDMWidget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Bank = " << dec << myCart.myCurrentBank + << ", hotspot = " << "$" << Common::Base::HEX4 + << (myCart.myCurrentBank+0x800); + + return buf.str(); +} diff -Nru stella-4.0/src/debugger/gui/CartMDMWidget.hxx stella-4.1.1/src/debugger/gui/CartMDMWidget.hxx --- stella-4.0/src/debugger/gui/CartMDMWidget.hxx 1970-01-01 00:00:00.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/CartMDMWidget.hxx 2014-08-31 23:16:57.000000000 +0000 @@ -0,0 +1,51 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: CartMDMWidget.hxx 2983 2014-08-31 23:16:57Z stephena $ +//============================================================================ + +#ifndef CARTRIDGEMDM_WIDGET_HXX +#define CARTRIDGEMDM_WIDGET_HXX + +class CartridgeMDM; +class CheckboxWidget; +class PopUpWidget; + +#include "CartDebugWidget.hxx" + +class CartridgeMDMWidget : public CartDebugWidget +{ + public: + CartridgeMDMWidget(GuiObject* boss, const GUI::Font& lfont, + const GUI::Font& nfont, + int x, int y, int w, int h, + CartridgeMDM& cart); + virtual ~CartridgeMDMWidget() { } + + void loadConfig(); + void handleCommand(CommandSender* sender, int cmd, int data, int id); + + string bankState(); + + private: + CartridgeMDM& myCart; + PopUpWidget* myBank; + CheckboxWidget* myBankDisabled; + + enum { kBankChanged = 'bkCH', kBankDisabled = 'bkDI' }; +}; + +#endif diff -Nru stella-4.0/src/debugger/gui/DataGridWidget.cxx stella-4.1.1/src/debugger/gui/DataGridWidget.cxx --- stella-4.0/src/debugger/gui/DataGridWidget.cxx 2014-06-10 21:04:36.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/DataGridWidget.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DataGridWidget.cxx 2914 2014-06-10 21:04:36Z stephena $ +// $Id: DataGridWidget.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include "OSystem.hxx" @@ -542,7 +542,7 @@ { //cerr << "DataGridWidget::drawWidget\n"; FBSurface& s = _boss->dialog().surface(); - int row, col, deltax; + int row, col; // Draw the internal grid and labels int linewidth = _cols * _colWidth; @@ -569,15 +569,12 @@ if (_selectedItem == pos && _editMode) { adjustOffset(); - deltax = -_editScrollOffset; s.drawString(_font, _editString, x, y, _colWidth, kTextColor, - kTextAlignLeft, deltax, false); + kTextAlignLeft, -_editScrollOffset, false); } else { - deltax = 0; - uInt32 color = kTextColor; if(_changedList[pos]) { diff -Nru stella-4.0/src/debugger/gui/DebuggerDialog.cxx stella-4.1.1/src/debugger/gui/DebuggerDialog.cxx --- stella-4.0/src/debugger/gui/DebuggerDialog.cxx 2014-06-29 18:37:55.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/DebuggerDialog.cxx 2014-07-31 17:05:21.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerDialog.cxx 2936 2014-06-29 18:37:55Z stephena $ +// $Id: DebuggerDialog.cxx 2968 2014-07-31 17:05:21Z stephena $ //============================================================================ #include "Widget.hxx" @@ -153,7 +153,8 @@ break; case RomWidget::kInvalidateListing: - myRom->invalidate(); + // Only do a full redraw if the disassembly tab is actually showing + myRom->invalidate(myRomTab->getActiveTab() == 0); break; default: diff -Nru stella-4.0/src/debugger/gui/module.mk stella-4.1.1/src/debugger/gui/module.mk --- stella-4.0/src/debugger/gui/module.mk 2014-06-29 23:25:53.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/module.mk 2014-08-29 15:33:04.000000000 +0000 @@ -32,6 +32,7 @@ src/debugger/gui/CartCMWidget.o \ src/debugger/gui/CartCTYWidget.o \ src/debugger/gui/CartCVWidget.o \ + src/debugger/gui/CartDASHWidget.o \ src/debugger/gui/CartDPCWidget.o \ src/debugger/gui/CartDPCPlusWidget.o \ src/debugger/gui/CartE0Widget.o \ @@ -53,6 +54,7 @@ src/debugger/gui/CartFA2Widget.o \ src/debugger/gui/CartFEWidget.o \ src/debugger/gui/CartMCWidget.o \ + src/debugger/gui/CartMDMWidget.o \ src/debugger/gui/CartSBWidget.o \ src/debugger/gui/CartUAWidget.o \ src/debugger/gui/CartX07Widget.o \ diff -Nru stella-4.0/src/debugger/gui/RomListWidget.cxx stella-4.1.1/src/debugger/gui/RomListWidget.cxx --- stella-4.0/src/debugger/gui/RomListWidget.cxx 2014-06-10 21:04:36.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/RomListWidget.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: RomListWidget.cxx 2914 2014-06-10 21:04:36Z stephena $ +// $Id: RomListWidget.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include "bspf.hxx" @@ -437,7 +437,6 @@ FBSurface& s = _boss->dialog().surface(); const CartDebug::DisassemblyList& dlist = myDisasm->list; int i, pos, xpos, ypos, len = dlist.size(); - int deltax; const GUI::Rect& r = getEditRect(); const GUI::Rect& l = getLineRect(); @@ -509,16 +508,13 @@ if (_selectedItem == pos && _editMode) { adjustOffset(); - deltax = -_editScrollOffset; - s.drawString(_font, _editString, _x + r.x(), ypos, r.width(), kTextColor, - kTextAlignLeft, deltax, false); + kTextAlignLeft, -_editScrollOffset, false); drawCaret(); } else { - deltax = 0; s.drawString(_font, dlist[pos].bytes, _x + r.x(), ypos, r.width(), kTextColor); } } diff -Nru stella-4.0/src/debugger/gui/RomWidget.cxx stella-4.1.1/src/debugger/gui/RomWidget.cxx --- stella-4.0/src/debugger/gui/RomWidget.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/RomWidget.cxx 2014-08-09 01:04:46.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: RomWidget.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: RomWidget.cxx 2973 2014-08-09 01:04:46Z stephena $ //============================================================================ #include @@ -46,9 +46,9 @@ // Show current bank state xpos = x; ypos = y + 7; t = new StaticTextWidget(boss, lfont, xpos, ypos, - lfont.getStringWidth("Bank state: "), + lfont.getStringWidth("Bank:"), lfont.getFontHeight(), - "Bank state: ", kTextAlignLeft); + "Bank:", kTextAlignLeft); xpos += t->getWidth() + 5; myBank = new EditTextWidget(boss, nfont, xpos, ypos-1, diff -Nru stella-4.0/src/debugger/gui/TiaWidget.cxx stella-4.1.1/src/debugger/gui/TiaWidget.cxx --- stella-4.0/src/debugger/gui/TiaWidget.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/debugger/gui/TiaWidget.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TiaWidget.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: TiaWidget.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include "ColorWidget.hxx" @@ -49,10 +49,8 @@ const char* regNames[] = { "COLUP0:", "COLUP1:", "COLUPF:", "COLUBK:" }; for(int row = 0; row < 4; ++row) { - t = new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2, - 7*fontWidth, fontHeight, - regNames[row], - kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2, + 7*fontWidth, fontHeight, regNames[row], kTextAlignLeft); } xpos += 7*fontWidth + 5; myColorRegs = new DataGridWidget(boss, nfont, xpos, ypos, @@ -86,18 +84,17 @@ "PF BL M1 M0 P1", kTextAlignLeft); // Add label for Strobes; buttons will be added later - t = new StaticTextWidget(boss, lfont, xpos + t->getWidth() + 9*fontWidth, ypos, - 8*fontWidth, fontHeight, - "Strobes:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos + t->getWidth() + 9*fontWidth, ypos, + 8*fontWidth, fontHeight, "Strobes:", kTextAlignLeft); // Add vertical labels xpos -= 2*fontWidth + 5; ypos += lineHeight; const char* collLabel[] = { "P0", "P1", "M0", "M1", "BL" }; for(int row = 0; row < 5; ++row) { - t = new StaticTextWidget(boss, lfont, xpos, ypos + row*(lineHeight+3), - 2*fontWidth, fontHeight, - collLabel[row], kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos + row*(lineHeight+3), + 2*fontWidth, fontHeight, + collLabel[row], kTextAlignLeft); } // Finally, add all 15 collision bits @@ -184,9 +181,8 @@ //////////////////////////// // grP0 xpos = 10; ypos = buttonY + 2*lineHeight; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, - 7*fontWidth, fontHeight, - "P0: GR:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 7*fontWidth, fontHeight, + "P0: GR:", kTextAlignLeft); xpos += 7*fontWidth + 5; myGRP0 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1); myGRP0->setTarget(this); @@ -208,9 +204,8 @@ // hmP0 xpos += myPosP0->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, - 3*fontWidth, fontHeight, - "HM:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "HM:", kTextAlignLeft); xpos += 3*fontWidth + 5; myHMP0 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 4, Common::Base::F_16_1); @@ -235,9 +230,8 @@ // NUSIZ0 (player portion) xpos = 10 + lwidth; ypos += myGRP0->getHeight() + 5; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, - 8*fontWidth, fontHeight, - "NusizP0:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 8*fontWidth, fontHeight, + "NusizP0:", kTextAlignLeft); xpos += 8*fontWidth + 5; myNusizP0 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 3, Common::Base::F_16_1); @@ -255,8 +249,8 @@ //////////////////////////// // grP1 xpos = 10; ypos += 2*lineHeight; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 7*fontWidth, fontHeight, - "P1: GR:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 7*fontWidth, fontHeight, + "P1: GR:", kTextAlignLeft); xpos += 7*fontWidth + 5; myGRP1 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1); myGRP1->setTarget(this); @@ -277,8 +271,8 @@ // hmP1 xpos += myPosP1->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, - "HM:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "HM:", kTextAlignLeft); xpos += 3*fontWidth + 5; myHMP1 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 4, Common::Base::F_16_1); @@ -303,8 +297,8 @@ // NUSIZ1 (player portion) xpos = 10 + lwidth; ypos += myGRP1->getHeight() + 5; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 8*fontWidth, fontHeight, - "NusizP1:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 8*fontWidth, fontHeight, + "NusizP1:", kTextAlignLeft); xpos += 8*fontWidth + 5; myNusizP1 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 3, Common::Base::F_16_1); @@ -322,8 +316,8 @@ //////////////////////////// // enaM0 xpos = 10; ypos += 2*lineHeight; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, - "M0:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "M0:", kTextAlignLeft); xpos += 3*fontWidth + 8; myEnaM0 = new CheckboxWidget(boss, lfont, xpos, ypos+2, "Enable", kCheckActionCmd); @@ -345,8 +339,8 @@ // hmM0 xpos += myPosM0->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, - "HM:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "HM:", kTextAlignLeft); xpos += 3*fontWidth + 5; myHMM0 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 4, Common::Base::F_16_1); @@ -356,8 +350,8 @@ // NUSIZ0 (missile portion) xpos += myHMM0->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, - "Size:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, + "Size:", kTextAlignLeft); xpos += 5*fontWidth + 5; myNusizM0 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 2, Common::Base::F_16_1); @@ -378,8 +372,8 @@ //////////////////////////// // enaM1 xpos = 10; ypos += lineHeight + 6; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, - "M1:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "M1:", kTextAlignLeft); xpos += 3*fontWidth + 8; myEnaM1 = new CheckboxWidget(boss, lfont, xpos, ypos+2, "Enable", kCheckActionCmd); @@ -401,8 +395,8 @@ // hmM0 xpos += myPosM1->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, - "HM:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "HM:", kTextAlignLeft); xpos += 3*fontWidth + 5; myHMM1 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 4, Common::Base::F_16_1); @@ -412,8 +406,8 @@ // NUSIZ1 (missile portion) xpos += myHMM1->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, - "Size:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, + "Size:", kTextAlignLeft); xpos += 5*fontWidth + 5; myNusizM1 = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 2, Common::Base::F_16_1); @@ -434,8 +428,8 @@ //////////////////////////// // enaBL xpos = 10; ypos += lineHeight + 6; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, - "BL:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "BL:", kTextAlignLeft); xpos += 3*fontWidth + 8; myEnaBL = new CheckboxWidget(boss, lfont, xpos, ypos+2, "Enable", kCheckActionCmd); @@ -457,8 +451,8 @@ // hmBL xpos += myPosBL->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, - "HM:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, + "HM:", kTextAlignLeft); xpos += 3*fontWidth + 5; myHMBL = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 4, Common::Base::F_16_1); @@ -468,8 +462,8 @@ // CTRLPF (size portion) xpos += myHMBL->getWidth() + 8; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, - "Size:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, + "Size:", kTextAlignLeft); xpos += 5*fontWidth + 5; mySizeBL = new DataGridWidget(boss, nfont, xpos, ypos, 1, 1, 1, 2, Common::Base::F_16_1); @@ -490,8 +484,8 @@ //////////////////////////// // PF0 xpos = 10; ypos += lineHeight + 6; - t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight, - "PF:", kTextAlignLeft); + new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight, + "PF:", kTextAlignLeft); xpos += 4*fontWidth; myPF[0] = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 4, 1); myPF[0]->setTarget(this); diff -Nru stella-4.0/src/emucore/Cart0840.cxx stella-4.1.1/src/emucore/Cart0840.cxx --- stella-4.0/src/emucore/Cart0840.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart0840.cxx 2014-08-14 00:03:56.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart0840.cxx,v 1.0 2006/11/17 +// $Id: Cart0840.cxx 2974 2014-08-14 00:03:56Z stephena $ //============================================================================ #include @@ -69,8 +69,7 @@ myHotSpotPageAccess[7] = mySystem->getPageAccess(0x0F00 >> shift); // Set the page accessing methods for the hot spots - System::PageAccess access(0, 0, 0, this, System::PA_READ); - + System::PageAccess access(this, System::PA_READ); for(uInt32 i = 0x0800; i < 0x0FFF; i += (1 << shift)) mySystem->setPageAccess(i >> shift, access); @@ -154,7 +153,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1000; address < 0x2000; address += (1 << shift)) @@ -167,7 +166,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge0840::bank() const +uInt16 Cartridge0840::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/Cart0840.hxx stella-4.1.1/src/emucore/Cart0840.hxx --- stella-4.0/src/emucore/Cart0840.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart0840.hxx 2014-08-14 00:03:56.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart0840.hxx,v 1.0 2006/11/14 +// $Id: Cart0840.hxx 2974 2014-08-14 00:03:56Z stephena $ //============================================================================ #ifndef CARTRIDGE0840_HXX @@ -76,7 +76,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/Cart2K.cxx stella-4.1.1/src/emucore/Cart2K.cxx --- stella-4.0/src/emucore/Cart2K.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart2K.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart2K.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart2K.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include @@ -77,7 +77,7 @@ assert((0x1000 & mask) == 0); // Map ROM image into the system - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 address = 0x1000; address < 0x2000; address += (1 << shift)) { @@ -101,26 +101,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool Cartridge2K::bank(uInt16 bank) -{ - // Doesn't support bankswitching - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge2K::bank() const -{ - // Doesn't support bankswitching - return 0; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge2K::bankCount() const -{ - return 1; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Cartridge2K::patch(uInt16 address, uInt8 value) { myImage[address & myMask] = value; diff -Nru stella-4.0/src/emucore/Cart2K.hxx stella-4.1.1/src/emucore/Cart2K.hxx --- stella-4.0/src/emucore/Cart2K.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart2K.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart2K.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart2K.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef CARTRIDGE2K_HXX @@ -34,7 +34,7 @@ 2600's 4K cartridge addressing space. @author Bradford W. Mott - @version $Id: Cart2K.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: Cart2K.hxx 2960 2014-07-24 17:15:28Z stephena $ */ class Cartridge2K : public Cartridge { @@ -70,23 +70,6 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** - Get the current bank. - */ - uInt16 bank() const; - - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const; - - /** Patch the cartridge ROM. @param address The ROM address to patch diff -Nru stella-4.0/src/emucore/Cart3E.cxx stella-4.1.1/src/emucore/Cart3E.cxx --- stella-4.0/src/emucore/Cart3E.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart3E.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart3E.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: Cart3E.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -71,7 +71,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1800 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READWRITE); + System::PageAccess access(this, System::PA_READWRITE); // Set the page accessing methods for the hot spots (for 100% emulation // we need to chain any accesses below 0x40 to the TIA. Our poke() method @@ -176,7 +176,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1000; address < 0x1800; address += (1 << shift)) @@ -197,7 +197,7 @@ uInt32 address; // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map read-port RAM image into the system for(address = 0x1000; address < 0x1400; address += (1 << shift)) @@ -222,7 +222,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge3E::bank() const +uInt16 Cartridge3E::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/Cart3E.hxx stella-4.1.1/src/emucore/Cart3E.hxx --- stella-4.0/src/emucore/Cart3E.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart3E.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart3E.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart3E.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGE3E_HXX @@ -61,7 +61,7 @@ any problems. (Famous last words...) @author B. Watson - @version $Id: Cart3E.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: Cart3E.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class Cartridge3E : public Cartridge @@ -107,7 +107,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/Cart3F.cxx stella-4.1.1/src/emucore/Cart3F.cxx --- stella-4.0/src/emucore/Cart3F.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart3F.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart3F.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart3F.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1800 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READWRITE); + System::PageAccess access(this, System::PA_READWRITE); // Set the page accessing methods for the hot spots (for 100% emulation // we need to chain any accesses below 0x40 to the TIA. Our poke() method @@ -142,7 +142,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1000; address < 0x1800; address += (1 << shift)) @@ -155,7 +155,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge3F::bank() const +uInt16 Cartridge3F::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/Cart3F.hxx stella-4.1.1/src/emucore/Cart3F.hxx --- stella-4.0/src/emucore/Cart3F.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart3F.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart3F.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart3F.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGE3F_HXX @@ -39,7 +39,7 @@ only used 8K this bankswitching scheme supports up to 512K. @author Bradford W. Mott - @version $Id: Cart3F.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: Cart3F.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class Cartridge3F : public Cartridge { @@ -84,7 +84,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/Cart4A50.cxx stella-4.1.1/src/emucore/Cart4A50.cxx --- stella-4.0/src/emucore/Cart4A50.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart4A50.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4A50.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart4A50.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include @@ -84,7 +84,7 @@ assert((0x1000 & mask) == 0); // Map all of the accesses to call peek and poke (We don't yet indicate RAM areas) - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 i = 0x1000; i < 0x2000; i += (1 << shift)) mySystem->setPageAccess(i >> shift, access); @@ -337,28 +337,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool Cartridge4A50::bank(uInt16) -{ - // Doesn't support bankswitching in the normal sense - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge4A50::bank() const -{ - // Doesn't support bankswitching in the normal sense - return 0; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge4A50::bankCount() const -{ - // Doesn't support bankswitching in the normal sense - // There is one 'virtual' bank that can change in many different ways - return 1; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Cartridge4A50::patch(uInt16 address, uInt8 value) { if((address & 0x1800) == 0x1000) // 2K region from 0x1000 - 0x17ff diff -Nru stella-4.0/src/emucore/Cart4A50.hxx stella-4.1.1/src/emucore/Cart4A50.hxx --- stella-4.0/src/emucore/Cart4A50.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart4A50.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4A50.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart4A50.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef CARTRIDGE4A50_HXX @@ -47,7 +47,7 @@ have changed on every poke operation (for any RAM) or an actual bankswitch. @author Eckhard Stolberg & Stephen Anthony - @version $Id: Cart4A50.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: Cart4A50.hxx 2960 2014-07-24 17:15:28Z stephena $ */ class Cartridge4A50 : public Cartridge { @@ -83,23 +83,6 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** - Get the current bank. - */ - uInt16 bank() const; - - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const; - - /** Patch the cartridge ROM. @param address The ROM address to patch diff -Nru stella-4.0/src/emucore/Cart4K.cxx stella-4.1.1/src/emucore/Cart4K.cxx --- stella-4.0/src/emucore/Cart4K.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart4K.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4K.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart4K.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include @@ -53,7 +53,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1000 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1000; address < 0x2000; address += (1 << shift)) @@ -78,26 +78,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool Cartridge4K::bank(uInt16) -{ - // Doesn't support bankswitching - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge4K::bank() const -{ - // Doesn't support bankswitching - return 0; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge4K::bankCount() const -{ - return 1; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Cartridge4K::patch(uInt16 address, uInt8 value) { myImage[address & 0x0FFF] = value; diff -Nru stella-4.0/src/emucore/Cart4K.hxx stella-4.1.1/src/emucore/Cart4K.hxx --- stella-4.0/src/emucore/Cart4K.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart4K.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4K.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Cart4K.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef CARTRIDGE4K_HXX @@ -33,7 +33,7 @@ not bankswitched. @author Bradford W. Mott - @version $Id: Cart4K.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: Cart4K.hxx 2960 2014-07-24 17:15:28Z stephena $ */ class Cartridge4K : public Cartridge { @@ -69,23 +69,6 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** - Get the current bank. - */ - uInt16 bank() const; - - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const; - - /** Patch the cartridge ROM. @param address The ROM address to patch diff -Nru stella-4.0/src/emucore/Cart4KSC.cxx stella-4.1.1/src/emucore/Cart4KSC.cxx --- stella-4.0/src/emucore/Cart4KSC.cxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart4KSC.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4KSC.cxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: Cart4KSC.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include @@ -59,7 +59,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1080 & mask) == 0) && ((0x1100 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -122,25 +122,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool Cartridge4KSC::bank(uInt16 bank) -{ - // Doesn't support bankswitching - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge4KSC::bank() const -{ - return 0; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 Cartridge4KSC::bankCount() const -{ - return 1; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Cartridge4KSC::patch(uInt16 address, uInt8 value) { address &= 0x0FFF; diff -Nru stella-4.0/src/emucore/Cart4KSC.hxx stella-4.1.1/src/emucore/Cart4KSC.hxx --- stella-4.0/src/emucore/Cart4KSC.hxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart4KSC.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4KSC.hxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: Cart4KSC.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef CARTRIDGE4KSC_HXX @@ -67,23 +67,6 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** - Get the current bank. - */ - uInt16 bank() const; - - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const; - - /** Patch the cartridge ROM. @param address The ROM address to patch diff -Nru stella-4.0/src/emucore/CartAR.cxx stella-4.1.1/src/emucore/CartAR.cxx --- stella-4.0/src/emucore/CartAR.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartAR.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartAR.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartAR.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -105,7 +105,7 @@ assert((0x1000 & mask) == 0); // Map all of the accesses to call peek and poke (we don't yet indicate RAM areas) - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 i = 0x1000; i < 0x2000; i += (1 << shift)) mySystem->setPageAccess(i >> shift, access); @@ -439,7 +439,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeAR::bank() const +uInt16 CartridgeAR::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartAR.hxx stella-4.1.1/src/emucore/CartAR.hxx --- stella-4.0/src/emucore/CartAR.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartAR.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartAR.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartAR.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEAR_HXX @@ -39,7 +39,7 @@ and one bank of ROM. All 6K of the RAM can be read and written. @author Bradford W. Mott - @version $Id: CartAR.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartAR.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeAR : public Cartridge { @@ -91,7 +91,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartBF.cxx stella-4.1.1/src/emucore/CartBF.cxx --- stella-4.0/src/emucore/CartBF.cxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/CartBF.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartBF.cxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: CartBF.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -94,7 +94,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1F80 & ~mask); i < 0x2000; i += (1 << shift)) @@ -115,7 +115,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeBF::bank() const +uInt16 CartridgeBF::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartBF.hxx stella-4.1.1/src/emucore/CartBF.hxx --- stella-4.0/src/emucore/CartBF.hxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/CartBF.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartBF.hxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: CartBF.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEBF_HXX @@ -34,7 +34,7 @@ Accessing $1FC0 - $1FDF switches to each bank. @author Mike Saarna - @version $Id: CartBF.hxx 2942 2014-06-30 14:38:18Z stephena $ + @version $Id: CartBF.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeBF : public Cartridge { @@ -79,7 +79,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartBFSC.cxx stella-4.1.1/src/emucore/CartBFSC.cxx --- stella-4.0/src/emucore/CartBFSC.cxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/CartBFSC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartBFSC.cxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: CartBFSC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1000 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -142,7 +142,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1F80 & ~mask); i < 0x2000; i += (1 << shift)) @@ -163,7 +163,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeBFSC::bank() const +uInt16 CartridgeBFSC::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartBFSC.hxx stella-4.1.1/src/emucore/CartBFSC.hxx --- stella-4.0/src/emucore/CartBFSC.hxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/CartBFSC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartBFSC.hxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: CartBFSC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEBFSC_HXX @@ -33,7 +33,7 @@ Accessing $1FD0 - $1FEF switches to each bank. @author Stephen Anthony - @version $Id: CartBFSC.hxx 2942 2014-06-30 14:38:18Z stephena $ + @version $Id: CartBFSC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeBFSC : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartCM.cxx stella-4.1.1/src/emucore/CartCM.cxx --- stella-4.0/src/emucore/CartCM.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartCM.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCM.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartCM.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -121,7 +121,7 @@ // The upper 2K of cart address space can point to either the 2K of RAM or // the upper 2K of the current ROM bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Lower 2K (always ROM) for(uInt32 address = 0x1000; address < 0x1800; address += (1 << shift)) @@ -159,7 +159,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeCM::bank() const +uInt16 CartridgeCM::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartCM.hxx stella-4.1.1/src/emucore/CartCM.hxx --- stella-4.0/src/emucore/CartCM.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartCM.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCM.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartCM.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGECM_HXX @@ -104,7 +104,7 @@ This code was heavily borrowed from z26. @author Stephen Anthony & z26 team - @version $Id: CartCM.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartCM.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeCM : public Cartridge { @@ -149,7 +149,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartCTY.cxx stella-4.1.1/src/emucore/CartCTY.cxx --- stella-4.0/src/emucore/CartCTY.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartCTY.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCTY.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartCTY.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -92,7 +92,7 @@ assert(((0x1000 & mask) == 0) && ((0x1080 & mask) == 0)); // Map all RAM accesses to call peek and poke - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 i = 0x1000; i < 0x1080; i += (1 << shift)) mySystem->setPageAccess(i >> shift, access); @@ -255,7 +255,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 address = 0x1080; address < 0x2000; address += (1 << shift)) { access.codeAccessBase = &myCodeAccessBase[myCurrentBank + (address & 0x0FFF)]; @@ -265,7 +265,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeCTY::bank() const +uInt16 CartridgeCTY::getBank() const { return myCurrentBank >> 12; } @@ -307,7 +307,7 @@ try { out.putString(name()); - out.putShort(bank()); + out.putShort(getBank()); out.putByteArray(myRAM, 64); out.putByte(myOperationType); diff -Nru stella-4.0/src/emucore/CartCTY.hxx stella-4.1.1/src/emucore/CartCTY.hxx --- stella-4.0/src/emucore/CartCTY.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartCTY.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCTY.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartCTY.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGECHETIRY_HXX @@ -108,7 +108,7 @@ non-zero value. @author Stephen Anthony and Chris D. Walton - @version $Id: CartCTY.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartCTY.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeCTY : public Cartridge { @@ -160,7 +160,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartCV.cxx stella-4.1.1/src/emucore/CartCV.cxx --- stella-4.0/src/emucore/CartCV.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartCV.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCV.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartCV.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include @@ -87,7 +87,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1800 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1800; address < 0x2000; address += (1 << shift)) @@ -150,26 +150,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool CartridgeCV::bank(uInt16 bank) -{ - // Doesn't support bankswitching - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeCV::bank() const -{ - // Doesn't support bankswitching - return 0; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeCV::bankCount() const -{ - return 1; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeCV::patch(uInt16 address, uInt8 value) { address &= 0x0FFF; diff -Nru stella-4.0/src/emucore/CartCV.hxx stella-4.1.1/src/emucore/CartCV.hxx --- stella-4.0/src/emucore/CartCV.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartCV.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCV.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartCV.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef CARTRIDGECV_HXX @@ -36,7 +36,7 @@ $F800-$FFFF ROM @author Eckhard Stolberg - @version $Id: CartCV.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartCV.hxx 2960 2014-07-24 17:15:28Z stephena $ */ class CartridgeCV : public Cartridge { @@ -72,23 +72,6 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** - Get the current bank. - */ - uInt16 bank() const; - - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const; - - /** Patch the cartridge ROM. @param address The ROM address to patch diff -Nru stella-4.0/src/emucore/Cart.cxx stella-4.1.1/src/emucore/Cart.cxx --- stella-4.0/src/emucore/Cart.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart.cxx 2014-08-14 00:03:56.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: Cart.cxx 2974 2014-08-14 00:03:56Z stephena $ //============================================================================ #include @@ -56,6 +56,7 @@ #include "CartFA2.hxx" #include "CartFE.hxx" #include "CartMC.hxx" +#include "CartMDM.hxx" #include "CartSB.hxx" #include "CartUA.hxx" #include "CartX07.hxx" @@ -244,6 +245,8 @@ cartridge = new CartridgeFE(image, size, settings); else if(type == "MC") cartridge = new CartridgeMC(image, size, settings); + else if(type == "MDM") + cartridge = new CartridgeMDM(image, size, settings); else if(type == "UA") cartridge = new CartridgeUA(image, size, settings); else if(type == "SB") @@ -323,8 +326,7 @@ return false; } - for(int i=0; i @@ -33,21 +33,11 @@ // Copy the ROM image into my buffer memcpy(myImage, image, mySize); - createCodeAccessBase(mySize + 65536); //RAM_TOTAL_SIZE); // TODO: how does the RAM write offset affect the size we need? - - // This cart can address 4 banks of RAM, each 512 bytes @ 1000, 1200, 1400, 1600 - // However, it may not be addressable all the time (it may be swapped out) - -#if 0 - registerRamArea(0x1000, RAM_BANK_SIZE, 0x00, RAM_WRITE_OFFSET); // 512 bytes RAM @ 0x1000 - registerRamArea(0x1200, RAM_BANK_SIZE, 0x00, RAM_WRITE_OFFSET); // 512 bytes RAM @ 0x1200 - registerRamArea(0x1400, RAM_BANK_SIZE, 0x00, RAM_WRITE_OFFSET); // 512 bytes RAM @ 0x1400 - registerRamArea(0x1600, RAM_BANK_SIZE, 0x00, RAM_WRITE_OFFSET); // 512 bytes RAM @ 0x1600 -#endif + createCodeAccessBase(mySize + RAM_TOTAL_SIZE); // Remember startup bank (0 per spec, rather than last per 3E scheme). // Set this to go to 3rd 1K Bank. - myStartBank = 0; //(3 << BANK_BITS) | 0; + myStartBank = 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -65,9 +55,18 @@ else memset(myRAM, 0, RAM_TOTAL_SIZE); - // We'll map the startup bank (0) from the image into the third 1K bank upon reset + // Initialise bank values for all ROM/RAM access + // This is used to reverse-lookup from address to bank location + for (uInt32 b = 0; b < 8; b++) + { + bankInUse[b] = BANK_UNDEFINED; // bank is undefined and inaccessible! + segmentInUse[b/2] = BANK_UNDEFINED; + } + initializeBankState(); - bankROM(myStartBank); + // We'll map the startup banks 0 and 3 from the image into the third 1K bank upon reset + bankROM((0 << BANK_BITS) | 0); + bankROM((3 << BANK_BITS) | 0); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -81,7 +80,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1800 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READWRITE); + System::PageAccess access(this, System::PA_READWRITE); // Set the page accessing methods for the hot spots (for 100% emulation // we need to chain any accesses below 0x40 to the TIA. Our poke() method @@ -90,50 +89,52 @@ for (uInt32 i = 0x00; i < 0x40; i += (1 << shift)) mySystem->setPageAccess(i >> shift, access); - // Setup the last segment (of 4, each 1K) to point to the first ROM slice - // Actually we DO NOT want "always". It's just on bootup, and can be out switched later - - access.type = System::PA_READ; - for (uInt32 address = (0x2000 - ROM_BANK_SIZE); address < 0x2000; address += (1 << shift)) { - access.directPeekBase = &myImage[address & (ROM_BANK_SIZE - 1)]; // from base address 0x0000 in image - access.codeAccessBase = &myCodeAccessBase[address & (ROM_BANK_SIZE - 1)]; - mySystem->setPageAccess(address >> shift, access); - } - - // Initialise bank values for the 4x 1K bank areas + // Initialise bank values for all ROM/RAM access // This is used to reverse-lookup from address to bank location for (uInt32 b = 0; b < 8; b++) + { bankInUse[b] = BANK_UNDEFINED; // bank is undefined and inaccessible! + segmentInUse[b/2] = BANK_UNDEFINED; + } + initializeBankState(); - // Install pages for the startup bank into the first segment - bankROM(myStartBank); + // Setup the last segment (of 4, each 1K) to point to the first ROM slice + // Actually we DO NOT want "always". It's just on bootup, and can be out switched later + bankROM((0 << BANK_BITS) | 0); + bankROM((3 << BANK_BITS) | 0); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 CartridgeDASH::peek(uInt16 address) { + uInt16 peekAddress = address; + address &= 0x0FFF; // restrict to 4K address range + uInt8 value = 0; - uInt32 bank = (address >> (ROM_BANK_TO_POWER - 1)) & 7; // convert to 512 byte bank index (0-7) - Int16 imageBank = bankInUse[bank]; // the ROM/RAM bank that's here + uInt32 bank = (address >> (ROM_BANK_TO_POWER - 1)) & 7; // convert to 512 byte bank index (0-7) + uInt16 imageBank = bankInUse[bank]; // the ROM/RAM bank that's here if (imageBank == BANK_UNDEFINED) { // an uninitialised bank? // accessing invalid bank, so return should be... random? value = mySystem->randGenerator().next(); - } else if (imageBank & BITMASK_ROMRAM) { // a RAM bank + } else if (imageBank & BITMASK_ROMRAM) { // a RAM bank + + // Reading from the write port triggers an unwanted write + value = mySystem->getDataBusState(0xFF); - Int32 ramBank = imageBank & BIT_BANK_MASK; // discard irrelevant bits - Int32 offset = ramBank << RAM_BANK_TO_POWER; // base bank address in RAM - offset += (address & BITMASK_RAM_BANK); // + byte offset in RAM bank - value = myRAM[offset]; - - } else { // accessing ROM - - Int32 romBank = imageBank & BIT_BANK_MASK; // discard irrelevant bits - Int32 offset = romBank << ROM_BANK_TO_POWER; // base bank address in image - offset += (address & BITMASK_ROM_BANK); // + byte offset in image bank - value = myImage[offset]; + if(bankLocked()) + return value; + else + { + triggerReadFromWritePort(peekAddress); + + Int32 ramBank = imageBank & BIT_BANK_MASK; // discard irrelevant bits + Int32 offset = ramBank << RAM_BANK_TO_POWER; // base bank address in RAM + offset += (address & BITMASK_RAM_BANK); // + byte offset in RAM bank + return myRAM[offset] = value; + } } return value; @@ -142,18 +143,16 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeDASH::poke(uInt16 address, uInt8 value) { - bool myBankChanged = false; - - address &= 0x0FFF; // restrict to 4K address range + bool changed = false; // Check for write to the bank switch address. RAM/ROM and bank # are encoded in 'value' // There are NO mirrored hotspots. if (address == BANK_SWITCH_HOTSPOT_RAM) - myBankChanged = bankRAM(value); + changed = bankRAM(value); else if (address == BANK_SWITCH_HOTSPOT_ROM) - myBankChanged = bankROM(value); + changed = bankROM(value); // Pass the poke through to the TIA. In a real Atari, both the cart and the // TIA see the address lines, and both react accordingly. In Stella, each @@ -161,109 +160,136 @@ // don't chain the poke to the TIA, then the TIA can't see it... mySystem->tia().poke(address, value); - return myBankChanged; + return changed; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeDASH::bankRAM(uInt8 bank) { - bool changed = false; + if (bankLocked()) // debugger can lock RAM + return false; + + // Each RAM bank uses two slots, separated by 0x800 in memory -- one read, one write. + bankRAMSlot(bank | BITMASK_ROMRAM | 0); + bankRAMSlot(bank | BITMASK_ROMRAM | BITMASK_LOWERUPPER); + + // Remember that this hotspot was accessed for RAM + segmentInUse[(bank >> BANK_BITS) & 3] = bank | BITMASK_ROMRAM; + + return myBankChanged = true; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDASH::bankRAMSlot(uInt16 bank) { uInt16 shift = mySystem->pageShift(); - uInt16 bankNumber = ((bank >> BANK_BITS) & 3) << 1; // which bank # we are switching TO (BITS D6,D7) to 512byte block - uInt16 currentBank = bank & BIT_BANK_MASK; // Wrap around/restrict to valid range + uInt16 bankNumber = (bank >> BANK_BITS) & 3; // which bank # we are switching TO (BITS D6,D7) to 512 byte block + uInt16 currentBank = bank & BIT_BANK_MASK; // Wrap around/restrict to valid range + bool upper = bank & BITMASK_LOWERUPPER; // is this the read or write port - // Each RAM bank uses two slots, separated by 0x800 in memory -- one read, one write. - bankInUse[bankNumber] = (Int16) (BITMASK_ROMRAM | currentBank); // Record which bank switched in (marked as RAM) - bankInUse[bankNumber + 4] = (Int16) (BITMASK_ROMRAM | currentBank); // Record which (write) bank switched in (marked as RAM) + uInt32 startCurrentBank = currentBank << RAM_BANK_TO_POWER; // Effectively * 512 bytes // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); - uInt32 startCurrentBank = currentBank << RAM_BANK_TO_POWER; // Effectively * 512 bytes - uInt32 base = 0x1000 + startCurrentBank; + if (upper) { // We're mapping the write port - for (uInt32 address = base; address < base + RAM_BANK_SIZE; address += (1 << shift)) { - access.directPeekBase = &myRAM[startCurrentBank + (address & (RAM_BANK_SIZE - 1))]; - access.codeAccessBase = &myCodeAccessBase[65536 + startCurrentBank + (address & (RAM_BANK_SIZE - 1))]; - mySystem->setPageAccess(address >> shift, access); - } + bankInUse[bankNumber + 4] = (Int16) bank; + access.type = System::PA_WRITE; - access.directPeekBase = 0; - access.type = System::PA_WRITE; + } else { // We're mapping the read port - base += RAM_WRITE_OFFSET; + bankInUse[bankNumber] = (Int16) bank; + access.type = System::PA_READ; - for (uInt32 address = base; address < base + RAM_BANK_SIZE; address += (1 << shift)) { - access.directPeekBase = &myRAM[startCurrentBank + (address & (RAM_BANK_SIZE - 1))]; - access.codeAccessBase = &myCodeAccessBase[65536 + startCurrentBank + (address & (RAM_BANK_SIZE - 1))]; - mySystem->setPageAccess(address >> shift, access); } - return changed; // TODO: does RAM change banks or not???? + uInt32 start = 0x1000 + (bankNumber << RAM_BANK_TO_POWER) + (upper ? RAM_WRITE_OFFSET : 0); + uInt32 end = start + RAM_BANK_SIZE - 1; + + for (uInt32 address = start; address <= end; address += (1 << shift)) { + if(upper) + access.directPokeBase = &myRAM[startCurrentBank + (address & (RAM_BANK_SIZE - 1))]; + else + access.directPeekBase = &myRAM[startCurrentBank + (address & (RAM_BANK_SIZE - 1))]; + access.codeAccessBase = &myCodeAccessBase[mySize + startCurrentBank + (address & (RAM_BANK_SIZE - 1))]; + mySystem->setPageAccess(address >> shift, access); + } } + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeDASH::bankROM(uInt8 bank) { - bool changed = false; - - if (!bankLocked()) { // debugger can lock ROM + if (bankLocked()) // debugger can lock ROM + return false; - uInt16 shift = mySystem->pageShift(); + // Map ROM bank image into the system into the correct slot + // Memory map is 1K slots at 0x1000, 0x1400, 0x1800, 0x1C00 + // Each ROM uses 2 consecutive 512 byte slots + bankROMSlot(bank | 0); + bankROMSlot(bank | BITMASK_LOWERUPPER); - uInt16 bankNumber = (bank >> BANK_BITS) & 3; // which bank # we are switching TO (BITS D6,D7) - uInt16 currentBank = bank & BIT_BANK_MASK; // Wrap around/restrict to valid range + // Remember that this hotspot was accessed for ROM + segmentInUse[(bank >> BANK_BITS) & 3] = bank; - // Map ROM bank image into the system into the correct slot - // Memory map is 1K slots at 0x1000, 0x1400, 0x1800, 0x1C00 - // Each ROM uses 2 consecutive 512 byte slots + return myBankChanged = true; +} - bankInUse[bankNumber * 2] = bankInUse[bankNumber * 2 + 1] = (Int16) currentBank; // Record which bank switched in (as ROM) +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDASH::bankROMSlot(uInt16 bank) { - uInt32 startCurrentBank = currentBank << ROM_BANK_TO_POWER; // Effectively *1K + uInt16 shift = mySystem->pageShift(); - // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + uInt16 bankNumber = (bank >> BANK_BITS) & 3; // which bank # we are switching TO (BITS D6,D7) + uInt16 currentBank = bank & BIT_BANK_MASK; // Wrap around/restrict to valid range + bool upper = bank & BITMASK_LOWERUPPER; // is this the lower or upper 512b - uInt32 base = 0x1000 + (bankNumber << ROM_BANK_TO_POWER); - for (uInt32 address = base; address < base + ROM_BANK_SIZE; address += (1 << shift)) { - access.directPeekBase = &myImage[startCurrentBank + (address & (ROM_BANK_SIZE - 1))]; - access.codeAccessBase = &myCodeAccessBase[startCurrentBank + (address & (ROM_BANK_SIZE - 1))]; - mySystem->setPageAccess(address >> shift, access); - } + bankInUse[bankNumber * 2 + (upper ? 1 : 0)] = (Int16) bank; // Record which bank switched in (as ROM) - changed = true; - } + uInt32 startCurrentBank = currentBank << ROM_BANK_TO_POWER; // Effectively *1K - return changed; -} + // Setup the page access methods for the current bank + System::PageAccess access(this, System::PA_READ); -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool CartridgeDASH::bank(uInt16 bank) { + uInt32 start = 0x1000 + (bankNumber << ROM_BANK_TO_POWER) + (upper ? ROM_BANK_SIZE / 2 : 0); + uInt32 end = start + ROM_BANK_SIZE / 2 - 1; - // Doesn't support bankswitching in the normal sense - return false; + for (uInt32 address = start; address <= end; address += (1 << shift)) { + access.directPeekBase = &myImage[startCurrentBank + (address & (ROM_BANK_SIZE - 1))]; + access.codeAccessBase = &myCodeAccessBase[startCurrentBank + (address & (ROM_BANK_SIZE - 1))]; + mySystem->setPageAccess(address >> shift, access); + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeDASH::bank() const { +void CartridgeDASH::initializeBankState() { - // Doesn't support bankswitching in the normal sense - return 0; -} + const uInt16& shift = mySystem->pageShift(); -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeDASH::bankCount() const { + // Switch in each 512b slot + for (uInt32 b = 0; b < 8; b++) { + if (bankInUse[b] == BANK_UNDEFINED) { + + // All accesses point to peek/poke above + System::PageAccess access(this, System::PA_READ); + uInt32 start = 0x1000 + (b << RAM_BANK_TO_POWER); + uInt32 end = start + RAM_BANK_SIZE - 1; + for (uInt32 address = start; address <= end; address += (1 << shift)) + mySystem->setPageAccess(address >> shift, access); - // Doesn't support bankswitching in the normal sense - return 1; + } + else if (bankInUse[b] & BITMASK_ROMRAM) + bankRAMSlot(bankInUse[b]); + else + bankROMSlot(bankInUse[b]); + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeDASH::patch(uInt16 address, uInt8 value) { - +#if 0 // Patch the cartridge ROM (for debugger) myBankChanged = true; @@ -292,6 +318,9 @@ } return myBankChanged; +#else + return false; +#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -302,10 +331,11 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeDASH::save(Serializer& out) const { + try { out.putString(name()); - for (uInt32 b = 0; b < 8; b++) - out.putShort(bankInUse[b]); + out.putShortArray(bankInUse, 8); + out.putShortArray(segmentInUse, 4); out.putByteArray(myRAM, RAM_TOTAL_SIZE); } catch (...) { cerr << "ERROR: CartridgeDASH::save" << endl; @@ -316,16 +346,18 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeDASH::load(Serializer& in) { + try { if (in.getString() != name()) return false; - for (uInt32 b = 0; b < 8; b++) { - bank(bankInUse[b] = in.getShort()); // read, and switch it in - } + in.getShortArray(bankInUse, 8); + in.getShortArray(segmentInUse, 4); in.getByteArray(myRAM, RAM_TOTAL_SIZE); } catch (...) { cerr << "ERROR: CartridgeDASH::load" << endl; return false; } + + initializeBankState(); return true; } diff -Nru stella-4.0/src/emucore/CartDASH.hxx stella-4.1.1/src/emucore/CartDASH.hxx --- stella-4.0/src/emucore/CartDASH.hxx 2014-06-06 23:29:00.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDASH.hxx 2014-07-29 22:37:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDASH.hxx 2911 2014-06-06 23:29:00Z adavie $ +// $Id: CartDASH.hxx 2966 2014-07-29 22:37:17Z stephena $ //============================================================================ #ifndef CARTRIDGEDASH_HXX @@ -27,7 +27,7 @@ #ifdef DEBUGGER_SUPPORT class CartridgeDASHWidget; -// #include "CartDASHWidget.hxx" + #include "CartDASHWidget.hxx" #endif /** @@ -35,26 +35,29 @@ Kind of a combination of 3F and 3E, with better switchability. B.Watson's Cart3E was used as a template for building this implementation. - Because a single bank number is used to define both the destination (0-3) - AND the type (ROM/RAM) there are only 5 bits left to indicate the actual bank - number. This sets the limits of 32K ROM and 16K RAM. - - D7 RAM/ROM flag (1=RAM) - D6D5 indicate the bank number (0-3) - D4D3D2D1D0 indicate the actual # (0-31) from the image/ram + The destination bank (0-3) is held in the top bits of the value written to + $3E (for RAM switching) or $3F (for ROM switching). The low 6 bits give + the actual bank number (0-63) corresponding to 512 byte blocks for RAM and + 1024 byte blocks for ROM. The maximum size is therefore 32K RAM and 64K ROM. - Hotspot 0x3F is used for bank-switching, with the encoded bank # as above. + D7D6 indicate the bank number (0-3) + D5D4D3D2D1D0 indicate the actual # (0-63) from the image/ram ROM: + Note: in descriptions $F000 is equivalent to $1000 -- that is, we only deal + with the low 13 bits of addressing. Stella code uses $1000, I'm used to $F000 + So, mask with top bits clear :) when reading this document. + In this scheme, the 4K address space is broken into four 1K ROM segments. living at 0x1000, 0x1400, 0x1800, 0x1C00 (or, same thing, 0xF000... etc.), and four 512 byte RAM segments, living at 0x1000, 0x1200, 0x1400, 0x1600 with write-mirrors +0x800 of these. The last 1K ROM ($FC00-$FFFF) segment - is initialised to point to the FIRST 1K of the ROM image, but it may be - switched out at any time. Note, this is DIFFERENT to 3E which switches in - the UPPER bank and this bank is fixed. This allows variable sized ROM - without having to detect size. First bank (0) in ROM is the default fixed + in the 6502 address space (ie: $1C00-$1FFF) is initialised to point to the + FIRST 1K of the ROM image, so the reset vectors must be placed at the + end of the first 1K in the ROM image. Note, this is DIFFERENT to 3E which + switches in the UPPER bank and this bank is fixed. This allows variable sized + ROM without having to detect size. First bank (0) in ROM is the default fixed bank mapped to $FC00. The system requires the reset vectors to be valid on a reset, so either the @@ -63,29 +66,31 @@ into the last bank area. Currently the latter (programmer onus) is required, but it would be nice for the cartridge hardware to auto-switch on reset. - ROM switching (write of block+bank number to $3F) D7=0 and D6D5 upper 2 bits of bank # - indicates the destination segment (0-3, corresponding to $F000, $F400, $F800, $FC00), - and lower 5 bits indicate the 1K bank to switch in. Can handle 32 x 1K ROM banks (32K total). - - D7 D6 D5 D4D3D2D1D0 - 0 0 0 x x x x x switch a 1K ROM bank xxxxx to $F000 - 0 0 1 switch a 1K ROM bank xxxxx to $F400 - 0 1 0 switch a 1K ROM bank xxxxx to $F800 - 0 1 1 switch a 1K ROM bank xxxxx to $FC00 - - RAM switching (write of segment+bank number to $3F) with D7=1 and D6D5 upper 2 bits of bank # - indicates the destination RAM segment (0-3, corresponding to $F000, $F200, $F400, $F600). - Note that this allows contiguous 2K of RAM to be configured by setting 4 consecutive RAM segments - each 512 bytes with consecutive addresses. However, as the write address of RAM is +0x800, this + ROM switching (write of block+bank number to $3F) D7D6 upper 2 bits of bank # + indicates the destination segment (0-3, corresponding to $F000, $F400, $F800, + $FC00), and lower 6 bits indicate the 1K bank to switch in. Can handle 64 + x 1K ROM banks (64K total). + + D7 D6 D5D4D3D2D1D0 + 0 0 x x x x x x switch a 1K ROM bank xxxxx to $F000 + 0 1 switch a 1K ROM bank xxxxx to $F400 + 1 0 switch a 1K ROM bank xxxxx to $F800 + 1 1 switch a 1K ROM bank xxxxx to $FC00 + + RAM switching (write of segment+bank number to $3E) with D7D6 upper 2 bits of + bank # indicates the destination RAM segment (0-3, corresponding to $F000, + $F200, $F400, $F600). Note that this allows contiguous 2K of RAM to be + configured by setting 4 consecutive RAM segments each 512 bytes with + consecutive addresses. However, as the write address of RAM is +0x800, this invalidates ROM access as described below. - can handle 32 x 512 byte RAM banks (16K total) + can handle 64 x 512 byte RAM banks (32K total) - D7 D6 D5 D4D3D2D1D0 - 1 0 0 x x x x x switch a 512 byte RAM bank xxxxx to $F000 with write @ $F800 - 0 1 switch a 512 byte RAM bank xxxxx to $F200 with write @ $FA00 - 1 0 switch a 512 byte RAM bank xxxxx to $F400 with write @ $FC00 - 1 1 switch a 512 byte RAM bank xxxxx to $F600 with write @ $FE00 + D7 D6 D5D4D3D2D1D0 + 0 0 x x x x x x switch a 512 byte RAM bank xxxxx to $F000 with write @ $F800 + 0 1 switch a 512 byte RAM bank xxxxx to $F200 with write @ $FA00 + 1 0 switch a 512 byte RAM bank xxxxx to $F400 with write @ $FC00 + 1 1 switch a 512 byte RAM bank xxxxx to $F600 with write @ $FE00 It is possible to switch multiple RAM banks and ROM banks together @@ -113,12 +118,9 @@ Switching in RAM block 1 makes F200-F3FF ROM inaccessible, however F000-F1FF is still readable. So, care must be paid. - TODO: THe partial reading of ROM blocks switched out by RAM is not yet implemented!! - This crazy RAM layout is useful as it allows contiguous RAM to be switched in, up to 2K in one sequentially accessible block. This means you CAN have 2K of - consecutive RAM. If you don't detect ROM write area, then you would have NO ROM - switched in (don't forget to copy your reset vectors!) + consecutive RAM (don't forget to copy your reset vectors!) @author Andrew Davie */ @@ -156,23 +158,6 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** - Get the current bank. - */ - uInt16 bank() const; - - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const; - - /** Patch the cartridge ROM. @param address The ROM address to patch @@ -222,7 +207,7 @@ CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h) { - return 0; //new CartridgeDASHWidget(boss, lfont, nfont, x, y, w, h, *this); + return new CartridgeDASHWidget(boss, lfont, nfont, x, y, w, h, *this); } #endif @@ -248,24 +233,27 @@ bool bankRAM(uInt8 bank); // switch a RAM bank bool bankROM(uInt8 bank); // switch a ROM bank + void bankRAMSlot(uInt16 bank); // switch in a 512b RAM slot (lower or upper 1/2 bank) + void bankROMSlot(uInt16 bank); // switch in a 512b RAM slot (read or write port) - uInt32 mySize; // Size of the ROM image - uInt8* myImage; // Pointer to a dynamically allocated ROM image of the cartridge - + void initializeBankState(); // set all banks according to current bankInUse state // We have an array that indicates for each of the 8 512 byte areas of the address space, which ROM/RAM // bank is used in that area. ROM switches 1K so occupies 2 successive entries for each switch. RAM occupies // two as well, one 512 byte for read and one for write. The RAM locations are +0x800 apart, and the ROM // are consecutive. This allows us to determine on a read/write exactly where the data is. - Int16 bankInUse[8]; // bank being used for ROM/RAM (eight 512 byte areas) (-1 = undefined) + static const uInt16 BANK_UNDEFINED = 0x8000; // bank is undefined and inaccessible + uInt16 bankInUse[8]; // bank being used for ROM/RAM (eight 512 byte areas) + uInt16 segmentInUse[4]; // set by bank methods, to know which hotspot was accessed - static const uInt16 BANK_SWITCH_HOTSPOT_RAM = 0x3E; // writes to this address cause bankswitching - static const uInt16 BANK_SWITCH_HOTSPOT_ROM = 0x3F; // writes to this address cause bankswitching + static const uInt16 BANK_SWITCH_HOTSPOT_RAM = 0x3E; // writes to this address cause bankswitching + static const uInt16 BANK_SWITCH_HOTSPOT_ROM = 0x3F; // writes to this address cause bankswitching static const uInt8 BANK_BITS = 6; // # bits for bank static const uInt8 BIT_BANK_MASK = (1 << BANK_BITS) - 1; // mask for those bits - static const uInt8 BITMASK_ROMRAM = 0x80; // flags ROM or RAM bank switching (D7--> 1==RAM) + static const uInt16 BITMASK_LOWERUPPER = 0x100; // flags lower or upper section of bank (1==upper) + static const uInt16 BITMASK_ROMRAM = 0x200; // flags ROM or RAM bank switching (1==RAM) static const uInt16 MAXIMUM_BANK_COUNT = (1< @@ -94,7 +94,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FC0 & ~mask); i < 0x2000; i += (1 << shift)) @@ -115,7 +115,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeDF::bank() const +uInt16 CartridgeDF::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartDF.hxx stella-4.1.1/src/emucore/CartDF.hxx --- stella-4.0/src/emucore/CartDF.hxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDF.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDF.hxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: CartDF.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEDF_HXX @@ -34,7 +34,7 @@ Accessing $1FC0 - $1FDF switches to each bank. @author Mike Saarna - @version $Id: CartDF.hxx 2942 2014-06-30 14:38:18Z stephena $ + @version $Id: CartDF.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeDF : public Cartridge { @@ -79,7 +79,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartDFSC.cxx stella-4.1.1/src/emucore/CartDFSC.cxx --- stella-4.0/src/emucore/CartDFSC.cxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDFSC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDFSC.cxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: CartDFSC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1000 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -142,7 +142,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FC0 & ~mask); i < 0x2000; i += (1 << shift)) @@ -163,7 +163,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeDFSC::bank() const +uInt16 CartridgeDFSC::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartDFSC.hxx stella-4.1.1/src/emucore/CartDFSC.hxx --- stella-4.0/src/emucore/CartDFSC.hxx 2014-06-30 14:38:18.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDFSC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDFSC.hxx 2942 2014-06-30 14:38:18Z stephena $ +// $Id: CartDFSC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEDFSC_HXX @@ -33,7 +33,7 @@ Accessing $1FD0 - $1FEF switches to each bank. @author Stephen Anthony - @version $Id: CartDFSC.hxx 2942 2014-06-30 14:38:18Z stephena $ + @version $Id: CartDFSC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeDFSC : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartDPC.cxx stella-4.1.1/src/emucore/CartDPC.cxx --- stella-4.0/src/emucore/CartDPC.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDPC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDPC.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartDPC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -91,7 +91,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1080 & mask) == 0) && ((0x1100 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READWRITE); + System::PageAccess access(this, System::PA_READWRITE); // Set the page accessing method for the DPC reading & writing pages for(uInt32 j = 0x1000; j < 0x1080; j += (1 << shift)) @@ -418,7 +418,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF8 & ~mask); i < 0x2000; i += (1 << shift)) @@ -439,7 +439,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeDPC::bank() const +uInt16 CartridgeDPC::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartDPC.hxx stella-4.1.1/src/emucore/CartDPC.hxx --- stella-4.0/src/emucore/CartDPC.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDPC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDPC.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartDPC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGE_DPC_HXX @@ -38,7 +38,7 @@ Patent Number 4,644,495. @author Bradford W. Mott - @version $Id: CartDPC.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartDPC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeDPC : public Cartridge { @@ -90,7 +90,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartDPCPlus.cxx stella-4.1.1/src/emucore/CartDPCPlus.cxx --- stella-4.0/src/emucore/CartDPCPlus.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDPCPlus.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDPCPlus.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartDPCPlus.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -134,7 +134,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1080 & mask) == 0) && ((0x1100 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map all of the accesses to call peek and poke for(uInt32 i = 0x1000; i < 0x1080; i += (1 << shift)) @@ -610,7 +610,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map Program ROM image into the system for(uInt32 address = 0x1080; address < 0x2000; address += (1 << shift)) @@ -622,7 +622,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeDPCPlus::bank() const +uInt16 CartridgeDPCPlus::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartDPCPlus.hxx stella-4.1.1/src/emucore/CartDPCPlus.hxx --- stella-4.0/src/emucore/CartDPCPlus.hxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartDPCPlus.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartDPCPlus.hxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartDPCPlus.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGE_DPC_PLUS_HXX @@ -41,7 +41,7 @@ Patent Number 4,644,495. @author Darrell Spice Jr, Fred Quimby, Stephen Anthony, Bradford W. Mott - @version $Id: CartDPCPlus.hxx 2921 2014-06-13 16:28:28Z stephena $ + @version $Id: CartDPCPlus.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeDPCPlus : public Cartridge { @@ -94,7 +94,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartE0.cxx stella-4.1.1/src/emucore/CartE0.cxx --- stella-4.0/src/emucore/CartE0.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartE0.cxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartE0.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartE0.cxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #include @@ -59,7 +59,7 @@ assert(((0x1000 & mask) == 0) && ((0x1400 & mask) == 0) && ((0x1800 & mask) == 0) && ((0x1C00 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page acessing methods for the first part of the last segment for(uInt32 i = 0x1C00; i < (0x1FE0U & ~mask); i += (1 << shift)) @@ -137,7 +137,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 address = 0x1000; address < 0x1400; address += (1 << shift)) { @@ -159,7 +159,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 address = 0x1400; address < 0x1800; address += (1 << shift)) { @@ -181,7 +181,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); for(uInt32 address = 0x1800; address < 0x1C00; address += (1 << shift)) { @@ -193,28 +193,6 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool CartridgeE0::bank(uInt16) -{ - // Doesn't support bankswitching in the normal sense - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeE0::bank() const -{ - // Doesn't support bankswitching in the normal sense - return 0; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeE0::bankCount() const -{ - // Doesn't support bankswitching in the normal sense - // There is one 'virtual' bank that can change in many different ways - return 1; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeE0::patch(uInt16 address, uInt8 value) { address &= 0x0FFF; diff -Nru stella-4.0/src/emucore/CartE0.hxx stella-4.1.1/src/emucore/CartE0.hxx --- stella-4.0/src/emucore/CartE0.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartE0.hxx 2014-07-24 17:15:28.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartE0.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartE0.hxx 2960 2014-07-24 17:15:28Z stephena $ //============================================================================ #ifndef CARTRIDGEE0_HXX @@ -42,7 +42,7 @@ many different ways. @author Bradford W. Mott - @version $Id: CartE0.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartE0.hxx 2960 2014-07-24 17:15:28Z stephena $ */ class CartridgeE0 : public Cartridge { @@ -78,23 +78,6 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** - Get the current bank. - */ - uInt16 bank() const; - - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const; - - /** Patch the cartridge ROM. @param address The ROM address to patch diff -Nru stella-4.0/src/emucore/CartE7.cxx stella-4.1.1/src/emucore/CartE7.cxx --- stella-4.0/src/emucore/CartE7.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartE7.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartE7.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartE7.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -68,7 +68,7 @@ assert(((0x1400 & mask) == 0) && ((0x1800 & mask) == 0) && ((0x1900 & mask) == 0) && ((0x1A00 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FE0 & ~mask); i < 0x2000; i += (1 << shift)) @@ -169,7 +169,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_WRITE); + System::PageAccess access(this, System::PA_WRITE); // Set the page accessing method for the 256 bytes of RAM writing pages for(uInt32 j = 0x1800; j < 0x1900; j += (1 << shift)) @@ -204,7 +204,7 @@ // Setup the page access methods for the current bank if(slice != 7) { - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into first segment for(uInt32 address = 0x1000; address < 0x1800; address += (1 << shift)) @@ -216,7 +216,7 @@ } else { - System::PageAccess access(0, 0, 0, this, System::PA_WRITE); + System::PageAccess access(this, System::PA_WRITE); // Set the page accessing method for the 1K slice of RAM writing pages for(uInt32 j = 0x1000; j < 0x1400; j += (1 << shift)) @@ -240,7 +240,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeE7::bank() const +uInt16 CartridgeE7::getBank() const { return myCurrentSlice[0]; } diff -Nru stella-4.0/src/emucore/CartE7.hxx stella-4.1.1/src/emucore/CartE7.hxx --- stella-4.0/src/emucore/CartE7.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartE7.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartE7.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartE7.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEE7_HXX @@ -59,7 +59,7 @@ 2K area. @author Bradford W. Mott - @version $Id: CartE7.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartE7.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeE7 : public Cartridge { @@ -104,7 +104,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartEF.cxx stella-4.1.1/src/emucore/CartEF.cxx --- stella-4.0/src/emucore/CartEF.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartEF.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartEF.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartEF.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -94,7 +94,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FE0 & ~mask); i < 0x2000; i += (1 << shift)) @@ -115,7 +115,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeEF::bank() const +uInt16 CartridgeEF::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartEF.hxx stella-4.1.1/src/emucore/CartEF.hxx --- stella-4.0/src/emucore/CartEF.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartEF.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartEF.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartEF.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEEF_HXX @@ -37,7 +37,7 @@ as this scheme doesn't seem to be documented anywhere. @author Stephen Anthony - @version $Id: CartEF.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartEF.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeEF : public Cartridge { @@ -82,7 +82,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartEFSC.cxx stella-4.1.1/src/emucore/CartEFSC.cxx --- stella-4.0/src/emucore/CartEFSC.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartEFSC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartEFSC.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartEFSC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1000 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -142,7 +142,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FE0 & ~mask); i < 0x2000; i += (1 << shift)) @@ -163,7 +163,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeEFSC::bank() const +uInt16 CartridgeEFSC::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartEFSC.hxx stella-4.1.1/src/emucore/CartEFSC.hxx --- stella-4.0/src/emucore/CartEFSC.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartEFSC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartEFSC.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartEFSC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEEFSC_HXX @@ -37,7 +37,7 @@ as this scheme doesn't seem to be documented anywhere. @author Stephen Anthony - @version $Id: CartEFSC.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartEFSC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeEFSC : public Cartridge { @@ -82,7 +82,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartF0.cxx stella-4.1.1/src/emucore/CartF0.cxx --- stella-4.0/src/emucore/CartF0.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF0.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF0.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF0.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -97,7 +97,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF0 & ~mask); i < 0x2000; i += (1 << shift)) @@ -129,7 +129,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeF0::bank() const +uInt16 CartridgeF0::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartF0.hxx stella-4.1.1/src/emucore/CartF0.hxx --- stella-4.0/src/emucore/CartF0.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF0.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF0.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF0.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEF0_HXX @@ -34,7 +34,7 @@ Accessing $1FF0 switches to next bank. @author Eckhard Stolberg - @version $Id: CartF0.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartF0.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeF0 : public Cartridge { @@ -79,7 +79,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartF4.cxx stella-4.1.1/src/emucore/CartF4.cxx --- stella-4.0/src/emucore/CartF4.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF4.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF4.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF4.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -99,7 +99,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF4 & ~mask); i < 0x2000; i += (1 << shift)) @@ -120,7 +120,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeF4::bank() const +uInt16 CartridgeF4::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartF4.hxx stella-4.1.1/src/emucore/CartF4.hxx --- stella-4.0/src/emucore/CartF4.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF4.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF4.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF4.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEF4_HXX @@ -33,7 +33,7 @@ are eight 4K banks. @author Bradford W. Mott - @version $Id: CartF4.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartF4.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeF4 : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartF4SC.cxx stella-4.1.1/src/emucore/CartF4SC.cxx --- stella-4.0/src/emucore/CartF4SC.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF4SC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF4SC.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartF4SC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1080 & mask) == 0) && ((0x1100 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -145,7 +145,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF4 & ~mask); i < 0x2000; i += (1 << shift)) @@ -166,7 +166,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeF4SC::bank() const +uInt16 CartridgeF4SC::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartF4SC.hxx stella-4.1.1/src/emucore/CartF4SC.hxx --- stella-4.0/src/emucore/CartF4SC.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF4SC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF4SC.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF4SC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEF4SC_HXX @@ -33,7 +33,7 @@ 128 bytes of RAM. There are eight 4K banks. @author Bradford W. Mott - @version $Id: CartF4SC.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartF4SC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeF4SC : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartF6.cxx stella-4.1.1/src/emucore/CartF6.cxx --- stella-4.0/src/emucore/CartF6.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF6.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF6.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF6.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -139,7 +139,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF6 & ~mask); i < 0x2000; i += (1 << shift)) @@ -160,7 +160,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeF6::bank() const +uInt16 CartridgeF6::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartF6.hxx stella-4.1.1/src/emucore/CartF6.hxx --- stella-4.0/src/emucore/CartF6.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF6.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF6.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF6.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEF6_HXX @@ -33,7 +33,7 @@ are four 4K banks. @author Bradford W. Mott - @version $Id: CartF6.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartF6.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeF6 : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartF6SC.cxx stella-4.1.1/src/emucore/CartF6SC.cxx --- stella-4.0/src/emucore/CartF6SC.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF6SC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF6SC.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartF6SC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1080 & mask) == 0) && ((0x1100 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -188,7 +188,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF6 & ~mask); i < 0x2000; i += (1 << shift)) @@ -209,7 +209,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeF6SC::bank() const +uInt16 CartridgeF6SC::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartF6SC.hxx stella-4.1.1/src/emucore/CartF6SC.hxx --- stella-4.0/src/emucore/CartF6SC.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF6SC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF6SC.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF6SC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEF6SC_HXX @@ -33,7 +33,7 @@ 128 bytes of RAM. There are four 4K banks. @author Bradford W. Mott - @version $Id: CartF6SC.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartF6SC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeF6SC : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartF8.cxx stella-4.1.1/src/emucore/CartF8.cxx --- stella-4.0/src/emucore/CartF8.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF8.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF8.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF8.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -127,7 +127,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF8 & ~mask); i < 0x2000; i += (1 << shift)) @@ -148,7 +148,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeF8::bank() const +uInt16 CartridgeF8::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartF8.hxx stella-4.1.1/src/emucore/CartF8.hxx --- stella-4.0/src/emucore/CartF8.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF8.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF8.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF8.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEF8_HXX @@ -33,7 +33,7 @@ are two 4K banks. @author Bradford W. Mott - @version $Id: CartF8.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartF8.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeF8 : public Cartridge { @@ -80,7 +80,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartF8SC.cxx stella-4.1.1/src/emucore/CartF8SC.cxx --- stella-4.0/src/emucore/CartF8SC.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF8SC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF8SC.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartF8SC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1080 & mask) == 0) && ((0x1100 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -168,7 +168,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF8 & ~mask); i < 0x2000; i += (1 << shift)) @@ -189,7 +189,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeF8SC::bank() const +uInt16 CartridgeF8SC::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartF8SC.hxx stella-4.1.1/src/emucore/CartF8SC.hxx --- stella-4.0/src/emucore/CartF8SC.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartF8SC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF8SC.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartF8SC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEF8SC_HXX @@ -33,7 +33,7 @@ 128 bytes of RAM. There are two 4K banks. @author Bradford W. Mott - @version $Id: CartF8SC.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartF8SC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeF8SC : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartFA2.cxx stella-4.1.1/src/emucore/CartFA2.cxx --- stella-4.0/src/emucore/CartFA2.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartFA2.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFA2.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartFA2.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -80,7 +80,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1100 & mask) == 0) && ((0x1200 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -248,7 +248,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF4 & ~mask); i < 0x2000; i += (1 << shift)) @@ -269,7 +269,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeFA2::bank() const +uInt16 CartridgeFA2::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartFA2.hxx stella-4.1.1/src/emucore/CartFA2.hxx --- stella-4.0/src/emucore/CartFA2.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartFA2.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFA2.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartFA2.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEFA2_HXX @@ -41,7 +41,7 @@ completely ignored by the emulator. @author Chris D. Walton - @version $Id: CartFA2.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartFA2.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeFA2 : public Cartridge { @@ -86,7 +86,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartFA.cxx stella-4.1.1/src/emucore/CartFA.cxx --- stella-4.0/src/emucore/CartFA.cxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/CartFA.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFA.cxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: CartFA.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -64,7 +64,7 @@ // Make sure the system we're being installed in has a page size that'll work assert(((0x1100 & mask) == 0) && ((0x1200 & mask) == 0)); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing method for the RAM writing pages access.type = System::PA_WRITE; @@ -178,7 +178,7 @@ uInt16 shift = mySystem->pageShift(); uInt16 mask = mySystem->pageMask(); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = (0x1FF8 & ~mask); i < 0x2000; i += (1 << shift)) @@ -199,7 +199,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeFA::bank() const +uInt16 CartridgeFA::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartFA.hxx stella-4.1.1/src/emucore/CartFA.hxx --- stella-4.0/src/emucore/CartFA.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartFA.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFA.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartFA.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEFA_HXX @@ -33,7 +33,7 @@ three 4K banks and 256 bytes of RAM. @author Bradford W. Mott - @version $Id: CartFA.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartFA.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeFA : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartFE.cxx stella-4.1.1/src/emucore/CartFE.cxx --- stella-4.0/src/emucore/CartFE.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartFE.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFE.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartFE.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -63,7 +63,7 @@ // Make sure the system we're being installed in has a page size that'll work assert((0x1000 & mask) == 0); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map all of the accesses to call peek and poke for(uInt32 i = 0x1000; i < 0x2000; i += (1 << shift)) @@ -104,14 +104,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool CartridgeFE::bank(uInt16) -{ - // Doesn't support bankswitching in the normal sense - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeFE::bank() const +uInt16 CartridgeFE::getBank() const { // The current bank depends on the last address accessed return ((myLastAddress1 & 0x2000) == 0) ? 1 : 0; diff -Nru stella-4.0/src/emucore/CartFE.hxx stella-4.1.1/src/emucore/CartFE.hxx --- stella-4.0/src/emucore/CartFE.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartFE.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFE.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartFE.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEFE_HXX @@ -48,7 +48,7 @@ determined on a real system. @author Bradford W. Mott - @version $Id: CartFE.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartFE.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeFE : public Cartridge { @@ -84,16 +84,9 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/Cart.hxx stella-4.1.1/src/emucore/Cart.hxx --- stella-4.0/src/emucore/Cart.hxx 2014-06-13 16:28:28.000000000 +0000 +++ stella-4.1.1/src/emucore/Cart.hxx 2014-08-14 00:03:56.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart.hxx 2921 2014-06-13 16:28:28Z stephena $ +// $Id: Cart.hxx 2974 2014-08-14 00:03:56Z stephena $ //============================================================================ #ifndef CARTRIDGE_HXX @@ -35,11 +35,6 @@ #include "Settings.hxx" #include "Font.hxx" -struct RamArea { - uInt16 start; uInt16 size; uInt16 roffset; uInt16 woffset; -}; -typedef Common::Array RamAreaList; - /** A cartridge is a device which contains the machine code for a game and handles any bankswitching performed by the cartridge. @@ -47,7 +42,7 @@ 0x1000-0x2000 area (or its mirrors). @author Bradford W. Mott - @version $Id: Cart.hxx 2921 2014-06-13 16:28:28Z stephena $ + @version $Id: Cart.hxx 2974 2014-08-14 00:03:56Z stephena $ */ class Cartridge : public Device { @@ -125,18 +120,24 @@ public: ////////////////////////////////////////////////////////////////////// - // The following methods are cart-specific and must be implemented - // in derived classes. + // The following methods are cart-specific and will usually be + // implemented in derived classes. Carts which don't support + // bankswitching (for any reason) do not have to provide an + // implementation for bankswitch-related methods. ////////////////////////////////////////////////////////////////////// /** - Set the specified bank. + Set the specified bank. This is used only when the bankswitching + scheme defines banks in a standard format (ie, 0 for first bank, + 1 for second, etc). Carts which will handle their own bankswitching + completely or non-bankswitched carts can ignore this method. */ - virtual bool bank(uInt16 bank) = 0; + virtual bool bank(uInt16) { return false; } /** - Get the current bank. + Get the current bank. Carts which have only one bank (either real + or virtual) always report that bank as zero. */ - virtual uInt16 bank() const = 0; + virtual uInt16 getBank() const { return 0; } /** Query the number of 'banks' supported by the cartridge. Note that @@ -151,7 +152,7 @@ RAM slices at multiple access points) is so complicated that the cart will report having only one 'virtual' bank. */ - virtual uInt16 bankCount() const = 0; + virtual uInt16 bankCount() const { return 1; } /** Patch the cartridge ROM. @@ -210,6 +211,15 @@ virtual CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h) { return NULL; } + // Info about the various bankswitch schemes, useful for displaying + // in GUI dropdown boxes, etc + struct BankswitchType { + const char* type; + const char* desc; + }; + enum { ourNumBSTypes = 44 }; + static BankswitchType ourBSList[ourNumBSTypes]; + protected: /** Indicate that an illegal read from a write port has occurred. @@ -303,6 +313,11 @@ static bool isProbably4A50(const uInt8* image, uInt32 size); /** + Returns true if the image is probably a BF/BFSC bankswitching cartridge + */ + static bool isProbablyBF(const uInt8* image, uInt32 size, const char*& type); + + /** Returns true if the image is probably a CTY bankswitching cartridge */ static bool isProbablyCTY(const uInt8* image, uInt32 size); @@ -318,6 +333,11 @@ static bool isProbablyDASH(const uInt8* image, uInt32 size); /** + Returns true if the image is probably a DF/DFSC bankswitching cartridge + */ + static bool isProbablyDF(const uInt8* image, uInt32 size, const char*& type); + + /** Returns true if the image is probably a DPC+ bankswitching cartridge */ static bool isProbablyDPCplus(const uInt8* image, uInt32 size); @@ -338,15 +358,6 @@ static bool isProbablyEF(const uInt8* image, uInt32 size, const char*& type); /** - Returns true if the image is probably a BF/BFSC bankswitching cartridge - */ - static bool isProbablyBF(const uInt8* image, uInt32 size, const char*& type); - /** - Returns true if the image is probably a DF/DFSC bankswitching cartridge - */ - static bool isProbablyDF(const uInt8* image, uInt32 size, const char*& type); - - /** Returns true if the image is probably an F6 bankswitching cartridge */ static bool isProbablyF6(const uInt8* image, uInt32 size); @@ -362,6 +373,11 @@ static bool isProbablyFE(const uInt8* image, uInt32 size); /** + Returns true if the image is probably a MDM bankswitching cartridge + */ + static bool isProbablyMDM(const uInt8* image, uInt32 size); + + /** Returns true if the image is probably a SB bankswitching cartridge */ static bool isProbablySB(const uInt8* image, uInt32 size); diff -Nru stella-4.0/src/emucore/CartMC.cxx stella-4.1.1/src/emucore/CartMC.cxx --- stella-4.0/src/emucore/CartMC.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartMC.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartMC.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartMC.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -82,7 +82,7 @@ // TODO: These TIA accesses may need to be chained, however, at this // point Chris isn't sure if the hardware will allow it or not // - System::PageAccess access(0, 0, 0, this, System::PA_READWRITE); + System::PageAccess access(this, System::PA_READWRITE); for(uInt32 i = 0x00; i < 0x40; i += (1 << shift)) mySystem->setPageAccess(i >> shift, access); @@ -210,14 +210,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool CartridgeMC::bank(uInt16 b) -{ - // Doesn't support bankswitching in the normal sense - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeMC::bank() const +uInt16 CartridgeMC::getBank() const { // TODO - add support for debugger return 0; diff -Nru stella-4.0/src/emucore/CartMC.hxx stella-4.1.1/src/emucore/CartMC.hxx --- stella-4.0/src/emucore/CartMC.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartMC.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartMC.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartMC.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEMC_HXX @@ -137,7 +137,7 @@ @author Bradford W. Mott - @version $Id: CartMC.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartMC.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeMC : public Cartridge { @@ -175,16 +175,9 @@ void install(System& system); /** - Install pages for the specified bank in the system. - - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank); - - /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartMDM.cxx stella-4.1.1/src/emucore/CartMDM.cxx --- stella-4.0/src/emucore/CartMDM.cxx 1970-01-01 00:00:00.000000000 +0000 +++ stella-4.1.1/src/emucore/CartMDM.cxx 2014-09-01 14:56:06.000000000 +0000 @@ -0,0 +1,205 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: CartMDM.cxx 2985 2014-09-01 14:56:06Z stephena $ +//============================================================================ + +#include +#include + +#include "System.hxx" +#include "CartMDM.hxx" + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +CartridgeMDM::CartridgeMDM(const uInt8* image, uInt32 size, const Settings& settings) + : Cartridge(settings), + myImage(NULL), + mySize(size), + myBankingDisabled(false) +{ + // Allocate array for the ROM image + myImage = new uInt8[mySize]; + + // Copy the ROM image into my buffer + memcpy(myImage, image, mySize); + createCodeAccessBase(mySize); + + // Remember startup bank + myStartBank = 0; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +CartridgeMDM::~CartridgeMDM() +{ + delete[] myImage; myImage = NULL; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeMDM::reset() +{ + // Upon reset we switch to the startup bank + bank(myStartBank); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeMDM::install(System& system) +{ + mySystem = &system; + uInt16 shift = mySystem->pageShift(); + uInt16 mask = mySystem->pageMask(); + + // Make sure the system we're being installed in has a page size that'll work + assert((0x1000 & mask) == 0); + + // Get the page accessing methods for the hot spots since they overlap + // areas within the TIA we'll need to forward requests to the TIA + myHotSpotPageAccess[0] = mySystem->getPageAccess(0x0800 >> shift); + myHotSpotPageAccess[1] = mySystem->getPageAccess(0x0900 >> shift); + myHotSpotPageAccess[2] = mySystem->getPageAccess(0x0A00 >> shift); + myHotSpotPageAccess[3] = mySystem->getPageAccess(0x0B00 >> shift); + myHotSpotPageAccess[4] = mySystem->getPageAccess(0x0C00 >> shift); + myHotSpotPageAccess[5] = mySystem->getPageAccess(0x0D00 >> shift); + myHotSpotPageAccess[6] = mySystem->getPageAccess(0x0E00 >> shift); + myHotSpotPageAccess[7] = mySystem->getPageAccess(0x0F00 >> shift); + + // Set the page accessing methods for the hot spots + System::PageAccess access(this, System::PA_READ); + for(uInt32 i = 0x0800; i < 0x0FFF; i += (1 << shift)) + mySystem->setPageAccess(i >> shift, access); + + // Install pages for bank 0 + bank(myStartBank); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt8 CartridgeMDM::peek(uInt16 address) +{ + // Because of the way we've set up accessing above, we can only + // get here when the addresses are from 0x800 - 0xFFF + bank(address & 0x0FF); + + int hotspot = ((address & 0x0F00) >> 8) - 8; + return myHotSpotPageAccess[hotspot].device->peek(address); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool CartridgeMDM::poke(uInt16 address, uInt8 value) +{ + // Currently, writing to the hotspots is disabled, so we don't need to + // worry about bankswitching + // However, all possible addresses can appear here, and we only care + // about those below $1000 + if(!(address & 0x1000)) + { + int hotspot = ((address & 0x0F00) >> 8) - 8; + myHotSpotPageAccess[hotspot].device->poke(address, value); + } + + return false; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool CartridgeMDM::bank(uInt16 bank) +{ + if(bankLocked() || myBankingDisabled) return false; + + // Remember what bank we're in + // Wrap around to a valid bank number if necessary + myCurrentBank = bank % bankCount(); + uInt32 offset = myCurrentBank << 12; + uInt16 shift = mySystem->pageShift(); + + // Setup the page access methods for the current bank + System::PageAccess access(this, System::PA_READ); + + // Map ROM image into the system + for(uInt32 address = 0x1000; address < 0x2000; address += (1 << shift)) + { + access.directPeekBase = &myImage[offset + (address & 0x0FFF)]; + access.codeAccessBase = &myCodeAccessBase[offset + (address & 0x0FFF)]; + mySystem->setPageAccess(address >> shift, access); + } + + // Accesses above bank 127 disable further bankswitching; we're only + // concerned with the lower byte + myBankingDisabled = myBankingDisabled || bank > 127; + return myBankChanged = true; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt16 CartridgeMDM::getBank() const +{ + return myCurrentBank; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt16 CartridgeMDM::bankCount() const +{ + return mySize >> 12; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool CartridgeMDM::patch(uInt16 address, uInt8 value) +{ + myImage[(myCurrentBank << 12) + (address & 0x0FFF)] = value; + return myBankChanged = true; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const uInt8* CartridgeMDM::getImage(int& size) const +{ + size = mySize; + return myImage; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool CartridgeMDM::save(Serializer& out) const +{ + try + { + out.putString(name()); + out.putShort(myCurrentBank); + } + catch(...) + { + cerr << "ERROR: CartridgeMDM::save" << endl; + return false; + } + + return true; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool CartridgeMDM::load(Serializer& in) +{ + try + { + if(in.getString() != name()) + return false; + + myCurrentBank = in.getShort(); + } + catch(...) + { + cerr << "ERROR: CartridgeMDM::load" << endl; + return false; + } + + // Remember what bank we were in + bank(myCurrentBank); + + return true; +} diff -Nru stella-4.0/src/emucore/CartMDM.hxx stella-4.1.1/src/emucore/CartMDM.hxx --- stella-4.0/src/emucore/CartMDM.hxx 1970-01-01 00:00:00.000000000 +0000 +++ stella-4.1.1/src/emucore/CartMDM.hxx 2014-08-29 15:33:04.000000000 +0000 @@ -0,0 +1,183 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: CartMDM.hxx 2981 2014-08-29 15:33:04Z stephena $ +//============================================================================ + +#ifndef CARTRIDGEMDM_HXX +#define CARTRIDGEMDM_HXX + +#include "bspf.hxx" +#include "Cart.hxx" +#include "System.hxx" +#ifdef DEBUGGER_SUPPORT + #include "CartMDMWidget.hxx" +#endif + +/** + Cartridge class used for "Menu Driven Megacart" as described at the + following link and developed by Edwin Blink: + + http://atariage.com/forums/topic/56073-cheap-2k4k-x-in-1-menu-driven-multicart-for-atari-2600 + + The hotspots in this scheme read from addresses $800 to $FFF, where the + lower byte determines the actual 4K bank switch to. In the current + implementation, only 128 banks are supported, so selecting bank 128+ results + in further bankswitching being locked. A reset line is used to reset to + bank 0 and re-enable bankswitching. + + Therefore, there are 128 banks / 512K possible in total. + + @author Stephen Anthony, based on 0840 scheme by Fred X. Quimby +*/ +class CartridgeMDM : public Cartridge +{ + friend class CartridgeMDMWidget; + + public: + /** + Create a new cartridge using the specified image + + @param image Pointer to the ROM image + @param size The size of the ROM image + @param settings A reference to the various settings (read-only) + */ + CartridgeMDM(const uInt8* image, uInt32 size, const Settings& settings); + + /** + Destructor + */ + virtual ~CartridgeMDM(); + + public: + /** + Reset device to its power-on state + */ + void reset(); + + /** + Install cartridge in the specified system. Invoked by the system + when the cartridge is attached to it. + + @param system The system the device should install itself in + */ + void install(System& system); + + /** + Install pages for the specified bank in the system. + + @param bank The bank that should be installed in the system + */ + bool bank(uInt16 bank); + + /** + Get the current bank. + */ + uInt16 getBank() const; + + /** + Query the number of banks supported by the cartridge. + */ + uInt16 bankCount() const; + + /** + Patch the cartridge ROM. + + @param address The ROM address to patch + @param value The value to place into the address + @return Success or failure of the patch operation + */ + bool patch(uInt16 address, uInt8 value); + + /** + Access the internal ROM image for this cartridge. + + @param size Set to the size of the internal ROM image data + @return A pointer to the internal ROM image data + */ + const uInt8* getImage(int& size) const; + + /** + Save the current state of this cart to the given Serializer. + + @param out The Serializer object to use + @return False on any errors, else true + */ + bool save(Serializer& out) const; + + /** + Load the current state of this cart from the given Serializer. + + @param in The Serializer object to use + @return False on any errors, else true + */ + bool load(Serializer& in); + + /** + Get a descriptor for the device name (used in error checking). + + @return The name of the object + */ + string name() const { return "CartridgeMDM"; } + + #ifdef DEBUGGER_SUPPORT + /** + Get debugger widget responsible for accessing the inner workings + of the cart. + */ + CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont, + const GUI::Font& nfont, int x, int y, int w, int h) + { + return new CartridgeMDMWidget(boss, lfont, nfont, x, y, w, h, *this); + } + #endif + + public: + /** + Get the byte at the specified address. + + @return The byte at the specified address + */ + uInt8 peek(uInt16 address); + + /** + Change the byte at the specified address to the given value + + @param address The address where the value should be stored + @param value The value to be stored at the address + @return True if the poke changed the device address space, else false + */ + bool poke(uInt16 address, uInt8 value); + + private: + // Pointer to a dynamically allocated ROM image of the cartridge + uInt8* myImage; + + // Size of the ROM image + uInt32 mySize; + + // Indicates which bank is currently active + uInt16 myCurrentBank; + + // Previous Device's page access + System::PageAccess myHotSpotPageAccess[8]; + + // Indicates whether banking has been disabled due to a bankswitch + // above bank 127 + bool myBankingDisabled; +}; + +#endif diff -Nru stella-4.0/src/emucore/CartSB.cxx stella-4.1.1/src/emucore/CartSB.cxx --- stella-4.0/src/emucore/CartSB.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartSB.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -74,7 +74,7 @@ myHotSpotPageAccess[6] = mySystem->getPageAccess(0x0E00 >> shift); myHotSpotPageAccess[7] = mySystem->getPageAccess(0x0F00 >> shift); - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Set the page accessing methods for the hot spots for(uInt32 i = 0x0800; i < 0x0FFF; i += (1 << shift)) @@ -134,7 +134,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1000; address < 0x2000; address += (1 << shift)) @@ -147,7 +147,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeSB::bank() const +uInt16 CartridgeSB::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartSB.hxx stella-4.1.1/src/emucore/CartSB.hxx --- stella-4.0/src/emucore/CartSB.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartSB.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartUA.cxx stella-4.1.1/src/emucore/CartUA.cxx --- stella-4.0/src/emucore/CartUA.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartUA.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartUA.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartUA.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -62,7 +62,7 @@ myHotSpotPageAccess = mySystem->getPageAccess(0x0220 >> shift); // Set the page accessing methods for the hot spots - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); mySystem->setPageAccess(0x0220 >> shift, access); mySystem->setPageAccess(0x0240 >> shift, access); @@ -142,7 +142,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1000; address < 0x2000; address += (1 << shift)) @@ -155,7 +155,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeUA::bank() const +uInt16 CartridgeUA::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartUA.hxx stella-4.1.1/src/emucore/CartUA.hxx --- stella-4.0/src/emucore/CartUA.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartUA.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartUA.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartUA.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEUA_HXX @@ -33,7 +33,7 @@ are two 4K banks. @author Bradford W. Mott - @version $Id: CartUA.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartUA.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeUA : public Cartridge { @@ -78,7 +78,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/CartX07.cxx stella-4.1.1/src/emucore/CartX07.cxx --- stella-4.0/src/emucore/CartX07.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartX07.cxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartX07.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartX07.cxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #include @@ -62,7 +62,7 @@ // Set the page accessing methods for the hot spots // The hotspots use almost all addresses below 0x1000, so we simply grab them // all and forward the TIA/RIOT calls from the peek and poke methods. - System::PageAccess access(0, 0, 0, this, System::PA_READWRITE); + System::PageAccess access(this, System::PA_READWRITE); for(uInt32 i = 0x00; i < 0x1000; i += (1 << shift)) mySystem->setPageAccess(i >> shift, access); @@ -126,7 +126,7 @@ uInt16 shift = mySystem->pageShift(); // Setup the page access methods for the current bank - System::PageAccess access(0, 0, 0, this, System::PA_READ); + System::PageAccess access(this, System::PA_READ); // Map ROM image into the system for(uInt32 address = 0x1000; address < 0x2000; address += (1 << shift)) @@ -139,7 +139,7 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt16 CartridgeX07::bank() const +uInt16 CartridgeX07::getBank() const { return myCurrentBank; } diff -Nru stella-4.0/src/emucore/CartX07.hxx stella-4.1.1/src/emucore/CartX07.hxx --- stella-4.0/src/emucore/CartX07.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/CartX07.hxx 2014-07-28 13:40:37.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartX07.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CartX07.hxx 2963 2014-07-28 13:40:37Z stephena $ //============================================================================ #ifndef CARTRIDGEX07_HXX @@ -43,7 +43,7 @@ Note that the latter will hit on almost any TIA access. @author Eckhard Stolberg - @version $Id: CartX07.hxx 2833 2014-01-12 17:23:42Z stephena $ + @version $Id: CartX07.hxx 2963 2014-07-28 13:40:37Z stephena $ */ class CartridgeX07 : public Cartridge { @@ -88,7 +88,7 @@ /** Get the current bank. */ - uInt16 bank() const; + uInt16 getBank() const; /** Query the number of banks supported by the cartridge. diff -Nru stella-4.0/src/emucore/EventHandler.cxx stella-4.1.1/src/emucore/EventHandler.cxx --- stella-4.0/src/emucore/EventHandler.cxx 2014-06-19 16:45:07.000000000 +0000 +++ stella-4.1.1/src/emucore/EventHandler.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.cxx 2928 2014-06-19 16:45:07Z stephena $ +// $Id: EventHandler.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include @@ -228,31 +228,31 @@ { if(BSPF_startsWithIgnoreCase(myJoysticks[i]->name, "Stelladaptor")) { - saCount++; - if(saOrder[saCount-1] == 1) + if(saOrder[saCount] == 1) { myJoysticks[i]->name += " (emulates left joystick port)"; myJoysticks[i]->type = StellaJoystick::JT_STELLADAPTOR_LEFT; } - else if(saOrder[saCount-1] == 2) + else if(saOrder[saCount] == 2) { myJoysticks[i]->name += " (emulates right joystick port)"; myJoysticks[i]->type = StellaJoystick::JT_STELLADAPTOR_RIGHT; } + saCount++; } else if(BSPF_startsWithIgnoreCase(myJoysticks[i]->name, "2600-daptor")) { - saCount++; - if(saOrder[saCount-1] == 1) + if(saOrder[saCount] == 1) { myJoysticks[i]->name += " (emulates left joystick port)"; myJoysticks[i]->type = StellaJoystick::JT_2600DAPTOR_LEFT; } - else if(saOrder[saCount-1] == 2) + else if(saOrder[saCount] == 2) { myJoysticks[i]->name += " (emulates right joystick port)"; myJoysticks[i]->type = StellaJoystick::JT_2600DAPTOR_RIGHT; } + saCount++; } } myOSystem.settings().setValue("saport", saport); @@ -897,16 +897,18 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EventHandler::handleSystemEvent(SystemEvent e, int data1, int data2) +void EventHandler::handleSystemEvent(SystemEvent e, int, int) { switch(e) { case EVENT_WINDOW_EXPOSED: myOSystem.frameBuffer().refresh(); break; +#if 0 case EVENT_WINDOW_MINIMIZED: if(myState == S_EMULATE) enterMenuMode(S_MENU); break; +#endif default: // handle other events as testing requires // cerr << "handleSystemEvent: " << e << endl; break; diff -Nru stella-4.0/src/emucore/FBSurface.cxx stella-4.1.1/src/emucore/FBSurface.cxx --- stella-4.0/src/emucore/FBSurface.cxx 2014-06-19 16:45:07.000000000 +0000 +++ stella-4.1.1/src/emucore/FBSurface.cxx 2014-08-28 14:21:44.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FBSurface.cxx 2928 2014-06-19 16:45:07Z stephena $ +// $Id: FBSurface.cxx 2979 2014-08-28 14:21:44Z stephena $ //============================================================================ #include "FrameBuffer.hxx" @@ -283,23 +283,5 @@ } } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurface::drawSurface(const FBSurface* surface) -{ - const GUI::Rect& srcR = ((FBSurface*)surface)->srcRect(); - const GUI::Rect& dstR = ((FBSurface*)surface)->dstRect(); - - const uInt32* src = surface->myPixels + srcR.y() * surface->myPitch + srcR.x(); - uInt32* dst = myPixels + dstR.y() * myPitch + dstR.x(); - - uInt32 h = srcR.height(), w = srcR.width() * 4; - while(h--) - { - memcpy(dst, src, w); - src += surface->myPitch; - dst += myPitch; - } -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const uInt32* FBSurface::myPalette = 0; diff -Nru stella-4.0/src/emucore/FBSurface.hxx stella-4.1.1/src/emucore/FBSurface.hxx --- stella-4.0/src/emucore/FBSurface.hxx 2014-06-19 16:45:07.000000000 +0000 +++ stella-4.1.1/src/emucore/FBSurface.hxx 2014-08-28 14:21:44.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FBSurface.hxx 2928 2014-06-19 16:45:07Z stephena $ +// $Id: FBSurface.hxx 2979 2014-08-28 14:21:44Z stephena $ //============================================================================ #ifndef FBSURFACE_HXX @@ -52,7 +52,7 @@ class FBSurface { - friend class TIASurface; +// friend class TIASurface; public: /** @@ -209,26 +209,10 @@ int deltax = 0, bool useEllipsis = true); /** - This method should be called copy the contents of the given - surface into the FrameBuffer surface. No scaling is done; that is, - a straight-forward copy of the surface pixels is done at the specified - destination. - - @param surface The data to draw + This method should be called to indicate that the surface has been + modified, and should be redrawn at the next interval. */ - virtual void drawSurface(const FBSurface* surface); - - /** - This method should be called to add a dirty rectangle - (ie, an area of the screen that has changed) - - @param x The x coordinate - @param y The y coordinate - @param w The width of the area - @param h The height of the area - */ - virtual void addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h) { } - virtual void addDirtyRect() { } + virtual void setDirty() { } ////////////////////////////////////////////////////////////////////////// // Note: The following methods are FBSurface-specific, and must be @@ -249,8 +233,8 @@ These methods answer the current *rendering* dimensions of the specified surface. */ - virtual const GUI::Rect& srcRect() = 0; - virtual const GUI::Rect& dstRect() = 0; + virtual const GUI::Rect& srcRect() const = 0; + virtual const GUI::Rect& dstRect() const = 0; /** These methods set the origin point and width/height for the @@ -263,6 +247,12 @@ virtual void setDstSize(uInt32 w, uInt32 h) = 0; /** + This method should be called to enable/disable showing the surface + (ie, if hidden it will not be drawn under any circumstances. + */ + virtual void setVisible(bool visible) = 0; + + /** This method should be called to translate the given coordinates to the (destination) surface coordinates. @@ -273,8 +263,9 @@ /** This method should be called to draw the surface to the screen. + It will return true if rendering actually occurred. */ - virtual void render() = 0; + virtual bool render() = 0; /** This method should be called to reset the surface to empty @@ -294,9 +285,13 @@ */ virtual void reload() = 0; - static void setPalette(const uInt32* palette) { myPalette = palette; } + /** + This method should be called to resize the surface to the + given dimensions and reload data/state. The surface is not + modified if it is larger than the given dimensions. + */ + virtual void resize(uInt32 width, uInt32 height) = 0; - protected: /** The rendering attributes that can be modified for this texture. These probably can only be implemented in child FBSurfaces where @@ -307,6 +302,12 @@ bool blending; // Blending is enabled uInt32 blendalpha; // Alpha to use in blending mode (0-100%) }; + + /** + Get the currently applied attributes. + */ + Attributes& attributes() { return myAttributes; } + /** The child class chooses which (if any) of the actual attributes can be applied. @@ -317,6 +318,8 @@ */ virtual void applyAttributes(bool immediate = true) = 0; + static void setPalette(const uInt32* palette) { myPalette = palette; } + protected: static const uInt32* myPalette; uInt32* myPixels; diff -Nru stella-4.0/src/emucore/FrameBuffer.cxx stella-4.1.1/src/emucore/FrameBuffer.cxx --- stella-4.0/src/emucore/FrameBuffer.cxx 2014-06-30 22:46:33.000000000 +0000 +++ stella-4.1.1/src/emucore/FrameBuffer.cxx 2014-09-03 13:27:33.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.cxx 2944 2014-06-30 22:46:33Z stephena $ +// $Id: FrameBuffer.cxx 2989 2014-09-03 13:27:33Z stephena $ //============================================================================ #include @@ -77,8 +77,8 @@ bool FrameBuffer::initialize() { // Get desktop resolution and supported renderers - uInt32 query_w, query_h; - queryHardware(query_w, query_h, myRenderers); + queryHardware(myDisplays, myRenderers); + uInt32 query_w = myDisplays[0].w, query_h = myDisplays[0].h; // Check the 'maxres' setting, which is an undocumented developer feature // that specifies the desktop size (not normally set) @@ -102,8 +102,7 @@ // We can probably add ifdefs to take care of corner cases, // but that means we've failed to abstract it enough ... //////////////////////////////////////////////////////////////////// - bool smallScreen = myDesktopSize.w < kFBMinW || - myDesktopSize.h < kFBMinH; + bool smallScreen = myDesktopSize.w < kFBMinW || myDesktopSize.h < kFBMinH; // 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 @@ -148,11 +147,13 @@ } // Set palette for GUI (upper area of array, doesn't change during execution) + int palID = myOSystem.settings().getString("uipalette") == "classic" ? 1 : 0; + for(int i = 0, j = 256; i < kNumColors-256; ++i, ++j) { - Uint8 r = (ourGUIColors[i] >> 16) & 0xff; - Uint8 g = (ourGUIColors[i] >> 8) & 0xff; - Uint8 b = ourGUIColors[i] & 0xff; + Uint8 r = (ourGUIColors[palID][i] >> 16) & 0xff; + Uint8 g = (ourGUIColors[palID][i] >> 8) & 0xff; + Uint8 b = ourGUIColors[palID][i] & 0xff; myPalette[j] = mapRGB(r, g, b); } @@ -302,7 +303,7 @@ msg, 1, 1, myStatsMsg.w, myStatsMsg.color, kTextAlignLeft); myStatsMsg.surface->drawString(infoFont(), info.BankSwitch, 1, 15, myStatsMsg.w, myStatsMsg.color, kTextAlignLeft); - myStatsMsg.surface->addDirtyRect(); // force a full draw + myStatsMsg.surface->setDirty(); myStatsMsg.surface->setDstPos(myImageRect.x() + 1, myImageRect.y() + 1); myStatsMsg.surface->render(); } @@ -486,7 +487,7 @@ } else { - myMsg.surface->addDirtyRect(); + myMsg.surface->setDirty(); myMsg.surface->render(); } } @@ -741,7 +742,11 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight) { myWindowedModeList.clear(); - myFullscreenModeList.clear(); + + for(uInt32 i = 0; i < myFullscreenModeLists.size(); ++i) + myFullscreenModeLists[i].clear(); + for(uInt32 i = myFullscreenModeLists.size(); i < myDisplays.size(); ++i) + myFullscreenModeLists.push_back(VideoModeList()); // Check if zooming is allowed for this state (currently only allowed // for TIA screens) @@ -772,26 +777,34 @@ desc << "Zoom " << zoom << "x"; VideoMode mode(baseWidth*zoom, baseHeight*zoom, - baseWidth*zoom, baseHeight*zoom, false, zoom, desc.str()); + baseWidth*zoom, baseHeight*zoom, -1, zoom, desc.str()); mode.applyAspectCorrection(aspect); myWindowedModeList.add(mode); } // TIA fullscreen mode - VideoMode mode(baseWidth*maxZoom, baseHeight*maxZoom, - myDesktopSize.w, myDesktopSize.h, true); - mode.applyAspectCorrection(aspect, myOSystem.settings().getBool("tia.fsfill")); - myFullscreenModeList.add(mode); + for(uInt32 i = 0; i < myDisplays.size(); ++i) + { + maxZoom = maxWindowSizeForScreen(baseWidth, baseHeight, + myDisplays[i].w, myDisplays[i].h); + VideoMode mode(baseWidth*maxZoom, baseHeight*maxZoom, + myDisplays[i].w, myDisplays[i].h, i); + mode.applyAspectCorrection(aspect, myOSystem.settings().getBool("tia.fsfill")); + myFullscreenModeLists[i].add(mode); + } } else // UI mode { // Windowed and fullscreen mode differ only in screen size myWindowedModeList.add( - VideoMode(baseWidth, baseHeight, baseWidth, baseHeight, false) - ); - myFullscreenModeList.add( - VideoMode(baseWidth, baseHeight, myDesktopSize.w, myDesktopSize.h, true) + VideoMode(baseWidth, baseHeight, baseWidth, baseHeight, -1) ); + for(uInt32 i = 0; i < myDisplays.size(); ++i) + { + myFullscreenModeLists[i].add( + VideoMode(baseWidth, baseHeight, myDisplays[i].w, myDisplays[i].h, i) + ); + } } } @@ -801,7 +814,15 @@ EventHandler::State state = myOSystem.eventHandler().state(); if(fullscreen) - myCurrentModeList = &myFullscreenModeList; + { + Int32 i = getCurrentDisplayIndex(); + if(i < 0) + { + // default to the first display + i = 0; + } + myCurrentModeList = &myFullscreenModeLists[i]; + } else myCurrentModeList = &myWindowedModeList; @@ -822,7 +843,7 @@ // // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VideoMode::VideoMode() - : fullscreen(false), + : fsIndex(-1), zoom(1), description("") { @@ -830,8 +851,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VideoMode::VideoMode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh, - bool full, uInt32 z, const string& desc) - : fullscreen(full), + Int32 full, uInt32 z, const string& desc) + : fsIndex(full), zoom(z), description(desc) { @@ -852,7 +873,7 @@ uInt32 iw = (uInt32)(float(image.width() * aspect) / 100.0); uInt32 ih = image.height(); - if(fullscreen) + if(fsIndex != -1) { // Fullscreen mode stretching float stretchFactor = 1.0; @@ -1008,12 +1029,24 @@ kDbgChangedTextColor Text color for changed cells kDbgColorHi Highlighted color in debugger data cells */ -uInt32 FrameBuffer::ourGUIColors[kNumColors-256] = { - 0x686868, 0x000000, 0x404040, 0x000000, 0x62a108, 0x9f0000, - 0xc9af7c, 0xf0f0cf, 0xc80000, - 0xac3410, 0xd55941, 0xffffff, 0xffd652, - 0xac3410, - 0xac3410, 0xd55941, - 0xac3410, 0xd55941, - 0xc80000, 0x00ff00, 0xc8c8ff +uInt32 FrameBuffer::ourGUIColors[2][kNumColors-256] = { + // Standard + { 0x686868, 0x000000, 0x404040, 0x000000, 0x62a108, 0x9f0000, + 0xc9af7c, 0xf0f0cf, 0xc80000, + 0xac3410, 0xd55941, 0xffffff, 0xffd652, + 0xac3410, + 0xac3410, 0xd55941, + 0xac3410, 0xd55941, + 0xc80000, 0x00ff00, 0xc8c8ff + }, + + // Classic + { 0x686868, 0x000000, 0x404040, 0x20a020, 0x00ff00, 0xc80000, + 0x000000, 0x000000, 0xc80000, + 0x000000, 0x000000, 0x20a020, 0x00ff00, + 0x20a020, + 0x20a020, 0x00ff00, + 0x20a020, 0x00ff00, + 0xc80000, 0x00ff00, 0xc8c8ff + } }; diff -Nru stella-4.0/src/emucore/FrameBuffer.hxx stella-4.1.1/src/emucore/FrameBuffer.hxx --- stella-4.0/src/emucore/FrameBuffer.hxx 2014-06-21 20:51:08.000000000 +0000 +++ stella-4.1.1/src/emucore/FrameBuffer.hxx 2014-09-03 13:27:33.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.hxx 2934 2014-06-21 20:51:08Z stephena $ +// $Id: FrameBuffer.hxx 2989 2014-09-03 13:27:33Z stephena $ //============================================================================ #ifndef FRAMEBUFFER_HXX @@ -97,19 +97,19 @@ public: GUI::Rect image; GUI::Size screen; - bool fullscreen; + Int32 fsIndex; uInt32 zoom; string description; public: VideoMode(); - VideoMode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh, bool full, + VideoMode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh, Int32 full, uInt32 z = 1, const string& desc = ""); friend ostream& operator<<(ostream& os, const VideoMode& vm) { os << "image=" << vm.image << " screen=" << vm.screen - << " full= " << vm.fullscreen << " zoom=" << vm.zoom + << " full= " << vm.fsIndex << " zoom=" << vm.zoom << " desc=" << vm.description; return os; } @@ -127,7 +127,7 @@ into FBSurfaces), are in turn drawn here as well. @author Stephen Anthony - @version $Id: FrameBuffer.hxx 2934 2014-06-21 20:51:08Z stephena $ + @version $Id: FrameBuffer.hxx 2989 2014-09-03 13:27:33Z stephena $ */ class FrameBuffer { @@ -368,7 +368,9 @@ This method is called to query and initialize the video hardware for desktop and fullscreen resolution information. */ - virtual void queryHardware(uInt32& w, uInt32& h, VariantList& ren) = 0; + virtual void queryHardware(Common::Array& mons, VariantList& ren) = 0; + + virtual Int32 getCurrentDisplayIndex() = 0; /** This method is called to change to the given video mode. @@ -530,6 +532,10 @@ // Maximum dimensions of the desktop area GUI::Size myDesktopSize; + // The resolution of the attached displays + // The primary display is first in the array + Common::Array myDisplays; + // Supported renderers VariantList myRenderers; @@ -563,9 +569,9 @@ Message myStatsMsg; // The list of all available video modes for this framebuffer - VideoModeList myWindowedModeList; - VideoModeList myFullscreenModeList; VideoModeList* myCurrentModeList; + VideoModeList myWindowedModeList; + Common::Array myFullscreenModeLists; // Names of the TIA zoom levels that can be used for this framebuffer VariantList myTIAZoomLevels; @@ -573,8 +579,8 @@ // Holds a reference to all the surfaces that have been created map mySurfaceList; - // Holds UI palette data - static uInt32 ourGUIColors[kNumColors-256]; + // Holds UI palette data (standard and classic colours) + static uInt32 ourGUIColors[2][kNumColors-256]; }; #endif diff -Nru stella-4.0/src/emucore/M6532.cxx stella-4.1.1/src/emucore/M6532.cxx --- stella-4.0/src/emucore/M6532.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/M6532.cxx 2014-07-24 16:24:27.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: M6532.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: M6532.cxx 2959 2014-07-24 16:24:27Z stephena $ //============================================================================ #include @@ -123,7 +123,7 @@ assert((0x1080 & mask) == 0); // All accesses are to the given device - System::PageAccess access(0, 0, 0, &device, System::PA_READWRITE); + System::PageAccess access(&device, System::PA_READWRITE); // We're installing in a 2600 system for(int address = 0; address < 8192; address += (1 << shift)) diff -Nru stella-4.0/src/emucore/MediaFactory.hxx stella-4.1.1/src/emucore/MediaFactory.hxx --- stella-4.0/src/emucore/MediaFactory.hxx 2014-05-12 23:34:25.000000000 +0000 +++ stella-4.1.1/src/emucore/MediaFactory.hxx 2014-08-15 15:13:00.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: MediaFactory.hxx 2889 2014-05-12 23:34:25Z stephena $ +// $Id: MediaFactory.hxx 2977 2014-08-15 15:13:00Z stephena $ //============================================================================ #ifndef MEDIA_FACTORY_HXX @@ -56,7 +56,7 @@ not be necessary since SDL2 covers this nicely). @author Stephen Anthony - @version $Id: MediaFactory.hxx 2889 2014-05-12 23:34:25Z stephena $ + @version $Id: MediaFactory.hxx 2977 2014-08-15 15:13:00Z stephena $ */ class MediaFactory { @@ -105,7 +105,6 @@ { return new EventHandlerSDL2(osystem); } - }; #endif diff -Nru stella-4.0/src/emucore/module.mk stella-4.1.1/src/emucore/module.mk --- stella-4.0/src/emucore/module.mk 2014-06-02 20:41:19.000000000 +0000 +++ stella-4.1.1/src/emucore/module.mk 2014-08-14 00:03:56.000000000 +0000 @@ -37,6 +37,7 @@ src/emucore/CartFA2.o \ src/emucore/CartFE.o \ src/emucore/CartMC.o \ + src/emucore/CartMDM.o \ src/emucore/CartSB.o \ src/emucore/CartUA.o \ src/emucore/CartX07.o \ diff -Nru stella-4.0/src/emucore/Settings.cxx stella-4.1.1/src/emucore/Settings.cxx --- stella-4.0/src/emucore/Settings.cxx 2014-06-04 16:01:45.000000000 +0000 +++ stella-4.1.1/src/emucore/Settings.cxx 2014-09-03 13:27:33.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Settings.cxx 2908 2014-06-04 16:01:45Z stephena $ +// $Id: Settings.cxx 2989 2014-09-03 13:27:33Z stephena $ //============================================================================ #include @@ -121,6 +121,7 @@ GUI::Size(DebuggerDialog::kMediumFontMinW, DebuggerDialog::kMediumFontMinH)); #endif + setInternal("uipalette", "standard"); setInternal("listdelay", "300"); setInternal("mwheel", "4"); diff -Nru stella-4.0/src/emucore/System.cxx stella-4.1.1/src/emucore/System.cxx --- stella-4.0/src/emucore/System.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/System.cxx 2014-07-24 16:24:27.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: System.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: System.cxx 2959 2014-07-24 16:24:27Z stephena $ //============================================================================ #include @@ -51,10 +51,7 @@ myPageIsDirtyTable = new bool[myNumberOfPages]; // Initialize page access table - PageAccess access; - access.directPeekBase = 0; - access.directPokeBase = 0; - access.device = &myNullDevice; + PageAccess access(&myNullDevice, System::PA_READ); for(int page = 0; page < myNumberOfPages; ++page) { setPageAccess(page, access); diff -Nru stella-4.0/src/emucore/System.hxx stella-4.1.1/src/emucore/System.hxx --- stella-4.0/src/emucore/System.hxx 2014-06-09 16:35:19.000000000 +0000 +++ stella-4.1.1/src/emucore/System.hxx 2014-07-24 16:24:27.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: System.hxx 2912 2014-06-09 16:35:19Z stephena $ +// $Id: System.hxx 2959 2014-07-24 16:24:27Z stephena $ //============================================================================ #ifndef SYSTEM_HXX @@ -43,7 +43,7 @@ 6507 based system and 65536 (2^16) bytes for a 6502 based system. @author Bradford W. Mott - @version $Id: System.hxx 2912 2014-06-09 16:35:19Z stephena $ + @version $Id: System.hxx 2959 2014-07-24 16:24:27Z stephena $ */ class System : public Serializable { @@ -115,7 +115,7 @@ @return The attached 6502 microprocessor */ - M6502& m6502() { return *myM6502; } + M6502& m6502() const { return *myM6502; } /** Answer the 6532 processor attached to the system. If a @@ -123,21 +123,21 @@ @return The attached 6532 microprocessor */ - M6532& m6532() { return *myM6532; } + M6532& m6532() const { return *myM6532; } /** Answer the TIA device attached to the system. @return The attached TIA device */ - TIA& tia() { return *myTIA; } + TIA& tia() const { return *myTIA; } /** Answer the random generator attached to the system. @return The random generator */ - Random& randGenerator() { return *myRandom; } + Random& randGenerator() const { return *myRandom; } /** Get the null device associated with the system. Every system @@ -337,11 +337,10 @@ device(0), type(System::PA_READ) { } - PageAccess(uInt8* peek, uInt8* poke, uInt8* code, Device* dev, - PageAccessType access) - : directPeekBase(peek), - directPokeBase(poke), - codeAccessBase(code), + PageAccess(Device* dev, PageAccessType access) + : directPeekBase(0), + directPokeBase(0), + codeAccessBase(0), device(dev), type(access) { } }; diff -Nru stella-4.0/src/emucore/TIA.cxx stella-4.1.1/src/emucore/TIA.cxx --- stella-4.0/src/emucore/TIA.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/emucore/TIA.cxx 2014-07-24 16:24:27.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TIA.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: TIA.cxx 2959 2014-07-24 16:24:27Z stephena $ //============================================================================ #include @@ -256,7 +256,7 @@ mySystem->resetCycles(); // All accesses are to the given device - System::PageAccess access(0, 0, 0, &device, System::PA_READWRITE); + System::PageAccess access(&device, System::PA_READWRITE); // We're installing in a 2600 system for(uInt32 i = 0; i < 8192; i += (1 << shift)) diff -Nru stella-4.0/src/emucore/TIASurface.cxx stella-4.1.1/src/emucore/TIASurface.cxx --- stella-4.0/src/emucore/TIASurface.cxx 2014-06-19 16:45:07.000000000 +0000 +++ stella-4.1.1/src/emucore/TIASurface.cxx 2014-09-01 21:17:33.000000000 +0000 @@ -14,9 +14,11 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TIASurface.cxx 2928 2014-06-19 16:45:07Z stephena $ +// $Id: TIASurface.cxx 2987 2014-09-01 21:17:33Z stephena $ //============================================================================ +#include + #include "FrameBuffer.hxx" #include "Settings.hxx" #include "OSystem.hxx" @@ -137,9 +139,8 @@ rect.setBounds(0, 0, width, height); // Fill the surface with pixels from the TIA, scaled 2x horizontally - uInt32 *buffer, pitch; - myBaseTiaSurface->basePtr(buffer, pitch); - uInt32* buf_ptr = buffer; + uInt32 *buf_ptr, pitch; + myBaseTiaSurface->basePtr(buf_ptr, pitch); for(uInt32 y = 0; y < height; ++y) { @@ -219,24 +220,25 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt32 TIASurface::enableScanlines(int relative, int absolute) { - uInt32& intensity = mySLineSurface->myAttributes.blendalpha; - if(relative == 0) intensity = absolute; - else intensity += relative; - intensity = BSPF_max(0u, intensity); - intensity = BSPF_min(100u, intensity); + FBSurface::Attributes& attr = mySLineSurface->attributes(); + if(relative == 0) attr.blendalpha = absolute; + else attr.blendalpha += relative; + attr.blendalpha = BSPF_max(0u, attr.blendalpha); + attr.blendalpha = BSPF_min(100u, attr.blendalpha); mySLineSurface->applyAttributes(); - mySLineSurface->addDirtyRect(); + mySLineSurface->setDirty(); - return intensity; + return attr.blendalpha; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TIASurface::enableScanlineInterpolation(bool enable) { - mySLineSurface->myAttributes.smoothing = enable; + FBSurface::Attributes& attr = mySLineSurface->attributes(); + attr.smoothing = enable; mySLineSurface->applyAttributes(); - mySLineSurface->addDirtyRect(); + mySLineSurface->setDirty(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -245,8 +247,8 @@ myUsePhosphor = enable; myPhosphorBlend = blend; myFilterType = FilterType(enable ? myFilterType | 0x01 : myFilterType & 0x10); - myTiaSurface->addDirtyRect(); - mySLineSurface->addDirtyRect(); + myTiaSurface->setDirty(); + mySLineSurface->setDirty(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -266,25 +268,26 @@ // Normal vs NTSC mode uses different source widths myTiaSurface->setSrcSize(enable ? ATARI_NTSC_OUT_WIDTH(160) : 160, myTIA->height()); - myTiaSurface->myAttributes.smoothing = - myOSystem.settings().getBool("tia.inter"); + FBSurface::Attributes& tia_attr = myTiaSurface->attributes(); + tia_attr.smoothing = myOSystem.settings().getBool("tia.inter"); myTiaSurface->applyAttributes(); myScanlinesEnabled = enable; - mySLineSurface->myAttributes.smoothing = - myOSystem.settings().getBool("tv.scaninter"); - mySLineSurface->myAttributes.blending = myScanlinesEnabled; - mySLineSurface->myAttributes.blendalpha = - myOSystem.settings().getInt("tv.scanlines"); + FBSurface::Attributes& sl_attr = mySLineSurface->attributes(); + sl_attr.smoothing = myOSystem.settings().getBool("tv.scaninter"); + sl_attr.blending = myScanlinesEnabled; + sl_attr.blendalpha = myOSystem.settings().getInt("tv.scanlines"); mySLineSurface->applyAttributes(); - myTiaSurface->addDirtyRect(); - mySLineSurface->addDirtyRect(); + myTiaSurface->setDirty(); + mySLineSurface->setDirty(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string TIASurface::effectsInfo() const { + const FBSurface::Attributes& attr = mySLineSurface->attributes(); + ostringstream buf; switch(myFilterType) { @@ -295,14 +298,12 @@ buf << "Disabled, phosphor mode"; break; case kBlarggNormal: - buf << myNTSCFilter.getPreset() << ", scanlines=" - << mySLineSurface->myAttributes.blendalpha << "/" - << (mySLineSurface->myAttributes.smoothing ? "inter" : "nointer"); + buf << myNTSCFilter.getPreset() << ", scanlines=" << attr.blendalpha << "/" + << (attr.smoothing ? "inter" : "nointer"); break; case kBlarggPhosphor: buf << myNTSCFilter.getPreset() << ", phosphor, scanlines=" - << mySLineSurface->myAttributes.blendalpha << "/" - << (mySLineSurface->myAttributes.smoothing ? "inter" : "nointer"); + << attr.blendalpha << "/" << (attr.smoothing ? "inter" : "nointer"); break; } return buf.str(); @@ -375,13 +376,13 @@ } // Draw TIA image - myTiaSurface->addDirtyRect(); + myTiaSurface->setDirty(); myTiaSurface->render(); // Draw overlaying scanlines if(myScanlinesEnabled) { - mySLineSurface->addDirtyRect(); + mySLineSurface->setDirty(); mySLineSurface->render(); } } diff -Nru stella-4.0/src/emucore/TIASurface.hxx stella-4.1.1/src/emucore/TIASurface.hxx --- stella-4.0/src/emucore/TIASurface.hxx 2014-06-19 16:45:07.000000000 +0000 +++ stella-4.1.1/src/emucore/TIASurface.hxx 2014-08-28 14:21:44.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TIASurface.hxx 2928 2014-06-19 16:45:07Z stephena $ +// $Id: TIASurface.hxx 2979 2014-08-28 14:21:44Z stephena $ //============================================================================ #ifndef TIASURFACE_HXX @@ -42,8 +42,6 @@ class TIASurface { - friend class FrameBuffer; - public: /** Creates a new TIASurface object diff -Nru stella-4.0/src/gui/CheckListWidget.cxx stella-4.1.1/src/gui/CheckListWidget.cxx --- stella-4.0/src/gui/CheckListWidget.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/gui/CheckListWidget.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CheckListWidget.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: CheckListWidget.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include "CheckListWidget.hxx" @@ -88,7 +88,6 @@ FBSurface& s = _boss->dialog().surface(); int i, pos, len = _list.size(); string buffer; - int deltax; // Draw a thin frame around the list and to separate columns s.hLine(_x, _y, _x + _w - 1, kColor); @@ -124,15 +123,13 @@ { buffer = _editString; adjustOffset(); - deltax = -_editScrollOffset; s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor, - kTextAlignLeft, deltax, false); + kTextAlignLeft, -_editScrollOffset, false); } else { buffer = _list[pos]; - deltax = 0; s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor); } } diff -Nru stella-4.0/src/gui/ContextMenu.cxx stella-4.1.1/src/gui/ContextMenu.cxx --- stella-4.0/src/gui/ContextMenu.cxx 2014-06-13 19:53:44.000000000 +0000 +++ stella-4.1.1/src/gui/ContextMenu.cxx 2014-08-24 21:47:51.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ContextMenu.cxx 2923 2014-06-13 19:53:44Z stephena $ +// $Id: ContextMenu.cxx 2978 2014-08-24 21:47:51Z stephena $ //============================================================================ #include "OSystem.hxx" @@ -590,7 +590,7 @@ s.drawBitmap(down_arrow, ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, _scrollDnColor, 8); } - s.addDirtyRect(_x, _y, _w, _h); + s.setDirty(); _dirty = false; } diff -Nru stella-4.0/src/gui/Dialog.cxx stella-4.1.1/src/gui/Dialog.cxx --- stella-4.0/src/gui/Dialog.cxx 2014-06-10 16:43:35.000000000 +0000 +++ stella-4.1.1/src/gui/Dialog.cxx 2014-08-24 21:47:51.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Dialog.cxx 2913 2014-06-10 16:43:35Z stephena $ +// $Id: Dialog.cxx 2978 2014-08-24 21:47:51Z stephena $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -69,12 +69,6 @@ // Make sure we have a valid surface to draw into // Technically, this shouldn't be needed until drawDialog(), but some // dialogs cause drawing to occur within loadConfig() - // Base surfaces are typically large, and will probably cause slow - // performance if we update the whole area each frame - // Instead, dirty rectangle updates should be performed - // However, this policy is left entirely to the framebuffer - // We suggest the hint here, but specific framebuffers are free to - // ignore it if(_surface == NULL) { uInt32 surfaceID = instance().frameBuffer().allocateSurface(_w, _h); @@ -275,6 +269,12 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Dialog::addSurface(FBSurface* surface) +{ + mySurfaceStack.push(surface); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Dialog::draw() { } @@ -290,7 +290,6 @@ if(_dirty) { // cerr << "Dialog::drawDialog(): w = " << _w << ", h = " << _h << " @ " << &s << endl << endl; - s.fillRect(_x, _y, _w, _h, kDlgColor); s.box(_x, _y, _w, _h, kColor, kShadowColor); @@ -309,13 +308,22 @@ // Draw outlines for focused widgets redrawFocus(); - // Tell the surface this area is dirty - s.addDirtyRect(_x, _y, _w, _h); + // Tell the surface(s) this area is dirty + s.setDirty(); + _dirty = false; } - // Commit surface changes to screen - s.render(); + // Commit surface changes to screen; also render any extra surfaces + // Extra surfaces must be rendered afterwards, so they are drawn on top + if(s.render()) + { + for(int i = 0; i < mySurfaceStack.size(); ++i) + { + mySurfaceStack[i]->setDirty(); + mySurfaceStack[i]->render(); + } + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru stella-4.0/src/gui/Dialog.hxx stella-4.1.1/src/gui/Dialog.hxx --- stella-4.0/src/gui/Dialog.hxx 2014-06-10 16:43:35.000000000 +0000 +++ stella-4.1.1/src/gui/Dialog.hxx 2014-08-24 21:47:51.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Dialog.hxx 2913 2014-06-10 16:43:35Z stephena $ +// $Id: Dialog.hxx 2978 2014-08-24 21:47:51Z stephena $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -29,6 +29,7 @@ class TabWidget; #include "Command.hxx" +#include "Stack.hxx" #include "Widget.hxx" #include "GuiObject.hxx" #include "StellaKeys.hxx" @@ -39,7 +40,7 @@ This is the base class for all dialog boxes. @author Stephen Anthony - @version $Id: Dialog.hxx 2913 2014-06-10 16:43:35Z stephena $ + @version $Id: Dialog.hxx 2978 2014-08-24 21:47:51Z stephena $ */ class Dialog : public GuiObject { @@ -72,8 +73,16 @@ void addCancelWidget(Widget* w) { _cancelWidget = w; } void setFocus(Widget* w); + /** Returns the base surface associated with this dialog. */ FBSurface& surface() const { return *_surface; } + /** Adds a surface to this dialog, which is rendered on top of the + base surface whenever the base surface is re-rendered. Since + the surface render() call will always occur in such a case, the + surface should call setVisible() to enable/disable its output. + */ + void addSurface(FBSurface* surface); + protected: virtual void draw(); void releaseFocus(); @@ -115,6 +124,8 @@ bool _visible; bool _processCancel; + Common::FixedStack mySurfaceStack; + private: struct Focus { Widget* widget; diff -Nru stella-4.0/src/gui/GameInfoDialog.cxx stella-4.1.1/src/gui/GameInfoDialog.cxx --- stella-4.0/src/gui/GameInfoDialog.cxx 2014-06-02 20:41:19.000000000 +0000 +++ stella-4.1.1/src/gui/GameInfoDialog.cxx 2014-08-14 00:03:56.000000000 +0000 @@ -14,9 +14,10 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: GameInfoDialog.cxx 2895 2014-06-02 20:41:19Z stephena $ +// $Id: GameInfoDialog.cxx 2974 2014-08-14 00:03:56Z stephena $ //============================================================================ +#include "Cart.hxx" #include "Console.hxx" #include "MouseControl.hxx" #include "Dialog.hxx" @@ -56,12 +57,6 @@ _w = 52 * fontWidth + 8; _h = 12 * (lineHeight + 4) + 10; - //////////////////////////////////////////////////////////////////// - // Some of the following items are also present in GlobalPropsDialog - // If any changes are ever made here, GlobalPropsDialog should also - // be updated accordingly - //////////////////////////////////////////////////////////////////// - // The tab widget xpos = 2; ypos = vBorder; myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, @@ -132,49 +127,8 @@ "Type:", kTextAlignLeft); pwidth = font.getStringWidth("CM (SpectraVideo CompuMate)"); items.clear(); - items.push_back("Auto-detect", "AUTO" ); - items.push_back("0840 (8K ECONObank)", "0840" ); - items.push_back("2IN1 Multicart (4-32K)", "2IN1" ); - items.push_back("4IN1 Multicart (8-32K)", "4IN1" ); - items.push_back("8IN1 Multicart (16-64K)", "8IN1" ); - items.push_back("16IN1 Multicart (32-128K)", "16IN1" ); - items.push_back("32IN1 Multicart (64/128K)", "32IN1" ); - items.push_back("64IN1 Multicart (128/256K)", "64IN1" ); - items.push_back("128IN1 Multicart (256/512K)", "128IN1"); - items.push_back("2K (64-2048 bytes Atari)", "2K" ); - items.push_back("3E (32K Tigervision)", "3E" ); - items.push_back("3F (512K Tigervision)", "3F" ); - items.push_back("4A50 (64K 4A50 + ram)", "4A50" ); - items.push_back("4K (4K Atari)", "4K" ); - items.push_back("4KSC (CPUWIZ 4K + ram)", "4KSC" ); - items.push_back("AR (Supercharger)", "AR" ); - items.push_back("BF (CPUWIZ 256K)", "BF" ); - items.push_back("BFSC (CPUWIZ 256K + ram)", "BFSC" ); - items.push_back("CV (Commavid extra ram)", "CV" ); - items.push_back("CM (SpectraVideo CompuMate)", "CM" ); - items.push_back("DASH (Boulder Dash 2)", "DASH" ); - items.push_back("DF (CPUWIZ 128K)", "DF" ); - items.push_back("DFSC (CPUWIZ 128K + ram)", "DFSC" ); - items.push_back("DPC (Pitfall II)", "DPC" ); - items.push_back("DPC+ (Enhanced DPC)", "DPC+" ); - items.push_back("E0 (8K Parker Bros)", "E0" ); - items.push_back("E7 (16K M-network)", "E7" ); - items.push_back("EF (64K H. Runner)", "EF" ); - items.push_back("EFSC (64K H. Runner + ram)", "EFSC" ); - items.push_back("F0 (Dynacom Megaboy)", "F0" ); - items.push_back("F4 (32K Atari)", "F4" ); - items.push_back("F4SC (32K Atari + ram)", "F4SC" ); - items.push_back("F6 (16K Atari)", "F6" ); - items.push_back("F6SC (16K Atari + ram)", "F6SC" ); - items.push_back("F8 (8K Atari)", "F8" ); - items.push_back("F8SC (8K Atari + ram)", "F8SC" ); - items.push_back("FA (CBS RAM Plus)", "FA" ); - items.push_back("FA2 (CBS RAM Plus 24/28K)", "FA2" ); - items.push_back("FE (8K Decathlon)", "FE" ); - items.push_back("MC (C. Wilkson Megacart)", "MC" ); - items.push_back("SB (128-256K SUPERbank)", "SB" ); - items.push_back("UA (8K UA Ltd.)", "UA" ); - items.push_back("X07 (64K AtariAge)", "X07" ); + for(int i = 0; i < Cartridge::ourNumBSTypes; ++i) + items.push_back(Cartridge::ourBSList[i].desc, Cartridge::ourBSList[i].type); myType = new PopUpWidget(myTab, font, xpos+lwidth, ypos, pwidth, lineHeight, items, "", 0, 0); wid.push_back(myType); diff -Nru stella-4.0/src/gui/GlobalPropsDialog.cxx stella-4.1.1/src/gui/GlobalPropsDialog.cxx --- stella-4.0/src/gui/GlobalPropsDialog.cxx 2014-06-02 20:41:19.000000000 +0000 +++ stella-4.1.1/src/gui/GlobalPropsDialog.cxx 2014-08-14 00:03:56.000000000 +0000 @@ -14,11 +14,12 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: GlobalPropsDialog.cxx 2895 2014-06-02 20:41:19Z stephena $ +// $Id: GlobalPropsDialog.cxx 2974 2014-08-14 00:03:56Z stephena $ //============================================================================ #include "bspf.hxx" +#include "Cart.hxx" #include "Control.hxx" #include "Dialog.hxx" #include "OSystem.hxx" @@ -53,59 +54,12 @@ xpos = 10; ypos = 10; - //////////////////////////////////////////////////////////////////// - // The following items are also present in GameInfoDialog - // If any changes are ever made here, GameInfoDialog should also - // be updated accordingly - //////////////////////////////////////////////////////////////////// - // Bankswitch type new StaticTextWidget(this, font, xpos, ypos+1, lwidth, fontHeight, "Bankswitch type:", kTextAlignLeft); items.clear(); - items.push_back("Auto-detect", "AUTO" ); - items.push_back("0840 (8K ECONObank)", "0840" ); - items.push_back("2IN1 Multicart (4-32K)", "2IN1" ); - items.push_back("4IN1 Multicart (8-32K)", "4IN1" ); - items.push_back("8IN1 Multicart (16-64K)", "8IN1" ); - items.push_back("16IN1 Multicart (32-128K)", "16IN1" ); - items.push_back("32IN1 Multicart (64/128K)", "32IN1" ); - items.push_back("64IN1 Multicart (128/256K)", "64IN1" ); - items.push_back("128IN1 Multicart (256/512K)", "128IN1"); - items.push_back("2K (64-2048 bytes Atari)", "2K" ); - items.push_back("3E (32K Tigervision)", "3E" ); - items.push_back("3F (512K Tigervision)", "3F" ); - items.push_back("4A50 (64K 4A50 + ram)", "4A50" ); - items.push_back("4K (4K Atari)", "4K" ); - items.push_back("4KSC (CPUWIZ 4K + ram)", "4KSC" ); - items.push_back("AR (Supercharger)", "AR" ); - items.push_back("BF (CPUWIZ 256K)", "BF" ); - items.push_back("BFSC (CPUWIZ 256K + ram)", "BFSC" ); - items.push_back("CV (Commavid extra ram)", "CV" ); - items.push_back("CM (SpectraVideo CompuMate)", "CM" ); - items.push_back("DASH (Boulder Dash 2)", "DASH" ); - items.push_back("DF (CPUWIZ 128K)", "DF" ); - items.push_back("DFSC (CPUWIZ 128K + ram)", "DFSC" ); - items.push_back("DPC (Pitfall II)", "DPC" ); - items.push_back("DPC+ (Enhanced DPC)", "DPC+" ); - items.push_back("E0 (8K Parker Bros)", "E0" ); - items.push_back("E7 (16K M-network)", "E7" ); - items.push_back("EF (64K H. Runner)", "EF" ); - items.push_back("EFSC (64K H. Runner + ram)", "EFSC" ); - items.push_back("F0 (Dynacom Megaboy)", "F0" ); - items.push_back("F4 (32K Atari)", "F4" ); - items.push_back("F4SC (32K Atari + ram)", "F4SC" ); - items.push_back("F6 (16K Atari)", "F6" ); - items.push_back("F6SC (16K Atari + ram)", "F6SC" ); - items.push_back("F8 (8K Atari)", "F8" ); - items.push_back("F8SC (8K Atari + ram)", "F8SC" ); - items.push_back("FA (CBS RAM Plus)", "FA" ); - items.push_back("FA2 (CBS RAM Plus 24/28K)", "FA2" ); - items.push_back("FE (8K Decathlon)", "FE" ); - items.push_back("MC (C. Wilkson Megacart)", "MC" ); - items.push_back("SB (128-256K SUPERbank)", "SB" ); - items.push_back("UA (8K UA Ltd.)", "UA" ); - items.push_back("X07 (64K AtariAge)", "X07" ); + for(int i = 0; i < Cartridge::ourNumBSTypes; ++i) + items.push_back(Cartridge::ourBSList[i].desc, Cartridge::ourBSList[i].type); myBSType = new PopUpWidget(this, font, xpos+lwidth, ypos, pwidth, lineHeight, items, "", 0, 0); wid.push_back(myBSType); diff -Nru stella-4.0/src/gui/LauncherDialog.cxx stella-4.1.1/src/gui/LauncherDialog.cxx --- stella-4.0/src/gui/LauncherDialog.cxx 2014-06-10 16:43:35.000000000 +0000 +++ stella-4.1.1/src/gui/LauncherDialog.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: LauncherDialog.cxx 2913 2014-06-10 16:43:35Z stephena $ +// $Id: LauncherDialog.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include @@ -150,7 +150,6 @@ myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Quit", kQuitCmd); wid.push_back(myQuitButton); - xpos += bwidth + 8; #else myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Quit", kQuitCmd); @@ -167,7 +166,6 @@ myStartButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Select", kLoadROMCmd); wid.push_back(myStartButton); - xpos += bwidth + 8; #endif mySelectedItem = 0; // Highlight 'Rom Listing' diff -Nru stella-4.0/src/gui/RomInfoWidget.cxx stella-4.1.1/src/gui/RomInfoWidget.cxx --- stella-4.0/src/gui/RomInfoWidget.cxx 2014-06-13 13:35:41.000000000 +0000 +++ stella-4.1.1/src/gui/RomInfoWidget.cxx 2014-08-29 23:30:18.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: RomInfoWidget.cxx 2919 2014-06-13 13:35:41Z stephena $ +// $Id: RomInfoWidget.cxx 2982 2014-08-29 23:30:18Z stephena $ //============================================================================ #include "FrameBuffer.hxx" @@ -29,13 +29,13 @@ int x, int y, int w, int h) : Widget(boss, font, x, y, w, h), mySurface(NULL), - mySurfaceID(-1), - myZoomLevel(w > 400 ? 2 : 1), mySurfaceIsValid(false), myHaveProperties(false) { _flags = WIDGET_ENABLED; _bgcolor = _bgcolorhi = kWidColor; + + myAvail = w > 400 ? GUI::Size(640, 512) : GUI::Size(320, 256); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -75,6 +75,8 @@ void RomInfoWidget::clearProperties() { myHaveProperties = mySurfaceIsValid = false; + if(mySurface) + mySurface->setVisible(mySurfaceIsValid); // Decide whether the information should be shown immediately if(instance().eventHandler().state() == EventHandler::S_LAUNCHER) @@ -89,12 +91,14 @@ // Check if a surface has ever been created; if so, we use it // The surface will always be the maximum size, but sometimes we'll // only draw certain parts of it - mySurface = instance().frameBuffer().surface(mySurfaceID); if(mySurface == NULL) { - mySurfaceID = instance().frameBuffer().allocateSurface( - 320*myZoomLevel, 256*myZoomLevel); - mySurface = instance().frameBuffer().surface(mySurfaceID); + uInt32 ID = instance().frameBuffer().allocateSurface(320*2, 256*2); + mySurface = instance().frameBuffer().surface(ID); + mySurface->attributes().smoothing = true; + mySurface->applyAttributes(); + + dialog().addSurface(mySurface); } // Initialize to empty properties entry @@ -110,12 +114,19 @@ try { instance().png().loadImage(filename, *mySurface); + + // Scale surface to available image area + const GUI::Rect& src = mySurface->srcRect(); + float scale = BSPF_min(float(myAvail.w) / src.width(), float(myAvail.h) / src.height()); + mySurface->setDstSize(uInt32(src.width() * scale), uInt32(src.height() * scale)); } catch(const char* msg) { mySurfaceIsValid = false; mySurfaceErrorMsg = msg; } + if(mySurface) + mySurface->setVisible(mySurfaceIsValid); // Now add some info for the message box below the image myRomInfo.push_back("Name: " + myProperties.get(Cartridge_Name)); @@ -132,7 +143,7 @@ { FBSurface& s = dialog().surface(); - const int yoff = myZoomLevel > 1 ? 260*2 + 10 : 275; + const int yoff = myAvail.h + 10; s.fillRect(_x+2, _y+2, _w-4, _h-4, kWidColor); s.box(_x, _y, _w, _h, kColor, kShadowColor); @@ -142,11 +153,14 @@ if(mySurfaceIsValid) { - const GUI::Rect& src = mySurface->srcRect(); - uInt32 x = _x + ((_w - src.width()) >> 1); - uInt32 y = _y + ((yoff - src.height()) >> 1); - mySurface->setDstPos(x, y); - s.drawSurface(mySurface); + const GUI::Rect& dst = mySurface->dstRect(); + uInt32 x = _x + ((_w - dst.width()) >> 1); + uInt32 y = _y + ((yoff - dst.height()) >> 1); + + // Make sure when positioning the snapshot surface that we take + // the dialog surface position into account + const GUI::Rect& s_dst = s.dstRect(); + mySurface->setDstPos(x + s_dst.x(), y + s_dst.y()); } else if(mySurfaceErrorMsg != "") { @@ -155,6 +169,7 @@ uInt32 y = _y + ((yoff - font.getLineHeight()) >> 1); s.drawString(font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor); } + int xpos = _x + 5, ypos = _y + yoff + 10; for(unsigned int i = 0; i < myRomInfo.size(); ++i) { diff -Nru stella-4.0/src/gui/RomInfoWidget.hxx stella-4.1.1/src/gui/RomInfoWidget.hxx --- stella-4.0/src/gui/RomInfoWidget.hxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/gui/RomInfoWidget.hxx 2014-08-28 15:29:35.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: RomInfoWidget.hxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: RomInfoWidget.hxx 2980 2014-08-28 15:29:35Z stephena $ //============================================================================ #ifndef ROM_INFO_WIDGET_HXX @@ -26,6 +26,7 @@ #include "Widget.hxx" #include "Command.hxx" #include "StringList.hxx" +#include "Rect.hxx" #include "bspf.hxx" @@ -47,12 +48,11 @@ void parseProperties(); private: - // Surface id and pointer holding the scaled PNG image + // Surface pointer holding the PNG image FBSurface* mySurface; - int mySurfaceID; - // How much to zoom the PNG image - int myZoomLevel; + // How much space available for the PNG image + GUI::Size myAvail; // Whether the surface should be redrawn by drawWidget() bool mySurfaceIsValid; diff -Nru stella-4.0/src/gui/StringListWidget.cxx stella-4.1.1/src/gui/StringListWidget.cxx --- stella-4.0/src/gui/StringListWidget.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/gui/StringListWidget.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: StringListWidget.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: StringListWidget.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include "ScrollBarWidget.hxx" @@ -50,7 +50,6 @@ FBSurface& s = _boss->dialog().surface(); int i, pos, len = _list.size(); string buffer; - int deltax; // Draw a thin frame around the list. s.hLine(_x, _y, _x + _w - 1, kColor); @@ -76,15 +75,13 @@ { buffer = _editString; adjustOffset(); - deltax = -_editScrollOffset; s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor, - kTextAlignLeft, deltax, false); + kTextAlignLeft, -_editScrollOffset, false); } else { buffer = _list[pos]; - deltax = 0; s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor); } } diff -Nru stella-4.0/src/gui/UIDialog.cxx stella-4.1.1/src/gui/UIDialog.cxx --- stella-4.0/src/gui/UIDialog.cxx 2014-06-30 13:45:25.000000000 +0000 +++ stella-4.1.1/src/gui/UIDialog.cxx 2014-09-03 13:27:33.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: UIDialog.cxx 2941 2014-06-30 13:45:25Z stephena $ +// $Id: UIDialog.cxx 2989 2014-09-03 13:27:33Z stephena $ //============================================================================ #include @@ -236,10 +236,19 @@ // 3) Misc. options wid.clear(); tabID = myTab->addTab(" Misc. "); - lwidth = font.getStringWidth("Mouse wheel scroll: "); + lwidth = font.getStringWidth("Interface Palette (*): "); pwidth = font.getStringWidth("Standard"); xpos = ypos = vBorder; + + // UI Palette ypos += 1; + items.clear(); + items.push_back("Standard", "standard"); + items.push_back("Classic", "classic"); + myPalettePopup = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight, + items, "Interface Palette (*): ", lwidth); + wid.push_back(myPalettePopup); + ypos += lineHeight + 4; // Delay between quick-selecting characters in ListWidget items.clear(); @@ -273,6 +282,13 @@ wid.push_back(myWheelLinesPopup); ypos += lineHeight + 4; + // Add message concerning usage + xpos = vBorder; ypos += 1*(lineHeight + 4); + lwidth = ifont.getStringWidth("(*) Requires application restart"); + new StaticTextWidget(myTab, ifont, xpos, ypos, BSPF_min(lwidth, _w-20), fontHeight, + "(*) Requires application restart", + kTextAlignLeft); + // Add items for tab 2 addToFocusList(wid, myTab, tabID); @@ -341,6 +357,10 @@ myDebuggerFontStyle->setSelected(style, "0"); #endif + // UI palette + const string& pal = instance().settings().getString("uipalette"); + myPalettePopup->setSelected(pal, "standard"); + // Listwidget quick delay const string& delay = instance().settings().getString("listdelay"); myListDelayPopup->setSelected(delay, "300"); @@ -381,6 +401,10 @@ instance().settings().setValue("dbg.fontstyle", myDebuggerFontStyle->getSelectedTag().toString()); + // UI palette + instance().settings().setValue("uipalette", + myPalettePopup->getSelectedTag().toString()); + // Listwidget quick delay instance().settings().setValue("listdelay", myListDelayPopup->getSelectedTag().toString()); @@ -426,6 +450,7 @@ } case 2: // Misc. options + myPalettePopup->setSelected("standard"); myListDelayPopup->setSelected("300"); myWheelLinesPopup->setSelected("4"); break; diff -Nru stella-4.0/src/gui/UIDialog.hxx stella-4.1.1/src/gui/UIDialog.hxx --- stella-4.0/src/gui/UIDialog.hxx 2014-01-31 16:23:10.000000000 +0000 +++ stella-4.1.1/src/gui/UIDialog.hxx 2014-09-03 13:27:33.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: UIDialog.hxx 2845 2014-01-31 16:23:10Z stephena $ +// $Id: UIDialog.hxx 2989 2014-09-03 13:27:33Z stephena $ //============================================================================ #ifndef UI_DIALOG_HXX @@ -58,6 +58,7 @@ PopUpWidget* myDebuggerFontStyle; // Misc options + PopUpWidget* myPalettePopup; PopUpWidget* myListDelayPopup; PopUpWidget* myWheelLinesPopup; diff -Nru stella-4.0/src/gui/VideoDialog.cxx stella-4.1.1/src/gui/VideoDialog.cxx --- stella-4.0/src/gui/VideoDialog.cxx 2014-06-21 01:45:23.000000000 +0000 +++ stella-4.1.1/src/gui/VideoDialog.cxx 2014-09-06 00:33:17.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: VideoDialog.cxx 2933 2014-06-21 01:45:23Z stephena $ +// $Id: VideoDialog.cxx 2992 2014-09-06 00:33:17Z stephena $ //============================================================================ #include @@ -192,7 +192,6 @@ // Center window (in windowed mode) myCenter = new CheckboxWidget(myTab, font, xpos, ypos, "Center window"); wid.push_back(myCenter); - ypos += lineHeight + 4; // Add items for tab 0 addToFocusList(wid, myTab, tabID); diff -Nru stella-4.0/src/gui/Widget.cxx stella-4.1.1/src/gui/Widget.cxx --- stella-4.0/src/gui/Widget.cxx 2014-01-12 17:23:42.000000000 +0000 +++ stella-4.1.1/src/gui/Widget.cxx 2014-08-24 21:47:51.000000000 +0000 @@ -14,7 +14,7 @@ // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Widget.cxx 2833 2014-01-12 17:23:42Z stephena $ +// $Id: Widget.cxx 2978 2014-08-24 21:47:51Z stephena $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -75,7 +75,7 @@ FBSurface& s = _boss->dialog().surface(); bool hasBorder = _flags & WIDGET_BORDER; - int oldX = _x, oldY = _y, oldW = _w, oldH = _h; + int oldX = _x, oldY = _y; // Account for our relative position in the dialog _x = getAbsX(); @@ -93,7 +93,8 @@ } // Draw border - if(hasBorder) { + if(hasBorder) + { s.box(_x, _y, _w, _h, kColor, kShadowColor); _x += 4; _y += 4; @@ -105,7 +106,8 @@ drawWidget((_flags & WIDGET_HILITED) ? true : false); // Restore x/y - if (hasBorder) { + if (hasBorder) + { _x -= 4; _y -= 4; _w += 8; @@ -124,7 +126,7 @@ } // Tell the framebuffer this area is dirty - s.addDirtyRect(getAbsX(), getAbsY(), oldW, oldH); + s.setDirty(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -226,7 +228,7 @@ s.frameRect(x, y, w, h, kDlgColor); tmp->setDirty(); tmp->draw(); - s.addDirtyRect(x, y, w, h); + s.setDirty(); } } @@ -269,7 +271,7 @@ s.frameRect(x, y, w, h, kWidFrameColor, kDashLine); tmp->setDirty(); tmp->draw(); - s.addDirtyRect(x, y, w, h); + s.setDirty(); return tmp; } diff -Nru stella-4.0/src/macosx/Info-Stella.plist stella-4.1.1/src/macosx/Info-Stella.plist --- stella-4.0/src/macosx/Info-Stella.plist 2014-06-20 14:29:05.000000000 +0000 +++ stella-4.1.1/src/macosx/Info-Stella.plist 2014-09-14 19:58:37.000000000 +0000 @@ -53,7 +53,7 @@ CFBundleSignature StLa CFBundleVersion - 4.0 + 4.1.1 LSMinimumSystemVersionByArchitecture i386 diff -Nru stella-4.0/src/macosx/stella.xcodeproj/project.pbxproj stella-4.1.1/src/macosx/stella.xcodeproj/project.pbxproj --- stella-4.0/src/macosx/stella.xcodeproj/project.pbxproj 2014-06-30 00:54:30.000000000 +0000 +++ stella-4.1.1/src/macosx/stella.xcodeproj/project.pbxproj 2014-08-31 23:29:45.000000000 +0000 @@ -320,6 +320,10 @@ DC69670C1361FD0A0036499D /* pnginfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DC6967081361FD0A0036499D /* pnginfo.h */; }; DC69670D1361FD0A0036499D /* pnglibconf.h in Headers */ = {isa = PBXBuildFile; fileRef = DC6967091361FD0A0036499D /* pnglibconf.h */; }; DC69670E1361FD0A0036499D /* pngstruct.h in Headers */ = {isa = PBXBuildFile; fileRef = DC69670A1361FD0A0036499D /* pngstruct.h */; }; + DC6A18F819B3E65500DEB242 /* CartMDMWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC6A18F619B3E65500DEB242 /* CartMDMWidget.cxx */; }; + DC6A18F919B3E65500DEB242 /* CartMDMWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC6A18F719B3E65500DEB242 /* CartMDMWidget.hxx */; }; + DC6A18FC19B3E67A00DEB242 /* CartMDM.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC6A18FA19B3E67A00DEB242 /* CartMDM.cxx */; }; + DC6A18FD19B3E67A00DEB242 /* CartMDM.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC6A18FB19B3E67A00DEB242 /* CartMDM.hxx */; }; DC6B2BA411037FF200F199A7 /* CartDebug.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC6B2BA011037FF200F199A7 /* CartDebug.cxx */; }; DC6B2BA511037FF200F199A7 /* CartDebug.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC6B2BA111037FF200F199A7 /* CartDebug.hxx */; }; DC6B2BA611037FF200F199A7 /* DiStella.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC6B2BA211037FF200F199A7 /* DiStella.cxx */; }; @@ -332,6 +336,8 @@ DC73BD8A1915E5E3003FAFAD /* FBSurface.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC73BD881915E5E3003FAFAD /* FBSurface.hxx */; }; DC74D6A1138D4D7E00F05C5C /* StringList.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC74D69F138D4D7E00F05C5C /* StringList.hxx */; }; DC74D6A2138D4D7E00F05C5C /* StringParser.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC74D6A0138D4D7E00F05C5C /* StringParser.hxx */; }; + DC74E5C6198AF12700F37E36 /* CartDASHWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC74E5C4198AF12700F37E36 /* CartDASHWidget.cxx */; }; + DC74E5C7198AF12700F37E36 /* CartDASHWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC74E5C5198AF12700F37E36 /* CartDASHWidget.hxx */; }; DC79F81217A88D9E00288B91 /* Base.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC79F81017A88D9E00288B91 /* Base.cxx */; }; DC79F81317A88D9E00288B91 /* Base.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC79F81117A88D9E00288B91 /* Base.hxx */; }; DC7A24D5173B1CF600B20FE9 /* Variant.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC7A24D4173B1CF600B20FE9 /* Variant.hxx */; }; @@ -865,6 +871,10 @@ DC6967081361FD0A0036499D /* pnginfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pnginfo.h; path = ../libpng/pnginfo.h; sourceTree = SOURCE_ROOT; }; DC6967091361FD0A0036499D /* pnglibconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pnglibconf.h; path = ../libpng/pnglibconf.h; sourceTree = SOURCE_ROOT; }; DC69670A1361FD0A0036499D /* pngstruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pngstruct.h; path = ../libpng/pngstruct.h; sourceTree = SOURCE_ROOT; }; + DC6A18F619B3E65500DEB242 /* CartMDMWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CartMDMWidget.cxx; path = ../debugger/gui/CartMDMWidget.cxx; sourceTree = ""; }; + DC6A18F719B3E65500DEB242 /* CartMDMWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartMDMWidget.hxx; path = ../debugger/gui/CartMDMWidget.hxx; sourceTree = ""; }; + DC6A18FA19B3E67A00DEB242 /* CartMDM.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CartMDM.cxx; path = ../emucore/CartMDM.cxx; sourceTree = ""; }; + DC6A18FB19B3E67A00DEB242 /* CartMDM.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartMDM.hxx; path = ../emucore/CartMDM.hxx; sourceTree = ""; }; DC6B2BA011037FF200F199A7 /* CartDebug.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CartDebug.cxx; path = ../debugger/CartDebug.cxx; sourceTree = SOURCE_ROOT; }; DC6B2BA111037FF200F199A7 /* CartDebug.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartDebug.hxx; path = ../debugger/CartDebug.hxx; sourceTree = SOURCE_ROOT; }; DC6B2BA211037FF200F199A7 /* DiStella.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DiStella.cxx; path = ../debugger/DiStella.cxx; sourceTree = SOURCE_ROOT; }; @@ -877,6 +887,8 @@ DC73BD881915E5E3003FAFAD /* FBSurface.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = FBSurface.hxx; path = ../emucore/FBSurface.hxx; sourceTree = ""; }; DC74D69F138D4D7E00F05C5C /* StringList.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = StringList.hxx; path = ../common/StringList.hxx; sourceTree = SOURCE_ROOT; }; DC74D6A0138D4D7E00F05C5C /* StringParser.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = StringParser.hxx; path = ../common/StringParser.hxx; sourceTree = SOURCE_ROOT; }; + DC74E5C4198AF12700F37E36 /* CartDASHWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CartDASHWidget.cxx; path = ../debugger/gui/CartDASHWidget.cxx; sourceTree = ""; }; + DC74E5C5198AF12700F37E36 /* CartDASHWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartDASHWidget.hxx; path = ../debugger/gui/CartDASHWidget.hxx; sourceTree = ""; }; DC79F81017A88D9E00288B91 /* Base.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Base.cxx; path = ../common/Base.cxx; sourceTree = SOURCE_ROOT; }; DC79F81117A88D9E00288B91 /* Base.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Base.hxx; path = ../common/Base.hxx; sourceTree = SOURCE_ROOT; }; DC7A24D4173B1CF600B20FE9 /* Variant.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Variant.hxx; path = ../common/Variant.hxx; sourceTree = SOURCE_ROOT; }; @@ -1196,6 +1208,8 @@ DC676A2E1729A0B000E4E73D /* CartCTYWidget.hxx */, DCAAE5BA1715887B0080BB82 /* CartCVWidget.cxx */, DCAAE5BB1715887B0080BB82 /* CartCVWidget.hxx */, + DC74E5C4198AF12700F37E36 /* CartDASHWidget.cxx */, + DC74E5C5198AF12700F37E36 /* CartDASHWidget.hxx */, DCAAE5BC1715887B0080BB82 /* CartDebugWidget.hxx */, DCAACB0A188D636F00A4D282 /* CartDFSCWidget.cxx */, DCAACB0B188D636F00A4D282 /* CartDFSCWidget.hxx */, @@ -1235,6 +1249,8 @@ DC676A3A1729A0B000E4E73D /* CartFEWidget.hxx */, DC676A3B1729A0B000E4E73D /* CartMCWidget.cxx */, DC676A3C1729A0B000E4E73D /* CartMCWidget.hxx */, + DC6A18F619B3E65500DEB242 /* CartMDMWidget.cxx */, + DC6A18F719B3E65500DEB242 /* CartMDMWidget.hxx */, DC2AADB2194F390F0026C7A4 /* CartRamWidget.cxx */, DC2AADB3194F390F0026C7A4 /* CartRamWidget.hxx */, DC676A3D1729A0B000E4E73D /* CartSBWidget.cxx */, @@ -1432,6 +1448,8 @@ 2DE2DF330627AE07006BEC99 /* CartFE.hxx */, 2DE2DF360627AE07006BEC99 /* CartMC.cxx */, 2DE2DF370627AE07006BEC99 /* CartMC.hxx */, + DC6A18FA19B3E67A00DEB242 /* CartMDM.cxx */, + DC6A18FB19B3E67A00DEB242 /* CartMDM.hxx */, DC0984830D3985160073C852 /* CartSB.cxx */, DC0984840D3985160073C852 /* CartSB.hxx */, 2DDBEB7008457B7D00812C11 /* CartUA.cxx */, @@ -1792,6 +1810,7 @@ 2D91741A09BA90380026E9FF /* FSNode.hxx in Headers */, 2D91741B09BA90380026E9FF /* OSystem.hxx in Headers */, 2D91741D09BA90380026E9FF /* Preferences.h in Headers */, + DC6A18F919B3E65500DEB242 /* CartMDMWidget.hxx in Headers */, 2D91741F09BA90380026E9FF /* AboutBox.h in Headers */, 2D91742009BA90380026E9FF /* ConsoleFont.hxx in Headers */, 2D91742109BA90380026E9FF /* Font.hxx in Headers */, @@ -1889,6 +1908,7 @@ DCAD60A91152F8BD00BC4184 /* CartDPCPlus.hxx in Headers */, DCD6FC7111C281ED005DA767 /* png.h in Headers */, DCD6FC7211C281ED005DA767 /* pngconf.h in Headers */, + DC74E5C7198AF12700F37E36 /* CartDASHWidget.hxx in Headers */, DCD6FC7711C281ED005DA767 /* pngpriv.h in Headers */, DCD6FC9411C28C6F005DA767 /* PNGLibrary.hxx in Headers */, DC98F35711F5B56200AA520F /* MessageBox.hxx in Headers */, @@ -1972,6 +1992,7 @@ DCAACAFF188D631500A4D282 /* CartDFSC.hxx in Headers */, DCAACB0F188D636F00A4D282 /* Cart4KSCWidget.hxx in Headers */, DCAACB11188D636F00A4D282 /* CartBFSCWidget.hxx in Headers */, + DC6A18FD19B3E67A00DEB242 /* CartMDM.hxx in Headers */, DCAACB13188D636F00A4D282 /* CartBFWidget.hxx in Headers */, DCAACB15188D636F00A4D282 /* CartDFSCWidget.hxx in Headers */, DCAACB17188D636F00A4D282 /* CartDFWidget.hxx in Headers */, @@ -2132,6 +2153,7 @@ 2D9174BA09BA90380026E9FF /* ScrollBarWidget.cxx in Sources */, 2D9174BB09BA90380026E9FF /* TabWidget.cxx in Sources */, 2D9174BC09BA90380026E9FF /* VideoDialog.cxx in Sources */, + DC6A18FC19B3E67A00DEB242 /* CartMDM.cxx in Sources */, 2D9174BD09BA90380026E9FF /* Widget.cxx in Sources */, 2D9174BE09BA90380026E9FF /* CartUA.cxx in Sources */, 2D9174BF09BA90380026E9FF /* FSNode.cxx in Sources */, @@ -2146,11 +2168,13 @@ 2D9174CB09BA90380026E9FF /* PackedBitArray.cxx in Sources */, 2D9174CC09BA90380026E9FF /* TIADebug.cxx in Sources */, 2D9174CD09BA90380026E9FF /* YaccParser.cxx in Sources */, + DC6A18F819B3E65500DEB242 /* CartMDMWidget.cxx in Sources */, DC62E6491960E87B007AEF05 /* SaveKeyWidget.cxx in Sources */, 2D9174CE09BA90380026E9FF /* Cart3E.cxx in Sources */, 2D9174CF09BA90380026E9FF /* CpuDebug.cxx in Sources */, 2D9174DC09BA90380026E9FF /* Expression.cxx in Sources */, 2D9174F109BA90380026E9FF /* InputTextDialog.cxx in Sources */, + DC74E5C6198AF12700F37E36 /* CartDASHWidget.cxx in Sources */, 2D9174F209BA90380026E9FF /* CheckListWidget.cxx in Sources */, 2D9174F309BA90380026E9FF /* StringListWidget.cxx in Sources */, 2D9174F409BA90380026E9FF /* CommandDialog.cxx in Sources */, diff -Nru stella-4.0/src/unix/stella.spec stella-4.1.1/src/unix/stella.spec --- stella-4.0/src/unix/stella.spec 2014-07-01 13:32:22.000000000 +0000 +++ stella-4.1.1/src/unix/stella.spec 2014-09-14 19:58:37.000000000 +0000 @@ -1,5 +1,5 @@ %define name stella -%define version 4.0 +%define version 4.1.1 %define rel 1 %define enable_gl 1 @@ -102,6 +102,12 @@ %_datadir/icons/large/%{name}.png %changelog +* Sun Sep 14 2014 Stephen Anthony 4.1.1-1 +- Version 4.1.1 release + +* Mon Sep 1 2014 Stephen Anthony 4.1-1 +- Version 4.1 release + * Tue Jul 1 2014 Stephen Anthony 4.0-1 - Version 4.0 release diff -Nru stella-4.0/src/windows/SDL-2.0.3_Alt-Beep.diff stella-4.1.1/src/windows/SDL-2.0.3_Alt-Beep.diff --- stella-4.0/src/windows/SDL-2.0.3_Alt-Beep.diff 1970-01-01 00:00:00.000000000 +0000 +++ stella-4.1.1/src/windows/SDL-2.0.3_Alt-Beep.diff 2014-09-14 19:58:37.000000000 +0000 @@ -0,0 +1,29 @@ +--- SDL_windowsevents.c.orig 2014-03-16 00:01:43.000000000 -0230 ++++ SDL_windowsevents.c 2014-09-07 17:51:51.983290900 -0230 +@@ -765,19 +765,23 @@ + } + return (1); + +-#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER) + case WM_SYSCOMMAND: + { ++ /* Disable beep on Alt-key press */ ++ if ((wParam & 0xFFF0) == SC_KEYMENU) { ++ return (0); ++ } ++#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER) + /* Don't start the screensaver or blank the monitor in fullscreen apps */ +- if ((wParam & 0xFFF0) == SC_SCREENSAVE || ++ else if ((wParam & 0xFFF0) == SC_SCREENSAVE || + (wParam & 0xFFF0) == SC_MONITORPOWER) { + if (SDL_GetVideoDevice()->suspend_screensaver) { + return (0); + } + } ++#endif /* System has screensaver support */ + } + break; +-#endif /* System has screensaver support */ + + case WM_CLOSE: + { diff -Nru stella-4.0/src/windows/stella.rc stella-4.1.1/src/windows/stella.rc --- stella-4.0/src/windows/stella.rc 2014-06-15 19:25:46.000000000 +0000 +++ stella-4.1.1/src/windows/stella.rc 2014-09-14 19:58:37.000000000 +0000 @@ -36,8 +36,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,0,0,0 - PRODUCTVERSION 4,0,0,0 + FILEVERSION 4,1,1,0 + PRODUCTVERSION 4,1,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -55,12 +55,12 @@ VALUE "Comments", "The multi-platform Atari 2600 emulator. Stella is released under the GPLv2." VALUE "CompanyName", "The Stella Team (http://stella.sourceforge.net)" VALUE "FileDescription", "Stella" - VALUE "FileVersion", "4.0" + VALUE "FileVersion", "4.1.1" VALUE "InternalName", "Stella" VALUE "LegalCopyright", "Copyright (C) 1995-2014 The Stella Team" VALUE "OriginalFilename", "Stella.exe" VALUE "ProductName", "Stella" - VALUE "ProductVersion", "4.0" + VALUE "ProductVersion", "4.1.1" END END BLOCK "VarFileInfo" diff -Nru stella-4.0/src/windows/Stella.vcxproj stella-4.1.1/src/windows/Stella.vcxproj --- stella-4.0/src/windows/Stella.vcxproj 2014-06-30 00:31:36.000000000 +0000 +++ stella-4.1.1/src/windows/Stella.vcxproj 2014-08-29 23:30:18.000000000 +0000 @@ -243,6 +243,7 @@ + @@ -262,6 +263,7 @@ + @@ -282,6 +284,7 @@ + @@ -496,6 +499,7 @@ + @@ -516,6 +520,7 @@ + @@ -539,6 +544,7 @@ + diff -Nru stella-4.0/src/windows/Stella.vcxproj.filters stella-4.1.1/src/windows/Stella.vcxproj.filters --- stella-4.0/src/windows/Stella.vcxproj.filters 2014-06-30 00:31:36.000000000 +0000 +++ stella-4.1.1/src/windows/Stella.vcxproj.filters 2014-08-29 23:30:18.000000000 +0000 @@ -768,6 +768,15 @@ Source Files\debugger + + Source Files\debugger + + + Source Files\emucore + + + Source Files\debugger + @@ -1550,6 +1559,15 @@ Header Files\debugger + + Header Files\debugger + + + Header Files\emucore + + + Header Files\debugger + diff -Nru stella-4.0/src/zlib/gzlib.c stella-4.1.1/src/zlib/gzlib.c --- stella-4.0/src/zlib/gzlib.c 2013-05-07 14:44:50.000000000 +0000 +++ stella-4.1.1/src/zlib/gzlib.c 2014-09-01 21:17:33.000000000 +0000 @@ -190,7 +190,7 @@ /* save the path name for error messages */ #ifdef _WIN32 if (fd == -2) { - len = wcstombs(NULL, path, 0); + len = wcstombs(NULL, (const wchar_t *)path, 0); if (len == (size_t)-1) len = 0; } @@ -205,7 +205,7 @@ #ifdef _WIN32 if (fd == -2) if (len) - wcstombs(state->path, path, len + 1); + wcstombs(state->path, (const wchar_t *)path, len + 1); else *(state->path) = 0; else @@ -240,7 +240,7 @@ /* open the file with the appropriate flags (or just use fd) */ state->fd = fd > -1 ? fd : ( #ifdef _WIN32 - fd == -2 ? _wopen(path, oflag, 0666) : + fd == -2 ? _wopen((const wchar_t *)path, oflag, 0666) : #endif open((const char *)path, oflag, 0666)); if (state->fd == -1) {