From a5cb67551fa20d04a691395eea025483b7c0caff Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 27 Jan 2013 15:08:04 +0000 Subject: [PATCH] Final updates to the sound code (resampling seems to be working fine). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2585 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- Changes.txt | 9 ++-- docs/graphics/options_audio.png | Bin 3614 -> 3189 bytes docs/index.html | 17 ++------ src/common/SoundNull.cxx | 74 -------------------------------- src/common/SoundNull.hxx | 36 ++++++++++++++-- src/common/SoundSDL.cxx | 2 - src/common/module.mk | 1 - src/emucore/Settings.cxx | 9 ++-- src/emucore/TIASnd.cxx | 21 +++------ src/emucore/TIASnd.hxx | 11 ++--- src/gui/AudioDialog.cxx | 21 ++------- src/gui/AudioDialog.hxx | 1 - 12 files changed, 58 insertions(+), 144 deletions(-) delete mode 100644 src/common/SoundNull.cxx diff --git a/Changes.txt b/Changes.txt index bb0909587..de050f686 100644 --- a/Changes.txt +++ b/Changes.txt @@ -12,16 +12,17 @@ Release History =========================================================================== -3.7.5 to 3.8: (January xx, 2013) +3.7.5 to 3.8: (February xx, 2013) * Huge changes to the sound system: - - The sound code now uses signed 16-bit samples instead of unsigned - 8-bit samples, making it more compatible with a wider variety of + - The sound code now uses 16-bit signed samples instead of 8-bit + unsigned samples, making it more compatible with a wider variety of systems. - Improved sound output for several ROMs, including "Space Rocks" (the 'heartbeat' sound can now be clearly heard). - The 'volume clipping' option has been removed, since in 16-bit mode it's no longer needed. + - The 'Tia freq' option has been removed. * Improved bankswitch autodetection for X07 ROMs (although there's only two known ROMs in existence, so the detection probably isn't robust). @@ -69,7 +70,7 @@ reading from TIMINT. Also, D6 of the Interrupt Flag register is now properly set on active transition of the PA7 pin. - * Fixed bug in DPC+ bankswitch scheme; the music in "Stay Frosty 2" + * Fixed bug in DPC+ bankswitch scheme; the music several DPC+ ROMS wasn't playing correctly. * The ROM properties database now uses 'Auto' instead of 'Auto-select' diff --git a/docs/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~zcFYA!DX9k8hJViJLbsmHV`$`C_lu=AdTGk{zb#@c4~oN2~l6*DeN9MABQ5C>wI$&AeAmdxojdboGWshtD&q{F4! zW4}PxVBg)(=9Nqav1p%7?_D?6757#BvAaQ?`Lov4sjRc4T0und2&iwZ}W)d+c7*55` z0etrqB3&@RHh(E_?-S5>61|IW5Tu&YGL-2>kdhY1FK~5k;7Y>AHbL9pZWamHCpugZ z5TaE=pmt`_7X=8S;Oh<*XC5Xv2dxbSOOKIc<^KvbpdA~k{()Jf{Q1gw=n;+U5@p%e zR!SXcByobuo~3EN^t$X=V~wDuLV$3${Lp6zDQNB`+XY^?oF#qIB#H=Ba^AB)9gNag z<@RDv__U1uWox`t?SK!5h?9_YgU$M5{`O{qvK5m^Tm_-e{cU@JENU#S%;KcM+}YT$ zdFyWM>lfAaPqGyq(RJMYo}A-3Pk#;9D{y7xtXCWGa^7AfX}z?hufcrO7N8 z;%-$b>buqjJ;X_ohtds8ixeNBf+-%+3bP-tjh*&t^WzsJk&W={TNRqwruS=>c7M9o zZRpje8ExiG(5($MMkPr0^4nz2f zJ=jt%@$L25)W3?DUpMaYN3i*65&Z*W{@f+b;+5xYV8Gobr0Guo?q|yp!9(*$8|u*pBGwiN0| zn5So1{>f!wG^J)$Dm@TBp0)71V3Vz-&*sWD+RYZS%C?`V_+Nsn=yOaM8wK;%KVx;I zsc9&{d&b|XSb_dAZ7~3q5lPJlDVuYWH}DR~qxaB{xIk(I{mzCY$jsuOND*_T7+vR~ zBd@IHCyKoMIIK@@1WjYMG94b=&_4b|h#kDN$P5mTmOUp-ECCM#?4&{D%s!z-{YR1i z-?Hj;jqBln)orbDD?QNEh@Rx6va<3y(T{Txk&#Ds_B>MKLuq0a^}>t=vazy1S8aLY G!M_1fbNkZ( diff --git a/docs/index.html b/docs/index.html index 0fba9d048..dc16b117a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@

A multi-platform Atari 2600 VCS emulator

-

Release 3.7.5

+

Release 3.8



User's Guide

@@ -54,7 +54,7 @@


-
February 1999 - December 2012
+
February 1999 - February 2013
The Stella Team
Stella Homepage
@@ -1995,14 +1995,7 @@
-freq <number>
- Set sound sample output frequency (0 - 48000). - Default is 31400. Do not change unless you experience sound - issues. - - - -
-tiafreq <number>
- Set sound sample generation frequency (0 - 48000). + Set sound sample output frequency (11025,22050,31400,44100,48000) Default is 31400. Do not change unless you experience sound issues. @@ -2494,9 +2487,7 @@ ItemBrief descriptionFor more information,
see CommandLine Volumeself-explanatory-volume Sample size (*)set size of audio buffers-fragsize - Output freq (*)change sound output frequency (advanced)-freq - TIA freqchange TIA output frequency (advanced)-tiafreq - Clip volumeEliminate popping in sound generation (advanced)-clipvol + Frequency (*)change sound output frequency-freq Enable soundself-explanatory-sound diff --git a/src/common/SoundNull.cxx b/src/common/SoundNull.cxx deleted file mode 100644 index 4f4784a0e..000000000 --- a/src/common/SoundNull.cxx +++ /dev/null @@ -1,74 +0,0 @@ -//============================================================================ -// -// SSSS tt lll lll -// SS SS tt ll ll -// SS tttttt eeee ll ll aaaa -// SSSS tt ee ee ll ll aa -// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" -// SS SS tt ee ll ll aa aa -// SSSS ttt eeeee llll llll aaaaa -// -// Copyright (c) 1995-2013 by Bradford W. Mott, Stephen Anthony -// and the Stella Team -// -// See the file "License.txt" for information on usage and redistribution of -// this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// $Id$ -//============================================================================ - -#include "bspf.hxx" - -#include "OSystem.hxx" -#include "Settings.hxx" -#include "SoundNull.hxx" - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SoundNull::SoundNull(OSystem* osystem) - : Sound(osystem) -{ - myOSystem->logMessage("Sound disabled.\n", 1); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SoundNull::~SoundNull() -{ -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool SoundNull::load(Serializer& in) -{ - if(in.getString() != "TIASound") - return false; - - // Read sound registers and discard - in.getByte(); - in.getByte(); - in.getByte(); - in.getByte(); - in.getByte(); - in.getByte(); - - // myLastRegisterSetCycle - in.getInt(); - - return true; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool SoundNull::save(Serializer& out) const -{ - out.putString("TIASound"); - - out.putByte(0); - out.putByte(0); - out.putByte(0); - out.putByte(0); - out.putByte(0); - out.putByte(0); - - // myLastRegisterSetCycle - out.putInt(0); - - return true; -} diff --git a/src/common/SoundNull.hxx b/src/common/SoundNull.hxx index 874ae3301..1f5180bd7 100644 --- a/src/common/SoundNull.hxx +++ b/src/common/SoundNull.hxx @@ -24,6 +24,7 @@ class OSystem; #include "bspf.hxx" #include "Sound.hxx" +#include "OSystem.hxx" /** This class implements a Null sound object, where-by sound generation @@ -39,7 +40,10 @@ class SoundNull : public Sound Create a new sound object. The init method must be invoked before using the object. */ - SoundNull(OSystem* osystem); + SoundNull(OSystem* osystem) : Sound(osystem) + { + myOSystem->logMessage("Sound disabled.\n", 1); + } /** Destructor @@ -128,14 +132,25 @@ class SoundNull : public Sound */ void adjustVolume(Int8 direction) { } -public: + public: /** Saves the current state of this device to the given Serializer. @param out The serializer device to save to. @return The result of the save. True on success, false on failure. */ - bool save(Serializer& out) const; + bool save(Serializer& out) const + { + out.putString("TIASound"); + + for(int = 0; i < 6; ++i) + out.putByte(0); + + // myLastRegisterSetCycle + out.putInt(0); + + return true; + } /** Loads the current state of this device from the given Serializer. @@ -143,7 +158,20 @@ public: @param in The Serializer device to load from. @return The result of the load. True on success, false on failure. */ - bool load(Serializer& in); + bool load(Serializer& in) + { + if(in.getString() != "TIASound") + return false; + + // Read sound registers and discard + for(int = 0; i < 6; ++i) + in.getByte(); + + // myLastRegisterSetCycle + in.getInt(); + + return true; + } /** Get a descriptor for this console class (used in error checking). diff --git a/src/common/SoundSDL.cxx b/src/common/SoundSDL.cxx index d34f29d9c..9b779f48a 100644 --- a/src/common/SoundSDL.cxx +++ b/src/common/SoundSDL.cxx @@ -125,9 +125,7 @@ void SoundSDL::open() } // Now initialize the TIASound object which will actually generate sound - int tiafreq = myOSystem->settings().getInt("tiafreq"); myTIASound.outputFrequency(myHardwareSpec.freq); - myTIASound.tiaFrequency(tiafreq); const string& chanResult = myTIASound.channels(myHardwareSpec.channels, myNumChannels == 2); diff --git a/src/common/module.mk b/src/common/module.mk index 7f50934b3..9e91715f3 100644 --- a/src/common/module.mk +++ b/src/common/module.mk @@ -2,7 +2,6 @@ MODULE := src/common MODULE_OBJS := \ src/common/mainSDL.o \ - src/common/SoundNull.o \ src/common/SoundSDL.o \ src/common/FrameBufferSoft.o \ src/common/FrameBufferGL.o \ diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 9f50f7b08..7035c7034 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -79,7 +79,6 @@ Settings::Settings(OSystem* osystem) setInternal("sound", "true"); setInternal("fragsize", "512"); setInternal("freq", "31400"); - setInternal("tiafreq", "31400"); setInternal("volume", "100"); // Input event options @@ -285,9 +284,8 @@ void Settings::validate() i = getInt("volume"); if(i < 0 || i > 100) setInternal("volume", "100"); i = getInt("freq"); - if(i < 0 || i > 48000) setInternal("freq", "31400"); - i = getInt("tiafreq"); - if(i < 0 || i > 48000) setInternal("tiafreq", "31400"); + if(!(i == 11025 || i == 22050 || i == 31400 || i == 44100 || i == 48000)) + setInternal("freq", "31400"); #endif i = getInt("joydeadzone"); @@ -382,8 +380,7 @@ void Settings::usage() #ifdef SOUND_SUPPORT << " -sound <1|0> Enable sound generation\n" << " -fragsize The size of sound fragments (must be a power of two)\n" - << " -freq Set sound sample output frequency (0 - 48000)\n" - << " -tiafreq Set sound sample generation frequency (0 - 48000)\n" + << " -freq Set sound sample output frequency (11025|22050|31400|44100|48000)\n" << " -volume Set the volume (0 - 100)\n" << " -clipvol <1|0> Enable volume clipping (eliminates popping)\n" << endl diff --git a/src/emucore/TIASnd.cxx b/src/emucore/TIASnd.cxx index 2c0001fb9..bed979521 100644 --- a/src/emucore/TIASnd.cxx +++ b/src/emucore/TIASnd.cxx @@ -21,10 +21,9 @@ #include "TIASnd.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -TIASound::TIASound(Int32 outputFrequency, Int32 tiaFrequency) +TIASound::TIASound(Int32 outputFrequency) : myChannelMode(Hardware2Stereo), myOutputFrequency(outputFrequency), - myTIAFrequency(tiaFrequency), myOutputCounter(0), myVolumePercentage(100) { @@ -68,12 +67,6 @@ void TIASound::outputFrequency(Int32 freq) myOutputFrequency = freq; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void TIASound::tiaFrequency(Int32 freq) -{ - myTIAFrequency = freq; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string TIASound::channels(uInt32 hardware, bool stereo) { @@ -352,31 +345,31 @@ void TIASound::process(Int16* buffer, uInt32 samples) switch(myChannelMode) { case Hardware2Mono: // mono sampling with 2 hardware channels - while((samples > 0) && (myOutputCounter >= myTIAFrequency)) + while((samples > 0) && (myOutputCounter >= 31400)) { Int16 byte = v0 + v1; *(buffer++) = byte; *(buffer++) = byte; - myOutputCounter -= myTIAFrequency; + myOutputCounter -= 31400; samples--; } break; case Hardware2Stereo: // stereo sampling with 2 hardware channels - while((samples > 0) && (myOutputCounter >= myTIAFrequency)) + while((samples > 0) && (myOutputCounter >= 31400)) { *(buffer++) = v0; *(buffer++) = v1; - myOutputCounter -= myTIAFrequency; + myOutputCounter -= 31400; samples--; } break; case Hardware1: // mono/stereo sampling with only 1 hardware channel - while((samples > 0) && (myOutputCounter >= myTIAFrequency)) + while((samples > 0) && (myOutputCounter >= 31400)) { *(buffer++) = v0 + v1; - myOutputCounter -= myTIAFrequency; + myOutputCounter -= 31400; samples--; } break; diff --git a/src/emucore/TIASnd.hxx b/src/emucore/TIASnd.hxx index 57ce93f17..41a38b7b2 100644 --- a/src/emucore/TIASnd.hxx +++ b/src/emucore/TIASnd.hxx @@ -26,6 +26,9 @@ This class implements a fairly accurate emulation of the TIA sound hardware. This class uses code/ideas from z26 and MESS. + Currently, the sound generation routines work at 31400Hz only. + Resampling can be done by passing in a different output frequency. + @author Bradford W. Mott, Stephen Anthony, z26 and MESS teams @version $Id$ */ @@ -35,7 +38,7 @@ class TIASound /** Create a new TIA Sound object using the specified output frequency */ - TIASound(Int32 outputFrequency = 31400, Int32 tiaFrequency = 31400); + TIASound(Int32 outputFrequency = 31400); /** Destructor @@ -53,11 +56,6 @@ class TIASound */ void outputFrequency(Int32 freq); - /** - Set the frequency the of the TIA device - */ - void tiaFrequency(Int32 freq); - /** Selects the number of audio channels per sample. There are two factors to consider: hardware capability and desired mixing. @@ -159,7 +157,6 @@ class TIASound ChannelMode myChannelMode; Int32 myOutputFrequency; - Int32 myTIAFrequency; Int32 myOutputCounter; uInt32 myVolumePercentage; diff --git a/src/gui/AudioDialog.cxx b/src/gui/AudioDialog.cxx index 455256a79..0be5dc601 100644 --- a/src/gui/AudioDialog.cxx +++ b/src/gui/AudioDialog.cxx @@ -55,7 +55,7 @@ AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent, // Set real dimensions _w = 35 * fontWidth + 10; - _h = 8 * (lineHeight + 4) + 10; + _h = 7 * (lineHeight + 4) + 10; // Volume xpos = 3 * fontWidth; ypos = 10; @@ -95,20 +95,13 @@ AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent, items.push_back("48000 Hz", "48000"); myFreqPopup = new PopUpWidget(this, font, xpos, ypos, pwidth + myVolumeLabel->getWidth() - 4, lineHeight, - items, "Output freq (*): ", lwidth); + items, "Frequency (*): ", lwidth); wid.push_back(myFreqPopup); ypos += lineHeight + 4; - // TIA frequency - // ... use same items as above - myTiaFreqPopup = new PopUpWidget(this, font, xpos, ypos, - pwidth + myVolumeLabel->getWidth() - 4, lineHeight, - items, "TIA freq: ", lwidth); - wid.push_back(myTiaFreqPopup); - ypos += lineHeight + 4; - // Enable sound xpos = (_w - (font.getStringWidth("Enable sound") + 10)) / 2; + ypos += 4; mySoundEnableCheckbox = new CheckboxWidget(this, font, xpos, ypos, "Enable sound", kSoundEnableChanged); wid.push_back(mySoundEnableCheckbox); @@ -148,9 +141,6 @@ void AudioDialog::loadConfig() // Output frequency myFreqPopup->setSelected(instance().settings().getString("freq"), "31400"); - // TIA frequency - myTiaFreqPopup->setSelected(instance().settings().getString("tiafreq"), "31400"); - // Enable sound bool b = instance().settings().getBool("sound"); mySoundEnableCheckbox->setState(b); @@ -174,9 +164,6 @@ void AudioDialog::saveConfig() // Output frequency settings.setString("freq", myFreqPopup->getSelectedTag()); - // TIA frequency - settings.setString("tiafreq", myTiaFreqPopup->getSelectedTag()); - // Enable/disable sound (requires a restart to take effect) instance().sound().setEnabled(mySoundEnableCheckbox->getState()); @@ -194,7 +181,6 @@ void AudioDialog::setDefaults() myFragsizePopup->setSelected("512", ""); myFreqPopup->setSelected("31400", ""); - myTiaFreqPopup->setSelected("31400", ""); mySoundEnableCheckbox->setState(true); @@ -211,7 +197,6 @@ void AudioDialog::handleSoundEnableChange(bool active) myVolumeLabel->setEnabled(active); myFragsizePopup->setEnabled(active); myFreqPopup->setEnabled(active); - myTiaFreqPopup->setEnabled(active); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/AudioDialog.hxx b/src/gui/AudioDialog.hxx index c35cd82f5..a79cee551 100644 --- a/src/gui/AudioDialog.hxx +++ b/src/gui/AudioDialog.hxx @@ -45,7 +45,6 @@ class AudioDialog : public Dialog StaticTextWidget* myVolumeLabel; PopUpWidget* myFragsizePopup; PopUpWidget* myFreqPopup; - PopUpWidget* myTiaFreqPopup; CheckboxWidget* mySoundEnableCheckbox; private: