[stella] 01/06: New upstream version 4.7.3
Stephen Kitt
skitt at moszumanska.debian.org
Thu Nov 24 22:12:43 UTC 2016
This is an automated email from the git hooks/post-receive script.
skitt pushed a commit to branch master
in repository stella.
commit b6755f1e294ef0ea74e948c21c2e51f085c7bcb9
Author: Stephen Kitt <steve at sk2.org>
Date: Thu Nov 24 22:46:56 2016 +0100
New upstream version 4.7.3
---
Announce.txt | 22 +-
Changes.txt | 25 +-
Makefile | 2 +-
configure | 10 +-
debian/changelog | 7 +
docs/debugger.html | 4 +-
docs/index.html | 2 +-
src/cheat/CheatManager.hxx | 6 +-
src/common/Base.cxx | 20 +-
src/common/EventHandlerSDL2.cxx | 4 +-
src/common/FSNodeZIP.cxx | 14 +-
src/common/FrameBufferSDL2.hxx | 8 +-
src/common/MouseControl.cxx | 10 +-
src/common/PNGLibrary.cxx | 10 +-
src/common/PNGLibrary.hxx | 4 +-
src/common/SoundNull.hxx | 4 +-
src/common/SoundSDL2.cxx | 2 +-
src/common/SoundSDL2.hxx | 4 +-
src/common/Variant.hxx | 6 +-
src/common/Version.hxx | 6 +-
src/common/ZipHandler.cxx | 18 +-
src/common/bspf.hxx | 249 ++++++++++----------
src/common/main.cxx | 4 +-
src/common/stella.xpm | 38 ---
src/common/tv_filters/NTSCFilter.cxx | 22 +-
src/debugger/CartDebug.cxx | 60 ++---
src/debugger/CartDebug.hxx | 30 +--
src/debugger/Debugger.cxx | 32 +--
src/debugger/Debugger.hxx | 8 +-
src/debugger/DebuggerParser.cxx | 186 ++++++++++++---
src/debugger/DebuggerParser.hxx | 11 +-
src/debugger/DiStella.cxx | 26 +--
src/debugger/DiStella.hxx | 4 +-
src/debugger/PackedBitArray.hxx | 4 +-
src/debugger/TIADebug.cxx | 22 +-
src/debugger/gui/Cart0840Widget.cxx | 4 +-
.../{CartDASHWidget.cxx => Cart3EPlusWidget.cxx} | 138 +++++------
.../{CartDASHWidget.hxx => Cart3EPlusWidget.hxx} | 32 +--
src/debugger/gui/Cart3EWidget.cxx | 4 +-
src/debugger/gui/Cart3FWidget.cxx | 4 +-
src/debugger/gui/Cart4A50Widget.cxx | 4 +-
src/debugger/gui/CartARWidget.cxx | 4 +-
src/debugger/gui/CartBFSCWidget.cxx | 6 +-
src/debugger/gui/CartBFWidget.cxx | 6 +-
src/debugger/gui/CartCMWidget.cxx | 4 +-
src/debugger/gui/CartCTYWidget.cxx | 4 +-
src/debugger/gui/CartCVPlusWidget.cxx | 4 +-
src/debugger/gui/CartDASHWidget.cxx | 2 +-
src/debugger/gui/CartDASHWidget.hxx | 2 +-
src/debugger/gui/CartDFSCWidget.cxx | 6 +-
src/debugger/gui/CartDFWidget.cxx | 6 +-
src/debugger/gui/CartDPCPlusWidget.cxx | 4 +-
src/debugger/gui/CartDPCWidget.cxx | 4 +-
src/debugger/gui/CartE0Widget.cxx | 4 +-
src/debugger/gui/CartE7Widget.cxx | 4 +-
src/debugger/gui/CartEFSCWidget.cxx | 6 +-
src/debugger/gui/CartEFWidget.cxx | 6 +-
src/debugger/gui/CartF0Widget.cxx | 8 +-
src/debugger/gui/CartF4SCWidget.cxx | 4 +-
src/debugger/gui/CartF4Widget.cxx | 4 +-
src/debugger/gui/CartF6SCWidget.cxx | 4 +-
src/debugger/gui/CartF6Widget.cxx | 4 +-
src/debugger/gui/CartF8SCWidget.cxx | 4 +-
src/debugger/gui/CartF8Widget.cxx | 4 +-
src/debugger/gui/CartFA2Widget.cxx | 4 +-
src/debugger/gui/CartFAWidget.cxx | 4 +-
src/debugger/gui/CartFEWidget.cxx | 4 +-
src/debugger/gui/CartMCWidget.cxx | 4 +-
src/debugger/gui/CartMDMWidget.cxx | 6 +-
src/debugger/gui/CartRamWidget.cxx | 6 +-
src/debugger/gui/CartSBWidget.cxx | 12 +-
src/debugger/gui/CartUAWidget.cxx | 4 +-
src/debugger/gui/CartWDWidget.cxx | 4 +-
src/debugger/gui/CartX07Widget.cxx | 6 +-
src/debugger/gui/DataGridWidget.cxx | 6 +-
src/debugger/gui/DebuggerDialog.cxx | 4 +-
src/debugger/gui/NullControlWidget.hxx | 4 +-
src/debugger/gui/PromptWidget.cxx | 8 +-
src/debugger/gui/RamWidget.cxx | 4 +-
src/debugger/gui/RiotWidget.cxx | 4 +-
src/debugger/gui/RomListWidget.cxx | 6 +-
src/debugger/gui/TiaOutputWidget.cxx | 4 +-
src/debugger/gui/TiaZoomWidget.cxx | 10 +-
src/debugger/gui/module.mk | 1 +
src/emucore/Cart.cxx | 29 ++-
src/emucore/Cart.hxx | 24 +-
src/emucore/Cart0840.cxx | 6 +-
src/emucore/Cart0840.hxx | 6 +-
src/emucore/Cart2K.cxx | 7 +-
src/emucore/Cart2K.hxx | 6 +-
src/emucore/Cart3E.cxx | 12 +-
src/emucore/Cart3E.hxx | 6 +-
src/emucore/{CartDASH.cxx => Cart3EPlus.cxx} | 169 +++++++-------
src/emucore/Cart3EPlus.hxx | 194 ++++++++++++++++
src/emucore/Cart3F.cxx | 10 +-
src/emucore/Cart3F.hxx | 6 +-
src/emucore/Cart4A50.cxx | 11 +-
src/emucore/Cart4K.cxx | 6 +-
src/emucore/Cart4KSC.cxx | 14 +-
src/emucore/CartAR.cxx | 12 +-
src/emucore/CartAR.hxx | 6 +-
src/emucore/CartBF.cxx | 6 +-
src/emucore/CartBFSC.cxx | 13 +-
src/emucore/CartCM.cxx | 13 +-
src/emucore/CartCTY.cxx | 13 +-
src/emucore/CartCTYTunes.hxx | 4 +-
src/emucore/CartCV.cxx | 14 +-
src/emucore/CartCV.hxx | 6 +-
src/emucore/CartCVPlus.cxx | 12 +-
src/emucore/CartCVPlus.hxx | 6 +-
src/emucore/CartDASH.cxx | 118 +++++-----
src/emucore/CartDASH.hxx | 254 ++++++++++-----------
src/emucore/CartDF.cxx | 6 +-
src/emucore/CartDFSC.cxx | 13 +-
src/emucore/CartDPC.cxx | 10 +-
src/emucore/CartDPCPlus.cxx | 7 +-
src/emucore/CartDPCPlus.hxx | 6 +-
src/emucore/CartE0.cxx | 6 +-
src/emucore/CartE7.cxx | 13 +-
src/emucore/CartEF.cxx | 6 +-
src/emucore/CartEFSC.cxx | 11 +-
src/emucore/CartF0.cxx | 6 +-
src/emucore/CartF4.cxx | 6 +-
src/emucore/CartF4SC.cxx | 13 +-
src/emucore/CartF6.cxx | 6 +-
src/emucore/CartF6SC.cxx | 13 +-
src/emucore/CartF8.cxx | 6 +-
src/emucore/CartF8SC.cxx | 13 +-
src/emucore/CartFA.cxx | 13 +-
src/emucore/CartFA2.cxx | 9 +-
src/emucore/CartFE.cxx | 6 +-
src/emucore/CartMC.cxx | 10 +-
src/emucore/CartMDM.cxx | 5 +-
src/emucore/CartMDM.hxx | 4 +-
src/emucore/CartSB.cxx | 3 -
src/emucore/CartSB.hxx | 2 +-
src/emucore/CartUA.cxx | 6 +-
src/emucore/CartWD.cxx | 13 +-
src/emucore/CartX07.cxx | 6 +-
src/emucore/Console.cxx | 18 +-
src/emucore/Console.hxx | 4 +-
src/emucore/Control.cxx | 8 +-
src/emucore/Control.hxx | 8 +-
src/emucore/Device.hxx | 11 +-
src/emucore/Driving.cxx | 4 +-
src/emucore/EventHandler.cxx | 11 +-
src/emucore/EventHandler.hxx | 8 +-
src/emucore/EventJoyHandler.cxx | 14 +-
src/emucore/FBSurface.cxx | 6 +-
src/emucore/FSNode.cxx | 4 +-
src/emucore/FSNode.hxx | 10 +-
src/emucore/FrameBuffer.cxx | 20 +-
src/emucore/Joystick.cxx | 5 +-
src/emucore/KidVid.hxx | 8 +-
src/emucore/M6502.cxx | 12 +-
src/emucore/M6502.hxx | 6 +-
src/emucore/M6532.cxx | 4 +-
src/emucore/MT24LC256.cxx | 12 +-
src/emucore/MT24LC256.hxx | 8 +-
src/emucore/NullDev.hxx | 11 +-
src/emucore/OSystem.cxx | 28 +--
src/emucore/OSystem.hxx | 15 +-
src/emucore/Paddles.cxx | 14 +-
src/emucore/Paddles.hxx | 4 +-
src/emucore/Props.cxx | 4 +-
src/emucore/PropsSet.cxx | 4 +-
src/emucore/PropsSet.hxx | 4 +-
src/emucore/Serializer.cxx | 5 +-
src/emucore/Settings.cxx | 4 +-
src/emucore/Sound.hxx | 4 +-
src/emucore/System.hxx | 12 +-
src/emucore/TIA.cxx | 34 ++-
src/emucore/TIA.hxx | 8 +-
src/emucore/TIASnd.cxx | 2 +-
src/emucore/TIASnd.hxx | 4 +-
src/emucore/TIASurface.cxx | 8 +-
src/emucore/Thumbulator.cxx | 4 +-
src/emucore/module.mk | 1 +
src/gui/CheckListWidget.cxx | 4 +-
src/gui/ComboDialog.cxx | 6 +-
src/gui/CommandMenu.hxx | 8 +-
src/gui/ContextMenu.cxx | 14 +-
src/gui/Dialog.cxx | 8 +-
src/gui/DialogContainer.cxx | 6 +-
src/gui/DialogContainer.hxx | 8 +-
src/gui/FileListWidget.cxx | 4 +-
src/gui/GameInfoDialog.cxx | 4 +-
src/gui/GlobalPropsDialog.cxx | 6 +-
src/gui/GlobalPropsDialog.hxx | 2 +-
src/gui/InputDialog.cxx | 6 +-
src/gui/Launcher.cxx | 10 +-
src/gui/Launcher.hxx | 8 +-
src/gui/LauncherDialog.cxx | 4 +-
src/gui/LauncherFilterDialog.cxx | 6 +-
src/gui/LauncherFilterDialog.hxx | 2 +-
src/gui/ListWidget.cxx | 4 +-
src/gui/LoggerDialog.cxx | 4 +-
src/gui/Menu.hxx | 8 +-
src/gui/MessageBox.cxx | 8 +-
src/gui/RomInfoWidget.cxx | 4 +-
src/gui/UIDialog.cxx | 30 +--
src/gui/VideoDialog.cxx | 6 +-
src/gui/Widget.cxx | 6 +-
src/macosx/Info-Stella.plist | 2 +-
src/macosx/OSystemMACOSX.hxx | 8 +-
src/macosx/SettingsMACOSX.hxx | 8 +-
src/macosx/stella.xcodeproj/project.pbxproj | 16 ++
src/unix/FSNodePOSIX.cxx | 4 +-
src/unix/OSystemUNIX.hxx | 8 +-
src/unix/SettingsUNIX.hxx | 8 +-
src/unix/stella.spec | 5 +-
src/windows/FSNodeWINDOWS.cxx | 5 +-
src/windows/HomeFinder.hxx | 79 ++-----
src/windows/OSystemWINDOWS.hxx | 8 +-
src/windows/SettingsWINDOWS.hxx | 6 +-
src/windows/Stella.vcxproj | 14 +-
src/windows/Stella.vcxproj.filters | 12 +
src/windows/stella.rc | 8 +-
src/yacc/YaccParser.cxx | 40 ++--
219 files changed, 1648 insertions(+), 1590 deletions(-)
diff --git a/Announce.txt b/Announce.txt
index 0c30805..32dd3cd 100644
--- a/Announce.txt
+++ b/Announce.txt
@@ -9,7 +9,7 @@
SSSS ttt eeeee llll llll aaaaa
===========================================================================
- Release 4.7.2 for Linux, MacOSX and Windows
+ Release 4.7.3 for Linux, MacOSX and Windows
===========================================================================
The Atari 2600 Video Computer System (VCS), introduced in 1977, was the
@@ -21,30 +21,30 @@ all of your favourite Atari 2600 games again! Stella was originally
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.7.2 release of Stella for Linux, Mac OSX and Windows. The
+This is the 4.7.3 release of Stella for Linux, Mac OSX and Windows. The
distributions currently available are:
* Binaries for Windows XP_SP3(*)/Vista/7/8/10 :
- Stella-4.7.2-win32.exe (32-bit EXE installer)
- Stella-4.7.2-x64.exe (64-bit EXE installer)
- Stella-4.7.2-windows.zip (32/64 bit versions)
+ Stella-4.7.3-win32.exe (32-bit EXE installer)
+ Stella-4.7.3-x64.exe (64-bit EXE installer)
+ Stella-4.7.3-windows.zip (32/64 bit versions)
(*) Note: Support for Windows XP is problematic on some systems,
and will probably be discontinued in a future release.
* Binary distribution for MacOS X 10.7 and above :
- Stella-4.7.2-macosx.dmg (64-bit Intel)
+ Stella-4.7.3-macosx.dmg (64-bit Intel)
* Binary distribution in 32-bit & 64-bit Ubuntu DEB format :
- stella_4.7.2-1_i386.deb
- stella_4.7.2-1_amd64.deb
+ stella_4.7.3-1_i386.deb
+ stella_4.7.3-1_amd64.deb
* Binary distribution in 32-bit & 64-bit RPM format :
- stella-4.7.2-2.i386.rpm
- stella-4.7.2-2.x86_64.rpm
+ stella-4.7.3-2.i386.rpm
+ stella-4.7.3-2.x86_64.rpm
* Source code distribution for all platforms :
- stella-4.7.2-src.tar.xz
+ stella-4.7.3-src.tar.xz
Distribution Site
diff --git a/Changes.txt b/Changes.txt
index 60d1c65..27e59b2 100644
--- a/Changes.txt
+++ b/Changes.txt
@@ -12,6 +12,29 @@
Release History
===========================================================================
+4.7.2 to 4.7.3: (Nov. 21, 2016)
+
+ * Added preliminary support for the 3E+ bankswitching scheme, developed
+ by Thomas Jentzsch.
+
+ * Fixed HMOVE positioning bug that occurred under certain circumstances.
+ Thanks to Omegamatrix of AtariAge for the bug report and patch to fix
+ the issue.
+
+ * Added 'trapm', 'trapreadm', 'trapwritem' commands to debugger prompt.
+ These are similar to the non-'m' versions, except that they also trap
+ on all mirrors of the given address.
+
+ * Fixed bug in debugger 'reset' command; it wasn't resetting the
+ bankswitching, so after a reset the banks were in an undefined state.
+
+ * Updated UNIX configure script to fix a bug where it fails in
+ cross-compilation under certain circumstances. Thanks to Vlad
+ Zakharov for providing a patch to fix this issue.
+
+-Have fun!
+
+
4.7.1 to 4.7.2: (Mar. 25, 2016)
* Fixed bug when entering and exiting the debugger; sometimes the
@@ -27,8 +50,6 @@
remove references to obsolete compiler versions that can no longer
be used to compile Stella.
--Have fun!
-
4.7 to 4.7.1: (Feb. 13, 2016)
diff --git a/Makefile b/Makefile
index 6dd0129..7a17d53 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@
srcdir ?= .
-DEFINES :=
+DEFINES := -D_GLIBCXX_USE_CXX11_ABI=1
LDFLAGS :=
INCLUDES :=
LIBS :=
diff --git a/configure b/configure
index 0d90a4f..c17e5f3 100755
--- a/configure
+++ b/configure
@@ -63,9 +63,9 @@ cc_check() {
echo >> "$TMPLOG"
cat "$TMPC" >> "$TMPLOG"
echo >> "$TMPLOG"
- echo "$CXX $TMPC $LDFLAGS -o $TMPO$EXEEXT $@" >> "$TMPLOG"
+ echo "$CXX $TMPC $CXXFLAGS $LDFLAGS -o $TMPO$EXEEXT $@" >> "$TMPLOG"
rm -f "$TMPO$EXEEXT"
- ( $CXX "$TMPC" $LDFLAGS -o "$TMPO$EXEEXT" "$@" ) >> "$TMPLOG" 2>&1
+ ( $CXX "$TMPC" $CXXFLAGS $LDFLAGS -o "$TMPO$EXEEXT" "$@" ) >> "$TMPLOG" 2>&1
TMP="$?"
echo >> "$TMPLOG"
return "$TMP"
@@ -107,9 +107,9 @@ EOF
if test -n "$_host"; then
# In cross-compiling mode, we cannot run the result
- eval "$1 $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
+ eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
else
- eval "$1 $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
+ eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
fi
}
@@ -392,7 +392,7 @@ if test "$have_clang" = yes; then
fi
case $cxx_version in
- [3].[4-9]|[3].[4-9].[0-9]|[3].[4-9].[0-9][-.]*)
+ [3].[4-9]|[3].[4-9].[0-9]|[3].[4-9].[0-9][-.]*|[4].[0-9].[0-9])
_cxx_major=`echo $cxx_version | cut -d '.' -f 1`
_cxx_minor=`echo $cxx_version | cut -d '.' -f 2`
cxx_version="$cxx_version, ok"
diff --git a/debian/changelog b/debian/changelog
index be5fb9a..c162ab7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+stella (4.7.3-1) stable; urgency=high
+
+ * Version 4.7.3 release
+
+ -- Stephen Anthony <stephena at users.sf.net> Mon, 21 Nov 2016 17:09:59 -0230
+
+
stella (4.7.2-1) stable; urgency=high
* Version 4.7.2 release
diff --git a/docs/debugger.html b/docs/debugger.html
index 22a62d5..bc24dcb 100644
--- a/docs/debugger.html
+++ b/docs/debugger.html
@@ -623,7 +623,6 @@ can also get rid of all traps at once with the "cleartraps" command.</p>
<pre>
a - Set Accumulator to value xx
- bank - Show # of banks, or switch to bank xx
base - Set default base (hex, dec, or bin)
break - Set/clear breakpoint at address xx (default=PC)
breakif - Set breakpoint on condition xx
@@ -685,6 +684,9 @@ listfunctions - List user-defined functions
trap - Trap read/write access to address(es) xx [to yy]
trapread - Trap read access to address(es) xx [to yy]
trapwrite - Trap write access to address(es) xx [to yy]
+ trapm - Trap read/write access to address xx (+mirrors)
+ trapreadm - Trap read access to address xx (+mirrors)
+ trapwritem - Trap write access to address xx (+mirrors)
type - Show disassembly type for address xx [to yy]
uhex - Toggle upper/lowercase HEX display
undef - Undefine label xx (if defined)
diff --git a/docs/index.html b/docs/index.html
index efa3be6..0bac056 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -10,7 +10,7 @@
<br><br>
<center><h2><b>A multi-platform Atari 2600 VCS emulator</b></h2></center>
- <center><h4><b>Release 4.7.2</b></h4></center>
+ <center><h4><b>Release 4.7.3</b></h4></center>
<br><br>
<center><h2><b>User's Guide</b></h2></center>
diff --git a/src/cheat/CheatManager.hxx b/src/cheat/CheatManager.hxx
index e432954..5669df1 100644
--- a/src/cheat/CheatManager.hxx
+++ b/src/cheat/CheatManager.hxx
@@ -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: CheatManager.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CheatManager.hxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#ifndef CHEAT_MANAGER_HXX
@@ -35,7 +35,7 @@ using CheatList = vector<shared_ptr<Cheat>>;
the list of all cheats currently in use.
@author Stephen Anthony
- @version $Id: CheatManager.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: CheatManager.hxx 3308 2016-05-24 16:55:45Z stephena $
*/
class CheatManager
{
@@ -150,7 +150,7 @@ class CheatManager
CheatList myCheatList;
CheatList myPerFrameList;
- map<string,string> myCheatMap;
+ std::map<string,string> myCheatMap;
string myCheatFile;
// This is set each time a new cheat/ROM is loaded, for later
diff --git a/src/common/Base.cxx b/src/common/Base.cxx
index 5e544aa..6e7c5a1 100644
--- a/src/common/Base.cxx
+++ b/src/common/Base.cxx
@@ -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: Base.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Base.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "Base.hxx"
@@ -65,32 +65,32 @@ string Base::toString(int value, Common::Base::Format outputBase)
case Base::F_10: // base 10: 3 or 5 bytes (depending on value)
if(value < 0x100)
- BSPF_snprintf(vToS_buf, 4, "%3d", value);
+ std::snprintf(vToS_buf, 4, "%3d", value);
else
- BSPF_snprintf(vToS_buf, 6, "%5d", value);
+ std::snprintf(vToS_buf, 6, "%5d", value);
break;
case Base::F_16_1: // base 16: 1 byte wide
- BSPF_snprintf(vToS_buf, 2, myFmt[0], value);
+ std::snprintf(vToS_buf, 2, myFmt[0], value);
break;
case Base::F_16_2: // base 16: 2 bytes wide
- BSPF_snprintf(vToS_buf, 3, myFmt[1], value);
+ std::snprintf(vToS_buf, 3, myFmt[1], value);
break;
case Base::F_16_4: // base 16: 4 bytes wide
- BSPF_snprintf(vToS_buf, 5, myFmt[2], value);
+ std::snprintf(vToS_buf, 5, myFmt[2], value);
break;
case Base::F_16_8: // base 16: 8 bytes wide
- BSPF_snprintf(vToS_buf, 9, myFmt[3], value);
+ std::snprintf(vToS_buf, 9, myFmt[3], value);
break;
case Base::F_16: // base 16: 2, 4, 8 bytes (depending on value)
default:
if(value < 0x100)
- BSPF_snprintf(vToS_buf, 3, myFmt[1], value);
+ std::snprintf(vToS_buf, 3, myFmt[1], value);
else if(value < 0x10000)
- BSPF_snprintf(vToS_buf, 5, myFmt[2], value);
+ std::snprintf(vToS_buf, 5, myFmt[2], value);
else
- BSPF_snprintf(vToS_buf, 9, myFmt[3], value);
+ std::snprintf(vToS_buf, 9, myFmt[3], value);
break;
}
diff --git a/src/common/EventHandlerSDL2.cxx b/src/common/EventHandlerSDL2.cxx
index 596a33b..1cd1803 100644
--- a/src/common/EventHandlerSDL2.cxx
+++ b/src/common/EventHandlerSDL2.cxx
@@ -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 3273 2016-02-06 21:06:23Z stephena $
+// $Id: EventHandlerSDL2.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "OSystem.hxx"
@@ -202,7 +202,7 @@ EventHandlerSDL2::JoystickSDL2::JoystickSDL2(int idx)
// havoc with the idea that a joystick will always have the same name.
// So we truncate the number.
const char* sdlname = SDL_JoystickName(myStick);
- const string& desc = BSPF_startsWithIgnoreCase(sdlname, "XInput Controller")
+ const string& desc = BSPF::startsWithIgnoreCase(sdlname, "XInput Controller")
? "XInput Controller" : sdlname;
initialize(SDL_JoystickInstanceID(myStick), desc,
diff --git a/src/common/FSNodeZIP.cxx b/src/common/FSNodeZIP.cxx
index 08bd69b..5d540b2 100644
--- a/src/common/FSNodeZIP.cxx
+++ b/src/common/FSNodeZIP.cxx
@@ -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: FSNodeZIP.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: FSNodeZIP.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <set>
@@ -45,13 +45,13 @@ FilesystemNodeZIP::FilesystemNodeZIP(const string& p)
// Is this a valid file?
auto isFile = [](const string& file)
{
- return BSPF_endsWithIgnoreCase(file, ".a26") ||
- BSPF_endsWithIgnoreCase(file, ".bin") ||
- BSPF_endsWithIgnoreCase(file, ".rom");
+ return BSPF::endsWithIgnoreCase(file, ".a26") ||
+ BSPF::endsWithIgnoreCase(file, ".bin") ||
+ BSPF::endsWithIgnoreCase(file, ".rom");
};
// Extract ZIP file and virtual file (if specified)
- size_t pos = BSPF_findIgnoreCase(p, ".zip");
+ size_t pos = BSPF::findIgnoreCase(p, ".zip");
if(pos == string::npos)
return;
@@ -148,13 +148,13 @@ bool FilesystemNodeZIP::getChildren(AbstractFSList& myList, ListMode mode,
if(!isDirectory() || _error != ZIPERR_NONE)
return false;
- set<string> dirs;
+ std::set<string> dirs;
ZipHandler& zip = open(_zipFile);
while(zip.hasNext())
{
// Only consider entries that start with '_virtualPath'
const string& next = zip.next();
- if(BSPF_startsWithIgnoreCase(next, _virtualPath))
+ if(BSPF::startsWithIgnoreCase(next, _virtualPath))
{
// First strip off the leading directory
const string& curr = next.substr(_virtualPath == "" ? 0 : _virtualPath.size()+1);
diff --git a/src/common/FrameBufferSDL2.hxx b/src/common/FrameBufferSDL2.hxx
index 31b4b34..6c39d1b 100644
--- a/src/common/FrameBufferSDL2.hxx
+++ b/src/common/FrameBufferSDL2.hxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: FrameBufferSDL2.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef FRAMEBUFFER_SDL2_HXX
@@ -33,7 +33,7 @@ class FBSurfaceSDL2;
Behind the scenes, it may be using Direct3D, OpenGL(ES), etc.
@author Stephen Anthony
- @version $Id: FrameBufferSDL2.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: FrameBufferSDL2.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class FrameBufferSDL2 : public FrameBuffer
{
@@ -44,10 +44,6 @@ class FrameBufferSDL2 : public FrameBuffer
Creates a new SDL2 framebuffer
*/
FrameBufferSDL2(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~FrameBufferSDL2();
//////////////////////////////////////////////////////////////////////
diff --git a/src/common/MouseControl.cxx b/src/common/MouseControl.cxx
index 86871af..31cbc8d 100644
--- a/src/common/MouseControl.cxx
+++ b/src/common/MouseControl.cxx
@@ -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: MouseControl.cxx 3250 2016-01-18 18:33:45Z stephena $
+// $Id: MouseControl.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "Console.hxx"
@@ -35,12 +35,12 @@ MouseControl::MouseControl(Console& console, const string& mode)
string m_mode;
m_axis >> m_mode;
- if(BSPF_equalsIgnoreCase(m_mode, "none"))
+ if(BSPF::equalsIgnoreCase(m_mode, "none"))
{
myModeList.push_back(MouseMode("Mouse input is disabled"));
return;
}
- else if(!BSPF_equalsIgnoreCase(m_mode, "auto") && m_mode.length() == 2 &&
+ else if(!BSPF::equalsIgnoreCase(m_mode, "auto") && m_mode.length() == 2 &&
m_mode[0] >= '0' && m_mode[0] <= '8' &&
m_mode[1] >= '0' && m_mode[1] <= '8')
{
@@ -148,7 +148,7 @@ MouseControl::MouseControl(Console& console, const string& mode)
// Now consider the possible modes for the mouse based on the left
// and right controllers
- bool noswap = BSPF_equalsIgnoreCase(myProps.get(Console_SwapPorts), "NO");
+ bool noswap = BSPF::equalsIgnoreCase(myProps.get(Console_SwapPorts), "NO");
if(noswap)
{
addLeftControllerModes(noswap);
@@ -243,7 +243,7 @@ void MouseControl::addPaddleModes(int lport, int rport, int lname, int rname)
msg << "Mouse is Paddle " << rname << " controller";
MouseMode mode1(type, rport, type, rport, msg.str());
- if(BSPF_equalsIgnoreCase(myProps.get(Controller_SwapPaddles), "NO"))
+ if(BSPF::equalsIgnoreCase(myProps.get(Controller_SwapPaddles), "NO"))
{
myModeList.push_back(mode0);
myModeList.push_back(mode1);
diff --git a/src/common/PNGLibrary.cxx b/src/common/PNGLibrary.cxx
index a6de5c4..fb79844 100644
--- a/src/common/PNGLibrary.cxx
+++ b/src/common/PNGLibrary.cxx
@@ -14,12 +14,10 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: PNGLibrary.cxx 3259 2016-01-24 17:42:44Z stephena $
+// $Id: PNGLibrary.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
#include <fstream>
-#include <cstring>
-#include <sstream>
#include <cmath>
#include "bspf.hxx"
@@ -45,7 +43,7 @@ void PNGLibrary::loadImage(const string& filename, FBSurface& surface)
int bit_depth, color_type, interlace_type;
const char* err_message = nullptr;
- ifstream in(filename, ios_base::binary);
+ ifstream in(filename, std::ios_base::binary);
if(!in.is_open())
loadImageERROR("No image found");
@@ -122,7 +120,7 @@ done:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PNGLibrary::saveImage(const string& filename, const VariantList& comments)
{
- ofstream out(filename, ios_base::binary);
+ ofstream out(filename, std::ios_base::binary);
if(!out.is_open())
throw runtime_error("ERROR: Couldn't create snapshot file");
@@ -146,7 +144,7 @@ void PNGLibrary::saveImage(const string& filename, const VariantList& comments)
void PNGLibrary::saveImage(const string& filename, const FBSurface& surface,
const GUI::Rect& rect, const VariantList& comments)
{
- ofstream out(filename, ios_base::binary);
+ ofstream out(filename, std::ios_base::binary);
if(!out.is_open())
throw runtime_error("ERROR: Couldn't create snapshot file");
diff --git a/src/common/PNGLibrary.hxx b/src/common/PNGLibrary.hxx
index eaeccee..0adccd1 100644
--- a/src/common/PNGLibrary.hxx
+++ b/src/common/PNGLibrary.hxx
@@ -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 3259 2016-01-24 17:42:44Z stephena $
+// $Id: PNGLibrary.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef PNGLIBRARY_HXX
@@ -92,7 +92,7 @@ class PNGLibrary
// The following data remains between invocations of allocateStorage,
// and is only changed when absolutely necessary.
struct ReadInfoType {
- unique_ptr<uInt8[]> buffer;
+ BytePtr buffer;
unique_ptr<png_bytep[]> row_pointers;
png_uint_32 width, height, pitch;
uInt32 buffer_size, row_size;
diff --git a/src/common/SoundNull.hxx b/src/common/SoundNull.hxx
index f1713c6..3dbd0f1 100644
--- a/src/common/SoundNull.hxx
+++ b/src/common/SoundNull.hxx
@@ -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: SoundNull.hxx 3241 2015-12-29 21:41:53Z stephena $
+// $Id: SoundNull.hxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#ifndef SOUND_NULL_HXX
@@ -31,7 +31,7 @@ class OSystem;
is completely disabled.
@author Stephen Anthony
- @version $Id: SoundNull.hxx 3241 2015-12-29 21:41:53Z stephena $
+ @version $Id: SoundNull.hxx 3310 2016-08-18 18:44:57Z stephena $
*/
class SoundNull : public Sound
{
diff --git a/src/common/SoundSDL2.cxx b/src/common/SoundSDL2.cxx
index bd6c6e4..f260013 100644
--- a/src/common/SoundSDL2.cxx
+++ b/src/common/SoundSDL2.cxx
@@ -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: SoundSDL2.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: SoundSDL2.cxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#ifdef SOUND_SUPPORT
diff --git a/src/common/SoundSDL2.hxx b/src/common/SoundSDL2.hxx
index 1c8af5c..df92a77 100644
--- a/src/common/SoundSDL2.hxx
+++ b/src/common/SoundSDL2.hxx
@@ -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: SoundSDL2.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: SoundSDL2.hxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#ifdef SOUND_SUPPORT
@@ -34,7 +34,7 @@ class OSystem;
This class implements the sound API for SDL.
@author Stephen Anthony and Bradford W. Mott
- @version $Id: SoundSDL2.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: SoundSDL2.hxx 3310 2016-08-18 18:44:57Z stephena $
*/
class SoundSDL2 : public Sound
{
diff --git a/src/common/Variant.hxx b/src/common/Variant.hxx
index 45a5490..e367041 100644
--- a/src/common/Variant.hxx
+++ b/src/common/Variant.hxx
@@ -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: Variant.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Variant.hxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#ifndef VARIANT_HXX
@@ -44,7 +44,7 @@ class Variant
}
public:
- Variant() : data("") { }
+ Variant() { }
Variant(const string& s) : data(s) { }
Variant(const char* s) : data(s) { }
@@ -77,7 +77,7 @@ class Variant
static const Variant EmptyVariant;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-using VariantList = vector<pair<string,Variant>>;
+using VariantList = vector<std::pair<string,Variant>>;
namespace VarList {
inline void push_back(VariantList& list, const Variant& name,
diff --git a/src/common/Version.hxx b/src/common/Version.hxx
index 8ce86af..3f467d3 100644
--- a/src/common/Version.hxx
+++ b/src/common/Version.hxx
@@ -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 3297 2016-03-25 20:51:28Z stephena $
+// $Id: Version.hxx 3320 2016-11-21 19:21:25Z stephena $
//============================================================================
#ifndef VERSION_HXX
@@ -22,7 +22,7 @@
#include <cstdlib>
-#define STELLA_VERSION "4.7.2"
-#define STELLA_BUILD atoi("$Rev: 3297 $" + 6)
+#define STELLA_VERSION "4.7.3"
+#define STELLA_BUILD atoi("$Rev: 3320 $" + 6)
#endif
diff --git a/src/common/ZipHandler.cxx b/src/common/ZipHandler.cxx
index 58f7dd9..72c6909 100644
--- a/src/common/ZipHandler.cxx
+++ b/src/common/ZipHandler.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: ZipHandler.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <cctype>
@@ -76,7 +76,7 @@ string ZipHandler::next()
// Ignore zero-length files and '__MACOSX' virtual directories
valid = header && (header->uncompressed_length > 0) &&
- !BSPF_startsWithIgnoreCase(header->filename, "__MACOSX");
+ !BSPF::startsWithIgnoreCase(header->filename, "__MACOSX");
}
while(!valid && myZip->cd_pos < myZip->ecd.cd_size);
@@ -133,11 +133,11 @@ bool ZipHandler::stream_open(const char* filename, fstream** stream,
}
else
{
- in->exceptions( ios_base::failbit | ios_base::badbit | ios_base::eofbit );
+ in->exceptions( std::ios_base::failbit | std::ios_base::badbit | std::ios_base::eofbit );
*stream = in;
- in->seekg(0, ios::end);
+ in->seekg(0, std::ios::end);
length = in->tellg();
- in->seekg(0, ios::beg);
+ in->seekg(0, std::ios::beg);
return true;
}
}
@@ -266,9 +266,9 @@ ZipHandler::zip_error ZipHandler::zip_file_open(const char* filename, zip_file**
while(hasNext())
{
const std::string& file = next();
- if(BSPF_endsWithIgnoreCase(file, ".a26") ||
- BSPF_endsWithIgnoreCase(file, ".bin") ||
- BSPF_endsWithIgnoreCase(file, ".rom"))
+ if(BSPF::endsWithIgnoreCase(file, ".a26") ||
+ BSPF::endsWithIgnoreCase(file, ".bin") ||
+ BSPF::endsWithIgnoreCase(file, ".rom"))
(*zip)->romfiles++;
}
@@ -616,7 +616,7 @@ ZipHandler::zip_error
{
// Read in the next chunk of data
bool success = stream_read(zip->file, zip->buffer, offset,
- BSPF_min(input_remaining, (uInt32)sizeof(zip->buffer)),
+ std::min(input_remaining, (uInt32)sizeof(zip->buffer)),
read_length);
if(!success)
{
diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx
index 4b182bd..2337b70 100644
--- a/src/common/bspf.hxx
+++ b/src/common/bspf.hxx
@@ -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: bspf.hxx 3294 2016-03-05 18:35:25Z stephena $
+// $Id: bspf.hxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
#ifndef BSPF_HXX
@@ -25,20 +25,17 @@
that need to be defined for different operating systems.
@author Bradford W. Mott
- @version $Id: bspf.hxx 3294 2016-03-05 18:35:25Z stephena $
+ @version $Id: bspf.hxx 3316 2016-08-24 23:57:07Z stephena $
*/
#include <cstdint>
-// Types for 8-bit signed and unsigned integers
-using Int8 = int8_t;
-using uInt8 = uint8_t;
-// Types for 16-bit signed and unsigned integers
+// Types for 8/16/32/64-bit signed and unsigned integers
+using Int8 = int8_t;
+using uInt8 = uint8_t;
using Int16 = int16_t;
using uInt16 = uint16_t;
-// Types for 32-bit signed and unsigned integers
using Int32 = int32_t;
using uInt32 = uint32_t;
-// Types for 64-bit signed and unsigned integers
using Int64 = int64_t;
using uInt64 = uint64_t;
@@ -56,128 +53,142 @@ using uInt64 = uint64_t;
#include <utility>
#include <vector>
#include "UniquePtr.hxx" // only until C++14 compilers are more common
-using namespace std;
-// Common array types
-using IntArray = vector<Int32>;
-using BoolArray = vector<bool>;
-using ByteArray = vector<uInt8>;
-using StringList = vector<string>;
-using BytePtr = unique_ptr<uInt8[]>;
-
-// Defines to help with path handling
-#if defined(BSPF_UNIX) || defined(BSPF_MAC_OSX)
- #define BSPF_PATH_SEPARATOR "/"
-#elif defined(BSPF_WINDOWS)
- #define BSPF_PATH_SEPARATOR "\\"
- #pragma warning(2:4264) // no override available for virtual member function from base 'class'; function is hidden
- #pragma warning(2:4265) // class has virtual functions, but destructor is not virtual
- #pragma warning(2:4266) // no override available for virtual member function from base 'type'; function is hidden
-#else
- #error Update src/common/bspf.hxx for path separator
-#endif
+using std::cin;
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::string;
+using std::istream;
+using std::ostream;
+using std::fstream;
+using std::iostream;
+using std::ifstream;
+using std::ofstream;
+using std::ostringstream;
+using std::istringstream;
+using std::stringstream;
+using std::unique_ptr;
+using std::shared_ptr;
+using std::make_ptr;
+using std::make_shared;
+using std::array;
+using std::vector;
+using std::make_pair;
+using std::runtime_error;
+using std::memcpy;
-// CPU architecture type
-// This isn't complete yet, but takes care of all the major platforms
-#if defined(__i386__) || defined(_M_IX86)
- #define BSPF_ARCH "i386"
-#elif defined(__x86_64__) || defined(_WIN64)
- #define BSPF_ARCH "x86_64"
-#elif defined(__powerpc__) || defined(__ppc__)
- #define BSPF_ARCH "ppc"
-#else
- #define BSPF_ARCH "NOARCH"
-#endif
-
-// I wish Windows had a complete POSIX layer
-#if defined BSPF_WINDOWS && !defined __GNUG__
- #define BSPF_snprintf _snprintf
- #define BSPF_vsnprintf _vsnprintf
-#else
- #define HAVE_UNISTD_H // needed for building zlib
- #include <strings.h>
- #define BSPF_snprintf snprintf
- #define BSPF_vsnprintf vsnprintf
-#endif
+// Common array types
+using IntArray = std::vector<Int32>;
+using BoolArray = std::vector<bool>;
+using ByteArray = std::vector<uInt8>;
+using StringList = std::vector<std::string>;
+using BytePtr = std::unique_ptr<uInt8[]>;
static const string EmptyString("");
-//////////////////////////////////////////////////////////////////////
-// Some convenience functions
-template<typename T> inline void BSPF_swap(T& a, T& b) { std::swap(a, b); }
-template<typename T> inline T BSPF_abs (T x) { return (x>=0) ? x : -x; }
-template<typename T> inline T BSPF_min (T a, T b) { return (a<b) ? a : b; }
-template<typename T> inline T BSPF_max (T a, T b) { return (a>b) ? a : b; }
-template<typename T> inline T BSPF_clamp (T a, T l, T u) { return (a<l) ? l : (a>u) ? u : a; }
-
-// Compare two strings, ignoring case
-inline int BSPF_compareIgnoreCase(const string& s1, const string& s2)
-{
-#if defined BSPF_WINDOWS && !defined __GNUG__
- return _stricmp(s1.c_str(), s2.c_str());
-#else
- return strcasecmp(s1.c_str(), s2.c_str());
-#endif
-}
-inline int BSPF_compareIgnoreCase(const char* s1, const char* s2)
+namespace BSPF
{
-#if defined BSPF_WINDOWS && !defined __GNUG__
- return _stricmp(s1, s2);
-#else
- return strcasecmp(s1, s2);
-#endif
-}
+ // Defines to help with path handling
+ #if defined(BSPF_UNIX) || defined(BSPF_MAC_OSX)
+ static const string PATH_SEPARATOR = "/";
+ #elif defined(BSPF_WINDOWS)
+ static const string PATH_SEPARATOR = "\\";
+ #pragma warning(2:4264) // no override available for virtual member function from base 'class'; function is hidden
+ #pragma warning(2:4265) // class has virtual functions, but destructor is not virtual
+ #pragma warning(2:4266) // no override available for virtual member function from base 'type'; function is hidden
+ #else
+ #error Update src/common/bspf.hxx for path separator
+ #endif
+
+ // CPU architecture type
+ // This isn't complete yet, but takes care of all the major platforms
+ #if defined(__i386__) || defined(_M_IX86)
+ static const string ARCH = "i386";
+ #elif defined(__x86_64__) || defined(_WIN64)
+ static const string ARCH = "x86_64";
+ #elif defined(__powerpc__) || defined(__ppc__)
+ static const string ARCH = "ppc";
+ #else
+ static const string ARCH = "NOARCH";
+ #endif
+
+ // Combines 'max' and 'min', and clamps value to the upper/lower value
+ // if it is outside the specified range
+ template<typename T> inline T clamp(T a, T l, T u)
+ {
+ return (a<l) ? l : (a>u) ? u : a;
+ }
-// Test whether the first string starts with the second one (case insensitive)
-inline bool BSPF_startsWithIgnoreCase(const string& s1, const string& s2)
-{
-#if defined BSPF_WINDOWS && !defined __GNUG__
- return _strnicmp(s1.c_str(), s2.c_str(), s2.length()) == 0;
-#else
- return strncasecmp(s1.c_str(), s2.c_str(), s2.length()) == 0;
-#endif
-}
-inline bool BSPF_startsWithIgnoreCase(const char* s1, const char* s2)
-{
-#if defined BSPF_WINDOWS && !defined __GNUG__
- return _strnicmp(s1, s2, strlen(s2)) == 0;
-#else
- return strncasecmp(s1, s2, strlen(s2)) == 0;
-#endif
-}
+ // Compare two strings, ignoring case
+ inline int compareIgnoreCase(const string& s1, const string& s2)
+ {
+ #if defined BSPF_WINDOWS && !defined __GNUG__
+ return _stricmp(s1.c_str(), s2.c_str());
+ #else
+ return strcasecmp(s1.c_str(), s2.c_str());
+ #endif
+ }
+ inline int compareIgnoreCase(const char* s1, const char* s2)
+ {
+ #if defined BSPF_WINDOWS && !defined __GNUG__
+ return _stricmp(s1, s2);
+ #else
+ return strcasecmp(s1, s2);
+ #endif
+ }
-// Test whether two strings are equal (case insensitive)
-inline bool BSPF_equalsIgnoreCase(const string& s1, const string& s2)
-{
- return BSPF_compareIgnoreCase(s1, s2) == 0;
-}
+ // Test whether the first string starts with the second one (case insensitive)
+ inline bool startsWithIgnoreCase(const string& s1, const string& s2)
+ {
+ #if defined BSPF_WINDOWS && !defined __GNUG__
+ return _strnicmp(s1.c_str(), s2.c_str(), s2.length()) == 0;
+ #else
+ return strncasecmp(s1.c_str(), s2.c_str(), s2.length()) == 0;
+ #endif
+ }
+ inline bool startsWithIgnoreCase(const char* s1, const char* s2)
+ {
+ #if defined BSPF_WINDOWS && !defined __GNUG__
+ return _strnicmp(s1, s2, strlen(s2)) == 0;
+ #else
+ return strncasecmp(s1, s2, strlen(s2)) == 0;
+ #endif
+ }
-// Find location (if any) of the second string within the first,
-// starting from 'startpos' in the first string
-inline size_t BSPF_findIgnoreCase(const string& s1, const string& s2, int startpos = 0)
-{
- auto pos = std::search(s1.begin()+startpos, s1.end(),
- s2.begin(), s2.end(), [](char ch1, char ch2) {
- return toupper(uInt8(ch1)) == toupper(uInt8(ch2));
- });
- return pos == s1.end() ? string::npos : size_t(pos - (s1.begin()+startpos));
-}
-
-// Test whether the first string ends with the second one (case insensitive)
-inline bool BSPF_endsWithIgnoreCase(const string& s1, const string& s2)
-{
- if(s1.length() >= s2.length())
+ // Test whether two strings are equal (case insensitive)
+ inline bool equalsIgnoreCase(const string& s1, const string& s2)
{
- const char* end = s1.c_str() + s1.length() - s2.length();
- return BSPF_compareIgnoreCase(end, s2.c_str()) == 0;
+ return compareIgnoreCase(s1, s2) == 0;
}
- return false;
-}
-// Test whether the first string contains the second one (case insensitive)
-inline bool BSPF_containsIgnoreCase(const string& s1, const string& s2)
-{
- return BSPF_findIgnoreCase(s1, s2) != string::npos;
-}
+ // Find location (if any) of the second string within the first,
+ // starting from 'startpos' in the first string
+ inline size_t findIgnoreCase(const string& s1, const string& s2, int startpos = 0)
+ {
+ auto pos = std::search(s1.begin()+startpos, s1.end(),
+ s2.begin(), s2.end(), [](char ch1, char ch2) {
+ return toupper(uInt8(ch1)) == toupper(uInt8(ch2));
+ });
+ return pos == s1.end() ? string::npos : size_t(pos - (s1.begin()+startpos));
+ }
+
+ // Test whether the first string ends with the second one (case insensitive)
+ inline bool endsWithIgnoreCase(const string& s1, const string& s2)
+ {
+ if(s1.length() >= s2.length())
+ {
+ const char* end = s1.c_str() + s1.length() - s2.length();
+ return compareIgnoreCase(end, s2.c_str()) == 0;
+ }
+ return false;
+ }
+
+ // Test whether the first string contains the second one (case insensitive)
+ inline bool containsIgnoreCase(const string& s1, const string& s2)
+ {
+ return findIgnoreCase(s1, s2) != string::npos;
+ }
+} // namespace BSPF
#endif
diff --git a/src/common/main.cxx b/src/common/main.cxx
index 01bb4e6..a371c43 100644
--- a/src/common/main.cxx
+++ b/src/common/main.cxx
@@ -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: main.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: main.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <cstdlib>
@@ -60,7 +60,7 @@ int stellaMain(int argc, char* argv[])
int main(int argc, char* argv[])
#endif
{
- ios_base::sync_with_stdio(false);
+ std::ios_base::sync_with_stdio(false);
// Create the parent OSystem object
theOSystem = MediaFactory::createOSystem();
diff --git a/src/common/stella.xpm b/src/common/stella.xpm
deleted file mode 100644
index 1815d65..0000000
--- a/src/common/stella.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static const char * stella_icon[] = {
-"32 32 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" .............. ",
-" .............. ",
-" ..++..++..++.. ",
-" ..++..++..++.. ",
-" ..++..++..++.. ",
-" ..++..++..++.. ",
-" ..++..++..++.. ",
-" ..++..++..++.. ",
-" ..++..++..++.. ",
-" ..++..++..++.. ",
-" ....++..++..++.... ",
-" ....++..++..++.... ",
-" ....++++..++..++++.... ",
-" ....++++..++..++++.... ",
-" ..++++....++....++++.. ",
-" ..++++....++....++++.. ",
-" ......++......++......++...... ",
-" ......++......++......++...... ",
-" ..++++++.. ..++.. ..++++++.. ",
-" ..++++++.. ..++.. ..++++++.. ",
-" ..++++.... ..++.. ....++++.. ",
-" ..++++.... ..++.. ....++++.. ",
-" ........ ...... ........ ",
-" ........ ...... ........ ",
-" ",
-" ",
-" ",
-" "};
diff --git a/src/common/tv_filters/NTSCFilter.cxx b/src/common/tv_filters/NTSCFilter.cxx
index 5aa5e49..aeaf94c 100644
--- a/src/common/tv_filters/NTSCFilter.cxx
+++ b/src/common/tv_filters/NTSCFilter.cxx
@@ -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: NTSCFilter.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: NTSCFilter.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "TIASurface.hxx"
@@ -186,16 +186,16 @@ string NTSCFilter::decreaseAdjustable()
void NTSCFilter::loadConfig(const Settings& settings)
{
// Load adjustables for custom mode
- myCustomSetup.hue = BSPF_clamp(settings.getFloat("tv.hue"), -1.0f, 1.0f);
- myCustomSetup.saturation = BSPF_clamp(settings.getFloat("tv.saturation"), -1.0f, 1.0f);
- myCustomSetup.contrast = BSPF_clamp(settings.getFloat("tv.contrast"), -1.0f, 1.0f);
- myCustomSetup.brightness = BSPF_clamp(settings.getFloat("tv.brightness"), -1.0f, 1.0f);
- myCustomSetup.sharpness = BSPF_clamp(settings.getFloat("tv.sharpness"), -1.0f, 1.0f);
- myCustomSetup.gamma = BSPF_clamp(settings.getFloat("tv.gamma"), -1.0f, 1.0f);
- myCustomSetup.resolution = BSPF_clamp(settings.getFloat("tv.resolution"), -1.0f, 1.0f);
- myCustomSetup.artifacts = BSPF_clamp(settings.getFloat("tv.artifacts"), -1.0f, 1.0f);
- myCustomSetup.fringing = BSPF_clamp(settings.getFloat("tv.fringing"), -1.0f, 1.0f);
- myCustomSetup.bleed = BSPF_clamp(settings.getFloat("tv.bleed"), -1.0f, 1.0f);
+ myCustomSetup.hue = BSPF::clamp(settings.getFloat("tv.hue"), -1.0f, 1.0f);
+ myCustomSetup.saturation = BSPF::clamp(settings.getFloat("tv.saturation"), -1.0f, 1.0f);
+ myCustomSetup.contrast = BSPF::clamp(settings.getFloat("tv.contrast"), -1.0f, 1.0f);
+ myCustomSetup.brightness = BSPF::clamp(settings.getFloat("tv.brightness"), -1.0f, 1.0f);
+ myCustomSetup.sharpness = BSPF::clamp(settings.getFloat("tv.sharpness"), -1.0f, 1.0f);
+ myCustomSetup.gamma = BSPF::clamp(settings.getFloat("tv.gamma"), -1.0f, 1.0f);
+ myCustomSetup.resolution = BSPF::clamp(settings.getFloat("tv.resolution"), -1.0f, 1.0f);
+ myCustomSetup.artifacts = BSPF::clamp(settings.getFloat("tv.artifacts"), -1.0f, 1.0f);
+ myCustomSetup.fringing = BSPF::clamp(settings.getFloat("tv.fringing"), -1.0f, 1.0f);
+ myCustomSetup.bleed = BSPF::clamp(settings.getFloat("tv.bleed"), -1.0f, 1.0f);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx
index 847690c..7b1014b 100644
--- a/src/debugger/CartDebug.cxx
+++ b/src/debugger/CartDebug.cxx
@@ -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 3242 2015-12-29 22:39:08Z stephena $
+// $Id: CartDebug.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <time.h>
@@ -31,7 +31,13 @@
#include "CartDebug.hxx"
#include "CartDebugWidget.hxx"
#include "CartRamWidget.hxx"
-using namespace Common;
+using Common::Base;
+using std::hex;
+using std::dec;
+using std::setfill;
+using std::setw;
+using std::left;
+using std::right;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
@@ -59,7 +65,7 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
myConsole.cartridge().getImage(banksize);
BankInfo info;
- info.size = BSPF_min(banksize, 4096);
+ info.size = std::min(banksize, 4096);
for(int i = 0; i < myConsole.cartridge().bankCount(); ++i)
myBankInfo.push_back(info);
@@ -196,7 +202,7 @@ string CartDebug::toString()
if(state.rport[i] - curraddr > bytesPerLine || bytesSoFar >= 256)
{
char port[37];
- BSPF_snprintf(port, 36, "%04x: (rport = %04x, wport = %04x)\n",
+ std::snprintf(port, 36, "%04x: (rport = %04x, wport = %04x)\n",
state.rport[i], state.rport[i], state.wport[i]);
port[2] = port[3] = 'x';
buf << DebuggerParser::red(port);
@@ -347,7 +353,7 @@ string CartDebug::disassemble(uInt16 start, uInt16 lines) const
{
if(begin == list_size) begin = end;
if(tag.type != CartDebug::ROW)
- length = BSPF_max(length, uInt32(tag.disasm.length()));
+ length = std::max(length, uInt32(tag.disasm.length()));
--lines;
}
@@ -360,14 +366,14 @@ string CartDebug::disassemble(uInt16 start, uInt16 lines) const
if(tag.type == CartDebug::NONE)
continue;
else if(tag.address)
- buffer << uppercase << hex << setw(4) << setfill('0') << tag.address
- << ": ";
+ buffer << std::uppercase << std::hex << std::setw(4)
+ << std::setfill('0') << tag.address << ": ";
else
buffer << " ";
- buffer << tag.disasm << setw(int(length - tag.disasm.length() + 2))
- << setfill(' ') << " "
- << setw(4) << left << tag.ccount << " " << tag.bytes << endl;
+ buffer << tag.disasm << std::setw(int(length - tag.disasm.length() + 2))
+ << std::setfill(' ') << " "
+ << std::setw(4) << std::left << tag.ccount << " " << tag.bytes << endl;
}
return buffer.str();
@@ -383,7 +389,7 @@ bool CartDebug::addDirective(CartDebug::DisasmType type,
if(bank < 0) // Do we want the current bank or ZP RAM?
bank = (myDebugger.cpuDebug().pc() & 0x1000) ? getBank() : int(myBankInfo.size())-1;
- bank = BSPF_min(bank, bankCount());
+ bank = std::min(bank, bankCount());
BankInfo& info = myBankInfo[bank];
DirectiveList& list = info.directiveList;
@@ -515,7 +521,7 @@ bool CartDebug::addLabel(const string& label, uInt16 address)
removeLabel(label);
myUserAddresses.insert(make_pair(label, address));
myUserLabels.insert(make_pair(address, label));
- myLabelLength = BSPF_max(myLabelLength, uInt16(label.size()));
+ myLabelLength = std::max(myLabelLength, uInt16(label.size()));
mySystem.setDirtyPage(address);
return true;
}
@@ -773,7 +779,7 @@ string CartDebug::loadSymbolFile()
// Make sure the value doesn't represent a constant
// For now, we simply ignore constants completely
const auto& iter = myUserCLabels.find(value);
- if(iter == myUserCLabels.end() || !BSPF_equalsIgnoreCase(label, iter->second))
+ if(iter == myUserCLabels.end() || !BSPF::equalsIgnoreCase(label, iter->second))
{
// Check for period, and strip leading number
if(string::size_type pos = label.find_first_of(".", 0) != string::npos)
@@ -859,32 +865,32 @@ string CartDebug::loadConfigFile()
string directive;
uInt16 start = 0, end = 0;
buf >> directive;
- if(BSPF_startsWithIgnoreCase(directive, "ORG"))
+ if(BSPF::startsWithIgnoreCase(directive, "ORG"))
{
// TODO - figure out what to do with this
buf >> hex >> start;
}
- else if(BSPF_startsWithIgnoreCase(directive, "CODE"))
+ else if(BSPF::startsWithIgnoreCase(directive, "CODE"))
{
buf >> hex >> start >> hex >> end;
addDirective(CartDebug::CODE, start, end, currentbank);
}
- else if(BSPF_startsWithIgnoreCase(directive, "GFX"))
+ else if(BSPF::startsWithIgnoreCase(directive, "GFX"))
{
buf >> hex >> start >> hex >> end;
addDirective(CartDebug::GFX, start, end, currentbank);
}
- else if(BSPF_startsWithIgnoreCase(directive, "PGFX"))
+ else if(BSPF::startsWithIgnoreCase(directive, "PGFX"))
{
buf >> hex >> start >> hex >> end;
addDirective(CartDebug::PGFX, start, end, currentbank);
}
- else if(BSPF_startsWithIgnoreCase(directive, "DATA"))
+ else if(BSPF::startsWithIgnoreCase(directive, "DATA"))
{
buf >> hex >> start >> hex >> end;
addDirective(CartDebug::DATA, start, end, currentbank);
}
- else if(BSPF_startsWithIgnoreCase(directive, "ROW"))
+ else if(BSPF::startsWithIgnoreCase(directive, "ROW"))
{
buf >> hex >> start;
buf >> hex >> end;
@@ -1139,7 +1145,7 @@ string CartDebug::saveDisassembly()
<< ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n";
int max_len = 0;
for(const auto& iter: myUserLabels)
- max_len = BSPF_max(max_len, int(iter.second.size()));
+ max_len = std::max(max_len, int(iter.second.size()));
for(const auto& iter: myUserLabels)
out << ALIGN(max_len) << iter.second << " = $" << iter.first << "\n";
}
@@ -1153,11 +1159,11 @@ string CartDebug::saveDisassembly()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartDebug::saveRom()
{
- const string& path = "~" BSPF_PATH_SEPARATOR +
+ const string& path = string("~") + BSPF::PATH_SEPARATOR +
myConsole.properties().get(Cartridge_Name) + ".a26";
FilesystemNode node(path);
- ofstream out(node.getPath(), ios::binary);
+ ofstream out(node.getPath(), std::ios::binary);
if(out && myConsole.cartridge().saveROM(out))
return "saved ROM as " + node.getShortPath();
else
@@ -1229,23 +1235,23 @@ void CartDebug::getCompletions(const char* in, StringList& completions) const
{
// First scan system equates
for(uInt16 addr = 0x00; addr <= 0x0F; ++addr)
- if(ourTIAMnemonicR[addr] && BSPF_startsWithIgnoreCase(ourTIAMnemonicR[addr], in))
+ if(ourTIAMnemonicR[addr] && BSPF::startsWithIgnoreCase(ourTIAMnemonicR[addr], in))
completions.push_back(ourTIAMnemonicR[addr]);
for(uInt16 addr = 0x00; addr <= 0x3F; ++addr)
- if(ourTIAMnemonicW[addr] && BSPF_startsWithIgnoreCase(ourTIAMnemonicW[addr], in))
+ if(ourTIAMnemonicW[addr] && BSPF::startsWithIgnoreCase(ourTIAMnemonicW[addr], in))
completions.push_back(ourTIAMnemonicW[addr]);
for(uInt16 addr = 0; addr <= 0x297-0x280; ++addr)
- if(ourIOMnemonic[addr] && BSPF_startsWithIgnoreCase(ourIOMnemonic[addr], in))
+ if(ourIOMnemonic[addr] && BSPF::startsWithIgnoreCase(ourIOMnemonic[addr], in))
completions.push_back(ourIOMnemonic[addr]);
for(uInt16 addr = 0; addr <= 0x7F; ++addr)
- if(ourZPMnemonic[addr] && BSPF_startsWithIgnoreCase(ourZPMnemonic[addr], in))
+ if(ourZPMnemonic[addr] && BSPF::startsWithIgnoreCase(ourZPMnemonic[addr], in))
completions.push_back(ourZPMnemonic[addr]);
// Now scan user-defined labels
for(const auto& iter: myUserAddresses)
{
const char* l = iter.first.c_str();
- if(BSPF_startsWithIgnoreCase(l, in))
+ if(BSPF::startsWithIgnoreCase(l, in))
completions.push_back(l);
}
}
diff --git a/src/debugger/CartDebug.hxx b/src/debugger/CartDebug.hxx
index 1f3eead..c9da82f 100644
--- a/src/debugger/CartDebug.hxx
+++ b/src/debugger/CartDebug.hxx
@@ -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 3242 2015-12-29 22:39:08Z stephena $
+// $Id: CartDebug.hxx 3317 2016-09-04 23:03:01Z stephena $
//============================================================================
#ifndef CART_DEBUG_HXX
@@ -87,6 +87,15 @@ class CartDebug : public DebuggerSystem
int fieldwidth;
};
+ // Determine 'type' of address (ie, what part of the system accessed)
+ enum AddrType {
+ ADDR_TIA,
+ ADDR_IO,
+ ADDR_ZPRAM,
+ ADDR_ROM
+ };
+ AddrType addressType(uInt16 addr) const;
+
public:
CartDebug(Debugger& dbg, Console& console, const OSystem& osystem);
virtual ~CartDebug() = default;
@@ -263,25 +272,16 @@ class CartDebug : public DebuggerSystem
void addressTypeAsString(ostream& buf, uInt16 addr) const;
private:
- using AddrToLabel = map<uInt16, string>;
- using LabelToAddr = map<string, uInt16>;
-
- // Determine 'type' of address (ie, what part of the system accessed)
- enum AddrType {
- ADDR_TIA,
- ADDR_IO,
- ADDR_ZPRAM,
- ADDR_ROM
- };
- AddrType addressType(uInt16 addr) const;
+ using AddrToLabel = std::map<uInt16, string>;
+ using LabelToAddr = std::map<string, uInt16>;
struct DirectiveTag {
DisasmType type;
uInt16 start;
uInt16 end;
};
- using AddressList = list<uInt16>;
- using DirectiveList = list<DirectiveTag>;
+ using AddressList = std::list<uInt16>;
+ using DirectiveList = std::list<DirectiveTag>;
struct BankInfo {
uInt16 start; // start of address space
@@ -352,7 +352,7 @@ class CartDebug : public DebuggerSystem
// Used for the disassembly display, and mapping from addresses
// to corresponding lines of text in that display
Disassembly myDisassembly;
- map<uInt16, int> myAddrToLineList;
+ std::map<uInt16, int> myAddrToLineList;
bool myAddrToLineIsROM;
// Mappings from label to address (and vice versa) for items
diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx
index 0d845d5..85560a2 100644
--- a/src/debugger/Debugger.cxx
+++ b/src/debugger/Debugger.cxx
@@ -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 3244 2015-12-30 19:07:11Z stephena $
+// $Id: Debugger.cxx 3314 2016-08-22 16:53:09Z stephena $
//============================================================================
#include "bspf.hxx"
@@ -143,10 +143,10 @@ void Debugger::initialize()
// The debugger dialog is resizable, within certain bounds
// We check those bounds now
- myWidth = BSPF_max(myWidth, uInt32(DebuggerDialog::kSmallFontMinW));
- myHeight = BSPF_max(myHeight, uInt32(DebuggerDialog::kSmallFontMinH));
- myWidth = BSPF_min(myWidth, uInt32(d.w));
- myHeight = BSPF_min(myHeight, uInt32(d.h));
+ myWidth = std::max(myWidth, uInt32(DebuggerDialog::kSmallFontMinW));
+ myHeight = std::max(myHeight, uInt32(DebuggerDialog::kSmallFontMinH));
+ myWidth = std::min(myWidth, uInt32(d.w));
+ myHeight = std::min(myHeight, uInt32(d.h));
myOSystem.settings().setValue("dbg.res", GUI::Size(myWidth, myHeight));
@@ -255,7 +255,9 @@ const string Debugger::invIfChanged(int reg, int oldReg)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::reset()
{
+ unlockBankswitchState();
mySystem.reset();
+ lockBankswitchState();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -576,13 +578,13 @@ string Debugger::builtinHelp() const
if(len > i_maxlen) i_maxlen = len;
}
- buf << setfill(' ') << endl << "Built-in functions:" << endl;
+ buf << std::setfill(' ') << endl << "Built-in functions:" << endl;
for(int i = 0; builtin_functions[i][0] != 0; ++i)
{
- buf << setw(c_maxlen) << left << builtin_functions[i][0]
- << setw(2) << right << "{"
- << setw(i_maxlen) << left << builtin_functions[i][1]
- << setw(4) << "}"
+ buf << std::setw(c_maxlen) << std::left << builtin_functions[i][0]
+ << std::setw(2) << std::right << "{"
+ << std::setw(i_maxlen) << std::left << builtin_functions[i][1]
+ << std::setw(4) << "}"
<< builtin_functions[i][2]
<< endl;
}
@@ -598,9 +600,9 @@ string Debugger::builtinHelp() const
buf << endl << "Pseudo-registers:" << endl;
for(int i = 0; pseudo_registers[i][0] != 0; ++i)
{
- buf << setw(c_maxlen) << left << pseudo_registers[i][0]
- << setw(2) << " "
- << setw(i_maxlen) << left << pseudo_registers[i][1]
+ buf << std::setw(c_maxlen) << std::left << pseudo_registers[i][0]
+ << std::setw(2) << " "
+ << std::setw(i_maxlen) << std::left << pseudo_registers[i][1]
<< endl;
}
@@ -613,12 +615,12 @@ void Debugger::getCompletions(const char* in, StringList& list) const
for(const auto& iter: myFunctions)
{
const char* l = iter.first.c_str();
- if(BSPF_equalsIgnoreCase(l, in))
+ if(BSPF::equalsIgnoreCase(l, in))
list.push_back(l);
}
for(int i = 0; pseudo_registers[i][0] != 0; ++i)
- if(BSPF_equalsIgnoreCase(pseudo_registers[i][0], in))
+ if(BSPF::equalsIgnoreCase(pseudo_registers[i][0], in))
list.push_back(pseudo_registers[i][0]);
}
diff --git a/src/debugger/Debugger.hxx b/src/debugger/Debugger.hxx
index a13b2a6..fb300dd 100644
--- a/src/debugger/Debugger.hxx
+++ b/src/debugger/Debugger.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Debugger.hxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#ifndef DEBUGGER_HXX
@@ -48,8 +48,8 @@ class ButtonWidget;
#include "TIADebug.hxx"
#include "bspf.hxx"
-using FunctionMap = map<string,unique_ptr<Expression>>;
-using FunctionDefMap = map<string,string>;
+using FunctionMap = std::map<string, unique_ptr<Expression>>;
+using FunctionDefMap = std::map<string, string>;
/**
@@ -57,7 +57,7 @@ using FunctionDefMap = map<string,string>;
for all debugging operations in Stella (parser, 6502 debugger, etc).
@author Stephen Anthony
- @version $Id: Debugger.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: Debugger.hxx 3308 2016-05-24 16:55:45Z stephena $
*/
class Debugger : public DialogContainer
{
diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx
index 69e0c48..92413c1 100644
--- a/src/debugger/DebuggerParser.cxx
+++ b/src/debugger/DebuggerParser.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: DebuggerParser.cxx 3317 2016-09-04 23:03:01Z stephena $
//============================================================================
#include <fstream>
@@ -39,7 +39,12 @@
#include "Vec.hxx"
#include "Base.hxx"
-using namespace Common;
+using Common::Base;
+using std::hex;
+using std::dec;
+using std::setfill;
+using std::setw;
+using std::right;
#ifdef CHEATCODE_SUPPORT
#include "Cheat.hxx"
@@ -108,7 +113,7 @@ string DebuggerParser::run(const string& command)
for(int i = 0; i < kNumCommands; ++i)
{
- if(BSPF_equalsIgnoreCase(verb, commands[i].cmdString))
+ if(BSPF::equalsIgnoreCase(verb, commands[i].cmdString))
{
if(validateArgs(i))
commands[i].executor(this);
@@ -160,7 +165,7 @@ void DebuggerParser::getCompletions(const char* in, StringList& completions) con
// cerr << "Attempting to complete \"" << in << "\"" << endl;
for(int i = 0; i < kNumCommands; ++i)
{
- if(BSPF_startsWithIgnoreCase(commands[i].cmdString.c_str(), in))
+ if(BSPF::startsWithIgnoreCase(commands[i].cmdString.c_str(), in))
completions.push_back(commands[i].cmdString);
}
}
@@ -562,9 +567,9 @@ string DebuggerParser::trapStatus(int addr)
else if(r)
result += "read";
else if(w)
- result += " write";
+ result += "write";
else
- result += " none ";
+ result += "none";
// TODO - technically, we should determine if the label is read or write
const string& l = debugger.cartDebug().getLabel(addr, true);
@@ -580,9 +585,8 @@ string DebuggerParser::trapStatus(int addr)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool DebuggerParser::saveScriptFile(string file)
{
- if( file.find_last_of('.') == string::npos ) {
+ if( file.find_last_of('.') == string::npos )
file += ".stella";
- }
ofstream out(file);
@@ -1288,7 +1292,7 @@ void DebuggerParser::executeRunTo()
if(pcline >= 0)
{
const string& next = list[pcline].disasm;
- done = (BSPF_findIgnoreCase(next, argStrings[0]) != string::npos);
+ done = (BSPF::findIgnoreCase(next, argStrings[0]) != string::npos);
}
// Update the progress bar
progress.setProgress(count);
@@ -1435,46 +1439,141 @@ void DebuggerParser::executeTrace()
// "trap"
void DebuggerParser::executeTrap()
{
- uInt32 beg = args[0];
- uInt32 end = argCount >= 2 ? args[1] : beg;
- if(beg > end) BSPF_swap(beg, end);
-
- for(uInt32 i = beg; i <= end; ++i)
- {
- debugger.toggleReadTrap(i);
- debugger.toggleWriteTrap(i);
- commandResult << trapStatus(i) << endl;
- }
+ executeTrapRW(true, true);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "trapread"
void DebuggerParser::executeTrapread()
{
+ executeTrapRW(true, false);
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// "trapwrite"
+void DebuggerParser::executeTrapwrite()
+{
+ executeTrapRW(false, true);
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// wrapper function for trap/trapread/trapwrite commands
+void DebuggerParser::executeTrapRW(bool read, bool write)
+{
uInt32 beg = args[0];
uInt32 end = argCount >= 2 ? args[1] : beg;
- if(beg > end) BSPF_swap(beg, end);
+ if(beg > end) std::swap(beg, end);
for(uInt32 i = beg; i <= end; ++i)
{
- debugger.toggleReadTrap(i);
+ if(read) debugger.toggleReadTrap(i);
+ if(write) debugger.toggleWriteTrap(i);
commandResult << trapStatus(i) << endl;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// "trapwrite"
-void DebuggerParser::executeTrapwrite()
+// "trapm"
+void DebuggerParser::executeTrapM()
{
- uInt32 beg = args[0];
- uInt32 end = argCount >= 2 ? args[1] : beg;
- if(beg > end) BSPF_swap(beg, end);
+ executeTrapMRW(true, true);
+}
- for(uInt32 i = beg; i <= end; ++i)
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// "trapreadm"
+void DebuggerParser::executeTrapreadM()
+{
+ executeTrapMRW(true, false);
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// "trapwritem"
+void DebuggerParser::executeTrapwriteM()
+{
+ executeTrapMRW(false, true);
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// wrapper function for trapm/trapreadm/trapwritem commands
+void DebuggerParser::executeTrapMRW(bool read, bool write)
+{
+ uInt32 addr = args[0];
+ uInt32 beg = argCount > 1 ? args[1] : 0;
+ uInt32 end = argCount > 2 ? args[2] : 0xFFFF;
+ if(beg > end) std::swap(beg, end);
+
+ switch(debugger.cartDebug().addressType(addr))
{
- debugger.toggleWriteTrap(i);
- commandResult << trapStatus(i) << endl;
+ case CartDebug::ADDR_TIA:
+ {
+ for(uInt32 i = beg; i <= end; ++i)
+ {
+ if((i & 0x1080) == 0x0000 && (i & 0x003F) == addr)
+ {
+ if(read) debugger.toggleReadTrap(i);
+ if(write) debugger.toggleWriteTrap(i);
+ }
+ }
+ break;
+ }
+ case CartDebug::ADDR_IO:
+ {
+ for(uInt32 i = beg; i <= end; ++i)
+ {
+ if((i & 0x1080) == 0x0080 && (i & 0x0200) != 0x0000 && (i & 0x02FF) == addr)
+ {
+ if(read) debugger.toggleReadTrap(i);
+ if(write) debugger.toggleWriteTrap(i);
+ }
+ }
+ break;
+ }
+ case CartDebug::ADDR_ZPRAM:
+ {
+ for(uInt32 i = beg; i <= end; ++i)
+ {
+ if((i & 0x1080) == 0x0080 && (i & 0x0200) == 0x0000 && (i & 0x00FF) == addr)
+ {
+ if(read) debugger.toggleReadTrap(i);
+ if(write) debugger.toggleWriteTrap(i);
+ }
+ }
+ break;
+ }
+ case CartDebug::ADDR_ROM:
+ {
+ // Enforce range?
+ if(argCount > 1)
+ {
+ if(beg < addr) beg = addr & 0xF000;
+ if(end < beg) beg = end;
+ }
+ else
+ {
+ beg = 0x1000;
+ end = 0xFFFF;
+ }
+
+ // Are we in range?
+ if(!(addr >= beg && addr <= end))
+ {
+ commandResult << "Address " << addr << " is outside range" << endl;
+ return;
+ }
+ for(uInt32 i = beg; i <= end; ++i)
+ {
+ if((i % 0x2000 >= 0x1000) && (i & 0x0FFF) == (addr & 0x0FFF))
+ {
+ if(read) debugger.toggleReadTrap(i);
+ if(write) debugger.toggleWriteTrap(i);
+ }
+ }
+ break;
+ }
}
+
+ commandResult << trapStatus(addr) << " + mirrors from $"
+ << Base::HEX4 << beg << " - $" << end << endl;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1483,7 +1582,7 @@ void DebuggerParser::executeType()
{
uInt32 beg = args[0];
uInt32 end = argCount >= 2 ? args[1] : beg;
- if(beg > end) BSPF_swap(beg, end);
+ if(beg > end) std::swap(beg, end);
for(uInt32 i = beg; i <= end; ++i)
{
@@ -2124,6 +2223,33 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
},
{
+ "trapm",
+ "Trap read/write access to address xx (+mirrors)",
+ true,
+ false,
+ { kARG_WORD, kARG_MULTI_WORD },
+ std::mem_fn(&DebuggerParser::executeTrapM)
+ },
+
+ {
+ "trapreadm",
+ "Trap read access to address xx (+mirrors)",
+ true,
+ false,
+ { kARG_WORD, kARG_MULTI_WORD },
+ std::mem_fn(&DebuggerParser::executeTrapreadM)
+ },
+
+ {
+ "trapwritem",
+ "Trap write access to address xx (+mirrors)",
+ true,
+ false,
+ { kARG_WORD, kARG_MULTI_WORD },
+ std::mem_fn(&DebuggerParser::executeTrapwriteM)
+ },
+
+ {
"type",
"Show disassembly type for address xx [to yy]",
true,
diff --git a/src/debugger/DebuggerParser.hxx b/src/debugger/DebuggerParser.hxx
index 974b522..69a6920 100644
--- a/src/debugger/DebuggerParser.hxx
+++ b/src/debugger/DebuggerParser.hxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: DebuggerParser.hxx 3317 2016-09-04 23:03:01Z stephena $
//============================================================================
#ifndef DEBUGGER_PARSER_HXX
@@ -70,9 +70,7 @@ class DebuggerParser
bool saveScriptFile(string file);
private:
- enum {
- kNumCommands = 70
- };
+ enum { kNumCommands = 73 };
// Constants for argument processing
enum {
@@ -182,6 +180,11 @@ class DebuggerParser
void executeTrap();
void executeTrapread();
void executeTrapwrite();
+ void executeTrapRW(bool read, bool write); // not exposed by debugger
+ void executeTrapM();
+ void executeTrapreadM();
+ void executeTrapwriteM();
+ void executeTrapMRW(bool read, bool write); // not exposed by debugger
void executeType();
void executeUHex();
void executeUndef();
diff --git a/src/debugger/DiStella.cxx b/src/debugger/DiStella.cxx
index df67222..5f2b29b 100644
--- a/src/debugger/DiStella.cxx
+++ b/src/debugger/DiStella.cxx
@@ -14,13 +14,13 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: DiStella.cxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: DiStella.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "bspf.hxx"
#include "Debugger.hxx"
#include "DiStella.hxx"
-using namespace Common;
+using Common::Base;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
@@ -812,7 +812,7 @@ void DiStella::disasm(uInt32 distart, int pass)
{
// A complete line of disassembly (text, cycle count, and bytes)
myDisasmBuf << nextline.str() << "'"
- << ";" << dec << int(ourLookup[op].cycles) << "'"
+ << ";" << std::dec << int(ourLookup[op].cycles) << "'"
<< nextlinebytes.str();
addEntry(CartDebug::CODE);
if (op == 0x40 || op == 0x60)
@@ -941,20 +941,20 @@ bool DiStella::check_range(uInt16 beg, uInt16 end) const
{
if(beg > end)
{
- cerr << "Beginning of range greater than end: start = " << hex << beg
- << ", end = " << hex << end << endl;
+ cerr << "Beginning of range greater than end: start = " << std::hex << beg
+ << ", end = " << std::hex << end << endl;
return false;
}
else if(beg > myAppData.end + myOffset)
{
- cerr << "Beginning of range out of range: start = " << hex << beg
- << ", range = " << hex << (myAppData.end + myOffset) << endl;
+ cerr << "Beginning of range out of range: start = " << std::hex << beg
+ << ", range = " << std::hex << (myAppData.end + myOffset) << endl;
return false;
}
else if(beg < myOffset)
{
- cerr << "Beginning of range out of range: start = " << hex << beg
- << ", offset = " << hex << myOffset << endl;
+ cerr << "Beginning of range out of range: start = " << std::hex << beg
+ << ", offset = " << std::hex << myOffset << endl;
return false;
}
return true;
@@ -969,18 +969,18 @@ void DiStella::addEntry(CartDebug::DisasmType type)
tag.type = type;
// Address
- myDisasmBuf.seekg(0, ios::beg);
+ myDisasmBuf.seekg(0, std::ios::beg);
if(myDisasmBuf.peek() == ' ')
tag.address = 0;
else
- myDisasmBuf >> setw(4) >> hex >> tag.address;
+ myDisasmBuf >> std::setw(4) >> std::hex >> tag.address;
// Only include addresses within the requested range
if(tag.address < myAppData.start)
goto DONE_WITH_ADD;
// Label (a user-defined label always overrides any auto-generated one)
- myDisasmBuf.seekg(5, ios::beg);
+ myDisasmBuf.seekg(5, std::ios::beg);
if(tag.address)
{
tag.label = myDbg.getLabel(tag.address, true);
@@ -1001,7 +1001,7 @@ void DiStella::addEntry(CartDebug::DisasmType type)
// Disassembly
// Up to this point the field sizes are fixed, until we get to
// variable length labels, cycle counts, etc
- myDisasmBuf.seekg(11, ios::beg);
+ myDisasmBuf.seekg(11, std::ios::beg);
switch(tag.type)
{
case CartDebug::CODE:
diff --git a/src/debugger/DiStella.hxx b/src/debugger/DiStella.hxx
index de5210a..b4b15d0 100644
--- a/src/debugger/DiStella.hxx
+++ b/src/debugger/DiStella.hxx
@@ -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.hxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: DiStella.hxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#ifndef DISTELLA_HXX
@@ -115,7 +115,7 @@ class DiStella
const Settings& mySettings;
CartDebug::ReservedEquates& myReserved;
stringstream myDisasmBuf;
- queue<uInt16> myAddressQueue;
+ std::queue<uInt16> myAddressQueue;
uInt16 myOffset, myPC, myPCEnd;
struct resource {
diff --git a/src/debugger/PackedBitArray.hxx b/src/debugger/PackedBitArray.hxx
index 1d79fad..a640896 100644
--- a/src/debugger/PackedBitArray.hxx
+++ b/src/debugger/PackedBitArray.hxx
@@ -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: PackedBitArray.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: PackedBitArray.hxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#ifndef PACKED_BIT_ARRAY_HXX
@@ -43,7 +43,7 @@ class PackedBitArray
private:
// The actual bits
- bitset<0x10000> myBits;
+ std::bitset<0x10000> myBits;
// Indicates whether we should treat this bitset as initialized
bool myInitialized;
diff --git a/src/debugger/TIADebug.cxx b/src/debugger/TIADebug.cxx
index 8f6bb1d..af2742d 100644
--- a/src/debugger/TIADebug.cxx
+++ b/src/debugger/TIADebug.cxx
@@ -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: TIADebug.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: TIADebug.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "Base.hxx"
@@ -706,7 +706,7 @@ string TIADebug::audFreq(uInt8 div)
double hz = 30000.0;
if(div) hz /= div;
- BSPF_snprintf(buf, 9, "%5.1f", hz);
+ std::snprintf(buf, 9, "%5.1f", hz);
ret += buf;
ret += "Hz";
@@ -752,7 +752,7 @@ string TIADebug::toString()
const TiaState& state = static_cast<const TiaState&>(getState());
// build up output, then return it.
- buf << "scanline " << dec << myTIA.scanlines() << " "
+ buf << "scanline " << std::dec << myTIA.scanlines() << " "
<< booleanWithLabel("vsync", vsync()) << " "
<< booleanWithLabel("vblank", vblank())
<< endl
@@ -775,35 +775,35 @@ string TIADebug::toString()
<< colorSwatch(state.coluRegs[3])
<< endl
<< "P0: GR=%" << Common::Base::toString(state.gr[P0], Common::Base::F_2_8)
- << " pos=#" << dec << state.pos[P0]
+ << " pos=#" << std::dec << state.pos[P0]
<< " HM=$" << Common::Base::HEX2 << state.hm[P0] << " "
<< nusizP0String() << " "
<< booleanWithLabel("refl", refP0()) << " "
<< booleanWithLabel("delay", vdelP0())
<< endl
<< "P1: GR=%" << Common::Base::toString(state.gr[P1], Common::Base::F_2_8)
- << " pos=#" << dec << state.pos[P1]
+ << " pos=#" << std::dec << state.pos[P1]
<< " HM=$" << Common::Base::HEX2 << state.hm[P1] << " "
<< nusizP1String() << " "
<< booleanWithLabel("refl", refP1()) << " "
<< booleanWithLabel("delay", vdelP1())
<< endl
<< "M0: " << (myTIA.myENAM0 ? " ENABLED" : "disabled")
- << " pos=#" << dec << state.pos[M0]
+ << " pos=#" << std::dec << state.pos[M0]
<< " HM=$" << Common::Base::HEX2 << state.hm[M0]
- << " size=" << dec << state.size[M0] << " "
+ << " size=" << std::dec << state.size[M0] << " "
<< booleanWithLabel("reset", resMP0())
<< endl
<< "M1: " << (myTIA.myENAM1 ? " ENABLED" : "disabled")
- << " pos=#" << dec << state.pos[M1]
+ << " pos=#" << std::dec << state.pos[M1]
<< " HM=$" << Common::Base::HEX2 << state.hm[M1]
- << " size=" << dec << state.size[M1] << " "
+ << " size=" << std::dec << state.size[M1] << " "
<< booleanWithLabel("reset", resMP0())
<< endl
<< "BL: " << (myTIA.myENABL ? " ENABLED" : "disabled")
- << " pos=#" << dec << state.pos[BL]
+ << " pos=#" << std::dec << state.pos[BL]
<< " HM=$" << Common::Base::HEX2 << state.hm[BL]
- << " size=" << dec << state.size[BL] << " "
+ << " size=" << std::dec << state.size[BL] << " "
<< booleanWithLabel("delay", vdelBL())
<< endl
<< "PF0: %" << Common::Base::toString(state.pf[0], Common::Base::F_2_8) << "/$"
diff --git a/src/debugger/gui/Cart0840Widget.cxx b/src/debugger/gui/Cart0840Widget.cxx
index bae5a77..bad54c6 100644
--- a/src/debugger/gui/Cart0840Widget.cxx
+++ b/src/debugger/gui/Cart0840Widget.cxx
@@ -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: Cart0840Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Cart0840Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "Cart0840.hxx"
@@ -85,7 +85,7 @@ string Cartridge0840Widget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$800", "$840" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartDASHWidget.cxx b/src/debugger/gui/Cart3EPlusWidget.cxx
similarity index 73%
copy from src/debugger/gui/CartDASHWidget.cxx
copy to src/debugger/gui/Cart3EPlusWidget.cxx
index 4854ccd..256efa4 100644
--- a/src/debugger/gui/CartDASHWidget.cxx
+++ b/src/debugger/gui/Cart3EPlusWidget.cxx
@@ -14,29 +14,29 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDASHWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Cart3EPlusWidget.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include "CartDASH.hxx"
+#include "Cart3EPlus.hxx"
#include "PopUpWidget.hxx"
-#include "CartDASHWidget.hxx"
+#include "Cart3EPlusWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-CartridgeDASHWidget::CartridgeDASHWidget(
+Cartridge3EPlusWidget::Cartridge3EPlusWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
- int x, int y, int w, int h, CartridgeDASH& cart)
+ int x, int y, int w, int h, Cartridge3EPlus& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
{
uInt32 size = cart.mySize;
ostringstream info;
- info << "DASH cartridge - (64K ROM + RAM)\n"
+ info << "3EPlus 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"
+ " Lower 512B of bank x (R)\n"
+ " Upper 512B of bank x (+$200) (W)\n"
<< "Startup bank = 0/-1/-1/0 (ROM)\n";
// Eventually, we should query this from the debugger/disassembler
@@ -45,7 +45,7 @@ CartridgeDASHWidget::CartridgeDASHWidget(
info << "Bank RORG" << " = $" << Common::Base::HEX4 << start << "\n";
int xpos = 10,
- ypos = addBaseInformation(size, "A. Davie & T. Jentzsch", info.str()) +
+ ypos = addBaseInformation(size, "T. Jentzsch", info.str()) +
myLineHeight;
VariantList bankno;
@@ -119,7 +119,7 @@ CartridgeDASHWidget::CartridgeDASHWidget(
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASHWidget::saveOldState()
+void Cartridge3EPlusWidget::saveOldState()
{
myOldState.internalram.clear();
@@ -128,14 +128,14 @@ void CartridgeDASHWidget::saveOldState()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASHWidget::loadConfig()
+void Cartridge3EPlusWidget::loadConfig()
{
updateUIState();
CartDebugWidget::loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASHWidget::handleCommand(CommandSender* sender,
+void Cartridge3EPlusWidget::handleCommand(CommandSender* sender,
int cmd, int data, int id)
{
uInt16 segment = 0;
@@ -176,15 +176,15 @@ void CartridgeDASHWidget::handleCommand(CommandSender* sender,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-string CartridgeDASHWidget::bankState()
+string Cartridge3EPlusWidget::bankState()
{
ostringstream& buf = buffer();
- int lastROMBank = -1;
- bool lastSlotRAM = false;
- for(int i = 0; i < 8; ++i)
+ // In this scheme, consecutive 512b segments are either both ROM or both RAM;
+ // we only need to look at the lower segment to determine what the 1K bank is
+ for(int i = 0; i < 4; ++i)
{
- uInt16 bank = myCart.bankInUse[i];
+ uInt16 bank = myCart.bankInUse[i*2];
if(bank == myCart.BANK_UNDEFINED) // never accessed
{
@@ -194,46 +194,12 @@ string CartridgeDASHWidget::bankState()
{
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;
- }
- }
+ if(bank & myCart.BITMASK_ROMRAM) // was RAM mapped here?
+ buf << " RAM " << bankno;
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;
- }
+ buf << " ROM " << bankno;
}
-
- if((i+1) % 2 == 0 && i < 7)
+ if(i < 3)
buf << " /";
}
@@ -241,29 +207,10 @@ string CartridgeDASHWidget::bankState()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASHWidget::updateUIState()
+void Cartridge3EPlusWidget::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
+ // Set description for each 512b bank state (@ each index)
+ // Set contents for actual banks number and type (@ each even index)
for(int i = 0; i < 8; ++i)
{
uInt16 bank = myCart.bankInUse[i];
@@ -271,6 +218,11 @@ void CartridgeDASHWidget::updateUIState()
if(bank == myCart.BANK_UNDEFINED) // never accessed
{
myBankState[i]->setText("Undefined");
+ if(i % 2 == 0)
+ {
+ myBankNumber[i/2]->clearSelection();
+ myBankType[i/2]->clearSelection();
+ }
}
else
{
@@ -291,6 +243,12 @@ void CartridgeDASHWidget::updateUIState()
<< (bankno << myCart.RAM_BANK_TO_POWER) << " (R)";
myBankState[i]->setText(buf.str());
}
+
+ if(i % 2 == 0)
+ {
+ myBankNumber[i/2]->setSelected(bankno);
+ myBankType[i/2]->setSelected("RAM");
+ }
}
else
{
@@ -306,36 +264,42 @@ void CartridgeDASHWidget::updateUIState()
<< (bankno << myCart.RAM_BANK_TO_POWER);
myBankState[i]->setText(buf.str());
}
+
+ if(i % 2 == 0)
+ {
+ myBankNumber[i/2]->setSelected(bankno);
+ myBankType[i/2]->setSelected("ROM");
+ }
}
}
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-uInt32 CartridgeDASHWidget::internalRamSize()
+uInt32 Cartridge3EPlusWidget::internalRamSize()
{
return 32*1024;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-uInt32 CartridgeDASHWidget::internalRamRPort(int start)
+uInt32 Cartridge3EPlusWidget::internalRamRPort(int start)
{
return 0x0000 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-string CartridgeDASHWidget::internalRamDescription()
+string Cartridge3EPlusWidget::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)";
+ << " $F000/$F400/$F800/etc used for Read Access\n"
+ << " $F200/$F600/$FA00/etc used for Write Access (+$200)";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const ByteArray& CartridgeDASHWidget::internalRamOld(int start, int count)
+const ByteArray& Cartridge3EPlusWidget::internalRamOld(int start, int count)
{
myRamOld.clear();
for(int i = 0; i < count; i++)
@@ -344,7 +308,7 @@ const ByteArray& CartridgeDASHWidget::internalRamOld(int start, int count)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const ByteArray& CartridgeDASHWidget::internalRamCurrent(int start, int count)
+const ByteArray& Cartridge3EPlusWidget::internalRamCurrent(int start, int count)
{
myRamCurrent.clear();
for(int i = 0; i < count; i++)
@@ -353,18 +317,18 @@ const ByteArray& CartridgeDASHWidget::internalRamCurrent(int start, int count)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASHWidget::internalRamSetValue(int addr, uInt8 value)
+void Cartridge3EPlusWidget::internalRamSetValue(int addr, uInt8 value)
{
myCart.myRAM[addr] = value;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-uInt8 CartridgeDASHWidget::internalRamGetValue(int addr)
+uInt8 Cartridge3EPlusWidget::internalRamGetValue(int addr)
{
return myCart.myRAM[addr];
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const CartridgeDASHWidget::BankID CartridgeDASHWidget::bankEnum[4] = {
+const Cartridge3EPlusWidget::BankID Cartridge3EPlusWidget::bankEnum[4] = {
kBank0Changed, kBank1Changed, kBank2Changed, kBank3Changed
};
diff --git a/src/debugger/gui/CartDASHWidget.hxx b/src/debugger/gui/Cart3EPlusWidget.hxx
similarity index 71%
copy from src/debugger/gui/CartDASHWidget.hxx
copy to src/debugger/gui/Cart3EPlusWidget.hxx
index e6837dd..7572c08 100644
--- a/src/debugger/gui/CartDASHWidget.hxx
+++ b/src/debugger/gui/Cart3EPlusWidget.hxx
@@ -14,32 +14,32 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDASHWidget.hxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: Cart3EPlusWidget.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
-#ifndef CARTRIDGEDASH_WIDGET_HXX
-#define CARTRIDGEDASH_WIDGET_HXX
+#ifndef CARTRIDGE3EPLUS_WIDGET_HXX
+#define CARTRIDGE3EPLUS_WIDGET_HXX
-class CartridgeDASH;
+class Cartridge3EPlus;
class ButtonWidget;
class PopUpWidget;
#include "CartDebugWidget.hxx"
-class CartridgeDASHWidget : public CartDebugWidget
+class Cartridge3EPlusWidget : 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() = default;
+ Cartridge3EPlusWidget(GuiObject* boss, const GUI::Font& lfont,
+ const GUI::Font& nfont,
+ int x, int y, int w, int h,
+ Cartridge3EPlus& cart);
+ virtual ~Cartridge3EPlusWidget() = default;
private:
void updateUIState();
private:
- CartridgeDASH& myCart;
+ Cartridge3EPlus& myCart;
PopUpWidget* myBankNumber[4];
PopUpWidget* myBankType[4];
@@ -77,11 +77,11 @@ class CartridgeDASHWidget : public CartDebugWidget
// end of functions for Cartridge RAM tab
// Following constructors and assignment operators not supported
- CartridgeDASHWidget() = delete;
- CartridgeDASHWidget(const CartridgeDASHWidget&) = delete;
- CartridgeDASHWidget(CartridgeDASHWidget&&) = delete;
- CartridgeDASHWidget& operator=(const CartridgeDASHWidget&) = delete;
- CartridgeDASHWidget& operator=(CartridgeDASHWidget&&) = delete;
+ Cartridge3EPlusWidget() = delete;
+ Cartridge3EPlusWidget(const Cartridge3EPlusWidget&) = delete;
+ Cartridge3EPlusWidget(Cartridge3EPlusWidget&&) = delete;
+ Cartridge3EPlusWidget& operator=(const Cartridge3EPlusWidget&) = delete;
+ Cartridge3EPlusWidget& operator=(Cartridge3EPlusWidget&&) = delete;
};
#endif
diff --git a/src/debugger/gui/Cart3EWidget.cxx b/src/debugger/gui/Cart3EWidget.cxx
index ec321a1..6688613 100644
--- a/src/debugger/gui/Cart3EWidget.cxx
+++ b/src/debugger/gui/Cart3EWidget.cxx
@@ -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: Cart3EWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Cart3EWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "Cart3E.hxx"
@@ -162,7 +162,7 @@ string Cartridge3EWidget::bankState()
uInt16& bank = myCart.myCurrentBank;
if(bank < 256)
- buf << "ROM bank " << dec << bank % myNumRomBanks << ", RAM inactive";
+ buf << "ROM bank " << std::dec << bank % myNumRomBanks << ", RAM inactive";
else
buf << "ROM inactive, RAM bank " << bank % myNumRomBanks;
diff --git a/src/debugger/gui/Cart3FWidget.cxx b/src/debugger/gui/Cart3FWidget.cxx
index e5f68ee..8694e22 100644
--- a/src/debugger/gui/Cart3FWidget.cxx
+++ b/src/debugger/gui/Cart3FWidget.cxx
@@ -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: Cart3FWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Cart3FWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "Cart3F.hxx"
@@ -85,7 +85,7 @@ string Cartridge3FWidget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $3F";
+ buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $3F";
return buf.str();
}
diff --git a/src/debugger/gui/Cart4A50Widget.cxx b/src/debugger/gui/Cart4A50Widget.cxx
index 92c550e..da92cb2 100644
--- a/src/debugger/gui/Cart4A50Widget.cxx
+++ b/src/debugger/gui/Cart4A50Widget.cxx
@@ -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: Cart4A50Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Cart4A50Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "Cart4A50.hxx"
@@ -269,7 +269,7 @@ string Cartridge4A50Widget::bankState()
{
ostringstream& buf = buffer();
- buf << "L/M/H = " << dec;
+ buf << "L/M/H = " << std::dec;
if(myCart.myIsRomLow)
buf << "ROM bank " << ((myCart.mySliceLow >> 11) & 0x1F) << " / ";
else
diff --git a/src/debugger/gui/CartARWidget.cxx b/src/debugger/gui/CartARWidget.cxx
index 3077402..a8ed890 100644
--- a/src/debugger/gui/CartARWidget.cxx
+++ b/src/debugger/gui/CartARWidget.cxx
@@ -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: CartARWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartARWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartAR.hxx"
@@ -104,7 +104,7 @@ string CartridgeARWidget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank;
+ buf << "Bank = " << std::dec << myCart.myCurrentBank;
return buf.str();
}
diff --git a/src/debugger/gui/CartBFSCWidget.cxx b/src/debugger/gui/CartBFSCWidget.cxx
index 60289e8..aff04b1 100644
--- a/src/debugger/gui/CartBFSCWidget.cxx
+++ b/src/debugger/gui/CartBFSCWidget.cxx
@@ -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: CartBFSCWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartBFSCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartBFSC.hxx"
@@ -41,7 +41,7 @@ CartridgeBFSCWidget::CartridgeBFSCWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100)
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100)
<< " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
@@ -169,7 +169,7 @@ string CartridgeBFSCWidget::bankState()
"$FB0", "$FB1", "$FB2", "$FB3", "$FB4", "$FB5", "$FB6", "$FB7",
"$FB8", "$FB9", "$FBA", "$FBB", "$FBC", "$FBD", "$FBE", "$FBF"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartBFWidget.cxx b/src/debugger/gui/CartBFWidget.cxx
index 4521a84..700c333 100644
--- a/src/debugger/gui/CartBFWidget.cxx
+++ b/src/debugger/gui/CartBFWidget.cxx
@@ -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: CartBFWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartBFWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartBF.hxx"
@@ -39,7 +39,7 @@ CartridgeBFWidget::CartridgeBFWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - "
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
@@ -156,7 +156,7 @@ string CartridgeBFWidget::bankState()
"$FB0", "$FB1", "$FB2", "$FB3", "$FB4", "$FB5", "$FB6", "$FB7",
"$FB8", "$FB9", "$FBA", "$FBB", "$FBC", "$FBD", "$FBE", "$FBF"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartCMWidget.cxx b/src/debugger/gui/CartCMWidget.cxx
index e650c8e..58a6e33 100644
--- a/src/debugger/gui/CartCMWidget.cxx
+++ b/src/debugger/gui/CartCMWidget.cxx
@@ -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: CartCMWidget.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartCMWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartCM.hxx"
@@ -221,7 +221,7 @@ string CartridgeCMWidget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", RAM is" << (myCart.mySWCHA & 0x10 ? " Inactive" :
myCart.mySWCHA & 0x20 ? " Read-only" : " Write-only");
diff --git a/src/debugger/gui/CartCTYWidget.cxx b/src/debugger/gui/CartCTYWidget.cxx
index 3e0c5bf..b179f10 100644
--- a/src/debugger/gui/CartCTYWidget.cxx
+++ b/src/debugger/gui/CartCTYWidget.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartCTYWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartCTY.hxx"
@@ -96,7 +96,7 @@ string CartridgeCTYWidget::bankState()
"", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
uInt16 bank = myCart.getBank();
- buf << "Bank = " << dec << bank << ", hotspot = " << spot[bank];
+ buf << "Bank = " << std::dec << bank << ", hotspot = " << spot[bank];
return buf.str();
}
diff --git a/src/debugger/gui/CartCVPlusWidget.cxx b/src/debugger/gui/CartCVPlusWidget.cxx
index 6ee535b..30177ba 100644
--- a/src/debugger/gui/CartCVPlusWidget.cxx
+++ b/src/debugger/gui/CartCVPlusWidget.cxx
@@ -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: CartCVPlusWidget.cxx 3253 2016-01-23 17:58:00Z stephena $
+// $Id: CartCVPlusWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartCVPlus.hxx"
@@ -81,7 +81,7 @@ string CartridgeCVPlusWidget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $3D";
+ buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $3D";
return buf.str();
}
diff --git a/src/debugger/gui/CartDASHWidget.cxx b/src/debugger/gui/CartDASHWidget.cxx
index 4854ccd..75548bb 100644
--- a/src/debugger/gui/CartDASHWidget.cxx
+++ b/src/debugger/gui/CartDASHWidget.cxx
@@ -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: CartDASHWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartDASHWidget.cxx 3300 2016-04-02 21:27:10Z stephena $
//============================================================================
#include "CartDASH.hxx"
diff --git a/src/debugger/gui/CartDASHWidget.hxx b/src/debugger/gui/CartDASHWidget.hxx
index e6837dd..eef780e 100644
--- a/src/debugger/gui/CartDASHWidget.hxx
+++ b/src/debugger/gui/CartDASHWidget.hxx
@@ -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: CartDASHWidget.hxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: CartDASHWidget.hxx 3300 2016-04-02 21:27:10Z stephena $
//============================================================================
#ifndef CARTRIDGEDASH_WIDGET_HXX
diff --git a/src/debugger/gui/CartDFSCWidget.cxx b/src/debugger/gui/CartDFSCWidget.cxx
index 444a8f9..9b85abc 100644
--- a/src/debugger/gui/CartDFSCWidget.cxx
+++ b/src/debugger/gui/CartDFSCWidget.cxx
@@ -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: CartDFSCWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartDFSCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartDFSC.hxx"
@@ -41,7 +41,7 @@ CartridgeDFSCWidget::CartridgeDFSCWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100)
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100)
<< " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
@@ -133,7 +133,7 @@ string CartridgeDFSCWidget::bankState()
"$FD0", "$FD1", "$FD2", "$FD3", "$FD4", "$FD5", "$FD6", "$FE7",
"$FD8", "$FD9", "$FDA", "$FDB", "$FDC", "$FDD", "$FDE", "$FDF"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartDFWidget.cxx b/src/debugger/gui/CartDFWidget.cxx
index d3c36c0..58e5eb0 100644
--- a/src/debugger/gui/CartDFWidget.cxx
+++ b/src/debugger/gui/CartDFWidget.cxx
@@ -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: CartDFWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartDFWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartDF.hxx"
@@ -39,7 +39,7 @@ CartridgeDFWidget::CartridgeDFWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - "
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
@@ -120,7 +120,7 @@ string CartridgeDFWidget::bankState()
"$FD0", "$FD1", "$FD2", "$FD3", "$FD4", "$FD5", "$FD6", "$FD7",
"$FD8", "$FD9", "$FDA", "$FDB", "$FDC", "$FDD", "$FDE", "$FDF"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartDPCPlusWidget.cxx b/src/debugger/gui/CartDPCPlusWidget.cxx
index 1074114..0c12b93 100644
--- a/src/debugger/gui/CartDPCPlusWidget.cxx
+++ b/src/debugger/gui/CartDPCPlusWidget.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartDPCPlusWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartDPCPlus.hxx"
@@ -329,7 +329,7 @@ string CartridgeDPCPlusWidget::bankState()
static const char* spot[] = {
"$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartDPCWidget.cxx b/src/debugger/gui/CartDPCWidget.cxx
index 775badc..52b2df4 100644
--- a/src/debugger/gui/CartDPCWidget.cxx
+++ b/src/debugger/gui/CartDPCWidget.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartDPCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartDPC.hxx"
@@ -230,7 +230,7 @@ string CartridgeDPCWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartE0Widget.cxx b/src/debugger/gui/CartE0Widget.cxx
index 5ea0d6d..d9f7708 100644
--- a/src/debugger/gui/CartE0Widget.cxx
+++ b/src/debugger/gui/CartE0Widget.cxx
@@ -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: CartE0Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartE0Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartE0.hxx"
@@ -135,7 +135,7 @@ string CartridgeE0Widget::bankState()
{
ostringstream& buf = buffer();
- buf << "Slices: " << dec
+ buf << "Slices: " << std::dec
<< seg0[myCart.myCurrentSlice[0]] << " / "
<< seg1[myCart.myCurrentSlice[1]] << " / "
<< seg2[myCart.myCurrentSlice[2]];
diff --git a/src/debugger/gui/CartE7Widget.cxx b/src/debugger/gui/CartE7Widget.cxx
index e1e5942..db72af4 100644
--- a/src/debugger/gui/CartE7Widget.cxx
+++ b/src/debugger/gui/CartE7Widget.cxx
@@ -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: CartE7Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartE7Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartE7.hxx"
@@ -128,7 +128,7 @@ string CartridgeE7Widget::bankState()
{
ostringstream& buf = buffer();
- buf << "Slices: " << dec
+ buf << "Slices: " << std::dec
<< spot_lower[myCart.myCurrentSlice[0]] << " / "
<< spot_upper[myCart.myCurrentRAM];
diff --git a/src/debugger/gui/CartEFSCWidget.cxx b/src/debugger/gui/CartEFSCWidget.cxx
index ad11e9c..5f8efb4 100644
--- a/src/debugger/gui/CartEFSCWidget.cxx
+++ b/src/debugger/gui/CartEFSCWidget.cxx
@@ -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: CartEFSCWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartEFSCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartEFSC.hxx"
@@ -41,7 +41,7 @@ CartridgeEFSCWidget::CartridgeEFSCWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100)
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100)
<< " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
@@ -115,7 +115,7 @@ string CartridgeEFSCWidget::bankState()
"$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7",
"$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartEFWidget.cxx b/src/debugger/gui/CartEFWidget.cxx
index 8211760..0e44c0b 100644
--- a/src/debugger/gui/CartEFWidget.cxx
+++ b/src/debugger/gui/CartEFWidget.cxx
@@ -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: CartEFWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartEFWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartEF.hxx"
@@ -39,7 +39,7 @@ CartridgeEFWidget::CartridgeEFWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - "
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
@@ -102,7 +102,7 @@ string CartridgeEFWidget::bankState()
"$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7",
"$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartF0Widget.cxx b/src/debugger/gui/CartF0Widget.cxx
index 022b6ae..18e9c8d 100644
--- a/src/debugger/gui/CartF0Widget.cxx
+++ b/src/debugger/gui/CartF0Widget.cxx
@@ -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: CartF0Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartF0Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartF0.hxx"
@@ -40,8 +40,8 @@ CartridgeF0Widget::CartridgeF0Widget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - "
- << "$" << (start + 0xFFF) << "\n";
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start
+ << " - " << "$" << (start + 0xFFF) << "\n";
}
int xpos = 10,
@@ -99,7 +99,7 @@ string CartridgeF0Widget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $FF0";
+ buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $FF0";
return buf.str();
}
diff --git a/src/debugger/gui/CartF4SCWidget.cxx b/src/debugger/gui/CartF4SCWidget.cxx
index 0eda9ed..325d50f 100644
--- a/src/debugger/gui/CartF4SCWidget.cxx
+++ b/src/debugger/gui/CartF4SCWidget.cxx
@@ -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: CartF4SCWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartF4SCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartF4SC.hxx"
@@ -105,7 +105,7 @@ string CartridgeF4SCWidget::bankState()
static const char* spot[] = {
"$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartF4Widget.cxx b/src/debugger/gui/CartF4Widget.cxx
index 32e588a..58fa633 100644
--- a/src/debugger/gui/CartF4Widget.cxx
+++ b/src/debugger/gui/CartF4Widget.cxx
@@ -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: CartF4Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartF4Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartF4.hxx"
@@ -92,7 +92,7 @@ string CartridgeF4Widget::bankState()
static const char* spot[] = {
"$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartF6SCWidget.cxx b/src/debugger/gui/CartF6SCWidget.cxx
index 192c685..3f3b601 100644
--- a/src/debugger/gui/CartF6SCWidget.cxx
+++ b/src/debugger/gui/CartF6SCWidget.cxx
@@ -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: CartF6SCWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartF6SCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartF6SC.hxx"
@@ -99,7 +99,7 @@ string CartridgeF6SCWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartF6Widget.cxx b/src/debugger/gui/CartF6Widget.cxx
index ce9c4a8..e6a77ab 100644
--- a/src/debugger/gui/CartF6Widget.cxx
+++ b/src/debugger/gui/CartF6Widget.cxx
@@ -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: CartF6Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartF6Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartF6.hxx"
@@ -86,7 +86,7 @@ string CartridgeF6Widget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartF8SCWidget.cxx b/src/debugger/gui/CartF8SCWidget.cxx
index 8352bb5..79354e9 100644
--- a/src/debugger/gui/CartF8SCWidget.cxx
+++ b/src/debugger/gui/CartF8SCWidget.cxx
@@ -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: CartF8SCWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartF8SCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartF8SC.hxx"
@@ -97,7 +97,7 @@ string CartridgeF8SCWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartF8Widget.cxx b/src/debugger/gui/CartF8Widget.cxx
index fcb459a..80f2eb0 100644
--- a/src/debugger/gui/CartF8Widget.cxx
+++ b/src/debugger/gui/CartF8Widget.cxx
@@ -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: CartF8Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartF8Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartF8.hxx"
@@ -84,7 +84,7 @@ string CartridgeF8Widget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartFA2Widget.cxx b/src/debugger/gui/CartFA2Widget.cxx
index 368adc2..b4ec190 100644
--- a/src/debugger/gui/CartFA2Widget.cxx
+++ b/src/debugger/gui/CartFA2Widget.cxx
@@ -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: CartFA2Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartFA2Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartFA2.hxx"
@@ -151,7 +151,7 @@ string CartridgeFA2Widget::bankState()
static const char* spot[] = {
"$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartFAWidget.cxx b/src/debugger/gui/CartFAWidget.cxx
index 063dd57..59b57ed 100644
--- a/src/debugger/gui/CartFAWidget.cxx
+++ b/src/debugger/gui/CartFAWidget.cxx
@@ -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: CartFAWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartFAWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartFA.hxx"
@@ -98,7 +98,7 @@ string CartridgeFAWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9", "$FFA" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartFEWidget.cxx b/src/debugger/gui/CartFEWidget.cxx
index 32bd92e..6a7672e 100644
--- a/src/debugger/gui/CartFEWidget.cxx
+++ b/src/debugger/gui/CartFEWidget.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartFEWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartFE.hxx"
@@ -46,7 +46,7 @@ string CartridgeFEWidget::bankState()
ostringstream& buf = buffer();
static const char* range[] = { "$F000", "$D000" };
- buf << "Bank = " << dec << myCart.getBank()
+ buf << "Bank = " << std::dec << myCart.getBank()
<< ", address range = " << range[myCart.getBank()];
return buf.str();
diff --git a/src/debugger/gui/CartMCWidget.cxx b/src/debugger/gui/CartMCWidget.cxx
index 8e8d9cc..9705a16 100644
--- a/src/debugger/gui/CartMCWidget.cxx
+++ b/src/debugger/gui/CartMCWidget.cxx
@@ -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: CartMCWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartMCWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartMC.hxx"
@@ -135,7 +135,7 @@ string CartridgeMCWidget::bankState()
{
ostringstream& buf = buffer();
- buf << "Slices: " << dec
+ buf << "Slices: " << std::dec
<< myCart.myCurrentBlock[0] << " / "
<< myCart.myCurrentBlock[1] << " / "
<< myCart.myCurrentBlock[2] << " / "
diff --git a/src/debugger/gui/CartMDMWidget.cxx b/src/debugger/gui/CartMDMWidget.cxx
index e804ef8..54546b5 100644
--- a/src/debugger/gui/CartMDMWidget.cxx
+++ b/src/debugger/gui/CartMDMWidget.cxx
@@ -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: CartMDMWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartMDMWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartMDM.hxx"
@@ -44,7 +44,7 @@ CartridgeMDMWidget::CartridgeMDMWidget(
for(uInt32 i = 0x800; i < (0x800u + myCart.bankCount()); ++i)
{
info.str("");
- info << dec << (i & 0xFF) << " ($" << Common::Base::HEX4 << i << ")";
+ info << std::dec << (i & 0xFF) << " ($" << Common::Base::HEX4 << i << ")";
VarList::push_back(items, info.str());
}
@@ -94,7 +94,7 @@ string CartridgeMDMWidget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << "$" << Common::Base::HEX4
<< (myCart.myCurrentBank+0x800);
diff --git a/src/debugger/gui/CartRamWidget.cxx b/src/debugger/gui/CartRamWidget.cxx
index 687410d..3eff746 100644
--- a/src/debugger/gui/CartRamWidget.cxx
+++ b/src/debugger/gui/CartRamWidget.cxx
@@ -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: CartRamWidget.cxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: CartRamWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "EditTextWidget.hxx"
@@ -111,8 +111,8 @@ CartRamWidget::InternalRamWidget::InternalRamWidget(GuiObject* boss,
int x, int y, int w, int h,
CartDebugWidget& dbg)
: RamWidget(boss, lfont, nfont, x, y, w, h,
- dbg.internalRamSize(), BSPF_min(dbg.internalRamSize() / 16, 16u),
- BSPF_min(dbg.internalRamSize() / 16, 16u) * 16),
+ dbg.internalRamSize(), std::min(dbg.internalRamSize() / 16, 16u),
+ std::min(dbg.internalRamSize() / 16, 16u) * 16),
myCart(dbg)
{
}
diff --git a/src/debugger/gui/CartSBWidget.cxx b/src/debugger/gui/CartSBWidget.cxx
index bfb295b..9ed81eb 100644
--- a/src/debugger/gui/CartSBWidget.cxx
+++ b/src/debugger/gui/CartSBWidget.cxx
@@ -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: CartSBWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartSBWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartSB.hxx"
@@ -36,7 +36,7 @@ CartridgeSBWidget::CartridgeSBWidget(
<< "Hotspots are from $800 to $"
<< Common::Base::HEX2 << (0x800 + myCart.bankCount() - 1) << ", including\n"
<< "mirrors ($900, $A00, $B00, ...)\n"
- << "Startup bank = " << dec << cart.myStartBank << "\n";
+ << "Startup bank = " << std::dec << cart.myStartBank << "\n";
// Eventually, we should query this from the debugger/disassembler
for(uInt32 i = 0, offset = 0xFFC, spot = 0x800; i < myCart.bankCount();
@@ -44,11 +44,11 @@ CartridgeSBWidget::CartridgeSBWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - "
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << spot << ")\n";
- bank << dec << setw(2) << setfill(' ') << i << " ($" << Common::Base::HEX2
- << spot << ")";
+ bank << std::dec << std::setw(2) << std::setfill(' ') << i << " ($"
+ << Common::Base::HEX2 << spot << ")";
VarList::push_back(items, bank.str());
bank.str("");
}
@@ -90,7 +90,7 @@ string CartridgeSBWidget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = $" << Common::Base::HEX2 << (myCart.myCurrentBank + 0x800);
return buf.str();
diff --git a/src/debugger/gui/CartUAWidget.cxx b/src/debugger/gui/CartUAWidget.cxx
index 30f26a1..827ac2f 100644
--- a/src/debugger/gui/CartUAWidget.cxx
+++ b/src/debugger/gui/CartUAWidget.cxx
@@ -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: CartUAWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartUAWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartUA.hxx"
@@ -85,7 +85,7 @@ string CartridgeUAWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$200", "$240" };
- buf << "Bank = " << dec << myCart.myCurrentBank
+ buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
diff --git a/src/debugger/gui/CartWDWidget.cxx b/src/debugger/gui/CartWDWidget.cxx
index 1773525..15fba1a 100644
--- a/src/debugger/gui/CartWDWidget.cxx
+++ b/src/debugger/gui/CartWDWidget.cxx
@@ -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: CartWDWidget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartWDWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartWD.hxx"
@@ -107,7 +107,7 @@ string CartridgeWDWidget::bankState()
"[0,0,6,7*]", "[0,1,7,6*]", "[3,2,4,5*]", "[6,0,5,1*]"
};
uInt16 bank = myCart.getBank();
- buf << "Bank = " << dec << bank << ", segments = " << segments[bank];
+ buf << "Bank = " << std::dec << bank << ", segments = " << segments[bank];
return buf.str();
}
diff --git a/src/debugger/gui/CartX07Widget.cxx b/src/debugger/gui/CartX07Widget.cxx
index ef1c704..2bfc711 100644
--- a/src/debugger/gui/CartX07Widget.cxx
+++ b/src/debugger/gui/CartX07Widget.cxx
@@ -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: CartX07Widget.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartX07Widget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include "CartX07.hxx"
@@ -41,7 +41,7 @@ CartridgeX07Widget::CartridgeX07Widget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
- info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start
+ info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start
<< " - " << "$" << (start + 0xFFF) << "\n";
}
@@ -100,7 +100,7 @@ string CartridgeX07Widget::bankState()
{
ostringstream& buf = buffer();
- buf << "Bank = " << dec << myCart.myCurrentBank;
+ buf << "Bank = " << std::dec << myCart.myCurrentBank;
return buf.str();
}
diff --git a/src/debugger/gui/DataGridWidget.cxx b/src/debugger/gui/DataGridWidget.cxx
index 5cf80dd..6c3efaf 100644
--- a/src/debugger/gui/DataGridWidget.cxx
+++ b/src/debugger/gui/DataGridWidget.cxx
@@ -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 3242 2015-12-29 22:39:08Z stephena $
+// $Id: DataGridWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "OSystem.hxx"
@@ -238,8 +238,8 @@ void DataGridWidget::setValue(int position, int value, bool changed,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DataGridWidget::setRange(int lower, int upper)
{
- _lowerBound = BSPF_max(0, lower);
- _upperBound = BSPF_min(1 << _bits, upper);
+ _lowerBound = std::max(0, lower);
+ _upperBound = std::min(1 << _bits, upper);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx
index c332f3e..77657c4 100644
--- a/src/debugger/gui/DebuggerDialog.cxx
+++ b/src/debugger/gui/DebuggerDialog.cxx
@@ -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 3295 2016-03-07 15:36:09Z stephena $
+// $Id: DebuggerDialog.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "Widget.hxx"
@@ -453,7 +453,7 @@ void DebuggerDialog::addRomArea()
GUI::Rect DebuggerDialog::getTiaBounds() const
{
// The area showing the TIA image (NTSC and PAL supported, up to 260 lines)
- GUI::Rect r(0, 0, 320, BSPF_max(260, int(_h * 0.35)));
+ GUI::Rect r(0, 0, 320, std::max(260, int(_h * 0.35)));
return r;
}
diff --git a/src/debugger/gui/NullControlWidget.hxx b/src/debugger/gui/NullControlWidget.hxx
index c79792e..a40ac26 100644
--- a/src/debugger/gui/NullControlWidget.hxx
+++ b/src/debugger/gui/NullControlWidget.hxx
@@ -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: NullControlWidget.hxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: NullControlWidget.hxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#ifndef NULLCONTROL_WIDGET_HXX
@@ -37,7 +37,7 @@ class NullControlWidget : public ControllerWidget
<< controller.name() << "):";
const int fontHeight = font.getFontHeight(),
lineHeight = font.getLineHeight(),
- lwidth = BSPF_max(font.getStringWidth(buf.str()),
+ lwidth = std::max(font.getStringWidth(buf.str()),
font.getStringWidth("Controller input"));
new StaticTextWidget(boss, font, x, y+2, lwidth,
fontHeight, buf.str(), kTextAlignLeft);
diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx
index 0aeac3e..a1c6aef 100644
--- a/src/debugger/gui/PromptWidget.cxx
+++ b/src/debugger/gui/PromptWidget.cxx
@@ -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: PromptWidget.cxx 3295 2016-03-07 15:36:09Z stephena $
+// $Id: PromptWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include <iostream>
@@ -752,7 +752,7 @@ void PromptWidget::nextLine()
// Call this (at least) when the current line changes or when a new line is added
void PromptWidget::updateScrollBuffer()
{
- int lastchar = BSPF_max(_promptEndPos, _currentPos);
+ int lastchar = std::max(_promptEndPos, _currentPos);
int line = lastchar / _lineWidth;
int numlines = (line < _linesInBuffer) ? line + 1 : _linesInBuffer;
int firstline = line - numlines + 1;
@@ -787,7 +787,7 @@ int PromptWidget::printf(const char* format, ...)
int PromptWidget::vprintf(const char* format, va_list argptr)
{
char buf[2048]; // Note: generates warnings about 'nonliteral' format
- int count = BSPF_vsnprintf(buf, sizeof(buf), format, argptr);
+ int count = std::vsnprintf(buf, sizeof(buf), format, argptr);
print(buf);
return count;
@@ -908,7 +908,7 @@ string PromptWidget::getCompletionPrefix(const StringList& completions, string p
{
if(s.length() < prefix.length())
return prefix; // current prefix is the best we're going to get
- else if(!BSPF_startsWithIgnoreCase(s, prefix))
+ else if(!BSPF::startsWithIgnoreCase(s, prefix))
{
prefix.erase(prefix.length()-1);
return prefix;
diff --git a/src/debugger/gui/RamWidget.cxx b/src/debugger/gui/RamWidget.cxx
index d580aa6..4271cfd 100644
--- a/src/debugger/gui/RamWidget.cxx
+++ b/src/debugger/gui/RamWidget.cxx
@@ -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: RamWidget.cxx 3244 2015-12-30 19:07:11Z stephena $
+// $Id: RamWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "DataGridWidget.hxx"
@@ -305,7 +305,7 @@ void RamWidget::fillGrid(bool updateOld)
// Update RAM labels
uInt32 rport = readPort(start), page = rport & 0xf0;
char buf[5];
- BSPF_snprintf(buf, 5, "%04X", rport);
+ std::snprintf(buf, 5, "%04X", rport);
buf[2] = buf[3] = 'x';
myRamStart->setLabel(buf);
for(uInt32 row = 0; row < myNumRows; ++row, page += 0x10)
diff --git a/src/debugger/gui/RiotWidget.cxx b/src/debugger/gui/RiotWidget.cxx
index 61f9004..b125d4f 100644
--- a/src/debugger/gui/RiotWidget.cxx
+++ b/src/debugger/gui/RiotWidget.cxx
@@ -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: RiotWidget.cxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: RiotWidget.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "Settings.hxx"
@@ -344,7 +344,7 @@ void RiotWidget::loadConfig()
const string& cpurandom = instance().settings().getString("cpurandom");
const char* cpuregs[] = { "S", "A", "X", "Y", "P" };
for(int i = 0; i < 5; ++i)
- myRandomizeCPU[i]->setState(BSPF_containsIgnoreCase(cpurandom, cpuregs[i]));
+ myRandomizeCPU[i]->setState(BSPF::containsIgnoreCase(cpurandom, cpuregs[i]));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx
index a5e407f..ccdc4e6 100644
--- a/src/debugger/gui/RomListWidget.cxx
+++ b/src/debugger/gui/RomListWidget.cxx
@@ -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 3242 2015-12-29 22:39:08Z stephena $
+// $Id: RomListWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "bspf.hxx"
@@ -66,7 +66,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
const int fontWidth = lfont.getMaxCharWidth(),
numchars = w / fontWidth;
- _labelWidth = BSPF_max(16, int(0.20 * (numchars - 12))) * fontWidth - 1;
+ _labelWidth = std::max(16, int(0.20 * (numchars - 12))) * fontWidth - 1;
_bytesWidth = 12 * fontWidth;
//////////////////////////////////////////////////////
@@ -75,7 +75,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
// rowheight is determined by largest item on a line,
// possibly meaning that number of rows will change
- _fontHeight = BSPF_max(_fontHeight, CheckboxWidget::boxSize());
+ _fontHeight = std::max(_fontHeight, CheckboxWidget::boxSize());
_rows = h / _fontHeight;
// Create a CheckboxWidget for each row in the list
diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx
index 7542e10..56c06a7 100644
--- a/src/debugger/gui/TiaOutputWidget.cxx
+++ b/src/debugger/gui/TiaOutputWidget.cxx
@@ -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: TiaOutputWidget.cxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: TiaOutputWidget.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <sstream>
@@ -65,7 +65,7 @@ void TiaOutputWidget::saveSnapshot()
ostringstream sspath;
sspath << instance().snapshotSaveDir()
<< instance().console().properties().get(Cartridge_Name)
- << "_dbg_" << hex << setw(8) << setfill('0') << number << ".png";
+ << "_dbg_" << std::hex << std::setw(8) << std::setfill('0') << number << ".png";
const uInt32 width = instance().console().tia().width(),
height = instance().console().tia().height();
diff --git a/src/debugger/gui/TiaZoomWidget.cxx b/src/debugger/gui/TiaZoomWidget.cxx
index 578a41e..5f05b5b 100644
--- a/src/debugger/gui/TiaZoomWidget.cxx
+++ b/src/debugger/gui/TiaZoomWidget.cxx
@@ -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: TiaZoomWidget.cxx 3242 2015-12-29 22:39:08Z stephena $
+// $Id: TiaZoomWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "OSystem.hxx"
@@ -38,8 +38,8 @@ TiaZoomWidget::TiaZoomWidget(GuiObject* boss, const GUI::Font& font,
_bgcolor = _bgcolorhi = kDlgColor;
// Use all available space, up to the maximum bounds of the TIA image
- _w = BSPF_min(w, 320);
- _h = BSPF_min(h, 260);
+ _w = std::min(w, 320);
+ _h = std::min(h, 260);
addFocusWidget(this);
@@ -96,8 +96,8 @@ void TiaZoomWidget::recalc()
th = instance().console().tia().height();
// Don't go past end of framebuffer
- myXOff = BSPF_clamp(myXOff, 0, tw - myNumCols);
- myYOff = BSPF_clamp(myYOff, 0, th - myNumRows);
+ myXOff = BSPF::clamp(myXOff, 0, tw - myNumCols);
+ myYOff = BSPF::clamp(myYOff, 0, th - myNumRows);
setDirty();
}
diff --git a/src/debugger/gui/module.mk b/src/debugger/gui/module.mk
index 2f7038c..ad2fd57 100644
--- a/src/debugger/gui/module.mk
+++ b/src/debugger/gui/module.mk
@@ -25,6 +25,7 @@ MODULE_OBJS := \
src/debugger/gui/Cart0840Widget.o \
src/debugger/gui/Cart2KWidget.o \
src/debugger/gui/Cart3EWidget.o \
+ src/debugger/gui/Cart3EPlusWidget.o \
src/debugger/gui/Cart3FWidget.o \
src/debugger/gui/Cart4A50Widget.o \
src/debugger/gui/Cart4KWidget.o \
diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx
index 38caf8b..4082158 100644
--- a/src/emucore/Cart.cxx
+++ b/src/emucore/Cart.cxx
@@ -14,17 +14,15 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart.cxx 3294 2016-03-05 18:35:25Z stephena $
+// $Id: Cart.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-#include <sstream>
-
#include "bspf.hxx"
#include "Cart.hxx"
#include "Cart0840.hxx"
#include "Cart2K.hxx"
#include "Cart3E.hxx"
+#include "Cart3EPlus.hxx"
#include "Cart3F.hxx"
#include "Cart4A50.hxx"
#include "Cart4K.hxx"
@@ -190,6 +188,8 @@ unique_ptr<Cartridge> Cartridge::create(const BytePtr& img, uInt32 size,
cartridge = make_ptr<Cartridge2K>(image, size, settings);
else if(type == "3E")
cartridge = make_ptr<Cartridge3E>(image, size, settings);
+ else if(type == "3E+")
+ cartridge = make_ptr<Cartridge3EPlus>(image, size, settings);
else if(type == "3F")
cartridge = make_ptr<Cartridge3F>(image, size, settings);
else if(type == "4A50")
@@ -362,6 +362,16 @@ void Cartridge::createCodeAccessBase(uInt32 size)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void Cartridge::initializeRAM(uInt8* arr, uInt32 size, uInt8 val) const
+{
+ if(mySettings.getBool("ramrandom"))
+ for(uInt32 i = 0; i < size; ++i)
+ arr[i] = mySystem->randGenerator().next();
+ else
+ memset(arr, val, size);
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Cartridge::autodetectType(const uInt8* image, uInt32 size)
{
// Guess type based on size
@@ -527,6 +537,8 @@ string Cartridge::autodetectType(const uInt8* image, uInt32 size)
// Variable sized ROM formats are independent of image size and come last
if(isProbablyDASH(image, size))
type = "DASH";
+ else if(isProbably3EPlus(image, size))
+ type = "3E+";
else if(isProbablyMDM(image, size))
type = "MDM";
@@ -648,6 +660,14 @@ bool Cartridge::isProbably3E(const uInt8* image, uInt32 size)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+bool Cartridge::isProbably3EPlus(const uInt8* image, uInt32 size)
+{
+ // 3E+ cart is identified key 'TJ3E' in the ROM
+ uInt8 signature[] = { 'T', 'J', '3', 'E' };
+ return searchForBytes(image, size, signature, 4, 1);
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Cartridge::isProbably3F(const uInt8* image, uInt32 size)
{
// 3F cart bankswitching is triggered by storing the bank number
@@ -974,6 +994,7 @@ Cartridge::BankswitchType Cartridge::ourBSList[ourNumBSTypes] = {
{ "128IN1", "128IN1 Multicart (256/512K)" },
{ "2K", "2K (64-2048 bytes Atari)" },
{ "3E", "3E (32K Tigervision)" },
+ { "3E+", "3E+ (TJ modified DASH)" },
{ "3F", "3F (512K Tigervision)" },
{ "4A50", "4A50 (64K 4A50 + ram)" },
{ "4K", "4K (4K Atari)" },
diff --git a/src/emucore/Cart.hxx b/src/emucore/Cart.hxx
index a9357f0..869b629 100644
--- a/src/emucore/Cart.hxx
+++ b/src/emucore/Cart.hxx
@@ -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 3294 2016-03-05 18:35:25Z stephena $
+// $Id: Cart.hxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
#ifndef CARTRIDGE_HXX
@@ -41,7 +41,7 @@ class GuiObject;
0x1000-0x2000 area (or its mirrors).
@author Bradford W. Mott
- @version $Id: Cart.hxx 3294 2016-03-05 18:35:25Z stephena $
+ @version $Id: Cart.hxx 3316 2016-08-24 23:57:07Z stephena $
*/
class Cartridge : public Device
{
@@ -76,7 +76,7 @@ class Cartridge : public Device
/**
Query some information about this cartridge.
*/
- static const string& about() { return myAboutString; }
+ static constexpr string& about() { return myAboutString; }
/**
Save the internal (patched) ROM image.
@@ -190,7 +190,7 @@ class Cartridge : public Device
const char* type;
const char* desc;
};
- enum { ourNumBSTypes = 47 };
+ enum { ourNumBSTypes = 48 };
static BankswitchType ourBSList[ourNumBSTypes];
protected:
@@ -210,6 +210,15 @@ class Cartridge : public Device
*/
void createCodeAccessBase(uInt32 size);
+ /**
+ Fill the given RAM array with (possibly random) data.
+
+ @param arr Pointer to the RAM array
+ @param size The size of the RAM array
+ @param val If provided, the value to store in the RAM array
+ */
+ void initializeRAM(uInt8* arr, uInt32 size, uInt8 val = 0) const;
+
private:
/**
Get an image pointer and size for a ROM that is part of a larger,
@@ -277,6 +286,11 @@ class Cartridge : public Device
static bool isProbably3E(const uInt8* image, uInt32 size);
/**
+ Returns true if the image is probably a 3E+ bankswitching cartridge
+ */
+ static bool isProbably3EPlus(const uInt8* image, uInt32 size);
+
+ /**
Returns true if the image is probably a 3F bankswitching cartridge
*/
static bool isProbably3F(const uInt8* image, uInt32 size);
@@ -383,7 +397,7 @@ class Cartridge : public Device
// The array containing information about every byte of ROM indicating
// whether it is used as code.
- unique_ptr<uInt8[]> myCodeAccessBase;
+ BytePtr myCodeAccessBase;
private:
// If myBankLocked is true, ignore attempts at bankswitching. This is used
diff --git a/src/emucore/Cart0840.cxx b/src/emucore/Cart0840.cxx
index 5f36cfc..b8a9aac 100644
--- a/src/emucore/Cart0840.cxx
+++ b/src/emucore/Cart0840.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart0840.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: Cart0840.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "Cart0840.hxx"
@@ -28,7 +26,7 @@ Cartridge0840::Cartridge0840(const uInt8* image, uInt32 size, const Settings& se
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(8192u, size));
+ memcpy(myImage, image, std::min(8192u, size));
createCodeAccessBase(8192);
// Remember startup bank
diff --git a/src/emucore/Cart0840.hxx b/src/emucore/Cart0840.hxx
index 5f162b9..264d383 100644
--- a/src/emucore/Cart0840.hxx
+++ b/src/emucore/Cart0840.hxx
@@ -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 3240 2015-12-29 21:28:10Z stephena $
+// $Id: Cart0840.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef CARTRIDGE0840_HXX
@@ -46,10 +46,6 @@ class Cartridge0840 : public Cartridge
@param settings A reference to the various settings (read-only)
*/
Cartridge0840(const uInt8* image, uInt32 size, const Settings& settings);
-
- /**
- Destructor
- */
virtual ~Cartridge0840() = default;
public:
diff --git a/src/emucore/Cart2K.cxx b/src/emucore/Cart2K.cxx
index 07e2614..0c973ca 100644
--- a/src/emucore/Cart2K.cxx
+++ b/src/emucore/Cart2K.cxx
@@ -14,18 +14,15 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart2K.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Cart2K.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "Cart2K.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge2K::Cartridge2K(const uInt8* image, uInt32 size, const Settings& settings)
- : Cartridge(settings),
- myImage(nullptr)
+ : Cartridge(settings)
{
// Size can be a maximum of 2K
if(size > 2048) size = 2048;
diff --git a/src/emucore/Cart2K.hxx b/src/emucore/Cart2K.hxx
index 179261a..d6f60ca 100644
--- a/src/emucore/Cart2K.hxx
+++ b/src/emucore/Cart2K.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Cart2K.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGE2K_HXX
@@ -34,7 +34,7 @@ class System;
2600's 4K cartridge addressing space.
@author Bradford W. Mott
- @version $Id: Cart2K.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: Cart2K.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class Cartridge2K : public Cartridge
{
@@ -136,7 +136,7 @@ class Cartridge2K : public Cartridge
private:
// Pointer to a dynamically allocated ROM image of the cartridge
- unique_ptr<uInt8[]> myImage;
+ BytePtr myImage;
// Size of the ROM image
uInt32 mySize;
diff --git a/src/emucore/Cart3E.cxx b/src/emucore/Cart3E.cxx
index 6a71140..92cf5a5 100644
--- a/src/emucore/Cart3E.cxx
+++ b/src/emucore/Cart3E.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart3E.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Cart3E.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "TIA.hxx"
#include "Cart3E.hxx"
@@ -27,7 +25,6 @@
Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- myImage(nullptr),
mySize(size),
myCurrentBank(0)
{
@@ -45,12 +42,7 @@ Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge3E::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 32768; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 32768);
+ initializeRAM(myRAM, 32768);
// We'll map the startup bank into the first segment upon reset
bank(myStartBank);
diff --git a/src/emucore/Cart3E.hxx b/src/emucore/Cart3E.hxx
index 03bab4f..46a6f78 100644
--- a/src/emucore/Cart3E.hxx
+++ b/src/emucore/Cart3E.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Cart3E.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGE3E_HXX
@@ -61,7 +61,7 @@ class System;
any problems. (Famous last words...)
@author B. Watson
- @version $Id: Cart3E.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: Cart3E.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class Cartridge3E : public Cartridge
@@ -181,7 +181,7 @@ class Cartridge3E : public Cartridge
private:
// Pointer to a dynamically allocated ROM image of the cartridge
- unique_ptr<uInt8[]> myImage;
+ BytePtr myImage;
// RAM contents. For now every ROM gets all 32K of potential RAM
uInt8 myRAM[32 * 1024];
diff --git a/src/emucore/CartDASH.cxx b/src/emucore/Cart3EPlus.cxx
similarity index 77%
copy from src/emucore/CartDASH.cxx
copy to src/emucore/Cart3EPlus.cxx
index faf9802..d89fd2c 100644
--- a/src/emucore/CartDASH.cxx
+++ b/src/emucore/Cart3EPlus.cxx
@@ -14,20 +14,17 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDASH.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Cart3EPlus.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "TIA.hxx"
-#include "CartDASH.hxx"
+#include "Cart3EPlus.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-CartridgeDASH::CartridgeDASH(const uInt8* image, uInt32 size, const Settings& settings)
+Cartridge3EPlus::Cartridge3EPlus(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings),
- mySize(size),
- myImage(nullptr)
+ mySize(size)
{
// Allocate array for the ROM image
myImage = make_ptr<uInt8[]>(mySize);
@@ -42,22 +39,15 @@ CartridgeDASH::CartridgeDASH(const uInt8* image, uInt32 size, const Settings& se
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::reset() {
-
- // Initialize RAM
- if (mySettings.getBool("ramrandom"))
- for (uInt32 i = 0; i < RAM_TOTAL_SIZE; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, RAM_TOTAL_SIZE);
+void Cartridge3EPlus::reset()
+{
+ initializeRAM(myRAM, RAM_TOTAL_SIZE);
// 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++)
- {
+ for(uInt32 b = 0; b < 8; ++b)
bankInUse[b] = BANK_UNDEFINED; // bank is undefined and inaccessible!
- segmentInUse[b/2] = BANK_UNDEFINED;
- }
+
initializeBankState();
// We'll map the startup banks 0 and 3 from the image into the third 1K bank upon reset
@@ -66,8 +56,8 @@ void CartridgeDASH::reset() {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::install(System& system) {
-
+void Cartridge3EPlus::install(System& system)
+{
mySystem = &system;
System::PageAccess access(this, System::PA_READWRITE);
@@ -76,16 +66,14 @@ void CartridgeDASH::install(System& system) {
// we need to chain any accesses below 0x40 to the TIA. Our poke() method
// does this via mySystem->tiaPoke(...), at least until we come up with a
// cleaner way to do it).
- for (uInt32 i = 0x00; i < 0x40; i += (1 << System::PAGE_SHIFT))
+ for(uInt32 i = 0x00; i < 0x40; i += (1 << System::PAGE_SHIFT))
mySystem->setPageAccess(i >> System::PAGE_SHIFT, access);
// 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++)
- {
+ for(uInt32 b = 0; b < 8; ++b)
bankInUse[b] = BANK_UNDEFINED; // bank is undefined and inaccessible!
- segmentInUse[b/2] = BANK_UNDEFINED;
- }
+
initializeBankState();
// Setup the last segment (of 4, each 1K) to point to the first ROM slice
@@ -95,22 +83,23 @@ void CartridgeDASH::install(System& system) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-uInt8 CartridgeDASH::peek(uInt16 address) {
-
+uInt8 Cartridge3EPlus::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)
- uInt16 imageBank = bankInUse[bank]; // the ROM/RAM bank that's here
-
- if (imageBank == BANK_UNDEFINED) { // an uninitialised bank?
+ 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);
@@ -131,17 +120,17 @@ uInt8 CartridgeDASH::peek(uInt16 address) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::poke(uInt16 address, uInt8 value) {
-
+bool Cartridge3EPlus::poke(uInt16 address, uInt8 value)
+{
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)
+ if(address == BANK_SWITCH_HOTSPOT_RAM)
changed = bankRAM(value);
- else if (address == BANK_SWITCH_HOTSPOT_ROM)
+ else if(address == BANK_SWITCH_HOTSPOT_ROM)
changed = bankROM(value);
// Pass the poke through to the TIA. In a real Atari, both the cart and the
@@ -154,63 +143,65 @@ bool CartridgeDASH::poke(uInt16 address, uInt8 value) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::bankRAM(uInt8 bank) {
-
- if (bankLocked()) // debugger can lock RAM
+bool Cartridge3EPlus::bankRAM(uInt8 bank)
+{
+ if(bankLocked()) // debugger can lock RAM
return false;
- // Each RAM bank uses two slots, separated by 0x800 in memory -- one read, one write.
+//cerr << "bankRAM " << int(bank) << endl;
+
+ // Each RAM bank uses two slots, separated by 0x200 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) {
-
+void Cartridge3EPlus::bankRAMSlot(uInt16 bank)
+{
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
uInt32 startCurrentBank = currentBank << RAM_BANK_TO_POWER; // Effectively * 512 bytes
-
+//cerr << "raw bank=" << std::dec << currentBank << endl
+// << "startCurrentBank=$" << std::hex << startCurrentBank << endl;
// Setup the page access methods for the current bank
System::PageAccess access(this, System::PA_READ);
- if (upper) { // We're mapping the write port
-
- bankInUse[bankNumber + 4] = Int16(bank);
+ if(upper) // We're mapping the write port
+ {
+ bankInUse[bankNumber * 2 + 1] = Int16(bank);
access.type = System::PA_WRITE;
-
- } else { // We're mapping the read port
-
- bankInUse[bankNumber] = Int16(bank);
+ }
+ else // We're mapping the read port
+ {
+ bankInUse[bankNumber * 2] = Int16(bank);
access.type = System::PA_READ;
-
}
- uInt32 start = 0x1000 + (bankNumber << RAM_BANK_TO_POWER) + (upper ? RAM_WRITE_OFFSET : 0);
+ uInt32 start = 0x1000 + (bankNumber << (RAM_BANK_TO_POWER+1)) + (upper ? RAM_WRITE_OFFSET : 0);
uInt32 end = start + RAM_BANK_SIZE - 1;
- for (uInt32 address = start; address <= end; address += (1 << System::PAGE_SHIFT)) {
+//cerr << "bank RAM: " << bankNumber << " -> " << (bankNumber * 2 + (upper ? 1 : 0)) << (upper ? " (W)" : " (R)") << endl
+// << "start=" << std::hex << start << ", end=" << end << endl << endl;
+ for(uInt32 address = start; address <= end; address += (1 << System::PAGE_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 >> System::PAGE_SHIFT, access);
}
}
-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::bankROM(uInt8 bank) {
-
- if (bankLocked()) // debugger can lock ROM
+bool Cartridge3EPlus::bankROM(uInt8 bank)
+{
+ if(bankLocked()) // debugger can lock ROM
return false;
// Map ROM bank image into the system into the correct slot
@@ -219,15 +210,12 @@ bool CartridgeDASH::bankROM(uInt8 bank) {
bankROMSlot(bank | 0);
bankROMSlot(bank | BITMASK_LOWERUPPER);
- // Remember that this hotspot was accessed for ROM
- segmentInUse[(bank >> BANK_BITS) & 3] = bank;
-
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::bankROMSlot(uInt16 bank) {
-
+void Cartridge3EPlus::bankROMSlot(uInt16 bank)
+{
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
@@ -242,7 +230,8 @@ void CartridgeDASH::bankROMSlot(uInt16 bank) {
uInt32 start = 0x1000 + (bankNumber << ROM_BANK_TO_POWER) + (upper ? ROM_BANK_SIZE / 2 : 0);
uInt32 end = start + ROM_BANK_SIZE / 2 - 1;
- for (uInt32 address = start; address <= end; address += (1 << System::PAGE_SHIFT)) {
+ for(uInt32 address = start; address <= end; address += (1 << System::PAGE_SHIFT))
+ {
access.directPeekBase = &myImage[startCurrentBank + (address & (ROM_BANK_SIZE - 1))];
access.codeAccessBase = &myCodeAccessBase[startCurrentBank + (address & (ROM_BANK_SIZE - 1))];
mySystem->setPageAccess(address >> System::PAGE_SHIFT, access);
@@ -250,19 +239,19 @@ void CartridgeDASH::bankROMSlot(uInt16 bank) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::initializeBankState() {
-
+void Cartridge3EPlus::initializeBankState()
+{
// Switch in each 512b slot
- for (uInt32 b = 0; b < 8; b++) {
- if (bankInUse[b] == BANK_UNDEFINED) {
-
+ 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 << System::PAGE_SHIFT))
mySystem->setPageAccess(address >> System::PAGE_SHIFT, access);
-
}
else if (bankInUse[b] & BITMASK_ROMRAM)
bankRAMSlot(bankInUse[b]);
@@ -272,7 +261,8 @@ void CartridgeDASH::initializeBankState() {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::patch(uInt16 address, uInt8 value) {
+bool Cartridge3EPlus::patch(uInt16 address, uInt8 value)
+{
#if 0
// Patch the cartridge ROM (for debugger)
@@ -308,37 +298,42 @@ bool CartridgeDASH::patch(uInt16 address, uInt8 value) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const uInt8* CartridgeDASH::getImage(int& size) const {
+const uInt8* Cartridge3EPlus::getImage(int& size) const
+{
size = mySize;
return myImage.get();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::save(Serializer& out) const {
-
- try {
+bool Cartridge3EPlus::save(Serializer& out) const
+{
+ try
+ {
out.putString(name());
out.putShortArray(bankInUse, 8);
- out.putShortArray(segmentInUse, 4);
out.putByteArray(myRAM, RAM_TOTAL_SIZE);
- } catch (...) {
- cerr << "ERROR: CartridgeDASH::save" << endl;
+ }
+ catch (...)
+ {
+ cerr << "ERROR: Cartridge3EPlus::save" << endl;
return false;
}
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::load(Serializer& in) {
-
- try {
+bool Cartridge3EPlus::load(Serializer& in)
+{
+ try
+ {
if (in.getString() != name())
return false;
in.getShortArray(bankInUse, 8);
- in.getShortArray(segmentInUse, 4);
in.getByteArray(myRAM, RAM_TOTAL_SIZE);
- } catch (...) {
- cerr << "ERROR: CartridgeDASH::load" << endl;
+ }
+ catch (...)
+ {
+ cerr << "ERROR: Cartridge3EPlus::load" << endl;
return false;
}
diff --git a/src/emucore/Cart3EPlus.hxx b/src/emucore/Cart3EPlus.hxx
new file mode 100644
index 0000000..5382833
--- /dev/null
+++ b/src/emucore/Cart3EPlus.hxx
@@ -0,0 +1,194 @@
+//============================================================================
+//
+// 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-2016 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: Cart3EPlus.hxx 3316 2016-08-24 23:57:07Z stephena $
+//============================================================================
+
+#ifndef CARTRIDGE_3EPLUS_HXX
+#define CARTRIDGE_3EPLUS_HXX
+
+class System;
+
+#include "bspf.hxx"
+#include "Cart.hxx"
+
+#ifdef DEBUGGER_SUPPORT
+class Cartridge3EPlusWidget;
+ #include "Cart3EPlusWidget.hxx"
+#endif
+
+/**
+ Cartridge class from Thomas Jentzsch, mostly based on the 'DASH' scheme
+ with the following changes:
+
+ RAM areas:
+ - read $x000, write $x200
+ - read $x400, write $x600
+ - read $x800, write $xa00
+ - read $xc00, write $xe00
+
+ @author Thomas Jentzsch and Stephen Anthony
+*/
+
+class Cartridge3EPlus: public Cartridge
+{
+ friend class Cartridge3EPlusWidget;
+
+ public:
+ /**
+ Create a new cartridge using the specified image and size
+
+ @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)
+ */
+ Cartridge3EPlus(const uInt8* image, uInt32 size, const Settings& settings);
+ virtual ~Cartridge3EPlus() = default;
+
+ public:
+ /** Reset device to its power-on state */
+ void reset() override;
+
+ /**
+ 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) override;
+
+ /**
+ 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) override;
+
+ /**
+ 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 override;
+
+ /**
+ 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 override;
+
+ /**
+ 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) override;
+
+ /**
+ Get a descriptor for the device name (used in error checking).
+
+ @return The name of the object
+ */
+ string name() const override { return "Cartridge3E+"; }
+
+ #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) override
+ {
+ return new Cartridge3EPlusWidget(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) override;
+
+ /**
+ 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) override;
+
+ private:
+ 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)
+
+ 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.
+
+ static constexpr uInt16 BANK_UNDEFINED = 0x8000; // bank is undefined and inaccessible
+ uInt16 bankInUse[8]; // bank being used for ROM/RAM (eight 512 byte areas)
+
+ static constexpr uInt16 BANK_SWITCH_HOTSPOT_RAM = 0x3E; // writes to this address cause bankswitching
+ static constexpr uInt16 BANK_SWITCH_HOTSPOT_ROM = 0x3F; // writes to this address cause bankswitching
+
+ static constexpr uInt8 BANK_BITS = 6; // # bits for bank
+ static constexpr uInt8 BIT_BANK_MASK = (1 << BANK_BITS) - 1; // mask for those bits
+ static constexpr uInt16 BITMASK_LOWERUPPER = 0x100; // flags lower or upper section of bank (1==upper)
+ static constexpr uInt16 BITMASK_ROMRAM = 0x200; // flags ROM or RAM bank switching (1==RAM)
+
+ static constexpr uInt16 MAXIMUM_BANK_COUNT = (1 << BANK_BITS);
+ static constexpr uInt16 RAM_BANK_TO_POWER = 9; // 2^n = 512
+ static constexpr uInt16 RAM_BANK_SIZE = (1 << RAM_BANK_TO_POWER);
+ static constexpr uInt16 BITMASK_RAM_BANK = (RAM_BANK_SIZE - 1);
+ static constexpr uInt32 RAM_TOTAL_SIZE = MAXIMUM_BANK_COUNT * RAM_BANK_SIZE;
+
+ static constexpr uInt16 ROM_BANK_TO_POWER = 10; // 2^n = 1024
+ static constexpr uInt16 ROM_BANK_SIZE = (1 << ROM_BANK_TO_POWER);
+ static constexpr uInt16 BITMASK_ROM_BANK = (ROM_BANK_SIZE - 1);
+
+ static constexpr uInt16 ROM_BANK_COUNT = 64;
+
+ static constexpr uInt16 RAM_WRITE_OFFSET = 0x200;
+
+ BytePtr myImage; // Pointer to a dynamically allocated ROM image of the cartridge
+ uInt32 mySize; // Size of the ROM image
+ uInt8 myRAM[RAM_TOTAL_SIZE];
+
+ private:
+ // Following constructors and assignment operators not supported
+ Cartridge3EPlus() = delete;
+ Cartridge3EPlus(const Cartridge3EPlus&) = delete;
+ Cartridge3EPlus(Cartridge3EPlus&&) = delete;
+ Cartridge3EPlus& operator=(const Cartridge3EPlus&) = delete;
+ Cartridge3EPlus& operator=(Cartridge3EPlus&&) = delete;
+};
+
+#endif
diff --git a/src/emucore/Cart3F.cxx b/src/emucore/Cart3F.cxx
index 678ee9c..a07ae68 100644
--- a/src/emucore/Cart3F.cxx
+++ b/src/emucore/Cart3F.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart3F.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Cart3F.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "TIA.hxx"
#include "Cart3F.hxx"
@@ -27,7 +25,6 @@
Cartridge3F::Cartridge3F(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- myImage(nullptr),
mySize(size),
myCurrentBank(0)
{
@@ -98,9 +95,7 @@ bool Cartridge3F::poke(uInt16 address, uInt8 value)
// Switch banks if necessary
if(address <= 0x003F)
- {
bank(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
@@ -114,7 +109,8 @@ bool Cartridge3F::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Cartridge3F::bank(uInt16 bank)
{
- if(bankLocked()) return false;
+ if(bankLocked())
+ return false;
// Make sure the bank they're asking for is reasonable
if((uInt32(bank) << 11) < mySize)
diff --git a/src/emucore/Cart3F.hxx b/src/emucore/Cart3F.hxx
index c89fb8a..b3a79f8 100644
--- a/src/emucore/Cart3F.hxx
+++ b/src/emucore/Cart3F.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Cart3F.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGE3F_HXX
@@ -39,7 +39,7 @@ class System;
only used 8K this bankswitching scheme supports up to 512K.
@author Bradford W. Mott
- @version $Id: Cart3F.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: Cart3F.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class Cartridge3F : public Cartridge
{
@@ -158,7 +158,7 @@ class Cartridge3F : public Cartridge
private:
// Pointer to a dynamically allocated ROM image of the cartridge
- unique_ptr<uInt8[]> myImage;
+ BytePtr myImage;
// Size of the ROM image
uInt32 mySize;
diff --git a/src/emucore/Cart4A50.cxx b/src/emucore/Cart4A50.cxx
index 77be17e..0557e20 100644
--- a/src/emucore/Cart4A50.cxx
+++ b/src/emucore/Cart4A50.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart4A50.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: Cart4A50.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "M6532.hxx"
#include "TIA.hxx"
@@ -59,12 +57,7 @@ Cartridge4A50::Cartridge4A50(const uInt8* image, uInt32 size,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge4A50::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 32768; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 32768);
+ initializeRAM(myRAM, 32768);
mySliceLow = mySliceMiddle = mySliceHigh = 0;
myIsRomLow = myIsRomMiddle = myIsRomHigh = true;
diff --git a/src/emucore/Cart4K.cxx b/src/emucore/Cart4K.cxx
index 24abe59..7832a8f 100644
--- a/src/emucore/Cart4K.cxx
+++ b/src/emucore/Cart4K.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart4K.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: Cart4K.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "Cart4K.hxx"
@@ -27,7 +25,7 @@ Cartridge4K::Cartridge4K(const uInt8* image, uInt32 size, const Settings& settin
: Cartridge(settings)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(4096u, size));
+ memcpy(myImage, image, std::min(4096u, size));
createCodeAccessBase(4096);
}
diff --git a/src/emucore/Cart4KSC.cxx b/src/emucore/Cart4KSC.cxx
index 8a0ce3a..db346b3 100644
--- a/src/emucore/Cart4KSC.cxx
+++ b/src/emucore/Cart4KSC.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: Cart4KSC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: Cart4KSC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "Cart4KSC.hxx"
@@ -27,19 +25,15 @@ Cartridge4KSC::Cartridge4KSC(const uInt8* image, uInt32 size, const Settings& se
: Cartridge(settings)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(4096u, size));
+ memcpy(myImage, image, std::min(4096u, size));
createCodeAccessBase(4096);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge4KSC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 128; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 128);
+ initializeRAM(myRAM, 128);
+
myBankChanged = true;
}
diff --git a/src/emucore/CartAR.cxx b/src/emucore/CartAR.cxx
index 7e55f07..d6d1fbd 100644
--- a/src/emucore/CartAR.cxx
+++ b/src/emucore/CartAR.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartAR.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartAR.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "M6502.hxx"
#include "System.hxx"
#include "CartAR.hxx"
@@ -27,8 +25,7 @@
CartridgeAR::CartridgeAR(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- mySize(BSPF_max(size, 8448u)),
- myLoadImages(nullptr),
+ mySize(std::max(size, 8448u)),
myWriteEnabled(false),
myPower(true),
myPowerRomCycle(0),
@@ -60,10 +57,7 @@ void CartridgeAR::reset()
{
// Initialize RAM
#if 0 // TODO - figure out actual behaviour of the real cart
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 6 * 1024; ++i)
- myImage[i] = mySystem->randGenerator().next();
- else
+ initializeRAM(myImage, 6*1024);
#endif
memset(myImage, 0, 6 * 1024);
diff --git a/src/emucore/CartAR.hxx b/src/emucore/CartAR.hxx
index d5f31b3..1fa2710 100644
--- a/src/emucore/CartAR.hxx
+++ b/src/emucore/CartAR.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartAR.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGEAR_HXX
@@ -38,7 +38,7 @@ class System;
and one bank of ROM. All 6K of the RAM can be read and written.
@author Bradford W. Mott
- @version $Id: CartAR.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: CartAR.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class CartridgeAR : public Cartridge
{
@@ -198,7 +198,7 @@ class CartridgeAR : public Cartridge
uInt32 mySize;
// All of the 8448 byte loads associated with the game
- unique_ptr<uInt8[]> myLoadImages;
+ BytePtr myLoadImages;
// Indicates how many 8448 loads there are
uInt8 myNumberOfLoadImages;
diff --git a/src/emucore/CartBF.cxx b/src/emucore/CartBF.cxx
index 9654f45..4c9c069 100644
--- a/src/emucore/CartBF.cxx
+++ b/src/emucore/CartBF.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartBF.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartBF.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartBF.hxx"
@@ -28,7 +26,7 @@ CartridgeBF::CartridgeBF(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(262144u, size));
+ memcpy(myImage, image, std::min(262144u, size));
createCodeAccessBase(262144);
// Remember startup bank
diff --git a/src/emucore/CartBFSC.cxx b/src/emucore/CartBFSC.cxx
index aa3dd08..33cf5ab 100644
--- a/src/emucore/CartBFSC.cxx
+++ b/src/emucore/CartBFSC.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartBFSC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartBFSC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartBFSC.hxx"
@@ -28,7 +26,7 @@ CartridgeBFSC::CartridgeBFSC(const uInt8* image, uInt32 size, const Settings& se
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(262144u, size));
+ memcpy(myImage, image, std::min(262144u, size));
createCodeAccessBase(262144);
// Remember startup bank
@@ -38,12 +36,7 @@ CartridgeBFSC::CartridgeBFSC(const uInt8* image, uInt32 size, const Settings& se
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeBFSC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 128; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 128);
+ initializeRAM(myRAM, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartCM.cxx b/src/emucore/CartCM.cxx
index 8121269..ed5fe84 100644
--- a/src/emucore/CartCM.cxx
+++ b/src/emucore/CartCM.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartCM.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartCM.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "CompuMate.hxx"
#include "System.hxx"
#include "M6532.hxx"
@@ -31,7 +29,7 @@ CartridgeCM::CartridgeCM(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(16384u, size));
+ memcpy(myImage, image, std::min(16384u, size));
createCodeAccessBase(16384);
// On powerup, the last bank of ROM is enabled and RAM is disabled
@@ -41,12 +39,7 @@ CartridgeCM::CartridgeCM(const uInt8* image, uInt32 size, const Settings& settin
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCM::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 2048; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 2048);
+ initializeRAM(myRAM, 2048);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartCTY.cxx b/src/emucore/CartCTY.cxx
index 08e5619..11e4ed4 100644
--- a/src/emucore/CartCTY.cxx
+++ b/src/emucore/CartCTY.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartCTY.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartCTY.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "OSystem.hxx"
#include "Serializer.hxx"
#include "System.hxx"
@@ -39,7 +37,7 @@ CartridgeCTY::CartridgeCTY(const uInt8* image, uInt32 size, const OSystem& osyst
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(32768u, size));
+ memcpy(myImage, image, std::min(32768u, size));
createCodeAccessBase(32768);
// Point to the first tune
@@ -52,12 +50,7 @@ CartridgeCTY::CartridgeCTY(const uInt8* image, uInt32 size, const OSystem& osyst
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCTY::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 64; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 64);
+ initializeRAM(myRAM, 64);
myRAM[0] = myRAM[1] = myRAM[2] = myRAM[3] = 0xFF;
diff --git a/src/emucore/CartCTYTunes.hxx b/src/emucore/CartCTYTunes.hxx
index 2d3b6c2..65517cf 100644
--- a/src/emucore/CartCTYTunes.hxx
+++ b/src/emucore/CartCTYTunes.hxx
@@ -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: CartCTYTunes.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: CartCTYTunes.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef CARTRIDGECHETIRY_TUNES_HXX
@@ -27,7 +27,7 @@
#define CHETIRY_TUNES_SIZE 7 * 4096
-static const uInt8 CartCTYTunes[CHETIRY_TUNES_SIZE] = {
+static constexpr uInt8 CartCTYTunes[CHETIRY_TUNES_SIZE] = {
///////////////////////////
// Tune 1
///////////////////////////
diff --git a/src/emucore/CartCV.cxx b/src/emucore/CartCV.cxx
index a70be27..c7a01fb 100644
--- a/src/emucore/CartCV.cxx
+++ b/src/emucore/CartCV.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartCV.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartCV.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartCV.hxx"
@@ -26,7 +24,6 @@
CartridgeCV::CartridgeCV(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- myInitialRAM(nullptr),
mySize(size)
{
if(mySize == 2048)
@@ -58,14 +55,7 @@ void CartridgeCV::reset()
memcpy(myRAM, myInitialRAM.get(), 1024);
}
else
- {
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 1024; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 1024);
- }
+ initializeRAM(myRAM, 1024);
myBankChanged = true;
}
diff --git a/src/emucore/CartCV.hxx b/src/emucore/CartCV.hxx
index bdb0e83..0cf4990 100644
--- a/src/emucore/CartCV.hxx
+++ b/src/emucore/CartCV.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartCV.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGECV_HXX
@@ -36,7 +36,7 @@ class System;
$F800-$FFFF ROM
@author Eckhard Stolberg
- @version $Id: CartCV.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: CartCV.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class CartridgeCV : public Cartridge
{
@@ -139,7 +139,7 @@ class CartridgeCV : public Cartridge
private:
// Pointer to the initial RAM data from the cart
// This doesn't always exist, so we don't pre-allocate it
- unique_ptr<uInt8[]> myInitialRAM;
+ BytePtr myInitialRAM;
// Initial size of the cart data
uInt32 mySize;
diff --git a/src/emucore/CartCVPlus.cxx b/src/emucore/CartCVPlus.cxx
index 4dfbdc5..dcbb588 100644
--- a/src/emucore/CartCVPlus.cxx
+++ b/src/emucore/CartCVPlus.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartCVPlus.cxx 3255 2016-01-23 18:17:23Z stephena $
+// $Id: CartCVPlus.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "TIA.hxx"
#include "CartCVPlus.hxx"
@@ -27,7 +25,6 @@
CartridgeCVPlus::CartridgeCVPlus(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- myImage(nullptr),
mySize(size),
myCurrentBank(0)
{
@@ -45,12 +42,7 @@ CartridgeCVPlus::CartridgeCVPlus(const uInt8* image, uInt32 size,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCVPlus::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 1024; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 1024);
+ initializeRAM(myRAM, 1024);
// We'll map the startup bank into the first segment upon reset
bank(myStartBank);
diff --git a/src/emucore/CartCVPlus.hxx b/src/emucore/CartCVPlus.hxx
index 0c626ac..17b67b2 100644
--- a/src/emucore/CartCVPlus.hxx
+++ b/src/emucore/CartCVPlus.hxx
@@ -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: CartCVPlus.hxx 3253 2016-01-23 17:58:00Z stephena $
+// $Id: CartCVPlus.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGECVPlus_HXX
@@ -45,7 +45,7 @@ class System;
selected by storing its value into $3D.
@author Stephen Anthony, LS_Dracon
- @version $Id: CartCVPlus.hxx 3253 2016-01-23 17:58:00Z stephena $
+ @version $Id: CartCVPlus.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class CartridgeCVPlus : public Cartridge
@@ -165,7 +165,7 @@ class CartridgeCVPlus : public Cartridge
private:
// Pointer to a dynamically allocated ROM image of the cartridge
- unique_ptr<uInt8[]> myImage;
+ BytePtr myImage;
// The 1024 bytes of RAM
uInt8 myRAM[1024];
diff --git a/src/emucore/CartDASH.cxx b/src/emucore/CartDASH.cxx
index faf9802..3154c1a 100644
--- a/src/emucore/CartDASH.cxx
+++ b/src/emucore/CartDASH.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDASH.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartDASH.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "TIA.hxx"
#include "CartDASH.hxx"
@@ -26,8 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDASH::CartridgeDASH(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings),
- mySize(size),
- myImage(nullptr)
+ mySize(size)
{
// Allocate array for the ROM image
myImage = make_ptr<uInt8[]>(mySize);
@@ -42,18 +39,13 @@ CartridgeDASH::CartridgeDASH(const uInt8* image, uInt32 size, const Settings& se
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::reset() {
-
- // Initialize RAM
- if (mySettings.getBool("ramrandom"))
- for (uInt32 i = 0; i < RAM_TOTAL_SIZE; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, RAM_TOTAL_SIZE);
+void CartridgeDASH::reset()
+{
+ initializeRAM(myRAM, RAM_TOTAL_SIZE);
// 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++)
+ for(uInt32 b = 0; b < 8; b++)
{
bankInUse[b] = BANK_UNDEFINED; // bank is undefined and inaccessible!
segmentInUse[b/2] = BANK_UNDEFINED;
@@ -66,8 +58,8 @@ void CartridgeDASH::reset() {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::install(System& system) {
-
+void CartridgeDASH::install(System& system)
+{
mySystem = &system;
System::PageAccess access(this, System::PA_READWRITE);
@@ -95,22 +87,23 @@ void CartridgeDASH::install(System& system) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-uInt8 CartridgeDASH::peek(uInt16 address) {
-
+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)
- uInt16 imageBank = bankInUse[bank]; // the ROM/RAM bank that's here
-
- if (imageBank == BANK_UNDEFINED) { // an uninitialised bank?
+ 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);
@@ -131,8 +124,8 @@ uInt8 CartridgeDASH::peek(uInt16 address) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::poke(uInt16 address, uInt8 value) {
-
+bool CartridgeDASH::poke(uInt16 address, uInt8 value)
+{
bool changed = false;
// Check for write to the bank switch address. RAM/ROM and bank # are encoded in 'value'
@@ -154,8 +147,8 @@ bool CartridgeDASH::poke(uInt16 address, uInt8 value) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::bankRAM(uInt8 bank) {
-
+bool CartridgeDASH::bankRAM(uInt8 bank)
+{
if (bankLocked()) // debugger can lock RAM
return false;
@@ -170,8 +163,8 @@ bool CartridgeDASH::bankRAM(uInt8 bank) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::bankRAMSlot(uInt16 bank) {
-
+void CartridgeDASH::bankRAMSlot(uInt16 bank)
+{
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
@@ -181,35 +174,35 @@ void CartridgeDASH::bankRAMSlot(uInt16 bank) {
// Setup the page access methods for the current bank
System::PageAccess access(this, System::PA_READ);
- if (upper) { // We're mapping the write port
-
+ if(upper) // We're mapping the write port
+ {
bankInUse[bankNumber + 4] = Int16(bank);
access.type = System::PA_WRITE;
-
- } else { // We're mapping the read port
-
+ }
+ else // We're mapping the read port
+ {
bankInUse[bankNumber] = Int16(bank);
access.type = System::PA_READ;
-
}
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 << System::PAGE_SHIFT)) {
+ for (uInt32 address = start; address <= end; address += (1 << System::PAGE_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 >> System::PAGE_SHIFT, access);
}
}
-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::bankROM(uInt8 bank) {
-
+bool CartridgeDASH::bankROM(uInt8 bank)
+{
if (bankLocked()) // debugger can lock ROM
return false;
@@ -226,8 +219,8 @@ bool CartridgeDASH::bankROM(uInt8 bank) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::bankROMSlot(uInt16 bank) {
-
+void CartridgeDASH::bankROMSlot(uInt16 bank)
+{
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
@@ -242,7 +235,8 @@ void CartridgeDASH::bankROMSlot(uInt16 bank) {
uInt32 start = 0x1000 + (bankNumber << ROM_BANK_TO_POWER) + (upper ? ROM_BANK_SIZE / 2 : 0);
uInt32 end = start + ROM_BANK_SIZE / 2 - 1;
- for (uInt32 address = start; address <= end; address += (1 << System::PAGE_SHIFT)) {
+ for (uInt32 address = start; address <= end; address += (1 << System::PAGE_SHIFT))
+ {
access.directPeekBase = &myImage[startCurrentBank + (address & (ROM_BANK_SIZE - 1))];
access.codeAccessBase = &myCodeAccessBase[startCurrentBank + (address & (ROM_BANK_SIZE - 1))];
mySystem->setPageAccess(address >> System::PAGE_SHIFT, access);
@@ -250,19 +244,19 @@ void CartridgeDASH::bankROMSlot(uInt16 bank) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void CartridgeDASH::initializeBankState() {
-
+void CartridgeDASH::initializeBankState()
+{
// Switch in each 512b slot
- for (uInt32 b = 0; b < 8; b++) {
- if (bankInUse[b] == BANK_UNDEFINED) {
-
+ 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 << System::PAGE_SHIFT))
mySystem->setPageAccess(address >> System::PAGE_SHIFT, access);
-
}
else if (bankInUse[b] & BITMASK_ROMRAM)
bankRAMSlot(bankInUse[b]);
@@ -272,7 +266,8 @@ void CartridgeDASH::initializeBankState() {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::patch(uInt16 address, uInt8 value) {
+bool CartridgeDASH::patch(uInt16 address, uInt8 value)
+{
#if 0
// Patch the cartridge ROM (for debugger)
@@ -308,20 +303,24 @@ bool CartridgeDASH::patch(uInt16 address, uInt8 value) {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const uInt8* CartridgeDASH::getImage(int& size) const {
+const uInt8* CartridgeDASH::getImage(int& size) const
+{
size = mySize;
return myImage.get();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::save(Serializer& out) const {
-
- try {
+bool CartridgeDASH::save(Serializer& out) const
+{
+ try
+ {
out.putString(name());
out.putShortArray(bankInUse, 8);
out.putShortArray(segmentInUse, 4);
out.putByteArray(myRAM, RAM_TOTAL_SIZE);
- } catch (...) {
+ }
+ catch (...)
+ {
cerr << "ERROR: CartridgeDASH::save" << endl;
return false;
}
@@ -329,15 +328,18 @@ bool CartridgeDASH::save(Serializer& out) const {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-bool CartridgeDASH::load(Serializer& in) {
-
- try {
+bool CartridgeDASH::load(Serializer& in)
+{
+ try
+ {
if (in.getString() != name())
return false;
in.getShortArray(bankInUse, 8);
in.getShortArray(segmentInUse, 4);
in.getByteArray(myRAM, RAM_TOTAL_SIZE);
- } catch (...) {
+ }
+ catch (...)
+ {
cerr << "ERROR: CartridgeDASH::load" << endl;
return false;
}
diff --git a/src/emucore/CartDASH.hxx b/src/emucore/CartDASH.hxx
index 305e2b9..2f49c49 100644
--- a/src/emucore/CartDASH.hxx
+++ b/src/emucore/CartDASH.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartDASH.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGEDASH_HXX
@@ -125,147 +125,145 @@ class CartridgeDASHWidget;
@author Andrew Davie
*/
-class CartridgeDASH: public Cartridge {
+class CartridgeDASH: public Cartridge
+{
friend class CartridgeDASHWidget;
-public:
- /**
- Create a new cartridge using the specified image and size
+ public:
+ /**
+ Create a new cartridge using the specified image and size
+
+ @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)
+ */
+ CartridgeDASH(const uInt8* image, uInt32 size, const Settings& settings);
+ virtual ~CartridgeDASH() = default;
+
+ public:
+ /** Reset device to its power-on state */
+ void reset() override;
+
+ /**
+ 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) override;
+
+ /**
+ 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) override;
+
+ /**
+ 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 override;
+
+ /**
+ 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 override;
+
+ /**
+ 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) override;
+
+ /**
+ Get a descriptor for the device name (used in error checking).
+
+ @return The name of the object
+ */
+ string name() const override { return "CartridgeDASH"; }
+
+ #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) override
+ {
+ return new CartridgeDASHWidget(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) override;
+
+ /**
+ 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) override;
- @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)
- */
- CartridgeDASH(const uInt8* image, uInt32 size, const Settings& settings);
- virtual ~CartridgeDASH() = default;
-
-public:
- /**
- Reset device to its power-on state
- */
- void reset() override;
-
- /**
- 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) override;
-
- /**
- 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) override;
-
- /**
- 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 override;
-
- /**
- 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 override;
-
- /**
- 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) override;
-
- /**
- Get a descriptor for the device name (used in error checking).
-
- @return The name of the object
- */
- string name() const override { return "CartridgeDASH"; }
-
-#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) override
- {
- return new CartridgeDASHWidget(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) override;
-
- /**
- 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) override;
-
-private:
-
- bool bankRAM(uInt8 bank); // switch a RAM bank
- bool bankROM(uInt8 bank); // switch a ROM bank
+ private:
+ 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)
+ 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)
- void initializeBankState(); // set all banks according to current bankInUse state
+ 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.
+ // 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.
- 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 constexpr 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 constexpr uInt16 BANK_SWITCH_HOTSPOT_RAM = 0x3E; // writes to this address cause bankswitching
+ static constexpr 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 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 constexpr uInt8 BANK_BITS = 6; // # bits for bank
+ static constexpr uInt8 BIT_BANK_MASK = (1 << BANK_BITS) - 1; // mask for those bits
+ static constexpr uInt16 BITMASK_LOWERUPPER = 0x100; // flags lower or upper section of bank (1==upper)
+ static constexpr uInt16 BITMASK_ROMRAM = 0x200; // flags ROM or RAM bank switching (1==RAM)
- static const uInt16 MAXIMUM_BANK_COUNT = (1<<BANK_BITS);
- static const uInt16 RAM_BANK_TO_POWER = 9; // 2^n = 512
- static const uInt16 RAM_BANK_SIZE = (1 << RAM_BANK_TO_POWER);
- static const uInt16 BITMASK_RAM_BANK = (RAM_BANK_SIZE - 1);
- static const uInt32 RAM_TOTAL_SIZE = MAXIMUM_BANK_COUNT * RAM_BANK_SIZE;
+ static constexpr uInt16 MAXIMUM_BANK_COUNT = (1 << BANK_BITS);
+ static constexpr uInt16 RAM_BANK_TO_POWER = 9; // 2^n = 512
+ static constexpr uInt16 RAM_BANK_SIZE = (1 << RAM_BANK_TO_POWER);
+ static constexpr uInt16 BITMASK_RAM_BANK = (RAM_BANK_SIZE - 1);
+ static constexpr uInt32 RAM_TOTAL_SIZE = MAXIMUM_BANK_COUNT * RAM_BANK_SIZE;
- static const uInt16 ROM_BANK_TO_POWER = 10; // 2^n = 1024
- static const uInt16 ROM_BANK_SIZE = (1 << ROM_BANK_TO_POWER);
- static const uInt16 BITMASK_ROM_BANK = (ROM_BANK_SIZE -1);
+ static constexpr uInt16 ROM_BANK_TO_POWER = 10; // 2^n = 1024
+ static constexpr uInt16 ROM_BANK_SIZE = (1 << ROM_BANK_TO_POWER);
+ static constexpr uInt16 BITMASK_ROM_BANK = (ROM_BANK_SIZE - 1);
- static const uInt16 ROM_BANK_COUNT = 64;
+ static constexpr uInt16 ROM_BANK_COUNT = 64;
- static const uInt16 RAM_WRITE_OFFSET = 0x800;
+ static constexpr uInt16 RAM_WRITE_OFFSET = 0x800;
- uInt32 mySize; // Size of the ROM image
- unique_ptr<uInt8[]> myImage; // Pointer to a dynamically allocated ROM image of the cartridge
- uInt8 myRAM[RAM_TOTAL_SIZE];
+ BytePtr myImage; // Pointer to a dynamically allocated ROM image of the cartridge
+ uInt32 mySize; // Size of the ROM image
+ uInt8 myRAM[RAM_TOTAL_SIZE];
private:
// Following constructors and assignment operators not supported
diff --git a/src/emucore/CartDF.cxx b/src/emucore/CartDF.cxx
index 4cc55ab..b7da675 100644
--- a/src/emucore/CartDF.cxx
+++ b/src/emucore/CartDF.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDF.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartDF.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartDF.hxx"
@@ -28,7 +26,7 @@ CartridgeDF::CartridgeDF(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(131072u, size));
+ memcpy(myImage, image, std::min(131072u, size));
createCodeAccessBase(131072);
// Remember startup bank
diff --git a/src/emucore/CartDFSC.cxx b/src/emucore/CartDFSC.cxx
index f7f651c..88c842a 100644
--- a/src/emucore/CartDFSC.cxx
+++ b/src/emucore/CartDFSC.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDFSC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartDFSC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartDFSC.hxx"
@@ -28,7 +26,7 @@ CartridgeDFSC::CartridgeDFSC(const uInt8* image, uInt32 size, const Settings& se
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(131072u, size));
+ memcpy(myImage, image, std::min(131072u, size));
createCodeAccessBase(131072);
// Remember startup bank
@@ -38,12 +36,7 @@ CartridgeDFSC::CartridgeDFSC(const uInt8* image, uInt32 size, const Settings& se
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDFSC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 128; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 128);
+ initializeRAM(myRAM, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartDPC.cxx b/src/emucore/CartDPC.cxx
index 3dde5ac..53c8b6c 100644
--- a/src/emucore/CartDPC.cxx
+++ b/src/emucore/CartDPC.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDPC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartDPC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartDPC.hxx"
@@ -32,7 +30,7 @@ CartridgeDPC::CartridgeDPC(const uInt8* image, uInt32 size,
myCurrentBank(0)
{
// Make a copy of the entire image
- memcpy(myImage, image, BSPF_min(size, 8192u + 2048u + 256u));
+ memcpy(myImage, image, std::min(size, 8192u + 2048u + 256u));
createCodeAccessBase(8192);
// Pointer to the program ROM (8K @ 0 byte offset)
@@ -92,7 +90,7 @@ inline void CartridgeDPC::clockRandomNumberGenerator()
{
// Table for computing the input bit of the random number generator's
// shift register (it's the NOT of the EOR of four bits)
- static const uInt8 f[16] = {
+ static constexpr uInt8 f[16] = {
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1
};
@@ -204,7 +202,7 @@ uInt8 CartridgeDPC::peek(uInt16 address)
// No, it's a music read
else
{
- static const uInt8 musicAmplitudes[8] = {
+ static constexpr uInt8 musicAmplitudes[8] = {
0x00, 0x04, 0x05, 0x09, 0x06, 0x0a, 0x0b, 0x0f
};
diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx
index fe89ba4..761f4d0 100644
--- a/src/emucore/CartDPCPlus.cxx
+++ b/src/emucore/CartDPCPlus.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartDPCPlus.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartDPCPlus.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#ifdef DEBUGGER_SUPPORT
#include "Debugger.hxx"
#endif
@@ -30,7 +28,6 @@
CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- myImage(nullptr),
myFastFetch(false),
myLDAimmediate(false),
myParameterPointer(0),
@@ -40,7 +37,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size,
{
// Store image, making sure it's at least 29KB
uInt32 minsize = 4096 * 6 + 4096 + 1024 + 255;
- mySize = BSPF_max(minsize, size);
+ mySize = std::max(minsize, size);
myImage = make_ptr<uInt8[]>(mySize);
memcpy(myImage.get(), image, size);
createCodeAccessBase(4096 * 6);
diff --git a/src/emucore/CartDPCPlus.hxx b/src/emucore/CartDPCPlus.hxx
index cb674a2..dde4402 100644
--- a/src/emucore/CartDPCPlus.hxx
+++ b/src/emucore/CartDPCPlus.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartDPCPlus.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGE_DPC_PLUS_HXX
@@ -41,7 +41,7 @@ class System;
Patent Number 4,644,495.
@author Darrell Spice Jr, Fred Quimby, Stephen Anthony, Bradford W. Mott
- @version $Id: CartDPCPlus.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: CartDPCPlus.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class CartridgeDPCPlus : public Cartridge
{
@@ -195,7 +195,7 @@ class CartridgeDPCPlus : public Cartridge
private:
// The ROM image and size
- unique_ptr<uInt8[]> myImage;
+ BytePtr myImage;
uInt32 mySize;
// Pointer to the 24K program ROM image of the cartridge
diff --git a/src/emucore/CartE0.cxx b/src/emucore/CartE0.cxx
index 6b8501c..d4e8d98 100644
--- a/src/emucore/CartE0.cxx
+++ b/src/emucore/CartE0.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartE0.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartE0.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartE0.hxx"
@@ -27,7 +25,7 @@ CartridgeE0::CartridgeE0(const uInt8* image, uInt32 size, const Settings& settin
: Cartridge(settings)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(8192u, size));
+ memcpy(myImage, image, std::min(8192u, size));
createCodeAccessBase(8192);
}
diff --git a/src/emucore/CartE7.cxx b/src/emucore/CartE7.cxx
index 8860f71..048f49b 100644
--- a/src/emucore/CartE7.cxx
+++ b/src/emucore/CartE7.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartE7.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartE7.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartE7.hxx"
@@ -28,7 +26,7 @@ CartridgeE7::CartridgeE7(const uInt8* image, uInt32 size, const Settings& settin
myCurrentRAM(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(16384u, size));
+ memcpy(myImage, image, std::min(16384u, size));
createCodeAccessBase(16384 + 2048);
// Remember startup bank
@@ -38,12 +36,7 @@ CartridgeE7::CartridgeE7(const uInt8* image, uInt32 size, const Settings& settin
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE7::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 2048; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 2048);
+ initializeRAM(myRAM, 2048);
// Install some default banks for the RAM and first segment
bankRAM(0);
diff --git a/src/emucore/CartEF.cxx b/src/emucore/CartEF.cxx
index a01459b..e7066ff 100644
--- a/src/emucore/CartEF.cxx
+++ b/src/emucore/CartEF.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartEF.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartEF.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartEF.hxx"
@@ -28,7 +26,7 @@ CartridgeEF::CartridgeEF(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(65536u, size));
+ memcpy(myImage, image, std::min(65536u, size));
createCodeAccessBase(65536);
// Remember startup bank
diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx
index 5a6dad0..72f8687 100644
--- a/src/emucore/CartEFSC.cxx
+++ b/src/emucore/CartEFSC.cxx
@@ -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 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartEFSC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
#include "System.hxx"
@@ -26,7 +26,7 @@ CartridgeEFSC::CartridgeEFSC(const uInt8* image, uInt32 size, const Settings& se
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(65536u, size));
+ memcpy(myImage, image, std::min(65536u, size));
createCodeAccessBase(65536);
// Remember startup bank
@@ -36,12 +36,7 @@ CartridgeEFSC::CartridgeEFSC(const uInt8* image, uInt32 size, const Settings& se
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEFSC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 128; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 128);
+ initializeRAM(myRAM, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartF0.cxx b/src/emucore/CartF0.cxx
index 4eab935..aeee450 100644
--- a/src/emucore/CartF0.cxx
+++ b/src/emucore/CartF0.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartF0.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartF0.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartF0.hxx"
@@ -28,7 +26,7 @@ CartridgeF0::CartridgeF0(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(65536u, size));
+ memcpy(myImage, image, std::min(65536u, size));
createCodeAccessBase(65536);
// Remember startup bank
diff --git a/src/emucore/CartF4.cxx b/src/emucore/CartF4.cxx
index 31b3202..2f7902f 100644
--- a/src/emucore/CartF4.cxx
+++ b/src/emucore/CartF4.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartF4.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartF4.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "Random.hxx"
#include "System.hxx"
#include "CartF4.hxx"
@@ -29,7 +27,7 @@ CartridgeF4::CartridgeF4(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(32768u, size));
+ memcpy(myImage, image, std::min(32768u, size));
createCodeAccessBase(32768);
// Remember startup bank
diff --git a/src/emucore/CartF4SC.cxx b/src/emucore/CartF4SC.cxx
index ff8d20d..d4c8467 100644
--- a/src/emucore/CartF4SC.cxx
+++ b/src/emucore/CartF4SC.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartF4SC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartF4SC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartF4SC.hxx"
@@ -28,7 +26,7 @@ CartridgeF4SC::CartridgeF4SC(const uInt8* image, uInt32 size, const Settings& se
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(32768u, size));
+ memcpy(myImage, image, std::min(32768u, size));
createCodeAccessBase(32768);
// Remember startup bank
@@ -38,12 +36,7 @@ CartridgeF4SC::CartridgeF4SC(const uInt8* image, uInt32 size, const Settings& se
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF4SC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 128; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 128);
+ initializeRAM(myRAM, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartF6.cxx b/src/emucore/CartF6.cxx
index ef904ec..c833e77 100644
--- a/src/emucore/CartF6.cxx
+++ b/src/emucore/CartF6.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartF6.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartF6.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartF6.hxx"
@@ -28,7 +26,7 @@ CartridgeF6::CartridgeF6(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(16384u, size));
+ memcpy(myImage, image, std::min(16384u, size));
createCodeAccessBase(16384);
// Remember startup bank
diff --git a/src/emucore/CartF6SC.cxx b/src/emucore/CartF6SC.cxx
index 20cc2b1..53c3da6 100644
--- a/src/emucore/CartF6SC.cxx
+++ b/src/emucore/CartF6SC.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartF6SC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartF6SC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartF6SC.hxx"
@@ -28,7 +26,7 @@ CartridgeF6SC::CartridgeF6SC(const uInt8* image, uInt32 size, const Settings& se
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(16384u, size));
+ memcpy(myImage, image, std::min(16384u, size));
createCodeAccessBase(16384);
// Remember startup bank
@@ -38,12 +36,7 @@ CartridgeF6SC::CartridgeF6SC(const uInt8* image, uInt32 size, const Settings& se
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF6SC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 128; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 128);
+ initializeRAM(myRAM, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartF8.cxx b/src/emucore/CartF8.cxx
index 3131a5f..2b1a84f 100644
--- a/src/emucore/CartF8.cxx
+++ b/src/emucore/CartF8.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartF8.cxx 3268 2016-01-30 00:57:04Z stephena $
+// $Id: CartF8.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartF8.hxx"
@@ -29,7 +27,7 @@ CartridgeF8::CartridgeF8(const uInt8* image, uInt32 size, const string& md5,
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(8192u, size));
+ memcpy(myImage, image, std::min(8192u, size));
createCodeAccessBase(8192);
// Normally bank 1 is the reset bank, unless we're dealing with ROMs
diff --git a/src/emucore/CartF8SC.cxx b/src/emucore/CartF8SC.cxx
index de4689b..7c78976 100644
--- a/src/emucore/CartF8SC.cxx
+++ b/src/emucore/CartF8SC.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartF8SC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartF8SC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartF8SC.hxx"
@@ -28,7 +26,7 @@ CartridgeF8SC::CartridgeF8SC(const uInt8* image, uInt32 size, const Settings& se
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(8192u, size));
+ memcpy(myImage, image, std::min(8192u, size));
createCodeAccessBase(8192);
// Remember startup bank
@@ -38,12 +36,7 @@ CartridgeF8SC::CartridgeF8SC(const uInt8* image, uInt32 size, const Settings& se
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF8SC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 128; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 128);
+ initializeRAM(myRAM, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx
index abfc7ff..de7ca9f 100644
--- a/src/emucore/CartFA.cxx
+++ b/src/emucore/CartFA.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartFA.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartFA.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartFA.hxx"
@@ -28,7 +26,7 @@ CartridgeFA::CartridgeFA(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(12288u, size));
+ memcpy(myImage, image, std::min(12288u, size));
createCodeAccessBase(12288);
// Remember startup bank
@@ -38,12 +36,7 @@ CartridgeFA::CartridgeFA(const uInt8* image, uInt32 size, const Settings& settin
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeFA::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 256; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 256);
+ initializeRAM(myRAM, 256);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartFA2.cxx b/src/emucore/CartFA2.cxx
index 235a491..6ee01f4 100644
--- a/src/emucore/CartFA2.cxx
+++ b/src/emucore/CartFA2.cxx
@@ -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 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartFA2.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
#include "OSystem.hxx"
@@ -47,12 +47,7 @@ CartridgeFA2::CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osyst
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeFA2::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 256; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 256);
+ initializeRAM(myRAM, 256);
// Upon reset we switch to the startup bank
bank(myStartBank);
diff --git a/src/emucore/CartFE.cxx b/src/emucore/CartFE.cxx
index 7f08854..84a7af7 100644
--- a/src/emucore/CartFE.cxx
+++ b/src/emucore/CartFE.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartFE.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartFE.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartFE.hxx"
@@ -30,7 +28,7 @@ CartridgeFE::CartridgeFE(const uInt8* image, uInt32 size, const Settings& settin
myLastAddressChanged(false)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(8192u, size));
+ memcpy(myImage, image, std::min(8192u, size));
// We use System::PageAccess.codeAccessBase, but don't allow its use
// through a pointer, since the address space of FE carts can change
diff --git a/src/emucore/CartMC.cxx b/src/emucore/CartMC.cxx
index c8cec2d..9e34fcb 100644
--- a/src/emucore/CartMC.cxx
+++ b/src/emucore/CartMC.cxx
@@ -14,11 +14,10 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartMC.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartMC.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
#include <cassert>
-#include <cstring>
#include "System.hxx"
#include "CartMC.hxx"
@@ -49,12 +48,7 @@ CartridgeMC::CartridgeMC(const uInt8* image, uInt32 size,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeMC::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 32768; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 32768);
+ initializeRAM(myRAM, 32768);
myBankChanged = true;
}
diff --git a/src/emucore/CartMDM.cxx b/src/emucore/CartMDM.cxx
index c9734f2..094f875 100644
--- a/src/emucore/CartMDM.cxx
+++ b/src/emucore/CartMDM.cxx
@@ -14,18 +14,15 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartMDM.cxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartMDM.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartMDM.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeMDM::CartridgeMDM(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings),
- myImage(nullptr),
mySize(size),
myCurrentBank(0),
myBankingDisabled(false)
diff --git a/src/emucore/CartMDM.hxx b/src/emucore/CartMDM.hxx
index e376802..b56cc32 100644
--- a/src/emucore/CartMDM.hxx
+++ b/src/emucore/CartMDM.hxx
@@ -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: CartMDM.hxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: CartMDM.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef CARTRIDGEMDM_HXX
@@ -163,7 +163,7 @@ class CartridgeMDM : public Cartridge
private:
// Pointer to a dynamically allocated ROM image of the cartridge
- unique_ptr<uInt8[]> myImage;
+ BytePtr myImage;
// Size of the ROM image
uInt32 mySize;
diff --git a/src/emucore/CartSB.cxx b/src/emucore/CartSB.cxx
index 79f5edc..25f488c 100644
--- a/src/emucore/CartSB.cxx
+++ b/src/emucore/CartSB.cxx
@@ -17,8 +17,6 @@
// $Id: CartSB.cxx,v 1.0 2007/10/11
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartSB.hxx"
@@ -26,7 +24,6 @@
CartridgeSB::CartridgeSB(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- myImage(nullptr),
mySize(size),
myCurrentBank(0)
{
diff --git a/src/emucore/CartSB.hxx b/src/emucore/CartSB.hxx
index d16f145..9448a06 100644
--- a/src/emucore/CartSB.hxx
+++ b/src/emucore/CartSB.hxx
@@ -152,7 +152,7 @@ class CartridgeSB : public Cartridge
private:
// The 128-256K ROM image and size of the cartridge
- unique_ptr<uInt8[]> myImage;
+ BytePtr myImage;
uInt32 mySize;
// Indicates which bank is currently active
diff --git a/src/emucore/CartUA.cxx b/src/emucore/CartUA.cxx
index db28da9..5c799b1 100644
--- a/src/emucore/CartUA.cxx
+++ b/src/emucore/CartUA.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartUA.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartUA.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "CartUA.hxx"
@@ -28,7 +26,7 @@ CartridgeUA::CartridgeUA(const uInt8* image, uInt32 size, const Settings& settin
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(8192u, size));
+ memcpy(myImage, image, std::min(8192u, size));
createCodeAccessBase(8192);
// Remember startup bank
diff --git a/src/emucore/CartWD.cxx b/src/emucore/CartWD.cxx
index 7884de1..77834aa 100644
--- a/src/emucore/CartWD.cxx
+++ b/src/emucore/CartWD.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartWD.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartWD.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "TIA.hxx"
#include "M6502.hxx"
#include "System.hxx"
@@ -28,7 +26,7 @@
CartridgeWD::CartridgeWD(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
- mySize(BSPF_min(8195u, size)),
+ mySize(std::min(8195u, size)),
myCyclesAtBankswitchInit(0),
myPendingBank(0),
myCurrentBank(0)
@@ -44,12 +42,7 @@ CartridgeWD::CartridgeWD(const uInt8* image, uInt32 size,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeWD::reset()
{
- // Initialize RAM
- if(mySettings.getBool("ramrandom"))
- for(uInt32 i = 0; i < 64; ++i)
- myRAM[i] = mySystem->randGenerator().next();
- else
- memset(myRAM, 0, 64);
+ initializeRAM(myRAM, 64);
myCyclesAtBankswitchInit = 0;
myPendingBank = 0xF0; // one more than the allowable bank #
diff --git a/src/emucore/CartX07.cxx b/src/emucore/CartX07.cxx
index 6701445..0d067cc 100644
--- a/src/emucore/CartX07.cxx
+++ b/src/emucore/CartX07.cxx
@@ -14,11 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: CartX07.cxx 3254 2016-01-23 18:16:09Z stephena $
+// $Id: CartX07.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cstring>
-
#include "System.hxx"
#include "M6532.hxx"
#include "TIA.hxx"
@@ -30,7 +28,7 @@ CartridgeX07::CartridgeX07(const uInt8* image, uInt32 size, const Settings& sett
myCurrentBank(0)
{
// Copy the ROM image into my buffer
- memcpy(myImage, image, BSPF_min(65536u, size));
+ memcpy(myImage, image, std::min(65536u, size));
createCodeAccessBase(65536);
// Remember startup bank
diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx
index cb2031c..8078e01 100644
--- a/src/emucore/Console.cxx
+++ b/src/emucore/Console.cxx
@@ -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: Console.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Console.cxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#include <cassert>
@@ -560,7 +560,7 @@ void Console::setTIAProperties()
myConsoleInfo.InitialFrameRate = "50";
// PAL ROMs normally need at least 250 lines
- height = BSPF_max(height, 250u);
+ height = std::max(height, 250u);
}
// Make sure these values fit within the bounds of the desktop
@@ -569,7 +569,7 @@ void Console::setTIAProperties()
if(height > dheight)
{
ystart += height - dheight;
- ystart = BSPF_min(ystart, 64u);
+ ystart = std::min(ystart, 64u);
height = dheight;
}
myTIA->setYStart(ystart);
@@ -619,7 +619,7 @@ void Console::setControllers(const string& rommd5)
{
leftC = make_ptr<Keyboard>(Controller::Left, myEvent, *mySystem);
}
- else if(BSPF_startsWithIgnoreCase(left, "PADDLES"))
+ else if(BSPF::startsWithIgnoreCase(left, "PADDLES"))
{
bool swapAxis = false, swapDir = false;
if(left == "PADDLES_IAXIS")
@@ -672,7 +672,7 @@ void Console::setControllers(const string& rommd5)
{
rightC = make_ptr<Keyboard>(Controller::Right, myEvent, *mySystem);
}
- else if(BSPF_startsWithIgnoreCase(right, "PADDLES"))
+ else if(BSPF::startsWithIgnoreCase(right, "PADDLES"))
{
bool swapAxis = false, swapDir = false;
if(right == "PADDLES_IAXIS")
@@ -746,16 +746,16 @@ void Console::setControllers(const string& rommd5)
void Console::loadUserPalette()
{
const string& palette = myOSystem.paletteFile();
- ifstream in(palette, ios::binary);
+ ifstream in(palette, std::ios::binary);
if(!in)
return;
// Make sure the contains enough data for the NTSC, PAL and SECAM palettes
// This means 128 colours each for NTSC and PAL, at 3 bytes per pixel
// and 8 colours for SECAM at 3 bytes per pixel
- in.seekg(0, ios::end);
- streampos length = in.tellg();
- in.seekg(0, ios::beg);
+ in.seekg(0, std::ios::end);
+ std::streampos length = in.tellg();
+ in.seekg(0, std::ios::beg);
if(length < 128 * 3 * 2 + 8 * 3)
{
cerr << "ERROR: invalid palette file " << palette << endl;
diff --git a/src/emucore/Console.hxx b/src/emucore/Console.hxx
index e8921ef..1f558a7 100644
--- a/src/emucore/Console.hxx
+++ b/src/emucore/Console.hxx
@@ -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: Console.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Console.hxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#ifndef CONSOLE_HXX
@@ -56,7 +56,7 @@ struct ConsoleInfo
This class represents the entire game console.
@author Bradford W. Mott
- @version $Id: Console.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: Console.hxx 3310 2016-08-18 18:44:57Z stephena $
*/
class Console : public Serializable
{
diff --git a/src/emucore/Control.cxx b/src/emucore/Control.cxx
index 6612ab4..75f1216 100644
--- a/src/emucore/Control.cxx
+++ b/src/emucore/Control.cxx
@@ -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: Control.cxx 3240 2015-12-29 21:28:10Z stephena $
+// $Id: Control.cxx 3299 2016-04-02 20:46:02Z stephena $
//============================================================================
#include <cassert>
@@ -168,9 +168,3 @@ bool Controller::load(Serializer& in)
}
return true;
}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const Int32 Controller::maximumResistance = 0x7FFFFFFF;
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const Int32 Controller::minimumResistance = 0x00000000;
diff --git a/src/emucore/Control.hxx b/src/emucore/Control.hxx
index 9eae55b..46346fe 100644
--- a/src/emucore/Control.hxx
+++ b/src/emucore/Control.hxx
@@ -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: Control.hxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Control.hxx 3299 2016-04-02 20:46:02Z stephena $
//============================================================================
#ifndef CONTROLLER_HXX
@@ -58,7 +58,7 @@ class System;
of the controller from the perspective of the controller's jack.
@author Bradford W. Mott
- @version $Id: Control.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: Control.hxx 3299 2016-04-02 20:46:02Z stephena $
*/
class Controller : public Serializable
{
@@ -235,10 +235,10 @@ class Controller : public Serializable
public:
/// Constant which represents maximum resistance for analog pins
- static const Int32 maximumResistance;
+ static constexpr Int32 maximumResistance = 0x7FFFFFFF;
/// Constant which represents minimum resistance for analog pins
- static const Int32 minimumResistance;
+ static constexpr Int32 minimumResistance = 0x00000000;
protected:
/// Specifies which jack the controller is plugged in
diff --git a/src/emucore/Device.hxx b/src/emucore/Device.hxx
index 610f8d6..7d8e83d 100644
--- a/src/emucore/Device.hxx
+++ b/src/emucore/Device.hxx
@@ -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: Device.hxx 3292 2016-02-27 22:18:30Z stephena $
+// $Id: Device.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef DEVICE_HXX
@@ -30,19 +30,12 @@ class System;
based system.
@author Bradford W. Mott
- @version $Id: Device.hxx 3292 2016-02-27 22:18:30Z stephena $
+ @version $Id: Device.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class Device : public Serializable
{
public:
- /**
- Create a new device
- */
Device() : mySystem(nullptr) { }
-
- /**
- Destructor
- */
virtual ~Device() = default;
public:
diff --git a/src/emucore/Driving.cxx b/src/emucore/Driving.cxx
index f1c0480..8f557b3 100644
--- a/src/emucore/Driving.cxx
+++ b/src/emucore/Driving.cxx
@@ -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: Driving.cxx 3240 2015-12-29 21:28:10Z stephena $
+// $Id: Driving.cxx 3300 2016-04-02 21:27:10Z stephena $
//============================================================================
#include "Event.hxx"
@@ -124,7 +124,7 @@ void Driving::update()
}
// Gray codes for rotation
- static const uInt8 graytable[] = { 0x03, 0x01, 0x00, 0x02 };
+ static constexpr uInt8 graytable[] = { 0x03, 0x01, 0x00, 0x02 };
// Determine which bits are set
uInt8 gray = graytable[myGrayIndex];
diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx
index 6151225..32194a4 100644
--- a/src/emucore/EventHandler.cxx
+++ b/src/emucore/EventHandler.cxx
@@ -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 3287 2016-02-24 20:49:49Z stephena $
+// $Id: EventHandler.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <sstream>
@@ -1797,7 +1797,8 @@ void EventHandler::takeSnapshot(uInt32 number)
if(number > 0)
{
ostringstream buf;
- buf << sspath << "_" << hex << setw(8) << setfill('0') << number << ".png";
+ buf << sspath << "_" << std::hex << std::setw(8) << std::setfill('0')
+ << number << ".png";
filename = buf.str();
}
else if(!myOSystem.settings().getBool("sssingle"))
@@ -1827,7 +1828,7 @@ void EventHandler::takeSnapshot(uInt32 number)
VariantList comments;
ostringstream version;
version << "Stella " << STELLA_VERSION << " (Build " << STELLA_BUILD << ") ["
- << BSPF_ARCH << "]";
+ << BSPF::ARCH << "]";
VarList::push_back(comments, "Software", version.str());
VarList::push_back(comments, "ROM Name", myOSystem.console().properties().get(Cartridge_Name));
VarList::push_back(comments, "ROM MD5", myOSystem.console().properties().get(Cartridge_MD5));
@@ -1879,9 +1880,9 @@ void EventHandler::setMouseControllerMode(const string& enable)
if(myOSystem.hasConsole())
{
bool usemouse = false;
- if(BSPF_equalsIgnoreCase(enable, "always"))
+ if(BSPF::equalsIgnoreCase(enable, "always"))
usemouse = true;
- else if(BSPF_equalsIgnoreCase(enable, "never"))
+ else if(BSPF::equalsIgnoreCase(enable, "never"))
usemouse = false;
else // 'analog'
{
diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx
index e8f4928..9d5597e 100644
--- a/src/emucore/EventHandler.hxx
+++ b/src/emucore/EventHandler.hxx
@@ -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.hxx 3287 2016-02-24 20:49:49Z stephena $
+// $Id: EventHandler.hxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#ifndef EVENTHANDLER_HXX
@@ -76,7 +76,7 @@ enum EventMode {
mapping can take place.
@author Stephen Anthony
- @version $Id: EventHandler.hxx 3287 2016-02-24 20:49:49Z stephena $
+ @version $Id: EventHandler.hxx 3308 2016-05-24 16:55:45Z stephena $
*/
class EventHandler
{
@@ -448,8 +448,8 @@ class EventHandler
};
public:
- using StickDatabase = map<string,StickInfo>;
- using StickList = map<int, StellaJoystick*>;
+ using StickDatabase = std::map<string,StickInfo>;
+ using StickList = std::map<int, StellaJoystick*>;
JoystickHandler(OSystem& system);
~JoystickHandler();
diff --git a/src/emucore/EventJoyHandler.cxx b/src/emucore/EventJoyHandler.cxx
index f3716d6..e5b7f75 100644
--- a/src/emucore/EventJoyHandler.cxx
+++ b/src/emucore/EventJoyHandler.cxx
@@ -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: EventJoyHandler.cxx 3273 2016-02-06 21:06:23Z stephena $
+// $Id: EventJoyHandler.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include <sstream>
@@ -290,7 +290,7 @@ bool EventHandler::JoystickHandler::add(StellaJoystick* stick)
// Figure out what type of joystick this is
bool specialAdaptor = false;
- if(BSPF_containsIgnoreCase(stick->name, "2600-daptor"))
+ if(BSPF::containsIgnoreCase(stick->name, "2600-daptor"))
{
// 2600-daptorII devices have 3 axes and 12 buttons, and the value of the z-axis
// determines how those 12 buttons are used (not all buttons are used in all modes)
@@ -305,7 +305,7 @@ bool EventHandler::JoystickHandler::add(StellaJoystick* stick)
specialAdaptor = true;
}
- else if(BSPF_containsIgnoreCase(stick->name, "Stelladaptor"))
+ else if(BSPF::containsIgnoreCase(stick->name, "Stelladaptor"))
{
stick->name = "Stelladaptor";
specialAdaptor = true;
@@ -317,7 +317,7 @@ bool EventHandler::JoystickHandler::add(StellaJoystick* stick)
// we append ' #x', where 'x' increases consecutively
int count = 0;
for(const auto& i: myDatabase)
- if(BSPF_startsWithIgnoreCase(i.first, stick->name) && i.second.joy)
+ if(BSPF::startsWithIgnoreCase(i.first, stick->name) && i.second.joy)
++count;
if(count > 0)
@@ -411,14 +411,14 @@ void EventHandler::JoystickHandler::mapStelladaptors(const string& saport)
// in setupJoysticks take care of that
int saCount = 0;
int saOrder[2] = { 1, 2 };
- if(BSPF_equalsIgnoreCase(saport, "rl"))
+ if(BSPF::equalsIgnoreCase(saport, "rl"))
{
saOrder[0] = 2; saOrder[1] = 1;
}
for(auto& stick: mySticks)
{
- if(BSPF_startsWithIgnoreCase(stick.second->name, "Stelladaptor"))
+ if(BSPF::startsWithIgnoreCase(stick.second->name, "Stelladaptor"))
{
if(saOrder[saCount] == 1)
{
@@ -432,7 +432,7 @@ void EventHandler::JoystickHandler::mapStelladaptors(const string& saport)
}
saCount++;
}
- else if(BSPF_startsWithIgnoreCase(stick.second->name, "2600-daptor"))
+ else if(BSPF::startsWithIgnoreCase(stick.second->name, "2600-daptor"))
{
if(saOrder[saCount] == 1)
{
diff --git a/src/emucore/FBSurface.cxx b/src/emucore/FBSurface.cxx
index ee28a40..9715f5c 100644
--- a/src/emucore/FBSurface.cxx
+++ b/src/emucore/FBSurface.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: FBSurface.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "FrameBuffer.hxx"
@@ -43,8 +43,8 @@ void FBSurface::readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) c
memcpy(buffer, src, width() * height() * 4);
else
{
- uInt32 w = BSPF_min(rect.width(), width());
- uInt32 h = BSPF_min(rect.height(), height());
+ uInt32 w = std::min(rect.width(), width());
+ uInt32 h = std::min(rect.height(), height());
// Copy 'height' lines of width 'pitch' (in bytes for both)
uInt8* dst = buffer;
diff --git a/src/emucore/FSNode.cxx b/src/emucore/FSNode.cxx
index 8c4ca0e..607f6f1 100644
--- a/src/emucore/FSNode.cxx
+++ b/src/emucore/FSNode.cxx
@@ -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: FSNode.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: FSNode.cxx 3302 2016-04-02 23:47:46Z stephena $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -43,7 +43,7 @@ FilesystemNode::FilesystemNode(const string& p)
AbstractFSNode* tmp = nullptr;
// Is this potentially a ZIP archive?
- if(BSPF_containsIgnoreCase(p, ".zip"))
+ if(BSPF::containsIgnoreCase(p, ".zip"))
tmp = FilesystemNodeFactory::create(p, FilesystemNodeFactory::ZIP);
else
tmp = FilesystemNodeFactory::create(p, FilesystemNodeFactory::SYSTEM);
diff --git a/src/emucore/FSNode.hxx b/src/emucore/FSNode.hxx
index d209cb6..b129813 100644
--- a/src/emucore/FSNode.hxx
+++ b/src/emucore/FSNode.hxx
@@ -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: FSNode.hxx 3240 2015-12-29 21:28:10Z stephena $
+// $Id: FSNode.hxx 3302 2016-04-02 23:47:46Z stephena $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -110,7 +110,7 @@ class FilesystemNode
if (isDirectory() != node.isDirectory())
return isDirectory();
- return BSPF_compareIgnoreCase(getName(), node.getName()) < 0;
+ return BSPF::compareIgnoreCase(getName(), node.getName()) < 0;
}
/**
@@ -119,7 +119,7 @@ class FilesystemNode
*/
inline bool operator==(const FilesystemNode& node) const
{
- return BSPF_compareIgnoreCase(getName(), node.getName()) == 0;
+ return BSPF::compareIgnoreCase(getName(), node.getName()) == 0;
}
/**
@@ -285,10 +285,6 @@ class AbstractFSNode
// AbstractFSNode(AbstractFSNode&&) = default;
AbstractFSNode& operator=(const AbstractFSNode&) = default;
// AbstractFSNode& operator=(AbstractFSNode&&) = default;
-
- /**
- * Destructor.
- */
virtual ~AbstractFSNode() { }
/*
diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx
index 50a6c40..b8a8469 100644
--- a/src/emucore/FrameBuffer.cxx
+++ b/src/emucore/FrameBuffer.cxx
@@ -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 3271 2016-01-31 03:57:08Z stephena $
+// $Id: FrameBuffer.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include <algorithm>
@@ -72,8 +72,8 @@ bool FrameBuffer::initialize()
query_h = s.h;
}
// Various parts of the codebase assume a minimum screen size
- myDesktopSize.w = BSPF_max(query_w, uInt32(kFBMinW));
- myDesktopSize.h = BSPF_max(query_h, uInt32(kFBMinH));
+ myDesktopSize.w = std::max(query_w, uInt32(kFBMinW));
+ myDesktopSize.h = std::max(query_h, uInt32(kFBMinH));
////////////////////////////////////////////////////////////////////
// Create fonts to draw text
@@ -275,7 +275,7 @@ void FrameBuffer::update()
{
const ConsoleInfo& info = myOSystem.console().about();
char msg[30];
- BSPF_snprintf(msg, 30, "%3u @ %3.2ffps => %s",
+ std::snprintf(msg, 30, "%3u @ %3.2ffps => %s",
myOSystem.console().tia().scanlines(),
myOSystem.console().getFramerate(), info.DisplayFormat.c_str());
myStatsMsg.surface->fillRect(0, 0, myStatsMsg.w, myStatsMsg.h, kBGColor);
@@ -743,10 +743,10 @@ VideoMode::VideoMode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh,
zoom(z),
description(desc)
{
- sw = BSPF_max(sw, uInt32(FrameBuffer::kTIAMinW));
- sh = BSPF_max(sh, uInt32(FrameBuffer::kTIAMinH));
- iw = BSPF_min(iw, sw);
- ih = BSPF_min(ih, sh);
+ sw = std::max(sw, uInt32(FrameBuffer::kTIAMinW));
+ sh = std::max(sh, uInt32(FrameBuffer::kTIAMinH));
+ iw = std::min(iw, sw);
+ ih = std::min(ih, sh);
int ix = (sw - iw) >> 1;
int iy = (sh - ih) >> 1;
image = GUI::Rect(ix, iy, ix+iw, iy+ih);
@@ -801,8 +801,8 @@ void VideoMode::applyAspectCorrection(uInt32 aspect, bool stretch)
}
// Now re-calculate the dimensions
- iw = BSPF_min(iw, screen.w);
- ih = BSPF_min(ih, screen.h);
+ iw = std::min(iw, screen.w);
+ ih = std::min(ih, screen.h);
image.moveTo((screen.w - iw) >> 1, (screen.h - ih) >> 1);
image.setWidth(iw);
diff --git a/src/emucore/Joystick.cxx b/src/emucore/Joystick.cxx
index 4d7b913..fa13d8c 100644
--- a/src/emucore/Joystick.cxx
+++ b/src/emucore/Joystick.cxx
@@ -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: Joystick.cxx 3240 2015-12-29 21:28:10Z stephena $
+// $Id: Joystick.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "Event.hxx"
@@ -136,8 +136,7 @@ bool Joystick::setMouseControl(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Joystick::setDeadZone(int deadzone)
{
- if(deadzone < 0) deadzone = 0;
- if(deadzone > 29) deadzone = 29;
+ deadzone = BSPF::clamp(deadzone, 0, 29);
_DEAD_ZONE = 3200 + deadzone * 1000;
}
diff --git a/src/emucore/KidVid.hxx b/src/emucore/KidVid.hxx
index a1dafae..dc51da2 100644
--- a/src/emucore/KidVid.hxx
+++ b/src/emucore/KidVid.hxx
@@ -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: KidVid.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: KidVid.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef KIDVID_HXX
@@ -36,7 +36,7 @@
This code was heavily borrowed from z26.
@author Stephen Anthony & z26 team
- @version $Id: KidVid.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: KidVid.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class KidVid : public Controller
{
@@ -51,10 +51,6 @@ class KidVid : public Controller
*/
KidVid(Jack jack, const Event& event, const System& system,
const string& md5sum);
-
- /**
- Destructor
- */
virtual ~KidVid();
public:
diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx
index a0cdc70..f734e68 100644
--- a/src/emucore/M6502.cxx
+++ b/src/emucore/M6502.cxx
@@ -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: M6502.cxx 3240 2015-12-29 21:28:10Z stephena $
+// $Id: M6502.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#ifdef DEBUGGER_SUPPORT
@@ -83,15 +83,15 @@ void M6502::reset()
// Set registers to random or default values
const string& cpurandom = mySettings.getString("cpurandom");
- SP = BSPF_containsIgnoreCase(cpurandom, "S") ?
+ SP = BSPF::containsIgnoreCase(cpurandom, "S") ?
mySystem->randGenerator().next() : 0xff;
- A = BSPF_containsIgnoreCase(cpurandom, "A") ?
+ A = BSPF::containsIgnoreCase(cpurandom, "A") ?
mySystem->randGenerator().next() : 0x00;
- X = BSPF_containsIgnoreCase(cpurandom, "X") ?
+ X = BSPF::containsIgnoreCase(cpurandom, "X") ?
mySystem->randGenerator().next() : 0x00;
- Y = BSPF_containsIgnoreCase(cpurandom, "Y") ?
+ Y = BSPF::containsIgnoreCase(cpurandom, "Y") ?
mySystem->randGenerator().next() : 0x00;
- PS(BSPF_containsIgnoreCase(cpurandom, "P") ?
+ PS(BSPF::containsIgnoreCase(cpurandom, "P") ?
mySystem->randGenerator().next() : 0x20);
// Reset access flag
diff --git a/src/emucore/M6502.hxx b/src/emucore/M6502.hxx
index 4aeb32d..aa0a8ab 100644
--- a/src/emucore/M6502.hxx
+++ b/src/emucore/M6502.hxx
@@ -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: M6502.hxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: M6502.hxx 3299 2016-04-02 20:46:02Z stephena $
//============================================================================
#ifndef M6502_HXX
@@ -45,7 +45,7 @@ class Settings;
effects and for games which are very time sensitive.
@author Bradford W. Mott
- @version $Id: M6502.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: M6502.hxx 3299 2016-04-02 20:46:02Z stephena $
*/
class M6502 : public Serializable
{
@@ -329,7 +329,7 @@ class M6502 : public Serializable
uInt16 myDataAddressForPoke;
/// Indicates the number of system cycles per processor cycle
- static const uInt32 SYSTEM_CYCLES_PER_CPU = 1;
+ static constexpr uInt32 SYSTEM_CYCLES_PER_CPU = 1;
#ifdef DEBUGGER_SUPPORT
Int32 evalCondBreaks() {
diff --git a/src/emucore/M6532.cxx b/src/emucore/M6532.cxx
index c697302..cd30cbe 100644
--- a/src/emucore/M6532.cxx
+++ b/src/emucore/M6532.cxx
@@ -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 3240 2015-12-29 21:28:10Z stephena $
+// $Id: M6532.cxx 3300 2016-04-02 21:27:10Z stephena $
//============================================================================
#include <cassert>
@@ -284,7 +284,7 @@ bool M6532::poke(uInt16 addr, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void M6532::setTimerRegister(uInt8 value, uInt8 interval)
{
- static const uInt8 shift[] = { 0, 3, 6, 10 };
+ static constexpr uInt8 shift[] = { 0, 3, 6, 10 };
myIntervalShift = shift[interval];
myOutTimer[interval] = value;
diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx
index 0265428..9934243 100644
--- a/src/emucore/MT24LC256.cxx
+++ b/src/emucore/MT24LC256.cxx
@@ -14,12 +14,10 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: MT24LC256.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: MT24LC256.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cassert>
#include <cstdio>
-#include <cstring>
#include <fstream>
#include "System.hxx"
@@ -73,14 +71,14 @@ MT24LC256::MT24LC256(const string& filename, const System& system)
jpee_ad_known(0)
{
// Load the data from an external file (if it exists)
- ifstream in(myDataFile, ios_base::binary);
+ ifstream in(myDataFile, std::ios_base::binary);
if(in.is_open())
{
// Get length of file; it must be 32768
- in.seekg(0, ios::end);
+ in.seekg(0, std::ios::end);
if(uInt32(in.tellg()) == 32768u)
{
- in.seekg(0, ios::beg);
+ in.seekg(0, std::ios::beg);
in.read(reinterpret_cast<char*>(myData), 32768);
myDataFileExists = true;
}
@@ -98,7 +96,7 @@ MT24LC256::~MT24LC256()
// Save EEPROM data to external file only when necessary
if(!myDataFileExists || myDataChanged)
{
- ofstream out(myDataFile, ios_base::binary);
+ ofstream out(myDataFile, std::ios_base::binary);
if(out.is_open())
out.write(reinterpret_cast<char*>(myData), 32768);
}
diff --git a/src/emucore/MT24LC256.hxx b/src/emucore/MT24LC256.hxx
index 2ce324b..9992b73 100644
--- a/src/emucore/MT24LC256.hxx
+++ b/src/emucore/MT24LC256.hxx
@@ -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: MT24LC256.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: MT24LC256.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef MT24LC256_HXX
@@ -31,7 +31,7 @@ class System;
(aka Supercat) for the bulk of this code.
@author Stephen Anthony & J. Payson
- @version $Id: MT24LC256.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: MT24LC256.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class MT24LC256
{
@@ -43,10 +43,6 @@ class MT24LC256
@param system The system using the controller of this device
*/
MT24LC256(const string& filename, const System& system);
-
- /**
- Destructor
- */
~MT24LC256();
public:
diff --git a/src/emucore/NullDev.hxx b/src/emucore/NullDev.hxx
index 165a27f..5432131 100644
--- a/src/emucore/NullDev.hxx
+++ b/src/emucore/NullDev.hxx
@@ -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: NullDev.hxx 3240 2015-12-29 21:28:10Z stephena $
+// $Id: NullDev.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef NULLDEVICE_HXX
@@ -31,19 +31,12 @@ class System;
holes in the address space (i.e. no real device attached).
@author Bradford W. Mott
- @version $Id: NullDev.hxx 3240 2015-12-29 21:28:10Z stephena $
+ @version $Id: NullDev.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class NullDevice : public Device
{
public:
- /**
- Create a new null device
- */
NullDevice() = default;
-
- /**
- Destructor
- */
virtual ~NullDevice() = default;
public:
diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx
index 75a64ae..f036b41 100644
--- a/src/emucore/OSystem.cxx
+++ b/src/emucore/OSystem.cxx
@@ -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: OSystem.cxx 3249 2016-01-18 16:03:22Z stephena $
+// $Id: OSystem.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <cassert>
@@ -87,7 +87,7 @@ OSystem::OSystem()
info << "Build " << STELLA_BUILD << ", using SDL " << int(ver.major)
<< "." << int(ver.minor) << "."<< int(ver.patch)
- << " [" << BSPF_ARCH << "]";
+ << " [" << BSPF::ARCH << "]";
myBuildInfo = info.str();
mySettings = MediaFactory::createSettings(*this);
@@ -369,27 +369,27 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
myEventHandler->handleEvent(Event::ConsoleSelect, 1);
const string& holdjoy0 = mySettings->getString("holdjoy0");
- if(BSPF_containsIgnoreCase(holdjoy0, "U"))
+ if(BSPF::containsIgnoreCase(holdjoy0, "U"))
myEventHandler->handleEvent(Event::JoystickZeroUp, 1);
- if(BSPF_containsIgnoreCase(holdjoy0, "D"))
+ if(BSPF::containsIgnoreCase(holdjoy0, "D"))
myEventHandler->handleEvent(Event::JoystickZeroDown, 1);
- if(BSPF_containsIgnoreCase(holdjoy0, "L"))
+ if(BSPF::containsIgnoreCase(holdjoy0, "L"))
myEventHandler->handleEvent(Event::JoystickZeroLeft, 1);
- if(BSPF_containsIgnoreCase(holdjoy0, "R"))
+ if(BSPF::containsIgnoreCase(holdjoy0, "R"))
myEventHandler->handleEvent(Event::JoystickZeroRight, 1);
- if(BSPF_containsIgnoreCase(holdjoy0, "F"))
+ if(BSPF::containsIgnoreCase(holdjoy0, "F"))
myEventHandler->handleEvent(Event::JoystickZeroFire, 1);
const string& holdjoy1 = mySettings->getString("holdjoy1");
- if(BSPF_containsIgnoreCase(holdjoy1, "U"))
+ if(BSPF::containsIgnoreCase(holdjoy1, "U"))
myEventHandler->handleEvent(Event::JoystickOneUp, 1);
- if(BSPF_containsIgnoreCase(holdjoy1, "D"))
+ if(BSPF::containsIgnoreCase(holdjoy1, "D"))
myEventHandler->handleEvent(Event::JoystickOneDown, 1);
- if(BSPF_containsIgnoreCase(holdjoy1, "L"))
+ if(BSPF::containsIgnoreCase(holdjoy1, "L"))
myEventHandler->handleEvent(Event::JoystickOneLeft, 1);
- if(BSPF_containsIgnoreCase(holdjoy1, "R"))
+ if(BSPF::containsIgnoreCase(holdjoy1, "R"))
myEventHandler->handleEvent(Event::JoystickOneRight, 1);
- if(BSPF_containsIgnoreCase(holdjoy1, "F"))
+ if(BSPF::containsIgnoreCase(holdjoy1, "F"))
myEventHandler->handleEvent(Event::JoystickOneFire, 1);
#ifdef DEBUGGER_SUPPORT
if(mySettings->getBool("debug"))
@@ -465,13 +465,13 @@ void OSystem::logMessage(const string& message, uInt8 level)
{
if(level == 0)
{
- cout << message << endl << flush;
+ cout << message << endl << std::flush;
myLogMessages += message + "\n";
}
else if(level <= uInt8(mySettings->getInt("loglevel")))
{
if(mySettings->getBool("logtoconsole"))
- cout << message << endl << flush;
+ cout << message << endl << std::flush;
myLogMessages += message + "\n";
}
}
diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx
index b0c3ba1..3b77832 100644
--- a/src/emucore/OSystem.hxx
+++ b/src/emucore/OSystem.hxx
@@ -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: OSystem.hxx 3249 2016-01-18 16:03:22Z stephena $
+// $Id: OSystem.hxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#ifndef OSYSTEM_HXX
@@ -55,7 +55,7 @@ struct TimingInfo {
other objects belong.
@author Stephen Anthony
- @version $Id: OSystem.hxx 3249 2016-01-18 16:03:22Z stephena $
+ @version $Id: OSystem.hxx 3302 2016-04-02 23:47:46Z stephena $
*/
class OSystem
{
@@ -63,14 +63,7 @@ class OSystem
friend class VideoDialog;
public:
- /**
- Create a new OSystem abstract class
- */
OSystem();
-
- /**
- Destructor
- */
virtual ~OSystem();
/**
@@ -417,8 +410,8 @@ class OSystem
that usually isn't user-modifiable), we create a special method
for it.
*/
- virtual string defaultSnapSaveDir() { return "~" BSPF_PATH_SEPARATOR; }
- virtual string defaultSnapLoadDir() { return "~" BSPF_PATH_SEPARATOR; }
+ virtual string defaultSnapSaveDir() { return string("~") + BSPF::PATH_SEPARATOR; }
+ virtual string defaultSnapLoadDir() { return string("~") + BSPF::PATH_SEPARATOR; }
protected:
/**
diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx
index d504c67..cca8938 100644
--- a/src/emucore/Paddles.cxx
+++ b/src/emucore/Paddles.cxx
@@ -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: Paddles.cxx 3260 2016-01-24 22:09:35Z stephena $
+// $Id: Paddles.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "Event.hxx"
@@ -276,7 +276,7 @@ void Paddles::update()
if(myMPaddleID > -1)
{
// We're in auto mode, where a single axis is used for one paddle only
- myCharge[myMPaddleID] = BSPF_clamp(myCharge[myMPaddleID] -
+ myCharge[myMPaddleID] = BSPF::clamp(myCharge[myMPaddleID] -
(myEvent.get(myAxisMouseMotion) * MOUSE_SENSITIVITY),
TRIGMIN, TRIGRANGE);
if(myEvent.get(Event::MouseButtonLeftValue) ||
@@ -289,7 +289,7 @@ void Paddles::update()
// mapped to a separate paddle
if(myMPaddleIDX > -1)
{
- myCharge[myMPaddleIDX] = BSPF_clamp(myCharge[myMPaddleIDX] -
+ myCharge[myMPaddleIDX] = BSPF::clamp(myCharge[myMPaddleIDX] -
(myEvent.get(Event::MouseAxisXValue) * MOUSE_SENSITIVITY),
TRIGMIN, TRIGRANGE);
if(myEvent.get(Event::MouseButtonLeftValue))
@@ -297,7 +297,7 @@ void Paddles::update()
}
if(myMPaddleIDY > -1)
{
- myCharge[myMPaddleIDY] = BSPF_clamp(myCharge[myMPaddleIDY] -
+ myCharge[myMPaddleIDY] = BSPF::clamp(myCharge[myMPaddleIDY] -
(myEvent.get(Event::MouseAxisYValue) * MOUSE_SENSITIVITY),
TRIGMIN, TRIGRANGE);
if(myEvent.get(Event::MouseButtonRightValue))
@@ -397,20 +397,20 @@ bool Paddles::setMouseControl(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Paddles::setDigitalSensitivity(int sensitivity)
{
- DIGITAL_SENSITIVITY = BSPF_clamp(sensitivity, 1, MAX_DIGITAL_SENSE);
+ DIGITAL_SENSITIVITY = BSPF::clamp(sensitivity, 1, MAX_DIGITAL_SENSE);
DIGITAL_DISTANCE = 20 + (DIGITAL_SENSITIVITY << 3);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Paddles::setMouseSensitivity(int sensitivity)
{
- MOUSE_SENSITIVITY = BSPF_clamp(sensitivity, 1, MAX_MOUSE_SENSE);
+ MOUSE_SENSITIVITY = BSPF::clamp(sensitivity, 1, MAX_MOUSE_SENSE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Paddles::setPaddleRange(int range)
{
- range = BSPF_clamp(range, 1, 100);
+ range = BSPF::clamp(range, 1, 100);
TRIGRANGE = int(TRIGMAX * (range / 100.0));
}
diff --git a/src/emucore/Paddles.hxx b/src/emucore/Paddles.hxx
index b73880e..2dc8cf6 100644
--- a/src/emucore/Paddles.hxx
+++ b/src/emucore/Paddles.hxx
@@ -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: Paddles.hxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Paddles.hxx 3300 2016-04-02 21:27:10Z stephena $
//============================================================================
#ifndef PADDLES_HXX
@@ -28,7 +28,7 @@
The standard Atari 2600 pair of paddle controllers.
@author Bradford W. Mott
- @version $Id: Paddles.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: Paddles.hxx 3300 2016-04-02 21:27:10Z stephena $
*/
class Paddles : public Controller
{
diff --git a/src/emucore/Props.cxx b/src/emucore/Props.cxx
index be42c95..cc84bd4 100644
--- a/src/emucore/Props.cxx
+++ b/src/emucore/Props.cxx
@@ -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: Props.cxx 3248 2016-01-16 00:13:52Z stephena $
+// $Id: Props.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include <cctype>
@@ -42,7 +42,7 @@ void Properties::set(PropertyType key, const string& value)
if(key != LastPropType)
{
myProperties[key] = value;
- if(BSPF_equalsIgnoreCase(myProperties[key], "AUTO-DETECT"))
+ if(BSPF::equalsIgnoreCase(myProperties[key], "AUTO-DETECT"))
myProperties[key] = "AUTO";
switch(key)
diff --git a/src/emucore/PropsSet.cxx b/src/emucore/PropsSet.cxx
index d125cd3..949a4e4 100644
--- a/src/emucore/PropsSet.cxx
+++ b/src/emucore/PropsSet.cxx
@@ -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: PropsSet.cxx 3248 2016-01-16 00:13:52Z stephena $
+// $Id: PropsSet.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include <fstream>
@@ -101,7 +101,7 @@ bool PropertiesSet::getMD5(const string& md5, Properties& properties,
while(low <= high)
{
int i = (low + high) / 2;
- int cmp = BSPF_compareIgnoreCase(md5, DefProps[i][Cartridge_MD5]);
+ int cmp = BSPF::compareIgnoreCase(md5, DefProps[i][Cartridge_MD5]);
if(cmp == 0) // found it
{
diff --git a/src/emucore/PropsSet.hxx b/src/emucore/PropsSet.hxx
index 3b54a91..48e3942 100644
--- a/src/emucore/PropsSet.hxx
+++ b/src/emucore/PropsSet.hxx
@@ -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: PropsSet.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: PropsSet.hxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#ifndef PROPERTIES_SET_HXX
@@ -117,7 +117,7 @@ class PropertiesSet
void print() const;
private:
- using PropsList = map<string, Properties>;
+ using PropsList = std::map<string, Properties>;
// The properties read from an external 'stella.pro' file
PropsList myExternalProps;
diff --git a/src/emucore/Serializer.cxx b/src/emucore/Serializer.cxx
index 7a8b16a..4e043bb 100644
--- a/src/emucore/Serializer.cxx
+++ b/src/emucore/Serializer.cxx
@@ -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: Serializer.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Serializer.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <fstream>
@@ -23,6 +23,9 @@
#include "FSNode.hxx"
#include "Serializer.hxx"
+using std::ios;
+using std::ios_base;
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Serializer::Serializer(const string& filename, bool readonly)
: myStream(nullptr)
diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx
index 417de2c..1b6a4e3 100644
--- a/src/emucore/Settings.cxx
+++ b/src/emucore/Settings.cxx
@@ -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 3277 2016-02-12 14:28:30Z stephena $
+// $Id: Settings.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
#include <cassert>
@@ -472,7 +472,7 @@ void Settings::usage() const
<< " -pp <arg> Sets the 'Display.Phosphor' property\n"
<< " -ppblend <arg> Sets the 'Display.PPBlend' property\n"
#endif
- << endl << flush;
+ << endl << std::flush;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/emucore/Sound.hxx b/src/emucore/Sound.hxx
index 25103b5..4c3725d 100644
--- a/src/emucore/Sound.hxx
+++ b/src/emucore/Sound.hxx
@@ -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: Sound.hxx 3258 2016-01-23 22:56:16Z stephena $
+// $Id: Sound.hxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#ifndef SOUND_HXX
@@ -30,7 +30,7 @@ class OSystem;
It has no functionality whatsoever.
@author Stephen Anthony
- @version $Id: Sound.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: Sound.hxx 3310 2016-08-18 18:44:57Z stephena $
*/
class Sound : public Serializable
{
diff --git a/src/emucore/System.hxx b/src/emucore/System.hxx
index ff7b2e4..5e76786 100644
--- a/src/emucore/System.hxx
+++ b/src/emucore/System.hxx
@@ -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 3258 2016-01-23 22:56:16Z stephena $
+// $Id: System.hxx 3299 2016-04-02 20:46:02Z stephena $
//============================================================================
#ifndef SYSTEM_HXX
@@ -43,7 +43,7 @@ class NullDevice;
6507 based system and 65536 (2^16) bytes for a 6502 based system.
@author Bradford W. Mott
- @version $Id: System.hxx 3258 2016-01-23 22:56:16Z stephena $
+ @version $Id: System.hxx 3299 2016-04-02 20:46:02Z stephena $
*/
class System : public Serializable
{
@@ -57,16 +57,16 @@ class System : public Serializable
virtual ~System() = default;
// Mask to apply to an address before accessing memory
- static const uInt16 ADDRESS_MASK = (1 << 13) - 1;
+ static constexpr uInt16 ADDRESS_MASK = (1 << 13) - 1;
// Amount to shift an address by to determine what page it's on
- static const uInt16 PAGE_SHIFT = 6;
+ static constexpr uInt16 PAGE_SHIFT = 6;
// Mask to apply to an address to obtain its page offset
- static const uInt16 PAGE_MASK = (1 << PAGE_SHIFT) - 1;
+ static constexpr uInt16 PAGE_MASK = (1 << PAGE_SHIFT) - 1;
// Number of pages in the system
- static const uInt16 NUM_PAGES = 1 << (13 - PAGE_SHIFT);
+ static constexpr uInt16 NUM_PAGES = 1 << (13 - PAGE_SHIFT);
public:
/**
diff --git a/src/emucore/TIA.cxx b/src/emucore/TIA.cxx
index 0f84a47..f3a1d0c 100644
--- a/src/emucore/TIA.cxx
+++ b/src/emucore/TIA.cxx
@@ -14,13 +14,9 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: TIA.cxx 3276 2016-02-12 14:23:40Z stephena $
+// $Id: TIA.cxx 3316 2016-08-24 23:57:07Z stephena $
//============================================================================
-#include <cassert>
-#include <cstdlib>
-#include <cstring>
-
#include "bspf.hxx"
#ifdef DEBUGGER_SUPPORT
@@ -194,10 +190,10 @@ void TIA::frameReset()
// In any event, at most 320 lines can be processed
uInt32 scanlines = myFrameYStart + myFrameHeight;
if(myMaximumNumberOfScanlines == 290)
- scanlines = BSPF_max(scanlines, 262u); // NTSC
+ scanlines = std::max(scanlines, 262u); // NTSC
else
- scanlines = BSPF_max(scanlines, 312u); // PAL
- myStopDisplayOffset = 228 * BSPF_min(scanlines, 320u);
+ scanlines = std::max(scanlines, 312u); // PAL
+ myStopDisplayOffset = 228 * std::min(scanlines, 320u);
// Reasonable values to start and stop the current frame drawing
myClockWhenFrameStarted = mySystem->cycles() * 3;
@@ -2294,12 +2290,12 @@ void TIA::pokeHMP0(uInt8 value, Int32 clock)
// Check if HMOVE is currently active
if(myCurrentHMOVEPos != 0x7FFFFFFF &&
- hpos < BSPF_min(myCurrentHMOVEPos + 6 + myMotionClockP0 * 4, 7))
+ hpos < std::min(myCurrentHMOVEPos + 6 + myMotionClockP0 * 4, 7))
{
Int32 newMotion = (value ^ 0x80) >> 4;
// Check if new horizontal move can still be applied normally
if(newMotion > myMotionClockP0 ||
- hpos <= BSPF_min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
+ hpos <= std::min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
{
myPOSP0 -= (newMotion - myMotionClockP0);
myMotionClockP0 = newMotion;
@@ -2328,12 +2324,12 @@ void TIA::pokeHMP1(uInt8 value, Int32 clock)
// Check if HMOVE is currently active
if(myCurrentHMOVEPos != 0x7FFFFFFF &&
- hpos < BSPF_min(myCurrentHMOVEPos + 6 + myMotionClockP1 * 4, 7))
+ hpos < std::min(myCurrentHMOVEPos + 6 + myMotionClockP1 * 4, 7))
{
Int32 newMotion = (value ^ 0x80) >> 4;
// Check if new horizontal move can still be applied normally
if(newMotion > myMotionClockP1 ||
- hpos <= BSPF_min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
+ hpos <= std::min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
{
myPOSP1 -= (newMotion - myMotionClockP1);
myMotionClockP1 = newMotion;
@@ -2362,12 +2358,12 @@ void TIA::pokeHMM0(uInt8 value, Int32 clock)
// Check if HMOVE is currently active
if(myCurrentHMOVEPos != 0x7FFFFFFF &&
- hpos < BSPF_min(myCurrentHMOVEPos + 6 + myMotionClockM0 * 4, 7))
+ hpos < std::min(myCurrentHMOVEPos + 6 + myMotionClockM0 * 4, 7))
{
Int32 newMotion = (value ^ 0x80) >> 4;
// Check if new horizontal move can still be applied normally
if(newMotion > myMotionClockM0 ||
- hpos <= BSPF_min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
+ hpos <= std::min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
{
myPOSM0 -= (newMotion - myMotionClockM0);
myMotionClockM0 = newMotion;
@@ -2395,12 +2391,12 @@ void TIA::pokeHMM1(uInt8 value, Int32 clock)
// Check if HMOVE is currently active
if(myCurrentHMOVEPos != 0x7FFFFFFF &&
- hpos < BSPF_min(myCurrentHMOVEPos + 6 + myMotionClockM1 * 4, 7))
+ hpos < std::min(myCurrentHMOVEPos + 6 + myMotionClockM1 * 4, 7))
{
Int32 newMotion = (value ^ 0x80) >> 4;
// Check if new horizontal move can still be applied normally
if(newMotion > myMotionClockM1 ||
- hpos <= BSPF_min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
+ hpos <= std::min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
{
myPOSM1 -= (newMotion - myMotionClockM1);
myMotionClockM1 = newMotion;
@@ -2428,12 +2424,12 @@ void TIA::pokeHMBL(uInt8 value, Int32 clock)
// Check if HMOVE is currently active
if(myCurrentHMOVEPos != 0x7FFFFFFF &&
- hpos < BSPF_min(myCurrentHMOVEPos + 6 + myMotionClockBL * 4, 7))
+ hpos < std::min(myCurrentHMOVEPos + 6 + myMotionClockBL * 4, 7))
{
Int32 newMotion = (value ^ 0x80) >> 4;
// Check if new horizontal move can still be applied normally
if(newMotion > myMotionClockBL ||
- hpos <= BSPF_min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
+ hpos <= std::min(myCurrentHMOVEPos + 6 + newMotion * 4, 7))
{
myPOSBL -= (newMotion - myMotionClockBL);
myMotionClockBL = newMotion;
@@ -2468,7 +2464,7 @@ void TIA::pokeHMBL(uInt8 value, Int32 clock)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
inline void TIA::applyActiveHMOVEMotion(int hpos, Int16& pos, Int32 motionClock)
{
- if(hpos < BSPF_min(myCurrentHMOVEPos + 6 + 16 * 4, 7))
+ if(hpos < std::min(myCurrentHMOVEPos + 6 + 16 * 4, 7))
{
Int32 decrements_passed = (hpos - (myCurrentHMOVEPos + 4)) >> 2;
pos += 8;
diff --git a/src/emucore/TIA.hxx b/src/emucore/TIA.hxx
index fcf5d3a..1f7ae76 100644
--- a/src/emucore/TIA.hxx
+++ b/src/emucore/TIA.hxx
@@ -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.hxx 3292 2016-02-27 22:18:30Z stephena $
+// $Id: TIA.hxx 3311 2016-08-21 21:37:06Z stephena $
//============================================================================
#ifndef TIA_HXX
@@ -41,7 +41,7 @@ class Sound;
be displayed on screen.
@author Bradford W. Mott
- @version $Id: TIA.hxx 3292 2016-02-27 22:18:30Z stephena $
+ @version $Id: TIA.hxx 3311 2016-08-21 21:37:06Z stephena $
*/
class TIA : public Device
{
@@ -408,10 +408,10 @@ class TIA : public Device
Settings& mySettings;
// Pointer to the current frame buffer
- unique_ptr<uInt8[]> myCurrentFrameBuffer;
+ BytePtr myCurrentFrameBuffer;
// Pointer to the previous frame buffer
- unique_ptr<uInt8[]> myPreviousFrameBuffer;
+ BytePtr myPreviousFrameBuffer;
// Pointer to the next pixel that will be drawn in the current frame buffer
uInt8* myFramePointer;
diff --git a/src/emucore/TIASnd.cxx b/src/emucore/TIASnd.cxx
index b6324ca..b60d94b 100644
--- a/src/emucore/TIASnd.cxx
+++ b/src/emucore/TIASnd.cxx
@@ -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: TIASnd.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: TIASnd.cxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#include "System.hxx"
diff --git a/src/emucore/TIASnd.hxx b/src/emucore/TIASnd.hxx
index e4de539..6b629f7 100644
--- a/src/emucore/TIASnd.hxx
+++ b/src/emucore/TIASnd.hxx
@@ -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: TIASnd.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: TIASnd.hxx 3310 2016-08-18 18:44:57Z stephena $
//============================================================================
#ifndef TIASOUND_HXX
@@ -30,7 +30,7 @@
Resampling can be done by passing in a different output frequency.
@author Bradford W. Mott, Stephen Anthony, z26 and MESS teams
- @version $Id: TIASnd.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: TIASnd.hxx 3310 2016-08-18 18:44:57Z stephena $
*/
class TIASound
{
diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx
index 6d5b365..cb04198 100644
--- a/src/emucore/TIASurface.cxx
+++ b/src/emucore/TIASurface.cxx
@@ -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.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: TIASurface.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include <cmath>
@@ -213,8 +213,8 @@ uInt32 TIASurface::enableScanlines(int relative, int absolute)
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);
+ attr.blendalpha = std::max(0u, attr.blendalpha);
+ attr.blendalpha = std::min(100u, attr.blendalpha);
mySLineSurface->applyAttributes();
mySLineSurface->setDirty();
@@ -245,7 +245,7 @@ void TIASurface::enablePhosphor(bool enable, int blend)
uInt8 TIASurface::getPhosphor(uInt8 c1, uInt8 c2) const
{
if(c2 > c1)
- BSPF_swap(c1, c2);
+ std::swap(c1, c2);
return ((c1 - c2) * myPhosphorBlend)/100 + c2;
}
diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx
index 9f6188e..5a9e479 100644
--- a/src/emucore/Thumbulator.cxx
+++ b/src/emucore/Thumbulator.cxx
@@ -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: Thumbulator.cxx 3290 2016-02-27 19:58:20Z stephena $
+// $Id: Thumbulator.cxx 3308 2016-05-24 16:55:45Z stephena $
//============================================================================
//============================================================================
@@ -29,7 +29,7 @@
#include "bspf.hxx"
#include "Base.hxx"
#include "Thumbulator.hxx"
-using namespace Common;
+using Common::Base;
// Uncomment the following to enable specific functionality
// WARNING!!! This slows the runtime to a crawl
diff --git a/src/emucore/module.mk b/src/emucore/module.mk
index 9c8d9cd..211fbf4 100644
--- a/src/emucore/module.mk
+++ b/src/emucore/module.mk
@@ -7,6 +7,7 @@ MODULE_OBJS := \
src/emucore/Cart0840.o \
src/emucore/Cart2K.o \
src/emucore/Cart3E.o \
+ src/emucore/Cart3EPlus.o \
src/emucore/Cart3F.o \
src/emucore/Cart4A50.o \
src/emucore/Cart4K.o \
diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx
index 1a96079..938bd02 100644
--- a/src/gui/CheckListWidget.cxx
+++ b/src/gui/CheckListWidget.cxx
@@ -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 3243 2015-12-29 23:45:21Z stephena $
+// $Id: CheckListWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "CheckListWidget.hxx"
@@ -29,7 +29,7 @@ CheckListWidget::CheckListWidget(GuiObject* boss, const GUI::Font& font,
// rowheight is determined by largest item on a line,
// possibly meaning that number of rows will change
- _fontHeight = BSPF_max(_fontHeight, CheckboxWidget::boxSize());
+ _fontHeight = std::max(_fontHeight, CheckboxWidget::boxSize());
_rows = h / _fontHeight;
// Create a CheckboxWidget for each row in the list
diff --git a/src/gui/ComboDialog.cxx b/src/gui/ComboDialog.cxx
index d146fa9..194928c 100644
--- a/src/gui/ComboDialog.cxx
+++ b/src/gui/ComboDialog.cxx
@@ -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: ComboDialog.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: ComboDialog.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include <sstream>
@@ -54,7 +54,7 @@ ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
// Get maximum width of popupwidget
int pwidth = 0;
for(const auto& s: combolist)
- pwidth = BSPF_max(font.getStringWidth(s.first), pwidth);
+ pwidth = std::max(font.getStringWidth(s.first), pwidth);
// Label for dialog, indicating which combo is being changed
myComboName = new StaticTextWidget(this, font, xpos, ypos, _w - xpos - 10,
@@ -109,7 +109,7 @@ void ComboDialog::loadConfig()
{
StringList events = instance().eventHandler().getComboListForEvent(myComboEvent);
- uInt32 size = BSPF_min(uInt32(events.size()), 8u);
+ uInt32 size = std::min(uInt32(events.size()), 8u);
for(uInt32 i = 0; i < size; ++i)
myEvents[i]->setSelected("", events[i]);
diff --git a/src/gui/CommandMenu.hxx b/src/gui/CommandMenu.hxx
index c8b401e..4fc416d 100644
--- a/src/gui/CommandMenu.hxx
+++ b/src/gui/CommandMenu.hxx
@@ -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: CommandMenu.hxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: CommandMenu.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef COMMAND_MENU_HXX
@@ -29,7 +29,7 @@ class OSystem;
The base dialog for common commands in Stella.
@author Stephen Anthony
- @version $Id: CommandMenu.hxx 3243 2015-12-29 23:45:21Z stephena $
+ @version $Id: CommandMenu.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class CommandMenu : public DialogContainer
{
@@ -38,10 +38,6 @@ class CommandMenu : public DialogContainer
Create a new menu stack
*/
CommandMenu(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~CommandMenu() = default;
private:
diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx
index 329c262..66b823b 100644
--- a/src/gui/ContextMenu.cxx
+++ b/src/gui/ContextMenu.cxx
@@ -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 3243 2015-12-29 23:45:21Z stephena $
+// $Id: ContextMenu.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "OSystem.hxx"
@@ -55,7 +55,7 @@ void ContextMenu::addItems(const VariantList& items)
// Resize to largest string
int maxwidth = 0;
for(const auto& e: _entries)
- maxwidth = BSPF_max(maxwidth, _font.getStringWidth(e.first));
+ maxwidth = std::max(maxwidth, _font.getStringWidth(e.first));
_x = _y = 0;
_w = maxwidth + 10;
@@ -100,7 +100,7 @@ void ContextMenu::recalc(const GUI::Rect& image)
{
// Now is the time to adjust the height
// If it's higher than the screen, we need to scroll through
- uInt32 maxentries = BSPF_min(18u, (image.height() - 4) / _rowHeight);
+ uInt32 maxentries = std::min(18u, (image.height() - 4) / _rowHeight);
if(_entries.size() > maxentries)
{
// We show two less than the max, so we have room for two scroll buttons
@@ -133,7 +133,7 @@ void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
{
for(uInt32 item = 0; item < _entries.size(); ++item)
{
- if(BSPF_equalsIgnoreCase(_entries[item].second.toString(), tag.toString()))
+ if(BSPF::equalsIgnoreCase(_entries[item].second.toString(), tag.toString()))
{
setSelectedIndex(item);
return;
@@ -144,7 +144,7 @@ void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
// If we get this far, the value wasn't found; use the default value
for(uInt32 item = 0; item < _entries.size(); ++item)
{
- if(BSPF_equalsIgnoreCase(_entries[item].second.toString(), defaultTag.toString()))
+ if(BSPF::equalsIgnoreCase(_entries[item].second.toString(), defaultTag.toString()))
{
setSelectedIndex(item);
return;
@@ -495,7 +495,7 @@ void ContextMenu::scrollUp(int distance)
if(_firstEntry == 0)
return;
- _firstEntry = BSPF_max(_firstEntry - distance, 0);
+ _firstEntry = std::max(_firstEntry - distance, 0);
_scrollUpColor = _firstEntry > 0 ? kScrollColor : kColor;
_scrollDnColor = kScrollColor;
@@ -509,7 +509,7 @@ void ContextMenu::scrollDown(int distance)
if(_firstEntry == max_offset)
return;
- _firstEntry = BSPF_min(_firstEntry + distance, max_offset);
+ _firstEntry = std::min(_firstEntry + distance, max_offset);
_scrollUpColor = kScrollColor;
_scrollDnColor = _firstEntry < max_offset ? kScrollColor : kColor;
diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx
index f35d559..9220fad 100644
--- a/src/gui/Dialog.cxx
+++ b/src/gui/Dialog.cxx
@@ -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 3254 2016-01-23 18:16:09Z stephena $
+// $Id: Dialog.cxx 3304 2016-04-03 00:35:00Z stephena $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -648,9 +648,9 @@ void Dialog::addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
const string& okText, const string& cancelText)
{
- int buttonWidth = BSPF_max(font.getStringWidth("Cancel"),
- BSPF_max(font.getStringWidth(okText),
- font.getStringWidth(okText))) + 15;
+ int buttonWidth = std::max(font.getStringWidth("Cancel"),
+ std::max(font.getStringWidth(okText),
+ font.getStringWidth(okText))) + 15;
int buttonHeight = font.getLineHeight() + 4;
ButtonWidget* b;
#ifndef BSPF_MAC_OSX
diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx
index d94f8ef..ca180d2 100644
--- a/src/gui/DialogContainer.cxx
+++ b/src/gui/DialogContainer.cxx
@@ -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: DialogContainer.cxx 3245 2015-12-30 20:26:56Z stephena $
+// $Id: DialogContainer.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "OSystem.hxx"
@@ -214,8 +214,8 @@ void DialogContainer::handleMouseButtonEvent(MouseButton b, int x, int y)
}
if(myLastClick.count && (myTime < myLastClick.time + kDoubleClickDelay)
- && BSPF_abs(myLastClick.x - x) < 3
- && BSPF_abs(myLastClick.y - y) < 3)
+ && std::abs(myLastClick.x - x) < 3
+ && std::abs(myLastClick.y - y) < 3)
{
myLastClick.count++;
}
diff --git a/src/gui/DialogContainer.hxx b/src/gui/DialogContainer.hxx
index 699dea7..46a5971 100644
--- a/src/gui/DialogContainer.hxx
+++ b/src/gui/DialogContainer.hxx
@@ -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: DialogContainer.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: DialogContainer.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef DIALOG_CONTAINER_HXX
@@ -37,7 +37,7 @@ class OSystem;
a stack, and handles their events.
@author Stephen Anthony
- @version $Id: DialogContainer.hxx 3239 2015-12-29 19:22:46Z stephena $
+ @version $Id: DialogContainer.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class DialogContainer
{
@@ -49,10 +49,6 @@ class DialogContainer
Create a new DialogContainer stack
*/
DialogContainer(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~DialogContainer();
public:
diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx
index fbd399e..2a5dd19 100644
--- a/src/gui/FileListWidget.cxx
+++ b/src/gui/FileListWidget.cxx
@@ -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: FileListWidget.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: FileListWidget.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "ScrollBarWidget.hxx"
@@ -64,7 +64,7 @@ void FileListWidget::setLocation(const FilesystemNode& node, string select)
bool isDir = file.isDirectory();
if(isDir)
name = " [" + name + "]";
- else if(!BSPF_endsWithIgnoreCase(name, _extension))
+ else if(!BSPF::endsWithIgnoreCase(name, _extension))
continue;
_gameList.appendGame(name, file.getPath(), "", isDir);
diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx
index 26f91d3..8a84fbe 100644
--- a/src/gui/GameInfoDialog.cxx
+++ b/src/gui/GameInfoDialog.cxx
@@ -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: GameInfoDialog.cxx 3250 2016-01-18 18:33:45Z stephena $
+// $Id: GameInfoDialog.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "Cart.hxx"
@@ -436,7 +436,7 @@ void GameInfoDialog::loadView()
istringstream m_axis(myGameProperties.get(Controller_MouseAxis));
string m_control, m_range;
m_axis >> m_control;
- bool autoAxis = BSPF_equalsIgnoreCase(m_control, "AUTO");
+ bool autoAxis = BSPF::equalsIgnoreCase(m_control, "AUTO");
if(autoAxis)
{
myMouseControl->setSelectedIndex(0);
diff --git a/src/gui/GlobalPropsDialog.cxx b/src/gui/GlobalPropsDialog.cxx
index 2934838..95fd079 100644
--- a/src/gui/GlobalPropsDialog.cxx
+++ b/src/gui/GlobalPropsDialog.cxx
@@ -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: GlobalPropsDialog.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: GlobalPropsDialog.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "bspf.hxx"
@@ -221,10 +221,10 @@ void GlobalPropsDialog::loadConfig()
const string& holdjoy0 = settings.getString("holdjoy0");
for(int i = kJ0Up; i <= kJ0Fire; ++i)
- myJoy[i]->setState(BSPF_containsIgnoreCase(holdjoy0, ourJoyState[i]));
+ myJoy[i]->setState(BSPF::containsIgnoreCase(holdjoy0, ourJoyState[i]));
const string& holdjoy1 = settings.getString("holdjoy1");
for(int i = kJ1Up; i <= kJ1Fire; ++i)
- myJoy[i]->setState(BSPF_containsIgnoreCase(holdjoy1, ourJoyState[i]));
+ myJoy[i]->setState(BSPF::containsIgnoreCase(holdjoy1, ourJoyState[i]));
myHoldSelect->setState(settings.getBool("holdselect"));
myHoldReset->setState(settings.getBool("holdreset"));
diff --git a/src/gui/GlobalPropsDialog.hxx b/src/gui/GlobalPropsDialog.hxx
index 82fd492..b48152c 100644
--- a/src/gui/GlobalPropsDialog.hxx
+++ b/src/gui/GlobalPropsDialog.hxx
@@ -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: GlobalPropsDialog.hxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: GlobalPropsDialog.hxx 3300 2016-04-02 21:27:10Z stephena $
//============================================================================
#ifndef GLOBAL_PROPS_DIALOG_HXX
diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx
index 7bbc6ef..978354a 100644
--- a/src/gui/InputDialog.cxx
+++ b/src/gui/InputDialog.cxx
@@ -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: InputDialog.cxx 3247 2015-12-30 23:57:54Z stephena $
+// $Id: InputDialog.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "bspf.hxx"
@@ -46,8 +46,8 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
StringList actions;
// Set real dimensions
- _w = BSPF_min(50 * fontWidth + 10, max_w);
- _h = BSPF_min(15 * (lineHeight + 4) + 14, max_h);
+ _w = std::min(50 * fontWidth + 10, max_w);
+ _h = std::min(15 * (lineHeight + 4) + 14, max_h);
// The tab widget
xpos = 2; ypos = vBorder;
diff --git a/src/gui/Launcher.cxx b/src/gui/Launcher.cxx
index 822b55a..4e2334d 100644
--- a/src/gui/Launcher.cxx
+++ b/src/gui/Launcher.cxx
@@ -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: Launcher.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: Launcher.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "LauncherDialog.hxx"
@@ -37,10 +37,10 @@ Launcher::Launcher(OSystem& osystem)
// The launcher dialog is resizable, within certain bounds
// We check those bounds now
- myWidth = BSPF_max(myWidth, uInt32(FrameBuffer::kFBMinW));
- myHeight = BSPF_max(myHeight, uInt32(FrameBuffer::kFBMinH));
- myWidth = BSPF_min(myWidth, uInt32(d.w));
- myHeight = BSPF_min(myHeight, uInt32(d.h));
+ myWidth = std::max(myWidth, uInt32(FrameBuffer::kFBMinW));
+ myHeight = std::max(myHeight, uInt32(FrameBuffer::kFBMinH));
+ myWidth = std::min(myWidth, uInt32(d.w));
+ myHeight = std::min(myHeight, uInt32(d.h));
myOSystem.settings().setValue("launcherres",
GUI::Size(myWidth, myHeight));
diff --git a/src/gui/Launcher.hxx b/src/gui/Launcher.hxx
index f08db3a..5d00e06 100644
--- a/src/gui/Launcher.hxx
+++ b/src/gui/Launcher.hxx
@@ -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: Launcher.hxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: Launcher.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef LAUNCHER_HXX
@@ -31,7 +31,7 @@ class FilesystemNode;
The base dialog for the ROM launcher in Stella.
@author Stephen Anthony
- @version $Id: Launcher.hxx 3243 2015-12-29 23:45:21Z stephena $
+ @version $Id: Launcher.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class Launcher : public DialogContainer
{
@@ -40,10 +40,6 @@ class Launcher : public DialogContainer
Create a new menu stack
*/
Launcher(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~Launcher() = default;
/**
diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx
index 0f1b96b..980e022 100644
--- a/src/gui/LauncherDialog.cxx
+++ b/src/gui/LauncherDialog.cxx
@@ -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 3245 2015-12-30 20:26:56Z stephena $
+// $Id: LauncherDialog.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include <sstream>
@@ -82,7 +82,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
// It has to fit between both labels
if(w >= 640)
{
- int fwidth = BSPF_min(15 * fontWidth, xpos - 20 - lwidth);
+ int fwidth = std::min(15 * fontWidth, xpos - 20 - lwidth);
xpos -= fwidth + 5;
myPattern = new EditTextWidget(this, font, xpos, ypos,
fwidth, fontHeight, "");
diff --git a/src/gui/LauncherFilterDialog.cxx b/src/gui/LauncherFilterDialog.cxx
index b93ad5b..a5d5b87 100644
--- a/src/gui/LauncherFilterDialog.cxx
+++ b/src/gui/LauncherFilterDialog.cxx
@@ -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: LauncherFilterDialog.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: LauncherFilterDialog.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include <algorithm>
@@ -126,7 +126,7 @@ bool LauncherFilterDialog::isValidRomName(const string& name,
const char* ext = name.c_str() + idx + 1;
for(const auto& s: exts)
- if(BSPF_equalsIgnoreCase(ext, s))
+ if(BSPF::equalsIgnoreCase(ext, s))
return true;
}
@@ -144,7 +144,7 @@ bool LauncherFilterDialog::isValidRomName(const FilesystemNode& node, string& ex
for(uInt32 i = 0; i < 5; ++i)
{
- if(BSPF_equalsIgnoreCase(e, ourRomTypes[1][i]))
+ if(BSPF::equalsIgnoreCase(e, ourRomTypes[1][i]))
{
ext = e;
return true;
diff --git a/src/gui/LauncherFilterDialog.hxx b/src/gui/LauncherFilterDialog.hxx
index 9c5a2ef..3a8921f 100644
--- a/src/gui/LauncherFilterDialog.hxx
+++ b/src/gui/LauncherFilterDialog.hxx
@@ -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: LauncherFilterDialog.hxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: LauncherFilterDialog.hxx 3300 2016-04-02 21:27:10Z stephena $
//============================================================================
#ifndef LAUNCHER_FILTER_DIALOG_HXX
diff --git a/src/gui/ListWidget.cxx b/src/gui/ListWidget.cxx
index 92a207e..8dab504 100644
--- a/src/gui/ListWidget.cxx
+++ b/src/gui/ListWidget.cxx
@@ -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: ListWidget.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: ListWidget.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include <cctype>
@@ -264,7 +264,7 @@ bool ListWidget::handleText(char text)
int newSelectedItem = 0;
for(const auto& i: _list)
{
- if(BSPF_startsWithIgnoreCase(i, _quickSelectStr))
+ if(BSPF::startsWithIgnoreCase(i, _quickSelectStr))
{
_selectedItem = newSelectedItem;
break;
diff --git a/src/gui/LoggerDialog.cxx b/src/gui/LoggerDialog.cxx
index 75eb68b..7a6cb67 100644
--- a/src/gui/LoggerDialog.cxx
+++ b/src/gui/LoggerDialog.cxx
@@ -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: LoggerDialog.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: LoggerDialog.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include <fstream>
@@ -111,7 +111,7 @@ void LoggerDialog::saveConfig()
void LoggerDialog::saveLogFile()
{
ostringstream path;
- path << "~" << BSPF_PATH_SEPARATOR << "stella.log";
+ path << "~" << BSPF::PATH_SEPARATOR << "stella.log";
FilesystemNode node(path.str());
ofstream out(node.getPath());
diff --git a/src/gui/Menu.hxx b/src/gui/Menu.hxx
index b5d0b56..3c52765 100644
--- a/src/gui/Menu.hxx
+++ b/src/gui/Menu.hxx
@@ -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: Menu.hxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: Menu.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef MENU_HXX
@@ -28,7 +28,7 @@ class OSystem;
The base dialog for all configuration menus in Stella.
@author Stephen Anthony
- @version $Id: Menu.hxx 3243 2015-12-29 23:45:21Z stephena $
+ @version $Id: Menu.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class Menu : public DialogContainer
{
@@ -37,10 +37,6 @@ class Menu : public DialogContainer
Create a new menu stack
*/
Menu(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~Menu() = default;
private:
diff --git a/src/gui/MessageBox.cxx b/src/gui/MessageBox.cxx
index 5c42b9b..a565caf 100644
--- a/src/gui/MessageBox.cxx
+++ b/src/gui/MessageBox.cxx
@@ -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: MessageBox.cxx 3243 2015-12-29 23:45:21Z stephena $
+// $Id: MessageBox.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "Dialog.hxx"
@@ -69,9 +69,9 @@ void MessageBox::addText(const GUI::Font& font, const StringList& text)
// Set real dimensions
int str_w = 0;
for(const auto& s: text)
- str_w = BSPF_max(int(s.length()), str_w);
- _w = BSPF_min(str_w * fontWidth + 20, _w);
- _h = BSPF_min(uInt32((text.size() + 2) * lineHeight + 20), uInt32(_h));
+ str_w = std::max(int(s.length()), str_w);
+ _w = std::min(str_w * fontWidth + 20, _w);
+ _h = std::min(uInt32((text.size() + 2) * lineHeight + 20), uInt32(_h));
xpos = 10; ypos = 10;
for(const auto& s: text)
diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx
index 708e9b2..175b34d 100644
--- a/src/gui/RomInfoWidget.cxx
+++ b/src/gui/RomInfoWidget.cxx
@@ -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 3243 2015-12-29 23:45:21Z stephena $
+// $Id: RomInfoWidget.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include "FrameBuffer.hxx"
@@ -100,7 +100,7 @@ void RomInfoWidget::parseProperties()
// 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());
+ float scale = std::min(float(myAvail.w) / src.width(), float(myAvail.h) / src.height());
mySurface->setDstSize(uInt32(src.width() * scale), uInt32(src.height() * scale));
}
catch(const runtime_error& e)
diff --git a/src/gui/UIDialog.cxx b/src/gui/UIDialog.cxx
index 76beb0a..8a47b1c 100644
--- a/src/gui/UIDialog.cxx
+++ b/src/gui/UIDialog.cxx
@@ -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 3243 2015-12-29 23:45:21Z stephena $
+// $Id: UIDialog.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include <sstream>
@@ -134,7 +134,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
// Add message concerning usage
xpos = vBorder; ypos += 1*(lineHeight + 4);
lwidth = ifont.getStringWidth("(*) Changes require application restart");
- new StaticTextWidget(myTab, ifont, xpos, ypos, BSPF_min(lwidth, _w-20), fontHeight,
+ new StaticTextWidget(myTab, ifont, xpos, ypos, std::min(lwidth, _w-20), fontHeight,
"(*) Changes require application restart",
kTextAlignLeft);
@@ -284,7 +284,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
// 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,
+ new StaticTextWidget(myTab, ifont, xpos, ypos, std::min(lwidth, _w-20), fontHeight,
"(*) Requires application restart",
kTextAlignLeft);
@@ -310,10 +310,10 @@ void UIDialog::loadConfig()
const GUI::Size& ls = instance().settings().getSize("launcherres");
uInt32 w = ls.w, h = ls.h;
- w = BSPF_max(w, uInt32(FrameBuffer::kFBMinW));
- h = BSPF_max(h, uInt32(FrameBuffer::kFBMinH));
- w = BSPF_min(w, instance().frameBuffer().desktopSize().w);
- h = BSPF_min(h, instance().frameBuffer().desktopSize().h);
+ w = std::max(w, uInt32(FrameBuffer::kFBMinW));
+ h = std::max(h, uInt32(FrameBuffer::kFBMinH));
+ w = std::min(w, instance().frameBuffer().desktopSize().w);
+ h = std::min(h, instance().frameBuffer().desktopSize().h);
myLauncherWidthSlider->setValue(w);
myLauncherWidthLabel->setValue(w);
@@ -336,10 +336,10 @@ void UIDialog::loadConfig()
// Debugger size
const GUI::Size& ds = instance().settings().getSize("dbg.res");
w = ds.w, h = ds.h;
- w = BSPF_max(w, uInt32(DebuggerDialog::kSmallFontMinW));
- h = BSPF_max(h, uInt32(DebuggerDialog::kSmallFontMinH));
- w = BSPF_min(w, ds.w);
- h = BSPF_min(h, ds.h);
+ w = std::max(w, uInt32(DebuggerDialog::kSmallFontMinW));
+ h = std::max(h, uInt32(DebuggerDialog::kSmallFontMinH));
+ w = std::min(w, ds.w);
+ h = std::min(h, ds.h);
myDebuggerWidthSlider->setValue(w);
myDebuggerWidthLabel->setValue(w);
@@ -417,8 +417,8 @@ void UIDialog::setDefaults()
{
case 0: // Launcher options
{
- uInt32 w = BSPF_min(instance().frameBuffer().desktopSize().w, 1000u);
- uInt32 h = BSPF_min(instance().frameBuffer().desktopSize().h, 600u);
+ uInt32 w = std::min(instance().frameBuffer().desktopSize().w, 1000u);
+ uInt32 h = std::min(instance().frameBuffer().desktopSize().h, 600u);
myLauncherWidthSlider->setValue(w);
myLauncherWidthLabel->setValue(w);
myLauncherHeightSlider->setValue(h);
@@ -432,8 +432,8 @@ void UIDialog::setDefaults()
case 1: // Debugger options
{
#ifdef DEBUGGER_SUPPORT
- uInt32 w = BSPF_min(instance().frameBuffer().desktopSize().w, uInt32(DebuggerDialog::kMediumFontMinW));
- uInt32 h = BSPF_min(instance().frameBuffer().desktopSize().h, uInt32(DebuggerDialog::kMediumFontMinH));
+ uInt32 w = std::min(instance().frameBuffer().desktopSize().w, uInt32(DebuggerDialog::kMediumFontMinW));
+ uInt32 h = std::min(instance().frameBuffer().desktopSize().h, uInt32(DebuggerDialog::kMediumFontMinH));
myDebuggerWidthSlider->setValue(w);
myDebuggerWidthLabel->setValue(w);
myDebuggerHeightSlider->setValue(h);
diff --git a/src/gui/VideoDialog.cxx b/src/gui/VideoDialog.cxx
index 72e13c6..cdba541 100644
--- a/src/gui/VideoDialog.cxx
+++ b/src/gui/VideoDialog.cxx
@@ -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 3279 2016-02-13 01:21:28Z stephena $
+// $Id: VideoDialog.cxx 3304 2016-04-03 00:35:00Z stephena $
//============================================================================
#include <sstream>
@@ -53,8 +53,8 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
VariantList items;
// Set real dimensions
- _w = BSPF_min(52 * fontWidth + 10, max_w);
- _h = BSPF_min(14 * (lineHeight + 4) + 10, max_h);
+ _w = std::min(52 * fontWidth + 10, max_w);
+ _h = std::min(14 * (lineHeight + 4) + 10, max_h);
// The tab widget
xpos = ypos = 5;
diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx
index 8ff4d91..b7b6827 100644
--- a/src/gui/Widget.cxx
+++ b/src/gui/Widget.cxx
@@ -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 3239 2015-12-29 19:22:46Z stephena $
+// $Id: Widget.cxx 3304 2016-04-03 00:35:00Z stephena $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -312,7 +312,7 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
void StaticTextWidget::setValue(int value)
{
char buf[256];
- BSPF_snprintf(buf, 255, "%d", value);
+ std::snprintf(buf, 255, "%d", value);
_label = buf;
setDirty();
@@ -701,7 +701,7 @@ int SliderWidget::valueToPos(int value)
{
if(value < _valueMin) value = _valueMin;
else if(value > _valueMax) value = _valueMax;
- int range = BSPF_max(_valueMax - _valueMin, 1); // don't divide by zero
+ int range = std::max(_valueMax - _valueMin, 1); // don't divide by zero
return ((_w - _labelWidth - 4) * (value - _valueMin) / range);
}
diff --git a/src/macosx/Info-Stella.plist b/src/macosx/Info-Stella.plist
index 4e2bc4d..4cb2ed7 100644
--- a/src/macosx/Info-Stella.plist
+++ b/src/macosx/Info-Stella.plist
@@ -53,7 +53,7 @@
<key>CFBundleSignature</key>
<string>StLa</string>
<key>CFBundleVersion</key>
- <string>4.7.2</string>
+ <string>4.7.3</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersionByArchitecture</key>
diff --git a/src/macosx/OSystemMACOSX.hxx b/src/macosx/OSystemMACOSX.hxx
index dd45d6c..520e2af 100644
--- a/src/macosx/OSystemMACOSX.hxx
+++ b/src/macosx/OSystemMACOSX.hxx
@@ -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: OSystemMACOSX.hxx 3244 2015-12-30 19:07:11Z stephena $
+// $Id: OSystemMACOSX.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef OSYSTEM_MACOSX_HXX
@@ -26,7 +26,7 @@
This class defines UNIX-like OS's (MacOS X) system specific settings.
@author Mark Grebe
- @version $Id: OSystemMACOSX.hxx 3244 2015-12-30 19:07:11Z stephena $
+ @version $Id: OSystemMACOSX.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class OSystemMACOSX : public OSystem
{
@@ -35,10 +35,6 @@ class OSystemMACOSX : public OSystem
Create a new MACOSX-specific operating system object
*/
OSystemMACOSX();
-
- /**
- Destructor
- */
virtual ~OSystemMACOSX() = default;
/**
diff --git a/src/macosx/SettingsMACOSX.hxx b/src/macosx/SettingsMACOSX.hxx
index 31987e0..0798993 100644
--- a/src/macosx/SettingsMACOSX.hxx
+++ b/src/macosx/SettingsMACOSX.hxx
@@ -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: SettingsMACOSX.hxx 3244 2015-12-30 19:07:11Z stephena $
+// $Id: SettingsMACOSX.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef SETTINGS_MAC_OSX_HXX
@@ -28,7 +28,7 @@ class OSystem;
This class defines Macintosh OSX system specific settings.
@author Mark Grebe
- @version $Id: SettingsMACOSX.hxx 3244 2015-12-30 19:07:11Z stephena $
+ @version $Id: SettingsMACOSX.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class SettingsMACOSX : public Settings
{
@@ -37,10 +37,6 @@ class SettingsMACOSX : public Settings
Create a new UNIX settings object
*/
SettingsMACOSX(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~SettingsMACOSX() = default;
public:
diff --git a/src/macosx/stella.xcodeproj/project.pbxproj b/src/macosx/stella.xcodeproj/project.pbxproj
index cc020f5..2ad642d 100644
--- a/src/macosx/stella.xcodeproj/project.pbxproj
+++ b/src/macosx/stella.xcodeproj/project.pbxproj
@@ -429,6 +429,10 @@
DCB20ECC1A0C50930048F595 /* atari_ntsc.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCB20EC91A0C50930048F595 /* atari_ntsc.cxx */; };
DCB20ECD1A0C50930048F595 /* atari_ntsc.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCB20ECA1A0C50930048F595 /* atari_ntsc.hxx */; };
DCB87E581A104C1E00BF2A3B /* MediaFactory.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCB87E571A104C1E00BF2A3B /* MediaFactory.hxx */; };
+ DCBDDE9A1D6A5F0E009DF1E9 /* Cart3EPlusWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCBDDE981D6A5F0E009DF1E9 /* Cart3EPlusWidget.cxx */; };
+ DCBDDE9B1D6A5F0E009DF1E9 /* Cart3EPlusWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCBDDE991D6A5F0E009DF1E9 /* Cart3EPlusWidget.hxx */; };
+ DCBDDE9E1D6A5F2F009DF1E9 /* Cart3EPlus.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCBDDE9C1D6A5F2F009DF1E9 /* Cart3EPlus.cxx */; };
+ DCBDDE9F1D6A5F2F009DF1E9 /* Cart3EPlus.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCBDDE9D1D6A5F2F009DF1E9 /* Cart3EPlus.hxx */; };
DCC527D110B9DA19005E1287 /* Device.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527C910B9DA19005E1287 /* Device.hxx */; };
DCC527D210B9DA19005E1287 /* M6502.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCC527CA10B9DA19005E1287 /* M6502.cxx */; };
DCC527D310B9DA19005E1287 /* M6502.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527CB10B9DA19005E1287 /* M6502.hxx */; };
@@ -989,6 +993,10 @@
DCB20ECA1A0C50930048F595 /* atari_ntsc.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = atari_ntsc.hxx; path = ../common/tv_filters/atari_ntsc.hxx; sourceTree = "<group>"; };
DCB87E571A104C1E00BF2A3B /* MediaFactory.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = MediaFactory.hxx; path = ../common/MediaFactory.hxx; sourceTree = "<group>"; };
DCBA710010DED62E0077193B /* Stella.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Stella.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ DCBDDE981D6A5F0E009DF1E9 /* Cart3EPlusWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Cart3EPlusWidget.cxx; path = ../debugger/gui/Cart3EPlusWidget.cxx; sourceTree = "<group>"; };
+ DCBDDE991D6A5F0E009DF1E9 /* Cart3EPlusWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Cart3EPlusWidget.hxx; path = ../debugger/gui/Cart3EPlusWidget.hxx; sourceTree = "<group>"; };
+ DCBDDE9C1D6A5F2F009DF1E9 /* Cart3EPlus.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Cart3EPlus.cxx; path = ../emucore/Cart3EPlus.cxx; sourceTree = "<group>"; };
+ DCBDDE9D1D6A5F2F009DF1E9 /* Cart3EPlus.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Cart3EPlus.hxx; path = ../emucore/Cart3EPlus.hxx; sourceTree = "<group>"; };
DCC527C910B9DA19005E1287 /* Device.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Device.hxx; path = ../emucore/Device.hxx; sourceTree = SOURCE_ROOT; };
DCC527CA10B9DA19005E1287 /* M6502.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = M6502.cxx; path = ../emucore/M6502.cxx; sourceTree = SOURCE_ROOT; };
DCC527CB10B9DA19005E1287 /* M6502.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = M6502.hxx; path = ../emucore/M6502.hxx; sourceTree = SOURCE_ROOT; };
@@ -1198,6 +1206,8 @@
DCCF4ACF14B7E6C300814FAB /* BoosterWidget.hxx */,
DCAAE5B21715887B0080BB82 /* Cart2KWidget.cxx */,
DCAAE5B31715887B0080BB82 /* Cart2KWidget.hxx */,
+ DCBDDE981D6A5F0E009DF1E9 /* Cart3EPlusWidget.cxx */,
+ DCBDDE991D6A5F0E009DF1E9 /* Cart3EPlusWidget.hxx */,
DC676A251729A0B000E4E73D /* Cart3EWidget.cxx */,
DC676A261729A0B000E4E73D /* Cart3EWidget.hxx */,
DCAAE5B41715887B0080BB82 /* Cart3FWidget.cxx */,
@@ -1404,6 +1414,8 @@
2DE2DF150627AE07006BEC99 /* Cart2K.hxx */,
2D9555D90880E78000466554 /* Cart3E.cxx */,
2D9555DA0880E78000466554 /* Cart3E.hxx */,
+ DCBDDE9C1D6A5F2F009DF1E9 /* Cart3EPlus.cxx */,
+ DCBDDE9D1D6A5F2F009DF1E9 /* Cart3EPlus.hxx */,
2DE2DF160627AE07006BEC99 /* Cart3F.cxx */,
2DE2DF170627AE07006BEC99 /* Cart3F.hxx */,
DCD56D360B247D920092F9F8 /* Cart4A50.cxx */,
@@ -1916,6 +1928,7 @@
DC932D480F278A5200FEFEFC /* TIATables.hxx in Headers */,
DC9EA8880F729A36000452B5 /* KidVid.hxx in Headers */,
DCF467B80F93993B00B25D7A /* SoundNull.hxx in Headers */,
+ DCBDDE9F1D6A5F2F009DF1E9 /* Cart3EPlus.hxx in Headers */,
DCF467BD0F9399F500B25D7A /* Version.hxx in Headers */,
DCF467C30F939A1400B25D7A /* CartEF.hxx in Headers */,
DCF467C50F939A1400B25D7A /* CartEFSC.hxx in Headers */,
@@ -1955,6 +1968,7 @@
DCCF4AD214B7E6C300814FAB /* BoosterWidget.hxx in Headers */,
DCCF4AD314B7E6C300814FAB /* NullControlWidget.hxx in Headers */,
DCCF4ADD14B9433100814FAB /* GenesisWidget.hxx in Headers */,
+ DCBDDE9B1D6A5F0E009DF1E9 /* Cart3EPlusWidget.hxx in Headers */,
DCCF4B0314BA27EB00814FAB /* DrivingWidget.hxx in Headers */,
DCCF4B0514BA27EB00814FAB /* KeyboardWidget.hxx in Headers */,
DC5C768F14C26F7C0031EBC7 /* StellaKeys.hxx in Headers */,
@@ -2173,6 +2187,7 @@
DC5E473B19EC9A14000E45DF /* EventJoyHandler.cxx in Sources */,
2D9174B709BA90380026E9FF /* OptionsDialog.cxx in Sources */,
2D9174B809BA90380026E9FF /* PopUpWidget.cxx in Sources */,
+ DCBDDE9A1D6A5F0E009DF1E9 /* Cart3EPlusWidget.cxx in Sources */,
DCE5CDE31BA10024005CD08A /* RiotRamWidget.cxx in Sources */,
2D9174B909BA90380026E9FF /* ProgressDialog.cxx in Sources */,
2D9174BA09BA90380026E9FF /* ScrollBarWidget.cxx in Sources */,
@@ -2312,6 +2327,7 @@
DCAAE5E21715887B0080BB82 /* CartF0Widget.cxx in Sources */,
DCAAE5E41715887B0080BB82 /* CartF4SCWidget.cxx in Sources */,
DC2AADB0194F389C0026C7A4 /* TIASurface.cxx in Sources */,
+ DCBDDE9E1D6A5F2F009DF1E9 /* Cart3EPlus.cxx in Sources */,
DCAAE5E61715887B0080BB82 /* CartF4Widget.cxx in Sources */,
DCAAE5E81715887B0080BB82 /* CartF6SCWidget.cxx in Sources */,
DCAAE5EA1715887B0080BB82 /* CartF6Widget.cxx in Sources */,
diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx
index 78dab33..5c27824 100644
--- a/src/unix/FSNodePOSIX.cxx
+++ b/src/unix/FSNodePOSIX.cxx
@@ -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: FSNodePOSIX.cxx 3294 2016-03-05 18:35:25Z stephena $
+// $Id: FSNodePOSIX.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include "FSNodePOSIX.hxx"
@@ -81,7 +81,7 @@ string FilesystemNodePOSIX::getShortPath() const
{
// If the path starts with the home directory, replace it with '~'
const char* home = getenv("HOME");
- if(home != NULL && BSPF_startsWithIgnoreCase(_path, home))
+ if(home != NULL && BSPF::startsWithIgnoreCase(_path, home))
{
string path = "~";
const char* offset = _path.c_str() + strlen(home);
diff --git a/src/unix/OSystemUNIX.hxx b/src/unix/OSystemUNIX.hxx
index 95be2ac..0a2a1c5 100644
--- a/src/unix/OSystemUNIX.hxx
+++ b/src/unix/OSystemUNIX.hxx
@@ -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: OSystemUNIX.hxx 3244 2015-12-30 19:07:11Z stephena $
+// $Id: OSystemUNIX.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef OSYSTEM_UNIX_HXX
@@ -26,7 +26,7 @@
This class defines UNIX-like OS's (Linux) system specific settings.
@author Stephen Anthony
- @version $Id: OSystemUNIX.hxx 3244 2015-12-30 19:07:11Z stephena $
+ @version $Id: OSystemUNIX.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class OSystemUNIX : public OSystem
{
@@ -35,10 +35,6 @@ class OSystemUNIX : public OSystem
Create a new UNIX-specific operating system object
*/
OSystemUNIX();
-
- /**
- Destructor
- */
virtual ~OSystemUNIX() = default;
private:
diff --git a/src/unix/SettingsUNIX.hxx b/src/unix/SettingsUNIX.hxx
index 251a77b..a019541 100644
--- a/src/unix/SettingsUNIX.hxx
+++ b/src/unix/SettingsUNIX.hxx
@@ -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: SettingsUNIX.hxx 3244 2015-12-30 19:07:11Z stephena $
+// $Id: SettingsUNIX.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef SETTINGS_UNIX_HXX
@@ -28,7 +28,7 @@ class OSystem;
This class defines UNIX-like OS's (Linux) system specific settings.
@author Stephen Anthony
- @version $Id: SettingsUNIX.hxx 3244 2015-12-30 19:07:11Z stephena $
+ @version $Id: SettingsUNIX.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class SettingsUNIX : public Settings
{
@@ -37,10 +37,6 @@ class SettingsUNIX : public Settings
Create a new UNIX settings object
*/
SettingsUNIX(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~SettingsUNIX() = default;
private:
diff --git a/src/unix/stella.spec b/src/unix/stella.spec
index f1dac3c..08ce168 100644
--- a/src/unix/stella.spec
+++ b/src/unix/stella.spec
@@ -1,5 +1,5 @@
%define name stella
-%define version 4.7.2
+%define version 4.7.3
%define rel 1
%define enable_sound 1
@@ -101,6 +101,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
%_datadir/icons/large/%{name}.png
%changelog
+* Mon Nov 21 2016 Stephen Anthony <stephena at users.sf.net> 4.7.3-1
+- Version 4.7.3 release
+
* Fri Mar 25 2016 Stephen Anthony <stephena at users.sf.net> 4.7.2-1
- Version 4.7.2 release
diff --git a/src/windows/FSNodeWINDOWS.cxx b/src/windows/FSNodeWINDOWS.cxx
index 5d7ff2f..cc8855e 100644
--- a/src/windows/FSNodeWINDOWS.cxx
+++ b/src/windows/FSNodeWINDOWS.cxx
@@ -14,10 +14,11 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: FSNodeWINDOWS.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: FSNodeWINDOWS.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
#include <cassert>
+#pragma warning( disable : 4091 )
#include <shlobj.h>
#ifdef ARRAYSIZE
@@ -205,7 +206,7 @@ string FilesystemNodeWINDOWS::getShortPath() const
{
// If the path starts with the home directory, replace it with '~'
const string& home = myHomeFinder.getHomePath();
- if(home != "" && BSPF_startsWithIgnoreCase(_path, home))
+ if(home != "" && BSPF::startsWithIgnoreCase(_path, home))
{
string path = "~";
const char* offset = _path.c_str() + home.length();
diff --git a/src/windows/HomeFinder.hxx b/src/windows/HomeFinder.hxx
index 0f9edbf..cf4a3be 100644
--- a/src/windows/HomeFinder.hxx
+++ b/src/windows/HomeFinder.hxx
@@ -14,105 +14,64 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
-// $Id: HomeFinder.hxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: HomeFinder.hxx 3299 2016-04-02 20:46:02Z stephena $
//============================================================================
#ifndef __HOME_FINDER_
#define __HOME_FINDER_
+#pragma warning( disable : 4091 )
#include <shlobj.h>
/*
* Used to determine the location of the various Win32 user/system folders.
- *
- * Win98 and earlier don't have SHGetFolderPath in shell32.dll.
- * Microsoft recommend that we load shfolder.dll at run time and
- * access the function through that.
- *
- * shfolder.dll is loaded dynamically in the constructor, and unloaded in
- * the destructor
- *
- * The class makes SHGetFolderPath available through its function operator.
- * It will work on all versions of Windows >= Win95.
- *
- * This code was borrowed from the Lyx project.
*/
class HomeFinder
{
public:
- HomeFinder() : myFolderModule(0), myFolderPathFunc(0)
- {
- myFolderModule = LoadLibrary("shfolder.dll");
- if(myFolderModule)
- myFolderPathFunc = reinterpret_cast<function_pointer>
- (::GetProcAddress(myFolderModule, "SHGetFolderPathA"));
- }
-
- ~HomeFinder() { if(myFolderModule) FreeLibrary(myFolderModule); }
+ HomeFinder() = default;
+ ~HomeFinder() = default;
- /** Wrapper for SHGetFolderPathA, returning the 'HOME/User' folder
- (or an empty string if the folder couldn't be determined. */
+ // Return the 'HOME/User' folder, or an empty string if the folder couldn't be determined.
const string& getHomePath() const
{
if(ourHomePath == "")
{
- if(!myFolderPathFunc)
- ourHomePath = "";
- else
- {
- char folder_path[MAX_PATH];
- HRESULT const result = (myFolderPathFunc)
- (NULL, CSIDL_PROFILE | CSIDL_FLAG_CREATE, NULL, 0, folder_path);
- ourHomePath = (result == 0) ? folder_path : "";
- }
+ char folder_path[MAX_PATH];
+ HRESULT const result = SHGetFolderPathA(NULL, CSIDL_PROFILE | CSIDL_FLAG_CREATE,
+ NULL, 0, folder_path);
+ ourHomePath = (result == S_OK) ? folder_path : EmptyString;
}
return ourHomePath;
}
- /** Wrapper for SHGetFolderPathA, returning the 'APPDATA' folder
- (or an empty string if the folder couldn't be determined. */
+ // Return the 'APPDATA' folder, or an empty string if the folder couldn't be determined.
const string& getAppDataPath() const
{
if(ourAppDataPath == "")
{
- if(!myFolderPathFunc)
- ourAppDataPath = "";
- else
- {
- char folder_path[MAX_PATH];
- HRESULT const result = (myFolderPathFunc)
- (NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, folder_path);
- ourAppDataPath = (result == 0) ? folder_path : "";
- }
+ char folder_path[MAX_PATH];
+ HRESULT const result = SHGetFolderPathA(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE,
+ NULL, 0, folder_path);
+ ourAppDataPath = (result == S_OK) ? folder_path : EmptyString;
}
return ourAppDataPath;
}
- /** Wrapper for SHGetFolderPathA, returning the 'DESKTOPDIRECTORY' folder
- (or an empty string if the folder couldn't be determined. */
+ // Return the 'DESKTOPDIRECTORY' folder, or an empty string if the folder couldn't be determined.
const string& getDesktopPath() const
{
if(ourDesktopPath == "")
{
- if(!myFolderPathFunc)
- ourDesktopPath = "";
- else
- {
- char folder_path[MAX_PATH];
- HRESULT const result = (myFolderPathFunc)
- (NULL, CSIDL_DESKTOPDIRECTORY | CSIDL_FLAG_CREATE, NULL, 0, folder_path);
- ourDesktopPath = (result == 0) ? folder_path : "";
- }
+ char folder_path[MAX_PATH];
+ HRESULT const result = SHGetFolderPathA(NULL, CSIDL_DESKTOPDIRECTORY | CSIDL_FLAG_CREATE,
+ NULL, 0, folder_path);
+ ourDesktopPath = (result == S_OK) ? folder_path : EmptyString;
}
return ourDesktopPath;
}
private:
- typedef HRESULT (__stdcall * function_pointer)(HWND, int, HANDLE, DWORD, LPCSTR);
-
- HMODULE myFolderModule;
- function_pointer myFolderPathFunc;
-
static string ourHomePath, ourAppDataPath, ourDesktopPath;
// Following constructors and assignment operators not supported
diff --git a/src/windows/OSystemWINDOWS.hxx b/src/windows/OSystemWINDOWS.hxx
index 81d2490..c886179 100644
--- a/src/windows/OSystemWINDOWS.hxx
+++ b/src/windows/OSystemWINDOWS.hxx
@@ -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: OSystemWINDOWS.hxx 3244 2015-12-30 19:07:11Z stephena $
+// $Id: OSystemWINDOWS.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef OSYSTEM_WINDOWS_HXX
@@ -26,7 +26,7 @@
This class defines Windows system specific settings.
@author Stephen Anthony
- @version $Id: OSystemWINDOWS.hxx 3244 2015-12-30 19:07:11Z stephena $
+ @version $Id: OSystemWINDOWS.hxx 3301 2016-04-02 22:52:29Z stephena $
*/
class OSystemWINDOWS : public OSystem
{
@@ -35,10 +35,6 @@ class OSystemWINDOWS : public OSystem
Create a new WINDOWS operating system object
*/
OSystemWINDOWS();
-
- /**
- Destructor
- */
virtual ~OSystemWINDOWS() = default;
public:
diff --git a/src/windows/SettingsWINDOWS.hxx b/src/windows/SettingsWINDOWS.hxx
index 23fd7e4..0dae6c8 100644
--- a/src/windows/SettingsWINDOWS.hxx
+++ b/src/windows/SettingsWINDOWS.hxx
@@ -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: SettingsWINDOWS.hxx 3244 2015-12-30 19:07:11Z stephena $
+// $Id: SettingsWINDOWS.hxx 3301 2016-04-02 22:52:29Z stephena $
//============================================================================
#ifndef SETTINGS_WINDOWS_HXX
@@ -31,10 +31,6 @@ class SettingsWINDOWS : public Settings
Create a new UNIX settings object
*/
SettingsWINDOWS(OSystem& osystem);
-
- /**
- Destructor
- */
virtual ~SettingsWINDOWS() = default;
private:
diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj
index 0bd5ad0..8d81cae 100644
--- a/src/windows/Stella.vcxproj
+++ b/src/windows/Stella.vcxproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -27,22 +27,22 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v120_xp</PlatformToolset>
+ <PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v120_xp</PlatformToolset>
+ <PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v120_xp</PlatformToolset>
+ <PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v120_xp</PlatformToolset>
+ <PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -237,6 +237,7 @@
<ClCompile Include="..\debugger\gui\BoosterWidget.cxx" />
<ClCompile Include="..\debugger\gui\Cart0840Widget.cxx" />
<ClCompile Include="..\debugger\gui\Cart2KWidget.cxx" />
+ <ClCompile Include="..\debugger\gui\Cart3EPlusWidget.cxx" />
<ClCompile Include="..\debugger\gui\Cart3EWidget.cxx" />
<ClCompile Include="..\debugger\gui\Cart3FWidget.cxx" />
<ClCompile Include="..\debugger\gui\Cart4A50Widget.cxx" />
@@ -283,6 +284,7 @@
<ClCompile Include="..\debugger\gui\RiotRamWidget.cxx" />
<ClCompile Include="..\debugger\gui\RomListSettings.cxx" />
<ClCompile Include="..\debugger\gui\SaveKeyWidget.cxx" />
+ <ClCompile Include="..\emucore\Cart3EPlus.cxx" />
<ClCompile Include="..\emucore\Cart4KSC.cxx" />
<ClCompile Include="..\emucore\CartBF.cxx" />
<ClCompile Include="..\emucore\CartBFSC.cxx" />
@@ -492,6 +494,7 @@
<ClInclude Include="..\debugger\gui\BoosterWidget.hxx" />
<ClInclude Include="..\debugger\gui\Cart0840Widget.hxx" />
<ClInclude Include="..\debugger\gui\Cart2KWidget.hxx" />
+ <ClInclude Include="..\debugger\gui\Cart3EPlusWidget.hxx" />
<ClInclude Include="..\debugger\gui\Cart3EWidget.hxx" />
<ClInclude Include="..\debugger\gui\Cart3FWidget.hxx" />
<ClInclude Include="..\debugger\gui\Cart4A50Widget.hxx" />
@@ -541,6 +544,7 @@
<ClInclude Include="..\debugger\gui\RiotRamWidget.hxx" />
<ClInclude Include="..\debugger\gui\RomListSettings.hxx" />
<ClInclude Include="..\debugger\gui\SaveKeyWidget.hxx" />
+ <ClInclude Include="..\emucore\Cart3EPlus.hxx" />
<ClInclude Include="..\emucore\Cart4KSC.hxx" />
<ClInclude Include="..\emucore\CartBF.hxx" />
<ClInclude Include="..\emucore\CartBFSC.hxx" />
diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters
index 5bd5a47..1bde600 100644
--- a/src/windows/Stella.vcxproj.filters
+++ b/src/windows/Stella.vcxproj.filters
@@ -786,6 +786,12 @@
<ClCompile Include="..\debugger\gui\CartCVPlusWidget.cxx">
<Filter>Source Files\debugger</Filter>
</ClCompile>
+ <ClCompile Include="..\debugger\gui\Cart3EPlusWidget.cxx">
+ <Filter>Source Files\debugger</Filter>
+ </ClCompile>
+ <ClCompile Include="..\emucore\Cart3EPlus.cxx">
+ <Filter>Source Files\emucore</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\bspf.hxx">
@@ -1592,6 +1598,12 @@
<ClInclude Include="..\emucore\CartCVPlus.hxx">
<Filter>Header Files\emucore</Filter>
</ClInclude>
+ <ClInclude Include="..\debugger\gui\Cart3EPlusWidget.hxx">
+ <Filter>Header Files\debugger</Filter>
+ </ClInclude>
+ <ClInclude Include="..\emucore\Cart3EPlus.hxx">
+ <Filter>Header Files\emucore</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="stella.ico">
diff --git a/src/windows/stella.rc b/src/windows/stella.rc
index c4b3a0d..9b4ef1e 100755
--- a/src/windows/stella.rc
+++ b/src/windows/stella.rc
@@ -36,8 +36,8 @@ IDI_ICON ICON "stella.ico"
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,7,2,0
- PRODUCTVERSION 4,7,2,0
+ FILEVERSION 4,7,3,0
+ PRODUCTVERSION 4,7,3,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -55,12 +55,12 @@ BEGIN
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.7.2"
+ VALUE "FileVersion", "4.7.3"
VALUE "InternalName", "Stella"
VALUE "LegalCopyright", "Copyright (C) 1995-2016 The Stella Team"
VALUE "OriginalFilename", "Stella.exe"
VALUE "ProductName", "Stella"
- VALUE "ProductVersion", "4.7.2"
+ VALUE "ProductVersion", "4.7.3"
END
END
BLOCK "VarFileInfo"
diff --git a/src/yacc/YaccParser.cxx b/src/yacc/YaccParser.cxx
index f26868c..5cc96b4 100644
--- a/src/yacc/YaccParser.cxx
+++ b/src/yacc/YaccParser.cxx
@@ -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: YaccParser.cxx 3239 2015-12-29 19:22:46Z stephena $
+// $Id: YaccParser.cxx 3302 2016-04-02 23:47:46Z stephena $
//============================================================================
//#include "YaccParser.hxx"
@@ -173,29 +173,29 @@ int const_to_int(char* ch) {
// special methods that get e.g. CPU registers
CpuMethod getCpuSpecial(char* ch)
{
- if(BSPF_equalsIgnoreCase(ch, "a"))
+ if(BSPF::equalsIgnoreCase(ch, "a"))
return &CpuDebug::a;
- else if(BSPF_equalsIgnoreCase(ch, "x"))
+ else if(BSPF::equalsIgnoreCase(ch, "x"))
return &CpuDebug::x;
- else if(BSPF_equalsIgnoreCase(ch, "y"))
+ else if(BSPF::equalsIgnoreCase(ch, "y"))
return &CpuDebug::y;
- else if(BSPF_equalsIgnoreCase(ch, "pc"))
+ else if(BSPF::equalsIgnoreCase(ch, "pc"))
return &CpuDebug::pc;
- else if(BSPF_equalsIgnoreCase(ch, "sp"))
+ else if(BSPF::equalsIgnoreCase(ch, "sp"))
return &CpuDebug::sp;
- else if(BSPF_equalsIgnoreCase(ch, "c"))
+ else if(BSPF::equalsIgnoreCase(ch, "c"))
return &CpuDebug::c;
- else if(BSPF_equalsIgnoreCase(ch, "z"))
+ else if(BSPF::equalsIgnoreCase(ch, "z"))
return &CpuDebug::z;
- else if(BSPF_equalsIgnoreCase(ch, "n"))
+ else if(BSPF::equalsIgnoreCase(ch, "n"))
return &CpuDebug::n;
- else if(BSPF_equalsIgnoreCase(ch, "v"))
+ else if(BSPF::equalsIgnoreCase(ch, "v"))
return &CpuDebug::v;
- else if(BSPF_equalsIgnoreCase(ch, "d"))
+ else if(BSPF::equalsIgnoreCase(ch, "d"))
return &CpuDebug::d;
- else if(BSPF_equalsIgnoreCase(ch, "i"))
+ else if(BSPF::equalsIgnoreCase(ch, "i"))
return &CpuDebug::i;
- else if(BSPF_equalsIgnoreCase(ch, "b"))
+ else if(BSPF::equalsIgnoreCase(ch, "b"))
return &CpuDebug::b;
else
return 0;
@@ -204,9 +204,9 @@ CpuMethod getCpuSpecial(char* ch)
// special methods that get Cart RAM/ROM internal state
CartMethod getCartSpecial(char* ch)
{
- if(BSPF_equalsIgnoreCase(ch, "_bank"))
+ if(BSPF::equalsIgnoreCase(ch, "_bank"))
return &CartDebug::getBank;
- else if(BSPF_equalsIgnoreCase(ch, "_rwport"))
+ else if(BSPF::equalsIgnoreCase(ch, "_rwport"))
return &CartDebug::readFromWritePort;
else
return 0;
@@ -215,15 +215,15 @@ CartMethod getCartSpecial(char* ch)
// special methods that get TIA internal state
TiaMethod getTiaSpecial(char* ch)
{
- if(BSPF_equalsIgnoreCase(ch, "_scan"))
+ if(BSPF::equalsIgnoreCase(ch, "_scan"))
return &TIADebug::scanlines;
- else if(BSPF_equalsIgnoreCase(ch, "_fcount"))
+ else if(BSPF::equalsIgnoreCase(ch, "_fcount"))
return &TIADebug::frameCount;
- else if(BSPF_equalsIgnoreCase(ch, "_cclocks"))
+ else if(BSPF::equalsIgnoreCase(ch, "_cclocks"))
return &TIADebug::clocksThisLine;
- else if(BSPF_equalsIgnoreCase(ch, "_vsync"))
+ else if(BSPF::equalsIgnoreCase(ch, "_vsync"))
return &TIADebug::vsyncAsInt;
- else if(BSPF_equalsIgnoreCase(ch, "_vblank"))
+ else if(BSPF::equalsIgnoreCase(ch, "_vblank"))
return &TIADebug::vblankAsInt;
else
return 0;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/stella.git
More information about the Pkg-games-commits
mailing list