From b270f7f231404fd3a0745c6f090f6223f960b7f4 Mon Sep 17 00:00:00 2001 From: stephena Date: Mon, 19 May 2008 03:15:12 +0000 Subject: [PATCH] Similar to the last commit, added cycle resetting the TrackBall class. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1519 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/emucore/TrackBall.cxx | 9 ++++++++- stella/src/emucore/TrackBall.hxx | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/stella/src/emucore/TrackBall.cxx b/stella/src/emucore/TrackBall.cxx index e79a0d31c..cba37fde2 100644 --- a/stella/src/emucore/TrackBall.cxx +++ b/stella/src/emucore/TrackBall.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TrackBall.cxx,v 1.1 2008-05-12 22:40:25 stephena Exp $ +// $Id: TrackBall.cxx,v 1.2 2008-05-19 03:15:12 stephena Exp $ //============================================================================ #include "Event.hxx" @@ -154,6 +154,13 @@ void TrackBall::update() myDigitalPinState[Six] = (myEvent.get(Event::MouseButtonValue) == 0); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TrackBall::systemCyclesReset() +{ + myCyclesWhenSWCHARead -= mySystem.cycles(); +} + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const uInt32 TrackBall::ourTrakBallTableTB_H[2][2] = { { 0x40, 0x00 }, { 0xc0, 0x80 } diff --git a/stella/src/emucore/TrackBall.hxx b/stella/src/emucore/TrackBall.hxx index e4a9502ed..1eb4f212a 100644 --- a/stella/src/emucore/TrackBall.hxx +++ b/stella/src/emucore/TrackBall.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TrackBall.hxx,v 1.1 2008-05-12 22:40:25 stephena Exp $ +// $Id: TrackBall.hxx,v 1.2 2008-05-19 03:15:12 stephena Exp $ //============================================================================ #ifndef TRACKBALL_HXX @@ -35,7 +35,7 @@ AmigaMouse: Amiga Mouse @author Stephen Anthony & z26 team - @version $Id: TrackBall.hxx,v 1.1 2008-05-12 22:40:25 stephena Exp $ + @version $Id: TrackBall.hxx,v 1.2 2008-05-19 03:15:12 stephena Exp $ */ class TrackBall : public Controller { @@ -70,6 +70,13 @@ class TrackBall : public Controller */ virtual void update(); + /** + Notification method invoked by the system right before the + system resets its cycle counter to zero. It may be necessary + to override this method for devices that remember cycle counts. + */ + virtual void systemCyclesReset(); + private: // Counter to iterate through the gray codes int myHCounter, myVCounter;