Hurray, it compiles and runs again. At least in software only mode,

and without snapshot support.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@371 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-02-22 02:59:54 +00:00
parent ce2974f6a9
commit f3a31ca452
11 changed files with 47 additions and 53 deletions

View File

@ -13,7 +13,7 @@
## 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: makefile,v 1.60 2005-02-21 20:41:04 stephena Exp $ ## $Id: makefile,v 1.61 2005-02-22 02:59:52 stephena Exp $
##============================================================================ ##============================================================================
##============================================================================ ##============================================================================
@ -32,7 +32,7 @@ OPTIMIZATIONS =
### to include support for saving snapshots in png format ### to include support for saving snapshots in png format
### (requires PNG library) ### (requires PNG library)
# SNAPSHOT_SUPPORT = 1 SNAPSHOT_SUPPORT = 1
### to include support for game developers ### to include support for game developers
### enables some extra commandline options that allow the user ### enables some extra commandline options that allow the user
@ -41,7 +41,7 @@ OPTIMIZATIONS =
### to build on SMP (or distcc-based) machines ### to build on SMP (or distcc-based) machines
### change to number of CPU's you have ### change to number of CPU's you have
NUMBER_CPU = 3 NUMBER_CPU = 1
##============================================================================ ##============================================================================
## All done, type make to get a list of frontends ## All done, type make to get a list of frontends

View File

@ -13,7 +13,7 @@
// 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: SoundSDL.cxx,v 1.9 2005-02-21 02:23:48 stephena Exp $ // $Id: SoundSDL.cxx,v 1.10 2005-02-22 02:59:53 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -32,12 +32,14 @@
#include "SoundSDL.hxx" #include "SoundSDL.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::SoundSDL(uInt32 fragsize) SoundSDL::SoundSDL(OSystem* osystem)
: myIsInitializedFlag(false), : Sound(osystem),
myFragmentSizeLogBase2(0), myFragmentSizeLogBase2(0),
myIsMuted(false), myIsMuted(false)
myVolume(100)
{ {
uInt32 fragsize = myOSystem->settings().getInt("fragsize");
myVolume = myOSystem->settings().getInt("volume");
if(SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) if(SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
{ {
cerr << "WARNING: Couldn't initialize SDL audio system! " << endl; cerr << "WARNING: Couldn't initialize SDL audio system! " << endl;

View File

@ -13,12 +13,14 @@
// 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: SoundSDL.hxx,v 1.7 2005-02-13 19:17:02 stephena Exp $ // $Id: SoundSDL.hxx,v 1.8 2005-02-22 02:59:53 stephena Exp $
//============================================================================ //============================================================================
#ifndef SOUNDSDL_HXX #ifndef SOUNDSDL_HXX
#define SOUNDSDL_HXX #define SOUNDSDL_HXX
class OSystem;
#include <SDL.h> #include <SDL.h>
#include "Sound.hxx" #include "Sound.hxx"
@ -29,7 +31,7 @@
This class implements the sound API for SDL. This class implements the sound API for SDL.
@author Stephen Anthony and Bradford W. Mott @author Stephen Anthony and Bradford W. Mott
@version $Id: SoundSDL.hxx,v 1.7 2005-02-13 19:17:02 stephena Exp $ @version $Id: SoundSDL.hxx,v 1.8 2005-02-22 02:59:53 stephena Exp $
*/ */
class SoundSDL : public Sound class SoundSDL : public Sound
{ {
@ -38,7 +40,7 @@ class SoundSDL : public Sound
Create a new sound object. The init method must be invoked before Create a new sound object. The init method must be invoked before
using the object. using the object.
*/ */
SoundSDL(uInt32 fragsize); SoundSDL(OSystem* osystem);
/** /**
Destructor Destructor
@ -196,9 +198,6 @@ class SoundSDL : public Sound
// Audio specification structure // Audio specification structure
SDL_AudioSpec myHardwareSpec; SDL_AudioSpec myHardwareSpec;
// Indicates if the sound device was successfully initialized
bool myIsInitializedFlag;
// Log base 2 of the selected fragment size // Log base 2 of the selected fragment size
double myFragmentSizeLogBase2; double myFragmentSizeLogBase2;

View File

@ -13,7 +13,7 @@
// 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: mainSDL.cxx,v 1.22 2005-02-21 20:41:20 stephena Exp $ // $Id: mainSDL.cxx,v 1.23 2005-02-22 02:59:53 stephena Exp $
//============================================================================ //============================================================================
#include <fstream> #include <fstream>
@ -923,20 +923,17 @@ int main(int argc, char* argv[])
// Create a sound object for playing audio // Create a sound object for playing audio
if(theSettings->getBool("sound")) if(theSettings->getBool("sound"))
{ {
uInt32 fragsize = theSettings->getInt("fragsize"); theSound = new SoundSDL(theOSystem);
Int32 volume = theSettings->getInt("volume");
theSound = new SoundSDL(fragsize);
theSound->setVolume(volume);
ostringstream message; ostringstream message;
message << "Sound enabled:" << endl message << "Sound enabled:" << endl;
<< " Volume : " << volume << endl //FIXME << " Volume : " << volume << endl
<< " Frag size: " << fragsize << endl; // << " Frag size: " << fragsize << endl;
ShowInfo(message.str()); ShowInfo(message.str());
} }
else // even if sound has been disabled, we still need a sound object else // even if sound has been disabled, we still need a sound object
{ {
theSound = new Sound(); theSound = new Sound(theOSystem);
ShowInfo("Sound disabled"); ShowInfo("Sound disabled");
} }
@ -958,9 +955,8 @@ int main(int argc, char* argv[])
in.close(); in.close();
// Create the 2600 game console // Create the 2600 game console
Console* theConsole = new Console(image, size, theOSystem); Console* theConsole = (Console*) NULL;
theConsole = new Console(image, size, theOSystem);
cerr << "got here\n";
// Free the image since we don't need it any longer // Free the image since we don't need it any longer
delete[] image; delete[] image;

View File

@ -13,7 +13,7 @@
// 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.40 2005-02-21 20:41:24 stephena Exp $ // $Id: Console.cxx,v 1.41 2005-02-22 02:59:53 stephena Exp $
//============================================================================ //============================================================================
#include <assert.h> #include <assert.h>
@ -173,12 +173,12 @@ Console::Console(const uInt8* image, uInt32 size, OSystem* osystem)
ostringstream title; ostringstream title;
title << "Stella: \"" << myProperties.get("Cartridge.Name") << "\""; title << "Stella: \"" << myProperties.get("Cartridge.Name") << "\"";
myOSystem->frameBuffer().initialize(title.str(), myOSystem->frameBuffer().initialize(title.str(),
myMediaSource->width() << 1, myMediaSource->width() << 1,
myMediaSource->height()); myMediaSource->height());
// Initialize the sound interface. // Initialize the sound interface.
uInt32 soundFrameRate = (myProperties.get("Display.Format") == "PAL") ? 50 : 60; uInt32 soundFrameRate = (myProperties.get("Display.Format") == "PAL") ? 50 : 60;
myOSystem->sound().initialize(myOSystem, mySystem, soundFrameRate); myOSystem->sound().initialize(soundFrameRate);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// 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: EventHandler.cxx,v 1.32 2005-02-21 20:42:07 stephena Exp $ // $Id: EventHandler.cxx,v 1.33 2005-02-22 02:59:53 stephena Exp $
//============================================================================ //============================================================================
#include <algorithm> #include <algorithm>
@ -42,7 +42,6 @@ EventHandler::EventHandler(OSystem* osystem)
myMenuStatus(false), myMenuStatus(false),
myRemapEnabledFlag(true) myRemapEnabledFlag(true)
{ {
cerr << "EventHandler::EventHandler()\n";
// Add this eventhandler object to the OSystem // Add this eventhandler object to the OSystem
myOSystem->attach(this); myOSystem->attach(this);

View File

@ -13,7 +13,7 @@
// 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: FrameBuffer.cxx,v 1.14 2005-02-21 20:42:38 stephena Exp $ // $Id: FrameBuffer.cxx,v 1.15 2005-02-22 02:59:54 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -81,6 +81,7 @@ FrameBuffer::FrameBuffer(OSystem* osystem)
myMenuRedraws(2), myMenuRedraws(2),
myInfoMenuWidth(0) myInfoMenuWidth(0)
{ {
// Add the framebuffer to the system
myOSystem->attach(this); myOSystem->attach(this);
} }

View File

@ -13,18 +13,23 @@
// 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: Sound.cxx,v 1.15 2005-02-21 02:23:57 stephena Exp $ // $Id: Sound.cxx,v 1.16 2005-02-22 02:59:54 stephena Exp $
//============================================================================ //============================================================================
#include "Serializer.hxx" #include "Serializer.hxx"
#include "Deserializer.hxx" #include "Deserializer.hxx"
#include "OSystem.hxx"
#include "Sound.hxx" #include "Sound.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sound::Sound(uInt32 fragsize) Sound::Sound(OSystem* osystem)
: myLastRegisterSetCycle(0) : myOSystem(osystem),
myIsInitializedFlag(false),
myLastRegisterSetCycle(0)
{ {
// Add the sound object to the system
myOSystem->attach(this);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -44,10 +49,8 @@ void Sound::mute(bool state)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Sound::initialize(OSystem* osystem, System* system, double displayframerate) void Sound::initialize(double displayframerate)
{ {
myOSystem = osystem;
mySystem = system;
myLastRegisterSetCycle = 0; myLastRegisterSetCycle = 0;
myDisplayFrameRate = displayframerate; myDisplayFrameRate = displayframerate;
} }

View File

@ -13,7 +13,7 @@
// 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: Sound.hxx,v 1.14 2005-02-21 02:23:57 stephena Exp $ // $Id: Sound.hxx,v 1.15 2005-02-22 02:59:54 stephena Exp $
//============================================================================ //============================================================================
#ifndef SOUND_HXX #ifndef SOUND_HXX
@ -22,7 +22,6 @@
class OSystem; class OSystem;
class Serializer; class Serializer;
class Deserializer; class Deserializer;
class System;
#include "bspf.hxx" #include "bspf.hxx"
@ -32,7 +31,7 @@ class System;
to compile Stella with no sound support whatsoever. to compile Stella with no sound support whatsoever.
@author Stephen Anthony and Bradford W. Mott @author Stephen Anthony and Bradford W. Mott
@version $Id: Sound.hxx,v 1.14 2005-02-21 02:23:57 stephena Exp $ @version $Id: Sound.hxx,v 1.15 2005-02-22 02:59:54 stephena Exp $
*/ */
class Sound class Sound
{ {
@ -41,7 +40,7 @@ class Sound
Create a new sound object. The init method must be invoked before Create a new sound object. The init method must be invoked before
using the object. using the object.
*/ */
Sound(uInt32 fragsize = 512); Sound(OSystem* osystem);
/** /**
Destructor Destructor
@ -61,11 +60,9 @@ class Sound
Initializes the sound device. This must be called before any Initializes the sound device. This must be called before any
calls are made to derived methods. calls are made to derived methods.
@param osystem The OSystem
@param system The M6502 system
@param framerate The base framerate depending on NTSC or PAL ROM @param framerate The base framerate depending on NTSC or PAL ROM
*/ */
virtual void initialize(OSystem* osystem, System* system, double displayframerate); virtual void initialize(double displayframerate);
/** /**
Return true iff the sound device was successfully initialized. Return true iff the sound device was successfully initialized.
@ -133,8 +130,8 @@ public:
// The OSystem for this sound object // The OSystem for this sound object
OSystem* myOSystem; OSystem* myOSystem;
// The M6502 system for this sound object // Indicates if the sound device was successfully initialized
System* mySystem; bool myIsInitializedFlag;
// Indicates the cycle when a sound register was last set // Indicates the cycle when a sound register was last set
Int32 myLastRegisterSetCycle; Int32 myLastRegisterSetCycle;

View File

@ -13,7 +13,7 @@
// 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: TIA.cxx,v 1.37 2005-02-21 20:43:22 stephena Exp $ // $Id: TIA.cxx,v 1.38 2005-02-22 02:59:54 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -265,8 +265,6 @@ void TIA::install(System& system)
uInt16 shift = mySystem->pageShift(); uInt16 shift = mySystem->pageShift();
mySystem->resetCycles(); mySystem->resetCycles();
cerr << "TIA::install()\n";
// All accesses are to this device // All accesses are to this device
System::PageAccess access; System::PageAccess access;

View File

@ -13,7 +13,7 @@
// 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: System.cxx,v 1.5 2005-02-21 20:43:28 stephena Exp $ // $Id: System.cxx,v 1.6 2005-02-22 02:59:54 stephena Exp $
//============================================================================ //============================================================================
#include <assert.h> #include <assert.h>
@ -101,7 +101,6 @@ void System::reset()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void System::attach(Device* device) void System::attach(Device* device)
{ {
cerr << "System::attach()\n";
assert(myNumberOfDevices < 100); assert(myNumberOfDevices < 100);
// Add device to my collection of devices // Add device to my collection of devices