Using -showinfo 0 will not show any non-urgent messages. Errors are still

shown, and cannot be turned off.

Barring any errors encountered in memory allocation (etc.), using
-showinfo 0 will not output ANYTHING to the console.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@153 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2002-12-01 17:06:18 +00:00
parent 39516ebe4e
commit 1dea24d7cc
4 changed files with 72 additions and 30 deletions

View File

@ -232,8 +232,6 @@
in Stella 1.2</li>
<li>Added "<i>-sound</i>" command line option to choose which sound backend to use
(alsa, oss, sdl) with the X11 and SDL versions</li>
<li>Added "<i>-help</i>" command line option to describe the options available.
Previously, help was always shown. X11 and SDL versions supported for now</li>
<li>Added the following <b>developer</b> command line options to the X11 and SDL
versions, which are only activated in <b>developer</b> builds:
<ul>
@ -662,11 +660,6 @@
<th>Description</th>
</tr>
<tr>
<td><pre>-help</pre></td>
<td>Show this table on the commandline</td>
</tr>
<tr>
<td><pre>-display &lt;display&gt;</pre></td>
<td>Connect to the designated X display (<i>X11 version only</i>)</td>

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: Settings.cxx,v 1.7 2002-11-13 16:19:20 stephena Exp $
// $Id: Settings.cxx,v 1.8 2002-12-01 17:06:18 stephena Exp $
//============================================================================
#ifdef DEVELOPER_SUPPORT
@ -192,11 +192,7 @@ bool Settings::handleCommandLineArgs(int argc, char* argv[])
}
else if(string(argv[i]) == "-sound")
{
string option = argv[++i];
if((option != "oss") && (option != "sdl") && (option != "alsa"))
option = "0";
theSoundDriver = option;
theSoundDriver = argv[++i];
}
#ifdef DEVELOPER_SUPPORT
else if(string(argv[i]) == "-Dformat")

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.39 2002-12-01 02:13:13 stephena Exp $
// $Id: mainSDL.cxx,v 1.40 2002-12-01 17:06:18 stephena Exp $
//============================================================================
#include <fstream>
@ -335,27 +335,38 @@ bool setupJoystick()
#ifdef HAVE_JOYSTICK
if(SDL_NumJoysticks() <= 0)
{
cout << "No joysticks present, use the keyboard.\n";
if(settings->theShowInfoFlag)
cout << "No joysticks present, use the keyboard.\n";
theLeftJoystick = theRightJoystick = 0;
return true;
}
if((theLeftJoystick = SDL_JoystickOpen(0)) != NULL)
cout << "Left joystick is a " << SDL_JoystickName(0) <<
" with " << SDL_JoystickNumButtons(theLeftJoystick) << " buttons.\n";
{
if(settings->theShowInfoFlag)
cout << "Left joystick is a " << SDL_JoystickName(0) <<
" with " << SDL_JoystickNumButtons(theLeftJoystick) << " buttons.\n";
}
else
cout << "Left joystick not present, use keyboard instead.\n";
{
if(settings->theShowInfoFlag)
cout << "Left joystick not present, use keyboard instead.\n";
}
if((theRightJoystick = SDL_JoystickOpen(1)) != NULL)
cout << "Right joystick is a " << SDL_JoystickName(1) <<
" with " << SDL_JoystickNumButtons(theRightJoystick) << " buttons.\n";
{
if(settings->theShowInfoFlag)
cout << "Right joystick is a " << SDL_JoystickName(1) <<
" with " << SDL_JoystickNumButtons(theRightJoystick) << " buttons.\n";
}
else
cout << "Right joystick not present, use keyboard instead.\n";
{
if(settings->theShowInfoFlag)
cout << "Right joystick not present, use keyboard instead.\n";
}
#endif
return true;
#else
return true;
#endif
}
@ -1475,7 +1486,7 @@ void usage()
for(uInt32 i = 0; message[i] != 0; ++i)
{
cerr << message[i] << endl;
cout << message[i] << endl;
}
exit(1);
}
@ -1707,18 +1718,32 @@ int main(int argc, char* argv[])
{
// if sound has been disabled, we still need a sound object
sound = new Sound();
if(settings->theShowInfoFlag)
cout << "Sound disabled.\n";
}
#ifdef SOUND_ALSA
else if(settings->theSoundDriver == "alsa")
{
sound = new SoundALSA();
if(settings->theShowInfoFlag)
cout << "Using ALSA for sound.\n";
}
#endif
#ifdef SOUND_OSS
else if(settings->theSoundDriver == "oss")
{
sound = new SoundOSS();
if(settings->theShowInfoFlag)
cout << "Using OSS for sound.\n";
}
#endif
#ifdef SOUND_SDL
else if(settings->theSoundDriver == "sdl")
{
sound = new SoundSDL();
if(settings->theShowInfoFlag)
cout << "Using SDL for sound.\n";
}
#endif
else // a driver that doesn't exist was requested, so disable sound
{

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: mainX11.cxx,v 1.34 2002-12-01 02:13:14 stephena Exp $
// $Id: mainX11.cxx,v 1.35 2002-12-01 17:06:18 stephena Exp $
//============================================================================
#include <fstream>
@ -369,9 +369,27 @@ bool setupDisplay()
bool setupJoystick()
{
#ifdef HAVE_JOYSTICK
// Open the joystick devices
theLeftJoystickFd = open("/dev/js0", O_RDONLY | O_NONBLOCK);
theRightJoystickFd = open("/dev/js1", O_RDONLY | O_NONBLOCK);
if((theLeftJoystickFd = open("/dev/js0", O_RDONLY | O_NONBLOCK)) >= 0)
{
if(settings->theShowInfoFlag)
cout << "Left joystick found.\n";
}
else
{
if(settings->theShowInfoFlag)
cout << "Left joystick not present, use keyboard instead.\n";
}
if((theRightJoystickFd = open("/dev/js1", O_RDONLY | O_NONBLOCK)) >= 0)
{
if(settings->theShowInfoFlag)
cout << "Right joystick found.\n";
}
else
{
if(settings->theShowInfoFlag)
cout << "Right joystick not present, use keyboard instead.\n";
}
#endif
return true;
@ -1368,7 +1386,7 @@ void usage()
for(uInt32 i = 0; message[i] != 0; ++i)
{
cerr << message[i] << endl;
cout << message[i] << endl;
}
exit(1);
}
@ -1580,14 +1598,24 @@ int main(int argc, char* argv[])
{
// if sound has been disabled, we still need a sound object
sound = new Sound();
if(settings->theShowInfoFlag)
cout << "Sound disabled.\n";
}
#ifdef SOUND_ALSA
else if(settings->theSoundDriver == "alsa")
{
sound = new SoundALSA();
if(settings->theShowInfoFlag)
cout << "Using ALSA for sound.\n";
}
#endif
#ifdef SOUND_OSS
else if(settings->theSoundDriver == "oss")
{
sound = new SoundOSS();
if(settings->theShowInfoFlag)
cout << "Using OSS for sound.\n";
}
#endif
else // a driver that doesn't exist was requested, so disable sound
{