Added the Event::Quit event to the remapping menu. This was requested by

quite a few people.  The only problem is that if you ever erase the 'Escape'
mapping for Event::Quit, there's no way to add it back, since while in menu
remap mode, the Escape key is used to erase an entry.  It can't be assigned
to any event.  So if you erase it, you'll have to delete the stellarc/
stella.ini file.  I can see this generating quite a few questions ...

Reworked the sound code for PAL games.  Now they sound just as good as NTSC.
Still TODO is research the correct speed for playing PAL games, since 60 fps
seems too fast.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@328 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2004-07-22 01:54:08 +00:00
parent 4c6eddb427
commit e060f52112
6 changed files with 25 additions and 16 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: SoundSDL.cxx,v 1.5 2004-06-20 01:12:12 stephena Exp $ // $Id: SoundSDL.cxx,v 1.6 2004-07-22 01:54:08 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -166,7 +166,7 @@ void SoundSDL::set(uInt16 addr, uInt8 value, Int32 cycle)
(1193191.66666667)); (1193191.66666667));
// Now, adjust the time based on the frame rate the user has selected // Now, adjust the time based on the frame rate the user has selected
delta = delta * (60.0 / (double)myConsole->frameRate()); delta = delta * (myDisplayFrameRate / (double)myConsole->frameRate());
RegWrite info; RegWrite info;
info.addr = addr; info.addr = addr;
@ -189,10 +189,10 @@ void SoundSDL::processFragment(uInt8* stream, Int32 length)
} }
// If there are excessive items on the queue then we'll remove some // If there are excessive items on the queue then we'll remove some
if(myRegWriteQueue.duration() > (myFragmentSizeLogBase2 / 60.0)) if(myRegWriteQueue.duration() > (myFragmentSizeLogBase2 / myDisplayFrameRate))
{ {
double removed = 0.0; double removed = 0.0;
while(removed < ((myFragmentSizeLogBase2 - 1) / 60.0)) while(removed < ((myFragmentSizeLogBase2 - 1) / myDisplayFrameRate))
{ {
RegWrite& info = myRegWriteQueue.front(); RegWrite& info = myRegWriteQueue.front();
removed += info.delta; removed += info.delta;

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.34 2004-07-10 13:20:26 stephena Exp $ // $Id: Console.cxx,v 1.35 2004-07-22 01:54:08 stephena Exp $
//============================================================================ //============================================================================
#include <assert.h> #include <assert.h>
@ -167,7 +167,8 @@ Console::Console(const uInt8* image, uInt32 size, const char* filename,
myFrameBuffer.initDisplay(this, myMediaSource); myFrameBuffer.initDisplay(this, myMediaSource);
// Initialize the sound interface. // Initialize the sound interface.
mySound.init(this, myMediaSource, mySystem); uInt32 framerate = (myProperties.get("Display.Format") == "PAL") ? 50 : 60;
mySound.init(this, myMediaSource, mySystem, framerate);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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.10 2004-06-27 22:44:04 stephena Exp $ // $Id: FrameBuffer.cxx,v 1.11 2004-07-22 01:54:08 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -696,7 +696,7 @@ FrameBuffer::MainMenuItem FrameBuffer::ourMainMenu[2] = {
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBuffer::RemapMenuItem FrameBuffer::ourRemapMenu[57] = { FrameBuffer::RemapMenuItem FrameBuffer::ourRemapMenu[58] = {
{ Event::ConsoleSelect, "Select", "" }, { Event::ConsoleSelect, "Select", "" },
{ Event::ConsoleReset, "Reset", "" }, { Event::ConsoleReset, "Reset", "" },
{ Event::ConsoleColor, "Color TV", "" }, { Event::ConsoleColor, "Color TV", "" },
@ -710,6 +710,7 @@ FrameBuffer::RemapMenuItem FrameBuffer::ourRemapMenu[57] = {
{ Event::LoadState, "Load State", "" }, { Event::LoadState, "Load State", "" },
{ Event::TakeSnapshot, "Snapshot", "" }, { Event::TakeSnapshot, "Snapshot", "" },
{ Event::Pause, "Pause", "" }, { Event::Pause, "Pause", "" },
{ Event::Quit, "Quit", "" },
{ Event::JoystickZeroUp, "Left-Joy Up", "" }, { Event::JoystickZeroUp, "Left-Joy Up", "" },
{ Event::JoystickZeroDown, "Left-Joy Down", "" }, { Event::JoystickZeroDown, "Left-Joy Down", "" },

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.hxx,v 1.10 2004-06-23 03:43:47 stephena Exp $ // $Id: FrameBuffer.hxx,v 1.11 2004-07-22 01:54:08 stephena Exp $
//============================================================================ //============================================================================
#ifndef FRAMEBUFFER_HXX #ifndef FRAMEBUFFER_HXX
@ -35,7 +35,7 @@ class Console;
can be changed. can be changed.
@author Stephen Anthony @author Stephen Anthony
@version $Id: FrameBuffer.hxx,v 1.10 2004-06-23 03:43:47 stephena Exp $ @version $Id: FrameBuffer.hxx,v 1.11 2004-07-22 01:54:08 stephena Exp $
*/ */
class FrameBuffer class FrameBuffer
{ {
@ -337,7 +337,7 @@ class FrameBuffer
static MainMenuItem ourMainMenu[2]; static MainMenuItem ourMainMenu[2];
// Holds static strings for the remap menu // Holds static strings for the remap menu
static RemapMenuItem ourRemapMenu[57]; static RemapMenuItem ourRemapMenu[58];
// Holds the current key mappings // Holds the current key mappings
Event::Type* myKeyTable; Event::Type* myKeyTable;

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.cxx,v 1.12 2004-06-13 04:54:25 bwmott Exp $ // $Id: Sound.cxx,v 1.13 2004-07-22 01:54:08 stephena Exp $
//============================================================================ //============================================================================
#include "Serializer.hxx" #include "Serializer.hxx"
@ -44,12 +44,14 @@ void Sound::mute(bool state)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Sound::init(Console* console, MediaSource* mediasrc, System* system) void Sound::init(Console* console, MediaSource* mediasrc, System* system,
double displayframerate)
{ {
myConsole = console; myConsole = console;
myMediaSource = mediasrc; myMediaSource = mediasrc;
mySystem = system; mySystem = system;
myLastRegisterSetCycle = 0; myLastRegisterSetCycle = 0;
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.11 2004-06-13 04:54:25 bwmott Exp $ // $Id: Sound.hxx,v 1.12 2004-07-22 01:54:08 stephena Exp $
//============================================================================ //============================================================================
#ifndef SOUND_HXX #ifndef SOUND_HXX
@ -33,7 +33,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.11 2004-06-13 04:54:25 bwmott Exp $ @version $Id: Sound.hxx,v 1.12 2004-07-22 01:54:08 stephena Exp $
*/ */
class Sound class Sound
{ {
@ -65,8 +65,10 @@ class Sound
@param console The console @param console The console
@param mediasrc The mediasource @param mediasrc The mediasource
@param system The system @param system The system
@param framerate The base framerate depending on NTSC or PAL ROM
*/ */
virtual void init(Console* console, MediaSource* mediasrc, System* system); virtual void init(Console* console, MediaSource* mediasrc, System* system,
double displayframerate);
/** /**
Return true iff the sound device was successfully initialized. Return true iff the sound device was successfully initialized.
@ -134,6 +136,9 @@ public:
// Indicates the cycle when a sound register was last set // Indicates the cycle when a sound register was last set
Int32 myLastRegisterSetCycle; Int32 myLastRegisterSetCycle;
// Indicates the base framerate depending on whether the ROM is NTSC or PAL
double myDisplayFrameRate;
}; };
#endif #endif