Added new argument to constructor to pass in the desired frame rate

to the Console.  This information is needed by the SoundSDL class to
properly schedule the sound.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@261 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
bwmott 2004-06-13 04:59:40 +00:00
parent 21af97fb43
commit 3d231acd53
2 changed files with 24 additions and 8 deletions

View File

@ -8,12 +8,12 @@
// SS SS tt ee ll ll aa aa // SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa // SSSS ttt eeeee llll llll aaaaa
// //
// Copyright (c) 1995-2002 by Bradford W. Mott // Copyright (c) 1995-2004 by Bradford W. Mott
// //
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: Console.cxx,v 1.28 2004-05-28 22:07:57 stephena Exp $ // $Id: Console.cxx,v 1.29 2004-06-13 04:59:40 bwmott Exp $
//============================================================================ //============================================================================
#include <assert.h> #include <assert.h>
@ -52,11 +52,12 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Console::Console(const uInt8* image, uInt32 size, const char* filename, Console::Console(const uInt8* image, uInt32 size, const char* filename,
Settings& settings, PropertiesSet& propertiesSet, Settings& settings, PropertiesSet& propertiesSet,
FrameBuffer& framebuffer, Sound& sound) FrameBuffer& framebuffer, Sound& sound, uInt32 frameRate)
: mySettings(settings), : mySettings(settings),
myPropSet(propertiesSet), myPropSet(propertiesSet),
myFrameBuffer(framebuffer), myFrameBuffer(framebuffer),
mySound(sound) mySound(sound),
myFrameRate(frameRate)
{ {
myControllers[0] = 0; myControllers[0] = 0;
myControllers[1] = 0; myControllers[1] = 0;
@ -224,6 +225,12 @@ FrameBuffer& Console::frameBuffer() const
return myFrameBuffer; return myFrameBuffer;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::frameRate() const
{
return myFrameRate;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sound& Console::sound() const Sound& Console::sound() const
{ {

View File

@ -8,12 +8,12 @@
// SS SS tt ee ll ll aa aa // SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa // SSSS ttt eeeee llll llll aaaaa
// //
// Copyright (c) 1995-2002 by Bradford W. Mott // Copyright (c) 1995-2004 by Bradford W. Mott
// //
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: Console.hxx,v 1.17 2003-12-04 19:18:45 stephena Exp $ // $Id: Console.hxx,v 1.18 2004-06-13 04:59:40 bwmott Exp $
//============================================================================ //============================================================================
#ifndef CONSOLE_HXX #ifndef CONSOLE_HXX
@ -41,7 +41,7 @@ class FrameBuffer;
This class represents the entire game console. This class represents the entire game console.
@author Bradford W. Mott @author Bradford W. Mott
@version $Id: Console.hxx,v 1.17 2003-12-04 19:18:45 stephena Exp $ @version $Id: Console.hxx,v 1.18 2004-06-13 04:59:40 bwmott Exp $
*/ */
class Console class Console
{ {
@ -57,10 +57,11 @@ class Console
@param profiles The game profiles object to use @param profiles The game profiles object to use
@param framebuffer The framebuffer object to use @param framebuffer The framebuffer object to use
@param sound The sound object to use @param sound The sound object to use
@param framerate The framerate being used
*/ */
Console(const uInt8* image, uInt32 size, const char* filename, Console(const uInt8* image, uInt32 size, const char* filename,
Settings& settings, PropertiesSet& propertiesSet, Settings& settings, PropertiesSet& propertiesSet,
FrameBuffer& framebuffer, Sound& sound); FrameBuffer& framebuffer, Sound& sound, uInt32 frameRate);
/** /**
Create a new console object by copying another one Create a new console object by copying another one
@ -112,6 +113,11 @@ class Console
*/ */
FrameBuffer& frameBuffer() const; FrameBuffer& frameBuffer() const;
/**
Get the frame rate for the emulation
*/
uInt32 frameRate() const;
/** /**
Get the sound object of the console Get the sound object of the console
@ -269,6 +275,9 @@ class Console
// Reference to the Sound object // Reference to the Sound object
Sound& mySound; Sound& mySound;
// Frame rate being used by the emulator
uInt32 myFrameRate;
// Pointer to the EventHandler object // Pointer to the EventHandler object
EventHandler* myEventHandler; EventHandler* myEventHandler;