From 6508718b39ae1e3151143cd48cdbf406d02a5008 Mon Sep 17 00:00:00 2001 From: stephena Date: Tue, 4 Jan 2005 02:29:31 +0000 Subject: [PATCH] - Added 'Ctrl ]' and 'Ctrl [' keys to dynamically increase/decrease volume. - Added 'Ctrl 0', 'Ctrl 1', 'Ctrl 2', 'Ctrl 3' keys to dynamically set which paddle the mouse should emulate. - Updated the user manual with above options. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@350 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/docs/stella.html | 77 +++++++++++++++++++---------- stella/src/common/FrameBufferGL.cxx | 4 +- stella/src/common/SoundSDL.cxx | 32 +++++++++++- stella/src/common/SoundSDL.hxx | 12 ++++- stella/src/common/mainSDL.cxx | 43 +++++++++++++++- stella/src/emucore/Sound.cxx | 7 ++- stella/src/emucore/Sound.hxx | 12 ++++- 7 files changed, 151 insertions(+), 36 deletions(-) diff --git a/stella/docs/stella.html b/stella/docs/stella.html index 35bd4a500..b25763c50 100644 --- a/stella/docs/stella.html +++ b/stella/docs/stella.html @@ -209,40 +209,33 @@ software. Stella is written in C++, which allows it to be ported to other operating systems and architectures. Since its original release Stella has been ported to AcornOS, AmigaOS, DOS, FreeBSD, Linux, MacOS, OpenStep, OS/2, - Sega Dreamcast, Unix, and Windows. + Sega Dreamcast, Unix, and Windows.

-

New in Release 1.4.1

+

New in Release 1.4.2

@@ -328,8 +321,9 @@

The Mac version of Stella is designed to work on a Power Macintosh with the following:

@@ -1491,6 +1485,35 @@ Control + s + + Increase volume + Control + ] + + + + Decrease volume + Control + [ + + + + Set mouse to emulate paddle 0 + Control + 0 + + + + Set mouse to emulate paddle 1 + Control + 1 + + + + Set mouse to emulate paddle 2 + Control + 2 + + + + Set mouse to emulate paddle 3 + Control + 3 +


diff --git a/stella/src/common/FrameBufferGL.cxx b/stella/src/common/FrameBufferGL.cxx index 027de2470..cebbd04ea 100644 --- a/stella/src/common/FrameBufferGL.cxx +++ b/stella/src/common/FrameBufferGL.cxx @@ -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: FrameBufferGL.cxx,v 1.7 2005-01-03 19:16:09 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.8 2005-01-04 02:29:28 stephena Exp $ //============================================================================ #include @@ -319,7 +319,7 @@ void FrameBufferGL::drawBoundedBox(uInt32 x, uInt32 y, uInt32 w, uInt32 h) glRecti(x, y, x+w, y+h); // Now draw the outer edges - glLineWidth(theZoomLevel/2); + glLineWidth(theZoomLevel); glColor4f(0.8, 0.8, 0.8, 1.0); glBegin(GL_LINE_LOOP); glVertex2i(x, y ); // Top Left diff --git a/stella/src/common/SoundSDL.cxx b/stella/src/common/SoundSDL.cxx index 11726e76b..da957bb69 100644 --- a/stella/src/common/SoundSDL.cxx +++ b/stella/src/common/SoundSDL.cxx @@ -13,17 +13,20 @@ // 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.6 2004-07-22 01:54:08 stephena Exp $ +// $Id: SoundSDL.cxx,v 1.7 2005-01-04 02:29:29 stephena Exp $ //============================================================================ +#include #include #include #include #include "TIASound.h" #include "Console.hxx" +#include "FrameBuffer.hxx" #include "Serializer.hxx" #include "Deserializer.hxx" +#include "Settings.hxx" #include "System.hxx" #include "SoundSDL.hxx" @@ -155,6 +158,33 @@ void SoundSDL::setVolume(Int32 percent) } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void SoundSDL::adjustVolume(Int8 direction) +{ + ostringstream strval; + string message; + + Int32 percent = myVolume; + + if(direction == -1) + percent -= 2; + else if(direction == 1) + percent += 2; + + if((percent < 0) || (percent > 100)) + return; + + setVolume(percent); + + // Now show an onscreen message + strval << percent; + message = "Volume set to "; + message += strval.str(); + + myConsole->frameBuffer().showMessage(message); + myConsole->settings().setInt("volume", percent); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void SoundSDL::set(uInt16 addr, uInt8 value, Int32 cycle) { diff --git a/stella/src/common/SoundSDL.hxx b/stella/src/common/SoundSDL.hxx index 25c0c89de..0358e6447 100644 --- a/stella/src/common/SoundSDL.hxx +++ b/stella/src/common/SoundSDL.hxx @@ -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.hxx,v 1.5 2004-06-20 00:52:37 stephena Exp $ +// $Id: SoundSDL.hxx,v 1.6 2005-01-04 02:29:29 stephena Exp $ //============================================================================ #ifndef SOUNDSDL_HXX @@ -29,7 +29,7 @@ This class implements the sound API for SDL. @author Stephen Anthony and Bradford W. Mott - @version $Id: SoundSDL.hxx,v 1.5 2004-06-20 00:52:37 stephena Exp $ + @version $Id: SoundSDL.hxx,v 1.6 2005-01-04 02:29:29 stephena Exp $ */ class SoundSDL : public Sound { @@ -83,6 +83,14 @@ class SoundSDL : public Sound */ virtual void setVolume(Int32 percent); + /** + Adjusts the volume of the sound device based on the given direction. + + @param direction Increase or decrease the current volume by a predefined + amount based on the direction (1 = increase, -1 =decrease) + */ + virtual void adjustVolume(Int8 direction); + public: /** Loads the current state of this device from the given Deserializer. diff --git a/stella/src/common/mainSDL.cxx b/stella/src/common/mainSDL.cxx index 766b33300..78a62280e 100644 --- a/stella/src/common/mainSDL.cxx +++ b/stella/src/common/mainSDL.cxx @@ -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.18 2005-01-03 19:16:09 stephena Exp $ +// $Id: mainSDL.cxx,v 1.19 2005-01-04 02:29:29 stephena Exp $ //============================================================================ #include @@ -64,6 +64,7 @@ static void HandleEvents(); static uInt32 GetTicks(); static void SetupProperties(PropertiesSet& set); static void ShowInfo(const string& msg); +static void SetPaddleMode(Int32 mode); #ifdef JOYSTICK_SUPPORT // Lookup table for joystick numbers and events @@ -266,6 +267,21 @@ static KeyList keyList[] = { }; +/** + Set the mouse to emulate the given paddle +*/ +void SetPaddleMode(Int32 mode) +{ + thePaddleMode = mode; + + ostringstream buf; + buf << "Mouse is paddle " << mode; + theDisplay->showMessage(buf.str()); + + theSettings->setInt("paddle",thePaddleMode); +} + + /** Prints given message based on 'theShowInfoFlag' */ @@ -412,6 +428,15 @@ void HandleEvents() case SDLK_RETURN: theDisplay->toggleFullscreen(); break; + + case SDLK_LEFTBRACKET: + theSound->adjustVolume(-1); + break; + + case SDLK_RIGHTBRACKET: + theSound->adjustVolume(1); + break; + #ifdef DISPLAY_OPENGL case SDLK_f: if(theUseOpenGLFlag) @@ -475,6 +500,22 @@ void HandleEvents() theDisplay->setupPalette(); break; + case SDLK_0: // Ctrl-0 sets the mouse to paddle 0 + SetPaddleMode(0); + break; + + case SDLK_1: // Ctrl-1 sets the mouse to paddle 1 + SetPaddleMode(1); + break; + + case SDLK_2: // Ctrl-2 sets the mouse to paddle 2 + SetPaddleMode(2); + break; + + case SDLK_3: // Ctrl-3 sets the mouse to paddle 3 + SetPaddleMode(3); + break; + #ifdef DEVELOPER_SUPPORT case SDLK_END: // Ctrl-End increases Width theConsole->changeWidth(1); diff --git a/stella/src/emucore/Sound.cxx b/stella/src/emucore/Sound.cxx index 993779eea..567099401 100644 --- a/stella/src/emucore/Sound.cxx +++ b/stella/src/emucore/Sound.cxx @@ -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.cxx,v 1.13 2004-07-22 01:54:08 stephena Exp $ +// $Id: Sound.cxx,v 1.14 2005-01-04 02:29:30 stephena Exp $ //============================================================================ #include "Serializer.hxx" @@ -76,6 +76,11 @@ void Sound::setVolume(Int32 volume) { } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Sound::adjustVolume(Int8 direction) +{ +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Sound::load(Deserializer& in) { diff --git a/stella/src/emucore/Sound.hxx b/stella/src/emucore/Sound.hxx index 6d207f8f4..641653e99 100644 --- a/stella/src/emucore/Sound.hxx +++ b/stella/src/emucore/Sound.hxx @@ -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.12 2004-07-22 01:54:08 stephena Exp $ +// $Id: Sound.hxx,v 1.13 2005-01-04 02:29:31 stephena Exp $ //============================================================================ #ifndef SOUND_HXX @@ -33,7 +33,7 @@ class System; to compile Stella with no sound support whatsoever. @author Stephen Anthony and Bradford W. Mott - @version $Id: Sound.hxx,v 1.12 2004-07-22 01:54:08 stephena Exp $ + @version $Id: Sound.hxx,v 1.13 2005-01-04 02:29:31 stephena Exp $ */ class Sound { @@ -107,6 +107,14 @@ class Sound */ virtual void setVolume(Int32 percent); + /** + Adjusts the volume of the sound device based on the given direction. + + @param direction Increase or decrease the current volume by a predefined + amount based on the direction (1 = increase, -1 =decrease) + */ + virtual void adjustVolume(Int8 direction); + public: /** Loads the current state of this device from the given Deserializer.