Oops, forgot to add UI objects to change fullscreen resolution.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1325 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2007-06-21 12:27:00 +00:00
parent 66eff3b9d8
commit 7e5d519234
8 changed files with 122 additions and 70 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: DebuggerDialog.cxx,v 1.18 2007-01-01 18:04:43 stephena Exp $ // $Id: DebuggerDialog.cxx,v 1.19 2007-06-21 12:27:00 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
@ -293,5 +293,5 @@ void DebuggerDialog::doScanlineAdvance()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doExit() void DebuggerDialog::doExit()
{ {
instance()->debugger().quit(); instance()->debugger().parser()->run("run");
} }

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: PromptWidget.cxx,v 1.15 2007-01-01 18:04:44 stephena Exp $ // $Id: PromptWidget.cxx,v 1.16 2007-06-21 12:27:00 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
@ -166,7 +166,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
int i; int i;
bool handled = true; bool handled = true;
bool dirty = false; bool dirty = false;
switch(ascii) switch(ascii)
{ {
case '\n': // enter/return case '\n': // enter/return
@ -188,7 +188,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
addToHistory(command.c_str()); addToHistory(command.c_str());
// Pass the command to the debugger, and print the result // Pass the command to the debugger, and print the result
print( instance()->debugger().run(command) + "\n"); string result = instance()->debugger().run(command) + "\n";
print( result );
} }
printPrompt(); printPrompt();
@ -202,7 +203,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
// both at once. // both at once.
if(_currentPos <= _promptStartPos) if(_currentPos <= _promptStartPos)
break; break;
scrollToCurrent(); scrollToCurrent();
int len = _promptEndPos - _promptStartPos; int len = _promptEndPos - _promptStartPos;
@ -211,12 +212,14 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
char delimiter = '\0'; char delimiter = '\0';
char *str = new char[len + 1]; char *str = new char[len + 1];
for (i = 0; i < len; i++) { for (i = 0; i < len; i++)
str[i] = buffer(_promptStartPos + i) & 0x7f; {
if(strchr("*@<> ", str[i]) != NULL ) { str[i] = buffer(_promptStartPos + i) & 0x7f;
lastDelimPos = i; if(strchr("*@<> ", str[i]) != NULL )
delimiter = str[i]; {
} lastDelimPos = i;
delimiter = str[i];
}
} }
str[len] = '\0'; str[len] = '\0';
@ -224,60 +227,66 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
const char *prefix; const char *prefix;
int possibilities; int possibilities;
if(lastDelimPos < 0) { if(lastDelimPos < 0)
// no delimiters, do command completion: {
DebuggerParser *parser = instance()->debugger().parser(); // no delimiters, do command completion:
possibilities = parser->countCompletions(str); DebuggerParser *parser = instance()->debugger().parser();
possibilities = parser->countCompletions(str);
if(possibilities < 1) { if(possibilities < 1) {
delete[] str; delete[] str;
break; break;
} }
completionList = parser->getCompletions(); completionList = parser->getCompletions();
prefix = parser->getCompletionPrefix(); prefix = parser->getCompletionPrefix();
} else { }
// we got a delimiter, so this must be a label: else
EquateList *equates = instance()->debugger().equates(); {
possibilities = equates->countCompletions(str + lastDelimPos + 1); // we got a delimiter, so this must be a label:
EquateList *equates = instance()->debugger().equates();
possibilities = equates->countCompletions(str + lastDelimPos + 1);
if(possibilities < 1) { if(possibilities < 1) {
delete[] str; delete[] str;
break; break;
} }
completionList = equates->getCompletions(); completionList = equates->getCompletions();
prefix = equates->getCompletionPrefix(); prefix = equates->getCompletionPrefix();
} }
if(possibilities == 1) { if(possibilities == 1)
// add to buffer as though user typed it (plus a space) {
_currentPos = _promptStartPos + lastDelimPos + 1; // add to buffer as though user typed it (plus a space)
while(*completionList != '\0') { _currentPos = _promptStartPos + lastDelimPos + 1;
putcharIntern(*completionList++); while(*completionList != '\0')
} putcharIntern(*completionList++);
putcharIntern(' ');
_promptEndPos = _currentPos;
} else {
nextLine();
// add to buffer as-is, then add PROMPT plus whatever we have so far
_currentPos = _promptStartPos + lastDelimPos + 1;
print("\n"); putcharIntern(' ');
print(completionList); _promptEndPos = _currentPos;
print("\n"); }
print(PROMPT); else
{
nextLine();
// add to buffer as-is, then add PROMPT plus whatever we have so far
_currentPos = _promptStartPos + lastDelimPos + 1;
_promptStartPos = _currentPos; print("\n");
print(completionList);
print("\n");
print(PROMPT);
for(i=0; i<lastDelimPos; i++) _promptStartPos = _currentPos;
putcharIntern(str[i]);
if(lastDelimPos > 0) for(i=0; i<lastDelimPos; i++)
putcharIntern(delimiter); putcharIntern(str[i]);
print(prefix); if(lastDelimPos > 0)
_promptEndPos = _currentPos; putcharIntern(delimiter);
print(prefix);
_promptEndPos = _currentPos;
} }
delete[] str; delete[] str;
dirty = true; dirty = true;
@ -639,7 +648,7 @@ void PromptWidget::addToHistory(const char *str)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int PromptWidget::compareHistory(const char *histLine) { int PromptWidget::compareHistory(const char *histLine) {
return 1; return 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: M6532.cxx,v 1.9 2007-01-01 18:04:48 stephena Exp $ // $Id: M6532.cxx,v 1.10 2007-06-21 12:27:00 stephena Exp $
//============================================================================ //============================================================================
#include <assert.h> #include <assert.h>
@ -238,6 +238,7 @@ void M6532::poke(uInt16 addr, uInt8 value)
else if((addr & 0x07) == 0x01) // Port A Data Direction Register else if((addr & 0x07) == 0x01) // Port A Data Direction Register
{ {
myDDRA = value; myDDRA = value;
#ifdef ATARIVOX_SUPPORT
/* /*
20060608 bkw: Not the most elegant thing in the world... 20060608 bkw: Not the most elegant thing in the world...
When a bit in the DDR is set as input, +5V is placed on its output When a bit in the DDR is set as input, +5V is placed on its output
@ -262,6 +263,7 @@ void M6532::poke(uInt16 addr, uInt8 value)
c.write(Controller::Three, !(value & 0x04)); c.write(Controller::Three, !(value & 0x04));
c.write(Controller::Four, !(value & 0x08)); c.write(Controller::Four, !(value & 0x08));
} }
#endif
} }
else if((addr & 0x07) == 0x02) // Port B I/O Register (Console switches) else if((addr & 0x07) == 0x02) // Port B I/O Register (Console switches)
{ {

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.52 2007-06-20 16:33:23 stephena Exp $ // $Id: OptionsDialog.cxx,v 1.53 2007-06-21 12:27:00 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,7 +107,7 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
int x = 0, y = 0, 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 = 150; w = 230; h = 165;
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;

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.32 2007-01-01 18:04:54 stephena Exp $ // $Id: PopUpWidget.cxx,v 1.33 2007-06-21 12:27:00 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
@ -509,6 +509,19 @@ void PopUpWidget::setSelected(int item)
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PopUpWidget::setSelectedName(const string& name)
{
for(unsigned int item = 0; item < _entries.size(); ++item)
{
if(_entries[item].name == name)
{
setSelected(item);
return;
}
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PopUpWidget::setSelectedTag(int tag) void PopUpWidget::setSelectedTag(int tag)
{ {
@ -522,6 +535,12 @@ void PopUpWidget::setSelectedTag(int tag)
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PopUpWidget::setSelectedMax()
{
setSelected(_entries.size() - 1);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PopUpWidget::drawWidget(bool hilite) void PopUpWidget::drawWidget(bool hilite)
{ {

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.17 2007-01-01 18:04:54 stephena Exp $ // $Id: PopUpWidget.hxx,v 1.18 2007-06-21 12:27:00 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
@ -72,9 +72,15 @@ class PopUpWidget : public Widget, public CommandSender
/** Select the entry at the given index. */ /** Select the entry at the given index. */
void setSelected(int item); void setSelected(int item);
/** Select the first entry matching the given name. */
void setSelectedName(const string& name);
/** Select the first entry matching the given tag. */ /** Select the first entry matching the given tag. */
void setSelectedTag(int tag); void setSelectedTag(int tag);
/** Select the highest/last entry in the internal list. */
void setSelectedMax();
int getSelected() const int getSelected() const
{ return _selectedItem; } { return _selectedItem; }
int getSelectedTag() const int getSelectedTag() const

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.43 2007-06-20 16:33:23 stephena Exp $ // $Id: VideoDialog.cxx,v 1.44 2007-06-21 12:27:00 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
@ -86,6 +86,14 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
wid.push_back(myPalettePopup); wid.push_back(myPalettePopup);
ypos += lineHeight + 4; ypos += lineHeight + 4;
// Fullscreen resolution
myFSResPopup = new PopUpWidget(this, font, xpos, ypos, pwidth,
lineHeight, "FS Res: ", lwidth);
for(uInt32 i = 0; i < instance()->supportedResolutions().size(); ++i)
myFSResPopup->appendEntry(instance()->supportedResolutions()[i].name, i+1);
wid.push_back(myFSResPopup);
ypos += lineHeight + 4;
// Available UI zoom levels // Available UI zoom levels
myUIZoomSlider = new SliderWidget(this, font, xpos, ypos, pwidth, lineHeight, myUIZoomSlider = new SliderWidget(this, font, xpos, ypos, pwidth, lineHeight,
"UI Zoom: ", lwidth, kUIZoomChanged); "UI Zoom: ", lwidth, kUIZoomChanged);
@ -229,6 +237,12 @@ 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);
// Fullscreen resolution
s = instance()->settings().getString("fullres");
myFSResPopup->setSelectedName(s);
if(myFSResPopup->getSelectedTag() < 0)
myFSResPopup->setSelectedMax();
// UI zoom level // UI zoom level
s = instance()->settings().getString("zoom_ui"); s = instance()->settings().getString("zoom_ui");
i = instance()->settings().getInt("zoom_ui"); i = instance()->settings().getInt("zoom_ui");
@ -293,12 +307,6 @@ void VideoDialog::saveConfig()
else if(i == 4) s = "always"; else if(i == 4) s = "always";
instance()->settings().setString("gl_fsmax", s); instance()->settings().setString("gl_fsmax", s);
/*
// Aspect ratio
s = myAspectRatioLabel->getLabel();
instance()->settings().setString("gl_aspect", s);
*/
// Palette // Palette
i = myPalettePopup->getSelectedTag(); i = myPalettePopup->getSelectedTag();
if(i == 1) s = "standard"; if(i == 1) s = "standard";
@ -307,6 +315,10 @@ void VideoDialog::saveConfig()
else if(i == 4) s = "user"; else if(i == 4) s = "user";
instance()->settings().setString("palette", s); instance()->settings().setString("palette", s);
// Fullscreen resolution
s = myFSResPopup->getSelectedString();
instance()->settings().setString("fullres", s);
// UI Scaler // UI Scaler
s = myUIZoomLabel->getLabel(); s = myUIZoomLabel->getLabel();
instance()->settings().setString("zoom_ui", s); instance()->settings().setString("zoom_ui", s);
@ -349,6 +361,7 @@ void VideoDialog::setDefaults()
myFilterPopup->setSelectedTag(1); myFilterPopup->setSelectedTag(1);
myFSStretchPopup->setSelectedTag(1); myFSStretchPopup->setSelectedTag(1);
myPalettePopup->setSelectedTag(1); myPalettePopup->setSelectedTag(1);
myFSResPopup->setSelectedMax();
myUIZoomSlider->setValue(2); myUIZoomSlider->setValue(2);
myUIZoomLabel->setLabel("2"); myUIZoomLabel->setLabel("2");
myTIAZoomSlider->setValue(2); myTIAZoomSlider->setValue(2);
@ -386,6 +399,8 @@ void VideoDialog::handleRendererChange(int item)
void VideoDialog::handleFullscreenChange(bool enable) void VideoDialog::handleFullscreenChange(bool enable)
{ {
#ifdef WINDOWED_SUPPORT #ifdef WINDOWED_SUPPORT
myFSResPopup->setEnabled(enable);
myUIZoomSlider->setEnabled(!enable); myUIZoomSlider->setEnabled(!enable);
myUIZoomLabel->setEnabled(!enable); myUIZoomLabel->setEnabled(!enable);
myTIAZoomSlider->setEnabled(!enable); myTIAZoomSlider->setEnabled(!enable);

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.20 2007-06-20 16:33:23 stephena Exp $ // $Id: VideoDialog.hxx,v 1.21 2007-06-21 12:27:00 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
@ -54,6 +54,7 @@ class VideoDialog : public Dialog
PopUpWidget* myFilterPopup; PopUpWidget* myFilterPopup;
PopUpWidget* myFSStretchPopup; PopUpWidget* myFSStretchPopup;
PopUpWidget* myPalettePopup; PopUpWidget* myPalettePopup;
PopUpWidget* myFSResPopup;
SliderWidget* myUIZoomSlider; SliderWidget* myUIZoomSlider;
StaticTextWidget* myUIZoomLabel; StaticTextWidget* myUIZoomLabel;
SliderWidget* myTIAZoomSlider; SliderWidget* myTIAZoomSlider;