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
## 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
### (requires PNG library)
# SNAPSHOT_SUPPORT = 1
SNAPSHOT_SUPPORT = 1
### to include support for game developers
### enables some extra commandline options that allow the user
@ -41,7 +41,7 @@ OPTIMIZATIONS =
### to build on SMP (or distcc-based) machines
### change to number of CPU's you have
NUMBER_CPU = 3
NUMBER_CPU = 1
##============================================================================
## 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
// 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>
@ -32,12 +32,14 @@
#include "SoundSDL.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::SoundSDL(uInt32 fragsize)
: myIsInitializedFlag(false),
SoundSDL::SoundSDL(OSystem* osystem)
: Sound(osystem),
myFragmentSizeLogBase2(0),
myIsMuted(false),
myVolume(100)
myIsMuted(false)
{
uInt32 fragsize = myOSystem->settings().getInt("fragsize");
myVolume = myOSystem->settings().getInt("volume");
if(SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
{
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
// 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
#define SOUNDSDL_HXX
class OSystem;
#include <SDL.h>
#include "Sound.hxx"
@ -29,7 +31,7 @@
This class implements the sound API for SDL.
@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
{
@ -38,7 +40,7 @@ class SoundSDL : public Sound
Create a new sound object. The init method must be invoked before
using the object.
*/
SoundSDL(uInt32 fragsize);
SoundSDL(OSystem* osystem);
/**
Destructor
@ -196,9 +198,6 @@ class SoundSDL : public Sound
// Audio specification structure
SDL_AudioSpec myHardwareSpec;
// Indicates if the sound device was successfully initialized
bool myIsInitializedFlag;
// Log base 2 of the selected fragment size
double myFragmentSizeLogBase2;

View File

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

View File

@ -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: 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>
@ -173,12 +173,12 @@ Console::Console(const uInt8* image, uInt32 size, OSystem* osystem)
ostringstream title;
title << "Stella: \"" << myProperties.get("Cartridge.Name") << "\"";
myOSystem->frameBuffer().initialize(title.str(),
myMediaSource->width() << 1,
myMediaSource->height());
myMediaSource->width() << 1,
myMediaSource->height());
// Initialize the sound interface.
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
// 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>
@ -42,7 +42,6 @@ EventHandler::EventHandler(OSystem* osystem)
myMenuStatus(false),
myRemapEnabledFlag(true)
{
cerr << "EventHandler::EventHandler()\n";
// Add this eventhandler object to the OSystem
myOSystem->attach(this);

View File

@ -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: 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>
@ -81,6 +81,7 @@ FrameBuffer::FrameBuffer(OSystem* osystem)
myMenuRedraws(2),
myInfoMenuWidth(0)
{
// Add the framebuffer to the system
myOSystem->attach(this);
}

View File

@ -13,18 +13,23 @@
// See the file "license" for information on usage and redistribution of
// 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 "Deserializer.hxx"
#include "OSystem.hxx"
#include "Sound.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sound::Sound(uInt32 fragsize)
: myLastRegisterSetCycle(0)
Sound::Sound(OSystem* osystem)
: 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;
myDisplayFrameRate = displayframerate;
}

View File

@ -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: 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
@ -22,7 +22,6 @@
class OSystem;
class Serializer;
class Deserializer;
class System;
#include "bspf.hxx"
@ -32,7 +31,7 @@ class System;
to compile Stella with no sound support whatsoever.
@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
{
@ -41,7 +40,7 @@ class Sound
Create a new sound object. The init method must be invoked before
using the object.
*/
Sound(uInt32 fragsize = 512);
Sound(OSystem* osystem);
/**
Destructor
@ -61,11 +60,9 @@ class Sound
Initializes the sound device. This must be called before any
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
*/
virtual void initialize(OSystem* osystem, System* system, double displayframerate);
virtual void initialize(double displayframerate);
/**
Return true iff the sound device was successfully initialized.
@ -133,8 +130,8 @@ public:
// The OSystem for this sound object
OSystem* myOSystem;
// The M6502 system for this sound object
System* mySystem;
// Indicates if the sound device was successfully initialized
bool myIsInitializedFlag;
// Indicates the cycle when a sound register was last set
Int32 myLastRegisterSetCycle;

View File

@ -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: 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>
@ -265,8 +265,6 @@ void TIA::install(System& system)
uInt16 shift = mySystem->pageShift();
mySystem->resetCycles();
cerr << "TIA::install()\n";
// All accesses are to this device
System::PageAccess access;

View File

@ -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: 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>
@ -101,7 +101,6 @@ void System::reset()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void System::attach(Device* device)
{
cerr << "System::attach()\n";
assert(myNumberOfDevices < 100);
// Add device to my collection of devices