From db5eb89335df15c489d58e78158c993999582697 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 4 Feb 2018 18:58:53 -0330 Subject: [PATCH 1/6] Updated changelog for one last fix for TIA PF collision handling. --- Changes.txt | 3 +++ src/common/Version.hxx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changes.txt b/Changes.txt index f82eefac1..b38b325cd 100644 --- a/Changes.txt +++ b/Changes.txt @@ -47,6 +47,9 @@ * Fixed bug in TIA collision handling; it is now disabled in VBlank. + * Improve TIA PF collision handling during hblank; this fixes a bug in + Thrust ROM. + * Fixed wrong display of HM values in debugger after 'HMCLR' has been executed. diff --git a/src/common/Version.hxx b/src/common/Version.hxx index e1c46ca47..6a7e3ac90 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -19,6 +19,6 @@ #define VERSION_HXX #define STELLA_VERSION "5.1" -#define STELLA_BUILD "4138" +#define STELLA_BUILD "4140" #endif From d07f7771a3fc38690cbefa7880d07b185c1093a7 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 15 Feb 2018 19:25:54 -0330 Subject: [PATCH 2/6] Add missing locks around Debugger::saveOldState() (fixes #298). --- src/debugger/Debugger.cxx | 48 ++++++++++++++++++++------------------- src/debugger/Debugger.hxx | 9 ++++---- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx index 7d5e28404..63ad94f73 100644 --- a/src/debugger/Debugger.cxx +++ b/src/debugger/Debugger.cxx @@ -226,9 +226,9 @@ const string Debugger::invIfChanged(int reg, int oldReg) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::reset() { - unlockBankswitchState(); + unlockSystem(); mySystem.reset(); - lockBankswitchState(); + lockSystem(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -253,21 +253,21 @@ string Debugger::setRAM(IntArray& args) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::saveState(int state) { - mySystem.clearDirtyPages(); - - unlockBankswitchState(); + // Saving a state is implicitly a read-only operation, so we keep the + // system locked, so no changes can occur myOSystem.state().saveState(state); - lockBankswitchState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::loadState(int state) { + // We're loading a new state, so we start with a clean slate mySystem.clearDirtyPages(); - unlockBankswitchState(); + // State loading could initiate a bankswitch, so we allow it temporarily + unlockSystem(); myOSystem.state().loadState(state); - lockBankswitchState(); + lockSystem(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -277,9 +277,9 @@ int Debugger::step() uInt64 startCycle = mySystem.cycles(); - unlockBankswitchState(); + unlockSystem(); myOSystem.console().tia().updateScanlineByStep().flushLineCache(); - lockBankswitchState(); + lockSystem(); addState("step"); return int(mySystem.cycles() - startCycle); @@ -305,9 +305,9 @@ int Debugger::trace() uInt64 startCycle = mySystem.cycles(); int targetPC = myCpuDebug->pc() + 3; // return address - unlockBankswitchState(); + unlockSystem(); myOSystem.console().tia().updateScanlineByTrace(targetPC).flushLineCache(); - lockBankswitchState(); + lockSystem(); addState("trace"); return int(mySystem.cycles() - startCycle); @@ -490,13 +490,13 @@ void Debugger::nextScanline(int lines) saveOldState(); - unlockBankswitchState(); + unlockSystem(); while(lines) { myOSystem.console().tia().updateScanline(); --lines; } - lockBankswitchState(); + lockSystem(); addState(buf.str()); myOSystem.console().tia().flushLineCache(); @@ -510,13 +510,13 @@ void Debugger::nextFrame(int frames) saveOldState(); - unlockBankswitchState(); + unlockSystem(); while(frames) { myOSystem.console().tia().update(); --frames; } - lockBankswitchState(); + lockSystem(); addState(buf.str()); } @@ -535,13 +535,13 @@ uInt16 Debugger::windStates(uInt16 numStates, bool unwind, string& message) saveOldState(); - unlockBankswitchState(); + unlockSystem(); uInt64 startCycles = myOSystem.console().tia().cycles(); uInt16 winds = r.windStates(numStates, unwind); message = r.getUnitString(myOSystem.console().tia().cycles() - startCycles); - lockBankswitchState(); + lockSystem(); updateRewindbuttons(r); return winds; @@ -593,13 +593,15 @@ bool Debugger::patchROM(uInt16 addr, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::saveOldState(bool clearDirtyPages) { - if (clearDirtyPages) + if(clearDirtyPages) mySystem.clearDirtyPages(); + lockSystem(); myCartDebug->saveOldState(); myCpuDebug->saveOldState(); myRiotDebug->saveOldState(); myTiaDebug->saveOldState(); + unlockSystem(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -615,7 +617,7 @@ void Debugger::addState(string rewindMsg) void Debugger::setStartState() { // Lock the bus each time the debugger is entered, so we don't disturb anything - lockBankswitchState(); + lockSystem(); // Save initial state and add it to the rewind list (except when in currently rewinding) RewindManager& r = myOSystem.state().rewindManager(); @@ -636,7 +638,7 @@ void Debugger::setQuitState() saveOldState(); // Bus must be unlocked for normal operation when leaving debugger mode - unlockBankswitchState(); + unlockSystem(); // execute one instruction on quit. If we're // sitting at a breakpoint/trap, this will get us past it. @@ -771,14 +773,14 @@ void Debugger::getCompletions(const char* in, StringList& list) const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Debugger::lockBankswitchState() +void Debugger::lockSystem() { mySystem.lockDataBus(); myConsole.cartridge().lockBank(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Debugger::unlockBankswitchState() +void Debugger::unlockSystem() { mySystem.unlockDataBus(); myConsole.cartridge().unlockBank(); diff --git a/src/debugger/Debugger.hxx b/src/debugger/Debugger.hxx index 0324cbdc0..abb0db1b8 100644 --- a/src/debugger/Debugger.hxx +++ b/src/debugger/Debugger.hxx @@ -231,14 +231,13 @@ class Debugger : public DialogContainer /** Normally, accessing RAM or ROM during emulation can possibly trigger - bankswitching. However, when we're in the debugger, we'd like to - inspect values without actually triggering bankswitches. The + bankswitching or other inadvertent changes. However, when we're in + the debugger, we'd like to inspect values without restriction. The read/write state must therefore be locked before accessing values, and unlocked for normal emulation to occur. - (takes mediasource into account) */ - void lockBankswitchState(); - void unlockBankswitchState(); + void lockSystem(); + void unlockSystem(); private: /** From 1a4670ca0ec627d75d8a8140a547e96f8b2e4602 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 15 Feb 2018 19:40:57 -0330 Subject: [PATCH 3/6] Cherry-pick debugger saveOldState() fix from master, and bump to 5.1.1. --- src/common/Version.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 6a7e3ac90..1721470e9 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -18,7 +18,7 @@ #ifndef VERSION_HXX #define VERSION_HXX -#define STELLA_VERSION "5.1" -#define STELLA_BUILD "4140" +#define STELLA_VERSION "5.1.1" +#define STELLA_BUILD "4141" #endif From a38b168db8fe9a36e9883a3e46b399ca9e1ea83c Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 15 Feb 2018 19:51:57 -0330 Subject: [PATCH 4/6] Updated various files for 5.1.1 release (dates still TBD). --- Announce.txt | 22 +++++++++++----------- Changes.txt | 23 +++++++++++++++++++++-- debian/changelog | 7 +++++++ docs/debugger.html | 2 +- docs/index.html | 2 +- src/unix/stella.spec | 5 ++++- src/windows/stella.rc | 8 ++++---- 7 files changed, 49 insertions(+), 20 deletions(-) diff --git a/Announce.txt b/Announce.txt index 0e6c7b85d..191408bd2 100644 --- a/Announce.txt +++ b/Announce.txt @@ -9,7 +9,7 @@ SSSS ttt eeeee llll llll aaaaa =========================================================================== - Release 5.1 for Linux, MacOSX and Windows + Release 5.1.1 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 5.1 release of Stella for Linux, Mac OSX and Windows. The +This is the 5.1.1 release of Stella for Linux, Mac OSX and Windows. The distributions currently available are: * Binaries for Windows XP_SP3(*)/Vista/7/8/10 : - Stella-5.1-win32.exe (32-bit EXE installer) - Stella-5.1-x64.exe (64-bit EXE installer) - Stella-5.1-windows.zip (32/64 bit versions) + Stella-5.1.1-win32.exe (32-bit EXE installer) + Stella-5.1.1-x64.exe (64-bit EXE installer) + Stella-5.1.1-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-5.1-macosx.dmg (64-bit Intel) + Stella-5.1.1-macosx.dmg (64-bit Intel) * Binary distribution in 32-bit & 64-bit Ubuntu DEB format : - stella_5.1-1_i386.deb - stella_5.1-1_amd64.deb + stella_5.1.1-1_i386.deb + stella_5.1.1-1_amd64.deb * Binary distribution in 32-bit & 64-bit RPM format : - stella-5.1-2.i386.rpm - stella-5.1-2.x86_64.rpm + stella-5.1.1-2.i386.rpm + stella-5.1.1-2.x86_64.rpm * Source code distribution for all platforms : - stella-5.1-src.tar.xz + stella-5.1.1-src.tar.xz Distribution Site diff --git a/Changes.txt b/Changes.txt index b38b325cd..7f2d767f5 100644 --- a/Changes.txt +++ b/Changes.txt @@ -1,3 +1,24 @@ +=========================================================================== + + 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 + +=========================================================================== + Release History +=========================================================================== + +5.1 to 5.1.1: (xxx xx, 2018) + + * Fixed bug in Stargunner ROM starting with a blank screen. + +-Have fun! + + 5.0.2 to 5.1: (February 4, 2018) * Added "Time Machine" mode, which automatically creates save states @@ -135,8 +156,6 @@ * Updated included PNG library to latest stable version. --Have fun! - 5.0.1 to 5.0.2: (August 20, 2017) diff --git a/debian/changelog b/debian/changelog index 250f3a179..d4b0e866e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +stella (5.1.1-1) stable; urgency=high + + * Version 5.1.1 release + + -- Stephen Anthony Sun, 4 Feb 2018 17:09:59 -0230 + + stella (5.1-1) stable; urgency=high * Version 5.1 release diff --git a/docs/debugger.html b/docs/debugger.html index 6af0123c9..9fb87cfe9 100644 --- a/docs/debugger.html +++ b/docs/debugger.html @@ -6,7 +6,7 @@
Stella
-

Release 5.1

+

Release 5.1.1

Integrated Debugger

(a work in progress)


diff --git a/docs/index.html b/docs/index.html index 8050fcaca..fbb483481 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@

A multi-platform Atari 2600 VCS emulator

-

Release 5.1

+

Release 5.1.1



User's Guide

diff --git a/src/unix/stella.spec b/src/unix/stella.spec index 8034789ea..90116b5cd 100644 --- a/src/unix/stella.spec +++ b/src/unix/stella.spec @@ -1,5 +1,5 @@ %define name stella -%define version 5.1 +%define version 5.1.1 %define rel 1 %define enable_sound 1 @@ -101,6 +101,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} %_datadir/icons/large/%{name}.png %changelog +* Sun Feb 04 2018 Stephen Anthony 5.1.1-1 +- Version 5.1.1 release + * Sun Feb 04 2018 Stephen Anthony 5.1-1 - Version 5.1 release diff --git a/src/windows/stella.rc b/src/windows/stella.rc index 57c0a4282..4b5e223ed 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 5,1,0,0 - PRODUCTVERSION 5,1,0,0 + FILEVERSION 5,1,1,0 + PRODUCTVERSION 5,1,1,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 (https://stella-emu.github.io)" VALUE "FileDescription", "Stella" - VALUE "FileVersion", "5.1" + VALUE "FileVersion", "5.1.1" VALUE "InternalName", "Stella" VALUE "LegalCopyright", "Copyright (C) 1995-2018 The Stella Team" VALUE "OriginalFilename", "Stella.exe" VALUE "ProductName", "Stella" - VALUE "ProductVersion", "5.1" + VALUE "ProductVersion", "5.1.1" END END BLOCK "VarFileInfo" From 36997d4d7a5bdc6670c1ce08acd17e23bfad8305 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Wed, 21 Feb 2018 15:38:29 -0330 Subject: [PATCH 5/6] Final updates for 5.1.1 release. --- Changes.txt | 2 +- debian/changelog | 2 +- src/common/Version.hxx | 2 +- src/unix/stella.spec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Changes.txt b/Changes.txt index 7f2d767f5..360ac06dd 100644 --- a/Changes.txt +++ b/Changes.txt @@ -12,7 +12,7 @@  Release History ===========================================================================  -5.1 to 5.1.1: (xxx xx, 2018) +5.1 to 5.1.1: (February 21, 2018) * Fixed bug in Stargunner ROM starting with a blank screen. diff --git a/debian/changelog b/debian/changelog index d4b0e866e..c27055554 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,7 @@ stella (5.1.1-1) stable; urgency=high * Version 5.1.1 release - -- Stephen Anthony Sun, 4 Feb 2018 17:09:59 -0230 + -- Stephen Anthony Wed, 21 Feb 2018 17:09:59 -0230 stella (5.1-1) stable; urgency=high diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 1721470e9..95c17ca81 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -19,6 +19,6 @@ #define VERSION_HXX #define STELLA_VERSION "5.1.1" -#define STELLA_BUILD "4141" +#define STELLA_BUILD "4144" #endif diff --git a/src/unix/stella.spec b/src/unix/stella.spec index 90116b5cd..38ebec3b4 100644 --- a/src/unix/stella.spec +++ b/src/unix/stella.spec @@ -101,7 +101,7 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} %_datadir/icons/large/%{name}.png %changelog -* Sun Feb 04 2018 Stephen Anthony 5.1.1-1 +* Wed Feb 21 2018 Stephen Anthony 5.1.1-1 - Version 5.1.1 release * Sun Feb 04 2018 Stephen Anthony 5.1-1 From d8178f546bef24a70e026d5ad0e39e71423adf21 Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Tue, 13 Mar 2018 22:12:57 +0100 Subject: [PATCH 6/6] Make sure that the hardware state is up to date before entering the debugger. --- src/emucore/M6502.cxx | 29 ++++++++++++++++++++--------- src/emucore/M6502.hxx | 6 ++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index be39a27e6..24f2316a1 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -237,6 +237,21 @@ bool M6502::execute(uInt32 number) return status; } +bool M6502::startDebugger(const string& message, int address, bool read) { + handleHalt(); + + mySystem->tia().updateEmulation(); + mySystem->m6532().updateEmulation(); + + #ifndef DEBUGGER_SUPPORT + return false; + #endif + + if (!myDebugger) return false; + + return myDebugger->start(message, address, read); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inline bool M6502::_execute(uInt32 number) { @@ -258,23 +273,19 @@ inline bool M6502::_execute(uInt32 number) { bool read = myJustHitReadTrapFlag; myJustHitReadTrapFlag = myJustHitWriteTrapFlag = false; - if(myDebugger && myDebugger->start(myHitTrapInfo.message, myHitTrapInfo.address, read)) - { - return true; - } + + if (startDebugger(myHitTrapInfo.message, myHitTrapInfo.address, read)) return true; } - if(myBreakPoints.isInitialized() && myBreakPoints.isSet(PC)) - if(myDebugger && myDebugger->start("BP: ", PC)) - return true; + if(myBreakPoints.isInitialized() && myBreakPoints.isSet(PC) && startDebugger("BP: ", PC)) + return true; int cond = evalCondBreaks(); if(cond > -1) { stringstream msg; msg << "CBP[" << Common::Base::HEX2 << cond << "]: " << myCondBreakNames[cond]; - if(myDebugger && myDebugger->start(msg.str())) - return true; + if (startDebugger(msg.str())) return true; } cond = evalCondSaveStates(); diff --git a/src/emucore/M6502.hxx b/src/emucore/M6502.hxx index 3c88674ac..5786b938a 100644 --- a/src/emucore/M6502.hxx +++ b/src/emucore/M6502.hxx @@ -326,6 +326,12 @@ class M6502 : public Serializable */ bool _execute(uInt32 number); + /** + Make sure that the current hardware state is up to date (TIA & RIOT) and dispatch + debugger. + */ + bool startDebugger(const string& message = "", int address = -1, bool read = true); + private: /** Bit fields used to indicate that certain conditions need to be