OK, some huge changes across the board, so lets see if I get it all:

After much request, added ability to access the settings menu from the
ROM browser dialog.  This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.

Completely removed pause functionality from the core code.  It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause.  Now that there are other event modes, the
EventHandler state machine is getting too complicated.  If you want to
pause, you can simply enter one of the in-game menus.  Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.

Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.

Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing.  Parts of each were being done in different classes; now it
should be more consistent.

Started infrastructure for user-selectable UI palettes.  For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.

Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.

Added '128' to the choices for fragment size in AudioDialog.

Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection.  It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-12-30 22:26:29 +00:00
parent 16f99140d2
commit fc4e4b7b17
41 changed files with 618 additions and 683 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: CheatCodeDialog.cxx,v 1.12 2006-12-08 16:48:55 stephena Exp $ // $Id: CheatCodeDialog.cxx,v 1.13 2006-12-30 22:26:27 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -67,7 +67,7 @@ CheatCodeDialog::CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
StringList labels; StringList labels;
labels.push_back("Name: "); labels.push_back("Name: ");
labels.push_back("Code: "); labels.push_back("Code: ");
myCheatInput = new InputTextDialog(this, font, labels, _x+20, _y+20); myCheatInput = new InputTextDialog(this, font, labels, 0, 0);
myCheatInput->setTarget(this); myCheatInput->setTarget(this);
// Add OK and Cancel buttons **** FIXME - coordinates // Add OK and Cancel buttons **** FIXME - coordinates
@ -139,12 +139,14 @@ void CheatCodeDialog::saveConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheatCodeDialog::addCheat() void CheatCodeDialog::addCheat()
{ {
// We have to add the dialog first, so it can be centered
// The methods after this depend on the dialog having the correct dimensions
parent()->addDialog(myCheatInput);
myCheatInput->setEditString("", 0); myCheatInput->setEditString("", 0);
myCheatInput->setEditString("", 1); myCheatInput->setEditString("", 1);
myCheatInput->setTitle(""); myCheatInput->setTitle("");
myCheatInput->setFocus(0); myCheatInput->setFocus(0);
myCheatInput->setEmitSignal(kCheatAdded); myCheatInput->setEmitSignal(kCheatAdded);
parent()->addDialog(myCheatInput);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -158,12 +160,14 @@ void CheatCodeDialog::editCheat()
const string& name = list[idx]->name(); const string& name = list[idx]->name();
const string& code = list[idx]->code(); const string& code = list[idx]->code();
// We have to add the dialog first, so it can be centered
// The methods after this depend on the dialog having the correct dimensions
parent()->addDialog(myCheatInput);
myCheatInput->setEditString(name, 0); myCheatInput->setEditString(name, 0);
myCheatInput->setEditString(code, 1); myCheatInput->setEditString(code, 1);
myCheatInput->setTitle(""); myCheatInput->setTitle("");
myCheatInput->setFocus(1); myCheatInput->setFocus(1);
myCheatInput->setEmitSignal(kCheatEdited); myCheatInput->setEmitSignal(kCheatEdited);
parent()->addDialog(myCheatInput);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -176,12 +180,14 @@ void CheatCodeDialog::removeCheat()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheatCodeDialog::addOneShotCheat() void CheatCodeDialog::addOneShotCheat()
{ {
// We have to add the dialog first, so it can be centered
// The methods after this depend on the dialog having the correct dimensions
parent()->addDialog(myCheatInput);
myCheatInput->setEditString("One-shot cheat", 0); myCheatInput->setEditString("One-shot cheat", 0);
myCheatInput->setEditString("", 1); myCheatInput->setEditString("", 1);
myCheatInput->setTitle(""); myCheatInput->setTitle("");
myCheatInput->setFocus(1); myCheatInput->setFocus(1);
myCheatInput->setEmitSignal(kOneShotCheatAdded); myCheatInput->setEmitSignal(kOneShotCheatAdded);
parent()->addDialog(myCheatInput);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: FrameBufferGL.cxx,v 1.80 2006-12-29 15:16:47 stephena Exp $ // $Id: FrameBufferGL.cxx,v 1.81 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#ifdef DISPLAY_OPENGL #ifdef DISPLAY_OPENGL
@ -123,8 +123,12 @@ bool FrameBufferGL::loadFuncs(const string& library)
if(SDL_WasInit(SDL_INIT_VIDEO) == 0) if(SDL_WasInit(SDL_INIT_VIDEO) == 0)
SDL_Init(SDL_INIT_VIDEO); SDL_Init(SDL_INIT_VIDEO);
const char* gl_ptr = library != "" ? library.c_str() : 0; // Try both the specified library and auto-detection
if(SDL_GL_LoadLibrary(gl_ptr) < 0) bool libLoaded = (library != "" && SDL_GL_LoadLibrary(library.c_str()) >= 0);
bool autoLoaded = false;
if(!libLoaded) autoLoaded = (SDL_GL_LoadLibrary(0) >= 0);
if(!libLoaded && !autoLoaded)
return false; return false;
// Otherwise, fill the function pointers for GL functions // Otherwise, fill the function pointers for GL functions

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: ContextMenu.cxx,v 1.7 2006-12-08 16:49:10 stephena Exp $ // $Id: ContextMenu.cxx,v 1.8 2006-12-30 22:26:28 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -33,6 +33,8 @@ ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font)
_rowHeight(font.getLineHeight()), _rowHeight(font.getLineHeight()),
_font(&font) _font(&font)
{ {
// Context menus pop up wherever the mouse is clicked
setCenter(false);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: RamWidget.cxx,v 1.9 2006-12-08 16:49:12 stephena Exp $ // $Id: RamWidget.cxx,v 1.10 2006-12-30 22:26:28 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -144,6 +144,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
myInputBox = new InputTextDialog(boss, font, label, myInputBox = new InputTextDialog(boss, font, label,
x + lwidth + 20, y + 2*lineHeight - 5); x + lwidth + 20, y + 2*lineHeight - 5);
myInputBox->setTarget(this); myInputBox->setTarget(this);
myInputBox->setCenter(false);
// Start with these buttons disabled // Start with these buttons disabled
myCompareButton->clearFlags(WIDGET_ENABLED); myCompareButton->clearFlags(WIDGET_ENABLED);
@ -207,17 +208,17 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break; break;
case kSearchCmd: case kSearchCmd:
parent()->addDialog(myInputBox);
myInputBox->setEditString(""); myInputBox->setEditString("");
myInputBox->setTitle(""); myInputBox->setTitle("");
myInputBox->setEmitSignal(kSValEntered); myInputBox->setEmitSignal(kSValEntered);
parent()->addDialog(myInputBox);
break; break;
case kCmpCmd: case kCmpCmd:
parent()->addDialog(myInputBox);
myInputBox->setEditString(""); myInputBox->setEditString("");
myInputBox->setTitle(""); myInputBox->setTitle("");
myInputBox->setEmitSignal(kCValEntered); myInputBox->setEmitSignal(kCValEntered);
parent()->addDialog(myInputBox);
break; break;
case kRestartCmd: case kRestartCmd:

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: RomWidget.cxx,v 1.18 2006-12-08 16:49:12 stephena Exp $ // $Id: RomWidget.cxx,v 1.19 2006-12-30 22:26:28 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -102,6 +102,7 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
label.push_back("Filename: "); label.push_back("Filename: ");
mySaveRom = new InputTextDialog(boss, font, label, _x + 50, _y + 80); mySaveRom = new InputTextDialog(boss, font, label, _x + 50, _y + 80);
mySaveRom->setTarget(this); mySaveRom->setTarget(this);
mySaveRom->setCenter(false);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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.115 2006-12-28 20:40:00 stephena Exp $ // $Id: Console.cxx,v 1.116 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -73,10 +73,8 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
// Attach the event subsystem to the current console // Attach the event subsystem to the current console
myEvent = myOSystem->eventHandler().event(); myEvent = myOSystem->eventHandler().event();
// Load user-defined palette for this ROM and initialize them // Load user-defined palette for this ROM
// depending on PAL colour-loss effect
loadUserPalette(); loadUserPalette();
setColorLossPalette(myOSystem->settings().getBool("colorloss"));
// Setup the controllers based on properties // Setup the controllers based on properties
string left = myProperties.get(Controller_Left); string left = myProperties.get(Controller_Left);
@ -256,7 +254,7 @@ Console::~Console()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleFormat() void Console::toggleFormat()
{ {
uInt32 framerate = 60; int framerate = 60;
if(myDisplayFormat == "NTSC") if(myDisplayFormat == "NTSC")
{ {
myDisplayFormat = "PAL"; myDisplayFormat = "PAL";
@ -364,7 +362,7 @@ void Console::setPalette(const string& type)
else // return normal palette by default else // return normal palette by default
palette = (myDisplayFormat.compare(0, 3, "PAL") == 0) ? ourPALPalette : ourNTSCPalette; palette = (myDisplayFormat.compare(0, 3, "PAL") == 0) ? ourPALPalette : ourNTSCPalette;
myOSystem->frameBuffer().setPalette(palette); myOSystem->frameBuffer().setTIAPalette(palette);
// FIXME - maybe add an error message that requested palette not available? // FIXME - maybe add an error message that requested palette not available?
} }
@ -398,24 +396,29 @@ void Console::setProperties(const Properties& props)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::initialize() void Console::initializeVideo(bool full)
{ {
// Set the correct framerate based on the format of the ROM if(full)
// This can be overridden by changing the framerate in the
// VideoDialog box or on the commandline, but it can't be saved
// (ie, framerate is now solely determined based on ROM format).
int framerate = myOSystem->settings().getInt("framerate");
if(framerate == -1)
{ {
if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60") string title = string("Stella ") + STELLA_VERSION +
framerate = 60; ": \"" + myProperties.get(Cartridge_Name) + "\"";
else if(myDisplayFormat == "PAL") myOSystem->frameBuffer().initialize(title,
framerate = 50; myMediaSource->width() << 1,
else myMediaSource->height());
framerate = 60;
} }
myOSystem->setFramerate(framerate);
bool enable = myProperties.get(Display_Phosphor) == "YES";
int blend = atoi(myProperties.get(Display_PPBlend).c_str());
myOSystem->frameBuffer().enablePhosphor(enable, blend);
setColorLossPalette(myOSystem->settings().getBool("colorloss"));
setPalette(myOSystem->settings().getString("palette"));
myOSystem->setFramerate(getFrameRate());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::initializeAudio()
{
// Initialize the sound interface. // Initialize the sound interface.
// The # of channels can be overridden in the AudioDialog box or on // The # of channels can be overridden in the AudioDialog box or on
// the commandline, but it can't be saved. // the commandline, but it can't be saved.
@ -430,44 +433,8 @@ void Console::initialize()
myOSystem->sound().close(); myOSystem->sound().close();
myOSystem->sound().setChannels(channels); myOSystem->sound().setChannels(channels);
myOSystem->sound().setFrameRate(framerate); myOSystem->sound().setFrameRate(getFrameRate());
myOSystem->sound().initialize(); myOSystem->sound().initialize();
// Initialize the options menu system with updated values from the framebuffer
myOSystem->menu().initialize();
// Initialize the command menu system with updated values from the framebuffer
myOSystem->commandMenu().initialize();
#ifdef DEBUGGER_SUPPORT
// Finally, initialize the debugging system, since it depends on the current ROM
myOSystem->debugger().setConsole(this);
myOSystem->debugger().initialize();
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::initializeVideo()
{
string title = string("Stella ") + STELLA_VERSION +
": \"" + myProperties.get(Cartridge_Name) + "\"";
myOSystem->frameBuffer().initialize(title,
myMediaSource->width() << 1,
myMediaSource->height());
bool enable = myProperties.get(Display_Phosphor) == "YES";
int blend = atoi(myProperties.get(Display_PPBlend).c_str());
myOSystem->frameBuffer().enablePhosphor(enable, blend);
setPalette(myOSystem->settings().getString("palette"));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::setChannels(int channels)
{
myOSystem->sound().setChannels(channels);
// Save to properties
string sound = channels == 2 ? "Stereo" : "Mono";
myProperties.set(Cartridge_Sound, sound);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -641,7 +608,7 @@ void Console::changeHeight(int direction)
else if(direction == -1) // decrease Height else if(direction == -1) // decrease Height
{ {
height--; height--;
if(height < 100) if(height < 200)
{ {
myOSystem->frameBuffer().showMessage("Height at minimum"); myOSystem->frameBuffer().showMessage("Height at minimum");
return; return;
@ -741,7 +708,7 @@ void Console::setColorLossPalette(bool loss)
continue; continue;
// If color-loss is enabled, fill the odd numbered palette entries // If color-loss is enabled, fill the odd numbered palette entries
// with grays values (calculated using the standard RGB -> grayscale // with gray values (calculated using the standard RGB -> grayscale
// conversion formula) // conversion formula)
for(int j = 0; j < 128; ++j) for(int j = 0; j < 128; ++j)
{ {
@ -761,6 +728,27 @@ void Console::setColorLossPalette(bool loss)
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::getFrameRate() const
{
// Set the correct framerate based on the format of the ROM
// This can be overridden by changing the framerate in the
// VideoDialog box or on the commandline, but it can't be saved
// (ie, framerate is now solely determined based on ROM format).
int framerate = myOSystem->settings().getInt("framerate");
if(framerate == -1)
{
if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60")
framerate = 60;
else if(myDisplayFormat == "PAL")
framerate = 50;
else
framerate = 60;
}
return framerate;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourNTSCPalette[256] = { uInt32 Console::ourNTSCPalette[256] = {
0x000000, 0, 0x4a4a4a, 0, 0x6f6f6f, 0, 0x8e8e8e, 0, 0x000000, 0, 0x4a4a4a, 0, 0x6f6f6f, 0, 0x8e8e8e, 0,

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.hxx,v 1.56 2006-12-28 20:40:00 stephena Exp $ // $Id: Console.hxx,v 1.57 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#ifndef CONSOLE_HXX #ifndef CONSOLE_HXX
@ -38,7 +38,7 @@ class System;
This class represents the entire game console. This class represents the entire game console.
@author Bradford W. Mott @author Bradford W. Mott
@version $Id: Console.hxx,v 1.56 2006-12-28 20:40:00 stephena Exp $ @version $Id: Console.hxx,v 1.57 2006-12-30 22:26:28 stephena Exp $
*/ */
class Console class Console
{ {
@ -172,26 +172,20 @@ class Console
*/ */
void toggleColorLoss(); void toggleColorLoss();
/**
Initialize the basic properties of the console.
TODO - This is a workaround for a bug in the TIA rendering, whereby
XStart/YStart values cause incorrect coordinates to be passed to the
in-game GUI rendering.
*/
void initialize();
/** /**
Initialize the video subsystem wrt this class. Initialize the video subsystem wrt this class.
This is required for changing window size, title, etc. This is required for changing window size, title, etc.
@param full Whether we want a full initialization,
or only reset certain attributes.
*/ */
void initializeVideo(); void initializeVideo(bool full = true);
/** /**
Sets the number of sound channels Initialize the audio subsystem wrt this class.
This is required any time the sound settings change.
@param channels Number of channels (indicates stereo or mono)
*/ */
void setChannels(int channels); void initializeAudio();
/** /**
"Fry" the Atari (mangle memory/TIA contents) "Fry" the Atari (mangle memory/TIA contents)
@ -266,6 +260,12 @@ class Console
*/ */
const uInt32* getPalette(int direction) const; const uInt32* getPalette(int direction) const;
/**
Returns the framerate based on a number of factors
(whether 'framerate' is set, what display format is in use, etc)
*/
uInt32 getFrameRate() const;
private: private:
// Pointer to the osystem object // Pointer to the osystem object
OSystem* myOSystem; OSystem* myOSystem;

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: Event.hxx,v 1.23 2006-12-08 16:49:25 stephena Exp $ // $Id: Event.hxx,v 1.24 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#ifndef EVENT_HXX #ifndef EVENT_HXX
@ -26,7 +26,7 @@ class EventStreamer;
/** /**
@author Bradford W. Mott @author Bradford W. Mott
@version $Id: Event.hxx,v 1.23 2006-12-08 16:49:25 stephena Exp $ @version $Id: Event.hxx,v 1.24 2006-12-30 22:26:28 stephena Exp $
*/ */
class Event class Event
{ {
@ -76,7 +76,7 @@ class Event
DrivingOneClockwise, DrivingOneCounterClockwise, DrivingOneValue, DrivingOneClockwise, DrivingOneCounterClockwise, DrivingOneValue,
DrivingOneFire, DrivingOneFire,
ChangeState, LoadState, SaveState, TakeSnapshot, Pause, Quit, ChangeState, LoadState, SaveState, TakeSnapshot, Quit,
MenuMode, CmdMenuMode, DebuggerMode, LauncherMode, Fry, MenuMode, CmdMenuMode, DebuggerMode, LauncherMode, Fry,
VolumeDecrease, VolumeIncrease, VolumeDecrease, VolumeIncrease,

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: EventHandler.cxx,v 1.191 2006-12-28 18:31:26 stephena Exp $ // $Id: EventHandler.cxx,v 1.192 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -62,7 +62,6 @@ EventHandler::EventHandler(OSystem* osystem)
myOverlay(NULL), myOverlay(NULL),
myState(S_NONE), myState(S_NONE),
myLSState(0), myLSState(0),
myPauseFlag(false),
myGrabMouseFlag(false), myGrabMouseFlag(false),
myUseLauncherFlag(false), myUseLauncherFlag(false),
myFryingFlag(false), myFryingFlag(false),
@ -161,9 +160,6 @@ void EventHandler::reset(State state)
setEventState(state); setEventState(state);
myLSState = 0; myLSState = 0;
myPauseFlag = false;
pause(false);
myEvent->clear(); myEvent->clear();
if(myState == S_LAUNCHER) if(myState == S_LAUNCHER)
@ -211,20 +207,6 @@ void EventHandler::refreshDisplay(bool forceUpdate)
myOSystem->frameBuffer().update(); myOSystem->frameBuffer().update();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::pause(bool status)
{
myPauseFlag = status;
if(&myOSystem->frameBuffer())
myOSystem->frameBuffer().pause(myPauseFlag);
if(&myOSystem->sound())
myOSystem->sound().mute(myPauseFlag);
// Inform the OSystem of the change in pause
myOSystem->pauseChanged(myPauseFlag);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::setupJoysticks() void EventHandler::setupJoysticks()
{ {
@ -657,8 +639,7 @@ void EventHandler::poll(uInt32 time)
case SDL_ACTIVEEVENT: case SDL_ACTIVEEVENT:
if((event.active.state & SDL_APPACTIVE) && (event.active.gain == 0)) if((event.active.state & SDL_APPACTIVE) && (event.active.gain == 0))
if(!myPauseFlag) if(myState == S_EMULATE) enterMenuMode(S_MENU);
handleEvent(Event::Pause, 1);
break; // SDL_ACTIVEEVENT break; // SDL_ACTIVEEVENT
case SDL_QUIT: case SDL_QUIT:
@ -1168,41 +1149,36 @@ void EventHandler::handleEvent(Event::Type event, int state)
return; return;
case Event::Fry: case Event::Fry:
if(!myPauseFlag)
myFryingFlag = bool(state); myFryingFlag = bool(state);
return; return;
case Event::VolumeDecrease: case Event::VolumeDecrease:
case Event::VolumeIncrease: case Event::VolumeIncrease:
if(state && !myPauseFlag) if(state)
myOSystem->sound().adjustVolume(event == Event::VolumeIncrease ? 1 : -1); myOSystem->sound().adjustVolume(event == Event::VolumeIncrease ? 1 : -1);
return; return;
case Event::SaveState: case Event::SaveState:
if(state && !myPauseFlag) saveState(); if(state) saveState();
return; return;
case Event::ChangeState: case Event::ChangeState:
if(state && !myPauseFlag) changeState(); if(state) changeState();
return; return;
case Event::LoadState: case Event::LoadState:
if(state && !myPauseFlag) loadState(); if(state) loadState();
return; return;
case Event::TakeSnapshot: case Event::TakeSnapshot:
if(state && !myPauseFlag) takeSnapshot(); if(state) takeSnapshot();
return;
case Event::Pause:
if(state)
pause(!myPauseFlag);
return; return;
case Event::LauncherMode: case Event::LauncherMode:
// ExitGame will only work when we've launched stella using the ROM // ExitGame will only work when we've launched stella using the ROM
// launcher. Otherwise, the only way to exit the main loop is to Quit. // launcher. Otherwise, the only way to exit the main loop is to Quit.
if(myState == S_EMULATE && myUseLauncherFlag && state) if((myState == S_EMULATE || myState == S_CMDMENU) &&
myUseLauncherFlag && state)
{ {
myOSystem->settings().saveConfig(); myOSystem->settings().saveConfig();
myOSystem->deleteConsole(); myOSystem->deleteConsole();
@ -1234,29 +1210,19 @@ bool EventHandler::eventStateChange(Event::Type type)
switch(type) switch(type)
{ {
case Event::MenuMode: case Event::MenuMode:
if(!myPauseFlag)
{
if(myState == S_EMULATE) if(myState == S_EMULATE)
enterMenuMode(S_MENU); enterMenuMode(S_MENU);
else else
handled = false; handled = false;
}
else
handled = false;
break; break;
case Event::CmdMenuMode: case Event::CmdMenuMode:
if(!myPauseFlag)
{
if(myState == S_EMULATE) if(myState == S_EMULATE)
enterMenuMode(S_CMDMENU); enterMenuMode(S_CMDMENU);
else if(myState == S_CMDMENU) else if(myState == S_CMDMENU)
leaveMenuMode(); leaveMenuMode();
else else
handled = false; handled = false;
}
else
handled = false;
break; break;
case Event::DebuggerMode: case Event::DebuggerMode:
@ -1769,7 +1735,6 @@ void EventHandler::setDefaultKeymap(EventMode mode)
myKeyTable[ SDLK_F10 ][mode] = Event::ChangeState; myKeyTable[ SDLK_F10 ][mode] = Event::ChangeState;
myKeyTable[ SDLK_F11 ][mode] = Event::LoadState; myKeyTable[ SDLK_F11 ][mode] = Event::LoadState;
myKeyTable[ SDLK_F12 ][mode] = Event::TakeSnapshot; myKeyTable[ SDLK_F12 ][mode] = Event::TakeSnapshot;
myKeyTable[ SDLK_PAUSE ][mode] = Event::Pause;
myKeyTable[ SDLK_BACKSPACE ][mode] = Event::Fry; myKeyTable[ SDLK_BACKSPACE ][mode] = Event::Fry;
myKeyTable[ SDLK_TAB ][mode] = Event::MenuMode; myKeyTable[ SDLK_TAB ][mode] = Event::MenuMode;
myKeyTable[ SDLK_BACKSLASH ][mode] = Event::CmdMenuMode; myKeyTable[ SDLK_BACKSLASH ][mode] = Event::CmdMenuMode;
@ -2224,8 +2189,8 @@ void EventHandler::enterMenuMode(State state)
myOverlay->reStack(); myOverlay->reStack();
refreshDisplay(); refreshDisplay();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(true); myOSystem->sound().mute(true);
myEvent->clear(); myEvent->clear();
} }
@ -2236,8 +2201,8 @@ void EventHandler::leaveMenuMode()
setEventState(S_EMULATE); setEventState(S_EMULATE);
refreshDisplay(); refreshDisplay();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(false); myOSystem->sound().mute(false);
myEvent->clear(); myEvent->clear();
} }
@ -2253,11 +2218,9 @@ bool EventHandler::enterDebugMode()
myOSystem->createFrameBuffer(); myOSystem->createFrameBuffer();
myOverlay->reStack(); myOverlay->reStack();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(true);
myEvent->clear(); myEvent->clear();
if(!myPauseFlag) // Pause when entering debugger mode
handleEvent(Event::Pause, 1);
// Make sure debugger starts in a consistent state // Make sure debugger starts in a consistent state
myOSystem->debugger().setStartState(); myOSystem->debugger().setStartState();
@ -2265,7 +2228,7 @@ bool EventHandler::enterDebugMode()
// (sometimes entering on a breakpoint doesn't draw contents) // (sometimes entering on a breakpoint doesn't draw contents)
refreshDisplay(); refreshDisplay();
#else #else
myOSystem->frameBuffer().showMessage("Developer/debugger unsupported"); myOSystem->frameBuffer().showMessage("Debugger unsupported");
#endif #endif
return true; return true;
@ -2286,10 +2249,8 @@ void EventHandler::leaveDebugMode()
myOSystem->createFrameBuffer(); myOSystem->createFrameBuffer();
refreshDisplay(); refreshDisplay();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(false);
myEvent->clear(); myEvent->clear();
if(myPauseFlag) // Un-Pause when leaving debugger mode
handleEvent(Event::Pause, 1);
#endif #endif
} }
@ -2586,7 +2547,6 @@ EventHandler::ActionList EventHandler::ourEmulActionList[kEmulActionListSize] =
{ Event::ChangeState, "Change State", 0 }, { Event::ChangeState, "Change State", 0 },
{ Event::LoadState, "Load State", 0 }, { Event::LoadState, "Load State", 0 },
{ Event::TakeSnapshot, "Snapshot", 0 }, { Event::TakeSnapshot, "Snapshot", 0 },
{ Event::Pause, "Pause", 0 },
{ Event::Fry, "Fry cartridge", 0 }, { Event::Fry, "Fry cartridge", 0 },
{ Event::VolumeDecrease, "Decrease volume", 0 }, { Event::VolumeDecrease, "Decrease volume", 0 },
{ Event::VolumeIncrease, "Increase volume", 0 }, { Event::VolumeIncrease, "Increase volume", 0 },

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: EventHandler.hxx,v 1.96 2006-12-28 18:31:26 stephena Exp $ // $Id: EventHandler.hxx,v 1.97 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#ifndef EVENTHANDLER_HXX #ifndef EVENTHANDLER_HXX
@ -62,7 +62,7 @@ enum EventMode {
mapping can take place. mapping can take place.
@author Stephen Anthony @author Stephen Anthony
@version $Id: EventHandler.hxx,v 1.96 2006-12-28 18:31:26 stephena Exp $ @version $Id: EventHandler.hxx,v 1.97 2006-12-30 22:26:28 stephena Exp $
*/ */
class EventHandler class EventHandler
{ {
@ -178,16 +178,6 @@ class EventHandler
*/ */
void refreshDisplay(bool forceUpdate = false); void refreshDisplay(bool forceUpdate = false);
/**
This method pauses the entire emulator.
*/
void pause(bool status);
/**
This method indicates whether a pause event has been received.
*/
inline bool isPaused() { return myPauseFlag; }
/** /**
This method indicates that the system should terminate. This method indicates that the system should terminate.
*/ */
@ -467,7 +457,7 @@ class EventHandler
private: private:
enum { enum {
kEmulActionListSize = 81, kEmulActionListSize = 80,
kMenuActionListSize = 15 kMenuActionListSize = 15
}; };
@ -547,9 +537,6 @@ class EventHandler
// Indicates the current state to use for state loading/saving // Indicates the current state to use for state loading/saving
uInt32 myLSState; uInt32 myLSState;
// Indicates the current pause status
bool myPauseFlag;
// Indicates whether the mouse cursor is grabbed // Indicates whether the mouse cursor is grabbed
bool myGrabMouseFlag; bool myGrabMouseFlag;

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.113 2006-12-29 16:52:43 stephena Exp $ // $Id: FrameBuffer.cxx,v 1.114 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -110,10 +110,6 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height,
// (lowercase vs. uppercase characters) // (lowercase vs. uppercase characters)
SDL_EnableUNICODE(1); SDL_EnableUNICODE(1);
// Set palette for GUI
for(int i = 0; i < kNumColors-256; i++)
myDefPalette[i+256] = mapRGB(ourGUIColors[i][0], ourGUIColors[i][1], ourGUIColors[i][2]);
// Erase any messages from a previous run // Erase any messages from a previous run
myMessage.counter = 0; myMessage.counter = 0;
@ -136,20 +132,14 @@ void FrameBuffer::update()
{ {
case EventHandler::S_EMULATE: case EventHandler::S_EMULATE:
{ {
bool mediaSourceChanged = false; // Run the console for one frame
// Draw changes to the mediasource
if(!myOSystem->eventHandler().isPaused())
{
myOSystem->console().mediaSource().update(); myOSystem->console().mediaSource().update();
if(myOSystem->eventHandler().frying()) if(myOSystem->eventHandler().frying())
myOSystem->console().fry(); myOSystem->console().fry();
mediaSourceChanged = true; // mediasource changed, so force an update
}
// Only update the screen if it's been invalidated // And update the screen
if(mediaSourceChanged || theRedrawTIAIndicator)
drawMediaSource(); drawMediaSource();
break; // S_EMULATE break; // S_EMULATE
} }
@ -301,11 +291,6 @@ inline void FrameBuffer::drawMessage()
addDirtyRect(myMessage.x, myMessage.y, myMessage.w, myMessage.h); addDirtyRect(myMessage.x, myMessage.y, myMessage.w, myMessage.h);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::pause(bool status)
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::refresh() void FrameBuffer::refresh()
{ {
@ -313,16 +298,16 @@ void FrameBuffer::refresh()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::setPalette(const uInt32* palette) void FrameBuffer::setTIAPalette(const uInt32* palette)
{ {
int i, j; int i, j;
// Set palette for normal fill // Set palette for normal fill
for(i = 0; i < 256; ++i) for(i = 0; i < 256; ++i)
{ {
Uint8 r = (Uint8) ((palette[i] & 0x00ff0000) >> 16); Uint8 r = (palette[i] >> 16) & 0xff;
Uint8 g = (Uint8) ((palette[i] & 0x0000ff00) >> 8); Uint8 g = (palette[i] >> 8) & 0xff;
Uint8 b = (Uint8) (palette[i] & 0x000000ff); Uint8 b = palette[i] & 0xff;
myDefPalette[i] = mapRGB(r, g, b); myDefPalette[i] = mapRGB(r, g, b);
} }
@ -332,12 +317,12 @@ void FrameBuffer::setPalette(const uInt32* palette)
{ {
for(j = 0; j < 256; ++j) for(j = 0; j < 256; ++j)
{ {
uInt8 ri = (uInt8) ((palette[i] & 0x00ff0000) >> 16); uInt8 ri = (palette[i] >> 16) & 0xff;
uInt8 gi = (uInt8) ((palette[i] & 0x0000ff00) >> 8); uInt8 gi = (palette[i] >> 8) & 0xff;
uInt8 bi = (uInt8) (palette[i] & 0x000000ff); uInt8 bi = palette[i] & 0xff;
uInt8 rj = (uInt8) ((palette[j] & 0x00ff0000) >> 16); uInt8 rj = (palette[j] >> 16) & 0xff;
uInt8 gj = (uInt8) ((palette[j] & 0x0000ff00) >> 8); uInt8 gj = (palette[j] >> 8) & 0xff;
uInt8 bj = (uInt8) (palette[j] & 0x000000ff); uInt8 bj = palette[j] & 0xff;
Uint8 r = (Uint8) getPhosphor(ri, rj); Uint8 r = (Uint8) getPhosphor(ri, rj);
Uint8 g = (Uint8) getPhosphor(gi, gj); Uint8 g = (Uint8) getPhosphor(gi, gj);
@ -350,6 +335,19 @@ void FrameBuffer::setPalette(const uInt32* palette)
theRedrawTIAIndicator = true; theRedrawTIAIndicator = true;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::setUIPalette(const uInt32* palette)
{
// Set palette for GUI
for(int i = 0; i < kNumColors-256; ++i)
{
Uint8 r = (palette[i] >> 16) & 0xff;
Uint8 g = (palette[i] >> 8) & 0xff;
Uint8 b = palette[i] & 0xff;
myDefPalette[i+256] = mapRGB(r, g, b);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::toggleFullscreen() void FrameBuffer::toggleFullscreen()
{ {
@ -747,21 +745,6 @@ const string& FrameBuffer::currentScalerName()
myOSystem->settings().getString("scale_ui") ); myOSystem->settings().getString("scale_ui") );
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const uInt8 FrameBuffer::ourGUIColors[kNumColors-256][3] = {
{ 104, 104, 104 }, // kColor
{ 0, 0, 0 }, // kBGColor
{ 64, 64, 64 }, // kShadowColor
{ 200, 200, 255 }, // kHiliteColor
{ 32, 160, 32 }, // kTextColor
#if !defined(GP2X) // Quick GP2X hack to change colours, until an in-game GUI is added
{ 0, 255, 0 }, // kTextColorHi
#else
{ 0, 0, 255 }, // kTextColorHi
#endif
{ 200, 0, 0 } // kTextColorEm
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Scaler FrameBuffer::ourScalers[kScalerListSize] = { Scaler FrameBuffer::ourScalers[kScalerListSize] = {
{ kZOOM1X, "Zoom1x", "zoom1x", 1 }, { kZOOM1X, "Zoom1x", "zoom1x", 1 },

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.82 2006-12-19 12:40:30 stephena Exp $ // $Id: FrameBuffer.hxx,v 1.83 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#ifndef FRAMEBUFFER_HXX #ifndef FRAMEBUFFER_HXX
@ -93,7 +93,7 @@ struct Scaler {
All GUI elements (ala ScummVM) are drawn here as well. All GUI elements (ala ScummVM) are drawn here as well.
@author Stephen Anthony @author Stephen Anthony
@version $Id: FrameBuffer.hxx,v 1.82 2006-12-19 12:40:30 stephena Exp $ @version $Id: FrameBuffer.hxx,v 1.83 2006-12-30 22:26:28 stephena Exp $
*/ */
class FrameBuffer class FrameBuffer
{ {
@ -172,13 +172,6 @@ class FrameBuffer
*/ */
inline const uInt32 imageHeight() { return myImageDim.h; } inline const uInt32 imageHeight() { return myImageDim.h; }
/**
Handle the pause event; currently this updates the palette.
@param status Whether pause has been enabled or disabled
*/
void pause(bool status);
/** /**
Indicates that the TIA area is dirty, and certain areas need Indicates that the TIA area is dirty, and certain areas need
to be redrawn. to be redrawn.
@ -238,11 +231,18 @@ class FrameBuffer
void setWindowTitle(const string& title); void setWindowTitle(const string& title);
/** /**
Set up the palette for a screen of any depth > 8. Set up the TIA/emulation palette for a screen of any depth > 8.
@param palette The array of colors @param palette The array of colors
*/ */
virtual void setPalette(const uInt32* palette); virtual void setTIAPalette(const uInt32* palette);
/**
Set up the user interface palette for a screen of any depth > 8.
@param palette The array of colors
*/
virtual void setUIPalette(const uInt32* palette);
/** /**
This method should be called to draw a rectangular box with sides This method should be called to draw a rectangular box with sides
@ -493,9 +493,6 @@ class FrameBuffer
// Amount to blend when using phosphor effect // Amount to blend when using phosphor effect
int myPhosphorBlend; int myPhosphorBlend;
// Table of RGB values for GUI elements
static const uInt8 ourGUIColors[kNumColors-256][3];
private: private:
/** /**
Set the icon for the main SDL window. Set the icon for the main SDL window.

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: OSystem.cxx,v 1.86 2006-12-28 20:40:00 stephena Exp $ // $Id: OSystem.cxx,v 1.87 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -136,6 +136,18 @@ bool OSystem::create()
myLauncherFont = new GUI::Font(GUI::stellaDesc); // FIXME myLauncherFont = new GUI::Font(GUI::stellaDesc); // FIXME
myConsoleFont = new GUI::Font(GUI::consoleDesc); myConsoleFont = new GUI::Font(GUI::consoleDesc);
// Create the event handler for the system
myEventHandler = new EventHandler(this);
myEventHandler->initialize();
// Create a properties set for us to use and set it up
myPropSet = new PropertiesSet(this);
#ifdef CHEATCODE_SUPPORT
myCheatManager = new CheatManager(this);
myCheatManager->loadCheatDatabase();
#endif
// Create menu and launcher GUI objects // Create menu and launcher GUI objects
myMenu = new Menu(this); myMenu = new Menu(this);
myCommandMenu = new CommandMenu(this); myCommandMenu = new CommandMenu(this);
@ -143,17 +155,6 @@ bool OSystem::create()
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
myDebugger = new Debugger(this); myDebugger = new Debugger(this);
#endif #endif
#ifdef CHEATCODE_SUPPORT
myCheatManager = new CheatManager(this);
myCheatManager->loadCheatDatabase();
#endif
// Create the event handler for the system
myEventHandler = new EventHandler(this);
myEventHandler->initialize();
// Create a properties set for us to use and set it up
myPropSet = new PropertiesSet(this);
// Create the sound object; the sound subsystem isn't actually // Create the sound object; the sound subsystem isn't actually
// opened until needed, so this is non-blocking (on those systems // opened until needed, so this is non-blocking (on those systems
@ -170,7 +171,6 @@ bool OSystem::create()
#ifdef JOYSTICK_SUPPORT #ifdef JOYSTICK_SUPPORT
myFeatures += "Joystick "; myFeatures += "Joystick ";
#endif #endif
myFeatures += "Snapshot ";
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
myFeatures += "Debugger "; myFeatures += "Debugger ";
#endif #endif
@ -243,18 +243,6 @@ bool OSystem::createFrameBuffer(bool showmessage)
case EventHandler::S_MENU: case EventHandler::S_MENU:
case EventHandler::S_CMDMENU: case EventHandler::S_CMDMENU:
myConsole->initializeVideo(); myConsole->initializeVideo();
if(showmessage)
{
switch(myFrameBuffer->type())
{
case kSoftBuffer:
myFrameBuffer->showMessage("Software mode");
break;
case kGLBuffer:
myFrameBuffer->showMessage("OpenGL mode");
break;
}
}
break; // S_EMULATE, S_MENU, S_CMDMENU break; // S_EMULATE, S_MENU, S_CMDMENU
case EventHandler::S_LAUNCHER: case EventHandler::S_LAUNCHER:
@ -274,6 +262,27 @@ bool OSystem::createFrameBuffer(bool showmessage)
// Setup the SDL joysticks (must be done after FrameBuffer is created) // Setup the SDL joysticks (must be done after FrameBuffer is created)
if(changeBuffer) myEventHandler->setupJoysticks(); if(changeBuffer) myEventHandler->setupJoysticks();
// Update the UI palette
// For now, we just use the standard palette
// Once an interface is created for this, it will be changable
// within the emulation
int palette = 0; // 1 indicates GP2X, but it should be called something else
// Perhaps tweaked and called high-contrast or something??
myFrameBuffer->setUIPalette(&ourGUIColors[palette][0]);
if(showmessage)
{
switch(myFrameBuffer->type())
{
case kSoftBuffer:
myFrameBuffer->showMessage("Software mode");
break;
case kGLBuffer:
myFrameBuffer->showMessage("OpenGL mode");
break;
}
}
return true; return true;
} }
@ -290,28 +299,14 @@ void OSystem::toggleFrameBuffer()
else // a driver that doesn't exist was requested, so use software mode else // a driver that doesn't exist was requested, so use software mode
video = "soft"; video = "soft";
myEventHandler->handleEvent(Event::Pause, 0);
// Remember the pause state
bool pause = myEventHandler->isPaused();
// Update the settings and create the framebuffer // Update the settings and create the framebuffer
mySettings->setString("video", video); mySettings->setString("video", video);
createFrameBuffer(true); // show onscreen message createFrameBuffer(true); // show onscreen message, re-initialize framebuffer
// And re-pause the system
myEventHandler->pause(pause);
// The palette and phosphor info for the framebuffer will be lost // The palette and phosphor info for the framebuffer will be lost
// when a new framebuffer is created; we must restore it // when a new framebuffer is created; we must restore it
if(myConsole) if(myConsole)
{ myConsole->initializeVideo(false);
const Properties& props = myConsole->properties();
bool enable = props.get(Display_Phosphor) == "YES";
int blend = atoi(props.get(Display_PPBlend).c_str());
myFrameBuffer->enablePhosphor(enable, blend);
myConsole->setPalette(mySettings->getString("palette"));
}
#endif #endif
} }
@ -359,11 +354,13 @@ bool OSystem::createConsole(const string& romfile)
#ifdef CHEATCODE_SUPPORT #ifdef CHEATCODE_SUPPORT
myCheatManager->loadCheats(md5); myCheatManager->loadCheats(md5);
#endif #endif
setFramerate(60); // We need to set framerate to see messages
myEventHandler->reset(EventHandler::S_EMULATE); myEventHandler->reset(EventHandler::S_EMULATE);
createFrameBuffer(false); createFrameBuffer(false); // Takes care of initializeVideo()
myFrameBuffer->setCursorState(); myConsole->initializeAudio();
myConsole->initialize(); // Must be done *after* the framebuffer is created #ifdef DEBUGGER_SUPPORT
myDebugger->setConsole(myConsole);
myDebugger->initialize();
#endif
if(showmessage) if(showmessage)
myFrameBuffer->showMessage("New console created"); myFrameBuffer->showMessage("New console created");
@ -375,6 +372,7 @@ bool OSystem::createConsole(const string& romfile)
// Update the timing info for a new console run // Update the timing info for a new console run
resetLoopTiming(); resetLoopTiming();
myFrameBuffer->setCursorState();
retval = true; retval = true;
} }
else else
@ -685,11 +683,6 @@ void OSystem::stateChanged(EventHandler::State state)
{ {
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OSystem::pauseChanged(bool status)
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OSystem::mainLoop() void OSystem::mainLoop()
{ {
@ -711,6 +704,25 @@ void OSystem::mainLoop()
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*
Palette is defined as follows:
kColor
kBGColor
kShadowColor
kHiliteColor
kTextColor
kTextColorHi
kTextColorEm
*/
uInt32 OSystem::ourGUIColors[kNumUIPalettes][kNumColors-256] = {
// Normal mode
{ 0x686868, 0x000000, 0x404040, 0xc8c8ff, 0x20a020, 0x00ff00, 0xc80000 },
// GP2X
{ 0x686868, 0x000000, 0x404040, 0xc8c8ff, 0x20a020, 0x0000ff, 0xc80000 }
// Others to be added ...
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OSystem::OSystem(const OSystem& osystem) OSystem::OSystem(const OSystem& osystem)
{ {

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: OSystem.hxx,v 1.49 2006-12-28 18:31:26 stephena Exp $ // $Id: OSystem.hxx,v 1.50 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#ifndef OSYSTEM_HXX #ifndef OSYSTEM_HXX
@ -45,7 +45,7 @@ class VideoDialog;
other objects belong. other objects belong.
@author Stephen Anthony @author Stephen Anthony
@version $Id: OSystem.hxx,v 1.49 2006-12-28 18:31:26 stephena Exp $ @version $Id: OSystem.hxx,v 1.50 2006-12-30 22:26:28 stephena Exp $
*/ */
class OSystem class OSystem
{ {
@ -355,11 +355,6 @@ class OSystem
*/ */
virtual void stateChanged(EventHandler::State state); virtual void stateChanged(EventHandler::State state);
/**
Informs the OSystem of a change in pause status.
*/
virtual void pauseChanged(bool status);
protected: protected:
/** /**
Set the base directory for all Stella files Set the base directory for all Stella files
@ -430,6 +425,7 @@ class OSystem
bool myQuitLoop; bool myQuitLoop;
private: private:
enum { kNumUIPalettes = 2 };
string myBaseDir; string myBaseDir;
string myStateDir; string myStateDir;
@ -460,6 +456,9 @@ class OSystem
}; };
TimingInfo myTimingInfo; TimingInfo myTimingInfo;
// Table of RGB values for GUI elements
static uInt32 ourGUIColors[kNumUIPalettes][kNumColors-256];
private: private:
/** /**
Creates the various framebuffers/renderers available in this system Creates the various framebuffers/renderers available in this system

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: Settings.cxx,v 1.109 2006-12-28 20:40:00 stephena Exp $ // $Id: Settings.cxx,v 1.110 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -241,14 +241,6 @@ void Settings::validate()
#endif #endif
#ifdef SOUND_SUPPORT #ifdef SOUND_SUPPORT
i = getInt("fragsize");
if(i != 256 && i != 512 && i != 1024 && i != 2048 && i != 4096)
#ifdef WIN32
setInternal("fragsize", "2048");
#else
setInternal("fragsize", "512");
#endif
i = getInt("volume"); i = getInt("volume");
if(i < 0 || i > 100) if(i < 0 || i > 100)
setInternal("volume", "100"); setInternal("volume", "100");
@ -325,7 +317,6 @@ void Settings::usage()
<< endl << endl
#ifdef SOUND_SUPPORT #ifdef SOUND_SUPPORT
<< " -sound <1|0> Enable sound generation\n" << " -sound <1|0> Enable sound generation\n"
<< " -channels <1|2> Enable mono or stereo sound\n"
<< " -fragsize <number> The size of sound fragments (must be a power of two)\n" << " -fragsize <number> The size of sound fragments (must be a power of two)\n"
<< " -freq <number> Set sound sample output frequency (0 - 48000)\n" << " -freq <number> Set sound sample output frequency (0 - 48000)\n"
<< " -tiafreq <number> Set sound sample generation frequency (0 - 48000)\n" << " -tiafreq <number> Set sound sample generation frequency (0 - 48000)\n"

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: OSystemGP2X.cxx,v 1.23 2006-12-28 18:31:26 stephena Exp $ // $Id: OSystemGP2X.cxx,v 1.24 2006-12-30 22:26:28 stephena Exp $
// Modified on 2006/01/06 by Alex Zaballa for use on GP2X // Modified on 2006/01/06 by Alex Zaballa for use on GP2X
//============================================================================ //============================================================================
@ -106,7 +106,7 @@ void OSystemGP2X::setDefaultJoymap()
myEventHandler->setDefaultJoyMapping(Event::CmdMenuMode, kEmulationMode, 0, 12); // A myEventHandler->setDefaultJoyMapping(Event::CmdMenuMode, kEmulationMode, 0, 12); // A
myEventHandler->setDefaultJoyMapping(Event::JoystickZeroFire, kEmulationMode, 0, 13); // B myEventHandler->setDefaultJoyMapping(Event::JoystickZeroFire, kEmulationMode, 0, 13); // B
myEventHandler->setDefaultJoyMapping(Event::MenuMode, kEmulationMode, 0, 14); // Y myEventHandler->setDefaultJoyMapping(Event::MenuMode, kEmulationMode, 0, 14); // Y
myEventHandler->setDefaultJoyMapping(Event::Pause, kEmulationMode, 0, 15); // X // myEventHandler->setDefaultJoyMapping(Event::Pause, kEmulationMode, 0, 15); // X
myEventHandler->setDefaultJoyMapping(Event::VolumeIncrease, kEmulationMode, 0, 16); // Vol+ myEventHandler->setDefaultJoyMapping(Event::VolumeIncrease, kEmulationMode, 0, 16); // Vol+
myEventHandler->setDefaultJoyMapping(Event::VolumeDecrease, kEmulationMode, 0, 17); // Vol- myEventHandler->setDefaultJoyMapping(Event::VolumeDecrease, kEmulationMode, 0, 17); // Vol-
myEventHandler->setDefaultJoyMapping(Event::NoType, kEmulationMode, 0, 18); // Click myEventHandler->setDefaultJoyMapping(Event::NoType, kEmulationMode, 0, 18); // Click

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: AudioDialog.cxx,v 1.22 2006-12-08 16:49:32 stephena Exp $ // $Id: AudioDialog.cxx,v 1.23 2006-12-30 22:26:28 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -65,11 +65,12 @@ AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
myFragsizePopup = new PopUpWidget(this, font, xpos, ypos, myFragsizePopup = new PopUpWidget(this, font, xpos, ypos,
pwidth + myVolumeLabel->getWidth() - 4, lineHeight, pwidth + myVolumeLabel->getWidth() - 4, lineHeight,
"Fragment size: ", lwidth); "Fragment size: ", lwidth);
myFragsizePopup->appendEntry("256", 1); myFragsizePopup->appendEntry("128", 1);
myFragsizePopup->appendEntry("512", 2); myFragsizePopup->appendEntry("256", 2);
myFragsizePopup->appendEntry("1024", 3); myFragsizePopup->appendEntry("512", 3);
myFragsizePopup->appendEntry("2048", 4); myFragsizePopup->appendEntry("1024", 4);
myFragsizePopup->appendEntry("4096", 5); myFragsizePopup->appendEntry("2048", 5);
myFragsizePopup->appendEntry("4096", 6);
wid.push_back(myFragsizePopup); wid.push_back(myFragsizePopup);
ypos += lineHeight + 4; ypos += lineHeight + 4;
@ -97,14 +98,8 @@ AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
wid.push_back(myTiaFreqPopup); wid.push_back(myTiaFreqPopup);
ypos += lineHeight + 4; ypos += lineHeight + 4;
// Stereo sound
mySoundTypeCheckbox = new CheckboxWidget(this, font, 20, ypos,
"Stereo mode", 0);
wid.push_back(mySoundTypeCheckbox);
// Clip volume // Clip volume
myClipVolumeCheckbox = new CheckboxWidget(this, font, myClipVolumeCheckbox = new CheckboxWidget(this, font, xpos+28, ypos,
40 + mySoundTypeCheckbox->getWidth(), ypos,
"Clip volume", 0); "Clip volume", 0);
wid.push_back(myClipVolumeCheckbox); wid.push_back(myClipVolumeCheckbox);
ypos += lineHeight + 4; ypos += lineHeight + 4;
@ -155,11 +150,12 @@ void AudioDialog::loadConfig()
// Fragsize // Fragsize
i = instance()->settings().getInt("fragsize"); i = instance()->settings().getInt("fragsize");
if(i == 256) i = 1; if(i == 128) i = 1;
else if(i == 512) i = 2; else if(i == 256) i = 2;
else if(i == 1024) i = 3; else if(i == 512) i = 3;
else if(i == 2048) i = 4; else if(i == 1024) i = 4;
else if(i == 4096) i = 5; else if(i == 2048) i = 5;
else if(i == 4096) i = 6;
myFragsizePopup->setSelectedTag(i); myFragsizePopup->setSelectedTag(i);
// Output frequency // Output frequency
@ -182,10 +178,6 @@ void AudioDialog::loadConfig()
else i = 3; // default to '31400' else i = 3; // default to '31400'
myTiaFreqPopup->setSelectedTag(i); myTiaFreqPopup->setSelectedTag(i);
// Stereo mode
i = instance()->settings().getInt("channels");
mySoundTypeCheckbox->setState(i == 2);
// Clip volume // Clip volume
b = instance()->settings().getBool("clipvol"); b = instance()->settings().getBool("clipvol");
myClipVolumeCheckbox->setState(b); myClipVolumeCheckbox->setState(b);
@ -201,71 +193,39 @@ void AudioDialog::loadConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void AudioDialog::saveConfig() void AudioDialog::saveConfig()
{ {
Settings& settings = instance()->settings();
string s; string s;
bool b;
int i; int i;
bool b, restart = false;
// Volume // Volume
i = myVolumeSlider->getValue(); i = myVolumeSlider->getValue();
instance()->sound().setVolume(i); instance()->sound().setVolume(i);
// Fragsize (requires a restart to take effect) // Fragsize
i = 1; s = myFragsizePopup->getSelectedString();
i <<= (myFragsizePopup->getSelectedTag() + 7); settings.setString("fragsize", s);
if(instance()->settings().getInt("fragsize") != i)
{
instance()->settings().setInt("fragsize", i);
restart = true;
}
// Output frequency (requires a restart to take effect) // Output frequency
s = myFreqPopup->getSelectedString(); s = myFreqPopup->getSelectedString();
if(instance()->settings().getString("freq") != s) settings.setString("freq", s);
{
instance()->settings().setString("freq", s);
restart = true;
}
// TIA frequency (requires a restart to take effect) // TIA frequency
s = myTiaFreqPopup->getSelectedString(); s = myTiaFreqPopup->getSelectedString();
if(instance()->settings().getString("tiafreq") != s) settings.setString("tiafreq", s);
{
instance()->settings().setString("tiafreq", s);
restart = true;
}
// Enable/disable stereo sound (requires a restart to take effect)
b = mySoundTypeCheckbox->getState();
if((instance()->settings().getInt("channels") == 2) != b)
{
instance()->console().setChannels(b ? 2 : 1);
restart = true;
}
// Enable/disable volume clipping (requires a restart to take effect) // Enable/disable volume clipping (requires a restart to take effect)
b = myClipVolumeCheckbox->getState(); b = myClipVolumeCheckbox->getState();
if(instance()->settings().getBool("clipvol") != b) settings.setBool("clipvol", b);
{
instance()->settings().setBool("clipvol", b);
restart = true;
}
// Enable/disable sound (requires a restart to take effect) // Enable/disable sound (requires a restart to take effect)
b = mySoundEnableCheckbox->getState(); b = mySoundEnableCheckbox->getState();
if(instance()->settings().getBool("sound") != b)
{
instance()->sound().setEnabled(b); instance()->sound().setEnabled(b);
restart = true;
}
// Only force a re-initialization when necessary, since it can // Only force a re-initialization when necessary, since it can
// be a time-consuming operation // be a time-consuming operation
if(restart) if(&instance()->console())
{ instance()->console().initializeAudio();
instance()->sound().close();
instance()->sound().initialize();
instance()->sound().mute(true);
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -275,15 +235,14 @@ void AudioDialog::setDefaults()
myVolumeLabel->setLabel("100"); myVolumeLabel->setLabel("100");
#ifdef WIN32 #ifdef WIN32
myFragsizePopup->setSelectedTag(4); myFragsizePopup->setSelectedTag(5);
#else #else
myFragsizePopup->setSelectedTag(2); myFragsizePopup->setSelectedTag(3);
#endif #endif
myFreqPopup->setSelectedTag(3); myFreqPopup->setSelectedTag(3);
myTiaFreqPopup->setSelectedTag(3); myTiaFreqPopup->setSelectedTag(3);
myClipVolumeCheckbox->setState(true); myClipVolumeCheckbox->setState(true);
mySoundTypeCheckbox->setState(false);
mySoundEnableCheckbox->setState(true); mySoundEnableCheckbox->setState(true);
// Make sure that mutually-exclusive items are not enabled at the same time // Make sure that mutually-exclusive items are not enabled at the same time
@ -300,7 +259,6 @@ void AudioDialog::handleSoundEnableChange(bool active)
myFragsizePopup->setEnabled(active); myFragsizePopup->setEnabled(active);
myFreqPopup->setEnabled(active); myFreqPopup->setEnabled(active);
myTiaFreqPopup->setEnabled(active); myTiaFreqPopup->setEnabled(active);
mySoundTypeCheckbox->setEnabled(active);
myClipVolumeCheckbox->setEnabled(active); myClipVolumeCheckbox->setEnabled(active);
} }

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: AudioDialog.hxx,v 1.9 2006-12-08 16:49:32 stephena Exp $ // $Id: AudioDialog.hxx,v 1.10 2006-12-30 22:26:28 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -33,11 +33,6 @@ class CheckboxWidget;
#include "OSystem.hxx" #include "OSystem.hxx"
#include "bspf.hxx" #include "bspf.hxx"
enum {
kVolumeChanged = 'ADvc',
kSoundEnableChanged = 'ADse'
};
class AudioDialog : public Dialog class AudioDialog : public Dialog
{ {
public: public:
@ -51,7 +46,6 @@ class AudioDialog : public Dialog
PopUpWidget* myFragsizePopup; PopUpWidget* myFragsizePopup;
PopUpWidget* myFreqPopup; PopUpWidget* myFreqPopup;
PopUpWidget* myTiaFreqPopup; PopUpWidget* myTiaFreqPopup;
CheckboxWidget* mySoundTypeCheckbox;
CheckboxWidget* myClipVolumeCheckbox; CheckboxWidget* myClipVolumeCheckbox;
CheckboxWidget* mySoundEnableCheckbox; CheckboxWidget* mySoundEnableCheckbox;
@ -62,6 +56,11 @@ class AudioDialog : public Dialog
void handleSoundEnableChange(bool active); void handleSoundEnableChange(bool active);
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id); virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
enum {
kVolumeChanged = 'ADvc',
kSoundEnableChanged = 'ADse'
};
}; };
#endif #endif

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: CommandDialog.cxx,v 1.10 2006-12-08 16:49:32 stephena Exp $ // $Id: CommandDialog.cxx,v 1.11 2006-12-30 22:26:28 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -42,8 +42,6 @@ CommandDialog::CommandDialog(OSystem* osystem, DialogContainer* parent)
// Set real dimensions // Set real dimensions
_w = 4 * (lwidth) + 5; _w = 4 * (lwidth) + 5;
_h = 4 * (buttonHeight+5) + 5; _h = 4 * (buttonHeight+5) + 5;
_x = (osystem->frameBuffer().baseWidth() - _w) / 2;
_y = (osystem->frameBuffer().baseHeight() - _h) / 2;
WidgetArray wid; WidgetArray wid;
ButtonWidget* b; ButtonWidget* b;
@ -186,26 +184,28 @@ void CommandDialog::handleCommand(CommandSender* sender, int cmd,
case kFormatCmd: case kFormatCmd:
instance()->eventHandler().leaveMenuMode(); instance()->eventHandler().leaveMenuMode();
instance()->console().toggleFormat(); instance()->console().toggleFormat();
return; execute = false;
break; break;
case kPaletteCmd: case kPaletteCmd:
instance()->eventHandler().leaveMenuMode(); instance()->eventHandler().leaveMenuMode();
instance()->console().togglePalette(); instance()->console().togglePalette();
return; execute = false;
break; break;
case kReloadRomCmd: case kReloadRomCmd:
instance()->eventHandler().leaveMenuMode(); instance()->eventHandler().leaveMenuMode();
instance()->deleteConsole();
instance()->createConsole(); instance()->createConsole();
return; execute = false;
break; break;
case kExitCmd: case kExitCmd:
if(instance()->eventHandler().useLauncher()) if(instance()->eventHandler().useLauncher())
event = Event::LauncherMode; instance()->eventHandler().handleEvent(Event::LauncherMode, 1);
else else
event = Event::Quit; instance()->quit();
execute = false;
break; break;
default: default:

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: CommandMenu.cxx,v 1.4 2006-12-08 16:49:32 stephena Exp $ // $Id: CommandMenu.cxx,v 1.5 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#include "Dialog.hxx" #include "Dialog.hxx"
@ -24,16 +24,10 @@
CommandMenu::CommandMenu(OSystem* osystem) CommandMenu::CommandMenu(OSystem* osystem)
: DialogContainer(osystem) : DialogContainer(osystem)
{ {
myBaseDialog = new CommandDialog(myOSystem, this);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandMenu::~CommandMenu() CommandMenu::~CommandMenu()
{ {
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CommandMenu::initialize()
{
delete myBaseDialog;
myBaseDialog = new CommandDialog(myOSystem, this);
}

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: CommandMenu.hxx,v 1.2 2006-12-08 16:49:32 stephena Exp $ // $Id: CommandMenu.hxx,v 1.3 2006-12-30 22:26:28 stephena Exp $
//============================================================================ //============================================================================
#ifndef COMMAND_MENU_HXX #ifndef COMMAND_MENU_HXX
@ -28,7 +28,7 @@ class OSystem;
The base dialog for common commands in Stella. The base dialog for common commands in Stella.
@author Stephen Anthony @author Stephen Anthony
@version $Id: CommandMenu.hxx,v 1.2 2006-12-08 16:49:32 stephena Exp $ @version $Id: CommandMenu.hxx,v 1.3 2006-12-30 22:26:28 stephena Exp $
*/ */
class CommandMenu : public DialogContainer class CommandMenu : public DialogContainer
{ {
@ -42,12 +42,6 @@ class CommandMenu : public DialogContainer
Destructor Destructor
*/ */
virtual ~CommandMenu(); virtual ~CommandMenu();
public:
/**
Updates the basedialog to be of the type defined for this derived class.
*/
void initialize();
}; };
#endif #endif

View File

@ -13,14 +13,12 @@
// 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: Dialog.cxx,v 1.51 2006-12-08 20:19:58 stephena Exp $ // $Id: Dialog.cxx,v 1.52 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
//============================================================================ //============================================================================
#include <SDL.h>
#include "OSystem.hxx" #include "OSystem.hxx"
#include "FrameBuffer.hxx" #include "FrameBuffer.hxx"
#include "Menu.hxx" #include "Menu.hxx"
@ -46,6 +44,7 @@ Dialog::Dialog(OSystem* instance, DialogContainer* parent,
_okWidget(0), _okWidget(0),
_cancelWidget(0), _cancelWidget(0),
_visible(true), _visible(true),
_center(true),
_ourTab(NULL), _ourTab(NULL),
_focusID(0) _focusID(0)
{ {
@ -87,6 +86,17 @@ void Dialog::close()
parent()->removeDialog(); parent()->removeDialog();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::center()
{
FrameBuffer& fb = instance()->frameBuffer();
if(_center && &fb)
{
_x = (fb.baseWidth() - _w) / 2;
_y = (fb.baseHeight() - _h) / 2;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::releaseFocus() void Dialog::releaseFocus()
{ {

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: Dialog.hxx,v 1.32 2006-12-08 16:49:33 stephena Exp $ // $Id: Dialog.hxx,v 1.33 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -36,7 +36,7 @@ class TabWidget;
This is the base class for all dialog boxes. This is the base class for all dialog boxes.
@author Stephen Anthony @author Stephen Anthony
@version $Id: Dialog.hxx,v 1.32 2006-12-08 16:49:33 stephena Exp $ @version $Id: Dialog.hxx,v 1.33 2006-12-30 22:26:29 stephena Exp $
*/ */
class Dialog : public GuiObject class Dialog : public GuiObject
{ {
@ -58,6 +58,7 @@ class Dialog : public GuiObject
virtual void open(); virtual void open();
virtual void close(); virtual void close();
virtual void center();
virtual void drawDialog(); virtual void drawDialog();
virtual void loadConfig() {} virtual void loadConfig() {}
virtual void saveConfig() {} virtual void saveConfig() {}
@ -70,6 +71,7 @@ class Dialog : public GuiObject
void addOKWidget(Widget* w) { _okWidget = w; } void addOKWidget(Widget* w) { _okWidget = w; }
void addCancelWidget(Widget* w) { _cancelWidget = w; } void addCancelWidget(Widget* w) { _cancelWidget = w; }
void setFocus(Widget* w); void setFocus(Widget* w);
void setCenter(bool state) { _center = state; }
protected: protected:
virtual void draw(); virtual void draw();
@ -107,6 +109,7 @@ class Dialog : public GuiObject
Widget* _okWidget; Widget* _okWidget;
Widget* _cancelWidget; Widget* _cancelWidget;
bool _visible; bool _visible;
bool _center;
private: private:
FocusList _ourFocusList; FocusList _ourFocusList;

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: DialogContainer.cxx,v 1.34 2006-12-08 16:49:33 stephena Exp $ // $Id: DialogContainer.cxx,v 1.35 2006-12-30 22:26:29 stephena Exp $
//============================================================================ //============================================================================
#include "OSystem.hxx" #include "OSystem.hxx"
@ -111,6 +111,7 @@ void DialogContainer::addDialog(Dialog* d)
{ {
myDialogStack.push(d); myDialogStack.push(d);
d->center();
d->open(); d->open();
d->setDirty(); // Next update() will take care of drawing d->setDirty(); // Next update() will take care of drawing
} }

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: DialogContainer.hxx,v 1.19 2006-12-08 16:49:33 stephena Exp $ // $Id: DialogContainer.hxx,v 1.20 2006-12-30 22:26:29 stephena Exp $
//============================================================================ //============================================================================
#ifndef DIALOG_CONTAINER_HXX #ifndef DIALOG_CONTAINER_HXX
@ -36,7 +36,7 @@ class OSystem;
a stack, and handles their events. a stack, and handles their events.
@author Stephen Anthony @author Stephen Anthony
@version $Id: DialogContainer.hxx,v 1.19 2006-12-08 16:49:33 stephena Exp $ @version $Id: DialogContainer.hxx,v 1.20 2006-12-30 22:26:29 stephena Exp $
*/ */
class DialogContainer class DialogContainer
{ {
@ -124,30 +124,34 @@ class DialogContainer
void draw(); void draw();
/** /**
Add a dialog box to the stack Add a dialog box to the stack.
*/ */
void addDialog(Dialog* d); void addDialog(Dialog* d);
/** /**
Remove the topmost dialog box from the stack Remove the topmost dialog box from the stack.
*/ */
void removeDialog(); void removeDialog();
/** /**
Reset dialog stack to the main configuration menu Reset dialog stack to the main configuration menu.
*/ */
void reStack(); void reStack();
/** /**
Redraw all dialogs on the stack Redraw all dialogs on the stack.
*/ */
void refresh() { myRefreshFlag = true; } void refresh() { myRefreshFlag = true; }
/** /**
(Re)initialize the menuing system. This is necessary if a new Console Return the bottom-most dialog of this container.
has been loaded, since in most cases the screen dimensions will have changed.
*/ */
virtual void initialize() = 0; const Dialog* baseDialog() const { return myBaseDialog; }
/**
(Re)initialize the menuing system. This isn't necessary in most cases.
*/
virtual void initialize() {}
private: private:
void reset(); void reset();

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: LauncherOptionsDialog.cxx,v 1.20 2006-12-08 16:49:35 stephena Exp $ // $Id: FileSnapDialog.cxx,v 1.1 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -21,21 +21,21 @@
#include "DialogContainer.hxx" #include "DialogContainer.hxx"
#include "BrowserDialog.hxx" #include "BrowserDialog.hxx"
#include "PopUpWidget.hxx"
#include "TabWidget.hxx" #include "TabWidget.hxx"
#include "FSNode.hxx" #include "FSNode.hxx"
#include "bspf.hxx" #include "bspf.hxx"
#include "LauncherDialog.hxx" #include "LauncherDialog.hxx"
#include "LauncherOptionsDialog.hxx" #include "FileSnapDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherOptionsDialog::LauncherOptionsDialog( FileSnapDialog::FileSnapDialog(
OSystem* osystem, DialogContainer* parent, OSystem* osystem, DialogContainer* parent,
const GUI::Font& font, GuiObject* boss, const GUI::Font& font, GuiObject* boss,
int x, int y, int w, int h) int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h), : Dialog(osystem, parent, x, y, w, h),
CommandSender(boss), CommandSender(boss),
myBrowser(NULL) myBrowser(NULL),
myIsGlobal(boss != 0)
{ {
const int vBorder = 4; const int vBorder = 4;
int xpos, ypos, bwidth, bheight; int xpos, ypos, bwidth, bheight;
@ -51,9 +51,9 @@ LauncherOptionsDialog::LauncherOptionsDialog(
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - 2*bheight - ypos); myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - 2*bheight - ypos);
addTabWidget(myTab); addTabWidget(myTab);
// 1) The ROM locations tab // 1) The browser settings tab
wid.clear(); wid.clear();
tabID = myTab->addTab("ROM Settings"); tabID = myTab->addTab("Browser Settings");
// ROM path // ROM path
xpos = 15; ypos += 5; xpos = 15; ypos += 5;
@ -80,6 +80,16 @@ LauncherOptionsDialog::LauncherOptionsDialog(
// myReloadButton->setEditable(true); // myReloadButton->setEditable(true);
wid.push_back(myReloadButton); wid.push_back(myReloadButton);
// ROM settings are disabled while in game mode
if(!myIsGlobal)
{
myTab->disableTab(0);
// TODO - until I get the above method working, we also need to
// disable the specific widgets ourself
myRomPath->clearFlags(WIDGET_ENABLED);
for(unsigned int i = 0; i < wid.size(); ++i)
wid[i]->clearFlags(WIDGET_ENABLED);
}
// Add focus widgets for ROM tab // Add focus widgets for ROM tab
addToFocusList(wid, tabID); addToFocusList(wid, tabID);
@ -134,19 +144,17 @@ LauncherOptionsDialog::LauncherOptionsDialog(
addToFocusList(wid); addToFocusList(wid);
// Create file browser dialog // Create file browser dialog
int baseW = instance()->frameBuffer().baseWidth(); myBrowser = new BrowserDialog(this, font, 60, 20, 200, 200);
int baseH = instance()->frameBuffer().baseHeight();
myBrowser = new BrowserDialog(this, font, 60, 20, baseW - 120, baseH - 40);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherOptionsDialog::~LauncherOptionsDialog() FileSnapDialog::~FileSnapDialog()
{ {
delete myBrowser; delete myBrowser;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherOptionsDialog::loadConfig() void FileSnapDialog::loadConfig()
{ {
string s; string s;
bool b; bool b;
@ -168,7 +176,7 @@ void LauncherOptionsDialog::loadConfig()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherOptionsDialog::saveConfig() void FileSnapDialog::saveConfig()
{ {
string s; string s;
bool b; bool b;
@ -190,27 +198,27 @@ void LauncherOptionsDialog::saveConfig()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherOptionsDialog::openRomBrowser() void FileSnapDialog::openRomBrowser()
{ {
parent()->addDialog(myBrowser);
myBrowser->setTitle("Select ROM directory:"); myBrowser->setTitle("Select ROM directory:");
myBrowser->setEmitSignal(kRomDirChosenCmd); myBrowser->setEmitSignal(kRomDirChosenCmd);
myBrowser->setStartPath(myRomPath->getLabel()); myBrowser->setStartPath(myRomPath->getLabel());
parent()->addDialog(myBrowser);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherOptionsDialog::openSnapBrowser() void FileSnapDialog::openSnapBrowser()
{ {
parent()->addDialog(myBrowser);
myBrowser->setTitle("Select snapshot directory:"); myBrowser->setTitle("Select snapshot directory:");
myBrowser->setEmitSignal(kSnapDirChosenCmd); myBrowser->setEmitSignal(kSnapDirChosenCmd);
myBrowser->setStartPath(mySnapPath->getLabel()); myBrowser->setStartPath(mySnapPath->getLabel());
parent()->addDialog(myBrowser);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherOptionsDialog::handleCommand(CommandSender* sender, int cmd, void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
int data, int id) int data, int id)
{ {
switch (cmd) switch (cmd)
@ -218,8 +226,11 @@ void LauncherOptionsDialog::handleCommand(CommandSender* sender, int cmd,
case kOKCmd: case kOKCmd:
saveConfig(); saveConfig();
close(); close();
if(myIsGlobal)
{
sendCommand(kBrowseChangedCmd, 0, 0); // Call this before refreshing ROMs sendCommand(kBrowseChangedCmd, 0, 0); // Call this before refreshing ROMs
sendCommand(kRomDirChosenCmd, 0, 0); // Let the boss know romdir has changed sendCommand(kRomDirChosenCmd, 0, 0); // Let the boss know romdir has changed
}
break; break;
case kChooseRomDirCmd: case kChooseRomDirCmd:
@ -230,12 +241,6 @@ void LauncherOptionsDialog::handleCommand(CommandSender* sender, int cmd,
openSnapBrowser(); openSnapBrowser();
break; break;
/*
case kBrowseDirCmd:
myReloadButton->setEnabled(!myBrowseCheckbox->getState());
break;
*/
case kRomDirChosenCmd: case kRomDirChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());

View File

@ -13,14 +13,14 @@
// 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: LauncherOptionsDialog.hxx,v 1.12 2006-12-08 16:49:35 stephena Exp $ // $Id: FileSnapDialog.hxx,v 1.1 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
//============================================================================ //============================================================================
#ifndef LAUNCHER_OPTIONS_DIALOG_HXX #ifndef FILE_SNAP_DIALOG_HXX
#define LAUNCHER_OPTIONS_DIALOG_HXX #define FILE_SNAP_DIALOG_HXX
class OSystem; class OSystem;
class GuiObject; class GuiObject;
@ -34,13 +34,13 @@ class TabWidget;
#include "Dialog.hxx" #include "Dialog.hxx"
#include "Command.hxx" #include "Command.hxx"
class LauncherOptionsDialog : public Dialog, public CommandSender class FileSnapDialog : public Dialog, public CommandSender
{ {
public: public:
LauncherOptionsDialog(OSystem* osystem, DialogContainer* parent, FileSnapDialog(OSystem* osystem, DialogContainer* parent,
const GUI::Font& font, GuiObject* boss, const GUI::Font& font, GuiObject* boss,
int x, int y, int w, int h); int x, int y, int w, int h);
~LauncherOptionsDialog(); ~FileSnapDialog();
virtual void loadConfig(); virtual void loadConfig();
virtual void saveConfig(); virtual void saveConfig();
@ -69,6 +69,9 @@ class LauncherOptionsDialog : public Dialog, public CommandSender
// Snapshot controls // Snapshot controls
StaticTextWidget* mySnapPath; StaticTextWidget* mySnapPath;
CheckboxWidget* mySnapSingleCheckbox; CheckboxWidget* mySnapSingleCheckbox;
// Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal;
}; };
#endif #endif

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: GameInfoDialog.cxx,v 1.34 2006-12-26 02:09:29 stephena Exp $ // $Id: GameInfoDialog.cxx,v 1.35 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -332,9 +332,12 @@ GameInfoDialog::~GameInfoDialog()
void GameInfoDialog::loadConfig() void GameInfoDialog::loadConfig()
{ {
myDefaultsSelected = false; myDefaultsSelected = false;
if(&myOSystem->console())
{
myGameProperties = myOSystem->console().properties(); myGameProperties = myOSystem->console().properties();
loadView(); loadView();
} }
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void GameInfoDialog::loadView() void GameInfoDialog::loadView()

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: LauncherDialog.cxx,v 1.62 2006-12-22 22:32:49 stephena Exp $ // $Id: LauncherDialog.cxx,v 1.63 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -34,7 +34,7 @@
#include "GuiUtils.hxx" #include "GuiUtils.hxx"
#include "BrowserDialog.hxx" #include "BrowserDialog.hxx"
#include "ProgressDialog.hxx" #include "ProgressDialog.hxx"
#include "LauncherOptionsDialog.hxx" #include "OptionsDialog.hxx"
#include "LauncherDialog.hxx" #include "LauncherDialog.hxx"
#include "bspf.hxx" #include "bspf.hxx"
@ -131,10 +131,8 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
#endif #endif
mySelectedItem = 0; // Highlight 'Rom Listing' mySelectedItem = 0; // Highlight 'Rom Listing'
// Create the launcher options dialog, where you can change ROM // Create an options dialog, similar to the in-game one
// and snapshot paths myOptions = new OptionsDialog(osystem, parent, this, true); // not in game mode
myOptions = new LauncherOptionsDialog(osystem, parent, font, this,
20, 60, _w - 40, _h - 120);
// Create a game list, which contains all the information about a ROM that // Create a game list, which contains all the information about a ROM that
// the launcher needs // the launcher needs
@ -184,17 +182,7 @@ void LauncherDialog::updateListing(bool fullReload)
myGameList->clear(); myGameList->clear();
myNote->setLabel(""); myNote->setLabel("");
// If this is the first time using Stella, the romdir won't be set.
// In that case, display the options dialog, and don't let Stella proceed
// until the options are set.
string romdir = instance()->settings().getString("romdir"); string romdir = instance()->settings().getString("romdir");
if(romdir == "")
{
myOptionsButton->setEnabled(true);
myQuitButton->setEnabled(true);
parent()->addDialog(myOptions);
return;
}
// If in ROM browse mode, just load the current directory and // If in ROM browse mode, just load the current directory and
// don't translate by md5sum at all // don't translate by md5sum at all

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: LauncherDialog.hxx,v 1.22 2006-12-08 16:49:35 stephena Exp $ // $Id: LauncherDialog.hxx,v 1.23 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -23,7 +23,7 @@
#define LAUNCHER_DIALOG_HXX #define LAUNCHER_DIALOG_HXX
class DialogContainer; class DialogContainer;
class LauncherOptionsDialog; class OptionsDialog;
class ProgressDialog; class ProgressDialog;
class CommandSender; class CommandSender;
class StaticTextWidget; class StaticTextWidget;
@ -69,7 +69,7 @@ class LauncherDialog : public Dialog
StaticTextWidget* myRomCount; StaticTextWidget* myRomCount;
GameList* myGameList; GameList* myGameList;
LauncherOptionsDialog* myOptions; OptionsDialog* myOptions;
ProgressDialog* myProgressBar; ProgressDialog* myProgressBar;
private: private:

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: Menu.cxx,v 1.14 2006-12-08 16:49:36 stephena Exp $ // $Id: Menu.cxx,v 1.15 2006-12-30 22:26:29 stephena Exp $
//============================================================================ //============================================================================
#include "Dialog.hxx" #include "Dialog.hxx"
@ -27,16 +27,10 @@ class Properties;
Menu::Menu(OSystem* osystem) Menu::Menu(OSystem* osystem)
: DialogContainer(osystem) : DialogContainer(osystem)
{ {
myBaseDialog = new OptionsDialog(myOSystem, this, 0, false); // in game mode
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Menu::~Menu() Menu::~Menu()
{ {
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Menu::initialize()
{
delete myBaseDialog;
myBaseDialog = new OptionsDialog(myOSystem, this);
}

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: Menu.hxx,v 1.13 2006-12-08 16:49:36 stephena Exp $ // $Id: Menu.hxx,v 1.14 2006-12-30 22:26:29 stephena Exp $
//============================================================================ //============================================================================
#ifndef MENU_HXX #ifndef MENU_HXX
@ -27,7 +27,7 @@ class OSystem;
The base dialog for all configuration menus in Stella. The base dialog for all configuration menus in Stella.
@author Stephen Anthony @author Stephen Anthony
@version $Id: Menu.hxx,v 1.13 2006-12-08 16:49:36 stephena Exp $ @version $Id: Menu.hxx,v 1.14 2006-12-30 22:26:29 stephena Exp $
*/ */
class Menu : public DialogContainer class Menu : public DialogContainer
{ {
@ -41,11 +41,6 @@ class Menu : public DialogContainer
Destructor Destructor
*/ */
virtual ~Menu(); virtual ~Menu();
/**
Updates the basedialog to be of the type defined for this derived class.
*/
void initialize();
}; };
#endif #endif

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: OptionsDialog.cxx,v 1.45 2006-12-08 16:49:36 stephena Exp $ // $Id: OptionsDialog.cxx,v 1.46 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -27,6 +27,8 @@
#include "VideoDialog.hxx" #include "VideoDialog.hxx"
#include "AudioDialog.hxx" #include "AudioDialog.hxx"
#include "InputDialog.hxx" #include "InputDialog.hxx"
//#include "UIDialog.hxx"
#include "FileSnapDialog.hxx"
#include "GameInfoDialog.hxx" #include "GameInfoDialog.hxx"
#include "HelpDialog.hxx" #include "HelpDialog.hxx"
#include "AboutDialog.hxx" #include "AboutDialog.hxx"
@ -38,50 +40,29 @@
#include "bspf.hxx" #include "bspf.hxx"
enum {
kVidCmd = 'VIDO',
kAudCmd = 'AUDO',
kInptCmd = 'INPT',
kInfoCmd = 'INFO',
kHelpCmd = 'HELP',
kAboutCmd = 'ABOU',
kExitCmd = 'EXIM',
kCheatCmd = 'CHET'
};
enum {
kRowHeight = 22,
kBigButtonWidth = 90,
kMainMenuWidth = (kBigButtonWidth + 2 * 8),
kMainMenuHeight = 8 * kRowHeight + 10,
};
#define addBigButton(label, cmd) \ #define addBigButton(label, cmd) \
new ButtonWidget(this, font, xoffset, yoffset, kBigButtonWidth, 18, label, cmd); yoffset += kRowHeight new ButtonWidget(this, font, xoffset, yoffset, kBigButtonWidth, 18, label, cmd); yoffset += kRowHeight
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent) OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
GuiObject* boss, bool global)
: Dialog(osystem, parent, 0, 0, kMainMenuWidth, kMainMenuHeight), : Dialog(osystem, parent, 0, 0, kMainMenuWidth, kMainMenuHeight),
myVideoDialog(NULL), myVideoDialog(NULL),
myAudioDialog(NULL), myAudioDialog(NULL),
myInputDialog(NULL), myInputDialog(NULL),
myUIDialog(NULL),
myFileSnapDialog(NULL),
myGameInfoDialog(NULL), myGameInfoDialog(NULL),
myCheatCodeDialog(NULL), myCheatCodeDialog(NULL),
myHelpDialog(NULL), myHelpDialog(NULL),
myAboutDialog(NULL) myAboutDialog(NULL),
myIsGlobal(global)
{ {
int yoffset = 7;
const int xoffset = (_w - kBigButtonWidth) / 2;
const int fbWidth = osystem->frameBuffer().baseWidth(),
fbHeight = osystem->frameBuffer().baseHeight();
const GUI::Font& font = instance()->font(); // FIXME - change reference to optionsFont() const GUI::Font& font = instance()->font(); // FIXME - change reference to optionsFont()
int xoffset = 10, yoffset = 10;
WidgetArray wid; WidgetArray wid;
ButtonWidget* b = NULL; ButtonWidget* b = NULL;
// Set actual dialog dimensions
_x = (fbWidth - kMainMenuWidth) / 2;
_y = (fbHeight - kMainMenuHeight) / 2;
b = addBigButton("Video Settings", kVidCmd); b = addBigButton("Video Settings", kVidCmd);
wid.push_back(b); wid.push_back(b);
@ -94,15 +75,24 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent)
b = addBigButton("Input Settings", kInptCmd); b = addBigButton("Input Settings", kInptCmd);
wid.push_back(b); wid.push_back(b);
b = addBigButton("Game Properties", kInfoCmd); b = addBigButton("UI Settings", kUsrIfaceCmd);
wid.push_back(b); wid.push_back(b);
b = addBigButton("Cheat Code", kCheatCmd); b = addBigButton("Files & Snapshots", kFileSnapCmd);
#ifndef CHEATCODE_SUPPORT
b->clearFlags(WIDGET_ENABLED);
#endif
wid.push_back(b); wid.push_back(b);
// Move to second column
xoffset += kBigButtonWidth + 10; yoffset = 10;
myGameInfoButton = addBigButton("Game Properties", kInfoCmd);
wid.push_back(myGameInfoButton);
myCheatCodeButton = addBigButton("Cheat Code", kCheatCmd);
#ifndef CHEATCODE_SUPPORT
myCheatCodeButton->clearFlags(WIDGET_ENABLED);
#endif
wid.push_back(myCheatCodeButton);
b = addBigButton("Help", kHelpCmd); b = addBigButton("Help", kHelpCmd);
wid.push_back(b); wid.push_back(b);
@ -114,40 +104,49 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent)
addCancelWidget(b); addCancelWidget(b);
// Set some sane values for the dialog boxes // Set some sane values for the dialog boxes
int x, y, w, h; int x = 0, y = 0, w, h;
// Now create all the dialogs attached to each menu button // Now create all the dialogs attached to each menu button
w = 230; h = 135; w = 230; h = 135;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myVideoDialog = new VideoDialog(myOSystem, parent, font, x, y, w, h); myVideoDialog = new VideoDialog(myOSystem, parent, font, x, y, w, h);
w = 200; h = 140; w = 200; h = 140;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myAudioDialog = new AudioDialog(myOSystem, parent, font, x, y, w, h); myAudioDialog = new AudioDialog(myOSystem, parent, font, x, y, w, h);
w = 230; h = 185; w = 230; h = 185;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myInputDialog = new InputDialog(myOSystem, parent, font, x, y, w, h); myInputDialog = new InputDialog(myOSystem, parent, font, x, y, w, h);
w = 230; h = 185;
myInputDialog = new InputDialog(myOSystem, parent, font, x, y, w, h);
w = 280; h = 120;
myFileSnapDialog = new FileSnapDialog(myOSystem, parent, font,
boss, x, y, w, h);
w = 255; h = 190; w = 255; h = 190;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myGameInfoDialog = new GameInfoDialog(myOSystem, parent, font, this, x, y, w, h); myGameInfoDialog = new GameInfoDialog(myOSystem, parent, font, this, x, y, w, h);
#ifdef CHEATCODE_SUPPORT #ifdef CHEATCODE_SUPPORT
w = 230; h = 150; w = 230; h = 150;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myCheatCodeDialog = new CheatCodeDialog(myOSystem, parent, font, x, y, w, h); myCheatCodeDialog = new CheatCodeDialog(myOSystem, parent, font, x, y, w, h);
#endif #endif
w = 255; h = 150; w = 255; h = 150;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myHelpDialog = new HelpDialog(myOSystem, parent, font, x, y, w, h); myHelpDialog = new HelpDialog(myOSystem, parent, font, x, y, w, h);
w = 255; h = 150; w = 255; h = 150;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myAboutDialog = new AboutDialog(myOSystem, parent, font, x, y, w, h); myAboutDialog = new AboutDialog(myOSystem, parent, font, x, y, w, h);
addToFocusList(wid); addToFocusList(wid);
// Certain buttons are always disabled while in game mode
if(myIsGlobal)
{
myGameInfoButton->clearFlags(WIDGET_ENABLED);
myCheatCodeButton->clearFlags(WIDGET_ENABLED);
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -156,22 +155,14 @@ OptionsDialog::~OptionsDialog()
delete myVideoDialog; delete myVideoDialog;
delete myAudioDialog; delete myAudioDialog;
delete myInputDialog; delete myInputDialog;
// delete myUIDialog;
delete myFileSnapDialog;
delete myGameInfoDialog; delete myGameInfoDialog;
delete myCheatCodeDialog; delete myCheatCodeDialog;
delete myHelpDialog; delete myHelpDialog;
delete myAboutDialog; delete myAboutDialog;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OptionsDialog::checkBounds(int width, int height,
int* x, int* y, int* w, int* h)
{
if(*w > width) *w = width;
if(*h > height) *h = height;
*x = (width - *w) / 2;
*y = (height - *h) / 2;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OptionsDialog::handleCommand(CommandSender* sender, int cmd, void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
int data, int id) int data, int id)
@ -190,6 +181,15 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
parent()->addDialog(myInputDialog); parent()->addDialog(myInputDialog);
break; break;
case kUsrIfaceCmd:
// parent()->addDialog(myGameInfoDialog);
cerr << "UI dialog\n";
break;
case kFileSnapCmd:
parent()->addDialog(myFileSnapDialog);
break;
case kInfoCmd: case kInfoCmd:
parent()->addDialog(myGameInfoDialog); parent()->addDialog(myGameInfoDialog);
break; break;
@ -209,6 +209,9 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
break; break;
case kExitCmd: case kExitCmd:
if(myIsGlobal)
close();
else
instance()->eventHandler().leaveMenuMode(); instance()->eventHandler().leaveMenuMode();
break; break;

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: OptionsDialog.hxx,v 1.20 2006-12-08 16:49:36 stephena Exp $ // $Id: OptionsDialog.hxx,v 1.21 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -24,8 +24,12 @@
class CommandSender; class CommandSender;
class DialogContainer; class DialogContainer;
class GuiObject;
class VideoDialog;
class AudioDialog; class AudioDialog;
class InputDialog; class InputDialog;
class UIDialog;
class FileSnapDialog;
class GameInfoDialog; class GameInfoDialog;
class CheatCodeDialog; class CheatCodeDialog;
class HelpDialog; class HelpDialog;
@ -33,13 +37,13 @@ class AboutDialog;
class OSystem; class OSystem;
#include "Dialog.hxx" #include "Dialog.hxx"
#include "GameInfoDialog.hxx"
#include "bspf.hxx" #include "bspf.hxx"
class OptionsDialog : public Dialog class OptionsDialog : public Dialog
{ {
public: public:
OptionsDialog(OSystem* osystem, DialogContainer* parent); OptionsDialog(OSystem* osystem, DialogContainer* parent, GuiObject* boss,
bool global);
virtual ~OptionsDialog(); virtual ~OptionsDialog();
private: private:
@ -50,10 +54,38 @@ class OptionsDialog : public Dialog
VideoDialog* myVideoDialog; VideoDialog* myVideoDialog;
AudioDialog* myAudioDialog; AudioDialog* myAudioDialog;
InputDialog* myInputDialog; InputDialog* myInputDialog;
UIDialog* myUIDialog;
FileSnapDialog* myFileSnapDialog;
GameInfoDialog* myGameInfoDialog; GameInfoDialog* myGameInfoDialog;
CheatCodeDialog* myCheatCodeDialog; CheatCodeDialog* myCheatCodeDialog;
HelpDialog* myHelpDialog; HelpDialog* myHelpDialog;
AboutDialog* myAboutDialog; AboutDialog* myAboutDialog;
ButtonWidget* myGameInfoButton;
ButtonWidget* myCheatCodeButton;
// Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal;
enum {
kVidCmd = 'VIDO',
kAudCmd = 'AUDO',
kInptCmd = 'INPT',
kUsrIfaceCmd = 'URIF',
kFileSnapCmd = 'FLSN',
kInfoCmd = 'INFO',
kCheatCmd = 'CHET',
kHelpCmd = 'HELP',
kAboutCmd = 'ABOU',
kExitCmd = 'EXIM'
};
enum {
kRowHeight = 22,
kBigButtonWidth = 90,
kMainMenuWidth = (2*kBigButtonWidth + 30),
kMainMenuHeight = 5*kRowHeight + 20
};
}; };
#endif #endif

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: PopUpWidget.cxx,v 1.30 2006-12-08 20:19:58 stephena Exp $ // $Id: PopUpWidget.cxx,v 1.31 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -68,7 +68,6 @@ void PopUpDialog::drawDialog()
{ {
FrameBuffer& fb = instance()->frameBuffer(); FrameBuffer& fb = instance()->frameBuffer();
//cerr << "PopUpDialog::drawDialog()\n";
// Draw the menu border // Draw the menu border
fb.hLine(_x, _y, _x + _w - 1, kColor); fb.hLine(_x, _y, _x + _w - 1, kColor);
fb.hLine(_x, _y + _h - 1, _x + _w - 1, kShadowColor); fb.hLine(_x, _y + _h - 1, _x + _w - 1, kShadowColor);
@ -200,7 +199,6 @@ void PopUpDialog::handleEvent(Event::Type e)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PopUpDialog::drawMenuEntry(int entry, bool hilite) void PopUpDialog::drawMenuEntry(int entry, bool hilite)
{ {
//cerr << "PopUpDialog::drawMenuEntry\n";
FrameBuffer& fb = instance()->frameBuffer(); FrameBuffer& fb = instance()->frameBuffer();
// Draw one entry of the popup menu, including selection // Draw one entry of the popup menu, including selection
@ -253,6 +251,9 @@ void PopUpDialog::recalc()
// Perform clipping / switch to scrolling mode if we don't fit on the screen // Perform clipping / switch to scrolling mode if we don't fit on the screen
const int height = instance()->frameBuffer().baseHeight(); const int height = instance()->frameBuffer().baseHeight();
_x = _popUpBoss->getAbsX() + _popUpBoss->_labelWidth;
_y = _popUpBoss->getAbsY() + _popUpBoss->getHeight();
_h = _popUpBoss->_entries.size() * _popUpBoss->_fontHeight + 2; _h = _popUpBoss->_entries.size() * _popUpBoss->_fontHeight + 2;
// HACK: For now, we do not do scrolling. Instead, we draw the dialog // HACK: For now, we do not do scrolling. Instead, we draw the dialog
@ -484,11 +485,6 @@ void PopUpWidget::appendEntry(const string& entry, int tag)
e.name = entry; e.name = entry;
e.tag = tag; e.tag = tag;
_entries.push_back(e); _entries.push_back(e);
// Each time an entry is added, the popup dialog gets larger
// This isn't as efficient as it could be, since it's called
// each time an entry is added (which can be dozens of times).
myPopUpDialog->recalc();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: PopUpWidget.hxx,v 1.15 2006-12-08 16:49:36 stephena Exp $ // $Id: PopUpWidget.hxx,v 1.16 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -107,6 +107,7 @@ class PopUpDialog : public Dialog
PopUpDialog(PopUpWidget* boss, int clickX, int clickY); PopUpDialog(PopUpWidget* boss, int clickX, int clickY);
void drawDialog(); void drawDialog();
void center() { recalc(); }
protected: protected:
void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount);

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: TabWidget.cxx,v 1.23 2006-12-08 16:49:37 stephena Exp $ // $Id: TabWidget.cxx,v 1.24 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -69,6 +69,7 @@ int TabWidget::addTab(const string& title)
newTab.title = title; newTab.title = title;
newTab.firstWidget = NULL; newTab.firstWidget = NULL;
newTab.parentWidget = NULL; newTab.parentWidget = NULL;
newTab.enabled = true;
_tabs.push_back(newTab); _tabs.push_back(newTab);
@ -108,6 +109,15 @@ void TabWidget::setActiveTab(int tabID, bool show)
sendCommand(kTabChangedCmd, _activeTab, -1); sendCommand(kTabChangedCmd, _activeTab, -1);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TabWidget::disableTab(int tabID)
{
assert(0 <= tabID && tabID < (int)_tabs.size());
_tabs[tabID].enabled = false;
// TODO - alsa disable all widgets belonging to this tab
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TabWidget::updateActiveTab() void TabWidget::updateActiveTab()
{ {
@ -255,12 +265,13 @@ void TabWidget::drawWidget(bool hilite)
int i, x = _x + kTabLeftOffset; int i, x = _x + kTabLeftOffset;
for (i = 0; i < (int)_tabs.size(); ++i) for (i = 0; i < (int)_tabs.size(); ++i)
{ {
int color = (i == _activeTab) ? kColor : kShadowColor; int fontcolor = _tabs[i].enabled ? kTextColor : kColor;
int boxcolor = (i == _activeTab) ? kColor : kShadowColor;
int yOffset = (i == _activeTab) ? 0 : 2; int yOffset = (i == _activeTab) ? 0 : 2;
box(x, _y + yOffset, _tabWidth, _tabHeight - yOffset, color, color, (i == _activeTab)); box(x, _y + yOffset, _tabWidth, _tabHeight - yOffset, boxcolor, boxcolor, (i == _activeTab));
fb.drawString(_font, _tabs[i].title, x + kTabPadding, fb.drawString(_font, _tabs[i].title, x + kTabPadding,
_y + yOffset / 2 + (_tabHeight - _fontHeight - 1), _y + yOffset / 2 + (_tabHeight - _fontHeight - 1),
_tabWidth - 2 * kTabPadding, kTextColor, kTextAlignCenter); _tabWidth - 2 * kTabPadding, fontcolor, kTextAlignCenter);
x += _tabWidth + kTabSpacing; x += _tabWidth + kTabSpacing;
} }

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: TabWidget.hxx,v 1.14 2006-12-08 16:49:37 stephena Exp $ // $Id: TabWidget.hxx,v 1.15 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -34,6 +34,7 @@ class TabWidget : public Widget, public CommandSender
string title; string title;
Widget* firstWidget; Widget* firstWidget;
Widget* parentWidget; Widget* parentWidget;
bool enabled;
}; };
typedef Common::Array<Tab> TabList; typedef Common::Array<Tab> TabList;
@ -54,6 +55,7 @@ class TabWidget : public Widget, public CommandSender
//void removeTab(int tabID); //void removeTab(int tabID);
// Setting the active tab: // Setting the active tab:
void setActiveTab(int tabID, bool show = false); void setActiveTab(int tabID, bool show = false);
void disableTab(int tabID);
void activateTabs(); void activateTabs();
void cycleTab(int direction); void cycleTab(int direction);
// setActiveTab changes the value of _firstWidget. This means Widgets added afterwards // setActiveTab changes the value of _firstWidget. This means Widgets added afterwards

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: VideoDialog.cxx,v 1.39 2006-12-28 20:40:01 stephena Exp $ // $Id: VideoDialog.cxx,v 1.40 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -45,25 +45,15 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
pwidth = font.getStringWidth("Software"); pwidth = font.getStringWidth("Software");
WidgetArray wid; WidgetArray wid;
// Use dirty rectangle updates
xpos = 5; ypos = 10; xpos = 5; ypos = 10;
myDirtyPopup = new PopUpWidget(this, font, xpos, ypos,
pwidth, lineHeight, "Dirty Rects: ", lwidth);
myDirtyPopup->appendEntry("Yes", 1);
myDirtyPopup->appendEntry("No", 2);
wid.push_back(myDirtyPopup);
ypos += lineHeight + 4;
// Video renderer // Video renderer
myRendererPopup = new PopUpWidget(this, font, xpos, ypos, myRendererPopup = new PopUpWidget(this, font, xpos, ypos,
pwidth, lineHeight, "Renderer: ", lwidth, pwidth, lineHeight, "Renderer: ", lwidth,
kRendererChanged); kRendererChanged);
myRendererPopup->appendEntry("Software", 1); myRendererPopup->appendEntry("Software", 1);
#ifdef PSP
myRendererPopup->appendEntry("Hardware", 2);
#endif
#ifdef DISPLAY_OPENGL #ifdef DISPLAY_OPENGL
myRendererPopup->appendEntry("OpenGL", 3); myRendererPopup->appendEntry("OpenGL", 2);
#endif #endif
wid.push_back(myRendererPopup); wid.push_back(myRendererPopup);
ypos += lineHeight + 4; ypos += lineHeight + 4;
@ -98,16 +88,27 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
wid.push_back(myPalettePopup); wid.push_back(myPalettePopup);
ypos += lineHeight + 4; ypos += lineHeight + 4;
// Available scalers // Available TIA scalers
myScalerPopup = new PopUpWidget(this, font, xpos, ypos, pwidth, myTIAScalerPopup = new PopUpWidget(this, font, xpos, ypos, pwidth,
lineHeight, "Scaler: ", lwidth); lineHeight, "TIA Scaler: ", lwidth);
myScalerPopup->appendEntry("Zoom1x", 1); myTIAScalerPopup->appendEntry("Zoom1x", 1);
myScalerPopup->appendEntry("Zoom2x", 2); myTIAScalerPopup->appendEntry("Zoom2x", 2);
myScalerPopup->appendEntry("Zoom3x", 3); myTIAScalerPopup->appendEntry("Zoom3x", 3);
myScalerPopup->appendEntry("Zoom4x", 4); myTIAScalerPopup->appendEntry("Zoom4x", 4);
myScalerPopup->appendEntry("Zoom5x", 5); myTIAScalerPopup->appendEntry("Zoom5x", 5);
myScalerPopup->appendEntry("Zoom6x", 6); myTIAScalerPopup->appendEntry("Zoom6x", 6);
wid.push_back(myScalerPopup); wid.push_back(myTIAScalerPopup);
ypos += lineHeight + 4;
myUIScalerPopup = new PopUpWidget(this, font, xpos, ypos, pwidth,
lineHeight, "UI Scaler: ", lwidth);
myUIScalerPopup->appendEntry("Zoom1x", 1);
myUIScalerPopup->appendEntry("Zoom2x", 2);
myUIScalerPopup->appendEntry("Zoom3x", 3);
myUIScalerPopup->appendEntry("Zoom4x", 4);
myUIScalerPopup->appendEntry("Zoom5x", 5);
myUIScalerPopup->appendEntry("Zoom6x", 6);
wid.push_back(myUIScalerPopup);
// Move over to the next column // Move over to the next column
xpos += 115; ypos = 10; xpos += 115; ypos = 10;
@ -130,6 +131,18 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
wid.push_back(myFullscreenCheckbox); wid.push_back(myFullscreenCheckbox);
ypos += lineHeight + 4; ypos += lineHeight + 4;
// PAL color-loss effect
myColorLossCheckbox = new CheckboxWidget(this, font, xpos + 5, ypos,
"PAL color-loss");
wid.push_back(myColorLossCheckbox);
ypos += lineHeight + 4;
// Use dirty rectangle merging
myDirtyRectCheckbox = new CheckboxWidget(this, font, xpos + 5, ypos,
"Dirty-rect merging");
wid.push_back(myDirtyRectCheckbox);
ypos += lineHeight + 4;
// Use desktop res in OpenGL // Use desktop res in OpenGL
myUseDeskResCheckbox = new CheckboxWidget(this, font, xpos + 5, ypos, myUseDeskResCheckbox = new CheckboxWidget(this, font, xpos + 5, ypos,
"Desktop Res in FS"); "Desktop Res in FS");
@ -138,7 +151,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
// Use sync to vblank in OpenGL // Use sync to vblank in OpenGL
myUseVSyncCheckbox = new CheckboxWidget(this, font, xpos + 5, ypos, myUseVSyncCheckbox = new CheckboxWidget(this, font, xpos + 5, ypos,
"Enable VSync"); "GL VSync");
wid.push_back(myUseVSyncCheckbox); wid.push_back(myUseVSyncCheckbox);
ypos += lineHeight + 20; ypos += lineHeight + 20;
@ -178,17 +191,10 @@ void VideoDialog::loadConfig()
int i; int i;
double f; double f;
// Driver setting
b = instance()->settings().getBool("dirtyrects");
i = b ? 1 : 2;
myDirtyPopup->setSelectedTag(i);
// Renderer setting // Renderer setting
s = instance()->settings().getString("video"); s = instance()->settings().getString("video");
if(s == "soft") myRendererPopup->setSelectedTag(1); if(s == "soft") myRendererPopup->setSelectedTag(1);
else if(s == "hard") myRendererPopup->setSelectedTag(2); else if(s == "gl") myRendererPopup->setSelectedTag(2);
else if(s == "gl") myRendererPopup->setSelectedTag(3);
else myRendererPopup->setSelectedTag(1);
// Filter setting // Filter setting
s = instance()->settings().getString("gl_filter"); s = instance()->settings().getString("gl_filter");
@ -198,16 +204,8 @@ void VideoDialog::loadConfig()
// Aspect ratio - another huge hack // Aspect ratio - another huge hack
s = instance()->settings().getString("gl_aspect"); s = instance()->settings().getString("gl_aspect");
f = instance()->settings().getFloat("gl_aspect"); f = instance()->settings().getFloat("gl_aspect");
if(f < 1.1) if(f < 1.1) { f = 1.1; s = "1.1"; }
{ else if(f > 2.0) { f = 2.0; s = "2.0"; }
f = 1.1;
s = "1.1";
}
else if(f > 2.0)
{
f = 2.0;
s = "2.0";
}
i = (int)((f * 10) - 10) * 10; i = (int)((f * 10) - 10) * 10;
myAspectRatioSlider->setValue(i); myAspectRatioSlider->setValue(i);
myAspectRatioLabel->setLabel(s); myAspectRatioLabel->setLabel(s);
@ -219,30 +217,51 @@ void VideoDialog::loadConfig()
else if(s == "z26") myPalettePopup->setSelectedTag(3); else if(s == "z26") myPalettePopup->setSelectedTag(3);
else if(s == "user") myPalettePopup->setSelectedTag(4); else if(s == "user") myPalettePopup->setSelectedTag(4);
// Scaler // TIA Scaler
s = instance()->settings().getString("scale_tia"); s = instance()->settings().getString("scale_tia");
if(s == "zoom1x") myScalerPopup->setSelectedTag(1); if(s == "zoom1x") myTIAScalerPopup->setSelectedTag(1);
else if(s == "zoom2x") myScalerPopup->setSelectedTag(2); else if(s == "zoom2x") myTIAScalerPopup->setSelectedTag(2);
else if(s == "zoom3x") myScalerPopup->setSelectedTag(3); else if(s == "zoom3x") myTIAScalerPopup->setSelectedTag(3);
else if(s == "zoom4x") myScalerPopup->setSelectedTag(4); else if(s == "zoom4x") myTIAScalerPopup->setSelectedTag(4);
else if(s == "zoom5x") myScalerPopup->setSelectedTag(5); else if(s == "zoom5x") myTIAScalerPopup->setSelectedTag(5);
else if(s == "zoom6x") myScalerPopup->setSelectedTag(6); else if(s == "zoom6x") myTIAScalerPopup->setSelectedTag(6);
else myScalerPopup->setSelectedTag(0); else myTIAScalerPopup->setSelectedTag(0);
// UI Scaler
s = instance()->settings().getString("scale_ui");
if(s == "zoom1x") myUIScalerPopup->setSelectedTag(1);
else if(s == "zoom2x") myUIScalerPopup->setSelectedTag(2);
else if(s == "zoom3x") myUIScalerPopup->setSelectedTag(3);
else if(s == "zoom4x") myUIScalerPopup->setSelectedTag(4);
else if(s == "zoom5x") myUIScalerPopup->setSelectedTag(5);
else if(s == "zoom6x") myUIScalerPopup->setSelectedTag(6);
else myUIScalerPopup->setSelectedTag(0);
// FIXME - what to do with this??
myFrameRateSlider->setEnabled(false);
// Fullscreen // Fullscreen
b = instance()->settings().getBool("fullscreen"); b = instance()->settings().getBool("fullscreen");
myFullscreenCheckbox->setState(b); myFullscreenCheckbox->setState(b);
// Use desktop resolution in fullscreen mode // PAL color-loss effect
b = instance()->settings().getBool("colorloss");
myColorLossCheckbox->setState(b);
// Dirty-rect merging (software mode only)
b = instance()->settings().getBool("dirtyrects");
myDirtyRectCheckbox->setState(b);
// Use desktop resolution in fullscreen mode (GL mode only)
b = instance()->settings().getBool("gl_fsmax"); b = instance()->settings().getBool("gl_fsmax");
myUseDeskResCheckbox->setState(b); myUseDeskResCheckbox->setState(b);
// Use sync to vertical blank // Use sync to vertical blank (GL mode only)
b = instance()->settings().getBool("gl_vsync"); b = instance()->settings().getBool("gl_vsync");
myUseVSyncCheckbox->setState(b); myUseVSyncCheckbox->setState(b);
// Make sure that mutually-exclusive items are not enabled at the same time // Make sure that mutually-exclusive items are not enabled at the same time
i = myRendererPopup->getSelectedTag() - 1; i = myRendererPopup->getSelectedTag();
handleRendererChange(i); handleRendererChange(i);
} }
@ -251,45 +270,23 @@ void VideoDialog::saveConfig()
{ {
string s; string s;
int i; int i;
bool b, restart = false; bool b;
// Dirty rectangle updates
i = myDirtyPopup->getSelectedTag();
b = (i == 1) ? 1 : 0;
if(b != instance()->settings().getBool("dirtyrects"))
{
instance()->settings().setBool("dirtyrects", b);
restart = true;
}
// Renderer setting // Renderer setting
i = myRendererPopup->getSelectedTag(); i = myRendererPopup->getSelectedTag();
if(i == 1) s = "soft"; if(i == 1) s = "soft";
else if(i == 2) s = "hard"; else if(i == 2) s = "gl";
else if(i == 3) s = "gl";
if(s != instance()->settings().getString("video"))
{
instance()->settings().setString("video", s); instance()->settings().setString("video", s);
restart = true;
}
// Filter setting // Filter setting
i = myFilterPopup->getSelectedTag(); i = myFilterPopup->getSelectedTag();
if(i == 1) s = "linear"; if(i == 1) s = "linear";
else if(i == 2) s = "nearest"; else if(i == 2) s = "nearest";
if(s != instance()->settings().getString("gl_filter"))
{
instance()->settings().setString("gl_filter", s); instance()->settings().setString("gl_filter", s);
restart = true;
}
// Aspect ratio // Aspect ratio
s = myAspectRatioLabel->getLabel(); s = myAspectRatioLabel->getLabel();
if(s != instance()->settings().getString("gl_aspect"))
{
instance()->settings().setString("gl_aspect", s); instance()->settings().setString("gl_aspect", s);
restart = true;
}
// Palette // Palette
i = myPalettePopup->getSelectedTag(); i = myPalettePopup->getSelectedTag();
@ -298,64 +295,68 @@ void VideoDialog::saveConfig()
else if(i == 3) s = "z26"; else if(i == 3) s = "z26";
else if(i == 4) s = "user"; else if(i == 4) s = "user";
instance()->settings().setString("palette", s); instance()->settings().setString("palette", s);
instance()->console().setPalette(s);
// Scaler // TIA Scaler
i = myScalerPopup->getSelectedTag(); i = myTIAScalerPopup->getSelectedTag();
if(i == 1) s = "zoom1x"; if(i == 1) s = "zoom1x";
else if(i == 2) s = "zoom2x"; else if(i == 2) s = "zoom2x";
else if(i == 3) s = "zoom3x"; else if(i == 3) s = "zoom3x";
else if(i == 4) s = "zoom4x"; else if(i == 4) s = "zoom4x";
else if(i == 5) s = "zoom5x"; else if(i == 5) s = "zoom5x";
else if(i == 6) s = "zoom6x"; else if(i == 6) s = "zoom6x";
if(s != instance()->settings().getString("scale_tia"))
{
instance()->settings().setString("scale_tia", s); instance()->settings().setString("scale_tia", s);
restart = true;
}
// Framerate // UI Scaler
i = myUIScalerPopup->getSelectedTag();
if(i == 1) s = "zoom1x";
else if(i == 2) s = "zoom2x";
else if(i == 3) s = "zoom3x";
else if(i == 4) s = "zoom4x";
else if(i == 5) s = "zoom5x";
else if(i == 6) s = "zoom6x";
instance()->settings().setString("scale_ui", s);
// Framerate FIXME - I haven't figured out what to do with this yet
/*
i = myFrameRateSlider->getValue(); i = myFrameRateSlider->getValue();
if(i > 0) if(i > 0)
instance()->setFramerate(i); instance()->setFramerate(i);
*/
// Fullscreen (the setFullscreen method takes care of updating settings) // Fullscreen
b = myFullscreenCheckbox->getState(); b = myFullscreenCheckbox->getState();
instance()->frameBuffer().setFullscreen(b); instance()->settings().setBool("fullscreen", b);
// Use desktop resolution in fullscreen mode // PAL color-loss effect
b = myColorLossCheckbox->getState();
instance()->settings().setBool("colorloss", b);
// Dirty rectangle merging (software mode only)
b = myDirtyRectCheckbox->getState();
instance()->settings().setBool("dirtyrects", b);
// Use desktop resolution in fullscreen mode (GL mode only)
b = myUseDeskResCheckbox->getState(); b = myUseDeskResCheckbox->getState();
if(b != instance()->settings().getBool("gl_fsmax"))
{
instance()->settings().setBool("gl_fsmax", b); instance()->settings().setBool("gl_fsmax", b);
restart = true;
}
// Use sync to vertical blank // Use sync to vertical blank (GL mode only)
b = myUseVSyncCheckbox->getState(); b = myUseVSyncCheckbox->getState();
if(b != instance()->settings().getBool("gl_vsync"))
{
instance()->settings().setBool("gl_vsync", b); instance()->settings().setBool("gl_vsync", b);
restart = true;
}
// Finally, issue a complete framebuffer re-initialization // Finally, issue a complete framebuffer re-initialization
// Not all options may require a full re-initialization, so we only instance()->createFrameBuffer(false);
// do it when necessary
if(restart)
instance()->createFrameBuffer();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::setDefaults() void VideoDialog::setDefaults()
{ {
myDirtyPopup->setSelectedTag(1);
myRendererPopup->setSelectedTag(1); myRendererPopup->setSelectedTag(1);
myFilterPopup->setSelectedTag(1); myFilterPopup->setSelectedTag(1);
myPalettePopup->setSelectedTag(1); myPalettePopup->setSelectedTag(1);
myScalerPopup->setSelectedTag(1); myTIAScalerPopup->setSelectedTag(2);
myFrameRateSlider->setValue(0); myUIScalerPopup->setSelectedTag(2);
myFrameRateLabel->setLabel("0"); // myFrameRateSlider->setValue(0);
// myFrameRateLabel->setLabel("0");
// For some unknown reason (ie, a bug), slider widgets can only // For some unknown reason (ie, a bug), slider widgets can only
// take certain ranges of numbers. So we have to fudge things ... // take certain ranges of numbers. So we have to fudge things ...
@ -363,27 +364,31 @@ void VideoDialog::setDefaults()
myAspectRatioLabel->setLabel("2.0"); myAspectRatioLabel->setLabel("2.0");
myFullscreenCheckbox->setState(false); myFullscreenCheckbox->setState(false);
myColorLossCheckbox->setState(false);
myDirtyRectCheckbox->setState(false);
myUseDeskResCheckbox->setState(true); myUseDeskResCheckbox->setState(true);
myUseVSyncCheckbox->setState(true); myUseVSyncCheckbox->setState(true);
// Make sure that mutually-exclusive items are not enabled at the same time // Make sure that mutually-exclusive items are not enabled at the same time
handleRendererChange(0); // 0 indicates software mode handleRendererChange(1); // 1 indicates software mode
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handleRendererChange(int item) void VideoDialog::handleRendererChange(int item)
{ {
// When we're in software mode, certain OpenGL-related options are disabled // When we're in software mode, certain OpenGL-related options are disabled
bool active = (item == 0 || item == 1) ? false : true; bool gl = (item > 1) ? true : false;
myFilterPopup->setEnabled(active); myFilterPopup->setEnabled(gl);
myAspectRatioSlider->setEnabled(active); myAspectRatioSlider->setEnabled(gl);
myAspectRatioLabel->setEnabled(active); myAspectRatioLabel->setEnabled(gl);
myUseDeskResCheckbox->setEnabled(active); myUseDeskResCheckbox->setEnabled(gl);
myUseVSyncCheckbox->setEnabled(active); myUseVSyncCheckbox->setEnabled(gl);
// Also, in OpenGL mode, certain software related items are disabled // Also, in OpenGL mode, certain software related items are disabled
myDirtyPopup->setEnabled(!active); myDirtyRectCheckbox->setEnabled(!gl);
_dirty = true;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: VideoDialog.hxx,v 1.17 2006-12-28 20:40:01 stephena Exp $ // $Id: VideoDialog.hxx,v 1.18 2006-12-30 22:26:29 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -49,16 +49,19 @@ class VideoDialog : public Dialog
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id); virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
private: private:
PopUpWidget* myDirtyPopup;
PopUpWidget* myRendererPopup; PopUpWidget* myRendererPopup;
PopUpWidget* myFilterPopup; PopUpWidget* myFilterPopup;
SliderWidget* myAspectRatioSlider; SliderWidget* myAspectRatioSlider;
StaticTextWidget* myAspectRatioLabel; StaticTextWidget* myAspectRatioLabel;
PopUpWidget* myPalettePopup; PopUpWidget* myPalettePopup;
PopUpWidget* myTIAScalerPopup;
PopUpWidget* myUIScalerPopup;
SliderWidget* myFrameRateSlider; SliderWidget* myFrameRateSlider;
StaticTextWidget* myFrameRateLabel; StaticTextWidget* myFrameRateLabel;
PopUpWidget* myScalerPopup;
CheckboxWidget* myFullscreenCheckbox; CheckboxWidget* myFullscreenCheckbox;
CheckboxWidget* myColorLossCheckbox;
CheckboxWidget* myDirtyRectCheckbox;
CheckboxWidget* myUseDeskResCheckbox; CheckboxWidget* myUseDeskResCheckbox;
CheckboxWidget* myUseVSyncCheckbox; CheckboxWidget* myUseVSyncCheckbox;

View File

@ -11,6 +11,7 @@ MODULE_OBJS := \
src/gui/EditableWidget.o \ src/gui/EditableWidget.o \
src/gui/EditTextWidget.o \ src/gui/EditTextWidget.o \
src/gui/EventMappingWidget.o \ src/gui/EventMappingWidget.o \
src/gui/FileSnapDialog.o \
src/gui/Font.o \ src/gui/Font.o \
src/gui/GameInfoDialog.o \ src/gui/GameInfoDialog.o \
src/gui/GameList.o \ src/gui/GameList.o \
@ -19,7 +20,6 @@ MODULE_OBJS := \
src/gui/InputTextDialog.o \ src/gui/InputTextDialog.o \
src/gui/Launcher.o \ src/gui/Launcher.o \
src/gui/LauncherDialog.o \ src/gui/LauncherDialog.o \
src/gui/LauncherOptionsDialog.o \
src/gui/ListWidget.o \ src/gui/ListWidget.o \
src/gui/Menu.o \ src/gui/Menu.o \
src/gui/OptionsDialog.o \ src/gui/OptionsDialog.o \